feat: search user
This commit is contained in:
parent
9b35e63dbd
commit
518a6b71f8
1 changed files with 13 additions and 0 deletions
|
|
@ -251,6 +251,7 @@ async function onSubmit() {
|
||||||
|
|
||||||
userStore.fetchList({
|
userStore.fetchList({
|
||||||
includeBranch: true,
|
includeBranch: true,
|
||||||
|
query: !!inputSearch.value ? inputSearch.value : undefined,
|
||||||
userType: selectorLabel.value ?? undefined,
|
userType: selectorLabel.value ?? undefined,
|
||||||
});
|
});
|
||||||
typeStats.value = await userStore.typeStats();
|
typeStats.value = await userStore.typeStats();
|
||||||
|
|
@ -281,6 +282,7 @@ async function onSubmit() {
|
||||||
selectorLabel.value = formData.value.userType;
|
selectorLabel.value = formData.value.userType;
|
||||||
userStore.fetchList({
|
userStore.fetchList({
|
||||||
includeBranch: true,
|
includeBranch: true,
|
||||||
|
query: !!inputSearch.value ? inputSearch.value : undefined,
|
||||||
userType: selectorLabel.value ?? undefined,
|
userType: selectorLabel.value ?? undefined,
|
||||||
});
|
});
|
||||||
typeStats.value = await userStore.typeStats();
|
typeStats.value = await userStore.typeStats();
|
||||||
|
|
@ -302,6 +304,7 @@ async function onDelete(id: string) {
|
||||||
await userStore.deleteById(id);
|
await userStore.deleteById(id);
|
||||||
await userStore.fetchList({
|
await userStore.fetchList({
|
||||||
includeBranch: true,
|
includeBranch: true,
|
||||||
|
query: !!inputSearch.value ? inputSearch.value : undefined,
|
||||||
userType: selectorLabel.value ?? undefined,
|
userType: selectorLabel.value ?? undefined,
|
||||||
});
|
});
|
||||||
typeStats.value = await userStore.typeStats();
|
typeStats.value = await userStore.typeStats();
|
||||||
|
|
@ -402,6 +405,7 @@ async function assignFormData(idEdit: string) {
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await userStore.fetchList({
|
await userStore.fetchList({
|
||||||
includeBranch: true,
|
includeBranch: true,
|
||||||
|
query: !!inputSearch.value ? inputSearch.value : undefined,
|
||||||
userType: selectorLabel.value ?? undefined,
|
userType: selectorLabel.value ?? undefined,
|
||||||
});
|
});
|
||||||
userStore.userOption.roleOpts.length === 0
|
userStore.userOption.roleOpts.length === 0
|
||||||
|
|
@ -427,6 +431,7 @@ watch(
|
||||||
mapUserType(label);
|
mapUserType(label);
|
||||||
await userStore.fetchList({
|
await userStore.fetchList({
|
||||||
includeBranch: true,
|
includeBranch: true,
|
||||||
|
query: !!inputSearch.value ? inputSearch.value : undefined,
|
||||||
userType: selectorLabel.value ?? undefined,
|
userType: selectorLabel.value ?? undefined,
|
||||||
});
|
});
|
||||||
const res = await branchStore.userStats(label);
|
const res = await branchStore.userStats(label);
|
||||||
|
|
@ -435,6 +440,13 @@ watch(
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(inputSearch, async () => {
|
||||||
|
await userStore.fetchList({
|
||||||
|
pageSize: 9999,
|
||||||
|
query: !!inputSearch.value ? inputSearch.value : undefined,
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -531,6 +543,7 @@ watch(
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
label="ค้นหา"
|
label="ค้นหา"
|
||||||
|
debounce="500"
|
||||||
v-model="inputSearch"
|
v-model="inputSearch"
|
||||||
></q-input>
|
></q-input>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue