Files
pqs-9100_client/frontend/src/stores/modules/check.ts

37 lines
1.1 KiB
TypeScript
Raw Normal View History

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'
export const useCheckStore = defineStore("check", {
id: CHECK_STORE_KEY,
state: () => ({
2024-12-24 11:29:31 +08:00
devices: Array<CheckData.Device>(),
plan: Object<Plan.ResPlan>(),
selectTestItems: Object<CheckData.SelectTestItem>({preTest: true, timeTest: true, channelsTest: true, test: true}),
}),
getters: {},
actions: {
addDevices(device: CheckData.Device[]) {
this.devices.push(...device);
},
setPlan(plan: Plan.ResPlan) {
this.plan = plan
},
clearDevices() {
this.devices = [];
2024-12-24 11:29:31 +08:00
},
initSelectTestItems() {
this.selectTestItems.preTest = true
this.selectTestItems.channelsTest = true
this.selectTestItems.test = true
2025-01-03 11:27:36 +08:00
},
setSelectTestItems(selectTestItems: CheckData.SelectTestItem) {
this.selectTestItems = selectTestItems
}
}
});