24 lines
503 B
TypeScript
24 lines
503 B
TypeScript
|
|
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: () => ({
|
||
|
|
devices: Array<CheckData.Device>()
|
||
|
|
}),
|
||
|
|
|
||
|
|
getters: {},
|
||
|
|
|
||
|
|
actions: {
|
||
|
|
addDevices(device: CheckData.Device[]) {
|
||
|
|
this.devices.push(...device);
|
||
|
|
},
|
||
|
|
|
||
|
|
clearDevices() {
|
||
|
|
this.devices = [];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|