fix: personnel => filter status no data
This commit is contained in:
parent
856f7f8587
commit
0bc62e597c
1 changed files with 20 additions and 4 deletions
|
|
@ -637,7 +637,8 @@ async function assignFormData(idEdit: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchImageList(id: string, selectedName: string) {
|
async function fetchImageList(id: string, selectedName?: string) {
|
||||||
|
if (!selectedName) return;
|
||||||
const res = await userStore.fetchImageListById(id);
|
const res = await userStore.fetchImageListById(id);
|
||||||
imageList.value = {
|
imageList.value = {
|
||||||
selectedImage: selectedName,
|
selectedImage: selectedName,
|
||||||
|
|
@ -662,6 +663,16 @@ async function fetchUserList() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function noPersonnel() {
|
||||||
|
const number =
|
||||||
|
typeStats.value &&
|
||||||
|
Object.entries(typeStats.value).reduce(
|
||||||
|
(acc, [key, value]) => acc + value,
|
||||||
|
0,
|
||||||
|
);
|
||||||
|
return number === 0;
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
navigatorStore.current.title = 'personnel.title';
|
navigatorStore.current.title = 'personnel.title';
|
||||||
navigatorStore.current.path = [{ text: 'personnel.caption', i18n: true }];
|
navigatorStore.current.path = [{ text: 'personnel.caption', i18n: true }];
|
||||||
|
|
@ -1392,7 +1403,9 @@ watch(
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="userData && userData.total === 0 && !inputSearch"
|
v-if="
|
||||||
|
userData && userData.total === 0 && !inputSearch && noPersonnel()
|
||||||
|
"
|
||||||
class="full-height column"
|
class="full-height column"
|
||||||
>
|
>
|
||||||
<div class="flex justify-end">
|
<div class="flex justify-end">
|
||||||
|
|
@ -1413,7 +1426,10 @@ watch(
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="userData?.total === 0 && !!inputSearch"
|
v-if="
|
||||||
|
(userData?.total === 0 && !!inputSearch) ||
|
||||||
|
(userData?.total === 0 && !!statusFilter)
|
||||||
|
"
|
||||||
class="row col full-width items-center justify-center"
|
class="row col full-width items-center justify-center"
|
||||||
style="min-height: 250px"
|
style="min-height: 250px"
|
||||||
>
|
>
|
||||||
|
|
@ -1985,7 +2001,7 @@ watch(
|
||||||
const res = await userStore.addImageList(
|
const res = await userStore.addImageList(
|
||||||
v,
|
v,
|
||||||
currentUser?.id,
|
currentUser?.id,
|
||||||
Date.now(),
|
Date.now().toString(),
|
||||||
);
|
);
|
||||||
await fetchImageList(currentUser?.id, res);
|
await fetchImageList(currentUser?.id, res);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue