| | |
| | | MenuType: '', |
| | | MenuId: '', |
| | | MenuNo: '', |
| | | tableFields: [], |
| | | delButtons: [], |
| | | activeKey: 'basedata', |
| | | menuloading: false, |
| | | oriConfig: null, |
| | | openEdition: '', |
| | | config: null, |
| | | customComponents: [] |
| | | } |
| | |
| | | return |
| | | } |
| | | |
| | | let _config = fromJS(config).toJS() |
| | | delete _config.tableFields |
| | | const _this = this |
| | | |
| | | if (!is(fromJS(oriConfig), fromJS(_config))) { |
| | | if (!is(fromJS(oriConfig), fromJS(config))) { |
| | | confirm({ |
| | | title: '配置已修改,放弃保存吗?', |
| | | content: '', |
| | |
| | | config.Template = 'CustomPage' |
| | | } |
| | | |
| | | config.open_edition = result.open_edition || '' |
| | | |
| | | this.setState({ |
| | | oriConfig: config, |
| | | config: fromJS(config).toJS(), |
| | | openEdition: result.open_edition || '', |
| | | config: fromJS(config).toJS() |
| | | }) |
| | | |
| | | this.props.modifyCustomMenu(config) |
| | |
| | | |
| | | submitConfig = () => { |
| | | const { btn } = this.props |
| | | const { openEdition, delButtons } = this.state |
| | | const { delButtons } = this.state |
| | | let config = fromJS(this.state.config).toJS() |
| | | |
| | | if ((config.cacheUseful === 'true' && !config.cacheTime) || !config.MenuNo || !config.MenuName) { |
| | |
| | | config.enabled = false |
| | | } |
| | | |
| | | let _config = fromJS(config).toJS() |
| | | delete _config.tableFields |
| | | |
| | | let _name = (btn.component.name ? btn.component.name + '-' : '') + btn.label |
| | | |
| | | let param = { |
| | | func: 'sPC_ButtonParam_AddUpt', |
| | | ParentID: btn.config.uuid, |
| | | MenuID: _config.uuid, |
| | | MenuNo: _config.MenuNo || '', |
| | | MenuID: config.uuid, |
| | | MenuNo: config.MenuNo || '', |
| | | Template: 'CustomPage', |
| | | MenuName: _name, |
| | | PageParam: JSON.stringify({Template: 'CustomPage'}), |
| | | LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(_config))) |
| | | } |
| | | |
| | | if (openEdition) { // 版本管理 |
| | | param.open_edition = openEdition |
| | | LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(config))), |
| | | open_edition: config.open_edition |
| | | } |
| | | |
| | | let btnParam = { // 添加菜单按钮 |
| | | func: 'sPC_Button_AddUpt', |
| | | Type: 60, // 添加菜单下的按钮type为40,按钮下的按钮type为60 |
| | | ParentID: _config.uuid, |
| | | MenuNo: _config.MenuNo, |
| | | ParentID: config.uuid, |
| | | MenuNo: config.MenuNo, |
| | | Template: 'CustomPage', |
| | | PageParam: '', |
| | | LongParam: '', |
| | |
| | | if (!res) return |
| | | |
| | | if (res.status) { |
| | | config.open_edition = res.open_edition || '' |
| | | |
| | | this.setState({ |
| | | oriConfig: fromJS(_config).toJS(), |
| | | openEdition: res.open_edition || '' |
| | | oriConfig: fromJS(config).toJS() |
| | | }) |
| | | |
| | | if (btnParam.LText) { |
| | |
| | | /** |
| | | * @description 更新常用表信息,快捷添加后更新配置信息 |
| | | */ |
| | | updatetable = (config, fields) => { |
| | | const { tableFields } = this.state |
| | | |
| | | config.tableFields = fields ? fields : tableFields |
| | | |
| | | this.setState({ |
| | | tableFields: fields ? fields : tableFields, |
| | | config |
| | | }) |
| | | updatetable = (config) => { |
| | | this.setState({ config }) |
| | | |
| | | this.props.modifyCustomMenu(config) |
| | | } |