Browse Source

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

* commit '324c45ed7efb31ce4fc1aedc1c400edd21d75600':
  fix: 写成常量
  fix: 间距调大一点
  fix: DEC-10044 编辑数据连接时,左上角显示数据连接类型名称。
qufenxi
alan 5 years ago
parent
commit
f4f27602ab
  1. 6
      src/modules/constants/constant.ts
  2. 8
      src/modules/pages/connection/connection_jdbc/connection_jdbc.ts
  3. 10
      src/modules/pages/connection/connection_jndi/connection_jndi.ts
  4. 12
      src/modules/pages/maintain/forms/components/form.jdbc.ts
  5. 11
      src/modules/pages/maintain/forms/components/form.jndi.ts
  6. 8
      src/modules/pages/maintain/maintain.ts

6
src/modules/constants/constant.ts

@ -646,4 +646,8 @@ export const DEFAULT_JDBC_POOL = {
numTestsPerEvictionRun: 3,
minEvictableIdleTimeMillis: 1800,
};
export const CONNECTION_LAYOUT = {
hgap: 15,
vgap: 15,
};

8
src/modules/pages/connection/connection_jdbc/connection_jdbc.ts

@ -5,6 +5,7 @@ import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/col
import { ConnectionJdbcModelXtype, ConnectionJdecModel } from './connection_jdbc.model';
import { ConnectionJDBC } from 'src/modules/crud/crud.typings';
import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo } from '../../../app.service';
import { CONNECTION_LAYOUT } from '@constants/constant';
export const ConnectionJdbcXtype = 'dec.dcm.connection_jdbc';
@shortcut(ConnectionJdbcXtype)
@store(ConnectionJdbcModelXtype)
@ -19,11 +20,12 @@ export class ConnectionJdbc extends BI.Widget {
const { driver, database, user, newCharsetName, schema, connectionPoolAttr, authType, principal, url } = connectionData;
const databaseType = getJdbcDatabaseType(database, driver);
const { host, port, databaseName } = resolveUrlInfo(url);
const { hgap, vgap } = CONNECTION_LAYOUT;
return {
type: Vertical,
hgap: 15,
vgap: 10,
hgap,
vgap,
items: [
{
type: FormItemXtype,
@ -94,7 +96,7 @@ export class ConnectionJdbc extends BI.Widget {
},
{
type: Vertical,
vgap: 10,
vgap,
invisible: true,
ref: (_ref: any) => {
this.advancedSet = _ref;

10
src/modules/pages/connection/connection_jndi/connection_jndi.ts

@ -4,6 +4,7 @@ import { FormItemXtype } from '../components/form_item/form_item';
import { ConnectionJndiModelXtype, ConnectionJndiModel } from './connection_jndi.model';
import { ConnectionJNDI } from 'src/modules/crud/crud.typings';
import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
import { CONNECTION_LAYOUT } from '@constants/constant';
export const ConnectionJndiXtype = 'dec.dcm.connection_jndi';
@shortcut(ConnectionJndiXtype)
@ -16,11 +17,12 @@ export class ConnectionJdbc extends BI.Widget {
render() {
const connectionData = this.model.connectionSelectedOne.connectionData as ConnectionJNDI;
const { jndiName, contextHashtable, originalCharsetName } = connectionData;
const { hgap, vgap } = CONNECTION_LAYOUT;
return {
type: Vertical,
hgap: 15,
vgap: 10,
hgap,
vgap,
items: [
{
type: FormItemXtype,
@ -30,7 +32,7 @@ export class ConnectionJdbc extends BI.Widget {
},
{
type: Htape,
height: 110,
height: 120,
items: [
{
el: {
@ -99,7 +101,7 @@ export class ConnectionJdbc extends BI.Widget {
},
{
type: Vertical,
vgap: 10,
vgap,
invisible: true,
ref: (_ref: any) => {
this.advancedSet = _ref;

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

@ -4,7 +4,7 @@ import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/col
import { FormItemXtype } from '../../components/form_item/form_item';
import { Connection, ConnectionJDBC, ConnectionPoolJDBC } from 'src/modules/crud/crud.typings';
import { connectionType } from '@constants/env';
import { CONNECT_CHARSET } from '@constants/constant';
import { CONNECT_CHARSET, CONNECTION_LAYOUT } from '@constants/constant';
import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl } from '../../../../app.service';
export const FormJdbcXtype = 'dec.dcm.maintain.form.jdbc';
@ -61,13 +61,13 @@ export class FormJdbc extends BI.Widget {
const { initialSize, maxActive, maxIdle, maxWait, validationQuery, testOnBorrow, testOnReturn, testWhileIdle, timeBetweenEvictionRunsMillis, numTestsPerEvictionRun, minEvictableIdleTimeMillis } = connectionPoolAttr as ConnectionPoolJDBC;
const databaseType = getJdbcDatabaseType(database, driver);
this.oldPassword = password;
const { host, port, databaseName } = resolveUrlInfo(url);
const { hgap, vgap } = CONNECTION_LAYOUT;
return {
type: Vertical,
hgap: 15,
vgap: 10,
hgap,
vgap,
items: [
{
type: FormItemXtype,
@ -393,7 +393,7 @@ export class FormJdbc extends BI.Widget {
},
{
type: Vertical,
vgap: 10,
vgap,
invisible: true,
ref: (_ref: any) => {
this.advancedSet = _ref;

11
src/modules/pages/maintain/forms/components/form.jndi.ts

@ -2,7 +2,7 @@ import { shortcut } from '@core/core';
import { Vertical, TextEditor, Htape, Left, Label, TextValueCombo } from 'ui';
import { FormItemXtype } from '../../components/form_item/form_item';
import { ConnectionJNDI, Connection, ContextHashtable } from 'src/modules/crud/crud.typings';
import { CONNECT_CHARSET } from '@constants/constant';
import { CONNECT_CHARSET, CONNECTION_LAYOUT } from '@constants/constant';
import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
import { connectionType } from '@constants/env';
export const FormJndiXtype = 'dec.dcm.maintain.form.jndi';
@ -37,11 +37,12 @@ export class FormJndi extends BI.Widget {
render() {
const { connectionName, connectionData } = this.options.formData;
const { jndiName, newCharsetName, contextHashtable } = connectionData as ConnectionJNDI;
const { hgap, vgap } = CONNECTION_LAYOUT;
return {
type: Vertical,
hgap: 15,
vgap: 10,
hgap,
vgap,
items: [
{
type: FormItemXtype,
@ -187,7 +188,7 @@ export class FormJndi extends BI.Widget {
},
{
type: Vertical,
vgap: 10,
vgap,
invisible: true,
ref: (_ref: any) => {
this.advancedSet = _ref;

8
src/modules/pages/maintain/maintain.ts

@ -7,7 +7,7 @@ import { ApiFactory } from 'src/modules/crud/apiFactory';
const api = new ApiFactory().create();
import './maintain.less';
import { connectionType } from '@constants/env';
import { getJdbcDatabaseType } from '../../app.service';
import { getJdbcDatabaseType, getTextByDatabaseType } from '../../app.service';
import { ConnectionJDBC } from 'src/modules/crud/crud.typings';
export const MaintainXtype = 'dec.dcm.maintain';
@ -20,8 +20,8 @@ export class Maintain extends BI.Widget {
listView: any;
render() {
const { text, isEdit, databaseType } = this.getEditConnection();
const titleText = this.model.isCopy ? `${text}-${BI.i18nText('Dec-Dcm_Copy')}` : text;
const { isEdit, databaseType } = this.getEditConnection();
const titleText = getTextByDatabaseType(databaseType);
return {
type: Vtape,
@ -43,7 +43,7 @@ export class Maintain extends BI.Widget {
},
{
type: Label,
text: `${titleText}${databaseType}`,
text: titleText,
},
],
height: 40,

Loading…
Cancel
Save