Browse Source

opc优化

hfxc226 2 years ago
parent
commit
db0015310c
2 changed files with 39 additions and 8 deletions
  1. 27 8
      src/views/remote/opc/modules/BaseForm.vue
  2. 12 0
      src/views/remote/opc/modules/Detail.vue

+ 27 - 8
src/views/remote/opc/modules/BaseForm.vue

@@ -20,6 +20,10 @@
       <a-form-item v-show="false">
         <a-input v-decorator="['id']" type="hidden"/>
         <a-input v-decorator="['sbId']" type="hidden"/>
+        <a-input v-decorator="['warnFirstColor']" type="hidden"/>
+        <a-input v-decorator="['warnSecondColor']" type="hidden"/>
+        <a-input v-decorator="['warnThirdColor']" type="hidden"/>
+        <a-input v-decorator="['warnFourColor']" type="hidden"/>
       </a-form-item>
 
       <row-list :col="2">
@@ -243,11 +247,12 @@
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
             <a-input-number
-              style="width: 100%"
+              style="width: 70%"
               :min="0.01"
               :formatter="BaseTool.Amount.formatter"
               :parser="BaseTool.Amount.parser"
-              v-decorator="['warnFirst', {initialValue:100,rules: [{required: false, message: '最低阈值不能为空'}]}]"/>
+              v-decorator="['warnFirst', {initialValue:'red',rules: [{required: false, message: '最低阈值不能为空'}]}]"/>
+            <a-button type="primary" style="width: 30%" @click="handleSelectColor(1)">选择颜色</a-button>
           </a-form-item>
         </row-item>
         <row-item>
@@ -258,11 +263,12 @@
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
             <a-input-number
-              style="width: 100%"
+              style="width: 70%"
               :min="0.01"
               :formatter="BaseTool.Amount.formatter"
               :parser="BaseTool.Amount.parser"
-              v-decorator="['warnSecond', {initialValue:0,rules: [{required: false, message: '低阈值不能为空'}]}]"/>
+              v-decorator="['warnSecond', {initialValue:'red',rules: [{required: false, message: '低阈值不能为空'}]}]"/>
+            <a-button type="primary" style="width: 30%" @click="handleSelectColor(2)">选择颜色</a-button>
           </a-form-item>
         </row-item>
         <row-item>
@@ -273,11 +279,12 @@
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
             <a-input-number
-              style="width: 100%"
+              style="width: 70%"
               :min="0.01"
               :formatter="BaseTool.Amount.formatter"
               :parser="BaseTool.Amount.parser"
-              v-decorator="['warnThird', {initialValue:100,rules: [{required: false, message: '高阈值不能为空'}]}]"/>
+              v-decorator="['warnThird', {initialValue:'red',rules: [{required: false, message: '高阈值不能为空'}]}]"/>
+            <a-button type="primary" style="width: 30%" @click="handleSelectColor(3)">选择颜色</a-button>
           </a-form-item>
         </row-item>
         <row-item>
@@ -288,11 +295,12 @@
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
             <a-input-number
-              style="width: 100%"
+              style="width: 70%"
               :min="0.01"
               :formatter="BaseTool.Amount.formatter"
               :parser="BaseTool.Amount.parser"
-              v-decorator="['warnFour', {initialValue:0,rules: [{required: false, message: '最高阈值不能为空'}]}]"/>
+              v-decorator="['warnFour', {initialValue:'red',rules: [{required: false, message: '最高阈值不能为空'}]}]"/>
+            <a-button type="primary" style="width: 30%" @click="handleSelectColor(4)">选择颜色</a-button>
           </a-form-item>
         </row-item>
         <row-item>
@@ -437,6 +445,14 @@ export default {
           'ratio',
           'low',
           'high',
+          'warnFirst',
+          'warnSecond',
+          'warnThird',
+          'warnFour',
+          'warnFirstColor',
+          'warnSecondColor',
+          'warnThirdColor',
+          'warnFourColor',
           'xposition',
           'yposition',
           'imgXPosition',
@@ -507,6 +523,9 @@ export default {
         this.$emit('ok')
       }
     },
+    handleSelectColor (type) {
+      this.$message.info(type)
+    },
     checkPoint (e) {
       const { form: { setFieldsValue, getFieldValue } } = this
       fetchRemoteOpcByPositionNumAndLine({

+ 12 - 0
src/views/remote/opc/modules/Detail.vue

@@ -30,9 +30,13 @@
       <detail-list-item term="量程下限">{{ model.low }}</detail-list-item>
       <detail-list-item term="量程上限">{{ model.high }}</detail-list-item>
       <detail-list-item term="最低阈值">{{ model.warnFirst }}</detail-list-item>
+      <detail-list-item term="最低阈值颜色">{{ model.warnFirstColor }}</detail-list-item>
       <detail-list-item term="低阈值">{{ model.warnSecond }}</detail-list-item>
+      <detail-list-item term="低阈值颜色">{{ model.warnSecondColor }}</detail-list-item>
       <detail-list-item term="高阈值">{{ model.warnThird }}</detail-list-item>
+      <detail-list-item term="高阈值颜色">{{ model.warnThirdColor }}</detail-list-item>
       <detail-list-item term="最高阈值">{{ model.warnFour }}</detail-list-item>
+      <detail-list-item term="最高阈值颜色">{{ model.warnFourColor }}</detail-list-item>
       <detail-list-item term="系数">{{ model.ratio }}</detail-list-item>
       <detail-list-item term="单位">{{ model.unit }}</detail-list-item>
       <detail-list-item term="x轴位置">{{ model.xPosition }}</detail-list-item>
@@ -78,6 +82,14 @@ export default {
         'description': null,
         'result': null,
         'ratio': null,
+        'warnFirst': null,
+        'warnSecond': null,
+        'warnThird': null,
+        'warnFour': null,
+        'warnFirstColor': null,
+        'warnSecondColor': null,
+        'warnThirdColor': null,
+        'warnFourColor': null,
         'xPosition': null,
         'yPosition': null,
         'imgXPosition': null,