mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-09 10:56:46 +08:00
feat:投票题干删除和选项删除\创建删除题干接口对接
This commit is contained in:
@@ -66,7 +66,7 @@
|
|||||||
<div :style="{ display: creVote ? 'block' : 'none' }">
|
<div :style="{ display: creVote ? 'block' : 'none' }">
|
||||||
<div class="fileTigan">
|
<div class="fileTigan">
|
||||||
<span style="color: #388be1">{{voteStemName}}</span>
|
<span style="color: #388be1">{{voteStemName}}</span>
|
||||||
<div class="delBox" @click="delBox()"></div>
|
<div class="delBox" @click="dleVoteStem()"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -74,7 +74,8 @@
|
|||||||
<div>
|
<div>
|
||||||
<cre-vote
|
<cre-vote
|
||||||
v-model:crevoteVisible="crevotevisible"
|
v-model:crevoteVisible="crevotevisible"
|
||||||
@getData="changeVData"
|
@getData="getStemId"
|
||||||
|
v-model:voteStemId="voteStemId"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- 创建投票侧弹窗 -->
|
<!-- 创建投票侧弹窗 -->
|
||||||
@@ -195,7 +196,7 @@ export default {
|
|||||||
endTimes: "",
|
endTimes: "",
|
||||||
startTimes: "",
|
startTimes: "",
|
||||||
ascriptionId: "",
|
ascriptionId: "",
|
||||||
voteStemId: "",
|
voteStemId: null,
|
||||||
voteId:"",
|
voteId:"",
|
||||||
voteStemName:"",
|
voteStemName:"",
|
||||||
});
|
});
|
||||||
@@ -209,6 +210,14 @@ export default {
|
|||||||
const showDrawerCreVote = () => {
|
const showDrawerCreVote = () => {
|
||||||
state.crevotevisible = true;
|
state.crevotevisible = true;
|
||||||
};
|
};
|
||||||
|
const getStemId = (data) => {
|
||||||
|
state.voteStemName = data.voteStemName;
|
||||||
|
state.voteStemId = Number(data.voteStemId);
|
||||||
|
state.creVote = data.creVote;
|
||||||
|
console.log('state.voteStemId', state.voteStemId);
|
||||||
|
console.log('state.voteStemId', state.creVote);
|
||||||
|
}
|
||||||
|
//暂时没用 之前给子用传参来着
|
||||||
const changeVData = (data) => {
|
const changeVData = (data) => {
|
||||||
console.log("111", data);
|
console.log("111", data);
|
||||||
state.creVote = data.creVote;
|
state.creVote = data.creVote;
|
||||||
@@ -220,25 +229,11 @@ export default {
|
|||||||
};
|
};
|
||||||
const delBox = () => {
|
const delBox = () => {
|
||||||
state.creVote = false;
|
state.creVote = false;
|
||||||
dleVoteStem()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//获取题干信息
|
const updateTableData = (data) => {
|
||||||
// const getStemText = () => {
|
console.log(data, 'data');
|
||||||
// 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 = () => {
|
const dleVoteStem = () => {
|
||||||
@@ -249,6 +244,7 @@ export default {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log('删除题干信息成功', res)
|
console.log('删除题干信息成功', res)
|
||||||
message.success('删除题干信息成功')
|
message.success('删除题干信息成功')
|
||||||
|
delBox()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//创建投票信息
|
//创建投票信息
|
||||||
@@ -273,9 +269,6 @@ export default {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (state.crevotevisible = false) {
|
|
||||||
// changeVData()
|
|
||||||
// };
|
|
||||||
|
|
||||||
let obj = {
|
let obj = {
|
||||||
ascriptionId: state.ascriptionId,
|
ascriptionId: state.ascriptionId,
|
||||||
@@ -342,12 +335,14 @@ export default {
|
|||||||
showDrawerCreVote,
|
showDrawerCreVote,
|
||||||
afterVisibleChange,
|
afterVisibleChange,
|
||||||
closeDrawer,
|
closeDrawer,
|
||||||
|
getStemId,
|
||||||
changeVData,
|
changeVData,
|
||||||
rowSelection,
|
rowSelection,
|
||||||
options1,
|
options1,
|
||||||
dleVoteStem,
|
dleVoteStem,
|
||||||
createVoteText,
|
createVoteText,
|
||||||
delBox,
|
delBox,
|
||||||
|
updateTableData,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -111,7 +111,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</a-drawer>
|
</a-drawer>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { reactive, toRefs } from "vue";
|
import { reactive, toRefs } from "vue";
|
||||||
import * as api from "../../api/indexVote";
|
import * as api from "../../api/indexVote";
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
@@ -186,46 +186,69 @@ export default {
|
|||||||
|
|
||||||
//创建题干接口
|
//创建题干接口
|
||||||
const createQueTit = () => {
|
const createQueTit = () => {
|
||||||
if (state.inputV1 == "") {
|
if (!state.inputV1) {
|
||||||
message.destroy();
|
message.destroy();
|
||||||
return message.info("请输入投票名称");
|
return message.info("请输入投票名称");
|
||||||
}
|
}
|
||||||
// if (!state.questions.inputV) {
|
for (let i = 0; i < state.questions.length; i++) {
|
||||||
// message.destroy();
|
if (!state.questions[i].inputV) {
|
||||||
// return message.info("请输入题干");
|
message.destroy();
|
||||||
// }
|
return message.info("请输入题干");
|
||||||
if (!state.questions.optins.opvalue) {
|
}
|
||||||
message.destroy();
|
}
|
||||||
return message.info("请输入选项");
|
for (let i = 0; i < state.questions.length; i++) {
|
||||||
|
for (let k = 0; k < state.questions[i].options.length; k++) {
|
||||||
|
if (!state.questions[i].options[k].opvalue) {
|
||||||
|
message.destroy();
|
||||||
|
return message.info("请输入选项");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for (let i = 0; i < state.questions.length; i++) {
|
||||||
|
// for (let k = 0; k < state.questions[i].options.length; k++) {
|
||||||
|
// // console.log('1111111111111111', state.questions);
|
||||||
|
// // console.log('2222222222222222', state.questions[i].options);
|
||||||
|
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
let obj = {
|
||||||
|
"ballotId": 0,
|
||||||
|
"ballotName": state.inputV1,
|
||||||
|
"createTime": "",
|
||||||
|
"createUser": 0,
|
||||||
|
"updateTime": "",
|
||||||
|
"updateUser": 0,
|
||||||
|
"voteStemDtoList": [
|
||||||
|
{
|
||||||
|
"ballotId": 0,
|
||||||
|
"createTime": "",
|
||||||
|
"createUser": 0,
|
||||||
|
"optionDetailList": [
|
||||||
|
{
|
||||||
|
"createTime": "",
|
||||||
|
"createUser": 0,
|
||||||
|
"optionFlag": "",
|
||||||
|
"optionId": 0,
|
||||||
|
// "optionName": state.questions[i].options[k].opvalue,
|
||||||
|
"optionName": "",
|
||||||
|
"optionOrderNum": "",
|
||||||
|
"optionPictureAddress": "",
|
||||||
|
"stem": "",
|
||||||
|
"updateTime": "",
|
||||||
|
"updateUser": 0,
|
||||||
|
"voteStemId": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"orderNumber": "",
|
||||||
|
"updateTime": "",
|
||||||
|
"updateUser": 0,
|
||||||
|
"voteStemFlag": "",
|
||||||
|
"voteStemId": 0,
|
||||||
|
// "voteStemName": state.questions[i].inputV,
|
||||||
|
"voteStemName": "",
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
console.log("111111", state.questions);
|
|
||||||
// console.log('22222',state.questions.inputV);
|
|
||||||
// console.log('333333',state.questions.options);
|
|
||||||
let obj = [
|
|
||||||
{
|
|
||||||
ascriptionId: 0,
|
|
||||||
createUser: 0,
|
|
||||||
optionDetailList: [
|
|
||||||
{
|
|
||||||
createUser: 0,
|
|
||||||
optionId: 0,
|
|
||||||
optionName: state.questions[0].options[0].opvalue,
|
|
||||||
optionOrderNum: "",
|
|
||||||
optionPictureAddress: "",
|
|
||||||
stem: "",
|
|
||||||
updateTime: "",
|
|
||||||
updateUser: 0,
|
|
||||||
voteStemId: 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
orderNumber: "",
|
|
||||||
updateTime: "",
|
|
||||||
updateUser: 0,
|
|
||||||
voteStemFlag: "",
|
|
||||||
voteStemId: 0,
|
|
||||||
voteStemName: state.questions[0].inputV,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
api
|
api
|
||||||
.createOptionMessage(obj)
|
.createOptionMessage(obj)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@@ -234,27 +257,12 @@ export default {
|
|||||||
// console.log('res.data.data[0].voteStemId',res.data.data[0].voteStemId);
|
// console.log('res.data.data[0].voteStemId',res.data.data[0].voteStemId);
|
||||||
// console.log('state.questions[0].inputV',state.questions[0].inputV);
|
// console.log('state.questions[0].inputV',state.questions[0].inputV);
|
||||||
message.success("创建成功");
|
message.success("创建成功");
|
||||||
//获取题干信息
|
|
||||||
let objstem = {
|
let objstem = {
|
||||||
stemId: res.data.data[0].ascriptionId,
|
|
||||||
ascriptionId: res.data.data[0].voteStemId,
|
|
||||||
};
|
|
||||||
api
|
|
||||||
.queryStemByStemId(objstem)
|
|
||||||
.then((res) => {
|
|
||||||
console.log("获取成功", res);
|
|
||||||
message.success("获取成功");
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.log(err);
|
|
||||||
});
|
|
||||||
let stemData = {
|
|
||||||
creVote: state.creVote,
|
|
||||||
ascriptionId: res.data.data[0].ascriptionId,
|
|
||||||
voteStemId: res.data.data[0].voteStemId,
|
|
||||||
voteStemName: state.questions[0].inputV,
|
voteStemName: state.questions[0].inputV,
|
||||||
|
voteStemId: res.data.data.voteStemVoList[0].voteStemId,
|
||||||
|
creVote: true,
|
||||||
};
|
};
|
||||||
ctx.emit("getData", stemData);
|
ctx.emit("getData", objstem);
|
||||||
closeDrawer();
|
closeDrawer();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
@@ -274,7 +282,7 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.ant-table-striped :deep(.table-striped) td {
|
.ant-table-striped :deep(.table-striped) td {
|
||||||
background-color: #fafafa !important;
|
background-color: #fafafa !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ const { defineConfig } = require("@vue/cli-service");
|
|||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
// transpileDependencies: true,
|
// transpileDependencies: true,
|
||||||
devServer: {
|
devServer: {
|
||||||
|
port:8080,
|
||||||
proxy: {
|
proxy: {
|
||||||
"/api": {
|
"/api": {
|
||||||
target: "http://111.231.196.214:30001/", //这里后台的地址模拟的;应该填写你们真实的后台接口
|
target: "http://111.231.196.214:30001/", //这里后台的地址模拟的;应该填写你们真实的后台接口
|
||||||
|
|||||||
Reference in New Issue
Block a user