From 25a8fb9aa22ecd1d2819a076de4d34eeeac7b83e Mon Sep 17 00:00:00 2001 From: waruneeta Date: Tue, 6 Feb 2024 17:21:46 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20dialog=20?= =?UTF-8?q?=E0=B8=AA=E0=B8=A3=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B9=82=E0=B8=84?= =?UTF-8?q?=E0=B8=A3=E0=B8=87=E0=B8=AA=E0=B8=A3=E0=B9=89=E0=B8=B2=E0=B8=87?= =?UTF-8?q?=E0=B9=83=E0=B8=AB=E0=B8=A1=E0=B9=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DialogNewStructure.vue | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/src/modules/02_organizationalNew/components/DialogNewStructure.vue b/src/modules/02_organizationalNew/components/DialogNewStructure.vue index 4e5556634..68d7cf8a2 100644 --- a/src/modules/02_organizationalNew/components/DialogNewStructure.vue +++ b/src/modules/02_organizationalNew/components/DialogNewStructure.vue @@ -130,16 +130,20 @@ async function fetchOrgRevision() { showLoader(); await http .get(config.API.organizationHistoryNew) - .then((res) => { + .then(async (res) => { const data = res.data.result.filter( (e: HistoryType) => e.orgRevisionIsDraft === false ); if (data) { - const listOption = data.map((e: HistoryType) => ({ - id: e.orgRevisionId, - name: e.orgRevisionName, - })); - orgRevisionOpMain.value = listOption; + // const listOption = data.map((e: HistoryType) => ({ + // id: e.orgRevisionId, + // name: e.orgRevisionName, + // })); + // orgRevisionOpMain.value = listOption; + const currentStr = await data.find( + (x: any) => x.orgRevisionIsCurrent === true + ); + formData.orgRevisionId = currentStr ? currentStr.orgRevisionId : null; } }) .catch((err) => { @@ -150,19 +154,19 @@ async function fetchOrgRevision() { }); } -function filterSelector(val: any, update: Function, refData: string) { - switch (refData) { - case "orgRevisionId": - update(() => { - orgRevisionOp.value = orgRevisionOpMain.value.filter( - (v: DataOption) => v.name.indexOf(val) > -1 - ); - }); - break; - default: - break; - } -} +// function filterSelector(val: any, update: Function, refData: string) { +// switch (refData) { +// case "orgRevisionId": +// update(() => { +// orgRevisionOp.value = orgRevisionOpMain.value.filter( +// (v: DataOption) => v.name.indexOf(val) > -1 +// ); +// }); +// break; +// default: +// break; +// } +// } watch( () => modal.value, @@ -213,7 +217,7 @@ watch( lazy-rules /> -
+