ฟิลเตอร์การลา

This commit is contained in:
STW_TTTY\stwtt 2024-07-10 15:31:55 +07:00
parent 94a8733746
commit 1b23eed1d1
3 changed files with 72 additions and 14 deletions

View file

@ -12,7 +12,8 @@ import { useCounterMixin } from "@/stores/mixin"
const mixin = useCounterMixin()
const { date2Thai, messageError } = mixin
const $q = useQuasar()
const type = ref<string>("00000000-0000-0000-0000-000000000000");
const status = ref<string>("ALL");
export const useLeaveStore = defineStore("Leave", () => {
const tabValue = ref<string>("calendar")
const typeLeave = ref<string | undefined>("")
@ -113,11 +114,13 @@ export const useLeaveStore = defineStore("Leave", () => {
function filterOption(val: any, update: Function, refData: string) {
switch (refData) {
case "LeaveTypeOption":
type.value = ''
update(() => {
typeOptions.value = typeOptionsMain.value.filter((v: any) => v.name.indexOf(val) > -1)
})
break
case "LeaveStatusOption":
status.value = ''
update(() => {
statusOptions.value = statusOptionsMain.value.filter((v: any) => v.name.indexOf(val) > -1)
})
@ -389,5 +392,9 @@ export const useLeaveStore = defineStore("Leave", () => {
convertStatud,
resetForm2,
fetchProfileOld,
type,
typeOptionsMain,
status,
statusOptionsMain
}
})