feat: 新增测试树表

This commit is contained in:
xlsea
2025-05-10 19:32:20 +08:00
parent 4a4febeeab
commit fd0783a50f
18 changed files with 601 additions and 38 deletions

View File

@ -174,13 +174,13 @@ async function addInRow(row: TableDataWithIndex<Api.System.Dept>) {
@refresh="getData"
>
<template #prefix>
<NButton v-if="!isCollapse" :disabled="!expandedRowKeys.length" size="small" @click="expandAll">
<NButton v-if="!isCollapse" :disabled="!data.length" size="small" @click="expandAll">
<template #icon>
<icon-quill:expand />
</template>
全部展开
</NButton>
<NButton v-if="isCollapse" :disabled="!expandedRowKeys.length" size="small" @click="collapseAll">
<NButton v-if="isCollapse" :disabled="!data.length" size="small" @click="collapseAll">
<template #icon>
<icon-quill:collapse />
</template>
@ -190,6 +190,7 @@ async function addInRow(row: TableDataWithIndex<Api.System.Dept>) {
</TableHeaderOperation>
</template>
<NDataTable
v-model:expanded-row-keys="expandedRowKeys"
:columns="columns"
:data="data"
size="small"
@ -198,9 +199,7 @@ async function addInRow(row: TableDataWithIndex<Api.System.Dept>) {
:loading="loading"
:indent="28"
:row-key="row => row.deptId"
:expanded-row-keys="expandedRowKeys"
class="sm:h-full"
@update:expanded-row-keys="keys => (expandedRowKeys = keys)"
/>
<DeptOperateDrawer
v-model:visible="drawerVisible"