import Magix from 'magix' import * as View from '../../../view' Magix.applyStyle('@./index.less') export default View.extend({ tmpl: '@apply_dialog.html', init (options) { this.options = options }, async render () { const { Moment } = this.updater.get() await this.postApply() this.updater.digest({ level: this.options.level, date: Moment().add(1, 'days').format('M月D日') }) }, async postApply () { try { const models = [{ name: 'api_power_center_request_post', params: { roleLevel: this.options.level + 1 } }] await this.fetch(models) } catch (error) { this.alert('错误提示', error.msg || error.message || error, null) } }, 'close': function (e) { this.options.dialog.close() if (this.options.callback) { this.options.callback() } } })