From 683ff2f934ab20c9b5ddbbc37ed19896a470adf7 Mon Sep 17 00:00:00 2001 From: xuhuajiao <13476289682@163.com> Date: Thu, 27 Nov 2025 14:56:57 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../prearchiveLibrary/prearchiveLibrary.js | 11 +-- src/assets/styles/prearchive-library.scss | 2 - src/assets/styles/yxk-admin.scss | 15 +++- src/utils/index.js | 26 ------- .../managementLibrary/anjuan/tableList.vue | 10 +-- .../managementLibrary/juannei/index.vue | 5 +- .../module/collectHeader.vue | 4 +- .../collectionLibrary/index.vue | 1 + src/views/components/category/PreviewForm.vue | 73 ++++++++++++++++++- src/views/components/categoryTree.vue | 5 +- src/views/prearchiveLibrary/index.vue | 6 ++ src/views/prearchiveLibrary/module/detail.vue | 34 +++------ src/views/prearchiveLibrary/treeList.vue | 50 +++++++++++-- src/views/preview/index.vue | 21 +++++- src/views/system/archiveScopeManage/index.vue | 36 ++++++++- src/views/system/archivesCategory/index.vue | 39 +++++++--- src/views/system/archivesClassify/index.vue | 35 ++++++++- src/views/system/groupManage/index.vue | 11 ++- .../system/notifyManage/module/selectObj.vue | 55 ++++++++++++-- 19 files changed, 327 insertions(+), 112 deletions(-) diff --git a/src/api/prearchiveLibrary/prearchiveLibrary.js b/src/api/prearchiveLibrary/prearchiveLibrary.js index ac29c91..880c577 100644 --- a/src/api/prearchiveLibrary/prearchiveLibrary.js +++ b/src/api/prearchiveLibrary/prearchiveLibrary.js @@ -117,13 +117,4 @@ export function FetchReDocumentBase64ByFileId(params) { }) } -// downloadFile -export function FetchDownload(params) { - return request({ - url: 'api/minioUpload/download', - method: 'get', - params - }) -} - -export default { add, prearchEdit, del, FetchInitPreDocument, FetchInitDocumentsViewTable, FetchDoeditDocument, FetchBatchToFile, FetchMergeToFile, FetchMove, FetchArchivesDetails, FetchFileListByDocumentId, FetchArchivesMetadata, FetchReDocumentBase64ByFileId, FetchDownload } +export default { add, prearchEdit, del, FetchInitPreDocument, FetchInitDocumentsViewTable, FetchDoeditDocument, FetchBatchToFile, FetchMergeToFile, FetchMove, FetchArchivesDetails, FetchFileListByDocumentId, FetchArchivesMetadata, FetchReDocumentBase64ByFileId } diff --git a/src/assets/styles/prearchive-library.scss b/src/assets/styles/prearchive-library.scss index 3f911ce..0bb716a 100644 --- a/src/assets/styles/prearchive-library.scss +++ b/src/assets/styles/prearchive-library.scss @@ -1,7 +1,5 @@ @import 'variables'; @import 'mixin'; - - .move-form{ ::v-deep .el-dialog{ width: 1000px; diff --git a/src/assets/styles/yxk-admin.scss b/src/assets/styles/yxk-admin.scss index e37e146..438b950 100644 --- a/src/assets/styles/yxk-admin.scss +++ b/src/assets/styles/yxk-admin.scss @@ -1052,9 +1052,7 @@ input[type ='number'] { &:hover{ background-color: #F5F9FC; } - p, span, i{ - // line-height: 40px; - } + p{ width: 300px; overflow: hidden; @@ -2101,4 +2099,15 @@ input[type ='number'] { .el-button--info.check-btn.is-plain:focus{ color: #fff !important; background-color: #0348f3 !important; +} + +.el-tree{ + .el-tooltip { + display: inline-block; + font-weight: normal; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + width: 200px; + } } \ No newline at end of file diff --git a/src/utils/index.js b/src/utils/index.js index e8be029..5046e72 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -474,29 +474,3 @@ export function saveByteArray(fileName, byte) { link.download = fileName link.click() } - -// 下载文件 -export function downloadMinioFile(obj, name, suffix) { - // 校验参数,避免空值 - if (!obj || !name || !suffix) { - console.error('下载参数缺失:obj/name/suffix不能为空') - return - } - try { - const blob = new Blob([obj]) - const url = window.URL.createObjectURL(blob) - const link = document.createElement('a') - link.style.display = 'none' - link.href = url - const fileName = `${name}.${suffix}` - link.setAttribute('download', fileName) - document.body.appendChild(link) - link.click() - setTimeout(() => { - document.body.removeChild(link) - window.URL.revokeObjectURL(url) - }, 100) - } catch (err) { - console.error('下载工具函数执行失败:', err) - } -} diff --git a/src/views/archivesManage/managementLibrary/anjuan/tableList.vue b/src/views/archivesManage/managementLibrary/anjuan/tableList.vue index 7a352cf..586fa07 100644 --- a/src/views/archivesManage/managementLibrary/anjuan/tableList.vue +++ b/src/views/archivesManage/managementLibrary/anjuan/tableList.vue @@ -47,27 +47,21 @@ {{ scope.row[field.fieldName] }} - + {{ scope.row.tid ? '已绑': '未绑' }} - - + --> - + {{ scope.row.tid ? '已绑': '未绑' }} @@ -73,7 +72,7 @@ - + --> - 标签绑定 + 在线移交 diff --git a/src/views/collectReorganizi/collectionLibrary/index.vue b/src/views/collectReorganizi/collectionLibrary/index.vue index 02910da..4317939 100644 --- a/src/views/collectReorganizi/collectionLibrary/index.vue +++ b/src/views/collectReorganizi/collectionLibrary/index.vue @@ -796,4 +796,5 @@ export default { } } } + diff --git a/src/views/components/category/PreviewForm.vue b/src/views/components/category/PreviewForm.vue index 30a37d6..8da32a5 100644 --- a/src/views/components/category/PreviewForm.vue +++ b/src/views/components/category/PreviewForm.vue @@ -60,6 +60,9 @@ > + @@ -109,8 +109,9 @@ import { form } from '@crud/crud' import { FetchArchivesDetails, FetchFileListByDocumentId, FetchArchivesMetadata } from '@/api/prearchiveLibrary/prearchiveLibrary' import { mapGetters } from 'vuex' -import { downloadMinioFile } from '@/utils/index' +import { downloadFile } from '@/utils/index' import { getToken } from '@/utils/auth' + export default { name: 'PrearchiveLibraryDetail', components: { }, @@ -150,34 +151,21 @@ export default { mounted() { }, methods: { - // 下载附件 downloadFile(row) { - const url = this.baseApi + '/api/minioUpload/download' + row.file_path + // filePath 保存的文件路径 + // bucketType 1预归档 2档案 + const url = this.baseApi + '/api/minioUpload/getFile?filePath=' + row.file_path + '&bucketType=1' const fetchOptions = { method: 'GET', headers: { 'Authorization': getToken() } } - - fetch(url, fetchOptions) - .then(res => { - if (!res.ok) { - throw new Error(`请求失败:${res.status} ${res.statusText}`) - } - return res.blob() - }) - .then(blob => { - downloadMinioFile(blob, row.file_name.split('.')[0], row.file_type) - }) - .catch((err) => { - console.error('下载失败详情:', err) - this.$message({ - message: '下载文件失败,请检查权限或网络', - type: 'error', - offset: 8 - }) - }) + fetch(url, fetchOptions).then(res => res.blob()).then(blob => { + downloadFile(blob, row.file_name.split('.')[0], row.file_type) + }).catch(() => { + this.$message({ message: '下载文件失败', type: 'error', offset: 8 }) + }) }, toPreview(row) { const routeData = this.$router.resolve({ diff --git a/src/views/prearchiveLibrary/treeList.vue b/src/views/prearchiveLibrary/treeList.vue index f7698ec..d006f73 100644 --- a/src/views/prearchiveLibrary/treeList.vue +++ b/src/views/prearchiveLibrary/treeList.vue @@ -6,13 +6,35 @@
- - - {{ data.label }} - - - {{ data.label }} - + +
+ {{ data.label }} + + + {{ data.label }} + + +
+
+ {{ data.label }} + + + {{ data.label }} + + +
@@ -81,7 +103,6 @@ export default { isType: 1, label: item.fonds.fonds_name, children: item.document.map((doc, childIndex) => { - // 生成唯一的子节点 id const uniqueChildId = `${item.fonds.fonds_id}_${doc.id}_${childIndex}` return { ...doc, @@ -120,7 +141,20 @@ export default { [data-theme=dark] .elect-cont-left .container-left { min-height: calc(100vh - 158px); } +.container-left .el-tree{ + margin: 0 !important; +} .tree-scroll{ font-size: 14px; + height: calc(100vh - 178px); + overflow-y: scroll; + overflow-x: hidden; +} +.tree-text.el-tooltip { + font-weight: normal; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + width: 170px; } diff --git a/src/views/preview/index.vue b/src/views/preview/index.vue index d651bbe..12deccb 100644 --- a/src/views/preview/index.vue +++ b/src/views/preview/index.vue @@ -64,6 +64,7 @@ import { downloadFile } from '@/utils/index' import { mapGetters } from 'vuex' import html2canvas from 'html2canvas' // 转图片打印需要先安装html2Canvas和print-js import printJS from 'print-js' +import { getToken } from '@/utils/auth' export default { name: 'Preview', @@ -166,11 +167,25 @@ export default { }, // 下载附件 downloadFile(row) { - const url = this.baseApi + '/downloadFile' + row.file_path - fetch(url).then(res => res.blob()).then(blob => { + // filePath 保存的文件路径 + // bucketType 1预归档 2档案 + let bucketType = null + if (this.documentId) { + bucketType = 1 + } else { + bucketType = 2 + } + const url = this.baseApi + '/api/minioUpload/getFile?filePath=' + row.file_path + '&bucketType=' + bucketType + const fetchOptions = { + method: 'GET', + headers: { + 'Authorization': getToken() + } + } + fetch(url, fetchOptions).then(res => res.blob()).then(blob => { downloadFile(blob, row.file_name.split('.')[0], row.file_type) }).catch(() => { - this.$message({ message: '下载文件失败!', type: 'error', offset: 8 }) + this.$message({ message: '下载文件失败', type: 'error', offset: 8 }) }) }, selectFile(item) { diff --git a/src/views/system/archiveScopeManage/index.vue b/src/views/system/archiveScopeManage/index.vue index a751bb6..1b3fd03 100644 --- a/src/views/system/archiveScopeManage/index.vue +++ b/src/views/system/archiveScopeManage/index.vue @@ -17,7 +17,34 @@ :props="defaultProps" :expand-on-click-node="false" @node-click="handleNodeClick" - /> + > + +
+ {{ data.cnName }} + + + {{ data.cnName }} + + +
+
+ {{ data.cnName }} + + + {{ data.cnName }} + + +
+
+ {{ data.cnName }} + + + {{ data.cnName }} + + +
+
+ @@ -149,6 +176,11 @@ export default { } .tree-scroll{ font-size: 14px; + height: calc(100vh - 178px); + overflow-y: scroll; + overflow-x: hidden; +} +.tree-text.el-tooltip { + width: 160px !important; } - diff --git a/src/views/system/archivesCategory/index.vue b/src/views/system/archivesCategory/index.vue index c764dd3..24ad014 100644 --- a/src/views/system/archivesCategory/index.vue +++ b/src/views/system/archivesCategory/index.vue @@ -33,15 +33,30 @@ - - {{ data.cnName }} - - - {{ data.cnName }} - - - {{ data.cnName }} - +
+ {{ data.cnName }} + + + {{ data.cnName }} + + +
+
+ {{ data.cnName }} + + + {{ data.cnName }} + + +
+
+ {{ data.cnName }} + + + {{ data.cnName }} + + +
@@ -320,5 +335,11 @@ export default { diff --git a/src/views/system/archivesClassify/index.vue b/src/views/system/archivesClassify/index.vue index 2f10d2c..bdece57 100644 --- a/src/views/system/archivesClassify/index.vue +++ b/src/views/system/archivesClassify/index.vue @@ -16,7 +16,34 @@ :props="defaultProps" :expand-on-click-node="false" @node-click="handleNodeClick" - /> + > + +
+ {{ data.cnName }} + + + {{ data.cnName }} + + +
+
+ {{ data.cnName }} + + + {{ data.cnName }} + + +
+
+ {{ data.cnName }} + + + {{ data.cnName }} + + +
+
+ @@ -128,5 +155,11 @@ export default { } .tree-scroll{ font-size: 14px; + height: calc(100vh - 178px); + overflow-y: scroll; + overflow-x: hidden; +} +.tree-text.el-tooltip { + width: 160px !important; } diff --git a/src/views/system/groupManage/index.vue b/src/views/system/groupManage/index.vue index b98012b..4e9515e 100644 --- a/src/views/system/groupManage/index.vue +++ b/src/views/system/groupManage/index.vue @@ -77,7 +77,7 @@ - + @@ -302,8 +302,13 @@ export default { this.deleteData.forEach(val => { ids.push(val.fondsId) }) - crudfonds.del(ids).then(() => { - this.$message({ message: '删除成功', type: 'success', offset: 8 }) + crudfonds.del(ids).then((res) => { + console.log('res', res) + if (res !== 0) { + this.$message({ message: '删除成功', type: 'success', offset: 8 }) + } else { + this.$message({ message: '删除失败', type: 'error', offset: 8 }) + } this.crud.delAllLoading = false this.crud.refresh() }).catch(err => { diff --git a/src/views/system/notifyManage/module/selectObj.vue b/src/views/system/notifyManage/module/selectObj.vue index 1100741..6445761 100644 --- a/src/views/system/notifyManage/module/selectObj.vue +++ b/src/views/system/notifyManage/module/selectObj.vue @@ -17,10 +17,18 @@ @@ -80,7 +88,7 @@ export default { return { fondsDatas: [], defaultExpandedKeys: [], - defaultProps: { children: 'children', label: 'fondsName' }, + defaultProps: { children: 'children', label: 'label' }, sendObjVisible: false, selectObjForm: { @@ -124,10 +132,21 @@ export default { parent.fondsName = '全宗选择' FetchFondsAll().then(res => { res.forEach(item => { - item.children = item.depts + // 1. 全宗节点:将fondsName赋值给label + item.label = item.fondsName + // 2. 部门节点(depts -> children):将deptsName赋值给label + if (item.depts && item.depts.length) { + item.children = this.formatDeptNodes(item.depts) + } else { + item.children = [] + } }) + // 根节点添加label + parent.label = parent.fondsName parent.children = res this.fondsDatas.push(parent) + + console.log('this.fondsDatas', this.fondsDatas) this.$nextTick(() => { Vue.set(this.defaultExpandedKeys, 0, this.fondsDatas[0].children[0].id) this.$refs.tree.setCurrentKey(this.fondsDatas[0].children[0].id) @@ -135,6 +154,27 @@ export default { }) }) }, + // 格式化部门节点:添加label字段 + formatDeptNodes(depts) { + return depts.map(dept => { + const node = { ...dept } + node.label = dept.deptsName // 部门节点用deptsName作为label + // 如果有子部门(childDepts),递归处理 + if (dept.childDepts && dept.childDepts.length) { + node.children = this.formatDeptNodes(dept.childDepts) + } + return node + }) + }, + // 可选:格式化分类节点(如果需要展示categorys) + formatCategoryNodes(categorys) { + return categorys.map(cate => { + const node = { ...cate } + node.label = cate.cnName // 分类节点用cnName作为label + return node + }) + }, + // 切换部门 handleNodeClick(data) { let params = {} @@ -359,4 +399,7 @@ export default { background-color: #f5f9fc; color: #0c0e1e; } +.el-tree .el-tooltip{ + width: 140px !important; +}