import Magix from 'magix' import * as View from '../../../../view' Magix.applyStyle('@./effects.less') export default View.extend({ tmpl: '@effects.html', init (options) { this.options = options }, async render () { // const loc = Magix.Router.parse() const { kmeansTaskId, kmeansCnt } = this.options const effects = await this.getEffects(kmeansTaskId, kmeansCnt) this.updater.digest({ effects }) }, async getEffects (kmeansTaskId, kmeansCnt) { try { const models = [{ name: 'api_scenario_cluster_effect_get', params: { kmeansTaskId, kmeansCnt } }] const [model] = await this.fetch(models) const data = model.get('data.effect', []) return data } catch (error) { this.alert('错误提示', error.msg || error.message || error, null, { mask: true }) } } })