<template>
  <el-form label-width="160px" style="margin-top:180px;">
    <el-form-item label="调查名称：">
      <el-select filterable placeholder="" v-model="vote" class="form-item">
        <el-option v-for="item in votes" :key="item.ID" :label="item.title" :value="item.code">
      </el-option>
      </el-select>
    </el-form-item>
  </el-form>
</template>
<script>
export default {
  data() {
    return {
      vote: '',
      votes: []
    }
  },
  computed: {
  },
  async created() {
  },
  methods: {
    getCode() {
      return `<cms:vote code="${this.vote}">{ZCMS:<z:lang id="Contentcore.Vote">调查</z:lang>}</cms:vote>`
    },
    async init() {
      let res = await axios.get('/ui/votes/votelist')
      if (res.data.status === 1) {
        this.votes = res.data.data.filter(val => val.status === 'published')
      }
    }
  }
}
</script>
