From 160664bb9a259098c15ff81e907acd2dff632c54 Mon Sep 17 00:00:00 2001 From: alan Date: Fri, 17 May 2019 09:58:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.component.scss | 11 +++++++++++ src/app/title/title.component.ts | 33 ++++++++++++++++++++++++------- src/img/icon_close9x9_normal.png | Bin 0 -> 260 bytes src/shared/crud/crud.request.ts | 22 +++++++++++++++++++++ tsconfig.json | 2 +- types/globals.d.ts | 1 + 6 files changed, 61 insertions(+), 8 deletions(-) create mode 100644 src/img/icon_close9x9_normal.png diff --git a/src/app/app.component.scss b/src/app/app.component.scss index 41b53cb..c6374ff 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -19,6 +19,17 @@ font-weight: 700; cursor: pointer; } + .close-button { + position: absolute !important; + right: 5px; + top: 5px; + width: 30px; + height: 30px; + cursor: pointer; + background-image: url("../img/icon_close9x9_normal.png"); + background-repeat: no-repeat; + background-position: center; + } } .linkset{ margin: 10px; diff --git a/src/app/title/title.component.ts b/src/app/title/title.component.ts index 3e0a792..3aaa127 100644 --- a/src/app/title/title.component.ts +++ b/src/app/title/title.component.ts @@ -1,5 +1,6 @@ -import {Left, WidgetType} from '@ui/index'; +import {Left, WidgetType, IconButton} from '@ui/index'; import TitleItem from './title_item/title_item.component'; +import {isDesigner, closeWindow} from '@shared/crud/crud.request'; const tabs = ['数据连接管理', '连接池状态']; const className = 'fr.title'; const Widget: WidgetType = { @@ -7,14 +8,32 @@ const Widget: WidgetType = { return { type: Left, cls: 'title', - items: BI.map(tabs, (index: number, text: string) => { - return { - type: TitleItem, - text, - }; - }), + items: [ + ...BI.map(tabs, (index: number, text: string) => { + return { + type: TitleItem, + text, + }; + }), + { + type:IconButton, + cls:'close-button', + handler() { + closeWindow(); + }, + invisible: true, + ref: _ref => { + this.CloseButton = _ref; + }, + }, + ], }; }, + mounted() { + if (isDesigner()) { + this.CloseButton.setVisible(true); + } + }, }; BI.shortcut(className, BI.inherit(BI.Widget, Widget)); diff --git a/src/img/icon_close9x9_normal.png b/src/img/icon_close9x9_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..198afc837cb3405dc357f21aa86f49b3cf70c21d GIT binary patch literal 260 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>3?#4ne^UZd-T^)#u0Xnf|NBYXK2P8IdGfBW zQ?`DevIE4Pw)5+h?Vo{cIGVf@$o?{A$EPXVKTQEDMv?-m`Tzg_y^l}!0*w