@ -0,0 +1,61 @@
|
||||
import {WidgetType, Vertical, SearchEditor, Left, Vtape} from '@ui/index'; |
||||
import {databaseTyle} from '../select/select.service'; |
||||
import MoreLinkItem from './more.link.item.component'; |
||||
const className = 'fr.component.linkSet.morelink'; |
||||
let morkLinkItem: any = null; |
||||
const Widget: WidgetType = { |
||||
render() { |
||||
return { |
||||
type: Vtape, |
||||
cls: 'more-link', |
||||
items: [ |
||||
{ |
||||
el:{ |
||||
type: Vertical, |
||||
items:[{ |
||||
type: SearchEditor, |
||||
width: 300, |
||||
watermark: '搜索', |
||||
}], |
||||
}, |
||||
height: 30, |
||||
}, |
||||
{ |
||||
type: Left, |
||||
cls:'more-link-item', |
||||
ref(ref: any) { |
||||
morkLinkItem = ref; |
||||
}, |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
mounted() { |
||||
this._renderItems(); |
||||
}, |
||||
_renderItems(text = '') { |
||||
const databaseLink = databaseTyle.slice(12, 12 + 33); |
||||
const items: any[] = []; |
||||
const that = this; |
||||
databaseLink.forEach(item => { |
||||
items.push({ |
||||
type: MoreLinkItem, |
||||
text: item.text, |
||||
name: item.databaseType, |
||||
selected: text === item.text, |
||||
listeners: [ |
||||
{ |
||||
eventName: 'EVENT_SELECT', |
||||
action (text: string) { |
||||
that._renderItems(text); |
||||
that.fireEvent('EVENT_SELECT', text); |
||||
}, |
||||
}, |
||||
], |
||||
}); |
||||
}); |
||||
morkLinkItem.populate(BI.createItems(items)); |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -0,0 +1,40 @@
|
||||
import {WidgetType, Vertical, Img, Label, Layout} from '@ui/index'; |
||||
const className = 'fr.component.linkSet.morelink.item'; |
||||
const Widget: WidgetType = { |
||||
render() { |
||||
const {text, name, selected} = this.options; |
||||
|
||||
return { |
||||
type: Vertical, |
||||
cls:'link-item', |
||||
width: 120, |
||||
height: 117, |
||||
items:[ |
||||
{ |
||||
type: Img, |
||||
width: 120, |
||||
height: 90, |
||||
src:`./img/${name}.jpg`, |
||||
}, { |
||||
type: Layout, |
||||
cls: 'selected', |
||||
invisible: !selected, |
||||
width:30, |
||||
height: 30, |
||||
}, { |
||||
type: Label, |
||||
cls:'text', |
||||
text, |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
mounted() { |
||||
const {text} = this.options; |
||||
this.element.on('click', () => { |
||||
this.fireEvent('EVENT_SELECT', text); |
||||
}); |
||||
}, |
||||
}; |
||||
BI.shortcut(className, BI.inherit(BI.Widget, Widget)); |
||||
export default className; |
@ -0,0 +1,54 @@
|
||||
import MoreLink from './more.link.component'; |
||||
let SubbitButton: any = null; |
||||
let selectKey = ''; |
||||
export const moreLink = (onConfirm?: Function): void => { |
||||
const id = BI.UUID(); |
||||
let Popovers: any = null; |
||||
BI.Popovers.create(id, { |
||||
type: 'bi.bar_popover', |
||||
size: 'normal', |
||||
header: '更多数据连接', |
||||
width: 550, |
||||
height: 500, |
||||
body: { |
||||
type: MoreLink, |
||||
listeners: [ |
||||
{ |
||||
eventName: 'EVENT_SELECT', |
||||
action (text: string) { |
||||
selectKey = text; |
||||
SubbitButton.setEnable(true); |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
footer:{ |
||||
type: 'bi.right_vertical_adapt', |
||||
lgap: 10, |
||||
items: [{ |
||||
type: 'bi.button', |
||||
text: '取消', |
||||
value: 1, |
||||
level: 'ignore', |
||||
handler (v: any) { |
||||
Popovers.close(v); |
||||
}, |
||||
}, { |
||||
type: 'bi.button', |
||||
text: '确定', |
||||
disabled: true, |
||||
value: 0, |
||||
ref(ref: any) { |
||||
SubbitButton = ref; |
||||
}, |
||||
handler (v: any) { |
||||
Popovers.close(v); |
||||
onConfirm ? onConfirm(selectKey) : null; |
||||
}, |
||||
}], |
||||
}, |
||||
ref(ref: any) { |
||||
Popovers = ref; |
||||
}, |
||||
}).open(id); |
||||
}; |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 16 KiB |