Commit 0546a130 authored by ganjingcun's avatar ganjingcun

投票人数统计

parent b841a375
......@@ -256,7 +256,7 @@
, title: 'Hi, ' + _this.user.username
, offset: 'rb' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
, id: 'layerDemo'
, time: 5000
, time: 10000
, content: '<div style="padding: 20px ;">' + '感谢您的参与,环境会因为您而变得更好。此问卷为您奖励EXP+1!' + '</div>'
, btn: ['知道了', '参与下一个投票']
......@@ -272,11 +272,34 @@
//return false 开启该代码可禁止点击该按钮关闭
API.getVote({ user: _this.user.id, username: _this.user.username }).then((res) => {
if (res.data.data && res.data.data !== "null") {
_this.voteObj = res.data.data
_this.voteObj.options = JSON.parse(_this.voteObj.options)
_this.dialogFormVisible = true;
} else {
API.getVote({ user: _this.user.id, username: _this.user.username }).then((res) => {
if (res.data.data && res.data.data !== "null") {
_this.voteObj = res.data.data
_this.voteObj.options = JSON.parse(_this.voteObj.options)
_this.dialogFormVisible = true;
} else {
API.getVote({ user: _this.user.id, username: _this.user.username }).then((res) => {
if (res.data.data && res.data.data !== "null") {
_this.voteObj = res.data.data
_this.voteObj.options = JSON.parse(_this.voteObj.options)
_this.dialogFormVisible = true;
} else {
}
}, (res) => {
console.log(res)
});
}
}, (res) => {
console.log(res)
});
}
}, (res) => {
......
......@@ -110,6 +110,7 @@
</el-table-column>
<!--<el-table-column label="ID" prop="id"></el-table-column>-->
<!--<el-table-column label="id" prop="id"></el-table-column>-->
<el-table-column label="标题" prop="title"></el-table-column>
<el-table-column label="开始时间" :formatter="formatter1"></el-table-column>
......@@ -127,6 +128,9 @@
</template>
</el-table-column>
<el-table-column label="参与人数" :formatter="formatter4"></el-table-column>
<el-table-column label="操作" width="100">
<template scope="props">
<el-button @click="handleClick(props.row)" type="text" size="small">编辑</el-button>
......@@ -377,6 +381,9 @@
formatter3(row, column) {
return row.status ? '启用' : '禁用'
},
formatter4(row, column) {
return row.count
},
renderTable: function () {
var params = {
type: this.type,
......@@ -393,8 +400,10 @@
var history = {}
history.total = res.data.total
var optionCountMap = res.data.optionCountMap
var voteCountMap = res.data.voteCountMap
history.data = res.data.data.map(function (row) {
row.options = JSON.parse(row.options)
row.count = voteCountMap[row.id]
var voteVount = 0
row.options.map(function (option) {
option.count = parseInt(optionCountMap[option.key])
......
......@@ -51,7 +51,7 @@ module.exports = {
expRank: 'EXP排名',
pointRank: '竞技场排名',
useRank: '使用量排名',
tableHead1: '查看EXP排行榜,这里展示娱乐匹配的成绩,你是否也榜上有名呢?',
tableHead1: 'EXP排行榜,EXP可以通过匹配以及参与调研获得。来看看谁是最资深的玩家吧!',
tableHead2: '查看竞技场排行榜,这里展示竞技匹配的成绩,你是否也榜上有名呢?',
tableHead3: '查看卡片排行榜.',
},
......
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