biz.js 1.2 KB

1
  1. define([],function(){var e={};return e.user={},e.user.browser=function(e,n,r){var o="visible";r&&r.mode&&(o=r.mode);var i="0";$.isArray(e)&&e.length>0&&(i=e.join()),$("#user-browser-dialog")[0]&&$("#user-browser-dialog").remove();var t="./index.php?c=utility&a=user&do=browser&callback=aMember&mode="+o+"&uids="+i,a=util.dialog("请选择用户","数据加载中......",'<button type="button" class="btn btn-default" data-dismiss="modal">取消</button><button type="button" class="btn btn-primary">确认</button>',{containerName:"user-browser-dialog"});a.modal("show"),a.on("shown.bs.modal",function(){window.aMember.pIndex=1,window.aMember.query()}),a.find(".modal-footer .btn-primary").click(function(){var e=[],r=$(".user-browser .btn-primary");r.length>0&&(r.each(function(){e.push($(this).attr("js-uid"))}),$.isFunction(n)&&(n(e),a.modal("hide")))}),window.aMember={pIndex:1,query:function(){var e={keyword:$("#keyword").val(),page:aMember.pIndex,callback:"aMember",mode:o,uids:i};$.post(t,e,function(e){a.find(".modal-body").html(e),r.direct&&a.find(".js-btn-select").click(function(){a.find(".modal-footer .btn-primary").trigger("click")}),a.find(".pagination a").click(function(){window.aMember.pIndex=$(this).attr("page"),window.aMember.query()})})}}},e});