|
|
|
@ -1,7 +1,14 @@
|
|
|
|
|
import {WidgetType, Vertical} from '@ui/index'; |
|
|
|
|
import Model from '../../link_set.model'; |
|
|
|
|
import {renderEdit} from './right_detail.service'; |
|
|
|
|
import {WidgetType, ListView, Left} from '@ui/index'; |
|
|
|
|
import Model from './right_detail.model'; |
|
|
|
|
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'; |
|
|
|
|
|
|
|
|
@ -11,21 +18,55 @@ const Widget: WidgetType = {
|
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
linkSelected(linkSelected: LinkType) { |
|
|
|
|
renderEdit(this.rightDetail, linkSelected); |
|
|
|
|
const showPage = this._createItems(linkSelected); |
|
|
|
|
this.rightDetail.populate(BI.createItems(showPage)); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
render() { |
|
|
|
|
const linkSelected = this.model.linkSelected; |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
type: Vertical, |
|
|
|
|
type: ListView, |
|
|
|
|
cls: 'right-content', |
|
|
|
|
ref: _ref => { |
|
|
|
|
this.rightDetail = _ref; |
|
|
|
|
}, |
|
|
|
|
items: this._createItems(linkSelected), |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
const linkSelected: LinkType = this.model.linkSelected; |
|
|
|
|
renderEdit(this.rightDetail, linkSelected); |
|
|
|
|
_createItems(linkSelected: LinkType) { |
|
|
|
|
const plugins: string[] = BI.Constants.getConstant(pluginListConstant); |
|
|
|
|
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)); |
|
|
|
|