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() * 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 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获取测评信息详情 //根据ID获取测评信息详情

View File

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

View File

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

View File

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

View File

@@ -544,6 +544,7 @@ import * as apidiscuss from "../../api/indexDiscuss";
import * as apiactivity from "../../api/indexActivity"; import * as apiactivity from "../../api/indexActivity";
import * as apieval from "../../api/indexEval"; import * as apieval from "../../api/indexEval";
import * as apiinvist from "../../api/indexInvist"; import * as apiinvist from "../../api/indexInvist";
import * as apivote from "../../api/indexVote";
const drawercolumns = [ const drawercolumns = [
{ {
title: "项目名称", title: "项目名称",
@@ -1031,7 +1032,6 @@ export default {
style="color:#4EA6FF;cursor:pointer" style="color:#4EA6FF;cursor:pointer"
onClick={() => { onClick={() => {
showDelete(); showDelete();
deleteInvistText();
deleteEvalText(); deleteEvalText();
}} }}
> >
@@ -1195,8 +1195,8 @@ export default {
//删除测评测试 //删除测评测试
const deleteEvalText = () => { const deleteEvalText = () => {
let obj = { let obj = {
evaluationId: state.deleteEvalID, evaluationId: "",
token: "", token: 123,
}; };
apieval apieval
.deleteEvaluationById(obj) .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) => { const onSelectChange = (selectedRowKeys) => {
console.log("selectedRowKeys changed: ", selectedRowKeys); console.log("selectedRowKeys changed: ", selectedRowKeys);
state.selectedRowKeys = selectedRowKeys; state.selectedRowKeys = selectedRowKeys;
@@ -1497,12 +1548,14 @@ export default {
deleteEvalText, deleteEvalText,
deleteExternalChain, deleteExternalChain,
deleteActivity, deleteActivity,
deleteVoteText,
editActivity, editActivity,
editEvalPath, editEvalPath,
deleteInvistText, deleteInvistText,
editLiveBroadcast, editLiveBroadcast,
editExternal, editExternal,
editInvistPath, editInvistPath,
editVotePath,
getTableData, getTableData,
}; };
}, },