帆软决策平台数据连接界面库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.7 KiB

import { shortcut, store } from '@core/core';
import { Right, Button, VerticalAdapt } from 'ui';
import { TitleDatebaseModel, TitleDatebaseModelXtype } from './title_datebase.model';
import { PAGE_INDEX } from '@constants/constant';
export const TitleDatabase = 'dec.dcm.title.datebase';
@shortcut(TitleDatabase)
@store(TitleDatebaseModelXtype)
export class TitleDatabaseWidget extends BI.Widget {
store: TitleDatebaseModel['store'];
model: TitleDatebaseModel['model'];
submitButton: any;
watch = {
datebaseTypeSelected: (datebaseTypeSelected: string) => {
this.submitButton.setEnable(!!datebaseTypeSelected);
},
}
render() {
return {
type: Right,
items: [{
type: VerticalAdapt,
height: 40,
rgap: 5,
items: [
{
type: Button,
text: BI.i18nText('BI-Basic_Cancel'),
level: 'ignore',
handler: () => {
this.store.setPageIndex(PAGE_INDEX.CONNECTION);
},
},
{
type: Button,
text: BI.i18nText('BI-Basic_Save'),
disabled: !this.model.datebaseTypeSelected,
ref: (_ref: any) => {
this.submitButton = _ref;
},
handler: () => {
this.store.setPageIndex(PAGE_INDEX.MAINTAIN);
},
},
],
}],
};
}
}