hrms-mgt/src/modules/18_command/store/Main.ts

29 lines
830 B
TypeScript

import { defineStore } from "pinia";
import { ref } from "vue";
import type { ListCommand } from "@/modules/18_command/interface/index/Main";
export const useCommandMainStore = defineStore("commandMainStore", () => {
const commandTypes = ref<ListCommand[]>([
{
id: "c94b8ce3-46f2-4ecb-9d3c-4d6b08f33dd9",
name: "คำสั่งให้โอนข้าราชการกรุงเทพมหานครสามัญ",
code: "C-PM-13",
subtitle: "",
commandSysId: "PLACEMENT",
},
]);
function getCommandTypes(data: ListCommand[]) {
return (commandTypes.value = data);
}
function getCommandTypeById(id: string) {
return commandTypes.value.find((item) => item.id === id);
}
return {
commandTypes,
getCommandTypes,
getCommandTypeById,
};
});