Browse Source

fix point config tools dictionary cascader error

haojianlong 5 years ago
parent
commit
ab0b952e03

+ 4 - 1
src/components/config_point/dictionaryCascader.vue

@@ -142,6 +142,9 @@ export default {
           let code = item.InfoPointCode
           this.pointDataSource[code] = item
         })
+        this.$nextTick(() => {
+          this.changeSelect(this.form.dict)
+        })
       })
     },
     //根据返回数据拼接options
@@ -157,6 +160,7 @@ export default {
       })
     },
     changeSelect(val) {
+      debugger
       let labels = this.$refs.dictCas.currentLabels
       this.$emit('change', { val: val, labels: labels })
     },
@@ -173,7 +177,6 @@ export default {
     //设置值
     setCascaderVal(value) {
       this.form.dict = tools.deepCopy(value)
-      this.changeSelect(value)
       value.splice(value.length - 1, 1)
       this.handleChange(value)
     },

+ 4 - 1
src/components/config_point/step3_edit/index.vue

@@ -371,7 +371,7 @@ export default {
             let data = res.Content
             let arr = data
               .filter(item => {
-                return item.inputMode == 'L'
+                return item.inputMode == 'L' || item.inputMode == 'M'
               })
               .map(item => {
                 return {
@@ -570,6 +570,9 @@ export default {
     changeDictionaryCas({ val, labels }) {
       this.dictionaryData = val;
       this.dictionaryNames = labels
+      this.infoDict = this.$refs.dictionaryCas.pointDataSource
+      this.unitObj = this.infoDict[val[val.length - 1]]
+      this.InfomationPoint = this.unitObj.InfoPointName || ''
     }
   },
   mounted() {

+ 1 - 1
src/components/config_point/step3_point/3_temps.vue

@@ -580,7 +580,7 @@ export default {
       this.dictionaryNames = labels
       this.infoDict = this.$refs.dictionaryCas.pointDataSource
       this.unitObj = this.infoDict[val[val.length - 1]]
-      this.InfomationPoint = this.unitObj.infoPointName || ''
+      this.InfomationPoint = this.unitObj.InfoPointName || ''
     }
   }
 }