2026-05-08 14:15:44 +08:00
|
|
|
|
<template>
|
2026-06-05 16:10:14 +08:00
|
|
|
|
<a-modal
|
|
|
|
|
|
:open="visible"
|
|
|
|
|
|
:title="title"
|
|
|
|
|
|
width="80vw"
|
|
|
|
|
|
:footer="null"
|
|
|
|
|
|
:closable="true"
|
|
|
|
|
|
@cancel="handleClose"
|
|
|
|
|
|
:destroyOnClose="true"
|
|
|
|
|
|
class="map-modal"
|
|
|
|
|
|
>
|
2026-06-08 09:33:06 +08:00
|
|
|
|
<!-- 问题:
|
|
|
|
|
|
1.基础信息图片展示是什么逻辑
|
|
|
|
|
|
2. 电站专题展示逻辑
|
2026-06-10 15:45:16 +08:00
|
|
|
|
3. 实时视频回放 少接口✅️
|
2026-06-08 09:33:06 +08:00
|
|
|
|
4. 预警提示 少接口
|
2026-06-10 15:45:16 +08:00
|
|
|
|
5. 生态流量 达标率查询不对(✅️)
|
2026-06-08 09:33:06 +08:00
|
|
|
|
6. 鱼类适应性繁殖同期对比NAN (王)
|
2026-06-09 11:44:29 +08:00
|
|
|
|
7. 出库水温 综合分析 导出没做
|
2026-06-10 15:45:16 +08:00
|
|
|
|
8. 栖息地-流量监测 没有水位视频和流量视频 字段没数据
|
|
|
|
|
|
9. 栖息地 水温、水质、流量没有数据没法测
|
|
|
|
|
|
|
2026-06-08 09:33:06 +08:00
|
|
|
|
-->
|
2026-06-03 18:25:57 +08:00
|
|
|
|
<div v-if="modelStore.showStcdSelector" class="stcd-selector-wrapper">
|
2026-06-05 16:10:14 +08:00
|
|
|
|
<a-select
|
|
|
|
|
|
v-model:value="modelStore.params.stcd"
|
|
|
|
|
|
placeholder="请选择测站"
|
|
|
|
|
|
style="width: 240px; margin-bottom: 12px"
|
|
|
|
|
|
:options="modelStore.stcdOptions"
|
|
|
|
|
|
show-search
|
|
|
|
|
|
:filter-option="filterOption"
|
|
|
|
|
|
@change="handleStcdChange"
|
|
|
|
|
|
>
|
2026-06-03 18:25:57 +08:00
|
|
|
|
</a-select>
|
|
|
|
|
|
</div>
|
2026-05-08 19:11:10 +08:00
|
|
|
|
<a-tabs :active-key="currentActiveKey" @change="onTabChange">
|
2026-05-09 19:30:03 +08:00
|
|
|
|
<a-tab-pane v-for="tab in tabsConfig" :key="tab.key" :tab="tab.name">
|
2026-05-08 19:11:10 +08:00
|
|
|
|
</a-tab-pane>
|
2026-06-10 15:45:16 +08:00
|
|
|
|
<template #rightExtra v-if="anchor.sttp == 'ENG' || anchor.sttp == 'eng'">
|
2026-05-11 17:45:09 +08:00
|
|
|
|
<a-tooltip :title="!isEngConfig ? '' : '该电站无专题配置'">
|
|
|
|
|
|
<a-button type="primary" :disabled="isEngConfig">
|
|
|
|
|
|
<i class="icon iconfont icon-topic mr-[5px]"></i>
|
|
|
|
|
|
电站专题
|
2026-06-05 16:10:14 +08:00
|
|
|
|
</a-button></a-tooltip
|
|
|
|
|
|
>
|
2026-05-09 19:30:03 +08:00
|
|
|
|
</template>
|
2026-05-08 19:11:10 +08:00
|
|
|
|
</a-tabs>
|
2026-06-05 16:10:14 +08:00
|
|
|
|
<!-- 内容区域 - 使用动态组件 + keep-alive 实现按需加载和缓存 -->
|
|
|
|
|
|
<keep-alive>
|
|
|
|
|
|
<div class="content">
|
2026-06-10 15:45:16 +08:00
|
|
|
|
<div class="content-wrapper" v-show="isQxdMode(currentActiveKey)">
|
|
|
|
|
|
测站:
|
|
|
|
|
|
<a-select
|
|
|
|
|
|
v-model:value="currentQxdSelectedStcd"
|
|
|
|
|
|
:options="qxdStationOptions"
|
|
|
|
|
|
style="width: 200px; margin-bottom: 12px"
|
|
|
|
|
|
placeholder="请选择站点"
|
|
|
|
|
|
@change="handleQxdStationChange"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
2026-06-05 16:10:14 +08:00
|
|
|
|
<!-- 基本信息 -->
|
|
|
|
|
|
<BasicInfo
|
|
|
|
|
|
v-show="currentActiveKey === 'basicInfo'"
|
|
|
|
|
|
:url="getTabUrl('basicInfo')"
|
|
|
|
|
|
:is-active="currentActiveKey === 'basicInfo'"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<!-- 实时视频 -->
|
|
|
|
|
|
<VideoInfo
|
|
|
|
|
|
v-show="currentActiveKey === 'videoInfo'"
|
|
|
|
|
|
:is-active="currentActiveKey === 'videoInfo'"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<!-- 全景影像 -->
|
|
|
|
|
|
<PanoramaInfo
|
|
|
|
|
|
v-show="currentActiveKey === 'panoramaInfo'"
|
|
|
|
|
|
:url="getTabUrl('panoramaInfo')"
|
|
|
|
|
|
:is-active="currentActiveKey === 'panoramaInfo'"
|
|
|
|
|
|
/>
|
2026-06-09 11:44:29 +08:00
|
|
|
|
<!-- 监测数据 - 电站运行过程线 -->
|
2026-06-05 16:10:14 +08:00
|
|
|
|
<MonitorInfo
|
|
|
|
|
|
v-show="currentActiveKey === 'monitorInfo'"
|
|
|
|
|
|
:is-active="currentActiveKey === 'monitorInfo'"
|
2026-06-09 11:44:29 +08:00
|
|
|
|
/>
|
|
|
|
|
|
<!-- 监测数据 - 水温 -->
|
|
|
|
|
|
<WaterTemperature
|
|
|
|
|
|
v-show="currentActiveKey === 'WaterTemperature'"
|
|
|
|
|
|
:is-active="currentActiveKey === 'WaterTemperature'"
|
2026-06-10 15:45:16 +08:00
|
|
|
|
:code="getTabCode('WaterTemperature')"
|
|
|
|
|
|
:stcd="
|
|
|
|
|
|
getTabCode('WaterTemperature') == 'qxd.tabs.jcsj'
|
|
|
|
|
|
? qxdSelectedStcd
|
|
|
|
|
|
: ''
|
|
|
|
|
|
"
|
2026-06-09 11:44:29 +08:00
|
|
|
|
/>
|
|
|
|
|
|
<!-- 监测数据 - 垂向水温 -->
|
|
|
|
|
|
<VerticalWaterTemperature
|
|
|
|
|
|
v-show="currentActiveKey === 'VerticalWaterTemperature'"
|
|
|
|
|
|
:is-active="currentActiveKey === 'VerticalWaterTemperature'"
|
2026-06-05 16:10:14 +08:00
|
|
|
|
/>
|
2026-06-10 15:45:16 +08:00
|
|
|
|
<!-- 监测数据 - 水质 -->
|
|
|
|
|
|
<WaterQuality
|
|
|
|
|
|
v-show="currentActiveKey === 'WaterQuality'"
|
|
|
|
|
|
:is-active="currentActiveKey === 'WaterQuality'"
|
|
|
|
|
|
:code="getTabCode('WaterQuality')"
|
|
|
|
|
|
:stcd="
|
|
|
|
|
|
getTabCode('WaterQuality') == 'qxd.tabs.szjc'
|
|
|
|
|
|
? qxdSelectedStcdWq
|
|
|
|
|
|
: ''
|
|
|
|
|
|
"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<!-- 流量监测 -->
|
|
|
|
|
|
<FlowMeasure
|
|
|
|
|
|
v-show="currentActiveKey === 'FlowMeasure'"
|
|
|
|
|
|
:is-active="currentActiveKey === 'FlowMeasure'"
|
|
|
|
|
|
:url="getTabUrl('FlowMeasure')"
|
|
|
|
|
|
:code="getTabCode('FlowMeasure')"
|
|
|
|
|
|
:stcd="
|
|
|
|
|
|
getTabCode('FlowMeasure') == 'qxd.tabs.lcjs'
|
|
|
|
|
|
? qxdSelectedStcdZq
|
|
|
|
|
|
: ''
|
|
|
|
|
|
"
|
|
|
|
|
|
/>
|
2026-06-05 16:10:14 +08:00
|
|
|
|
<!-- 预警提示 -->
|
|
|
|
|
|
<EarlyWarningAlert
|
|
|
|
|
|
v-show="currentActiveKey === 'tableTabs'"
|
|
|
|
|
|
:tabs-items="getTabChildren('tableTabs')"
|
|
|
|
|
|
:is-active="currentActiveKey === 'tableTabs'"
|
|
|
|
|
|
/>
|
2026-06-08 09:33:06 +08:00
|
|
|
|
<!-- 生态流量 -->
|
|
|
|
|
|
<EcologicalFlow
|
|
|
|
|
|
v-show="currentActiveKey === 'EcologicalFlow'"
|
|
|
|
|
|
:is-active="currentActiveKey === 'EcologicalFlow'"
|
|
|
|
|
|
/>
|
2026-06-05 16:10:14 +08:00
|
|
|
|
<!-- 鱼类繁殖适宜性分析 -->
|
|
|
|
|
|
<WaterTemperatureRep
|
|
|
|
|
|
v-show="currentActiveKey === 'WaterTemperatureRep'"
|
|
|
|
|
|
:is-active="currentActiveKey === 'WaterTemperatureRep'"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<!-- 查看报告 -->
|
|
|
|
|
|
<Attachment
|
|
|
|
|
|
v-show="currentActiveKey === 'attachment'"
|
|
|
|
|
|
:is-active="currentActiveKey === 'attachment'"
|
|
|
|
|
|
tabKey="attachment"
|
|
|
|
|
|
:show-download="false"
|
|
|
|
|
|
:url="getTabUrl('attachment')"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<!-- 批复文件 -->
|
|
|
|
|
|
<Attachment
|
|
|
|
|
|
v-show="currentActiveKey === 'approval'"
|
|
|
|
|
|
:is-active="currentActiveKey === 'approval'"
|
|
|
|
|
|
tabKey="approval"
|
|
|
|
|
|
:show-download="true"
|
|
|
|
|
|
:url="getTabUrl('approval')"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</keep-alive>
|
2026-05-08 14:15:44 +08:00
|
|
|
|
</a-modal>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2026-06-05 16:10:14 +08:00
|
|
|
|
import { ref, watch, reactive, computed } from 'vue';
|
2026-05-08 14:15:44 +08:00
|
|
|
|
// 导入预定义的 Tab 内容组件
|
2026-06-05 16:10:14 +08:00
|
|
|
|
import BasicInfo from './components/BasicInfo.vue'; // 基本信息
|
|
|
|
|
|
import VideoInfo from './components/videoInfo.vue'; // 实时视频
|
|
|
|
|
|
import PanoramaInfo from './components/PanoramaInfo.vue'; // 全景影像
|
2026-06-09 11:44:29 +08:00
|
|
|
|
import MonitorInfo from './components/MonitorInfo.vue'; // 电站运行过程线
|
|
|
|
|
|
import WaterTemperature from './components/WaterTemperature.vue'; // 水温
|
|
|
|
|
|
import VerticalWaterTemperature from './components/VerticalWaterTemperature.vue'; // 垂向水温
|
2026-06-10 15:45:16 +08:00
|
|
|
|
import WaterQuality from './components/WaterQuality.vue'; // 水质
|
2026-06-05 16:10:14 +08:00
|
|
|
|
import EarlyWarningAlert from './components/EarlyWarningAlert.vue'; // 预警提示
|
2026-06-10 15:45:16 +08:00
|
|
|
|
import FlowMeasure from './components/FlowMeasure.vue'; // 流量监测
|
2026-06-08 09:33:06 +08:00
|
|
|
|
import EcologicalFlow from './components/EcologicalFlow.vue'; // 生态流量
|
2026-06-05 16:10:14 +08:00
|
|
|
|
import Attachment from './components/Attachment.vue'; // 查看报告/批复文件
|
|
|
|
|
|
import WaterTemperatureRep from './components/WaterTemperatureRep.vue'; // 水温对比数据
|
|
|
|
|
|
import { useModelStore } from '@/store/modules/model';
|
|
|
|
|
|
import { handleTabs } from './setting.config';
|
2026-06-10 15:45:16 +08:00
|
|
|
|
import {
|
|
|
|
|
|
getMonitorDataWt,
|
|
|
|
|
|
getMonitorDataWq,
|
|
|
|
|
|
getMonitorDataZq
|
|
|
|
|
|
} from '@/api/mapModal';
|
2026-05-09 19:30:03 +08:00
|
|
|
|
|
|
|
|
|
|
const modelStore = useModelStore();
|
|
|
|
|
|
const tabsConfig = ref([]);
|
|
|
|
|
|
// 判断是否显示电站专题配置
|
|
|
|
|
|
const isEngConfig = ref(true);
|
2026-06-10 15:45:16 +08:00
|
|
|
|
|
|
|
|
|
|
// ==================== qxd 栖息地模式相关 ====================
|
|
|
|
|
|
// qxd模式配置映射
|
|
|
|
|
|
const qxdConfigMap: Record<
|
|
|
|
|
|
string,
|
|
|
|
|
|
{
|
|
|
|
|
|
sttpCode: string;
|
|
|
|
|
|
apiFn: (data: any) => Promise<any>;
|
|
|
|
|
|
selectProp: string;
|
|
|
|
|
|
}
|
|
|
|
|
|
> = {
|
|
|
|
|
|
'qxd.tabs.jcsj': {
|
|
|
|
|
|
// 水温
|
|
|
|
|
|
sttpCode: 'WTRV',
|
|
|
|
|
|
apiFn: getMonitorDataWt,
|
|
|
|
|
|
selectProp: 'qxdSelectedStcd'
|
|
|
|
|
|
},
|
|
|
|
|
|
'qxd.tabs.szjc': {
|
|
|
|
|
|
// 水质
|
|
|
|
|
|
sttpCode: 'WQ',
|
|
|
|
|
|
apiFn: getMonitorDataWq,
|
|
|
|
|
|
selectProp: 'qxdSelectedStcdWq'
|
|
|
|
|
|
},
|
|
|
|
|
|
'qxd.tabs.lcjs': {
|
|
|
|
|
|
// 流量监测
|
|
|
|
|
|
sttpCode: 'ZQ',
|
|
|
|
|
|
apiFn: getMonitorDataZq,
|
|
|
|
|
|
selectProp: 'qxdSelectedStcdZq'
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 各模式的站点选项和选中值
|
|
|
|
|
|
const qxdStationOptions = ref<{ label: string; value: string }[]>([]);
|
|
|
|
|
|
const qxdSelectedStcd = ref<string>('');
|
|
|
|
|
|
const qxdSelectedStcdWq = ref<string>('');
|
|
|
|
|
|
const qxdSelectedStcdZq = ref<string>('');
|
|
|
|
|
|
const qxdLoadedCodes = ref<Set<string>>(new Set());
|
|
|
|
|
|
|
|
|
|
|
|
// 获取当前tab对应的qxd配置
|
|
|
|
|
|
const getCurrentQxdConfig = (tabKey: string) => {
|
|
|
|
|
|
const code = getTabCode(tabKey);
|
|
|
|
|
|
return code && qxdConfigMap[code] ? qxdConfigMap[code] : null;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 获取选中的stcd
|
|
|
|
|
|
const getQxdSelectedStcd = (tabKey: string) => {
|
|
|
|
|
|
const config = getCurrentQxdConfig(tabKey);
|
|
|
|
|
|
if (!config) return '';
|
|
|
|
|
|
switch (config.selectProp) {
|
|
|
|
|
|
case 'qxdSelectedStcd':
|
|
|
|
|
|
return qxdSelectedStcd.value;
|
|
|
|
|
|
case 'qxdSelectedStcdWq':
|
|
|
|
|
|
return qxdSelectedStcdWq.value;
|
|
|
|
|
|
case 'qxdSelectedStcdZq':
|
|
|
|
|
|
return qxdSelectedStcdZq.value;
|
|
|
|
|
|
default:
|
|
|
|
|
|
return '';
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 设置选中的stcd
|
|
|
|
|
|
const setQxdSelectedStcd = (tabKey: string, value: string) => {
|
|
|
|
|
|
const config = getCurrentQxdConfig(tabKey);
|
|
|
|
|
|
if (!config) return;
|
|
|
|
|
|
switch (config.selectProp) {
|
|
|
|
|
|
case 'qxdSelectedStcd':
|
|
|
|
|
|
qxdSelectedStcd.value = value;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'qxdSelectedStcdWq':
|
|
|
|
|
|
qxdSelectedStcdWq.value = value;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'qxdSelectedStcdZq':
|
|
|
|
|
|
qxdSelectedStcdZq.value = value;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 加载栖息地站点列表
|
|
|
|
|
|
const loadQxdStationList = async (tabKey: string) => {
|
|
|
|
|
|
const code = getTabCode(tabKey);
|
|
|
|
|
|
if (!code || !qxdConfigMap[code]) return;
|
|
|
|
|
|
if (qxdLoadedCodes.value.has(code)) return;
|
|
|
|
|
|
|
|
|
|
|
|
const config = qxdConfigMap[code];
|
|
|
|
|
|
try {
|
|
|
|
|
|
const params = {
|
|
|
|
|
|
filter: {
|
|
|
|
|
|
logic: 'and',
|
|
|
|
|
|
filters: [
|
|
|
|
|
|
{
|
|
|
|
|
|
field: 'fhstcd',
|
|
|
|
|
|
operator: 'eq',
|
|
|
|
|
|
dataType: 'string',
|
|
|
|
|
|
value: modelStore.params.stcd
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
field: 'sttpCode',
|
|
|
|
|
|
operator: 'eq',
|
|
|
|
|
|
dataType: 'string',
|
|
|
|
|
|
value: config.sttpCode
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
select: ['stcd', 'stnm']
|
|
|
|
|
|
};
|
|
|
|
|
|
const res = await config.apiFn(params);
|
|
|
|
|
|
const stations = res?.data?.data || res?.data?.records || [];
|
|
|
|
|
|
if (stations.length > 0) {
|
|
|
|
|
|
qxdStationOptions.value = stations.map((item: any) => ({
|
|
|
|
|
|
label: item.stnm,
|
|
|
|
|
|
value: item.stcd
|
|
|
|
|
|
}));
|
|
|
|
|
|
setQxdSelectedStcd(tabKey, stations[0].stcd);
|
|
|
|
|
|
}
|
|
|
|
|
|
qxdLoadedCodes.value.add(code);
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
console.error(`获取站点列表失败(${code}):`, error);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 获取当前激活tab对应的选中stcd (支持v-model双向绑定)
|
|
|
|
|
|
const currentQxdSelectedStcd = computed({
|
|
|
|
|
|
get: () => getQxdSelectedStcd(currentActiveKey.value),
|
|
|
|
|
|
set: (val: string) => setQxdSelectedStcd(currentActiveKey.value, val)
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// 判断是否是qxd模式
|
|
|
|
|
|
const isQxdMode = (tabKey: string) => {
|
|
|
|
|
|
const code = getTabCode(tabKey);
|
|
|
|
|
|
return code && qxdConfigMap[code] ? true : false;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 处理栖息地站点切换
|
|
|
|
|
|
const handleQxdStationChange = () => {
|
|
|
|
|
|
// 站点切换后,子组件会通过 watch stcd 自动刷新
|
|
|
|
|
|
};
|
2026-05-08 19:11:10 +08:00
|
|
|
|
// import MapView from './components/MapView.vue';
|
|
|
|
|
|
// import SurroundingInfo from './components/SurroundingInfo.vue';
|
2026-05-08 14:15:44 +08:00
|
|
|
|
|
|
|
|
|
|
// 定义 Tab 配置项接口
|
|
|
|
|
|
interface TabItem {
|
|
|
|
|
|
key: string;
|
|
|
|
|
|
title: string;
|
2026-05-08 19:11:10 +08:00
|
|
|
|
url: string;
|
2026-05-08 14:15:44 +08:00
|
|
|
|
}
|
2026-06-05 16:10:14 +08:00
|
|
|
|
// 获取 Tab 配置项的 URL
|
|
|
|
|
|
const getTabUrl = (key: string) => {
|
|
|
|
|
|
const tab = tabsConfig.value.find((item: any) => item.key === key);
|
|
|
|
|
|
return tab?.url || '';
|
|
|
|
|
|
};
|
|
|
|
|
|
// 获取 Tab 配置项的子 Tab
|
|
|
|
|
|
const getTabChildren = (key: string) => {
|
|
|
|
|
|
console.log(tabsConfig.value);
|
|
|
|
|
|
const tab = tabsConfig.value.find((item: any) => item.key === key);
|
|
|
|
|
|
return tab?.tabs || [];
|
|
|
|
|
|
};
|
|
|
|
|
|
// 获取 Tab 配置项的 code
|
|
|
|
|
|
const getTabCode = (key: string) => {
|
|
|
|
|
|
const tab = tabsConfig.value.find((item: any) => item.key === key);
|
|
|
|
|
|
return tab?.code || '';
|
|
|
|
|
|
};
|
2026-05-08 14:15:44 +08:00
|
|
|
|
// 定义 Props
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
|
|
visible: boolean;
|
|
|
|
|
|
title?: string;
|
|
|
|
|
|
activeKey?: string; // 外部控制的当前激活 tab
|
|
|
|
|
|
data?: any; // 可选:传递给内部组件的数据
|
|
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
|
|
// 定义 Emits
|
2026-05-08 19:11:10 +08:00
|
|
|
|
// 添加 'update:activeKey' 以支持 v-model:active-key
|
2026-05-08 14:15:44 +08:00
|
|
|
|
const emit = defineEmits<{
|
2026-06-05 16:10:14 +08:00
|
|
|
|
(e: 'update:visible', value: boolean): void;
|
|
|
|
|
|
(e: 'change', key: string): void;
|
2026-05-08 14:15:44 +08:00
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
|
|
// 内部维护的 activeKey
|
2026-06-05 16:10:14 +08:00
|
|
|
|
const currentActiveKey = ref<string>('');
|
2026-06-10 15:45:16 +08:00
|
|
|
|
const anchor = ref<string>('');
|
2026-05-08 14:15:44 +08:00
|
|
|
|
|
2026-05-08 19:11:10 +08:00
|
|
|
|
// 监听外部传入的 activeKey 变化,同步到内部状态
|
|
|
|
|
|
watch(
|
|
|
|
|
|
() => props.activeKey,
|
2026-06-05 16:10:14 +08:00
|
|
|
|
newVal => {
|
2026-05-08 19:11:10 +08:00
|
|
|
|
if (newVal && newVal !== currentActiveKey.value) {
|
|
|
|
|
|
currentActiveKey.value = newVal;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{ immediate: true }
|
|
|
|
|
|
);
|
2026-05-09 19:30:03 +08:00
|
|
|
|
watch(
|
|
|
|
|
|
() => modelStore.params,
|
2026-06-05 16:10:14 +08:00
|
|
|
|
newVal => {
|
|
|
|
|
|
if (!newVal || Object.keys(newVal).length === 0) return;
|
2026-05-13 08:45:15 +08:00
|
|
|
|
console.log(newVal);
|
2026-06-10 15:45:16 +08:00
|
|
|
|
anchor.value = newVal;
|
|
|
|
|
|
let params = newVal;
|
|
|
|
|
|
if (['VD', 'WTRV', 'ZQ', 'WQ'].includes(params?.sttpCode)) {
|
|
|
|
|
|
params.sttp = params.sttpCode;
|
|
|
|
|
|
}
|
|
|
|
|
|
tabsConfig.value = handleTabs({ ...params });
|
2026-05-11 17:45:09 +08:00
|
|
|
|
let value = tabsConfig.value.find((item: any) => item.default);
|
|
|
|
|
|
currentActiveKey.value = value?.key;
|
2026-05-09 19:30:03 +08:00
|
|
|
|
},
|
|
|
|
|
|
{ deep: true, immediate: true }
|
|
|
|
|
|
);
|
2026-06-10 15:45:16 +08:00
|
|
|
|
|
|
|
|
|
|
// 监听 tab 切换,如果是 qxd 模式,加载站点列表
|
|
|
|
|
|
watch(
|
|
|
|
|
|
() => currentActiveKey.value,
|
|
|
|
|
|
activeKey => {
|
|
|
|
|
|
const code = getTabCode(activeKey);
|
|
|
|
|
|
if (code && qxdConfigMap[code]) {
|
|
|
|
|
|
loadQxdStationList(activeKey);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{ immediate: true }
|
|
|
|
|
|
);
|
2026-05-08 19:11:10 +08:00
|
|
|
|
// 监听内部 tab 切换
|
|
|
|
|
|
const onTabChange = (key: string) => {
|
|
|
|
|
|
currentActiveKey.value = key;
|
|
|
|
|
|
// 通知父组件更新 activeKey (支持 v-model)
|
|
|
|
|
|
// 通知父组件发生了切换事件 (用于业务逻辑,如加载数据)
|
2026-06-05 16:10:14 +08:00
|
|
|
|
emit('change', key);
|
2026-05-08 19:11:10 +08:00
|
|
|
|
};
|
2026-05-08 14:15:44 +08:00
|
|
|
|
|
|
|
|
|
|
// 关闭弹窗
|
|
|
|
|
|
const handleClose = () => {
|
2026-06-05 16:10:14 +08:00
|
|
|
|
emit('update:visible', false);
|
|
|
|
|
|
modelStore.params = {};
|
2026-06-03 18:25:57 +08:00
|
|
|
|
// 清理状态,避免影响下次打开
|
|
|
|
|
|
modelStore.showStcdSelector = false;
|
|
|
|
|
|
modelStore.stcdOptions = [];
|
2026-06-10 15:45:16 +08:00
|
|
|
|
// 清理qxd模式状态
|
|
|
|
|
|
qxdStationOptions.value = [];
|
|
|
|
|
|
qxdSelectedStcd.value = '';
|
|
|
|
|
|
qxdSelectedStcdWq.value = '';
|
|
|
|
|
|
qxdSelectedStcdZq.value = '';
|
|
|
|
|
|
qxdLoadedCodes.value = new Set();
|
2026-05-08 14:15:44 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 为了方便模板中使用,将 props.data 暴露给模板
|
|
|
|
|
|
const modalData = ref(props.data);
|
2026-05-08 19:11:10 +08:00
|
|
|
|
watch(
|
|
|
|
|
|
() => props.data,
|
2026-06-05 16:10:14 +08:00
|
|
|
|
newVal => {
|
2026-05-08 19:11:10 +08:00
|
|
|
|
modalData.value = newVal;
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
2026-06-03 18:25:57 +08:00
|
|
|
|
// 搜索过滤函数
|
|
|
|
|
|
const filterOption = (input: string, option: any) => {
|
|
|
|
|
|
return option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 处理测站切换
|
|
|
|
|
|
const handleStcdChange = (newStcd: string) => {
|
|
|
|
|
|
console.log('【测站切换】', newStcd);
|
|
|
|
|
|
// 由于 BasicInfo.vue 监听了 stcd 变化,这里只需更新 store
|
|
|
|
|
|
// 如果需要刷新所有 tab 的数据,可以在这里触发事件
|
|
|
|
|
|
};
|
2026-05-08 14:15:44 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
.map-modal {
|
2026-05-08 19:11:10 +08:00
|
|
|
|
.content {
|
|
|
|
|
|
min-height: 600px;
|
2026-05-08 14:15:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-05-08 19:11:10 +08:00
|
|
|
|
</style>
|