Files
pqs-9100_client/frontend/src/stores/modules/check.ts
caozehui c215f51554 微调
2025-03-18 19:38:27 +08:00

54 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {defineStore} from "pinia";
import {CHECK_STORE_KEY} from "@/stores/constant";
import type {CheckData} from "@/api/check/interface";
import type {Plan} from '@/api/plan/interface'
import {useAppSceneStore} from "@/stores/modules/mode";
const AppSceneStore = useAppSceneStore()
export const useCheckStore = defineStore("check", {
id: CHECK_STORE_KEY,
state: () => ({
devices: Array<CheckData.Device>(),
plan: Object<Plan.ResPlan>(),
selectTestItems: Object<CheckData.SelectTestItem>({preTest: true, timeTest: true, channelsTest: false, test: true}),
checkType:1, // 0:手动检测 1:自动检测
reCheckType: 1, // 0:不合格项复检 1:全部复检
showDetailType: 0 // 0:数据查询 1:误差体系跟换 2正式检测
}),
getters: {},
actions: {
addDevices(device: CheckData.Device[]) {
this.devices.push(...device);
},
setPlan(plan: Plan.ResPlan) {
this.plan = plan
},
clearDevices() {
this.devices = [];
},
initSelectTestItems() {
this.selectTestItems.preTest = true
if (AppSceneStore.currentScene === '1') {
this.selectTestItems.channelsTest = true
} else {
this.selectTestItems.timeTest = true
}
this.selectTestItems.test = true
},
setSelectTestItems(selectTestItems: CheckData.SelectTestItem) {
this.selectTestItems = selectTestItems
},
setCheckType(checkType: number) {
this.checkType = checkType
},
setReCheckType(reCheckType: number) {
this.reCheckType = reCheckType
},
setShowDetailType(showDetailType: number) {
this.showDetailType = showDetailType
}
}
});