| | |
| | | class ComTableConfig extends Component { |
| | | static propTpyes = { |
| | | menu: PropTypes.any, |
| | | optionLibs: PropTypes.any, |
| | | supMenuList: PropTypes.array, |
| | | reloadmenu: PropTypes.func, |
| | | handleView: PropTypes.func |
| | |
| | | funcLoading: false, // 存储过程创建中 |
| | | showColumnName: false, // 显示列字段名控制 |
| | | tabviews: [], // 所有标签页 |
| | | profileVisible: false // 验证信息模态框 |
| | | profileVisible: false, // 验证信息模态框 |
| | | optionLibs: null // 自定义下拉选项库 |
| | | } |
| | | |
| | | /** |
| | |
| | | * 2、设置操作类型、原始菜单信息(每次保存后重置)、已使用表及基本信息表单 |
| | | */ |
| | | UNSAFE_componentWillMount () { |
| | | const { menu } = this.props |
| | | const { menu, optionLibs } = this.props |
| | | |
| | | let _LongParam = menu.LongParam |
| | | let _config = '' |
| | |
| | | _config.isAdd = true |
| | | } else { |
| | | _config = _LongParam |
| | | _config.search.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: menu.MenuName, |
| | | type: 'search', |
| | | options: item.options |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 配置默认值,兼容 |
| | |
| | | |
| | | this.setState({ |
| | | config: _config, |
| | | optionLibs: optionLibs, |
| | | originActions: _oriActions, |
| | | originMenu: JSON.parse(JSON.stringify(menu)), |
| | | selectedTables: _config.tables || [], |
| | |
| | | */ |
| | | handleSubmit = () => { |
| | | const { menu } = this.props |
| | | const { config, card, modaltype } = this.state |
| | | const { config, card, modaltype, optionLibs } = this.state |
| | | |
| | | if (modaltype === 'search') { |
| | | this.searchFormRef.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: menu.MenuName, |
| | | type: 'search', |
| | | options: res.options |
| | | }) |
| | | } |
| | | |
| | | let _search = config.search.map(item => { |
| | | if (item.uuid === res.uuid) { |
| | | return res |
| | |
| | | |
| | | this.setState({ |
| | | config: {...config, search: _search}, |
| | | 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 = { |
| | |
| | | */ |
| | | setSubConfig = (item, type) => { |
| | | const { menu } = this.props |
| | | const { config, originMenu } = this.state |
| | | const { config, originMenu, optionLibs } = this.state |
| | | |
| | | if (!originMenu.MenuID) { // menuID不存在时,为新建菜单,提示菜单尚未保存 |
| | | notification.warning({ |
| | |
| | | } |
| | | |
| | | let param = { |
| | | optionLibs: optionLibs, |
| | | editMenu: _originMenu, |
| | | editTab: !isbutton ? item : '', |
| | | tabConfig: null, |
| | |
| | | <SearchForm |
| | | dict={this.state.dict} |
| | | card={this.state.card} |
| | | optionLibs={this.state.optionLibs} |
| | | formlist={this.state.formlist} |
| | | wrappedComponentRef={(inst) => this.searchFormRef = inst} |
| | | /> |