mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 03:16:44 +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 saveLists = (obj) => http.post(`${ACTIVITYAPI}/permission/list`,obj)
|
||||||
//删除配置管理
|
//删除配置管理
|
||||||
export const deleteId = (obj) => http.post(`${ACTIVITYAPI}/permission/delete`,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 { useRoute } from "vue-router";
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
|
import {boeRequest} from "@/api/request";
|
||||||
export default {
|
export default {
|
||||||
name: "evadown",
|
name: "evadown",
|
||||||
components: {},
|
components: {},
|
||||||
@@ -153,19 +154,31 @@ import { useStore } from "vuex";
|
|||||||
}
|
}
|
||||||
const listData = async () => {
|
const listData = async () => {
|
||||||
state.tableLoading = true
|
state.tableLoading = true
|
||||||
await getPage({
|
await boeRequest('/activityApi/evaluation/detail/getPage post',{
|
||||||
pid:route.query.id,
|
pid:route.query.id,
|
||||||
pageNo: state.params.pageNo,
|
pageNo: state.params.pageNo,
|
||||||
pageSize: state.params.pageSize,
|
pageSize: state.params.pageSize,
|
||||||
searchParam:state.searchName
|
searchParam:state.searchName
|
||||||
}).then((res) => {
|
}).then((res)=>{
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
state.tableLoading = false
|
state.tableLoading = false
|
||||||
state.tableData = res.data.records,
|
state.tableData = res.data.records,
|
||||||
console.log(state.tableData,'data')
|
|
||||||
state.total = res.data.total
|
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 = () => {
|
const searchList = () => {
|
||||||
state.params.pageNo = 1
|
state.params.pageNo = 1
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content" id="talbeList">
|
||||||
<a-table
|
<a-table
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data-source="tableData"
|
:data-source="tableData"
|
||||||
@@ -68,9 +68,6 @@
|
|||||||
<span class="download"></span>
|
<span class="download"></span>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</a-button>
|
</a-button>
|
||||||
<div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a-dropdown :getPopupContainer='triggerNode=> triggerNode.parentNode' :trigger="['click']">
|
<a-dropdown :getPopupContainer='triggerNode=> triggerNode.parentNode' :trigger="['click']">
|
||||||
<a class="ant-dropdown-link" @click.prevent>
|
<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"
|
<a-upload name="avatar" list-type="picture-card" class="avatar-uploader" :show-upload-list="false"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
:before-upload="beforeUpload">
|
: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="i_upload" v-else>
|
||||||
<div class="addimg">
|
<div class="addimg">
|
||||||
<div class="heng"></div>
|
<div class="heng"></div>
|
||||||
@@ -678,7 +675,8 @@ import {
|
|||||||
clear,
|
clear,
|
||||||
savePermission,
|
savePermission,
|
||||||
saveLists,
|
saveLists,
|
||||||
deleteId
|
deleteId,
|
||||||
|
downloadError
|
||||||
} from "@/api/evaluation";
|
} from "@/api/evaluation";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
@@ -702,6 +700,7 @@ import { message } from "ant-design-vue";
|
|||||||
powerStatus:{},
|
powerStatus:{},
|
||||||
saveListPid: '',
|
saveListPid: '',
|
||||||
idValue: null,
|
idValue: null,
|
||||||
|
downloadUrl:null,
|
||||||
valueAll: [],
|
valueAll: [],
|
||||||
uploadStatus: true,
|
uploadStatus: true,
|
||||||
uploadId: '',
|
uploadId: '',
|
||||||
@@ -734,7 +733,7 @@ import { message } from "ant-design-vue";
|
|||||||
evaluationName: '',
|
evaluationName: '',
|
||||||
validated: 0,
|
validated: 0,
|
||||||
id: '',
|
id: '',
|
||||||
imageUrl: '',
|
cover: '',
|
||||||
remarks: '',
|
remarks: '',
|
||||||
},
|
},
|
||||||
bg_check: false,
|
bg_check: false,
|
||||||
@@ -970,9 +969,10 @@ import { message } from "ant-design-vue";
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
width: "150",
|
width: 200,
|
||||||
dataIndex: "id",
|
dataIndex: "id",
|
||||||
key: "id",
|
key: "id",
|
||||||
|
fixed: 'right',
|
||||||
align: "center",
|
align: "center",
|
||||||
slots: { customRender: "action" },
|
slots: { customRender: "action" },
|
||||||
},
|
},
|
||||||
@@ -1072,12 +1072,15 @@ import { message } from "ant-design-vue";
|
|||||||
};
|
};
|
||||||
//报告上传
|
//报告上传
|
||||||
const bgupload = () => {
|
const bgupload = () => {
|
||||||
|
state.downloadUrl = null
|
||||||
state.uploadId = ''
|
state.uploadId = ''
|
||||||
state.valueAll = []
|
state.valueAll = []
|
||||||
|
state.btShow = true
|
||||||
state.bg_check = true;
|
state.bg_check = true;
|
||||||
state.formData = {}
|
state.formData = {}
|
||||||
}
|
}
|
||||||
const bgupload1 = (record) => {
|
const bgupload1 = (record) => {
|
||||||
|
state.downloadUrl = null
|
||||||
console.log(record,'record')
|
console.log(record,'record')
|
||||||
state.valueAll = []
|
state.valueAll = []
|
||||||
state.uploadDownId =record.id
|
state.uploadDownId =record.id
|
||||||
@@ -1095,6 +1098,7 @@ import { message } from "ant-design-vue";
|
|||||||
const of_exit = () => {
|
const of_exit = () => {
|
||||||
state.bg_check = false;
|
state.bg_check = false;
|
||||||
state.errorMessage = ''
|
state.errorMessage = ''
|
||||||
|
state.uploadDownId = ''
|
||||||
// state.uploadId = ''
|
// state.uploadId = ''
|
||||||
state.uploadName = ''
|
state.uploadName = ''
|
||||||
state.loadData = false
|
state.loadData = false
|
||||||
@@ -1110,14 +1114,22 @@ import { message } from "ant-design-vue";
|
|||||||
state.bg_results = false
|
state.bg_results = false
|
||||||
}
|
}
|
||||||
const failedDownload = () => {
|
const failedDownload = () => {
|
||||||
console.log('aaa')
|
const ids = state.totalNumber.failedIds.join(',')
|
||||||
window.open(`/activityApi/evaluation/download?id=${state.totalNumber.failedIds}`);
|
window.open(`/activityApi/evaluation/download-failed?ids=${ids}`)
|
||||||
|
|
||||||
}
|
}
|
||||||
const reportUpload = async () => {
|
const reportUpload = async () => {
|
||||||
if(!state.formData.evaluationName){
|
if(!state.formData.evaluationName){
|
||||||
message.error('请输入测评标题名称')
|
message.error('请输入测评标题名称')
|
||||||
return
|
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
|
state.tableLoading = true
|
||||||
|
|
||||||
if(state.uploadStatus||state.btShow){
|
if(state.uploadStatus||state.btShow){
|
||||||
@@ -1129,8 +1141,9 @@ import { message } from "ant-design-vue";
|
|||||||
prefix:'',
|
prefix:'',
|
||||||
remarks:state.formData.remarks,
|
remarks:state.formData.remarks,
|
||||||
evaluationName:state.formData.evaluationName,
|
evaluationName:state.formData.evaluationName,
|
||||||
detailIds:state.idValue,
|
// detailIds:state.idValue,
|
||||||
imagePath:state.formData.imageUrl
|
downloadUrls:state.downloadUrl,
|
||||||
|
imagePath:state.formData.cover
|
||||||
}).then((res)=>{
|
}).then((res)=>{
|
||||||
console.log(res.data,'data')
|
console.log(res.data,'data')
|
||||||
})
|
})
|
||||||
@@ -1195,7 +1208,7 @@ import { message } from "ant-design-vue";
|
|||||||
formData.append("file", file);
|
formData.append("file", file);
|
||||||
uploadImage(formData).then((res) => {
|
uploadImage(formData).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
state.formData.imageUrl = res.data.split('Path:')[1];
|
state.formData.cover = res.data.split('Path:')[1];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
@@ -1243,10 +1256,12 @@ import { message } from "ant-design-vue";
|
|||||||
boeRequest('/activityApi/evaluation/import post formData',formData).then((res)=>{
|
boeRequest('/activityApi/evaluation/import post formData',formData).then((res)=>{
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
if(state.stateType == "application/pdf"){
|
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
|
state.valueAll = res.data
|
||||||
}else{
|
}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.valueAll = res.data.evaluationDetailList
|
||||||
state.totalNumber = res.data
|
state.totalNumber = res.data
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user