Browse Source

Merge pull request #50 in DEC/decision-webui-dcm from ~ALAN/decision-webui-dcm:feature/10.0 to feature/10.0

* commit '5fe5945368e675609e84ffbafea9f1de69b34d81':
  fix: 数据连接名称可为空,在其他地方做验证
  fix: DEC-9802 复制数据连接时,保留之前的id
qufenxi
alan 5 years ago
parent
commit
b84ea97bdd
  1. 2
      src/modules/crud/decision.api.ts
  2. 1
      src/modules/pages/maintain/forms/components/form.jdbc.ts
  3. 7
      src/modules/pages/maintain/forms/form.ts

2
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),
};

1
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;
},

7
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 {

Loading…
Cancel
Save