|
@@ -71,7 +71,8 @@ export default {
|
|
|
Bd: 'Building',
|
|
|
Fl: 'Floor',
|
|
|
VOTn: 'Tenant',
|
|
|
- }
|
|
|
+ },
|
|
|
+ timer: null
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -127,7 +128,6 @@ export default {
|
|
|
},
|
|
|
//请求信息点
|
|
|
getDataPoint(type) {
|
|
|
- let that = this;
|
|
|
let param = {
|
|
|
data: {
|
|
|
Filters: "InputMode='M' or InputMode='L'",
|
|
@@ -144,17 +144,31 @@ export default {
|
|
|
Name: item.InfoPointName
|
|
|
}
|
|
|
})
|
|
|
- this.pushPoints(this.options, tempArr, type);
|
|
|
this.pointDataSource = {}
|
|
|
res.Content.map(item => {
|
|
|
let code = item.InfoPointCode
|
|
|
this.pointDataSource[code] = item
|
|
|
})
|
|
|
- this.$nextTick(() => {
|
|
|
- this.changeSelect(this.form.dict)
|
|
|
- })
|
|
|
+ this.timer = setTimeout(() => {
|
|
|
+ if (this.interval()) {
|
|
|
+ this.pushPoints(this.options, tempArr, type);
|
|
|
+ this.changeSelect(this.form.dict);
|
|
|
+ clearTimeout(this.timer);
|
|
|
+ this.timer = null;
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.timer()
|
|
|
+ }, 100);
|
|
|
})
|
|
|
},
|
|
|
+ interval() {
|
|
|
+ for (let i = 0; i < this.options.length; i++) {
|
|
|
+ if (this.options[i].children.length > 0) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ },
|
|
|
//根据返回数据拼接options
|
|
|
pushPoints(options, arr, Code) {
|
|
|
options.map(option => {
|
|
@@ -168,8 +182,10 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
changeSelect(val) {
|
|
|
- let labels = this.$refs.dictCas.getCheckedNodes()[0].pathLabels
|
|
|
- this.$emit('change', { val: val, labels: labels })
|
|
|
+ if (this.$refs.dictCas.getCheckedNodes()[0]) {
|
|
|
+ let labels = this.$refs.dictCas.getCheckedNodes()[0].pathLabels
|
|
|
+ this.$emit('change', { val: val, labels: labels })
|
|
|
+ }
|
|
|
},
|
|
|
//减少请求次数
|
|
|
hasChildren(Code) {
|