## 弹窗插件
**用于弹窗展示信息**
```typescript
$.CreateModal(id: string, set: IModalSetting)//参数设置如下IModalSetting所示
interface IModalSetting {
//弹窗标题
title: string,
//触发弹窗的元素
modalHandle?: string,
//模板名称
tmplName?: string,//可用选择器使用页面内嵌模板,也可使用html模板
//触发弹窗后额外的行为
addEvent?: any,////modal实体作为参数
//确定按钮点击后的行为
okEvent?: any,//modal实体作为参数
//初始化事件,页面初始化时的行为
init?: any,//modal实体作为参数
//弹窗隐藏后的行为
hideEvent?: any,//modal实体作为参数
//添加额外的class修改样式
cssClass?: string,
//确定按钮标题
okTitle?: string,
//取消按钮标题
cancelTitle?: string,
}
//弹窗模板(可变更)
modalTemplates={
dialog://窗体容器
"<div class='modal' role='dialog' data-backdrop='static' >" +
"<div class='modal-dialog' >" +
"<div class='modal-content'>" +
"<div class='modal-body'></div>" +
"</div>" +
"</div>" +
"</div>",
header://页眉
"<div class='modal-header'>" +
"<a class='close' data-dismiss='modal' aria-hidden='true'>×</a><h4 class='modal-title'></h4>" +
"</div>",
footer://页脚
"<div class='modal-footer'></div>",
cancleButton://取消按钮
"<a class='btn btn-secondary default btnCancel' data-dismiss='modal' aria-hidden='true'></a>",
okButton://确认按钮
'<button class="btn btn-primary blue btnOk"></button>'
}
//e.g.
//新建弹窗
var modal = $.CreateModal("test",{
title:"审批说明",
tmplName:"#checkMemo",
okTitle:"同意",
cancelTitle:"拒绝",
cssClass:"test",
init:function(){console.log("初始化");},//载入页面后打印'初始化'
okEvent:function(){console.log("同意");}//点击同意按钮后打印'同意'
hideEvent:function(){console.log("隐藏");}//关闭弹窗后打印'隐藏'
addEvent:function(){console.log("新增");}//弹窗显示前打印'新增'
});
//控制弹窗
modal.Show();//显示弹窗
modal.Hide();//隐藏弹窗
modal.resetOk();//取消OK按钮禁用
```