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