| | |
| | | @callParentMethod="parentMethod" |
| | | ></rightEdit> |
| | | <folderFile |
| | | @refreshMethod="refreshMethod" |
| | | :activeName="activeName" |
| | | v-if="layerParams.addFolder || (layerParams.editFolder)" |
| | | ></folderFile> |
| | |
| | | fileType: 1, //文件夹类型 |
| | | editFolderData: null, |
| | | editingIsProhibited:false,//禁止编辑 |
| | | isDetailShow:false |
| | | }); |
| | | |
| | | const handleClick = tab => { |
| | | const clickedTab = tabData.value.find(item => item.type === tab.paneName); |
| | | |
| | | activeType.value = clickedTab.type; |
| | | activeName.value = clickedTab.name; |
| | | getdataFolderApi(); |
| | | parentMethod() |
| | | }; |
| | | |
| | | const refreshMethod =()=>{ |
| | | getdataFolderApi() |
| | | } |
| | | const getdataFolderApi = () => { |
| | | let id; |
| | | if (activeName.value === '电子围栏') { |
| | |
| | | label: folder.name, |
| | | value: folder.id.toString(), |
| | | })); |
| | | layerParams.value.folderOption = formattedFolderOption; |
| | | layerParams.value.folderOption = formattedFolderOption; |
| | | }); |
| | | }; |
| | | // 编辑围栏区域 |
| | | const handleEdit = val => { |
| | | console.log('编辑数据',val); |
| | | |
| | | viewer.entities.removeAll(); |
| | | layerParams.value.editDetailData = val; |
| | | drawPolygonExample.editThePatch(true); |
| | |
| | | } else { |
| | | viewer.entities.removeAll(); |
| | | } |
| | | }; |
| | | // 编辑围栏区域 |
| | | const previewInformation = val => { |
| | | console.log('编辑数据',val); |
| | | layerParams.value.editDetailData = val; |
| | | }; |
| | | const loadDataToMap = dataList => { |
| | | if (!viewer) return; |
| | |
| | | }); |
| | | focusOnAllFeatures(); |
| | | viewInstance.value?.addLeftClickEvent(null, handleFenceClick); |
| | | |
| | | }; |
| | | //计算所有图斑的包围球并定位 |
| | | const focusOnAllFeatures = () => { |
| | |
| | | if (Cesium.defined(pickedObject) && pickedObject.id?.customType === 'fence_polygon') { |
| | | const selectedEntity = pickedObject.id; |
| | | const selectedData = selectedEntity.customInfo; |
| | | viewer.entities.values.forEach(entity => { |
| | | if (entity.customType === 'fence_polygon') { |
| | | entity.polygon.material = entity === selectedEntity |
| | | ? Cesium.Color.RED.withAlpha(0.5) |
| | | : Cesium.Color.YELLOW.withAlpha(0.5); |
| | | } |
| | | }); |
| | | |
| | | layerParams.value.editNest = true; // 显示右侧编辑组件 |
| | | // viewer.entities.values.forEach(entity => { |
| | | // if (entity.customType === 'fence_polygon') { |
| | | // entity.polygon.material = entity === selectedEntity |
| | | // ? Cesium.Color.RED.withAlpha(0.5) |
| | | // : Cesium.Color.YELLOW.withAlpha(0.5); |
| | | // } |
| | | // }); |
| | | if (activeName.value !== '国土空间规划') { |
| | | layerParams.value.editNest = true; // 显示右侧编辑组件 |
| | | layerParams.value.decideWhetherToAddOrEdit = 2; // 标记为编辑模式 |
| | | // 根据围栏类型设置fenceType |
| | | if (activeName.value === '电子围栏') { |
| | |
| | | layerParams.value.fenceArea = selectedData.area; |
| | | layerParams.value.editingIsProhibited = true |
| | | } |
| | | } |
| | | |
| | | }; |
| | | let publicCesiumInstance = null; |
| | | let viewer = null; |