|
|
@ -46,6 +46,15 @@ function searchDetail(scope) { |
|
|
|
const indexMethod = function (index) { |
|
|
|
return index + 1; |
|
|
|
} |
|
|
|
//重置投票记录 |
|
|
|
function resetVote() { |
|
|
|
CanApi.Reset().then(result => { |
|
|
|
if (result.code == 10000) { |
|
|
|
loadCandidates(); |
|
|
|
ElMessage.success('重置成功'); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
@ -53,6 +62,7 @@ const indexMethod = function (index) { |
|
|
|
<el-table-column type="index" :index="indexMethod" label="序号" width="180" /> |
|
|
|
<el-table-column prop="name" label="候选国家" width="180" /> |
|
|
|
<el-table-column prop="votes" label="获得票数" /> |
|
|
|
|
|
|
|
<el-table-column label="操作"> |
|
|
|
<template #default="scope"> |
|
|
|
<div class="button" @click="searchDetail(scope.row.jwCode)"> |
|
|
@ -68,7 +78,7 @@ const indexMethod = function (index) { |
|
|
|
<el-table-column prop="voteTime" label="投票时间" width="200" /> |
|
|
|
</el-table> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-button type="primary" @click="resetVote">重置投票记录</el-button> |
|
|
|
</template> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|