import Magix from 'magix' import View from '../../../../../view' import reportHelper from '../../helper' Magix.applyStyle('@../index.less') Magix.applyStyle('@./channel-effect.less') export default View.extend({ tmpl: '@channel-effect.html', mixins: [reportHelper], init (options) { this.options = options }, async render () { const { currentWeekly } = this.options const indicators = await this._getAllIndicators() const _indicators = ['charge', 'roi', 'collectCartRate', 'dealGmv', 'clickCost', 'ctr'] const selectedIndicators = [] // 固定6个指标 _indicators.forEach(key => { const ind = indicators.find(_ind => key === _ind.key) selectedIndicators.push(ind) }) this.updater.digest({ showPeer: true, currentWeekly, selectedIndicators, callback: (channelDatas) => { channelDatas.sort((a, b) => b.chargeRatio - a.chargeRatio) this.updater.digest({ topChannel: channelDatas[0].name }) } }) } })