fix: dataTreeFormatted
This commit is contained in:
parent
13005eaa5c
commit
1da8ce8d49
4 changed files with 22 additions and 20 deletions
|
|
@ -75,6 +75,7 @@ interface DataTree {
|
|||
responsibility: string;
|
||||
isDeputy: boolean;
|
||||
labelName: string;
|
||||
children?: DataTree[];
|
||||
}
|
||||
|
||||
interface DataProfile {
|
||||
|
|
|
|||
|
|
@ -97,7 +97,11 @@ async function fetchDataTree(id: string) {
|
|||
.get(config.API.orgByid(id.toString()))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
nodeTree.value.push(...data);
|
||||
const dataTreeFormatted = data.map((item: DataTree) => {
|
||||
const { children, ...itemWithoutChildren } = item;
|
||||
return itemWithoutChildren;
|
||||
});
|
||||
nodeTree.value.push(...dataTreeFormatted);
|
||||
|
||||
if (data.length === 1) {
|
||||
selectedOrg(data[0].orgTreeId);
|
||||
|
|
@ -309,7 +313,7 @@ onMounted(async () => {
|
|||
class="q-pa-sm q-gutter-sm"
|
||||
dense
|
||||
:nodes="nodeTree"
|
||||
node-key="labelName"
|
||||
node-key="orgRootName"
|
||||
label-key="labelName"
|
||||
:filter="filter?.trim()"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue