Преглед изворни кода

feat: 禁用已绑定参数的编辑并新增设备列

yusheng пре 1 месец
родитељ
комит
cc5959f98f

+ 23 - 0
src/views/rulesManagement/recordPlan/components/programRulesDialog.vue

@@ -371,6 +371,7 @@
                 placeholder="请选择参数类型"
                 size="mini"
                 @change="paramTypeChange(row)"
+                :disabled="!!row.paramCode"
               >
                 <el-option label="数值" :value="1" />
                 <el-option label="选择" :value="2" />
@@ -414,6 +415,7 @@
                 size="mini"
                 type="textarea"
                 rows="1"
+                :disabled="!!row.paramCode"
                 autosize
               ></el-input>
             </template>
@@ -545,6 +547,9 @@
                 placeholder="请输入参数上限"
                 size="mini"
               ></el-input>
+              <span v-else-if="row.paramType == 7 && row.paramCode">{{
+                row.maxValue
+              }}</span>
             </template>
             <template v-slot:minValue="{ row }">
               <el-input
@@ -553,6 +558,9 @@
                 placeholder="请输入参数下限"
                 size="mini"
               ></el-input>
+              <span v-else-if="row.paramType == 7 && row.paramCode">{{
+                row.minValue
+              }}</span>
             </template>
             <template v-slot:unitName="{ row }">
               <!-- <el-input
@@ -569,6 +577,9 @@
                 size="mini"
               >
               </DictSelection>
+              <span v-else-if="row.paramType == 7 && row.paramCode">{{
+                row.unitName
+              }}</span>
             </template>
             <template v-slot:toolName="{ row }">
               <el-link :underline="false" style="cursor: pointer">
@@ -929,6 +940,18 @@
             slot: 'unitName',
             minWidth: 110
           },
+          {
+            prop: 'substanceName',
+            label: '设备名称',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'substanceCode',
+            label: '设备编码',
+            align: 'center',
+            minWidth: 110
+          },
           {
             prop: 'toolName',
             label: '工具名称',

+ 5 - 1
src/views/rulesManagement/releaseRules/components/permitAdd.vue

@@ -336,7 +336,7 @@
               icon="el-icon-plus"
               class="ele-btn-icon"
               @click="bindSubstanceListOpen"
-              v-if="this.formData.reportWorkType==5"
+              v-if="formData.reportWorkType == 5"
             >
               添加物联参数
             </el-button>
@@ -1847,6 +1847,10 @@
         this.currentRow = row;
         this.currentIndex = index;
         if (type == 'substanceName') {
+          if (!this.formData.deviceId) {
+            this.$message.error('请选择主设备!');
+            return;
+          }
           this.$refs.bindSubstanceRef.open(
             this.formData.deviceId,
             this.formData.deviceName,