|
|
@ -6,7 +6,7 @@ import { FormPlugin } from './components/form.plugin'; |
|
|
|
import { connectionType, errorCode } from '@constants/env'; |
|
|
|
import { connectionType, errorCode } from '@constants/env'; |
|
|
|
import { ConnectionJDBC, Connection, ResultType } from 'src/modules/crud/crud.typings'; |
|
|
|
import { ConnectionJDBC, Connection, ResultType } from 'src/modules/crud/crud.typings'; |
|
|
|
import { DEFAULT_JNDI_DATA, DEFAULT_JDBC_POOL, DATEBASE_FILTER_TYPE } from '@constants/constant'; |
|
|
|
import { DEFAULT_JNDI_DATA, DEFAULT_JDBC_POOL, DATEBASE_FILTER_TYPE } from '@constants/constant'; |
|
|
|
import { getJdbcDatabaseType, getChartLength } from '../../../app.service'; |
|
|
|
import { getJdbcDatabaseType, getChartLength, getAllDatabaseTypes } from '../../../app.service'; |
|
|
|
import { NAME_MAX_LENGTH } from '../../../app.constant'; |
|
|
|
import { NAME_MAX_LENGTH } from '../../../app.constant'; |
|
|
|
import { checkIllegalStrings } from "@core/index"; |
|
|
|
import { checkIllegalStrings } from "@core/index"; |
|
|
|
|
|
|
|
|
|
|
@ -14,8 +14,7 @@ import { checkIllegalStrings } from "@core/index"; |
|
|
|
@store(MaintainFormModel) |
|
|
|
@store(MaintainFormModel) |
|
|
|
export class MaintainForm extends BI.Widget { |
|
|
|
export class MaintainForm extends BI.Widget { |
|
|
|
static xtype = 'dec.dcm.maintain.form'; |
|
|
|
static xtype = 'dec.dcm.maintain.form'; |
|
|
|
static TESTCONNECTION = 'EVENT_TEST_CONNECTION'; |
|
|
|
static EVENT_TESTCONNECTION = 'EVENT_TEST_CONNECTION'; |
|
|
|
static EVENTNOTEST = 'EVENT_HIDE_TEST_CONNECTION'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
props = { |
|
|
|
props = { |
|
|
|
connectionType: '', |
|
|
|
connectionType: '', |
|
|
@ -31,9 +30,9 @@ export class MaintainForm extends BI.Widget { |
|
|
|
|
|
|
|
|
|
|
|
watch = { |
|
|
|
watch = { |
|
|
|
saveEvent: () => { |
|
|
|
saveEvent: () => { |
|
|
|
const sonSave = this.form.save?.(); |
|
|
|
const sonSave = this.form.getSaveFn?.(); |
|
|
|
if (sonSave) { |
|
|
|
if (sonSave) { |
|
|
|
sonSave().then((success: Boolean) => { |
|
|
|
sonSave().then((success: boolean) => { |
|
|
|
if (success) { |
|
|
|
if (success) { |
|
|
|
BI.Msg.toast(BI.i18nText("Dec-Basic_Save_Success"), { |
|
|
|
BI.Msg.toast(BI.i18nText("Dec-Basic_Save_Success"), { |
|
|
|
level: "success", |
|
|
|
level: "success", |
|
|
@ -45,9 +44,20 @@ export class MaintainForm extends BI.Widget { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (this.form.preventParentSave()) { |
|
|
|
|
|
|
|
|
|
|
|
//只有外来插件才可以使用是否不执行平台的保存逻辑
|
|
|
|
|
|
|
|
if (this.model.datebaseTypeSelected) { |
|
|
|
|
|
|
|
const isPluginDatabase = BI.some(BI.Providers.getProvider('dec.connection.provider.datebase').customDatabaseType, (_index, value) => value.databaseType === this.model.datebaseTypeSelected); |
|
|
|
|
|
|
|
if (isPluginDatabase && this.model.datebaseTypeSelectedOne.isNoSave) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
const databaseType = this.model.connectionSelectedOne.connectionType; |
|
|
|
|
|
|
|
const database = BI.find(getAllDatabaseTypes(), (_index, value) => value.databaseType === databaseType); |
|
|
|
|
|
|
|
if (this.model.connectionSelectedOne.pluginConnection && database?.isNoSave) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.save(); |
|
|
|
this.save(); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -70,15 +80,10 @@ export class MaintainForm extends BI.Widget { |
|
|
|
this.form = _ref; |
|
|
|
this.form = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
|
listeners: [{ |
|
|
|
listeners: [{ |
|
|
|
eventName: MaintainForm.TESTCONNECTION, |
|
|
|
eventName: MaintainForm.EVENT_TESTCONNECTION, |
|
|
|
action: () => { |
|
|
|
action: () => { |
|
|
|
this.testConnection(); |
|
|
|
this.testConnection(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, { |
|
|
|
|
|
|
|
eventName: MaintainForm.EVENTNOTEST, |
|
|
|
|
|
|
|
action: (value: boolean) => { |
|
|
|
|
|
|
|
this.model.noTestConnection = value; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}], |
|
|
|
}], |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|