| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2024-10-31 10:47:29 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2024-12-03 13:44:43 |
| | | * @LastEditTime: 2024-12-06 16:13:43 |
| | | * @FilePath: \bigScreen\src\pages\map\components\scomponents\layersControl.vue |
| | | * @Description: |
| | | * |
| | |
| | | label: '应急空间', |
| | | children: [ |
| | | { |
| | | parentId: '3', |
| | | id: '3-1', |
| | | label: '应急池', |
| | | type: 'layer', |
| | |
| | | addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id) |
| | | window.$viewer.addLayer(addPopLayers[attrParams.id]) |
| | | let iconEl = `<div class="marsBlueGradientPnl"> |
| | | <div>${attrParams.firmName}</div> |
| | | <div>${attrParams.mainFuncName}</div> |
| | | <div>企业名称:${attrParams.firmName}</div> |
| | | <div>作用:${attrParams.mainFuncName}</div> |
| | | </div>` |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64), |
| | |
| | | } |
| | | }, |
| | | { |
| | | parentId: '3', |
| | | id: '3-2', |
| | | label: '阀门', |
| | | type: 'layer', |
| | |
| | | addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id) |
| | | window.$viewer.addLayer(addPopLayers[attrParams.id]) |
| | | let iconEl = `<div class="marsBlueGradientPnl"> |
| | | <div>${attrParams.firmName}</div> |
| | | <div>${attrParams.mainFuncName}</div> |
| | | <div>企业名称:${attrParams.firmName}</div> |
| | | <div>作用:${attrParams.mainFuncName}</div> |
| | | </div>` |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64), |
| | |
| | | }, |
| | | |
| | | { |
| | | parentId: '3', |
| | | id: '3-3', |
| | | label: '公共管网', |
| | | children: [ |
| | | // 给水管网、污水管网、燃气管网、雨水管网 |
| | | { |
| | | parentId: '3-3', |
| | | id: '3-3-2', |
| | | label: '污水管网', |
| | | type: 'layer', |
| | |
| | | height: 60.2, |
| | | }, |
| | | { |
| | | parentId: '3-3', |
| | | id: '3-3-4', |
| | | label: '雨水管网', |
| | | type: 'layer', |
| | |
| | | }, |
| | | |
| | | { |
| | | parentId: '3', |
| | | id: '3-4', |
| | | label: '污水提升泵站', |
| | | type: 'layer', |
| | |
| | | }, |
| | | |
| | | { |
| | | parentId: '3', |
| | | id: '3-5', |
| | | label: '水库', |
| | | type: 'layer', |
| | |
| | | }, |
| | | |
| | | { |
| | | parentId: '3', |
| | | id: '3-6', |
| | | label: '应急泵', |
| | | type: 'layer', |
| | |
| | | addPopLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name) |
| | | window.$viewer.addLayer(addPopLayers[attrParams.name]) |
| | | let iconEl = `<div class="marsBlueGradientPnl"> |
| | | <div>${attrParams.firmName}</div> |
| | | <div>${attrParams.mainFuncName}</div> |
| | | <div>企业名称:${attrParams.firmName}</div> |
| | | <div>作用:${attrParams.mainFuncName}</div> |
| | | </div>` |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64), |
| | |
| | | }, |
| | | |
| | | { |
| | | parentId: '3', |
| | | id: '3-8', |
| | | label: '沟渠', |
| | | type: 'layer', |
| | |
| | | // layerName: 'fsclz' |
| | | // }, |
| | | { |
| | | parentId: '3', |
| | | id: '3-10', |
| | | label: '排水口', |
| | | type: 'layer', |
| | |
| | | addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id) |
| | | window.$viewer.addLayer(addPopLayers[attrParams.id]) |
| | | let iconEl = `<div class="marsBlueGradientPnl"> |
| | | <div>${attrParams.firmName}</div> |
| | | <div>${attrParams.mainFuncName}</div> |
| | | <div>企业名称:${attrParams.firmName}</div> |
| | | <div>作用:${attrParams.mainFuncName}</div> |
| | | </div>` |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64), |
| | |
| | | label: '风险源', |
| | | children: [ |
| | | { |
| | | parentId: '4', |
| | | id: '4-1', |
| | | label: '一般', |
| | | type: 'layer', |
| | |
| | | addPopLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name) |
| | | window.$viewer.addLayer(addPopLayers[attrParams.name]) |
| | | let iconEl = `<div class="marsBlueGradientPnl"> |
| | | <li>${attrParams.firmName || ''}</li> |
| | | <li>${attrParams.name || ''}</li> |
| | | <li>${attrParams.riskLevelName || ''}</li> |
| | | <li>企业名称:${attrParams.firmName || ''}</li> |
| | | <li>风险等级:${attrParams.riskLevelName || ''}</li> |
| | | <li>行业类别:${attrParams.name || ''}</li> |
| | | </div>` |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64), |
| | |
| | | } |
| | | }, |
| | | { |
| | | parentId: '4', |
| | | id: '4-2', |
| | | label: '较大', |
| | | type: 'layer', |
| | |
| | | addPopLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name) |
| | | window.$viewer.addLayer(addPopLayers[attrParams.name]) |
| | | let iconEl = `<div class="marsBlueGradientPnl"> |
| | | <li>${attrParams.firmName || ''}</li> |
| | | <li>${attrParams.name || ''}</li> |
| | | <li>${attrParams.riskLevelName || ''}</li> |
| | | <li>企业名称:${attrParams.firmName || ''}</li> |
| | | <li>风险等级:${attrParams.riskLevelName || ''}</li> |
| | | <li>行业类别:${attrParams.name || ''}</li> |
| | | </div>` |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64), |
| | |
| | | } |
| | | }, |
| | | { |
| | | parentId: '4', |
| | | id: '4-9', |
| | | label: '暂定', |
| | | type: 'layer', |
| | |
| | | } |
| | | |
| | | const handleCheckChange = (data) => { |
| | | |
| | | let options = treeRef.value?.getCheckedNodes() |
| | | collectedNodes.value = [] |
| | | collectNodesWithFlag(data) |
| | |
| | | computeCircle(1.6) |
| | | ) |
| | | |
| | | polylineVolume.setStyle({ |
| | | material: item.color |
| | | }) |
| | | if (i.properties.RefName.indexOf('拟建') != -1) { |
| | | polylineVolume.setStyle({ |
| | | material: DC.Color.fromBytes(234, 93, 240, 230) |
| | | }) |
| | | } else { |
| | | polylineVolume.setStyle({ |
| | | material: item.color |
| | | }) |
| | | } |
| | | |
| | | addTileLayers[item.layerName].addOverlay(polylineVolume) |
| | | }) |
| | | } else { |
| | |
| | | } |
| | | |
| | | const restHandleDelChange = (key) => { |
| | | |
| | | let checkIds = treeRef.value?.getCheckedKeys() |
| | | |
| | | if (checkIds && !checkIds.some(i => i == key)) { |
| | | return |
| | | } |
| | | |
| | | treeRef.value?.setCheckedKeys(checkIds.filter(i => i.indexOf(key))) |
| | | handleCheckChange([findObjectById(data, key)]) |
| | | let selectData = findObjectById(data, key) |
| | | |
| | | let parentId = null |
| | | if (selectData && 'parentId' in selectData) parentId = selectData.parentId |
| | | |
| | | treeRef.value?.setCheckedKeys(checkIds.filter(i => i.indexOf(key) && i != parentId)) |
| | | handleCheckChange([selectData]) |
| | | } |
| | | |
| | | // 飞到园区范围 |
| | |
| | | // 关闭所有选中的,除了倾斜,园区分布,空中全景 |
| | | const closeAll = () => { |
| | | EventBus.emit('restHandleDelChange', `2`) |
| | | EventBus.emit('restHandleDelChange', `3`) |
| | | EventBus.emit('restHandleDelChange', `3-1`) |
| | | EventBus.emit('restHandleDelChange', `3-2`) |
| | | EventBus.emit('restHandleDelChange', `3-3`) |
| | | // EventBus.emit('restHandleDelChange', `3-3-1`) |
| | | EventBus.emit('restHandleDelChange', `3-3-2`) |
| | | // EventBus.emit('restHandleDelChange', `3-3-3`) |
| | |
| | | EventBus.emit('restHandleDelChange', `3-7`) |
| | | EventBus.emit('restHandleDelChange', `3-8`) |
| | | // EventBus.emit('restHandleDelChange', `3-9`) |
| | | EventBus.emit('restHandleDelChange', `4`) |
| | | EventBus.emit('restHandleDelChange', `4-1`) |
| | | EventBus.emit('restHandleDelChange', `4-2`) |
| | | EventBus.emit('restHandleDelChange', `4-9`) |
| | |
| | | |
| | | // 销毁 |
| | | function destroyPop () { |
| | | let arr = Object.keys(addPopLayers) |
| | | if (arr.length > 0) { |
| | | arr.forEach(i => { |
| | | addPopLayers[i] && window.$viewer && window.$viewer.removeLayer(addPopLayers[i]) |
| | | addPopLayers[i] = null |
| | | delete addPopLayers[i] |
| | | }) |
| | | addPopLayers = {} |
| | | if (addPopLayers && addPopLayers != null) { |
| | | let arr = Object.keys(addPopLayers) |
| | | if (arr.length > 0) { |
| | | arr.forEach(i => { |
| | | addPopLayers[i] && window.$viewer && window.$viewer.removeLayer(addPopLayers[i]) |
| | | addPopLayers[i] = null |
| | | delete addPopLayers[i] |
| | | }) |
| | | addPopLayers = {} |
| | | } |
| | | } |
| | | } |
| | | |