Browse Source

DEC-19762 feat:【FR配合】部分数据连接支持fetchsize

feature/10.0
dailer 3 years ago
parent
commit
151a770315
  1. 10
      package.json
  2. 6
      src/modules/app.ts
  3. 10
      src/modules/crud/crud.typings.d.ts
  4. 16
      src/modules/pages/connection/connection.ts
  5. 1
      src/modules/pages/connection/connection_jdbc/connection_jdbc.ts
  6. 2
      src/modules/pages/maintain/forms/components/form.jdbc.ts
  7. 18
      src/modules/pages/maintain/forms/form.ts

10
package.json

@ -48,15 +48,14 @@
"source-map-loader": "0.2.4", "source-map-loader": "0.2.4",
"style-loader": "0.23.1", "style-loader": "0.23.1",
"ts-jest": "24.0.2", "ts-jest": "24.0.2",
"typescript": "3.5.1", "typescript": "^4.3.5",
"webpack": "4.35.2", "webpack": "4.35.2",
"webpack-cli": "3.3.5", "webpack-cli": "3.3.5",
"webpack-dev-server": "3.7.2", "webpack-dev-server": "3.7.2",
"webpack-merge": "4.2.1" "webpack-merge": "4.2.1"
}, },
"optionalDependencies": { "optionalDependencies": {
"@fui/core": "^2.0.0", "@fui/core": "^2.0.20210721103227"
"@fui/materials": "10.0.0-release - 10.0.0-release.99999999999999"
}, },
"scripts": { "scripts": {
"dev": "cross-env NODE_ENV=mock webpack-dev-server -p --progress --config=webpack/webpack.dev.js --mode development --open", "dev": "cross-env NODE_ENV=mock webpack-dev-server -p --progress --config=webpack/webpack.dev.js --mode development --open",
@ -67,10 +66,5 @@
"i18n": "node ./lib/transform-i18n/transform-i18n.js", "i18n": "node ./lib/transform-i18n/transform-i18n.js",
"test": "jest --passWithNoTests", "test": "jest --passWithNoTests",
"upgrade": "node lib/upgrade" "upgrade": "node lib/upgrade"
},
"husky": {
"hooks": {
"pre-push": "npm run eslint && npm run test"
}
} }
} }

6
src/modules/app.ts

