zhangzengfei
2023-08-30 b2d0ac2db80c08783fd848933230618cc30d76a2
src/views/hashrate/CameraManage/CameraRules/components/TimeSlider.vue
@@ -64,7 +64,7 @@
      </div>
    </div>
    <div class="control">
      <div class="button editBtn" @click="edit = !edit">
      <div class="button editBtn" @click="editOrSave">
        {{ edit ? "锁定" : "编辑" }}
      </div>
      <div class="button addBtn" @click="handleTabsEdit('', 'add')">
@@ -84,10 +84,10 @@
      </TimeSliderItem>
    </div>
    <div class="btns">
    <!-- <div class="btns">
      <div class="cancelBtn button" @click="close">取消</div>
      <div class="confirmBtn button" @click="save">确定</div>
    </div>
    </div> -->
  </div>
</template>
@@ -174,8 +174,6 @@
              repeat = true
            }
          })
          console.log("aaa")
          console.log(repeat)
          if (repeat) {
            this.$notify({
              message: "名称不能重复",
@@ -221,6 +219,7 @@
                }
              }
              this.isAdding = false
              this.edit = true
            })
            .catch(() => {
              this.$notify({
@@ -272,12 +271,10 @@
    windowSizeChange() {
      let timeSlideWidth = document.querySelector(".sub-time-box").clientWidth
      this.cavasLength = timeSlideWidth
      console.log("时间组件宽度:", timeSlideWidth)
    },
    updateTimeRule(rule) {
      saveTimeRule(rule)
        .then(async (rsp) => {
          console.log(rsp, "rrr1333331rrrrrrrrrrrrr")
          if (rsp && rsp.success) {
            await this.VideoManageData.getTimeRule()
            this.isAdding = false
@@ -319,7 +316,6 @@
    save() {
      saveTimeRule(this.activeTabObj)
        .then(async (rsp) => {
          console.log(rsp, "rrr112222rrrrrrrrrrrrr")
          if (rsp && rsp.success) {
            this.$notify({
              type: "success",
@@ -332,6 +328,14 @@
        .catch(() => {
          this.isAdding = false
        })
    },
    editOrSave() {
      this.edit = !this.edit
      // console.log(this.edit, "this.edit")
      if (!this.edit) {
        // 锁定
        this.save()
      }
    }
  }
}