From d8b3b81e3997b3c9c54a534a985a3d3b5bbfd933 Mon Sep 17 00:00:00 2001 From: dailer Date: Mon, 16 Aug 2021 15:08:25 +0800 Subject: [PATCH 1/5] =?UTF-8?q?DEC-19760=20feat:=20=E3=80=90BI=E9=85=8D?= =?UTF-8?q?=E5=90=88=E3=80=91=E9=A9=B1=E5=8A=A8=E7=AE=A1=E7=90=86,war?= =?UTF-8?q?=E5=8C=85=E9=83=A8=E7=BD=B2=E4=B8=8D=E6=94=AF=E6=8C=81=E6=8F=90?= =?UTF-8?q?=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../driverselector/driverselector.ts | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/modules/pages/maintain/components/driverselector/driverselector.ts b/src/modules/pages/maintain/components/driverselector/driverselector.ts index c155878..4382810 100644 --- a/src/modules/pages/maintain/components/driverselector/driverselector.ts +++ b/src/modules/pages/maintain/components/driverselector/driverselector.ts @@ -136,16 +136,25 @@ export class DriverSelector extends BI.Widget { }, }, { el: { - type: BI.Button.xtype, + type: 'dec.connection.driver.entry', ref: (_ref: Button) => { this.driverManageEntry = _ref; }, - level: 'ignore', - text: BI.i18nText('Dec-Dcm_Create_New_Driver'), - invisible: !this.model.driverManageEntryVisible, - handler: () => { - this.createDriverManagerLayer(); + el: { + type: BI.Button.xtype, + level: 'ignore', + text: BI.i18nText('Dec-Dcm_Create_New_Driver'), }, + from: '.dec-dcm', + invisible: !this.model.driverManageEntryVisible, + listeners: [ + { + eventName: 'EVENT_CLOSE', + action: () => { + this.store.initDriverClassList(BI.emptyFn); + }, + }, + ], }, }, ], From 11d8cea36be3af882c468ffea7728c26b9ce63cd Mon Sep 17 00:00:00 2001 From: dailer Date: Mon, 16 Aug 2021 17:02:11 +0800 Subject: [PATCH 2/5] =?UTF-8?q?DEC-20201=20fix:=20=E3=80=90=E8=BF=AD?= =?UTF-8?q?=E4=BB=A3=E3=80=91=E3=80=90=E9=A9=B1=E5=8A=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E3=80=91=E5=88=87=E6=8D=A2=E4=B8=BA=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=A9=B1=E5=8A=A8=EF=BC=8C=E5=B7=B2=E7=BB=8F=E5=A1=AB=E5=A5=BD?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E5=BA=93=E4=BF=A1=E6=81=AF=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../driverselector/driverselector.ts | 56 ++----------------- 1 file changed, 4 insertions(+), 52 deletions(-) diff --git a/src/modules/pages/maintain/components/driverselector/driverselector.ts b/src/modules/pages/maintain/components/driverselector/driverselector.ts index 4382810..0bb502c 100644 --- a/src/modules/pages/maintain/components/driverselector/driverselector.ts +++ b/src/modules/pages/maintain/components/driverselector/driverselector.ts @@ -76,12 +76,15 @@ export class DriverSelector extends BI.Widget { if (value === 'default') { this.defaultDrivers.setVisible(true); this.customDrivers.setVisible(false); - + this.fireEvent('EVENT_CHANGE'); return; } this.defaultDrivers.setVisible(false); this.customDrivers.setVisible(true); + if (BI.isKey(this.customDrivers.getValue()[0])) { + this.fireEvent('EVENT_CHANGE'); + } }, }, ], @@ -161,57 +164,6 @@ export class DriverSelector extends BI.Widget { }; } - private createDriverManagerLayer() { - const name = BI.UUID(); - - BI.Layers.create(name, '.dec-dcm', { - render: { - type: 'bi.vtape', - cls: 'bi-background', - items: [ - { - type: 'bi.vertical_adapt', - cls: 'bi-card', - items: [ - { - el: { - type: 'bi.icon_text_item', - text: BI.i18nText('Dec-Connection_Driver_Management_Exit'), - cls: 'back-font bi-high-light', - height: 24, - logic: { - dynamic: true, - }, - handler: () => { - this.store.initDriverClassList(() => BI.Layers.remove(name)); - }, - }, - hgap: 10, - }, - ], - height: 40, - }, { - el: { - type: 'dec.connection.driver', - listeners: [ - { - eventName: 'EVENT_CLOSE', - action() { - BI.Layers.remove(name); - }, - }, - ], - }, - hgap: 10, - vgap: 10, - }, - ], - }, - }); - - BI.Layers.show(name); - } - validation(): boolean { if (this.model.selectedDriverType === 'default' && BI.isKey(this.model.defaultDriver.driver)) { return true; From 8226d5ac15b4b96b8fd663674a1811226a421689 Mon Sep 17 00:00:00 2001 From: dailer Date: Mon, 16 Aug 2021 19:56:09 +0800 Subject: [PATCH 3/5] =?UTF-8?q?DEC-20235=20fix:=20=E3=80=90=E8=BF=AD?= =?UTF-8?q?=E4=BB=A3=E3=80=91=E3=80=90=E9=A9=B1=E5=8A=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E3=80=91=E6=96=B0=E5=BB=BA=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E8=87=AA=E5=AE=9A=E4=B9=89=E9=A9=B1=E5=8A=A8?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E6=B7=BB=E5=8A=A0=E9=A9=B1=E5=8A=A8?= =?UTF-8?q?=E5=86=8D=E9=80=80=E5=87=BA=EF=BC=8C=E6=89=80=E6=9C=89=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E9=80=89=E6=8B=A9=E9=A9=B1=E5=8A=A8=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E9=A9=B1=E5=8A=A8=E6=A0=87=E8=93=9D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/driverselector/driverselector.model.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/pages/maintain/components/driverselector/driverselector.model.ts b/src/modules/pages/maintain/components/driverselector/driverselector.model.ts index 77077ab..9b2fc3e 100644 --- a/src/modules/pages/maintain/components/driverselector/driverselector.model.ts +++ b/src/modules/pages/maintain/components/driverselector/driverselector.model.ts @@ -45,7 +45,9 @@ export class DriverSelectorModel extends Model { initDriverClassList: cb => { api.getSimpleDriverList().then(res => { - this.model.customDrivers = res.data; + this.model.customDrivers = res.data.filter(driver => { + return BI.isKey(driver.driverClass); + }); cb(); }); }, From c61dac179428975334bfa93bf05c988acfcb1ee1 Mon Sep 17 00:00:00 2001 From: dailer Date: Mon, 16 Aug 2021 20:21:14 +0800 Subject: [PATCH 4/5] =?UTF-8?q?DEC-20237=20fix:=20=E3=80=90=E8=BF=AD?= =?UTF-8?q?=E4=BB=A3=E3=80=91=E3=80=90=E9=A9=B1=E5=8A=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E3=80=91=E4=BD=BF=E7=94=A8=E6=9F=90=E4=B8=AA=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=A9=B1=E5=8A=A8=E6=96=B0=E5=BB=BA=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=EF=BC=8C=E4=B8=8B=E6=8B=89=E6=A1=86=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E5=90=8E=E5=86=8D=E6=AC=A1=E4=B8=8B=E6=8B=89=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9B=B8=E5=90=8C=E9=A9=B1=E5=8A=A8=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E7=9A=84=E6=89=80=E6=9C=89=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=A9=B1=E5=8A=A8=E9=83=BD=E4=BC=9A=E6=A0=87=E8=93=9D?= =?UTF-8?q?=E9=80=89=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../driverselector/driverselector.model.ts | 15 ++++++++++----- .../components/driverselector/driverselector.ts | 6 +++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/modules/pages/maintain/components/driverselector/driverselector.model.ts b/src/modules/pages/maintain/components/driverselector/driverselector.model.ts index 9b2fc3e..384e4f4 100644 --- a/src/modules/pages/maintain/components/driverselector/driverselector.model.ts +++ b/src/modules/pages/maintain/components/driverselector/driverselector.model.ts @@ -23,7 +23,7 @@ export class DriverSelectorModel extends Model { }, customDriver: { driver: driverSource !== '' ? selectedDriver : '', - text: driverSource !== '' ? `${this.options.driver} (${driverSource})` : '', + value: driverSource !== '' ? `${this.options.driver} (${driverSource})` : '', }, }; }; @@ -32,7 +32,8 @@ export class DriverSelectorModel extends Model { driverClassItems: () => this.model.customDrivers.map(driver => { return { text: `${driver.driverClass} (${driver.name})`, - value: driver.driverClass, + value: `${driver.driverClass} (${driver.name})`, + driverClass: driver.driverClass, }; }), @@ -57,14 +58,18 @@ export class DriverSelectorModel extends Model { this.model.driverSource = ''; }, - changeCustomDriver: driver => { - this.model.customDriver.driver = driver; + changeCustomDriver: value => { + const item = this.model.driverClassItems.find(item => { + return item.value === value; + }); + const driver = item.driverClass; + this.model.customDriver.driver = driver; this.model.customDrivers.some(customDriver => { if (customDriver.driverClass === driver) { this.model.driverSource = customDriver.name; - this.model.customDriver.text = `${driver} (${customDriver.name})`; + this.model.customDriver.value = `${driver} (${customDriver.name})`; return true; } diff --git a/src/modules/pages/maintain/components/driverselector/driverselector.ts b/src/modules/pages/maintain/components/driverselector/driverselector.ts index 0bb502c..896c157 100644 --- a/src/modules/pages/maintain/components/driverselector/driverselector.ts +++ b/src/modules/pages/maintain/components/driverselector/driverselector.ts @@ -37,7 +37,7 @@ export class DriverSelector extends BI.Widget { watch = { driverClassItems: items => { this.customDrivers.populate(items); - this.customDrivers.setValue(this.model.customDriver.driver); + this.customDrivers.setValue(this.model.customDriver.value); }, driverManageEntryVisible: b => { @@ -123,8 +123,8 @@ export class DriverSelector extends BI.Widget { width: 204, watermark: BI.i18nText('Dec-Please_Input'), items: this.model.driverClassItems, - value: this.model.customDriver.driver, - text: () => this.model.customDriver.text || '', + value: this.model.customDriver.value, + text: () => this.model.customDriver.value || '', defaultText: BI.i18nText('Dec-Please_Select'), warningTitle: BI.i18nText('Dec-Dcm-Driver_Driver_File_Lost'), listeners: [ From 02622eef5bb9b1461a2299f8de8a09f34b49cecd Mon Sep 17 00:00:00 2001 From: dailer Date: Wed, 18 Aug 2021 11:02:55 +0800 Subject: [PATCH 5/5] =?UTF-8?q?DEC-19760=20feat:=20=E3=80=90BI=E9=85=8D?= =?UTF-8?q?=E5=90=88=E3=80=91=E9=A9=B1=E5=8A=A8=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/connection/connection.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modules/pages/connection/connection.ts b/src/modules/pages/connection/connection.ts index 8094b8d..90f5ba1 100644 --- a/src/modules/pages/connection/connection.ts +++ b/src/modules/pages/connection/connection.ts @@ -81,6 +81,14 @@ export class Connection extends BI.Widget { type: 'dec.connection.driver.entry', invisible: !BI.Services.getService('dec.service.global').isAdmin(), from: '.dec-dcm', + listeners: [ + { + eventName: 'EVENT_CLOSE', + action: () => { + this.reset(); + }, + }, + ], }, ], },