| | |
| | | tabview: _tabview |
| | | } |
| | | |
| | | this.state.copyActions.forEach(item => { |
| | | let _param = { |
| | | func: 'sPC_MainMenu_Del', |
| | | MenuID: item |
| | | } |
| | | Api.getSystemConfig(_param) |
| | | }) |
| | | |
| | | this.props.handleView(param) |
| | | } |
| | | |
| | |
| | | Template: 'SubTable', |
| | | PageParam: '', |
| | | LongParam: '', |
| | | LText: config.action.map((item, index) => { |
| | | return `select '${item.uuid}' as menuid, '${item.label}' as menuname, '${(index + 1) * 10}' as Sort` |
| | | }) |
| | | LText: [] |
| | | } |
| | | |
| | | let btntabs = [] |
| | | |
| | | config.action.forEach((item, index) => { |
| | | if (item.OpenType === 'popview') { |
| | | btntabs.push(`select '${item.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${(index + 1) * 10}' as Sort`) |
| | | } else { |
| | | btnParam.LText.push(`select '${item.uuid}' as menuid, '${item.label}' as menuname, '${(index + 1) * 10}' as Sort`) |
| | | } |
| | | }) |
| | | |
| | | btnParam.LText = btnParam.LText.join(' union all ') |
| | | btnParam.LText = Utils.formatOptions(btnParam.LText) |
| | | btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp) |
| | | |
| | | let tabParam = { // 添加标签按钮tab页 |
| | | func: 'sPC_sMenusTab_AddUpt', |
| | | MenuID: _config.uuid, |
| | | LText: btntabs.join(' union all ') |
| | | } |
| | | |
| | | tabParam.LText = Utils.formatOptions(tabParam.LText) |
| | | tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp) |
| | | |
| | | let param = { |
| | | func: 'sPC_Tab_AddUpt', |
| | |
| | | menuloading: false, |
| | | menucloseloading: false |
| | | }) |
| | | this.submitAction(btnParam) |
| | | this.submitAction(btnParam, tabParam) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | |
| | | /** |
| | | * @description 保存或修改菜单按钮 |
| | | */ |
| | | submitAction = (param) => { |
| | | submitAction = (btnParam, tabParam) => { |
| | | const { config } = this.state |
| | | |
| | | new Promise(resolve => { |
| | | if (param.LText) { |
| | | Api.getSystemConfig(param).then(res => { |
| | | if (res.status) { |
| | | resolve(true) |
| | | } else { |
| | | let deffers = [] |
| | | |
| | | if (tabParam.LText) { |
| | | let defer = new Promise(resolve => { |
| | | Api.getSystemConfig(tabParam).then(result => { |
| | | resolve(result) |
| | | }) |
| | | }) |
| | | deffers.push(defer) |
| | | } |
| | | |
| | | if (btnParam.LText) { |
| | | let defer = new Promise(resolve => { |
| | | Api.getSystemConfig(btnParam).then(result => { |
| | | if (result.status) { |
| | | this.setState({ // 保存成功后清空复制列表 |
| | | copyActions: [] |
| | | }) |
| | | } |
| | | resolve(result) |
| | | }) |
| | | }) |
| | | deffers.push(defer) |
| | | } |
| | | |
| | | if (deffers.length === 0) { |
| | | resolve(true) |
| | | } else { |
| | | Promise.all(deffers).then(result => { |
| | | let error = false |
| | | result.forEach(res => { |
| | | if (!res.status) { |
| | | error = res |
| | | } |
| | | }) |
| | | |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | message: error.message, |
| | | duration: 10 |
| | | }) |
| | | resolve(false) |
| | | } else { |
| | | resolve(true) |
| | | } |
| | | }) |
| | | } else { |
| | | resolve(true) |
| | | } |
| | | }).then(response => { |
| | | if (response === false) return response |