Эх сурвалжийг харах

Merge remote-tracking branch 'origin/V1.0.11' into V1.0.11

jingyuanchao 11 сар өмнө
parent
commit
a2b9d8b7e3

+ 16 - 3
src/views/iot/diagnoseMission/dialog.bindMission.vue

@@ -117,9 +117,22 @@ export default {
       this.$refs.form.validate(async (isValidate) => {
         if (!isValidate) return;
         this.queryParams.bindMissionId = this.formData.bindMissionId;
-        await bindMission(this.queryParams);
-        this.$emit("success");
-        this.isShow = false;
+
+        const param = this.queryParams;
+
+        this.$modal
+        .confirm("添加符合当前筛选条件的设备到选定的诊断任务,取消和其他任务的关联,确定?")
+        .then(function () {
+          return bindMission(param);
+        })
+        .then(() => {
+          this.$modal.msgSuccess("绑定成功");
+          this.$emit("success");
+          this.isShow = false;
+        })
+        .catch(() => {
+        });
+
       });
     },
   },

+ 14 - 6
src/views/iot/diagnoseMission/indexCamera.vue

@@ -81,7 +81,7 @@
                   type="primary"
                   icon="el-icon-refresh"
                   size="mini"
-                  @click="unbindMission()"
+                  @click="unbind()"
                   >解绑任务
                 </el-button>
               </el-col>
@@ -305,11 +305,19 @@ export default {
       this.$refs["bindMissionDialog"].show(this.queryParams, this.deviceTypes);
     },
     /** 解绑任务 */
-    unbindMission() {
-      this.loading = true;
-      unbindMission(this.queryParams).then((response) => {
-           this.loading = false;
-           this.getList();
+    unbind() {
+      const param = this.queryParams;
+
+      this.$modal
+      .confirm("解绑符合当前筛选条件的设备的诊断任务,不可恢复,确定执行?")
+      .then(function () {
+        return unbindMission(param);
+      })
+      .then(() => {
+        this.$modal.msgSuccess("解绑成功");
+        this.getList();
+      })
+      .catch(() => {
       });
     },
 

+ 3 - 1
src/views/iot/diagnoseThreshold/dialog.addThreshold.vue

@@ -18,7 +18,7 @@
             <el-col :span="19">
               <el-form-item  prop="timeRange" label="有效时段">
                 <el-time-picker style="width:100%"  v-model="formData.timeRange" value-format="HH:mm:ss"
-                               is-range  start-placeholder="开始时间" end-placeholder="结束时间" @change="startDateChanged">
+                               is-range  start-placeholder="开始时间" end-placeholder="结束时间">
                 </el-time-picker>
               </el-form-item>
             </el-col>
@@ -100,6 +100,7 @@ export default {
     ...mapMutations([]),
     reset() {
       return {
+        thresholdId: null,
         thresholdCode: null,
         thresholdName: null,
         timeRange: ['00:00:00', '23:59:59'],
@@ -112,6 +113,7 @@ export default {
       this.isEdit=false;
       if (param.thresholdCode){
         this.formData = {
+                thresholdId: param.thresholdId,
                 thresholdCode: param.thresholdCode,
                 thresholdName: param.thresholdName,
                 timeRange: [param.beginTime,param.endTime],

+ 16 - 3
src/views/iot/diagnoseThreshold/dialog.bindThreshold.vue

@@ -118,9 +118,22 @@ export default {
       this.$refs.form.validate(async (isValidate) => {
         if (!isValidate) return;
         this.queryParams.bindThresholdCodes = this.formData.bindThresholdCodes;
-        await bindThreshold(this.queryParams);
-        this.$emit("success");
-        this.isShow = false;
+
+        const param = this.queryParams;
+
+        this.$modal
+        .confirm("添加符合当前筛选条件的设备到选定的诊断阈值,确定?")
+        .then(function () {
+          return bindThreshold(param);
+        })
+        .then(() => {
+          this.$modal.msgSuccess("绑定成功");
+          this.$emit("success");
+          this.isShow = false;
+        })
+        .catch(() => {
+        });
+
       });
     },
   },

+ 17 - 5
src/views/iot/diagnoseThreshold/dialog.unbindThreshold.vue

@@ -116,11 +116,23 @@ export default {
     },
     onSubmit() {
       this.$refs.form.validate(async (isValidate) => {
-        if (!isValidate) return;
-        this.queryParams.bindThresholdCodes = this.formData.bindThresholdCodes;
-        await unbindThreshold(this.queryParams);
-        this.$emit("success");
-        this.isShow = false;
+         if (!isValidate) return;
+         this.queryParams.bindThresholdCodes = this.formData.bindThresholdCodes;
+
+         const param = this.queryParams;
+         this.$modal
+         .confirm("解绑符合当前筛选条件的设备选定的诊断阈值,不可恢复,确定执行?")
+         .then(function () {
+           return unbindThreshold(param);
+         })
+         .then(() => {
+           this.$modal.msgSuccess("解绑成功");
+           this.$emit("success");
+           this.isShow = false;
+         })
+         .catch(() => {
+         });
+
       });
     },
   },