/**
 * [description]
 * @Author   AotyKyp    <aotykyp@gmail.com>
 * @DateTime 2018-10-12
 
 */
;layui.define(['layer','jquery'], function(exports) {
    var $ = layui.jquery
        ,layer = layui.layer;
        
    var admin = {
        config: {
            pageType: ''
        },
        set: function(options) {
            var _this = this;
            $.extend(true, _this.config, options);
            return _this;
        },
        init: function() {
            var _this = this,
                _config = _this.config;
            
            if (_config.pageType === 'form') {
                
            } else if (_config.pageType === 'list') {

            }

            return _this;
        },
        layerOpen: function(title,url,w,h){
          if (title == null || title == '') {
            title=false;
          };
          if (url == null || url == '') {
            url="404.html";
          };
          if (w == null || w == '') {
            w=800;
          };
          if (h == null || h == '') {
            h=($(window).height() - 50);
          };
          layer.open({
            type: 2,
            area: [w+'px', h +'px'],
            fix: false, //不固定
            maxmin: false,
            skin: 'layui-layer-rim',
            shade:0.4,
            title: title,
            content: url,
          });
        },
        layerLoad: function(){
          layer.load(2);
        },
        layerCloseLoad: function(){
          layer.closeAll('loading');
        }
    };

    exports('admin', admin);
});