fix: dataTreeFormatted

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-02-11 16:03:10 +07:00
parent 13005eaa5c
commit 1da8ce8d49
4 changed files with 22 additions and 20 deletions

View file

@ -75,6 +75,7 @@ interface DataTree {
responsibility: string;
isDeputy: boolean;
labelName: string;
children?: DataTree[];
}
interface DataProfile {

View file

@ -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="ไม่พบข้อมูลที่ค้นหา"