@ -15,6 +15,10 @@ import '../less/index.less';
export class App extends BI.Widget { export class App extends BI.Widget {
static xtype = 'dec.dcm.main'; static xtype = 'dec.dcm.main';
props = {
baseCls: 'dec-dcm',
};
tab: Tab; tab: Tab;
store: AppModel['store']; store: AppModel['store'];
@ -24,7 +28,7 @@ export class App extends BI.Widget {
pageIndex: (index: string) => { pageIndex: (index: string) => {
this.tab.setSelect(index); this.tab.setSelect(index);
}, },
} };
render() { render() {
return { return {

10
src/modules/crud/crud.typings.d.ts vendored

@ -22,12 +22,12 @@ export interface Connection {
privilegeDetailBeanList?: { privilegeDetailBeanList?: {
privilegeType: number; privilegeType: number;
privilegeValue: number; privilegeValue: number;
}[] }[];
} }
export interface ConnectionLicInfo { export interface ConnectionLicInfo {
currentConnectionNum: number; currentConnectionNum: number;
maxConnectionNum: number maxConnectionNum: number;
} }
export interface ConnectionJDBC { export interface ConnectionJDBC {
@ -111,7 +111,11 @@ export interface ConnectionJDBC {
/** /**
* fetchSize * fetchSize
*/ */
fetchSize?: string; fetchSize?: number;
/**
* id
*/
identity?: string;
connectionPoolAttr: ConnectionPoolJDBC; connectionPoolAttr: ConnectionPoolJDBC;
} }

16
src/modules/pages/connection/connection.ts

@ -64,15 +64,25 @@ export class Connection extends BI.Widget {
items: [ items: [
{ {
el: { el: {
type: BI.VerticalAdaptLayout.xtype, type: BI.LeftRightVerticalAdaptLayout.xtype,
cls: 'bi-border-bottom', cls: 'bi-border-bottom',
items: [{ items: {
left: [
{
type: BI.Button.xtype, type: BI.Button.xtype,
text: BI.i18nText('Dec-Dcm_Connection_New'), text: BI.i18nText('Dec-Dcm_Connection_New'),
handler: () => { handler: () => {
this.store.createNewConnection(); this.store.createNewConnection();
}, },
}], },
],
right: [
{
type: 'dec.connection.driver.entry',
from: '.dec-dcm',
},
],
},
}, },
height: 40, height: 40,
}, },

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

@ -182,6 +182,7 @@ export class ConnectionJdbc extends BI.Widget {
unit: BI.i18nText('BI-Basic_Seconds'), unit: BI.i18nText('BI-Basic_Seconds'),
}, { }, {
type: FormItem.xtype, type: FormItem.xtype,
invisible: BI.parseInt(fetchSize) < 0,
name: 'Fetchsize', name: 'Fetchsize',
value: fetchSize, value: fetchSize,
}, },

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

@ -849,7 +849,7 @@ export class FormJdbc extends BI.Widget {
creator: Dec ? Dec.personal.username : '', creator: Dec ? Dec.personal.username : '',
principal: this.form.principal.getValue(), principal: this.form.principal.getValue(),
keyPath: this.form.keyPath.getValue(), keyPath: this.form.keyPath.getValue(),
fetchSize: this.form.fetchSize.getValue(), fetchSize: BI.parseInt(this.form.fetchSize.getValue()),
connectionPoolAttr: { connectionPoolAttr: {
initialSize: this.form.initialSize.getValue(), initialSize: this.form.initialSize.getValue(),
maxActive: this.form.maxActive.getValue(), maxActive: this.form.maxActive.getValue(),

18
src/modules/pages/maintain/forms/form.ts

@ -16,7 +16,7 @@ export class MaintainForm extends BI.Widget {
props = { props = {
connectionType: '', connectionType: '',
} };
isEdit = false; isEdit = false;
connectionName = ''; connectionName = '';
@ -55,7 +55,7 @@ export class MaintainForm extends BI.Widget {
testEvent: () => { testEvent: () => {
this.testConnection(); this.testConnection();
}, },
} };
render() { render() {
const formData = BI.clone(this.getFormData()); const formData = BI.clone(this.getFormData());
@ -98,7 +98,7 @@ export class MaintainForm extends BI.Widget {
} }
} }
private getFormData():Connection { private getFormData(): Connection {
switch (this.options.connectionType) { switch (this.options.connectionType) {
case connectionType.JDBC: case connectionType.JDBC:
return this.getJdbcConnection(); return this.getJdbcConnection();
@ -111,7 +111,7 @@ export class MaintainForm extends BI.Widget {
} }
} }
private getJdbcConnection():Connection { private getJdbcConnection(): Connection {
const connectionName = this.getConnectionName(); const connectionName = this.getConnectionName();
let editConnection: Connection; let editConnection: Connection;
let connectionData: ConnectionJDBC; let connectionData: ConnectionJDBC;
@ -122,8 +122,10 @@ export class MaintainForm extends BI.Widget {
database: this.model.datebaseTypeSelectedOne.databaseType, database: this.model.datebaseTypeSelectedOne.databaseType,
connectionName, connectionName,
connectionPoolAttr: DEFAULT_JDBC_POOL, connectionPoolAttr: DEFAULT_JDBC_POOL,
port:'', port: '',
host: 'localhost', host: 'localhost',
fetchSize: this.model.datebaseTypeSelectedOne.fetchSize ?? -1,
identity: BI.UUID(),
}; };
editConnection = { editConnection = {
connectionId: '', connectionId: '',
@ -143,7 +145,7 @@ export class MaintainForm extends BI.Widget {
return connection; return connection;
} }
private getJndiConnection():Connection { private getJndiConnection(): Connection {
if (this.model.datebaseTypeSelected) { if (this.model.datebaseTypeSelected) {
return { return {
connectionId: '', connectionId: '',
@ -158,7 +160,7 @@ export class MaintainForm extends BI.Widget {
return this.model.connectionSelectedOne; return this.model.connectionSelectedOne;
} }
private getPluginConnection():Connection { private getPluginConnection(): Connection {
if (!this.model.datebaseTypeSelected) { if (!this.model.datebaseTypeSelected) {
this.connectionName = this.model.connectionSelectedOne.connectionName; this.connectionName = this.model.connectionSelectedOne.connectionName;
this.isEdit = true; this.isEdit = true;
@ -174,7 +176,7 @@ export class MaintainForm extends BI.Widget {
}; };
} }
private testValue():boolean { private testValue(): boolean {
const value = this.form.getSubmitValue(); const value = this.form.getSubmitValue();
if (!value.connectionName) { if (!value.connectionName) {
this.setFromError(BI.i18nText('Dec-Dcm_Connection_ConnectionName_Cannt_Null')); this.setFromError(BI.i18nText('Dec-Dcm_Connection_ConnectionName_Cannt_Null'));

Loading…
Cancel
Save