|
|
@ -177,7 +177,10 @@ export default { |
|
|
|
getMinMapLayers(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
async setFilterData(data) { |
|
|
|
setFilterDataNoAction(data) { //纯更新data |
|
|
|
this.filterData = data; |
|
|
|
}, |
|
|
|
async setFilterData(data) {//更新并调用接口 |
|
|
|
this.filterData = data; |
|
|
|
const tabContentData = []; |
|
|
|
this.layerData.forEach((layerDataItem => { |
|
|
@ -193,20 +196,24 @@ export default { |
|
|
|
const status = item.status; |
|
|
|
// if (!eventMap[`${key}${status ? "_close" : ""}`]) return this.$emit("onClickItem", item); |
|
|
|
// console.log(`${key}${status ? "" : "_close"}`, this.filterData, 'xxx'); |
|
|
|
await eventMap[`${key}${status ? "" : "_close"}`]?.call(this, item, this.filterData, isDefault); |
|
|
|
await eventMap[`${key}${status ? "" : "_close"}`]?.call(this, item, this.filterData, isDefault, this.cb); |
|
|
|
} |
|
|
|
await Promise.allSettled(tabContentData.map(item => eventMapCall(item, true))) |
|
|
|
Object.keys(lngLatMap).forEach(key => { |
|
|
|
addInGraphHandle(lngLatMap[key]); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
handleClick(item) { |
|
|
|
this.active = item.title; |
|
|
|
this.tabContentData = item.children; |
|
|
|
}, |
|
|
|
cb(item, config) { |
|
|
|
const deviceType = config.deviceType; |
|
|
|
const activeDeviceTypes = this.activeDeviceTypes; |
|
|
|
const findIndex = activeDeviceTypes.indexOf(deviceType); |
|
|
|
if (item.status) findIndex === -1 && activeDeviceTypes.push(deviceType); |
|
|
|
else findIndex !== -1 && activeDeviceTypes.splice(findIndex, 1); |
|
|
|
}, |
|
|
|
async handleDeviceImmediate(item, isDefault) { |
|
|
|
const key = getHandleDeviceType(item) || `${this.active}/${item.title}`; |
|
|
|
|
|
|
@ -218,14 +225,8 @@ export default { |
|
|
|
|
|
|
|
if (!eventMap[`${key}${status ? "_close" : ""}`]) return this.$emit("onClickItem", item); |
|
|
|
console.log(`${key}${status ? "_close" : ""}`, this.filterData, isDefault) |
|
|
|
const cb = (item, config) => { |
|
|
|
const deviceType = config.deviceType; |
|
|
|
const activeDeviceTypes = this.activeDeviceTypes; |
|
|
|
const findIndex = activeDeviceTypes.indexOf(deviceType); |
|
|
|
if (item.status) findIndex === -1 && activeDeviceTypes.push(deviceType); |
|
|
|
else findIndex !== -1 && activeDeviceTypes.splice(findIndex, 1); |
|
|
|
} |
|
|
|
await eventMap[`${key}${status ? "_close" : ""}`]?.call(this, item, this.filterData, isDefault, cb); |
|
|
|
|
|
|
|
await eventMap[`${key}${status ? "_close" : ""}`]?.call(this, item, this.filterData, isDefault, this.cb); |
|
|
|
}, |
|
|
|
handleDevice: debounce(function (item) { |
|
|
|
this.handleDeviceImmediate(item); |
|
|
|