redis数据集插件。
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.
 
 
 
 
 
 

44 lines
1.4 KiB

import { FormulaOpeartingPanel } from '@fui/materials';
import { fetchFormulaConfig } from '../../crud/crud.request';
/**
* 打开公式编辑框
*/
export function openFormulaPopover<T extends {formula: string}>(value: T, inserterType: string = BI.RegularFormulaInserter.xtype): Promise<T> {
return new Promise((resolve, reject) => {
const id = BI.UUID();
let formulaPane: FormulaOpeartingPanel;
BI.Popovers.create(id, {
type: BI.BarPopover.xtype,
width: 900,
height: 600,
header: BI.i18nText('Plugin-JSON_Function_Definition'),
body: {
type: BI.FormulaOpeartingPanel.xtype,
configLoader: fetchFormulaConfig,
ref: (_ref: FormulaOpeartingPanel) => {
formulaPane = _ref;
},
inserterType,
value,
},
listeners: [{
eventName: BI.Popover.EVENT_CANCEL,
action: () => {
reject();
BI.Popovers.remove(id);
},
}, {
eventName: BI.Popover.EVENT_CONFIRM,
action: () => {
resolve(formulaPane.getValue() as T);
BI.Popovers.remove(id);
},
}],
}).open(id);
});
}