Browse Source

Merge pull request #1119 in DEC/decision-webui-dcm from bugfix/10.0 to feature/10.0

* commit '1718cdde8ffc86f65f8e73a3d04ec2d5630d9d85':
  KERNEL-6541 类型引用规范化
  build: KERNEL-6541 引用类型规范化
research/11.0
superman 4 years ago
parent
commit
f76473bb86
  1. 2
      config/jest.environment.js
  2. 8
      index.html
  3. 7
      package.json
  4. 2
      src/less/background.less
  5. 2
      src/less/font.less
  6. 4
      src/less/index.less
  7. 2
      src/less/lib/font.less
  8. 9
      src/modules/app.ts
  9. 17
      src/modules/components/collapse/collapse.ts
  10. 17
      src/modules/components/link_button/link.ts
  11. 23
      src/modules/components/test_status/test_status.ts
  12. 15
      src/modules/components/test_status/tip_icon/tip_fail.ts
  13. 4
      src/modules/components/test_status/tip_icon/tip_icon.ts
  14. 18
      src/modules/components/text_checker/text_checker.ts
  15. 6
      src/modules/pages/connection/components/form_item/form_item.ts
  16. 19
      src/modules/pages/connection/connection.ts
  17. 4
      src/modules/pages/connection/connection_jndi/connection_jndi.ts
  18. 13
      src/modules/pages/connection/list/list.ts
  19. 25
      src/modules/pages/connection/list/list_item/list_item.ts
  20. 15
      src/modules/pages/connection_pool/connection_pool.ts
  21. 4
      src/modules/pages/connection_pool/list_item/list_item.ts
  22. 43
      src/modules/pages/connection_pool/pool/pool.ts
  23. 39
      src/modules/pages/database/database.ts
  24. 11
      src/modules/pages/database/database_type/database_type.ts
  25. 3
      src/modules/pages/database/filter/filter.ts
  26. 4
      src/modules/pages/maintain/components/form_item/form_item.ts
  27. 73
      src/modules/pages/maintain/forms/components/form.jdbc.ts
  28. 75
      src/modules/pages/maintain/forms/components/form.jndi.ts
  29. 7
      src/modules/pages/maintain/maintain.ts
  30. 15
      src/modules/title/title.ts
  31. 11
      src/modules/title/title_database/title_datebase.ts
  32. 8
      src/modules/title/title_maintain/title_maintain.ts
  33. 54
      src/ui/fineui.ts
  34. 1
      tsconfig.json
  35. 2
      types/globals.d.ts
  36. 2
      webpack/webpack.common.js
  37. 5
      webpack/webpack.dev.js
  38. 2275
      yarn.lock

2
config/jest.environment.js

