From 5d4746a033d46ace622c4cecba55c5b9e26705bb Mon Sep 17 00:00:00 2001 From: zhangsir Date: Thu, 28 Mar 2024 19:22:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=84=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/evaluation.js | 1 + src/views/evaluation/EvaDown.vue | 19 ++++++++-- src/views/evaluation/evaluationUpload.vue | 45 +++++++++++++++-------- 3 files changed, 47 insertions(+), 18 deletions(-) diff --git a/src/api/evaluation.js b/src/api/evaluation.js index 4810ba61..b1f85161 100644 --- a/src/api/evaluation.js +++ b/src/api/evaluation.js @@ -34,3 +34,4 @@ export const savePermission = (obj) => http.post(`${ACTIVITYAPI}/permission/save export const saveLists = (obj) => http.post(`${ACTIVITYAPI}/permission/list`,obj) //删除配置管理 export const deleteId = (obj) => http.post(`${ACTIVITYAPI}/permission/delete`,obj) + diff --git a/src/views/evaluation/EvaDown.vue b/src/views/evaluation/EvaDown.vue index dee2eba8..7cf3a1b9 100644 --- a/src/views/evaluation/EvaDown.vue +++ b/src/views/evaluation/EvaDown.vue @@ -68,6 +68,7 @@ import { getPage,deleteById } from "@/api/evaluation"; import { useRoute } from "vue-router"; import { message } from "ant-design-vue"; import { useStore } from "vuex"; +import {boeRequest} from "@/api/request"; export default { name: "evadown", components: {}, @@ -153,19 +154,31 @@ import { useStore } from "vuex"; } const listData = async () => { state.tableLoading = true - await getPage({ + await boeRequest('/activityApi/evaluation/detail/getPage post',{ pid:route.query.id, pageNo: state.params.pageNo, pageSize: state.params.pageSize, searchParam:state.searchName - }).then((res) => { + }).then((res)=>{ if(res.code === 200){ state.tableLoading = false state.tableData = res.data.records, - console.log(state.tableData,'data') state.total = res.data.total } }) + // await getPage({ + // pid:route.query.id, + // pageNo: state.params.pageNo, + // pageSize: state.params.pageSize, + // searchParam:state.searchName + // }).then((res) => { + // if(res.code === 200){ + // state.tableLoading = false + // state.tableData = res.data.records, + // console.log(state.tableData,'data') + // state.total = res.data.total + // } + // }) } const searchList = () => { state.params.pageNo = 1 diff --git a/src/views/evaluation/evaluationUpload.vue b/src/views/evaluation/evaluationUpload.vue index 734b0c7e..54ee9357 100644 --- a/src/views/evaluation/evaluationUpload.vue +++ b/src/views/evaluation/evaluationUpload.vue @@ -40,7 +40,7 @@ -
+
-
- -
更多 @@ -165,7 +162,7 @@ - avatar + avatar
@@ -678,7 +675,8 @@ import { clear, savePermission, saveLists, - deleteId + deleteId, + downloadError } from "@/api/evaluation"; import { useStore } from "vuex"; import { message } from "ant-design-vue"; @@ -702,6 +700,7 @@ import { message } from "ant-design-vue"; powerStatus:{}, saveListPid: '', idValue: null, + downloadUrl:null, valueAll: [], uploadStatus: true, uploadId: '', @@ -734,7 +733,7 @@ import { message } from "ant-design-vue"; evaluationName: '', validated: 0, id: '', - imageUrl: '', + cover: '', remarks: '', }, bg_check: false, @@ -970,9 +969,10 @@ import { message } from "ant-design-vue"; }, { title: "操作", - width: "150", + width: 200, dataIndex: "id", key: "id", + fixed: 'right', align: "center", slots: { customRender: "action" }, }, @@ -1072,12 +1072,15 @@ import { message } from "ant-design-vue"; }; //报告上传 const bgupload = () => { + state.downloadUrl = null state.uploadId = '' state.valueAll = [] + state.btShow = true state.bg_check = true; state.formData = {} } const bgupload1 = (record) => { + state.downloadUrl = null console.log(record,'record') state.valueAll = [] state.uploadDownId =record.id @@ -1095,6 +1098,7 @@ import { message } from "ant-design-vue"; const of_exit = () => { state.bg_check = false; state.errorMessage = '' + state.uploadDownId = '' // state.uploadId = '' state.uploadName = '' state.loadData = false @@ -1110,14 +1114,22 @@ import { message } from "ant-design-vue"; state.bg_results = false } const failedDownload = () => { - console.log('aaa') - window.open(`/activityApi/evaluation/download?id=${state.totalNumber.failedIds}`); + const ids = state.totalNumber.failedIds.join(',') + window.open(`/activityApi/evaluation/download-failed?ids=${ids}`) + } const reportUpload = async () => { if(!state.formData.evaluationName){ message.error('请输入测评标题名称') return } + console.log(state.valueAll,'aaaa') + if(state.totalNumber.failedEntries&&state.valueAll.length!=0){ + message.error('请先下载失败数据,并修改后重新上传') + state.bg_results = true + state.bg_check = false + return + } state.tableLoading = true if(state.uploadStatus||state.btShow){ @@ -1129,8 +1141,9 @@ import { message } from "ant-design-vue"; prefix:'', remarks:state.formData.remarks, evaluationName:state.formData.evaluationName, - detailIds:state.idValue, - imagePath:state.formData.imageUrl + // detailIds:state.idValue, + downloadUrls:state.downloadUrl, + imagePath:state.formData.cover }).then((res)=>{ console.log(res.data,'data') }) @@ -1195,7 +1208,7 @@ import { message } from "ant-design-vue"; formData.append("file", file); uploadImage(formData).then((res) => { if (res.status === 200) { - state.formData.imageUrl = res.data.split('Path:')[1]; + state.formData.cover = res.data.split('Path:')[1]; } }); return false; @@ -1243,10 +1256,12 @@ import { message } from "ant-design-vue"; boeRequest('/activityApi/evaluation/import post formData',formData).then((res)=>{ if(res.code === 200){ if(state.stateType == "application/pdf"){ - state.idValue = res.data.map(item=>item.id) + // state.idValue = res.data.map(item=>item.id) + state.downloadUrl = res.data.map(item=>item.downloadUrl) state.valueAll = res.data }else{ - state.idValue = res.data.evaluationDetailList.map(item=>item.id) + // state.idValue = res.data.evaluationDetailList.map(item=>item.id) + state.downloadUrl = res.data.evaluationDetailList.map(item=>item.downloadUrl) state.valueAll = res.data.evaluationDetailList state.totalNumber = res.data }