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, Select, List, Icon, Empty } from 'antd'
|
import DragElement from './dragelement'
|
import SourceElement from './dragelement/source'
|
import Api from '@/api'
|
import ModalForm from './modalform'
|
import SettingForm from './settingform'
|
import EditCard from './editcard'
|
import MenuForm from './menuform'
|
import zhCN from '@/locales/zh-CN/comtable.js'
|
import enUS from '@/locales/en-US/comtable.js'
|
import Utils from '@/utils/utils.js'
|
import Source from './source'
|
import './index.scss'
|
|
const { Panel } = Collapse
|
const { Option } = Select
|
const { confirm } = Modal
|
const CommonDict = (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS
|
|
class ComTableConfig extends Component {
|
static propTpyes = {
|
menu: PropTypes.any,
|
editAction: PropTypes.object,
|
handleConfig: PropTypes.func
|
}
|
|
state = {
|
operaType: '', // 操作类型,新建或编辑
|
dict: CommonDict, // 字典
|
config: null, // 页面配置
|
visible: false, // 搜索条件、按钮、显示列,模态框显示控制
|
tableVisible: false, // 数据表字段模态框
|
addType: '', // 添加类型-搜索条件或显示列
|
tableColumns: [], // 表格显示列
|
fields: null, // 搜索条件及显示列,可选字段
|
modalformlist: null, // 基本信息表单字段
|
formlist: null, // 搜索条件、按钮、显示列表单字段
|
card: null, // 编辑元素
|
loading: false, // 搜索条件加载中
|
menuloading: false, // 菜单保存中
|
settingVisible: false, // 全局配置模态框
|
closeVisible: false, // 关闭模态框
|
tables: [], // 可用表名
|
selectedTables: [], // 已选表名
|
originMenu: null // 原始菜单
|
}
|
|
UNSAFE_componentWillMount () {
|
const {menu, editAction} = this.props
|
|
let _config = ''
|
let _operaType = 'add'
|
if (editAction.pageParam) {
|
_config = editAction.pageParam
|
_operaType = 'edit'
|
} else {
|
_config = JSON.parse(JSON.stringify((Source.baseConfig)))
|
}
|
|
if (!_config.setting.title) {
|
_config.setting.title = editAction.label
|
}
|
|
this.setState({
|
config: _config,
|
operaType: _operaType,
|
selectedTables: _config.tables || [],
|
modalformlist: [
|
{
|
type: 'text',
|
key: 'supMenu',
|
label: this.state.dict['header.menu.supMenu'],
|
initVal: menu.MenuName,
|
required: true,
|
readonly: true,
|
},
|
{
|
type: 'text',
|
key: 'btnName',
|
label: '按钮名称',
|
initVal: editAction.label,
|
required: true,
|
readonly: true
|
}
|
]
|
})
|
}
|
|
componentDidMount () {
|
let _text = 'select TbName ,Remark from sDataDictionary where IsKey!=\'\' and Deleted =0'
|
_text = Utils.formatOptions(_text)
|
|
Api.getSystemConfig({func: 'sPC_Get_SelectedList', LText: _text, obj_name: 'data', arr_field: 'TbName,Remark'}).then(res => {
|
if (res.status) {
|
this.setState({
|
tables: res.data
|
})
|
} else {
|
notification.warning({
|
top: 92,
|
message: res.message,
|
duration: 10
|
})
|
}
|
})
|
|
let deffers = this.state.selectedTables.map(item => {
|
return new Promise(resolve => {
|
Api.getSystemConfig({func: 'sPC_Get_FieldName', TBName: item.TbName}).then(res => {
|
res.TBName = item.TbName
|
resolve(res)
|
})
|
})
|
})
|
Promise.all(deffers).then(response => {
|
let _columns = []
|
response.forEach(res => {
|
if (res.status) {
|
let tabmsg = {
|
tableName: res.TBName,
|
columns: res.FDName.map(item => {
|
let _type = item.FieldType.toLowerCase()
|
let _decimal = 0
|
if (/^nvarchar/.test(_type)) {
|
_type = 'text'
|
} else if (/^int/.test(_type)) {
|
_type = 'number'
|
} else if (/^decimal/.test(_type)) {
|
_decimal = _type.split(',')[1]
|
_decimal = parseInt(_decimal)
|
if (_decimal > 4) {
|
_decimal = 4
|
}
|
_type = 'number'
|
} else if (/^decimal/.test(_type)) {
|
_decimal = _type.split(',')[1]
|
_decimal = parseInt(_decimal)
|
if (_decimal > 4) {
|
_decimal = 4
|
}
|
_type = 'number'
|
} else if (/^datetime/.test(_type)) {
|
_type = 'datetime'
|
} else if (/^date/.test(_type)) {
|
_type = 'date'
|
} else {
|
_type = 'text'
|
}
|
|
return {
|
field: item.FieldName,
|
label: item.FieldDec,
|
type: _type,
|
decimal: _decimal
|
}
|
})
|
}
|
_columns.push(tabmsg)
|
} else {
|
notification.warning({
|
top: 92,
|
message: res.message,
|
duration: 10
|
})
|
}
|
})
|
|
this.setState({
|
tableColumns: _columns
|
})
|
})
|
}
|
|
handleList = (list) => {
|
let _config = JSON.parse(JSON.stringify(this.state.config))
|
|
if (list.length > _config.fields.length) {
|
_config.fields = list.filter(item => !item.origin)
|
this.setState({
|
loading: true,
|
config: _config
|
}, () => {
|
this.setState({
|
loading: false
|
})
|
})
|
} else {
|
_config.fields = list
|
this.setState({config: _config})
|
}
|
}
|
|
handleForm = (card) => {
|
this.setState({
|
visible: true,
|
card: card,
|
formlist: [
|
{
|
type: 'text',
|
key: 'label',
|
label: this.state.dict['header.form.name'],
|
initVal: card.label,
|
required: true,
|
readonly: false
|
},
|
{
|
type: 'text',
|
key: 'field',
|
label: this.state.dict['header.form.field'],
|
initVal: card.field,
|
required: true,
|
readonly: false
|
},
|
{
|
type: 'select',
|
key: 'type',
|
label: this.state.dict['header.form.type'],
|
initVal: card.type,
|
required: true,
|
options: [{
|
value: 'text',
|
text: this.state.dict['header.form.text']
|
}, {
|
value: 'select',
|
text: this.state.dict['header.form.select']
|
}, {
|
value: 'link',
|
text: this.state.dict['header.form.link']
|
}, {
|
value: 'date',
|
text: this.state.dict['header.form.dateday']
|
}, {
|
value: 'dateweek',
|
text: this.state.dict['header.form.dateweek']
|
}, {
|
value: 'datemonth',
|
text: this.state.dict['header.form.datemonth']
|
}, {
|
value: 'daterange',
|
text: this.state.dict['header.form.daterange']
|
}]
|
},
|
{
|
type: 'text',
|
key: 'initval',
|
label: this.state.dict['header.form.initval'],
|
initVal: card.initval,
|
required: false
|
},
|
{
|
type: 'radio',
|
key: 'resourceType',
|
label: this.state.dict['header.form.resourceType'],
|
initVal: card.resourceType || '0',
|
required: true,
|
options: [{
|
value: '0',
|
text: this.state.dict['header.form.custom']
|
}, {
|
value: '1',
|
text: this.state.dict['header.form.datasource']
|
}]
|
},
|
{
|
type: 'radio',
|
key: 'setAll',
|
label: this.state.dict['header.form.setAll'],
|
initVal: card.setAll || 'false',
|
options: [{
|
value: 'true',
|
text: this.state.dict['header.form.true']
|
}, {
|
value: 'false',
|
text: this.state.dict['header.form.false']
|
}]
|
},
|
{
|
type: 'textarea',
|
key: 'dataSource',
|
label: this.state.dict['header.form.datasource'],
|
initVal: card.dataSource || '',
|
required: true,
|
readonly: false
|
},
|
{
|
type: 'options',
|
key: 'options',
|
label: '',
|
initVal: card.options || [],
|
required: true,
|
readonly: false
|
},
|
{
|
type: 'text',
|
key: 'linkField',
|
label: this.state.dict['header.form.linkField'],
|
initVal: card.linkField || '',
|
required: true,
|
readonly: false
|
},
|
{
|
type: 'text',
|
key: 'valueField',
|
label: this.state.dict['header.form.valueField'],
|
initVal: card.valueField || '',
|
required: true,
|
readonly: false
|
},
|
{
|
type: 'text',
|
key: 'valueText',
|
label: this.state.dict['header.form.valueText'],
|
initVal: card.valueText || '',
|
required: true,
|
readonly: false
|
},
|
{
|
type: 'text',
|
key: 'orderBy',
|
label: this.state.dict['header.form.orderBy'],
|
initVal: card.orderBy || '',
|
required: false,
|
readonly: false
|
},
|
{
|
type: 'select',
|
key: 'orderType',
|
label: this.state.dict['header.form.orderType'],
|
initVal: card.orderType || 'asc',
|
options: [{
|
value: 'asc',
|
text: this.state.dict['header.form.asc']
|
}, {
|
value: 'desc',
|
text: this.state.dict['header.form.desc']
|
}]
|
}
|
]
|
})
|
}
|
|
handleSubmit = () => {
|
this.formRef.handleConfirm().then(res => {
|
let _config = JSON.parse(JSON.stringify(this.state.config))
|
console.log(res)
|
_config.fields = _config.fields.map(item => {
|
if (item.uuid === res.uuid) {
|
return res
|
} else {
|
return item
|
}
|
})
|
_config.fields = _config.fields.filter(item => !item.origin)
|
|
this.setState({
|
config: _config,
|
loading: true,
|
visible: false
|
}, () => {
|
this.setState({
|
loading: false
|
})
|
})
|
})
|
}
|
|
closeForm = (card) => {
|
let _this = this
|
|
confirm({
|
content: `确定删除<<${card.label}>>吗?`,
|
okText: this.state.dict['header.confirm'],
|
cancelText: this.state.dict['header.cancel'],
|
onOk() {
|
let _config = JSON.parse(JSON.stringify(_this.state.config))
|
_config.fields = _config.fields.filter(item => {
|
if (item.uuid === card.uuid) {
|
return false
|
} else {
|
return true
|
}
|
})
|
_this.setState({
|
config: _config,
|
loading: true
|
}, () => {
|
_this.setState({
|
loading: false
|
})
|
})
|
},
|
onCancel() {}
|
})
|
}
|
|
changeTemplate = () => {
|
this.props.handleConfig('template')
|
}
|
|
submitConfig = () => {
|
const { menu } = this.props
|
const { config, originMenu } = this.state
|
this.menuformRef.handleConfirm().then(res => {
|
|
if (!config.fields[0] && config.fields[0].origin) {
|
notification.warning({
|
top: 92,
|
message: '请添加表单',
|
duration: 10
|
})
|
return
|
}
|
|
let _LongParam = ''
|
let _config = {...config, tables: this.state.selectedTables}
|
let _pageParam = {...menu.PageParam, OpenType: res.opentype}
|
|
try {
|
_LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_config)))
|
} catch (e) {
|
notification.warning({
|
top: 92,
|
message: '编译错误',
|
duration: 10
|
})
|
return
|
}
|
|
let param = {
|
func: 'sPC_ButtonParam_AddUpt',
|
ParentID: res.parentId,
|
MenuID: menu.MenuID,
|
MenuNo: res.menuNo,
|
Template: menu.PageParam.Template || '',
|
MenuName: res.menuName,
|
PageParam: JSON.stringify(_pageParam),
|
LongParam: _LongParam
|
}
|
this.setState({
|
menuloading: true
|
})
|
|
Api.getSystemConfig(param).then(response => {
|
if (response.status) {
|
this.setState({
|
menuloading: false,
|
operaType: 'edit',
|
originMenu: {
|
...originMenu,
|
LongParam: _config,
|
PageParam: _pageParam,
|
MenuName: res.menuName,
|
MenuNo: res.menuNo,
|
ParentID: res.parentId
|
}
|
})
|
notification.success({
|
top: 92,
|
message: '保存成功',
|
duration: 10
|
})
|
} else {
|
this.setState({
|
menuloading: false
|
})
|
notification.warning({
|
top: 92,
|
message: response.message,
|
duration: 10
|
})
|
}
|
})
|
|
if (this.state.operaType === 'add') {
|
|
} else {
|
let param = {
|
func: 'sPC_TrdMenu_Upt',
|
ParentID: res.parentId,
|
MenuID: menu.MenuID,
|
MenuNo: res.menuNo,
|
Template: menu.PageParam.Template || '',
|
MenuName: res.menuName,
|
PageParam: JSON.stringify(_pageParam),
|
LongParam: _LongParam
|
}
|
this.setState({
|
menuloading: true
|
})
|
|
Api.getSystemConfig(param).then(response => {
|
if (response.status) {
|
notification.success({
|
top: 92,
|
message: '保存成功',
|
duration: 10
|
})
|
if (this.state.closeVisible) {
|
this.props.handleConfig('')
|
} else {
|
this.setState({
|
menuloading: false,
|
originMenu: {
|
...originMenu,
|
LongParam: _config,
|
PageParam: _pageParam,
|
MenuName: res.menuName,
|
MenuNo: res.menuNo,
|
ParentID: res.parentId
|
}
|
})
|
}
|
} else {
|
this.setState({
|
menuloading: false
|
})
|
notification.warning({
|
top: 92,
|
message: response.message,
|
duration: 10
|
})
|
}
|
})
|
}
|
}, () => {
|
notification.warning({
|
top: 92,
|
message: this.state.dict['header.menu.basemsg'],
|
duration: 10
|
})
|
})
|
}
|
|
cancelConfig = () => {
|
const { menu } = this.props
|
const { config, originMenu } = this.state
|
let _this = this
|
|
if (this.state.operaType === 'add') {
|
confirm({
|
content: '菜单尚未提交,确定放弃保存吗?',
|
okText: this.state.dict['header.confirm'],
|
cancelText: this.state.dict['header.cancel'],
|
onOk() {
|
_this.props.handleConfig('')
|
},
|
onCancel() {}
|
})
|
} else {
|
this.menuformRef.handleConfirm().then(res => {
|
let _config = {...config, tables: this.state.selectedTables}
|
let _pageParam = {...menu.PageParam, OpenType: res.opentype}
|
let _originMenu = {
|
...originMenu,
|
LongParam: _config,
|
PageParam: _pageParam,
|
MenuName: res.menuName,
|
MenuNo: res.menuNo,
|
ParentID: res.parentId
|
}
|
|
if (!is(fromJS(originMenu), fromJS(_originMenu))) {
|
this.setState({
|
closeVisible: true
|
})
|
} else {
|
this.props.handleConfig('')
|
}
|
}, () => {
|
this.setState({
|
closeVisible: true
|
})
|
})
|
}
|
}
|
|
queryField = () => {
|
const {selectedTables, tableColumns, config} = this.state
|
if (selectedTables.length === 0) {
|
notification.warning({
|
top: 92,
|
message: '请选择表名!',
|
duration: 10
|
})
|
return
|
}
|
|
let columns = new Map()
|
tableColumns.forEach(table => {
|
table.columns.forEach(column => {
|
columns.set(column.field, column)
|
})
|
})
|
|
config.fields.forEach(item => {
|
if (columns.has(item.field)) {
|
columns.set(item.field, {...item, selected: true, type: item.type})
|
}
|
})
|
|
this.setState({
|
tableVisible: true,
|
fields: [...columns.values()]
|
})
|
}
|
|
addFieldSubmit = () => {
|
if (!this.state.fields || this.state.fields.length === 0) {
|
this.setState({
|
tableVisible: false
|
})
|
}
|
|
let _config = JSON.parse(JSON.stringify(this.state.config))
|
|
let cards = this.refs.searchcard.state.selectCards
|
let columns = new Map()
|
cards.forEach(card => {
|
columns.set(card.field, card)
|
})
|
|
let items = []
|
_config.fields.forEach(item => {
|
if (columns.has(item.field)) {
|
let cell = columns.get(item.field)
|
|
if (cell.selected && cell.type === item.type) { // 数据未修改
|
items.push(item)
|
} else if (cell.selected) { // 数据类型修改
|
item.type = cell.type
|
item.initval = ''
|
items.push(item)
|
}
|
columns.delete(item.field)
|
} else if (!item.origin) {
|
items.push(item)
|
}
|
})
|
|
let _columns = [...columns.values()]
|
let indexes = items.map(card => {return card.id})
|
let id = Math.max(...indexes, 0) + 1
|
|
_columns.forEach(item => {
|
if (item.selected) {
|
let newcard = {
|
id: id,
|
uuid: Utils.getuuid(),
|
label: item.label,
|
field: item.field,
|
initval: '',
|
type: item.type,
|
resourceType: '0',
|
setAll: 'false',
|
options: [],
|
dataSource: '',
|
linkField: '',
|
valueField: '',
|
valueText: '',
|
orderBy: '',
|
orderType: 'asc',
|
}
|
|
items.push(newcard)
|
id++
|
}
|
})
|
|
_config.fields = items
|
|
this.setState({
|
tableVisible: false,
|
loading: true,
|
config: _config
|
}, () => {
|
this.setState({
|
loading: false
|
})
|
})
|
}
|
|
onTableChange = (value) => {
|
const {tables, selectedTables, tableColumns} = this.state
|
|
let _table = tables.filter(item => item.TbName === value)[0]
|
let isSelected = !!selectedTables.filter(cell => cell.TbName === value)[0]
|
if (!isSelected) {
|
this.setState({
|
selectedTables: [...selectedTables, _table]
|
})
|
Api.getSystemConfig({func: 'sPC_Get_FieldName', TBName: value}).then(res => {
|
if (res.status) {
|
let tabmsg = {
|
tableName: _table.name,
|
columns: res.FDName.map(item => {
|
let _type = item.FieldType.toLowerCase()
|
let _decimal = 0
|
if (/^nvarchar/.test(_type)) {
|
_type = 'text'
|
} else if (/^int/.test(_type)) {
|
_type = 'number'
|
} else if (/^decimal/.test(_type)) {
|
_decimal = _type.split(',')[1]
|
_decimal = parseInt(_decimal)
|
_type = 'number'
|
} else if (/^datetime/.test(_type)) {
|
_type = 'datetime'
|
} else if (/^date/.test(_type)) {
|
_type = 'date'
|
} else {
|
_type = 'text'
|
}
|
|
return {
|
field: item.FieldName,
|
label: item.FieldDec,
|
type: _type,
|
decimal: _decimal
|
}
|
})
|
}
|
this.setState({
|
tableColumns: [...tableColumns, tabmsg]
|
})
|
} else {
|
notification.warning({
|
top: 92,
|
message: res.message,
|
duration: 10
|
})
|
}
|
})
|
}
|
}
|
|
deleteTable = (table) => {
|
const {selectedTables, tableColumns} = this.state
|
|
this.setState({
|
selectedTables: selectedTables.filter(item => item.name !== table.name),
|
tableColumns: tableColumns.filter(item => item.tableName !== table.name)
|
})
|
}
|
|
changeSetting = () => {
|
this.setState({
|
settingVisible: true
|
})
|
}
|
|
settingSave = () => {
|
const {config} = this.state
|
this.settingRef.handleConfirm().then(res => {
|
this.setState({
|
config: {...config, setting: res},
|
settingVisible: false
|
})
|
})
|
}
|
|
render () {
|
const { config } = this.state
|
|
return (
|
<div className="modal-form-board">
|
<DndProvider backend={HTML5Backend}>
|
<div className="tools">
|
<Collapse accordion defaultActiveKey="0" bordered={false}>
|
<Panel header="基本信息" key="0" id="modal-basedata">
|
<MenuForm
|
dict={this.state.dict}
|
formlist={this.state.modalformlist}
|
wrappedComponentRef={(inst) => this.menuformRef = inst}
|
/>
|
<MenuForm
|
dict={this.state.dict}
|
formlist={this.state.modalformlist}
|
wrappedComponentRef={(inst) => this.menuformRef = inst}
|
/>
|
<div className="ant-col ant-form-item-label">
|
<label title="添加表名">添加表名</label>
|
</div>
|
<Select
|
showSearch
|
className="tables"
|
style={{ width: '100%' }}
|
optionFilterProp="children"
|
value={'请选择表名'}
|
onChange={this.onTableChange}
|
showArrow={false}
|
getPopupContainer={() => document.getElementById('modal-basedata')}
|
filterOption={(input, option) => {
|
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
}}
|
>
|
{this.state.tables.map((table, index) => (
|
<Option key={index} value={table.TbName}>{table.Remark}</Option>
|
))}
|
</Select>
|
{this.state.selectedTables.length > 0 && <List
|
size="small"
|
bordered
|
dataSource={this.state.selectedTables}
|
renderItem={(item, index) => <List.Item key={index} title={item.Remark + ' (' + item.TbName + ')'}>
|
{item.Remark + ' (' + item.TbName + ')'}
|
<Icon type="close" onClick={() => this.deleteTable(item)}/>
|
<div className="bottom-mask"></div>
|
</List.Item>}
|
/>}
|
</Panel>
|
<Panel header="表单" key="1">
|
<div className="search-element">
|
{Source.searchItems.map((item, index) => {
|
return (<SourceElement key={index} content={item}/>)
|
})}
|
</div>
|
<Button type="primary" block onClick={() => this.queryField()}>添加表单</Button>
|
</Panel>
|
</Collapse>
|
</div>
|
<div className="setting">
|
<Card title="表单配置" bordered={false} extra={
|
<div>
|
<Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['header.save']}</Button>
|
<Button onClick={this.cancelConfig}>{this.state.dict['header.return']}</Button>
|
</div>
|
} style={{ width: '100%' }}>
|
<Icon type="setting" onClick={this.changeSetting} />
|
<div className="ant-modal-content" style={{width: config.setting.width + '%'}}>
|
<button type="button" className="ant-modal-close">
|
<span className="ant-modal-close-x"><Icon type="close"/></span>
|
</button>
|
<div className="ant-modal-header">
|
<div className="ant-modal-title">{config.setting.title}</div>
|
</div>
|
<div className="ant-modal-body">
|
<div className="modal-form">
|
{!this.state.loading ?
|
<DragElement
|
list={config.fields}
|
setting={config.setting}
|
placeholder={this.state.dict['header.form.modal.placeholder']}
|
handleList={this.handleList}
|
handleForm={this.handleForm}
|
closeForm={this.closeForm}
|
/> : null
|
}
|
</div>
|
</div>
|
<div className="ant-modal-footer">
|
<div>
|
<button type="button" className="ant-btn"><span>取 消</span></button>
|
<button type="button" className="ant-btn ant-btn-primary"><span>确 定</span></button>
|
</div>
|
<div className="action-mask"></div>
|
</div>
|
</div>
|
</Card>
|
</div>
|
</DndProvider>
|
<Modal
|
title={this.state.dict['header.edit']}
|
visible={this.state.visible}
|
width={700}
|
onCancel={() => {
|
this.setState({
|
visible: false
|
})
|
}}
|
onOk={this.handleSubmit}
|
destroyOnClose
|
>
|
{<ModalForm
|
dict={this.state.dict}
|
formlist={this.state.formlist}
|
card={this.state.card}
|
wrappedComponentRef={(inst) => this.formRef = inst}
|
/>}
|
</Modal>
|
<Modal
|
title={this.state.dict['header.edit']}
|
visible={this.state.tableVisible}
|
width={'65vw'}
|
style={{minWidth: '900px', maxWidth: '1200px'}}
|
onOk={this.addFieldSubmit}
|
onCancel={() => {
|
this.setState({
|
tableVisible: false
|
})
|
}}
|
destroyOnClose
|
>
|
{this.state.fields && this.state.fields.length > 0 ?
|
<EditCard data={this.state.fields} ref="searchcard" type="search" /> : null
|
}
|
{(!this.state.fields || this.state.fields.length === 0) &&
|
<Empty />
|
}
|
</Modal>
|
<Modal
|
title={this.state.dict['header.edit']}
|
visible={this.state.settingVisible}
|
width={700}
|
onOk={this.settingSave}
|
onCancel={() => {
|
this.setState({
|
settingVisible: false
|
})
|
}}
|
destroyOnClose
|
>
|
<SettingForm
|
data={config.setting}
|
dict={this.state.dict}
|
wrappedComponentRef={(inst) => this.settingRef = inst}
|
/>
|
</Modal>
|
<Modal
|
bodyStyle={{textAlign: 'center', color: '#000000', fontSize: '16px'}}
|
closable={false}
|
visible={this.state.closeVisible}
|
onCancel={() => { this.setState({closeVisible: false}) }}
|
footer={[
|
<Button key="save" className="mk-btn mk-green" onClick={this.submitConfig}>{this.state.dict['header.save']}</Button>,
|
<Button key="confirm" className="mk-btn mk-yellow" onClick={() => {this.props.handleConfig('')}}>{this.state.dict['header.notsave']}</Button>,
|
<Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{this.state.dict['header.cancel']}</Button>
|
]}
|
destroyOnClose
|
>
|
菜单配置已修改,是否保存配置信息?
|
</Modal>
|
</div>
|
)
|
}
|
}
|
|
export default ComTableConfig
|