/* * @Author: xiaomin * @Date: 2021-07-07 10:54:03 * @LastEditTime: 2021-07-09 16:32:45 * @LastEditors: xiaominhuang */ /** * Created by jacky on 2016/7/9. */ export function alert(msg){ const dialog=buildDialog('消息提示',msg); dialog.modal('show'); }; export function confirm(msg,callback){ const dialog=buildDialog('确认提示',msg,[{ name:'确认', click:function(){ callback.call(this); } }]); dialog.modal('show'); }; export function dialog(title,content,callback){ const dialog=buildDialog(title,content,[{ name:'确认', click:function(){ callback.call(this); } }]); dialog.modal('show'); }; export function showDialog(title,dialogContent,buttons,events,large){ const dialog=buildDialog(title,dialogContent,buttons,large); dialog.modal('show'); if(events){ for(let event of events){ dialog.on(event.name,event.callback); } } }; function buildDialog(title,dialogContent,buttons,large){ const className='modal-dialog'+ (large ? ' modal-lg' : ''); let modal=$(``); let dialog=$(`
`); modal.append(dialog); let content=$(`