fix: ปรับโครงสร้าง โดยไม่แสดงปุ่มสืบทอดที่โครงปัจจุบัน ปิดการ sort ของประวัติตำแหน่ง และเอาชื่อคนครองออก
This commit is contained in:
parent
58cbeb108d
commit
762acf46bd
2 changed files with 40 additions and 29 deletions
|
|
@ -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 เรียกข้อมูลประวัติตำแหน่ง
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue