import Magix from 'magix' import View from '../../../../view' Magix.applyStyle('@./status-deepen-analysis.less') export default View.extend({ tmpl: '@status-deepen-analysis.html', init (options) { this.options = options this.observeLocation(['statusDeepenType', 'statusId']) }, async render () { const loc = Magix.Router.parse() const { statusId } = this.options this.options.statusId = loc.get('statusId') || statusId const viewMap = { 1: '@./status-no-deepen', 2: '@../flow-contribute' } const tabs = [{ text: '状态未加深人群机会分析', value: '1' }, { text: '状态加深流转详情', value: '2' }] const selected = loc.get('statusDeepenType') || tabs[0].value this.updater.digest({ randomStamp: Math.random(), viewMap, params: this.options, tabs, selected }) }, 'changeTab' (e) { const { selected } = this.updater.get() Magix.Router.to({ statusDeepenType: selected }) } })