<script>
import XQuestionnaire from './XQuestionnaire.vue'
export default {
  name: 'XList2Demo',
  components: {
    XQuestionnaire,
  },
  data () {
    return {
      queryParamsName: 'securityChecksConfig'
    }
  },
  methods: {
    init () {
      console.log(this)
      const conditionData = {
        tmp_6: { tmp_id: 6, data_id: 17 },
        tmp_7: { tmp_id: 7, data_id: 17 },
        tmp_8: { tmp_id: 8, data_id: 17 }
      }
      this.$refs.questionnaireRef.init(conditionData)
    },
    save () {
      console.log(this)
      console.log(this.$refs.questionnaireRef.questionnaireItemRefs.get('tmp_1').results)
    },
    refreshList () {
      this.$refs.questionnaireRef.refreshList('tmp_2', { tmp_id: 3 })
    }
  }
}
</script>

<template>
  <div style="display: flex">
    <x-questionnaire ref="questionnaireRef" :queryParamsName="queryParamsName">
    </x-questionnaire>
    <a-button type="primary" @click="init">
      初始化
    </a-button>
    <a-button type="primary" @click="save">
      保存
    </a-button>
    <a-button type="primary" @click="refreshList">
      刷新
    </a-button>
  </div>
</template>

<style scoped>
</style>
