2026-05-08 19:11:10 +08:00
|
|
|
import { defineStore } from 'pinia';
|
|
|
|
|
import { ref } from 'vue';
|
|
|
|
|
|
|
|
|
|
export const useModelStore = defineStore('model', () => {
|
|
|
|
|
// state
|
2026-05-09 19:30:03 +08:00
|
|
|
const modalVisible = ref(false);
|
2026-06-15 09:18:00 +08:00
|
|
|
const ylfbModalVisible = ref(false); // 鱼类分布弹窗显示状态
|
|
|
|
|
const currentTabKey = ref('basicInfo');
|
2026-05-09 19:30:03 +08:00
|
|
|
const tabList = ref([]);
|
|
|
|
|
const title = ref('');
|
|
|
|
|
const isBasicEdit = ref(false);
|
2026-06-03 18:25:57 +08:00
|
|
|
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); // 鱼类监测数据信息
|
2026-06-15 09:18:00 +08:00
|
|
|
|
2026-05-09 19:30:03 +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-08 19:11:10 +08:00
|
|
|
}>({
|
2026-05-26 19:30:22 +08:00
|
|
|
sttp: 'eng',
|
|
|
|
|
stcd: '',
|
|
|
|
|
date: '',
|
2026-06-08 15:34:13 +08:00
|
|
|
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-05-08 19:11:10 +08:00
|
|
|
});
|
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
|
|
|
});
|
2026-05-08 19:11:10 +08:00
|
|
|
return {
|
2026-05-09 19:30:03 +08:00
|
|
|
params,
|
|
|
|
|
modalVisible,
|
2026-06-15 09:18:00 +08:00
|
|
|
ylfbModalVisible, // 鱼类分布弹窗显示状态
|
2026-05-09 19:30:03 +08:00
|
|
|
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,
|
2026-06-15 09:18:00 +08:00
|
|
|
fishTabInfo
|
2026-05-08 19:11:10 +08:00
|
|
|
};
|
2026-06-15 09:18:00 +08:00
|
|
|
});
|