|
|
|
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,
|
|
|
|
$value: 'title-database-cancel',
|
|
|
|
text: BI.i18nText('BI-Basic_Cancel'),
|
|
|
|
level: 'ignore',
|
|
|
|
handler: () => {
|
|
|
|
this.store.setPageIndex(PAGE_INDEX.CONNECTION);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: Button,
|
|
|
|
$value: 'title-database-save',
|
|
|
|
text: BI.i18nText('BI-Basic_Save'),
|
|
|
|
disabled: !this.model.datebaseTypeSelected,
|
|
|
|
ref: (_ref: any) => {
|
|
|
|
this.submitButton = _ref;
|
|
|
|
},
|
|
|
|
handler: () => {
|
|
|
|
this.store.setPageIndex(PAGE_INDEX.MAINTAIN);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|