|
@@ -25,7 +25,7 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="relics-content">
|
|
<div class="relics-content">
|
|
- <el-table :data="relicsArray" border>
|
|
|
|
|
|
+ <el-table default-expand-all row-key="orgId" :data="relicsArray" border>
|
|
<el-table-column label="单位名称" prop="orgName"></el-table-column>
|
|
<el-table-column label="单位名称" prop="orgName"></el-table-column>
|
|
<el-table-column label="类型" prop="type" v-slot:default="{ row }: { row: OrganizationType }">
|
|
<el-table-column label="类型" prop="type" v-slot:default="{ row }: { row: OrganizationType }">
|
|
{{ row.type ? OrganizationTypeDesc[row.type] : '' }}
|
|
{{ row.type ? OrganizationTypeDesc[row.type] : '' }}
|
|
@@ -69,7 +69,7 @@ import {
|
|
import type { OrganizationType } from "@/request/organization";
|
|
import type { OrganizationType } from "@/request/organization";
|
|
import { OrganizationTypeDesc } from '@/store/organization'
|
|
import { OrganizationTypeDesc } from '@/store/organization'
|
|
import { organizationAdd, organizationEdit } from "./quisk";
|
|
import { organizationAdd, organizationEdit } from "./quisk";
|
|
-import { debounce } from "@/util";
|
|
|
|
|
|
+import { debounce, parseTree } from "@/util";
|
|
import { ElMessageBox } from "element-plus";
|
|
import { ElMessageBox } from "element-plus";
|
|
|
|
|
|
const initProps: PageProps<Partial<OrganizationType>> = {
|
|
const initProps: PageProps<Partial<OrganizationType>> = {
|
|
@@ -88,7 +88,8 @@ const relicsArray = ref<any[]>([]);
|
|
const refresh = debounce(async () => {
|
|
const refresh = debounce(async () => {
|
|
const data = await getOrgListFetch(pageProps.value);
|
|
const data = await getOrgListFetch(pageProps.value);
|
|
total.value = data.total;
|
|
total.value = data.total;
|
|
- relicsArray.value = data.records;
|
|
|
|
|
|
+ // console.log('parseTree', parseTree(data.records, 'orgId'))
|
|
|
|
+ relicsArray.value = parseTree(data.records, 'orgId');
|
|
});
|
|
});
|
|
|
|
|
|
watch(pageProps, refresh, { deep: true, immediate: true });
|
|
watch(pageProps, refresh, { deep: true, immediate: true });
|