Pārlūkot izejas kodu

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

695593266@qq.com 8 mēneši atpakaļ
vecāks
revīzija
bfbc65a3ea

+ 1 - 1
src/components/Dict/DictSelection.vue

@@ -3,10 +3,10 @@
     v-model="selectVal"
     :disabled="isProhibit"
     style="width: 100%"
-    v-bind="$attrs"
     v-on="$listeners"
     filterable
     clearable
+    v-bind="$attrs"
   >
     <el-option
       v-for="item in dictList"

+ 25 - 1
src/views/rulesManagement/matterRules/components/matter-add.vue

@@ -488,7 +488,31 @@
         form.categoryName = this.cName;
         form.categoryId = this.cId;
 
-        form.cycle = this.$refs.cycleMultipleRef.ruleCycleList;
+        form.cycle = this.$refs.cycleMultipleRef.ruleCycleList
+          .map((i) => {
+            // 根据月日时分排序计算权重排序
+            let sortNum = 0;
+            if (i.month) {
+              sortNum += i.month * 60 * 24 * 30;
+            }
+            if (i.day) {
+              sortNum += i.day * 60 * 24;
+            }
+            if (i.hour) {
+              sortNum += i.hour * 60;
+            }
+
+            if (i.minute) {
+              sortNum += i.minute * 1;
+            }
+
+            return { ...i, sortNum };
+          })
+          .sort((a, b) => a.sortNum - b.sortNum)
+          .map((i, index) => {
+            return { ...i, sortNum: index + 1 };
+          });
+
         console.log(form);
 
         switch (form.cycleType) {

+ 102 - 72
src/views/rulesManagement/releaseRules/components/permitAdd.vue

@@ -104,6 +104,18 @@
           </el-form-item>
         </el-col>
       </el-row>
+      <el-row style="margin-bottom: 10px">
+        <el-col :span="8">
+          <el-form-item label="模块分类" required prop="reportWorkType">
+            <dict-selection
+              v-model="formData.reportWorkType"
+              dictName="记录规则报工类型"
+              placeholder="请选择模块"
+              :clearable="false"
+            ></dict-selection>
+          </el-form-item>
+        </el-col>
+      </el-row>
       <el-row style="margin-bottom: 10px">
         <el-col :span="24">
           <el-form-item label="周期" prop="frequencyValue" required>
@@ -452,40 +464,45 @@
       }
     },
     data() {
+      const formDateBase = {
+        id: null,
+        classify: null,
+        deviceId: null,
+        deviceName: '',
+        frequencyUnit: 2,
+        frequencyValue: null,
+        name: '',
+        recordRulesDetailList: [
+          {
+            id: 0,
+            defaultValue: '',
+            maxValue: null,
+            minValue: null,
+            paramType: null,
+            paramValue: null,
+            remark: '',
+            symbol: null,
+            tools: [],
+            unitName: null,
+            productName: '',
+            productCode: ''
+          }
+        ],
+        recordRulesCycleList: [],
+        startDate: null,
+        stopDate: null,
+        version: 1,
+        code: '',
+        fromId: null,
+        // 模块分类 参考字典项:record_rules_report_work_type
+        reportWorkType: '1'
+      };
+
       return {
         dialogTitle: '',
         visible: false,
-        formData: {
-          id: null,
-          classify: null,
-          deviceId: null,
-          deviceName: '',
-          frequencyUnit: 2,
-          frequencyValue: null,
-          name: '',
-          recordRulesDetailList: [
-            {
-              id: 0,
-              defaultValue: '',
-              maxValue: null,
-              minValue: null,
-              paramType: null,
-              paramValue: null,
-              remark: '',
-              symbol: null,
-              tools: [],
-              unitName: null,
-              productName: '',
-              productCode: ''
-            }
-          ],
-          recordRulesCycleList: [],
-          startDate: null,
-          stopDate: null,
-          version: 1,
-          code: '',
-          fromId: null
-        },
+        formDateBase,
+        formData: JSON.parse(JSON.stringify(formDateBase)),
         formRules: {
           name: [
             { required: true, message: '请输入规则名称', trigger: 'blur' }
@@ -513,6 +530,10 @@
           ],
           deviceName: [
             { required: true, message: '请输入选择设备', trigger: 'blur' }
+          ],
+          reportWorkType: [
+            { required: true, message: '请选择模块分类', trigger: 'change' },
+            { required: true, message: '请选择模块分类', trigger: 'blur' }
           ]
         },
         recordSheet: [], // 记录表
@@ -520,7 +541,8 @@
         dataIndex: null,
         showEdit: false,
         btnLoading: false,
-        currentRow: null
+        currentRow: null,
+        type: ''
       };
     },
     mounted() {
@@ -539,6 +561,7 @@
           this.formData.startDate = new Date(row.startDate);
           this.formData.stopDate = new Date(row.stopDate);
           this.formData.classify = this.formData.classify + '';
+          this.formData.reportWorkType = this.formData.reportWorkType + '';
 
           this.recordrulesDetailPage(row);
           this.recordrulesCyclePage(row);
@@ -591,38 +614,7 @@
         this.visible = false;
         this.$refs['formRef'].resetFields();
         // 清空表单数据
-        this.formData = {
-          id: null,
-          classify: null,
-          deviceId: null,
-          deviceName: '',
-          frequencyUnit: null,
-          frequencyValue: null,
-          name: '',
-          recordRulesDetailList: [
-            {
-              id: 0,
-              defaultValue: '',
-              maxValue: null,
-              minValue: null,
-              paramType: null,
-              paramValue: null,
-              remark: '',
-              symbol: null,
-              toolCodes: null,
-              tools: [],
-              unitName: null,
-              productName: '',
-              productCode: ''
-            }
-          ],
-          recordRulesCycleList: [],
-          startDate: null,
-          stopDate: null,
-          version: 1,
-          code: '',
-          fromId: null
-        };
+        this.formData = JSON.parse(JSON.stringify(this.formDateBase));
       },
       // 保存
       confirm() {
@@ -641,11 +633,30 @@
             this.btnLoading = true;
 
             this.formData.recordRulesCycleList =
-              this.$refs.cycleMultipleRef.recordRulesCycleList.map(
-                (i, index) => {
+              this.$refs.cycleMultipleRef.recordRulesCycleList
+                .map((i) => {
+                  // 根据月日时分排序计算权重排序
+                  let sortNum = 0;
+                  if (i.month) {
+                    sortNum += i.month * 60 * 24 * 30;
+                  }
+                  if (i.day) {
+                    sortNum += i.day * 60 * 24;
+                  }
+                  if (i.hour) {
+                    sortNum += i.hour * 60;
+                  }
+
+                  if (i.minute) {
+                    sortNum += i.minute * 1;
+                  }
+
+                  return { ...i, sortNum };
+                })
+                .sort((a, b) => a.sortNum - b.sortNum)
+                .map((i, index) => {
                   return { ...i, sortNum: index + 1 };
-                }
-              );
+                });
 
             const body = { ...this.formData };
 
@@ -693,11 +704,30 @@
           try {
             this.btnLoading = true;
             this.formData.recordRulesCycleList =
-              this.$refs.cycleMultipleRef.recordRulesCycleList.map(
-                (i, index) => {
+              this.$refs.cycleMultipleRef.recordRulesCycleList
+                .map((i) => {
+                  // 根据月日时分排序计算权重排序
+                  let sortNum = 0;
+                  if (i.month) {
+                    sortNum += i.month * 60 * 24 * 30;
+                  }
+                  if (i.day) {
+                    sortNum += i.day * 60 * 24;
+                  }
+                  if (i.hour) {
+                    sortNum += i.hour * 60;
+                  }
+
+                  if (i.minute) {
+                    sortNum += i.minute * 1;
+                  }
+
+                  return { ...i, sortNum };
+                })
+                .sort((a, b) => a.sortNum - b.sortNum)
+                .map((i, index) => {
                   return { ...i, sortNum: index + 1 };
-                }
-              );
+                });
 
             const body = { ...this.formData };
 

+ 8 - 1
src/views/technology/production/components/user-setting-matter.vue

@@ -128,7 +128,10 @@
           {
             prop: 'rulesName',
             label: '名称',
-            align: 'center'
+            align: 'center',
+            formatter: (row) => {
+              return row.rulesName || row.itemTaskName;
+            }
           },
           {
             columnKey: 'action',
@@ -180,6 +183,10 @@
       },
       // 删除事项
       async delMatter(row) {
+        if (row.isUsing) {
+          return this.$message.warning('事项正在使用中,无法删除');
+        }
+
         // 事项列表过滤
         this.matterList = this.matterList.filter((item) => item.id !== row.id);
         // 如果是临时id,直接前端删除

+ 2 - 1
vue.config.js

@@ -35,10 +35,11 @@ module.exports = {
         // target: 'http://192.168.1.105:18086',
         // target: 'http://192.168.1.158:18086',
         // target: 'http://192.168.1.176:18086',
-        target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18087',
         // target: 'http://192.168.1.116:18086',
+        target: 'http://192.168.1.251:18086',
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {