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

Loading…
Cancel
Save