From a41394d8bd9cfe6118017341b3067f0337f12cb1 Mon Sep 17 00:00:00 2001
From: cwchen <1048842385@qq.com>
Date: Thu, 18 Sep 2025 11:16:04 +0800
Subject: [PATCH] =?UTF-8?q?=E6=A1=A3=E6=A1=88=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../fileManager/fileManager.js | 15 +-
.../fileManager/components/leftTree.vue | 10 +-
.../fileManager/components/rightTable.vue | 8 +-
.../fileManager/file-data.vue | 252 +++++++++++++++---
.../archivesManagement/fileManager/index.vue | 5 +-
src/views/viewFile/viewFile.vue | 102 ++++---
6 files changed, 304 insertions(+), 88 deletions(-)
diff --git a/src/api/archivesManagement/fileManager/fileManager.js b/src/api/archivesManagement/fileManager/fileManager.js
index a0bff6c..7493267 100644
--- a/src/api/archivesManagement/fileManager/fileManager.js
+++ b/src/api/archivesManagement/fileManager/fileManager.js
@@ -117,11 +117,11 @@ export function getFileManageByIdApi(params) {
}
// 档案移交确认
-export function updateIntegrityStatusApi(params) {
+export function updateIntegrityStatusApi(data) {
return request({
url: '/smartArchives/fileManage/updateIntegrityStatus',
- method: 'get',
- params
+ method: 'post',
+ data
})
}
@@ -132,4 +132,13 @@ export function fileExtractApi(data) {
method: 'post',
data
})
+}
+
+// 文件预览
+export function getFileAsBase64Api(params) {
+ return request({
+ url: '/smartArchives/fileManage/getFileAsBase64',
+ method: 'get',
+ params:params
+ })
}
\ No newline at end of file
diff --git a/src/views/archivesManagement/fileManager/components/leftTree.vue b/src/views/archivesManagement/fileManager/components/leftTree.vue
index 6aced6a..43ed01a 100644
--- a/src/views/archivesManagement/fileManager/components/leftTree.vue
+++ b/src/views/archivesManagement/fileManager/components/leftTree.vue
@@ -12,7 +12,7 @@
查询
+ v-hasPermi="['archive:catalogue:add']" @click="addTree" v-if="fileStatus === '0'">
新增
@@ -31,14 +31,14 @@
{{ node.label }}
- addTree(data)" v-hasPermi="['file:manage:add']">
- editTree(data, data)"
v-hasPermi="['file:manage:update']">
- delTree(node, data)" v-hasPermi="['file:manage:del']">
@@ -59,7 +59,7 @@ import FileAddTreeData from './addTreeData.vue'
export default {
name: 'FileLeftTree',
components: { FileAddTreeData },
- props: ["projectId"],
+ props: ["projectId", "fileStatus"],
data() {
return {
treeDataList: [],
diff --git a/src/views/archivesManagement/fileManager/components/rightTable.vue b/src/views/archivesManagement/fileManager/components/rightTable.vue
index 448ef37..94f289f 100644
--- a/src/views/archivesManagement/fileManager/components/rightTable.vue
+++ b/src/views/archivesManagement/fileManager/components/rightTable.vue
@@ -2,7 +2,7 @@
-
{{ data.dataSource === '1' ? '本系统上传' : '智慧现场' }}
@@ -12,7 +12,7 @@
+ @click="handleAdd" :disabled="addBtnIsShow" v-if="fileStatus === '0'">
新增
@@ -58,6 +58,10 @@ export default {
selectedNode:{
type:Object,
default:null
+ },
+ fileStatus:{
+ type:String,
+ default:''
}
},
components: {
diff --git a/src/views/archivesManagement/fileManager/file-data.vue b/src/views/archivesManagement/fileManager/file-data.vue
index ecc0a94..cb229a4 100644
--- a/src/views/archivesManagement/fileManager/file-data.vue
+++ b/src/views/archivesManagement/fileManager/file-data.vue
@@ -3,10 +3,12 @@
@@ -27,6 +74,7 @@
import LeftTree from './components/leftTree.vue'
import RightTable from './components/rightTable.vue'
import { fileExtractApi, updateIntegrityStatusApi } from '@/api/archivesManagement/fileManager/fileManager'
+import { decryptWithSM4 } from '@/utils/sm'
export default {
name: 'FileData',
components: {
@@ -36,14 +84,23 @@ export default {
data() {
return {
projectId: null,
+ fileStatus: null,
// 选中的节点
selectedNode: null,
+ // 档案同步弹框相关
+ syncDialogVisible: false,
+ isSyncing: false,
+ syncSuccess: false,
+ syncError: false,
+ integrityStatus: false,
+ // 确认弹框相关
+ confirmDialogVisible: false,
}
},
created() {
// 获取传递的项目ID
- this.projectId = this.$route.query.id
- console.log('接收到的项目ID:', this.projectId)
+ this.projectId = decryptWithSM4(this.$route.query.id)
+ this.fileStatus = decryptWithSM4(this.$route.query.fileStatus)
},
methods: {
handleClose() {
@@ -54,39 +111,76 @@ export default {
handleNodeClick(data) {
this.selectedNode = data;
},
- // 档案抽取
- handleFileExtract() {
- // 显示档案同步中的提示
- const loadingInstance = this.$loading({
- lock: true,
- text: '档案同步中...',
- spinner: 'el-icon-loading',
- background: 'rgba(0, 0, 0, 0.7)'
- });
-
- // 调用档案抽取接口
- fileExtractApi({ projectId: this.projectId })
+ // 移交清单确认
+ moveListConfirm() {
+ this.integrityStatus = true;
+ },
+ // 完整性确认
+ handleIntegrityStatus() {
+ this.confirmDialogVisible = true;
+ },
+ // 确认完整性状态
+ confirmIntegrityStatus() {
+ this.closeConfirmDialog();
+ // 调用完整性确认接口
+ updateIntegrityStatusApi({ proId: this.projectId })
.then(res => {
- // 关闭加载提示
- loadingInstance.close();
-
if (res.code === 200) {
- this.$message.success('同步档案已完成');
+ this.$message.success('完整性确认成功');
+ this.closeConfirmDialog();
+ // 可以在这里添加其他逻辑,比如刷新页面或更新状态
} else {
- this.$message.error(res.msg || '档案同步失败');
+ this.$message.error(res.msg || '完整性确认失败');
}
})
.catch(error => {
- // 关闭加载提示
- loadingInstance.close();
- this.$message.error('档案同步失败,请重试');
- console.error('档案抽取失败:', error);
+ this.$message.error('完整性确认失败,请重试');
+ console.error('完整性确认失败:', error);
});
},
- // 档案移交确认
- handleUpdateIntegrityStatus() {
-
- }
+ // 关闭确认弹框
+ closeConfirmDialog() {
+ this.confirmDialogVisible = false;
+ setTimeout(() => {
+ const obj = { path: "/archivesManagement/fileManager" }
+ this.$tab.closeOpenPage(obj)
+ }, 200);
+ },
+ // 档案抽取
+ handleFileExtract() {
+ // 显示同步弹框
+ this.syncDialogVisible = true;
+ this.isSyncing = true;
+ this.syncSuccess = false;
+ this.syncError = false;
+
+ // 调用档案抽取接口
+ setTimeout(() => {
+ fileExtractApi({ projectId: this.projectId })
+ .then(res => {
+ this.isSyncing = false;
+
+ if (res.code === 200) {
+ this.syncSuccess = true;
+ } else {
+ this.syncError = true;
+ }
+ })
+ .catch(error => {
+ this.isSyncing = false;
+ this.syncError = true;
+ console.error('档案抽取失败:', error);
+ });
+ }, 2000);
+ },
+ // 关闭同步弹框
+ closeSyncDialog() {
+ this.syncDialogVisible = false;
+ this.isSyncing = false;
+ this.syncSuccess = false;
+ this.syncError = false;
+ },
+
}
}
@@ -133,4 +227,96 @@ export default {
.pane-right {
overflow: hidden;
}
+
+/* 档案同步弹框样式 */
+.dialog-title {
+ text-align: left;
+}
+
+.dialog-footer {
+ text-align: right !important;
+}
+
+.dialog-footer .el-button+.el-button {
+ margin-left: 8px;
+}
+
+.sync-content {
+ text-align: center;
+ padding: 20px 0;
+}
+
+.sync-icon {
+ font-size: 48px;
+ margin-bottom: 16px;
+}
+
+.sync-icon .el-icon-loading {
+ color: #409EFF;
+ animation: rotating 2s linear infinite;
+}
+
+.sync-icon .el-icon-success {
+ color: #67C23A;
+}
+
+.sync-icon .el-icon-error {
+ color: #F56C6C;
+}
+
+.sync-text p {
+ margin: 0;
+ font-size: 16px;
+ color: #606266;
+}
+
+.success-text {
+ color: #67C23A !important;
+}
+
+.error-text {
+ color: #F56C6C !important;
+}
+
+@keyframes rotating {
+ 0% {
+ transform: rotate(0deg);
+ }
+
+ 100% {
+ transform: rotate(360deg);
+ }
+}
+
+/* 确认弹框样式 */
+.confirm-content {
+ display: flex;
+ align-items: flex-start;
+ padding: 20px 0;
+}
+
+.confirm-icon {
+ font-size: 48px;
+ color: #E6A23C;
+ margin-right: 16px;
+ flex-shrink: 0;
+}
+
+.confirm-text {
+ flex: 1;
+}
+
+.main-message {
+ margin: 0 0 8px 0;
+ font-size: 16px;
+ color: #303133;
+ line-height: 1.5;
+}
+
+.sub-message {
+ margin: 0;
+ font-size: 14px;
+ color: #909399;
+ line-height: 1.4;
+}
\ No newline at end of file
diff --git a/src/views/archivesManagement/fileManager/index.vue b/src/views/archivesManagement/fileManager/index.vue
index 419bd31..8c17c6b 100644
--- a/src/views/archivesManagement/fileManager/index.vue
+++ b/src/views/archivesManagement/fileManager/index.vue
@@ -30,6 +30,7 @@