@ -11,7 +11,7 @@ class FineUiEnvironment extends JsdomEnvironment {
document.createElement('body'); document.createElement('body');
[ [
'../node_modules/fineui/dist/fineui.js', '../node_modules/@fui/core/dist/fineui.js',
'../node_modules/@fui/materials/docs/materials.js', '../node_modules/@fui/materials/docs/materials.js',
'../config/fineui.prepare.js', '../config/fineui.prepare.js',
'./fineui.setup.js', './fineui.setup.js',

8
index.html

@ -5,15 +5,15 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>Fine Report</title> <title>Fine Report</title>
<!--核心css文件--> <!--核心css文件-->
<link rel="preload" href="./node_modules/fineui/dist/font/iconfont.woff" as="font" type="font/woff" crossorigin="" /> <link rel="preload" href="./node_modules/@fui/core/dist/font/iconfont.woff" as="font" type="font/woff" crossorigin="" />
<link rel="stylesheet" type="text/css" href="./node_modules/fineui/dist/fineui.css" /> <link rel="stylesheet" type="text/css" href="./node_modules/@fui/core/dist/fineui.css" />
<link rel="stylesheet" type="text/css" href="./node_modules/@fui/materials/docs/materials.css" /> <link rel="stylesheet" type="text/css" href="./node_modules/@fui/materials/docs/materials.css" />
</head> </head>
<body id="body"> <body id="body">
<div id="wrapper"></div> <div id="wrapper"></div>
<script src="./node_modules/fineui/dist/fineui.js"></script> <script src="./node_modules/@fui/core/dist/fineui.js"></script>
<script src="./node_modules/fineui/dist/utils.js"></script> <script src="./node_modules/@fui/core/dist/utils.js"></script>
<script src="./node_modules/@fui/materials/docs/materials.js"></script> <script src="./node_modules/@fui/materials/docs/materials.js"></script>
<script src="./assets/scripts/dec.js"></script> <script src="./assets/scripts/dec.js"></script>
<script src="./redis.js"></script> <script src="./redis.js"></script>

7
package.json

@ -16,6 +16,7 @@
"nprogress": "0.2.0" "nprogress": "0.2.0"
}, },
"devDependencies": { "devDependencies": {
"@fui/babel-preset-fineui": "^1.0.0",
"@types/jest": "24.0.11", "@types/jest": "24.0.11",
"@typescript-eslint/eslint-plugin": "1.7.0", "@typescript-eslint/eslint-plugin": "1.7.0",
"@typescript-eslint/parser": "1.7.0", "@typescript-eslint/parser": "1.7.0",
@ -28,6 +29,7 @@
"eslint": "5.16.0", "eslint": "5.16.0",
"eslint-plugin-jest": "22.4.1", "eslint-plugin-jest": "22.4.1",
"express": "4.16.4", "express": "4.16.4",
"fork-ts-checker-webpack-plugin": "1.4.3",
"html-webpack-plugin": "3.2.0", "html-webpack-plugin": "3.2.0",
"http-proxy": "1.17.0", "http-proxy": "1.17.0",
"husky": "1.3.1", "husky": "1.3.1",
@ -50,11 +52,10 @@
"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"
"@fui/babel-preset-fineui": "^1.0.0"
}, },
"optionalDependencies": { "optionalDependencies": {
"fineui": "^2.0.0", "@fui/core": "^2.0.0",
"@fui/materials": "10.0.0-release - 10.0.0-release.99999999999999" "@fui/materials": "10.0.0-release - 10.0.0-release.99999999999999"
}, },
"scripts": { "scripts": {

2
src/less/background.less

@ -1,4 +1,4 @@
@import "../../node_modules/fineui/src/less/image.less"; @import "../../node_modules/@fui/core/src/less/image.less";
@import "./lib/background.less"; @import "./lib/background.less";
@import "var"; @import "var";

2
src/less/font.less

@ -1,4 +1,4 @@
@import "../../node_modules/fineui/src/less/image.less"; @import "../../node_modules/@fui/core/src/less/image.less";
@import "./lib/font.less"; @import "./lib/font.less";
.addFontRes(); .addFontRes();
.font(dcm-link-font, @font-link); .font(dcm-link-font, @font-link);

4
src/less/index.less

@ -1,5 +1,5 @@
@import "../../node_modules/fineui/src/less/lib/colors.less"; @import "../../node_modules/@fui/core/src/less/lib/colors.less";
@import '../../node_modules/fineui/src/less/visual.less'; @import '../../node_modules/@fui/core/src/less/visual.less';
@import "background.less"; @import "background.less";
@import "font.less"; @import "font.less";
@import "var.less"; @import "var.less";

2
src/less/lib/font.less

@ -1,4 +1,4 @@
@import '../../../node_modules/fineui/src/less/lib/font.less'; @import '../../../node_modules/@fui/core/src/less/lib/font.less';
@font-link: "e759"; @font-link: "e759";
@font-link-test: "e763"; @font-link-test: "e763";

9
src/modules/app.ts

@ -1,17 +1,18 @@
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { Tab, Vtape, Absolute } from 'ui'; import { Vtape, Absolute } from 'ui';
import { TitleXtype } from './title/title'; import { TitleXtype } from './title/title';
import { PAGE_INDEX } from './constants/constant'; import { PAGE_INDEX } from './constants/constant';
import { ConnectionXtype, DatebaseXtype, MaintainXtype, ConnectionPoolXtype } from './pages'; import { ConnectionXtype, DatebaseXtype, MaintainXtype, ConnectionPoolXtype } from './pages';
import { AppModel, AppModelXtype } from './app.model'; import { AppModel, AppModelXtype } from './app.model';
import './app.provider'; import './app.provider';
import '../less/index.less'; import '../less/index.less';
import { Tab } from '@fui/core';
export const AppXtype = 'dec.dcm.main'; export const AppXtype = 'dec.dcm.main';
@store(AppModelXtype) @store(AppModelXtype)
@shortcut(AppXtype) @shortcut(AppXtype)
export class App extends BI.Widget { export class App extends BI.Widget {
tab: any; tab: Tab;
store: AppModel['store']; store: AppModel['store'];
model: AppModel['model']; model: AppModel['model'];
@ -38,12 +39,12 @@ export class App extends BI.Widget {
cls: 'bi-background', cls: 'bi-background',
items: [{ items: [{
el: { el: {
type: Tab, type: BI.Tab.xtype,
cls: 'bi-card', cls: 'bi-card',
single: true, single: true,
tgap: 10, tgap: 10,
showIndex: this.model.pageIndex, showIndex: this.model.pageIndex,
ref: (_ref: any) => { ref: (_ref: Tab) => {
this.tab = _ref; this.tab = _ref;
}, },
cardCreator: (index: string) => { cardCreator: (index: string) => {

17
src/modules/components/collapse/collapse.ts

@ -1,6 +1,7 @@
import { IconLabel, Left, Label } from 'ui'; import { Left } from 'ui';
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { CollapseModel, CollapseModelXtype } from './collapse.model'; import { CollapseModel, CollapseModelXtype } from './collapse.model';
import { IconLabel } from '@fui/core';
export const EVENT_CHANGE = 'EVENT_CHANGE'; export const EVENT_CHANGE = 'EVENT_CHANGE';
export const CollapseXtype = 'dec.dcm.components.collapse'; export const CollapseXtype = 'dec.dcm.components.collapse';
@ -13,8 +14,8 @@ export class Collapse extends BI.BasicButton {
$testId: 'dec-dcm-components-collapse', $testId: 'dec-dcm-components-collapse',
} }
rightFont: any; rightFont: IconLabel;
downFont: any; downFont: IconLabel;
model: CollapseModel['model']; model: CollapseModel['model'];
store: CollapseModel['store']; store: CollapseModel['store'];
@ -34,25 +35,25 @@ export class Collapse extends BI.BasicButton {
type: Left, type: Left,
items: [ items: [
{ {
type: IconLabel, type: BI.IconLabel.xtype,
height: 17, height: 17,
cls: 'dcm-triangle-collapse-font icon-size-16', cls: 'dcm-triangle-collapse-font icon-size-16',
ref: (_ref: any) => { ref: (_ref: IconLabel) => {
this.rightFont = _ref; this.rightFont = _ref;
}, },
invisible: !this.model.isCollapse, invisible: !this.model.isCollapse,
}, },
{ {
type: IconLabel, type: BI.IconLabel.xtype,
height: 17, height: 17,
cls: 'dcm-triangle-expand-font icon-size-16', cls: 'dcm-triangle-expand-font icon-size-16',
ref: (_ref: any) => { ref: (_ref: IconLabel) => {
this.downFont = _ref; this.downFont = _ref;
}, },
invisible: this.model.isCollapse, invisible: this.model.isCollapse,
}, },
{ {
type: Label, type: BI.Label.xtype,
lgap: 2, lgap: 2,
text: this.options.name, text: this.options.name,
}, },

17
src/modules/components/link_button/link.ts

@ -1,25 +1,36 @@
import { CenterAdapt, Label } from 'ui'; import { CenterAdapt } from 'ui';
import { shortcut } from '@core/core'; import { shortcut } from '@core/core';
import { Label } from '@fui/core';
export const LinkXtype = 'dec.dcm.components.link.button'; export const LinkXtype = 'dec.dcm.components.link.button';
const DEFAULT_LINK = '/'; const DEFAULT_LINK = '/';
@shortcut(LinkXtype) @shortcut(LinkXtype)
export class LinkButton extends BI.BasicButton { export class LinkButton extends BI.BasicButton {
props = { props: {
text: string;
cls: string;
$testId: string;
link?: Function | string;
} = {
text: '', text: '',
cls: 'cursor-pointer', cls: 'cursor-pointer',
$testId: 'dec-dcm-link-button', $testId: 'dec-dcm-link-button',
} }
private text: Label;
render() { render() {
return { return {
type: CenterAdapt, type: CenterAdapt,
cls: 'bi-high-light', cls: 'bi-high-light',
items: [ items: [
{ {
type: Label, type: BI.Label.xtype,
cls: 'bi-high-light-border-bottom', cls: 'bi-high-light-border-bottom',
text: this.options.text, text: this.options.text,
ref: (_ref: Label) => {
this.text = _ref;
},
}, },
], ],
}; };

23
src/modules/components/test_status/test_status.ts

@ -1,9 +1,10 @@
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { TestStatusModelXtype, TestStatusModel } from './test_status.model'; import { TestStatusModelXtype, TestStatusModel } from './test_status.model';
import { CenterAdapt, Tab, Vertical, Label, TextButton, Left } from 'ui'; import { CenterAdapt, Vertical, Left } from 'ui';
import { TEST_STATUS } from '@constants/constant'; import { TEST_STATUS } from '@constants/constant';
import { TipIconXtype } from './tip_icon/tip_icon'; import { TipIconXtype } from './tip_icon/tip_icon';
import { TipFailXtype, EVENT_CLOSE, EVENT_RELOAD, EVENT_DETAIL } from './tip_icon/tip_fail'; import { TipFailXtype, EVENT_CLOSE, EVENT_RELOAD, EVENT_DETAIL } from './tip_icon/tip_fail';
import { Label, Tab } from '@fui/core';
export const TestStatusXtype = 'dec.dcm.components.test_status'; export const TestStatusXtype = 'dec.dcm.components.test_status';
export { export {
EVENT_CLOSE, EVENT_CLOSE,
@ -25,9 +26,9 @@ export class TestStatus extends BI.Widget {
model: TestStatusModel['model']; model: TestStatusModel['model'];
store: TestStatusModel['store']; store: TestStatusModel['store'];
tab: any; tab: Tab;
failMessage: any; failMessage: Label;
failDriverMessage: any; failDriverMessage: Label;
driverLink: any; driverLink: any;
detail: any; detail: any;
@ -48,13 +49,13 @@ export class TestStatus extends BI.Widget {
type: Vertical, type: Vertical,
items: [ items: [
{ {
type: Tab, type: BI.Tab.xtype,
cls: 'bi-card', cls: 'bi-card',
width: 450, width: 450,
height: 250, height: 250,
single: true, single: true,
showIndex: this.model.status, showIndex: this.model.status,
ref: (_ref: any) => { ref: (_ref: Tab) => {
this.tab = _ref; this.tab = _ref;
}, },
cardCreator: (index: string) => { cardCreator: (index: string) => {
@ -118,20 +119,20 @@ export class TestStatus extends BI.Widget {
height: 75, height: 75,
items: [ items: [
{ {
type: Label, type: BI.Label.xtype,
whiteSpace: 'normal', whiteSpace: 'normal',
width: 400, width: 400,
textAlign: 'left', textAlign: 'left',
text: '', text: '',
ref: (_ref: any) => { ref: (_ref: Label) => {
this.failMessage = _ref; this.failMessage = _ref;
}, },
}, },
{ {
type: Label, type: BI.Label.xtype,
textAlign: 'left', textAlign: 'left',
invisible: true, invisible: true,
ref: (_ref: any) => { ref: (_ref: Label) => {
this.failDriverMessage = _ref; this.failDriverMessage = _ref;
}, },
}, },
@ -140,7 +141,7 @@ export class TestStatus extends BI.Widget {
invisible: true, invisible: true,
items: [ items: [
{ {
type: TextButton, type: BI.TextButton.xtype,
cls: 'bi-high-light bi-high-light-border-bottom', cls: 'bi-high-light bi-high-light-border-bottom',
text: BI.i18nText('Dec-Dcm_Connection_Download_Driver'), text: BI.i18nText('Dec-Dcm_Connection_Download_Driver'),
handler: () => { handler: () => {

15
src/modules/components/test_status/tip_icon/tip_fail.ts

@ -1,5 +1,6 @@
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { Vertical, HorizotalAuto, CenterAdapt, Label, VerticalAdapt, Button } from 'ui'; import { Button } from '@fui/core';
import { Vertical, HorizotalAuto, CenterAdapt, VerticalAdapt } from 'ui';
import { TipFailModel, TipFailModelXtype } from './tip_fail.model'; import { TipFailModel, TipFailModelXtype } from './tip_fail.model';
export const TipFailXtype = 'dec.dcm.components.test_status.tip_fail'; export const TipFailXtype = 'dec.dcm.components.test_status.tip_fail';
export const EVENT_CLOSE = 'EVENT_CLOSE'; export const EVENT_CLOSE = 'EVENT_CLOSE';
@ -17,7 +18,7 @@ export class TipFail extends BI.Widget {
model: TipFailModel['model']; model: TipFailModel['model'];
store: TipFailModel['store']; store: TipFailModel['store'];
detailButton: any; detailButton: Button;
watch = { watch = {
isCollapse: (isCollapse: boolean) => { isCollapse: (isCollapse: boolean) => {
@ -46,7 +47,7 @@ export class TipFail extends BI.Widget {
height: 60, height: 60,
}], }],
}, { }, {
type: Label, type: BI.Label.xtype,
height: 14, height: 14,
bgap: 10, bgap: 10,
text: tipText, text: tipText,
@ -56,10 +57,10 @@ export class TipFail extends BI.Widget {
hgap: 5, hgap: 5,
items: [ items: [
{ {
type: Button, type: BI.Button.xtype,
text: BI.i18nText('Dec-Dcm_Connection_Detailed_Information'), text: BI.i18nText('Dec-Dcm_Connection_Detailed_Information'),
level: 'ignore', level: 'ignore',
ref: (_ref: any) => { ref: (_ref: Button) => {
this.detailButton = _ref; this.detailButton = _ref;
}, },
handler: () => { handler: () => {
@ -68,7 +69,7 @@ export class TipFail extends BI.Widget {
}, },
}, },
{ {
type: Button, type: BI.Button.xtype,
text: BI.i18nText('Dec-Dcm_Back'), text: BI.i18nText('Dec-Dcm_Back'),
level: 'ignore', level: 'ignore',
handler: () => { handler: () => {
@ -76,7 +77,7 @@ export class TipFail extends BI.Widget {
}, },
}, },
{ {
type: Button, type: BI.Button.xtype,
text: retryText, text: retryText,
handler: () => { handler: () => {
this.fireEvent(EVENT_RELOAD); this.fireEvent(EVENT_RELOAD);

4
src/modules/components/test_status/tip_icon/tip_icon.ts

@ -1,5 +1,5 @@
import { shortcut } from '@core/core'; import { shortcut } from '@core/core';
import { Vertical, HorizotalAuto, CenterAdapt, Label } from 'ui'; import { Vertical, HorizotalAuto, CenterAdapt } from 'ui';
export const TipIconXtype = 'dec.dcm.components.test_status.tip_icon'; export const TipIconXtype = 'dec.dcm.components.test_status.tip_icon';
@shortcut(TipIconXtype) @shortcut(TipIconXtype)
export class TipIcon extends BI.Widget { export class TipIcon extends BI.Widget {
@ -26,7 +26,7 @@ export class TipIcon extends BI.Widget {
height: 60, height: 60,
}], }],
}, { }, {
type: Label, type: BI.Label.xtype,
height: 14, height: 14,
text: tipText, text: tipText,
}, },

18
src/modules/components/text_checker/text_checker.ts

@ -1,5 +1,6 @@
import { shortcut } from '@core/core'; import { shortcut } from '@core/core';
import { TextEditor, Absolute, Label } from 'ui'; import { Label, TextEditor } from '@fui/core';
import { Absolute } from 'ui';
export const TextCheckerXtype = 'dec.dcm.components.text_checker'; export const TextCheckerXtype = 'dec.dcm.components.text_checker';
@shortcut(TextCheckerXtype) @shortcut(TextCheckerXtype)
export class TextChecker extends BI.Widget { export class TextChecker extends BI.Widget {
@ -13,11 +14,12 @@ export class TextChecker extends BI.Widget {
checker: (value: string) => boolean; checker: (value: string) => boolean;
autoFix?: boolean; autoFix?: boolean;
}[], }[],
$value: '',
} }
textEditor: any; textEditor: TextEditor;
errorLabel: any; errorLabel: Label;
private isError; private isError: boolean;
private value: string; private value: string;
private errorChecker: { private errorChecker: {
errorText: string; errorText: string;
@ -35,13 +37,13 @@ export class TextChecker extends BI.Widget {
height: 20, height: 20,
items: [{ items: [{
el: { el: {
type: TextEditor, type: BI.TextEditor.xtype,
$value, $value,
width, width,
allowBlank, allowBlank,
value, value,
watermark, watermark,
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.textEditor = _ref; this.textEditor = _ref;
}, },
listeners: [{ listeners: [{
@ -73,9 +75,9 @@ export class TextChecker extends BI.Widget {
}, },
}, { }, {
el: { el: {
type: Label, type: BI.Label.xtype,
cls: 'bi-error', cls: 'bi-error',
ref: (_ref: any) => { ref: (_ref: Label) => {
this.errorLabel = _ref; this.errorLabel = _ref;
}, },
}, },

6
src/modules/pages/connection/components/form_item/form_item.ts

@ -1,5 +1,5 @@
import { shortcut } from '@core/core'; import { shortcut } from '@core/core';
import { Label, Htape, Vertical } from 'ui'; import { Htape, Vertical } from 'ui';
export const FormItemXtype = 'dec.dcm.connection_form_item'; export const FormItemXtype = 'dec.dcm.connection_form_item';
@shortcut(FormItemXtype) @shortcut(FormItemXtype)
export class FormItem extends BI.Widget { export class FormItem extends BI.Widget {
@ -21,7 +21,7 @@ export class FormItem extends BI.Widget {
items: [ items: [
{ {
el: { el: {
type: Label, type: BI.Label.xtype,
cls: this.options.isBold ? 'bi-font-bold' : '', cls: this.options.isBold ? 'bi-font-bold' : '',
textAlign: 'left', textAlign: 'left',
text: this.options.name, text: this.options.name,
@ -32,7 +32,7 @@ export class FormItem extends BI.Widget {
type: Vertical, type: Vertical,
items: [ items: [
{ {
type: Label, type: BI.Label.xtype,
text: unit ? `${value} ${unit}` : value, text: unit ? `${value} ${unit}` : value,
textAlign: 'left', textAlign: 'left',
title: value, title: value,

19
src/modules/pages/connection/connection.ts

@ -1,4 +1,4 @@
import { Button, Htape, Vtape, Label, VerticalAdapt, ListView, CenterAdapt, Layout } from 'ui'; import { Htape, Vtape, VerticalAdapt, ListView, CenterAdapt, Layout } from 'ui';
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { ConnectionModel, ConnectionModelXtype } from './connection.model'; import { ConnectionModel, ConnectionModelXtype } from './connection.model';
import { PAGE_INDEX } from '@constants/constant'; import { PAGE_INDEX } from '@constants/constant';
@ -9,6 +9,7 @@ import { ConnectionPluginXtype } from './connection_plugin/connection_plugin';
import { connectionType } from '@constants/env'; import { connectionType } from '@constants/env';
import { getAllDatabaseTypes, connectionCanEdit, getJdbcDatabaseType, getTextByDatabaseType } from '../../app.service'; import { getAllDatabaseTypes, connectionCanEdit, getJdbcDatabaseType, getTextByDatabaseType } from '../../app.service';
import { ConnectionJDBC } from '../../crud/crud.typings'; import { ConnectionJDBC } from '../../crud/crud.typings';
import { Button, Label } from '@fui/core';
export const ConnectionXtype = 'dec.dcm.connection'; export const ConnectionXtype = 'dec.dcm.connection';
@shortcut(ConnectionXtype) @shortcut(ConnectionXtype)
@ -17,8 +18,8 @@ export class Connection extends BI.Widget {
store: ConnectionModel['store']; store: ConnectionModel['store'];
model: ConnectionModel['model']; model: ConnectionModel['model'];
connectionTitleWidget: any; connectionTitleWidget: Label;
connectionEditWidget: any; connectionEditWidget: Button;
listView: any; listView: any;
title: any; title: any;
@ -62,7 +63,7 @@ export class Connection extends BI.Widget {
type: VerticalAdapt, type: VerticalAdapt,
cls: 'bi-border-bottom', cls: 'bi-border-bottom',
items: [{ items: [{
type: Button, type: BI.Button.xtype,
text: BI.i18nText('Dec-Dcm_Connection_New'), text: BI.i18nText('Dec-Dcm_Connection_New'),
handler: () => { handler: () => {
this.store.setPageIndex(PAGE_INDEX.DATEBASE); this.store.setPageIndex(PAGE_INDEX.DATEBASE);
@ -91,9 +92,9 @@ export class Connection extends BI.Widget {
cls: 'bi-border-bottom', cls: 'bi-border-bottom',
items: [ items: [
{ {
type: Label, type: BI.Label.xtype,
textAlign: 'left', textAlign: 'left',
ref: (_ref: any) => { ref: (_ref: Label) => {
this.connectionTitleWidget = _ref; this.connectionTitleWidget = _ref;
}, },
}, },
@ -101,11 +102,11 @@ export class Connection extends BI.Widget {
el: { el: {
type: VerticalAdapt, type: VerticalAdapt,
items: [{ items: [{
type: Button, type: BI.Button.xtype,
$value: 'connection-edit', $value: 'connection-edit',
invisible: true, invisible: true,
text: BI.i18nText('Dec-Dcm_Edit'), text: BI.i18nText('Dec-Dcm_Edit'),
ref: (_ref: any) => { ref: (_ref: Button) => {
this.connectionEditWidget = _ref; this.connectionEditWidget = _ref;
}, },
handler: () => { handler: () => {
@ -174,7 +175,7 @@ export class Connection extends BI.Widget {
height: 130, height: 130,
}, },
{ {
type: Label, type: BI.Label.xtype,
cls: 'bi-tips', cls: 'bi-tips',
text: BI.i18nText('Dec-Dcm_Connection_Np_Registered'), text: BI.i18nText('Dec-Dcm_Connection_Np_Registered'),
}, },

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

@ -1,5 +1,5 @@
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { Vertical, Htape, Label, Left } from 'ui'; import { Vertical, Htape, Left } from 'ui';
import { FormItemXtype } from '../components/form_item/form_item'; import { FormItemXtype } from '../components/form_item/form_item';
import { ConnectionJndiModelXtype, ConnectionJndiModel } from './connection_jndi.model'; import { ConnectionJndiModelXtype, ConnectionJndiModel } from './connection_jndi.model';
import { ConnectionJNDI } from 'src/modules/crud/crud.typings'; import { ConnectionJNDI } from 'src/modules/crud/crud.typings';
@ -40,7 +40,7 @@ export class ConnectionJdbc extends BI.Widget {
type: Left, type: Left,
items: [ items: [
{ {
type: Label, type: BI.Label.xtype,
cls: 'bi-font-bold', cls: 'bi-font-bold',
textAlign: 'left', textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_Connection'), text: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_Connection'),

13
src/modules/pages/connection/list/list.ts

@ -1,8 +1,9 @@
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { CenterAdapt, Label, Layout, Vtape, Loader, Tab } from 'ui'; import { CenterAdapt, Layout, Vtape } from 'ui';
import { ListItemXtype } from './list_item/list_item'; import { ListItemXtype } from './list_item/list_item';
import { ConnectionListModel, ConnectionListModelXtype } from './list.model'; import { ConnectionListModel, ConnectionListModelXtype } from './list.model';
import { getDatabaseType } from './list.service'; import { getDatabaseType } from './list.service';
import { Tab } from '@fui/core';
export const ConnectionListXtype = 'dec.dcm.connection.list'; export const ConnectionListXtype = 'dec.dcm.connection.list';
@shortcut(ConnectionListXtype) @shortcut(ConnectionListXtype)
@store(ConnectionListModelXtype) @store(ConnectionListModelXtype)
@ -11,7 +12,7 @@ export class ConnectionList extends BI.LoadingPane {
model: ConnectionListModel['model']; model: ConnectionListModel['model'];
groupWidget: any; groupWidget: any;
tab: any; tab: Tab;
beforeInit(cb: Function) { beforeInit(cb: Function) {
this.store.setConnections().then(() => { this.store.setConnections().then(() => {
@ -32,10 +33,10 @@ export class ConnectionList extends BI.LoadingPane {
render() { render() {
return { return {
type: Tab, type: BI.Tab.xtype,
single: true, single: true,
showIndex: this.model.shwoType, showIndex: this.model.shwoType,
ref: (_ref: any) => { ref: (_ref: Tab) => {
this.tab = _ref; this.tab = _ref;
}, },
cardCreator: (index: 'list' | 'none') => { cardCreator: (index: 'list' | 'none') => {
@ -56,7 +57,7 @@ export class ConnectionList extends BI.LoadingPane {
height: 130, height: 130,
}, },
{ {
type: Label, type: BI.Label.xtype,
cls: 'bi-tips', cls: 'bi-tips',
text: BI.i18nText('Dec-Dcm_Connection_None'), text: BI.i18nText('Dec-Dcm_Connection_None'),
}, },
@ -67,7 +68,7 @@ export class ConnectionList extends BI.LoadingPane {
} }
return { return {
type: Loader, type: BI.Loader.xtype,
itemsCreator: (options: {times: number}, populate) => { itemsCreator: (options: {times: number}, populate) => {
populate(this.renderList((options.times - 1) * 50, options.times * 50)); populate(this.renderList((options.times - 1) * 50, options.times * 50));
}, },

25
src/modules/pages/connection/list/list_item/list_item.ts

@ -1,11 +1,12 @@
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { Label, IconLabel, IconButton, DownListCombo, SignEditor, Layout, Htape, Vertical } from 'ui'; import { Layout, Htape, Vertical } from 'ui';
import './list_item.less'; import './list_item.less';
import { ListItemModel, ListItemModelXtype } from './list_item.model'; import { ListItemModel, ListItemModelXtype } from './list_item.model';
import { PAGE_INDEX } from '@constants/constant'; import { PAGE_INDEX } from '@constants/constant';
import { hasRegistered } from '../list.service'; import { hasRegistered } from '../list.service';
import { connectionCanEdit, getTextByDatabaseType, getChartLength } from '../../../../app.service'; import { connectionCanEdit, getTextByDatabaseType, getChartLength } from '../../../../app.service';
import { testConnection } from '../../../maintain/forms/form.server'; import { testConnection } from '../../../maintain/forms/form.server';
import { DownListCombo, Label, SignEditor } from '@fui/core';
export const ListItemXtype = 'dec.dcm.connection.list_item'; export const ListItemXtype = 'dec.dcm.connection.list_item';
@shortcut(ListItemXtype) @shortcut(ListItemXtype)
@ -24,9 +25,9 @@ export class ListItem extends BI.BasicButton {
model: ListItemModel['model']; model: ListItemModel['model'];
comboWidget: any; comboWidget: any;
nameLabel: any; nameLabel: Label;
nameEditor: any; nameEditor: SignEditor;
downListCombo: any; downListCombo: DownListCombo;
watch = { watch = {
isEdit: (isEdit: boolean) => { isEdit: (isEdit: boolean) => {
@ -46,7 +47,7 @@ export class ListItem extends BI.BasicButton {
$scope: name, $scope: name,
items: [{ items: [{
el: { el: {
type: IconLabel, type: BI.IconLabel.xtype,
cls: 'dcm-link-font icon-size-16', cls: 'dcm-link-font icon-size-16',
title: name, title: name,
}, },
@ -55,21 +56,21 @@ export class ListItem extends BI.BasicButton {
type: Vertical, type: Vertical,
items: [ items: [
{ {
type: Label, type: BI.Label.xtype,
text: name, text: name,
textAlign: 'left', textAlign: 'left',
height: 25, height: 25,
title: name, title: name,
ref: (_ref: any) => { ref: (_ref: Label) => {
this.nameLabel = _ref; this.nameLabel = _ref;
}, },
}, },
{ {
type: SignEditor, type: BI.SignEditor.xtype,
$value: 'connection-name', $value: 'connection-name',
value: name, value: name,
invisible: !this.model.isEdit, invisible: !this.model.isEdit,
ref: (_ref: any) => { ref: (_ref: SignEditor) => {
this.nameEditor = _ref; this.nameEditor = _ref;
}, },
listeners: [{ listeners: [{
@ -104,17 +105,17 @@ export class ListItem extends BI.BasicButton {
], ],
}, { }, {
el: databaseType ? { el: databaseType ? {
type: DownListCombo, type: BI.DownListCombo.xtype,
cls: 'link-item-icon', cls: 'link-item-icon',
stopPropagation: true, stopPropagation: true,
hgap: 8, hgap: 8,
el: { el: {
type: IconButton, type: BI.IconButton.xtype,
$value: 'other-edit', $value: 'other-edit',
cls: 'dcm-link-other-font icon-size-16', cls: 'dcm-link-other-font icon-size-16',
}, },
items: this.renderDownList(), items: this.renderDownList(),
ref: (_ref: any) => { ref: (_ref: DownListCombo) => {
this.downListCombo = _ref; this.downListCombo = _ref;
}, },
listeners: [{ listeners: [{

15
src/modules/pages/connection_pool/connection_pool.ts

@ -1,14 +1,15 @@
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { Htape, Vtape, Label, Layout, CenterAdapt, Loader } from 'ui'; import { Htape, Vtape, Layout, CenterAdapt } from 'ui';
import { ConnectionPoolModel, ConnectionPoolModelXtype } from './connection_pool.model'; import { ConnectionPoolModel, ConnectionPoolModelXtype } from './connection_pool.model';
import { ListItemXtype } from './list_item/list_item'; import { ListItemXtype } from './list_item/list_item';
import { PoolXtype } from './pool/pool'; import { PoolXtype } from './pool/pool';
import { PAGE_SIZE } from '@constants/constant'; import { PAGE_SIZE } from '@constants/constant';
import { Label } from '@fui/core';
export const ConnectionPoolXtype = 'dec.dcm.connection_pool'; export const ConnectionPoolXtype = 'dec.dcm.connection_pool';
@shortcut(ConnectionPoolXtype) @shortcut(ConnectionPoolXtype)
@store(ConnectionPoolModelXtype) @store(ConnectionPoolModelXtype)
export class ConnectionPool extends BI.Widget { export class ConnectionPool extends BI.Widget {
title: any; title: Label;
model: ConnectionPoolModel['model']; model: ConnectionPoolModel['model'];
store: ConnectionPoolModel['store']; store: ConnectionPoolModel['store'];
@ -39,7 +40,7 @@ export class ConnectionPool extends BI.Widget {
items: [ items: [
{ {
el: { el: {
type: Label, type: BI.Label.xtype,
cls: 'bi-border-bottom', cls: 'bi-border-bottom',
textAlign: 'left', textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Data_Connections'), text: BI.i18nText('Dec-Dcm_Data_Connections'),
@ -48,7 +49,7 @@ export class ConnectionPool extends BI.Widget {
height: 40, height: 40,
}, },
{ {
type: Loader, type: BI.Loader.xtype,
itemsCreator: (options: {times: number}, populate) => { itemsCreator: (options: {times: number}, populate) => {
populate(this.renderList((options.times - 1) * PAGE_SIZE, options.times * PAGE_SIZE)); populate(this.renderList((options.times - 1) * PAGE_SIZE, options.times * PAGE_SIZE));
}, },
@ -69,11 +70,11 @@ export class ConnectionPool extends BI.Widget {
items: [ items: [
{ {
el: { el: {
type: Label, type: BI.Label.xtype,
cls: 'bi-border-bottom', cls: 'bi-border-bottom',
textAlign: 'left', textAlign: 'left',
lgap: 10, lgap: 10,
ref: (_ref: any) => { ref: (_ref: Label) => {
this.title = _ref; this.title = _ref;
}, },
}, },
@ -103,7 +104,7 @@ export class ConnectionPool extends BI.Widget {
height: 130, height: 130,
}, },
{ {
type: Label, type: BI.Label.xtype,
cls: 'bi-tips', cls: 'bi-tips',
text: BI.i18nText('Dec-Dcm_Connection_NO_Connection_Pool'), text: BI.i18nText('Dec-Dcm_Connection_NO_Connection_Pool'),
}, },

4
src/modules/pages/connection_pool/list_item/list_item.ts

@ -1,5 +1,5 @@
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { VerticalAdapt, Label } from 'ui'; import { VerticalAdapt } from 'ui';
import { ListItemModel, ListItemModelXtype } from './list_item.model'; import { ListItemModel, ListItemModelXtype } from './list_item.model';
export const ListItemXtype = 'dec.dcm.connection_pool.list_item'; export const ListItemXtype = 'dec.dcm.connection_pool.list_item';
@shortcut(ListItemXtype) @shortcut(ListItemXtype)
@ -20,7 +20,7 @@ export class ListItem extends BI.BasicButton {
lgap: 5, lgap: 5,
items: [ items: [
{ {
type: Label, type: BI.Label.xtype,
text: this.options.name, text: this.options.name,
title: this.options.name, title: this.options.name,
width: 250, width: 250,

43
src/modules/pages/connection_pool/pool/pool.ts

@ -1,8 +1,9 @@
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { PoolModel, PoolModelXtype } from './pool.model'; import { PoolModel, PoolModelXtype } from './pool.model';
import { FloatCenter, Vertical, CenterAdapt, Label, VerticalAdapt } from 'ui'; import { FloatCenter, Vertical, CenterAdapt, VerticalAdapt } from 'ui';
import './pool.less'; import './pool.less';
import { ConnectionPoolType } from '../../../crud/crud.typings'; import { ConnectionPoolType } from '../../../crud/crud.typings';
import { Label } from '@fui/core';
export const PoolXtype = 'dec.dcm.connection_pool.pool'; export const PoolXtype = 'dec.dcm.connection_pool.pool';
@shortcut(PoolXtype) @shortcut(PoolXtype)
@ -14,17 +15,17 @@ export class Pool extends BI.Widget {
} }
model: PoolModel['model']; model: PoolModel['model'];
maxActive: any; maxActive: Label;
maxIdle: any; maxIdle: Label;
numActive: any; numActive: Label;
numIdle: any; numIdle: Label;
watch = { watch = {
pool: (pool: ConnectionPoolType) => { pool: (pool: ConnectionPoolType) => {
this.maxActive.setText(pool.maxActive); this.maxActive.setText(`${pool.maxActive}`);
this.maxIdle.setText(pool.maxIdle); this.maxIdle.setText(`${pool.maxIdle}`);
this.numActive.setText(pool.numActive); this.numActive.setText(`${pool.numActive}`);
this.numIdle.setText(pool.numIdle); this.numIdle.setText(`${pool.numIdle}`);
}, },
} }
@ -54,23 +55,23 @@ export class Pool extends BI.Widget {
type: VerticalAdapt, type: VerticalAdapt,
items: [ items: [
{ {
type: Label, type: BI.Label.xtype,
$testId: 'dec-dcm-pool-status-number', $testId: 'dec-dcm-pool-status-number',
$value: 'active', $value: 'active',
cls: 'bi-high-light card-font-heighlight', cls: 'bi-high-light card-font-heighlight',
ref: (_ref: any) => { ref: (_ref: Label) => {
this.numActive = _ref; this.numActive = _ref;
}, },
}, },
{ {
type: Label, type: BI.Label.xtype,
text: '/', text: '/',
}, },
{ {
type: Label, type: BI.Label.xtype,
$testId: 'dec-dcm-pool-status-max', $testId: 'dec-dcm-pool-status-max',
$value: 'active', $value: 'active',
ref: (_ref: any) => { ref: (_ref: Label) => {
this.maxActive = _ref; this.maxActive = _ref;
}, },
}, },
@ -79,7 +80,7 @@ export class Pool extends BI.Widget {
], ],
}, },
{ {
type: Label, type: BI.Label.xtype,
text: BI.i18nText('Dec-Dcm_Active_Connections_Number'), text: BI.i18nText('Dec-Dcm_Active_Connections_Number'),
}, },
], ],
@ -102,23 +103,23 @@ export class Pool extends BI.Widget {
type: VerticalAdapt, type: VerticalAdapt,
items: [ items: [
{ {
type: Label, type: BI.Label.xtype,
$testId: 'dec-dcm-pool-status-number', $testId: 'dec-dcm-pool-status-number',
$value: 'idle', $value: 'idle',
cls: 'bi-high-light card-font-heighlight', cls: 'bi-high-light card-font-heighlight',
ref: (_ref: any) => { ref: (_ref: Label) => {
this.numIdle = _ref; this.numIdle = _ref;
}, },
}, },
{ {
type: Label, type: BI.Label.xtype,
text: '/', text: '/',
}, },
{ {
type: Label, type: BI.Label.xtype,
$testId: 'dec-dcm-pool-status-max', $testId: 'dec-dcm-pool-status-max',
$value: 'idle', $value: 'idle',
ref: (_ref: any) => { ref: (_ref: Label) => {
this.maxIdle = _ref; this.maxIdle = _ref;
}, },
}, },
@ -127,7 +128,7 @@ export class Pool extends BI.Widget {
], ],
}, },
{ {
type: Label, type: BI.Label.xtype,
text: BI.i18nText('Dec-Dcm_Leisure_Connections_Number'), text: BI.i18nText('Dec-Dcm_Leisure_Connections_Number'),
}, },
], ],

39
src/modules/pages/database/database.ts

@ -1,4 +1,4 @@
import { SearchEditor, Vtape, Right, Htape, Vertical, ButtonGroup, Left, Label, MultiSelectItem, CenterAdapt } from 'ui'; import { Vtape, Right, Htape, Vertical, Left, CenterAdapt } from 'ui';
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { FilterXtype } from './filter/filter'; import { FilterXtype } from './filter/filter';
import { DatebaseModel, DatebaseModelXtype } from './database.model'; import { DatebaseModel, DatebaseModelXtype } from './database.model';
@ -6,16 +6,17 @@ import { DATEBASE_FILTER_TYPE, OTHER_JDBC } from '@constants/constant';
import { connectionType } from '@constants/env'; import { connectionType } from '@constants/env';
import { DatebaseTypeXtype } from './database_type/database_type'; import { DatebaseTypeXtype } from './database_type/database_type';
import { getAllDatabaseTypes } from '../../app.service'; import { getAllDatabaseTypes } from '../../app.service';
import { ButtonGroup, MultiSelectItem, SearchEditor } from '@fui/core';
export const DatebaseXtype = 'dec.dcm.datebase'; export const DatebaseXtype = 'dec.dcm.datebase';
@shortcut(DatebaseXtype) @shortcut(DatebaseXtype)
@store(DatebaseModelXtype) @store(DatebaseModelXtype)
export class Datebase extends BI.Widget { export class Datebase extends BI.Widget {
filter: any; filter: ButtonGroup;
search: any; search: SearchEditor;
datebaseType: any; datebaseType: ButtonGroup;
typeFilterWidget: any; typeFilterWidget: any;
internalWidget: any; internalWidget: MultiSelectItem;
pluginWidget: any; pluginWidget: MultiSelectItem;
allDatabaseTypes = getAllDatabaseTypes(); allDatabaseTypes = getAllDatabaseTypes();
@ -80,11 +81,11 @@ export class Datebase extends BI.Widget {
type: Right, type: Right,
items: [ items: [
{ {
type: SearchEditor, type: BI.SearchEditor.xtype,
$value: 'database-type', $value: 'database-type',
width: 300, width: 300,
watermark: BI.i18nText('BI-Basic_Search'), watermark: BI.i18nText('BI-Basic_Search'),
ref: (_ref: any) => { ref: (_ref: SearchEditor) => {
this.search = _ref; this.search = _ref;
}, },
listeners: [ listeners: [
@ -107,12 +108,12 @@ export class Datebase extends BI.Widget {
items: [ items: [
{ {
el: { el: {
type: ButtonGroup, type: BI.ButtonGroup.xtype,
cls: 'bi-border-right', cls: 'bi-border-right',
layouts: [{ layouts: [{
type: Vertical, type: Vertical,
}], }],
ref: (_ref: any) => { ref: (_ref: ButtonGroup) => {
this.filter = _ref; this.filter = _ref;
}, },
items: [ items: [
@ -146,19 +147,19 @@ export class Datebase extends BI.Widget {
invisible: true, invisible: true,
items: [ items: [
{ {
type: Label, type: BI.Label.xtype,
width: 70, width: 70,
textAlign: 'left', textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Type_Filter'), text: BI.i18nText('Dec-Dcm_Connection_Type_Filter'),
title: BI.i18nText('Dec-Dcm_Connection_Type_Filter'), title: BI.i18nText('Dec-Dcm_Connection_Type_Filter'),
}, },
{ {
type: MultiSelectItem, type: BI.MultiSelectItem.xtype,
width: 80, width: 80,
selected: this.model.isInternal, selected: this.model.isInternal,
text: BI.i18nText('Dec-Dcm_Connection_Support_Inner'), text: BI.i18nText('Dec-Dcm_Connection_Support_Inner'),
title: BI.i18nText('Dec-Dcm_Connection_Support_Inner'), title: BI.i18nText('Dec-Dcm_Connection_Support_Inner'),
ref: (_ref: any) => { ref: (_ref: MultiSelectItem) => {
this.internalWidget = _ref; this.internalWidget = _ref;
}, },
handler: () => { handler: () => {
@ -166,12 +167,12 @@ export class Datebase extends BI.Widget {
}, },
}, },
{ {
type: MultiSelectItem, type: BI.MultiSelectItem.xtype,
width: 80, width: 80,
selected: this.model.isPlugin, selected: this.model.isPlugin,
text: BI.i18nText('Dec-Dcm_Connection_Support_Plugin'), text: BI.i18nText('Dec-Dcm_Connection_Support_Plugin'),
title: BI.i18nText('Dec-Dcm_Connection_Support_Plugin'), title: BI.i18nText('Dec-Dcm_Connection_Support_Plugin'),
ref: (_ref: any) => { ref: (_ref: MultiSelectItem) => {
this.pluginWidget = _ref; this.pluginWidget = _ref;
}, },
handler: () => { handler: () => {
@ -179,7 +180,7 @@ export class Datebase extends BI.Widget {
}, },
}, },
{ {
type: Label, type: BI.Label.xtype,
cls: 'bi-tips', cls: 'bi-tips',
textAlign: 'left', textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Filter_Tip'), text: BI.i18nText('Dec-Dcm_Connection_Filter_Tip'),
@ -193,14 +194,14 @@ export class Datebase extends BI.Widget {
height: 24, height: 24,
}, },
{ {
type: ButtonGroup, type: BI.ButtonGroup.xtype,
hgap: 15, hgap: 15,
layouts: [{ layouts: [{
type: Left, type: Left,
scrolly: true, scrolly: true,
}], }],
items: this.renderDatebaseType(), items: this.renderDatebaseType(),
ref: (_ref: any) => { ref: (_ref: ButtonGroup) => {
this.datebaseType = _ref; this.datebaseType = _ref;
}, },
}, },
@ -236,7 +237,7 @@ export class Datebase extends BI.Widget {
height: '100%', height: '100%',
width: '100%', width: '100%',
items: [{ items: [{
type: Label, type: BI.Label.xtype,
cls: 'bi-tips', cls: 'bi-tips',
text: BI.i18nText('Dec-Dcm_Connection_No_Search_Result'), text: BI.i18nText('Dec-Dcm_Connection_No_Search_Result'),
}], }],

11
src/modules/pages/database/database_type/database_type.ts

@ -1,9 +1,10 @@
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { Vtape, Label, Absolute, Img } from 'ui'; import { Vtape, Absolute } from 'ui';
import { DatebaseTypeModel, DatebaseTypeModelXtype } from './database_type.model'; import { DatebaseTypeModel, DatebaseTypeModelXtype } from './database_type.model';
import { ImgPrefix, PluginImgPrefix } from '@constants/env'; import { ImgPrefix, PluginImgPrefix } from '@constants/env';
import './database_type.less'; import './database_type.less';
import { PAGE_INDEX } from '@constants/constant'; import { PAGE_INDEX } from '@constants/constant';
import { Img } from '@fui/core';
export const DatebaseTypeXtype = 'dec.dcm.datebase.type'; export const DatebaseTypeXtype = 'dec.dcm.datebase.type';
@shortcut(DatebaseTypeXtype) @shortcut(DatebaseTypeXtype)
@ -22,7 +23,7 @@ export class DatebaseType extends BI.BasicButton {
$testId: 'dec-dcm-database-type', $testId: 'dec-dcm-database-type',
} }
img: any; img: Img;
store: DatebaseTypeModel['store']; store: DatebaseTypeModel['store'];
@ -39,16 +40,16 @@ export class DatebaseType extends BI.BasicButton {
items: [ items: [
{ {
el: { el: {
type: Img, type: BI.Img.xtype,
src: iconUrl ? this.getIconUrl(iconUrl) : `${ImgPrefix}${databaseType}.jpg`, src: iconUrl ? this.getIconUrl(iconUrl) : `${ImgPrefix}${databaseType}.jpg`,
ref: (_ref: any) => { ref: (_ref: Img) => {
this.img = _ref; this.img = _ref;
}, },
}, },
height: 90, height: 90,
}, },
{ {
type: Label, type: BI.Label.xtype,
cls: 'bi-header-background', cls: 'bi-header-background',
text, text,
title: text, title: text,

3
src/modules/pages/database/filter/filter.ts

@ -1,5 +1,4 @@
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { Label } from 'ui';
import { FilterModel, FilterModelXtype } from './filter.model'; import { FilterModel, FilterModelXtype } from './filter.model';
export const FilterXtype = 'dec.dcm.datebase.filter'; export const FilterXtype = 'dec.dcm.datebase.filter';
@ -18,7 +17,7 @@ export class Filter extends BI.BasicButton {
const { text } = this.options; const { text } = this.options;
return { return {
type: Label, type: BI.Label.xtype,
textAlign: 'left', textAlign: 'left',
height: 25, height: 25,
lgap: 10, lgap: 10,

4
src/modules/pages/maintain/components/form_item/form_item.ts

@ -1,5 +1,5 @@
import { shortcut } from '@core/core'; import { shortcut } from '@core/core';
import { Label, Left } from 'ui'; import { Left } from 'ui';
import { CONNECTION_LAYOUT } from '@constants/constant'; import { CONNECTION_LAYOUT } from '@constants/constant';
export const FormItemXtype = 'dec.dcm.Maintain_form_item'; export const FormItemXtype = 'dec.dcm.Maintain_form_item';
@shortcut(FormItemXtype) @shortcut(FormItemXtype)
@ -17,7 +17,7 @@ export class FormItem extends BI.Widget {
type: Left, type: Left,
items: [ items: [
{ {
type: Label, type: BI.Label.xtype,
cls: this.options.isBold ? 'bi-font-bold' : '', cls: this.options.isBold ? 'bi-font-bold' : '',
width: this.options.nameWidth, width: this.options.nameWidth,
textAlign: 'left', textAlign: 'left',

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

@ -1,5 +1,5 @@
import { shortcut } from '@core/core'; import { shortcut } from '@core/core';
import { Vertical, TextEditor, TextValueCombo, Label, TextAreaEditor, Editor, EdirotIconCheckCombo, Left, TextButton, Layout } from 'ui'; import { Vertical, Left, Layout } from 'ui';
import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse'; import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
import { FormItemXtype } from '../../components/form_item/form_item'; import { FormItemXtype } from '../../components/form_item/form_item';
import { Connection, ConnectionJDBC, ConnectionPoolJDBC } from 'src/modules/crud/crud.typings'; import { Connection, ConnectionJDBC, ConnectionPoolJDBC } from 'src/modules/crud/crud.typings';
@ -8,6 +8,7 @@ import { CONNECT_CHARSET, CONNECTION_LAYOUT, INT_MAX_VALUE, INT_MIN_VALUE } from
import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl } from '../../../../app.service'; import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl } from '../../../../app.service';
import { TextCheckerXtype } from '../../../../components/text_checker/text_checker'; import { TextCheckerXtype } from '../../../../components/text_checker/text_checker';
import { ApiFactory } from 'src/modules/crud/apiFactory'; import { ApiFactory } from 'src/modules/crud/apiFactory';
import { Editor, EditorIconCheckCombo, Label, TextAreaEditor, TextEditor, TextValueCombo } from '@fui/core';
const api = new ApiFactory().create(); const api = new ApiFactory().create();
export const FormJdbcXtype = 'dec.dcm.maintain.form.jdbc'; export const FormJdbcXtype = 'dec.dcm.maintain.form.jdbc';
@ -95,12 +96,12 @@ export class FormJdbc extends BI.Widget {
type: FormItemXtype, type: FormItemXtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'), name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
forms: [{ forms: [{
type: EdirotIconCheckCombo, type: BI.EditorIconCheckCombo.xtype,
$testId: 'dec-editor-icon-check-combo', $testId: 'dec-editor-icon-check-combo',
$value: 'driver', $value: 'driver',
width: 300, width: 300,
value: driver, value: driver,
ref: (_ref: any) => { ref: (_ref: EditorIconCheckCombo) => {
this.form.driver = _ref; this.form.driver = _ref;
}, },
items: this.getDrivers(), items: this.getDrivers(),
@ -124,7 +125,7 @@ export class FormJdbc extends BI.Widget {
type: FormItemXtype, type: FormItemXtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'), name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'),
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'database-name', $value: 'database-name',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
@ -145,7 +146,7 @@ export class FormJdbc extends BI.Widget {
type: FormItemXtype, type: FormItemXtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Host'), name: BI.i18nText('Dec-Dcm_Connection_Form_Host'),
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'database-host', $value: 'database-host',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
@ -193,11 +194,11 @@ export class FormJdbc extends BI.Widget {
name: BI.i18nText('Dec-Dcm_Connection_Form_AuthType'), name: BI.i18nText('Dec-Dcm_Connection_Form_AuthType'),
invisible: !databaseType.kerberos, invisible: !databaseType.kerberos,
forms: [{ forms: [{
type: TextValueCombo, type: BI.TextValueCombo.xtype,
$value: 'auth-type', $value: 'auth-type',
width: 300, width: 300,
value: authType, value: authType,
ref: (_ref: any) => { ref: (_ref: TextValueCombo) => {
this.form.authType = _ref; this.form.authType = _ref;
}, },
items: [ items: [
@ -233,13 +234,13 @@ export class FormJdbc extends BI.Widget {
this.formUser = _ref; this.formUser = _ref;
}, },
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'username', $value: 'username',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: user, value: user,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_UserName'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.user = _ref; this.form.user = _ref;
}, },
}], }],
@ -252,7 +253,7 @@ export class FormJdbc extends BI.Widget {
this.formPassword = _ref; this.formPassword = _ref;
}, },
forms: [{ forms: [{
type: Editor, type: BI.Editor.xtype,
$value: 'password', $value: 'password',
cls: 'bi-border bi-border-radius', cls: 'bi-border bi-border-radius',
width: 300, width: 300,
@ -262,7 +263,7 @@ export class FormJdbc extends BI.Widget {
inputType: 'password', inputType: 'password',
autocomplete: 'new-password', autocomplete: 'new-password',
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Password'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
ref: (_ref: any) => { ref: (_ref: Editor) => {
this.form.password = _ref; this.form.password = _ref;
}, },
}], }],
@ -275,13 +276,13 @@ export class FormJdbc extends BI.Widget {
this.formPrincipal = _ref; this.formPrincipal = _ref;
}, },
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'principal', $value: 'principal',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: principal, value: principal,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Principal'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Principal'),
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.principal = _ref; this.form.principal = _ref;
}, },
}], }],
@ -294,7 +295,7 @@ export class FormJdbc extends BI.Widget {
this.formKeyPath = _ref; this.formKeyPath = _ref;
}, },
forms: [{ forms: [{
type: Editor, type: BI.Editor.xtype,
$value: 'key-path', $value: 'key-path',
cls: 'bi-border', cls: 'bi-border',
width: 300, width: 300,
@ -302,18 +303,18 @@ export class FormJdbc extends BI.Widget {
allowBlank: true, allowBlank: true,
value: keyPath, value: keyPath,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_KeyPath'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_KeyPath'),
ref: (_ref: any) => { ref: (_ref: Editor) => {
this.form.keyPath = _ref; this.form.keyPath = _ref;
}, },
}], }],
}, },
{ {
type: Label, type: BI.Label.xtype,
cls: 'bi-tips', cls: 'bi-tips',
textAlign: 'left', textAlign: 'left',
invisible: true, invisible: true,
text: BI.i18nText('Dec-Dcm_Connection_JDBC_Warning'), text: BI.i18nText('Dec-Dcm_Connection_JDBC_Warning'),
ref: (_ref: any) => { ref: (_ref: Label) => {
this.labelTips = _ref; this.labelTips = _ref;
}, },
}, },
@ -321,12 +322,12 @@ export class FormJdbc extends BI.Widget {
type: FormItemXtype, type: FormItemXtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
forms: [{ forms: [{
type: TextValueCombo, type: BI.TextValueCombo.xtype,
$value: 'original-charset-name', $value: 'original-charset-name',
width: 300, width: 300,
value: originalCharsetName ? originalCharsetName : '', value: originalCharsetName ? originalCharsetName : '',
items: CONNECT_CHARSET, items: CONNECT_CHARSET,
ref: (_ref: any) => { ref: (_ref: TextValueCombo) => {
this.form.originalCharsetName = _ref; this.form.originalCharsetName = _ref;
}, },
}], }],
@ -341,27 +342,27 @@ export class FormJdbc extends BI.Widget {
items: [{ items: [{
type: Left, type: Left,
items: [{ items: [{
type: TextButton, type: BI.TextButton.xtype,
cls: 'bi-high-light', cls: 'bi-high-light',
text: BI.i18nText('Dec-Dcm_Connection_Click_Connect_Database'), text: BI.i18nText('Dec-Dcm_Connection_Click_Connect_Database'),
handler: () => { handler: () => {
this.fireEvent('EVENT_TEST_CONNECTION'); this.fireEvent('EVENT_TEST_CONNECTION');
}, },
}, { }, {
type: Label, type: BI.Label.xtype,
cls: 'bi-tips', cls: 'bi-tips',
lgap: 3, lgap: 3,
text: BI.i18nText('Dec-Dcm_Connection_Read_Mode_List'), text: BI.i18nText('Dec-Dcm_Connection_Read_Mode_List'),
}], }],
}, { }, {
type: TextValueCombo, type: BI.TextValueCombo.xtype,
$value: 'schema', $value: 'schema',
width: 300, width: 300,
vgap: 15, vgap: 15,
disabled: true, disabled: true,
value: schema, value: schema,
items: schema ? [{ text: schema, value:schema }] : [], items: schema ? [{ text: schema, value:schema }] : [],
ref: (_ref: any) => { ref: (_ref: TextValueCombo) => {
this.form.schema = _ref; this.form.schema = _ref;
}, },
}], }],
@ -376,13 +377,13 @@ export class FormJdbc extends BI.Widget {
type: FormItemXtype, type: FormItemXtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'), name: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'),
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'database-url', $value: 'database-url',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: url, value: url,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'),
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.url = _ref; this.form.url = _ref;
}, },
listeners: [{ listeners: [{
@ -521,7 +522,7 @@ export class FormJdbc extends BI.Widget {
}, },
}, },
{ {
type: Label, type: BI.Label.xtype,
lgap: 5, lgap: 5,
height: CONNECTION_LAYOUT.labelHeight, height: CONNECTION_LAYOUT.labelHeight,
text: BI.i18nText('Dec-Dcm_Millisecond'), text: BI.i18nText('Dec-Dcm_Millisecond'),
@ -532,7 +533,7 @@ export class FormJdbc extends BI.Widget {
type: FormItemXtype, type: FormItemXtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'), name: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'),
forms: [{ forms: [{
type: TextAreaEditor, type: BI.TextAreaEditor.xtype,
$value: 'validation-query', $value: 'validation-query',
cls: 'bi-border', cls: 'bi-border',
allowBlank: true, allowBlank: true,
@ -540,7 +541,7 @@ export class FormJdbc extends BI.Widget {
value: validationQuery, value: validationQuery,
width: 300, width: 300,
height: 100, height: 100,
ref: (_ref: any) => { ref: (_ref: TextAreaEditor) => {
this.form.validationQuery = _ref; this.form.validationQuery = _ref;
}, },
}], }],
@ -549,14 +550,14 @@ export class FormJdbc extends BI.Widget {
type: FormItemXtype, type: FormItemXtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'), name: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'),
forms: [{ forms: [{
type: TextValueCombo, type: BI.TextValueCombo.xtype,
$value: 'check', $value: 'check',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: testOnBorrow, value: testOnBorrow,
items: this.getBooleanItem(), items: this.getBooleanItem(),
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'),
ref: (_ref: any) => { ref: (_ref: TextValueCombo) => {
this.form.testOnBorrow = _ref; this.form.testOnBorrow = _ref;
}, },
}], }],
@ -565,14 +566,14 @@ export class FormJdbc extends BI.Widget {
type: FormItemXtype, type: FormItemXtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'), name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'),
forms: [{ forms: [{
type: TextValueCombo, type: BI.TextValueCombo.xtype,
$value: 'test-on-return', $value: 'test-on-return',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: testOnReturn, value: testOnReturn,
items: this.getBooleanItem(), items: this.getBooleanItem(),
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'),
ref: (_ref: any) => { ref: (_ref: TextValueCombo) => {
this.form.testOnReturn = _ref; this.form.testOnReturn = _ref;
}, },
}], }],
@ -581,14 +582,14 @@ export class FormJdbc extends BI.Widget {
type: FormItemXtype, type: FormItemXtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'), name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'),
forms: [{ forms: [{
type: TextValueCombo, type: BI.TextValueCombo.xtype,
$value: 'test-while-idle', $value: 'test-while-idle',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: testWhileIdle, value: testWhileIdle,
items: this.getBooleanItem(), items: this.getBooleanItem(),
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'),
ref: (_ref: any) => { ref: (_ref: TextValueCombo) => {
this.form.testWhileIdle = _ref; this.form.testWhileIdle = _ref;
}, },
}], }],
@ -614,7 +615,7 @@ export class FormJdbc extends BI.Widget {
}, },
}, },
{ {
type: Label, type: BI.Label.xtype,
lgap: 5, lgap: 5,
height: CONNECTION_LAYOUT.labelHeight, height: CONNECTION_LAYOUT.labelHeight,
text: BI.i18nText('Dec-Dcm_Millisecond'), text: BI.i18nText('Dec-Dcm_Millisecond'),
@ -662,7 +663,7 @@ export class FormJdbc extends BI.Widget {
}, },
}, },
{ {
type: Label, type: BI.Label.xtype,
lgap: 5, lgap: 5,
height: CONNECTION_LAYOUT.labelHeight, height: CONNECTION_LAYOUT.labelHeight,
text: BI.i18nText('BI-Basic_Seconds'), text: BI.i18nText('BI-Basic_Seconds'),

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

@ -1,11 +1,12 @@
import { shortcut } from '@core/core'; import { shortcut } from '@core/core';
import { Vertical, TextEditor, Htape, Left, Label, TextValueCombo, EdirotIconCheckCombo } from 'ui'; import { Vertical, Htape, Left } from 'ui';
import { FormItemXtype } from '../../components/form_item/form_item'; import { FormItemXtype } from '../../components/form_item/form_item';
import { ConnectionJNDI, Connection, ContextHashtable } from 'src/modules/crud/crud.typings'; import { ConnectionJNDI, Connection, ContextHashtable } from 'src/modules/crud/crud.typings';
import { CONNECT_CHARSET, CONNECTION_LAYOUT, JNDI_FACTORYS } from '@constants/constant'; import { CONNECT_CHARSET, CONNECTION_LAYOUT, JNDI_FACTORYS } from '@constants/constant';
import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse'; import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
import { connectionType } from '@constants/env'; import { connectionType } from '@constants/env';
import { TextCheckerXtype } from '../../../../components/text_checker/text_checker'; import { TextCheckerXtype } from '../../../../components/text_checker/text_checker';
import { EditorIconCheckCombo, TextEditor, TextValueCombo } from '@fui/core';
export const FormJndiXtype = 'dec.dcm.maintain.form.jndi'; export const FormJndiXtype = 'dec.dcm.maintain.form.jndi';
@shortcut(FormJndiXtype) @shortcut(FormJndiXtype)
export class FormJndi extends BI.Widget { export class FormJndi extends BI.Widget {
@ -64,12 +65,12 @@ export class FormJndi extends BI.Widget {
name: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_ConnectionName'), name: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_ConnectionName'),
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'jdni-name', $value: 'jdni-name',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: jndiName, value: jndiName,
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.jndiName = _ref; this.form.jndiName = _ref;
}, },
}], }],
@ -83,7 +84,7 @@ export class FormJndi extends BI.Widget {
type: Left, type: Left,
items: [ items: [
{ {
type: Label, type: BI.Label.xtype,
cls: 'bi-font-bold', cls: 'bi-font-bold',
textAlign: 'left', textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_Connection'), text: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_Connection'),
@ -103,12 +104,12 @@ export class FormJndi extends BI.Widget {
nameWidth: 200, nameWidth: 200,
isBold: false, isBold: false,
forms: [{ forms: [{
type: EdirotIconCheckCombo, type: BI.EditorIconCheckCombo.xtype,
$testId: 'dec-editor-icon-check-combo', $testId: 'dec-editor-icon-check-combo',
$value: 'initial', $value: 'initial',
width: 300, width: 300,
value: contextHashtable['java.naming.factory.initial'], value: contextHashtable['java.naming.factory.initial'],
ref: (_ref: any) => { ref: (_ref: EditorIconCheckCombo) => {
this.form.initial = _ref; this.form.initial = _ref;
}, },
items: JNDI_FACTORYS.map(item => { items: JNDI_FACTORYS.map(item => {
@ -133,12 +134,12 @@ export class FormJndi extends BI.Widget {
isBold: false, isBold: false,
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'provider-url', $value: 'provider-url',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: contextHashtable['java.naming.provider.url'], value: contextHashtable['java.naming.provider.url'],
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.providerUrl = _ref; this.form.providerUrl = _ref;
}, },
}], }],
@ -149,12 +150,12 @@ export class FormJndi extends BI.Widget {
isBold: false, isBold: false,
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'security-principal', $value: 'security-principal',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: contextHashtable['java.naming.security.principal'], value: contextHashtable['java.naming.security.principal'],
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.securityPrincipal = _ref; this.form.securityPrincipal = _ref;
}, },
}], }],
@ -165,18 +166,18 @@ export class FormJndi extends BI.Widget {
isBold: false, isBold: false,
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'security-credentials', $value: 'security-credentials',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: contextHashtable['java.naming.security.credentials'], value: contextHashtable['java.naming.security.credentials'],
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.securityCredentials = _ref; this.form.securityCredentials = _ref;
}, },
}], }],
}, },
{ {
type: Label, type: BI.Label.xtype,
bgap: -15, bgap: -15,
cls: 'bi-tips', cls: 'bi-tips',
textAlign: 'left', textAlign: 'left',
@ -191,12 +192,12 @@ export class FormJndi extends BI.Widget {
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextValueCombo, type: BI.TextValueCombo.xtype,
$value: 'new-charset-name', $value: 'new-charset-name',
width: 300, width: 300,
value: newCharsetName ? newCharsetName : '', value: newCharsetName ? newCharsetName : '',
items: CONNECT_CHARSET, items: CONNECT_CHARSET,
ref: (_ref: any) => { ref: (_ref: TextValueCombo) => {
this.form.newCharsetName = _ref; this.form.newCharsetName = _ref;
}, },
}], }],
@ -228,12 +229,12 @@ export class FormJndi extends BI.Widget {
name: 'OBJECT_FACTORIES', name: 'OBJECT_FACTORIES',
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'factory-object', $value: 'factory-object',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: contextHashtable['java.naming.factory.object'], value: contextHashtable['java.naming.factory.object'],
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.factoryObject = _ref; this.form.factoryObject = _ref;
}, },
}], }],
@ -243,12 +244,12 @@ export class FormJndi extends BI.Widget {
name: 'STATE_FACTORIES', name: 'STATE_FACTORIES',
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'factory-state', $value: 'factory-state',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: contextHashtable['java.naming.factory.state'], value: contextHashtable['java.naming.factory.state'],
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.factoryState = _ref; this.form.factoryState = _ref;
}, },
}], }],
@ -258,12 +259,12 @@ export class FormJndi extends BI.Widget {
name: 'URL_PKG_PREFIXES', name: 'URL_PKG_PREFIXES',
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'factory-url-pkgs', $value: 'factory-url-pkgs',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: contextHashtable['java.naming.factory.url.pkgs'], value: contextHashtable['java.naming.factory.url.pkgs'],
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.factoryUrlPkgs = _ref; this.form.factoryUrlPkgs = _ref;
}, },
}], }],
@ -273,12 +274,12 @@ export class FormJndi extends BI.Widget {
name: 'DNS_URL', name: 'DNS_URL',
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'dns-url', $value: 'dns-url',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: contextHashtable['java.naming.dns.url'], value: contextHashtable['java.naming.dns.url'],
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.dnsUrl = _ref; this.form.dnsUrl = _ref;
}, },
}], }],
@ -288,12 +289,12 @@ export class FormJndi extends BI.Widget {
name: 'AUTHORITATIVE', name: 'AUTHORITATIVE',
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'authoritative', $value: 'authoritative',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: contextHashtable['java.naming.authoritative'], value: contextHashtable['java.naming.authoritative'],
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.authoritative = _ref; this.form.authoritative = _ref;
}, },
}], }],
@ -303,12 +304,12 @@ export class FormJndi extends BI.Widget {
name: 'BATCHSIZE', name: 'BATCHSIZE',
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'batchsize', $value: 'batchsize',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: contextHashtable['java.naming.batchsize'], value: contextHashtable['java.naming.batchsize'],
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.batchsize = _ref; this.form.batchsize = _ref;
}, },
}], }],
@ -318,12 +319,12 @@ export class FormJndi extends BI.Widget {
name: 'REFERRAL', name: 'REFERRAL',
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'referral', $value: 'referral',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: contextHashtable['java.naming.referral'], value: contextHashtable['java.naming.referral'],
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.referral = _ref; this.form.referral = _ref;
}, },
}], }],
@ -333,12 +334,12 @@ export class FormJndi extends BI.Widget {
name: 'SECURITY_PROTOCOL', name: 'SECURITY_PROTOCOL',
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'security-protocol', $value: 'security-protocol',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: contextHashtable['java.naming.security.protocol'], value: contextHashtable['java.naming.security.protocol'],
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.securityProtocol = _ref; this.form.securityProtocol = _ref;
}, },
}], }],
@ -348,12 +349,12 @@ export class FormJndi extends BI.Widget {
name: 'SECURITY_AUTHENTICATION', name: 'SECURITY_AUTHENTICATION',
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'security-authentication', $value: 'security-authentication',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: contextHashtable['java.naming.security.authentication'], value: contextHashtable['java.naming.security.authentication'],
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.authentication = _ref; this.form.authentication = _ref;
}, },
}], }],
@ -363,12 +364,12 @@ export class FormJndi extends BI.Widget {
name: 'LANGUAGE', name: 'LANGUAGE',
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'language', $value: 'language',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: contextHashtable['java.naming.language'], value: contextHashtable['java.naming.language'],
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.language = _ref; this.form.language = _ref;
}, },
}], }],
@ -378,12 +379,12 @@ export class FormJndi extends BI.Widget {
name: 'APPLET', name: 'APPLET',
nameWidth: 200, nameWidth: 200,
forms: [{ forms: [{
type: TextEditor, type: BI.TextEditor.xtype,
$value: 'applet', $value: 'applet',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: contextHashtable['java.naming.applet'], value: contextHashtable['java.naming.applet'],
ref: (_ref: any) => { ref: (_ref: TextEditor) => {
this.form.applet = _ref; this.form.applet = _ref;
}, },
}], }],

7
src/modules/pages/maintain/maintain.ts

@ -1,4 +1,4 @@
import { Vtape, Label, VerticalAdapt, ListView, IconButton } from 'ui'; import { Vtape, VerticalAdapt, ListView } from 'ui';
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { MaintainModel, MaintainModelXtype } from './maintain.model'; import { MaintainModel, MaintainModelXtype } from './maintain.model';
import { MaintainFormXtype } from './forms/form'; import { MaintainFormXtype } from './forms/form';
@ -19,6 +19,7 @@ export class Maintain extends BI.Widget {
store: MaintainModel['store']; store: MaintainModel['store'];
listView: any; listView: any;
socketTip: any;
render() { render() {
const { isEdit, databaseType } = this.getEditConnection(); const { isEdit, databaseType } = this.getEditConnection();
@ -35,7 +36,7 @@ export class Maintain extends BI.Widget {
hgap: 5, hgap: 5,
items: [ items: [
{ {
type: IconButton, type: BI.IconButton.xtype,
$value: 'back-databases', $value: 'back-databases',
cls: 'dcm-back-font', cls: 'dcm-back-font',
height: 15, height: 15,
@ -45,7 +46,7 @@ export class Maintain extends BI.Widget {
}, },
}, },
{ {
type: Label, type: BI.Label.xtype,
text: titleText, text: titleText,
height: 15, height: 15,
}, },

15
src/modules/title/title.ts

@ -1,9 +1,10 @@
import { LeftRightVerticalAdapt, VerticalAdapt, LinearSegment, Tab } from 'ui'; import { LeftRightVerticalAdapt, VerticalAdapt } from 'ui';
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { TitleModel, TitleModelXtype } from './title.model'; import { TitleModel, TitleModelXtype } from './title.model';
import { PAGE_INDEX } from '@constants/constant'; import { PAGE_INDEX } from '@constants/constant';
import { TitleDatabase } from './title_database/title_datebase'; import { TitleDatabase } from './title_database/title_datebase';
import { TitleMaintain } from './title_maintain/title_maintain'; import { TitleMaintain } from './title_maintain/title_maintain';
import { LinearSegment, Tab } from '@fui/core';
export const TitleXtype = 'dec.dcm.title'; export const TitleXtype = 'dec.dcm.title';
@shortcut(TitleXtype) @shortcut(TitleXtype)
@ -12,8 +13,8 @@ export class Title extends BI.Widget {
props = { props = {
baseCls: 'bi-card', baseCls: 'bi-card',
} }
tab: any; tab: Tab;
linearSegment: any; linearSegment: LinearSegment;
model: TitleModel['model']; model: TitleModel['model'];
store: TitleModel['store']; store: TitleModel['store'];
@ -31,14 +32,14 @@ export class Title extends BI.Widget {
items: { items: {
left: [ left: [
{ {
type: LinearSegment, type: BI.LinearSegment.xtype,
cls: 'bi-font-bold', cls: 'bi-font-bold',
height: 40, height: 40,
hgap: 10, hgap: 10,
layouts: [{ layouts: [{
type: VerticalAdapt, type: VerticalAdapt,
}], }],
ref: (_ref: any) => { ref: (_ref: LinearSegment) => {
this.linearSegment = _ref; this.linearSegment = _ref;
}, },
items: [ items: [
@ -66,10 +67,10 @@ export class Title extends BI.Widget {
], ],
right: [ right: [
{ {
type: Tab, type: BI.Tab.xtype,
height: 40, height: 40,
showIndex: this.model.pageIndex, showIndex: this.model.pageIndex,
ref: (_ref: any) => { ref: (_ref: Tab) => {
this.tab = _ref; this.tab = _ref;
}, },
cardCreator: (index: string) => { cardCreator: (index: string) => {

11
src/modules/title/title_database/title_datebase.ts

@ -1,7 +1,8 @@
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { Right, Button, VerticalAdapt } from 'ui'; import { Right, VerticalAdapt } from 'ui';
import { TitleDatebaseModel, TitleDatebaseModelXtype } from './title_datebase.model'; import { TitleDatebaseModel, TitleDatebaseModelXtype } from './title_datebase.model';
import { PAGE_INDEX } from '@constants/constant'; import { PAGE_INDEX } from '@constants/constant';
import { Button } from '@fui/core';
export const TitleDatabase = 'dec.dcm.title.datebase'; export const TitleDatabase = 'dec.dcm.title.datebase';
@ -11,7 +12,7 @@ export class TitleDatabaseWidget extends BI.Widget {
store: TitleDatebaseModel['store']; store: TitleDatebaseModel['store'];
model: TitleDatebaseModel['model']; model: TitleDatebaseModel['model'];
submitButton: any; submitButton: Button;
watch = { watch = {
datebaseTypeSelected: (datebaseTypeSelected: string) => { datebaseTypeSelected: (datebaseTypeSelected: string) => {
@ -28,7 +29,7 @@ export class TitleDatabaseWidget extends BI.Widget {
rgap: 5, rgap: 5,
items: [ items: [
{ {
type: Button, type: BI.Button.xtype,
$value: 'title-database-cancel', $value: 'title-database-cancel',
text: BI.i18nText('BI-Basic_Cancel'), text: BI.i18nText('BI-Basic_Cancel'),
level: 'ignore', level: 'ignore',
@ -37,11 +38,11 @@ export class TitleDatabaseWidget extends BI.Widget {
}, },
}, },
{ {
type: Button, type: BI.Button.xtype,
$value: 'title-database-save', $value: 'title-database-save',
text: BI.i18nText('BI-Basic_Save'), text: BI.i18nText('BI-Basic_Save'),
disabled: !this.model.datebaseTypeSelected, disabled: !this.model.datebaseTypeSelected,
ref: (_ref: any) => { ref: (_ref: Button) => {
this.submitButton = _ref; this.submitButton = _ref;
}, },
handler: () => { handler: () => {

8
src/modules/title/title_maintain/title_maintain.ts

@ -1,5 +1,5 @@
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { Right, Button, VerticalAdapt } from 'ui'; import { Right, VerticalAdapt } from 'ui';
import { TitleMaintainModel, TitleMaintainModelXtype } from './title_maintain.model'; import { TitleMaintainModel, TitleMaintainModelXtype } from './title_maintain.model';
import { PAGE_INDEX } from '@constants/constant'; import { PAGE_INDEX } from '@constants/constant';
@ -18,7 +18,7 @@ export class TitleMaintainWidget extends BI.Widget {
rgap: 5, rgap: 5,
items: [ items: [
{ {
type: Button, type: BI.Button.xtype,
$value: 'title-maintain-cancel', $value: 'title-maintain-cancel',
text: BI.i18nText('BI-Basic_Cancel'), text: BI.i18nText('BI-Basic_Cancel'),
level: 'ignore', level: 'ignore',
@ -29,7 +29,7 @@ export class TitleMaintainWidget extends BI.Widget {
}, },
}, },
{ {
type: Button, type: BI.Button.xtype,
$value: 'title-maintain-connection-test', $value: 'title-maintain-connection-test',
text: BI.i18nText('Dec-Dcm_Connection_Test'), text: BI.i18nText('Dec-Dcm_Connection_Test'),
level: 'ignore', level: 'ignore',
@ -38,7 +38,7 @@ export class TitleMaintainWidget extends BI.Widget {
}, },
}, },
{ {
type: Button, type: BI.Button.xtype,
$value: 'title-maintain-save', $value: 'title-maintain-save',
text: BI.i18nText('BI-Basic_Save'), text: BI.i18nText('BI-Basic_Save'),
handler: () => { handler: () => {

54
src/ui/fineui.ts

@ -1,57 +1,3 @@
export const Icon = 'bi.icon';
export const IconTextItem = 'bi.icon_text_item';
export const IconTextIconItem = 'bi.icon_text_icon_item';
export const IconButton = 'bi.icon_button';
export const IconChangeButton = 'bi.icon_change_button';
export const TextButton = 'bi.text_button';
export const DownListCombo = 'bi.down_list_combo';
export const Label = 'bi.label';
export const SmallTextEditor = 'bi.small_text_editor';
export const MultiFileEditor = 'bi.multifile_editor';
export const SignEditor = 'bi.sign_editor';
export const Button = 'bi.button';
export const TextEditor = 'bi.text_editor';
export const MultiSelectInsertCombo = 'bi.multi_select_insert_combo';
export const MultiSelectCombo = 'bi.multi_select_combo';
export const ButtonGroup = 'bi.button_group';
export const AllValueChooserCombo = 'bi.all_value_chooser_combo';
export const TextAreaEditor = 'bi.textarea_editor';
export const MultiSelectItem = 'bi.multi_select_item';
export const BarPopOver = 'bi.bar_popover';
export const DynamicDateCombo = 'bi.dynamic_date_combo';
export const DynamicDateTimeCombo = 'bi.dynamic_date_time_combo';
export const MultiTreeCombo = 'bi.multi_tree_combo';
export const RichEditor = 'bi.rich_editor';
export const NicEditor = 'bi.nic_editor';
export const Editor = 'bi.editor';
export const MultiTreePopupView = 'bi.multi_tree_popup_view';
export const SingleSelectRadioItem = 'bi.single_select_radio_item';
export const SingleSelectInsertCombo = 'bi.single_select_insert_combo';
export const SingleSelectCombo = 'bi.single_select_combo';
export const Tab = 'bi.tab';
export const DynamicYearMonthCombo = 'bi.dynamic_year_month_combo';
export const Text = 'bi.text';
export const Combo = 'bi.combo';
export const TimeCombo = 'bi.time_combo';
export const IFrame = 'bi.iframe';
export const MultiTreeInsertCombo = 'bi.multi_tree_insert_combo';
export const MultiTreeListCombo = 'bi.multi_tree_list_combo';
export const MultilayerSingleTreeCombo = 'bi.multilayer_single_tree_combo';
export const MultilayerSelectTreeCombo = 'bi.multilayer_select_tree_combo';
export const AsyncTree = 'bi.async_tree';
export const ListAsyncTree = 'bi.list_async_tree';
export const MultilayerSingleTreePopup = 'bi.multilayer_single_tree_popup';
export const MultilayerSelectTreePopup = 'bi.multilayer_select_tree_popup';
export const IconLabel = 'bi.icon_label';
export const Radio = 'bi.radio';
export const LinearSegment = 'bi.linear_segment';
export const SearchEditor = 'bi.search_editor';
export const Img = 'bi.img';
export const BubbleCombo = 'bi.bubble_combo';
export const TextBubblePopupBarView = 'bi.text_bubble_bar_popup_view';
export const TextValueCombo = 'bi.text_value_combo';
export const Loader = 'bi.loader';
export const EdirotIconCheckCombo = 'bi.editor_icon_check_combo';
// 布局 // 布局
export const VerticalAdapt = 'bi.vertical_adapt'; export const VerticalAdapt = 'bi.vertical_adapt';
export const Vtape = 'bi.vtape'; export const Vtape = 'bi.vtape';

1
tsconfig.json

@ -19,6 +19,7 @@
// "noUnusedParameters": true, // "noUnusedParameters": true,
// "noImplicitReturns": true, // "noImplicitReturns": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"paths": { "paths": {
"ui": ["./src/ui"], "ui": ["./src/ui"],
"ReportCst": ["./private/constants"], "ReportCst": ["./private/constants"],

2
types/globals.d.ts vendored

@ -2,7 +2,7 @@ interface Obj {
[key: string]: any; [key: string]: any;
} }
declare let BI: Obj & import('fineui')._BI; declare let BI: Obj & import('@fui/core').BI & import('@fui/materials').BI;
declare const Fix: Obj; declare const Fix: Obj;
declare const DecCst: Obj; declare const DecCst: Obj;
declare const Dec: { declare const Dec: {

2
webpack/webpack.common.js

@ -49,7 +49,7 @@ module.exports = {
options: { options: {
plugins: [vars({ plugins: [vars({
variables: { variables: {
fontUrl: '../node_modules/fineui/dist/font/', fontUrl: '../node_modules/@fui/core/dist/font/',
imageUrl: '/webroot/decision/resources?path=/com/fr/web/resources/dist/images/1x', imageUrl: '/webroot/decision/resources?path=/com/fr/web/resources/dist/images/1x',
image2xUrl: '/webroot/decision/resources?path=/com/fr/web/resources/dist/images/2x', image2xUrl: '/webroot/decision/resources?path=/com/fr/web/resources/dist/images/2x',
} }

5
webpack/webpack.dev.js

@ -6,7 +6,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const chokidar = require('chokidar'); const chokidar = require('chokidar');
const { execSync } = require('child_process'); const { execSync } = require('child_process');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const dirs = require('./dirs'); const dirs = require('./dirs');
const common = require('./webpack.common.js'); const common = require('./webpack.common.js');
@ -65,6 +65,9 @@ module.exports = merge(common, {
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: path.resolve(__dirname, '../index.html'), template: path.resolve(__dirname, '../index.html'),
}), }),
new ForkTsCheckerWebpackPlugin({
watch: ['./src'],
}),
new OptimizeCssAssetsPlugin({ new OptimizeCssAssetsPlugin({
assetNameRegExp: /\.css$/g, assetNameRegExp: /\.css$/g,
cssProcessor: require('cssnano'), cssProcessor: require('cssnano'),

2275
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save