diff --git a/package.json b/package.json index f13d596..8f7d836 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "eslint": "5.16.0", "eslint-plugin-jest": "22.4.1", "express": "4.16.4", + "fork-ts-checker-webpack-plugin": "1.4.3", "html-webpack-plugin": "3.2.0", "http-proxy": "1.17.0", "husky": "1.3.1", @@ -51,8 +52,7 @@ "webpack": "4.35.2", "webpack-cli": "3.3.5", "webpack-dev-server": "3.7.2", - "webpack-merge": "4.2.1", - "fork-ts-checker-webpack-plugin": "1.4.3" + "webpack-merge": "4.2.1" }, "optionalDependencies": { "@fui/core": "^2.0.0", diff --git a/src/modules/app.ts b/src/modules/app.ts index 3dd69aa..bab0430 100644 --- a/src/modules/app.ts +++ b/src/modules/app.ts @@ -1,17 +1,18 @@ import { shortcut, store } from '@core/core'; -import { Tab, Vtape, Absolute } from 'ui'; +import { Vtape, Absolute } from 'ui'; import { TitleXtype } from './title/title'; import { PAGE_INDEX } from './constants/constant'; import { ConnectionXtype, DatebaseXtype, MaintainXtype, ConnectionPoolXtype } from './pages'; import { AppModel, AppModelXtype } from './app.model'; import './app.provider'; import '../less/index.less'; +import { Tab } from '@fui/core'; export const AppXtype = 'dec.dcm.main'; @store(AppModelXtype) @shortcut(AppXtype) export class App extends BI.Widget { - tab: any; + tab: Tab; store: AppModel['store']; model: AppModel['model']; @@ -38,12 +39,12 @@ export class App extends BI.Widget { cls: 'bi-background', items: [{ el: { - type: Tab, + type: BI.Tab.xtype, cls: 'bi-card', single: true, tgap: 10, showIndex: this.model.pageIndex, - ref: (_ref: any) => { + ref: (_ref: Tab) => { this.tab = _ref; }, cardCreator: (index: string) => { diff --git a/src/modules/components/collapse/collapse.ts b/src/modules/components/collapse/collapse.ts index 675749f..7cbff87 100644 --- a/src/modules/components/collapse/collapse.ts +++ b/src/modules/components/collapse/collapse.ts @@ -1,6 +1,7 @@ -import { IconLabel, Left } from 'ui'; +import { Left } from 'ui'; import { shortcut, store } from '@core/core'; import { CollapseModel, CollapseModelXtype } from './collapse.model'; +import { IconLabel } from '@fui/core'; export const EVENT_CHANGE = 'EVENT_CHANGE'; export const CollapseXtype = 'dec.dcm.components.collapse'; @@ -13,8 +14,8 @@ export class Collapse extends BI.BasicButton { $testId: 'dec-dcm-components-collapse', } - rightFont: any; - downFont: any; + rightFont: IconLabel; + downFont: IconLabel; model: CollapseModel['model']; store: CollapseModel['store']; @@ -34,19 +35,19 @@ export class Collapse extends BI.BasicButton { type: Left, items: [ { - type: IconLabel, + type: BI.IconLabel.xtype, height: 17, cls: 'dcm-triangle-collapse-font icon-size-16', - ref: (_ref: any) => { + ref: (_ref: IconLabel) => { this.rightFont = _ref; }, invisible: !this.model.isCollapse, }, { - type: IconLabel, + type: BI.IconLabel.xtype, height: 17, cls: 'dcm-triangle-expand-font icon-size-16', - ref: (_ref: any) => { + ref: (_ref: IconLabel) => { this.downFont = _ref; }, invisible: this.model.isCollapse, diff --git a/src/modules/components/test_status/test_status.ts b/src/modules/components/test_status/test_status.ts index b76663b..bdb09bb 100644 --- a/src/modules/components/test_status/test_status.ts +++ b/src/modules/components/test_status/test_status.ts @@ -1,10 +1,10 @@ import { shortcut, store } from '@core/core'; import { TestStatusModelXtype, TestStatusModel } from './test_status.model'; -import { CenterAdapt, Tab, Vertical, Left } from 'ui'; +import { CenterAdapt, Vertical, Left } from 'ui'; import { TEST_STATUS } from '@constants/constant'; import { TipIconXtype } from './tip_icon/tip_icon'; import { TipFailXtype, EVENT_CLOSE, EVENT_RELOAD, EVENT_DETAIL } from './tip_icon/tip_fail'; -import { Label } from '@fui/core'; +import { Label, Tab } from '@fui/core'; export const TestStatusXtype = 'dec.dcm.components.test_status'; export { EVENT_CLOSE, @@ -26,7 +26,7 @@ export class TestStatus extends BI.Widget { model: TestStatusModel['model']; store: TestStatusModel['store']; - tab: any; + tab: Tab; failMessage: Label; failDriverMessage: Label; driverLink: any; @@ -49,13 +49,13 @@ export class TestStatus extends BI.Widget { type: Vertical, items: [ { - type: Tab, + type: BI.Tab.xtype, cls: 'bi-card', width: 450, height: 250, single: true, showIndex: this.model.status, - ref: (_ref: any) => { + ref: (_ref: Tab) => { this.tab = _ref; }, cardCreator: (index: string) => { diff --git a/src/modules/components/test_status/tip_icon/tip_fail.ts b/src/modules/components/test_status/tip_icon/tip_fail.ts index 65997be..4ebf523 100644 --- a/src/modules/components/test_status/tip_icon/tip_fail.ts +++ b/src/modules/components/test_status/tip_icon/tip_fail.ts @@ -1,5 +1,6 @@ import { shortcut, store } from '@core/core'; -import { Vertical, HorizotalAuto, CenterAdapt, VerticalAdapt, Button } from 'ui'; +import { Button } from '@fui/core'; +import { Vertical, HorizotalAuto, CenterAdapt, VerticalAdapt } from 'ui'; import { TipFailModel, TipFailModelXtype } from './tip_fail.model'; export const TipFailXtype = 'dec.dcm.components.test_status.tip_fail'; export const EVENT_CLOSE = 'EVENT_CLOSE'; @@ -17,7 +18,7 @@ export class TipFail extends BI.Widget { model: TipFailModel['model']; store: TipFailModel['store']; - detailButton: any; + detailButton: Button; watch = { isCollapse: (isCollapse: boolean) => { @@ -56,10 +57,10 @@ export class TipFail extends BI.Widget { hgap: 5, items: [ { - type: Button, + type: BI.Button.xtype, text: BI.i18nText('Dec-Dcm_Connection_Detailed_Information'), level: 'ignore', - ref: (_ref: any) => { + ref: (_ref: Button) => { this.detailButton = _ref; }, handler: () => { @@ -68,7 +69,7 @@ export class TipFail extends BI.Widget { }, }, { - type: Button, + type: BI.Button.xtype, text: BI.i18nText('Dec-Dcm_Back'), level: 'ignore', handler: () => { @@ -76,7 +77,7 @@ export class TipFail extends BI.Widget { }, }, { - type: Button, + type: BI.Button.xtype, text: retryText, handler: () => { this.fireEvent(EVENT_RELOAD); diff --git a/src/modules/components/text_checker/text_checker.ts b/src/modules/components/text_checker/text_checker.ts index 91fc540..8a95649 100644 --- a/src/modules/components/text_checker/text_checker.ts +++ b/src/modules/components/text_checker/text_checker.ts @@ -1,6 +1,6 @@ import { shortcut } from '@core/core'; -import { Label } from '@fui/core'; -import { TextEditor, Absolute } from 'ui'; +import { Label, TextEditor } from '@fui/core'; +import { Absolute } from 'ui'; export const TextCheckerXtype = 'dec.dcm.components.text_checker'; @shortcut(TextCheckerXtype) export class TextChecker extends BI.Widget { @@ -17,7 +17,7 @@ export class TextChecker extends BI.Widget { $value: '', } - textEditor: any; + textEditor: TextEditor; errorLabel: Label; private isError: boolean; private value: string; @@ -37,13 +37,13 @@ export class TextChecker extends BI.Widget { height: 20, items: [{ el: { - type: TextEditor, + type: BI.TextEditor.xtype, $value, width, allowBlank, value, watermark, - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.textEditor = _ref; }, listeners: [{ diff --git a/src/modules/pages/connection/connection.ts b/src/modules/pages/connection/connection.ts index 1911a1e..c00be92 100644 --- a/src/modules/pages/connection/connection.ts +++ b/src/modules/pages/connection/connection.ts @@ -1,4 +1,4 @@ -import { Button, Htape, Vtape, VerticalAdapt, ListView, CenterAdapt, Layout } from 'ui'; +import { Htape, Vtape, VerticalAdapt, ListView, CenterAdapt, Layout } from 'ui'; import { shortcut, store } from '@core/core'; import { ConnectionModel, ConnectionModelXtype } from './connection.model'; import { PAGE_INDEX } from '@constants/constant'; @@ -9,7 +9,7 @@ import { ConnectionPluginXtype } from './connection_plugin/connection_plugin'; import { connectionType } from '@constants/env'; import { getAllDatabaseTypes, connectionCanEdit, getJdbcDatabaseType, getTextByDatabaseType } from '../../app.service'; import { ConnectionJDBC } from '../../crud/crud.typings'; -import { Label } from '@fui/core'; +import { Button, Label } from '@fui/core'; export const ConnectionXtype = 'dec.dcm.connection'; @shortcut(ConnectionXtype) @@ -19,7 +19,7 @@ export class Connection extends BI.Widget { model: ConnectionModel['model']; connectionTitleWidget: Label; - connectionEditWidget: any; + connectionEditWidget: Button; listView: any; title: any; @@ -63,7 +63,7 @@ export class Connection extends BI.Widget { type: VerticalAdapt, cls: 'bi-border-bottom', items: [{ - type: Button, + type: BI.Button.xtype, text: BI.i18nText('Dec-Dcm_Connection_New'), handler: () => { this.store.setPageIndex(PAGE_INDEX.DATEBASE); @@ -102,11 +102,11 @@ export class Connection extends BI.Widget { el: { type: VerticalAdapt, items: [{ - type: Button, + type: BI.Button.xtype, $value: 'connection-edit', invisible: true, text: BI.i18nText('Dec-Dcm_Edit'), - ref: (_ref: any) => { + ref: (_ref: Button) => { this.connectionEditWidget = _ref; }, handler: () => { diff --git a/src/modules/pages/connection/list/list.ts b/src/modules/pages/connection/list/list.ts index 97beb17..21ec40e 100644 --- a/src/modules/pages/connection/list/list.ts +++ b/src/modules/pages/connection/list/list.ts @@ -1,8 +1,9 @@ import { shortcut, store } from '@core/core'; -import { CenterAdapt, Layout, Vtape, Loader, Tab } from 'ui'; +import { CenterAdapt, Layout, Vtape } from 'ui'; import { ListItemXtype } from './list_item/list_item'; import { ConnectionListModel, ConnectionListModelXtype } from './list.model'; import { getDatabaseType } from './list.service'; +import { Tab } from '@fui/core'; export const ConnectionListXtype = 'dec.dcm.connection.list'; @shortcut(ConnectionListXtype) @store(ConnectionListModelXtype) @@ -11,7 +12,7 @@ export class ConnectionList extends BI.LoadingPane { model: ConnectionListModel['model']; groupWidget: any; - tab: any; + tab: Tab; beforeInit(cb: Function) { this.store.setConnections().then(() => { @@ -32,10 +33,10 @@ export class ConnectionList extends BI.LoadingPane { render() { return { - type: Tab, + type: BI.Tab.xtype, single: true, showIndex: this.model.shwoType, - ref: (_ref: any) => { + ref: (_ref: Tab) => { this.tab = _ref; }, cardCreator: (index: 'list' | 'none') => { @@ -67,7 +68,7 @@ export class ConnectionList extends BI.LoadingPane { } return { - type: Loader, + type: BI.Loader.xtype, itemsCreator: (options: {times: number}, populate) => { populate(this.renderList((options.times - 1) * 50, options.times * 50)); }, diff --git a/src/modules/pages/connection/list/list_item/list_item.ts b/src/modules/pages/connection/list/list_item/list_item.ts index 6c446a0..ff75a43 100644 --- a/src/modules/pages/connection/list/list_item/list_item.ts +++ b/src/modules/pages/connection/list/list_item/list_item.ts @@ -1,5 +1,5 @@ import { shortcut, store } from '@core/core'; -import { IconLabel, Layout, Htape, Vertical } from 'ui'; +import { Layout, Htape, Vertical } from 'ui'; import './list_item.less'; import { ListItemModel, ListItemModelXtype } from './list_item.model'; import { PAGE_INDEX } from '@constants/constant'; @@ -47,7 +47,7 @@ export class ListItem extends BI.BasicButton { $scope: name, items: [{ el: { - type: IconLabel, + type: BI.IconLabel.xtype, cls: 'dcm-link-font icon-size-16', title: name, }, diff --git a/src/modules/pages/connection_pool/connection_pool.ts b/src/modules/pages/connection_pool/connection_pool.ts index af87f09..7c0e441 100644 --- a/src/modules/pages/connection_pool/connection_pool.ts +++ b/src/modules/pages/connection_pool/connection_pool.ts @@ -1,5 +1,5 @@ import { shortcut, store } from '@core/core'; -import { Htape, Vtape, Layout, CenterAdapt, Loader } from 'ui'; +import { Htape, Vtape, Layout, CenterAdapt } from 'ui'; import { ConnectionPoolModel, ConnectionPoolModelXtype } from './connection_pool.model'; import { ListItemXtype } from './list_item/list_item'; import { PoolXtype } from './pool/pool'; @@ -49,7 +49,7 @@ export class ConnectionPool extends BI.Widget { height: 40, }, { - type: Loader, + type: BI.Loader.xtype, itemsCreator: (options: {times: number}, populate) => { populate(this.renderList((options.times - 1) * PAGE_SIZE, options.times * PAGE_SIZE)); }, diff --git a/src/modules/pages/database/database.ts b/src/modules/pages/database/database.ts index 915c48e..74e4752 100644 --- a/src/modules/pages/database/database.ts +++ b/src/modules/pages/database/database.ts @@ -1,4 +1,4 @@ -import { SearchEditor, Vtape, Right, Htape, Vertical, ButtonGroup, Left, MultiSelectItem, CenterAdapt } from 'ui'; +import { Vtape, Right, Htape, Vertical, Left, CenterAdapt } from 'ui'; import { shortcut, store } from '@core/core'; import { FilterXtype } from './filter/filter'; 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 { DatebaseTypeXtype } from './database_type/database_type'; import { getAllDatabaseTypes } from '../../app.service'; +import { ButtonGroup, MultiSelectItem, SearchEditor } from '@fui/core'; export const DatebaseXtype = 'dec.dcm.datebase'; @shortcut(DatebaseXtype) @store(DatebaseModelXtype) export class Datebase extends BI.Widget { - filter: any; - search: any; - datebaseType: any; + filter: ButtonGroup; + search: SearchEditor; + datebaseType: ButtonGroup; typeFilterWidget: any; - internalWidget: any; - pluginWidget: any; + internalWidget: MultiSelectItem; + pluginWidget: MultiSelectItem; allDatabaseTypes = getAllDatabaseTypes(); @@ -80,11 +81,11 @@ export class Datebase extends BI.Widget { type: Right, items: [ { - type: SearchEditor, + type: BI.SearchEditor.xtype, $value: 'database-type', width: 300, watermark: BI.i18nText('BI-Basic_Search'), - ref: (_ref: any) => { + ref: (_ref: SearchEditor) => { this.search = _ref; }, listeners: [ @@ -107,12 +108,12 @@ export class Datebase extends BI.Widget { items: [ { el: { - type: ButtonGroup, + type: BI.ButtonGroup.xtype, cls: 'bi-border-right', layouts: [{ type: Vertical, }], - ref: (_ref: any) => { + ref: (_ref: ButtonGroup) => { this.filter = _ref; }, items: [ @@ -153,12 +154,12 @@ export class Datebase extends BI.Widget { title: BI.i18nText('Dec-Dcm_Connection_Type_Filter'), }, { - type: MultiSelectItem, + type: BI.MultiSelectItem.xtype, width: 80, selected: this.model.isInternal, text: BI.i18nText('Dec-Dcm_Connection_Support_Inner'), title: BI.i18nText('Dec-Dcm_Connection_Support_Inner'), - ref: (_ref: any) => { + ref: (_ref: MultiSelectItem) => { this.internalWidget = _ref; }, handler: () => { @@ -166,12 +167,12 @@ export class Datebase extends BI.Widget { }, }, { - type: MultiSelectItem, + type: BI.MultiSelectItem.xtype, width: 80, selected: this.model.isPlugin, text: BI.i18nText('Dec-Dcm_Connection_Support_Plugin'), title: BI.i18nText('Dec-Dcm_Connection_Support_Plugin'), - ref: (_ref: any) => { + ref: (_ref: MultiSelectItem) => { this.pluginWidget = _ref; }, handler: () => { @@ -193,14 +194,14 @@ export class Datebase extends BI.Widget { height: 24, }, { - type: ButtonGroup, + type: BI.ButtonGroup.xtype, hgap: 15, layouts: [{ type: Left, scrolly: true, }], items: this.renderDatebaseType(), - ref: (_ref: any) => { + ref: (_ref: ButtonGroup) => { this.datebaseType = _ref; }, }, diff --git a/src/modules/pages/database/database_type/database_type.ts b/src/modules/pages/database/database_type/database_type.ts index 1064673..075a800 100644 --- a/src/modules/pages/database/database_type/database_type.ts +++ b/src/modules/pages/database/database_type/database_type.ts @@ -1,9 +1,10 @@ import { shortcut, store } from '@core/core'; -import { Vtape, Absolute, Img } from 'ui'; +import { Vtape, Absolute } from 'ui'; import { DatebaseTypeModel, DatebaseTypeModelXtype } from './database_type.model'; import { ImgPrefix, PluginImgPrefix } from '@constants/env'; import './database_type.less'; import { PAGE_INDEX } from '@constants/constant'; +import { Img } from '@fui/core'; export const DatebaseTypeXtype = 'dec.dcm.datebase.type'; @shortcut(DatebaseTypeXtype) @@ -22,7 +23,7 @@ export class DatebaseType extends BI.BasicButton { $testId: 'dec-dcm-database-type', } - img: any; + img: Img; store: DatebaseTypeModel['store']; @@ -39,9 +40,9 @@ export class DatebaseType extends BI.BasicButton { items: [ { el: { - type: Img, + type: BI.Img.xtype, src: iconUrl ? this.getIconUrl(iconUrl) : `${ImgPrefix}${databaseType}.jpg`, - ref: (_ref: any) => { + ref: (_ref: Img) => { this.img = _ref; }, }, diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index b12a8d2..f6622d9 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -1,5 +1,5 @@ import { shortcut } from '@core/core'; -import { Vertical, TextEditor, TextValueCombo, TextAreaEditor, Editor, EdirotIconCheckCombo, Left, Layout } from 'ui'; +import { Vertical, Left, Layout } from 'ui'; import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse'; import { FormItemXtype } from '../../components/form_item/form_item'; 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 { TextCheckerXtype } from '../../../../components/text_checker/text_checker'; import { ApiFactory } from 'src/modules/crud/apiFactory'; +import { Editor, EditorIconCheckCombo, Label, TextAreaEditor, TextEditor, TextValueCombo } from '@fui/core'; const api = new ApiFactory().create(); export const FormJdbcXtype = 'dec.dcm.maintain.form.jdbc'; @@ -95,12 +96,12 @@ export class FormJdbc extends BI.Widget { type: FormItemXtype, name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'), forms: [{ - type: EdirotIconCheckCombo, + type: BI.EditorIconCheckCombo.xtype, $testId: 'dec-editor-icon-check-combo', $value: 'driver', width: 300, value: driver, - ref: (_ref: any) => { + ref: (_ref: EditorIconCheckCombo) => { this.form.driver = _ref; }, items: this.getDrivers(), @@ -124,7 +125,7 @@ export class FormJdbc extends BI.Widget { type: FormItemXtype, name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'), forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'database-name', width: 300, allowBlank: true, @@ -145,7 +146,7 @@ export class FormJdbc extends BI.Widget { type: FormItemXtype, name: BI.i18nText('Dec-Dcm_Connection_Form_Host'), forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'database-host', width: 300, allowBlank: true, @@ -193,11 +194,11 @@ export class FormJdbc extends BI.Widget { name: BI.i18nText('Dec-Dcm_Connection_Form_AuthType'), invisible: !databaseType.kerberos, forms: [{ - type: TextValueCombo, + type: BI.TextValueCombo.xtype, $value: 'auth-type', width: 300, value: authType, - ref: (_ref: any) => { + ref: (_ref: TextValueCombo) => { this.form.authType = _ref; }, items: [ @@ -233,13 +234,13 @@ export class FormJdbc extends BI.Widget { this.formUser = _ref; }, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'username', width: 300, allowBlank: true, value: user, watermark: BI.i18nText('Dec-Dcm_Connection_Form_UserName'), - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.user = _ref; }, }], @@ -252,7 +253,7 @@ export class FormJdbc extends BI.Widget { this.formPassword = _ref; }, forms: [{ - type: Editor, + type: BI.Editor.xtype, $value: 'password', cls: 'bi-border bi-border-radius', width: 300, @@ -262,7 +263,7 @@ export class FormJdbc extends BI.Widget { inputType: 'password', autocomplete: 'new-password', watermark: BI.i18nText('Dec-Dcm_Connection_Form_Password'), - ref: (_ref: any) => { + ref: (_ref: Editor) => { this.form.password = _ref; }, }], @@ -275,13 +276,13 @@ export class FormJdbc extends BI.Widget { this.formPrincipal = _ref; }, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'principal', width: 300, allowBlank: true, value: principal, watermark: BI.i18nText('Dec-Dcm_Connection_Form_Principal'), - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.principal = _ref; }, }], @@ -294,7 +295,7 @@ export class FormJdbc extends BI.Widget { this.formKeyPath = _ref; }, forms: [{ - type: Editor, + type: BI.Editor.xtype, $value: 'key-path', cls: 'bi-border', width: 300, @@ -302,7 +303,7 @@ export class FormJdbc extends BI.Widget { allowBlank: true, value: keyPath, watermark: BI.i18nText('Dec-Dcm_Connection_Form_KeyPath'), - ref: (_ref: any) => { + ref: (_ref: Editor) => { this.form.keyPath = _ref; }, }], @@ -313,7 +314,7 @@ export class FormJdbc extends BI.Widget { textAlign: 'left', invisible: true, text: BI.i18nText('Dec-Dcm_Connection_JDBC_Warning'), - ref: (_ref: any) => { + ref: (_ref: Label) => { this.labelTips = _ref; }, }, @@ -321,12 +322,12 @@ export class FormJdbc extends BI.Widget { type: FormItemXtype, name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), forms: [{ - type: TextValueCombo, + type: BI.TextValueCombo.xtype, $value: 'original-charset-name', width: 300, value: originalCharsetName ? originalCharsetName : '', items: CONNECT_CHARSET, - ref: (_ref: any) => { + ref: (_ref: TextValueCombo) => { this.form.originalCharsetName = _ref; }, }], @@ -354,14 +355,14 @@ export class FormJdbc extends BI.Widget { text: BI.i18nText('Dec-Dcm_Connection_Read_Mode_List'), }], }, { - type: TextValueCombo, + type: BI.TextValueCombo.xtype, $value: 'schema', width: 300, vgap: 15, disabled: true, value: schema, items: schema ? [{ text: schema, value:schema }] : [], - ref: (_ref: any) => { + ref: (_ref: TextValueCombo) => { this.form.schema = _ref; }, }], @@ -376,13 +377,13 @@ export class FormJdbc extends BI.Widget { type: FormItemXtype, name: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'), forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'database-url', width: 300, allowBlank: true, value: url, watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'), - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.url = _ref; }, listeners: [{ @@ -532,7 +533,7 @@ export class FormJdbc extends BI.Widget { type: FormItemXtype, name: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'), forms: [{ - type: TextAreaEditor, + type: BI.TextAreaEditor.xtype, $value: 'validation-query', cls: 'bi-border', allowBlank: true, @@ -540,7 +541,7 @@ export class FormJdbc extends BI.Widget { value: validationQuery, width: 300, height: 100, - ref: (_ref: any) => { + ref: (_ref: TextAreaEditor) => { this.form.validationQuery = _ref; }, }], @@ -549,14 +550,14 @@ export class FormJdbc extends BI.Widget { type: FormItemXtype, name: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'), forms: [{ - type: TextValueCombo, + type: BI.TextValueCombo.xtype, $value: 'check', width: 300, allowBlank: true, value: testOnBorrow, items: this.getBooleanItem(), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'), - ref: (_ref: any) => { + ref: (_ref: TextValueCombo) => { this.form.testOnBorrow = _ref; }, }], @@ -565,14 +566,14 @@ export class FormJdbc extends BI.Widget { type: FormItemXtype, name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'), forms: [{ - type: TextValueCombo, + type: BI.TextValueCombo.xtype, $value: 'test-on-return', width: 300, allowBlank: true, value: testOnReturn, items: this.getBooleanItem(), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'), - ref: (_ref: any) => { + ref: (_ref: TextValueCombo) => { this.form.testOnReturn = _ref; }, }], @@ -581,14 +582,14 @@ export class FormJdbc extends BI.Widget { type: FormItemXtype, name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'), forms: [{ - type: TextValueCombo, + type: BI.TextValueCombo.xtype, $value: 'test-while-idle', width: 300, allowBlank: true, value: testWhileIdle, items: this.getBooleanItem(), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'), - ref: (_ref: any) => { + ref: (_ref: TextValueCombo) => { this.form.testWhileIdle = _ref; }, }], diff --git a/src/modules/pages/maintain/forms/components/form.jndi.ts b/src/modules/pages/maintain/forms/components/form.jndi.ts index 24b0079..3995c9c 100644 --- a/src/modules/pages/maintain/forms/components/form.jndi.ts +++ b/src/modules/pages/maintain/forms/components/form.jndi.ts @@ -1,11 +1,12 @@ import { shortcut } from '@core/core'; -import { Vertical, TextEditor, Htape, Left, TextValueCombo, EdirotIconCheckCombo } from 'ui'; +import { Vertical, Htape, Left } from 'ui'; import { FormItemXtype } from '../../components/form_item/form_item'; import { ConnectionJNDI, Connection, ContextHashtable } from 'src/modules/crud/crud.typings'; import { CONNECT_CHARSET, CONNECTION_LAYOUT, JNDI_FACTORYS } from '@constants/constant'; import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse'; import { connectionType } from '@constants/env'; import { TextCheckerXtype } from '../../../../components/text_checker/text_checker'; +import { EditorIconCheckCombo, TextEditor, TextValueCombo } from '@fui/core'; export const FormJndiXtype = 'dec.dcm.maintain.form.jndi'; @shortcut(FormJndiXtype) 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'), nameWidth: 200, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'jdni-name', width: 300, allowBlank: true, value: jndiName, - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.jndiName = _ref; }, }], @@ -103,12 +104,12 @@ export class FormJndi extends BI.Widget { nameWidth: 200, isBold: false, forms: [{ - type: EdirotIconCheckCombo, + type: BI.EditorIconCheckCombo.xtype, $testId: 'dec-editor-icon-check-combo', $value: 'initial', width: 300, value: contextHashtable['java.naming.factory.initial'], - ref: (_ref: any) => { + ref: (_ref: EditorIconCheckCombo) => { this.form.initial = _ref; }, items: JNDI_FACTORYS.map(item => { @@ -133,12 +134,12 @@ export class FormJndi extends BI.Widget { isBold: false, nameWidth: 200, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'provider-url', width: 300, allowBlank: true, value: contextHashtable['java.naming.provider.url'], - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.providerUrl = _ref; }, }], @@ -149,12 +150,12 @@ export class FormJndi extends BI.Widget { isBold: false, nameWidth: 200, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'security-principal', width: 300, allowBlank: true, value: contextHashtable['java.naming.security.principal'], - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.securityPrincipal = _ref; }, }], @@ -165,12 +166,12 @@ export class FormJndi extends BI.Widget { isBold: false, nameWidth: 200, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'security-credentials', width: 300, allowBlank: true, value: contextHashtable['java.naming.security.credentials'], - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.securityCredentials = _ref; }, }], @@ -191,12 +192,12 @@ export class FormJndi extends BI.Widget { name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), nameWidth: 200, forms: [{ - type: TextValueCombo, + type: BI.TextValueCombo.xtype, $value: 'new-charset-name', width: 300, value: newCharsetName ? newCharsetName : '', items: CONNECT_CHARSET, - ref: (_ref: any) => { + ref: (_ref: TextValueCombo) => { this.form.newCharsetName = _ref; }, }], @@ -228,12 +229,12 @@ export class FormJndi extends BI.Widget { name: 'OBJECT_FACTORIES', nameWidth: 200, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'factory-object', width: 300, allowBlank: true, value: contextHashtable['java.naming.factory.object'], - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.factoryObject = _ref; }, }], @@ -243,12 +244,12 @@ export class FormJndi extends BI.Widget { name: 'STATE_FACTORIES', nameWidth: 200, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'factory-state', width: 300, allowBlank: true, value: contextHashtable['java.naming.factory.state'], - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.factoryState = _ref; }, }], @@ -258,12 +259,12 @@ export class FormJndi extends BI.Widget { name: 'URL_PKG_PREFIXES', nameWidth: 200, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'factory-url-pkgs', width: 300, allowBlank: true, value: contextHashtable['java.naming.factory.url.pkgs'], - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.factoryUrlPkgs = _ref; }, }], @@ -273,12 +274,12 @@ export class FormJndi extends BI.Widget { name: 'DNS_URL', nameWidth: 200, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'dns-url', width: 300, allowBlank: true, value: contextHashtable['java.naming.dns.url'], - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.dnsUrl = _ref; }, }], @@ -288,12 +289,12 @@ export class FormJndi extends BI.Widget { name: 'AUTHORITATIVE', nameWidth: 200, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'authoritative', width: 300, allowBlank: true, value: contextHashtable['java.naming.authoritative'], - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.authoritative = _ref; }, }], @@ -303,12 +304,12 @@ export class FormJndi extends BI.Widget { name: 'BATCHSIZE', nameWidth: 200, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'batchsize', width: 300, allowBlank: true, value: contextHashtable['java.naming.batchsize'], - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.batchsize = _ref; }, }], @@ -318,12 +319,12 @@ export class FormJndi extends BI.Widget { name: 'REFERRAL', nameWidth: 200, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'referral', width: 300, allowBlank: true, value: contextHashtable['java.naming.referral'], - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.referral = _ref; }, }], @@ -333,12 +334,12 @@ export class FormJndi extends BI.Widget { name: 'SECURITY_PROTOCOL', nameWidth: 200, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'security-protocol', width: 300, allowBlank: true, value: contextHashtable['java.naming.security.protocol'], - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.securityProtocol = _ref; }, }], @@ -348,12 +349,12 @@ export class FormJndi extends BI.Widget { name: 'SECURITY_AUTHENTICATION', nameWidth: 200, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'security-authentication', width: 300, allowBlank: true, value: contextHashtable['java.naming.security.authentication'], - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.authentication = _ref; }, }], @@ -363,12 +364,12 @@ export class FormJndi extends BI.Widget { name: 'LANGUAGE', nameWidth: 200, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'language', width: 300, allowBlank: true, value: contextHashtable['java.naming.language'], - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.language = _ref; }, }], @@ -378,12 +379,12 @@ export class FormJndi extends BI.Widget { name: 'APPLET', nameWidth: 200, forms: [{ - type: TextEditor, + type: BI.TextEditor.xtype, $value: 'applet', width: 300, allowBlank: true, value: contextHashtable['java.naming.applet'], - ref: (_ref: any) => { + ref: (_ref: TextEditor) => { this.form.applet = _ref; }, }], diff --git a/src/modules/title/title.ts b/src/modules/title/title.ts index abb89d5..7195d81 100644 --- a/src/modules/title/title.ts +++ b/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 { TitleModel, TitleModelXtype } from './title.model'; import { PAGE_INDEX } from '@constants/constant'; import { TitleDatabase } from './title_database/title_datebase'; import { TitleMaintain } from './title_maintain/title_maintain'; +import { LinearSegment, Tab } from '@fui/core'; export const TitleXtype = 'dec.dcm.title'; @shortcut(TitleXtype) @@ -12,8 +13,8 @@ export class Title extends BI.Widget { props = { baseCls: 'bi-card', } - tab: any; - linearSegment: any; + tab: Tab; + linearSegment: LinearSegment; model: TitleModel['model']; store: TitleModel['store']; @@ -31,14 +32,14 @@ export class Title extends BI.Widget { items: { left: [ { - type: LinearSegment, + type: BI.LinearSegment.xtype, cls: 'bi-font-bold', height: 40, hgap: 10, layouts: [{ type: VerticalAdapt, }], - ref: (_ref: any) => { + ref: (_ref: LinearSegment) => { this.linearSegment = _ref; }, items: [ @@ -66,10 +67,10 @@ export class Title extends BI.Widget { ], right: [ { - type: Tab, + type: BI.Tab.xtype, height: 40, showIndex: this.model.pageIndex, - ref: (_ref: any) => { + ref: (_ref: Tab) => { this.tab = _ref; }, cardCreator: (index: string) => { diff --git a/src/modules/title/title_database/title_datebase.ts b/src/modules/title/title_database/title_datebase.ts index acda335..61d640b 100644 --- a/src/modules/title/title_database/title_datebase.ts +++ b/src/modules/title/title_database/title_datebase.ts @@ -1,7 +1,8 @@ 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 { PAGE_INDEX } from '@constants/constant'; +import { Button } from '@fui/core'; export const TitleDatabase = 'dec.dcm.title.datebase'; @@ -11,7 +12,7 @@ export class TitleDatabaseWidget extends BI.Widget { store: TitleDatebaseModel['store']; model: TitleDatebaseModel['model']; - submitButton: any; + submitButton: Button; watch = { datebaseTypeSelected: (datebaseTypeSelected: string) => { @@ -28,7 +29,7 @@ export class TitleDatabaseWidget extends BI.Widget { rgap: 5, items: [ { - type: Button, + type: BI.Button.xtype, $value: 'title-database-cancel', text: BI.i18nText('BI-Basic_Cancel'), level: 'ignore', @@ -37,11 +38,11 @@ export class TitleDatabaseWidget extends BI.Widget { }, }, { - type: Button, + type: BI.Button.xtype, $value: 'title-database-save', text: BI.i18nText('BI-Basic_Save'), disabled: !this.model.datebaseTypeSelected, - ref: (_ref: any) => { + ref: (_ref: Button) => { this.submitButton = _ref; }, handler: () => { diff --git a/src/modules/title/title_maintain/title_maintain.ts b/src/modules/title/title_maintain/title_maintain.ts index d9be407..36b1abc 100644 --- a/src/modules/title/title_maintain/title_maintain.ts +++ b/src/modules/title/title_maintain/title_maintain.ts @@ -1,5 +1,5 @@ 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 { PAGE_INDEX } from '@constants/constant'; @@ -18,7 +18,7 @@ export class TitleMaintainWidget extends BI.Widget { rgap: 5, items: [ { - type: Button, + type: BI.Button.xtype, $value: 'title-maintain-cancel', text: BI.i18nText('BI-Basic_Cancel'), level: 'ignore', @@ -29,7 +29,7 @@ export class TitleMaintainWidget extends BI.Widget { }, }, { - type: Button, + type: BI.Button.xtype, $value: 'title-maintain-connection-test', text: BI.i18nText('Dec-Dcm_Connection_Test'), level: 'ignore', @@ -38,7 +38,7 @@ export class TitleMaintainWidget extends BI.Widget { }, }, { - type: Button, + type: BI.Button.xtype, $value: 'title-maintain-save', text: BI.i18nText('BI-Basic_Save'), handler: () => { diff --git a/src/ui/fineui.ts b/src/ui/fineui.ts index 61846f8..6707153 100644 --- a/src/ui/fineui.ts +++ b/src/ui/fineui.ts @@ -1,46 +1,3 @@ -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 Vtape = 'bi.vtape'; diff --git a/yarn.lock b/yarn.lock index affe74d..2738bb8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -897,9 +897,9 @@ "@babel/preset-typescript" "7.3.3" "@fui/core@^2.0.0": - version "2.0.20201218162221" - resolved "https://npm.fineres.com/@fui%2fcore/-/core-2.0.20201218162221.tgz#d68bd3b72790c5e54cc9d2888eebc65f63f70c8b" - integrity sha512-o7OVoTOnxjbzbNsb+lh6mH1oQk+vmjetusalcHObIFFE2FBY50cFtH9c0frOq1GOvG/zbSyDJlwsZvEvC0hiXw== + version "2.0.20201221142205" + resolved "https://npm.fineres.com/@fui%2fcore/-/core-2.0.20201221142205.tgz#f3ff66a10df5b38e1955bb4337645a7fef697ef3" + integrity sha512-CaF/s14RnNlNXQi0GD9v4J3TFycTUebZzOIurVpfeR2tqhkKe6G/K7DreQGncVooggbRogrIDMJNVfs+d2nHtA== "@fui/materials@10.0.0-release - 10.0.0-release.99999999999999": version "10.0.0-release.20201218163254"