| | |
| | | class ComTableConfig extends Component { |
| | | static propTpyes = { |
| | | menu: PropTypes.any, |
| | | optionLibs: PropTypes.any, |
| | | btnTab: PropTypes.object, |
| | | config: PropTypes.any, |
| | | handleView: PropTypes.func |
| | |
| | | tabviews: [], // 所有标签页 |
| | | profileVisible: false, // 验证信息模态框 |
| | | editgroup: null, // 当前编辑组 |
| | | groupVisible: false // 编辑组模态框 |
| | | groupVisible: false, // 编辑组模态框 |
| | | optionLibs: null // 自定义下拉选项库 |
| | | } |
| | | |
| | | /** |
| | |
| | | * 2、设置操作类型、原始菜单信息(每次保存后重置)、已使用表及基本信息表单 |
| | | */ |
| | | UNSAFE_componentWillMount () { |
| | | const { menu, btnTab, config } = this.props |
| | | const { menu, btnTab, config, optionLibs } = this.props |
| | | |
| | | let _config = '' |
| | | let columns = [] |
| | |
| | | } |
| | | } else { |
| | | _config = config |
| | | |
| | | _config.groups.forEach(group => { |
| | | group.sublist.forEach(item => { |
| | | if ( |
| | | (item.type === 'select' || item.type === 'multiselect' || item.type === 'link') && |
| | | item.resourceType === '0' && |
| | | item.options && item.options.length > 0 |
| | | ) { |
| | | optionLibs.set(item.uuid, { |
| | | uuid: item.uuid, |
| | | label: item.label, |
| | | parname: btnTab.label, |
| | | type: 'Modal', |
| | | options: item.options |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | if (menu && menu.LongParam && menu.LongParam.columns) { |
| | |
| | | |
| | | this.setState({ |
| | | config: _config, |
| | | optionLibs: optionLibs, |
| | | columns: columns, |
| | | originMenu: JSON.parse(JSON.stringify(_config)), |
| | | selectedTables: _config.tables, |
| | |
| | | let _tabview = menu ? menu.LongParam.Template : '' |
| | | let param = { |
| | | editMenu: menu, |
| | | optionLibs: this.state.optionLibs, |
| | | editTab: null, |
| | | tabConfig: null, |
| | | editSubTab: null, |
| | |
| | | * 3、添加或编辑列,保存时,如按钮位置设置为表格,则修改操作列显示状态 |
| | | */ |
| | | handleSubmit = () => { |
| | | const { config, modaltype } = this.state |
| | | const { btnTab } = this.props |
| | | const { config, modaltype, optionLibs } = this.state |
| | | |
| | | if (modaltype === 'search') { |
| | | this.modalFormRef.handleConfirm().then(res => { |
| | | if ( // 更新下拉字典 |
| | | (res.type === 'select' || res.type === 'multiselect' || res.type === 'link') && |
| | | res.resourceType === '0' && |
| | | res.options && res.options.length > 0 |
| | | ) { |
| | | optionLibs.set(res.uuid, { |
| | | uuid: res.uuid, |
| | | label: res.label, |
| | | parname: btnTab.label, |
| | | type: 'Modal', |
| | | options: res.options |
| | | }) |
| | | } |
| | | let _groups = config.groups.map(group => { |
| | | group.sublist = group.sublist.map(item => { |
| | | if (item.uuid === res.uuid) { |
| | |
| | | |
| | | this.setState({ |
| | | config: {...config, groups: _groups}, |
| | | optionLibs: optionLibs, |
| | | modaltype: '' |
| | | }) |
| | | }) |
| | |
| | | return |
| | | } |
| | | |
| | | if (setting.dataresource.length > 50 && config.setting.dataresource !== setting.dataresource) { |
| | | if (/[^\s]+\s+[^\s]+/ig.test(setting.dataresource) && config.setting.dataresource !== setting.dataresource) { |
| | | let param = { |
| | | func: 's_DataSrc_Save', |
| | | LText: setting.dataresource, |
| | |
| | | if ( |
| | | res.interType === 'inner' && |
| | | !res.innerFunc && |
| | | res.dataresource.length > 50 && |
| | | /[^\s]+\s+[^\s]+/ig.test(res.dataresource) && |
| | | config.setting.dataresource !== res.dataresource |
| | | ) { |
| | | let param = { |
| | |
| | | |
| | | let param = { |
| | | editMenu: menu, |
| | | optionLibs: this.state.optionLibs, |
| | | editTab: btn, |
| | | tabConfig: null, |
| | | editSubTab: null, |
| | |
| | | dict={this.state.dict} |
| | | card={this.state.card} |
| | | formlist={this.state.formlist} |
| | | optionLibs={this.state.optionLibs} |
| | | wrappedComponentRef={(inst) => this.modalFormRef = inst} |
| | | /> |
| | | </Modal> |