Files
frontend_hmi_station/src/store/pwo.ts

32 lines
524 B
TypeScript
Raw Normal View History

import { defineStore } from "pinia";
2025-12-29 08:59:29 +08:00
import { reactive } from "vue";
2025-12-29 08:59:29 +08:00
export interface PwoInfo {
code: string;
id: string | number;
orderType: string;
[key: string]: any;
}
2025-12-29 08:59:29 +08:00
export const usePwoStore = defineStore("pwo", () => {
const pwoInfo = reactive<PwoInfo>({
code: "",
id: "",
orderType: "",
});
2025-12-29 08:59:29 +08:00
function setInfo(info: PwoInfo) {
Object.assign(pwoInfo, info);
}
2025-12-29 08:59:29 +08:00
function resetInfo() {
Object.assign(pwoInfo, {});
}
return {
2025-12-29 08:59:29 +08:00
pwoInfo,
setInfo,
resetInfo,
};
});