fix useStructStore
This commit is contained in:
parent
07b33e6bf5
commit
3b6bced57a
2 changed files with 45 additions and 13 deletions
|
|
@ -150,20 +150,21 @@ async function scrollToCenter() {
|
|||
}
|
||||
|
||||
async function fetchAgencyData(id: string) {
|
||||
if (!id) return; // ถ้าไม่มี id ให้ return ออกไป
|
||||
|
||||
agencyId.value = "";
|
||||
await http
|
||||
.get(config.API.orgByid(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result.data;
|
||||
agencyData.value = data.map((item: any) => ({
|
||||
id: item.orgTreeId,
|
||||
name: item.orgName,
|
||||
}));
|
||||
agencyOp.value = agencyData.value;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
try {
|
||||
const data = await storeOrg.fetchDataTree(id);
|
||||
console.log(data);
|
||||
|
||||
agencyData.value = data.data.map((item: any) => ({
|
||||
id: item.orgTreeId,
|
||||
name: item.orgName,
|
||||
}));
|
||||
agencyOp.value = agencyData.value;
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
}
|
||||
}
|
||||
|
||||
function onSelectAgency(val: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue