|
|
@@ -15,7 +15,7 @@
|
|
|
:data="treeData"
|
|
|
:props="defaultProps"
|
|
|
default-expand-all
|
|
|
- node-key="symbol"
|
|
|
+ node-key="id"
|
|
|
:default-checked-keys="defaultCheckedKeys"
|
|
|
:filter-node-method="filterNode"
|
|
|
@check="getCheckList()"
|
|
|
@@ -50,13 +50,20 @@ export default class monitorTree extends Vue {
|
|
|
target.filter(val)
|
|
|
}
|
|
|
@Watch('deviceCheckList', { deep: true })
|
|
|
- onChangeCheckListMethod() {
|
|
|
+ onChangeCheckListMethod(val) {
|
|
|
this.showMapPoint()
|
|
|
+ this.$store.state.bigScreen.monitorTreeCheckHistory = []
|
|
|
+ val.forEach((item) => {
|
|
|
+ this.$store.state.bigScreen.monitorTreeCheckHistory.push(item.id)
|
|
|
+ })
|
|
|
}
|
|
|
@Watch('treeData', { deep: true })
|
|
|
onChangeTreeDataMethod() {
|
|
|
this.setCheckInfo()
|
|
|
}
|
|
|
+ get historyInfo() {
|
|
|
+ return this.$store.state.bigScreen.monitorTreeCheckHistory
|
|
|
+ }
|
|
|
viewer
|
|
|
//参数
|
|
|
deviceCheckList = []
|
|
|
@@ -85,7 +92,7 @@ export default class monitorTree extends Vue {
|
|
|
const res = await axios.request({ url: '/panoramic/commonData/list', method: 'get', params })
|
|
|
let result = res.result
|
|
|
Object.keys(result).forEach((item, index) => {
|
|
|
- this.treeData.push({ symbol: index, name: item, children: result[item] })
|
|
|
+ this.treeData.push({ name: item, children: result[item] })
|
|
|
})
|
|
|
}
|
|
|
setStatusIconColor(type) {
|
|
|
@@ -102,7 +109,7 @@ export default class monitorTree extends Vue {
|
|
|
return iconSrc
|
|
|
}
|
|
|
handleTreeNodeClick(data) {
|
|
|
- let entity = customDataSource.entities.getById(data.id)
|
|
|
+ let entity = customDataSource.entities.getById(data.name)
|
|
|
this.viewer.flyTo(entity)
|
|
|
}
|
|
|
getCheckList() {
|
|
|
@@ -110,18 +117,33 @@ export default class monitorTree extends Vue {
|
|
|
}
|
|
|
setCheckInfo() {
|
|
|
let checkedList = []
|
|
|
- this.deviceCheckList = this.treeData
|
|
|
+ let tempCheckList = this.treeData
|
|
|
.map((item, index) => {
|
|
|
- checkedList.push(index)
|
|
|
+ if (item.children) {
|
|
|
+ item.children.forEach((child) => {
|
|
|
+ if (this.historyInfo != null) {
|
|
|
+ if (child.id && this.historyInfo.some((id) => id == child.id)) {
|
|
|
+ checkedList.push(child.id)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ checkedList.push(child.id)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
return item.children
|
|
|
})
|
|
|
.flat()
|
|
|
+ tempCheckList.forEach((item) => {
|
|
|
+ if (checkedList.some((id) => id == item.id)) {
|
|
|
+ this.deviceCheckList.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
this.$nextTick(() => {
|
|
|
this.defaultCheckedKeys = checkedList
|
|
|
+ this.$store.state.bigScreen.monitorTreeCheckHistory = this.defaultCheckedKeys
|
|
|
})
|
|
|
}
|
|
|
showMapPoint() {
|
|
|
- console.log(this.deviceCheckList)
|
|
|
if (Cesium.defined(customDataSource)) {
|
|
|
customDataSource.entities.removeAll()
|
|
|
}
|
|
|
@@ -145,7 +167,6 @@ export default class monitorTree extends Vue {
|
|
|
const position = Cesium.Cartesian3.fromDegrees(options.position[0], options.position[1], 0)
|
|
|
var bottomPosition = Cesium.Cartographic.fromCartesian(position)
|
|
|
var entity = new Cesium.Entity({
|
|
|
- // id: 'deviceInfo' + options.id,
|
|
|
id: options.name,
|
|
|
type: 'deviceInfo',
|
|
|
name: options.name,
|
|
|
@@ -185,6 +206,7 @@ export default class monitorTree extends Vue {
|
|
|
)
|
|
|
}
|
|
|
initInfoPop(data, position) {
|
|
|
+ console.log(data)
|
|
|
let deviceInfoConstructor = Vue.extend(deviceInfo)
|
|
|
const deviceInfoModule = new deviceInfoConstructor({
|
|
|
data: {
|