export default {
  methods: {
    occupationResolver() {
      // 职业兴趣的数据解析
      const dimensionA = { name: '喜欢' }
      const dimensionB = { name: '擅长' }
      const tableDefines = { name: { label: '类型' } }
      const resolveKeys = []
      const matchedKeys = []
      const resolveConfig = {}
      for (const data of this.source.datas) {
        const key = data.key
        resolveKeys.push(key)
        data.stats = data.stats || {}
        dimensionA[key] = data.stats[dimensionA.name]
        dimensionB[key] = data.stats[dimensionB.name]
        tableDefines[key] = { label: data.name }
        if (data.matched) matchedKeys.push(key)
        resolveConfig[key] = {
          title: data.name,
          code: data.code,
          matched: data.matched || false,
          description: data.content,
          matchedMajor: data.viewMajorList?.map(m => m.majorCategory) || []
        }
      }
      this.dataList = [dimensionA, dimensionB]
      this.reportConfig.matchedKeys = matchedKeys
      this.reportConfig.resolveKeys = resolveKeys
      this.reportConfig.tableDefines = tableDefines
      this.reportConfig.resolveConfig = resolveConfig
      this.reportConfig.categoryDescription = ''
    }
  }
}
