แก้ dialog สร้างโครงสร้างใหม่
This commit is contained in:
parent
c0cf58c95b
commit
25a8fb9aa2
1 changed files with 25 additions and 21 deletions
|
|
@ -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
|
||||
/>
|
||||
</div>
|
||||
<div class="col-6" v-if="type !== 'NEW'">
|
||||
<!-- <div class="col-6" v-if="type !== 'NEW'">
|
||||
<q-select
|
||||
for="#orgRevisionId"
|
||||
ref="orgRevisionIdRef"
|
||||
|
|
@ -242,7 +246,7 @@ watch(
|
|||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue