export default {
  methods: {
    philosophyResolver() {
      // 价值观的数据解析
      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)
        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,
          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 = '心理学家根据人们价值观的不同，把人分为政治型、经济型、科学型、社会型、审美型、精神型六种类型，不同类型的人所看重的价值是不同的。'
    }
  }
}
