fix: branch file

This commit is contained in:
Thanaphon Frappet 2024-12-06 09:30:01 +07:00
parent a0013bdbe0
commit 57aabf1deb
2 changed files with 32 additions and 32 deletions

View file

@ -422,6 +422,7 @@ async function fetchBranchById(id: string) {
const resAttachment = await branchStore.fetchListAttachment(res.id);
if (resAttachment) {
currentAttachmentList.value = await Promise.all(
resAttachment.map(async (v) => {
return {
@ -2016,6 +2017,7 @@ watch(currentHq, () => {
id="form-attachment"
class="q-mb-xl"
:auto-save="currentId !== ''"
:readonly="formType === 'view'"
branch
v-model="currentAttachmentList"
@save="
@ -2368,22 +2370,9 @@ watch(currentHq, () => {
class="q-mb-xl"
id="info-attachment"
branch
v-model="currentAttachmentList"
:readonly="formType === 'view'"
:file="currentAttachmentList"
:tree-file="
Object.values(
currentAttachmentList.reduce<
Record<string, { label: string; file: { label: string }[] }>
>((a, b) => {
if (b.name && !a[b.name]) {
a[b.name] = {
label: b.name,
file: [],
};
}
return a;
}, {}) || {},
)
"
@save="
async (_group, file) => {
if (file) {