<template>
    <div class="voteResult container">
      <div class="card">
        <voteChart ref="voteChart"></voteChart>


      </div>

    </div>
</template>

<script>
import voteChart from "@/views/vote/module/voteChart";
import RxTable from "@/components/RxTable";
export default {
  name: "voteResult",
  components:{
    voteChart,RxTable
  },
  data(){
    return {
      // voteId
      pageInfo: {
        page: 1,
        pageCapacity: 10,
      },
      listData:{
        list:[]
      },
      tableHeader: [
        {
          prop: "passportName",
          label: "意见人",
          width: "120"
        },

        {
          prop: "suggestion",
          label: "意见",
          width: "120"
        },

      ],
    }
  },
  methods:{
    init(){
      let voteId = this.$route.query.voteId
      this.$api.choices({
        voteId
      }).then(res => {
        console.log(res)
        res.content.options.forEach(tar => {
            tar.flag = false;
        })
        this.$refs.voteChart.chartData = {
          ...res.content,
        }
      })


    },
    changePage(page) {

      this.pageInfo.page = page
      this.voteList()
    },
  },
  mounted() {
    this.init()
  }
}
</script>

<style scoped>

</style>
