| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- var ModalFix = require('../modal/src/ModalFix.JS');
- export default {
- /**
- * 显示模态框
- */
- show : function(options){
- var dialog = BootstrapDialog.show(options);
- dialog.getModal().on('hidden.bs.modal', {dialog: this}, function (event) {
- ModalFix.fix();
- });
- },
- /**
- * 显示通知
- * @param {title} 标题
- * @param {content} 内容
- * @param {autoClose} 自动延时关闭时间(毫秒)
- * author: 杨志杰
- * version: 1.0
- */
- notice : function(title, content, autoClose){
- var dialog = BootstrapDialog.show({
- title: title,
- message: content,
- type: BootstrapDialog.TYPE_WARNING,
- });
- dialog.getModal().on('hidden.bs.modal', {dialog: this}, function (event) {
- ModalFix.fix();
- });
- if(autoClose && autoClose > 0){
- setTimeout(function(){
- dialog.close();
- }, autoClose);
- }
- },
- /**
- * 显示通知
- * @param {title} 标题
- * @param {content} 内容
- * author: 杨志杰
- * version: 1.0
- */
- noticeBig : function(title, content){
- var dialog = BootstrapDialog.show({
- title: title,
- message: content,
- type: BootstrapDialog.TYPE_WARNING,
- size: BootstrapDialog.SIZE_WIDE,
- });
- dialog.getModal().on('hidden.bs.modal', {dialog: this}, function (event) {
- ModalFix.fix();
- });
- },
- /**
- * 显示消息
- * @param {title} 标题
- * @param {content} 内容
- * @param {autoClose} 自动延时关闭时间(毫秒)
- * author: 杨志杰
- * version: 1.0
- */
- info : function(title, content, autoClose){
- var dialog = BootstrapDialog.show({
- title: title,
- message: content,
- type: BootstrapDialog.TYPE_INFO,
- });
- dialog.getModal().on('hidden.bs.modal', {dialog: this}, function (event) {
- ModalFix.fix();
- });
-
- if(autoClose && autoClose > 0){
- setTimeout(function(){
- dialog.close();
- }, autoClose);
- }
- },
- /**
- * 显示消息
- * @param {title} 标题
- * @param {content} 内容
- * @param {autoClose} 自动延时关闭时间(毫秒)
- * author: 杨志杰
- * version: 1.0
- */
- infoBig : function(title, content, autoClose){
- var dialog = BootstrapDialog.show({
- title: title,
- message: content,
- type: BootstrapDialog.TYPE_INFO,
- size: BootstrapDialog.SIZE_WIDE,
- });
- dialog.getModal().on('hidden.bs.modal', {dialog: this}, function (event) {
- ModalFix.fix();
- });
-
- if(autoClose && autoClose > 0){
- setTimeout(function(){
- dialog.close();
- }, autoClose);
- }
- },
- /**
- * 显示成功信息
- * @param {title} 标题
- * @param {content} 内容
- * @param {autoClose} 自动延时关闭时间(毫秒)
- * author: 杨志杰
- * version: 1.0
- */
- success : function(title, content, autoClose){
- var dialog = BootstrapDialog.show({
- title: title,
- message: content,
- type: BootstrapDialog.TYPE_SUCCESS,
- });
- dialog.getModal().on('hidden.bs.modal', {dialog: this}, function (event) {
- ModalFix.fix();
- });
-
- if(autoClose && autoClose > 0){
- setTimeout(function(){
- dialog.close();
- }, autoClose);
- }
- },
- /**
- * 显示错误信息
- * @param {title} 标题
- * @param {content} 内容
- * @param {autoClose} 自动延时关闭时间(毫秒)
- * author: 杨志杰
- * version: 1.0
- */
- error : function(title, content, autoClose){
- var dialog = BootstrapDialog.show({
- title: title,
- message: content,
- type: BootstrapDialog.TYPE_DANGER,
- });
- dialog.getModal().on('hidden.bs.modal', {dialog: this}, function (event) {
- ModalFix.fix();
- });
- },
-
- };
|