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.
|
|
|
export const confirm = (message: string, onConfirm: Function): void => {
|
|
|
|
const id = BI.UUID();
|
|
|
|
BI.Popovers.create(id, {
|
|
|
|
type: 'bi.bar_popover',
|
|
|
|
size: 'normal',
|
|
|
|
header: '提示',
|
|
|
|
width: 450,
|
|
|
|
height: 220,
|
|
|
|
body: {
|
|
|
|
type: 'bi.left',
|
|
|
|
cls: 'comfirm-content',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
type: 'bi.layout',
|
|
|
|
cls: 'comfirm-icon',
|
|
|
|
width: 50,
|
|
|
|
height: 50,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'bi.label',
|
|
|
|
text: message,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
listeners: [
|
|
|
|
{
|
|
|
|
eventName: 'EVENT_CONFIRM',
|
|
|
|
action () {
|
|
|
|
onConfirm ? onConfirm(true) : null;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
eventName: 'EVENT_CANCEL',
|
|
|
|
action () {
|
|
|
|
onConfirm ? onConfirm(false) : null;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}).open(id);
|
|
|
|
};
|