| | |
| | | } |
| | | |
| | | let _param = { |
| | | funcName: btn.innerFunc, |
| | | name: _config.setting.tableName || '', |
| | | fields: fields |
| | | fields: fields, |
| | | menuNo: this.props.menu.MenuNo |
| | | } |
| | | LText = Utils.formatOptions(Utils.getfunc(_param)) |
| | | DelText = Utils.formatOptions(Utils.dropfunc(_param.name)) |
| | | DelText = Utils.formatOptions(Utils.dropfunc(_param.funcName)) |
| | | resolve(true) |
| | | } else { |
| | | resolve(false) |
| | |
| | | }) |
| | | } else { |
| | | let _param = { |
| | | funcName: btn.innerFunc, |
| | | name: _config.setting.tableName || '', |
| | | fields: '' |
| | | fields: '', |
| | | menuNo: this.props.menu.MenuNo |
| | | } |
| | | LText = Utils.formatOptions(Utils.getfunc(_param)) |
| | | DelText = Utils.formatOptions(Utils.dropfunc(_param.name)) |
| | | DelText = Utils.formatOptions(Utils.dropfunc(_param.funcName)) |
| | | resolve(true) |
| | | } |
| | | }).then(res => { |
| | |
| | | } |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) |
| | | return Api.getSystemConfig(_param) |
| | | }).then(res => { |
| | | console.log(res) |
| | | if (res === false) return res |
| | | |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | return false |
| | | } else { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '创建成功', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | return Api.getSystemConfig(_param) |
| | | }).then(res => { |
| | | console.log(res) |
| | | if (res === false) return res |
| | |
| | | |
| | | let isupdate = false |
| | | _config.action = _config.action.map(item => { |
| | | if (item.uuid === res.values.uuid) { |
| | | if (item.uuid === btn.uuid) { |
| | | isupdate = true |
| | | return res.values |
| | | return btn |
| | | } else { |
| | | return item |
| | | } |
| | |
| | | |
| | | |
| | | if (!isupdate) { // 操作不是修改,添加元素至列表 |
| | | _config.action.push(res.values) |
| | | _config.action.push(btn) |
| | | } |
| | | |
| | | let gridbtn = _config.action.filter(act => act.position === 'grid') |
| | |
| | | const { config } = this.state |
| | | new Promise(resolve => { |
| | | // 内部请求 |
| | | Api.getSystemConfig(param).then(response => { |
| | | if (response.status) { |
| | | resolve('true') |
| | | } else { |
| | | resolve(response) |
| | | } |
| | | }) |
| | | if (param.LText) { |
| | | Api.getSystemConfig(param).then(response => { |
| | | if (response.status) { |
| | | resolve('true') |
| | | } else { |
| | | resolve(response) |
| | | } |
| | | }) |
| | | } else { |
| | | resolve('true') |
| | | } |
| | | }).then(res => { |
| | | console.log(res) |
| | | if (res === 'true' && this.state.delActions.length > 0) { |