From 3c053bb854b245e9b3e0b22677bef9589708262e Mon Sep 17 00:00:00 2001 From: alan Date: Wed, 12 Jun 2019 09:50:33 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BF=AE=E6=AD=A3=E4=B8=8D?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E7=9A=84=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/service/dialog.service.ts | 37 +++++++++++----------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/src/shared/service/dialog.service.ts b/src/shared/service/dialog.service.ts index c7ddb77..0ada72a 100644 --- a/src/shared/service/dialog.service.ts +++ b/src/shared/service/dialog.service.ts @@ -131,17 +131,16 @@ class Dialog { } public linkFail(text: string, more: string, cb?: Function): string { - let dialogPopover = null; let dialogMore = null; + let showErrMessage = false; const id = BI.UUID(); - const that = this; const body = { type: Vertical, items: [ { - type: 'bi.center_adapt', + type: CenterAdapt, cls: 'bi-card', - tgap: 10, + vgap: 10, items: [ { type: Vertical, @@ -160,7 +159,6 @@ class Dialog { }, { type: VerticalAdapt, - cls: 'buttons', hgap: 5, items: [ { @@ -168,27 +166,24 @@ class Dialog { text: BI.i18nText('Dec-Dcm_Connection_Detailed_Information'), level: 'ignore', handler() { - const isHide = !dialogMore.isVisible(); - dialogPopover.element.css({ - height: isHide ? '290' : '220', - }); - dialogMore.setVisible(isHide); - this.setText(isHide ? BI.i18nText('Dec-Dcm_Connection_Handup_Information') : BI.i18nText('Dec-Dcm_Connection_Detailed_Information')); + showErrMessage = !showErrMessage; + dialogMore.setVisible(showErrMessage); + this.setText(showErrMessage ? BI.i18nText('Dec-Dcm_Connection_Handup_Information') : BI.i18nText('Dec-Dcm_Connection_Detailed_Information')); }, }, { type: Button, text: BI.i18nText('Dec-Dcm_Back'), level: 'ignore', - handler() { - that.remove(id); + handler: () => { + this.remove(id); }, }, { type: Button, text: BI.i18nText('Dec-Dcm_Connection_ReConnect'), - handler() { - that.close(id); + handler: () => { + this.remove(id); cb ? cb() : null; }, }, @@ -202,10 +197,12 @@ class Dialog { type: Label, cls: 'bi-header-background', text: more, - invisible: true, + invisible: !showErrMessage, + textAlign: 'left', height: 73, width: 400, - value: false, + vgap: 10, + lgap: 5, ref: _ref => { dialogMore = _ref; }, @@ -219,14 +216,10 @@ class Dialog { cls: 'bi-z-index-mask', items: [{ el: { - type: 'bi.center_adapt', + type: CenterAdapt, cls: 'bi-card', width: 450, - height: 220, items: [body], - ref: _ref => { - dialogPopover = _ref; - }, }, }], },