From 0c6b2eb953f5ed4df00a77a5f7b14b9ff6c563fe Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期日, 04 一月 2026 23:59:06 +0800
Subject: [PATCH] 修改代码
---
src/utils/request.js | 2
src/views/archiveManager/archiveMaterial/index.vue | 71 ++++++++++++++---------
src/views/archiveManager/index.vue | 100 +++++++++++++++++++++-----------
3 files changed, 110 insertions(+), 63 deletions(-)
diff --git a/src/utils/request.js b/src/utils/request.js
index 7150ecb..25e2e89 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -17,7 +17,7 @@
// axios涓姹傞厤缃湁baseURL閫夐」锛岃〃绀鸿姹俇RL鍏叡閮ㄥ垎
baseURL: process.env.VUE_APP_BASE_API,
// 瓒呮椂
- timeout: 10000
+ timeout: 30000
})
// request鎷︽埅鍣�
diff --git a/src/views/archiveManager/archiveMaterial/index.vue b/src/views/archiveManager/archiveMaterial/index.vue
index d4c3320..79fd6da 100644
--- a/src/views/archiveManager/archiveMaterial/index.vue
+++ b/src/views/archiveManager/archiveMaterial/index.vue
@@ -278,7 +278,7 @@
icon="el-icon-download"
size="mini"
@click="handleExportDir"
- v-hasPermi="['system:materials:export']"
+ v-hasPermi="['system:materials:list']"
>瀵煎嚭鍗峰唴鐩綍</el-button>
</el-col>
@@ -289,7 +289,7 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
- v-hasPermi="['system:materials:export']"
+ v-hasPermi="['system:materials:list']"
>瀵煎嚭鐢靛瓙鏂囦欢鐩綍</el-button>
</el-col>
@@ -354,7 +354,7 @@
>瀵煎叆妯℃澘涓嬭浇</el-button>
</el-col>
- <el-col :span="1.5">
+ <el-col v-if="sho" :span="1.5">
<el-upload
action=""
@@ -376,7 +376,7 @@
<el-table v-loading="loading" :data="materialsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
- <el-table-column label="鎿嶄綔" align="center" width="160" class-name="small-padding ">
+ <el-table-column v-if="sho" label="鎿嶄綔" align="center" width="160" class-name="small-padding ">
<template slot-scope="scope">
<el-button
size="mini"
@@ -828,13 +828,17 @@
importDialogVisible: false,
fileList: [],
- uploadUrl: process.env.VUE_APP_BASE_API +'/system/materials/upload/'+this.recordId, // 鏇挎崲涓哄疄闄呯殑涓婁紶鎺ュ彛
+ uploadUrl: process.env.VUE_APP_BASE_API +'/system/materials/uploads/'+this.recordId, // 鏇挎崲涓哄疄闄呯殑涓婁紶鎺ュ彛
headers: {
Authorization: 'Bearer ' + getToken()
},
uploadParams: {
type: 'material' // 鑷畾涔変笂浼犵被鍨�
},
+ // 涓婁紶鐘舵�佽窡韪�
+ uploadSuccessCount: 0,
+ uploadFailCount: 0,
+ totalUploadFiles: 0,
// 娣诲姞鏉愭枡绫诲瀷閫夐」
fileStyleOptions: [
{ value: '鏂囧瓧鏉愭枡', label: '鏂囧瓧鏉愭枡' },
@@ -901,7 +905,7 @@
titleSearchTimer: null, // 闃叉姈瀹氭椂鍣�
creatorSuggestions: [], // 鍖归厤鐨勮矗浠讳汉寤鸿鍒楄〃
showCreatorSuggestions: false, // 鏄惁鏄剧ず璐d换浜哄缓璁
- creatorSearchTimer: null, // persona鏌ヨ闃叉姈瀹氭椂鍣�
+ creatorSearchTimer: null, // 璐d换浜烘煡璇㈤槻鎶栧畾鏃跺櫒
// 鏄惁鏄剧ず寮瑰嚭灞�
open: false,
titles: "",
@@ -1051,29 +1055,43 @@
methods: {
// 涓婁紶澶辫触鍥炶皟
handleError(err, file, fileList) {
- this.$modal.msgError("涓婁紶澶辫触: " + err.message)
- // 娓呴櫎涓婁紶鍒楄〃
- this.$refs.upload.clearFiles();
+ // 澶辫触璁℃暟+1
+ this.uploadFailCount++;
+ // 妫�鏌ユ槸鍚︽墍鏈夋枃浠堕兘涓婁紶瀹屾垚
+ this.checkUploadComplete();
},
// 涓婁紶鎴愬姛鍥炶皟
handleSuccess(response, file, fileList) {
if (response.code === 200) {
- this.$modal.msgSuccess("涓婁紶鎴愬姛")
- // 娓呴櫎涓婁紶鍒楄〃
- this.$refs.upload.clearFiles();
- // 鍏抽棴涓婁紶瀵硅瘽妗�
- this.importDialogVisible = false;
- // 鍒锋柊鍒楄〃鏁版嵁
- this.getList(); // 杩欓噷鍙互璋冪敤鎺ュ彛鍏宠仈涓婁紶鐨勬枃浠跺拰褰撳墠璁板綍
- //鏇存柊妗f鐨勭姸鎬�
-
+ // 鎴愬姛璁℃暟+1
+ this.uploadSuccessCount++;
} else {
- // alert(234)
- console.log(response)
- this.$modal.msgError(response.msg)
+ // 澶辫触璁℃暟+1
+ this.uploadFailCount++;
+ }
+ // 妫�鏌ユ槸鍚︽墍鏈夋枃浠堕兘涓婁紶瀹屾垚
+ this.checkUploadComplete();
+ },
+ // 妫�鏌ユ墍鏈夋枃浠舵槸鍚︿笂浼犲畬鎴�
+ checkUploadComplete() {
+ // 褰撴墍鏈夋枃浠堕兘涓婁紶瀹屾垚鏃�
+ if (this.uploadSuccessCount + this.uploadFailCount === this.totalUploadFiles) {
+ if (this.uploadFailCount === 0) {
+ // 鎵�鏈夋枃浠朵笂浼犳垚鍔�
+ this.$modal.msgSuccess("鎵�鏈夋枃浠朵笂浼犳垚鍔�");
+ } else {
+ // 閮ㄥ垎鏂囦欢涓婁紶澶辫触
+ this.$modal.msgError(`涓婁紶瀹屾垚锛屼絾鏈� ${this.uploadFailCount} 涓枃浠朵笂浼犲け璐);
+ }
+ // 娓呴櫎涓婁紶鍒楄〃
+ this.$refs.upload.clearFiles();
+ // 鍏抽棴涓婁紶瀵硅瘽妗�
+ this.importDialogVisible = false;
+ // 鍒锋柊鍒楄〃鏁版嵁
+ this.getList();
}
},
- // 鎵撳紑瀵煎叆瀵硅瘽妗�
+ // 鎵撳紑瀵煎叆瀵硅瘽妗�
handleImport() {
//鐢熸垚鏂扮殑璁板綍
insertFile(this.recordId, this.totalPageCount).then(response => {
@@ -1118,6 +1136,10 @@
}
else
{
+ // 鍒濆鍖栦笂浼犵姸鎬佽鏁�
+ this.uploadSuccessCount = 0;
+ this.uploadFailCount = 0;
+ this.totalUploadFiles = fileCount;
// 鎵ц涓婁紶
this.$refs.upload.submit()
this.getList()
@@ -1743,11 +1765,6 @@
background-color: #fff;
}
</style>
-
-
-
-
-
diff --git a/src/views/archiveManager/index.vue b/src/views/archiveManager/index.vue
index aa291a8..6f319d2 100644
--- a/src/views/archiveManager/index.vue
+++ b/src/views/archiveManager/index.vue
@@ -1820,9 +1820,9 @@
this.getExcelFile(id).then(blob => {
this.$modal.closeLoading();
// 淇濆瓨鏂囦欢淇℃伅骞舵樉绀洪潤鎬佸脊绐�
- alert(23)
+ // alert(23)
this.currentExcelUrl = URL.createObjectURL(blob);
- alert(this.currentExcelUrl)
+ // alert(this.currentExcelUrl)
this.currentExcelBlob = blob;
this.currentExcelId = id;
this.excelDialogVisible = true;
@@ -1996,28 +1996,49 @@
// 鑾峰彇鐢ㄦ埛閫夋嫨鐨勯�夐」
const { includeQrCode, selectedAnnotations } = this.excelOptions;
console.log('涓嬭浇閫夐」:', { includeQrCode, selectedAnnotations });
+ var id = this.recordId ;
+ this.getExcelFile(id).then(blob => {
+ this.$modal.closeLoading();
+ // 淇濆瓨鏂囦欢淇℃伅骞舵樉绀洪潤鎬佸脊绐�
+ // alert(23)
+ this.currentExcelUrl = URL.createObjectURL(blob);
+ const link = document.createElement('a');
+ link.href = this.currentExcelUrl;
+
+ // 鏋勫缓鏂囦欢鍚嶏紝鍖呭惈閫夐」淇℃伅
+ let filename = `record_${this.currentExcelId}`;
+ if (includeQrCode) filename += '_qr';
+ // if (selectedAnnotations.length > 0) {
+ // filename += `_anno${selectedAnnotations.join('')}`;x
+ // }
+ filename += `_${new Date().getTime()}.xls`;
+
+ link.download = filename;
+
+ // 瑙﹀彂涓嬭浇
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+
+ // 鎻愮ず涓嬭浇鎴愬姛
+ this.$modal.msgSuccess('Excel鏂囦欢涓嬭浇鎴愬姛');
+ // alert(this.currentExcelUrl)
+ // this.currentExcelBlob = blob;
+ // this.currentExcelId = id;
+ // this.excelDialogVisible = true;
+ // this.excelLoading = false;
+ }).catch(error => {
+ this.$modal.closeLoading();
+ console.error('鑾峰彇Excel鏂囦欢澶辫触:', error);
+ this.$modal.msgError('鑾峰彇Excel鏂囦欢澶辫触锛岃绋嶅悗閲嶈瘯');
+
+
+ this.showExcelPreview = false;
+ });
+ // alert(this.excelOptions.includeQrCode)
// 鍒涘缓涓嬭浇閾炬帴锛屾枃浠跺悕鍖呭惈閫夐」淇℃伅
- const link = document.createElement('a');
- link.href = this.currentExcelUrl;
- // 鏋勫缓鏂囦欢鍚嶏紝鍖呭惈閫夐」淇℃伅
- let filename = `record_${this.currentExcelId}`;
- if (includeQrCode) filename += '_qr';
- // if (selectedAnnotations.length > 0) {
- // filename += `_anno${selectedAnnotations.join('')}`;x
- // }
- filename += `_${new Date().getTime()}.xls`;
-
- link.download = filename;
-
- // 瑙﹀彂涓嬭浇
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
-
- // 鎻愮ず涓嬭浇鎴愬姛
- this.$modal.msgSuccess('Excel鏂囦欢涓嬭浇鎴愬姛');
}
},
@@ -2059,20 +2080,25 @@
/** 浠庡悗绔幏鍙朎xcel鏂囦欢 */
getExcelFile(id) {
var includeQrCode = this.excelOptions.includeQrCode;
- var urls = `${process.env.VUE_APP_BASE_API}/system/records/recordFileList`+"/"+includeQrCode;
+ var urls = `${process.env.VUE_APP_BASE_API}/system/records/recordFileList`
+ //+"/"+includeQrCode;
- if(this.excelOptions.subselectedSignatures.length!=0)
- {
- var selectedSignatures = this.excelOptions.subselectedSignatures
- urls = urls +'/'+ selectedSignatures
- }
- if(this.excelOptions.subselectedAnnotations.length!=0)
- {
- var selectedAnnotations = this.excelOptions.subselectedAnnotations
- urls = urls+"/"+selectedAnnotations
- }
-
+// // if(this.excelOptions.subselectedSignatures.length!=0)
+// // {
+// // var selectedSignatures = this.excelOptions.subselectedSignatures
+// // urls = urls +'/'+ selectedSignatures
+// // // alert(urls)
+// // }
+// console.log(this.excelOptions.subselectedAnnotations)
+// alert(234)
+// if(this.excelOptions.subselectedAnnotations.length!=0)
+// {
+// var selectedAnnotations = this.excelOptions.subselectedAnnotations
+// urls = urls+"/"+selectedAnnotations
+// // alert(urls)
+// }
+// alert(urls)
return new Promise((resolve, reject) => {
// 棣栧厛灏濊瘯浣跨敤axios锛堥」鐩凡鏈夌殑HTTP瀹㈡埛绔級
try {
@@ -2082,13 +2108,17 @@
// 鏋勫缓鍙傛暟锛屽寘鍚敞瑙e唴瀹�
const params = {
recordId: id,
-
+ selectedSignatures: this.excelOptions.subselectedSignatures,
+ selectedAnnotations: this.excelOptions.subselectedAnnotations,
+ includeQrCode: this.excelOptions.includeQrCode
};
+ console.log(params)
+ alert(457)
axios({
method: 'Post',
url: urls,
- params: params,
+ data: params,
responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + getToken() }
}).then(response => {
--
Gitblit v1.9.1