Merge branch 'refs/heads/feature/v8.0/8.0.2' into test
| | |
| | | v-if="permission.fly_device_offline" @click.stop="handleDeviceOffline(scope.row)">注销</el-button> |
| | | </el-dropdown-item> |
| | | <el-dropdown-item command="e"> |
| | | <el-button type="primary" text icon="el-icon-document-delete" |
| | | v-if="permission.fly_device_offline" |
| | | :disabled="scope.row.dem_status === 1" |
| | | @click.stop="handleStatus(scope.row)"> |
| | | <el-button type="primary" text icon="el-icon-document-delete" v-if="permission.fly_device_offline" |
| | | :disabled="scope.row.dem_status === 1" @click.stop="handleStatus(scope.row)"> |
| | | {{ scope.row.dem_status === 0 ? '初始化地形' : (scope.row.dem_status === 1 ? '初始化中' : '更新地形') }} |
| | | </el-button> |
| | | </el-dropdown-item> |
| | |
| | | |
| | | // 设备 |
| | | handleStatus(row) { |
| | | console.log(row, '8888') |
| | | // dem_status |
| | | if (row.dem_status === 2 || row.dem_status === 3) { |
| | | deleteAirportTerrainHeight({ dockSn: row.device_sn }).then(res => { |
| | | initAirportTerrainHeight({ dockSn: row.device_sn, centerLon: row.longitude, centerLat: row.latitude, }).then(res => { |
| | | ElMessage.success('操作成功') |
| | | this.init() |
| | | }) |
| | | if (row.dem_status != 0){ |
| | | deleteAirportTerrainHeight({ dockSn: row.device_sn }).then(res => { |
| | | }) |
| | | } else { |
| | | initAirportTerrainHeight({ dockSn: row.device_sn, centerLon: row.longitude, centerLat: row.latitude, }).then(res => { |
| | | ElMessage.success('操作成功') |
| | | this.init() |
| | | }) |
| | | } |
| | | |
| | | this.init() |
| | | }, |
| | | |
| | | cancenOperateDo () { |
| | |
| | | const handleLocation = node => { |
| | | if (node.data.level === 2) { |
| | | layerParams.value.isSingleLocating = false; |
| | | // 新增:标记当前定位的文件夹ID |
| | | layerParams.value.currentLocationFolderId = node.data.id; |
| | | } else if (node.data.level === 3) { |
| | | layerParams.value.isSingleLocating = true; |
| | | // 清空文件夹定位标识 |
| | | layerParams.value.currentLocationFolderId = null; |
| | | } |
| | | |
| | | const currentCheckedKeys = [...checkedKeys.value]; |
| | | const currentCheckedNodes = [...checkedNodes.value]; |
| | | EventBus.emit('focusOnNode', node.data); |
| | | |
| | | if (node.data.level === 2) { |
| | | const folderChildren = node.data.children || []; |
| | | const childrenIds = folderChildren.map(child => child.id); |
| | | // 合并已选中的节点和当前文件夹的子节点 |
| | | const newCheckedKeys = [...new Set([...currentCheckedKeys, ...childrenIds])]; |
| | | const newCheckedNodes = [...currentCheckedNodes, ...folderChildren]; |
| | | const newChildrenIds = childrenIds.filter(id => !currentCheckedKeys.includes(id)); |
| | | const newChildrenNodes = folderChildren.filter(child => newChildrenIds.includes(child.id)); |
| | | |
| | | const newCheckedKeys = [...new Set([...currentCheckedKeys, ...newChildrenIds])]; |
| | | const newCheckedNodes = [...currentCheckedNodes, ...newChildrenNodes]; |
| | | |
| | | treeRef.value.setCheckedKeys(newCheckedKeys); |
| | | checkedKeys.value = newCheckedKeys; |
| | | checkedNodes.value = newCheckedNodes; |
| | | coverData.value = newCheckedNodes; |
| | | } |
| | | // 如果是单个节点(level 3),仅添加到选中列表(如果未选中) |
| | | else if (!currentCheckedKeys.includes(node.data.id)) { |
| | | layerParams.value.isSingleLocating = true |
| | | emit('update:coverData', coverData.value); |
| | | } else if (!currentCheckedKeys.includes(node.data.id)) { |
| | | layerParams.value.isSingleLocating = true; |
| | | currentCheckedKeys.push(node.data.id); |
| | | currentCheckedNodes.push(node.data); |
| | | treeRef.value.setCheckedKeys(currentCheckedKeys); |
| | | checkedKeys.value = currentCheckedKeys; |
| | | checkedNodes.value = currentCheckedNodes; |
| | | coverData.value = currentCheckedNodes; |
| | | } |
| | | emit('update:coverData', coverData.value); |
| | | } |
| | | }; |
| | | // 编辑按钮事件 |
| | | const handleEdit = node => { |
| | |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | :disabled-date="disabledDate" |
| | | /> |
| | | </div> |
| | | </div> |
| | |
| | | const isDisabled = computed(() => { |
| | | return layerParams.value.editingIsProhibited; |
| | | }); |
| | | |
| | | // 禁用当天之前的日期 |
| | | const disabledDate = time => { |
| | | return time.getTime() < Date.now() - 8.64e7 // 86400000 = 24 * 60 * 60 * 1000 |
| | | } |
| | | watch( |
| | | () => layerParams.value.fenceArea, |
| | | newArea => { |
| | |
| | | editFolderData: null, |
| | | editingIsProhibited: false, //禁止编辑 |
| | | isDetailShow: false, |
| | | isSingleLocating:false |
| | | isSingleLocating:false , |
| | | currentLocationFolderId:null, |
| | | }); |
| | | |
| | | const handleClick = tab => { |
| | |
| | | }; |
| | | // 点击显示区域 |
| | | const handleCoverDataUpdate = data => { |
| | | console.log('daa',data); |
| | | |
| | | selectDataList.value = data; |
| | | if (selectDataList.value.length > 0) { |
| | | |
| | |
| | | zIndex: 99, |
| | | }); |
| | | }); |
| | | |
| | | |
| | | if (!layerParams.value.isSingleLocating) { |
| | | focusOnAllFeatures(); |
| | | } |
| | |
| | | }; |
| | | const focusOnAllFeatures = () => { |
| | | if (tbJwdList.length === 0 || !viewer) return; |
| | | |
| | | // 判断是否有指定定位的文件夹 |
| | | if (layerParams.value.currentLocationFolderId) { |
| | | // 筛选当前文件夹下的所有子节点坐标 |
| | | const targetFolderPositions = selectDataList.value |
| | | .filter(item => item.folder_id === layerParams.value.currentLocationFolderId) |
| | | .flatMap(item => { |
| | | const positions = parseGeoDataToPositions(item.geo_data, item.altitude); |
| | | return positions.length >= 3 ? positions : []; |
| | | }); |
| | | |
| | | if (targetFolderPositions.length > 0) { |
| | | const positionsData = targetFolderPositions.map(pos => [ |
| | | pos.lng, |
| | | pos.lat, |
| | | pos.height || 0 |
| | | ]); |
| | | flyVisual({ |
| | | positionsData, |
| | | viewer, |
| | | multiple: activeName.value === '国土空间规划' ? 13 : 10, |
| | | pitch: -90 |
| | | }); |
| | | return; // 仅聚焦当前文件夹,结束方法 |
| | | } |
| | | } |
| | | |
| | | // 无指定文件夹时,聚焦所有选中数据 |
| | | const positionsData = tbJwdList.map(pos => [ |
| | | pos.lng, |
| | | pos.lat, |
| | |
| | | flyVisual({ |
| | | positionsData, |
| | | viewer, |
| | | multiple:activeName.value == '国土空间规划' ? 13 :4, // 缩放倍数 |
| | | multiple: activeName.value === '国土空间规划' ? 13 : 4, |
| | | pitch: -90 |
| | | }); |
| | | }; |
| | |
| | | } |
| | | }; |
| | | provide('layerParams', layerParams); |
| | | // onMounted(() => { |
| | | // initMap(); |
| | | // cesiumContextMenu(); |
| | | // getdataFolderApi(); |
| | | // EventBus.on('deleteMapEntityById', deleteMapEntityById); |
| | | // EventBus.on('deleteMapEntitiesByFolderId', deleteMapEntitiesByFolderId); |
| | | |
| | | // }); |
| | | onMounted(() => { |
| | | initMap(); |
| | | cesiumContextMenu(); |
| | |
| | | |
| | | //定位到指定节点 |
| | | const focusOnNode = (nodeData) => { |
| | | |
| | | if (!viewer || !nodeData?.geo_data) return; |
| | | |
| | | // 解析节点坐标 |
| | | const positions = parseGeoDataToPositions(nodeData.geo_data, nodeData.altitude); |
| | | if (positions.length < 3) { |
| | | if (positions.length < 3) return; |
| | | |
| | | return; |
| | | } |
| | | // level 2 节点走全量聚焦,level 3 节点走单个聚焦 |
| | | if (nodeData.level === 2) { |
| | | focusOnAllFeatures(); |
| | | } else { |
| | | flyVisual({ |
| | | positionsData: positions.map(pos => [pos.lng, pos.lat, pos.height || 0]), |
| | | viewer, |
| | | multiple:activeName.value == '国土空间规划' ? 13 :7, // 缩放倍数 |
| | | multiple: activeName.value === '国土空间规划' ? 13 : 7, // 缩放倍数 |
| | | pitch: -90 |
| | | }); |
| | | |
| | | } |
| | | }; |
| | | onBeforeUnmount(() => { |
| | | destroyMap(); |