feat:投票删除编辑

This commit is contained in:
dongwug
2022-11-03 15:41:38 +08:00
parent 5cfa72c80a
commit c4ecfd2f97
5 changed files with 77 additions and 26 deletions

View File

@@ -33,11 +33,7 @@ import qs from 'qs';
* axios.post(`${this.$url}/test/testRequest`,data).then()
*
*/
// , {
// header: {
// 'token': '123',
// }
// }
// 接口-请求
@@ -48,7 +44,11 @@ export const createEvaluation = (obj) => http.post('/evaluation/createEvaluation
export const fileUp = (obj) => http.post('/file/upload', obj, qs.stringify({ obj }));
//删除测评信息
export const deleteEvaluationById = (obj) => http.post('/evaluation/deleteEvaluationById', { params: obj })
export const deleteEvaluationById = (obj) => http.post('/evaluation/deleteEvaluationById', { params: obj }, {
header: {
'token': '123',
}
})
//根据ID获取测评信息详情

View File

@@ -91,7 +91,7 @@
</div>
</a-upload>
<span style="padding-bottom: 20px; color: #878b92"
>图片格式为</span
>图片格式为JPG/PNG 图片大小不可超过1MB</span
>
</div>
</div>
@@ -179,9 +179,9 @@ export default {
const beforeUpload = (file) => {
const isJpgOrPng =
file.type === "image/jpeg" || file.type === "image/png";
file.type === "image/jpg" || file.type === "image/png";
if (!isJpgOrPng) {
message.error("You can only upload JPG file!");
message.error("You can upload JPG/PNG file!");
}
const isLt2M = file.size / 1024 / 1024 < 1;
if (!isLt2M) {
@@ -229,21 +229,21 @@ export default {
api
.createEvaluation(obj)
.then((res) => {
setTimeout(() => {
console.log("创建成功", res);
message.success("创建成功");
closeDrawer();
apitaskadd.addTask({
apitaskadd
.addTask({
courseId: 0,
duration: 0,
flag: true,
name: "",
name: obj.evaluationName,
projectId: 28,
projectTaskId: 0,
stageId: 3,
type: 10,
});
}, 1000);
},
);
})
.catch((err) => {
console.log("创建失败", err);

View File

@@ -202,21 +202,20 @@ export default {
api
.createAppraiseMessage(obj)
.then((res) => {
setTimeout(() => {
console.log("创建成功", res);
message.success("创建成功");
closeDrawer();
apitaskadd.addTask({
apitaskadd
.addTask({
courseId: 0,
duration: 0,
flag: true,
name: "",
name: obj.appraiseName,
projectId: 28,
projectTaskId: 0,
stageId: 3,
type: 11,
});
}, 1000);
})
.catch((err) => {
console.log("创建失败", err);

View File

@@ -203,21 +203,20 @@ export default {
api
.createVote(obj)
.then((res) => {
setTimeout(() => {
console.log("创建成功", res);
message.success("创建成功");
closeDrawer();
apitaskadd.addTask({
apitaskadd
.addTask({
courseId: 0,
duration: 0,
flag: true,
name: "",
name: obj.voteName,
projectId: 28,
projectTaskId: 0,
stageId: 3,
type: 12,
});
}, 1000);
})
.catch((err) => {
console.log("创建失败", err);

View File

@@ -544,6 +544,7 @@ import * as apidiscuss from "../../api/indexDiscuss";
import * as apiactivity from "../../api/indexActivity";
import * as apieval from "../../api/indexEval";
import * as apiinvist from "../../api/indexInvist";
import * as apivote from "../../api/indexVote";
const drawercolumns = [
{
title: "项目名称",
@@ -1031,7 +1032,6 @@ export default {
style="color:#4EA6FF;cursor:pointer"
onClick={() => {
showDelete();
deleteInvistText();
deleteEvalText();
}}
>
@@ -1195,8 +1195,8 @@ export default {
//删除测评测试
const deleteEvalText = () => {
let obj = {
evaluationId: state.deleteEvalID,
token: "",
evaluationId: "",
token: 123,
};
apieval
.deleteEvaluationById(obj)
@@ -1359,6 +1359,57 @@ export default {
});
};
//删除投票信息
const deleteVoteText = () => {
let obj = {
voteId: "",
};
apivote
.deleteVoteMessage(obj)
.then((res) => {
console.log("删除成功", res);
message.success("删除成功");
//重新获取列表
getTask();
})
.catch((err) => {
console.log("删除失败", err);
});
};
//编辑投票信息
const editVotePath = () => {
let obj = {
appraiseEndTime: "",
appraiseExplain: "",
appraiseFlag: "",
appraiseId: 0,
appraiseName: "",
appraiseStartTime: "",
appraiseTag: "",
createTime: "",
createUser: 0,
researchId: 0,
researchName: "",
updateTime: "",
updateUser: 0,
};
apivote
.editVote(obj)
.then((res) => {
setTimeout(() => {
console.log("修改成功", res);
message.success("修改成功");
}, 1000);
})
.catch((err) => {
console.log("修改失败", err);
// state.createLoading = false;
//重新获取列表
getTask();
});
};
const onSelectChange = (selectedRowKeys) => {
console.log("selectedRowKeys changed: ", selectedRowKeys);
state.selectedRowKeys = selectedRowKeys;
@@ -1497,12 +1548,14 @@ export default {
deleteEvalText,
deleteExternalChain,
deleteActivity,
deleteVoteText,
editActivity,
editEvalPath,
deleteInvistText,
editLiveBroadcast,
editExternal,
editInvistPath,
editVotePath,
getTableData,
};
},