Commit 5ddcc077 authored by 华国豪's avatar 华国豪 🙄

投票

parent e576bd2a
...@@ -2,35 +2,14 @@ ...@@ -2,35 +2,14 @@
<div class="Voting"> <div class="Voting">
<div class="Voting-box"> <div class="Voting-box">
<div class="tit"> <div class="tit">
<p>占位占位投票(单选)</p> <p>{{NowVoteData.Title}}</p>
</div> </div>
<div class="list"> <div class="list">
<div class="item" :class="{'active': radio === '1'}"> <div class="item" :class="{'active': radio === item.ID}" v-for="(item, index) in NowVoteData.VoteOptionsList">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="1">这里是A选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio> <el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" :label="item.ID">{{item.OptionsName}}</el-radio>
</div> </div>
<div class="item" :class="{'active': radio === '2'}">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="2">这里是B选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio>
</div> </div>
<div class="item" :class="{'active': radio === '3'}"> <div class="btn" @click="TP()">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="3">这里是C选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio>
</div>
<div class="item" :class="{'active': radio === '4'}">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="4">这里是D选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio>
</div>
<div class="item" :class="{'active': radio === '1'}">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="1">这里是A选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio>
</div>
<div class="item" :class="{'active': radio === '2'}">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="2">这里是B选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio>
</div>
<div class="item" :class="{'active': radio === '3'}">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="3">这里是C选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio>
</div>
<div class="item" :class="{'active': radio === '4'}">
<el-radio text-color="#ffffff" fill="#ffffff" v-model="radio" label="4">这里是D选项的答案,如果你觉得投票该选这里,那就点击前面圆框</el-radio>
</div>
</div>
<div class="btn">
<div>确认提交</div> <div>确认提交</div>
</div> </div>
</div> </div>
...@@ -40,15 +19,38 @@ ...@@ -40,15 +19,38 @@
<script> <script>
export default { export default {
name: 'Voting', name: 'Voting',
props: {
NowVoteData: {
type: Object,
default: {}
}
},
data () { data () {
return { return {
radio: 1 radio: 1,
} }
}, },
activated () {}, activated () {},
created () {}, created () {},
mounted () {}, mounted () {
methods: {} },
methods: {
TP: function () {
let data = this.NowVoteData
data.VoteOptionsList.map(x=>{
if (x.ID === this.radio) {
x.IsCheck = 1
} else {
x.IsCheck = 0
}
})
this.apipost('user_post_SetEmployeeVote', data, r=>{
if (r.data.resultCode === 1) {
this.MsgBus.$emit('closeVotingBox');
}
}, null)
}
}
} }
</script> </script>
...@@ -62,6 +64,8 @@ export default { ...@@ -62,6 +64,8 @@ export default {
background: rgba(0, 0, 0, 0.19); background: rgba(0, 0, 0, 0.19);
position: absolute; position: absolute;
z-index: 2019129; z-index: 2019129;
left: 0;
top: 0;
} }
.Voting div.Voting-box{ .Voting div.Voting-box{
width:800px; width:800px;
...@@ -114,5 +118,10 @@ export default { ...@@ -114,5 +118,10 @@ export default {
color: white; color: white;
background:rgba(233,82,82,1); background:rgba(233,82,82,1);
border-radius:5px; border-radius:5px;
cursor: pointer;
}
.Voting .el-radio{
width: 100%;
height: 100%;
} }
</style> </style>
...@@ -1126,7 +1126,7 @@ ...@@ -1126,7 +1126,7 @@
</div> </div>
</div> </div>
<!-- 投票 --> <!-- 投票 -->
<Voting v-show="false"></Voting> <Voting v-show="VotingShow" :NowVoteData="NowVoteData"></Voting>
</div> </div>
</template> </template>
...@@ -1380,6 +1380,8 @@ export default { ...@@ -1380,6 +1380,8 @@ export default {
} }
] ]
}, },
VotingShow: false,
NowVoteData: {}
}; };
}, },
filters: { filters: {
...@@ -1606,6 +1608,16 @@ export default { ...@@ -1606,6 +1608,16 @@ export default {
}, },
mounted() { mounted() {
let that = this; let that = this;
this.apipost('user_post_GetNowVote', {}, r=>{
if (r.data.resultCode === 1){
this.NowVoteData = r.data.data
this.VotingShow = true
}
}, null)
this.MsgBus.$on('closeVotingBox', function () {
that.VotingShow = false
that.NowVoteData = {}
});
this.MsgBus.$on('doudong',function(){ this.MsgBus.$on('doudong',function(){
that.dou() that.dou()
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment