| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { DndProvider } from 'react-dnd' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { Button, Card, Modal, Collapse, notification, Spin, Icon, Switch } from 'antd' |
| | | import { Button, Card, Modal, Collapse, notification, Spin, Switch } from 'antd' |
| | | import { RedoOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | 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 |
| | | } |
| | |
| | | <Card title={ |
| | | <div> |
| | | 日历页面配置 |
| | | <Icon type="redo" style={{marginLeft: '10px'}} title="刷新标签列表" onClick={() => this.reloadTab(true)} /> |
| | | <RedoOutlined style={{marginLeft: '10px'}} title="刷新标签列表" onClick={() => this.reloadTab(true)} /> |
| | | </div> |
| | | } bordered={false} extra={ |
| | | <div> |
| | | <EditComponent dict={this.state.dict} options={['search']} config={this.state.config}/> |
| | | <EditComponent dict={this.state.dict} type="table" options={['search', 'form']} config={this.state.config}/> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> |
| | | <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> |
| | | <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button> |