| | |
| | | |
| | | return Promise.reject(response.data) |
| | | } else { |
| | | if (response.config.requestId) { |
| | | response.data.$requestId = response.config.requestId |
| | | } |
| | | return Promise.resolve(response.data) |
| | | } |
| | | }, (error) => { |
| | |
| | | * @description 获取业务通用接口 |
| | | * 访问 'https://sso.mk9h.cn/webapi/dostars'或云端时,传入userid、LoginUID |
| | | */ |
| | | genericInterface (param, script = '', position) { |
| | | genericInterface (param, script = '', position, requestId = '') { |
| | | param.userid = param.userid || sessionStorage.getItem('UserID') || '' |
| | | param.lang = param.lang || sessionStorage.getItem('lang') || '' |
| | | param.SessionUid = localStorage.getItem('SessionUid') || '' |
| | |
| | | return axios({ |
| | | url: `${url}${param.func ? '/' + param.func : ''}`, |
| | | method: 'post', |
| | | data: JSON.stringify(param) |
| | | data: JSON.stringify(param), |
| | | requestId |
| | | }) |
| | | } |
| | | } |
| | |
| | | let _orderBy = orderBy || config.setting.order || '' |
| | | let param = UtilsDM.getQueryDataParams(config.setting, searches, _orderBy, pageIndex, pageSize, BID) |
| | | |
| | | if (param.func === 'sPC_Get_TableData') { |
| | | this.requestId = param.timestamp |
| | | } |
| | | this.requestId = config.uuid + new Date().getTime() |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | let result = await Api.genericInterface(param, '', '', this.requestId) |
| | | if (result.status) { |
| | | if (result.timestamp_back && this.requestId !== result.timestamp_back) return |
| | | if (result.$requestId && this.requestId !== result.$requestId) return |
| | | |
| | | let start = 1 |
| | | if (config.setting.laypage) { |
| | |
| | | let _orderBy = orderBy || config.setting.order || '' |
| | | let param = UtilsDM.getQueryDataParams(config.setting, searches, _orderBy, pageIndex, pageSize, BID) |
| | | |
| | | if (param.func === 'sPC_Get_TableData') { |
| | | this.requestId = param.timestamp |
| | | } |
| | | this.requestId = config.uuid + new Date().getTime() |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | let result = await Api.genericInterface(param, '', '', this.requestId) |
| | | if (result.status) { |
| | | if (result.timestamp_back && this.requestId !== result.timestamp_back) return |
| | | if (result.$requestId && this.requestId !== result.$requestId) return |
| | | |
| | | let start = 1 |
| | | if (config.setting.laypage) { |
| | |
| | | this.setState({ |
| | | data: [], |
| | | selectedData: [], |
| | | loading: false, |
| | | total: 0 |
| | | }) |
| | | |
| | |
| | | let _orderBy = orderBy || setting.order |
| | | let param = UtilsDM.getQueryDataParams(setting, searches, _orderBy, pageIndex, pageSize, BID) |
| | | |
| | | if (param.func === 'sPC_Get_TableData') { |
| | | this.requestId = param.timestamp |
| | | } |
| | | this.requestId = config.uuid + new Date().getTime() |
| | | |
| | | let result = await Api.genericInterface(param, setting.js_script) |
| | | let result = await Api.genericInterface(param, setting.js_script, '', this.requestId) |
| | | if (result.status) { |
| | | if (result.timestamp_back && this.requestId !== result.timestamp_back) return |
| | | if (result.$requestId && this.requestId !== result.$requestId) return |
| | | |
| | | if (repage === 'false' && result.data && result.data.length === 0 && result.total > 0 && pageIndex > 1) { |
| | | let _pageIndex = Math.ceil(result.total / pageSize) |
| | |
| | | this.setState({ |
| | | data: [], |
| | | selectedData: [], |
| | | loading: false, |
| | | total: 0 |
| | | }) |
| | | reset && MKEmitter.emit('resetTable', config.uuid, 'true') // 列表重置 |
| | |
| | | let _orderBy = orderBy || setting.order |
| | | let param = UtilsDM.getQueryDataParams(setting, searches, _orderBy, pageIndex, pageSize, BID) |
| | | |
| | | if (param.func === 'sPC_Get_TableData') { |
| | | this.requestId = param.timestamp |
| | | } |
| | | this.requestId = config.uuid + new Date().getTime() |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | let result = await Api.genericInterface(param, '', '', this.requestId) |
| | | if (result.status) { |
| | | if (result.timestamp_back && this.requestId !== result.timestamp_back) return |
| | | if (result.$requestId && this.requestId !== result.$requestId) return |
| | | |
| | | reset && MKEmitter.emit('resetTable', config.uuid, repage) // 列表重置 |
| | | |
| | |
| | | this.setState({ |
| | | data: [], |
| | | selectedData: [], |
| | | loading: false, |
| | | total: 0 |
| | | }) |
| | | |
| | |
| | | let _orderBy = orderBy || setting.order |
| | | let param = UtilsDM.getQueryDataParams(setting, searches, _orderBy, pageIndex, pageSize, BID) |
| | | |
| | | if (param.func === 'sPC_Get_TableData') { |
| | | this.requestId = param.timestamp |
| | | } |
| | | this.requestId = config.uuid + new Date().getTime() |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | let result = await Api.genericInterface(param, '', '', this.requestId) |
| | | if (result.status) { |
| | | if (result.timestamp_back && this.requestId !== result.timestamp_back) return |
| | | if (result.$requestId && this.requestId !== result.$requestId) return |
| | | |
| | | this.loaded = true |
| | | if (config.$cache && type === 'init') { |