cuiqian2004
4 天以前 2af5f043b60c1f7ac38ecccc8f5bf44743134325
pages/task/map-task.vue
@@ -238,7 +238,12 @@
            })
         },
         clickDelSetTask(item) {
            showModal("确认删除任务设置", "警告").then((res) => {
            showModal({
               title: this.translate('ask_confirm_delete'),
               content: `${this.translate('history_task_will_be_retained')}`,
               confirmText: this.translate('delete'),
               cancelText: this.translate('cancel'),
            }).then((res) => {
               if (res) {
                  const list = this.setList
                  const index = list.findIndex((a) => {
@@ -269,23 +274,21 @@
                  []
               ]
               this.deleteX[root][index] = old; // 重置偏移量
            } else
            {
            } else {
               this.deleteX = [
                  [],
                  []
               ]
               this.deleteX[root][index] = 0; // 重置偏移量
            }
         },
         touchMove(event, root, index) {
            const moveX = event.touches[0].pageX - this.startX;
            if (moveX < 0) {
               this.deleteX[root][index] = moveX; // 左滑时更新偏移量
            }
            else if (moveX > 0) {
               this.deleteX[root][index] =0
            } else if (moveX > 0) {
               this.deleteX[root][index] = 0
            }
         },
         touchEnd(event, root, index) {
@@ -295,7 +298,10 @@
               this.deleteX[root][index] = 0; // 否则恢复原位
            }
         },
         translate(t) {
            if (typeof this.$t == "function") return this.$t(`page.${t}`)
            else return t;
         },
      }
   }