diff --git a/i18n/zh_cn.properties b/i18n/zh_cn.properties index f436552..f1136e2 100644 --- a/i18n/zh_cn.properties +++ b/i18n/zh_cn.properties @@ -101,6 +101,7 @@ Dec-Dcm_Connection_JDBC_Other=其他JDBC Dec-Dcm_Connection_JDBC_Warning= 请确认已经将krb5.Conf文件添加到/webapps/webroot/WEB_INF/resources目录 Dec-Dcm_Connection_Form_UserName_Password= 用户名密码 Dec-Dcm_Change_Name= 重命名 +Dec-Dcm_Socket_Unable_Connect= Socket未连接,可能存在多人同时编辑造成冲突,相关端口可能未开放 BI-Multi_Date_Quarter_End= 季度末 BI-Multi_Date_Month_Begin= 月初 diff --git a/private/i18n.ts b/private/i18n.ts index 8a5abbb..15589b4 100644 --- a/private/i18n.ts +++ b/private/i18n.ts @@ -100,6 +100,7 @@ export default { 'Dec-Dcm_Connection_JDBC_Warning': '请确认已经将krb5.Conf文件添加到/webapps/webroot/WEB_INF/resources目录', 'Dec-Dcm_Connection_Form_UserName_Password': '用户名密码', 'Dec-Dcm_Change_Name': '重命名', + 'Dec-Dcm_Socket_Unable_Connect': 'Socket未连接,可能存在多人同时编辑造成冲突,相关端口可能未开放', 'BI-Multi_Date_Quarter_End': '季度末', 'BI-Multi_Date_Month_Begin': '月初', 'BI-Multi_Date_YMD': '年月日', diff --git a/src/modules/crud/api.ts b/src/modules/crud/api.ts index f8628ac..aafe39a 100644 --- a/src/modules/crud/api.ts +++ b/src/modules/crud/api.ts @@ -51,4 +51,9 @@ export interface Api { * @param name */ shutdownConnectionStatus(name: string): Promise; + + /** + * 获取socket连接状态 + */ + getSocketStatus(): boolean; } diff --git a/src/modules/crud/decision.api.ts b/src/modules/crud/decision.api.ts index 072c996..ba31495 100644 --- a/src/modules/crud/decision.api.ts +++ b/src/modules/crud/decision.api.ts @@ -57,6 +57,14 @@ export class DecisionApi implements Api { return this.sendEditStatusEvent(name, editStatusEvent.SHUTDOWN); } + getSocketStatus(): boolean { + if (Dec) { + return Dec.socket.connected; + } + + return false; + } + private sendEditStatusEvent(name: string, type: string): Promise { return new Promise(resolve => { if (Dec && Dec.socket.connected) { diff --git a/src/modules/crud/design.api.ts b/src/modules/crud/design.api.ts index a4e5609..33a77ad 100644 --- a/src/modules/crud/design.api.ts +++ b/src/modules/crud/design.api.ts @@ -56,4 +56,9 @@ export class DesignApi implements Api { resolve({ data: 'success' }); }); } + + getSocketStatus() { + // 设计器无socket校验 + return true; + } } diff --git a/src/modules/pages/maintain/maintain.ts b/src/modules/pages/maintain/maintain.ts index 713fd09..3980102 100644 --- a/src/modules/pages/maintain/maintain.ts +++ b/src/modules/pages/maintain/maintain.ts @@ -3,6 +3,8 @@ import { shortcut, store } from '@core/core'; import { MaintainModel, MaintainModelXtype } from './maintain.model'; import { MaintainFormXtype } from './forms/form'; import { PAGE_INDEX } from '@constants/constant'; +import { ApiFactory } from 'src/modules/crud/apiFactory'; +const api = new ApiFactory().create(); import './maintain.less'; export const MaintainXtype = 'dec.dcm.maintain'; @@ -53,6 +55,14 @@ export class Maintain extends BI.Widget { }; } + mounted() { + if (!api.getSocketStatus()) { + BI.Msg.toast(BI.i18nText('Dec-Dcm_Socket_Unable_Connect'), { + level: 'warning', + }); + } + } + private renderItems() { const { type } = this.getEditConnection();