import Magix from 'magix' export default { // 获取所有指标 async _getAllIndicators () { if (Magix.config('allIndicators')) { return Magix.config('allIndicators') } try { const models = [{ name: 'api_report_indicators_get' }] const [model] = await this.fetch(models) const indicators = model.get('data', []) Magix.config({ allIndicators: indicators }) return indicators } catch (error) { this.alert('错误提示', error.msg || error.message || error, null, { mask: true }) } } }