import React, {Component} from 'react'
|
import PropTypes from 'prop-types'
|
import { is, fromJS } from 'immutable'
|
import { DndProvider } from 'react-dnd'
|
import HTML5Backend from 'react-dnd-html5-backend'
|
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 Utils from '@/utils/utils.js'
|
|
import asyncComponent from '@/utils/asyncComponent'
|
import SearchComponent from '@/templates/sharecomponent/searchcomponent'
|
|
import MenuForm from '@/templates/comtableconfig/menuform'
|
import SourceElement from '@/templates/zshare/dragsource'
|
import Source from './source'
|
import './index.scss'
|
|
const { Panel } = Collapse
|
const { confirm } = Modal
|
|
const UrlFieldComponent = asyncComponent(() => import('@/menu/urlfieldcomponent'))
|
const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent'))
|
const SettingComponent = asyncComponent(() => import('@/templates/sharecomponent/settingcalcomponent'))
|
const TabComponent = asyncComponent(() => import('./tabcomponent'))
|
const CalComponent = asyncComponent(() => import('./calcomponent'))
|
const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent'))
|
const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent'))
|
const CalendarComponent = asyncComponent(() => import('@/tabviews/zshare/calendar'))
|
|
class SubTableConfig extends Component {
|
static propTpyes = {
|
menu: PropTypes.any,
|
reloadmenu: PropTypes.func,
|
handleView: PropTypes.func
|
}
|
|
state = {
|
config: null, // 页面配置
|
visible: false, // 搜索条件、按钮、显示列,模态框显示控制
|
fields: null, // 搜索条件及显示列,可选字段
|
formlist: null, // 搜索条件、按钮、显示列表单字段
|
menuloading: false, // 菜单保存中
|
menucloseloading: false, // 菜单关闭时,选择保存
|
loading: false, // 加载中,页面spin
|
closeVisible: false, // 关闭模态框
|
originConfig: null, // 原配置
|
tabviews: [], // 所有标签页
|
activeKey: '0', // 默认展开基本信息
|
openEdition: '', // 编辑版本标记,防止多人操作
|
mockdata: [], // 测试数据
|
}
|
|
/**
|
* @description 数据预处理
|
* 1、设置页面配置信息,新建或无配置信息时(切换模板后无配置信息),使用模板默认配置
|
* 2、设置操作类型、原始菜单信息(每次保存后重置)、已使用表及基本信息表单
|
*/
|
UNSAFE_componentWillMount () {
|
const { menu } = this.props
|
let _LongParam = menu.LongParam
|
let _config = ''
|
|
if (!_LongParam) {
|
_config = fromJS(Source.baseConfig).toJS()
|
_config.isAdd = true
|
} else {
|
_config = _LongParam
|
}
|
|
if (_config.type === 'user') {
|
if (_config.tab) {
|
_config.tab.linkTab = ''
|
}
|
}
|
|
// 页面配置中保留菜单信息,只用于数据传递
|
_config.ParentId = menu.ParentId
|
_config.fstMenuId = menu.fstMenuId
|
_config.MenuName = menu.MenuName || ''
|
_config.MenuNo = menu.MenuNo || ''
|
_config.OpenType = menu.PageParam ? menu.PageParam.OpenType : ''
|
_config.easyCode = _config.easyCode || ''
|
|
// 数据源
|
if (_config.setting.interType === 'inner' && !_config.setting.innerFunc) {
|
_config.setting.interType = 'system'
|
}
|
|
this.setState({
|
openEdition: menu.open_edition || '',
|
activeKey: menu.activeKey || '0',
|
config: _config,
|
originMenu: fromJS(_config).toJS(),
|
mockdata: this.getMockData(moment().format('YYYY'))
|
})
|
}
|
|
/**
|
* @description 加载完成后
|
* 1、获取系统可使用表
|
* 2、根据配置信息中已使用表获取相关字段信息
|
*/
|
componentDidMount () {
|
this.reloadTab(false)
|
document.onkeydown = (event) => {
|
let e = event || window.event
|
let keyCode = e.keyCode || e.which || e.charCode
|
let preKey = ''
|
|
if (e.ctrlKey) {
|
preKey = 'ctrl'
|
}
|
if (e.shiftKey) {
|
preKey = 'shift'
|
} else if (e.altKey) {
|
preKey = 'alt'
|
}
|
|
if (!preKey || !keyCode) return
|
|
let _shortcut = `${preKey}+${keyCode}`
|
|
if (_shortcut === 'ctrl+83') {
|
let modals = document.querySelectorAll('.mk-pop-modal')
|
let msg = null
|
for (let i = 0; i < modals.length; i++) {
|
if (msg) {
|
break
|
}
|
|
let node = modals[i].querySelector('.mk-com-name')
|
|
if (node) {
|
msg = node.innerText
|
}
|
}
|
if (msg) {
|
notification.warning({
|
top: 92,
|
message: '请保存' + msg,
|
duration: 5
|
})
|
return false
|
}
|
|
let node = document.getElementById('save-config')
|
if (node && node.click) {
|
node.click()
|
}
|
return false
|
}
|
}
|
}
|
|
getMockData = (year) => {
|
let msgs = [
|
{color: 'red', remark: '您有一条新的消息!'},
|
{color: 'orange', remark: '您有一条新的消息!'},
|
{color: 'yellow', remark: '您有一条新的消息!'},
|
{color: 'green', remark: '您有一条新的消息。'},
|
{color: 'cyan', remark: '您有一条新的消息。'},
|
{color: 'blue', remark: '您有一条新的消息!'},
|
{color: 'purple', remark: '您有一条新的消息。'},
|
{color: 'gray', remark: '您有一条新的消息。'}
|
]
|
let mockdata = []
|
|
for (let i = 1; i <= 12; i++) {
|
if (Math.random() > 0.5) {
|
let cell = {uuid: Utils.getuuid()}
|
let msg = msgs[Math.floor(Math.random() * 8)]
|
let day = Math.floor(Math.random() * 28 + 1)
|
|
cell.color = msg.color
|
cell.remark = msg.remark
|
cell.start = `${year}-${i < 10 ? '0' + i : i}-${day < 10 ? '0' + day : day}`
|
cell.end = moment(cell.start, 'YYYY-MM-DD').add(Math.floor(Math.random() * 10), 'days').format('YYYY-MM-DD')
|
|
mockdata.push(cell)
|
|
if (Math.random() > 0.5) {
|
let _cell = {uuid: Utils.getuuid()}
|
let _msg = msgs[Math.floor(Math.random() * 8)]
|
let _day = Math.floor(Math.random() * 28 + 1)
|
|
_cell.color = _msg.color
|
_cell.remark = _msg.remark
|
_cell.start = `${year}-${i < 10 ? '0' + i : i}-${_day < 10 ? '0' + _day : _day}`
|
_cell.end = moment(_cell.start, 'YYYY-MM-DD').add(Math.floor(Math.random() * 10), 'days').format('YYYY-MM-DD')
|
|
mockdata.push(_cell)
|
}
|
}
|
}
|
|
return mockdata
|
}
|
|
/**
|
* @description 加载或刷新标签信息
|
*/
|
reloadTab = (type) => {
|
this.setState({
|
loading: type,
|
tabviews: []
|
})
|
Api.getSystemConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'tab'}).then(res => {
|
if (res.status) {
|
let _tabviews = []
|
res.UserTemp.forEach(temp => {
|
let item = {
|
uuid: temp.MenuID,
|
value: temp.MenuID,
|
text: temp.MenuName,
|
type: temp.Template,
|
MenuNo: temp.MenuNo
|
}
|
|
_tabviews.push(item)
|
})
|
|
this.setState({
|
loading: false,
|
tabviews: _tabviews
|
})
|
|
if (type) {
|
notification.success({
|
top: 92,
|
message: '刷新成功。',
|
duration: 2
|
})
|
}
|
} else {
|
this.setState({
|
loading: false
|
})
|
notification.warning({
|
top: 92,
|
message: res.message,
|
duration: 5
|
})
|
}
|
})
|
}
|
|
/**
|
* @description 组件销毁,清除state更新
|
*/
|
componentWillUnmount () {
|
this.setState = () => {
|
return
|
}
|
document.onkeydown = () => {}
|
}
|
|
// 页面返回
|
handleViewBack = () => {
|
let param = {
|
editMenu: null,
|
editTab: null,
|
tabConfig: null,
|
subTabConfig: null,
|
btnTab: null,
|
btnTabConfig: null,
|
editAction: null,
|
subConfig: null,
|
tabview: ''
|
}
|
|
this.props.handleView(param)
|
}
|
|
getFuncNames = (data, funcNames, tableNames) => {
|
data.forEach(item => {
|
// if (item.subfuncs) {
|
// this.getFuncNames(item.subfuncs, funcNames, tableNames)
|
// return
|
// }
|
|
if (item.tableName) {
|
tableNames.push(item.tableName)
|
}
|
if (item.innerFunc) {
|
funcNames.push({func: item.innerFunc, label: item.label || ''})
|
}
|
|
if (item.callbackFunc) {
|
funcNames.push({func: item.callbackFunc, label: item.label || ''})
|
}
|
})
|
|
return {
|
func: funcNames,
|
table: tableNames
|
}
|
}
|
|
/**
|
* @description 三级菜单保存
|
*/
|
submitConfig = () => {
|
const { menu } = this.props
|
const { openEdition } = this.state
|
|
let _config = fromJS(this.state.config).toJS()
|
|
// 基本信息验证
|
if (!_config.fstMenuId || !_config.ParentId || !_config.MenuName || !_config.MenuNo) {
|
notification.warning({
|
top: 92,
|
message: '请完善菜单基本信息!',
|
duration: 5
|
})
|
this.setState({activeKey: '0'})
|
return
|
}
|
|
if (_config.isAdd) {
|
_config.search = _config.search.filter(item => !item.origin)
|
}
|
|
if (_config.type === 'user') { // 使用已有菜单时,默认添加关联标签id
|
if (_config.tab && !_config.tab.linkTab) {
|
_config.tab.linkTab = Utils.getuuid()
|
}
|
}
|
|
// 未设置数据源或标签不合法时,启用状态为false
|
let vresult = this.verifyconfig(_config)
|
if (vresult !== true) {
|
_config.enabled = false
|
}
|
|
_config.funcs = [] // 页面及子页面存储过程集
|
|
_config.funcs.push({
|
type: 'view',
|
subtype: 'view',
|
uuid: menu.MenuID,
|
intertype: _config.setting.interType || 'system',
|
interface: _config.setting.interface || '',
|
tableName: _config.setting.tableName || '',
|
innerFunc: _config.setting.innerFunc || '',
|
outerFunc: _config.setting.outerFunc || ''
|
})
|
|
if (_config.tab) {
|
_config.funcs.push({
|
type: 'tab',
|
subtype: 'tab',
|
uuid: _config.tab.uuid,
|
label: _config.tab.label,
|
linkTab: _config.tab.linkTab
|
})
|
}
|
|
if (this.state.closeVisible) { // 显示关闭对话框时,模态框中保存按钮,显示保存中状态
|
this.setState({
|
menucloseloading: true
|
})
|
} else {
|
this.setState({
|
menuloading: true
|
})
|
}
|
|
new Promise(resolve => {
|
// if (_config.tab) {
|
// Api.getSystemConfig({
|
// func: 'sPC_Get_LongParam',
|
// MenuID: _config.tab.linkTab
|
// }).then(result => {
|
// if (result.status && result.LongParam) {
|
// let _LongParam = ''
|
|
// if (result.LongParam) {
|
// try {
|
// _LongParam = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
|
// } catch (e) {
|
// console.warn('Parse Failure')
|
// _LongParam = ''
|
// }
|
// }
|
|
// if (_LongParam) {
|
// _config.funcs[1].menuNo = _LongParam.tabNo || ''
|
// _config.funcs[1].subfuncs = _LongParam.funcs || []
|
// }
|
// }
|
// resolve()
|
// })
|
// } else {
|
// resolve()
|
// }
|
resolve()
|
}).then(() => {
|
// 保存时删除配置类型,system 、user
|
delete _config.type
|
delete _config.isAdd
|
|
let _LongParam = ''
|
|
try {
|
_LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_config)))
|
} catch (e) {
|
notification.warning({
|
top: 92,
|
message: '编译错误',
|
duration: 5
|
})
|
this.setState({
|
menucloseloading: false,
|
menuloading: false
|
})
|
return
|
}
|
|
// let tabParam = { // 添加菜单tab页
|
// func: 'sPC_sMenusTab_AddUpt',
|
// MenuID: menu.MenuID
|
// }
|
|
// if (_config.tab) {
|
// tabParam.LText = Utils.formatOptions(`select '${menu.MenuID}' as MenuID ,'${_config.tab.linkTab}' as Tabid,'${_config.tab.label}' as TabName ,'0' as Sort`)
|
// } else {
|
// tabParam.LText = Utils.formatOptions(`select '${menu.MenuID}' as MenuID ,'' as Tabid,'' as TabName ,'0' as Sort`)
|
// }
|
|
// tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
|
// tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
|
|
let _vals = this.getFuncNames(_config.funcs, [], [])
|
let _tables = Array.from(new Set(_vals.table))
|
|
let param = {
|
func: 'sPC_TrdMenu_AddUpt',
|
FstID: _config.fstMenuId,
|
SndID: _config.ParentId,
|
ParentID: _config.ParentId,
|
MenuID: menu.MenuID,
|
MenuNo: _config.MenuNo,
|
EasyCode: _config.easyCode || '',
|
Template: _config.Template || '',
|
MenuName: _config.MenuName,
|
PageParam: JSON.stringify({...menu.PageParam, Template: _config.Template, OpenType: _config.OpenType}),
|
LongParam: _LongParam,
|
LText: _vals.func.map(item => `select '${menu.MenuID}' as MenuID,'${item.func}' as ProcName,'${item.label}' as MenuName`),
|
LTexttb: _tables.map(item => `select '${menu.MenuID}' as MenuID,'${item}' as tbName`)
|
}
|
|
if (menu.menuSort) { // 菜单新建时设置排序
|
param.Sort = menu.menuSort
|
}
|
|
param.LText = param.LText.join(' union all ')
|
param.LText = Utils.formatOptions(param.LText)
|
param.LTexttb = param.LTexttb.join(' union all ')
|
param.LTexttb = Utils.formatOptions(param.LTexttb)
|
param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
|
param.secretkey = Utils.encrypt(param.LText, param.timestamp)
|
|
if (openEdition) { // 版本管理
|
param.open_edition = openEdition
|
}
|
|
// 保存本地
|
let localParam = fromJS(param).toJS()
|
|
Api.getSystemConfig(param).then(response => {
|
if (response.status) {
|
this.setState({
|
config: _config,
|
openEdition: response.open_edition || '',
|
originMenu: fromJS(_config).toJS(),
|
menuloading: false,
|
menucloseloading: false
|
})
|
|
this.props.reloadmenu()
|
|
localParam.func = 'sPC_TrdMenu_AddUpt_For_Local'
|
delete localParam.LongParam
|
delete localParam.PageParam
|
delete localParam.Template
|
delete localParam.Sort
|
delete localParam.EasyCode
|
delete localParam.open_edition
|
|
Api.genericInterface(localParam)
|
|
notification.success({
|
top: 92,
|
message: '保存成功',
|
duration: 2
|
})
|
|
if (this.state.closeVisible) {
|
this.handleViewBack()
|
}
|
} else {
|
this.setState({
|
menuloading: false,
|
menucloseloading: false
|
})
|
notification.warning({
|
top: 92,
|
message: response.message,
|
duration: 5
|
})
|
}
|
})
|
})
|
}
|
|
cancelConfig = () => {
|
const { config, originMenu } = this.state
|
let _this = this
|
|
if (config.isAdd) {
|
confirm({
|
content: '菜单尚未提交,确定放弃保存吗?',
|
onOk() {
|
_this.props.handleView()
|
},
|
onCancel() {}
|
})
|
} else {
|
if (!is(fromJS(originMenu), fromJS(config))) {
|
this.setState({
|
closeVisible: true
|
})
|
} else {
|
this.props.handleView()
|
}
|
}
|
}
|
|
/**
|
* @description 设置可配置按钮
|
*/
|
setSubConfig = () => {
|
const { menu } = this.props
|
const { config, originMenu, activeKey, openEdition } = this.state
|
|
if (config.isAdd) { // 新建菜单,提示菜单尚未保存
|
notification.warning({
|
top: 92,
|
message: '菜单尚未保存,请先保存菜单配置!',
|
duration: 5
|
})
|
} else {
|
// 基本信息验证
|
if (!config.fstMenuId || !config.ParentId || !config.MenuName || !config.MenuNo) {
|
notification.warning({
|
top: 92,
|
message: '请完善菜单基本信息!',
|
duration: 5
|
})
|
this.setState({activeKey: '0'})
|
return
|
}
|
|
if (!is(fromJS(originMenu), fromJS(config))) { // 菜单信息变化时,提示保存
|
notification.warning({
|
top: 92,
|
message: '菜单配置已修改,请保存!',
|
duration: 5
|
})
|
return
|
}
|
|
let submenu = menu.fstMenuList.filter(item => item.MenuID === config.fstMenuId)[0]
|
let _Menu = {
|
...menu,
|
LongParam: config,
|
PageParam: {...menu.PageParam, Template: config.Template, OpenType: config.OpenType},
|
MenuName: config.MenuName,
|
MenuNo: config.MenuNo,
|
ParentId: config.ParentId,
|
fstMenuId: config.fstMenuId,
|
supMenuList: submenu ? submenu.options : []
|
}
|
|
// 菜单信息验证通过后,跳转子配置页面
|
_Menu.activeKey = activeKey // 保存当前打开页签
|
_Menu.open_edition = openEdition // 更新版本号
|
|
let param = {
|
editMenu: _Menu,
|
editTab: fromJS(config.tab).toJS(),
|
tabConfig: null,
|
editSubTab: null,
|
subTabConfig: null,
|
btnTab: null,
|
btnTabConfig: null,
|
editAction: '',
|
subConfig: '',
|
tabview: config.tab.type
|
}
|
|
// 当子表使用主页搜索条件时,将主页搜索向下传递
|
if (param.editTab && param.editTab.searchPass === 'true') {
|
param.editTab.mainsearch = fromJS(config.search).toJS()
|
}
|
|
this.setState({
|
loading: true
|
})
|
|
Api.getSystemConfig({
|
func: 'sPC_Get_LongParam',
|
MenuID: config.tab.linkTab
|
}).then(res => {
|
if (res.status) {
|
this.setState({
|
loading: false
|
})
|
let _LongParam = ''
|
if (res.LongParam) {
|
try {
|
_LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam)))
|
} catch (e) {
|
console.warn('Parse Failure')
|
_LongParam = ''
|
}
|
}
|
|
if (_LongParam && param.tabview === 'SubTable' && _LongParam.Template === 'SubTable') {
|
param.subConfig = _LongParam
|
}
|
|
if (param.editTab) {
|
param.editTab.open_edition = res.open_edition || ''
|
}
|
|
this.props.handleView(param)
|
} else {
|
this.setState({
|
loading: false
|
})
|
notification.warning({
|
top: 92,
|
message: res.message,
|
duration: 5
|
})
|
}
|
})
|
}
|
}
|
|
/**
|
* @description 切换标签是否启用
|
*/
|
onEnabledChange = () => {
|
const { config } = this.state
|
|
let _enabled = !config.enabled
|
let result = this.verifyconfig(config)
|
|
if (_enabled && result !== true) {
|
notification.warning({
|
top: 92,
|
message: result,
|
duration: 5
|
})
|
return
|
}
|
|
this.setState({
|
config: {...config, enabled: _enabled}
|
})
|
}
|
|
/**
|
* @description 校验配置信息的合法性
|
*/
|
verifyconfig = (config) => {
|
let cols = []
|
config.columns.forEach(col => {
|
if (col.field) {
|
cols.push(col.field)
|
}
|
})
|
|
if (config.setting.interType === 'system' && config.setting.default !== 'false' && !config.setting.dataresource) {
|
return '菜单尚未设置数据源,不可启用!'
|
} else if (config.columns.length === 0) {
|
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
|
}
|
}
|
|
/**
|
* @description 编辑功能完成更新,包括解冻按钮、粘贴、替换等
|
*/
|
updateConfig = (res) => {
|
if (res.type === 'thaw') {
|
this.setState({
|
config: res.config
|
})
|
} else if (res.type === 'paste') {
|
this.setState({config: res.config})
|
}
|
}
|
|
/**
|
* @description 更新搜索条件配置信息
|
*/
|
updatesearch = (config) => {
|
|
this.setState({
|
config: config
|
})
|
}
|
|
/**
|
* @description 更新显示列配置信息
|
*/
|
updateconfig = (config) => {
|
this.setState({
|
config: config
|
})
|
}
|
|
// 年切换时重新生成数据
|
changeDate = (year) => {
|
this.setState({
|
mockdata: this.getMockData(year)
|
})
|
}
|
|
render () {
|
const { menu } = this.props
|
const { activeKey, config, tabviews, mockdata } = this.state
|
|
return (
|
<div className="model-calendar-board">
|
<DndProvider backend={HTML5Backend}>
|
{/* 工具栏 */}
|
<div className="tools">
|
<Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}>
|
{/* 基本信息 */}
|
<Panel forceRender={true} header="基本信息" key="0" id="subtable-basedata">
|
{/* 菜单信息 */}
|
<MenuForm
|
menu={menu}
|
config={config}
|
updatemenu={this.updateconfig}
|
/>
|
{config ? <UrlFieldComponent
|
config={config}
|
updateConfig={this.updateconfig}
|
/> : null}
|
{/* 表名添加 */}
|
<TableComponent
|
config={config}
|
containerId="subtable-basedata"
|
updatetable={this.updateconfig}
|
/>
|
</Panel>
|
{/* 搜索条件添加 */}
|
<Panel header="搜索" key="1">
|
<div className="search-element">
|
{Source.searchItems.map((item, index) => {
|
return (<SourceElement key={index} content={item}/>)
|
})}
|
</div>
|
<FieldsComponent config={config} type="search" />
|
</Panel>
|
</Collapse>
|
</div>
|
<div className="setting">
|
<Card title={
|
<div>
|
日历页面配置
|
<RedoOutlined style={{marginLeft: '10px'}} title="刷新标签列表" onClick={() => this.reloadTab(true)} />
|
</div>
|
} bordered={false} extra={
|
<div>
|
<EditComponent 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" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>保存</Button>
|
<Button onClick={this.cancelConfig}>关闭</Button>
|
</div>
|
} style={{ width: '100%' }}>
|
<SettingComponent
|
config={config}
|
MenuID={menu.MenuID}
|
updateConfig={this.updateconfig}
|
/>
|
<SearchComponent
|
menu={{MenuID: menu.MenuID, MenuName: config.MenuName}}
|
config={config}
|
updatesearch={this.updatesearch}
|
/>
|
<div className="calendar-wrap">
|
<TabComponent config={config} updateConfig={this.updateconfig} tabviews={tabviews} setSubConfig={this.setSubConfig} />
|
<CalComponent config={config} updateConfig={this.updateconfig} />
|
<CalendarComponent calendar={{
|
levels: config.calendar.levels, startfield: 'start', endfield: 'end', colorfield: 'color', remarkfield: 'remark', refresh: config.calendar.refresh
|
}} data={mockdata} changeDate={this.changeDate}/>
|
</div>
|
</Card>
|
</div>
|
</DndProvider>
|
<Modal
|
bodyStyle={{textAlign: 'center', color: '#000000', fontSize: '16px'}}
|
closable={false}
|
maskClosable={false}
|
visible={this.state.closeVisible}
|
onCancel={() => { this.setState({closeVisible: false}) }}
|
footer={[
|
<Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>保存</Button>,
|
<Button key="confirm" className="mk-btn mk-yellow" onClick={this.handleViewBack}>不保存</Button>,
|
<Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>取消</Button>
|
]}
|
destroyOnClose
|
>
|
配置已修改,是否保存配置信息?
|
</Modal>
|
{this.state.loading && <Spin size="large" />}
|
</div>
|
)
|
}
|
}
|
|
export default SubTableConfig
|