Kaynağa Gözat

视频诊断编辑会清空列表页数据,bug修复

humingshi-7@163.com 11 ay önce
ebeveyn
işleme
59f25b1177

+ 10 - 5
src/views/iot/diagnoseMission/dialog.addMission.vue

@@ -80,9 +80,7 @@ import dayjs from "dayjs";
 export default {
   components: {},
   data() {
-    const params = this.$route.params;
     return {
-      missionId: params ? params.missionId : null,
       isShow: false,
       title: '',
       formData: this.reset(),
@@ -123,11 +121,18 @@ export default {
         enabled: 1,
       };
     },
-    async show(formData) {
+    async show(param) {
       this.title = '新增任务';
       this.isEdit=false;
-      if (formData.missionId){
-        this.formData = formData;
+      if (param.missionId){
+        this.formData = {
+            missionId: param.missionId,
+            name: param.name,
+            beginTime: param.beginTime,
+            endTime: param.endTime,
+            cycle:param.cycle,
+            enabled: param.enabled
+        };
         this.title = '编辑任务';
         this.isEdit=true;
       }

+ 9 - 6
src/views/iot/diagnoseThreshold/dialog.addThreshold.vue

@@ -65,9 +65,7 @@ import dayjs from "dayjs";
 export default {
   components: {},
   data() {
-    const params = this.$route.params;
     return {
-      missionId: params ? params.missionId : null,
       isShow: false,
       title: '',
       formData: this.reset(),
@@ -109,12 +107,17 @@ export default {
         covered: "@value>=255",
       };
     },
-    async show(formData) {
+    async show(param) {
       this.title = '新增阈值';
       this.isEdit=false;
-      if (formData.thresholdCode){
-        this.formData = formData;
-        this.formData.timeRange=[formData.beginTime,formData.endTime];
+      if (param.thresholdCode){
+        this.formData = {
+                thresholdCode: param.thresholdCode,
+                thresholdName: param.thresholdName,
+                timeRange: [param.beginTime,param.endTime],
+                nosignal: param.nosignal,
+                covered: param.covered,
+        }
         this.title = '编辑阈值';
         this.isEdit=true;
       }