|
|
@@ -47,7 +47,14 @@
|
|
|
:default-expand-all="true"
|
|
|
v-model:selectedKeys="selectedKeys"
|
|
|
@select="handleTreeSelect"
|
|
|
- />
|
|
|
+ >
|
|
|
+ <template #icon="slotProps">
|
|
|
+ <!-- 电子数据包用手机图标;其余保持目录/文件图标 -->
|
|
|
+ <MobileOutlined v-if="isEdsTreeNode(resolveSlotGovernNode(slotProps))" />
|
|
|
+ <FolderOutlined v-else-if="slotProps?.children?.length" />
|
|
|
+ <FileOutlined v-else />
|
|
|
+ </template>
|
|
|
+ </BasicTree>
|
|
|
</div>
|
|
|
</aside>
|
|
|
|
|
|
@@ -245,7 +252,14 @@
|
|
|
<script lang="ts" setup name="ViewsDataIndex">
|
|
|
import { computed, h, ref, nextTick, onActivated, onBeforeUnmount, onDeactivated, onMounted } from 'vue';
|
|
|
import { Button, Select, Pagination, Input, Modal, Radio, Tooltip, Popover, Form, RadioGroup } from 'ant-design-vue';
|
|
|
- import { ReloadOutlined, FileZipOutlined, TableOutlined } from '@ant-design/icons-vue';
|
|
|
+ import {
|
|
|
+ ReloadOutlined,
|
|
|
+ FileZipOutlined,
|
|
|
+ TableOutlined,
|
|
|
+ MobileOutlined,
|
|
|
+ FileOutlined,
|
|
|
+ FolderOutlined,
|
|
|
+ } from '@ant-design/icons-vue';
|
|
|
import { BasicTable, type BasicColumn } from '@/core/components/Table';
|
|
|
import TableSetting from '@/core/components/Table/src/components/settings/index.vue';
|
|
|
import { createTableContext } from '@/core/components/Table/src/hooks/useTableContext';
|
|
|
@@ -633,9 +647,20 @@
|
|
|
columns.value = defaultColumns.map((column) => applyResultSortProps(column));
|
|
|
};
|
|
|
|
|
|
+ /** 电子数据包节点(后端 type=eds,检材目录树入口) */
|
|
|
+ const isEdsTreeNode = (node?: GovernTree | null) => String(node?.type ?? '').trim() === 'eds';
|
|
|
+
|
|
|
+ /**
|
|
|
+ * ant Tree 的 icon 插槽参数里,dataRef 是树节点项,其 dataRef 才是 GovernTree,
|
|
|
+ * 这里统一还原成业务节点,供图标判断使用。
|
|
|
+ */
|
|
|
+ const resolveSlotGovernNode = (slotProps?: Recordable): GovernTree | undefined =>
|
|
|
+ (slotProps?.dataRef?.dataRef ?? slotProps?.data?.dataRef) as GovernTree | undefined;
|
|
|
+
|
|
|
const formatTreeTitle = (node: GovernTree) => {
|
|
|
const name = node.tableNameCn ?? node.tableNameEn ?? '';
|
|
|
- const countText = typeof node.dataCount === 'number' ? ` (${node.dataCount})` : '';
|
|
|
+ // 电子数据包节点不展示数据条数
|
|
|
+ const countText = !isEdsTreeNode(node) && typeof node.dataCount === 'number' ? ` (${node.dataCount})` : '';
|
|
|
return `${name}${countText}` || `节点-${node.id ?? ''}`;
|
|
|
};
|
|
|
|