กำหนดสิทธิ์จัดการโครงสร้าง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-11-11 13:11:42 +07:00
parent 2ccdcef509
commit 90568eac79
3 changed files with 22 additions and 12 deletions

View file

@ -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>