refactor: header inputSearch
This commit is contained in:
parent
b8a9acbaeb
commit
8d6ec05c66
1 changed files with 23 additions and 1 deletions
|
|
@ -643,6 +643,7 @@ async function fetchList(opts: {
|
|||
}
|
||||
|
||||
watch(inputSearch, () => {
|
||||
console.log(inputSearch.value);
|
||||
fetchList({ tree: true, query: inputSearch.value });
|
||||
currentSubBranch.value = undefined;
|
||||
});
|
||||
|
|
@ -1167,7 +1168,28 @@ watch(currentHq, () => {
|
|||
bordered
|
||||
class="full-width"
|
||||
:rows-per-page-options="[0]"
|
||||
:rows="currentSubBranch || treeData"
|
||||
:rows="
|
||||
(
|
||||
currentSubBranch ||
|
||||
(inputSearch !== ''
|
||||
? treeData.flatMap((v) => [v, ...v.branch])
|
||||
: treeData)
|
||||
).filter((v) => {
|
||||
if (
|
||||
statusFilter === 'statusACTIVE' &&
|
||||
v.status === 'INACTIVE'
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
if (
|
||||
statusFilter === 'statusINACTIVE' &&
|
||||
v.status !== 'INACTIVE'
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
})
|
||||
"
|
||||
:columns="columns"
|
||||
:grid="modeView"
|
||||
card-container-class="row q-col-gutter-md"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue