refactor: edit get value
This commit is contained in:
parent
4ff7f50811
commit
0b648d8e45
1 changed files with 22 additions and 16 deletions
|
|
@ -201,23 +201,29 @@ export const useCustomerForm = defineStore('form-customer', () => {
|
|||
|
||||
payDateEN: v.payDateEN,
|
||||
statusSave: true,
|
||||
file: await customerStore.listAttachment(v.id).then(async (r) => {
|
||||
if (r) {
|
||||
return await Promise.all(
|
||||
r.map(async (item) => {
|
||||
const fragment = item.split('-');
|
||||
const group = fragment.length === 1 ? 'other' : fragment.at(0);
|
||||
file: await customerStore
|
||||
.listAttachment({ parentId: v.id })
|
||||
.then(async (r) => {
|
||||
if (r) {
|
||||
return await Promise.all(
|
||||
r.map(async (item) => {
|
||||
const fragment = item.split('-');
|
||||
const group =
|
||||
fragment.length === 1 ? 'other' : fragment.at(0);
|
||||
|
||||
return {
|
||||
url: await customerStore.getAttachment(v.id, item),
|
||||
name: item,
|
||||
group: group,
|
||||
};
|
||||
}),
|
||||
);
|
||||
}
|
||||
return [];
|
||||
}),
|
||||
return {
|
||||
url: await customerStore.getAttachment({
|
||||
parentId: v.id,
|
||||
name: item,
|
||||
}),
|
||||
name: item,
|
||||
group: group,
|
||||
};
|
||||
}),
|
||||
);
|
||||
}
|
||||
return [];
|
||||
}),
|
||||
})),
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue