帆软决策平台数据连接界面库
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.

60 lines
2.1 KiB

import { shortcut, store } from '@core/core';
import { Right, Button, VerticalAdapt } from 'ui';
import { TitleMaintainModel, TitleMaintainModelXtype } from './title_maintain.model';
import { PAGE_INDEX } from '@constants/constant';
export const TitleMaintain = 'dec.dcm.title.maintain';
@shortcut(TitleMaintain)
@store(TitleMaintainModelXtype)
export class TitleMaintainWidget extends BI.Widget {
store: TitleMaintainModel['store'];
model: TitleMaintainModel['model'];
render() {
return {
type: Right,
items: [{
type: VerticalAdapt,
height: 40,
rgap: 5,
items: [
{
type: Button,
$value: 'title-maintain-cancel',
text: BI.i18nText('BI-Basic_Cancel'),
level: 'ignore',
handler: () => {
this.store.setIsCopy(false);
this.store.setPageIndex(PAGE_INDEX.CONNECTION);
this.store.shutdownConnectionStatus();
},
},
{
type: Button,
$value: 'title-maintain-connection-test',
text: BI.i18nText('Dec-Dcm_Connection_Test'),
level: 'ignore',
handler: () => {
this.store.setTestEvent();
},
},
{
type: Button,
$value: 'title-maintain-save',
text: BI.i18nText('BI-Basic_Save'),
handler: () => {
this.store.setSaveEvent();
this.store.shutdownConnectionStatus();
},
},
],
}],
};
}
mounted () {
window.onunload = () => {
this.store.shutdownConnectionStatus();
};
}
}