引入store存放检测设备的相关信息

This commit is contained in:
caozehui
2024-12-20 18:19:18 +08:00
parent bbe23e1b14
commit 9b8765f001
5 changed files with 214 additions and 164 deletions

View File

@@ -0,0 +1,24 @@
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 = [];
}
}
});