กำหนดสิทธิ์จัดการโครงสร้าง
This commit is contained in:
parent
2ccdcef509
commit
90568eac79
3 changed files with 22 additions and 12 deletions
|
|
@ -63,26 +63,31 @@ const menuList = readonly<any[]>([
|
|||
key: 2.0,
|
||||
label: "ข้อมูลเกี่ยวกับบุคคล",
|
||||
path: "masterPersonal",
|
||||
role: ["SUPER_ADMIN"],
|
||||
},
|
||||
{
|
||||
key: 2.0,
|
||||
label: "ข้อมูลตำแหน่งข้าราชการ ฯ",
|
||||
path: "masterPosition",
|
||||
role: ["SUPER_ADMIN"],
|
||||
},
|
||||
{
|
||||
key: 2.0,
|
||||
label: "ข้อมูลตำแหน่งลูกจ้างประจำ",
|
||||
path: "masterPositionEmployee",
|
||||
role: ["SUPER_ADMIN"],
|
||||
},
|
||||
{
|
||||
key: 2.0,
|
||||
label: "ข้อมูลปฏิทินวันหยุด",
|
||||
path: "masterCalendarWork",
|
||||
role: ["SUPER_ADMIN"],
|
||||
},
|
||||
{
|
||||
key: 2.0,
|
||||
label: "ข้อมูลเครื่องราชอิสริยาภรณ์",
|
||||
path: "masterInsigniaPage",
|
||||
role: ["SUPER_ADMIN"],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -97,26 +102,31 @@ const menuList = readonly<any[]>([
|
|||
key: 2.0,
|
||||
label: "จัดการผู้ใช้งาน",
|
||||
path: "manageUsers",
|
||||
role: ["SUPER_ADMIN", "ADMIN"],
|
||||
},
|
||||
{
|
||||
key: 2.0,
|
||||
label: "จัดการบทบาทและสิทธิ์ (Roles)",
|
||||
path: "manageRoles",
|
||||
role: ["SUPER_ADMIN"],
|
||||
},
|
||||
{
|
||||
key: 2.0,
|
||||
label: "กำหนดสิทธิ์ (Permissions)",
|
||||
path: "managePermission",
|
||||
role: ["SUPER_ADMIN", "ADMIN"],
|
||||
},
|
||||
{
|
||||
key: 2.0,
|
||||
label: "กำหนดสิทธิ์จัดการโครงสร้าง",
|
||||
path: "roleOrganization",
|
||||
role: ["SUPER_ADMIN", "ADMIN"],
|
||||
},
|
||||
{
|
||||
key: 2.0,
|
||||
label: "มอบหมายหน้าที่ความรับผิดชอบ",
|
||||
path: "responsibilities",
|
||||
role: ["SUPER_ADMIN", "ADMIN"],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -147,11 +157,13 @@ const menuList = readonly<any[]>([
|
|||
key: 2.0,
|
||||
label: "รายการคำสั่ง",
|
||||
path: "commandTemplate",
|
||||
role: ["SUPER_ADMIN"],
|
||||
},
|
||||
{
|
||||
key: 2.0,
|
||||
label: "ต้นแบบสำหรับลงในตำแหน่ง/เงินเดือน",
|
||||
path: "salaryTemplate",
|
||||
role: ["SUPER_ADMIN"],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ const orgId = ref<string>(""); // id หน่วยงานที่เลื
|
|||
|
||||
/**
|
||||
* ฟังก์ชันดึงข้อมูลโครงสร้าง
|
||||
*
|
||||
* เก็บข้อมูลโครงสร้างไว้ใน nodeTree
|
||||
*/
|
||||
async function fatchOrg() {
|
||||
|
|
@ -40,6 +39,11 @@ async function fatchOrg() {
|
|||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
nodeTree.value = data;
|
||||
if (data.length === 1) {
|
||||
selectedOrg(data[0].id);
|
||||
} else {
|
||||
await fetchListPerson(); // ดึงข้อมูลรายชื่อคนที่มีสิทธิ์จัดการโครงสร้าง
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -52,7 +56,6 @@ async function fatchOrg() {
|
|||
/**
|
||||
* ฟังก์ชันเลือกหน่วยงาน
|
||||
* @param id หน่วยงานที่เลือก
|
||||
*
|
||||
* กำหนดค่าของ qureyBody ให้เป็นค่า defult และกำหนดค่าของ qureyBody.id เป็นหน่วยงานที่เลือก
|
||||
* และดึงข้อมูลรายชื่อคนที่มีสิทธิ์จัดการโครงสร้างในหน่วยงานที่เลือก
|
||||
*/
|
||||
|
|
@ -157,7 +160,6 @@ async function fetchListPerson(newPage: boolean = false) {
|
|||
/**
|
||||
* ฟังก์ชันยืนยันการลบรายชื่อคนที่มีสิทธิ์จัดการโครงสร้าง
|
||||
* @param id รายชื่อคนที่มีสิทธิ์จัดการโครงสร้าง
|
||||
*
|
||||
* ลบเสร็จจะโหลดข้อมูลรายชื่อคนที่มีสิทธิ์จัดการโครงสร้าง
|
||||
*/
|
||||
function onDeletePerson(id: string) {
|
||||
|
|
@ -197,7 +199,6 @@ function updatePagination(newPagination: Pagination) {
|
|||
|
||||
/**
|
||||
* ดูการเปลี่ยนแปลงของ pageSize ใน queryBody
|
||||
*
|
||||
* เมื่อ pageSize มีการเปลี่ยนแปลงให้โหลดข้อมูลหน้าแรก
|
||||
*/
|
||||
watch(
|
||||
|
|
@ -209,13 +210,9 @@ watch(
|
|||
|
||||
/**
|
||||
* hook ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
||||
*
|
||||
*/
|
||||
onMounted(async () => {
|
||||
await Promise.all([
|
||||
fatchOrg(), // ดึงข้อมูลโครงสร้าง
|
||||
fetchListPerson(), // ดึงข้อมูลรายชื่อคนที่มีสิทธิ์จัดการโครงสร้าง
|
||||
]);
|
||||
await fatchOrg(); // ดึงข้อมูลโครงสร้าง
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -889,14 +889,15 @@ onUnmounted(() => {
|
|||
:to="{ name: `${subMenu2.path}` }"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-item-label class="font-400 subLabel"
|
||||
>{{ subMenu2.label }}
|
||||
<q-item-label class="font-400 subLabel">
|
||||
{{ subMenu2.label }}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-expansion-item>
|
||||
|
||||
<q-item
|
||||
v-else
|
||||
v-else-if="checkPermission(subMenu.role, reles)"
|
||||
dense
|
||||
class="menuSubHover"
|
||||
active-class="text-primary active-item text-weight-bold menuSubAct"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue