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",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
name: "fullname",
|
// name: "fullname",
|
||||||
align: "left",
|
// align: "left",
|
||||||
label: "ชื่อคนครอง",
|
// label: "ชื่อคนครอง",
|
||||||
sortable: true,
|
// sortable: true,
|
||||||
field: "fullname",
|
// field: "fullname",
|
||||||
headerStyle: "font-size: 14px",
|
// headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
// style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
// sort: (a: string, b: string) =>
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
name: "orgShortName",
|
name: "orgShortName",
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|
@ -157,19 +157,14 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "วันที่แก้ไข",
|
label: "วันที่แก้ไข",
|
||||||
field: "lastUpdatedAt",
|
field: "lastUpdatedAt",
|
||||||
sortable: true,
|
sortable: false,
|
||||||
format(val, row) {
|
format(val) {
|
||||||
return date2Thai(val);
|
return date2Thai(val);
|
||||||
},
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "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 เรียกข้อมูลประวัติตำแหน่ง
|
* function เรียกข้อมูลประวัติตำแหน่ง
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,6 @@ const modalSelectPerson = ref<boolean>(false); //เลือกคนครอ
|
||||||
const rowId = ref<string>(""); //id ที่ต้องการกระทำ
|
const rowId = ref<string>(""); //id ที่ต้องการกระทำ
|
||||||
const actionType = ref<string>(""); //ประเภทการกระทำ
|
const actionType = ref<string>(""); //ประเภทการกระทำ
|
||||||
const orgShortName = ref<string>(""); //ชื่อย่อหน่วยงาน
|
const orgShortName = ref<string>(""); //ชื่อย่อหน่วยงาน
|
||||||
const orgRootIdMain = ref<string>(""); //Id สำนัก
|
|
||||||
/** ListMenu Table*/
|
/** ListMenu Table*/
|
||||||
const listMenu = ref<ListMenu[]>([
|
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[]>([
|
const baseDocument = ref<DataDocument[]>([
|
||||||
{
|
{
|
||||||
name: "บัญชี 1",
|
name: "บัญชี 1",
|
||||||
|
|
@ -739,16 +764,7 @@ watch(
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item
|
<q-item
|
||||||
v-for="(item, index) in props.row.positionIsSelected !=
|
v-for="(item, index) in getMenuItems(props.row)"
|
||||||
'ว่าง' && 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"
|
|
||||||
:key="index"
|
:key="index"
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue