2024-12-20 18:19:18 +08:00
|
|
|
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(""),
|
2025-01-02 18:00:58 +08:00
|
|
|
planCode: String(""),
|
2024-12-31 19:03:52 +08:00
|
|
|
scriptId: String(""),
|
2025-01-03 11:27:36 +08:00
|
|
|
errorSysId: String(""),
|
2024-12-20 18:19:18 +08:00
|
|
|
}),
|
|
|
|
|
|
|
|
|
|
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
|
|
|
},
|
|
|
|
|
|
2025-01-02 18:00:58 +08:00
|
|
|
setPlanCode(planCode: string) {
|
|
|
|
|
this.planCode = planCode
|
|
|
|
|
},
|
|
|
|
|
|
2024-12-31 19:03:52 +08:00
|
|
|
setScriptId(scriptId: string) {
|
|
|
|
|
this.scriptId = scriptId
|
2025-01-03 11:27:36 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
setErrorSysId(errorSysId: string) {
|
|
|
|
|
this.errorSysId = errorSysId
|
2024-12-20 18:19:18 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|