import Magix from 'magix' import View from 'dmp-new/view' Magix.applyStyle('@./channel.less') export default View.extend({ tmpl: '@channel.html', init(options) { this.options = options }, async render() { // const loc = Magix.Router.parse() const { report, taskId, transferType, isInflow, top20, statusIds, statusId: _statusId, brandsMap, competeBrandId: _competeBrandId } = this.options const { statusId = _statusId, competeBrandId = _competeBrandId } = this.updater.get() this.updater.digest({ loading: true, isInflow, report, brandsMap, taskId, transferType, top20, statusIds, competeBrandId, statusId }) const data = await this.getChannelData() this.updater.digest({ data, loading: false }) }, async getChannelData() { try { const { taskId, competeBrandId, statusId, transferType } = this.updater.get() const params = { taskId, competeBrandId, statusId, transferType } const models = [ { name: 'api_deeplink_compete_transfer_channel_get', params } ] const [model] = await this.fetch(models) const data = model.get('data', {}) return data } catch (error) { console.error(error) return [] } }, 'changeFilter'(e) { this.render() } })