| | |
| | | } |
| | | } |
| | | |
| | | loadOutResource = (params) => { |
| | | let setting = params.shift() |
| | | loadOutResource = (inters) => { |
| | | let setting = inters.shift() |
| | | let param = UtilsDM.getPrevQueryParams(setting, [], this.state.BID, this.props.menuType) |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | if (res.mk_ex_invoke === 'false') { |
| | | if (params.length > 0) { |
| | | this.loadOutResource(params) |
| | | if (inters.length > 0) { |
| | | this.loadOutResource(inters) |
| | | } |
| | | } else { |
| | | this.customOuterRequest(res, setting, params) |
| | | this.customOuterRequest(res, setting, inters) |
| | | } |
| | | } else { |
| | | notification.error({ |
| | |
| | | }) |
| | | } |
| | | |
| | | customOuterRequest = (result, setting, params) => { |
| | | customOuterRequest = (result, setting, inters) => { |
| | | let url = '' |
| | | |
| | | if (window.GLOB.systemType === 'production') { |
| | |
| | | $ErrMesg: error |
| | | } |
| | | |
| | | this.customCallbackRequest(_result, setting, params) |
| | | this.customCallbackRequest(_result, setting, inters) |
| | | } else { |
| | | res.mk_api_key = mkey |
| | | this.customCallbackRequest(res, setting, params) |
| | | this.customCallbackRequest(res, setting, inters) |
| | | } |
| | | }, (e) => { |
| | | let _result = { |
| | |
| | | $ErrMesg: e && e.statusText ? e.statusText : '' |
| | | } |
| | | |
| | | this.customCallbackRequest(_result, setting, params) |
| | | this.customCallbackRequest(_result, setting, inters) |
| | | }) |
| | | } |
| | | |
| | | customCallbackRequest = (result, setting, params) => { |
| | | customCallbackRequest = (result, setting, inters) => { |
| | | let errSql = '' |
| | | if (result.$ErrCode === 'E') { |
| | | errSql = ` |
| | |
| | | } else { |
| | | param.func = 's_ex_result_back' |
| | | param.s_ex_result = lines.map((item, index) => ({ |
| | | MenuID: this.props.MenuID, |
| | | MenuName: this.props.MenuName, |
| | | MenuID: this.props.MenuID || '', |
| | | MenuName: this.props.MenuName || '', |
| | | TableName: item.table, |
| | | LongText: window.btoa(window.encodeURIComponent(`${item.insert} ${item.selects.join(` union all `)}`)), |
| | | Sort: index + 1 |
| | |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | if (params.length > 0) { |
| | | this.loadOutResource(params) |
| | | if (inters.length > 0) { |
| | | this.loadOutResource(inters) |
| | | } |
| | | } else { |
| | | notification.error({ |