|
|
@ -1,7 +1,14 @@ |
|
|
|
import {WidgetType, Vertical} from '@ui/index'; |
|
|
|
import {WidgetType, ListView, Left} from '@ui/index'; |
|
|
|
import Model from '../../link_set.model'; |
|
|
|
import Model from './right_detail.model'; |
|
|
|
import {renderEdit} from './right_detail.service'; |
|
|
|
|
|
|
|
import {LinkType} from '@ui/type'; |
|
|
|
import {LinkType} from '@ui/type'; |
|
|
|
|
|
|
|
import Title from '../right_title/right_title'; |
|
|
|
|
|
|
|
import RightShow from '../right_show/right_show'; |
|
|
|
|
|
|
|
import RightShowJndi from '../right_show/right_show_jndi'; |
|
|
|
|
|
|
|
import RightEdit from '../right_edit/right_edit'; |
|
|
|
|
|
|
|
import RightEditMysql from '../right_edit/right_edit_mysql'; |
|
|
|
|
|
|
|
import RightEditJndi from '../right_edit/right_edit_jndi'; |
|
|
|
|
|
|
|
import pluginListConstant from '../../../app.constant'; |
|
|
|
|
|
|
|
import {MYSQL_CONNECT, JNDI_CONNECT} from '@private/constants'; |
|
|
|
|
|
|
|
|
|
|
|
const className = 'fr.component.right.detail'; |
|
|
|
const className = 'fr.component.right.detail'; |
|
|
|
|
|
|
|
|
|
|
@ -11,21 +18,55 @@ const Widget: WidgetType = { |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
linkSelected(linkSelected: LinkType) { |
|
|
|
linkSelected(linkSelected: LinkType) { |
|
|
|
renderEdit(this.rightDetail, linkSelected); |
|
|
|
const showPage = this._createItems(linkSelected); |
|
|
|
|
|
|
|
this.rightDetail.populate(BI.createItems(showPage)); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
render() { |
|
|
|
render() { |
|
|
|
|
|
|
|
const linkSelected = this.model.linkSelected; |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
type: Vertical, |
|
|
|
type: ListView, |
|
|
|
cls: 'right-content', |
|
|
|
cls: 'right-content', |
|
|
|
ref: _ref => { |
|
|
|
ref: _ref => { |
|
|
|
this.rightDetail = _ref; |
|
|
|
this.rightDetail = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
items: this._createItems(linkSelected), |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
_createItems(linkSelected: LinkType) { |
|
|
|
const linkSelected: LinkType = this.model.linkSelected; |
|
|
|
const plugins: string[] = BI.Constants.getConstant(pluginListConstant); |
|
|
|
renderEdit(this.rightDetail, linkSelected); |
|
|
|
const isPlugin = BI.some(plugins, (index: number, item: string) => item === linkSelected.text); |
|
|
|
|
|
|
|
let editPage = null; |
|
|
|
|
|
|
|
let showPage = null; |
|
|
|
|
|
|
|
switch (linkSelected.text) { |
|
|
|
|
|
|
|
case (MYSQL_CONNECT): |
|
|
|
|
|
|
|
editPage = RightEditMysql; |
|
|
|
|
|
|
|
showPage = RightShow; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case (JNDI_CONNECT): |
|
|
|
|
|
|
|
editPage = RightEditJndi; |
|
|
|
|
|
|
|
showPage = RightShowJndi; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
editPage = RightEdit; |
|
|
|
|
|
|
|
showPage = RightShow; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (isPlugin) { |
|
|
|
|
|
|
|
editPage = BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${linkSelected.text.toLowerCase()}.edit`); |
|
|
|
|
|
|
|
showPage = BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${linkSelected.text.toLowerCase()}.preview`); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
type: Title, |
|
|
|
|
|
|
|
isEdit: linkSelected.isSelected, |
|
|
|
|
|
|
|
linkSelected, |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
type: linkSelected.isSelected ? editPage : showPage, |
|
|
|
|
|
|
|
linkSelected, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
]; |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
|
|
|
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
|
|
|