ทะเบียนประวัติ ==> ข้อมูลส่วนตัว, รายการคำร้องขอแก้ไขทะเบียนประวัติ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-12-02 18:09:51 +07:00
parent b9cd90d70a
commit b21a4f53ac
13 changed files with 64 additions and 85 deletions

View file

@ -38,6 +38,7 @@ export const useProfileDataStore = defineStore("profile", () => {
firstName: "",
prefix: "",
rank: null,
prefixMain: "",
};
//ข้อมูลตัวเลือก
@ -187,60 +188,61 @@ export const useProfileDataStore = defineStore("profile", () => {
* @param refData
*/
const filterSelector = (val: string, update: Function, refData: string) => {
const newVal = val.toLowerCase();
switch (refData) {
case "prefixOps":
update(() => {
Ops.value.prefixOps = OpsFilter.value.prefixOps.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
);
});
break;
case "rankOps":
update(() => {
Ops.value.rankOps = OpsFilter.value.rankOps.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
);
});
break;
case "genderOps":
update(() => {
Ops.value.genderOps = OpsFilter.value.genderOps.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
);
});
break;
case "bloodOps":
update(() => {
Ops.value.bloodOps = OpsFilter.value.bloodOps.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
);
});
break;
case "statusOps":
update(() => {
Ops.value.statusOps = OpsFilter.value.statusOps.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
);
});
break;
case "religionOps":
update(() => {
Ops.value.religionOps = OpsFilter.value.religionOps.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
);
});
break;
case "employeeClassOps":
update(() => {
Ops.value.employeeClassOps = OpsFilter.value.employeeClassOps.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
);
});
break;
case "employeeTypeOps":
update(() => {
Ops.value.employeeTypeOps = OpsFilter.value.employeeTypeOps.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
);
});
break;