电站专题优化

This commit is contained in:
王兴凯 2026-07-31 15:00:29 +08:00
commit ae2ff1ced4
3 changed files with 42 additions and 33 deletions

View File

@ -70,7 +70,7 @@ export function getStInfoByStcd(params: any) {
// 检查电站是否有专题配置数据 // 检查电站是否有专题配置数据
export function checkPowerStationTopic(data: any) { export function checkPowerStationTopic(data: any) {
return request({ return request({
url: '/api/wmp-sys-server/sys/psbmodulelbb/GetKendoList', url: '/sys/psbmodulelbb/GetKendoListCust',
method: 'post', method: 'post',
data data
}); });

View File

@ -301,7 +301,7 @@ import {
checkPowerStationTopic checkPowerStationTopic
} from '@/api/mapModal'; } from '@/api/mapModal';
import { useDraggable } from '@/utils/drag'; import { useDraggable } from '@/utils/drag';
// import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
const modelStore = useModelStore(); const modelStore = useModelStore();
const tabsConfig = ref([]); const tabsConfig = ref([]);
@ -322,7 +322,7 @@ const isJiangJu = computed(() => {
// TODO: // TODO:
return false; return false;
}); });
// const router = useRouter(); const router = useRouter();
/** /**
* 查询电站是否有专题配置数据 * 查询电站是否有专题配置数据
@ -348,7 +348,8 @@ const checkPowerStationTopicData = async (stcd: string) => {
] ]
} }
}); });
hasPowerStatData.value = res?.data?.data && res?.data?.data?.length > 0; // debugger
hasPowerStatData.value = res?.data && res?.data?.length > 0;
} catch (error) { } catch (error) {
console.error('查询电站专题配置失败:', error); console.error('查询电站专题配置失败:', error);
hasPowerStatData.value = false; hasPowerStatData.value = false;
@ -359,25 +360,13 @@ const checkPowerStationTopicData = async (stcd: string) => {
* 跳转到电站专题页面 * 跳转到电站专题页面
*/ */
const gotoEngTopic = () => { const gotoEngTopic = () => {
// TODO: const stcd = modelStore.params?.stcd;
/* if (!stcd) return;
const url = `/qgc-biz-home/${hbbSearchParams}`; router.push({
const menu = { path: '/dianZhanZhuanTi/dianZhanZhuanTi',
id: 'dianZhanZhuanTi', query: { stcd }
url, });
name: '电站专题'
};
// stcd
localStorage.setItem('modalSelectedEngTopic', JSON.stringify({ stcd: modelStore.params.stcd }));
//
handleClose(); handleClose();
// 使 Vue Router
// router.push(url);
*/
console.log('电站专题跳转(暂未实现):', modelStore.params.stcd);
}; };
// React // React

View File

@ -173,10 +173,11 @@ function onTreeSelect(value: any, item: any) {
waitForMapReady(() => { waitForMapReady(() => {
setTimeout(() => { setTimeout(() => {
if ((window as any).mapClass) { if ((window as any).mapClass) {
(window as any).mapClass.flyTopanto([item.lgtd, item.lttd], 14); (window as any).mapClass.flyTopanto([Number(item.lgtd), Number(item.lttd)], 12);
} }
}, 0); }, 0);
}); });
nextTick(collapseLegend);
} }
/** 在树数据中查找叶子节点对应的父节点基地级code */ /** 在树数据中查找叶子节点对应的父节点基地级code */
@ -260,7 +261,7 @@ watch(
watch( watch(
() => layoutData.value, () => layoutData.value,
(val) => { (val) => {
if (val?.type) { if (val?.type && uiStore.mapType !== '3D') {
const sk = LAYOUT_GRID_SKELETONS[val.type]; const sk = LAYOUT_GRID_SKELETONS[val.type];
const rows = sk?.gridTemplateRows?.split(' ') || []; const rows = sk?.gridTemplateRows?.split(' ') || [];
const bottomRowHeight = rows[rows.length - 1]; const bottomRowHeight = rows[rows.length - 1];
@ -272,21 +273,30 @@ watch(
// ==================== ==================== // ==================== ====================
function resetMapControlPositions() { function resetMapControlPositions() {
['#qgc-legendtl', '#map-filter-container', '#map-compassControl', '#map-controller', '#map-monitor', '#map-baselayer'].forEach(sel => { const legend = document.querySelector('#qgc-legendtl') as HTMLElement;
const controller = document.querySelector('#map-controller') as HTMLElement;
const baselayer = document.querySelector('#map-baselayer') as HTMLElement;
if (legend) { legend.style.left = '0px'; legend.style.bottom = '0px'; }
if (controller) { controller.style.right = '12px'; controller.style.bottom = '114px'; }
if (baselayer) { baselayer.style.right = '60px'; baselayer.style.bottom = '0px'; }
['#map-filter-container', '#map-compassControl', '#map-monitor'].forEach(sel => {
const el = document.querySelector(sel) as HTMLElement; const el = document.querySelector(sel) as HTMLElement;
if (el) { if (el) { el.style.left = ''; el.style.right = ''; el.style.bottom = ''; }
el.style.left = '';
el.style.right = '';
el.style.bottom = '';
}
}); });
} }
/** 收缩图例(仅在展开时点击收起按钮) */
function collapseLegend() {
const icon = document.querySelector('.legendBtn .icon-fold') as HTMLElement;
icon?.parentElement?.click();
}
// ==================== 3D/2D ==================== // ==================== 3D/2D ====================
watch( watch(
() => uiStore.mapType, () => uiStore.mapType,
(newType) => { (newType) => {
showLayout.value = newType !== '3D'; showLayout.value = newType !== '3D';
nextTick(collapseLegend);
} }
); );
@ -299,17 +309,27 @@ watch(
resetMapControlPositions(); resetMapControlPositions();
const station = dianZhanStation.value; const station = dianZhanStation.value;
if (station) { if (station) {
const mc = (window as any).mapClass;
mc?.flyTopanto?.([station.lgtd, station.lttd], 14); nextTick(() => {
requestAnimationFrame(() => {
const mc = (window as any).mapClass;
mc?.flyTopanto?.([Number(station.lgtd), Number(station.lttd)], 12);
});
});
} }
} else if (showLayout.value) { } else if (showLayout.value) {
// 3D 2D + // 3D 2D + +
if (layoutData.value?.type) { if (layoutData.value?.type) {
const sk = LAYOUT_GRID_SKELETONS[layoutData.value.type]; const sk = LAYOUT_GRID_SKELETONS[layoutData.value.type];
const rows = sk?.gridTemplateRows?.split(' ') || []; const rows = sk?.gridTemplateRows?.split(' ') || [];
nextTick(() => setMapLegendPos(layoutData.value!.type, layoutData.value, 460, rows[rows.length - 1])); nextTick(() => setMapLegendPos(layoutData.value!.type, layoutData.value, 460, rows[rows.length - 1]));
} }
switchToSatellite(); switchToSatellite();
const station = dianZhanStation.value;
if (station) {
const mc = (window as any).mapClass;
mc?.flyTopanto?.([Number(station.lgtd), Number(station.lttd)], 14);
}
} }
} }
); );