mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-08 18:36:46 +08:00
测评上传
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="content" id="talbeList">
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="tableData"
|
||||
@@ -68,9 +68,6 @@
|
||||
<span class="download"></span>
|
||||
</a-tooltip>
|
||||
</a-button>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
<a-dropdown :getPopupContainer='triggerNode=> triggerNode.parentNode' :trigger="['click']">
|
||||
<a class="ant-dropdown-link" @click.prevent>
|
||||
更多
|
||||
@@ -165,7 +162,7 @@
|
||||
<a-upload name="avatar" list-type="picture-card" class="avatar-uploader" :show-upload-list="false"
|
||||
:headers="headers"
|
||||
:before-upload="beforeUpload">
|
||||
<img class="i_upload_img" v-if="formData.imageUrl" :src="formData.imageUrl" alt="avatar" />
|
||||
<img class="i_upload_img" v-if="formData.cover" :src="formData.cover" alt="avatar" />
|
||||
<div class="i_upload" v-else>
|
||||
<div class="addimg">
|
||||
<div class="heng"></div>
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user