diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 3e0fff9..c656dcd 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,8 +1,8 @@ import {Vtape} from '../ui/index'; import appModel from './app.model'; import title from './title/title.component'; -import linkSet from './linkSet/linkSet.component'; -import linkStatus from './linkStatus/linkStatus.component'; +import linkSet from './link_set/link-set.component'; +import linkStatus from './link_status/link_status.component'; import './app.component.scss'; const className = 'fr.main'; diff --git a/src/app/app.model.ts b/src/app/app.model.ts index 2db3b97..cda6e69 100644 --- a/src/app/app.model.ts +++ b/src/app/app.model.ts @@ -2,10 +2,11 @@ const className = 'fr.model.main'; import {ModelType} from '@ui'; const Model: ModelType = { - childContext: ['tab'], + childContext: ['tab', 'newLink'], state () { return { tab: '数据连接管理', + newLink: '', }; }, computed: { diff --git a/src/app/linkSet/linkSet.component.ts b/src/app/link_set/link-set.component.ts similarity index 90% rename from src/app/linkSet/linkSet.component.ts rename to src/app/link_set/link-set.component.ts index 1afb924..4ad5da3 100644 --- a/src/app/linkSet/linkSet.component.ts +++ b/src/app/link_set/link-set.component.ts @@ -1,5 +1,5 @@ -import {Htape, WidgetType, Vtape} from '@ui'; -import linkSetModel from './linkSet.model'; +import {Htape, WidgetType, Vtape, Left} from '@ui'; +import linkSetModel from './link-set.model'; import Select from './select/select.component'; const className = 'fr.linkset'; const Widget: WidgetType = { @@ -22,7 +22,7 @@ const Widget: WidgetType = { items: [ { el: { - type: 'bi.left', + type: Left, cls:'select-group', items:[ { diff --git a/src/app/linkSet/linkSet.model.ts b/src/app/link_set/link-set.model.ts similarity index 100% rename from src/app/linkSet/linkSet.model.ts rename to src/app/link_set/link-set.model.ts diff --git a/src/app/linkSet/select/select.component.ts b/src/app/link_set/select/select.component.ts similarity index 72% rename from src/app/linkSet/select/select.component.ts rename to src/app/link_set/select/select.component.ts index 387b49f..d0b039c 100644 --- a/src/app/linkSet/select/select.component.ts +++ b/src/app/link_set/select/select.component.ts @@ -1,10 +1,16 @@ import {WidgetType, Combo, ButtonGroup, TextItem, Vertical} from '@ui'; +import selectModel from './select.model'; const linkList = [ 'APACHE KYLIN', 'DERBY', 'HP Vertica', 'IBM DB2', 'INFORMIX', 'Microsoft SQL Server', 'MySQL', 'Oracle', 'Privotal Greenplum Database', 'Postgresql', 'GaussDB 200', ]; const className = 'fr.linkset.select'; const Widget: WidgetType = { + _store() { + return BI.Models.getModel(selectModel); + }, render() { + let combo: any = null; + return { type: Combo, cls:'select', @@ -25,6 +31,8 @@ const Widget: WidgetType = { height: 24, width: 152, text: item, + title: item, + value: item, }; }), { type: TextItem, @@ -32,12 +40,16 @@ const Widget: WidgetType = { height: 24, width: 152, text: '更多数据连接...', + title:'更多数据连接...', + value: 'more', }, { type: TextItem, cls: 'link-item', height: 24, width: 152, text: '其他', + title:'其他', + value: 'other', }], layouts: [{ type: Vertical, @@ -45,6 +57,16 @@ const Widget: WidgetType = { }, maxHeight: 400, }, + listeners:[{ + eventName: 'EVENT_CHANGE', + action: (v: string) => { + this.store.setNewLink(v); + combo.hideView(); + }, + }], + ref () { + combo = this; + }, }; }, }; diff --git a/src/app/link_set/select/select.model.ts b/src/app/link_set/select/select.model.ts new file mode 100644 index 0000000..e0d792e --- /dev/null +++ b/src/app/link_set/select/select.model.ts @@ -0,0 +1,11 @@ +const className = 'fr.model.linkset.select'; +const Model = BI.inherit(Fix.Model, { + context: ['newLink'], + actions: { + setNewLink(value: string) { + this.model.newLink = value; + }, + }, +}); +BI.model(className, Model); +export default className; diff --git a/src/app/linkStatus/linkStatus.component.ts b/src/app/link_status/link_status.component.ts similarity index 93% rename from src/app/linkStatus/linkStatus.component.ts rename to src/app/link_status/link_status.component.ts index d9ab7d6..b1d725a 100644 --- a/src/app/linkStatus/linkStatus.component.ts +++ b/src/app/link_status/link_status.component.ts @@ -1,5 +1,5 @@ import {WidgetType, Htape} from '@ui'; -import linkStatusModel from './linkStatus.model'; +import linkStatusModel from './link_status.model'; const className = 'fr.linkstatus'; const Widget: WidgetType = { diff --git a/src/app/linkStatus/linkStatus.model.ts b/src/app/link_status/link_status.model.ts similarity index 100% rename from src/app/linkStatus/linkStatus.model.ts rename to src/app/link_status/link_status.model.ts diff --git a/src/app/title/title.component.ts b/src/app/title/title.component.ts index 0fe19c9..3e0a792 100644 --- a/src/app/title/title.component.ts +++ b/src/app/title/title.component.ts @@ -1,5 +1,5 @@ import {Left, WidgetType} from '@ui/index'; -import TitleItem from './titleItem/title-item.component'; +import TitleItem from './title_item/title_item.component'; const tabs = ['数据连接管理', '连接池状态']; const className = 'fr.title'; const Widget: WidgetType = { diff --git a/src/app/title/titleItem/title-item.component.ts b/src/app/title/title_item/title_item.component.ts similarity index 87% rename from src/app/title/titleItem/title-item.component.ts rename to src/app/title/title_item/title_item.component.ts index 397a773..7a3adef 100644 --- a/src/app/title/titleItem/title-item.component.ts +++ b/src/app/title/title_item/title_item.component.ts @@ -1,6 +1,6 @@ import {Label} from '@ui'; -import tableItemModel from './title-item.model'; -import {getSelectStyle} from './title-item.service'; +import tableItemModel from './title_item.model'; +import {getSelectStyle} from './title_item.service'; const className = 'fr.title.item'; const Widget = BI.inherit(BI.Widget, { props: { diff --git a/src/app/title/titleItem/title-item.model.ts b/src/app/title/title_item/title_item.model.ts similarity index 100% rename from src/app/title/titleItem/title-item.model.ts rename to src/app/title/title_item/title_item.model.ts diff --git a/src/app/title/titleItem/title-item.service.ts b/src/app/title/title_item/title_item.service.ts similarity index 100% rename from src/app/title/titleItem/title-item.service.ts rename to src/app/title/title_item/title_item.service.ts