Răsfoiți Sursa

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

chencc 1 an în urmă
părinte
comite
150f5ec604

+ 8 - 2
src/views/rulesManagement/earlyWarningRules/components/matter-add.vue

@@ -427,13 +427,16 @@
       },
       async openDialog(row, type) {
         this.isBindPlan = type;
-        if (type == 'edit' || type == 'clone') {
+        if (type == 'edit') {
           this.getRuleInfo(row.id, type);
         }
         if (type == 'add') {
-          console.log('add');
           this.getOrderCode();
         }
+        if (type == 'clone') {
+          this.getOrderCode();
+          this.getRuleInfo(row.id, type);
+        }
 
         this.addMatterDialog = true;
       },
@@ -441,6 +444,9 @@
       async getRuleInfo(id, type) {
         const data = await getDetail(id);
         this.formData = deepClone(data);
+        if (this.isBindPlan == 'clone') {
+          this.formData.ruleObjCode = '';
+        }
 
         if (data.actionList && data.actionList.length > 0) {
           for (let i = 0; i < data.actionList.length; i++) {

+ 10 - 8
src/views/rulesManagement/earlyWarningRules/components/matter-search.vue

@@ -28,14 +28,14 @@
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="创建时间:">
           <el-date-picker
-            style="width: 100%"
             v-model="time"
-            type="daterange"
+            type="datetimerange"
             range-separator="至"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
+            start-placeholder="开始时间"
+            end-placeholder="结束时间"
             value-format="yyyy-MM-dd HH:mm:ss"
             :default-time="['00:00:00', '23:59:59']"
+            style="width: 100%"
           >
           </el-date-picker>
         </el-form-item>
@@ -103,10 +103,12 @@
     methods: {
       /* 搜索 */
       search() {
-        if (this.time.length) {
-          this.where.startTime = this.time[0];
-          this.where.endTime = this.time[1];
-        }
+        const [startTime = '', endTime = ''] = this.time || [];
+        this.where = {
+          ...this.where,
+          startTime,
+          endTime
+        };
         this.$emit('search', this.where);
       },
       /*  重置 */