feat:创建题干接口

This commit is contained in:
dongwug
2022-11-08 14:22:57 +08:00
parent 7b52d58288
commit 305cfb9830
2 changed files with 41 additions and 17 deletions

View File

@@ -176,6 +176,8 @@ export default {
basevote: "", basevote: "",
endTimes: "", endTimes: "",
startTimes: "", startTimes: "",
ascriptionId:"",
voteStemId:"",
}); });
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:addvoteVisible", false); ctx.emit("update:addvoteVisible", false);
@@ -189,8 +191,11 @@ export default {
}; };
const changeVData = (data) => { const changeVData = (data) => {
console.log('111', data); console.log('111', data);
state.creVote = data state.creVote = data.creVote
state.ascriptionId = data.ascriptionId
state.voteStemId = data.voteStemId
console.log('222',state.creVote); console.log('222',state.creVote);
console.log('333',state.ascriptionId);
} }
const delBox = () => { const delBox = () => {
state.creVote = false; state.creVote = false;

View File

@@ -167,27 +167,46 @@ export default {
// return message.info("请输入选项"); // return message.info("请输入选项");
// } // }
console.log(state.questions[0].inputV); console.log(state.questions[0].inputV);
let obj = { let obj = [
createTime: "", {
createUser: 0, ascriptionId: 0,
optionDto: [ createTime: "",
{ createUser: 0,
optionId: 0, optionDetailList: [
optionName: "", {
optionPictureAddress: "", createTime: "",
}, createUser: 0,
], optionId: 0,
stemName: "", optionName: "",
updateTime: "", optionOrderNum: "",
updateUser: 0, optionPictureAddress: "",
voteStemId: 0, stem: "",
}; updateTime: "",
updateUser: 0,
voteStemId: 0,
},
],
orderNumber: "",
updateTime: "",
updateUser: 0,
voteStemFlag: "",
voteStemId: 0,
voteStemName: "",
},
];
api api
.createOptionMessage(obj) .createOptionMessage(obj)
.then((res) => { .then((res) => {
console.log("创建成功", res); console.log("创建成功", res);
console.log('res.data.data[0].ascriptionId',res.data.data[0].ascriptionId);
console.log('res.data.data[0].voteStemId',res.data.data[0].voteStemId);
message.success("创建成功"); message.success("创建成功");
ctx.emit("getData", state.creVote); let stemData = {
creVote: state.creVote,
ascriptionId: res.data.data[0].ascriptionId,
voteStemId:res.data.data[0].voteStemId
};
ctx.emit("getData", stemData);
closeDrawer(); closeDrawer();
}) })
.catch((err) => { .catch((err) => {