From 02ac99e30410e1ad90b2dcf1b5a0f577421a9e9c Mon Sep 17 00:00:00 2001 From: alan Date: Thu, 19 Sep 2019 16:53:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20DEC-9802=20=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E6=97=B6=EF=BC=8C=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E4=B9=8B=E5=89=8D=E7=9A=84id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/crud/decision.api.ts | 2 +- src/modules/pages/maintain/forms/form.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/crud/decision.api.ts b/src/modules/crud/decision.api.ts index 1bf5e55..49f0f64 100644 --- a/src/modules/crud/decision.api.ts +++ b/src/modules/crud/decision.api.ts @@ -19,7 +19,7 @@ export class DecisionApi implements Api { addConnection(data: Connection) { const form = { ...data, - connectionId: data.connectionName, + connectionId: data.connectionId || data.connectionName, connectionData : JSON.stringify(data.connectionData), }; diff --git a/src/modules/pages/maintain/forms/form.ts b/src/modules/pages/maintain/forms/form.ts index 3e9feaf..54f38c7 100644 --- a/src/modules/pages/maintain/forms/form.ts +++ b/src/modules/pages/maintain/forms/form.ts @@ -33,7 +33,9 @@ export class MaintainForm extends BI.Widget { if (this.connectionName && !this.model.isCopy) { this.store.updateConnection(this.connectionName, this.form.getSubmitValue()); } else { - this.store.addConnection(this.form.getSubmitValue()); + const form = this.form.getSubmitValue(); + form.connectionId = this.connectionName; + this.store.addConnection(form); } this.store.setIsCopy(false); }, @@ -44,7 +46,7 @@ export class MaintainForm extends BI.Widget { const id = BI.UUID(); const testConnection = () => { const formValue = this.form.getSubmitValue(); - if (this.isEdit) { + if (this.isEdit || this.model.isCopy) { formValue.connectionId = this.connectionName; } this.store.testConnection(formValue).then(re => { @@ -118,7 +120,6 @@ export class MaintainForm extends BI.Widget { if (this.model.isCopy) { formData.connectionName = `${formData.connectionName}-${BI.i18nText('Dec-Dcm_Copy')}`; this.isEdit = false; - this.connectionName = ''; } return { From 5fe5945368e675609e84ffbafea9f1de69b34d81 Mon Sep 17 00:00:00 2001 From: alan Date: Thu, 19 Sep 2019 16:57:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=8F=AF=E4=B8=BA=E7=A9=BA=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=9C=B0=E6=96=B9=E5=81=9A=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/maintain/forms/components/form.jdbc.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index 8bc83cd..bd5590a 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -76,6 +76,7 @@ export class FormJdbc extends BI.Widget { type: TextEditor, width: 300, value: connectionName, + allowBlank: true, ref: (_ref: any) => { this.form.connectionName = _ref; },