mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 20:36:45 +08:00
feat:添加投票-创建投票-添加题干,添加选项;评估编辑接口对接
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import http from "./config";
|
import http from "./config";
|
||||||
// import qs from 'qs';
|
import qs from 'qs';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,15 +33,19 @@ import http from "./config";
|
|||||||
* axios.post(`${this.$url}/test/testRequest`,data).then()
|
* axios.post(`${this.$url}/test/testRequest`,data).then()
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
// , {
|
||||||
|
// header: {
|
||||||
|
// 'token': '123',
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
// 接口-请求
|
// 接口-请求
|
||||||
|
|
||||||
//创建测评
|
//创建测评
|
||||||
export const createEvaluation = (obj) => http.post('/evaluation/createEvaluation', obj,);
|
export const createEvaluation = (obj) => http.post('/evaluation/createEvaluation', obj);
|
||||||
|
|
||||||
//上传组件
|
//上传组件
|
||||||
export const fileUp = (obj) => http.post('/file/upload', 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 })
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
import http from "./config";
|
||||||
|
import qs from 'qs';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接口传参数方式(get)
|
||||||
|
* axios.get('/user', {
|
||||||
|
* params: {
|
||||||
|
* id: 12345,
|
||||||
|
* name: user
|
||||||
|
* }
|
||||||
|
* }).then(res => console.log(res))
|
||||||
|
*
|
||||||
|
* 接口传参三种方式(post/put/patch)
|
||||||
|
*
|
||||||
|
* 1.'Content-Type'= 'multipart/form-data',传参格式为 formData。
|
||||||
|
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded')
|
||||||
|
* (request的Header:'Content-Type'= 'multipart/form-data')
|
||||||
|
* var formData=new FormData();
|
||||||
|
* formData.append('user',123456);formData.append('pass',12345678);
|
||||||
|
* axios.post("/notice",formData).then()
|
||||||
|
*
|
||||||
|
* 2.'Content-Type'= 'application/x-www-form-urlencoded',传参格式为 query 形式,使用$qs.stringify。
|
||||||
|
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded')
|
||||||
|
* (request的Header:'Content-Type'= 'application/x-www-form-urlencoded')
|
||||||
|
* let data = {"code":"1234","name":"yyyy"};
|
||||||
|
* axios.post(`${this.$url}/test/testRequest`,qs.stringify({data})).then()
|
||||||
|
*
|
||||||
|
* 3.'Content-Type'= 'application/json,传参格式为 raw (JSON格式)。
|
||||||
|
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded')
|
||||||
|
* (request的Header:'Content-Type'= 'application/json;charset=UTF-8')
|
||||||
|
* let data = {"code":"1234","name":"yyyy"}
|
||||||
|
* axios.post(`${this.$url}/test/testRequest`,data).then()
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
// , {
|
||||||
|
// header: {
|
||||||
|
// 'token': '123',
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 接口-请求
|
||||||
|
|
||||||
|
//基础票数上传接口
|
||||||
|
// export const baseVoteupload = (obj) => http.post('/vote/baseVoteupload', obj)
|
||||||
|
|
||||||
|
//创建题干信息接口
|
||||||
|
export const createOptionMessage = (obj) => http.post('/vote/createOptionMessage', obj)
|
||||||
|
|
||||||
|
//投票信息创建接口
|
||||||
|
export const createVote = (obj) => http.post('/vote/createVote', obj)
|
||||||
|
|
||||||
|
//删除投票信息
|
||||||
|
export const deleteVoteMessage = (obj) => http.post('/vote/deleteVoteMessage', { params: obj })
|
||||||
|
|
||||||
|
//修改投票信息接口
|
||||||
|
export const editVote = (obj) => http.post('/vote/editVote', obj)
|
||||||
|
|
||||||
|
//根据题干ID获取题干信息
|
||||||
|
export const queryStemByStemId = (obj) => http.post('/vote/queryStemByStemId', { params: obj })
|
||||||
|
|
||||||
|
//修改题干信息接口
|
||||||
|
export const updateStemMessage = (obj) => http.post('/vote/updateStemMessage', obj);
|
||||||
|
|
||||||
|
//上传组件
|
||||||
|
export const fileUp = (obj) => http.post('/file/upload', obj, qs.stringify({ obj }));
|
||||||
|
|
||||||
|
|
||||||
|
// 测试方法
|
||||||
|
// import * as api from '../../api/index'
|
||||||
|
// api.getLearnPath({}).then(res => {
|
||||||
|
// console.log(res)
|
||||||
|
// }).catch(err => {
|
||||||
|
// console.log(err)
|
||||||
|
// })
|
||||||
|
|||||||
@@ -120,8 +120,8 @@ export default {
|
|||||||
},
|
},
|
||||||
setup(props, ctx) {
|
setup(props, ctx) {
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
inputV1: "",
|
inputV1: '',
|
||||||
inputV2: "",
|
inputV2: '',
|
||||||
time: undefined,
|
time: undefined,
|
||||||
endTimes : "",
|
endTimes : "",
|
||||||
startTimes: "",
|
startTimes: "",
|
||||||
@@ -230,7 +230,7 @@ export default {
|
|||||||
evaluationEndTime: state.endTimes,
|
evaluationEndTime: state.endTimes,
|
||||||
evaluationFlag: "",
|
evaluationFlag: "",
|
||||||
evaluationId: "",
|
evaluationId: "",
|
||||||
evaluationPictureAddress: state.picUrl,
|
evaluationPictureAddress: "",
|
||||||
evaluationStartTime: state.startTimes,
|
evaluationStartTime: state.startTimes,
|
||||||
evaluationTag: "",
|
evaluationTag: "",
|
||||||
evaluationTypeId: 0,
|
evaluationTypeId: 0,
|
||||||
|
|||||||
@@ -859,7 +859,7 @@ export default {
|
|||||||
isActive: false,
|
isActive: false,
|
||||||
deleteLiveID: null, //删除直播id
|
deleteLiveID: null, //删除直播id
|
||||||
deleteEvalID: null, //测评
|
deleteEvalID: null, //测评
|
||||||
deleteInvistID: null, //评估
|
deleteInvistID: 4, //评估
|
||||||
deleteDiscussID: null, //删除讨论id
|
deleteDiscussID: null, //删除讨论id
|
||||||
deleteActivityID: null, //删除活动id
|
deleteActivityID: null, //删除活动id
|
||||||
});
|
});
|
||||||
@@ -970,13 +970,15 @@ export default {
|
|||||||
// width: 100,
|
// width: 100,
|
||||||
align: "center",
|
align: "center",
|
||||||
scopedSlots: { customRender: "action" },
|
scopedSlots: { customRender: "action" },
|
||||||
customRender: () => {
|
customRender: (text) => {
|
||||||
return (
|
return (
|
||||||
<div class="opa">
|
<div class="opa">
|
||||||
<div class="opacation">
|
<div class="opacation">
|
||||||
<span
|
<span
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
state.editonlinevisible = true;
|
state.editonlinevisible = true;
|
||||||
|
console.log(text, "编辑text");
|
||||||
|
editInvistPath();
|
||||||
}}
|
}}
|
||||||
style="color:#4EA6FF;margin-right:25px;cursor:pointer"
|
style="color:#4EA6FF;margin-right:25px;cursor:pointer"
|
||||||
>
|
>
|
||||||
@@ -986,7 +988,6 @@ export default {
|
|||||||
style="color:#4EA6FF;cursor:pointer"
|
style="color:#4EA6FF;cursor:pointer"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
showDelete();
|
showDelete();
|
||||||
deleteEvalText();
|
|
||||||
deleteInvistText();
|
deleteInvistText();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -1010,7 +1011,7 @@ export default {
|
|||||||
.getTask(obj)
|
.getTask(obj)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
console.log(res.data.data.stageList, 22222);
|
console.log("22222", res.data.data.stageList);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
@@ -1073,7 +1074,7 @@ export default {
|
|||||||
//删除测评测试
|
//删除测评测试
|
||||||
const deleteEvalText = () => {
|
const deleteEvalText = () => {
|
||||||
let obj = {
|
let obj = {
|
||||||
evaluationId:state.deleteEvalID,
|
evaluationId: state.deleteEvalID,
|
||||||
};
|
};
|
||||||
apieval
|
apieval
|
||||||
.deleteEvaluationById(obj)
|
.deleteEvaluationById(obj)
|
||||||
@@ -1090,9 +1091,6 @@ export default {
|
|||||||
|
|
||||||
//编辑测评信息
|
//编辑测评信息
|
||||||
const editEvalPath = () => {
|
const editEvalPath = () => {
|
||||||
// if (!state.inputV1) return message.info("请输入测评名称");
|
|
||||||
// if (!state.organizationSelectName) return message.warning("请选择归属组织");
|
|
||||||
// state.createLoading = true;
|
|
||||||
let obj = {
|
let obj = {
|
||||||
createTime: "",
|
createTime: "",
|
||||||
createUser: 0,
|
createUser: 0,
|
||||||
@@ -1106,7 +1104,7 @@ export default {
|
|||||||
evaluationTypeId: 0,
|
evaluationTypeId: 0,
|
||||||
evaluationTypeName: "",
|
evaluationTypeName: "",
|
||||||
updateTime: "",
|
updateTime: "",
|
||||||
updateUser: 0
|
updateUser: 0,
|
||||||
};
|
};
|
||||||
apieval
|
apieval
|
||||||
.updateEvaluation(obj)
|
.updateEvaluation(obj)
|
||||||
@@ -1114,22 +1112,20 @@ export default {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log("修改成功", res);
|
console.log("修改成功", res);
|
||||||
message.success("修改成功");
|
message.success("修改成功");
|
||||||
// state.createLoading = false;
|
|
||||||
// state.currentPage = 1;
|
|
||||||
// router.push("/leveladd");
|
|
||||||
// getLearnPath();
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log("修改失败", err);
|
console.log("修改失败", err);
|
||||||
// state.createLoading = false;
|
// state.createLoading = false;
|
||||||
|
//重新获取列表
|
||||||
|
getTask();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
//删除评估测试
|
//删除评估测试
|
||||||
const deleteInvistText = () => {
|
const deleteInvistText = () => {
|
||||||
let obj = {
|
let obj = {
|
||||||
evaluationId:state.deleteInvistID,
|
evaluationId: state.deleteInvistID,
|
||||||
};
|
};
|
||||||
apiinvist
|
apiinvist
|
||||||
.deleteAppraise(obj)
|
.deleteAppraise(obj)
|
||||||
@@ -1143,7 +1139,40 @@ export default {
|
|||||||
console.log("删除失败", err);
|
console.log("删除失败", err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//编辑测评信息
|
||||||
|
const editInvistPath = () => {
|
||||||
|
let obj = {
|
||||||
|
appraiseEndTime: "",
|
||||||
|
appraiseExplain: "",
|
||||||
|
appraiseFlag: "",
|
||||||
|
appraiseId: 0,
|
||||||
|
appraiseName: "",
|
||||||
|
appraiseStartTime: "",
|
||||||
|
appraiseTag: "",
|
||||||
|
createTime: "",
|
||||||
|
createUser: 0,
|
||||||
|
researchId: 0,
|
||||||
|
researchName: "",
|
||||||
|
updateTime: "",
|
||||||
|
updateUser: 0,
|
||||||
|
};
|
||||||
|
apiinvist
|
||||||
|
.updateAppraiseMessage(obj)
|
||||||
|
.then((res) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
console.log("修改成功", res);
|
||||||
|
message.success("修改成功");
|
||||||
|
//重新获取列表
|
||||||
|
getTask();
|
||||||
|
}, 1000);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log("修改失败", err);
|
||||||
|
// state.createLoading = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const onSelectChange = (selectedRowKeys) => {
|
const onSelectChange = (selectedRowKeys) => {
|
||||||
console.log("selectedRowKeys changed: ", selectedRowKeys);
|
console.log("selectedRowKeys changed: ", selectedRowKeys);
|
||||||
state.selectedRowKeys = selectedRowKeys;
|
state.selectedRowKeys = selectedRowKeys;
|
||||||
@@ -1276,6 +1305,7 @@ export default {
|
|||||||
deleteActivity,
|
deleteActivity,
|
||||||
editEvalPath,
|
editEvalPath,
|
||||||
deleteInvistText,
|
deleteInvistText,
|
||||||
|
editInvistPath,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user