mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 12:26:47 +08:00
t
This commit is contained in:
@@ -45,21 +45,31 @@ export const fileUp = (data) =>
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
});
|
||||
|
||||
//删除测评信息
|
||||
export const deleteEvaluationById = (obj) => http.post('/evaluation/deleteEvaluationById', { params: obj }, {
|
||||
header: {
|
||||
'token': '123',
|
||||
}
|
||||
})
|
||||
//上传文件
|
||||
export const baseVoteupload = (data) =>
|
||||
http.post("/vote/baseVoteupload", data, {
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
});
|
||||
|
||||
//删除测评信息
|
||||
export const deleteEvaluationById = (obj) =>
|
||||
http.post(
|
||||
"/evaluation/deleteEvaluationById",
|
||||
{ params: obj },
|
||||
{
|
||||
header: {
|
||||
token: "123",
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
//根据ID获取测评信息详情
|
||||
export const queryEvaluationDetailById = (obj) =>
|
||||
http.post("/evaluation/queryEvaluationDetailById", obj, {
|
||||
headers: {
|
||||
'token': '123',
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
}
|
||||
token: "123",
|
||||
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||
},
|
||||
});
|
||||
|
||||
//修改测评信息
|
||||
@@ -81,7 +91,7 @@ export const updateEvaluation = (obj) =>
|
||||
export const getEvalListByName = (obj) =>
|
||||
http.post("/evaluation/queryEvaluationDetailById", obj, {
|
||||
headers: {
|
||||
'token': '123',
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
}
|
||||
token: "123",
|
||||
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||
},
|
||||
});
|
||||
@@ -121,16 +121,22 @@
|
||||
<span style="margin-right: 3px">基础投票数:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-upload
|
||||
<!-- <a-upload
|
||||
@change="handleChange"
|
||||
:before-upload="beforeUpload"
|
||||
:multiple="true"
|
||||
:max-count="1"
|
||||
action="/manageApi/vote/baseVoteupload"
|
||||
v-model:file-list="fileList"
|
||||
> -->
|
||||
<a-upload
|
||||
:before-upload="beforeUpload"
|
||||
:multiple="false"
|
||||
:max-count="1"
|
||||
v-model:file-list="fileList"
|
||||
>
|
||||
<button class="xkbtn">点击上传</button></a-upload
|
||||
>
|
||||
<button class="xkbtn">点击上传</button>
|
||||
</a-upload>
|
||||
<div v-if="voteCount > 0">
|
||||
<a-tag color="processing">
|
||||
<span style="font-size: 14px; line-height: 33px">
|
||||
@@ -178,6 +184,7 @@ import { RouterEditTask } from "@/api/indexTask";
|
||||
import dayjs from "dayjs";
|
||||
import * as apiTask from "../../api/indexTaskadd";
|
||||
import { addTempTask } from "../../api/indexTaskadd";
|
||||
import { baseVoteupload } from "../../api/indexEval";
|
||||
|
||||
export default {
|
||||
name: "AddVote",
|
||||
@@ -278,13 +285,9 @@ export default {
|
||||
};
|
||||
|
||||
// 限制文件格式上传
|
||||
const beforeUpload = (obj) => {
|
||||
console.log(obj);
|
||||
};
|
||||
|
||||
const handleChange = (info) => {
|
||||
console.log(info.file.type, info.file.type.indexOf("sheet"));
|
||||
if (info.file.type.indexOf("sheet") == -1) {
|
||||
const beforeUpload = (file) => {
|
||||
console.log(file);
|
||||
if (file.type.indexOf("sheet") == -1) {
|
||||
message.destroy();
|
||||
message.error("请上传正确的文件格式");
|
||||
|
||||
@@ -294,18 +297,25 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
let resFileList = [...info.fileList];
|
||||
// let resFileList = [...info.fileList];
|
||||
|
||||
resFileList.map((file) => {
|
||||
if (file.response) {
|
||||
// Component will show file.url as link
|
||||
file.url = file.response.url;
|
||||
console.log("file========", file);
|
||||
console.log("file========", file.response);
|
||||
state.voteCount = file.response.data;
|
||||
// resFileList.map((file) => {
|
||||
// if (file.response) {
|
||||
// // Component will show file.url as link
|
||||
// file.url = file.response.url;
|
||||
// console.log("file========", file);
|
||||
// console.log("file========", file.response);
|
||||
// state.voteCount = file.response.data;
|
||||
// }
|
||||
// });
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("uploadFile", file);
|
||||
baseVoteupload(formData).then((res) => {
|
||||
if (res.data.code === 200) {
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
//fileList.value = resFileList;
|
||||
};
|
||||
|
||||
//删除题干信息接口
|
||||
@@ -470,7 +480,6 @@ export default {
|
||||
updateVoteInfo,
|
||||
queryStem,
|
||||
closeStem,
|
||||
handleChange,
|
||||
beforeUpload,
|
||||
handlelog,
|
||||
};
|
||||
|
||||
@@ -3101,7 +3101,8 @@ const columns1 = [
|
||||
customRender: ({ text }) => {
|
||||
return text ? text : "-";
|
||||
},
|
||||
},{
|
||||
},
|
||||
{
|
||||
title: " 所属路径",
|
||||
width: 250,
|
||||
dataIndex: "routerName",
|
||||
|
||||
Reference in New Issue
Block a user