| | |
| | | import Api from '@/api' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | // } |
| | | resolve() |
| | | }).then(() => { |
| | | let reload = _config.isAdd |
| | | |
| | | // 保存时删除配置类型,system 、user |
| | | delete _config.type |
| | | delete _config.isAdd |
| | |
| | | config: _config, |
| | | openEdition: response.open_edition || '', |
| | | originMenu: fromJS(_config).toJS() |
| | | }, () => { |
| | | reload && MKEmitter.emit('revert') |
| | | }) |
| | | |
| | | this.props.reloadmenu() |
| | |
| | | } |
| | | }) |
| | | |
| | | let calvaild = true |
| | | if (!cols.includes(config.calendar.startfield)) { |
| | | calvaild = false |
| | | } else if (!cols.includes(config.calendar.endfield)) { |
| | | calvaild = false |
| | | } else if (!cols.includes(config.calendar.colorfield)) { |
| | | calvaild = false |
| | | } else if (!cols.includes(config.calendar.remarkfield)) { |
| | | calvaild = false |
| | | } |
| | | |
| | | if (config.setting.interType === 'system' && config.setting.default !== 'false' && !config.setting.dataresource) { |
| | | return '菜单尚未设置数据源,不可启用!' |
| | | } else if (config.columns.length === 0) { |
| | | return '菜单尚未设置数据字段,不可启用!' |
| | | } else if (!calvaild) { |
| | | return '菜单尚未设置字段集,不可启用!' |
| | | } else if (!config.calendar.startfield) { |
| | | return '日历关联字段未设置,不可启用!' |
| | | } else if (!cols.includes(config.calendar.startfield)) { |
| | | return '开始时间字段已删除,不可启用!' |
| | | } else if (!cols.includes(config.calendar.endfield)) { |
| | | return '结束时间字段已删除,不可启用!' |
| | | } else if (config.calendar.colorfield && !cols.includes(config.calendar.colorfield)) { |
| | | return '颜色字段已删除,不可启用!' |
| | | } else if (!cols.includes(config.calendar.remarkfield)) { |
| | | return '信息字段已删除,不可启用!' |
| | | } else { |
| | | return true |
| | | } |