From 573265f7d79341298ba4287be38f00ddbc66e7ec Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期五, 07 三月 2025 12:00:51 +0800 Subject: [PATCH] 标准查新bug --- src/views/CNAS/systemManagement/documentControl/components/FileList.vue | 42 +++++++++++++++++++++--------------------- 1 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/views/CNAS/systemManagement/documentControl/components/FileList.vue b/src/views/CNAS/systemManagement/documentControl/components/FileList.vue index b3d2158..4696f3e 100644 --- a/src/views/CNAS/systemManagement/documentControl/components/FileList.vue +++ b/src/views/CNAS/systemManagement/documentControl/components/FileList.vue @@ -21,8 +21,9 @@ <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button> </div> <div class="btns" style="padding-left: 30px;"> - <el-upload :action="action" :multiple="false" accept='.xls,.xlsx' :headers="headers" :on-change="beforeUpload" - :on-error="onError" ref='upload' :on-success="handleSuccessUp" :show-file-list="false"> + <el-upload :action="action" :multiple="false" accept='.xls,.xlsx' :headers="uploadHeader" + :on-change="beforeUpload" :on-error="onError" ref='upload' :on-success="handleSuccessUp" + :show-file-list="false"> <el-button size="small" type="primary" :loading="upLoading">瀵煎叆</el-button></el-upload> </div> </div> @@ -96,7 +97,6 @@ delManageDocumentList, doManageDocumentList, } from '@/api/cnas/systemManagement/documentControl.js' -import { getToken } from "@/utils/auth"; export default { components: { UpPdfStamp, @@ -201,11 +201,6 @@ }, // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭� computed: { - headers() { - return { - 'Authorization': "Bearer " + getToken() - } - }, action() { return this.javaApi + '/manageDocumentList/exportManageDocumentList' } @@ -257,8 +252,7 @@ // 涓嬭浇鏂囦欢 handleDown(row) { if (!row.url) return this.$message.warning('鏂囦欢鏈笂浼�') - let url = this.javaApi + '/word/' + row.url - this.$download.saveAs(url, row.url); + this.$download.downloadFileFromUrl(row.url, row.url); }, // 鏌ョ湅鏂囦欢 handleLook(row) { @@ -322,6 +316,8 @@ if (response.code == 200) { this.$message.success('涓婁紶鎴愬姛'); this.refreshTable() + }else { + this.$message.error(response.msg); } }, selectEnumByCategory() { @@ -339,17 +335,22 @@ formData.append('file', pdfBlob, fileName); // 鏂囦欢瀛楁 formData.append('id', this.currentInfo.id); // 鏂囦欢鍚嶅瓧娈� - let res = await uploadFileManageDocumentList(formData) - this.addLoading = false - if (res.code == 200) { - this.$message({ message: '涓婁紶鎴愬姛', type: 'success' }); - this.addDialogVisible = false; - this.refreshTable() - return true - } else { - this.$message({ message: '涓婁紶澶辫触', type: 'error' }); - return false + try { + let res = await uploadFileManageDocumentList(formData) + this.addLoading = false + if (res.code == 200) { + this.$message({ message: '涓婁紶鎴愬姛', type: 'success' }); + this.addDialogVisible = false; + this.refreshTable() + return true + } else { + this.$message({ message: '涓婁紶澶辫触', type: 'error' }); + return false + } + } catch (e) { + this.addLoading = false } + }, handleDelete(row) { this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", { @@ -359,7 +360,6 @@ }) .then(() => { delManageDocumentList({ id: row.id }).then((res) => { - if (res.code == 201) return; this.$message.success("鍒犻櫎鎴愬姛"); this.refresh(); }); -- Gitblit v1.9.3