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

34 lines
732 B
TypeScript
Raw Normal View History

import {defineStore} from "pinia";
import {CHECK_STORE_KEY} from "@/stores/constant";
import type {CheckData} from "@/api/check/interface";
export const useCheckStore = defineStore("check", {
id: CHECK_STORE_KEY,
state: () => ({
2024-12-24 11:29:31 +08:00
devices: Array<CheckData.Device>(),
planId: String(""),
2024-12-31 19:03:52 +08:00
scriptId: String(""),
}),
getters: {},
actions: {
addDevices(device: CheckData.Device[]) {
this.devices.push(...device);
},
clearDevices() {
this.devices = [];
2024-12-24 11:29:31 +08:00
},
setPlanId(planId: string) {
this.planId = planId
2024-12-31 19:03:52 +08:00
},
setScriptId(scriptId: string) {
this.scriptId = scriptId
}
}
});