From 914072c8b6d55974cda7a6a90aef40879a807ae7 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 13 Nov 2024 17:24:13 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=82=E0=B8=84=E0=B8=A3=E0=B8=87=E0=B8=AA?= =?UTF-8?q?=E0=B8=A3=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=AD=E0=B8=B1=E0=B8=95?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=81=E0=B8=B3=E0=B8=A5=E0=B8=B1=E0=B8=87?= =?UTF-8?q?=20=3D>=20=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1=20isLoc?= =?UTF-8?q?k?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/02_organizational/api.organization.ts | 1 + .../02_organization/components/TreeMain.vue | 10 +++++++--- .../02_organization/components/TreeTable.vue | 4 ++-- .../02_organization/store/organizational.ts | 10 ++++++---- src/modules/02_organization/views/main.vue | 18 +++++++++++++++++- 5 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts index 0688fdab9..564ec057e 100644 --- a/src/api/02_organizational/api.organization.ts +++ b/src/api/02_organizational/api.organization.ts @@ -26,6 +26,7 @@ export default { organizationHistoryNew: `${organization}/history`, organizationHistoryPostNew: `${organization}/history/publish`, orgChart: (id: string) => `${organization}/org-chart/${id}`, + orgIsLock: `${organization}/lock`, /** position*/ orgPosPosition: `${orgPos}/position`, diff --git a/src/modules/02_organization/components/TreeMain.vue b/src/modules/02_organization/components/TreeMain.vue index 65723ab4f..81ab199c6 100644 --- a/src/modules/02_organization/components/TreeMain.vue +++ b/src/modules/02_organization/components/TreeMain.vue @@ -384,7 +384,10 @@ watch(
-
+
{ const typeOrganizational = ref("current"); // ประเภทโครงสร้าง const statusView = ref("list"); // การแสดงผล รายการ,map - const rootId = ref('') - const isOfficer = ref(null); - const isStaff = ref(null); + const rootId = ref(""); + const isOfficer = ref(null); + const isStaff = ref(null); const dataActive = ref(); //ข้อมูลโครงสร้าง const activeId = ref(); // id โครงสร้างปัจจุบัน @@ -24,6 +24,7 @@ export const useOrganizational = defineStore("organizationalStore", () => { const treeId = ref(); // id โหนด const level = ref(); // ระดับโหนด const orgPublishDate = ref(null); // วันเผยแพร่ + const isLosck = ref(false); const sumPosition = reactive({ total: 0, use: 0, @@ -166,6 +167,7 @@ export const useOrganizational = defineStore("organizationalStore", () => { getSumPosition, isOfficer, isStaff, - rootId + rootId, + isLosck, }; }); diff --git a/src/modules/02_organization/views/main.vue b/src/modules/02_organization/views/main.vue index 632fb0805..c786c035b 100644 --- a/src/modules/02_organization/views/main.vue +++ b/src/modules/02_organization/views/main.vue @@ -56,6 +56,7 @@ async function fetchOrganizationActive() { const data = await res.data.result; if (data) { await store.fetchDataActive(data); + await fetchCheckIslock(data.draftId); if (data.activeName === null && data.draftName === null) { isStatusData.value = false; } else { @@ -146,6 +147,18 @@ async function workflowSystem() { .finally(() => {}); } +async function fetchCheckIslock(id: string) { + http + .get(config.API.orgIsLock + `/${id}`) + .then((res) => { + const data = res.data.result; + store.isLosck = data; + }) + .catch((e) => { + messageError($q, e); + }); +} + watch( () => store.typeOrganizational, () => { @@ -305,7 +318,10 @@ onMounted(async () => {