mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 12:26:47 +08:00
feat:删除投票信息接口 获取题干信息接口
This commit is contained in:
@@ -48,16 +48,34 @@
|
||||
</div>
|
||||
<span>创建投票:</span>
|
||||
</div>
|
||||
<div class="btnbox" >
|
||||
<button class="xkbtn" :style="{ display: creVote ? 'none' : 'block'}" @click="showDrawerCreVote">创建投票</button>
|
||||
<button class="xkbtn" :style="{ display: creVote ? 'block' : 'none'}" @click="showDrawerCreVote">编辑投票</button>
|
||||
<div :style="{ display: creVote ? 'block' : 'none'}" ><div class="fileTigan" ><span style="color:#388be1 ;">传过来的name</span> <div class="delBox" @click="delBox()"></div></div></div>
|
||||
|
||||
<div class="btnbox">
|
||||
<button
|
||||
class="xkbtn"
|
||||
:style="{ display: creVote ? 'none' : 'block' }"
|
||||
@click="showDrawerCreVote"
|
||||
>
|
||||
创建投票
|
||||
</button>
|
||||
<button
|
||||
class="xkbtn"
|
||||
:style="{ display: creVote ? 'block' : 'none' }"
|
||||
@click="showDrawerCreVote"
|
||||
>
|
||||
编辑投票
|
||||
</button>
|
||||
<div :style="{ display: creVote ? 'block' : 'none' }">
|
||||
<div class="fileTigan">
|
||||
<span style="color: #388be1">传过来的name</span>
|
||||
<div class="delBox" @click="delBox()"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 创建投票侧弹窗 -->
|
||||
<div>
|
||||
<cre-vote v-model:crevoteVisible="crevotevisible"
|
||||
@getData="changeVData"/>
|
||||
<cre-vote
|
||||
v-model:crevoteVisible="crevotevisible"
|
||||
@getData="changeVData"
|
||||
/>
|
||||
</div>
|
||||
<!-- 创建投票侧弹窗 -->
|
||||
</div>
|
||||
@@ -170,14 +188,15 @@ export default {
|
||||
const state = reactive({
|
||||
inputV1: "",
|
||||
textV1: "",
|
||||
creVote:false,
|
||||
creVote: false,
|
||||
crevotevisible: false,
|
||||
time: undefined,
|
||||
basevote: "",
|
||||
endTimes: "",
|
||||
startTimes: "",
|
||||
ascriptionId:"",
|
||||
voteStemId:"",
|
||||
ascriptionId: "",
|
||||
voteStemId: "",
|
||||
voteId:"",
|
||||
});
|
||||
const closeDrawer = () => {
|
||||
ctx.emit("update:addvoteVisible", false);
|
||||
@@ -190,15 +209,45 @@ export default {
|
||||
state.crevotevisible = true;
|
||||
};
|
||||
const changeVData = (data) => {
|
||||
console.log('111', data);
|
||||
state.creVote = data.creVote
|
||||
state.ascriptionId = data.ascriptionId
|
||||
state.voteStemId = data.voteStemId
|
||||
console.log('222',state.creVote);
|
||||
console.log('333',state.ascriptionId);
|
||||
}
|
||||
console.log("111", data);
|
||||
state.creVote = data.creVote;
|
||||
state.ascriptionId = data.ascriptionId;
|
||||
state.voteStemId = data.voteStemId;
|
||||
console.log("222", state.creVote);
|
||||
console.log("333", state.ascriptionId);
|
||||
};
|
||||
const delBox = () => {
|
||||
state.creVote = false;
|
||||
dleVoteStem()
|
||||
};
|
||||
|
||||
//获取题干信息
|
||||
// const getStemText = () => {
|
||||
// let objstem = {
|
||||
// stemId: state.ascriptionId,
|
||||
// ascriptionId: state.voteStemId,
|
||||
// }
|
||||
// api
|
||||
// .queryStemByStemId(objstem)
|
||||
// .then((res) => {
|
||||
// console.log("获取成功", res);
|
||||
// message.success("获取成功");
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.log(err);
|
||||
// });
|
||||
// }
|
||||
|
||||
//删除题干信息接口
|
||||
const dleVoteStem = () => {
|
||||
let objdelstem = {
|
||||
voteStemId:state.voteStemId
|
||||
}
|
||||
api.deleteVoteStem(objdelstem)
|
||||
.then((res) => {
|
||||
console.log('删除题干信息成功', res)
|
||||
message.success('删除题干信息成功')
|
||||
})
|
||||
}
|
||||
//创建投票信息
|
||||
const createVoteText = () => {
|
||||
@@ -227,17 +276,13 @@ export default {
|
||||
// };
|
||||
|
||||
let obj = {
|
||||
ascriptionId: state.ascriptionId,
|
||||
baseVote: state.basevote,
|
||||
createTime: "",
|
||||
createUser: 0,
|
||||
stem: "",
|
||||
stemId: 0,
|
||||
updateTime: "",
|
||||
updateUser: 0,
|
||||
voteEndTime: state.endTimes,
|
||||
voteExplain: state.textV1,
|
||||
voteFlag: "",
|
||||
voteId: 0,
|
||||
voteName: state.inputV1,
|
||||
voteStartTime: state.startTimes,
|
||||
voteTag: "",
|
||||
@@ -245,22 +290,23 @@ export default {
|
||||
api
|
||||
.createVote(obj)
|
||||
.then((res) => {
|
||||
console.log("创建成功", res);
|
||||
console.log("创建成功123", res);
|
||||
message.success("创建成功");
|
||||
ctx.emit("getData", res.data.data.voteId);
|
||||
closeDrawer();
|
||||
if (props.learn == 0)
|
||||
apitaskadd
|
||||
.addTask({
|
||||
courseId: 0,
|
||||
duration: 0,
|
||||
flag: true,
|
||||
name: obj.voteName,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 12,
|
||||
})
|
||||
.then((res) => {
|
||||
apitaskadd
|
||||
.addTask({
|
||||
courseId: 0,
|
||||
duration: 0,
|
||||
flag: true,
|
||||
name: obj.voteName,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 12,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后", res.data);
|
||||
//自定义事件给父组件传值
|
||||
ctx.emit("changeData", false);
|
||||
@@ -271,7 +317,7 @@ export default {
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
else {
|
||||
else {
|
||||
let editObj1 = {
|
||||
chapterId: 36,
|
||||
courseId: 0,
|
||||
@@ -282,7 +328,7 @@ export default {
|
||||
routerTaskId: 0,
|
||||
type: 12,
|
||||
};
|
||||
RouterEditTask(editObj1)
|
||||
RouterEditTask(editObj1);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
@@ -297,6 +343,7 @@ export default {
|
||||
changeVData,
|
||||
rowSelection,
|
||||
options1,
|
||||
dleVoteStem,
|
||||
createVoteText,
|
||||
delBox,
|
||||
};
|
||||
@@ -359,15 +406,15 @@ export default {
|
||||
color: #fff;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.fileTigan{
|
||||
.fileTigan {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 3px 5px;
|
||||
background-color: rgba(42, 103, 209, 0.4);
|
||||
span{
|
||||
span {
|
||||
margin-right: 5px;
|
||||
}
|
||||
.delBox{
|
||||
.delBox {
|
||||
width: 13px;
|
||||
height: 13px;
|
||||
background-image: url(@/assets/images/basicinfo/ch.png);
|
||||
|
||||
Reference in New Issue
Block a user