mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-06 17:36:44 +08:00
测评上传报告逻辑修改
This commit is contained in:
2
.env
2
.env
@@ -4,6 +4,8 @@ VUE_APP_BASE=/manage
|
|||||||
VUE_APP_BASE_API=/manageApi
|
VUE_APP_BASE_API=/manageApi
|
||||||
# systemApi
|
# systemApi
|
||||||
VUE_APP_SYS_API=/systemapi
|
VUE_APP_SYS_API=/systemapi
|
||||||
|
# activityApi
|
||||||
|
VUE_APP_ACT_API=/activityApi
|
||||||
# 教师节上传图片文件夹id
|
# 教师节上传图片文件夹id
|
||||||
VUE_APP_PIC_FOLDERID=1147577187794841600
|
VUE_APP_PIC_FOLDERID=1147577187794841600
|
||||||
# 教师节上传zip文件夹id
|
# 教师节上传zip文件夹id
|
||||||
|
|||||||
@@ -3,35 +3,35 @@ import http from "./configPublic";
|
|||||||
const ACTIVITYAPI = '/activityApi'
|
const ACTIVITYAPI = '/activityApi'
|
||||||
import {getCookieForName} from "@/api/method";
|
import {getCookieForName} from "@/api/method";
|
||||||
//查询测评
|
//查询测评
|
||||||
export const list = (obj) => http.post(`${ACTIVITYAPI}/evaluation/list`,obj)
|
export const list = (obj) => http.post(`${process.env.VUE_APP_ACT_API}/evaluation/list`,obj)
|
||||||
//导入
|
//导入
|
||||||
export const importList = (obj) => http.post(`${ACTIVITYAPI}/evaluation/import`,obj, {
|
export const importList = (obj) => http.post(`${process.env.VUE_APP_ACT_API}/evaluation/import`,obj, {
|
||||||
headers: { "Content-Type": "multipart/form-data",token:getCookieForName("token") },
|
headers: { "Content-Type": "multipart/form-data",token:getCookieForName("token") },
|
||||||
})
|
})
|
||||||
//保存
|
//保存
|
||||||
export const save = (obj) => http.post(`${ACTIVITYAPI}/evaluation/save`,obj)
|
export const save = (obj) => http.post(`${process.env.VUE_APP_ACT_API}/evaluation/save`,obj)
|
||||||
//保存测评详情
|
//保存测评详情
|
||||||
export const saveEvaluationDetail = (obj) => http.post(`${ACTIVITYAPI}/evaluation/detail/saveEvaluationDetail`,obj)
|
export const saveEvaluationDetail = (obj) => http.post(`${process.env.VUE_APP_ACT_API}/evaluation/detail/saveEvaluationDetail`,obj)
|
||||||
//测评封面上传
|
//测评封面上传
|
||||||
export const uploadImage = (obj) => http.post(`${ACTIVITYAPI}/evaluation/upload-image`,obj,{
|
export const uploadImage = (obj) => http.post(`${process.env.VUE_APP_ACT_API}/evaluation/upload-image`,obj,{
|
||||||
headers: { "Content-Type": "multipart/form-data",token:getCookieForName("token") },
|
headers: { "Content-Type": "multipart/form-data",token:getCookieForName("token") },
|
||||||
})
|
})
|
||||||
//权限管理
|
//权限管理
|
||||||
export const adminList = (obj) => http.post(`${ACTIVITYAPI}/permission/adminList`,obj)
|
export const adminList = (obj) => http.post(`${process.env.VUE_APP_ACT_API}/permission/adminList`,obj)
|
||||||
//权限启用
|
//权限启用
|
||||||
export const updateStatus = (obj) => http.post(`${ACTIVITYAPI}/permission/updateStatus`,obj)
|
export const updateStatus = (obj) => http.post(`${process.env.VUE_APP_ACT_API}/permission/updateStatus`,obj)
|
||||||
//测评删除
|
//测评删除
|
||||||
export const deleteList = (obj) => http.post(`${ACTIVITYAPI}/evaluation/delete`,obj)
|
export const deleteList = (obj) => http.post(`${process.env.VUE_APP_ACT_API}/evaluation/delete`,obj)
|
||||||
//测评详情展示
|
//测评详情展示
|
||||||
export const getPage = (obj) => http.post(`${ACTIVITYAPI}/evaluation/detail/getPage`,obj)
|
export const getPage = (obj) => http.post(`${process.env.VUE_APP_ACT_API}/evaluation/detail/getPage`,obj)
|
||||||
//测评详情删除
|
//测评详情删除
|
||||||
export const deleteById = (obj) => http.post(`${ACTIVITYAPI}/evaluation/detail/deleteById`,obj)
|
export const deleteById = (obj) => http.post(`${process.env.VUE_APP_ACT_API}/evaluation/detail/deleteById`,obj)
|
||||||
//测评清空
|
//测评清空
|
||||||
export const clear = (obj) => http.post(`${ACTIVITYAPI}/evaluation/clear`,obj)
|
export const clear = (obj) => http.post(`${process.env.VUE_APP_ACT_API}/evaluation/clear`,obj)
|
||||||
//保存启用的人员信息
|
//保存启用的人员信息
|
||||||
export const savePermission = (obj) => http.post(`${ACTIVITYAPI}/permission/savePermission`,obj)
|
export const savePermission = (obj) => http.post(`${process.env.VUE_APP_ACT_API}/permission/savePermission`,obj)
|
||||||
//权限列表
|
//权限列表
|
||||||
export const saveLists = (obj) => http.post(`${ACTIVITYAPI}/permission/list`,obj)
|
export const saveLists = (obj) => http.post(`${process.env.VUE_APP_ACT_API}/permission/list`,obj)
|
||||||
//删除配置管理
|
//删除配置管理
|
||||||
export const deleteId = (obj) => http.post(`${ACTIVITYAPI}/permission/delete`,obj)
|
export const deleteId = (obj) => http.post(`${process.env.VUE_APP_ACT_API}/permission/delete`,obj)
|
||||||
|
|
||||||
|
|||||||
@@ -204,7 +204,7 @@
|
|||||||
:show-upload-list="false"
|
:show-upload-list="false"
|
||||||
:before-upload="beforeUpload3"
|
:before-upload="beforeUpload3"
|
||||||
@change="handleChange"
|
@change="handleChange"
|
||||||
action="/activityApi/evaluation/import"
|
:action="activeUrl"
|
||||||
:data="uploadParameters"
|
:data="uploadParameters"
|
||||||
ref="uploadRef"
|
ref="uploadRef"
|
||||||
>
|
>
|
||||||
@@ -703,7 +703,9 @@ import {timeoutUpload} from "@/api/configPublic";
|
|||||||
const userInfo = computed(() => store.state.userInfo);
|
const userInfo = computed(() => store.state.userInfo);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
activeUrl: process.env.VUE_APP_ACT_API + '/evaluation/import',
|
||||||
uploadTypes: true,
|
uploadTypes: true,
|
||||||
|
uploadStatusType: true,
|
||||||
saveNotUpload: true,
|
saveNotUpload: true,
|
||||||
stateUpload: true,
|
stateUpload: true,
|
||||||
uploadParameters: {},
|
uploadParameters: {},
|
||||||
@@ -804,6 +806,7 @@ import {timeoutUpload} from "@/api/configPublic";
|
|||||||
serchList()
|
serchList()
|
||||||
}
|
}
|
||||||
const listData = async () => {
|
const listData = async () => {
|
||||||
|
state.tableLoading = true
|
||||||
await list({
|
await list({
|
||||||
evaluationName: state.serchName,
|
evaluationName: state.serchName,
|
||||||
pageNo: state.searchParam.pageNo,
|
pageNo: state.searchParam.pageNo,
|
||||||
@@ -1139,9 +1142,10 @@ import {timeoutUpload} from "@/api/configPublic";
|
|||||||
message.info('请先上传报告')
|
message.info('请先上传报告')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
window.open(`/activityApi/evaluation/download?id=${record.id}`);
|
window.open(`${process.env.VUE_APP_ACT_API}/evaluation/download?id=${record.id}`);
|
||||||
}
|
}
|
||||||
const of_exit = () => {
|
const of_exit = () => {
|
||||||
|
// state.tableLoading = false
|
||||||
state.uploadTypes = false
|
state.uploadTypes = false
|
||||||
state.uploadDownLoad = false
|
state.uploadDownLoad = false
|
||||||
state.bg_check = false;
|
state.bg_check = false;
|
||||||
@@ -1158,6 +1162,7 @@ import {timeoutUpload} from "@/api/configPublic";
|
|||||||
// 上传结果
|
// 上传结果
|
||||||
const of_results = () => {
|
const of_results = () => {
|
||||||
if(state.totalNumber.failedEntries!=0){
|
if(state.totalNumber.failedEntries!=0){
|
||||||
|
message.warning('上传文件含有错误信息,已自动删除,请上传正确文件')
|
||||||
delUploadList()
|
delUploadList()
|
||||||
}
|
}
|
||||||
state.totalNumber = {}
|
state.totalNumber = {}
|
||||||
@@ -1174,10 +1179,11 @@ import {timeoutUpload} from "@/api/configPublic";
|
|||||||
const failedId = state.totalNumber.failedId==null?'':state.totalNumber.failedId
|
const failedId = state.totalNumber.failedId==null?'':state.totalNumber.failedId
|
||||||
const middle = state.totalNumber.successId==null?'':','
|
const middle = state.totalNumber.successId==null?'':','
|
||||||
const ids = successId+middle+failedId
|
const ids = successId+middle+failedId
|
||||||
window.open(`/activityApi/evaluation/download-failed?ids=${ids}`)
|
window.open(`${process.env.VUE_APP_ACT_API}/evaluation/download-failed?ids=${ids}`)
|
||||||
|
|
||||||
}
|
}
|
||||||
const reportUpload = async () => {
|
const reportUpload = async () => {
|
||||||
|
state.uploadStatusType = true
|
||||||
if(!state.formData.evaluationName){
|
if(!state.formData.evaluationName){
|
||||||
message.error('请输入测评标题名称')
|
message.error('请输入测评标题名称')
|
||||||
return
|
return
|
||||||
@@ -1186,14 +1192,14 @@ import {timeoutUpload} from "@/api/configPublic";
|
|||||||
message.error('上传报告含有错误报告,请检查后重新上传')
|
message.error('上传报告含有错误报告,请检查后重新上传')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
state.tableLoading = true
|
// state.tableLoading = true
|
||||||
state.uploadDownLoad = true
|
state.uploadDownLoad = true
|
||||||
if( !state.loadData&&state.loadNewDown){
|
if( !state.loadData&&state.loadNewDown){
|
||||||
// 保存上传文件
|
// 保存上传文件
|
||||||
if(state.sussessIds == null){
|
if(state.sussessIds == null){
|
||||||
state.sussessIds = []
|
state.sussessIds = []
|
||||||
}
|
}
|
||||||
await boeRequest('/activityApi/evaluation/detail/saveEvaluationDetail post',{
|
await boeRequest(`${process.env.VUE_APP_ACT_API}/evaluation/detail/saveEvaluationDetail post`,{
|
||||||
id:state.uploadId,
|
id:state.uploadId,
|
||||||
successIds:state.sussessIds.length!=0?state.sussessIds.split(','):null
|
successIds:state.sussessIds.length!=0?state.sussessIds.split(','):null
|
||||||
}).then((res)=>{
|
}).then((res)=>{
|
||||||
@@ -1207,7 +1213,7 @@ import {timeoutUpload} from "@/api/configPublic";
|
|||||||
if(state.sussessIds == null){
|
if(state.sussessIds == null){
|
||||||
state.sussessIds = []
|
state.sussessIds = []
|
||||||
}
|
}
|
||||||
await boeRequest('/activityApi/evaluation/save post',{
|
await boeRequest(`${process.env.VUE_APP_ACT_API}/evaluation/save post`,{
|
||||||
id: state.uploadDownId,
|
id: state.uploadDownId,
|
||||||
createId:userInfo.value.userId,
|
createId:userInfo.value.userId,
|
||||||
createName:userInfo.value.realName,
|
createName:userInfo.value.realName,
|
||||||
@@ -1218,14 +1224,21 @@ import {timeoutUpload} from "@/api/configPublic";
|
|||||||
imagePath:state.formData.cover,
|
imagePath:state.formData.cover,
|
||||||
successIds:state.saveNotUpload?state.sussessIds.length!=0?state.sussessIds.split(','):null:null
|
successIds:state.saveNotUpload?state.sussessIds.length!=0?state.sussessIds.split(','):null:null
|
||||||
}).then((res)=>{
|
}).then((res)=>{
|
||||||
|
if(res.status == 500){
|
||||||
|
message.error('测评标题和报告名称不一致')
|
||||||
|
state.uploadDownLoad = false
|
||||||
|
state.uploadStatusType = false
|
||||||
|
}
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
state.uploadDownLoad = false
|
state.uploadDownLoad = false
|
||||||
state.bg_check = false
|
state.bg_check = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
of_exit()
|
if(state.uploadStatusType){
|
||||||
listData()
|
of_exit()
|
||||||
|
listData()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const showUpload = () => {
|
const showUpload = () => {
|
||||||
reportUpload()
|
reportUpload()
|
||||||
@@ -1257,14 +1270,10 @@ import {timeoutUpload} from "@/api/configPublic";
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
const beforeUpload3 = async (file) => {
|
const beforeUpload3 = async (file) => {
|
||||||
state.uploadTypes = true
|
if(!state.formData.evaluationName){
|
||||||
if(file.type === "application/pdf"){
|
message.error('请先填写测评名称')
|
||||||
const pattern = /^([0-9\u4e00-\u9fa5\a-z\A-Z]+-){2}[0-9\u4e00-\u9fa5\a-z\A-Z]+\.\w*$/;
|
state.uploadTypes = false
|
||||||
if (!pattern.test(file.name)) {
|
return false
|
||||||
message.error('上传文件名称格式不对')
|
|
||||||
state.stateUpload = false
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
const isJpgOrPng =
|
const isJpgOrPng =
|
||||||
file.type === "application/x-zip-compressed" ||
|
file.type === "application/x-zip-compressed" ||
|
||||||
@@ -1275,6 +1284,20 @@ import {timeoutUpload} from "@/api/configPublic";
|
|||||||
state.stateUpload = false
|
state.stateUpload = false
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
state.uploadTypes = true
|
||||||
|
if(file.type === "application/pdf"){
|
||||||
|
const pattern = /^([0-9\u4e00-\u9fa5\a-z\A-Z]+-){2}[0-9\u4e00-\u9fa5\a-z\A-Z]+\.\w*$/;
|
||||||
|
if (!pattern.test(file.name)) {
|
||||||
|
message.error('上传文件名称格式不对')
|
||||||
|
state.stateUpload = false
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if(state.formData.evaluationName!=file.name.split('-')[0]){
|
||||||
|
message.error('上传文件名称与测评名称不匹配')
|
||||||
|
state.stateUpload = false
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
let isLt1M = file.size < 1024000000;
|
let isLt1M = file.size < 1024000000;
|
||||||
if (!isLt1M) {
|
if (!isLt1M) {
|
||||||
message.error("文件大小超过1GB!");
|
message.error("文件大小超过1GB!");
|
||||||
@@ -1286,7 +1309,8 @@ import {timeoutUpload} from "@/api/configPublic";
|
|||||||
// file: file,
|
// file: file,
|
||||||
uploadName: userInfo.value.realName,
|
uploadName: userInfo.value.realName,
|
||||||
createId: userInfo.value.userId,
|
createId: userInfo.value.userId,
|
||||||
createName: userInfo.value.realName
|
createName: userInfo.value.realName,
|
||||||
|
newEvaluationName: state.formData.evaluationName
|
||||||
}
|
}
|
||||||
if(state.uploadId){
|
if(state.uploadId){
|
||||||
formData.pid= state.uploadId
|
formData.pid= state.uploadId
|
||||||
@@ -1396,7 +1420,7 @@ import {timeoutUpload} from "@/api/configPublic";
|
|||||||
//权限列表
|
//权限列表
|
||||||
const saveListItem = async () => {
|
const saveListItem = async () => {
|
||||||
state.tableLoadingAut = true
|
state.tableLoadingAut = true
|
||||||
await boeRequest('/activityApi/permission/list post',{
|
await boeRequest(`${process.env.VUE_APP_ACT_API}/permission/list post`,{
|
||||||
pid:state.saveListPid,
|
pid:state.saveListPid,
|
||||||
nameOrWorkNum:state.searchParam.createNames,
|
nameOrWorkNum:state.searchParam.createNames,
|
||||||
status:state.searchParam.status2,
|
status:state.searchParam.status2,
|
||||||
@@ -1443,7 +1467,7 @@ import {timeoutUpload} from "@/api/configPublic";
|
|||||||
//搜索权限
|
//搜索权限
|
||||||
const searchSave = async () => {
|
const searchSave = async () => {
|
||||||
state.tableLoadingAdd = true
|
state.tableLoadingAdd = true
|
||||||
await boeRequest('/activityApi/permission/adminList post',{
|
await boeRequest(`${process.env.VUE_APP_ACT_API}/permission/adminList post`,{
|
||||||
keyword:state.searchParam.createName,
|
keyword:state.searchParam.createName,
|
||||||
pageNo: state.paramsAdd.pageNo,
|
pageNo: state.paramsAdd.pageNo,
|
||||||
pageSize: state.paramsAdd.pageSize,
|
pageSize: state.paramsAdd.pageSize,
|
||||||
|
|||||||
Reference in New Issue
Block a user