WholeProcessPlatform/frontend/src/store/modules/model.ts

91 lines
2.8 KiB
TypeScript
Raw Normal View History

import { defineStore } from 'pinia';
import { ref } from 'vue';
export const useModelStore = defineStore('model', () => {
// state
const modalVisible = ref(false);
2026-06-15 09:18:00 +08:00
const ylfbModalVisible = ref(false); // 鱼类分布弹窗显示状态
const currentTabKey = ref('basicInfo');
const tabList = ref([]);
const title = ref('');
const isBasicEdit = ref(false);
const showStcdSelector = ref(false); // 是否显示下拉框
2026-06-15 09:18:00 +08:00
const stcdOptions = ref<Array<{ label: string; value: string }>>([]); // 可选测站列表
2026-06-12 16:59:35 +08:00
// 新增:功能迁移所需的状态字段
const baseId = ref<string>(''); // 当前基地 ID
const hasPowerStatData = ref<boolean>(false); // 电站是否有专题数据
const isPowerStatPage = ref<boolean>(false); // 是否在电站专题页面
const verticalWaterStcd = ref<string>(''); // 垂向水温子站点编码
const aiSites = ref<any[]>([]); // AI 识别站点列表
const wtConfig = ref<{ ioWtrv?: boolean; hasRstcdWtvt?: boolean }>({}); // 水温配置
const wqShow = ref<boolean>(false); // 水质 AI 预测显示
const fishTabInfo = ref<any>(null); // 鱼类监测数据信息
const selectedAnchorPoint = ref<any>(null); // 地图筛选下拉选中的点位对象(供基本信息等面板消费)
// 全局抽屉内容模式:'basicInfo' 展示基础信息,'speciesIntro' 展示物种介绍(动物/植物介绍)
const globalDrawerMode = ref<'basicInfo' | 'speciesIntro'>('basicInfo');
// 鱼种下拉选中的物种列表(供物种介绍面板展示;预留 image/intro 等字段,后续对接真实数据源)
const selectedFishSpecies = ref<
Array<{ label: string; value: string; image?: string; intro?: string }>
>([]);
2026-06-15 09:18:00 +08:00
const params = ref<{
sttp: string;
2026-05-26 19:30:22 +08:00
stcd: any;
date: any;
2026-06-03 17:10:34 +08:00
show: any;
2026-06-15 09:18:00 +08:00
enfc: any;
eqtp: any;
2026-06-12 16:59:35 +08:00
baseId?: string; // 新增:基地 ID
sttpCode?: string; // 新增:站点类型代码
sttpMap?: string; // 新增:站点类型映射
dtinType?: string;
bldstt: string;
2026-06-18 09:29:15 +08:00
bldsttCcode: string;
}>({
2026-05-26 19:30:22 +08:00
sttp: 'eng',
stcd: '',
date: '',
show: true,
2026-06-15 09:18:00 +08:00
enfc: '0',
eqtp: '',
2026-06-12 16:59:35 +08:00
baseId: '',
sttpCode: '',
sttpMap: '',
2026-06-15 09:18:00 +08:00
dtinType: '',
2026-06-18 09:29:15 +08:00
bldstt: '',
bldsttCcode: ''
});
2026-06-15 14:10:19 +08:00
const filter = ref({
stllgzlx: '', // 生态流量 - 规则类型
stllTmType: '', // 生态流量 - 时间类型
tm: '',
2026-06-24 11:26:19 +08:00
rangeTm: [],
year: ''
2026-06-15 14:10:19 +08:00
});
return {
params,
modalVisible,
2026-06-15 09:18:00 +08:00
ylfbModalVisible, // 鱼类分布弹窗显示状态
currentTabKey,
tabList,
title,
isBasicEdit,
2026-06-15 09:18:00 +08:00
showStcdSelector, // 新增
stcdOptions, // 新增
2026-06-15 14:10:19 +08:00
filter,
2026-06-12 16:59:35 +08:00
// 新增返回字段
baseId,
hasPowerStatData,
isPowerStatPage,
verticalWaterStcd,
aiSites,
wtConfig,
wqShow,
fishTabInfo,
selectedAnchorPoint,
globalDrawerMode,
selectedFishSpecies
};
2026-06-15 09:18:00 +08:00
});