电站专题优化

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) {
return request({
url: '/api/wmp-sys-server/sys/psbmodulelbb/GetKendoList',
url: '/sys/psbmodulelbb/GetKendoListCust',
method: 'post',
data
});

View File

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

View File

@ -173,10 +173,11 @@ function onTreeSelect(value: any, item: any) {
waitForMapReady(() => {
setTimeout(() => {
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);
});
nextTick(collapseLegend);
}
/** 在树数据中查找叶子节点对应的父节点基地级code */
@ -260,7 +261,7 @@ watch(
watch(
() => layoutData.value,
(val) => {
if (val?.type) {
if (val?.type && uiStore.mapType !== '3D') {
const sk = LAYOUT_GRID_SKELETONS[val.type];
const rows = sk?.gridTemplateRows?.split(' ') || [];
const bottomRowHeight = rows[rows.length - 1];
@ -272,21 +273,30 @@ watch(
// ==================== ====================
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;
if (el) {
el.style.left = '';
el.style.right = '';
el.style.bottom = '';
}
if (el) { 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 ====================
watch(
() => uiStore.mapType,
(newType) => {
showLayout.value = newType !== '3D';
nextTick(collapseLegend);
}
);
@ -299,17 +309,27 @@ watch(
resetMapControlPositions();
const station = dianZhanStation.value;
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) {
// 3D 2D +
// 3D 2D + +
if (layoutData.value?.type) {
const sk = LAYOUT_GRID_SKELETONS[layoutData.value.type];
const rows = sk?.gridTemplateRows?.split(' ') || [];
nextTick(() => setMapLegendPos(layoutData.value!.type, layoutData.value, 460, rows[rows.length - 1]));
}
switchToSatellite();
const station = dianZhanStation.value;
if (station) {
const mc = (window as any).mapClass;
mc?.flyTopanto?.([Number(station.lgtd), Number(station.lttd)], 14);
}
}
}
);