Browse Source

Merge branch 'master' of http://39.106.8.246:3003/web/ibms

chuwu 5 years ago
parent
commit
7171c61ab0
1 changed files with 15 additions and 17 deletions
  1. 15 17
      src/components/config_point/step3_edit/index.vue

+ 15 - 17
src/components/config_point/step3_edit/index.vue

@@ -33,7 +33,7 @@
                 <el-form-item
                     label='对应数据字典'
                     prop='dict'
-                   
+                    :rules='[{ required: true, message: "请输入对应数据字典", trigger: "change" },{ validator: validateDict, trigger: ["blur", "change"] }]'
                 >
                     <el-cascader
                         style='width: 100%;'
@@ -124,7 +124,7 @@ export default {
             },
             ValueDescription: '', //值/点位描述
             form: {
-                dict: [],                
+                dict: [],
                 DataRuleType: ''
             },
             rules: {
@@ -252,7 +252,7 @@ export default {
                 InfomationPoint: this.InfomationPoint, //信息点
                 DataRuleType: basic.DataRuleType, //值处理方式
                 DataSourceId: '4',
-                PointId: this.editData.Point.Id,  //点位ID
+                PointId: this.editData.Point.Id //点位ID
             }
             let otherParams = {}
             switch (type) {
@@ -368,7 +368,6 @@ export default {
             }
             let params = [Object.assign(basicParams, otherParams)]
             this.create(params)
-
         },
         create(params) {
             batchCreate(params, res => {
@@ -389,7 +388,7 @@ export default {
         },
         handleChange(arr) {
             this.unitObj = this.infoDict[arr[3]]
-            this.InfomationPoint = this.unitObj.infoPointName || '--'
+            this.InfomationPoint = this.unitObj ? (this.unitObj.infoPointName || '--') : '--'
         },
         handleItemChange(val, cb) {
             if (val.length == 3) {
@@ -443,7 +442,7 @@ export default {
                 this.dataDict[arr[i].code] = arr[i]
                 if (arr[i].content && arr[i].content.length > 0) {
                     this.getDataDict(arr[i].content)
-                }else {
+                } else {
                     this.$set(arr[i], 'content', [])
                 }
             }
@@ -474,19 +473,19 @@ export default {
                         DataRuleType: data.DataRuleType
                     }
                     this.unitObj = this.infoDict[data.InfomationPointCode]
-                    this.InfomationPoint = this.unitObj.infoPointName || '--';
-                    if(typeof this.unitObj.dataSource == "string") {
-                        if(this.unitObj.dataSource.length) {
+                    this.InfomationPoint = this.unitObj.infoPointName || '--'
+                    if (typeof this.unitObj.dataSource == 'string') {
+                        if (this.unitObj.dataSource.length) {
                             this.ValueDescription = this.unitObj.dataSource
                         } else {
-                            this.ValueDescription = "无信息点单位及值说明"
-                        }                        
+                            this.ValueDescription = '无信息点单位及值说明'
+                        }
                     } else {
                         let str = ''
                         this.unitObj.dataSource.forEach(ele => {
-                            str = ele.code + '、' + ele.name + " "
+                            str = ele.code + '、' + ele.name + ' '
                         })
-                        this.ValueDescription = str;
+                        this.ValueDescription = str
                     }
                 })
                 if (length == 1) {
@@ -531,7 +530,6 @@ export default {
                                 extractArr: extractArr
                             }
                             break
-                            
                     }
                 } else {
                     let dataRules = JSON.parse(data.DataRuleContent)
@@ -540,11 +538,11 @@ export default {
 
                         return {
                             EquipmentMark: ele.EquipmentMark,
-                            SplitStart:arr[0].content[0].from ,
+                            SplitStart: arr[0].content[0].from,
                             SplitEnd: arr[0].content[0].to
                         }
-                    }) 
-                    let pointArr = dataRules[1].content;
+                    })
+                    let pointArr = dataRules[1].content
                     this.splitHandleShow = {
                         EquipmentMark: data.EquipmentMark,
                         pointArr: pointArr,