Browse Source

Merge pull request #6450 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x

* commit '166f3ab4961ddc0a4f821290590a5c06eec4c12a':
  REPORT-85200 fix:修复「初始化连接数」错误提示显示问题
  REPORT-85619 feat: 拓展下数据连接配置功能
feature/x
superman 2 years ago
parent
commit
0bd1db8cc9
  1. 28
      src/modules/app.provider.ts
  2. 3
      src/modules/pages/maintain/forms/components/form.jdbc.ts

28
src/modules/app.provider.ts

@ -1,10 +1,11 @@
import { CONSTANT_PLUGIN_TYPES } from './app.constant'; import { CONSTANT_PLUGIN_TYPES } from './app.constant';
import { DATA_BASE_TYPES } from '@constants/constant';
BI.provider('dec.connection.provider.datebase', function() { BI.provider('dec.connection.provider.datebase', function () {
this.resolves = {}; this.resolves = {};
// 原service中resolveUrlInfo方法 // 原service中resolveUrlInfo方法
function jdbcResolve (url: string) { function jdbcResolve(url: string) {
if (BI.isNull(url)) return {}; if (BI.isNull(url)) return {};
const oracleUlr = url.match(/^jdbc:(oracle):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(:|\/)([^]+)(.*)/i); const oracleUlr = url.match(/^jdbc:(oracle):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(:|\/)([^]+)(.*)/i);
if (oracleUlr) { if (oracleUlr) {
@ -68,14 +69,35 @@ BI.provider('dec.connection.provider.datebase', function() {
}; };
} }
function coverBaseDatabase(config) {
const baseDataBase = DATA_BASE_TYPES.find(item => item.text === config.text);
if (BI.isNotNull(baseDataBase)) {
// 覆盖基础配置
Object.assign(baseDataBase, config);
return true;
}
return false;
}
this.registerDatabaseType = (config: any) => { this.registerDatabaseType = (config: any) => {
if (coverBaseDatabase(config)) return;
BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, config)); BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, config));
}; };
this.registerJdbcDatabase = (config: any, resolve?: Function) => { this.registerJdbcDatabase = (config: any, resolve?: Function) => {
BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, { ...config, type: 'jdbc' })); config = {
...config,
type: 'jdbc',
};
BI.isFunction(resolve) && (this.resolves[config.databaseType] = resolve); BI.isFunction(resolve) && (this.resolves[config.databaseType] = resolve);
if (coverBaseDatabase(config)) return;
BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, config));
}; };
this.$get = () => BI.inherit(BI.OB, { this.$get = () => BI.inherit(BI.OB, {

3
src/modules/pages/maintain/forms/components/form.jdbc.ts

@ -1001,7 +1001,8 @@ export class FormJdbc extends BI.Widget {
{ {
el: { el: {
type: BI.VerticalLayout.xtype, type: BI.VerticalLayout.xtype,
bgap: vgap, vgap: vgap,
top: -15,
invisible: true, invisible: true,
ref: (_ref: VerticalLayout) => { ref: (_ref: VerticalLayout) => {
this.advancedSet = _ref; this.advancedSet = _ref;

Loading…
Cancel
Save