Browse Source

Pull request #8955: REPORT-116621 fix: 【服务拆分】数据连接消息结构适配

Merge in DEC/decision-webui-dcm from ~AUSTIN.DUAN/decision-webui-dcm:research/11.0 to research/11.0

* commit 'db636f32ed211e88f1b7acf6675642113db5bd7f':
  REPORT-116621  fix: 【服务拆分】数据连接消息结构适配
research/11.0
Austin.Duan-段嗣跃 8 months ago
parent
commit
159428317b
  1. 12
      src/modules/crud/decision.api.ts

12
src/modules/crud/decision.api.ts

@ -66,9 +66,11 @@ export class DecisionApi implements Api {
return new Promise((resolve, rejected) => { return new Promise((resolve, rejected) => {
this.addEventListener(editStatusEvent.OPEN, res => { this.addEventListener(editStatusEvent.OPEN, res => {
if (res.errorCode) { const data = JSON.parse(res.data);
if (data.errorCode) {
let errorMessage = ''; let errorMessage = '';
switch (res.errorCode) { switch (data.errorCode) {
case errorCode.CONNECTION_DELETED: case errorCode.CONNECTION_DELETED:
errorMessage = 'Dec-Dcm_Connection_Deleted'; errorMessage = 'Dec-Dcm_Connection_Deleted';
break; break;
@ -76,13 +78,13 @@ export class DecisionApi implements Api {
errorMessage = 'Dec-Dcm_Connection_Is_Using'; errorMessage = 'Dec-Dcm_Connection_Is_Using';
break; break;
default: default:
errorMessage = res.errorMsg; errorMessage = data.errorMessage;
break; break;
} }
BI.Msg.toast(BI.i18nText(errorMessage, res.errorMsg), { BI.Msg.toast(BI.i18nText(errorMessage, data.errorMessage), {
level: 'error', level: 'error',
}); });
rejected(res); rejected(data);
} else { } else {
resolve(res); resolve(res);
} }

Loading…
Cancel
Save