import Popover from './Popover'
import Question from './question.vue'


import Vue from 'vue'
import myPopover from '@/views/visual/title/index.js'
Vue.directive('myPopover', myPopover);

export default {
  props: {
    total: Object,
    QuestionTotal:Array,
    questionName:String
  },
  components: {
    Popover,
    Question
  },
  data() {
    return {}
  },
  methods: {
    handleClick(type) {
      this.$emit('on-click', type)
    },
    getTotal(type) {
      const total = this.total[type]
      if (total) {
        return total
      }
      return 0
    },
    getQuestionTotal(type){
      if(this.QuestionTotal.length>0){
        const total = this.QuestionTotal.find(item=>{return item.applicationScenarioName == type}).eventNumber
        
        if (total) {
          this.total1 = total
          return total
        }
      }
      
      return 0
    },
    getQuestionId(type){
      if(this.QuestionTotal.length>0){
         return this.QuestionTotal.find(item=>{return item.applicationScenarioName == type})
      }
    },
  }
}