ui รายการลาออก

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-10-25 15:09:06 +07:00
parent d08dbd9528
commit 8d8ba07217
12 changed files with 1497 additions and 463 deletions

View file

@ -0,0 +1,60 @@
import { defineStore } from "pinia";
import { ref, computed, reactive, watch } from "vue";
export const useDataStore = defineStore("resign", () => {
const mainTabs = ref<string>("1");
const baseOptionStatus = ref<any[]>([
{
name: "รอดำเนินการ",
value: "WAITTING",
group: "1",
},
{
name: "ส่งรายชื่อไปออกคำสั่ง",
value: "REPORT",
group: "1",
},
{
name: "ออกคำสั่งเสร็จแล้ว",
value: "DONE",
group: "1",
},
{
name: "ยกเลิกการลาออก",
value: "CANCEL",
group: "2",
},
{
name: "รอดำเนินการ",
value: "DONECANCEL",
group: "2",
},
{
name: "ส่งรายชื่อไปออกคำสั่ง",
value: "CANCEL",
group: "2",
},
{
name: "ออกคำสั่งยกเลิกลาออกเสร็จแล้ว",
value: "DONEREJECT",
group: "2",
},
]);
const formQurey = reactive({
status: "WAITTING",
page: 1,
rowsPerPage: 10,
});
const optionStatus = computed(() => {
return baseOptionStatus.value.filter(
(option) => option.group === mainTabs.value
);
});
watch(mainTabs, (val) => {
formQurey.status = val === "1" ? "WAITTING" : "DONECANCEL";
});
return { mainTabs, formQurey, optionStatus };
});