fix: ปรับโครงสร้าง โดยไม่แสดงปุ่มสืบทอดที่โครงปัจจุบัน ปิดการ sort ของประวัติตำแหน่ง และเอาชื่อคนครองออก

This commit is contained in:
Warunee Tamkoo 2025-08-21 15:06:47 +07:00
parent 58cbeb108d
commit 762acf46bd
2 changed files with 40 additions and 29 deletions

View file

@ -47,17 +47,17 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "fullname",
align: "left",
label: "ชื่อคนครอง",
sortable: true,
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
// {
// name: "fullname",
// align: "left",
// label: "",
// sortable: true,
// field: "fullname",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// sort: (a: string, b: string) =>
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
// },
{
name: "orgShortName",
align: "left",
@ -157,19 +157,14 @@ const columns = ref<QTableProps["columns"]>([
align: "left",
label: "วันที่แก้ไข",
field: "lastUpdatedAt",
sortable: true,
format(val, row) {
sortable: false,
format(val) {
return date2Thai(val);
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const pagination = ref({
sortBy: "lastUpdatedAt",
});
/**
* function เรยกขอมลประวตำแหน

View file

@ -72,7 +72,6 @@ const modalSelectPerson = ref<boolean>(false); //เลือกคนครอ
const rowId = ref<string>(""); //id
const actionType = ref<string>(""); //
const orgShortName = ref<string>(""); //
const orgRootIdMain = ref<string>(""); //Id
/** ListMenu Table*/
const listMenu = ref<ListMenu[]>([
{
@ -125,6 +124,32 @@ const listMenu = ref<ListMenu[]>([
},
]);
/**
* Returns filtered menu items for a given row.
*/
function getMenuItems(row: any) {
if (
row.positionIsSelected != "ว่าง" &&
store.typeOrganizational === "current"
) {
return listMenu.value.filter(
(item) =>
item.type !== "DEL" &&
item.type !== "CONDITION" &&
item.type !== "INHERIT"
);
} else if (store.typeOrganizational === "current") {
return listMenu.value.filter((item) => item.type !== "INHERIT");
} else if (
row.positionIsSelected != "ว่าง" &&
store.typeOrganizational === "draft"
) {
return listMenu.value.filter((item) => item.type !== "CONDITION");
} else {
return listMenu.value;
}
}
const baseDocument = ref<DataDocument[]>([
{
name: "บัญชี 1",
@ -739,16 +764,7 @@ watch(
</q-item-section>
</q-item>
<q-item
v-for="(item, index) in props.row.positionIsSelected !=
'ว่าง' && store.typeOrganizational === 'current'
? listMenu.filter(
(item) =>
item.type !== 'DEL' && item.type !== 'CONDITION'
)
: props.row.positionIsSelected != 'ว่าง' &&
store.typeOrganizational === 'draft'
? listMenu.filter((item) => item.type !== 'CONDITION')
: listMenu"
v-for="(item, index) in getMenuItems(props.row)"
:key="index"
clickable
v-close-popup