电站专题优化
This commit is contained in:
commit
ae2ff1ced4
@ -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
|
||||||
});
|
});
|
||||||
|
|||||||
@ -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 版本对齐)
|
||||||
|
|||||||
@ -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) {
|
||||||
|
|
||||||
|
nextTick(() => {
|
||||||
|
requestAnimationFrame(() => {
|
||||||
const mc = (window as any).mapClass;
|
const mc = (window as any).mapClass;
|
||||||
mc?.flyTopanto?.([station.lgtd, station.lttd], 14);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user