From 91281fc6a0875289db5f2a37630c173f98350fd1 Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Wed, 3 Dec 2025 10:23:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fileManager/components/addTableData.vue | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/src/views/fileManager/components/addTableData.vue b/src/views/fileManager/components/addTableData.vue index 391c8dc2..c29a2d5f 100644 --- a/src/views/fileManager/components/addTableData.vue +++ b/src/views/fileManager/components/addTableData.vue @@ -37,15 +37,16 @@ > - + check-strictly + :props="{ value: 'id', label: 'label', children: 'children' }" + style="width: 100%" + /> { } else { console.error('获取档案标识代码字典失败:', markCodeRes.data.msg) } + const convertToVueTree = (data) => { + if (!data || !Array.isArray(data)) return []; + return data.map((item) => { + const node = { + id: item.id, + label: item.title + }; + if (item.children && Array.isArray(item.children) && item.children.length > 0) { + const children = convertToVueTree(item.children); + if (children.length > 0) node.children = children; + + } + return node; + }); + }; + const deptRes = await getDeptTree(); + dictData.unit_name = convertToVueTree(deptRes.data.data); + + // 获取文件大小限制字典 const fileSizeRes = await getDictDataByTypeApi({ dictType: 'file_size_limit' }) @@ -237,6 +259,7 @@ const fetchDictData = async () => { console.error('获取字典数据失败:', error) // 使用默认值 dictData.mark_code = [] + dictData.unit_name = [] dictData.file_size_limit = [] } }