diff --git a/403.html b/403.html new file mode 100644 index 000000000..c0423068e --- /dev/null +++ b/403.html @@ -0,0 +1,21 @@ + + + + + 403 - 访问被拒绝 + + + + +
+ +
+

403

+

抱歉,你无权访问该页面

+ +
+
+ + + + diff --git a/404.html b/404.html new file mode 100644 index 000000000..16d21439e --- /dev/null +++ b/404.html @@ -0,0 +1,21 @@ + + + + + 404 - 页面不存在 + + + + +
+ +
+

404

+

抱歉,你访问的页面不存在或仍在开发中

+ +
+
+ + + + diff --git a/500.html b/500.html new file mode 100644 index 000000000..a067102fd --- /dev/null +++ b/500.html @@ -0,0 +1,21 @@ + + + + + 500 - 服务器错误 + + + + +
+ +
+

500

+

抱歉,服务器出错了

+ +
+
+ + + + diff --git a/application/admin/common/auth.php b/application/admin/common/auth.php index 9fee46c34..7f64ccbc5 100644 --- a/application/admin/common/auth.php +++ b/application/admin/common/auth.php @@ -1,276 +1,276 @@ array('name' => lang('menu/index'), 'icon' => 'xe625', 'sub' => array( - '11' => array("show"=>1,"name" =>lang('menu/welcome'), 'controller' => 'index', 'action' => 'welcome'), - '12' => array("show"=>1,"name" =>lang('menu/quickmenu'), 'controller' => 'index', 'action' => 'quickmenu'), + '1' => array("title" => lang('menu/index'), 'icon' => 'layui-icon layui-icon-console', 'children' => array( + '11' => array("show" => 1, "title" => lang('menu/welcome'), 'controller' => 'index', 'action' => 'welcome'), + '12' => array("show" => 1, "title" => lang('menu/quickmenu'), 'controller' => 'index', 'action' => 'quickmenu'), - '1001' => array("show"=>0,"name" => '--切换布局', 'controller' => 'index', 'action' => 'iframe'), - '1002' => array("show"=>0,"name" => '--清理缓存', 'controller' => 'index', 'action' => 'clear'), - '1003' => array("show"=>0,"name" => '--锁屏解锁', 'controller' => 'index', 'action' => 'unlocked'), - '1004' => array("show"=>0,"name" => '--公共下拉选择框', 'controller' => 'index', 'action' => 'select'), - '1005' => array("show"=>0,"name" => '--文件上传', 'controller' => 'upload', 'action' => 'upload'), + '1001' => array("show" => 0, "title" => '--切换布局', 'controller' => 'index', 'action' => 'iframe'), + '1002' => array("show" => 0, "title" => '--清理缓存', 'controller' => 'index', 'action' => 'clear'), + '1003' => array("show" => 0, "title" => '--锁屏解锁', 'controller' => 'index', 'action' => 'unlocked'), + '1004' => array("show" => 0, "title" => '--公共下拉选择框', 'controller' => 'index', 'action' => 'select'), + '1005' => array("show" => 0, "title" => '--文件上传', 'controller' => 'upload', 'action' => 'upload'), )), - '2' => array('name' => lang('menu/system'), 'icon' => 'xe62e', 'sub' => array( - '21' => array("show"=>1,'name' => lang('menu/config'), 'controller' => 'system', 'action' => 'config'), - '210' => array("show"=>1,"name" => lang('menu/configseo'), 'controller' => 'system', 'action' => 'configseo'), - '211' => array("show"=>1,"name" => lang('menu/configuser'), 'controller' => 'system', 'action' => 'configuser'), - '212' => array("show"=>1,"name" => lang('menu/configcomment'), 'controller' => 'system', 'action' => 'configcomment'), - '213' => array("show"=>1,"name" => lang('menu/configupload'), 'controller' => 'system', 'action' => 'configupload'), - '22' => array("show"=>1,"name" => lang('menu/configurl'), 'controller' => 'system', 'action' => 'configurl'), - '23' => array("show"=>1,"name" => lang('menu/configplay'), 'controller' => 'system', 'action' => 'configplay'), - '24' => array("show"=>1,"name" => lang('menu/configcollect'), 'controller' => 'system', 'action' => 'configcollect'), - '25' => array("show"=>1,"name" => lang('menu/configinterface'), 'controller' => 'system', 'action' => 'configinterface'), - '26' => array("show"=>1,"name" => lang('menu/configapi'), 'controller' => 'system', 'action' => 'configapi'), - '27' => array("show"=>1,"name" => lang('menu/configconnect'), 'controller' => 'system', 'action' => 'configconnect'), - '28' => array("show"=>1,"name" => lang('menu/configpay'), 'controller' => 'system', 'action' => 'configpay'), - '29' => array("show"=>1,"name" => lang('menu/configweixin'), 'controller' => 'system', 'action' => 'configweixin'), - '291' => array("show"=>1,"name" => lang('menu/configemail'), 'controller' => 'system', 'action' => 'configemail'), - '292' => array("show"=>1,"name" => lang('menu/configsms'), 'controller' => 'system', 'action' => 'configsms'), - - '2910' => array("show"=>1,"name" => lang('menu/timming'), 'controller' => 'timming', 'action' => 'index'), - '2911' => array("show"=>0,'name' => '--定时任务信息维护', 'controller' => 'timming', 'action' => 'info'), - '2912' => array("show"=>0,'name' => '--定时任务删除', 'controller' => 'timming', 'action' => 'del'), - '2913' => array("show"=>0,'name' => '--定时任务状态', 'controller' => 'timming', 'action' => 'field'), - '2920' => array("show"=>1,"name" => lang('menu/domain'), 'controller' => 'domain', 'action' => 'index'), - '2922' => array("show"=>0,'name' => '--站群删除', 'controller' => 'domain', 'action' => 'del'), - '2923' => array("show"=>0,'name' => '--站群导出', 'controller' => 'domain', 'action' => 'export'), - '2924' => array("show"=>0,'name' => '--站群导入', 'controller' => 'domain', 'action' => 'import'), + '2' => array("title" => lang('menu/system'), 'icon' => 'layui-icon layui-icon-console', 'children' => array( + '21' => array("show" => 1, "title" => lang('menu/config'), 'controller' => 'system', 'action' => 'config'), + '210' => array("show" => 1, "title" => lang('menu/configseo'), 'controller' => 'system', 'action' => 'configseo'), + '211' => array("show" => 1, "title" => lang('menu/configuser'), 'controller' => 'system', 'action' => 'configuser'), + '212' => array("show" => 1, "title" => lang('menu/configcomment'), 'controller' => 'system', 'action' => 'configcomment'), + '213' => array("show" => 1, "title" => lang('menu/configupload'), 'controller' => 'system', 'action' => 'configupload'), + '22' => array("show" => 1, "title" => lang('menu/configurl'), 'controller' => 'system', 'action' => 'configurl'), + '23' => array("show" => 1, "title" => lang('menu/configplay'), 'controller' => 'system', 'action' => 'configplay'), + '24' => array("show" => 1, "title" => lang('menu/configcollect'), 'controller' => 'system', 'action' => 'configcollect'), + '25' => array("show" => 1, "title" => lang('menu/configinterface'), 'controller' => 'system', 'action' => 'configinterface'), + '26' => array("show" => 1, "title" => lang('menu/configapi'), 'controller' => 'system', 'action' => 'configapi'), + '27' => array("show" => 1, "title" => lang('menu/configconnect'), 'controller' => 'system', 'action' => 'configconnect'), + '28' => array("show" => 1, "title" => lang('menu/configpay'), 'controller' => 'system', 'action' => 'configpay'), + '29' => array("show" => 1, "title" => lang('menu/configweixin'), 'controller' => 'system', 'action' => 'configweixin'), + '291' => array("show" => 1, "title" => lang('menu/configemail'), 'controller' => 'system', 'action' => 'configemail'), + '292' => array("show" => 1, "title" => lang('menu/configsms'), 'controller' => 'system', 'action' => 'configsms'), + + '2910' => array("show" => 1, "title" => lang('menu/timming'), 'controller' => 'timming', 'action' => 'index'), + '2911' => array("show" => 0, "title" => '--定时任务信息维护', 'controller' => 'timming', 'action' => 'info'), + '2912' => array("show" => 0, "title" => '--定时任务删除', 'controller' => 'timming', 'action' => 'del'), + '2913' => array("show" => 0, "title" => '--定时任务状态', 'controller' => 'timming', 'action' => 'field'), + '2920' => array("show" => 1, "title" => lang('menu/domain'), 'controller' => 'domain', 'action' => 'index'), + '2922' => array("show" => 0, "title" => '--站群删除', 'controller' => 'domain', 'action' => 'del'), + '2923' => array("show" => 0, "title" => '--站群导出', 'controller' => 'domain', 'action' => 'export'), + '2924' => array("show" => 0, "title" => '--站群导入', 'controller' => 'domain', 'action' => 'import'), )), - '3' => array('name' => lang('menu/base'), 'icon' => 'xe64b', 'sub' => array( - '31' => array("show"=>1,'name' => lang('menu/type'), 'controller' => 'type', 'action' => 'index'), - - '3101' => array("show"=>0,'name' => '--分类信息维护', 'controller' => 'type', 'action' => 'info'), - '3102' => array("show"=>0,'name' => '--分类批量修改', 'controller' => 'type', 'action' => 'batch'), - '3103' => array("show"=>0,'name' => '--分类删除', 'controller' => 'type', 'action' => 'del'), - '3104' => array("show"=>0,'name' => '--分类状态', 'controller' => 'type', 'action' => 'field'), - '3105' => array("show"=>0,'name' => '--分类扩展配置信息', 'controller' => 'type', 'action' => 'extend'), - - - '32' => array("show"=>1,'name' => lang('menu/topic'), 'controller' => 'topic', 'action' => 'data'), - '3201' => array("show"=>0,'name' => '--专题信息维护', 'controller' => 'topic', 'action' => 'info'), - '3202' => array("show"=>0,'name' => '--专题批量修改', 'controller' => 'topic', 'action' => 'batch'), - '3203' => array("show"=>0,'name' => '--专题删除', 'controller' => 'topic', 'action' => 'del'), - '3204' => array("show"=>0,'name' => '--专题状态', 'controller' => 'topic', 'action' => 'field'), - - '33' => array("show"=>1,'name' => lang('menu/link'), 'controller' => 'link', 'action' => 'index'), - '3301' => array("show"=>0,'name' => '--友链信息维护', 'controller' => 'link', 'action' => 'info'), - '3302' => array("show"=>0,'name' => '--友链批量修改', 'controller' => 'link', 'action' => 'batch'), - '3303' => array("show"=>0,'name' => '--友链删除', 'controller' => 'link', 'action' => 'del'), - '3304' => array("show"=>0,'name' => '--友链状态', 'controller' => 'link', 'action' => 'field'), - - - '34' => array("show"=>1,'name' => lang('menu/gbook'), 'controller' => 'gbook', 'action' => 'data'), - '3401' => array("show"=>0,'name' => '--留言信息维护', 'controller' => 'gbook', 'action' => 'info'), - '3402' => array("show"=>0,'name' => '--留言删除', 'controller' => 'gbook', 'action' => 'del'), - '3404' => array("show"=>0,'name' => '--留言状态', 'controller' => 'gbook', 'action' => 'field'), - - '35' => array("show"=>1,'name' => lang('menu/comment'), 'controller' => 'comment', 'action' => 'data'), - '3501' => array("show"=>0,'name' => '--评论信息维护', 'controller' => 'comment', 'action' => 'info'), - '3502' => array("show"=>0,'name' => '--评论删除', 'controller' => 'comment', 'action' => 'del'), - '3504' => array("show"=>0,'name' => '--评论状态', 'controller' => 'comment', 'action' => 'field'), - - '36' => array("show"=>1,'name' => lang('menu/images'), 'controller' => 'annex', 'action' => 'data'), - '3604' => array("show"=>0,'name' => '--附件文件夹', 'controller' => 'annex', 'action' => 'file'), - '3605' => array("show"=>0,'name' => '--附件检测', 'controller' => 'annex', 'action' => 'check'), - '3606' => array("show"=>0,'name' => '--附件数据初始化', 'controller' => 'annex', 'action' => 'init'), - '3601' => array("show"=>0,'name' => '--附件删除', 'controller' => 'annex', 'action' => 'del'), - '3602' => array("show"=>0,'name' => '--同步图片选项', 'controller' => 'images', 'action' => 'opt'), - '3603' => array("show"=>0,'name' => '--同步图片方法', 'controller' => 'images', 'action' => 'sync'), + '3' => array("title" => lang('menu/base'), 'icon' => 'layui-icon layui-icon-console', 'children' => array( + '31' => array("show" => 1, "title" => lang('menu/type'), 'controller' => 'type', 'action' => 'index'), + + '3101' => array("show" => 0, "title" => '--分类信息维护', 'controller' => 'type', 'action' => 'info'), + '3102' => array("show" => 0, "title" => '--分类批量修改', 'controller' => 'type', 'action' => 'batch'), + '3103' => array("show" => 0, "title" => '--分类删除', 'controller' => 'type', 'action' => 'del'), + '3104' => array("show" => 0, "title" => '--分类状态', 'controller' => 'type', 'action' => 'field'), + '3105' => array("show" => 0, "title" => '--分类扩展配置信息', 'controller' => 'type', 'action' => 'extend'), + + + '32' => array("show" => 1, "title" => lang('menu/topic'), 'controller' => 'topic', 'action' => 'data'), + '3201' => array("show" => 0, "title" => '--专题信息维护', 'controller' => 'topic', 'action' => 'info'), + '3202' => array("show" => 0, "title" => '--专题批量修改', 'controller' => 'topic', 'action' => 'batch'), + '3203' => array("show" => 0, "title" => '--专题删除', 'controller' => 'topic', 'action' => 'del'), + '3204' => array("show" => 0, "title" => '--专题状态', 'controller' => 'topic', 'action' => 'field'), + + '33' => array("show" => 1, "title" => lang('menu/link'), 'controller' => 'link', 'action' => 'index'), + '3301' => array("show" => 0, "title" => '--友链信息维护', 'controller' => 'link', 'action' => 'info'), + '3302' => array("show" => 0, "title" => '--友链批量修改', 'controller' => 'link', 'action' => 'batch'), + '3303' => array("show" => 0, "title" => '--友链删除', 'controller' => 'link', 'action' => 'del'), + '3304' => array("show" => 0, "title" => '--友链状态', 'controller' => 'link', 'action' => 'field'), + + + '34' => array("show" => 1, "title" => lang('menu/gbook'), 'controller' => 'gbook', 'action' => 'data'), + '3401' => array("show" => 0, "title" => '--留言信息维护', 'controller' => 'gbook', 'action' => 'info'), + '3402' => array("show" => 0, "title" => '--留言删除', 'controller' => 'gbook', 'action' => 'del'), + '3404' => array("show" => 0, "title" => '--留言状态', 'controller' => 'gbook', 'action' => 'field'), + + '35' => array("show" => 1, "title" => lang('menu/comment'), 'controller' => 'comment', 'action' => 'data'), + '3501' => array("show" => 0, "title" => '--评论信息维护', 'controller' => 'comment', 'action' => 'info'), + '3502' => array("show" => 0, "title" => '--评论删除', 'controller' => 'comment', 'action' => 'del'), + '3504' => array("show" => 0, "title" => '--评论状态', 'controller' => 'comment', 'action' => 'field'), + + '36' => array("show" => 1, "title" => lang('menu/images'), 'controller' => 'annex', 'action' => 'data'), + '3604' => array("show" => 0, "title" => '--附件文件夹', 'controller' => 'annex', 'action' => 'file'), + '3605' => array("show" => 0, "title" => '--附件检测', 'controller' => 'annex', 'action' => 'check'), + '3606' => array("show" => 0, "title" => '--附件数据初始化', 'controller' => 'annex', 'action' => 'init'), + '3601' => array("show" => 0, "title" => '--附件删除', 'controller' => 'annex', 'action' => 'del'), + '3602' => array("show" => 0, "title" => '--同步图片选项', 'controller' => 'images', 'action' => 'opt'), + '3603' => array("show" => 0, "title" => '--同步图片方法', 'controller' => 'images', 'action' => 'sync'), )), - '5' => array('name' => lang('menu/art'), 'icon' => 'xe616', 'sub' => array( + '5' => array("title" => lang('menu/art'), 'icon' => 'layui-icon layui-icon-console', 'children' => array( - '51' => array("show"=>1,'name' => lang('menu/art_data'), 'controller' => 'art', 'action' => 'data'), - '5101' => array("show"=>0,'name' => '--文章信息维护', 'controller' => 'art', 'action' => 'info'), - '5102' => array("show"=>0,'name' => '--文章删除', 'controller' => 'art', 'action' => 'del'), - '5103' => array("show"=>0,'name' => '--文章状态', 'controller' => 'art', 'action' => 'field'), + '51' => array("show" => 1, "title" => lang('menu/art_data'), 'controller' => 'art', 'action' => 'data'), + '5101' => array("show" => 0, "title" => '--文章信息维护', 'controller' => 'art', 'action' => 'info'), + '5102' => array("show" => 0, "title" => '--文章删除', 'controller' => 'art', 'action' => 'del'), + '5103' => array("show" => 0, "title" => '--文章状态', 'controller' => 'art', 'action' => 'field'), - '52' => array("show"=>1,'name' => lang('menu/art_add'), 'controller' => 'art', 'action' => 'info'), - '53' => array("show"=>1,'name' => lang('menu/art_data_lock'), 'controller' => 'art', 'action' => 'data','param'=>'lock=1'), - '54' => array("show"=>1,'name' => lang('menu/art_data_audit'), 'controller' => 'art', 'action' => 'data','param'=>'status=0'), - '59' => array("show"=>1,'name' => lang('menu/art_batch'), 'controller' => 'art', 'action' => 'batch'), - '591' => array("show"=>1,'name' => lang('menu/art_repeat'), 'controller' => 'art', 'action' => 'data', 'param'=>'repeat=1'), + '52' => array("show" => 1, "title" => lang('menu/art_add'), 'controller' => 'art', 'action' => 'info'), + '53' => array("show" => 1, "title" => lang('menu/art_data_lock'), 'controller' => 'art', 'action' => 'data', 'param' => 'lock=1'), + '54' => array("show" => 1, "title" => lang('menu/art_data_audit'), 'controller' => 'art', 'action' => 'data', 'param' => 'status=0'), + '59' => array("show" => 1, "title" => lang('menu/art_batch'), 'controller' => 'art', 'action' => 'batch'), + '591' => array("show" => 1, "title" => lang('menu/art_repeat'), 'controller' => 'art', 'action' => 'data', 'param' => 'repeat=1'), )), - '4' => array('name' => lang('menu/vod'), 'icon' => 'xe639', 'sub' => array( - '41' => array("show"=>1,'name' => lang('menu/server'), 'controller' => 'vodserver', 'action' => 'index'), - '4101' => array("show"=>0,'name' => '--服务器组信息维护', 'controller' => 'vodserver', 'action' => 'info'), - '4102' => array("show"=>0,'name' => '--服务器组删除', 'controller' => 'vodserver', 'action' => 'del'), - '4103' => array("show"=>0,'name' => '--服务器组状态', 'controller' => 'vodserver', 'action' => 'field'), - - '42' => array("show"=>1,'name' => lang('menu/player'), 'controller' => 'vodplayer', 'action' => 'index'), - '4201' => array("show"=>0,'name' => '--播放器信息维护', 'controller' => 'vodplayer', 'action' => 'info'), - '4202' => array("show"=>0,'name' => '--播放器删除', 'controller' => 'vodplayer', 'action' => 'del'), - '4203' => array("show"=>0,'name' => '--播放器组状态', 'controller' => 'vodplayer', 'action' => 'field'), - - '43' => array("show"=>1,'name' => lang('menu/downer'), 'controller' => 'voddowner', 'action' => 'index'), - '4301' => array("show"=>0,'name' => '--下载器信息维护', 'controller' => 'voddowner', 'action' => 'info'), - '4302' => array("show"=>0,'name' => '--下载器删除', 'controller' => 'voddowner', 'action' => 'del'), - '4303' => array("show"=>0,'name' => '--下载器组状态', 'controller' => 'voddowner', 'action' => 'field'), - - '44' => array("show"=>1,'name' => lang('menu/vod_data'), 'controller' => 'vod', 'action' => 'data'), - '4401' => array("show"=>0,'name' => '--视频信息维护', 'controller' => 'vod', 'action' => 'info'), - '4402' => array("show"=>0,'name' => '--视频删除', 'controller' => 'vod', 'action' => 'del'), - '4403' => array("show"=>0,'name' => '--视频状态', 'controller' => 'vod', 'action' => 'field'), - - '45' => array("show"=>1,'name' => lang('menu/vod_add'), 'controller' => 'vod', 'action' => 'info'), - '46' => array("show"=>1,'name' => lang('menu/vod_data_url_empty'), 'controller' => 'vod', 'action' => 'data' , 'param'=>'url=1'), - '47' => array("show"=>1,'name' => lang('menu/vod_data_lock'), 'controller' => 'vod', 'action' => 'data', 'param'=>'lock=1'), - '48' => array("show"=>1,'name' => lang('menu/vod_data_audit'), 'controller' => 'vod', 'action' => 'data', 'param'=>'status=0'), - '481' => array("show"=>1,'name' => lang('menu/vod_data_points'), 'controller' => 'vod', 'action' => 'data', 'param'=>'points=1'), - '482' => array("show"=>1,'name' => lang('menu/vod_data_plot'), 'controller' => 'vod', 'action' => 'data', 'param'=>'plot=1'), - '49' => array("show"=>1,'name' => lang('menu/vod_batch'), 'controller' => 'vod', 'action' => 'batch'), - '491' => array("show"=>1,'name' => lang('menu/vod_repeat'), 'controller' => 'vod', 'action' => 'data', 'param'=>'repeat=1'), - - '495' => array("show"=>1,'name' => lang('menu/actor'), 'controller' => 'actor', 'action' => 'data', 'param'=>''), - '4951' => array("show"=>0,'name' => '--演员信息维护', 'controller' => 'actor', 'action' => 'info'), - '4952' => array("show"=>0,'name' => '--演员删除', 'controller' => 'actor', 'action' => 'del'), - '4953' => array("show"=>0,'name' => '--演员状态', 'controller' => 'actor', 'action' => 'field'), - '4954' => array("show"=>0,'name' => '--添加演员', 'controller' => 'actor', 'action' => 'info'), - - '496' => array("show"=>1,'name' => lang('menu/role'), 'controller' => 'role', 'action' => 'data', 'param'=>''), - '4961' => array("show"=>0,'name' => '--角色信息维护', 'controller' => 'role', 'action' => 'info'), - '4962' => array("show"=>0,'name' => '--角色删除', 'controller' => 'role', 'action' => 'del'), - '4963' => array("show"=>0,'name' => '--角色状态', 'controller' => 'role', 'action' => 'field'), - '4964' => array("show"=>0,'name' => '--添加角色', 'controller' => 'role', 'action' => 'info'), + '4' => array("title" => lang('menu/vod'), 'icon' => 'layui-icon layui-icon-console', 'children' => array( + '41' => array("show" => 1, "title" => lang('menu/server'), 'controller' => 'vodserver', 'action' => 'index'), + '4101' => array("show" => 0, "title" => '--服务器组信息维护', 'controller' => 'vodserver', 'action' => 'info'), + '4102' => array("show" => 0, "title" => '--服务器组删除', 'controller' => 'vodserver', 'action' => 'del'), + '4103' => array("show" => 0, "title" => '--服务器组状态', 'controller' => 'vodserver', 'action' => 'field'), + + '42' => array("show" => 1, "title" => lang('menu/player'), 'controller' => 'vodplayer', 'action' => 'index'), + '4201' => array("show" => 0, "title" => '--播放器信息维护', 'controller' => 'vodplayer', 'action' => 'info'), + '4202' => array("show" => 0, "title" => '--播放器删除', 'controller' => 'vodplayer', 'action' => 'del'), + '4203' => array("show" => 0, "title" => '--播放器组状态', 'controller' => 'vodplayer', 'action' => 'field'), + + '43' => array("show" => 1, "title" => lang('menu/downer'), 'controller' => 'voddowner', 'action' => 'index'), + '4301' => array("show" => 0, "title" => '--下载器信息维护', 'controller' => 'voddowner', 'action' => 'info'), + '4302' => array("show" => 0, "title" => '--下载器删除', 'controller' => 'voddowner', 'action' => 'del'), + '4303' => array("show" => 0, "title" => '--下载器组状态', 'controller' => 'voddowner', 'action' => 'field'), + + '44' => array("show" => 1, "title" => lang('menu/vod_data'), 'controller' => 'vod', 'action' => 'data'), + '4401' => array("show" => 0, "title" => '--视频信息维护', 'controller' => 'vod', 'action' => 'info'), + '4402' => array("show" => 0, "title" => '--视频删除', 'controller' => 'vod', 'action' => 'del'), + '4403' => array("show" => 0, "title" => '--视频状态', 'controller' => 'vod', 'action' => 'field'), + + '45' => array("show" => 1, "title" => lang('menu/vod_add'), 'controller' => 'vod', 'action' => 'info'), + '46' => array("show" => 1, "title" => lang('menu/vod_data_url_empty'), 'controller' => 'vod', 'action' => 'data', 'param' => 'url=1'), + '47' => array("show" => 1, "title" => lang('menu/vod_data_lock'), 'controller' => 'vod', 'action' => 'data', 'param' => 'lock=1'), + '48' => array("show" => 1, "title" => lang('menu/vod_data_audit'), 'controller' => 'vod', 'action' => 'data', 'param' => 'status=0'), + '481' => array("show" => 1, "title" => lang('menu/vod_data_points'), 'controller' => 'vod', 'action' => 'data', 'param' => 'points=1'), + '482' => array("show" => 1, "title" => lang('menu/vod_data_plot'), 'controller' => 'vod', 'action' => 'data', 'param' => 'plot=1'), + '49' => array("show" => 1, "title" => lang('menu/vod_batch'), 'controller' => 'vod', 'action' => 'batch'), + '491' => array("show" => 1, "title" => lang('menu/vod_repeat'), 'controller' => 'vod', 'action' => 'data', 'param' => 'repeat=1'), + + '495' => array("show" => 1, "title" => lang('menu/actor'), 'controller' => 'actor', 'action' => 'data', 'param' => ''), + '4951' => array("show" => 0, "title" => '--演员信息维护', 'controller' => 'actor', 'action' => 'info'), + '4952' => array("show" => 0, "title" => '--演员删除', 'controller' => 'actor', 'action' => 'del'), + '4953' => array("show" => 0, "title" => '--演员状态', 'controller' => 'actor', 'action' => 'field'), + '4954' => array("show" => 0, "title" => '--添加演员', 'controller' => 'actor', 'action' => 'info'), + + '496' => array("show" => 1, "title" => lang('menu/role'), 'controller' => 'role', 'action' => 'data', 'param' => ''), + '4961' => array("show" => 0, "title" => '--角色信息维护', 'controller' => 'role', 'action' => 'info'), + '4962' => array("show" => 0, "title" => '--角色删除', 'controller' => 'role', 'action' => 'del'), + '4963' => array("show" => 0, "title" => '--角色状态', 'controller' => 'role', 'action' => 'field'), + '4964' => array("show" => 0, "title" => '--添加角色', 'controller' => 'role', 'action' => 'info'), )), - '12' => array('name' => lang('menu/website'), 'icon' => 'xe616', 'sub' => array( + '12' => array("title" => lang('menu/website'), 'icon' => 'layui-icon layui-icon-console', 'children' => array( - '121' => array("show"=>1,'name' => lang('menu/website_data'), 'controller' => 'website', 'action' => 'data'), - '12101' => array("show"=>0,'name' => '--网址信息维护', 'controller' => 'website', 'action' => 'info'), - '12102' => array("show"=>0,'name' => '--网址删除', 'controller' => 'website', 'action' => 'del'), - '12103' => array("show"=>0,'name' => '--网址状态', 'controller' => 'website', 'action' => 'field'), + '121' => array("show" => 1, "title" => lang('menu/website_data'), 'controller' => 'website', 'action' => 'data'), + '12101' => array("show" => 0, "title" => '--网址信息维护', 'controller' => 'website', 'action' => 'info'), + '12102' => array("show" => 0, "title" => '--网址删除', 'controller' => 'website', 'action' => 'del'), + '12103' => array("show" => 0, "title" => '--网址状态', 'controller' => 'website', 'action' => 'field'), - '122' => array("show"=>1,'name' => lang('menu/website_add'), 'controller' => 'website', 'action' => 'info'), - '123' => array("show"=>1,'name' => lang('menu/website_data_lock'), 'controller' => 'website', 'action' => 'data','param'=>'lock=1'), - '124' => array("show"=>1,'name' => lang('menu/website_data_audit'), 'controller' => 'website', 'action' => 'data','param'=>'status=0'), - '129' => array("show"=>1,'name' => lang('menu/website_batch'), 'controller' => 'website', 'action' => 'batch'), - '1291' => array("show"=>1,'name' => lang('menu/website_repeat'), 'controller' => 'website', 'action' => 'data', 'param'=>'repeat=1'), + '122' => array("show" => 1, "title" => lang('menu/website_add'), 'controller' => 'website', 'action' => 'info'), + '123' => array("show" => 1, "title" => lang('menu/website_data_lock'), 'controller' => 'website', 'action' => 'data', 'param' => 'lock=1'), + '124' => array("show" => 1, "title" => lang('menu/website_data_audit'), 'controller' => 'website', 'action' => 'data', 'param' => 'status=0'), + '129' => array("show" => 1, "title" => lang('menu/website_batch'), 'controller' => 'website', 'action' => 'batch'), + '1291' => array("show" => 1, "title" => lang('menu/website_repeat'), 'controller' => 'website', 'action' => 'data', 'param' => 'repeat=1'), )), - '6' => array('name' => lang('menu/users'), 'icon' => 'xe62c', 'sub' => array( - '61' => array("show"=>1,'name' => lang('menu/admin'), 'controller' => 'admin', 'action' => 'index'), - '6101' => array("show"=>0,'name' => '--管理员信息维护', 'controller' => 'admin', 'action' => 'info'), - '6102' => array("show"=>0,'name' => '--管理员删除', 'controller' => 'admin', 'action' => 'del'), - '6103' => array("show"=>0,'name' => '--管理员状态', 'controller' => 'admin', 'action' => 'field'), + '6' => array("title" => lang('menu/users'), 'icon' => 'layui-icon layui-icon-console', 'children' => array( + '61' => array("show" => 1, "title" => lang('menu/admin'), 'controller' => 'admin', 'action' => 'index'), + '6101' => array("show" => 0, "title" => '--管理员信息维护', 'controller' => 'admin', 'action' => 'info'), + '6102' => array("show" => 0, "title" => '--管理员删除', 'controller' => 'admin', 'action' => 'del'), + '6103' => array("show" => 0, "title" => '--管理员状态', 'controller' => 'admin', 'action' => 'field'), - '62' => array("show"=>1,'name' => lang('menu/group'), 'controller' => 'group', 'action' => 'index'), - '6201' => array("show"=>0,'name' => '--会员组信息维护', 'controller' => 'group', 'action' => 'info'), - '6202' => array("show"=>0,'name' => '--会员组删除', 'controller' => 'group', 'action' => 'del'), - '6203' => array("show"=>0,'name' => '--会员组状态', 'controller' => 'group', 'action' => 'field'), + '62' => array("show" => 1, "title" => lang('menu/group'), 'controller' => 'group', 'action' => 'index'), + '6201' => array("show" => 0, "title" => '--会员组信息维护', 'controller' => 'group', 'action' => 'info'), + '6202' => array("show" => 0, "title" => '--会员组删除', 'controller' => 'group', 'action' => 'del'), + '6203' => array("show" => 0, "title" => '--会员组状态', 'controller' => 'group', 'action' => 'field'), - '63' => array("show"=>1,'name' => lang('menu/user'), 'controller' => 'user', 'action' => 'data'), - '6301' => array("show"=>0,'name' => '--会员信息维护', 'controller' => 'user', 'action' => 'info'), - '6302' => array("show"=>0,'name' => '--会员删除', 'controller' => 'user', 'action' => 'del'), - '6303' => array("show"=>0,'name' => '--会员状态', 'controller' => 'user', 'action' => 'field'), + '63' => array("show" => 1, "title" => lang('menu/user'), 'controller' => 'user', 'action' => 'data'), + '6301' => array("show" => 0, "title" => '--会员信息维护', 'controller' => 'user', 'action' => 'info'), + '6302' => array("show" => 0, "title" => '--会员删除', 'controller' => 'user', 'action' => 'del'), + '6303' => array("show" => 0, "title" => '--会员状态', 'controller' => 'user', 'action' => 'field'), - '64' => array("show"=>1,'name' => lang('menu/card'), 'controller' => 'card', 'action' => 'index'), - '6401' => array("show"=>0,'name' => '--充值卡信息维护', 'controller' => 'card', 'action' => 'info'), - '6402' => array("show"=>0,'name' => '--充值卡删除', 'controller' => 'card', 'action' => 'del'), + '64' => array("show" => 1, "title" => lang('menu/card'), 'controller' => 'card', 'action' => 'index'), + '6401' => array("show" => 0, "title" => '--充值卡信息维护', 'controller' => 'card', 'action' => 'info'), + '6402' => array("show" => 0, "title" => '--充值卡删除', 'controller' => 'card', 'action' => 'del'), - '65' => array("show"=>1,'name' => lang('menu/order'), 'controller' => 'order', 'action' => 'index'), - '6501' => array("show"=>0,'name' => '--订单删除', 'controller' => 'order', 'action' => 'del'), + '65' => array("show" => 1, "title" => lang('menu/order'), 'controller' => 'order', 'action' => 'index'), + '6501' => array("show" => 0, "title" => '--订单删除', 'controller' => 'order', 'action' => 'del'), - '66' => array("show"=>1,'name' => lang('menu/ulog'), 'controller' => 'ulog', 'action' => 'index'), - '6601' => array("show"=>0,'name' => '--访问日志删除', 'controller' => 'ulog', 'action' => 'del'), + '66' => array("show" => 1, "title" => lang('menu/ulog'), 'controller' => 'ulog', 'action' => 'index'), + '6601' => array("show" => 0, "title" => '--访问日志删除', 'controller' => 'ulog', 'action' => 'del'), - '67' => array("show"=>1,'name' => lang('menu/plog'), 'controller' => 'plog', 'action' => 'index'), - '6701' => array("show"=>0,'name' => '--积分日志删除', 'controller' => 'plog', 'action' => 'del'), + '67' => array("show" => 1, "title" => lang('menu/plog'), 'controller' => 'plog', 'action' => 'index'), + '6701' => array("show" => 0, "title" => '--积分日志删除', 'controller' => 'plog', 'action' => 'del'), - '68' => array("show"=>1,'name' => lang('menu/cash'), 'controller' => 'cash', 'action' => 'index'), - '6801' => array("show"=>0,'name' => '--提现删除', 'controller' => 'cash', 'action' => 'del'), - '6802' => array("show"=>0,'name' => '--提现审核', 'controller' => 'cash', 'action' => 'audit'), + '68' => array("show" => 1, "title" => lang('menu/cash'), 'controller' => 'cash', 'action' => 'index'), + '6801' => array("show" => 0, "title" => '--提现删除', 'controller' => 'cash', 'action' => 'del'), + '6802' => array("show" => 0, "title" => '--提现审核', 'controller' => 'cash', 'action' => 'audit'), )), - '7' => array('name' => lang('menu/templates'), 'icon' => 'xe72d', 'sub' => array( - '71' => array("show"=>1,'name' => lang('menu/template'), 'controller' => 'template', 'action' => 'index'), - '7101' => array("show"=>0,'name' => '--模板信息维护', 'controller' => 'template', 'action' => 'info'), - '7102' => array("show"=>0,'name' => '--模板删除', 'controller' => 'template', 'action' => 'del'), + '7' => array("title" => lang('menu/templates'), 'icon' => 'layui-icon layui-icon-console', 'children' => array( + '71' => array("show" => 1, "title" => lang('menu/template'), 'controller' => 'template', 'action' => 'index'), + '7101' => array("show" => 0, "title" => '--模板信息维护', 'controller' => 'template', 'action' => 'info'), + '7102' => array("show" => 0, "title" => '--模板删除', 'controller' => 'template', 'action' => 'del'), - '72' => array("show"=>1,'name' => lang('menu/ads'), 'controller' => 'template', 'action' => 'ads', 'param'=>''), - '73' => array("show"=>1,'name' => lang('menu/wizard'), 'controller' => 'template', 'action' => 'wizard'), + '72' => array("show" => 1, "title" => lang('menu/ads'), 'controller' => 'template', 'action' => 'ads', 'param' => ''), + '73' => array("show" => 1, "title" => lang('menu/wizard'), 'controller' => 'template', 'action' => 'wizard'), )), - '8' => array('name' => lang('menu/make'), 'icon' => 'xe63e', 'sub' => array( - '81' => array("show"=>1,'name' => lang('menu/make_opt'), 'controller' => 'make', 'action' => 'opt'), - '82' => array("show"=>1,'name' => lang('menu/make_index'), 'controller' => 'make', 'action' => 'index'), - '821' => array("show"=>1,'name' => lang('menu/make_index_wap'), 'controller' => 'make', 'action' => 'index?ac2=wap'), - '83' => array("show"=>1,'name' => lang('menu/make_map'), 'controller' => 'make', 'action' => 'map'), + '8' => array("title" => lang('menu/make'), 'icon' => 'layui-icon layui-icon-console', 'children' => array( + '81' => array("show" => 1, "title" => lang('menu/make_opt'), 'controller' => 'make', 'action' => 'opt'), + '82' => array("show" => 1, "title" => lang('menu/make_index'), 'controller' => 'make', 'action' => 'index'), + '821' => array("show" => 1, "title" => lang('menu/make_index_wap'), 'controller' => 'make', 'action' => 'index?ac2=wap'), + '83' => array("show" => 1, "title" => lang('menu/make_map'), 'controller' => 'make', 'action' => 'map'), - '8101' => array("show"=>0,'name' => '--生成入口', 'controller' => 'make', 'action' => 'make'), - '8102' => array("show"=>0,'name' => '--生成RSS', 'controller' => 'make', 'action' => 'rss'), - '8103' => array("show"=>0,'name' => '--生成分类', 'controller' => 'make', 'action' => 'type'), - '8104' => array("show"=>0,'name' => '--生成专题首页', 'controller' => 'make', 'action' => 'topic_index'), - '8105' => array("show"=>0,'name' => '--生成专题内容', 'controller' => 'make', 'action' => 'topic_info'), - '8106' => array("show"=>0,'name' => '--生成内容页', 'controller' => 'make', 'action' => 'info'), - '8107' => array("show"=>0,'name' => '--生成自定义页', 'controller' => 'make', 'action' => 'label'), + '8101' => array("show" => 0, "title" => '--生成入口', 'controller' => 'make', 'action' => 'make'), + '8102' => array("show" => 0, "title" => '--生成RSS', 'controller' => 'make', 'action' => 'rss'), + '8103' => array("show" => 0, "title" => '--生成分类', 'controller' => 'make', 'action' => 'type'), + '8104' => array("show" => 0, "title" => '--生成专题首页', 'controller' => 'make', 'action' => 'topic_index'), + '8105' => array("show" => 0, "title" => '--生成专题内容', 'controller' => 'make', 'action' => 'topic_info'), + '8106' => array("show" => 0, "title" => '--生成内容页', 'controller' => 'make', 'action' => 'info'), + '8107' => array("show" => 0, "title" => '--生成自定义页', 'controller' => 'make', 'action' => 'label'), )), - '9' => array('name' => lang('menu/cjs'), 'icon' => 'xe727', 'sub' => array( - '91' => array("show"=>0,'name' => lang('menu/union'), 'controller' => 'collect', 'action' => 'union'), - '9101' => array("show"=>0,'name' => '--采集入口', 'controller' => 'collect', 'action' => 'api'), - '9102' => array("show"=>0,'name' => '--断点采集', 'controller' => 'collect', 'action' => 'load'), - '9103' => array("show"=>0,'name' => '--绑定分类', 'controller' => 'collect', 'action' => 'bind'), - '9104' => array("show"=>0,'name' => '--采集视频', 'controller' => 'collect', 'action' => 'vod'), - '9105' => array("show"=>0,'name' => '--采集文章', 'controller' => 'collect', 'action' => 'art'), - '92' => array("show"=>0,'name' => lang('menu/collect_timming'), 'controller' => 'collect', 'action' => 'timing'), - - '93' => array("show"=>1,'name' => lang('menu/collect'), 'controller' => 'collect', 'action' => 'index'), - '9301' => array("show"=>0,'name' => '--自定义资源信息维护', 'controller' => 'collect', 'action' => 'info'), - '9302' => array("show"=>0,'name' => '--自定义资源删除', 'controller' => 'collect', 'action' => 'del'), - - '94' => array("show"=>1,'name' => lang('menu/cj'), 'controller' => 'cj', 'action' => 'index'), - '9401' => array("show"=>0,'name' => '--自定义规则信息维护', 'controller' => 'cj', 'action' => 'info'), - '9402' => array("show"=>0,'name' => '--自定义规则删除', 'controller' => 'cj', 'action' => 'del'), - '9403' => array("show"=>0,'name' => '--自定义规则发布方案', 'controller' => 'cj', 'action' => 'program'), - '9404' => array("show"=>0,'name' => '--自定义规则采集网址', 'controller' => 'cj', 'action' => 'col_url'), - '9405' => array("show"=>0,'name' => '--自定义规则采集内容', 'controller' => 'cj', 'action' => 'col_content'), - '9406' => array("show"=>0,'name' => '--自定义规则发布内容', 'controller' => 'cj', 'action' => 'publish'), - '9407' => array("show"=>0,'name' => '--自定义规则导出', 'controller' => 'cj', 'action' => 'export'), - '9408' => array("show"=>0,'name' => '--自定义规则导入', 'controller' => 'cj', 'action' => 'import'), + '9' => array("title" => lang('menu/cjs'), 'icon' => 'layui-icon layui-icon-console', 'children' => array( + '91' => array("show" => 0, "title" => lang('menu/union'), 'controller' => 'collect', 'action' => 'union'), + '9101' => array("show" => 0, "title" => '--采集入口', 'controller' => 'collect', 'action' => 'api'), + '9102' => array("show" => 0, "title" => '--断点采集', 'controller' => 'collect', 'action' => 'load'), + '9103' => array("show" => 0, "title" => '--绑定分类', 'controller' => 'collect', 'action' => 'bind'), + '9104' => array("show" => 0, "title" => '--采集视频', 'controller' => 'collect', 'action' => 'vod'), + '9105' => array("show" => 0, "title" => '--采集文章', 'controller' => 'collect', 'action' => 'art'), + '92' => array("show" => 0, "title" => lang('menu/collect_timming'), 'controller' => 'collect', 'action' => 'timing'), + + '93' => array("show" => 1, "title" => lang('menu/collect'), 'controller' => 'collect', 'action' => 'index'), + '9301' => array("show" => 0, "title" => '--自定义资源信息维护', 'controller' => 'collect', 'action' => 'info'), + '9302' => array("show" => 0, "title" => '--自定义资源删除', 'controller' => 'collect', 'action' => 'del'), + + '94' => array("show" => 1, "title" => lang('menu/cj'), 'controller' => 'cj', 'action' => 'index'), + '9401' => array("show" => 0, "title" => '--自定义规则信息维护', 'controller' => 'cj', 'action' => 'info'), + '9402' => array("show" => 0, "title" => '--自定义规则删除', 'controller' => 'cj', 'action' => 'del'), + '9403' => array("show" => 0, "title" => '--自定义规则发布方案', 'controller' => 'cj', 'action' => 'program'), + '9404' => array("show" => 0, "title" => '--自定义规则采集网址', 'controller' => 'cj', 'action' => 'col_url'), + '9405' => array("show" => 0, "title" => '--自定义规则采集内容', 'controller' => 'cj', 'action' => 'col_content'), + '9406' => array("show" => 0, "title" => '--自定义规则发布内容', 'controller' => 'cj', 'action' => 'publish'), + '9407' => array("show" => 0, "title" => '--自定义规则导出', 'controller' => 'cj', 'action' => 'export'), + '9408' => array("show" => 0, "title" => '--自定义规则导入', 'controller' => 'cj', 'action' => 'import'), )), - '10' => array('name' => lang('menu/db'), 'icon' => 'xe621', 'sub' => array( - '101' => array("show"=>1,'name' => lang('menu/database'), 'controller' => 'database', 'action' => 'index'), - '10001' => array("show"=>0,'name' => '--数据库备份', 'controller' => 'database', 'action' => 'export'), - '10002' => array("show"=>0,'name' => '--数据库还原', 'controller' => 'database', 'action' => 'import'), - '10003' => array("show"=>0,'name' => '--数据库优化', 'controller' => 'database', 'action' => 'optimize'), - '10004' => array("show"=>0,'name' => '--数据库修复', 'controller' => 'database', 'action' => 'repair'), - '10005' => array("show"=>0,'name' => '--数据库删除备份', 'controller' => 'database', 'action' => 'del'), - '10006' => array("show"=>0,'name' => '--数据库表信息', 'controller' => 'database', 'action' => 'columns'), - - '102' => array("show"=>1,'name' => lang('menu/database_sql'), 'controller' => 'database', 'action' => 'sql'), - '103' => array("show"=>1,'name' => lang('menu/database_rep'), 'controller' => 'database', 'action' => 'rep'), + '10' => array("title" => lang('menu/db'), 'icon' => 'layui-icon layui-icon-console', 'children' => array( + '101' => array("show" => 1, "title" => lang('menu/database'), 'controller' => 'database', 'action' => 'index'), + '10001' => array("show" => 0, "title" => '--数据库备份', 'controller' => 'database', 'action' => 'export'), + '10002' => array("show" => 0, "title" => '--数据库还原', 'controller' => 'database', 'action' => 'import'), + '10003' => array("show" => 0, "title" => '--数据库优化', 'controller' => 'database', 'action' => 'optimize'), + '10004' => array("show" => 0, "title" => '--数据库修复', 'controller' => 'database', 'action' => 'repair'), + '10005' => array("show" => 0, "title" => '--数据库删除备份', 'controller' => 'database', 'action' => 'del'), + '10006' => array("show" => 0, "title" => '--数据库表信息', 'controller' => 'database', 'action' => 'columns'), + + '102' => array("show" => 1, "title" => lang('menu/database_sql'), 'controller' => 'database', 'action' => 'sql'), + '103' => array("show" => 1, "title" => lang('menu/database_rep'), 'controller' => 'database', 'action' => 'rep'), )), - '11' => array('name' => lang('menu/apps'), 'icon' => 'xe621', 'sub' => array( - '111' => array("show"=>1,'name' => lang('menu/addon'), 'controller' => 'addon', 'action' => 'index', 'param'=>''), - '112' => array("show"=>1,'name' => lang('menu/urlsend'), 'controller' => 'urlsend', 'action' => 'index', 'param'=>''), - '113' => array("show"=>1,'name' => lang('menu/safety_file'), 'controller' => 'safety', 'action' => 'file', 'param'=>''), - '114' => array("show"=>1,'name' => lang('menu/safety_data'), 'controller' => 'safety', 'action' => 'data', 'param'=>''), - '11200' => array("show"=>0,'name' => '--推送入口', 'controller' => 'urlsend', 'action' => 'push'), - '11201' => array("show"=>0,'name' => '--百度主动推送', 'controller' => 'urlsend', 'action' => 'baidu_push'), - '11202' => array("show"=>0,'name' => '--百度熊掌推送', 'controller' => 'urlsend', 'action' => 'baidu_bear'), - - '11100' => array("show"=>0,'name' => '--应用插件列表', 'controller' => 'addon', 'action' => 'downloaded'), - '11101' => array("show"=>0,'name' => '--应用插件安装', 'controller' => 'addon', 'action' => 'install'), - '11102' => array("show"=>0,'name' => '--应用插件卸载', 'controller' => 'addon', 'action' => 'uninstall'), - '11103' => array("show"=>0,'name' => '--应用插件配置', 'controller' => 'addon', 'action' => 'config'), - '11104' => array("show"=>0,'name' => '--应用插件状态', 'controller' => 'addon', 'action' => 'state'), - '11105' => array("show"=>0,'name' => '--应用插件上传', 'controller' => 'addon', 'action' => 'local'), - '11106' => array("show"=>0,'name' => '--应用插件升级', 'controller' => 'addon', 'action' => 'upgrade'), - '11107' => array("show"=>0,'name' => '--应用插件添加', 'controller' => 'addon', 'action' => 'add'), + '11' => array("title" => lang('menu/apps'), 'icon' => 'layui-icon layui-icon-console', 'children' => array( + '111' => array("show" => 1, "title" => lang('menu/addon'), 'controller' => 'addon', 'action' => 'index', 'param' => ''), + '112' => array("show" => 1, "title" => lang('menu/urlsend'), 'controller' => 'urlsend', 'action' => 'index', 'param' => ''), + '113' => array("show" => 1, "title" => lang('menu/safety_file'), 'controller' => 'safety', 'action' => 'file', 'param' => ''), + '114' => array("show" => 1, "title" => lang('menu/safety_data'), 'controller' => 'safety', 'action' => 'data', 'param' => ''), + '11200' => array("show" => 0, "title" => '--推送入口', 'controller' => 'urlsend', 'action' => 'push'), + '11201' => array("show" => 0, "title" => '--百度主动推送', 'controller' => 'urlsend', 'action' => 'baidu_push'), + '11202' => array("show" => 0, "title" => '--百度熊掌推送', 'controller' => 'urlsend', 'action' => 'baidu_bear'), + + '11100' => array("show" => 0, "title" => '--应用插件列表', 'controller' => 'addon', 'action' => 'downloaded'), + '11101' => array("show" => 0, "title" => '--应用插件安装', 'controller' => 'addon', 'action' => 'install'), + '11102' => array("show" => 0, "title" => '--应用插件卸载', 'controller' => 'addon', 'action' => 'uninstall'), + '11103' => array("show" => 0, "title" => '--应用插件配置', 'controller' => 'addon', 'action' => 'config'), + '11104' => array("show" => 0, "title" => '--应用插件状态', 'controller' => 'addon', 'action' => 'state'), + '11105' => array("show" => 0, "title" => '--应用插件上传', 'controller' => 'addon', 'action' => 'local'), + '11106' => array("show" => 0, "title" => '--应用插件升级', 'controller' => 'addon', 'action' => 'upgrade'), + '11107' => array("show" => 0, "title" => '--应用插件添加', 'controller' => 'addon', 'action' => 'add'), )), -); \ No newline at end of file +); diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index dcf0c20ca..6f3ad57c0 100644 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -1,5 +1,7 @@ isPost()) { + if (Request()->isPost()) { $data = input('post.'); $res = model('Admin')->login($data); if ($res['code'] > 1) { @@ -30,69 +32,74 @@ public function logout() } public function index() + { + $this->assign('title', lang('admin/index/title')); + + + return $this->fetch('admin@index/index'); + } + + public function pearconfig(){ + $config = [ "logo" => [ "title" => lang('admin/index/index/name'), "image" => "/static/images/logo.png" ], "menu" => [ "data" => "../../admin/index/memu", "method" => "GET", "accordion" => true, "collaspe" => false, "control" => true, "controlWidth" => 500, "select" => "11", "async" => true ], "tab" => [ "enable" => true, "keepState" => true, "session" => false, "max" => "30", "index" => [ "id" => "11", "href" => "../../admin/index/welcome.html", "title" => "首页" ] ], "theme" => [ "defaultColor" => "2", "defaultMenu" => "dark-theme", "defaultHeader" => "light-theme", "allowCustom" => true, "banner" => true ], "colors" => [[ "id" => "1", "color" => "#2d8cf0", "second" => "#ecf5ff" ], [ "id" => "2", "color" => "#36b368", "second" => "#f0f9eb" ], [ "id" => "3", "color" => "#f6ad55", "second" => "#fdf6ec" ], [ "id" => "4", "color" => "#f56c6c", "second" => "#fef0f0" ], [ "id" => "5", "color" => "#3963bc", "second" => "#ecf5ff" ] ], "other" => [ "keepLoad" => "1200", "autoHead" => true ], "header" => [ "message" => false ] ]; + return json($config); + } + + public function memu() { $menus = @include MAC_ADMIN_COMM . 'auth.php'; - foreach($menus as $k1=>$v1){ - foreach($v1['sub'] as $k2=>$v2){ - if($v2['show'] == 1) { - if(strpos($v2['action'],'javascript')!==false){ - $url = $v2['action']; - } - else { - $url = url('admin/' . $v2['controller'] . '/' . $v2['action']); - } - if (!empty($v2['param'])) { - $url .= '?' . $v2['param']; - } - if ($this->check_auth($v2['controller'], $v2['action'])) { - $menus[$k1]['sub'][$k2]['url'] = $url; - } else { - unset($menus[$k1]['sub'][$k2]); - } - } - else{ - unset($menus[$k1]['sub'][$k2]); + foreach ($menus as $k1 => $v1) { + $menus[$k1]['id'] = $k1; + $menus[$k1]['type'] = 0; + foreach ($v1['children'] as $k2 => $v2) { + $menus[$k1]['children'][$k2]['id'] = $k2; + $menus[$k1]['children'][$k2]['type'] = 1; + if ($v2['show'] == 1) { + if (strpos($v2['action'], 'javascript') !== false) $url = $v2['action']; + else $url = url('admin/' . $v2['controller'] . '/' . $v2['action']); + if (!empty($v2['param'])) $url .= '?' . $v2['param']; + if ($this->check_auth($v2['controller'], $v2['action'])) $menus[$k1]['children'][$k2]['href'] = $url; + else unset($menus[$k1]['children'][$k2]); + } else { + unset($menus[$k1]['children'][$k2]); } } - if(empty($menus[$k1]['sub'])){ - unset($menus[$k1]); - } + if (empty($menus[$k1]['children'])) unset($menus[$k1]); } $quickmenu = config('quickmenu'); - if(empty($quickmenu)){ - $quickmenu = mac_read_file( APP_PATH.'data/config/quickmenu.txt'); - $quickmenu = explode(chr(13),$quickmenu); - } - if(!empty($quickmenu)){ - $menus[1]['sub'][13] = ['name'=>lang('admin/index/quick_tit'), 'url'=>'javascript:void(0);return false;','controller'=>'', 'action'=>'' ]; - - foreach($quickmenu as $k=>$v){ - if(empty($v)){ - continue; - } - $one = explode(',',trim($v)); - if(substr($one[1],0,4)=='http' || substr($one[1],0,2)=='//'){ - - } - elseif(substr($one[1],0,1) =='/'){ - - } - elseif(strpos($one[1],'###')!==false || strpos($one[1],'javascript:')!==false){ - - } - else{ + if (empty($quickmenu)) { + $quickmenu = mac_read_file(APP_PATH . 'data/config/quickmenu.txt'); + $quickmenu = explode(chr(13), $quickmenu); + } + if (!empty($quickmenu)) { + $menus[1]['children'][] = ['id' => 13, 'type' => 1, 'title' => lang('admin/index/quick_tit'), 'href' => 'javascript:void(0);return false;']; + + foreach ($quickmenu as $k => $v) { + if (empty($v)) continue; + + $one = explode(',', trim($v)); + if (substr($one[1], 0, 4) == 'http' || substr($one[1], 0, 2) == '//') { + } elseif (substr($one[1], 0, 1) == '/'|| strpos($one[1], 'javascript:') !== false) { + } elseif (strpos($one[1], '###') !== false ) { + $one[0] = '====不支持分隔符===='; + $one[1] = 'javascript:void(0);return false;'; + } else { $one[1] = url($one[1]); } - $menus[1]['sub'][14 + $k] = ['name'=>$one[0], 'url'=>$one[1],'controller'=>'', 'action'=>'' ]; + $menus[1]['children'][] = ['id' => 14 + $k,'type' => 1, 'title' => $one[0], 'href' => $one[1]]; } } - $this->assign('menus',$menus); + //$this->assign('menus',$menus); - $this->assign('title',lang('admin/index/title')); - return $this->fetch('admin@index/index'); + foreach ($menus as $kkp => $pear) { + unset($menus[$kkp]['children']); + $menus[$kkp]['children'] = array_values($pear['children']); + } + + header("Content-Type:application/json; charset=utf-8"); + return json(array_values($menus)); } public function welcome() @@ -100,43 +107,41 @@ public function welcome() $version = config('version'); $update_sql = file_exists('./application/data/update/database.php'); - $this->assign('version',$version); - $this->assign('update_sql',$update_sql); - $this->assign('mac_lang',config('default_lang')); + $this->assign('version', $version); + $this->assign('update_sql', $update_sql); + $this->assign('mac_lang', config('default_lang')); - $this->assign('admin',$this->_admin); - $this->assign('title',lang('admin/index/welcome/title')); + $this->assign('admin', $this->_admin); + $this->assign('title', lang('admin/index/welcome/title')); return $this->fetch('admin@index/welcome'); } public function quickmenu() { - if(Request()->isPost()){ + if (Request()->isPost()) { $param = input(); $validate = \think\Loader::validate('Token'); - if(!$validate->check($param)){ + if (!$validate->check($param)) { return $this->error($validate->getError()); } $quickmenu = input('post.quickmenu'); - $quickmenu = str_replace(chr(10),'',$quickmenu); - $menu_arr = explode(chr(13),$quickmenu); + $quickmenu = str_replace(chr(10), '', $quickmenu); + $menu_arr = explode(chr(13), $quickmenu); $res = mac_arr2file(APP_PATH . 'extra/quickmenu.php', $menu_arr); if ($res === false) { return $this->error(lang('save_err')); } return $this->success(lang('save_ok')); - } - else{ + } else { $config_menu = config('quickmenu'); - if(empty($config_menu)){ - $quickmenu = mac_read_file(APP_PATH.'data/config/quickmenu.txt'); - } - else{ + if (empty($config_menu)) { + $quickmenu = mac_read_file(APP_PATH . 'data/config/quickmenu.txt'); + } else { $quickmenu = array_values($config_menu); - $quickmenu = join(chr(13),$quickmenu); + $quickmenu = join(chr(13), $quickmenu); } - $this->assign('quickmenu',$quickmenu); - $this->assign('title',lang('admin/index/quickmenu/title')); + $this->assign('quickmenu', $quickmenu); + $this->assign('title', lang('admin/index/quickmenu/title')); return $this->fetch('admin@index/quickmenu'); } } @@ -145,7 +150,7 @@ public function checkcache() { $res = 'no'; $r = cache('cache_data'); - if($r=='1'){ + if ($r == '1') { $res = 'haved'; } echo $res; @@ -155,7 +160,7 @@ public function clear() { $res = $this->_cache_clear(); //运行缓存 - if(!$res) { + if (!$res) { $this->error(lang('admin/index/clear_err')); } return $this->success(lang('admin/index/clear_ok')); @@ -180,7 +185,7 @@ public function unlocked() $param = input(); $password = $param['password']; - if($this->_admin['admin_pwd'] != md5($password)){ + if ($this->_admin['admin_pwd'] != md5($password)) { return $this->error(lang('admin/index/pass_err')); } @@ -206,47 +211,43 @@ public function select() $refresh = $param['refresh']; - if(empty($tpl) || empty($tab) || empty($col) || empty($ids) || empty($url)){ + if (empty($tpl) || empty($tab) || empty($col) || empty($ids) || empty($url)) { return $this->error(lang('param_err')); } - if(is_array($ids)){ - $ids = join(',',$ids); + if (is_array($ids)) { + $ids = join(',', $ids); } - if(empty($refresh)){ + if (empty($refresh)) { $refresh = 'yes'; } $url = url($url); $mid = 1; - if($tab=='art'){ + if ($tab == 'art') { $mid = 2; + } elseif ($tab == 'actor') { + $mid = 8; + } elseif ($tab == 'website') { + $mid = 11; } - elseif($tab=='actor'){ - $mid=8; - } - elseif($tab=='website'){ - $mid=11; - } - $this->assign('mid',$mid); + $this->assign('mid', $mid); - if($tpl=='select_type'){ + if ($tpl == 'select_type') { $type_tree = model('Type')->getCache('type_tree'); - $this->assign('type_tree',$type_tree); - } - elseif($tpl =='select_level'){ - $level_list = [1,2,3,4,5,6,7,8,9]; - $this->assign('level_list',$level_list); - } - - $this->assign('refresh',$refresh); - $this->assign('url',$url); - $this->assign('tab',$tab); - $this->assign('col',$col); - $this->assign('ids',$ids); - $this->assign('val',$val); - return $this->fetch( 'admin@public/'.$tpl); + $this->assign('type_tree', $type_tree); + } elseif ($tpl == 'select_level') { + $level_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + $this->assign('level_list', $level_list); + } + + $this->assign('refresh', $refresh); + $this->assign('url', $url); + $this->assign('tab', $tab); + $this->assign('col', $col); + $this->assign('ids', $ids); + $this->assign('val', $val); + return $this->fetch('admin@public/' . $tpl); } - } diff --git a/application/admin/controller/Urlsend.php b/application/admin/controller/Urlsend.php index ed4ee87e7..eaa40e45c 100644 --- a/application/admin/controller/Urlsend.php +++ b/application/admin/controller/Urlsend.php @@ -195,6 +195,7 @@ public function push($pp=[]) $this->_param = $pp; } $ac = $this->_param['ac']; + $cp = 'app\\common\\extend\\urlsend\\' . ucfirst($ac); if (class_exists($cp)) { $data = $this->data(); diff --git a/application/admin/view/actor/index.html b/application/admin/view/actor/index.html index cc9c73f3f..7414583e5 100644 --- a/application/admin/view/actor/index.html +++ b/application/admin/view/actor/index.html @@ -64,19 +64,19 @@
- + {/if} -
- {:lang('add')} - {:lang('del')} - {:lang('type')} - {:lang('level')} - {:lang('hits')} - {:lang('status')} - {:lang('pic_sync')} +
+ {:lang('add')} + {:lang('del')} + {:lang('type')} + {:lang('level')} + {:lang('hits')} + {:lang('status')} + {:lang('pic_sync')}
diff --git a/application/admin/view/actor/info.html b/application/admin/view/actor/info.html index 71dea93ed..c656a4f2f 100644 --- a/application/admin/view/actor/info.html +++ b/application/admin/view/actor/info.html @@ -202,7 +202,7 @@
- +
@@ -258,8 +258,8 @@
- - + +
@@ -366,7 +366,7 @@ $('.actor_'+key+"_label").html(''); if(value != ''){ $.each(value, function(key2, value2){ - $(".actor_"+key+"_label").append(''+value2+''); + $(".actor_"+key+"_label").append(''+value2+''); }); } }); diff --git a/application/admin/view/addon/config.html b/application/admin/view/addon/config.html index d7d35dfb7..550e652d5 100644 --- a/application/admin/view/addon/config.html +++ b/application/admin/view/addon/config.html @@ -107,8 +107,8 @@
- - + +
diff --git a/application/admin/view/addon/index.html b/application/admin/view/addon/index.html index 1224ae039..e02a89732 100644 --- a/application/admin/view/addon/index.html +++ b/application/admin/view/addon/index.html @@ -14,7 +14,7 @@
- +
@@ -108,16 +108,16 @@ h ='

'+row.title+'{:lang('level')}

¥'+row.price+'

{:lang('author')}: '+row.author+'

{:lang('intro')}: '+row.intro+'

{:lang('ver')}: '+row.version+'

{:lang('update_time')}: '+ getDataTime(row.createtime)+'

'; h+='
'; if(row.install =='1'){ - h+='{:lang('config')}'; + h+='{:lang('config')}'; if(row.state=='1'){ - h+='{:lang('disable')}'; + h+='{:lang('disable')}'; } else{ - h+='{:lang('enable')}{:lang('uninstall')}'; + h+='{:lang('enable')}{:lang('uninstall')}'; } } else{ - h+='{:lang('install')}'; + h+='{:lang('install')}'; } h+='
'; diff --git a/application/admin/view/admin/index.html b/application/admin/view/admin/index.html index 03cb8d420..5a5680ed3 100644 --- a/application/admin/view/admin/index.html +++ b/application/admin/view/admin/index.html @@ -3,9 +3,9 @@
-
- {:lang('add')} - {:lang('del')} +
diff --git a/application/admin/view/admin/info.html b/application/admin/view/admin/info.html index d13b842ef..5f31bfd4c 100644 --- a/application/admin/view/admin/info.html +++ b/application/admin/view/admin/info.html @@ -52,11 +52,11 @@
- - + + - - + +
diff --git a/application/admin/view/annex/file.html b/application/admin/view/annex/file.html index c2af4c91a..90732ce73 100644 --- a/application/admin/view/annex/file.html +++ b/application/admin/view/annex/file.html @@ -2,9 +2,9 @@
-
- {:lang('return')} - {:lang('del')} +
diff --git a/application/admin/view/annex/index.html b/application/admin/view/annex/index.html index 67ca7ada5..f7dc3612e 100644 --- a/application/admin/view/annex/index.html +++ b/application/admin/view/annex/index.html @@ -27,16 +27,16 @@
- +
{/if} - diff --git a/application/admin/view/annex/info.html b/application/admin/view/annex/info.html index d83ae2e13..f4bf50269 100644 --- a/application/admin/view/annex/info.html +++ b/application/admin/view/annex/info.html @@ -152,7 +152,7 @@ $('.actor_'+key+"_label").html(''); if(value != ''){ $.each(value, function(key2, value2){ - $(".actor_"+key+"_label").append(''+value2+''); + $(".actor_"+key+"_label").append(''+value2+''); }); } }); diff --git a/application/admin/view/annex/init.html b/application/admin/view/annex/init.html index 07a37f24a..86b19fc73 100644 --- a/application/admin/view/annex/init.html +++ b/application/admin/view/annex/init.html @@ -20,7 +20,7 @@
- +
diff --git a/application/admin/view/art/batch.html b/application/admin/view/art/batch.html index 2af83e785..ece8a467c 100644 --- a/application/admin/view/art/batch.html +++ b/application/admin/view/art/batch.html @@ -76,7 +76,7 @@
- +
@@ -152,7 +152,7 @@
- +
diff --git a/application/admin/view/art/index.html b/application/admin/view/art/index.html index be90acaa2..5d87233df 100644 --- a/application/admin/view/art/index.html +++ b/application/admin/view/art/index.html @@ -71,26 +71,26 @@
- + -
- {:lang('add')} - {:lang('del')} - {:lang('type')} - {:lang('level')} - {:lang('hits')} - {:lang('status')} - {:lang('lock')} - {:lang('pic_sync')} - {:lang('make_page')} +
+ {:lang('add')} + {:lang('del')} + {:lang('type')} + {:lang('level')} + {:lang('hits')} + {:lang('status')} + {:lang('lock')} + {:lang('pic_sync')} + {:lang('make_page')} {if condition="$param.select eq 1"} - {:lang('select_return')} + {:lang('select_return')} {/if} {if condition="$param['repeat'] neq ''"} - {:lang('del_auto_keep_min')} - {:lang('del_auto_keep_max')} + {:lang('del_auto_keep_min')} + {:lang('del_auto_keep_max')} {/if}
diff --git a/application/admin/view/art/info.html b/application/admin/view/art/info.html index dd3e351a6..4ab9d3a03 100644 --- a/application/admin/view/art/info.html +++ b/application/admin/view/art/info.html @@ -168,7 +168,7 @@
-
+
@@ -216,7 +216,7 @@
- +
@@ -234,7 +234,7 @@
- +
@@ -324,8 +324,8 @@
- - + +
@@ -540,7 +540,7 @@ $('.art_'+key+"_label").html(''); if(value != ''){ $.each(value, function(key2, value2){ - $(".art_"+key+"_label").append(''+value2+''); + $(".art_"+key+"_label").append(''+value2+''); }); } }); diff --git a/application/admin/view/card/index.html b/application/admin/view/card/index.html index 1b7429edc..3f9c0195d 100644 --- a/application/admin/view/card/index.html +++ b/application/admin/view/card/index.html @@ -30,15 +30,15 @@
- - + +
- diff --git a/application/admin/view/card/info.html b/application/admin/view/card/info.html index 85bfd115e..f73e0fc60 100644 --- a/application/admin/view/card/info.html +++ b/application/admin/view/card/info.html @@ -40,8 +40,8 @@
- - + +
diff --git a/application/admin/view/cash/index.html b/application/admin/view/cash/index.html index 7540f9dc4..7520fcde8 100644 --- a/application/admin/view/cash/index.html +++ b/application/admin/view/cash/index.html @@ -14,14 +14,14 @@
- +
- diff --git a/application/admin/view/cj/index.html b/application/admin/view/cj/index.html index 0b6a8c247..0f9d35bdc 100644 --- a/application/admin/view/cj/index.html +++ b/application/admin/view/cj/index.html @@ -2,9 +2,9 @@
- @@ -28,15 +28,15 @@ {$vo.name} {$vo.lastdate|mac_day} - {:lang('admin/cj/cj_url')} - {:lang('admin/cj/cj_content')} - {:lang('admin/cj/content_publish')} + {:lang('admin/cj/cj_url')} + {:lang('admin/cj/cj_content')} + {:lang('admin/cj/content_publish')} - {:lang('edit')} - {:lang('admin/cj/publish_plan')} - {:lang('export')} - {:lang('del')} + {:lang('edit')} + {:lang('admin/cj/publish_plan')} + {:lang('export')} + {:lang('del')} {/volist} diff --git a/application/admin/view/cj/info.html b/application/admin/view/cj/info.html index fe7b223e0..6041a2489 100644 --- a/application/admin/view/cj/info.html +++ b/application/admin/view/cj/info.html @@ -76,7 +76,7 @@
@@ -127,9 +127,9 @@
{:lang('admin/cj/wildcard_prompt')}
-
- {:lang('expand_all')} - {:lang('fold_all')} +
@@ -147,7 +147,7 @@

{:lang('admin/cj/title_rule')}

- +
@@ -169,7 +169,7 @@

{:lang('admin/cj/type_rule')}

- +
@@ -191,7 +191,7 @@

{:lang('admin/cj/content_rule')}

- +
@@ -229,7 +229,7 @@

{:lang('admin/cj/page_mode')}

@@ -249,7 +249,7 @@

{:lang('admin/cj/page_mode')}

{:lang('admin/cj/filter_rule')}:
- +

@@ -378,10 +378,10 @@

{:lang('admin/cj/page_mode')}

} //折叠面板 function showAll(_this) { - $(_this).parents(".layui-btn-group").siblings(".layui-collapse").children(".layui-colla-item").children(".layui-colla-content").addClass("layui-show"); + $(_this).parents(".pear-btn-group").siblings(".layui-collapse").children(".layui-colla-item").children(".layui-colla-content").addClass("layui-show"); } function hideAll(_this) { - $(_this).parents(".layui-btn-group").siblings(".layui-collapse").children(".layui-colla-item").children(".layui-colla-content").removeClass("layui-show"); + $(_this).parents(".pear-btn-group").siblings(".layui-collapse").children(".layui-colla-item").children(".layui-colla-content").removeClass("layui-show"); } // 包含内容 @@ -418,7 +418,7 @@

{:lang('admin/cj/page_mode')}

var caiji=0; function add_caiji() { - $('#customize_config').append('
{:lang('rule_name_en')}:
{:lang('use')}" [内容] "{:lang('admin/cj/wildcard_tip')}
{:lang('admin/cj/filter_rule')}:

'); + $('#customize_config').append('
{:lang('rule_name_en')}:
{:lang('use')}" [内容] "{:lang('admin/cj/wildcard_tip')}
{:lang('admin/cj/filter_rule')}:

'); caiji++; } diff --git a/application/admin/view/cj/program.html b/application/admin/view/cj/program.html index e132335ce..1dfa8bbc3 100644 --- a/application/admin/view/cj/program.html +++ b/application/admin/view/cj/program.html @@ -33,8 +33,8 @@
- - + +
diff --git a/application/admin/view/cj/publish.html b/application/admin/view/cj/publish.html index c57977c63..2c9276528 100644 --- a/application/admin/view/cj/publish.html +++ b/application/admin/view/cj/publish.html @@ -11,11 +11,11 @@
-
- {:lang('del')} - {:lang('clear')} - {:lang('import')} - {:lang('import_all')} + diff --git a/application/admin/view/collect/actor.html b/application/admin/view/collect/actor.html index 46e7f6da0..a011e3c41 100644 --- a/application/admin/view/collect/actor.html +++ b/application/admin/view/collect/actor.html @@ -25,7 +25,7 @@
- + @@ -55,15 +55,15 @@ {/volist}
-
+
diff --git a/application/admin/view/collect/art.html b/application/admin/view/collect/art.html index e9bd70562..e055ae525 100644 --- a/application/admin/view/collect/art.html +++ b/application/admin/view/collect/art.html @@ -25,7 +25,7 @@
- +
@@ -55,15 +55,15 @@ {/volist} -
+
diff --git a/application/admin/view/collect/index.html b/application/admin/view/collect/index.html index 1a295b65f..011dd2733 100644 --- a/application/admin/view/collect/index.html +++ b/application/admin/view/collect/index.html @@ -4,25 +4,25 @@
-
- {:lang('add')} - {:lang('del')} - {:lang('admin/collect/clear_bind')} +
+ {:lang('add')} + {:lang('del')} + {:lang('admin/collect/clear_bind')} {if condition="$collect_break_vod neq ''"} - 【进入视频断点采集】 + 【进入视频断点采集】 {/if} {if condition="$collect_break_art neq ''"} - 【进入文章断点采集】 + 【进入文章断点采集】 {/if} {if condition="$collect_break_actor neq ''"} - 【进入明星断点采集】 + 【进入明星断点采集】 {/if} {if condition="$collect_break_role neq ''"} - 【进入角色断点采集】 + 【进入角色断点采集】 {/if} {if condition="$collect_break_website neq ''"} - 【进入网址断点采集】 + 【进入网址断点采集】 {/if}
diff --git a/application/admin/view/collect/info.html b/application/admin/view/collect/info.html index 830be4f2b..8c6b75a42 100644 --- a/application/admin/view/collect/info.html +++ b/application/admin/view/collect/info.html @@ -79,9 +79,9 @@
- - - + + +
diff --git a/application/admin/view/collect/role.html b/application/admin/view/collect/role.html index 460a437f5..48d3f45b3 100644 --- a/application/admin/view/collect/role.html +++ b/application/admin/view/collect/role.html @@ -25,7 +25,7 @@
- +
@@ -55,15 +55,15 @@ {/volist} -
+
diff --git a/application/admin/view/collect/timing.html b/application/admin/view/collect/timing.html index 795aac328..395030d98 100644 --- a/application/admin/view/collect/timing.html +++ b/application/admin/view/collect/timing.html @@ -112,8 +112,8 @@ -   - +   + diff --git a/application/admin/view/collect/union.html b/application/admin/view/collect/union.html index b0443731d..c4d92b10e 100644 --- a/application/admin/view/collect/union.html +++ b/application/admin/view/collect/union.html @@ -3,21 +3,21 @@
-
+
{if condition="$collect_break_vod neq ''"} - 【进入视频断点采集】 + 【进入视频断点采集】 {/if} {if condition="$collect_break_art neq ''"} - 【进入文章断点采集】 + 【进入文章断点采集】 {/if} {if condition="$collect_break_actor neq ''"} - 【进入明星断点采集】 + 【进入明星断点采集】 {/if} {if condition="$collect_break_role neq ''"} - 【进入角色断点采集】 + 【进入角色断点采集】 {/if} {if condition="$collect_break_website neq ''"} - 【进入网址断点采集】 + 【进入网址断点采集】 {/if}
diff --git a/application/admin/view/collect/vod.html b/application/admin/view/collect/vod.html index 75cb18905..148d26cc3 100644 --- a/application/admin/view/collect/vod.html +++ b/application/admin/view/collect/vod.html @@ -25,7 +25,7 @@
- +
@@ -55,15 +55,15 @@ {/volist} -
+
diff --git a/application/admin/view/collect/website.html b/application/admin/view/collect/website.html index 4ab4818fb..e47f3925d 100644 --- a/application/admin/view/collect/website.html +++ b/application/admin/view/collect/website.html @@ -25,7 +25,7 @@
- +
@@ -55,15 +55,15 @@ {/volist} -
+
diff --git a/application/admin/view/comment/index.html b/application/admin/view/comment/index.html index c7ce2852d..304a54c5b 100644 --- a/application/admin/view/comment/index.html +++ b/application/admin/view/comment/index.html @@ -33,14 +33,14 @@
- +
- diff --git a/application/admin/view/comment/info.html b/application/admin/view/comment/info.html index c92998704..5702a8b74 100644 --- a/application/admin/view/comment/info.html +++ b/application/admin/view/comment/info.html @@ -38,8 +38,8 @@
- - + +
diff --git a/application/admin/view/database/export.html b/application/admin/view/database/export.html index 683509442..5f6ee3f47 100644 --- a/application/admin/view/database/export.html +++ b/application/admin/view/database/export.html @@ -7,10 +7,10 @@
  • {:lang('admin/database/import_db')}
  • - diff --git a/application/admin/view/database/import.html b/application/admin/view/database/import.html index a2d39c14d..3970213bd 100644 --- a/application/admin/view/database/import.html +++ b/application/admin/view/database/import.html @@ -29,9 +29,9 @@ {:round($vo['size']/1024, 2)} K {:date('Y-m-d H:i:s', $vo['time'])} -
    - {:lang('admin/database/import')} - {:lang('del')} + diff --git a/application/admin/view/database/rep.html b/application/admin/view/database/rep.html index 0f61b3f63..0203478d1 100644 --- a/application/admin/view/database/rep.html +++ b/application/admin/view/database/rep.html @@ -63,8 +63,8 @@
    - - + +
    @@ -84,7 +84,7 @@ $.post("{:url('columns')}", {table:data.value}, function(res) { if (res.code == 1) { $.each(res.data,function(index,row){ - $(".fields").append(''+row.Field+'  '); + $(".fields").append(''+row.Field+'  '); if(index>0 && index%5==0){ //$(".fields").append('
    '); } diff --git a/application/admin/view/database/sql.html b/application/admin/view/database/sql.html index 59e44d4f6..c02dd3a9e 100644 --- a/application/admin/view/database/sql.html +++ b/application/admin/view/database/sql.html @@ -27,8 +27,8 @@
    - - + +
    diff --git a/application/admin/view/domain/index.html b/application/admin/view/domain/index.html index f64f15674..c37448ad3 100644 --- a/application/admin/view/domain/index.html +++ b/application/admin/view/domain/index.html @@ -15,8 +15,8 @@
    {:lang('admin/domain/help_tip')} - {:lang('export')} - {:lang('import')} + {:lang('export')} + {:lang('import')}
    - - - - - \ No newline at end of file + + + diff --git a/application/admin/view/index/login.html b/application/admin/view/index/login.html index 4dad9a666..0a1b72d60 100644 --- a/application/admin/view/index/login.html +++ b/application/admin/view/index/login.html @@ -1,133 +1,150 @@ - + + - - - - - {:lang('admin/index/login/title')} - - - + + + {:lang('admin/index/login/title')} + + + + - - - + + + + + - - + $("input[name='verify']").bind('keypress', function(event) { + if (event.keyCode == "13") { + if ($("input[name='verify']").val() != '') { + $('[lay-submit]').click(); + } + } + }); + }); + }) + + \ No newline at end of file diff --git a/application/admin/view/index/quickmenu.html b/application/admin/view/index/quickmenu.html index 832a9d67b..dd388c58e 100644 --- a/application/admin/view/index/quickmenu.html +++ b/application/admin/view/index/quickmenu.html @@ -16,8 +16,8 @@
    - - + +
    diff --git a/application/admin/view/link/index.html b/application/admin/view/link/index.html index 6ff91fbc5..027318d39 100644 --- a/application/admin/view/link/index.html +++ b/application/admin/view/link/index.html @@ -7,14 +7,14 @@
    - +
    - diff --git a/application/admin/view/link/info.html b/application/admin/view/link/info.html index 20f8fcaa3..e9c4692a7 100644 --- a/application/admin/view/link/info.html +++ b/application/admin/view/link/info.html @@ -39,8 +39,8 @@
    - - + +
    diff --git a/application/admin/view/make/opt.html b/application/admin/view/make/opt.html index e9c9965ec..9c4639f15 100644 --- a/application/admin/view/make/opt.html +++ b/application/admin/view/make/opt.html @@ -16,14 +16,14 @@
    - - - - - - - - + + + + + + + +
    @@ -36,14 +36,14 @@
    - - - - - - - - + + + + + + + +
    @@ -62,9 +62,9 @@
    - - - + + +
    @@ -77,8 +77,8 @@
    - - + +
    @@ -88,13 +88,13 @@
    - - - - - - - + + + + + + +
    diff --git a/application/admin/view/order/index.html b/application/admin/view/order/index.html index 55fbf6752..811f91933 100644 --- a/application/admin/view/order/index.html +++ b/application/admin/view/order/index.html @@ -14,13 +14,13 @@
    - + -
    - {:lang('del')} - {:lang('clear')} +
    + {:lang('del')} + {:lang('clear')}
    diff --git a/application/admin/view/plog/index.html b/application/admin/view/plog/index.html index 9c2fe55ea..a8e1bbf31 100644 --- a/application/admin/view/plog/index.html +++ b/application/admin/view/plog/index.html @@ -21,13 +21,13 @@
    - + -
    - {:lang('del')} - {:lang('clear')} +
    + {:lang('del')} + {:lang('clear')}
    diff --git a/application/admin/view/public/foot.html b/application/admin/view/public/foot.html index 834c34e24..9477cebbb 100644 --- a/application/admin/view/public/foot.html +++ b/application/admin/view/public/foot.html @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/application/admin/view/public/head.html b/application/admin/view/public/head.html index 5426dd242..3117b555f 100644 --- a/application/admin/view/public/head.html +++ b/application/admin/view/public/head.html @@ -4,10 +4,12 @@ {$title} - {:lang('admin/public/head/title')} - - - + + + + + diff --git a/application/admin/view/public/select_copyright.html b/application/admin/view/public/select_copyright.html index 934e78b9e..10459de1c 100644 --- a/application/admin/view/public/select_copyright.html +++ b/application/admin/view/public/select_copyright.html @@ -10,7 +10,7 @@
    - +
    diff --git a/application/admin/view/public/select_hits.html b/application/admin/view/public/select_hits.html index b47f1446c..a0764ebf6 100644 --- a/application/admin/view/public/select_hits.html +++ b/application/admin/view/public/select_hits.html @@ -12,7 +12,7 @@
    - +
    diff --git a/application/admin/view/public/select_level.html b/application/admin/view/public/select_level.html index c2f2f7bc6..e415045fd 100644 --- a/application/admin/view/public/select_level.html +++ b/application/admin/view/public/select_level.html @@ -12,7 +12,7 @@
    - +
    diff --git a/application/admin/view/public/select_lock.html b/application/admin/view/public/select_lock.html index 7d00819db..9ed55c1ba 100644 --- a/application/admin/view/public/select_lock.html +++ b/application/admin/view/public/select_lock.html @@ -10,7 +10,7 @@
    - +
    diff --git a/application/admin/view/public/select_state.html b/application/admin/view/public/select_state.html index 5ad050b05..b0569d56a 100644 --- a/application/admin/view/public/select_state.html +++ b/application/admin/view/public/select_state.html @@ -10,7 +10,7 @@
    - +
    diff --git a/application/admin/view/public/select_status.html b/application/admin/view/public/select_status.html index 1e201cf38..9a65f2279 100644 --- a/application/admin/view/public/select_status.html +++ b/application/admin/view/public/select_status.html @@ -10,7 +10,7 @@
    - +
    diff --git a/application/admin/view/public/select_type.html b/application/admin/view/public/select_type.html index b0a568426..c5aa9404e 100644 --- a/application/admin/view/public/select_type.html +++ b/application/admin/view/public/select_type.html @@ -16,7 +16,7 @@
    - +
    diff --git a/application/admin/view/role/index.html b/application/admin/view/role/index.html index 0d88216e6..666489118 100644 --- a/application/admin/view/role/index.html +++ b/application/admin/view/role/index.html @@ -51,20 +51,20 @@
    - + {/if} -
    +
    {if condition="$param.select eq 1 && $param.rid neq ''"} - {:lang('add')} + {:lang('add')} {/if} - {:lang('del')} - {:lang('level')} - {:lang('hits')} - {:lang('status')} - {:lang('pic_sync')} + {:lang('del')} + {:lang('level')} + {:lang('hits')} + {:lang('status')} + {:lang('pic_sync')}
    diff --git a/application/admin/view/role/info.html b/application/admin/view/role/info.html index adfdf4972..2da3c9dfd 100644 --- a/application/admin/view/role/info.html +++ b/application/admin/view/role/info.html @@ -135,7 +135,7 @@
    - +
    @@ -191,8 +191,8 @@
    - - + +
    diff --git a/application/admin/view/safety/data.html b/application/admin/view/safety/data.html index b24ae4ca6..dd1f5e02f 100644 --- a/application/admin/view/safety/data.html +++ b/application/admin/view/safety/data.html @@ -20,7 +20,7 @@
    - +
    diff --git a/application/admin/view/safety/file.html b/application/admin/view/safety/file.html index 4d3a9e17e..9aa7971a4 100644 --- a/application/admin/view/safety/file.html +++ b/application/admin/view/safety/file.html @@ -21,7 +21,7 @@
    - +
    diff --git a/application/admin/view/system/config.html b/application/admin/view/system/config.html index 0beac14d3..5eaedbda4 100644 --- a/application/admin/view/system/config.html +++ b/application/admin/view/system/config.html @@ -213,7 +213,7 @@
    - +
    @@ -554,8 +554,8 @@
    - - + +
    diff --git a/application/admin/view/system/configapi.html b/application/admin/view/system/configapi.html index 3cbe54488..3f3c727dc 100644 --- a/application/admin/view/system/configapi.html +++ b/application/admin/view/system/configapi.html @@ -361,8 +361,8 @@
    - - + +
    diff --git a/application/admin/view/system/configcollect.html b/application/admin/view/system/configcollect.html index 74a38eabc..6b6070065 100644 --- a/application/admin/view/system/configcollect.html +++ b/application/admin/view/system/configcollect.html @@ -739,8 +739,8 @@
    - - + +
    diff --git a/application/admin/view/system/configcomment.html b/application/admin/view/system/configcomment.html index 6c8bf5217..ca1867f84 100644 --- a/application/admin/view/system/configcomment.html +++ b/application/admin/view/system/configcomment.html @@ -102,8 +102,8 @@
    - - + +
    diff --git a/application/admin/view/system/configconnect.html b/application/admin/view/system/configconnect.html index e18187373..d9658ce6c 100644 --- a/application/admin/view/system/configconnect.html +++ b/application/admin/view/system/configconnect.html @@ -16,7 +16,7 @@
    - {:lang('admin/system/configconnect/qq')} {:lang('admin/system/configconnect/go_reg')} + {:lang('admin/system/configconnect/qq')} {:lang('admin/system/configconnect/go_reg')}
    @@ -41,7 +41,7 @@
    - {:lang('admin/system/configconnect/wx')} {:lang('admin/system/configconnect/go_reg')} + {:lang('admin/system/configconnect/wx')} {:lang('admin/system/configconnect/go_reg')}
    @@ -71,8 +71,8 @@
    - - + +
    diff --git a/application/admin/view/system/configemail.html b/application/admin/view/system/configemail.html index 7f15c645f..a102d94aa 100644 --- a/application/admin/view/system/configemail.html +++ b/application/admin/view/system/configemail.html @@ -48,7 +48,7 @@
    - +
    @@ -109,8 +109,8 @@
    - - + +
    diff --git a/application/admin/view/system/configinterface.html b/application/admin/view/system/configinterface.html index 71daed950..1b7ef532c 100644 --- a/application/admin/view/system/configinterface.html +++ b/application/admin/view/system/configinterface.html @@ -56,8 +56,8 @@
    - - + +
    diff --git a/application/admin/view/system/configpay.html b/application/admin/view/system/configpay.html index cc94f5d4e..38d87b05f 100644 --- a/application/admin/view/system/configpay.html +++ b/application/admin/view/system/configpay.html @@ -64,8 +64,8 @@
    - - + +
    diff --git a/application/admin/view/system/configplay.html b/application/admin/view/system/configplay.html index 9f48ccdbf..9f5a91999 100644 --- a/application/admin/view/system/configplay.html +++ b/application/admin/view/system/configplay.html @@ -115,10 +115,10 @@ @@ -132,9 +132,9 @@
    - - - + + +
    diff --git a/application/admin/view/system/configseo.html b/application/admin/view/system/configseo.html index 0b2884710..5312ab16b 100644 --- a/application/admin/view/system/configseo.html +++ b/application/admin/view/system/configseo.html @@ -192,8 +192,8 @@
    - - + +
    diff --git a/application/admin/view/system/configsms.html b/application/admin/view/system/configsms.html index e5f4d7029..e25c310d6 100644 --- a/application/admin/view/system/configsms.html +++ b/application/admin/view/system/configsms.html @@ -63,8 +63,8 @@
    - - + +
    diff --git a/application/admin/view/system/configupload.html b/application/admin/view/system/configupload.html index bcf4b2907..83e015fd3 100644 --- a/application/admin/view/system/configupload.html +++ b/application/admin/view/system/configupload.html @@ -161,8 +161,8 @@
    - - + +
    diff --git a/application/admin/view/system/configurl.html b/application/admin/view/system/configurl.html index ab9557b87..6a0680b4e 100644 --- a/application/admin/view/system/configurl.html +++ b/application/admin/view/system/configurl.html @@ -382,8 +382,8 @@
    - - + +
    diff --git a/application/admin/view/system/configuser.html b/application/admin/view/system/configuser.html index ddf7f0ff7..01c3325a6 100644 --- a/application/admin/view/system/configuser.html +++ b/application/admin/view/system/configuser.html @@ -204,8 +204,8 @@
    - - + +
    diff --git a/application/admin/view/system/configweixin.html b/application/admin/view/system/configweixin.html index cb6684de5..fe78c15d4 100644 --- a/application/admin/view/system/configweixin.html +++ b/application/admin/view/system/configweixin.html @@ -147,8 +147,8 @@
    - - + +
    diff --git a/application/admin/view/template/ads.html b/application/admin/view/template/ads.html index 47c86ba24..a56550afe 100644 --- a/application/admin/view/template/ads.html +++ b/application/admin/view/template/ads.html @@ -1,8 +1,8 @@ {include file="../../../application/admin/view/public/head" /}
    -
    - {:lang('add')} +
    diff --git a/application/admin/view/template/index.html b/application/admin/view/template/index.html index 17ff9f1d9..68bd2bad6 100644 --- a/application/admin/view/template/index.html +++ b/application/admin/view/template/index.html @@ -1,8 +1,8 @@ {include file="../../../application/admin/view/public/head" /}
    -
    - {:lang('add')} +
    diff --git a/application/admin/view/template/info.html b/application/admin/view/template/info.html index 698b0ecd2..5e48ad04d 100644 --- a/application/admin/view/template/info.html +++ b/application/admin/view/template/info.html @@ -29,8 +29,8 @@
    - - + +
    diff --git a/application/admin/view/template/wizard.html b/application/admin/view/template/wizard.html index 83962da12..e0cb59c89 100644 --- a/application/admin/view/template/wizard.html +++ b/application/admin/view/template/wizard.html @@ -8,21 +8,21 @@
    - + - - - - + + + + - - - - - + + + + + - - + +
    diff --git a/application/admin/view/timming/index.html b/application/admin/view/timming/index.html index 47d1f22a3..6e2fdca3a 100644 --- a/application/admin/view/timming/index.html +++ b/application/admin/view/timming/index.html @@ -2,9 +2,9 @@
    - diff --git a/application/admin/view/timming/info.html b/application/admin/view/timming/info.html index b287880db..f6adaa4b0 100644 --- a/application/admin/view/timming/info.html +++ b/application/admin/view/timming/info.html @@ -87,11 +87,11 @@
    - - + + - - + +
    diff --git a/application/admin/view/topic/index.html b/application/admin/view/topic/index.html index 821c33c6d..a6d278650 100644 --- a/application/admin/view/topic/index.html +++ b/application/admin/view/topic/index.html @@ -15,15 +15,15 @@
    - +
    - diff --git a/application/admin/view/topic/info.html b/application/admin/view/topic/info.html index 5657dfc63..74ed1b10f 100644 --- a/application/admin/view/topic/info.html +++ b/application/admin/view/topic/info.html @@ -191,7 +191,7 @@
    - +
    @@ -237,8 +237,8 @@
    - - + +
    diff --git a/application/admin/view/type/index.html b/application/admin/view/type/index.html index 0765fc631..99d069db8 100644 --- a/application/admin/view/type/index.html +++ b/application/admin/view/type/index.html @@ -2,12 +2,12 @@
    - diff --git a/application/admin/view/type/info.html b/application/admin/view/type/info.html index 25631e966..8cf1150db 100644 --- a/application/admin/view/type/info.html +++ b/application/admin/view/type/info.html @@ -186,8 +186,8 @@
    - - + +
    diff --git a/application/admin/view/ulog/index.html b/application/admin/view/ulog/index.html index 185cb7839..945802903 100644 --- a/application/admin/view/ulog/index.html +++ b/application/admin/view/ulog/index.html @@ -26,13 +26,13 @@
    - +
    - diff --git a/application/admin/view/urlsend/index.html b/application/admin/view/urlsend/index.html index 5dc6deaba..ba48155d0 100644 --- a/application/admin/view/urlsend/index.html +++ b/application/admin/view/urlsend/index.html @@ -18,8 +18,8 @@
    - - + +
    @@ -66,26 +66,26 @@

    - - + + - - + +
    - - + + - - + +
    - - + + - - + +
    {if condition="$urlsend_break_baidu_push neq ''"} - 【{:lang('admin/urlsend/in_break_point_exec')}】 + 【{:lang('admin/urlsend/in_break_point_exec')}】 {/if} diff --git a/application/admin/view/user/index.html b/application/admin/view/user/index.html index a6ba9281b..71a2d0464 100644 --- a/application/admin/view/user/index.html +++ b/application/admin/view/user/index.html @@ -23,13 +23,13 @@
    - +
    - diff --git a/application/admin/view/user/info.html b/application/admin/view/user/info.html index 42b31d8d2..63412c9d5 100644 --- a/application/admin/view/user/info.html +++ b/application/admin/view/user/info.html @@ -104,8 +104,8 @@
    - - + +
    diff --git a/application/admin/view/user/reward.html b/application/admin/view/user/reward.html index ac25a927f..7239f294c 100644 --- a/application/admin/view/user/reward.html +++ b/application/admin/view/user/reward.html @@ -17,14 +17,14 @@
    - +
    - diff --git a/application/admin/view/visit/index.html b/application/admin/view/visit/index.html index 0a284ad7d..87fa3000f 100644 --- a/application/admin/view/visit/index.html +++ b/application/admin/view/visit/index.html @@ -22,13 +22,13 @@
    - +
    - diff --git a/application/admin/view/vod/batch.html b/application/admin/view/vod/batch.html index 0436d2645..8ca7f9270 100644 --- a/application/admin/view/vod/batch.html +++ b/application/admin/view/vod/batch.html @@ -146,7 +146,7 @@
    - +
    @@ -247,7 +247,7 @@
    - +
    diff --git a/application/admin/view/vod/index.html b/application/admin/view/vod/index.html index 5d653b57a..9aba6eead 100644 --- a/application/admin/view/vod/index.html +++ b/application/admin/view/vod/index.html @@ -165,28 +165,28 @@ - + -
    - {:lang('add')} - {:lang('del')} - {:lang('type')} - {:lang('level')} - {:lang('hits')} - {:lang('status')} - {:lang('lock')} - {:lang('admin/vod/copyright')} - {:lang('pic_sync')} - {:lang('make_page')} +
    + {:lang('add')} + {:lang('del')} + {:lang('type')} + {:lang('level')} + {:lang('hits')} + {:lang('status')} + {:lang('lock')} + {:lang('admin/vod/copyright')} + {:lang('pic_sync')} + {:lang('make_page')} {if condition="$param.select eq 1"} - {:lang('select_return')} + {:lang('select_return')} {/if} {if condition="$param['repeat'] neq ''"} - {:lang('del_auto_keep_min')} - {:lang('del_auto_keep_max')} + {:lang('del_auto_keep_min')} + {:lang('del_auto_keep_max')} {/if}
    diff --git a/application/admin/view/vod/info.html b/application/admin/view/vod/info.html index f4c4f8d89..44840e295 100644 --- a/application/admin/view/vod/info.html +++ b/application/admin/view/vod/info.html @@ -179,7 +179,7 @@
    - +
    @@ -293,7 +293,7 @@
    -
    +
    @@ -342,7 +342,7 @@ {/volist}
    - +
    @@ -365,7 +365,7 @@ {/volist}
    - +
    @@ -389,7 +389,7 @@
    - +
    @@ -507,8 +507,8 @@
    - - + +
    @@ -940,7 +940,7 @@ $('.vod_'+key+"_label").html(''); if(value != ''){ $.each(value, function(key2, value2){ - $(".vod_"+key+"_label").append(''+value2+''); + $(".vod_"+key+"_label").append(''+value2+''); }); } }); diff --git a/application/admin/view/vod/iplot.html b/application/admin/view/vod/iplot.html index b41b17a65..33887ad48 100644 --- a/application/admin/view/vod/iplot.html +++ b/application/admin/view/vod/iplot.html @@ -34,7 +34,7 @@ {/volist}
    - +
    @@ -46,8 +46,8 @@
    - - + +
    diff --git a/application/admin/view/voddowner/index.html b/application/admin/view/voddowner/index.html index 1378e35a2..f83125176 100644 --- a/application/admin/view/voddowner/index.html +++ b/application/admin/view/voddowner/index.html @@ -2,10 +2,10 @@
    - diff --git a/application/admin/view/voddowner/info.html b/application/admin/view/voddowner/info.html index 3114fcb22..0efec26d2 100644 --- a/application/admin/view/voddowner/info.html +++ b/application/admin/view/voddowner/info.html @@ -62,8 +62,8 @@
    - - + +
    diff --git a/application/admin/view/vodplayer/index.html b/application/admin/view/vodplayer/index.html index ca9aa89db..8c59f9c95 100644 --- a/application/admin/view/vodplayer/index.html +++ b/application/admin/view/vodplayer/index.html @@ -2,11 +2,11 @@
    - diff --git a/application/admin/view/vodplayer/info.html b/application/admin/view/vodplayer/info.html index eee650ae8..34a4b9372 100644 --- a/application/admin/view/vodplayer/info.html +++ b/application/admin/view/vodplayer/info.html @@ -87,8 +87,8 @@
    - - + +
    diff --git a/application/admin/view/vodserver/index.html b/application/admin/view/vodserver/index.html index 42175fca8..a891b36a6 100644 --- a/application/admin/view/vodserver/index.html +++ b/application/admin/view/vodserver/index.html @@ -2,8 +2,8 @@
    - diff --git a/application/admin/view/vodserver/info.html b/application/admin/view/vodserver/info.html index f8896483e..fd37d7c1c 100644 --- a/application/admin/view/vodserver/info.html +++ b/application/admin/view/vodserver/info.html @@ -42,8 +42,8 @@
    - - + +
    diff --git a/application/admin/view/website/batch.html b/application/admin/view/website/batch.html index e8e55fc4d..de3dc42eb 100644 --- a/application/admin/view/website/batch.html +++ b/application/admin/view/website/batch.html @@ -76,7 +76,7 @@
    - +
    @@ -144,7 +144,7 @@
    - +
    diff --git a/application/admin/view/website/index.html b/application/admin/view/website/index.html index 2e7278814..2167fb527 100644 --- a/application/admin/view/website/index.html +++ b/application/admin/view/website/index.html @@ -71,26 +71,26 @@
    - +
    -
    - {:lang('add')} - {:lang('del')} - {:lang('type')} - {:lang('level')} - {:lang('hits')} - {:lang('status')} - {:lang('lock')} - {:lang('pic_sync')} - {:lang('make_page')} + diff --git a/application/admin/view/website/info.html b/application/admin/view/website/info.html index adea22a20..158138690 100644 --- a/application/admin/view/website/info.html +++ b/application/admin/view/website/info.html @@ -158,7 +158,7 @@
    -
    +
    @@ -205,7 +205,7 @@
    - +
    @@ -284,8 +284,8 @@
    - - + +
    @@ -447,7 +447,7 @@ $('.website_'+key+"_label").html(''); if(value != ''){ $.each(value, function(key2, value2){ - $(".website_"+key+"_label").append(''+value2+''); + $(".website_"+key+"_label").append(''+value2+''); }); } }); diff --git a/application/common/util/Collection.php b/application/common/util/Collection.php index 094f288e4..a62f3f5c5 100644 --- a/application/common/util/Collection.php +++ b/application/common/util/Collection.php @@ -179,7 +179,7 @@ public static function get_url_lists($url, &$config) { $xml = pc_base::load_sys_class('xml'); $html = $xml->xml_unserialize($html); if (pc_base::load_config('system', 'charset') == 'gbk') { - $html = array_iconv($html, 'utf-8', 'gbk'); + $html = iconv($html, 'utf-8', 'gbk'); } $data = array(); if (is_array($html['rss']['channel']['item']))foreach ($html['rss']['channel']['item'] as $k=>$v) { @@ -267,7 +267,7 @@ protected static function cut_html($html, $start, $end) { */ protected static function replace_item($html, $config) { if (empty($config)) return $html; - $config = explode("\n", $config); + //$config = explode("\n", $config); $patterns = $replace = array(); $p = 0; foreach ($config as $k=>$v) { diff --git a/application/common/util/Dir.php b/application/common/util/Dir.php index 8bf3606ed..b8dc62537 100644 --- a/application/common/util/Dir.php +++ b/application/common/util/Dir.php @@ -42,7 +42,7 @@ public static function create($path, $mode = 0755) { * 取得目录下面的文件信息 * @param mixed $pathname 路径 */ - public static function listFile($pathname, $pattern = '*') { + public function listFile($pathname, $pattern = '*') { static $_listDirs = array(); $guid = md5($pathname . $pattern); if (!isset($_listDirs[$guid])) { @@ -72,11 +72,11 @@ public static function listFile($pathname, $pattern = '*') { $dir[$i]['isReadable'] = is_readable($file); $dir[$i]['isWritable'] = is_writable($file); } - $cmp_func = create_function('$a,$b', ' - $k = "isDir"; - if($a[$k] == $b[$k]) return 0; - return $a[$k]>$b[$k]?-1:1; - '); + $cmp_func = function($a,$b){ + $k = "isDir"; + if($a[$k] == $b[$k]) return 0; + return $a[$k]>$b[$k]?-1:1; + }; // 对结果排序 保证目录在前面 usort($dir, $cmp_func); $this->_values = $dir; @@ -90,7 +90,7 @@ public static function listFile($pathname, $pattern = '*') { * 返回数组中的当前元素(单元) * @return array */ - public static function current($arr) { + public function current($arr) { if (!is_array($arr)) { return false; } @@ -101,7 +101,7 @@ public static function current($arr) { * 文件上次访问时间 * @return integer */ - public static function getATime() { + public function getATime() { $current = $this->current($this->_values); return $current['atime']; } @@ -110,7 +110,7 @@ public static function getATime() { * 取得文件的 inode 修改时间 * @return integer */ - public static function getCTime() { + public function getCTime() { $current = $this->current($this->_values); return $current['ctime']; } @@ -119,7 +119,7 @@ public static function getCTime() { * 遍历子目录文件信息 * @return DirectoryIterator */ - public static function getChildren() { + public function getChildren() { $current = $this->current($this->_values); if ($current['isDir']) { return new Dir($current['pathname']); @@ -131,7 +131,7 @@ public static function getChildren() { * 取得文件名 * @return string */ - public static function getFilename() { + public function getFilename() { $current = $this->current($this->_values); return $current['filename']; } @@ -140,7 +140,7 @@ public static function getFilename() { * 取得文件的组 * @return integer */ - public static function getGroup() { + public function getGroup() { $current = $this->current($this->_values); return $current['group']; } @@ -149,7 +149,7 @@ public static function getGroup() { * 取得文件的 inode * @return integer */ - public static function getInode() { + public function getInode() { $current = $this->current($this->_values); return $current['inode']; } @@ -158,7 +158,7 @@ public static function getInode() { * 取得文件的上次修改时间 * @return integer */ - public static function getMTime() { + public function getMTime() { $current = $this->current($this->_values); return $current['mtime']; } @@ -176,7 +176,7 @@ function getOwner() { * 取得文件路径,不包括文件名 * @return string */ - public static function getPath() { + public function getPath() { $current = $this->current($this->_values); return $current['path']; } @@ -185,7 +185,7 @@ public static function getPath() { * 取得文件的完整路径,包括文件名 * @return string */ - public static function getPathname() { + public function getPathname() { $current = $this->current($this->_values); return $current['pathname']; } @@ -194,7 +194,7 @@ public static function getPathname() { * 取得文件的权限 * @return integer */ - public static function getPerms() { + public function getPerms() { $current = $this->current($this->_values); return $current['perms']; } @@ -203,7 +203,7 @@ public static function getPerms() { * 取得文件的大小 * @return integer */ - public static function getSize() { + public function getSize() { $current = $this->current($this->_values); return $current['size']; } @@ -212,7 +212,7 @@ public static function getSize() { * 取得文件类型 * @return string */ - public static function getType() { + public function getType() { $current = $this->current($this->_values); return $current['type']; } @@ -221,7 +221,7 @@ public static function getType() { * 是否为目录 * @return boolen */ - public static function isDir() { + public function isDir() { $current = $this->current($this->_values); return $current['isDir']; } @@ -230,7 +230,7 @@ public static function isDir() { * 是否为文件 * @return boolen */ - public static function isFile() { + public function isFile() { $current = $this->current($this->_values); return $current['isFile']; } @@ -239,7 +239,7 @@ public static function isFile() { * 文件是否为一个符号连接 * @return boolen */ - public static function isLink() { + public function isLink() { $current = $this->current($this->_values); return $current['isLink']; } @@ -248,7 +248,7 @@ public static function isLink() { * 文件是否可以执行 * @return boolen */ - public static function isExecutable() { + public function isExecutable() { $current = $this->current($this->_values); return $current['isExecutable']; } @@ -257,7 +257,7 @@ public static function isExecutable() { * 文件是否可读 * @return boolen */ - public static function isReadable() { + public function isReadable() { $current = $this->current($this->_values); return $current['isReadable']; } @@ -266,12 +266,13 @@ public static function isReadable() { * 获取foreach的遍历方式 * @return string */ - public static function getIterator() { + /* + public function getIterator() { return new ArrayObject($this->_values); - } + }*/ // 返回目录的数组信息 - public static function toArray() { + public function toArray() { return $this->_values; } diff --git a/static/component/layui/css/layui.css b/static/component/layui/css/layui.css new file mode 100644 index 000000000..d635d8f72 --- /dev/null +++ b/static/component/layui/css/layui.css @@ -0,0 +1 @@ +.layui-inline,img{display:inline-block;vertical-align:middle}h1,h2,h3,h4,h5,h6{font-weight:400}a,body{color:#333}.layui-edge,.layui-header,.layui-inline,.layui-main{position:relative}.layui-edge,hr{height:0;overflow:hidden}.layui-layout-body,.layui-side,.layui-side-scroll{overflow-x:hidden}.layui-edge,.layui-elip,hr{overflow:hidden}.layui-btn,.layui-edge,.layui-inline,img{vertical-align:middle}.layui-btn,.layui-disabled,.layui-icon,.layui-unselect{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-elip,.layui-form-checkbox span,.layui-form-pane .layui-form-label{text-overflow:ellipsis;white-space:nowrap}blockquote,body,button,dd,div,dl,dt,form,h1,h2,h3,h4,h5,h6,input,li,ol,p,pre,td,textarea,th,ul{margin:0;padding:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}a:active,a:hover{outline:0}img{border:none}li{list-style:none}table{border-collapse:collapse;border-spacing:0}h4,h5,h6{font-size:100%}button,input,optgroup,option,select,textarea{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;outline:0}pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}body{line-height:1.6;color:rgba(0,0,0,.85);font:14px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif}hr{line-height:0;margin:10px 0;padding:0;border:none!important;border-bottom:1px solid #eee!important;clear:both;background:0 0}a{text-decoration:none}a:hover{color:#777}a cite{font-style:normal;*cursor:pointer}.layui-border-box,.layui-border-box *{box-sizing:border-box}.layui-box,.layui-box *{box-sizing:content-box}.layui-clear{clear:both;*zoom:1}.layui-clear:after{content:'\20';clear:both;*zoom:1;display:block;height:0}.layui-inline{*display:inline;*zoom:1}.layui-btn,.layui-btn-group,.layui-edge{display:inline-block}.layui-inline-container>.layui-inline{margin-right:10px;margin-bottom:10px}.layui-edge{width:0;border-width:6px;border-style:dashed;border-color:transparent}.layui-edge-top{top:-4px;border-bottom-color:#999;border-bottom-style:solid}.layui-edge-right{border-left-color:#999;border-left-style:solid}.layui-edge-bottom{top:2px;border-top-color:#999;border-top-style:solid}.layui-edge-left{border-right-color:#999;border-right-style:solid}.layui-disabled,.layui-disabled:hover{color:#d2d2d2!important;cursor:not-allowed!important}.layui-circle{border-radius:100%}.layui-show{display:block!important}.layui-hide{display:none!important}.layui-show-v{visibility:visible!important}.layui-hide-v{visibility:hidden!important}@font-face{font-family:layui-icon;src:url(../font/iconfont.eot?t=270);src:url(../font/iconfont.eot?t=270#iefix) format('embedded-opentype'),url(../font/iconfont.woff2?t=270) format('woff2'),url(../font/iconfont.woff?t=270) format('woff'),url(../font/iconfont.ttf?t=270) format('truetype'),url(../font/iconfont.svg?t=270#layui-icon) format('svg')}.layui-icon{font-family:layui-icon!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-icon-eye:before{content:"\e695"}.layui-icon-eye-invisible:before{content:"\e696"}.layui-icon-backspace:before{content:"\e694"}.layui-icon-help-circle:before{content:"\e77c"}.layui-icon-tips-fill:before{content:"\eb2e"}.layui-icon-test:before{content:"\e692"}.layui-icon-clear:before{content:"\e788"}.layui-icon-keyboard:before{content:"\e693"}.layui-icon-heart-fill:before{content:"\e68f"}.layui-icon-light:before{content:"\e748"}.layui-icon-music:before{content:"\e690"}.layui-icon-time:before{content:"\e68d"}.layui-icon-ie:before{content:"\e7bb"}.layui-icon-firefox:before{content:"\e686"}.layui-icon-at:before{content:"\e687"}.layui-icon-bluetooth:before{content:"\e689"}.layui-icon-chrome:before{content:"\e68a"}.layui-icon-edge:before{content:"\e68b"}.layui-icon-heart:before{content:"\e68c"}.layui-icon-key:before{content:"\e683"}.layui-icon-android:before{content:"\e684"}.layui-icon-mike:before{content:"\e6dc"}.layui-icon-mute:before{content:"\e685"}.layui-icon-gift:before{content:"\e627"}.layui-icon-windows:before{content:"\e67f"}.layui-icon-ios:before{content:"\e680"}.layui-icon-logout:before{content:"\e682"}.layui-icon-wifi:before{content:"\e7e0"}.layui-icon-rss:before{content:"\e808"}.layui-icon-email:before{content:"\e618"}.layui-icon-reduce-circle:before{content:"\e616"}.layui-icon-transfer:before{content:"\e691"}.layui-icon-service:before{content:"\e626"}.layui-icon-addition:before{content:"\e624"}.layui-icon-subtraction:before{content:"\e67e"}.layui-icon-slider:before{content:"\e714"}.layui-icon-print:before{content:"\e66d"}.layui-icon-export:before{content:"\e67d"}.layui-icon-cols:before{content:"\e610"}.layui-icon-screen-full:before{content:"\e622"}.layui-icon-screen-restore:before{content:"\e758"}.layui-icon-rate-half:before{content:"\e6c9"}.layui-icon-rate-solid:before{content:"\e67a"}.layui-icon-rate:before{content:"\e67b"}.layui-icon-cellphone:before{content:"\e678"}.layui-icon-vercode:before{content:"\e679"}.layui-icon-login-weibo:before{content:"\e675"}.layui-icon-login-qq:before{content:"\e676"}.layui-icon-login-wechat:before{content:"\e677"}.layui-icon-username:before{content:"\e66f"}.layui-icon-password:before{content:"\e673"}.layui-icon-refresh-3:before{content:"\e9aa"}.layui-icon-auz:before{content:"\e672"}.layui-icon-shrink-right:before{content:"\e668"}.layui-icon-spread-left:before{content:"\e66b"}.layui-icon-snowflake:before{content:"\e6b1"}.layui-icon-tips:before{content:"\e702"}.layui-icon-note:before{content:"\e66e"}.layui-icon-senior:before{content:"\e674"}.layui-icon-refresh-1:before{content:"\e666"}.layui-icon-refresh:before{content:"\e669"}.layui-icon-flag:before{content:"\e66c"}.layui-icon-theme:before{content:"\e66a"}.layui-icon-notice:before{content:"\e667"}.layui-icon-console:before{content:"\e665"}.layui-icon-website:before{content:"\e7ae"}.layui-icon-face-surprised:before{content:"\e664"}.layui-icon-set:before{content:"\e716"}.layui-icon-template:before{content:"\e663"}.layui-icon-app:before{content:"\e653"}.layui-icon-template-1:before{content:"\e656"}.layui-icon-home:before{content:"\e68e"}.layui-icon-female:before{content:"\e661"}.layui-icon-male:before{content:"\e662"}.layui-icon-tread:before{content:"\e6c5"}.layui-icon-praise:before{content:"\e6c6"}.layui-icon-rmb:before{content:"\e65e"}.layui-icon-more:before{content:"\e65f"}.layui-icon-camera:before{content:"\e660"}.layui-icon-cart-simple:before{content:"\e698"}.layui-icon-face-cry:before{content:"\e69c"}.layui-icon-face-smile:before{content:"\e6af"}.layui-icon-survey:before{content:"\e6b2"}.layui-icon-read:before{content:"\e705"}.layui-icon-location:before{content:"\e715"}.layui-icon-dollar:before{content:"\e659"}.layui-icon-diamond:before{content:"\e735"}.layui-icon-return:before{content:"\e65c"}.layui-icon-camera-fill:before{content:"\e65d"}.layui-icon-fire:before{content:"\e756"}.layui-icon-more-vertical:before{content:"\e671"}.layui-icon-cart:before{content:"\e657"}.layui-icon-star-fill:before{content:"\e658"}.layui-icon-prev:before{content:"\e65a"}.layui-icon-next:before{content:"\e65b"}.layui-icon-upload:before{content:"\e67c"}.layui-icon-upload-drag:before{content:"\e681"}.layui-icon-user:before{content:"\e770"}.layui-icon-file-b:before{content:"\e655"}.layui-icon-component:before{content:"\e857"}.layui-icon-find-fill:before{content:"\e670"}.layui-icon-loading:before{content:"\e63d"}.layui-icon-loading-1:before{content:"\e63e"}.layui-icon-add-1:before{content:"\e654"}.layui-icon-pause:before{content:"\e651"}.layui-icon-play:before{content:"\e652"}.layui-icon-video:before{content:"\e6ed"}.layui-icon-headset:before{content:"\e6fc"}.layui-icon-voice:before{content:"\e688"}.layui-icon-speaker:before{content:"\e645"}.layui-icon-fonts-del:before{content:"\e64f"}.layui-icon-fonts-html:before{content:"\e64b"}.layui-icon-fonts-code:before{content:"\e64e"}.layui-icon-fonts-strong:before{content:"\e62b"}.layui-icon-unlink:before{content:"\e64d"}.layui-icon-picture:before{content:"\e64a"}.layui-icon-link:before{content:"\e64c"}.layui-icon-face-smile-b:before{content:"\e650"}.layui-icon-align-center:before{content:"\e647"}.layui-icon-align-right:before{content:"\e648"}.layui-icon-align-left:before{content:"\e649"}.layui-icon-fonts-u:before{content:"\e646"}.layui-icon-fonts-i:before{content:"\e644"}.layui-icon-tabs:before{content:"\e62a"}.layui-icon-circle:before{content:"\e63f"}.layui-icon-radio:before{content:"\e643"}.layui-icon-share:before{content:"\e641"}.layui-icon-edit:before{content:"\e642"}.layui-icon-delete:before{content:"\e640"}.layui-icon-engine:before{content:"\e628"}.layui-icon-chart-screen:before{content:"\e629"}.layui-icon-chart:before{content:"\e62c"}.layui-icon-table:before{content:"\e62d"}.layui-icon-tree:before{content:"\e62e"}.layui-icon-upload-circle:before{content:"\e62f"}.layui-icon-templeate-1:before{content:"\e630"}.layui-icon-util:before{content:"\e631"}.layui-icon-layouts:before{content:"\e632"}.layui-icon-prev-circle:before{content:"\e633"}.layui-icon-carousel:before{content:"\e634"}.layui-icon-code-circle:before{content:"\e635"}.layui-icon-water:before{content:"\e636"}.layui-icon-date:before{content:"\e637"}.layui-icon-layer:before{content:"\e638"}.layui-icon-fonts-clear:before{content:"\e639"}.layui-icon-dialogue:before{content:"\e63a"}.layui-icon-cellphone-fine:before{content:"\e63b"}.layui-icon-form:before{content:"\e63c"}.layui-icon-file:before{content:"\e621"}.layui-icon-triangle-r:before{content:"\e623"}.layui-icon-triangle-d:before{content:"\e625"}.layui-icon-set-sm:before{content:"\e620"}.layui-icon-add-circle:before{content:"\e61f"}.layui-icon-layim-download:before{content:"\e61e"}.layui-icon-layim-uploadfile:before{content:"\e61d"}.layui-icon-404:before{content:"\e61c"}.layui-icon-about:before{content:"\e60b"}.layui-icon-layim-theme:before{content:"\e61b"}.layui-icon-down:before{content:"\e61a"}.layui-icon-up:before{content:"\e619"}.layui-icon-circle-dot:before{content:"\e617"}.layui-icon-set-fill:before{content:"\e614"}.layui-icon-search:before{content:"\e615"}.layui-icon-friends:before{content:"\e612"}.layui-icon-group:before{content:"\e613"}.layui-icon-reply-fill:before{content:"\e611"}.layui-icon-menu-fill:before{content:"\e60f"}.layui-icon-face-smile-fine:before{content:"\e60c"}.layui-icon-picture-fine:before{content:"\e60d"}.layui-icon-log:before{content:"\e60e"}.layui-icon-list:before{content:"\e60a"}.layui-icon-release:before{content:"\e609"}.layui-icon-add-circle-fine:before{content:"\e608"}.layui-icon-ok:before{content:"\e605"}.layui-icon-help:before{content:"\e607"}.layui-icon-chat:before{content:"\e606"}.layui-icon-top:before{content:"\e604"}.layui-icon-right:before{content:"\e602"}.layui-icon-left:before{content:"\e603"}.layui-icon-star:before{content:"\e600"}.layui-icon-download-circle:before{content:"\e601"}.layui-icon-close:before{content:"\1006"}.layui-icon-close-fill:before{content:"\1007"}.layui-icon-ok-circle:before{content:"\1005"}.layui-main{width:1140px;margin:0 auto}.layui-header{z-index:1000;height:60px}.layui-header a:hover{transition:all .5s;-webkit-transition:all .5s}.layui-side{position:fixed;left:0;top:0;bottom:0;z-index:999;width:200px}.layui-side-scroll{position:relative;width:220px;height:100%}.layui-body{position:relative;left:200px;right:0;top:0;bottom:0;z-index:900;width:auto;box-sizing:border-box}.layui-layout-admin .layui-header{position:fixed;top:0;left:0;right:0;background-color:#23262E}.layui-layout-admin .layui-side{top:60px;width:200px;overflow-x:hidden}.layui-layout-admin .layui-body{position:absolute;top:60px;padding-bottom:44px}.layui-layout-admin .layui-main{width:auto;margin:0 15px}.layui-layout-admin .layui-footer{position:fixed;left:200px;right:0;bottom:0;z-index:990;height:44px;line-height:44px;padding:0 15px;box-shadow:-1px 0 4px rgb(0 0 0 / 12%);background-color:#FAFAFA}.layui-layout-admin .layui-logo{position:absolute;left:0;top:0;width:200px;height:100%;line-height:60px;text-align:center;color:#009688;font-size:16px;box-shadow:0 1px 2px 0 rgb(0 0 0 / 15%)}.layui-layout-admin .layui-header .layui-nav{background:0 0}.layui-layout-left{position:absolute!important;left:200px;top:0}.layui-layout-right{position:absolute!important;right:0;top:0}.layui-container{position:relative;margin:0 auto;padding:0 15px;box-sizing:border-box}.layui-fluid{position:relative;margin:0 auto;padding:0 15px}.layui-row:after,.layui-row:before{content:"";display:block;clear:both}.layui-col-lg1,.layui-col-lg10,.layui-col-lg11,.layui-col-lg12,.layui-col-lg2,.layui-col-lg3,.layui-col-lg4,.layui-col-lg5,.layui-col-lg6,.layui-col-lg7,.layui-col-lg8,.layui-col-lg9,.layui-col-md1,.layui-col-md10,.layui-col-md11,.layui-col-md12,.layui-col-md2,.layui-col-md3,.layui-col-md4,.layui-col-md5,.layui-col-md6,.layui-col-md7,.layui-col-md8,.layui-col-md9,.layui-col-sm1,.layui-col-sm10,.layui-col-sm11,.layui-col-sm12,.layui-col-sm2,.layui-col-sm3,.layui-col-sm4,.layui-col-sm5,.layui-col-sm6,.layui-col-sm7,.layui-col-sm8,.layui-col-sm9,.layui-col-xs1,.layui-col-xs10,.layui-col-xs11,.layui-col-xs12,.layui-col-xs2,.layui-col-xs3,.layui-col-xs4,.layui-col-xs5,.layui-col-xs6,.layui-col-xs7,.layui-col-xs8,.layui-col-xs9{position:relative;display:block;box-sizing:border-box}.layui-col-xs1,.layui-col-xs10,.layui-col-xs11,.layui-col-xs12,.layui-col-xs2,.layui-col-xs3,.layui-col-xs4,.layui-col-xs5,.layui-col-xs6,.layui-col-xs7,.layui-col-xs8,.layui-col-xs9{float:left}.layui-col-xs1{width:8.33333333%}.layui-col-xs2{width:16.66666667%}.layui-col-xs3{width:25%}.layui-col-xs4{width:33.33333333%}.layui-col-xs5{width:41.66666667%}.layui-col-xs6{width:50%}.layui-col-xs7{width:58.33333333%}.layui-col-xs8{width:66.66666667%}.layui-col-xs9{width:75%}.layui-col-xs10{width:83.33333333%}.layui-col-xs11{width:91.66666667%}.layui-col-xs12{width:100%}.layui-col-xs-offset1{margin-left:8.33333333%}.layui-col-xs-offset2{margin-left:16.66666667%}.layui-col-xs-offset3{margin-left:25%}.layui-col-xs-offset4{margin-left:33.33333333%}.layui-col-xs-offset5{margin-left:41.66666667%}.layui-col-xs-offset6{margin-left:50%}.layui-col-xs-offset7{margin-left:58.33333333%}.layui-col-xs-offset8{margin-left:66.66666667%}.layui-col-xs-offset9{margin-left:75%}.layui-col-xs-offset10{margin-left:83.33333333%}.layui-col-xs-offset11{margin-left:91.66666667%}.layui-col-xs-offset12{margin-left:100%}@media screen and (max-width:768px){.layui-hide-xs{display:none!important}.layui-show-xs-block{display:block!important}.layui-show-xs-inline{display:inline!important}.layui-show-xs-inline-block{display:inline-block!important}}@media screen and (min-width:768px){.layui-container{width:750px}.layui-hide-sm{display:none!important}.layui-show-sm-block{display:block!important}.layui-show-sm-inline{display:inline!important}.layui-show-sm-inline-block{display:inline-block!important}.layui-col-sm1,.layui-col-sm10,.layui-col-sm11,.layui-col-sm12,.layui-col-sm2,.layui-col-sm3,.layui-col-sm4,.layui-col-sm5,.layui-col-sm6,.layui-col-sm7,.layui-col-sm8,.layui-col-sm9{float:left}.layui-col-sm1{width:8.33333333%}.layui-col-sm2{width:16.66666667%}.layui-col-sm3{width:25%}.layui-col-sm4{width:33.33333333%}.layui-col-sm5{width:41.66666667%}.layui-col-sm6{width:50%}.layui-col-sm7{width:58.33333333%}.layui-col-sm8{width:66.66666667%}.layui-col-sm9{width:75%}.layui-col-sm10{width:83.33333333%}.layui-col-sm11{width:91.66666667%}.layui-col-sm12{width:100%}.layui-col-sm-offset1{margin-left:8.33333333%}.layui-col-sm-offset2{margin-left:16.66666667%}.layui-col-sm-offset3{margin-left:25%}.layui-col-sm-offset4{margin-left:33.33333333%}.layui-col-sm-offset5{margin-left:41.66666667%}.layui-col-sm-offset6{margin-left:50%}.layui-col-sm-offset7{margin-left:58.33333333%}.layui-col-sm-offset8{margin-left:66.66666667%}.layui-col-sm-offset9{margin-left:75%}.layui-col-sm-offset10{margin-left:83.33333333%}.layui-col-sm-offset11{margin-left:91.66666667%}.layui-col-sm-offset12{margin-left:100%}}@media screen and (min-width:992px){.layui-container{width:970px}.layui-hide-md{display:none!important}.layui-show-md-block{display:block!important}.layui-show-md-inline{display:inline!important}.layui-show-md-inline-block{display:inline-block!important}.layui-col-md1,.layui-col-md10,.layui-col-md11,.layui-col-md12,.layui-col-md2,.layui-col-md3,.layui-col-md4,.layui-col-md5,.layui-col-md6,.layui-col-md7,.layui-col-md8,.layui-col-md9{float:left}.layui-col-md1{width:8.33333333%}.layui-col-md2{width:16.66666667%}.layui-col-md3{width:25%}.layui-col-md4{width:33.33333333%}.layui-col-md5{width:41.66666667%}.layui-col-md6{width:50%}.layui-col-md7{width:58.33333333%}.layui-col-md8{width:66.66666667%}.layui-col-md9{width:75%}.layui-col-md10{width:83.33333333%}.layui-col-md11{width:91.66666667%}.layui-col-md12{width:100%}.layui-col-md-offset1{margin-left:8.33333333%}.layui-col-md-offset2{margin-left:16.66666667%}.layui-col-md-offset3{margin-left:25%}.layui-col-md-offset4{margin-left:33.33333333%}.layui-col-md-offset5{margin-left:41.66666667%}.layui-col-md-offset6{margin-left:50%}.layui-col-md-offset7{margin-left:58.33333333%}.layui-col-md-offset8{margin-left:66.66666667%}.layui-col-md-offset9{margin-left:75%}.layui-col-md-offset10{margin-left:83.33333333%}.layui-col-md-offset11{margin-left:91.66666667%}.layui-col-md-offset12{margin-left:100%}}@media screen and (min-width:1200px){.layui-container{width:1170px}.layui-hide-lg{display:none!important}.layui-show-lg-block{display:block!important}.layui-show-lg-inline{display:inline!important}.layui-show-lg-inline-block{display:inline-block!important}.layui-col-lg1,.layui-col-lg10,.layui-col-lg11,.layui-col-lg12,.layui-col-lg2,.layui-col-lg3,.layui-col-lg4,.layui-col-lg5,.layui-col-lg6,.layui-col-lg7,.layui-col-lg8,.layui-col-lg9{float:left}.layui-col-lg1{width:8.33333333%}.layui-col-lg2{width:16.66666667%}.layui-col-lg3{width:25%}.layui-col-lg4{width:33.33333333%}.layui-col-lg5{width:41.66666667%}.layui-col-lg6{width:50%}.layui-col-lg7{width:58.33333333%}.layui-col-lg8{width:66.66666667%}.layui-col-lg9{width:75%}.layui-col-lg10{width:83.33333333%}.layui-col-lg11{width:91.66666667%}.layui-col-lg12{width:100%}.layui-col-lg-offset1{margin-left:8.33333333%}.layui-col-lg-offset2{margin-left:16.66666667%}.layui-col-lg-offset3{margin-left:25%}.layui-col-lg-offset4{margin-left:33.33333333%}.layui-col-lg-offset5{margin-left:41.66666667%}.layui-col-lg-offset6{margin-left:50%}.layui-col-lg-offset7{margin-left:58.33333333%}.layui-col-lg-offset8{margin-left:66.66666667%}.layui-col-lg-offset9{margin-left:75%}.layui-col-lg-offset10{margin-left:83.33333333%}.layui-col-lg-offset11{margin-left:91.66666667%}.layui-col-lg-offset12{margin-left:100%}}.layui-col-space1{margin:-.5px}.layui-col-space1>*{padding:.5px}.layui-col-space2{margin:-1px}.layui-col-space2>*{padding:1px}.layui-col-space4{margin:-2px}.layui-col-space4>*{padding:2px}.layui-col-space5{margin:-2.5px}.layui-col-space5>*{padding:2.5px}.layui-col-space6{margin:-3px}.layui-col-space6>*{padding:3px}.layui-col-space8{margin:-4px}.layui-col-space8>*{padding:4px}.layui-col-space10{margin:-5px}.layui-col-space10>*{padding:5px}.layui-col-space12{margin:-6px}.layui-col-space12>*{padding:6px}.layui-col-space14{margin:-7px}.layui-col-space14>*{padding:7px}.layui-col-space15{margin:-7.5px}.layui-col-space15>*{padding:7.5px}.layui-col-space16{margin:-8px}.layui-col-space16>*{padding:8px}.layui-col-space18{margin:-9px}.layui-col-space18>*{padding:9px}.layui-col-space20{margin:-10px}.layui-col-space20>*{padding:10px}.layui-col-space22{margin:-11px}.layui-col-space22>*{padding:11px}.layui-col-space24{margin:-12px}.layui-col-space24>*{padding:12px}.layui-col-space25{margin:-12.5px}.layui-col-space25>*{padding:12.5px}.layui-col-space26{margin:-13px}.layui-col-space26>*{padding:13px}.layui-col-space28{margin:-14px}.layui-col-space28>*{padding:14px}.layui-col-space30{margin:-15px}.layui-col-space30>*{padding:15px}.layui-btn,.layui-input,.layui-select,.layui-textarea,.layui-upload-button{outline:0;-webkit-appearance:none;transition:all .3s;-webkit-transition:all .3s;box-sizing:border-box}.layui-elem-quote{margin-bottom:10px;padding:15px;line-height:1.6;border-left:5px solid #5FB878;border-radius:0 2px 2px 0;background-color:#FAFAFA}.layui-quote-nm{border-style:solid;border-width:1px 1px 1px 5px;background:0 0}.layui-elem-field{margin-bottom:10px;padding:0;border-width:1px;border-style:solid}.layui-elem-field legend{margin-left:20px;padding:0 10px;font-size:20px;font-weight:300}.layui-field-title{margin:10px 0 20px;border-width:1px 0 0}.layui-field-box{padding:15px}.layui-field-title .layui-field-box{padding:10px 0}.layui-progress{position:relative;height:6px;border-radius:20px;background-color:#eee}.layui-progress-bar{position:absolute;left:0;top:0;width:0;max-width:100%;height:6px;border-radius:20px;text-align:right;background-color:#5FB878;transition:all .3s;-webkit-transition:all .3s}.layui-progress-big,.layui-progress-big .layui-progress-bar{height:18px;line-height:18px}.layui-progress-text{position:relative;top:-20px;line-height:18px;font-size:12px;color:#666}.layui-progress-big .layui-progress-text{position:static;padding:0 10px;color:#fff}.layui-collapse{border-width:1px;border-style:solid;border-radius:2px}.layui-colla-content,.layui-colla-item{border-top-width:1px;border-top-style:solid}.layui-colla-item:first-child{border-top:none}.layui-colla-title{position:relative;height:42px;line-height:42px;padding:0 15px 0 35px;color:#333;background-color:#FAFAFA;cursor:pointer;font-size:14px;overflow:hidden}.layui-colla-content{display:none;padding:10px 15px;line-height:1.6;color:#666}.layui-colla-icon{position:absolute;left:15px;top:0;font-size:14px}.layui-card-body,.layui-card-header,.layui-form-label,.layui-form-mid,.layui-input-block,.layui-input-inline,.layui-input-wrap,.layui-panel,.layui-textarea{position:relative}.layui-card{margin-bottom:15px;border-radius:2px;background-color:#fff;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.layui-form-select dl,.layui-panel{box-shadow:1px 1px 4px rgb(0 0 0 / 8%)}.layui-card:last-child{margin-bottom:0}.layui-card-header{height:42px;line-height:42px;padding:0 15px;border-bottom:1px solid #f6f6f6;color:#333;border-radius:2px 2px 0 0;font-size:14px}.layui-card-body{padding:10px 15px;line-height:24px}.layui-card-body[pad15]{padding:15px}.layui-card-body[pad20]{padding:20px}.layui-card-body .layui-table{margin:5px 0}.layui-card .layui-tab{margin:0}.layui-panel{border-width:1px;border-style:solid;border-radius:2px;background-color:#fff;color:#666}.layui-bg-black,.layui-bg-blue,.layui-bg-cyan,.layui-bg-green,.layui-bg-orange,.layui-bg-red{color:#fff!important}.layui-panel-window{position:relative;padding:15px;border-radius:0;border-top:5px solid #eee;background-color:#fff}.layui-border,.layui-border-black,.layui-border-blue,.layui-border-cyan,.layui-border-green,.layui-border-orange,.layui-border-red{border-width:1px;border-style:solid}.layui-auxiliar-moving{position:fixed;left:0;right:0;top:0;bottom:0;width:100%;height:100%;background:0 0;z-index:9999999999}.layui-bg-red{background-color:#FF5722!important}.layui-bg-orange{background-color:#FFB800!important}.layui-bg-green{background-color:#009688!important}.layui-bg-cyan{background-color:#2F4056!important}.layui-bg-blue{background-color:#1E9FFF!important}.layui-bg-black{background-color:#393D49!important}.layui-bg-gray{background-color:#FAFAFA!important;color:#666!important}.layui-badge-rim,.layui-border,.layui-colla-content,.layui-colla-item,.layui-collapse,.layui-elem-field,.layui-form-pane .layui-form-item[pane],.layui-form-pane .layui-form-label,.layui-iconpicker,.layui-iconpicker-main,.layui-input,.layui-input-split,.layui-layedit,.layui-layedit-tool,.layui-panel,.layui-quote-nm,.layui-select,.layui-tab-bar,.layui-tab-card,.layui-tab-title,.layui-tab-title .layui-this:after,.layui-textarea{border-color:#eee}.layui-border-red{border-color:#FF5722!important;color:#FF5722!important}.layui-border-orange{border-color:#FFB800!important;color:#FFB800!important}.layui-border-green{border-color:#009688!important;color:#009688!important}.layui-border-cyan{border-color:#2F4056!important;color:#2F4056!important}.layui-border-blue{border-color:#1E9FFF!important;color:#1E9FFF!important}.layui-border-black{border-color:#393D49!important;color:#393D49!important}.layui-timeline-item:before{background-color:#eee}.layui-text{line-height:1.6;font-size:14px;color:#666}.layui-text h1,.layui-text h2,.layui-text h3{font-weight:500;color:#333}.layui-text h1{font-size:30px}.layui-text h2{font-size:24px}.layui-text h3{font-size:18px}.layui-text a:not(.layui-btn){color:#01AAED}.layui-text a:not(.layui-btn):hover{text-decoration:underline}.layui-text ul{padding:5px 0 5px 15px}.layui-text ul li{margin-top:5px;list-style-type:disc}.layui-text em,.layui-word-aux{color:#999!important;padding-left:5px!important;padding-right:5px!important}.layui-text p{margin:10px 0}.layui-text p:first-child{margin-top:0}.layui-font-12{font-size:12px!important}.layui-font-14{font-size:14px!important}.layui-font-16{font-size:16px!important}.layui-font-18{font-size:18px!important}.layui-font-20{font-size:20px!important}.layui-font-22{font-size:22px!important}.layui-font-24{font-size:24px!important}.layui-font-26{font-size:26px!important}.layui-font-28{font-size:28px!important}.layui-font-30{font-size:30px!important}.layui-font-red{color:#FF5722!important}.layui-font-orange{color:#FFB800!important}.layui-font-green{color:#009688!important}.layui-font-cyan{color:#2F4056!important}.layui-font-blue{color:#01AAED!important}.layui-font-black{color:#000!important}.layui-font-gray{color:#c2c2c2!important}.layui-btn{height:38px;line-height:38px;border:1px solid transparent;padding:0 18px;background-color:#009688;color:#fff;white-space:nowrap;text-align:center;font-size:14px;border-radius:2px;cursor:pointer}.layui-btn:hover{opacity:.8;filter:alpha(opacity=80);color:#fff}.layui-btn:active{opacity:1;filter:alpha(opacity=100)}.layui-btn+.layui-btn{margin-left:10px}.layui-btn-container{font-size:0}.layui-btn-container .layui-btn{margin-right:10px;margin-bottom:10px}.layui-btn-container .layui-btn+.layui-btn{margin-left:0}.layui-table .layui-btn-container .layui-btn{margin-bottom:9px}.layui-btn-radius{border-radius:100px}.layui-btn .layui-icon{padding:0 2px;vertical-align:middle\9;vertical-align:bottom}.layui-btn-primary{border-color:#d2d2d2;background:0 0;color:#666}.layui-btn-primary:hover{border-color:#009688;color:#333}.layui-btn-normal{background-color:#1E9FFF}.layui-btn-warm{background-color:#FFB800}.layui-btn-danger{background-color:#FF5722}.layui-btn-checked{background-color:#5FB878}.layui-btn-disabled,.layui-btn-disabled:active,.layui-btn-disabled:hover{border-color:#eee!important;background-color:#FBFBFB!important;color:#d2d2d2!important;cursor:not-allowed!important;opacity:1}.layui-btn-lg{height:44px;line-height:44px;padding:0 25px;font-size:16px}.layui-btn-sm{height:30px;line-height:30px;padding:0 10px;font-size:12px}.layui-btn-xs{height:22px;line-height:22px;padding:0 5px;font-size:12px}.layui-btn-xs i{font-size:12px!important}.layui-btn-group{vertical-align:middle;font-size:0}.layui-btn-group .layui-btn{margin-left:0!important;margin-right:0!important;border-left:1px solid rgba(255,255,255,.5);border-radius:0}.layui-btn-group .layui-btn-primary{border-left:none}.layui-btn-group .layui-btn-primary:hover{border-color:#d2d2d2;color:#009688}.layui-btn-group .layui-btn:first-child{border-left:none;border-radius:2px 0 0 2px}.layui-btn-group .layui-btn-primary:first-child{border-left:1px solid #d2d2d2}.layui-btn-group .layui-btn:last-child{border-radius:0 2px 2px 0}.layui-btn-group .layui-btn+.layui-btn{margin-left:0}.layui-btn-group+.layui-btn-group{margin-left:10px}.layui-btn-fluid{width:100%}.layui-input,.layui-select,.layui-textarea{height:38px;line-height:1.3;line-height:38px\9;border-width:1px;border-style:solid;background-color:#fff;color:rgba(0,0,0,.85);border-radius:2px}.layui-input::-webkit-input-placeholder,.layui-select::-webkit-input-placeholder,.layui-textarea::-webkit-input-placeholder{line-height:1.3}.layui-input,.layui-textarea{display:block;width:100%;padding-left:10px}.layui-input:hover,.layui-textarea:hover{border-color:#eee!important}.layui-input:focus,.layui-textarea:focus{border-color:#d2d2d2!important}.layui-textarea{min-height:100px;height:auto;line-height:20px;padding:6px 10px;resize:vertical}.layui-select{padding:0 10px}.layui-form input[type=checkbox],.layui-form input[type=radio],.layui-form select{display:none}.layui-form [lay-ignore]{display:initial}.layui-form-item{margin-bottom:15px;clear:both;*zoom:1}.layui-form-item:after{content:'\20';clear:both;*zoom:1;display:block;height:0}.layui-form-label{float:left;display:block;padding:9px 15px;width:80px;font-weight:400;line-height:20px;text-align:right}.layui-form-label-col{display:block;float:none;padding:9px 0;line-height:20px;text-align:left}.layui-form-item .layui-inline{margin-bottom:5px;margin-right:10px}.layui-input-block{margin-left:110px;min-height:36px}.layui-input-inline{display:inline-block;vertical-align:middle}.layui-form-item .layui-input-inline{float:left;width:190px;margin-right:10px}.layui-form-text .layui-input-inline{width:auto}.layui-form-mid{float:left;display:block;padding:9px 0!important;line-height:20px;margin-right:10px}.layui-form-danger+.layui-form-select .layui-input,.layui-form-danger:focus{border-color:#FF5722!important}.layui-input-wrap{height:38px;line-height:38px}.layui-input-wrap .layui-input{padding-right:35px;cursor:pointer}.layui-input-wrap .layui-input::-ms-clear,.layui-input-wrap .layui-input::-ms-reveal{display:none}.layui-input-wrap-prefix .layui-input{padding-left:35px}.layui-input-prefix,.layui-input-split,.layui-input-suffix{position:absolute;right:0;top:0;padding:0 10px;width:35px;height:100%;text-align:center;transition:all .3s;cursor:pointer;pointer-events:none;box-sizing:border-box}.layui-input-prefix{left:0;border-radius:2px 0 0 2px}.layui-input-suffix{right:0;border-radius:0 2px 2px 0}.layui-input-wrap .layui-input:focus+.layui-input-split{border-color:#d2d2d2}.layui-input-prefix .layui-icon,.layui-input-split .layui-icon,.layui-input-suffix .layui-icon{position:relative;font-size:16px;color:rgba(0,0,0,.6);transition:all .3s}.layui-input-wrap .layui-input-prefix.layui-input-split{border-width:0 1px 0 0}.layui-input-wrap-prefix .layui-form-select{position:static}.layui-input-affix-event .layui-icon{color:rgba(0,0,0,.8)}.layui-input-affix-event .layui-icon-clear{color:rgba(0,0,0,.3)}.layui-input-affix-event .layui-icon:hover{color:rgba(0,0,0,.6)}.layui-input-split{border-width:1px;border-style:solid}.layui-input-affix-event{pointer-events:auto}.layui-input-group{position:relative;display:inline-table;cursor:pointer}.layui-input-group>*{display:table-cell;vertical-align:middle;position:relative;cursor:pointer}.layui-input-group .layui-input{padding-right:15px}.layui-input-group .layui-input-prefix{width:auto;border-right:0}.layui-input-group .layui-input-suffix{width:auto;border-left:0}.layui-form-select{position:relative}.layui-form-select .layui-input{padding-right:30px;cursor:pointer}.layui-form-select .layui-edge{position:absolute;right:10px;top:50%;margin-top:-3px;cursor:pointer;border-width:6px;border-top-color:#c2c2c2;border-top-style:solid;transition:all .3s;-webkit-transition:all .3s}.layui-form-select dl{display:none;position:absolute;left:0;top:42px;padding:5px 0;z-index:899;min-width:100%;border:1px solid #eee;max-height:300px;overflow-y:auto;background-color:#fff;border-radius:2px;box-sizing:border-box}.layui-form-select dl dd,.layui-form-select dl dt{padding:0 10px;line-height:36px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-form-select dl dt{font-size:12px;color:#999}.layui-form-select dl dd{cursor:pointer}.layui-form-select dl dd:hover{background-color:#F6F6F6;-webkit-transition:.5s all;transition:.5s all}.layui-form-select .layui-select-group dd{padding-left:20px}.layui-form-select dl dd.layui-select-tips{padding-left:10px!important;color:#999}.layui-form-select dl dd.layui-this{background-color:#F6F6F6;color:#5FB878;font-weight:700}.layui-form-checkbox,.layui-form-select dl dd.layui-disabled{background-color:#fff}.layui-form-selected dl{display:block}.layui-form-checkbox,.layui-form-checkbox *,.layui-form-switch{display:inline-block;vertical-align:middle}.layui-form-selected .layui-edge{margin-top:-9px;-webkit-transform:rotate(180deg);transform:rotate(180deg);margin-top:-3px\9}:root .layui-form-selected .layui-edge{margin-top:-9px\0/IE9}.layui-form-selectup dl{top:auto;bottom:42px}.layui-select-none{margin:5px 0;text-align:center;color:#999}.layui-select-disabled .layui-disabled{border-color:#eee!important}.layui-select-disabled .layui-edge{border-top-color:#d2d2d2}.layui-form-checkbox{position:relative;height:30px;line-height:30px;margin-right:10px;padding-right:30px;cursor:pointer;font-size:0;-webkit-transition:.1s linear;transition:.1s linear;box-sizing:border-box}.layui-form-checkbox span{padding:0 10px;height:100%;font-size:14px;border-radius:2px 0 0 2px;background-color:#d2d2d2;color:#fff;overflow:hidden}.layui-form-checkbox:hover span{background-color:#c2c2c2}.layui-form-checkbox i{position:absolute;right:0;top:0;width:30px;height:28px;border:1px solid #d2d2d2;border-left:none;border-radius:0 2px 2px 0;color:#fff;font-size:20px;text-align:center}.layui-form-checkbox:hover i{border-color:#c2c2c2;color:#c2c2c2}.layui-form-checked,.layui-form-checked:hover{border-color:#5FB878}.layui-form-checked span,.layui-form-checked:hover span{background-color:#5FB878}.layui-form-checked i,.layui-form-checked:hover i{color:#5FB878}.layui-form-item .layui-form-checkbox{margin-top:4px}.layui-form-checkbox[lay-skin=primary]{height:auto!important;line-height:normal!important;min-width:18px;min-height:18px;border:none!important;margin-right:0;padding-left:28px;padding-right:0;background:0 0}.layui-form-checkbox[lay-skin=primary] span{padding-left:0;padding-right:15px;line-height:18px;background:0 0;color:#666}.layui-form-checkbox[lay-skin=primary] i{right:auto;left:0;width:16px;height:16px;line-height:16px;border:1px solid #d2d2d2;font-size:12px;border-radius:2px;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-checkbox[lay-skin=primary]:hover i{border-color:#5FB878;color:#fff}.layui-form-checked[lay-skin=primary] i{border-color:#5FB878!important;background-color:#5FB878;color:#fff}.layui-checkbox-disabled[lay-skin=primary] span{background:0 0!important;color:#c2c2c2!important}.layui-checkbox-disabled[lay-skin=primary]:hover i{border-color:#d2d2d2}.layui-form-item .layui-form-checkbox[lay-skin=primary]{margin-top:10px}.layui-form-switch{position:relative;height:22px;line-height:22px;min-width:35px;padding:0 5px;margin-top:8px;border:1px solid #d2d2d2;border-radius:20px;cursor:pointer;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-switch i{position:absolute;left:5px;top:3px;width:16px;height:16px;border-radius:20px;background-color:#d2d2d2;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-switch em{position:relative;top:0;width:25px;margin-left:21px;padding:0!important;text-align:center!important;color:#999!important;font-style:normal!important;font-size:12px}.layui-form-onswitch{border-color:#5FB878;background-color:#5FB878}.layui-checkbox-disabled,.layui-checkbox-disabled i{border-color:#eee!important}.layui-form-onswitch i{left:100%;margin-left:-21px;background-color:#fff}.layui-form-onswitch em{margin-left:5px;margin-right:21px;color:#fff!important}.layui-checkbox-disabled span{background-color:#eee!important}.layui-checkbox-disabled em{color:#d2d2d2!important}.layui-checkbox-disabled:hover i{color:#fff!important}[lay-radio]{display:none}.layui-form-radio,.layui-form-radio *{display:inline-block;vertical-align:middle}.layui-form-radio{line-height:28px;margin:6px 10px 0 0;padding-right:10px;cursor:pointer;font-size:0}.layui-form-radio *{font-size:14px}.layui-form-radio>i{margin-right:8px;font-size:22px;color:#c2c2c2}.layui-form-radio:hover *,.layui-form-radioed,.layui-form-radioed>i{color:#5FB878}.layui-radio-disabled>i{color:#eee!important}.layui-radio-disabled *{color:#c2c2c2!important}.layui-form-pane .layui-form-label{width:110px;padding:8px 15px;height:38px;line-height:20px;border-width:1px;border-style:solid;border-radius:2px 0 0 2px;text-align:center;background-color:#FAFAFA;overflow:hidden;box-sizing:border-box}.layui-form-pane .layui-input-inline{margin-left:-1px}.layui-form-pane .layui-input-block{margin-left:110px;left:-1px}.layui-form-pane .layui-input{border-radius:0 2px 2px 0}.layui-form-pane .layui-form-text .layui-form-label{float:none;width:100%;border-radius:2px;box-sizing:border-box;text-align:left}.layui-form-pane .layui-form-text .layui-input-inline{display:block;margin:0;top:-1px;clear:both}.layui-form-pane .layui-form-text .layui-input-block{margin:0;left:0;top:-1px}.layui-form-pane .layui-form-text .layui-textarea{min-height:100px;border-radius:0 0 2px 2px}.layui-form-pane .layui-form-checkbox{margin:4px 0 4px 10px}.layui-form-pane .layui-form-radio,.layui-form-pane .layui-form-switch{margin-top:6px;margin-left:10px}.layui-form-pane .layui-form-item[pane]{position:relative;border-width:1px;border-style:solid}.layui-form-pane .layui-form-item[pane] .layui-form-label{position:absolute;left:0;top:0;height:100%;border-width:0 1px 0 0}.layui-form-pane .layui-form-item[pane] .layui-input-inline{margin-left:110px}@media screen and (max-width:450px){.layui-form-item .layui-form-label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-form-item .layui-inline{display:block;margin-right:0;margin-bottom:20px;clear:both}.layui-form-item .layui-inline:after{content:'\20';clear:both;display:block;height:0}.layui-form-item .layui-input-inline{display:block;float:none;left:-3px;width:auto!important;margin:0 0 10px 112px}.layui-form-item .layui-input-inline+.layui-form-mid{margin-left:110px;top:-5px;padding:0}.layui-form-item .layui-form-checkbox{margin-right:5px;margin-bottom:5px}}.layui-layedit{border-width:1px;border-style:solid;border-radius:2px}.layui-layedit-tool{padding:3px 5px;border-bottom-width:1px;border-bottom-style:solid;font-size:0}.layedit-tool-fixed{position:fixed;top:0;border-top:1px solid #eee}.layui-layedit-tool .layedit-tool-mid,.layui-layedit-tool .layui-icon{display:inline-block;vertical-align:middle;text-align:center;font-size:14px}.layui-layedit-tool .layui-icon{position:relative;width:32px;height:30px;line-height:30px;margin:3px 5px;color:#777;cursor:pointer;border-radius:2px}.layui-layedit-tool .layui-icon:hover{color:#393D49}.layui-layedit-tool .layui-icon:active{color:#000}.layui-layedit-tool .layedit-tool-active{background-color:#eee;color:#000}.layui-layedit-tool .layui-disabled,.layui-layedit-tool .layui-disabled:hover{color:#d2d2d2;cursor:not-allowed}.layui-layedit-tool .layedit-tool-mid{width:1px;height:18px;margin:0 10px;background-color:#d2d2d2}.layedit-tool-html{width:50px!important;font-size:30px!important}.layedit-tool-b,.layedit-tool-code,.layedit-tool-help{font-size:16px!important}.layedit-tool-d,.layedit-tool-face,.layedit-tool-image,.layedit-tool-unlink{font-size:18px!important}.layedit-tool-image input{position:absolute;font-size:0;left:0;top:0;width:100%;height:100%;opacity:.01;filter:Alpha(opacity=1);cursor:pointer}.layui-layedit-iframe iframe{display:block;width:100%}#LAY_layedit_code{overflow:hidden}.layui-laypage{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;margin:10px 0;font-size:0}.layui-laypage>a:first-child,.layui-laypage>a:first-child em{border-radius:2px 0 0 2px}.layui-laypage>a:last-child,.layui-laypage>a:last-child em{border-radius:0 2px 2px 0}.layui-laypage>:first-child{margin-left:0!important}.layui-laypage>:last-child{margin-right:0!important}.layui-laypage a,.layui-laypage button,.layui-laypage input,.layui-laypage select,.layui-laypage span{border:1px solid #eee}.layui-laypage a,.layui-laypage span{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding:0 15px;height:28px;line-height:28px;margin:0 -1px 5px 0;background-color:#fff;color:#333;font-size:12px}.layui-laypage a:hover{color:#009688}.layui-laypage em{font-style:normal}.layui-laypage .layui-laypage-spr{color:#999;font-weight:700}.layui-laypage a{text-decoration:none}.layui-laypage .layui-laypage-curr{position:relative}.layui-laypage .layui-laypage-curr em{position:relative;color:#fff}.layui-laypage .layui-laypage-curr .layui-laypage-em{position:absolute;left:-1px;top:-1px;padding:1px;width:100%;height:100%;background-color:#009688}.layui-laypage-em{border-radius:2px}.layui-laypage-next em,.layui-laypage-prev em{font-family:Sim sun;font-size:16px}.layui-laypage .layui-laypage-count,.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh,.layui-laypage .layui-laypage-skip{margin-left:10px;margin-right:10px;padding:0;border:none}.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh{vertical-align:top}.layui-laypage .layui-laypage-refresh i{font-size:18px;cursor:pointer}.layui-laypage select{height:22px;padding:3px;border-radius:2px;cursor:pointer}.layui-laypage .layui-laypage-skip{height:30px;line-height:30px;color:#999}.layui-laypage button,.layui-laypage input{height:30px;line-height:30px;border-radius:2px;vertical-align:top;background-color:#fff;box-sizing:border-box}.layui-laypage input{display:inline-block;width:40px;margin:0 10px;padding:0 3px;text-align:center}.layui-laypage input:focus,.layui-laypage select:focus{border-color:#009688!important}.layui-laypage button{margin-left:10px;padding:0 10px;cursor:pointer}.layui-table,.layui-table-view{margin:10px 0}.layui-flow-more{margin:10px 0;text-align:center;color:#999;font-size:14px}.layui-flow-more a{height:32px;line-height:32px}.layui-flow-more a *{display:inline-block;vertical-align:top}.layui-flow-more a cite{padding:0 20px;border-radius:3px;background-color:#eee;color:#333;font-style:normal}.layui-flow-more a cite:hover{opacity:.8}.layui-flow-more a i{font-size:30px;color:#737383}.layui-table{width:100%;background-color:#fff;color:#666}.layui-table tr{transition:all .3s;-webkit-transition:all .3s}.layui-table th{text-align:left;font-weight:400}.layui-table tbody tr:hover,.layui-table thead tr,.layui-table-click,.layui-table-header,.layui-table-hover,.layui-table-mend,.layui-table-patch,.layui-table-tool,.layui-table-total,.layui-table-total tr,.layui-table[lay-even] tr:nth-child(even){background-color:#FAFAFA}.layui-table td,.layui-table th,.layui-table-col-set,.layui-table-fixed-r,.layui-table-grid-down,.layui-table-header,.layui-table-page,.layui-table-tips-main,.layui-table-tool,.layui-table-total,.layui-table-view,.layui-table[lay-skin=line],.layui-table[lay-skin=row]{border-width:1px;border-style:solid;border-color:#eee}.layui-table td,.layui-table th{position:relative;padding:9px 15px;min-height:20px;line-height:20px;font-size:14px}.layui-table[lay-skin=line] td,.layui-table[lay-skin=line] th{border-width:0 0 1px}.layui-table[lay-skin=row] td,.layui-table[lay-skin=row] th{border-width:0 1px 0 0}.layui-table[lay-skin=nob] td,.layui-table[lay-skin=nob] th{border:none}.layui-table img{max-width:100px}.layui-table[lay-size=lg] td,.layui-table[lay-size=lg] th{padding:15px 30px}.layui-table-view .layui-table[lay-size=lg] .layui-table-cell{height:40px;line-height:40px}.layui-table[lay-size=sm] td,.layui-table[lay-size=sm] th{font-size:12px;padding:5px 10px}.layui-table-view .layui-table[lay-size=sm] .layui-table-cell{height:20px;line-height:20px}.layui-table[lay-data]{display:none}.layui-table-box{position:relative;overflow:hidden}.layui-table-view .layui-table{position:relative;width:auto;margin:0;border-collapse:separate}.layui-table-view .layui-table[lay-skin=line]{border-width:0 1px 0 0}.layui-table-view .layui-table[lay-skin=row]{border-width:0 0 1px}.layui-table-view .layui-table td,.layui-table-view .layui-table th{padding:5px 0;border-top:none;border-left:none}.layui-table-view .layui-table th.layui-unselect .layui-table-cell span{cursor:pointer}.layui-table-view .layui-table td{cursor:default}.layui-table-view .layui-table td[data-edit=text]{cursor:text}.layui-table-view .layui-form-checkbox[lay-skin=primary] i{width:18px;height:18px}.layui-table-view .layui-form-radio{line-height:0;padding:0}.layui-table-view .layui-form-radio>i{margin:0;font-size:20px}.layui-table-init{position:absolute;left:0;top:0;width:100%;height:100%;text-align:center;z-index:110}.layui-table-init .layui-icon{position:absolute;left:50%;top:50%;margin:-15px 0 0 -15px;font-size:30px;color:#c2c2c2}.layui-table-header{border-width:0 0 1px;overflow:hidden}.layui-table-header .layui-table{margin-bottom:-1px}.layui-table-tool .layui-inline[lay-event]{position:relative;width:26px;height:26px;padding:5px;line-height:16px;margin-right:10px;text-align:center;color:#333;border:1px solid #ccc;cursor:pointer;-webkit-transition:.5s all;transition:.5s all}.layui-table-tool .layui-inline[lay-event]:hover{border:1px solid #999}.layui-table-tool-temp{padding-right:120px}.layui-table-tool-self{position:absolute;right:17px;top:10px}.layui-table-tool .layui-table-tool-self .layui-inline[lay-event]{margin:0 0 0 10px}.layui-table-tool-panel{position:absolute;top:29px;left:-1px;padding:5px 0;min-width:150px;min-height:40px;border:1px solid #d2d2d2;text-align:left;overflow-y:auto;background-color:#fff;box-shadow:0 2px 4px rgba(0,0,0,.12)}.layui-table-cell,.layui-table-tool-panel li{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.layui-table-tool-panel li{padding:0 10px;line-height:30px;-webkit-transition:.5s all;transition:.5s all}.layui-iconpicker-list li,.layui-keyboard-list li,.layui-menu li,.layui-menu-body-title a:hover,.layui-menu-body-title>.layui-icon:hover,.layui-nav .layui-nav-item a{transition:all .3s}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary]{width:100%;padding-left:28px}.layui-table-tool-panel li:hover{background-color:#F6F6F6}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary] i{position:absolute;left:0;top:0}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary] span{padding:0}.layui-table-tool .layui-table-tool-self .layui-table-tool-panel{left:auto;right:-1px}.layui-table-col-set{position:absolute;right:0;top:0;width:20px;height:100%;border-width:0 0 0 1px;background-color:#fff}.layui-table-sort{width:10px;height:20px;margin-left:5px;cursor:pointer!important}.layui-table-sort .layui-edge{position:absolute;left:5px;border-width:5px}.layui-table-sort .layui-table-sort-asc{top:3px;border-top:none;border-bottom-style:solid;border-bottom-color:#b2b2b2}.layui-table-sort .layui-table-sort-asc:hover{border-bottom-color:#666}.layui-table-sort .layui-table-sort-desc{bottom:5px;border-bottom:none;border-top-style:solid;border-top-color:#b2b2b2}.layui-table-sort .layui-table-sort-desc:hover{border-top-color:#666}.layui-table-sort[lay-sort=asc] .layui-table-sort-asc{border-bottom-color:#000}.layui-table-sort[lay-sort=desc] .layui-table-sort-desc{border-top-color:#000}.layui-table-cell{height:28px;line-height:28px;padding:0 15px;position:relative;box-sizing:border-box}.layui-table-cell .layui-form-checkbox[lay-skin=primary]{top:-1px;padding:0}.layui-table-cell .layui-table-link{color:#01AAED}.laytable-cell-checkbox,.laytable-cell-numbers,.laytable-cell-radio,.laytable-cell-space{padding:0;text-align:center;-webkit-box-pack:center}.layui-table-body{position:relative;overflow:auto;margin-right:-1px;margin-bottom:-1px}.layui-table-body .layui-none{line-height:26px;padding:30px 15px;text-align:center;color:#999}.layui-table-fixed{position:absolute;left:0;top:0;z-index:101}.layui-table-fixed .layui-table-body{overflow:hidden}.layui-table-fixed-l{box-shadow:1px 0 8px rgba(0,0,0,.08)}.layui-table-fixed-r{left:auto;right:-1px;border-width:0 0 0 1px;box-shadow:-1px 0 8px rgba(0,0,0,.08)}.layui-table-fixed-r .layui-table-header{position:relative;overflow:visible}.layui-table-mend{position:absolute;right:-49px;top:0;height:100%;width:50px}.layui-table-tool{position:relative;z-index:890;width:100%;min-height:50px;line-height:30px;padding:10px 15px;border-width:0 0 1px;box-shadow:0 2px 8px rgb(0 0 0 / 8%)}.layui-table-tool .layui-btn-container{margin-bottom:-10px}.layui-table-page,.layui-table-total{border-width:1px 0 0;margin-bottom:-1px;overflow:hidden}.layui-table-page{position:relative;width:100%;padding:7px 7px 0;height:41px;font-size:12px;white-space:nowrap}.layui-table-page>div{height:26px}.layui-table-page .layui-laypage{margin:0}.layui-table-page .layui-laypage a,.layui-table-page .layui-laypage span{height:26px;line-height:26px;margin-bottom:10px;border:none;background:0 0}.layui-table-page .layui-laypage a,.layui-table-page .layui-laypage span.layui-laypage-curr{padding:0 12px}.layui-table-page .layui-laypage span{margin-left:0;padding:0}.layui-table-page .layui-laypage .layui-laypage-prev{margin-left:-7px!important}.layui-table-page .layui-laypage .layui-laypage-curr .layui-laypage-em{left:0;top:0;padding:0}.layui-table-page .layui-laypage button,.layui-table-page .layui-laypage input{height:26px;line-height:26px}.layui-table-page .layui-laypage input{width:40px}.layui-table-page .layui-laypage button{padding:0 10px}.layui-table-page select{height:18px}.layui-table-pagebar{float:right;line-height:26px}.layui-table-view select[lay-ignore]{display:inline-block}.layui-table-patch .layui-table-cell{padding:0;width:30px}.layui-table-edit{position:absolute;left:0;top:0;width:100%;height:100%;padding:0 14px 1px;border-radius:0;box-shadow:1px 1px 20px rgba(0,0,0,.15)}.layui-table-edit:focus{border-color:#5FB878!important}select.layui-table-edit{padding:0 0 0 10px;border-color:#d2d2d2}.layui-table-view .layui-form-checkbox,.layui-table-view .layui-form-radio,.layui-table-view .layui-form-switch{top:0;margin:0;box-sizing:content-box}.layui-colorpicker-alpha-slider,.layui-colorpicker-side-slider,.layui-menu,.layui-menu *,.layui-nav{box-sizing:border-box}.layui-table-view .layui-form-checkbox{top:-1px;height:26px;line-height:26px}.layui-table-view .layui-form-checkbox i{height:26px}.layui-table-grid .layui-table-cell{overflow:visible}.layui-table-grid-down{position:absolute;top:0;right:0;width:26px;height:100%;padding:5px 0;border-width:0 0 0 1px;text-align:center;background-color:#fff;color:#999;cursor:pointer}.layui-table-grid-down .layui-icon{position:absolute;top:50%;left:50%;margin:-8px 0 0 -8px}.layui-table-grid-down:hover{background-color:#fbfbfb}body .layui-table-tips .layui-layer-content{background:0 0;padding:0;box-shadow:0 1px 6px rgba(0,0,0,.12)}.layui-table-tips-main{margin:-44px 0 0 -1px;max-height:150px;padding:8px 15px;font-size:14px;overflow-y:scroll;background-color:#fff;color:#666}.layui-table-tips-c{position:absolute;right:-3px;top:-13px;width:20px;height:20px;padding:3px;cursor:pointer;background-color:#666;border-radius:50%;color:#fff}.layui-table-tips-c:hover{background-color:#777}.layui-table-tips-c:before{position:relative;right:-2px}.layui-upload-file{display:none!important;opacity:.01;filter:Alpha(opacity=1)}.layui-upload-drag,.layui-upload-form,.layui-upload-wrap{display:inline-block}.layui-upload-list{margin:10px 0}.layui-upload-choose{max-width:200px;padding:0 10px;color:#999;font-size:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-upload-drag{position:relative;padding:30px;border:1px dashed #e2e2e2;background-color:#fff;text-align:center;cursor:pointer;color:#999}.layui-upload-drag .layui-icon{font-size:50px;color:#009688}.layui-upload-drag[lay-over]{border-color:#009688}.layui-upload-iframe{position:absolute;width:0;height:0;border:0;visibility:hidden}.layui-upload-wrap{position:relative;vertical-align:middle}.layui-upload-wrap .layui-upload-file{display:block!important;position:absolute;left:0;top:0;z-index:10;font-size:100px;width:100%;height:100%;opacity:.01;filter:Alpha(opacity=1);cursor:pointer}.layui-btn-container .layui-upload-choose{padding-left:0}.layui-menu{position:relative;margin:5px 0;background-color:#fff}.layui-menu li,.layui-menu-body-title a{padding:5px 15px}.layui-menu li{position:relative;margin:1px 0;width:calc(100% + 1px);line-height:26px;color:rgba(0,0,0,.8);font-size:14px;white-space:nowrap;cursor:pointer}.layui-menu li:hover{background-color:#F6F6F6}.layui-menu-item-parent:hover>.layui-menu-body-panel{display:block;animation-name:layui-fadein;animation-duration:.3s;animation-fill-mode:both;animation-delay:.2s}.layui-menu-item-group .layui-menu-body-title,.layui-menu-item-parent .layui-menu-body-title{padding-right:25px}.layui-menu .layui-menu-item-divider:hover,.layui-menu .layui-menu-item-group:hover,.layui-menu .layui-menu-item-none:hover{background:0 0;cursor:default}.layui-menu .layui-menu-item-group>ul{margin:5px 0 -5px}.layui-menu .layui-menu-item-group>.layui-menu-body-title{color:rgba(0,0,0,.35);user-select:none}.layui-menu .layui-menu-item-none{color:rgba(0,0,0,.35);cursor:default;text-align:center}.layui-menu .layui-menu-item-divider{margin:5px 0;padding:0;height:0;line-height:0;border-bottom:1px solid #eee;overflow:hidden}.layui-menu .layui-menu-item-down:hover,.layui-menu .layui-menu-item-up:hover{cursor:pointer}.layui-menu .layui-menu-item-up>.layui-menu-body-title{color:rgba(0,0,0,.8)}.layui-menu .layui-menu-item-up>ul{visibility:hidden;height:0;overflow:hidden}.layui-menu .layui-menu-item-down:hover>.layui-menu-body-title>.layui-icon,.layui-menu .layui-menu-item-up>.layui-menu-body-title:hover>.layui-icon{color:rgba(0,0,0,1)}.layui-menu .layui-menu-item-down>ul{visibility:visible;height:auto}.layui-breadcrumb,.layui-tree-btnGroup{visibility:hidden}.layui-menu .layui-menu-item-checked,.layui-menu .layui-menu-item-checked2{background-color:#F6F6F6!important;color:#5FB878}.layui-menu .layui-menu-item-checked a,.layui-menu .layui-menu-item-checked2 a{color:#5FB878}.layui-menu .layui-menu-item-checked:after{position:absolute;right:0;top:0;bottom:0;border-right:3px solid #5FB878;content:""}.layui-menu-body-title{position:relative;overflow:hidden;text-overflow:ellipsis}.layui-menu-body-title a{display:block;margin:-5px -15px;color:rgba(0,0,0,.8)}.layui-menu-body-title>.layui-icon{position:absolute;right:0;top:0;font-size:14px}.layui-menu-body-title>.layui-icon-right{right:-1px}.layui-menu-body-panel{display:none;position:absolute;top:-7px;left:100%;z-index:1000;margin-left:13px;padding:5px 0}.layui-menu-body-panel:before{content:"";position:absolute;width:20px;left:-16px;top:0;bottom:0}.layui-menu-body-panel-left{left:auto;right:100%;margin:0 13px}.layui-menu-body-panel-left:before{left:auto;right:-16px}.layui-menu-lg li{line-height:32px}.layui-menu-lg .layui-menu-body-title a:hover,.layui-menu-lg li:hover{background:0 0;color:#5FB878}.layui-menu-lg li .layui-menu-body-panel{margin-left:14px}.layui-menu-lg li .layui-menu-body-panel-left{margin:0 15px}.layui-dropdown{position:absolute;left:-999999px;top:-999999px;z-index:66666666;margin:5px 0;min-width:100px}.layui-dropdown:before{content:"";position:absolute;width:100%;height:6px;left:0;top:-6px}.layui-dropdown .layui-none{line-height:26px;color:#999;text-align:center}.layui-iconpicker{position:relative;height:38px;line-height:38px;border-width:1px;border-style:solid;border-radius:2px;cursor:pointer}.layui-iconpicker .layui-inline{height:36px;line-height:36px;vertical-align:top}.layui-iconpicker-title{padding-left:5px}.layui-iconpicker-main{padding:0 10px}.layui-iconpicker-main .layui-icon{font-size:20px}.layui-iconpicker-main .layui-inline{vertical-align:top}.layui-iconpicker-split .layui-iconpicker-main{padding:0 15px;border-right-width:1px;border-right-style:solid}.layui-iconpicker-suffix{position:relative;width:35px;text-align:center}.layui-iconpicker-suffix .layui-icon{font-size:14px;color:rgba(0,0,0,.5);transition:all .3s}.layui-iconpicker-down .layui-iconpicker-suffix .layui-icon-down{transform:rotate(180deg)}.layui-iconpicker-none{color:rgba(0,0,0,.5)}.layui-iconpicker-search{padding:10px;box-shadow:0 2px 8px #f0f1f2;border-bottom:1px solid #eee\9}.layui-iconpicker-list{padding:10px 10px 5px}.layui-iconpicker-list ul{width:262px;margin-right:-6px}.layui-iconpicker-list li{display:inline-block;vertical-align:top;width:60px;margin:0 5px 5px 0;padding:5px;border:1px solid #eee;border-radius:2px;cursor:pointer;text-align:center}.layui-iconpicker-list li:hover{background-color:#FAFAFA;color:rgba(0,0,0,.5)}.layui-iconpicker-list li.layui-this{border-color:#5FB878;color:#5FB878}.layui-iconpicker-list li .layui-icon{font-size:20px}.layui-iconpicker-list li .layui-elip{margin-top:2px;line-height:20px;font-size:12px}.layui-iconpicker-list .layui-none{margin:30px 0 35px}.layui-iconpicker-scroll .layui-iconpicker-list{max-height:194px;overflow:auto}.layui-iconpicker-page{position:relative;padding:10px 10px 5px;border-top:1px solid #eee;text-align:right}.layui-iconpicker-page .layui-laypage{margin:0}.layui-iconpicker-page .layui-laypage a,.layui-iconpicker-page .layui-laypage span{padding:0 10px;color:#666}.layui-iconpicker-page .layui-laypage-count{position:absolute;left:10px}.layui-iconpicker-page .layui-laypage-curr .layui-laypage-em{background:0 0}.layui-iconpicker-page .layui-laypage-curr em{color:#666;color:rgba(0,0,0,.6)}.layui-iconpicker-page .layui-laypage-first,.layui-iconpicker-page .layui-laypage-last,.layui-iconpicker-page .layui-laypage-spr{display:none}.layui-keyboard-header{height:40px;line-height:40px;padding:0 60px;text-align:center;background-color:#fff;box-shadow:0 2px 8px #f0f1f2;border-bottom:1px solid #eee\9}.layui-keyboard-list{padding:10px 10px 5px;text-align:center}.layui-keyboard-header button{position:absolute;right:10px;top:10px;height:20px;line-height:20px;border:none;color:#009688}.layui-keyboard-header button:first-child{left:10px;right:auto;color:#999}.layui-keyboard-list ul{margin-right:-5px}.layui-keyboard-list li{display:inline-block;vertical-align:top;margin:0 5px 5px 0;padding:5px;width:30px;height:36px;line-height:26px;border:1px solid #eee;border-radius:2px;cursor:pointer;text-align:center;background-color:#fff}.layui-keyboard-list li:hover{background-color:#FAFAFA;color:rgba(0,0,0,.5)}.layui-keyboard-list li.layui-this{border-color:#5FB878;color:#5FB878}.layui-nav{position:relative;padding:0 20px;background-color:#393D49;color:#fff;border-radius:2px;font-size:0}.layui-nav *{font-size:14px}.layui-nav .layui-nav-item{position:relative;display:inline-block;*display:inline;*zoom:1;vertical-align:middle;line-height:60px}.layui-nav .layui-nav-item a{display:block;padding:0 20px;color:#fff;color:rgba(255,255,255,.7);-webkit-transition:all .3s}.layui-nav .layui-this:after,.layui-nav-bar{content:"";position:absolute;left:0;top:0;width:0;height:5px;background-color:#5FB878;transition:all .2s;-webkit-transition:all .2s;pointer-events:none}.layui-nav-bar{z-index:1000}.layui-nav[lay-bar=disabled] .layui-nav-bar{display:none}.layui-nav .layui-nav-item a:hover,.layui-nav .layui-this a{color:#fff}.layui-nav .layui-this:after{top:auto;bottom:0;width:100%}.layui-nav-img{width:30px;height:30px;margin-right:5px;border-radius:50%}.layui-nav .layui-nav-more{position:absolute;top:0;right:3px;left:auto!important;margin-top:0;font-size:12.5px!important;cursor:pointer;transition:all .2s;-webkit-transition:all .2s}.layui-nav .layui-nav-mored,.layui-nav-itemed>a .layui-nav-more{transform:rotate(180deg)}.layui-nav-child{display:none;position:absolute;left:0;top:65px;min-width:100%;line-height:36px;padding:5px 0;box-shadow:0 2px 4px rgba(0,0,0,.12);border:1px solid #eee;background-color:#fff;z-index:100;border-radius:2px;white-space:nowrap}.layui-nav .layui-nav-child a{color:#666;color:rgba(0,0,0,.8)}.layui-nav .layui-nav-child a:hover{background-color:#F6F6F6;color:rgba(0,0,0,.8)}.layui-nav-child dd{margin:1px 0;position:relative}.layui-nav-child dd.layui-this{background-color:#F6F6F6;color:#000}.layui-nav-child dd.layui-this:after{display:none}.layui-nav-child-r{left:auto;right:0}.layui-nav-child-c{text-align:center}.layui-nav-tree{width:200px;padding:0}.layui-nav-tree .layui-nav-item{display:block;width:100%;line-height:40px}.layui-nav-tree .layui-nav-item a{position:relative;height:40px;line-height:40px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-nav-tree .layui-nav-item>a{padding-top:5px;padding-bottom:5px}.layui-nav-tree .layui-nav-more{right:15px}.layui-nav-tree .layui-nav-item>a .layui-nav-more{padding:5px 0}.layui-nav-tree .layui-nav-bar{width:5px;height:0;background-color:#009688}.layui-side .layui-nav-tree .layui-nav-bar{width:2px}.layui-nav-tree .layui-nav-child dd.layui-this,.layui-nav-tree .layui-nav-child dd.layui-this a,.layui-nav-tree .layui-this,.layui-nav-tree .layui-this>a,.layui-nav-tree .layui-this>a:hover{background-color:#009688;color:#fff}.layui-nav-tree .layui-this:after{display:none}.layui-nav-itemed>a,.layui-nav-tree .layui-nav-title a,.layui-nav-tree .layui-nav-title a:hover{color:#fff!important}.layui-nav-tree .layui-nav-child{position:relative;z-index:0;top:0;border:none;box-shadow:none}.layui-nav-tree .layui-nav-child dd{margin:0}.layui-nav-tree .layui-nav-child a{color:#fff;color:rgba(255,255,255,.7)}.layui-nav-tree .layui-nav-child,.layui-nav-tree .layui-nav-child a:hover{background:0 0;color:#fff}.layui-nav-itemed>.layui-nav-child{display:block;background-color:rgba(0,0,0,.3)!important}.layui-nav-itemed>.layui-nav-child>.layui-this>.layui-nav-child{display:block}.layui-nav-tree.layui-bg-gray a,.layui-nav.layui-bg-gray .layui-nav-item a{color:#666!important;color:rgba(0,0,0,.8)!important}.layui-nav-tree.layui-bg-gray .layui-nav-itemed>.layui-nav-child{background:0 0!important}.layui-nav-tree.layui-bg-gray .layui-nav-child dd.layui-this,.layui-nav-tree.layui-bg-gray .layui-nav-child dd.layui-this a{background:0 0!important;color:#5FB878!important;font-weight:700}.layui-nav.layui-bg-gray .layui-nav-bar{background-color:#5FB878}.layui-nav-side{position:fixed;top:0;bottom:0;left:0;overflow-x:hidden;z-index:999}.layui-breadcrumb{font-size:0}.layui-breadcrumb>*{font-size:14px}.layui-breadcrumb a:hover{color:#5FB878!important}.layui-breadcrumb a cite{color:#999;font-style:normal}.layui-breadcrumb span[lay-separator]{margin:0 10px;color:#ccc}.layui-tab{margin:10px 0;text-align:left!important}.layui-tab[overflow]>.layui-tab-title{overflow:hidden}.layui-tab-title{position:relative;left:0;height:40px;white-space:nowrap;font-size:0;border-bottom-width:1px;border-bottom-style:solid;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;font-size:14px;transition:all .2s;-webkit-transition:all .2s;position:relative;line-height:40px;min-width:65px;padding:0 15px;text-align:center;cursor:pointer}.layui-tab-title li a{display:block;padding:0 15px;margin:0 -15px}.layui-tab-title .layui-this{color:#000}.layui-tab-title .layui-this:after{position:absolute;left:0;top:0;content:"";width:100%;height:41px;border-width:1px;border-style:solid;border-bottom-color:#fff;border-radius:2px 2px 0 0;box-sizing:border-box;pointer-events:none}.layui-tab-bar{position:absolute;right:0;top:0;z-index:10;width:30px;height:39px;line-height:39px;border-width:1px;border-style:solid;border-radius:2px;text-align:center;background-color:#fff;cursor:pointer}.layui-tab-bar .layui-icon{position:relative;display:inline-block;top:3px;transition:all .3s;-webkit-transition:all .3s}.layui-tab-item{display:none}.layui-tab-more{padding-right:30px;height:auto!important;white-space:normal!important}.layui-tab-more li.layui-this:after{border-bottom-color:#eee;border-radius:2px}.layui-tab-more .layui-tab-bar .layui-icon{top:-2px;top:3px\9;-webkit-transform:rotate(180deg);transform:rotate(180deg)}:root .layui-tab-more .layui-tab-bar .layui-icon{top:-2px\0/IE9}.layui-tab-content{padding:15px 0}.layui-tab-title li .layui-tab-close{position:relative;display:inline-block;width:18px;height:18px;line-height:20px;margin-left:8px;top:1px;text-align:center;font-size:14px;color:#c2c2c2;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li .layui-tab-close:hover{border-radius:2px;background-color:#FF5722;color:#fff}.layui-tab-brief>.layui-tab-title .layui-this{color:#009688}.layui-tab-brief>.layui-tab-more li.layui-this:after,.layui-tab-brief>.layui-tab-title .layui-this:after{border:none;border-radius:0;border-bottom:2px solid #5FB878}.layui-tab-brief[overflow]>.layui-tab-title .layui-this:after{top:-1px}.layui-tab-card{border-width:1px;border-style:solid;border-radius:2px;box-shadow:0 2px 5px 0 rgba(0,0,0,.1)}.layui-tab-card>.layui-tab-title{background-color:#FAFAFA}.layui-tab-card>.layui-tab-title li{margin-right:-1px;margin-left:-1px}.layui-tab-card>.layui-tab-title .layui-this{background-color:#fff}.layui-tab-card>.layui-tab-title .layui-this:after{border-top:none;border-width:1px;border-bottom-color:#fff}.layui-tab-card>.layui-tab-title .layui-tab-bar{height:40px;line-height:40px;border-radius:0;border-top:none;border-right:none}.layui-tab-card>.layui-tab-more .layui-this{background:0 0;color:#5FB878}.layui-tab-card>.layui-tab-more .layui-this:after{border:none}.layui-timeline{padding-left:5px}.layui-timeline-item{position:relative;padding-bottom:20px}.layui-timeline-axis{position:absolute;left:-5px;top:0;z-index:10;width:20px;height:20px;line-height:20px;background-color:#fff;color:#5FB878;border-radius:50%;text-align:center;cursor:pointer}.layui-timeline-axis:hover{color:#FF5722}.layui-timeline-item:before{content:"";position:absolute;left:5px;top:0;z-index:0;width:1px;height:100%}.layui-timeline-item:first-child:before{display:block}.layui-timeline-item:last-child:before{display:none}.layui-timeline-content{padding-left:25px}.layui-timeline-title{position:relative;margin-bottom:10px;line-height:22px}.layui-badge,.layui-badge-dot,.layui-badge-rim{position:relative;display:inline-block;padding:0 6px;font-size:12px;text-align:center;background-color:#FF5722;color:#fff;border-radius:2px}.layui-badge{height:18px;line-height:18px}.layui-badge-dot{width:8px;height:8px;padding:0;border-radius:50%}.layui-badge-rim{height:18px;line-height:18px;border-width:1px;border-style:solid;background-color:#fff;color:#666}.layui-btn .layui-badge,.layui-btn .layui-badge-dot{margin-left:5px}.layui-nav .layui-badge,.layui-nav .layui-badge-dot{position:absolute;top:50%;margin:-5px 6px 0}.layui-nav .layui-badge{margin-top:-10px}.layui-tab-title .layui-badge,.layui-tab-title .layui-badge-dot{left:5px;top:-2px}.layui-carousel{position:relative;left:0;top:0;background-color:#f8f8f8}.layui-carousel>[carousel-item]{position:relative;width:100%;height:100%;overflow:hidden}.layui-carousel>[carousel-item]:before{position:absolute;content:'\e63d';left:50%;top:50%;width:100px;line-height:20px;margin:-10px 0 0 -50px;text-align:center;color:#c2c2c2;font-family:layui-icon!important;font-size:30px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-carousel>[carousel-item]>*{display:none;position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f8f8f8;transition-duration:.3s;-webkit-transition-duration:.3s}.layui-carousel-updown>*{-webkit-transition:.3s ease-in-out up;transition:.3s ease-in-out up}.layui-carousel-arrow{display:none\9;opacity:0;position:absolute;left:10px;top:50%;margin-top:-18px;width:36px;height:36px;line-height:36px;text-align:center;font-size:20px;border:0;border-radius:50%;background-color:rgba(0,0,0,.2);color:#fff;-webkit-transition-duration:.3s;transition-duration:.3s;cursor:pointer}.layui-carousel-arrow[lay-type=add]{left:auto!important;right:10px}.layui-carousel:hover .layui-carousel-arrow[lay-type=add],.layui-carousel[lay-arrow=always] .layui-carousel-arrow[lay-type=add]{right:20px}.layui-carousel[lay-arrow=always] .layui-carousel-arrow{opacity:1;left:20px}.layui-carousel[lay-arrow=none] .layui-carousel-arrow{display:none}.layui-carousel-arrow:hover,.layui-carousel-ind ul:hover{background-color:rgba(0,0,0,.35)}.layui-carousel:hover .layui-carousel-arrow{display:block\9;opacity:1;left:20px}.layui-carousel-ind{position:relative;top:-35px;width:100%;line-height:0!important;text-align:center;font-size:0}.layui-carousel[lay-indicator=outside]{margin-bottom:30px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind{top:10px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind ul{background-color:rgba(0,0,0,.5)}.layui-carousel[lay-indicator=none] .layui-carousel-ind{display:none}.layui-carousel-ind ul{display:inline-block;padding:5px;background-color:rgba(0,0,0,.2);border-radius:10px;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li{display:inline-block;width:10px;height:10px;margin:0 3px;font-size:14px;background-color:#eee;background-color:rgba(255,255,255,.5);border-radius:50%;cursor:pointer;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li:hover{background-color:rgba(255,255,255,.7)}.layui-carousel-ind li.layui-this{background-color:#fff}.layui-carousel>[carousel-item]>.layui-carousel-next,.layui-carousel>[carousel-item]>.layui-carousel-prev,.layui-carousel>[carousel-item]>.layui-this{display:block}.layui-carousel>[carousel-item]>.layui-this{left:0}.layui-carousel>[carousel-item]>.layui-carousel-prev{left:-100%}.layui-carousel>[carousel-item]>.layui-carousel-next{left:100%}.layui-carousel>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel>[carousel-item]>.layui-carousel-prev.layui-carousel-right{left:0}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-left{left:-100%}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-right{left:100%}.layui-carousel[lay-anim=updown] .layui-carousel-arrow{left:50%!important;top:20px;margin:0 0 0 -18px}.layui-carousel[lay-anim=updown]>[carousel-item]>*,.layui-carousel[lay-anim=fade]>[carousel-item]>*{left:0!important}.layui-carousel[lay-anim=updown] .layui-carousel-arrow[lay-type=add]{top:auto!important;bottom:20px}.layui-carousel[lay-anim=updown] .layui-carousel-ind{position:absolute;top:50%;right:20px;width:auto;height:auto}.layui-carousel[lay-anim=updown] .layui-carousel-ind ul{padding:3px 5px}.layui-carousel[lay-anim=updown] .layui-carousel-ind li{display:block;margin:6px 0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next{top:100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev.layui-carousel-right{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this.layui-carousel-left{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this.layui-carousel-right{top:100%}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-next,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-prev{opacity:0}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-prev.layui-carousel-right{opacity:1}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-this.layui-carousel-left,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-this.layui-carousel-right{opacity:0}.layui-fixbar{position:fixed;right:15px;bottom:15px;z-index:999999}.layui-fixbar li{width:50px;height:50px;line-height:50px;margin-bottom:1px;text-align:center;cursor:pointer;font-size:30px;background-color:#9F9F9F;color:#fff;border-radius:2px;opacity:.95}.layui-fixbar li:hover{opacity:.85}.layui-fixbar li:active{opacity:1}.layui-fixbar .layui-fixbar-top{display:none;font-size:40px}body .layui-util-face{border:none;background:0 0}body .layui-util-face .layui-layer-content{padding:0;background-color:#fff;color:#666;box-shadow:none}.layui-util-face .layui-layer-TipsG{display:none}.layui-transfer-active,.layui-transfer-box{display:inline-block;vertical-align:middle}.layui-util-face ul{position:relative;width:372px;padding:10px;border:1px solid #D9D9D9;background-color:#fff;box-shadow:0 0 20px rgba(0,0,0,.2)}.layui-util-face ul li{cursor:pointer;float:left;border:1px solid #e8e8e8;height:22px;width:26px;overflow:hidden;margin:-1px 0 0 -1px;padding:4px 2px;text-align:center}.layui-util-face ul li:hover{position:relative;z-index:2;border:1px solid #eb7350;background:#fff9ec}.layui-code{position:relative;margin:10px 0;padding:15px;line-height:20px;border:1px solid #eee;border-left-width:6px;background-color:#FAFAFA;color:#333;font-family:Courier New;font-size:12px}.layui-transfer-box,.layui-transfer-header,.layui-transfer-search{border-width:0;border-style:solid;border-color:#eee}.layui-transfer-box{position:relative;border-width:1px;width:200px;height:360px;border-radius:2px;background-color:#fff}.layui-transfer-box .layui-form-checkbox{width:100%;margin:0!important}.layui-transfer-header{height:38px;line-height:38px;padding:0 10px;border-bottom-width:1px}.layui-transfer-search{position:relative;padding:10px;border-bottom-width:1px}.layui-transfer-search .layui-input{height:32px;padding-left:30px;font-size:12px}.layui-transfer-search .layui-icon-search{position:absolute;left:20px;top:50%;margin-top:-8px;color:#666}.layui-transfer-active{margin:0 15px}.layui-transfer-active .layui-btn{display:block;margin:0;padding:0 15px;background-color:#5FB878;border-color:#5FB878;color:#fff}.layui-transfer-active .layui-btn-disabled{background-color:#FBFBFB;border-color:#eee;color:#d2d2d2}.layui-transfer-active .layui-btn:first-child{margin-bottom:15px}.layui-transfer-active .layui-btn .layui-icon{margin:0;font-size:14px!important}.layui-transfer-data{padding:5px 0;overflow:auto}.layui-transfer-data li{height:32px;line-height:32px;padding:0 10px}.layui-transfer-data li:hover{background-color:#F6F6F6;transition:.5s all}.layui-transfer-data .layui-none{padding:15px 10px;text-align:center;color:#999}.layui-rate,.layui-rate *{display:inline-block;vertical-align:middle}.layui-rate{padding:10px 5px 10px 0;font-size:0}.layui-rate li i.layui-icon{font-size:20px;color:#FFB800;margin-right:5px;transition:all .3s;-webkit-transition:all .3s}.layui-rate li i:hover{cursor:pointer;transform:scale(1.12);-webkit-transform:scale(1.12)}.layui-rate[readonly] li i:hover{cursor:default;transform:scale(1)}.layui-colorpicker{width:26px;height:26px;border:1px solid #eee;padding:5px;border-radius:2px;line-height:24px;display:inline-block;cursor:pointer;transition:all .3s;-webkit-transition:all .3s}.layui-colorpicker:hover{border-color:#d2d2d2}.layui-colorpicker.layui-colorpicker-lg{width:34px;height:34px;line-height:32px}.layui-colorpicker.layui-colorpicker-sm{width:24px;height:24px;line-height:22px}.layui-colorpicker.layui-colorpicker-xs{width:22px;height:22px;line-height:20px}.layui-colorpicker-trigger-bgcolor{display:block;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);border-radius:2px}.layui-colorpicker-trigger-span{display:block;height:100%;box-sizing:border-box;border:1px solid rgba(0,0,0,.15);border-radius:2px;text-align:center}.layui-colorpicker-trigger-i{display:inline-block;color:#FFF;font-size:12px}.layui-colorpicker-trigger-i.layui-icon-close{color:#999}.layui-colorpicker-main{position:absolute;left:-999999px;top:-999999px;z-index:66666666;width:280px;margin:5px 0;padding:7px;background:#FFF;border:1px solid #d2d2d2;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.12)}.layui-colorpicker-main-wrapper{height:180px;position:relative}.layui-colorpicker-basis{width:260px;height:100%;position:relative}.layui-colorpicker-basis-white{width:100%;height:100%;position:absolute;top:0;left:0;background:linear-gradient(90deg,#FFF,hsla(0,0%,100%,0))}.layui-colorpicker-basis-black{width:100%;height:100%;position:absolute;top:0;left:0;background:linear-gradient(0deg,#000,transparent)}.layui-colorpicker-basis-cursor{width:10px;height:10px;border:1px solid #FFF;border-radius:50%;position:absolute;top:-3px;right:-3px;cursor:pointer}.layui-colorpicker-side{position:absolute;top:0;right:0;width:12px;height:100%;background:linear-gradient(red,#FF0,#0F0,#0FF,#00F,#F0F,red)}.layui-colorpicker-side-slider{width:100%;height:5px;box-shadow:0 0 1px #888;background:#FFF;border-radius:1px;border:1px solid #f0f0f0;cursor:pointer;position:absolute;left:0}.layui-colorpicker-main-alpha{display:none;height:12px;margin-top:7px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.layui-colorpicker-alpha-bgcolor{height:100%;position:relative}.layui-colorpicker-alpha-slider{width:5px;height:100%;box-shadow:0 0 1px #888;background:#FFF;border-radius:1px;border:1px solid #f0f0f0;cursor:pointer;position:absolute;top:0}.layui-colorpicker-main-pre{padding-top:7px;font-size:0}.layui-colorpicker-pre{width:20px;height:20px;border-radius:2px;display:inline-block;margin-left:6px;margin-bottom:7px;cursor:pointer}.layui-colorpicker-pre:nth-child(11n+1){margin-left:0}.layui-colorpicker-pre-isalpha{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.layui-colorpicker-pre.layui-this{box-shadow:0 0 3px 2px rgba(0,0,0,.15)}.layui-colorpicker-pre>div{height:100%;border-radius:2px}.layui-colorpicker-main-input{text-align:right;padding-top:7px}.layui-colorpicker-main-input .layui-btn-container .layui-btn{margin:0 0 0 10px}.layui-colorpicker-main-input div.layui-inline{float:left;margin-right:10px;font-size:14px}.layui-colorpicker-main-input input.layui-input{width:150px;height:30px;color:#666}.layui-slider{height:4px;background:#eee;border-radius:3px;position:relative;cursor:pointer}.layui-slider-bar{border-radius:3px;position:absolute;height:100%}.layui-slider-step{position:absolute;top:0;width:4px;height:4px;border-radius:50%;background:#FFF;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.layui-slider-wrap{width:36px;height:36px;position:absolute;top:-16px;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:10;text-align:center}.layui-slider-wrap-btn{width:12px;height:12px;border-radius:50%;background:#FFF;display:inline-block;vertical-align:middle;cursor:pointer;transition:.3s}.layui-slider-wrap:after{content:"";height:100%;display:inline-block;vertical-align:middle}.layui-slider-wrap-btn.layui-slider-hover,.layui-slider-wrap-btn:hover{transform:scale(1.2)}.layui-slider-wrap-btn.layui-disabled:hover{transform:scale(1)!important}.layui-slider-tips{position:absolute;top:-42px;z-index:66666666;white-space:nowrap;display:none;-webkit-transform:translateX(-50%);transform:translateX(-50%);color:#FFF;background:#000;border-radius:3px;height:25px;line-height:25px;padding:0 10px}.layui-slider-tips:after{content:"";position:absolute;bottom:-12px;left:50%;margin-left:-6px;width:0;height:0;border-width:6px;border-style:solid;border-color:#000 transparent transparent}.layui-slider-input{width:70px;height:32px;border:1px solid #eee;border-radius:3px;font-size:16px;line-height:32px;position:absolute;right:0;top:-14px}.layui-slider-input-btn{position:absolute;top:0;right:0;width:20px;height:100%;border-left:1px solid #eee}.layui-slider-input-btn i{cursor:pointer;position:absolute;right:0;bottom:0;width:20px;height:50%;font-size:12px;line-height:16px;text-align:center;color:#999}.layui-slider-input-btn i:first-child{top:0;border-bottom:1px solid #eee}.layui-slider-input-txt{height:100%;font-size:14px}.layui-slider-input-txt input{height:100%;border:none}.layui-slider-input-btn i:hover{color:#009688}.layui-slider-vertical{width:4px;margin-left:33px}.layui-slider-vertical .layui-slider-bar{width:4px}.layui-slider-vertical .layui-slider-step{top:auto;left:0;-webkit-transform:translateY(50%);transform:translateY(50%)}.layui-slider-vertical .layui-slider-wrap{top:auto;left:-16px;-webkit-transform:translateY(50%);transform:translateY(50%)}.layui-slider-vertical .layui-slider-tips{top:auto;left:2px}@media \0screen{.layui-slider-wrap-btn{margin-left:-20px}.layui-slider-vertical .layui-slider-wrap-btn{margin-left:0;margin-bottom:-20px}.layui-slider-vertical .layui-slider-tips{margin-left:-8px}.layui-slider>span{margin-left:8px}}.layui-tree{line-height:22px}.layui-tree .layui-form-checkbox{margin:0!important}.layui-tree-set{width:100%;position:relative}.layui-tree-pack{display:none;padding-left:20px;position:relative}.layui-tree-iconClick,.layui-tree-main{display:inline-block;vertical-align:middle}.layui-tree-line .layui-tree-pack{padding-left:27px}.layui-tree-line .layui-tree-set .layui-tree-set:after{content:"";position:absolute;top:14px;left:-9px;width:17px;height:0;border-top:1px dotted #c0c4cc}.layui-tree-entry{position:relative;padding:3px 0;height:20px;white-space:nowrap}.layui-tree-entry:hover{background-color:#eee}.layui-tree-line .layui-tree-entry:hover{background-color:rgba(0,0,0,0)}.layui-tree-line .layui-tree-entry:hover .layui-tree-txt{color:#999;text-decoration:underline;transition:.3s}.layui-tree-main{cursor:pointer;padding-right:10px}.layui-tree-line .layui-tree-set:before{content:"";position:absolute;top:0;left:-9px;width:0;height:100%;border-left:1px dotted #c0c4cc}.layui-tree-line .layui-tree-set.layui-tree-setLineShort:before{height:13px}.layui-tree-line .layui-tree-set.layui-tree-setHide:before{height:0}.layui-tree-iconClick{position:relative;height:20px;line-height:20px;margin:0 10px;color:#c0c4cc}.layui-tree-icon{height:12px;line-height:12px;width:12px;text-align:center;border:1px solid #c0c4cc}.layui-tree-iconClick .layui-icon{font-size:18px}.layui-tree-icon .layui-icon{font-size:12px;color:#666}.layui-tree-iconArrow{padding:0 5px}.layui-tree-iconArrow:after{content:"";position:absolute;left:4px;top:3px;z-index:100;width:0;height:0;border-width:5px;border-style:solid;border-color:transparent transparent transparent #c0c4cc;transition:.5s}.layui-tree-btnGroup,.layui-tree-editInput{position:relative;vertical-align:middle;display:inline-block}.layui-tree-spread>.layui-tree-entry>.layui-tree-iconClick>.layui-tree-iconArrow:after{transform:rotate(90deg) translate(3px,4px)}.layui-tree-txt{display:inline-block;vertical-align:middle;color:#555}.layui-tree-search{margin-bottom:15px;color:#666}.layui-tree-btnGroup .layui-icon{display:inline-block;vertical-align:middle;padding:0 2px;cursor:pointer}.layui-tree-btnGroup .layui-icon:hover{color:#999;transition:.3s}.layui-tree-entry:hover .layui-tree-btnGroup{visibility:visible}.layui-tree-editInput{height:20px;line-height:20px;padding:0 3px;border:none;background-color:rgba(0,0,0,.05)}.layui-tree-emptyText{text-align:center;color:#999}.layui-anim{-webkit-animation-duration:.3s;-webkit-animation-fill-mode:both;animation-duration:.3s;animation-fill-mode:both}.layui-anim.layui-icon{display:inline-block}.layui-anim-loop{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.layui-trans,.layui-trans a{transition:all .2s;-webkit-transition:all .2s}@-webkit-keyframes layui-rotate{from{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(360deg)}}@keyframes layui-rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}.layui-anim-rotate{-webkit-animation-name:layui-rotate;animation-name:layui-rotate;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes layui-up{from{-webkit-transform:translate3d(0,100%,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes layui-up{from{transform:translate3d(0,100%,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-anim-up{-webkit-animation-name:layui-up;animation-name:layui-up}@-webkit-keyframes layui-upbit{from{-webkit-transform:translate3d(0,15px,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes layui-upbit{from{transform:translate3d(0,15px,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-anim-upbit{-webkit-animation-name:layui-upbit;animation-name:layui-upbit}@keyframes layui-down{0%{opacity:.3;transform:translate3d(0,-100%,0)}100%{opacity:1;transform:translate3d(0,0,0)}}.layui-anim-down{animation-name:layui-down}@keyframes layui-downbit{0%{opacity:.3;transform:translate3d(0,-5px,0)}100%{opacity:1;transform:translate3d(0,0,0)}}.layui-anim-downbit{animation-name:layui-downbit}@-webkit-keyframes layui-scale{0%{opacity:.3;-webkit-transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1)}}@keyframes layui-scale{0%{opacity:.3;-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-ms-transform:scale(1);transform:scale(1)}}.layui-anim-scale{-webkit-animation-name:layui-scale;animation-name:layui-scale}@-webkit-keyframes layui-scale-spring{0%{opacity:.5;-webkit-transform:scale(.5)}80%{opacity:.8;-webkit-transform:scale(1.1)}100%{opacity:1;-webkit-transform:scale(1)}}@keyframes layui-scale-spring{0%{opacity:.5;transform:scale(.5)}80%{opacity:.8;transform:scale(1.1)}100%{opacity:1;transform:scale(1)}}.layui-anim-scaleSpring{-webkit-animation-name:layui-scale-spring;animation-name:layui-scale-spring}@keyframes layui-scalesmall{0%{opacity:.3;transform:scale(1.5)}100%{opacity:1;transform:scale(1)}}.layui-anim-scalesmall{animation-name:layui-scalesmall}@keyframes layui-scalesmall-spring{0%{opacity:.3;transform:scale(1.5)}80%{opacity:.8;transform:scale(.9)}100%{opacity:1;transform:scale(1)}}.layui-anim-scalesmall-spring{animation-name:layui-scalesmall-spring}@-webkit-keyframes layui-fadein{0%{opacity:0}100%{opacity:1}}@keyframes layui-fadein{0%{opacity:0}100%{opacity:1}}.layui-anim-fadein{-webkit-animation-name:layui-fadein;animation-name:layui-fadein}@-webkit-keyframes layui-fadeout{0%{opacity:1}100%{opacity:0}}@keyframes layui-fadeout{0%{opacity:1}100%{opacity:0}}.layui-anim-fadeout{-webkit-animation-name:layui-fadeout;animation-name:layui-fadeout} \ No newline at end of file diff --git a/static/component/layui/css/modules/code.css b/static/component/layui/css/modules/code.css new file mode 100644 index 000000000..0fee0c500 --- /dev/null +++ b/static/component/layui/css/modules/code.css @@ -0,0 +1 @@ +html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #eee;border-left-width:6px;background-color:#FAFAFA;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:40px;line-height:40px;border-bottom:1px solid #eee}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 10px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view .layui-code-ol li:first-child{padding-top:10px}.layui-code-view .layui-code-ol li:last-child{padding-bottom:10px}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}.layui-code-demo .layui-code{visibility:visible!important;margin:-15px;border-top:none;border-right:none;border-bottom:none}.layui-code-demo .layui-tab-content{padding:15px;border-top:none} \ No newline at end of file diff --git a/static/component/layui/css/modules/laydate/default/laydate.css b/static/component/layui/css/modules/laydate/default/laydate.css new file mode 100644 index 000000000..5fb5c99db --- /dev/null +++ b/static/component/layui/css/modules/laydate/default/laydate.css @@ -0,0 +1 @@ +.laydate-set-ym,.layui-laydate,.layui-laydate *,.layui-laydate-list{box-sizing:border-box}html #layuicss-laydate{display:none;position:absolute;width:1989px}.layui-laydate *{margin:0;padding:0}.layui-laydate{position:absolute;z-index:66666666;margin:5px 0;border-radius:2px;font-size:14px;-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;animation-name:laydate-downbit}.layui-laydate-main{width:272px}.layui-laydate-content td,.layui-laydate-header *,.layui-laydate-list li{transition-duration:.3s;-webkit-transition-duration:.3s}@keyframes laydate-downbit{0%{opacity:.3;transform:translate3d(0,-5px,0)}100%{opacity:1;transform:translate3d(0,0,0)}}.layui-laydate-static{position:relative;z-index:0;display:inline-block;margin:0;-webkit-animation:none;animation:none}.laydate-ym-show .laydate-next-m,.laydate-ym-show .laydate-prev-m{display:none!important}.laydate-ym-show .laydate-next-y,.laydate-ym-show .laydate-prev-y{display:inline-block!important}.laydate-time-show .laydate-set-ym span[lay-type=month],.laydate-time-show .laydate-set-ym span[lay-type=year],.laydate-time-show .layui-laydate-header .layui-icon,.laydate-ym-show .laydate-set-ym span[lay-type=month]{display:none!important}.layui-laydate-header{position:relative;line-height:30px;padding:10px 70px 5px}.layui-laydate-header *{display:inline-block;vertical-align:bottom}.layui-laydate-header i{position:absolute;top:10px;padding:0 5px;color:#999;font-size:18px;cursor:pointer}.layui-laydate-header i.laydate-prev-y{left:15px}.layui-laydate-header i.laydate-prev-m{left:45px}.layui-laydate-header i.laydate-next-y{right:15px}.layui-laydate-header i.laydate-next-m{right:45px}.laydate-set-ym{width:100%;text-align:center;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.laydate-set-ym span{padding:0 10px;cursor:pointer}.laydate-time-text{cursor:default!important}.layui-laydate-content{position:relative;padding:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-laydate-content table{border-collapse:collapse;border-spacing:0}.layui-laydate-content td,.layui-laydate-content th{width:36px;height:30px;padding:5px;text-align:center}.layui-laydate-content td{cursor:pointer}.laydate-day-mark{position:absolute;left:0;top:0;width:100%;line-height:30px;font-size:12px;overflow:hidden}.laydate-day-mark::after{position:absolute;content:'';right:2px;top:2px;width:5px;height:5px;border-radius:50%}.layui-laydate-footer{position:relative;height:46px;line-height:26px;padding:10px}.layui-laydate-footer span{display:inline-block;vertical-align:top;height:26px;line-height:24px;padding:0 10px;border:1px solid #C9C9C9;border-radius:2px;background-color:#fff;font-size:12px;cursor:pointer;white-space:nowrap;transition:all .3s}.layui-laydate-list>li,.layui-laydate-range .layui-laydate-main{display:inline-block;vertical-align:middle}.layui-laydate-footer span:hover{color:#5FB878}.laydate-footer-btns{position:absolute;right:10px;top:10px}.laydate-footer-btns span{margin:0 0 0 -1px}.layui-laydate-list{position:absolute;left:0;top:0;width:100%;height:100%;padding:10px;background-color:#fff}.layui-laydate-list>li{position:relative;width:33.3%;height:36px;line-height:36px;margin:3px 0;text-align:center;cursor:pointer}.laydate-month-list>li{width:25%;margin:17px 0}.laydate-time-list>li{height:100%;margin:0;line-height:normal;cursor:default}.laydate-time-list p{position:relative;top:-4px;line-height:29px}.laydate-time-list ol{height:181px;overflow:hidden}.laydate-time-list>li:hover ol{overflow-y:auto}.laydate-time-list ol li{width:130%;padding-left:33px;height:30px;line-height:30px;text-align:left;cursor:pointer}.layui-laydate-hint{position:absolute;top:115px;left:50%;width:250px;margin-left:-125px;line-height:20px;padding:15px;text-align:center;font-size:12px}.layui-laydate-range{width:546px}.layui-laydate-range .laydate-main-list-0 .laydate-next-m,.layui-laydate-range .laydate-main-list-0 .laydate-next-y,.layui-laydate-range .laydate-main-list-1 .laydate-prev-m,.layui-laydate-range .laydate-main-list-1 .laydate-prev-y{display:none}.layui-laydate-range .laydate-main-list-1 .layui-laydate-content{border-left:1px solid #e2e2e2}.layui-laydate,.layui-laydate-hint{border:1px solid #d2d2d2;box-shadow:0 2px 4px rgba(0,0,0,.12);background-color:#fff;color:#666}.layui-laydate-header{border-bottom:1px solid #e2e2e2}.layui-laydate-header i:hover,.layui-laydate-header span:hover{color:#5FB878}.layui-laydate-content{border-top:none 0;border-bottom:none 0}.layui-laydate-content th{font-weight:400;color:#333}.layui-laydate-content td{position:relative;color:#666}.layui-laydate-content td.laydate-now{color:#5FB878}.layui-laydate-content td.laydate-now:after{content:'';position:absolute;width:100%;height:30px;left:0;top:0;border:1px solid #5FB878;box-sizing:border-box}.layui-laydate-content td.laydate-selected{background-color:#E3F2E8}.laydate-selected:hover{background-color:#CDE7D6!important;color:#000}.layui-laydate-content td:hover,.layui-laydate-list li:hover{background-color:#eee;color:#333;border:none!important}.layui-laydate-content td.laydate-selected:after,.layui-laydate-content td:hover:after{border:none!important}.laydate-time-list li ol{margin:0;padding:0;border:1px solid #e2e2e2;border-left-width:0}.laydate-time-list li:first-child ol{border-left-width:1px}.laydate-time-list>li:hover{background:0 0}.layui-laydate-content .laydate-day-next,.layui-laydate-content .laydate-day-prev{color:#d2d2d2}.laydate-selected.laydate-day-next,.laydate-selected.laydate-day-prev{background:0 0!important}.layui-laydate-footer{border-top:1px solid #e2e2e2}.layui-laydate-hint{color:#FF5722}.laydate-day-mark::after{background-color:#5FB878}.layui-laydate-content td.layui-this .laydate-day-mark::after{display:none}.layui-laydate-footer span[lay-type=date]{color:#5FB878}.layui-laydate .layui-this{background-color:#5FB878!important;color:#fff!important}.layui-laydate .laydate-disabled,.layui-laydate .laydate-disabled:hover{background:0 0!important;color:#d2d2d2!important;cursor:not-allowed!important;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.laydate-theme-molv{border:none}.laydate-theme-molv.layui-laydate-range{width:548px}.laydate-theme-molv .layui-laydate-main{width:274px}.laydate-theme-molv .layui-laydate-header{border:none;background-color:#009688}.laydate-theme-molv .layui-laydate-header i,.laydate-theme-molv .layui-laydate-header span{color:#f6f6f6}.laydate-theme-molv .layui-laydate-header i:hover,.laydate-theme-molv .layui-laydate-header span:hover{color:#fff}.laydate-theme-molv .layui-laydate-content{border:1px solid #e2e2e2;border-top:none;border-bottom:none}.laydate-theme-molv .laydate-main-list-1 .layui-laydate-content{border-left:none}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li,.laydate-theme-grid .layui-laydate-content td,.laydate-theme-grid .layui-laydate-content thead,.laydate-theme-molv .layui-laydate-footer{border:1px solid #e2e2e2}.laydate-theme-grid .laydate-selected,.laydate-theme-grid .laydate-selected:hover{background-color:#f2f2f2!important;color:#009688!important}.laydate-theme-grid .laydate-selected.laydate-day-next,.laydate-theme-grid .laydate-selected.laydate-day-prev{color:#d2d2d2!important}.laydate-theme-grid .laydate-month-list,.laydate-theme-grid .laydate-year-list{margin:1px 0 0 1px}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li{margin:0 -1px -1px 0}.laydate-theme-grid .laydate-year-list>li{height:43px;line-height:43px}.laydate-theme-grid .laydate-month-list>li{height:71px;line-height:71px} \ No newline at end of file diff --git a/static/layui/css/modules/layer/default/icon-ext.png b/static/component/layui/css/modules/layer/default/icon-ext.png similarity index 100% rename from static/layui/css/modules/layer/default/icon-ext.png rename to static/component/layui/css/modules/layer/default/icon-ext.png diff --git a/static/layui/css/modules/layer/default/icon.png b/static/component/layui/css/modules/layer/default/icon.png similarity index 100% rename from static/layui/css/modules/layer/default/icon.png rename to static/component/layui/css/modules/layer/default/icon.png diff --git a/static/component/layui/css/modules/layer/default/layer.css b/static/component/layui/css/modules/layer/default/layer.css new file mode 100644 index 000000000..db51f3181 --- /dev/null +++ b/static/component/layui/css/modules/layer/default/layer.css @@ -0,0 +1 @@ +.layui-layer-imgbar,.layui-layer-imgtit a,.layui-layer-tab .layui-layer-title span,.layui-layer-title{text-overflow:ellipsis;white-space:nowrap}html #layuicss-layer{display:none;position:absolute;width:1989px}.layui-layer,.layui-layer-shade{position:fixed;_position:absolute;pointer-events:auto}.layui-layer-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px")}.layui-layer{-webkit-overflow-scrolling:touch;top:150px;left:0;margin:0;padding:0;background-color:#fff;-webkit-background-clip:content;border-radius:2px;box-shadow:1px 1px 50px rgba(0,0,0,.3)}.layui-layer-close{position:absolute}.layui-layer-content{position:relative}.layui-layer-border{border:1px solid #B2B2B2;border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 5px rgba(0,0,0,.2)}.layui-layer-load{background:url(loading-1.gif) center center no-repeat #eee}.layui-layer-ico{background:url(icon.png) no-repeat}.layui-layer-btn a,.layui-layer-dialog .layui-layer-ico,.layui-layer-setwin a{display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-move{display:none;position:fixed;*position:absolute;left:0;top:0;width:100%;height:100%;cursor:move;opacity:0;filter:alpha(opacity=0);background-color:#fff;z-index:2147483647}.layui-layer-resize{position:absolute;width:15px;height:15px;right:0;bottom:0;cursor:se-resize}.layer-anim{-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.3s;animation-duration:.3s}@-webkit-keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-00{-webkit-animation-name:layer-bounceIn;animation-name:layer-bounceIn}@-webkit-keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-01{-webkit-animation-name:layer-zoomInDown;animation-name:layer-zoomInDown}@-webkit-keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.layer-anim-02{-webkit-animation-name:layer-fadeInUpBig;animation-name:layer-fadeInUpBig}@-webkit-keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);-ms-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);-ms-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-03{-webkit-animation-name:layer-zoomInLeft;animation-name:layer-zoomInLeft}@-webkit-keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}@keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);-ms-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}.layer-anim-04{-webkit-animation-name:layer-rollIn;animation-name:layer-rollIn}@keyframes layer-fadeIn{0%{opacity:0}100%{opacity:1}}.layer-anim-05{-webkit-animation-name:layer-fadeIn;animation-name:layer-fadeIn}@-webkit-keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layer-anim-06{-webkit-animation-name:layer-shake;animation-name:layer-shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layui-layer-title{padding:0 80px 0 20px;height:50px;line-height:50px;border-bottom:1px solid #F0F0F0;font-size:14px;color:#333;overflow:hidden;border-radius:2px 2px 0 0}.layui-layer-setwin{position:absolute;right:15px;*right:0;top:17px;font-size:0;line-height:initial}.layui-layer-setwin a{position:relative;width:16px;height:16px;margin-left:10px;font-size:12px;_overflow:hidden}.layui-layer-setwin .layui-layer-min cite{position:absolute;width:14px;height:2px;left:0;top:50%;margin-top:-1px;background-color:#2E2D3C;cursor:pointer;_overflow:hidden}.layui-layer-setwin .layui-layer-min:hover cite{background-color:#2D93CA}.layui-layer-setwin .layui-layer-max{background-position:-32px -40px}.layui-layer-setwin .layui-layer-max:hover{background-position:-16px -40px}.layui-layer-setwin .layui-layer-maxmin{background-position:-65px -40px}.layui-layer-setwin .layui-layer-maxmin:hover{background-position:-49px -40px}.layui-layer-setwin .layui-layer-close1{background-position:1px -40px;cursor:pointer}.layui-layer-setwin .layui-layer-close1:hover{opacity:.7}.layui-layer-setwin .layui-layer-close2{position:absolute;right:-28px;top:-28px;width:30px;height:30px;margin-left:0;background-position:-149px -31px;*right:-18px;_display:none}.layui-layer-setwin .layui-layer-close2:hover{background-position:-180px -31px}.layui-layer-btn{text-align:right;padding:0 15px 12px;pointer-events:auto;user-select:none;-webkit-user-select:none}.layui-layer-btn a{height:28px;line-height:28px;margin:5px 5px 0;padding:0 15px;border:1px solid #dedede;background-color:#fff;color:#333;border-radius:2px;font-weight:400;cursor:pointer;text-decoration:none}.layui-layer-btn a:hover{opacity:.9;text-decoration:none}.layui-layer-btn a:active{opacity:.8}.layui-layer-btn .layui-layer-btn0{border-color:#1E9FFF;background-color:#1E9FFF;color:#fff}.layui-layer-btn-l{text-align:left}.layui-layer-btn-c{text-align:center}.layui-layer-dialog{min-width:300px}.layui-layer-dialog .layui-layer-content{position:relative;padding:20px;line-height:24px;word-break:break-all;overflow:hidden;font-size:14px;overflow-x:hidden;overflow-y:auto}.layui-layer-dialog .layui-layer-content .layui-layer-ico{position:absolute;top:16px;left:15px;_left:-40px;width:30px;height:30px}.layui-layer-ico1{background-position:-30px 0}.layui-layer-ico2{background-position:-60px 0}.layui-layer-ico3{background-position:-90px 0}.layui-layer-ico4{background-position:-120px 0}.layui-layer-ico5{background-position:-150px 0}.layui-layer-ico6{background-position:-180px 0}.layui-layer-rim{border:6px solid #8D8D8D;border:6px solid rgba(0,0,0,.3);border-radius:5px;box-shadow:none}.layui-layer-msg{min-width:180px;border:1px solid #D3D4D3;box-shadow:none}.layui-layer-hui{min-width:100px;background-color:#000;filter:alpha(opacity=60);background-color:rgba(0,0,0,.6);color:#fff;border:none}.layui-layer-hui .layui-layer-content{padding:12px 25px;text-align:center}.layui-layer-dialog .layui-layer-padding{padding:20px 20px 20px 55px;text-align:left}.layui-layer-page .layui-layer-content{position:relative;overflow:auto}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn{padding-top:10px}.layui-layer-nobg{background:0 0}.layui-layer-iframe iframe{display:block;width:100%}.layui-layer-loading{border-radius:100%;background:0 0;box-shadow:none;border:none}.layui-layer-loading .layui-layer-content{width:60px;height:24px;background:url(loading-0.gif) no-repeat}.layui-layer-loading .layui-layer-loading1{width:37px;height:37px;background:url(loading-1.gif) no-repeat}.layui-layer-ico16,.layui-layer-loading .layui-layer-loading2{width:32px;height:32px;background:url(loading-2.gif) no-repeat}.layui-layer-tips{background:0 0;box-shadow:none;border:none}.layui-layer-tips .layui-layer-content{position:relative;line-height:22px;min-width:12px;padding:8px 15px;font-size:12px;_float:left;border-radius:2px;box-shadow:1px 1px 3px rgba(0,0,0,.2);background-color:#000;color:#fff}.layui-layer-tips .layui-layer-close{right:-2px;top:-1px}.layui-layer-tips i.layui-layer-TipsG{position:absolute;width:0;height:0;border-width:8px;border-color:transparent;border-style:dashed;*overflow:hidden}.layui-layer-tips i.layui-layer-TipsB,.layui-layer-tips i.layui-layer-TipsT{left:5px;border-right-style:solid;border-right-color:#000}.layui-layer-tips i.layui-layer-TipsT{bottom:-8px}.layui-layer-tips i.layui-layer-TipsB{top:-8px}.layui-layer-tips i.layui-layer-TipsL,.layui-layer-tips i.layui-layer-TipsR{top:5px;border-bottom-style:solid;border-bottom-color:#000}.layui-layer-tips i.layui-layer-TipsR{left:-8px}.layui-layer-tips i.layui-layer-TipsL{right:-8px}.layui-layer-lan[type=dialog]{min-width:280px}.layui-layer-lan .layui-layer-title{background:#4476A7;color:#fff;border:none}.layui-layer-lan .layui-layer-btn{padding:5px 10px 10px;text-align:right;border-top:1px solid #E9E7E7}.layui-layer-lan .layui-layer-btn a{background:#fff;border-color:#E9E7E7;color:#333}.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#C9C5C5}.layui-layer-molv .layui-layer-title{background:#009f95;color:#fff;border:none}.layui-layer-molv .layui-layer-btn a{background:#009f95;border-color:#009f95}.layui-layer-molv .layui-layer-btn .layui-layer-btn1{background:#92B8B1}.layui-layer-iconext{background:url(icon-ext.png) no-repeat}.layui-layer-prompt .layui-layer-input{display:block;width:260px;height:36px;margin:0 auto;line-height:30px;padding-left:10px;border:1px solid #e6e6e6;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px;padding:6px 10px}.layui-layer-prompt .layui-layer-content{padding:20px}.layui-layer-prompt .layui-layer-btn{padding-top:0}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:300px;padding:0 20px;text-align:center;overflow:hidden;cursor:pointer}.layui-layer-tab .layui-layer-title span.layui-this{height:51px;border-left:1px solid #eee;border-right:1px solid #eee;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.layui-this{display:block}.layui-layer-photos{background:0 0;box-shadow:none}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imgnext,.layui-layer-imgprev{position:fixed;top:50%;width:27px;_width:44px;height:44px;margin-top:-22px;outline:0;blr:expression(this.onFocus=this.blur())}.layui-layer-imgprev{left:30px;background-position:-5px -5px;_background-position:-70px -5px}.layui-layer-imgprev:hover{background-position:-33px -5px;_background-position:-120px -5px}.layui-layer-imgnext{right:30px;_right:8px;background-position:-5px -50px;_background-position:-70px -50px}.layui-layer-imgnext:hover{background-position:-33px -50px;_background-position:-120px -50px}.layui-layer-imgbar{position:fixed;left:0;right:0;bottom:0;width:100%;height:40px;line-height:40px;background-color:#000\9;filter:Alpha(opacity=60);background-color:rgba(2,0,0,.35);color:#fff;overflow:hidden;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:12px}.layui-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{padding-left:10px;font-style:normal}@-webkit-keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-close{-webkit-animation-name:layer-bounceOut;animation-name:layer-bounceOut;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s}@media screen and (max-width:1100px){.layui-layer-iframe{overflow-y:auto;-webkit-overflow-scrolling:touch}} \ No newline at end of file diff --git a/static/layui/css/modules/layer/default/loading-0.gif b/static/component/layui/css/modules/layer/default/loading-0.gif similarity index 100% rename from static/layui/css/modules/layer/default/loading-0.gif rename to static/component/layui/css/modules/layer/default/loading-0.gif diff --git a/static/layui/css/modules/layer/default/loading-1.gif b/static/component/layui/css/modules/layer/default/loading-1.gif similarity index 100% rename from static/layui/css/modules/layer/default/loading-1.gif rename to static/component/layui/css/modules/layer/default/loading-1.gif diff --git a/static/layui/css/modules/layer/default/loading-2.gif b/static/component/layui/css/modules/layer/default/loading-2.gif similarity index 100% rename from static/layui/css/modules/layer/default/loading-2.gif rename to static/component/layui/css/modules/layer/default/loading-2.gif diff --git a/static/component/layui/font/iconfont.eot b/static/component/layui/font/iconfont.eot new file mode 100644 index 000000000..7bc337451 Binary files /dev/null and b/static/component/layui/font/iconfont.eot differ diff --git a/static/component/layui/font/iconfont.svg b/static/component/layui/font/iconfont.svg new file mode 100644 index 000000000..b64f79158 --- /dev/null +++ b/static/component/layui/font/iconfont.svg @@ -0,0 +1,387 @@ + + + + Created by iconfont + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/component/layui/font/iconfont.ttf b/static/component/layui/font/iconfont.ttf new file mode 100644 index 000000000..8661b19ee Binary files /dev/null and b/static/component/layui/font/iconfont.ttf differ diff --git a/static/component/layui/font/iconfont.woff b/static/component/layui/font/iconfont.woff new file mode 100644 index 000000000..2e9cd2a67 Binary files /dev/null and b/static/component/layui/font/iconfont.woff differ diff --git a/static/component/layui/font/iconfont.woff2 b/static/component/layui/font/iconfont.woff2 new file mode 100644 index 000000000..4adc7ce45 Binary files /dev/null and b/static/component/layui/font/iconfont.woff2 differ diff --git a/static/component/layui/layui.js b/static/component/layui/layui.js new file mode 100644 index 000000000..d57cc011d --- /dev/null +++ b/static/component/layui/layui.js @@ -0,0 +1,5 @@ +/*! 2.7.0-rc5 | MIT Licensed */;!function(t){"use strict";var e=t.document,n={modules:{},status:{},timeout:10,event:{}},r=function(){this.v="2.7.0-rc5"},o=t.LAYUI_GLOBAL||{},a=function(){var t=e.currentScript?e.currentScript.src:function(){for(var t,n=e.scripts,r=n.length-1,o=r;o>0;o--)if("interactive"===n[o].readyState){t=n[o].src;break}return t||n[r].src}();return n.dir=o.dir||t.substring(0,t.lastIndexOf("/")+1)}(),i=function(e,n){n=n||"log",t.console&&console[n]&&console[n]("layui error hint: "+e)},u="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),l=n.builtin={lay:"lay",layer:"layer",laydate:"laydate",laypage:"laypage",laytpl:"laytpl",layedit:"layedit",form:"form",upload:"upload",dropdown:"dropdown",icon:"icon",keyboard:"keyboard",transfer:"transfer",tree:"tree",table:"table",element:"element",rate:"rate",colorpicker:"colorpicker",slider:"slider",carousel:"carousel",flow:"flow",util:"util",code:"code",jquery:"jquery",component:"component",all:"all","layui.all":"layui.all"};r.prototype.cache=n,r.prototype.define=function(t,e){var r=this,o="function"==typeof t,a=function(){var t=function(t,e){layui[t]=e,n.status[t]=!0};return"function"==typeof e&&e(function(r,o){t(r,o),n.callback[r]=function(){e(t)}}),this};return o&&(e=t,t=[]),r.use(t,a,null,"define"),r},r.prototype.use=function(r,o,c,s){function p(t,e){var r="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===t.type||r.test((t.currentTarget||t.srcElement).readyState))&&(n.modules[h]=e,v.removeChild(b),function o(){return++m>1e3*n.timeout/4?i(h+" is not a valid module","error"):void(n.status[h]?f():setTimeout(o,4))}())}function f(){c.push(layui[h]),r.length>1?y.use(r.slice(1),o,c,s):"function"==typeof o&&function(){return layui.jquery&&"function"==typeof layui.jquery&&"define"!==s?layui.jquery(function(){o.apply(layui,c)}):void o.apply(layui,c)}()}var y=this,d=n.dir=n.dir?n.dir:a,v=e.getElementsByTagName("head")[0];r=function(){return"string"==typeof r?[r]:"function"==typeof r?(o=r,["all"]):r}(),t.jQuery&&jQuery.fn.on&&(y.each(r,function(t,e){"jquery"===e&&r.splice(t,1)}),layui.jquery=layui.$=jQuery);var h=r[0],m=0;if(c=c||[],n.host=n.host||(d.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===r.length||layui["layui.all"]&&l[h])return f(),y;var g=(l[h]?d+"modules/":/^\{\/\}/.test(y.modules[h])?"":n.base||"")+(y.modules[h]||h)+".js";if(g=g.replace(/^\{\/\}/,""),!n.modules[h]&&layui[h]&&(n.modules[h]=g),n.modules[h])!function S(){return++m>1e3*n.timeout/4?i(h+" is not a valid module","error"):void("string"==typeof n.modules[h]&&n.status[h]?f():setTimeout(S,4))}();else{var b=e.createElement("script");b.async=!0,b.charset="utf-8",b.src=g+function(){var t=n.version===!0?n.v||(new Date).getTime():n.version||"";return t?"?v="+t:""}(),v.appendChild(b),!b.attachEvent||b.attachEvent.toString&&b.attachEvent.toString().indexOf("[native code")<0||u?b.addEventListener("load",function(t){p(t,g)},!1):b.attachEvent("onreadystatechange",function(t){p(t,g)}),n.modules[h]=g}return y},r.prototype.getStyle=function(e,n){var r=e.currentStyle?e.currentStyle:t.getComputedStyle(e,null);return r[r.getPropertyValue?"getPropertyValue":"getAttribute"](n)},r.prototype.link=function(t,r,o){var a=this,u=e.getElementsByTagName("head")[0],l=e.createElement("link");"string"==typeof r&&(o=r);var c=(o||t).replace(/\.|\//g,""),s=l.id="layuicss-"+c,p="creating",f=0;return l.rel="stylesheet",l.href=t+(n.debug?"?v="+(new Date).getTime():""),l.media="all",e.getElementById(s)||u.appendChild(l),"function"!=typeof r?a:(function y(o){var u=100,l=e.getElementById(s);return++f>1e3*n.timeout/u?i(t+" timeout"):void(1989===parseInt(a.getStyle(l,"width"))?(o===p&&l.removeAttribute("lay-status"),l.getAttribute("lay-status")===p?setTimeout(y,u):r()):(l.setAttribute("lay-status",p),setTimeout(function(){y(p)},u)))}(),a)},r.prototype.addcss=function(t,e,r){return layui.link(n.dir+"css/"+t,e,r)},n.callback={},r.prototype.factory=function(t){if(layui[t])return"function"==typeof n.callback[t]?n.callback[t]:null},r.prototype.img=function(t,e,n){var r=new Image;return r.src=t,r.complete?e(r):(r.onload=function(){r.onload=null,"function"==typeof e&&e(r)},void(r.onerror=function(t){r.onerror=null,"function"==typeof n&&n(t)}))},r.prototype.config=function(t){t=t||{};for(var e in t)n[e]=t[e];return this},r.prototype.modules=function(){var t={};for(var e in l)t[e]=l[e];return t}(),r.prototype.extend=function(t){var e=this;t=t||{};for(var n in t)e[n]||e.modules[n]?i(n+" Module already exists","error"):e.modules[n]=t[n];return e},r.prototype.router=function(t){var e=this,t=t||location.hash,n={path:[],search:{},hash:(t.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(t)?(t=t.replace(/^#\//,""),n.href="/"+t,t=t.replace(/([^#])(#.*$)/,"$1").split("/")||[],e.each(t,function(t,e){/^\w+=/.test(e)?function(){e=e.split("="),n.search[e[0]]=e[1]}():n.path.push(e)}),n):n},r.prototype.url=function(t){var e=this,n={pathname:function(){var e=t?function(){var e=(t.match(/\.[^.]+?\/.+/)||[])[0]||"";return e.replace(/^[^\/]+/,"").replace(/\?.+/,"")}():location.pathname;return e.replace(/^\//,"").split("/")}(),search:function(){var n={},r=(t?function(){var e=(t.match(/\?.+/)||[])[0]||"";return e.replace(/\#.+/,"")}():location.search).replace(/^\?+/,"").split("&");return e.each(r,function(t,e){var r=e.indexOf("="),o=function(){return r<0?e.substr(0,e.length):0!==r&&e.substr(0,r)}();o&&(n[o]=r>0?e.substr(r+1):null)}),n}(),hash:e.router(function(){return t?(t.match(/#.+/)||[])[0]||"/":location.hash}())};return n},r.prototype.data=function(e,n,r){if(e=e||"layui",r=r||localStorage,t.JSON&&t.JSON.parse){if(null===n)return delete r[e];n="object"==typeof n?n:{key:n};try{var o=JSON.parse(r[e])}catch(a){var o={}}return"value"in n&&(o[n.key]=n.value),n.remove&&delete o[n.key],r[e]=JSON.stringify(o),n.key?o[n.key]:o}},r.prototype.sessionData=function(t,e){return this.data(t,e,sessionStorage)},r.prototype.device=function(e){var n=navigator.userAgent.toLowerCase(),r=function(t){var e=new RegExp(t+"/([^\\s\\_\\-]+)");return t=(n.match(e)||[])[1],t||!1},o={os:function(){return/windows/.test(n)?"windows":/linux/.test(n)?"linux":/iphone|ipod|ipad|ios/.test(n)?"ios":/mac/.test(n)?"mac":void 0}(),ie:function(){return!!(t.ActiveXObject||"ActiveXObject"in t)&&((n.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:r("micromessenger")};return e&&!o[e]&&(o[e]=r(e)),o.android=/android/.test(n),o.ios="ios"===o.os,o.mobile=!(!o.android&&!o.ios),o},r.prototype.hint=function(){return{error:i}},r.prototype._typeof=function(t){return null===t?String(t):"object"==typeof t||"function"==typeof t?function(){var e=Object.prototype.toString.call(t).match(/\s(.+)\]$/)||[],n="Function|Array|Date|RegExp|Object|Error|Symbol";return e=e[1]||"Object",new RegExp("\\b("+n+")\\b").test(e)?e.toLowerCase():"object"}():typeof t},r.prototype._isArray=function(e){var n,r=this,o=r._typeof(e);return!(!e||"object"!=typeof e||e===t)&&(n="length"in e&&e.length,"array"===o||0===n||"number"==typeof n&&n>0&&n-1 in e)},r.prototype.each=function(t,e){var n,r=this,o=function(t,n){return e.call(n[t],t,n[t])};if("function"!=typeof e)return r;if(t=t||[],r._isArray(t))for(n=0;no?1:r(t.innerHeight||n.documentElement.clientHeight)},r.style=function(t){t=t||{};var e=r.elem("style"),n=t.text||"",o=t.target||r("body")[0];if(n){"styleSheet"in e?(e.setAttribute("type","text/css"),e.styleSheet.cssText=n):e.innerHTML=n,r.style.index=r.style.index||0,r.style.index++;var i=e.id="LAY-STYLE-"+(t.id||"DF-"+r.style.index),c=r(o).find("#"+i);c[0]&&c.remove(),r(o).append(e)}},r.position=function(e,o,i){if(o){i=i||{},e!==n&&e!==r("body")[0]||(i.clickType="right");var c="right"===i.clickType?function(){var e=i.e||t.event||{};return{left:e.clientX,top:e.clientY,right:e.clientX,bottom:e.clientY}}():e.getBoundingClientRect(),u=o.offsetWidth,a=o.offsetHeight,s=function(t){return t=t?"scrollLeft":"scrollTop",n.body[t]|n.documentElement[t]},l=function(t){return n.documentElement[t?"clientWidth":"clientHeight"]},f=5,h=c.left,p=c.bottom;"center"===i.align?h-=(u-e.offsetWidth)/2:"right"===i.align&&(h=h-u+e.offsetWidth),h+u+f>l("width")&&(h=l("width")-u-f),hl()&&(c.top>a+f?p=c.top-a-2*f:"right"===i.clickType&&(p=l()-a-2*f,p<0&&(p=0)));var y=i.position;if(y&&(o.style.position=y),o.style.left=h+("fixed"===y?0:s(1))+"px",o.style.top=p+("fixed"===y?0:s())+"px",!r.hasScrollbar()){var d=o.getBoundingClientRect();!i.SYSTEM_RELOAD&&d.bottom+f>l()&&(i.SYSTEM_RELOAD=!0,setTimeout(function(){r.position(e,o,i)},50))}}},r.options=function(t,e){var n=r(t),o=e||"lay-options";try{return new Function("return "+(n.attr(o)||"{}"))()}catch(c){return i.error("parseerror\uff1a"+c,"error"),{}}},r.isTopElem=function(t){var e=[n,r("body")[0]],o=!1;return r.each(e,function(e,n){if(n===t)return o=!0}),o},o.addStr=function(t,e){return t=t.replace(/\s+/," "),e=e.replace(/\s+/," ").split(" "),r.each(e,function(e,n){new RegExp("\\b"+n+"\\b").test(t)||(t=t+" "+n)}),t.replace(/^\s|\s$/,"")},o.removeStr=function(t,e){return t=t.replace(/\s+/," "),e=e.replace(/\s+/," ").split(" "),r.each(e,function(e,n){var r=new RegExp("\\b"+n+"\\b");r.test(t)&&(t=t.replace(r,""))}),t.replace(/\s+/," ").replace(/^\s|\s$/,"")},o.prototype.find=function(t){var e=this,n=0,o=[],i="object"==typeof t;return this.each(function(r,c){for(var u=i?c.contains(t):c.querySelectorAll(t||null);n0)return n[0].style[t]}():n.each(function(n,i){"object"==typeof t?r.each(t,function(t,e){i.style[t]=o(e)}):i.style[t]=o(e)})},o.prototype.width=function(t){var e=this;return void 0===t?function(){if(e.length>0)return e[0].offsetWidth}():e.each(function(n,r){e.css("width",t)})},o.prototype.height=function(t){var e=this;return void 0===t?function(){if(e.length>0)return e[0].offsetHeight}():e.each(function(n,r){e.css("height",t)})},o.prototype.attr=function(t,e){var n=this;return void 0===e?function(){if(n.length>0)return n[0].getAttribute(t)}():n.each(function(n,r){r.setAttribute(t,e)})},o.prototype.removeAttr=function(t){return this.each(function(e,n){n.removeAttribute(t)})},o.prototype.html=function(t){var e=this;return void 0===t?function(){if(e.length>0)return e[0].innerHTML}():this.each(function(e,n){n.innerHTML=t})},o.prototype.val=function(t){var e=this;return void 0===t?function(){if(e.length>0)return e[0].value}():this.each(function(e,n){n.value=t})},o.prototype.insertVal=function(t){var e=this;return t?e.each(function(e,n){var o=n.value,i="string"==typeof r(n).attr("readonly");if("number"!=typeof n.selectionStart||i)n.value="",n.focus(),n.value=o+t;else{var c=n.selectionStart,u=n.selectionEnd,a=[o.substring(0,c),t,o.substr(u)];n.value=a.join(""),n.focus(),n.selectionStart=c+t.length,n.selectionEnd=c+t.length}}):e},o.prototype.deleteVal=function(){var t=this;return t.each(function(t,e){var n=e.value,o="string"==typeof r(e).attr("readonly");if("number"!=typeof e.selectionStart||o)e.value="",e.focus(),e.value=n.replace(/[\s\S]{1}$/,"");else{var i=e.selectionStart,c=e.selectionEnd,u=i-(i==c?1:0),a=[n.substring(0,u),n.substr(c)];e.value=a.join(""),e.focus(),e.selectionStart=u,e.selectionEnd=u}})},o.prototype.append=function(t){return this.each(function(e,n){"object"==typeof t?n.appendChild(t):n.innerHTML=n.innerHTML+t})},o.prototype.remove=function(t){return this.each(function(e,n){t?n.removeChild(t):n.parentNode.removeChild(n)})},o.prototype.on=function(t,e){return this.each(function(n,r){r.attachEvent?r.attachEvent("on"+t,function(t){t.target=t.srcElement,e.call(r,t)}):r.addEventListener(t,e,!1)})},o.prototype.off=function(t,e){return this.each(function(n,r){r.detachEvent?r.detachEvent("on"+t,e):r.removeEventListener(t,e,!1)})},t.lay=r,t.layui&&layui.define&&layui.define(function(t){t(e,r)})}(window,window.document);layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error: ";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\(.)/g,"$1")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\(.)/g,"$1")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)});layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",r="laypage",i="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.parse=a.parse||{},a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,r={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var r=Math.floor((t-1)/2),i=n>1?a.curr-r:1,u=n>1?function(){var e=a.curr+(t-r-1);return e>a.pages?a.pages:e}():t;for(u-i2&&e.push('');i<=u;i++)i===a.curr?e.push('"+("function"==typeof a.parse.curr?a.parse.curr(i,a):i)+""):e.push(''+i+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:''+("function"==typeof a.parse.count?a.parse.count(a.count,a):"\u5171 "+a.count+" \u6761")+"",limit:function(){var e=['"}(),refresh:['','',""].join(""),skip:function(){return['到第','','页',""].join("")}()};return['
    ',function(){var e=[];return layui.each(a.layout,function(a,t){r[t]&&e.push(r[t])}),e.join("")}(),"
    "].join("")},u.prototype.jump=function(e,a){if(e){var t=this,r=t.config,i=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(r.curr=e,t.render())};if(a)return c();for(var o=0,y=i.length;or.pages||(r.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;r.curr*e>r.count&&(r.curr=Math.ceil(r.count/e)),r.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,r=t.keyCode;/^(37|38|39|40)$/.test(r)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===r&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,r=n.config,i=n.type(),u=n.view(),s=null;2===i?(s=r.elem,r.elem&&(s.innerHTML=u)):3===i?(s=r.elem[0],r.elem.html(u)):a[t](r.elem)&&(s=a[t](r.elem),s.innerHTML=u),r.jump&&r.jump(r,e);var l=s&&s.querySelector(".layui-laypage");l=l||a[t]("layui-laypage-"+r.index),n.jump(l),r.hash&&!e&&(location.hash="!"+r.hash+"="+r.curr),n.skip(l)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(r,s)});!function(e,t){"use strict";var a=e.layui&&layui.define,n={getPath:e.lay&&lay.getPath?lay.getPath:"",link:function(t,a,n){l.path&&e.lay&&lay.layui&&lay.layui.link(l.path+t,a,n)}},i=e.LAYUI_GLOBAL||{},l={v:"5.3.1",config:{},index:e.laydate&&e.laydate.v?1e5:0,path:i.laydate_dir||n.getPath,set:function(e){var t=this;return t.config=lay.extend({},t.config,e),t},ready:function(e){var t="laydate",i="",r=(a?"modules/laydate/":"theme/")+"default/laydate.css?v="+l.v+i;return a?layui.addcss(r,e,t):n.link(r,e,t),this}},r=function(){var e=this,t=e.config,a=t.id;return r.that[a]=e,{hint:function(t){e.hint.call(e,t)},config:e.config}},s="laydate",o=".layui-laydate",y="layui-this",d="laydate-disabled",m=[100,2e5],c="layui-laydate-static",u="layui-laydate-list",h="laydate-now",f="laydate-selected",p="layui-laydate-hint",g="laydate-day-prev",v="laydate-day-next",D="layui-laydate-footer",T=".laydate-btns-confirm",w="laydate-time-text",x="laydate-btns-time",C=function(e){var t=this;t.index=++l.index,t.config=lay.extend({},t.config,l.config,e),e=t.config,e.id="id"in e?e.id:t.index,l.ready(function(){t.init()})},M="yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s";r.formatArr=function(e){return(e||"").match(new RegExp(M+"|.","g"))||[]},C.isLeapYear=function(e){return e%4===0&&e%100!==0||e%400===0},C.prototype.config={type:"date",range:!1,format:"yyyy-MM-dd",value:null,isInitValue:!0,min:"1900-1-1",max:"2099-12-31",trigger:"click",show:!1,showBottom:!0,isPreview:!0,btns:["clear","now","confirm"],lang:"cn",theme:"default",position:null,calendar:!1,mark:{},zIndex:null,done:null,change:null},C.prototype.lang=function(){var e=this,t=e.config,a={cn:{weeks:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],time:["\u65f6","\u5206","\u79d2"],timeTips:"\u9009\u62e9\u65f6\u95f4",startTime:"\u5f00\u59cb\u65f6\u95f4",endTime:"\u7ed3\u675f\u65f6\u95f4",dateTips:"\u8fd4\u56de\u65e5\u671f",month:["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"],tools:{confirm:"\u786e\u5b9a",clear:"\u6e05\u7a7a",now:"\u73b0\u5728"},timeout:"\u7ed3\u675f\u65f6\u95f4\u4e0d\u80fd\u65e9\u4e8e\u5f00\u59cb\u65f6\u95f4
    \u8bf7\u91cd\u65b0\u9009\u62e9",invalidDate:"\u4e0d\u5728\u6709\u6548\u65e5\u671f\u6216\u65f6\u95f4\u8303\u56f4\u5185",formatError:["\u65e5\u671f\u683c\u5f0f\u4e0d\u5408\u6cd5
    \u5fc5\u987b\u9075\u5faa\u4e0b\u8ff0\u683c\u5f0f\uff1a
    ","
    \u5df2\u4e3a\u4f60\u91cd\u7f6e"]},en:{weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],time:["Hours","Minutes","Seconds"],timeTips:"Select Time",startTime:"Start Time",endTime:"End Time",dateTips:"Select Date",month:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tools:{confirm:"Confirm",clear:"Clear",now:"Now"},timeout:"End time cannot be less than start Time
    Please re-select",invalidDate:"Invalid date",formatError:["The date format error
    Must be followed\uff1a
    ","
    It has been reset"]}};return a[t.lang]||a.cn},C.prototype.init=function(){var t=this,a=t.config,n="static"===a.position,i={year:"yyyy",month:"yyyy-MM",date:"yyyy-MM-dd",time:"HH:mm:ss",datetime:"yyyy-MM-dd HH:mm:ss"};a.elem=lay(a.elem),a.eventElem=lay(a.eventElem),a.elem[0]&&(t.rangeStr=a.range?"string"==typeof a.range?a.range:"-":"","array"===layui._typeof(a.range)&&(t.rangeElem=[lay(a.range[0]),lay(a.range[1])]),i[a.type]||(e.console&&console.error&&console.error("laydate type error:'"+a.type+"' is not supported"),a.type="date"),a.format===i.date&&(a.format=i[a.type]||i.date),t.format=r.formatArr(a.format),t.EXP_IF="",t.EXP_SPLIT="",lay.each(t.format,function(e,a){var n=new RegExp(M).test(a)?"\\d{"+function(){return new RegExp(M).test(t.format[0===e?e+1:e-1]||"")?/^yyyy|y$/.test(a)?4:a.length:/^yyyy$/.test(a)?"1,4":/^y$/.test(a)?"1,308":"1,2"}()+"}":"\\"+a;t.EXP_IF=t.EXP_IF+n,t.EXP_SPLIT=t.EXP_SPLIT+"("+n+")"}),t.EXP_IF_ONE=new RegExp("^"+t.EXP_IF+"$"),t.EXP_IF=new RegExp("^"+(a.range?t.EXP_IF+"\\s\\"+t.rangeStr+"\\s"+t.EXP_IF:t.EXP_IF)+"$"),t.EXP_SPLIT=new RegExp("^"+t.EXP_SPLIT+"$",""),t.isInput(a.elem[0])||"focus"===a.trigger&&(a.trigger="click"),a.elem.attr("lay-key")||(a.elem.attr("lay-key",t.index),a.eventElem.attr("lay-key",t.index)),a.mark=lay.extend({},a.calendar&&"cn"===a.lang?{"0-1-1":"\u5143\u65e6","0-2-14":"\u60c5\u4eba","0-3-8":"\u5987\u5973","0-3-12":"\u690d\u6811","0-4-1":"\u611a\u4eba","0-5-1":"\u52b3\u52a8","0-5-4":"\u9752\u5e74","0-6-1":"\u513f\u7ae5","0-9-10":"\u6559\u5e08","0-9-18":"\u56fd\u803b","0-10-1":"\u56fd\u5e86","0-12-25":"\u5723\u8bde"}:{},a.mark),lay.each(["min","max"],function(e,t){var n=[],i=[];if("number"==typeof a[t]){var l=a[t],r=(new Date).getTime(),s=864e5,o=new Date(l?l0)return!0;var t=lay.elem("div",{"class":"layui-laydate-header"}),i=[function(){var e=lay.elem("i",{"class":"layui-icon laydate-icon laydate-prev-y"});return e.innerHTML="",e}(),function(){var e=lay.elem("i",{"class":"layui-icon laydate-icon laydate-prev-m"});return e.innerHTML="",e}(),function(){var e=lay.elem("div",{"class":"laydate-set-ym"}),t=lay.elem("span"),a=lay.elem("span");return e.appendChild(t),e.appendChild(a),e}(),function(){var e=lay.elem("i",{"class":"layui-icon laydate-icon laydate-next-m"});return e.innerHTML="",e}(),function(){var e=lay.elem("i",{"class":"layui-icon laydate-icon laydate-next-y"});return e.innerHTML="",e}()],l=lay.elem("div",{"class":"layui-laydate-content"}),r=lay.elem("table"),m=lay.elem("thead"),c=lay.elem("tr");lay.each(i,function(e,a){t.appendChild(a)}),m.appendChild(c),lay.each(new Array(6),function(e){var t=r.insertRow(0);lay.each(new Array(7),function(a){if(0===e){var i=lay.elem("th");i.innerHTML=n.weeks[a],c.appendChild(i)}t.insertCell(a)})}),r.insertBefore(m,r.children[0]),l.appendChild(r),s[e]=lay.elem("div",{"class":"layui-laydate-main laydate-main-list-"+e}),s[e].appendChild(t),s[e].appendChild(l),o.push(i),y.push(l),d.push(r)}),lay(m).html(function(){var e=[],t=[];return"datetime"===a.type&&e.push(''+n.timeTips+""),lay.each(a.btns,function(e,l){var r=n.tools[l]||"btn";a.range&&"now"===l||(i&&"clear"===l&&(r="cn"===a.lang?"\u91cd\u7f6e":"Reset"),t.push(''+r+""))}),e.push('"),e.join("")}()),lay.each(s,function(e,t){r.appendChild(t)}),a.showBottom&&r.appendChild(m),/^#/.test(a.theme)){var u=lay.elem("style"),h=["#{{id}} .layui-laydate-header{background-color:{{theme}};}","#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g,e.elemID).replace(/{{theme}}/g,a.theme);"styleSheet"in u?(u.setAttribute("type","text/css"),u.styleSheet.cssText=h):u.innerHTML=h,lay(r).addClass("laydate-theme-molv"),r.appendChild(u)}l.thisId=a.id,e.remove(C.thisElemDate),i?a.elem.append(r):(t.body.appendChild(r),e.position()),e.checkDate().calendar(),e.changeEvent(),C.thisElemDate=e.elemID,"function"==typeof a.ready&&a.ready(lay.extend({},a.dateTime,{month:a.dateTime.month+1}))},C.prototype.remove=function(e){var t=this,a=(t.config,lay("#"+(e||t.elemID)));return a[0]?(a.hasClass(c)||t.checkDate(function(){a.remove()}),t):t},C.prototype.position=function(){var e=this,t=e.config;return lay.position(e.bindElem||t.elem[0],e.elem,{position:t.position}),e},C.prototype.hint=function(e){var t=this,a=(t.config,lay.elem("div",{"class":p}));t.elem&&(a.innerHTML=e||"",lay(t.elem).find("."+p).remove(),t.elem.appendChild(a),clearTimeout(t.hinTimer),t.hinTimer=setTimeout(function(){lay(t.elem).find("."+p).remove()},3e3))},C.prototype.getAsYM=function(e,t,a){return a?t--:t++,t<0&&(t=11,e--),t>11&&(t=0,e++),[e,t]},C.prototype.systemDate=function(e){var t=e||new Date;return{year:t.getFullYear(),month:t.getMonth(),date:t.getDate(),hours:e?e.getHours():0,minutes:e?e.getMinutes():0,seconds:e?e.getSeconds():0}},C.prototype.checkDate=function(e){var t,a,n=this,i=(new Date,n.config),r=n.lang(),s=i.dateTime=i.dateTime||n.systemDate(),o=n.bindElem||i.elem[0],y=(n.isInput(o)?"val":"html",function(){if(n.rangeElem){var e=[n.rangeElem[0].val(),n.rangeElem[1].val()];if(e[0]&&e[1])return e.join(" "+n.rangeStr+" ")}return n.isInput(o)?o.value:"static"===i.position?"":lay(o).attr("lay-date")}()),d=function(e){return e?(e.year>m[1]&&(e.year=m[1],a=!0),e.month>11&&(e.month=11,a=!0),e.hours>23&&(e.hours=0,a=!0),e.minutes>59&&(e.minutes=0,e.hours++,a=!0),e.seconds>59&&(e.seconds=0,e.minutes++,a=!0),t=l.getEndDate(e.month+1,e.year),void(e.date>t&&(e.date=t,a=!0))):a=!0},c=function(e,t,l){var r=["startTime","endTime"];t=(t.match(n.EXP_SPLIT)||[]).slice(1),l=l||0,i.range&&(n[r[l]]=n[r[l]]||{}),lay.each(n.format,function(s,o){var y=parseFloat(t[s]);t[s].lengthu(i.max)||u(s)'+a+""),n},C.prototype.limit=function(e,t,a,n){var i,l=this,r=l.config,s={},o=r[a>41?"endDate":"dateTime"],y=lay.extend({},o,t||{});return lay.each({now:y,min:r.min,max:r.max},function(e,t){s[e]=l.newDate(lay.extend({year:t.year,month:t.month,date:t.date},function(){var e={};return lay.each(n,function(a,n){e[n]=t[n]}),e}())).getTime()}),i=s.nows.max,e&&e[i?"addClass":"removeClass"](d),i},C.prototype.calendar=function(e,t){var a,n,i,r=this,s=r.config,o=e?1:0,d=e||s.dateTime,c=new Date,u=r.lang(),h="date"!==s.type&&"datetime"!==s.type,f=lay(r.table[o]).find("td"),p=lay(r.elemHeader[o][2]).find("span");if(d.yearm[1]&&(d.year=m[1],r.hint(u.invalidDate)),r.firstDate||(r.firstDate=lay.extend({},d)),c.setFullYear(d.year,d.month,1),a=c.getDay(),n=l.getEndDate(d.month||12,d.year),i=l.getEndDate(d.month+1,d.year),lay.each(f,function(e,t){var l=[d.year,d.month],o=0;t=lay(t),t.removeAttr("class"),e=a&&e=a.firstDate.year&&(l.month=n.max.month,l.date=n.max.date),a.limit(lay(i),l,t),C++}),lay(m[f?0:1]).attr("lay-ym",C-8+"-"+g[1]).html(M+p+" - "+(C-1+p))}else if("month"===e)lay.each(new Array(12),function(e){var i=lay.elem("li",{"lay-ym":e}),r={year:g[0],month:e};e+1==g[1]&&lay(i).addClass(y),i.innerHTML=l.month[e]+(f?"\u6708":""),s.appendChild(i),g[0]=a.firstDate.year&&(r.date=n.max.date),a.limit(lay(i),r,t)}),lay(m[f?0:1]).attr("lay-ym",g[0]+"-"+g[1]).html(g[0]+p);else if("time"===e){var E=function(){lay(s).find("ol").each(function(e,n){lay(n).find("li").each(function(n,i){a.limit(lay(i),[{hours:n},{hours:a[D].hours,minutes:n},{hours:a[D].hours,minutes:a[D].minutes,seconds:n}][e],t,[["hours"],["hours","minutes"],["hours","minutes","seconds"]][e])})}),n.range||a.limit(lay(a.footer).find(T),a[D],0,["hours","minutes","seconds"])};n.range?a[D]||(a[D]="startTime"===D?i:a.endDate):a[D]=i,lay.each([24,60,60],function(e,t){var n=lay.elem("li"),i=["

    "+l.time[e]+"

      "];lay.each(new Array(t),function(t){i.push(""+lay.digit(t,2)+"")}),n.innerHTML=i.join("")+"
    ",s.appendChild(n)}),E()}if(h&&c.removeChild(h),c.appendChild(s),"year"===e||"month"===e)lay(a.elemMain[t]).addClass("laydate-ym-show"),lay(s).find("li").on("click",function(){var l=0|lay(this).attr("lay-ym");if(!lay(this).hasClass(d)){if(0===t)i[e]=l,r&&(a.startDate[e]=l),a.limit(lay(a.footer).find(T),null,0);else if(r)a.endDate[e]=l;else{var o="year"===e?a.getAsYM(l,g[1]-1,"sub"):a.getAsYM(g[0],l,"sub");lay.extend(i,{year:o[0],month:o[1]})}var m="year"===n.type||"month"===n.type;m?(lay(s).find("."+y).removeClass(y),lay(this).addClass(y),"month"===n.type&&"year"===e&&(a.listYM[t][0]=l,r&&(a[["startDate","endDate"][t]].year=l),a.list("month",t))):(a.checkDate("limit").calendar(),a.closeList()),a.setBtnStatus(),n.range||("month"===n.type&&"month"===e||"year"===n.type&&"year"===e)&&a.setValue(a.parse()).remove().done(),n.range||a.done(null,"change"),lay(a.footer).find("."+x).removeClass(d)}});else{var I=lay.elem("span",{"class":w}),S=function(){lay(s).find("ol").each(function(e){var t=this,n=lay(t).find("li");t.scrollTop=30*(a[D][v[e]]-2),t.scrollTop<=0&&n.each(function(e,a){if(!lay(this).hasClass(d))return t.scrollTop=30*(e-2),!0})})},k=lay(o[2]).find("."+w);S(),I.innerHTML=n.range?[l.startTime,l.endTime][t]:l.timeTips,lay(a.elemMain[t]).addClass("laydate-time-show"),k[0]&&k.remove(),o[2].appendChild(I),lay(s).find("ol").each(function(e){var t=this;lay(t).find("li").on("click",function(){var l=0|this.innerHTML;lay(this).hasClass(d)||(n.range?a[D][v[e]]=l:i[v[e]]=l,lay(t).find("."+y).removeClass(y),lay(this).addClass(y),E(),S(),(a.endDate||"time"===n.type)&&a.done(null,"change"),a.setBtnStatus())})})}return a},C.prototype.listYM=[],C.prototype.closeList=function(){var e=this;e.config;lay.each(e.elemCont,function(t,a){lay(this).find("."+u).remove(),lay(e.elemMain[t]).removeClass("laydate-ym-show laydate-time-show")}),lay(e.elem).find("."+w).remove()},C.prototype.setBtnStatus=function(e,t,a){var n,i=this,l=i.config,r=i.lang(),s=lay(i.footer).find(T);l.range||i.limit(s,null,0,["hours","minutes","seconds"]),l.range&&"time"!==l.type&&(t=t||i.startDate,a=a||i.endDate,n=i.newDate(t).getTime()>i.newDate(a).getTime(),i.limit(null,t)||i.limit(null,a)?s.addClass(d):s[n?"addClass":"removeClass"](d),e&&n&&i.hint("string"==typeof e?r.timeout.replace(/\u65e5\u671f/g,e):r.timeout))},C.prototype.parse=function(e,t){var a=this,n=a.config,i=t||("end"==e?lay.extend({},a.endDate,a.endTime):n.range?lay.extend({},a.startDate,a.startTime):n.dateTime),r=l.parse(i,a.format,1);return n.range&&void 0===e?r+" "+a.rangeStr+" "+a.parse("end"):r},C.prototype.newDate=function(e){return e=e||{},new Date(e.year||1,e.month||0,e.date||1,e.hours||0,e.minutes||0,e.seconds||0)},C.prototype.setValue=function(e){var t=this,a=t.config,n=t.bindElem||a.elem[0];return"static"===a.position?t:(e=e||"",t.isInput(n)?lay(n).val(e):t.rangeElem?(t.rangeElem[0].val(e?t.parse("start"):""),t.rangeElem[1].val(e?t.parse("end"):"")):(0===lay(n).find("*").length&&lay(n).html(e),lay(n).attr("lay-date",e)),t)},C.prototype.stampRange=function(e,t){var a=this,n=a.config,i=lay(a.elem).find("td"),l=a.lang();if(e){if(!a.startDate||a.endDate)return}else n.range&&!a.endDate&&lay(a.footer).find(T).addClass(d);var r=a.startDate?a.newDate({year:a.startDate.year,month:a.startDate.month,date:a.startDate.date}).getTime():0,s=a.endDate?a.newDate({year:a.endDate.year,month:a.endDate.month,date:a.endDate.date}).getTime():0;return s&&r>s&&!e?a.hint(l.timeout):void lay.each(i,function(n,i){var l=lay(i).attr("title").split("-"),o=a.newDate({year:l[0],month:l[1]-1,date:l[2]}).getTime();if(a.startDate||o===a.newDate(a.systemDate()).getTime()&&lay(i).addClass(lay(i).hasClass(g)||lay(i).hasClass(v)?"":h),lay(i).removeClass(f+" "+y),o!==r&&o!==s||lay(i).addClass(lay(i).hasClass(g)||lay(i).hasClass(v)?f:y),"mouseenter"===e){var d=a.newDate({year:t[0],month:t[1]-1,date:t[2]}).getTime();(o>r&&o<=d||o=d)&&lay(i).addClass(f)}else{if("mouseleave"===e)return;o>r&&o0&&t-1 in e)}function r(e,t,n){if(pe.isFunction(t))return pe.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return pe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Ce.test(t))return pe.filter(t,e,n);t=pe.filter(t,e)}return pe.grep(e,function(e){return pe.inArray(e,t)>-1!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t={};return pe.each(e.match(De)||[],function(e,n){t[n]=!0}),t}function a(){re.addEventListener?(re.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s)):(re.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(re.addEventListener||"load"===e.event.type||"complete"===re.readyState)&&(a(),pe.ready())}function u(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(_e,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:qe.test(n)?pe.parseJSON(n):n)}catch(i){}pe.data(e,t,n)}else n=void 0}return n}function l(e){var t;for(t in e)if(("data"!==t||!pe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(He(e)){var i,o,a=pe.expando,s=e.nodeType,u=s?pe.cache:e,l=s?e[a]:e[a]&&a;if(l&&u[l]&&(r||u[l].data)||void 0!==n||"string"!=typeof t)return l||(l=s?e[a]=ne.pop()||pe.guid++:a),u[l]||(u[l]=s?{}:{toJSON:pe.noop}),"object"!=typeof t&&"function"!=typeof t||(r?u[l]=pe.extend(u[l],t):u[l].data=pe.extend(u[l].data,t)),o=u[l],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[pe.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[pe.camelCase(t)])):i=o,i}}function f(e,t,n){if(He(e)){var r,i,o=e.nodeType,a=o?pe.cache:e,s=o?e[pe.expando]:pe.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){pe.isArray(t)?t=t.concat(pe.map(t,pe.camelCase)):t in r?t=[t]:(t=pe.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!l(r):!pe.isEmptyObject(r))return}(n||(delete a[s].data,l(a[s])))&&(o?pe.cleanData([e],!0):fe.deleteExpando||a!=a.window?delete a[s]:a[s]=void 0)}}}function d(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return pe.css(e,t,"")},u=s(),l=n&&n[3]||(pe.cssNumber[t]?"":"px"),c=(pe.cssNumber[t]||"px"!==l&&+u)&&Me.exec(pe.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do o=o||".5",c/=o,pe.style(e,t,c+l);while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function p(e){var t=ze.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function h(e,t){var n,r,i=0,o="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||pe.nodeName(r,t)?o.push(r):pe.merge(o,h(r,t));return void 0===t||t&&pe.nodeName(e,t)?pe.merge([e],o):o}function g(e,t){for(var n,r=0;null!=(n=e[r]);r++)pe._data(n,"globalEval",!t||pe._data(t[r],"globalEval"))}function m(e){Be.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t,n,r,i){for(var o,a,s,u,l,c,f,d=e.length,y=p(t),v=[],x=0;x"!==f[1]||Ve.test(a)?0:u:u.firstChild,o=a&&a.childNodes.length;o--;)pe.nodeName(c=a.childNodes[o],"tbody")&&!c.childNodes.length&&a.removeChild(c);for(pe.merge(v,u.childNodes),u.textContent="";u.firstChild;)u.removeChild(u.firstChild);u=y.lastChild}else v.push(t.createTextNode(a));for(u&&y.removeChild(u),fe.appendChecked||pe.grep(h(v,"input"),m),x=0;a=v[x++];)if(r&&pe.inArray(a,r)>-1)i&&i.push(a);else if(s=pe.contains(a.ownerDocument,a),u=h(y.appendChild(a),"script"),s&&g(u),n)for(o=0;a=u[o++];)Ie.test(a.type||"")&&n.push(a);return u=null,y}function v(){return!0}function x(){return!1}function b(){try{return re.activeElement}catch(e){}}function w(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)w(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=x;else if(!i)return e;return 1===o&&(a=i,i=function(e){return pe().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=pe.guid++)),e.each(function(){pe.event.add(this,t,i,r,n)})}function T(e,t){return pe.nodeName(e,"table")&&pe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function C(e){return e.type=(null!==pe.find.attr(e,"type"))+"/"+e.type,e}function E(e){var t=it.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function N(e,t){if(1===t.nodeType&&pe.hasData(e)){var n,r,i,o=pe._data(e),a=pe._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;r1&&"string"==typeof p&&!fe.checkClone&&rt.test(p))return e.each(function(i){var o=e.eq(i);g&&(t[0]=p.call(this,i,o.html())),S(o,t,n,r)});if(f&&(l=y(t,e[0].ownerDocument,!1,e,r),i=l.firstChild,1===l.childNodes.length&&(l=i),i||r)){for(s=pe.map(h(l,"script"),C),a=s.length;c")).appendTo(t.documentElement),t=(ut[0].contentWindow||ut[0].contentDocument).document,t.write(),t.close(),n=D(e,t),ut.detach()),lt[e]=n),n}function L(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function H(e){if(e in Et)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=Ct.length;n--;)if(e=Ct[n]+t,e in Et)return e}function q(e,t){for(var n,r,i,o=[],a=0,s=e.length;a=0&&n=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==pe.type(e)||e.nodeType||pe.isWindow(e))return!1;try{if(e.constructor&&!ce.call(e,"constructor")&&!ce.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(!fe.ownFirst)for(t in e)return ce.call(e,t);for(t in e);return void 0===t||ce.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ue[le.call(e)]||"object":typeof e},globalEval:function(t){t&&pe.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ge,"ms-").replace(me,ye)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var r,i=0;if(n(e))for(r=e.length;iT.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[P]=!0,e}function i(e){var t=H.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)T.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||V)-(~e.sourceIndex||V);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function d(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,n,r){for(var i=0,o=n.length;i-1&&(r[l]=!(a[l]=f))}}else x=m(x===a?x.splice(h,x.length):x),o?o(null,a,x,u):Q.apply(a,x)})}function v(e){for(var t,n,r,i=e.length,o=T.relative[e[0].type],a=o||T.relative[" "],s=o?1:0,u=p(function(e){return e===t},a,!0),l=p(function(e){return ee(t,e)>-1},a,!0),c=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];s1&&h(c),s>1&&d(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,s0,o=e.length>0,a=function(r,a,s,u,l){var c,f,d,p=0,h="0",g=r&&[],y=[],v=A,x=r||o&&T.find.TAG("*",l),b=W+=null==v?1:Math.random()||.1,w=x.length;for(l&&(A=a===H||a||l);h!==w&&null!=(c=x[h]);h++){if(o&&c){for(f=0,a||c.ownerDocument===H||(L(c),s=!_);d=e[f++];)if(d(c,a||H,s)){u.push(c);break}l&&(W=b)}i&&((c=!d&&c)&&p--,r&&g.push(c))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(g,y,a,s);if(r){if(p>0)for(;h--;)g[h]||y[h]||(y[h]=G.call(u));y=m(y)}Q.apply(u,y),l&&!r&&y.length>0&&p+n.length>1&&t.uniqueSort(u)}return l&&(W=b,A=v),g};return i?r(a):a}var b,w,T,C,E,N,k,S,A,D,j,L,H,q,_,F,M,O,R,P="sizzle"+1*new Date,B=e.document,W=0,I=0,$=n(),z=n(),X=n(),U=function(e,t){return e===t&&(j=!0),0},V=1<<31,Y={}.hasOwnProperty,J=[],G=J.pop,K=J.push,Q=J.push,Z=J.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),ce=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),de=new RegExp("^"+re+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,xe=/'|\\/g,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),we=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Te=function(){L()};try{Q.apply(J=Z.call(B.childNodes),B.childNodes),J[B.childNodes.length].nodeType}catch(Ce){Q={apply:J.length?function(e,t){K.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}w=t.support={},E=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},L=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:B;return r!==H&&9===r.nodeType&&r.documentElement?(H=r,q=H.documentElement,_=!E(H),(n=H.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Te,!1):n.attachEvent&&n.attachEvent("onunload",Te)),w.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=i(function(e){return e.appendChild(H.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=me.test(H.getElementsByClassName),w.getById=i(function(e){return q.appendChild(e).id=P,!H.getElementsByName||!H.getElementsByName(P).length}),w.getById?(T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&_){var n=t.getElementById(e);return n?[n]:[]}},T.filter.ID=function(e){var t=e.replace(be,we);return function(e){return e.getAttribute("id")===t}}):(delete T.find.ID,T.filter.ID=function(e){var t=e.replace(be,we);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),T.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},T.find.CLASS=w.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&_)return t.getElementsByClassName(e)},M=[],F=[],(w.qsa=me.test(H.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&F.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||F.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+P+"-]").length||F.push("~="),e.querySelectorAll(":checked").length||F.push(":checked"),e.querySelectorAll("a#"+P+"+*").length||F.push(".#.+[+~]")}),i(function(e){var t=H.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&F.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||F.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),F.push(",.*:")})),(w.matchesSelector=me.test(O=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){w.disconnectedMatch=O.call(e,"div"),O.call(e,"[s!='']:x"),M.push("!=",oe)}),F=F.length&&new RegExp(F.join("|")),M=M.length&&new RegExp(M.join("|")),t=me.test(q.compareDocumentPosition),R=t||me.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},U=t?function(e,t){if(e===t)return j=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!w.sortDetached&&t.compareDocumentPosition(e)===n?e===H||e.ownerDocument===B&&R(B,e)?-1:t===H||t.ownerDocument===B&&R(B,t)?1:D?ee(D,e)-ee(D,t):0:4&n?-1:1)}:function(e,t){if(e===t)return j=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],u=[t];if(!i||!o)return e===H?-1:t===H?1:i?-1:o?1:D?ee(D,e)-ee(D,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===B?-1:u[r]===B?1:0},H):H},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==H&&L(e),n=n.replace(ce,"='$1']"),w.matchesSelector&&_&&!X[n+" "]&&(!M||!M.test(n))&&(!F||!F.test(n)))try{var r=O.call(e,n);if(r||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,H,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==H&&L(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==H&&L(e);var n=T.attrHandle[t.toLowerCase()],r=n&&Y.call(T.attrHandle,t.toLowerCase())?n(e,t,!_):void 0;return void 0!==r?r:w.attributes||!_?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!w.detectDuplicates,D=!w.sortStable&&e.slice(0),e.sort(U),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return D=null,e},C=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=C(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=C(t);return n},T=t.selectors={cacheLength:50,createPseudo:r,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,we),e[3]=(e[3]||e[4]||e[5]||"").replace(be,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=N(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ae," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,d,p,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s,x=!1;if(m){if(o){for(;g;){for(d=t;d=d[g];)if(s?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(d=m,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===W&&l[1],x=p&&l[2], +d=p&&m.childNodes[p];d=++p&&d&&d[g]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){c[e]=[W,p,x];break}}else if(v&&(d=t,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===W&&l[1],x=p),x===!1)for(;(d=++p&&d&&d[g]||(x=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++x||(v&&(f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[e]=[W,x]),d!==t)););return x-=i,x===r||x%r===0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[P]?o(n):o.length>1?(i=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(se,"$1"));return i[P]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,we),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,we).toLowerCase(),function(t){var n;do if(n=_?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===H.activeElement&&(!H.hasFocus||H.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(a=o[0]).type&&w.getById&&9===t.nodeType&&_&&T.relative[o[1].type]){if(t=(T.find.ID(a.matches[0].replace(be,we),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!T.relative[s=a.type]);)if((u=T.find[s])&&(r=u(a.matches[0].replace(be,we),ve.test(o[0].type)&&c(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Q.apply(n,r),n;break}}return(l||k(e,f))(r,t,!_,n,!t||ve.test(e)&&c(t.parentNode)||t),n},w.sortStable=P.split("").sort(U).join("")===P,w.detectDuplicates=!!j,L(),w.sortDetached=i(function(e){return 1&e.compareDocumentPosition(H.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);pe.find=ve,pe.expr=ve.selectors,pe.expr[":"]=pe.expr.pseudos,pe.uniqueSort=pe.unique=ve.uniqueSort,pe.text=ve.getText,pe.isXMLDoc=ve.isXML,pe.contains=ve.contains;var xe=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&pe(e).is(n))break;r.push(e)}return r},be=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},we=pe.expr.match.needsContext,Te=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Ce=/^.[^:#\[\.,]*$/;pe.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?pe.find.matchesSelector(r,e)?[r]:[]:pe.find.matches(e,pe.grep(t,function(e){return 1===e.nodeType}))},pe.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(pe(e).filter(function(){for(t=0;t1?pe.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&we.test(e)?pe(e):e||[],!1).length}});var Ee,Ne=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ke=pe.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||Ee,"string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Ne.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof pe?t[0]:t,pe.merge(this,pe.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:re,!0)),Te.test(r[1])&&pe.isPlainObject(t))for(r in t)pe.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(i=re.getElementById(r[2]),i&&i.parentNode){if(i.id!==r[2])return Ee.find(e);this.length=1,this[0]=i}return this.context=re,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):pe.isFunction(e)?"undefined"!=typeof n.ready?n.ready(e):e(pe):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),pe.makeArray(e,this))};ke.prototype=pe.fn,Ee=pe(re);var Se=/^(?:parents|prev(?:Until|All))/,Ae={children:!0,contents:!0,next:!0,prev:!0};pe.fn.extend({has:function(e){var t,n=pe(e,this),r=n.length;return this.filter(function(){for(t=0;t-1:1===n.nodeType&&pe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?pe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?pe.inArray(this[0],pe(e)):pe.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(pe.uniqueSort(pe.merge(this.get(),pe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),pe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xe(e,"parentNode")},parentsUntil:function(e,t,n){return xe(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return xe(e,"nextSibling")},prevAll:function(e){return xe(e,"previousSibling")},nextUntil:function(e,t,n){return xe(e,"nextSibling",n)},prevUntil:function(e,t,n){return xe(e,"previousSibling",n)},siblings:function(e){return be((e.parentNode||{}).firstChild,e)},children:function(e){return be(e.firstChild)},contents:function(e){return pe.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:pe.merge([],e.childNodes)}},function(e,t){pe.fn[e]=function(n,r){var i=pe.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=pe.filter(r,i)),this.length>1&&(Ae[e]||(i=pe.uniqueSort(i)),Se.test(e)&&(i=i.reverse())),this.pushStack(i)}});var De=/\S+/g;pe.Callbacks=function(e){e="string"==typeof e?o(e):pe.extend({},e);var t,n,r,i,a=[],s=[],u=-1,l=function(){for(i=e.once,r=t=!0;s.length;u=-1)for(n=s.shift();++u-1;)a.splice(n,1),n<=u&&u--}),this},has:function(e){return e?pe.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=s=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=!0,n||c.disable(),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},pe.extend({Deferred:function(e){var t=[["resolve","done",pe.Callbacks("once memory"),"resolved"],["reject","fail",pe.Callbacks("once memory"),"rejected"],["notify","progress",pe.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return pe.Deferred(function(n){pe.each(t,function(t,o){var a=pe.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&pe.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?pe.extend(e,r):r}},i={};return r.pipe=r.then,pe.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=ie.call(arguments),a=o.length,s=1!==a||e&&pe.isFunction(e.promise)?a:0,u=1===s?e:pe.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?ie.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);i0||(je.resolveWith(re,[pe]),pe.fn.triggerHandler&&(pe(re).triggerHandler("ready"),pe(re).off("ready"))))}}),pe.ready.promise=function(t){if(!je)if(je=pe.Deferred(),"complete"===re.readyState||"loading"!==re.readyState&&!re.documentElement.doScroll)e.setTimeout(pe.ready);else if(re.addEventListener)re.addEventListener("DOMContentLoaded",s),e.addEventListener("load",s);else{re.attachEvent("onreadystatechange",s),e.attachEvent("onload",s);var n=!1;try{n=null==e.frameElement&&re.documentElement}catch(r){}n&&n.doScroll&&!function i(){if(!pe.isReady){try{n.doScroll("left")}catch(t){return e.setTimeout(i,50)}a(),pe.ready()}}()}return je.promise(t)},pe.ready.promise();var Le;for(Le in pe(fe))break;fe.ownFirst="0"===Le,fe.inlineBlockNeedsLayout=!1,pe(function(){var e,t,n,r;n=re.getElementsByTagName("body")[0],n&&n.style&&(t=re.createElement("div"),r=re.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),"undefined"!=typeof t.style.zoom&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",fe.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=re.createElement("div");fe.deleteExpando=!0;try{delete e.test}catch(t){fe.deleteExpando=!1}e=null}();var He=function(e){var t=pe.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||t!==!0&&e.getAttribute("classid")===t)},qe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;pe.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?pe.cache[e[pe.expando]]:e[pe.expando],!!e&&!l(e)},data:function(e,t,n){return c(e,t,n)},removeData:function(e,t){return f(e,t)},_data:function(e,t,n){return c(e,t,n,!0)},_removeData:function(e,t){return f(e,t,!0)}}),pe.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=pe.data(o),1===o.nodeType&&!pe._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=pe.camelCase(r.slice(5)),u(o,r,i[r])));pe._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){pe.data(this,e)}):arguments.length>1?this.each(function(){pe.data(this,e,t)}):o?u(o,e,pe.data(o,e)):void 0},removeData:function(e){return this.each(function(){pe.removeData(this,e)})}}),pe.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=pe._data(e,t),n&&(!r||pe.isArray(n)?r=pe._data(e,t,pe.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=pe.queue(e,t),r=n.length,i=n.shift(),o=pe._queueHooks(e,t),a=function(){pe.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return pe._data(e,n)||pe._data(e,n,{empty:pe.Callbacks("once memory").add(function(){pe._removeData(e,t+"queue"),pe._removeData(e,n)})})}}),pe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length
    a",fe.leadingWhitespace=3===e.firstChild.nodeType,fe.tbody=!e.getElementsByTagName("tbody").length,fe.htmlSerialize=!!e.getElementsByTagName("link").length,fe.html5Clone="<:nav>"!==re.createElement("nav").cloneNode(!0).outerHTML,n.type="checkbox",n.checked=!0,t.appendChild(n),fe.appendChecked=n.checked,e.innerHTML="",fe.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,t.appendChild(e),n=re.createElement("input"),n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),fe.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.noCloneEvent=!!e.addEventListener,e[pe.expando]=1,fe.attributes=!e.getAttribute(pe.expando)}();var Xe={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:fe.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]};Xe.optgroup=Xe.option,Xe.tbody=Xe.tfoot=Xe.colgroup=Xe.caption=Xe.thead,Xe.th=Xe.td;var Ue=/<|&#?\w+;/,Ve=/-1&&(h=p.split("."),p=h.shift(),h.sort()),a=p.indexOf(":")<0&&"on"+p,t=t[pe.expando]?t:new pe.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:pe.makeArray(n,[t]),l=pe.event.special[p]||{},i||!l.trigger||l.trigger.apply(r,n)!==!1)){if(!i&&!l.noBubble&&!pe.isWindow(r)){for(u=l.delegateType||p,Ke.test(u+p)||(s=s.parentNode);s;s=s.parentNode)d.push(s),c=s;c===(r.ownerDocument||re)&&d.push(c.defaultView||c.parentWindow||e)}for(f=0;(s=d[f++])&&!t.isPropagationStopped();)t.type=f>1?u:l.bindType||p,o=(pe._data(s,"events")||{})[t.type]&&pe._data(s,"handle"),o&&o.apply(s,n),o=a&&s[a],o&&o.apply&&He(s)&&(t.result=o.apply(s,n),t.result===!1&&t.preventDefault());if(t.type=p,!i&&!t.isDefaultPrevented()&&(!l._default||l._default.apply(d.pop(),n)===!1)&&He(r)&&a&&r[p]&&!pe.isWindow(r)){c=r[a],c&&(r[a]=null),pe.event.triggered=p;try{r[p]()}catch(g){}pe.event.triggered=void 0,c&&(r[a]=c)}return t.result}},dispatch:function(e){e=pe.event.fix(e);var t,n,r,i,o,a=[],s=ie.call(arguments),u=(pe._data(this,"events")||{})[e.type]||[],l=pe.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){for(a=pe.event.handlers.call(this,e,u),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,r=((pe.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(r=[],n=0;n-1:pe.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&a.push({elem:u,handlers:r})}return s]","i"),tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,nt=/\s*$/g,at=p(re),st=at.appendChild(re.createElement("div"));pe.extend({htmlPrefilter:function(e){return e.replace(tt,"<$1>")},clone:function(e,t,n){var r,i,o,a,s,u=pe.contains(e.ownerDocument,e);if(fe.html5Clone||pe.isXMLDoc(e)||!et.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(st.innerHTML=e.outerHTML,st.removeChild(o=st.firstChild)),!(fe.noCloneEvent&&fe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||pe.isXMLDoc(e)))for(r=h(o),s=h(e),a=0;null!=(i=s[a]);++a)r[a]&&k(i,r[a]);if(t)if(n)for(s=s||h(e),r=r||h(o),a=0;null!=(i=s[a]);a++)N(i,r[a]);else N(e,o);return r=h(o,"script"),r.length>0&&g(r,!u&&h(e,"script")),r=s=i=null,o},cleanData:function(e,t){for(var n,r,i,o,a=0,s=pe.expando,u=pe.cache,l=fe.attributes,c=pe.event.special;null!=(n=e[a]);a++)if((t||He(n))&&(i=n[s],o=i&&u[i])){if(o.events)for(r in o.events)c[r]?pe.event.remove(n,r):pe.removeEvent(n,r,o.handle);u[i]&&(delete u[i],l||"undefined"==typeof n.removeAttribute?n[s]=void 0:n.removeAttribute(s),ne.push(i))}}}),pe.fn.extend({domManip:S,detach:function(e){return A(this,e,!0)},remove:function(e){return A(this,e)},text:function(e){return Pe(this,function(e){return void 0===e?pe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||re).createTextNode(e))},null,e,arguments.length)},append:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.appendChild(e)}})},prepend:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&pe.cleanData(h(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&pe.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return pe.clone(this,e,t)})},html:function(e){return Pe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Ze,""):void 0;if("string"==typeof e&&!nt.test(e)&&(fe.htmlSerialize||!et.test(e))&&(fe.leadingWhitespace||!$e.test(e))&&!Xe[(We.exec(e)||["",""])[1].toLowerCase()]){e=pe.htmlPrefilter(e);try{for(;nt",l.childNodes[0].style.borderCollapse="separate",t=l.getElementsByTagName("td"),t[0].style.cssText="margin:0;border:0;padding:0;display:none",o=0===t[0].offsetHeight,o&&(t[0].style.display="",t[1].style.display="none",o=0===t[0].offsetHeight)),f.removeChild(u)}var n,r,i,o,a,s,u=re.createElement("div"),l=re.createElement("div");l.style&&(l.style.cssText="float:left;opacity:.5",fe.opacity="0.5"===l.style.opacity,fe.cssFloat=!!l.style.cssFloat,l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",fe.clearCloneStyle="content-box"===l.style.backgroundClip,u=re.createElement("div"),u.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",l.innerHTML="",u.appendChild(l),fe.boxSizing=""===l.style.boxSizing||""===l.style.MozBoxSizing||""===l.style.WebkitBoxSizing,pe.extend(fe,{reliableHiddenOffsets:function(){return null==n&&t(),o},boxSizingReliable:function(){return null==n&&t(),i},pixelMarginRight:function(){return null==n&&t(),r},pixelPosition:function(){return null==n&&t(),n},reliableMarginRight:function(){return null==n&&t(),a},reliableMarginLeft:function(){return null==n&&t(),s}}))}();var ht,gt,mt=/^(top|right|bottom|left)$/;e.getComputedStyle?(ht=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n.getPropertyValue(t)||n[t]:void 0,""!==a&&void 0!==a||pe.contains(e.ownerDocument,e)||(a=pe.style(e,t)),n&&!fe.pixelMarginRight()&&ft.test(a)&&ct.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o),void 0===a?a:a+""}):pt.currentStyle&&(ht=function(e){return e.currentStyle},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n[t]:void 0,null==a&&s&&s[t]&&(a=s[t]),ft.test(a)&&!mt.test(t)&&(r=s.left,i=e.runtimeStyle,o=i&&i.left,o&&(i.left=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"});var yt=/alpha\([^)]*\)/i,vt=/opacity\s*=\s*([^)]*)/i,xt=/^(none|table(?!-c[ea]).+)/,bt=new RegExp("^("+Fe+")(.*)$","i"),wt={position:"absolute",visibility:"hidden",display:"block"},Tt={letterSpacing:"0",fontWeight:"400"},Ct=["Webkit","O","Moz","ms"],Et=re.createElement("div").style;pe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=gt(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":fe.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=pe.camelCase(t),u=e.style;if(t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];if(o=typeof n,"string"===o&&(i=Me.exec(n))&&i[1]&&(n=d(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(pe.cssNumber[s]?"":"px")),fe.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{u[t]=n}catch(l){}}},css:function(e,t,n,r){var i,o,a,s=pe.camelCase(t);return t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],a&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=gt(e,t,r)),"normal"===o&&t in Tt&&(o=Tt[t]),""===n||n?(i=parseFloat(o),n===!0||isFinite(i)?i||0:o):o}}),pe.each(["height","width"],function(e,t){pe.cssHooks[t]={get:function(e,n,r){if(n)return xt.test(pe.css(e,"display"))&&0===e.offsetWidth?dt(e,wt,function(){return M(e,t,r)}):M(e,t,r)},set:function(e,n,r){var i=r&&ht(e);return _(e,n,r?F(e,t,r,fe.boxSizing&&"border-box"===pe.css(e,"boxSizing",!1,i),i):0)}}}),fe.opacity||(pe.cssHooks.opacity={get:function(e,t){return vt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=pe.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===pe.trim(o.replace(yt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=yt.test(o)?o.replace(yt,i):o+" "+i)}}),pe.cssHooks.marginRight=L(fe.reliableMarginRight,function(e,t){if(t)return dt(e,{display:"inline-block"},gt,[e,"marginRight"])}),pe.cssHooks.marginLeft=L(fe.reliableMarginLeft,function(e,t){if(t)return(parseFloat(gt(e,"marginLeft"))||(pe.contains(e.ownerDocument,e)?e.getBoundingClientRect().left-dt(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}):0))+"px"}),pe.each({margin:"",padding:"",border:"Width"},function(e,t){pe.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+Oe[r]+t]=o[r]||o[r-2]||o[0];return i}},ct.test(e)||(pe.cssHooks[e+t].set=_)}),pe.fn.extend({css:function(e,t){return Pe(this,function(e,t,n){var r,i,o={},a=0;if(pe.isArray(t)){for(r=ht(e),i=t.length;a1)},show:function(){return q(this,!0)},hide:function(){return q(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Re(this)?pe(this).show():pe(this).hide()})}}),pe.Tween=O,O.prototype={constructor:O,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||pe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(pe.cssNumber[n]?"":"px")},cur:function(){var e=O.propHooks[this.prop];return e&&e.get?e.get(this):O.propHooks._default.get(this)},run:function(e){var t,n=O.propHooks[this.prop];return this.options.duration?this.pos=t=pe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):O.propHooks._default.set(this),this}},O.prototype.init.prototype=O.prototype,O.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=pe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){pe.fx.step[e.prop]?pe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[pe.cssProps[e.prop]]&&!pe.cssHooks[e.prop]?e.elem[e.prop]=e.now:pe.style(e.elem,e.prop,e.now+e.unit)}}},O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},pe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},pe.fx=O.prototype.init,pe.fx.step={};var Nt,kt,St=/^(?:toggle|show|hide)$/,At=/queueHooks$/;pe.Animation=pe.extend($,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return d(n.elem,e,Me.exec(t),n),n}]},tweener:function(e,t){pe.isFunction(e)?(t=e,e=["*"]):e=e.match(De);for(var n,r=0,i=e.length;r
    a",e=n.getElementsByTagName("a")[0],t.setAttribute("type","checkbox"),n.appendChild(t),e=n.getElementsByTagName("a")[0],e.style.cssText="top:1px",fe.getSetAttribute="t"!==n.className,fe.style=/top/.test(e.getAttribute("style")),fe.hrefNormalized="/a"===e.getAttribute("href"),fe.checkOn=!!t.value,fe.optSelected=i.selected,fe.enctype=!!re.createElement("form").enctype,r.disabled=!0,fe.optDisabled=!i.disabled,t=re.createElement("input"),t.setAttribute("value",""),fe.input=""===t.getAttribute("value"),t.value="t",t.setAttribute("type","radio"),fe.radioValue="t"===t.value}();var Dt=/\r/g,jt=/[\x20\t\r\n\f]+/g;pe.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=pe.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,pe(this).val()):e,null==i?i="":"number"==typeof i?i+="":pe.isArray(i)&&(i=pe.map(i,function(e){return null==e?"":e+""})),t=pe.valHooks[this.type]||pe.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=pe.valHooks[i.type]||pe.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(Dt,""):null==n?"":n)}}}),pe.extend({valHooks:{option:{get:function(e){var t=pe.find.attr(e,"value");return null!=t?t:pe.trim(pe.text(e)).replace(jt," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,a=o?null:[],s=o?i+1:r.length,u=i<0?s:o?i:0;u-1)try{r.selected=n=!0}catch(s){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),pe.each(["radio","checkbox"],function(){pe.valHooks[this]={set:function(e,t){if(pe.isArray(t))return e.checked=pe.inArray(pe(e).val(),t)>-1}},fe.checkOn||(pe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Lt,Ht,qt=pe.expr.attrHandle,_t=/^(?:checked|selected)$/i,Ft=fe.getSetAttribute,Mt=fe.input;pe.fn.extend({attr:function(e,t){return Pe(this,pe.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){pe.removeAttr(this,e)})}}),pe.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?pe.prop(e,t,n):(1===o&&pe.isXMLDoc(e)||(t=t.toLowerCase(),i=pe.attrHooks[t]||(pe.expr.match.bool.test(t)?Ht:Lt)),void 0!==n?null===n?void pe.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=pe.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!fe.radioValue&&"radio"===t&&pe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(De);if(o&&1===e.nodeType)for(;n=o[i++];)r=pe.propFix[n]||n,pe.expr.match.bool.test(n)?Mt&&Ft||!_t.test(n)?e[r]=!1:e[pe.camelCase("default-"+n)]=e[r]=!1:pe.attr(e,n,""),e.removeAttribute(Ft?n:r)}}),Ht={set:function(e,t,n){return t===!1?pe.removeAttr(e,n):Mt&&Ft||!_t.test(n)?e.setAttribute(!Ft&&pe.propFix[n]||n,n):e[pe.camelCase("default-"+n)]=e[n]=!0,n}},pe.each(pe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=qt[t]||pe.find.attr;Mt&&Ft||!_t.test(t)?qt[t]=function(e,t,r){var i,o;return r||(o=qt[t],qt[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,qt[t]=o),i}:qt[t]=function(e,t,n){if(!n)return e[pe.camelCase("default-"+t)]?t.toLowerCase():null}}),Mt&&Ft||(pe.attrHooks.value={set:function(e,t,n){return pe.nodeName(e,"input")?void(e.defaultValue=t):Lt&&Lt.set(e,t,n)}}),Ft||(Lt={set:function(e,t,n){var r=e.getAttributeNode(n);if(r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n))return t}},qt.id=qt.name=qt.coords=function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},pe.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:Lt.set},pe.attrHooks.contenteditable={set:function(e,t,n){Lt.set(e,""!==t&&t,n)}},pe.each(["width","height"],function(e,t){pe.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}})),fe.style||(pe.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Ot=/^(?:input|select|textarea|button|object)$/i,Rt=/^(?:a|area)$/i;pe.fn.extend({prop:function(e,t){return Pe(this,pe.prop,e,t,arguments.length>1)},removeProp:function(e){return e=pe.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(t){}})}}),pe.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&pe.isXMLDoc(e)||(t=pe.propFix[t]||t,i=pe.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=pe.find.attr(e,"tabindex");return t?parseInt(t,10):Ot.test(e.nodeName)||Rt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),fe.hrefNormalized||pe.each(["href","src"],function(e,t){pe.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),fe.optSelected||(pe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),pe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){pe.propFix[this.toLowerCase()]=this}),fe.enctype||(pe.propFix.enctype="encoding");var Pt=/[\t\r\n\f]/g;pe.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).addClass(e.call(this,t,z(this)))});if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).removeClass(e.call(this,t,z(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):pe.isFunction(e)?this.each(function(n){pe(this).toggleClass(e.call(this,n,z(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=pe(this),o=e.match(De)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=z(this),t&&pe._data(this,"__className__",t),pe.attr(this,"class",t||e===!1?"":pe._data(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+z(n)+" ").replace(Pt," ").indexOf(t)>-1)return!0;return!1}}),pe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){pe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),pe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});var Bt=e.location,Wt=pe.now(),It=/\?/,$t=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;pe.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=pe.trim(t+"");return i&&!pe.trim(i.replace($t,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():pe.error("Invalid JSON: "+t)},pe.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(r=new e.DOMParser,n=r.parseFromString(t,"text/xml")):(n=new e.ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(i){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||pe.error("Invalid XML: "+t),n};var zt=/#.*$/,Xt=/([?&])_=[^&]*/,Ut=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Vt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Yt=/^(?:GET|HEAD)$/,Jt=/^\/\//,Gt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Kt={},Qt={},Zt="*/".concat("*"),en=Bt.href,tn=Gt.exec(en.toLowerCase())||[];pe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:en,type:"GET",isLocal:Vt.test(tn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":pe.parseJSON,"text xml":pe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?V(V(e,pe.ajaxSettings),t):V(pe.ajaxSettings,e)},ajaxPrefilter:X(Kt),ajaxTransport:X(Qt),ajax:function(t,n){function r(t,n,r,i){var o,f,v,x,w,C=n;2!==b&&(b=2,u&&e.clearTimeout(u),c=void 0,s=i||"",T.readyState=t>0?4:0,o=t>=200&&t<300||304===t,r&&(x=Y(d,T,r)),x=J(d,x,T,o),o?(d.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(pe.lastModified[a]=w),w=T.getResponseHeader("etag"),w&&(pe.etag[a]=w)),204===t||"HEAD"===d.type?C="nocontent":304===t?C="notmodified":(C=x.state,f=x.data,v=x.error,o=!v)):(v=C,!t&&C||(C="error",t<0&&(t=0))),T.status=t,T.statusText=(n||C)+"",o?g.resolveWith(p,[f,C,T]):g.rejectWith(p,[T,C,v]),T.statusCode(y),y=void 0,l&&h.trigger(o?"ajaxSuccess":"ajaxError",[T,d,o?f:v]),m.fireWith(p,[T,C]),l&&(h.trigger("ajaxComplete",[T,d]),--pe.active||pe.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,d=pe.ajaxSetup({},n),p=d.context||d,h=d.context&&(p.nodeType||p.jquery)?pe(p):pe.event,g=pe.Deferred(),m=pe.Callbacks("once memory"),y=d.statusCode||{},v={},x={},b=0,w="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!f)for(f={};t=Ut.exec(s);)f[t[1].toLowerCase()]=t[2];t=f[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=x[n]=x[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)y[t]=[y[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||w;return c&&c.abort(t),r(0,t),this}};if(g.promise(T).complete=m.add,T.success=T.done,T.error=T.fail,d.url=((t||d.url||en)+"").replace(zt,"").replace(Jt,tn[1]+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=pe.trim(d.dataType||"*").toLowerCase().match(De)||[""],null==d.crossDomain&&(i=Gt.exec(d.url.toLowerCase()),d.crossDomain=!(!i||i[1]===tn[1]&&i[2]===tn[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(tn[3]||("http:"===tn[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=pe.param(d.data,d.traditional)),U(Kt,d,n,T),2===b)return T;l=pe.event&&d.global,l&&0===pe.active++&&pe.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Yt.test(d.type),a=d.url,d.hasContent||(d.data&&(a=d.url+=(It.test(a)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=Xt.test(a)?a.replace(Xt,"$1_="+Wt++):a+(It.test(a)?"&":"?")+"_="+Wt++)),d.ifModified&&(pe.lastModified[a]&&T.setRequestHeader("If-Modified-Since",pe.lastModified[a]),pe.etag[a]&&T.setRequestHeader("If-None-Match",pe.etag[a])),(d.data&&d.hasContent&&d.contentType!==!1||n.contentType)&&T.setRequestHeader("Content-Type",d.contentType),T.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Zt+"; q=0.01":""):d.accepts["*"]);for(o in d.headers)T.setRequestHeader(o,d.headers[o]);if(d.beforeSend&&(d.beforeSend.call(p,T,d)===!1||2===b))return T.abort();w="abort";for(o in{success:1,error:1,complete:1})T[o](d[o]);if(c=U(Qt,d,n,T)){if(T.readyState=1,l&&h.trigger("ajaxSend",[T,d]),2===b)return T;d.async&&d.timeout>0&&(u=e.setTimeout(function(){T.abort("timeout")},d.timeout));try{b=1,c.send(v,r)}catch(C){if(!(b<2))throw C;r(-1,C)}}else r(-1,"No Transport");return T},getJSON:function(e,t,n){return pe.get(e,t,n,"json")},getScript:function(e,t){return pe.get(e,void 0,t,"script")}}),pe.each(["get","post"],function(e,t){pe[t]=function(e,n,r,i){return pe.isFunction(n)&&(i=i||r,r=n,n=void 0),pe.ajax(pe.extend({url:e,type:t,dataType:i,data:n,success:r},pe.isPlainObject(e)&&e))}}),pe._evalUrl=function(e){return pe.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},pe.fn.extend({wrapAll:function(e){if(pe.isFunction(e))return this.each(function(t){pe(this).wrapAll(e.call(this,t))});if(this[0]){var t=pe(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return pe.isFunction(e)?this.each(function(t){pe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=pe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=pe.isFunction(e);return this.each(function(n){pe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){pe.nodeName(this,"body")||pe(this).replaceWith(this.childNodes)}).end()}}),pe.expr.filters.hidden=function(e){return fe.reliableHiddenOffsets()?e.offsetWidth<=0&&e.offsetHeight<=0&&!e.getClientRects().length:K(e)},pe.expr.filters.visible=function(e){return!pe.expr.filters.hidden(e)};var nn=/%20/g,rn=/\[\]$/,on=/\r?\n/g,an=/^(?:submit|button|image|reset|file)$/i,sn=/^(?:input|select|textarea|keygen)/i;pe.param=function(e,t){var n,r=[],i=function(e,t){t=pe.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=pe.ajaxSettings&&pe.ajaxSettings.traditional),pe.isArray(e)||e.jquery&&!pe.isPlainObject(e))pe.each(e,function(){i(this.name,this.value)});else for(n in e)Q(n,e[n],t,i);return r.join("&").replace(nn,"+")},pe.fn.extend({serialize:function(){return pe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=pe.prop(this,"elements");return e?pe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!pe(this).is(":disabled")&&sn.test(this.nodeName)&&!an.test(e)&&(this.checked||!Be.test(e))}).map(function(e,t){var n=pe(this).val();return null==n?null:pe.isArray(n)?pe.map(n,function(e){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),pe.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return this.isLocal?ee():re.documentMode>8?Z():/^(get|post|head|put|delete|options)$/i.test(this.type)&&Z()||ee()}:Z;var un=0,ln={},cn=pe.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in ln)ln[e](void 0,!0)}),fe.cors=!!cn&&"withCredentials"in cn,cn=fe.ajax=!!cn,cn&&pe.ajaxTransport(function(t){if(!t.crossDomain||fe.cors){var n;return{send:function(r,i){var o,a=t.xhr(),s=++un;if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)void 0!==r[o]&&a.setRequestHeader(o,r[o]+"");a.send(t.hasContent&&t.data||null),n=function(e,r){var o,u,l;if(n&&(r||4===a.readyState))if(delete ln[s],n=void 0,a.onreadystatechange=pe.noop,r)4!==a.readyState&&a.abort();else{l={},o=a.status,"string"==typeof a.responseText&&(l.text=a.responseText);try{u=a.statusText}catch(c){u=""}o||!t.isLocal||t.crossDomain?1223===o&&(o=204):o=l.text?200:404}l&&i(o,u,l,a.getAllResponseHeaders())},t.async?4===a.readyState?e.setTimeout(n):a.onreadystatechange=ln[s]=n:n()},abort:function(){n&&n(void 0,!0)}}}}),pe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return pe.globalEval(e),e}}}),pe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),pe.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=re.head||pe("head")[0]||re.documentElement;return{send:function(r,i){t=re.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var fn=[],dn=/(=)\?(?=&|$)|\?\?/;pe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=fn.pop()||pe.expando+"_"+Wt++;return this[e]=!0,e}}),pe.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=t.jsonp!==!1&&(dn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&dn.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=pe.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(dn,"$1"+i):t.jsonp!==!1&&(t.url+=(It.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||pe.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?pe(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,fn.push(i)),a&&pe.isFunction(o)&&o(a[0]),a=o=void 0}),"script"}),pe.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||re;var r=Te.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=y([e],t,i),i&&i.length&&pe(i).remove(),pe.merge([],r.childNodes))};var pn=pe.fn.load;return pe.fn.load=function(e,t,n){if("string"!=typeof e&&pn)return pn.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=pe.trim(e.slice(s,e.length)),e=e.slice(0,s)),pe.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&pe.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?pe("
    ").append(pe.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},pe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){pe.fn[t]=function(e){return this.on(t,e)}}),pe.expr.filters.animated=function(e){return pe.grep(pe.timers,function(t){return e===t.elem}).length},pe.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=pe.css(e,"position"),f=pe(e),d={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=pe.css(e,"top"),u=pe.css(e,"left"),l=("absolute"===c||"fixed"===c)&&pe.inArray("auto",[o,u])>-1,l?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),pe.isFunction(t)&&(t=t.call(e,n,pe.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):f.css(d)}},pe.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){pe.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;if(o)return t=o.documentElement,pe.contains(t,i)?("undefined"!=typeof i.getBoundingClientRect&&(r=i.getBoundingClientRect()),n=te(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===pe.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),pe.nodeName(e[0],"html")||(n=e.offset()),n.top+=pe.css(e[0],"borderTopWidth",!0),n.left+=pe.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-pe.css(r,"marginTop",!0),left:t.left-n.left-pe.css(r,"marginLeft",!0)}}},offsetParent:function(){ +return this.map(function(){for(var e=this.offsetParent;e&&!pe.nodeName(e,"html")&&"static"===pe.css(e,"position");)e=e.offsetParent;return e||pt})}}),pe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);pe.fn[e]=function(r){return Pe(this,function(e,r,i){var o=te(e);return void 0===i?o?t in o?o[t]:o.document.documentElement[r]:e[r]:void(o?o.scrollTo(n?pe(o).scrollLeft():i,n?i:pe(o).scrollTop()):e[r]=i)},e,r,arguments.length,null)}}),pe.each(["top","left"],function(e,t){pe.cssHooks[t]=L(fe.pixelPosition,function(e,n){if(n)return n=gt(e,t),ft.test(n)?pe(e).position()[t]+"px":n})}),pe.each({Height:"height",Width:"width"},function(e,t){pe.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){pe.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return Pe(this,function(t,n,r){var i;return pe.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?pe.css(t,n,a):pe.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),pe.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),pe.fn.size=function(){return this.length},pe.fn.andSelf=pe.fn.addBack,layui.define(function(e){layui.$=pe,e("jquery",pe)}),pe});!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var t=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}(),i=e.LAYUI_GLOBAL||{};return i.layer_dir||t.substring(0,t.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c="creating",d=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(t){var n=100,a=document.getElementById(f);return++d>1e4/n?e.console&&console.error(l+".css: Invalid"):void(1989===parseInt(o.getStyle(a,"width"))?(t===c&&a.removeAttribute("lay-status"),a.getAttribute("lay-status")===c?setTimeout(u,n):i()):(a.setAttribute("lay-status",c),setTimeout(function(){u(c)},n)))}()}}},r={v:"3.6.0",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",d=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:d}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:260},n))}},s=function(e){var t=this,a=function(){t.creat()};t.index=++r.index,t.config.maxWidth=i(n).width()-30,t.config=i.extend({},t.config,o.config,e),document.body?a():setTimeout(function(){a()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],l.SHADE="layui-layer-shade",l.MOVE="layui-layer-move",s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,minStack:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),d=r.title?'
    '+(f?r.title[0]:r.title)+"
    ":"";return r.zIndex=s,t([r.shade?'
    ':"",'
    '+(e&&2!=r.type?"":d)+'
    '+(0==r.type&&r.icon!==-1?'':"")+(1==r.type&&e?"":r.content||"")+'
    '+function(){var e=c?'':"";return r.closeBtn&&(e+=''),e}()+""+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t'+r.btn[t]+"";return'
    '+e+"
    "}():"")+(r.resize?'':"")+"
    "],d,i('
    ')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,d){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i("#"+l.MOVE)[0]||c.append(o.moveElem=d),e.layero=i("#"+l[0]+a),e.shadeo=i("#"+l.SHADE+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),e.shadeo.css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():function(){e.offset(),parseInt(o.getStyle(document.getElementById(l.MOVE),"z-index"))||function(){e.layero.css("visibility","hidden"),r.ready(function(){e.offset(),e.layero.css("visibility","visible")})}()}(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var d="layer-anim "+l.anim[t.anim];e.layero.addClass(d).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(d)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,d=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:d("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,d("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),d("."+l[5])):d("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=["LAY_MOVE_DICT","LAY_RESIZE_DICT"],f=s.find(t.move),c=s.find(".layui-layer-resize");return t.move&&f.css("cursor","move"),f.on("mousedown",function(e){var n=i(this),a={};t.move&&(a.layero=s,a.config=t,a.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],n.data(l[0],a),o.eventMoveElem=n,o.moveElem.css("cursor","move").show()),e.preventDefault()}),c.on("mousedown",function(n){var a=i(this),r={};t.resize&&(r.layero=s,r.config=t,r.offset=[n.clientX,n.clientY],r.index=e.index,r.area=[s.outerWidth(),s.outerHeight()],a.data(l[1],r),o.eventResizeElem=a,o.moveElem.css("cursor","se-resize").show()),n.preventDefault()}),o.docEvent?e:(a.on("mousemove",function(e){if(o.eventMoveElem){var t=o.eventMoveElem.data(l[0])||{},i=t.layero,a=t.config,s=e.clientX-t.offset[0],f=e.clientY-t.offset[1],c="fixed"===i.css("position");if(e.preventDefault(),t.stX=c?0:n.scrollLeft(),t.stY=c?0:n.scrollTop(),!a.moveOut){var d=n.width()-i.outerWidth()+t.stX,u=n.height()-i.outerHeight()+t.stY;sd&&(s=d),fu&&(f=u)}i.css({left:s,top:f})}if(o.eventResizeElem){var t=o.eventResizeElem.data(l[1])||{},a=t.config,s=e.clientX-t.offset[0],f=e.clientY-t.offset[1];e.preventDefault(),r.style(t.index,{width:t.area[0]+s,height:t.area[1]+f}),a.resizing&&a.resizing(t.layero)}}).on("mouseup",function(e){if(o.eventMoveElem){var t=o.eventMoveElem.data(l[0])||{},i=t.config;o.eventMoveElem.removeData(l[0]),delete o.eventMoveElem,o.moveElem.hide(),i.moveEnd&&i.moveEnd(t.layero)}o.eventResizeElem&&(o.eventResizeElem.removeData(l[1]),delete o.eventResizeElem,o.moveElem.hide())}),o.docEvent=!0,e)},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n,t);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index,t)}):a.success(n,t.index,t)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n,t):a.btn1?a.btn1(t.index,n,t):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n,t);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&t.shadeo.on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n,t.index,t);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n,t.index,t)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n,t.index,t)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){t=t||{};var a=i("#"+l[0]+e),s=i("#"+l.SHADE+e),f=a.find(l[1]).outerHeight()||0,c=a.attr("minLeft")||181*o.minIndex+"px",d=a.css("position"),u={width:180,height:f,position:"fixed",overflow:"hidden"};o.record(a),o.minLeft[0]&&(c=o.minLeft[0],o.minLeft.shift()),t.minStack&&(u.left=c,u.top=n.height()-f,a.attr("minLeft")||o.minIndex++,a.attr("minLeft",c)),a.attr("position",d),r.style(e,u,!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),s.hide()},r.restore=function(e){var t=i("#"+l[0]+e),n=i("#"+l.SHADE+e),a=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(a[0]),height:parseFloat(a[1]),top:parseFloat(a[2]),left:parseFloat(a[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e),n.show()},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e,t){var n=i("#"+l[0]+e),a=n.attr("type"),s="layer-anim-close";if(n[0]){var f="layui-layer-wrap",c=function(){if(a===o.type[1]&&"object"===n.attr("conType")){n.children(":not(."+l[5]+")").remove();for(var r=n.find("."+f),s=0;s<2;s++)r.unwrap();r.css("display",r.data("display")).removeClass(f)}else{if(a===o.type[2])try{var c=i("#"+l[4]+e)[0];c.contentWindow.document.write(""),c.contentWindow.close(),n.find("."+l[5])[0].removeChild(c)}catch(d){}n[0].innerHTML="",n.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e],"function"==typeof t&&t()};n.data("isOutAnim")&&n.addClass("layer-anim "+s),i("#layui-layer-moves, #"+l.SHADE+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),n.attr("minLeft")&&(o.minIndex--,o.minLeft.push(n.attr("minLeft"))),r.ie&&r.ie<10||!n.data("isOutAnim")?c():setTimeout(function(){c()},200)}},r.closeAll=function(e,t){"function"==typeof e&&(t=e,e=null);var n=i("."+l[0]);i.each(n,function(a){var o=i(this),s=e?o.attr("type")===e:1;s&&r.close(o.attr("times"),a===n.length-1?t:null),s=null}),0===n.length&&"function"==typeof t&&t()};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return''}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(t){s=t.find(".layui-layer-input"),s.val(e.value||"").focus(),"function"==typeof f&&f(t)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:'
      '+function(){var e=t.length,i=1,a="";if(e>0)for(a='
    • '+(t[0].content||"no content")+"
    • ";i'+(t[i].content||"no content")+"";return a}()+"
    ",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=!("string"==typeof t.photos||t.photos instanceof i),f=l?t.photos:{},d=f.data||[],u=f.start||0;s.imgIndex=(0|u)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===d.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){d=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),d.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===d.length)return;if(n||p.on("click",t.img,function(){h();var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:d,tab:t.tab},full:t.full}),!0)}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=d.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>d.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(d.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev(!0)}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext(!0)}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(d[u].src,function(n){r.close(s.loadi),a&&(t.anim=-1),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]'+(d[u].alt||'+function(){return d.length>1?'
    '+(d[u].alt||"")+""+s.imgIndex+" / "+d.length+"
    ":""}()+"
    ",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imgbar"),s.event(e),t.tab&&t.tab(d[u],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
    是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){d.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){r.ready(),o.run(e.jQuery)}()}(window);layui.define(["jquery","lay"],function(e){"use strict";var n=layui.$,t=layui.hint(),i=layui.lay;e("component",function(e){e=e||{};var o=e.MOD_NAME,r=o.toUpperCase(),a="LAY_"+r+"_MOD_INDEX",c=n.extend(!0,{config:e.global||{},index:layui[o]?layui[o].index+1e4:0,CONST:n.extend(!0,{MOD_NAME:o,MOD_NAME_UPPER:r,MOD_INDEX:a,CLASS_THIS:"layui-this",CLASS_HIDE:"layui-hide",CLASS_DISABLED:"layui-disabled",CLASS_NONE:"layui-none"},e.CONST),set:function(e){var t=this;return t.config=n.extend({},t.config,e),t},on:function(e,n){return layui.onevent.call(this,o,e,n)}},e.exports),f=function(){var t=this,i=t.config,o=i.id||t.index;t.id=o,f.that[o]=t;var r={config:i,id:o,reload:function(e){t.reload.call(t,e)}};return"function"==typeof e.inst&&(r=n.extend(!0,r,e.inst.call(t))),r},u=function(e){var t=this;t.index=++c.index,t.config=n.extend({},t.config,c.config,e),t.init()};return u.prototype.config=e.config,u.prototype.reload=function(e){var t=this;layui.each(e,function(e,n){"array"===layui._typeof(n)&&delete t.config[e]}),t.config=n.extend({},t.config,e),t.init(!0)},u.prototype.init=function(t){var o=this,r=o.config,f=r.elem=n(r.elem);if(f[0]){if(f.length>1)return layui.each(f,function(){c.render(n.extend({},r,{elem:this}))}),o;r.id="id"in r?r.id:o.index,f.attr("lay-options")&&(r=o.config=n.extend({},r,i.options(r.elem[0]))),"function"==typeof e.before&&e.before.call(o,o.config),(e.isEventShow&&r.show||!e.isEventShow)&&o.render(t),f.data(a,r.id),"function"==typeof e.events&&o.events()}},u.prototype.render=e.render,u.prototype.events=e.events,u.prototype.cache=function(e,n){var t=this,i=t.config,r=i.elem;if(r){var a="LAY_"+o.toUpperCase()+"_CACHE",c=r.data(a)||{};if(void 0===n)return c[e];c[e]=n,r.data(a,c)}},f.that={},f.getThis=c.getThis=function(e){var n=f.that[e];return n||t.error(e?o+" instance with ID '"+e+"' not found":"ID argument required"),n},c.Class=u,c.reload=function(e,n){var t=f.that[e];return t.reload(n),f.call(t)},c.render=function(e){var n=new u(e);return f.call(n)},c})});layui.define("jquery",function(e){"use strict";var t=layui.$,i=layui.hint(),n={fixbar:function(e){var i,n,o="layui-fixbar",r="layui-fixbar-top",a=t(document),l=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"":e.bar1,e.bar2=e.bar2===!0?"":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,""],g=t(['
      ',e.bar1?'
    • '+c[0]+"
    • ":"",e.bar2?'
    • '+c[1]+"
    • ":"",'
    • '+c[2]+"
    • ","
    "].join("")),u=g.find("."+r),s=function(){var t=a.scrollTop();t>=e.showHeight?i||(u.show(),i=1):i&&(u.hide(),i=0)};t("."+o)[0]||("object"==typeof e.css&&g.css(e.css),l.append(g),s(),g.find("li").on("click",function(){var i=t(this),n=i.attr("lay-type");"top"===n&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,n)}),a.on("scroll",function(){clearTimeout(n),n=setTimeout(function(){s()},100)}))},countdown:function(e,t,i){var n=this,o="function"==typeof t,r=new Date(e).getTime(),a=new Date(!t||o?(new Date).getTime():t).getTime(),l=r-a,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];o&&(i=t);var g=setTimeout(function(){n.countdown(e,a+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,g),l<=0&&clearTimeout(g),g},timeAgo:function(e,t){var i=this,n=[[],[]],o=(new Date).getTime()-new Date(e).getTime();return o>26784e5?(o=new Date(e),n[0][0]=i.digit(o.getFullYear(),4),n[0][1]=i.digit(o.getMonth()+1),n[0][2]=i.digit(o.getDate()),t||(n[1][0]=i.digit(o.getHours()),n[1][1]=i.digit(o.getMinutes()),n[1][2]=i.digit(o.getSeconds())),n[0].join("-")+" "+n[1].join(":")):o>=864e5?(o/1e3/60/60/24|0)+"\u5929\u524d":o>=36e5?(o/1e3/60/60|0)+"\u5c0f\u65f6\u524d":o>=18e4?(o/1e3/60|0)+"\u5206\u949f\u524d":o<0?"\u672a\u6765":"\u521a\u521a"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var n=e.length;n/g,">").replace(/'/g,"'").replace(/"/g,""")},unescape:function(e){return void 0!==e&&null!==e||(e=""),String(e||"").replace(/\&/g,"&").replace(/\</g,"<").replace(/\>/g,">").replace(/\'/,"'").replace(/\"/,'"')},toVisibleArea:function(e){if(e=t.extend({margin:160,duration:200,type:"y"},e),e.scrollElem[0]&&e.thisElem[0]){var i=e.scrollElem,n=e.thisElem,o="y"===e.type,r=o?"scrollTop":"scrollLeft",a=o?"top":"left",l=i[r](),c=i[o?"height":"width"](),g=i.offset()[a],u=n.offset()[a]-g,s={};(u>c-e.margin||u0&&t.unshift(""),t.join(" ")}()+">"+(a.title||"unnaming")+"";return s[0]?s.before(r):n.append(r),o.append('
    '+(a.content||"")+"
    "),b.hideTabMore(!0),b.tabAuto(),this},s.prototype.tabDelete=function(t,a){var e=".layui-tab-title",l=i(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.find('>li[lay-id="'+a+'"]');return b.tabDelete(null,s),this},s.prototype.tabChange=function(t,a){var e=".layui-tab-title",l=i(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.find('>li[lay-id="'+a+'"]');return b.tabClick.call(s[0],null,null,s),this},s.prototype.tab=function(t){t=t||{},m.on("click",t.headerElem,function(a){var e=i(this).index();b.tabClick.call(this,a,e,null,t)})},s.prototype.progress=function(t,a){var e="layui-progress",l=i("."+e+"[lay-filter="+t+"]"),n=l.find("."+e+"-bar"),s=n.find("."+e+"-text");return n.css("width",a).attr("lay-percent",a),s.text(a),this};var o=".layui-nav",r="layui-nav-item",c="layui-nav-bar",u="layui-nav-tree",y="layui-nav-child",d="layui-nav-child-c",f="layui-nav-more",h="layui-icon-down",p="layui-anim layui-anim-upbit",b={tabClick:function(t,a,s,o){o=o||{};var r=s||i(this),a=a||r.parent().children("li").index(r),c=o.headerElem?r.parent():r.parents(".layui-tab").eq(0),u=o.bodyElem?i(o.bodyElem):c.children(".layui-tab-content").children(".layui-tab-item"),y=r.find("a"),d="javascript:;"!==y.attr("href")&&"_blank"===y.attr("target"),f="string"==typeof r.attr("lay-unselect"),h=c.attr("lay-filter");d||f||(r.addClass(l).siblings().removeClass(l),u.eq(a).addClass(n).siblings().removeClass(n)),layui.event.call(this,e,"tab("+h+")",{elem:c,index:a})},tabDelete:function(t,a){var n=a||i(this).parent(),s=n.index(),o=n.parents(".layui-tab").eq(0),r=o.children(".layui-tab-content").children(".layui-tab-item"),c=o.attr("lay-filter");n.hasClass(l)&&(n.next()[0]?b.tabClick.call(n.next()[0],null,s+1):n.prev()[0]&&b.tabClick.call(n.prev()[0],null,s-1)),n.remove(),r.eq(s).remove(),setTimeout(function(){b.tabAuto()},50),layui.event.call(this,e,"tabDelete("+c+")",{elem:o,index:s})},tabAuto:function(){var t="layui-tab-more",e="layui-tab-bar",l="layui-tab-close",n=this;i(".layui-tab").each(function(){var s=i(this),o=s.children(".layui-tab-title"),r=(s.children(".layui-tab-content").children(".layui-tab-item"),'lay-stope="tabmore"'),c=i('');if(n===window&&8!=a.ie&&b.hideTabMore(!0),s.attr("lay-allowClose")&&o.find("li").each(function(){var t=i(this);if(!t.find("."+l)[0]){var a=i('');a.on("click",b.tabDelete),t.append(a)}}),"string"!=typeof s.attr("lay-unauto"))if(o.prop("scrollWidth")>o.outerWidth()+1){if(o.find("."+e)[0])return;o.append(c),s.attr("overflow",""),c.on("click",function(i){o[this.title?"removeClass":"addClass"](t),this.title=this.title?"":"\u6536\u7f29"})}else o.find("."+e).remove(),s.removeAttr("overflow")})},hideTabMore:function(t){var a=i(".layui-tab-title");t!==!0&&"tabmore"===i(t.target).attr("lay-stope")||(a.removeClass("layui-tab-more"),a.find(".layui-tab-bar").attr("title",""))},clickThis:function(){var t=i(this),a=t.parents(o),n=a.attr("lay-filter"),s=t.parent(),c=t.siblings("."+y),d="string"==typeof s.attr("lay-unselect");"javascript:;"!==t.attr("href")&&"_blank"===t.attr("target")||d||c[0]||(a.find("."+l).removeClass(l),s.addClass(l)),a.hasClass(u)&&(c.removeClass(p),c[0]&&(s["none"===c.css("display")?"addClass":"removeClass"](r+"ed"),"all"===a.attr("lay-shrink")&&s.siblings().removeClass(r+"ed"))),layui.event.call(this,e,"nav("+n+")",t)},collapse:function(){var t=i(this),a=t.find(".layui-colla-icon"),l=t.siblings(".layui-colla-content"),s=t.parents(".layui-collapse").eq(0),o=s.attr("lay-filter"),r="none"===l.css("display");if("string"==typeof s.attr("lay-accordion")){var c=s.children(".layui-colla-item").children("."+n);c.siblings(".layui-colla-title").children(".layui-colla-icon").html(""),c.removeClass(n)}l[r?"addClass":"removeClass"](n),a.html(r?"":""),layui.event.call(this,e,"collapse("+o+")",{title:t,content:l,show:r})}};s.prototype.init=function(t,e){var l=function(){return e?'[lay-filter="'+e+'"]':""}(),s={tab:function(){b.tabAuto.call({})},nav:function(){var t=200,e={},s={},v={},m="layui-nav-title",C=function(l,o,r){var c=i(this),h=c.find("."+y);if(o.hasClass(u)){if(!h[0]){var b=c.children("."+m);l.css({top:c.offset().top-o.offset().top,height:(b[0]?b:c).outerHeight(),opacity:1})}}else h.addClass(p),h.hasClass(d)&&h.css({left:-(h.outerWidth()-c.width())/2}),h[0]?l.css({left:l.position().left+l.width()/2,width:0,opacity:0}):l.css({left:c.position().left+parseFloat(c.css("marginLeft")),top:c.position().top+c.height()-l.height()}),e[r]=setTimeout(function(){l.css({width:h[0]?0:c.width(),opacity:h[0]?0:1})},a.ie&&a.ie<10?0:t),clearTimeout(v[r]),"block"===h.css("display")&&clearTimeout(s[r]),s[r]=setTimeout(function(){h.addClass(n),c.find("."+f).addClass(f+"d")},300)};i(o+l).each(function(a){var l=i(this),o=i(''),d=l.find("."+r);if(!l.find("."+c)[0]){var p=l.hasClass(u)?d.find("dd,>."+m):d;l.append(o),p.on("mouseenter",function(){C.call(this,o,l,a)}).on("mouseleave",function(){l.hasClass(u)?o.css({height:0,opacity:0}):(clearTimeout(s[a]),s[a]=setTimeout(function(){l.find("."+y).removeClass(n),l.find("."+f).removeClass(f+"d")},300))}),l.on("mouseleave",function(){clearTimeout(e[a]),v[a]=setTimeout(function(){l.hasClass(u)||o.css({width:0,left:o.position().left+o.width()/2,opacity:0})},t)})}d.find("a").each(function(){var t=i(this),a=(t.parent(),t.siblings("."+y));a[0]&&!t.children("."+f)[0]&&t.append(''),t.off("click",b.clickThis).on("click",b.clickThis)})})},breadcrumb:function(){var t=".layui-breadcrumb";i(t+l).each(function(){var t=i(this),a="lay-separator",e=t.attr(a)||"/",l=t.find("a");l.next("span["+a+"]")[0]||(l.each(function(t){t!==l.length-1&&i(this).after(""+e+"")}),t.css("visibility","visible"))})},progress:function(){var t="layui-progress";i("."+t+l).each(function(){var a=i(this),e=a.find(".layui-progress-bar"),l=e.attr("lay-percent");e.css("width",function(){return/^.+\/.+$/.test(l)?100*new Function("return "+l)()+"%":l}()),a.attr("lay-showPercent")&&setTimeout(function(){e.html(''+l+"")},350)})},collapse:function(){var t="layui-collapse";i("."+t+l).each(function(){var t=i(this).find(".layui-colla-item");t.each(function(){var t=i(this),a=t.find(".layui-colla-title"),e=t.find(".layui-colla-content"),l="none"===e.css("display");a.find(".layui-colla-icon").remove(),a.append(''+(l?"":"")+""),a.off("click",b.collapse).on("click",b.collapse)})})}};return s[t]?s[t]():layui.each(s,function(t,i){i()})},s.prototype.render=s.prototype.init;var v=new s,m=i(document);i(function(){v.render()});var C=".layui-tab-title li";m.on("click",C,b.tabClick),m.on("click",b.hideTabMore),i(window).on("resize",b.tabAuto),t(e,v)});layui.define("layer",function(e){"use strict";var t=layui.$,i=layui.layer,n=layui.hint(),o=layui.device(),a={config:{},set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,l,e,t)}},r=function(){var e=this;return{upload:function(t){e.upload.call(e,t)},reload:function(t){e.reload.call(e,t)},config:e.config}},l="upload",u="layui-upload-file",c="layui-upload-form",f="layui-upload-iframe",s="layui-upload-choose",p=function(e){var i=this;i.config=t.extend({},i.config,a.config,e),i.render()};p.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",force:"",field:"file",acceptMime:"",method:"post",data:{},drag:!0,size:0,number:0,multiple:!1},p.prototype.render=function(e){var i=this,e=i.config;e.elem=t(e.elem),e.bindAction=t(e.bindAction),i.file(),i.events()},p.prototype.file=function(){var e=this,i=e.config,n=e.elemFile=t(['"].join("")),a=i.elem.next();(a.hasClass(u)||a.hasClass(c))&&a.remove(),o.ie&&o.ie<10&&i.elem.wrap('
    '),e.isFile()?(e.elemFile=i.elem,i.field=i.elem[0].name):i.elem.after(n),o.ie&&o.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,i=e.config,n=t(''),o=t(['
    ',"
    "].join(""));t("#"+f)[0]||t("body").append(n),i.elem.next().hasClass(c)||(e.elemFile.wrap(o),i.elem.next("."+c).append(function(){var e=[];return layui.each(i.data,function(t,i){i="function"==typeof i?i():i,e.push('')}),e.join("")}()))},p.prototype.msg=function(e){return i.msg(e,{icon:2,shift:6})},p.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},p.prototype.preview=function(e){var t=this;window.FileReader&&layui.each(t.chooseFiles,function(t,i){var n=new FileReader;n.readAsDataURL(i),n.onload=function(){e&&e(t,i,this.result)}})},p.prototype.upload=function(e,i){var n,a=this,r=a.config,l=a.elemFile[0],u=function(){var i=0,n=0,o=e||a.files||a.chooseFiles||l.files,u=function(){r.multiple&&i+n===a.fileLength&&"function"==typeof r.allDone&&r.allDone({total:a.fileLength,successful:i,aborted:n})};layui.each(o,function(e,o){var l=new FormData;l.append(r.field,o),layui.each(r.data,function(e,t){t="function"==typeof t?t():t,l.append(e,t)});var c={url:r.url,type:"post",data:l,contentType:!1,processData:!1,dataType:"json",headers:r.headers||{},success:function(t){i++,d(e,t),u()},error:function(t){n++,a.msg("Request URL is abnormal: "+(t.statusText||"error")),m(e),u()}};"function"==typeof r.progress&&(c.xhr=function(){var i=t.ajaxSettings.xhr();return i.upload.addEventListener("progress",function(t){if(t.lengthComputable){var i=Math.floor(t.loaded/t.total*100);r.progress(i,r.item?r.item[0]:r.elem[0],t,e)}}),i}),t.ajax(c)})},c=function(){var e=t("#"+f);a.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var t,i=e.contents().find("body");try{t=i.text()}catch(n){a.msg("Cross-domain requests are not supported"),clearInterval(p.timer),m()}t&&(clearInterval(p.timer),i.html(""),d(0,t))},30)},d=function(e,t){if(a.elemFile.next("."+s).remove(),l.value="","json"===r.force&&"object"!=typeof t)try{t=JSON.parse(t)}catch(i){return t={},a.msg("Please return JSON data format")}"function"==typeof r.done&&r.done(t,e||0,function(e){a.upload(e)})},m=function(e){r.auto&&(l.value=""),"function"==typeof r.error&&r.error(e||0,function(e){a.upload(e)})},h=r.exts,v=function(){var t=[];return layui.each(e||a.chooseFiles,function(e,i){t.push(i.name)}),t}(),g={preview:function(e){a.preview(e)},upload:function(e,t){var i={};i[e]=t,a.upload(i)},pushFile:function(){return a.files=a.files||{},layui.each(a.chooseFiles,function(e,t){a.files[e]=t}),a.files},resetFile:function(e,t,i){var n=new File([t],i);a.files=a.files||{},a.files[e]=n}},y=function(){if(!(("choose"===i||r.auto)&&(r.choose&&r.choose(g),"choose"===i)||r.before&&r.before(g)===!1))return o.ie?o.ie>9?u():c():void u()},F={file:"\u6587\u4ef6",images:"\u56fe\u7247",video:"\u89c6\u9891",audio:"\u97f3\u9891"}[r.accept]||"\u6587\u4ef6";if(v=0===v.length?l.value.match(/[^\/\\]+\..+/g)||[]||"":v,0!==v.length){switch(r.accept){case"file":layui.each(v,function(e,t){if(h&&!RegExp(".\\.("+h+")$","i").test(escape(t)))return n=!0});break;case"video":layui.each(v,function(e,t){if(!RegExp(".\\.("+(h||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(t)))return n=!0});break;case"audio":layui.each(v,function(e,t){if(!RegExp(".\\.("+(h||"mp3|wav|mid")+")$","i").test(escape(t)))return n=!0});break;default:layui.each(v,function(e,t){if(!RegExp(".\\.("+(h||"jpg|png|gif|bmp|jpeg")+")$","i").test(escape(t)))return n=!0})}if(n)return a.msg("\u9009\u62e9\u7684"+F+"\u4e2d\u5305\u542b\u4e0d\u652f\u6301\u7684\u683c\u5f0f"),l.value="";if(a.fileLength=function(){var t=0,i=e||a.files||a.chooseFiles||l.files;return layui.each(i,function(){t++}),t}(),r.number&&a.fileLength>r.number)return a.msg("\u540c\u65f6\u6700\u591a\u53ea\u80fd\u9009\u62e9 "+r.number+" \u4e2a\u6587\u4ef6");if(r.size>0&&!(o.ie&&o.ie<10)){var b;if(layui.each(a.chooseFiles,function(e,t){if(t.size>1024*r.size){var i=r.size/1024;i=i>=1?i.toFixed(2)+"MB":r.size+"KB",l.value="",b=i}}),b)return a.msg("\u6587\u4ef6\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 "+b)}y()}},p.prototype.reload=function(e){e=e||{},delete e.elem,delete e.bindAction;var i=this,e=i.config=t.extend({},i.config,a.config,e),n=e.elem.next();n.attr({name:e.name,accept:e.acceptMime,multiple:e.multiple})},p.prototype.events=function(){var e=this,i=e.config,a=function(t){e.chooseFiles={},layui.each(t,function(t,i){var n=(new Date).getTime();e.chooseFiles[n+"-"+t]=i})},r=function(t,n){var o=e.elemFile,a=(i.item?i.item:i.elem,t.length>1?t.length+"\u4e2a\u6587\u4ef6":(t[0]||{}).name||o[0].value.match(/[^\/\\]+\..+/g)||[]||"");o.next().hasClass(s)&&o.next().remove(),e.upload(null,"choose"),e.isFile()||i.choose||o.after(''+a+"")};i.elem.off("upload.start").on("upload.start",function(){var o=t(this),a=o.attr("lay-data");if(a)try{a=new Function("return "+a)(),e.config=t.extend({},i,a)}catch(r){n.error("Upload element property lay-data configuration item has a syntax error: "+a)}e.config.item=o,e.elemFile[0].click()}),o.ie&&o.ie<10||i.elem.off("upload.over").on("upload.over",function(){var e=t(this);e.attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){var e=t(this);e.removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(n,o){var l=t(this),u=o.originalEvent.dataTransfer.files||[];l.removeAttr("lay-over"),a(u),i.auto?e.upload(u):r(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var t=this.files||[];a(t),i.auto?e.upload():r(t)}),i.bindAction.off("upload.action").on("upload.action",function(){e.upload()}),i.elem.data("haveEvents")||(e.elemFile.on("change",function(){t(this).trigger("upload.change")}),i.elem.on("click",function(){e.isFile()||t(this).trigger("upload.start")}),i.drag&&i.elem.on("dragover",function(e){e.preventDefault(),t(this).trigger("upload.over")}).on("dragleave",function(e){t(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),t(this).trigger("upload.drop",e)}),i.bindAction.on("click",function(){t(this).trigger("upload.action")}),i.elem.data("haveEvents",!0))},a.render=function(e){var t=new p(e);return r.call(t)},e(l,a)});layui.define(["jquery","laytpl","lay","component"],function(e){"use strict";var i=layui.$,t=layui.laytpl,n=(layui.hint(),layui.device()),a=n.mobile?"click":"mousedown",l=layui.component({MOD_NAME:"dropdown",config:{trigger:"click",content:"",className:"",style:"",show:!1,isAllowSpread:!0,isSpreadItem:!0,data:[],delay:300},CONST:{RETURN_REMOVE:"REMOVE",STR_ELEM:"layui-dropdown",STR_ITEM_UP:"layui-menu-item-up",STR_ITEM_DOWN:"layui-menu-item-down",STR_MENU_TITLE:"layui-menu-body-title",STR_ITEM_GROUP:"layui-menu-item-group",STR_ITEM_PARENT:"layui-menu-item-parent",STR_ITEM_DIV:"layui-menu-item-divider",STR_ITEM_CHECKED:"layui-menu-item-checked",STR_ITEM_CHECKED2:"layui-menu-item-checked2",STR_MENU_PANEL:"layui-menu-body-panel",STR_MENU_PANEL_L:"layui-menu-body-panel-left",TRIGGER_NAME:"LAY_DROPDOWN_ELEM_callback"},isEventShow:!0,before:function(e){"hover"===e.trigger&&(e.trigger="mouseenter")},render:function(e){var n=this,r=n.config,m=i("body"),s=function(){var e=i('
      ');return r.data.length>0?d(e,r.data):e.html('
    • no menu
    • '),e},d=function(e,n){return layui.each(n,function(n,a){var o=a.child&&a.child.length>0,u="isSpreadItem"in a?a.isSpreadItem:r.isSpreadItem,m=a.templet?t(a.templet).render(a):r.templet?t(r.templet).render(a):a.title,s=function(){return o&&(a.type=a.type||"parent"),a.type?{group:"group",parent:"parent","-":"-"}[a.type]||"parent":""}();if("-"===s||a.title||a.id||o){var T=i(["",function(){var e="href"in a?''+m+"":m;return o?'
      '+e+function(){return"parent"===s?'':"group"===s&&r.isAllowSpread?'':""}()+"
      ":'
      '+e+"
      "}(),""].join(""));if(T.data("item",a),o){var c=i('
      '),p=i("
        ");"parent"===s?(c.append(d(p,a.child)),T.append(c)):T.append(d(p,a.child))}e.append(T)}}),e},T=['
        ',"
        "].join("");("contextmenu"===r.trigger||lay.isTopElem(r.elem[0]))&&(e=!0),n.elemView=i(T),n.elemView.append(r.content||s()),r.className&&n.elemView.addClass(r.className),r.style&&n.elemView.attr("style",r.style),r.component&&n.elemView.attr("lay-component",r.component),l.thisId=r.id,n.remove(),m.append(n.elemView),r.elem.data(l.CONST.MOD_INDEX+"_opened",!0),n.position(),o.prevElem=n.elemView,o.prevElem.data("prevElem",r.elem),n.elemView.find(".layui-menu").on(a,function(e){layui.stope(e)}),n.elemView.find(".layui-menu li").on("click",function(e){var t=i(this),a=t.data("item")||{},l=a.child&&a.child.length>0;return l||"-"===a.type||(n.remove(),"function"==typeof r.click&&r.click(a,t)),"function"==typeof r.clickItem&&r.clickItem(a,t),!1}),n.elemView.find(u).on("click",function(e){var t=i(this),n=t.parent(),a=n.data("item")||{};"group"===a.type&&r.isAllowSpread&&o.spread(n)}),"mouseenter"===r.trigger&&n.elemView.on("mouseenter",function(){clearTimeout(o.timer)}).on("mouseleave",function(){n.delayRemove()})},events:function(){var e=this,i=e.config;i.elem.off(i.trigger,i.elem.data(l.CONST.TRIGGER_NAME)),i.elem.data(l.CONST.TRIGGER_NAME,function(t){if(clearTimeout(o.timer),e.e=t,t.preventDefault(),i.elem.data(l.CONST.MOD_INDEX+"_opened")){var n=i.elem.prop("tagName").toLowerCase(),a=("input"===n||"textarea"===n)&&!i.elem.attr("readonly");return void("mouseenter"===i.trigger||a||e.remove())}e.render(),"function"==typeof i.ready&&i.ready(e.elemView,i.elem,t.target)}),i.elem.on(i.trigger,i.elem.data(l.CONST.TRIGGER_NAME)),"mouseenter"===i.trigger&&i.elem.on("mouseleave",function(){e.delayRemove()})},inst:function(){var e=this;return{close:function(){e.remove.call(e)},elemView:e.elemView}},exports:{close:function(e){var i=l.getThis(e);return i?(i.remove(),i):this}}}),o={},r=l.Class,u="."+l.CONST.STR_ITEM_GROUP+">."+l.CONST.STR_MENU_TITLE;r.prototype.position=function(e){var i=this,t=i.config;lay.position(t.elem[0],i.elemView[0],{position:t.position,e:i.e,clickType:"contextmenu"===t.trigger?"right":null,align:t.align||null})},r.prototype.remove=function(){var e=this,i=e.config,t=o.prevElem;t&&(t.data("prevElem")&&t.data("prevElem").data(l.CONST.MOD_INDEX+"_opened",!1),t.remove(),"function"==typeof i.close&&i.close())},r.prototype.delayRemove=function(){var e=this,i=e.config;clearTimeout(o.timer),o.timer=setTimeout(function(){e.remove()},i.delay)},o.spread=function(e){var i=e.children("."+l.CONST.STR_MENU_TITLE).find(".layui-icon");e.hasClass(l.CONST.STR_ITEM_UP)?(e.removeClass(l.CONST.STR_ITEM_UP).addClass(l.CONST.STR_ITEM_DOWN),i.removeClass("layui-icon-down").addClass("layui-icon-up")):(e.removeClass(l.CONST.STR_ITEM_DOWN).addClass(l.CONST.STR_ITEM_UP),i.removeClass("layui-icon-up").addClass("layui-icon-down"))},!function(){var e=i(window),t=i(document);e.on("resize",function(){if(l.thisId){var e=l.getThis(l.thisId);if(e){if(!e.elemView||!e.elemView[0]||!i("."+l.CONST.STR_ELEM)[0])return!1;var t=e.config;"contextmenu"===t.trigger?e.remove():e.position()}}}),t.on(a,function(e){if(l.thisId){var i=l.getThis(l.thisId);if(i){var t=i.config;!lay.isTopElem(t.elem[0])&&"contextmenu"!==t.trigger&&(e.target===t.elem[0]||t.elem.find(e.target)[0]||i.elemView&&e.target===i.elemView[0]||i.elemView&&i.elemView.find(e.target)[0])||i.remove()}}});var n=".layui-menu:not(.layui-dropdown-menu) li";t.on("click",n,function(e){var t=i(this),n=t.parents(".layui-menu").eq(0),a=t.hasClass(l.CONST.STR_ITEM_GROUP)||t.hasClass(l.CONST.STR_ITEM_PARENT),o=n.attr("lay-filter")||n.attr("id"),r=lay.options(this);t.hasClass(l.CONST.STR_ITEM_DIV)||a||(n.find("."+l.CONST.STR_ITEM_CHECKED).removeClass(l.CONST.STR_ITEM_CHECKED),n.find("."+l.CONST.STR_ITEM_CHECKED2).removeClass(l.CONST.STR_ITEM_CHECKED2),t.addClass(l.CONST.STR_ITEM_CHECKED),t.parents("."+l.CONST.STR_ITEM_PARENT).addClass(l.CONST.STR_ITEM_CHECKED2),layui.event.call(this,l.CONST.MOD_NAME,"click("+o+")",r))}),t.on("click",n+u,function(e){var t=i(this),n=t.parents("."+l.CONST.STR_ITEM_GROUP+":eq(0)"),a=lay.options(n[0]);"isAllowSpread"in a&&!a.isAllowSpread||o.spread(n)});var r=".layui-menu ."+l.CONST.STR_ITEM_PARENT;t.on("mouseenter",r,function(t){var n=i(this),a=n.find("."+l.CONST.STR_MENU_PANEL);if(a[0]){var o=a[0].getBoundingClientRect();o.right>e.width()&&(a.addClass(l.CONST.STR_MENU_PANEL_L),o=a[0].getBoundingClientRect(),o.left<0&&a.removeClass(l.CONST.STR_MENU_PANEL_L)),o.bottom>e.height()&&a.eq(0).css("margin-top",-(o.bottom-e.height()))}}).on("mouseleave",r,function(e){var t=i(this),n=t.children("."+l.CONST.STR_MENU_PANEL);n.removeClass(l.CONST.STR_MENU_PANEL_L),n.css("margin-top",0)})}(),e(l.CONST.MOD_NAME,l)});layui.define("jquery",function(e){"use strict";var i=layui.jquery,t={config:{},index:layui.slider?layui.slider.index+1e4:0,set:function(e){var t=this;return t.config=i.extend({},t.config,e),t},on:function(e,i){return layui.onevent.call(this,n,e,i)}},a=function(){var e=this,i=e.config;return{setValue:function(t,a){return i.value=t,e.slide("set",t,a||0)},config:i}},n="slider",l="layui-disabled",s="layui-slider",r="layui-slider-bar",o="layui-slider-wrap",u="layui-slider-wrap-btn",d="layui-slider-tips",v="layui-slider-input",c="layui-slider-input-txt",p="layui-slider-input-btn",m="layui-slider-hover",f=function(e){var a=this;a.index=++t.index,a.config=i.extend({},a.config,t.config,e),a.render()};f.prototype.config={type:"default",min:0,max:100,value:0,step:1,showstep:!1,tips:!0,input:!1,range:!1,height:200,disabled:!1,theme:"#009688"},f.prototype.render=function(){var e=this,t=e.config;if(t.step<1&&(t.step=1),t.maxt.min?a:t.min,t.value[1]=n>t.min?n:t.min,t.value[0]=t.value[0]>t.max?t.max:t.value[0],t.value[1]=t.value[1]>t.max?t.max:t.value[1];var r=Math.floor((t.value[0]-t.min)/(t.max-t.min)*100),v=Math.floor((t.value[1]-t.min)/(t.max-t.min)*100),p=v-r+"%";r+="%",v+="%"}else{"object"==typeof t.value&&(t.value=Math.min.apply(null,t.value)),t.valuet.max&&(t.value=t.max);var p=Math.floor((t.value-t.min)/(t.max-t.min)*100)+"%"}var m=t.disabled?"#c2c2c2":t.theme,f='
        '+(t.tips?'
        ':"")+'
        '+(t.range?'
        ':"")+"
        ",h=i(t.elem),y=h.next("."+s);if(y[0]&&y.remove(),e.elemTemp=i(f),t.range?(e.elemTemp.find("."+o).eq(0).data("value",t.value[0]),e.elemTemp.find("."+o).eq(1).data("value",t.value[1])):e.elemTemp.find("."+o).data("value",t.value),h.html(e.elemTemp),"vertical"===t.type&&e.elemTemp.height(t.height+"px"),t.showstep){for(var g=(t.max-t.min)/t.step,b="",x=1;x
        ')}e.elemTemp.append(b)}if(t.input&&!t.range){var w=i('
        ');h.css("position","relative"),h.append(w),h.find("."+c).children("input").val(t.value),"vertical"===t.type?w.css({left:0,top:-48}):e.elemTemp.css("margin-right",w.outerWidth()+15)}t.disabled?(e.elemTemp.addClass(l),e.elemTemp.find("."+u).addClass(l)):e.slide(),e.elemTemp.find("."+u).on("mouseover",function(){var a="vertical"===t.type?t.height:e.elemTemp[0].offsetWidth,n=e.elemTemp.find("."+o),l="vertical"===t.type?a-i(this).parent()[0].offsetTop-n.height():i(this).parent()[0].offsetLeft,s=l/a*100,r=i(this).parent().data("value"),u=t.setTips?t.setTips(r):r;e.elemTemp.find("."+d).html(u),"vertical"===t.type?e.elemTemp.find("."+d).css({bottom:s+"%","margin-bottom":"20px",display:"inline-block"}):e.elemTemp.find("."+d).css({left:s+"%",display:"inline-block"})}).on("mouseout",function(){e.elemTemp.find("."+d).css("display","none")})},f.prototype.slide=function(e,t,a){var n=this,l=n.config,s=n.elemTemp,f=function(){return"vertical"===l.type?l.height:s[0].offsetWidth},h=s.find("."+o),y=s.next("."+v),g=y.children("."+c).children("input").val(),b=100/((l.max-l.min)/Math.ceil(l.step)),x=function(e,i){e=Math.ceil(e)*b>100?Math.ceil(e)*b:Math.round(e)*b,e=e>100?100:e,h.eq(i).css("vertical"===l.type?"bottom":"left",e+"%");var t=T(h[0].offsetLeft),a=l.range?T(h[1].offsetLeft):0;"vertical"===l.type?(s.find("."+d).css({bottom:e+"%","margin-bottom":"20px"}),t=T(f()-h[0].offsetTop-h.height()),a=l.range?T(f()-h[1].offsetTop-h.height()):0):s.find("."+d).css("left",e+"%"),t=t>100?100:t,a=a>100?100:a;var n=Math.min(t,a),o=Math.abs(t-a);"vertical"===l.type?s.find("."+r).css({height:o+"%",bottom:n+"%"}):s.find("."+r).css({width:o+"%",left:n+"%"});var u=l.min+Math.round((l.max-l.min)*e/100);if(g=u,y.children("."+c).children("input").val(g),h.eq(i).data("value",u),s.find("."+d).html(l.setTips?l.setTips(u):u),l.range){var v=[h.eq(0).data("value"),h.eq(1).data("value")];v[0]>v[1]&&v.reverse()}l.change&&l.change(l.range?v:u)},T=function(e){var i=e/f()*100/b,t=Math.round(i)*b;return e==f()&&(t=Math.ceil(i)*b),t},w=i(['
        f()&&(r=f());var o=r/f()*100/b;x(o,e),t.addClass(m),s.find("."+d).show(),i.preventDefault()},o=function(){t.removeClass(m),s.find("."+d).hide()};M(r,o)})}),s.on("click",function(e){var t=i("."+u);if(!t.is(event.target)&&0===t.has(event.target).length&&t.length){var a,n="vertical"===l.type?f()-e.clientY+i(this).offset().top:e.clientX-i(this).offset().left;n<0&&(n=0),n>f()&&(n=f());var s=n/f()*100/b;a=l.range?"vertical"===l.type?Math.abs(n-parseInt(i(h[0]).css("bottom")))>Math.abs(n-parseInt(i(h[1]).css("bottom")))?1:0:Math.abs(n-h[0].offsetLeft)>Math.abs(n-h[1].offsetLeft)?1:0:0,x(s,a),e.preventDefault()}}),y.children("."+p).children("i").each(function(e){i(this).on("click",function(){g=y.children("."+c).children("input").val(),g=1==e?g-l.stepl.max?l.max:Number(g)+l.step;var i=(g-l.min)/(l.max-l.min)*100/b;x(i,0)})});var q=function(){var e=this.value;e=isNaN(e)?0:e,e=el.max?l.max:e,this.value=e;var i=(e-l.min)/(l.max-l.min)*100/b;x(i,0)};y.children("."+c).children("input").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),q.call(this))}).on("change",q)},f.prototype.events=function(){var e=this;e.config},t.render=function(e){var i=new f(e);return a.call(i)},e(n,t)});layui.define(["jquery","lay"],function(e){"use strict";var i=layui.jquery,r=layui.lay,o=layui.device(),n=o.mobile?"click":"mousedown",l={config:{},index:layui.colorpicker?layui.colorpicker.index+1e4:0,set:function(e){var r=this;return r.config=i.extend({},r.config,e),r},on:function(e,i){return layui.onevent.call(this,"colorpicker",e,i)}},t=function(){var e=this,i=e.config;return{config:i}},c="colorpicker",a="layui-show",s="layui-colorpicker",f=".layui-colorpicker-main",d="layui-icon-down",u="layui-icon-close",p="layui-colorpicker-trigger-span",g="layui-colorpicker-trigger-i",v="layui-colorpicker-side",h="layui-colorpicker-side-slider",b="layui-colorpicker-basis",k="layui-colorpicker-alpha-bgcolor",y="layui-colorpicker-alpha-slider",m="layui-colorpicker-basis-cursor",x="layui-colorpicker-main-input",P=function(e){var i={h:0,s:0,b:0},r=Math.min(e.r,e.g,e.b),o=Math.max(e.r,e.g,e.b),n=o-r;return i.b=o,i.s=0!=o?255*n/o:0,0!=i.s?e.r==o?i.h=(e.g-e.b)/n:e.g==o?i.h=2+(e.b-e.r)/n:i.h=4+(e.r-e.g)/n:i.h=-1,o==r&&(i.h=0),i.h*=60,i.h<0&&(i.h+=360),i.s*=100/255,i.b*=100/255,i},C=function(e){var e=e.indexOf("#")>-1?e.substring(1):e;if(3==e.length){var i=e.split("");e=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]}e=parseInt(e,16);var r={r:e>>16,g:(65280&e)>>8,b:255&e};return P(r)},B=function(e){var i={},r=e.h,o=255*e.s/100,n=255*e.b/100;if(0==o)i.r=i.g=i.b=n;else{var l=n,t=(255-o)*n/255,c=(l-t)*(r%60)/60;360==r&&(r=0),r<60?(i.r=l,i.b=t,i.g=t+c):r<120?(i.g=l,i.b=t,i.r=l-c):r<180?(i.g=l,i.r=t,i.b=t+c):r<240?(i.b=l,i.r=t,i.g=l-c):r<300?(i.b=l,i.g=t,i.r=t+c):r<360?(i.r=l,i.g=t,i.b=l-c):(i.r=0,i.g=0,i.b=0)}return{r:Math.round(i.r),g:Math.round(i.g),b:Math.round(i.b)}},w=function(e){var r=B(e),o=[r.r.toString(16),r.g.toString(16),r.b.toString(16)];return i.each(o,function(e,i){1==i.length&&(o[e]="0"+i)}),o.join("")},D=function(e){var i=/[0-9]{1,3}/g,r=e.match(i)||[];return{r:r[0],g:r[1],b:r[2]}},j=i(window),E=i(document),F=function(e){var r=this;r.index=++l.index,r.config=i.extend({},r.config,l.config,e),r.render()};F.prototype.config={color:"",size:null,alpha:!1,format:"hex",predefine:!1,colors:["#009688","#5FB878","#1E9FFF","#FF5722","#FFB800","#01AAED","#999","#c00","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","rgb(0, 186, 189)","rgb(255, 120, 0)","rgb(250, 212, 0)","#393D49","rgba(0,0,0,.5)","rgba(255, 69, 0, 0.68)","rgba(144, 240, 144, 0.5)","rgba(31, 147, 255, 0.73)"]},F.prototype.render=function(){var e=this,r=e.config,o=i(['
        ',"",'3&&(r.alpha&&"rgb"==r.format||(e="#"+w(P(D(r.color))))),"background: "+e):e}()+'">','',"","","
        "].join("")),n=i(r.elem);r.size&&o.addClass("layui-colorpicker-"+r.size),n.addClass("layui-inline").html(e.elemColorBox=o),e.color=e.elemColorBox.find("."+p)[0].style.background,e.events()},F.prototype.renderPicker=function(){var e=this,r=e.config,o=e.elemColorBox[0],n=e.elemPicker=i(['
        ','
        ','
        ','
        ','
        ','
        ',"
        ",'
        ','
        ',"
        ","
        ",'
        ','
        ','
        ',"
        ","
        ",function(){if(r.predefine){var e=['
        '];return layui.each(r.colors,function(i,r){e.push(['
        ','
        ',"
        "].join(""))}),e.push("
        "),e.join("")}return""}(),'
        ','
        ','',"
        ",'
        ','','',"","
        "].join(""));e.elemColorBox.find("."+p)[0];i(f)[0]&&i(f).data("index")==e.index?e.removePicker(F.thisElemInd):(e.removePicker(F.thisElemInd),i("body").append(n)),F.thisElemInd=e.index,F.thisColor=o.style.background,e.position(),e.pickerEvents()},F.prototype.removePicker=function(e){var r=this,o=r.config;e=e||r.index;var n=i("#layui-colorpicker"+e);return n[0]&&(n.remove(),"function"==typeof o.close&&o.close(r)),r},F.prototype.position=function(){var e=this,i=e.config;return r.position(e.bindElem||e.elemColorBox[0],e.elemPicker[0],{position:i.position,align:"center"}),e},F.prototype.val=function(){var e=this,i=(e.config,e.elemColorBox.find("."+p)),r=e.elemPicker.find("."+x),o=i[0],n=o.style.backgroundColor;if(n){var l=P(D(n)),t=i.attr("lay-type");if(e.select(l.h,l.s,l.b),"torgb"===t&&r.find("input").val(n),"rgba"===t){var c=D(n);if(3==(n.match(/[0-9]{1,3}/g)||[]).length)r.find("input").val("rgba("+c.r+", "+c.g+", "+c.b+", 1)"),e.elemPicker.find("."+y).css("left",280);else{r.find("input").val(n);var a=280*n.slice(n.lastIndexOf(",")+1,n.length-1);e.elemPicker.find("."+y).css("left",a)}e.elemPicker.find("."+k)[0].style.background="linear-gradient(to right, rgba("+c.r+", "+c.g+", "+c.b+", 0), rgb("+c.r+", "+c.g+", "+c.b+"))"}}else e.select(0,100,100),r.find("input").val(""),e.elemPicker.find("."+k)[0].style.background="",e.elemPicker.find("."+y).css("left",280)},F.prototype.side=function(){var e=this,r=e.config,o=e.elemColorBox.find("."+p),n=o.attr("lay-type"),l=e.elemPicker.find("."+v),t=e.elemPicker.find("."+h),c=e.elemPicker.find("."+b),a=e.elemPicker.find("."+m),s=e.elemPicker.find("."+k),f=e.elemPicker.find("."+y),C=t[0].offsetTop/180*360,w=100-(a[0].offsetTop+3)/180*100,E=(a[0].offsetLeft+3)/260*100,F=Math.round(f[0].offsetLeft/280*100)/100,H=e.elemColorBox.find("."+g),M=e.elemPicker.find(".layui-colorpicker-pre").children("div"),Y=function(i,l,t,c){e.select(i,l,t);var a=B({h:i,s:l,b:t});if(H.addClass(d).removeClass(u),o[0].style.background="rgb("+a.r+", "+a.g+", "+a.b+")","torgb"===n&&e.elemPicker.find("."+x).find("input").val("rgb("+a.r+", "+a.g+", "+a.b+")"),"rgba"===n){var p=0;p=280*c,f.css("left",p),e.elemPicker.find("."+x).find("input").val("rgba("+a.r+", "+a.g+", "+a.b+", "+c+")"),o[0].style.background="rgba("+a.r+", "+a.g+", "+a.b+", "+c+")",s[0].style.background="linear-gradient(to right, rgba("+a.r+", "+a.g+", "+a.b+", 0), rgb("+a.r+", "+a.g+", "+a.b+"))"}r.change&&r.change(e.elemPicker.find("."+x).find("input").val())},I=i(['
        '].join("")),L=function(e){i("#LAY-colorpicker-moving")[0]||i("body").append(I),I.on("mousemove",e),I.on("mouseup",function(){I.remove()}).on("mouseleave",function(){I.remove()})};t.on("mousedown",function(e){var i=this.offsetTop,r=e.clientY,o=function(e){var o=i+(e.clientY-r),n=l[0].offsetHeight;o<0&&(o=0),o>n&&(o=n);var t=o/180*360;C=t,Y(t,E,w,F),e.preventDefault()};L(o),e.preventDefault()}),l.on("click",function(e){var r=e.clientY-i(this).offset().top;r<0&&(r=0),r>this.offsetHeight&&(r=this.offsetHeight);var o=r/180*360;C=o,Y(o,E,w,F),e.preventDefault()}),a.on("mousedown",function(e){var i=this.offsetTop,r=this.offsetLeft,o=e.clientY,n=e.clientX,l=function(e){var l=i+(e.clientY-o),t=r+(e.clientX-n),a=c[0].offsetHeight-3,s=c[0].offsetWidth-3;l<-3&&(l=-3),l>a&&(l=a),t<-3&&(t=-3),t>s&&(t=s);var f=(t+3)/260*100,d=100-(l+3)/180*100;w=d,E=f,Y(C,f,d,F),e.preventDefault()};layui.stope(e),L(l),e.preventDefault()}),c.on("mousedown",function(e){var r=e.clientY-i(this).offset().top-3+j.scrollTop(),o=e.clientX-i(this).offset().left-3+j.scrollLeft();r<-3&&(r=-3),r>this.offsetHeight-3&&(r=this.offsetHeight-3),o<-3&&(o=-3),o>this.offsetWidth-3&&(o=this.offsetWidth-3);var n=(o+3)/260*100,l=100-(r+3)/180*100;w=l,E=n,Y(C,n,l,F),layui.stope(e),e.preventDefault(),a.trigger(e,"mousedown")}),f.on("mousedown",function(e){var i=this.offsetLeft,r=e.clientX,o=function(e){var o=i+(e.clientX-r),n=s[0].offsetWidth;o<0&&(o=0),o>n&&(o=n);var l=Math.round(o/280*100)/100;F=l,Y(C,E,w,l),e.preventDefault()};L(o),e.preventDefault()}),s.on("click",function(e){var r=e.clientX-i(this).offset().left;r<0&&(r=0),r>this.offsetWidth&&(r=this.offsetWidth);var o=Math.round(r/280*100)/100;F=o,Y(C,E,w,o),e.preventDefault()}),M.each(function(){i(this).on("click",function(){i(this).parent(".layui-colorpicker-pre").addClass("selected").siblings().removeClass("selected");var e,r=this.style.backgroundColor,o=P(D(r)),n=r.slice(r.lastIndexOf(",")+1,r.length-1);C=o.h,E=o.s,w=o.b,3==(r.match(/[0-9]{1,3}/g)||[]).length&&(n=1),F=n,e=280*n,Y(o.h,o.s,o.b,n)})})},F.prototype.select=function(e,i,r,o){var n=this,l=(n.config,w({h:e,s:100,b:100})),t=w({h:e,s:i,b:r}),c=e/360*180,a=180-r/100*180-3,s=i/100*260-3;n.elemPicker.find("."+h).css("top",c),n.elemPicker.find("."+b)[0].style.background="#"+l,n.elemPicker.find("."+m).css({top:a,left:s}),"change"!==o&&n.elemPicker.find("."+x).find("input").val("#"+t)},F.prototype.pickerEvents=function(){var e=this,r=e.config,o=e.elemColorBox.find("."+p),n=e.elemPicker.find("."+x+" input"),l={clear:function(i){o[0].style.background="",e.elemColorBox.find("."+g).removeClass(d).addClass(u),e.color="",r.done&&r.done(""),e.removePicker()},confirm:function(i,l){var t=n.val(),c=t,a={};if(t.indexOf(",")>-1){if(a=P(D(t)),e.select(a.h,a.s,a.b),o[0].style.background=c="#"+w(a),(t.match(/[0-9]{1,3}/g)||[]).length>3&&"rgba"===o.attr("lay-type")){var s=280*t.slice(t.lastIndexOf(",")+1,t.length-1);e.elemPicker.find("."+y).css("left",s),o[0].style.background=t,c=t}}else a=C(t),o[0].style.background=c="#"+w(a),e.elemColorBox.find("."+g).removeClass(u).addClass(d);return"change"===l?(e.select(a.h,a.s,a.b,l),void(r.change&&r.change(c))):(e.color=t,r.done&&r.done(t),void e.removePicker())}};e.elemPicker.on("click","*[colorpicker-events]",function(){var e=i(this),r=e.attr("colorpicker-events");l[r]&&l[r].call(this,e)}),n.on("keyup",function(e){var r=i(this);l.confirm.call(this,r,13===e.keyCode?null:"change")})},F.prototype.events=function(){var e=this,r=e.config,o=e.elemColorBox.find("."+p);e.elemColorBox.on("click",function(){e.renderPicker(),i(f)[0]&&(e.val(),e.side())}),r.elem[0]&&!e.elemColorBox[0].eventHandler&&(E.on(n,function(r){if(!i(r.target).hasClass(s)&&!i(r.target).parents("."+s)[0]&&!i(r.target).hasClass(f.replace(/\./g,""))&&!i(r.target).parents(f)[0]&&e.elemPicker){if(e.color){var n=P(D(e.color));e.select(n.h,n.s,n.b)}else e.elemColorBox.find("."+g).removeClass(d).addClass(u);o[0].style.background=e.color||"",e.removePicker()}}),j.on("resize",function(){return!(!e.elemPicker||!i(f)[0])&&void e.position()}),e.elemColorBox[0].eventHandler=!0)},l.render=function(e){var i=new F(e);return t.call(i)},e(c,l)});layui.define("layer",function(e){"use strict";var t=layui.$,i=layui.layer,a=layui.hint(),n=layui.device(),l="form",r=".layui-form",o="layui-this",s="layui-hide",c="layui-disabled",u=function(){this.config={verify:{required:[/[\S]+/,"\u5fc5\u586b\u9879\u4e0d\u80fd\u4e3a\u7a7a"],phone:[/^1\d{10}$/,"\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u624b\u673a\u53f7"],email:[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"\u90ae\u7bb1\u683c\u5f0f\u4e0d\u6b63\u786e"],url:[/^(#|(http(s?)):\/\/|\/\/)[^\s]+\.[^\s]+$/,"\u94fe\u63a5\u683c\u5f0f\u4e0d\u6b63\u786e"],number:function(e){if(!e||isNaN(e))return"\u53ea\u80fd\u586b\u5199\u6570\u5b57"},date:[/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,"\u65e5\u671f\u683c\u5f0f\u4e0d\u6b63\u786e"],identity:[/(^\d{15}$)|(^\d{17}(x|X|\d)$)/,"\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u8eab\u4efd\u8bc1\u53f7"]},autocomplete:null}};u.prototype.set=function(e){var i=this;return t.extend(!0,i.config,e),i},u.prototype.verify=function(e){var i=this;return t.extend(!0,i.config.verify,e),i},u.prototype.getFormElem=function(e){return t(r+function(){return e?'[lay-filter="'+e+'"]':""}())},u.prototype.on=function(e,t){return layui.onevent.call(this,l,e,t)},u.prototype.val=function(e,i){var a=this,n=a.getFormElem(e);return n.each(function(e,a){var n=t(this);layui.each(i,function(e,t){var i,a=n.find('[name="'+e+'"]');a[0]&&(i=a[0].type,"checkbox"===i?a[0].checked=t:"radio"===i?a.each(function(){this.value==t&&(this.checked=!0)}):a.val(t))})}),f.render(null,e),a.getValue(e)},u.prototype.getValue=function(e,i){i=i||this.getFormElem(e);var a={},n={},l=i.find("input,select,textarea");return layui.each(l,function(e,i){var l;t(this);if(i.name=(i.name||"").replace(/^\s*|\s*&/,""),i.name){if(/^.*\[\]$/.test(i.name)){var r=i.name.match(/^(.*)\[\]$/g)[0];a[r]=0|a[r],l=i.name.replace(/^(.*)\[\]$/,"$1["+a[r]++ +"]")}/^checkbox|radio$/.test(i.type)&&!i.checked||(n[l||i.name]=i.value)}}),n},u.prototype.render=function(e,i){var n=this,u=n.config,d=t(r+function(){return i?'[lay-filter="'+i+'"]':""}()),f={input:function(){var e=d.find("input,textarea");u.autocomplete&&e.attr("autocomplete",u.autocomplete),d.find("input[lay-affix],textarea[lay-affix]").each(function(){var e=t(this),i=e.attr("lay-affix"),a="layui-input-suffix",n=e.next("."+a),r=function(e,i){e&&e[t.trim(i)?"removeClass":"addClass"](s)},o=function(a){n.remove(),n=t(['
        ','',"
        "].join("")),e.after(n),r(n,e.val()),e.on("input propertychange",function(){var e=this.value;r(n,e)}),n.on("click",function(){var t=e.attr("lay-filter");c[i]&&c[i][1].call(this),layui.event.call(this,l,"input-affix("+t+")",{elem:e[0],affix:i})})},c={clear:[function(){o("clear")},function(){e.val("").focus(),r(n,null)}],eye:[function(){o("eye")},function(){var t="LAY_FORM_INPUT_AFFIX_SHOW",i=e.data(t);e.attr("type",i?"password":"text").data(t,!i),o(i?"eye":"eye-invisible")}]};c[i]&&c[i][0]()})},select:function(){var e,i="\u8bf7\u9009\u62e9",a="layui-form-select",n="layui-select-title",r="layui-select-none",u="",f=d.find("select"),v=function(i,l){t(i.target).parent().hasClass(n)&&!l||(t("."+a).removeClass(a+"ed "+a+"up"),e&&u&&e.val(u)),e=null},y=function(i,d,f){var y,p=t(this),m=i.find("."+n),x=m.find("input"),g=i.find("dl"),k=g.children("dd"),b=this.selectedIndex;if(!d){var C=function(){var e=i.offset().top+i.outerHeight()+5-h.scrollTop(),t=g.outerHeight();b=p[0].selectedIndex,i.addClass(a+"ed"),k.removeClass(s),y=null,k.eq(b).addClass(o).siblings().removeClass(o),e+t>h.height()&&e>=t&&i.addClass(a+"up"),T()},w=function(e){i.removeClass(a+"ed "+a+"up"),x.blur(),y=null,e||$(x.val(),function(e){var i=p[0].selectedIndex;e&&(u=t(p[0].options[i]).html(),0===i&&u===x.attr("placeholder")&&(u=""),x.val(u||""))})},T=function(){var e=g.children("dd."+o);if(e[0]){var t=e.position().top,i=g.height(),a=e.height();t>i&&g.scrollTop(t+g.scrollTop()-i+a-5),t<0&&g.scrollTop(t+g.scrollTop()-5)}};m.on("click",function(e){i.hasClass(a+"ed")?w():(v(e,!0),C()),g.find("."+r).remove()}),m.find(".layui-edge").on("click",function(){x.focus()}),x.on("keyup",function(e){var t=e.keyCode;9===t&&C()}).on("keydown",function(e){var t=e.keyCode;9===t&&w();var i=function(t,a){var n,l;e.preventDefault();var r=function(){var e=g.children("dd."+o);if(g.children("dd."+s)[0]&&"next"===t){var i=g.children("dd:not(."+s+",."+c+")"),n=i.eq(0).index();if(n>=0&&n\u65e0\u5339\u914d\u9879

        '):g.find("."+r).remove()},"keyup"),""===t&&g.find("."+r).remove(),void T())};f&&x.on("keyup",F).on("blur",function(i){var a=p[0].selectedIndex;e=x,u=t(p[0].options[a]).html(),0===a&&u===x.attr("placeholder")&&(u=""),setTimeout(function(){$(x.val(),function(e){u||x.val("")},"blur")},200)}),k.on("click",function(){var e=t(this),a=e.attr("lay-value"),n=p.attr("lay-filter");return!e.hasClass(c)&&(e.hasClass("layui-select-tips")?x.val(""):(x.val(e.text()),e.addClass(o)),e.siblings().removeClass(o),p.val(a).removeClass("layui-form-danger"),layui.event.call(this,l,"select("+n+")",{elem:p[0],value:a,othis:i}),w(!0),!1)}),i.find("dl>dt").on("click",function(e){return!1}),t(document).off("click",v).on("click",v)}};f.each(function(e,l){var r=t(this),s=r.next("."+a),u=this.disabled,d=l.value,f=t(l.options[l.selectedIndex]),v=l.options[0];if("string"==typeof r.attr("lay-ignore"))return r.show();var h="string"==typeof r.attr("lay-search"),p=v?v.value?i:v.innerHTML||i:i,m=t(['
        ','
        ','','
        ','
        ',function(e){var a=[];return layui.each(e,function(e,n){0!==e||n.value?"optgroup"===n.tagName.toLowerCase()?a.push("
        "+n.label+"
        "):a.push('
        '+t.trim(n.innerHTML)+"
        "):a.push('
        '+t.trim(n.innerHTML||i)+"
        ")}),0===a.length&&a.push('
        \u6ca1\u6709\u9009\u9879
        '),a.join("")}(r.find("*"))+"
        ","
        "].join(""));s[0]&&s.remove(),r.after(m),y.call(this,m,u,h)})},checkbox:function(){var e={checkbox:["layui-form-checkbox","layui-form-checked","checkbox"],_switch:["layui-form-switch","layui-form-onswitch","switch"]},i=d.find("input[type=checkbox]"),a=function(e,i){var a=t(this);e.on("click",function(){var t=a.attr("lay-filter"),n=(a.attr("lay-text")||"").split("|");a[0].disabled||(a[0].checked?(a[0].checked=!1,e.removeClass(i[1]).find("em").text(n[1])):(a[0].checked=!0,e.addClass(i[1]).find("em").text(n[0])),layui.event.call(a[0],l,i[2]+"("+t+")",{elem:a[0],value:a[0].value,othis:e}))})};i.each(function(i,n){var l=t(this),r=l.attr("lay-skin"),o=(l.attr("lay-text")||"").split("|"),s=this.disabled;"switch"===r&&(r="_"+r);var u=e[r]||e.checkbox;if("string"==typeof l.attr("lay-ignore"))return l.show();var d=l.next("."+u[0]),f=t(['
        ",function(){var e=n.title.replace(/\s/g,""),t={checkbox:[e?""+n.title+"":"",''].join(""),_switch:""+((n.checked?o[0]:o[1])||"")+""};return t[r]||t.checkbox}(),"
        "].join(""));d[0]&&d.remove(),l.after(f),a.call(this,f,u)})},radio:function(){var e="layui-form-radio",i=["",""],a=d.find("input[type=radio]"),n=function(a){var n=t(this),o="layui-anim-scaleSpring";a.on("click",function(){var s=n[0].name,c=n.parents(r),u=n.attr("lay-filter"),d=c.find("input[name="+s.replace(/(\.|#|\[|\])/g,"\\$1")+"]");n[0].disabled||(layui.each(d,function(){var a=t(this).next("."+e);this.checked=!1,a.removeClass(e+"ed"),a.find(".layui-icon").removeClass(o).html(i[1])}),n[0].checked=!0,a.addClass(e+"ed"),a.find(".layui-icon").addClass(o).html(i[0]),layui.event.call(n[0],l,"radio("+u+")",{elem:n[0],value:n[0].value,othis:a}))})};a.each(function(a,l){var r=t(this),o=r.next("."+e),s=this.disabled;if("string"==typeof r.attr("lay-ignore"))return r.show();o[0]&&o.remove();var u=t(['
        ',''+i[l.checked?0:1]+"","
        "+function(){var e=l.title||"";return"string"==typeof r.next().attr("lay-radio")&&(e=r.next().html()),e}()+"
        ","
        "].join(""));r.after(u),n.call(this,u)})}};return e?f[e]?f[e]():a.error('\u4e0d\u652f\u6301\u7684 "'+e+'" \u8868\u5355\u6e32\u67d3'):layui.each(f,function(e,t){t()}),n};var d=u.prototype.submit=function(e,a){var o=t(this),s="string"==typeof e?e:o.attr("lay-filter"),c=this.getFormElem?this.getFormElem(s):o.parents(r).eq(0),u=c.find("*[lay-verify]"),d=null,h=f.config.verify,y="layui-form-danger",p={};if(layui.each(u,function(e,a){var l=t(this),r=l.attr("lay-verify").split("|"),o=l.attr("lay-verType"),s=l.val();if(l.removeClass(y),layui.each(r,function(e,t){var r,c="",u="function"==typeof h[t];if(h[t]){var r=u?c=h[t](s,a):!h[t][0].test(s),f="select"===a.tagName.toLowerCase()||/^checkbox|radio$/.test(a.type);if(c=c||h[t][1],"required"===t&&(c=l.attr("lay-reqText")||c),r)return"tips"===o?i.tips(c,function(){return"string"!=typeof l.attr("lay-ignore")&&f?l.next():l}(),{tips:1}):"alert"===o?i.alert(c,{title:"\u63d0\u793a",shadeClose:!0}):/\bstring|number\b/.test(typeof c)&&i.msg(c,{icon:5,shift:6}),n.mobile?v.scrollTop(function(){try{return(f?l.next():l).offset().top-15}catch(e){return 0}}()):setTimeout(function(){(f?l.next().find("input"):a).focus()},7),l.addClass(y),d=!0}}),d)return d}),d)return!1;p=f.getValue(null,c);var m={elem:this.getFormElem?window.event&&window.event.target:this,form:this.getFormElem?c[0]:o.parents("form")[0],field:p};return"function"==typeof a&&a(m),layui.event.call(this,l,"submit("+s+")",m)},f=new u,v=t(document),h=t(window);t(function(){f.render()}),v.on("reset",r,function(){var e=t(this).attr("lay-filter");setTimeout(function(){f.render(null,e)},50)}),v.on("submit",r,d).on("click","*[lay-submit]",d),e(l,f)});layui.define(["laypage","component","dropdown","form","util"],function(i){"use strict";var e=layui.$,l=(layui.hint(),layui.laypage),t=layui.dropdown,c=layui.form,n=layui.util,o=layui.component({MOD_NAME:"icon",config:{type:"fontclass",fontfamily:"layui-icon",replace:!0,isSplit:!1,search:!0,page:!0},CONST:{elem:"layui-iconpicker",split:"layui-iconpicker-split",down:"layui-iconpicker-down",wrap:"layui-form layui-input-wrap layui-input-wrap-prefix",scroll:"layui-iconpicker-scroll",page:"layui-iconpicker-page",search:"layui-iconpicker-search",list:"layui-iconpicker-list"},before:function(i){var e=this,l=i.elem;i.data="array"===layui._typeof(i.data)?i.data:e.data,i.value=l.val()||i.value,i.title=l.attr("title")||i.title,i.placeholder=l.attr("placeholder")||i.placeholder},render:function(i){var l=this,n=l.config,a=n.elem,s=l.elemReview=e(['
        ',function(){var i=[];return!n.value||n.replace!==!0&&"icon"!==n.replace||i.push(''+("unicode"===n.type?n.value:"")+""),!n.title||n.replace!==!0&&"title"!==n.replace||i.push(''+n.title+""),n.value||n.title||!n.placeholder||i.push(''+n.placeholder+""),i.length>0&&(i.unshift('
        '),i.push("
        ")),i.join("")}(),'','',"","
        "].join(""));n.replace?(a.next().hasClass(o.CONST.elem)&&a.next().remove(),a.addClass(o.CONST.CLASS_HIDE).after(s),n.className&&s.addClass(n.className),n.style&&s.attr("style",n.style)):s=a,l.elemView=e('
        '),l.elemViewSearch=e(['
        ','
        ','
        ','',"
        ",'',"
        ","
        "].join("")),l.elemViewList=e('
        '),l.elemViewPage=e('
        '),n.search&&l.elemView.append(l.elemViewSearch),l.elemView.append(l.elemViewList),n.page?l.elemView.append(l.elemViewPage):l.elemView.addClass(o.CONST.scroll),l.renderData(),t.render(e.extend({},n,{elem:s,content:l.elemView,className:"layui-iconpicker-panel",component:o.CONST.MOD_NAME,id:o.CONST.MOD_NAME_UPPER+"_"+n.id,style:null,ready:function(i){var e=l.elemView.attr("lay-filter");c.render("input",e),l.events(i),s.addClass(o.CONST.down),"function"==typeof n.ready&&n.ready(l.elemView,n.elem)},close:function(){s.removeClass(o.CONST.down),"function"==typeof n.close&&n.close()}}))},inst:function(){return{close:function(){t.close(o.CONST.MOD_ID)}}},exports:{close:function(i){var e=o.getThis(i);return e?(t.close(o.CONST.MOD_NAME_UPPER+"_"+i),e):this}}}),a=o.Class;a.prototype.renderIcon=function(i){var e=this,l=e.config,t=["
          "];i=e.thisData=i||l.data||[],layui.each(i,function(i,e){t.push("

          '+e.title+"

          ")}),i.length>0?t.push("
        "):t=['
        \u672a\u5339\u914d\u5230\u56fe\u6807
        '],e.elemViewList.html(t.join(""))},a.prototype.search=function(i){var e=this,l=e.config,t=[];i=(i||"").toLowerCase(),layui.each(l.data,function(e,c){try{var n=c.fontclass.toLowerCase(),o=c.unicode.toLowerCase(),a=c.title.toLowerCase();(n.indexOf(i)!=-1||"unicode"===l.type&&o.indexOf(i)!=-1||a.indexOf(i)!=-1)&&t.push(c)}catch(s){}}),e.renderData(i?t:null),e.cache("search",i)},a.prototype.renderData=function(i){var e=this,t=e.config;i=i||t.data||[],t.page?l.render({elem:e.elemViewPage,count:i.length,limit:12,groups:1,prev:'',next:'',layout:["count","prev","page","next"],parse:{curr:function(i,e){return i+" / "+e.pages},count:function(i,e){return"\u5171 "+i+" \u4e2a"}},curr:e.cache("pagecurr")||1,jump:function(l,t){var c=i.concat().splice(l.curr*l.limit-l.limit,l.limit);e.renderIcon(c),e.cache("pagecurr",l.curr)}}):e.renderIcon(i)},a.prototype.events=function(i){var l=this,t=l.config,a=i.find("."+o.CONST.search+" input"),s=a.attr("lay-filter");i.find("."+o.CONST.list).on("click","li",function(){var i=e(this),c=i.index(),a=l.thisData[c]||{};i.addClass(o.CONST.CLASS_THIS),t.elem.val(n.escape(a[t.type])).attr("title",a.title),o.reload(t.id),"function"==typeof t.click&&t.click(a),o.close(t.id)}),t.search&&(a.on("input propertychange",function(){l.search(this.value)}),l.cache("search")&&l.search(l.cache("search")),c.on("input-affix("+s+")",function(i){"clear"===i.affix&&(l.renderData(),l.cache("search",null))}))},a.prototype.data=[{title:"\u5b9e\u5fc3",fontclass:"layui-icon-heart-fill",unicode:""},{title:"\u7a7a\u5fc3",fontclass:"layui-icon-heart",unicode:""},{title:"\u4eae\u5ea6/\u6674",fontclass:"layui-icon-light",unicode:""},{title:"\u65f6\u95f4/\u5386\u53f2",fontclass:"layui-icon-time",unicode:""},{title:"\u84dd\u7259",fontclass:"layui-icon-bluetooth",unicode:""},{title:"@\u827e\u7279",fontclass:"layui-icon-at",unicode:""},{title:"\u9759\u97f3",fontclass:"layui-icon-mute",unicode:""},{title:"\u5f55\u97f3/\u9ea6\u514b\u98ce",fontclass:"layui-icon-mike",unicode:""},{title:"\u5bc6\u94a5/\u94a5\u5319",fontclass:"layui-icon-key",unicode:""},{title:"\u793c\u7269/\u6d3b\u52a8",fontclass:"layui-icon-gift",unicode:""},{title:"\u90ae\u7bb1",fontclass:"layui-icon-email",unicode:""},{title:"RSS",fontclass:"layui-icon-rss",unicode:""},{title:"WiFi",fontclass:"layui-icon-wifi",unicode:""},{title:"\u9000\u51fa/\u6ce8\u9500",fontclass:"layui-icon-logout",unicode:""},{title:"Android \u5b89\u5353",fontclass:"layui-icon-android",unicode:""},{title:"Apple IOS \u82f9\u679c",fontclass:"layui-icon-ios",unicode:""},{title:"Windows",fontclass:"layui-icon-windows",unicode:""},{title:"\u7a7f\u68ad\u6846",fontclass:"layui-icon-transfer",unicode:""},{title:"\u5ba2\u670d",fontclass:"layui-icon-service",unicode:""},{title:"\u51cf",fontclass:"layui-icon-subtraction",unicode:""},{title:"\u52a0",fontclass:"layui-icon-addition",unicode:""},{title:"\u6ed1\u5757",fontclass:"layui-icon-slider",unicode:""},{title:"\u6253\u5370",fontclass:"layui-icon-print",unicode:""},{title:"\u5bfc\u51fa",fontclass:"layui-icon-export",unicode:""},{title:"\u5217",fontclass:"layui-icon-cols",unicode:""},{title:"\u9000\u51fa\u5168\u5c4f",fontclass:"layui-icon-screen-restore",unicode:""},{title:"\u5168\u5c4f",fontclass:"layui-icon-screen-full",unicode:""},{title:"\u534a\u661f",fontclass:"layui-icon-rate-half",unicode:""},{title:"\u661f\u661f-\u7a7a\u5fc3",fontclass:"layui-icon-rate",unicode:""},{title:"\u661f\u661f-\u5b9e\u5fc3",fontclass:"layui-icon-rate-solid",unicode:""},{title:"\u624b\u673a",fontclass:"layui-icon-cellphone",unicode:""},{title:"\u9a8c\u8bc1\u7801",fontclass:"layui-icon-vercode",unicode:""},{title:"\u5fae\u4fe1",fontclass:"layui-icon-login-wechat",unicode:""},{title:"QQ",fontclass:"layui-icon-login-qq",unicode:""},{title:"\u5fae\u535a",fontclass:"layui-icon-login-weibo",unicode:""},{title:"\u5bc6\u7801",fontclass:"layui-icon-password",unicode:""},{title:"\u7528\u6237\u540d",fontclass:"layui-icon-username",unicode:""},{title:"\u5237\u65b0-\u7c97",fontclass:"layui-icon-refresh-3",unicode:""},{title:"\u6388\u6743",fontclass:"layui-icon-auz",unicode:""},{title:"\u5de6\u5411\u53f3\u4f38\u7f29\u83dc\u5355",fontclass:"layui-icon-spread-left",unicode:""},{title:"\u53f3\u5411\u5de6\u4f38\u7f29\u83dc\u5355",fontclass:"layui-icon-shrink-right",unicode:""},{title:"\u96ea\u82b1",fontclass:"layui-icon-snowflake",unicode:""},{title:"\u63d0\u793a\u8bf4\u660e",fontclass:"layui-icon-tips",unicode:""},{title:"\u4fbf\u7b7e",fontclass:"layui-icon-note",unicode:""},{title:"\u4e3b\u9875",fontclass:"layui-icon-home",unicode:""},{title:"\u9ad8\u7ea7",fontclass:"layui-icon-senior",unicode:""},{title:"\u5237\u65b0",fontclass:"layui-icon-refresh",unicode:""},{title:"\u5237\u65b0",fontclass:"layui-icon-refresh-1",unicode:""},{title:"\u65d7\u5e1c",fontclass:"layui-icon-flag",unicode:""},{title:"\u4e3b\u9898",fontclass:"layui-icon-theme",unicode:""},{title:"\u6d88\u606f-\u901a\u77e5",fontclass:"layui-icon-notice",unicode:""},{title:"\u7f51\u7ad9",fontclass:"layui-icon-website",unicode:""},{title:"\u63a7\u5236\u53f0",fontclass:"layui-icon-console",unicode:""},{title:"\u8868\u60c5-\u60ca\u8bb6",fontclass:"layui-icon-face-surprised",unicode:""},{title:"\u8bbe\u7f6e-\u7a7a\u5fc3",fontclass:"layui-icon-set",unicode:""},{title:"\u6a21\u677f",fontclass:"layui-icon-template-1",unicode:""},{title:"\u5e94\u7528",fontclass:"layui-icon-app",unicode:""},{title:"\u6a21\u677f",fontclass:"layui-icon-template",unicode:""},{title:"\u8d5e",fontclass:"layui-icon-praise",unicode:""},{title:"\u8e29",fontclass:"layui-icon-tread",unicode:""},{title:"\u7537",fontclass:"layui-icon-male",unicode:""},{title:"\u5973",fontclass:"layui-icon-female",unicode:""},{title:"\u76f8\u673a-\u7a7a\u5fc3",fontclass:"layui-icon-camera",unicode:""},{title:"\u76f8\u673a-\u5b9e\u5fc3",fontclass:"layui-icon-camera-fill",unicode:""},{title:"\u83dc\u5355-\u6c34\u5e73",fontclass:"layui-icon-more",unicode:""},{title:"\u83dc\u5355-\u5782\u76f4",fontclass:"layui-icon-more-vertical",unicode:""},{title:"\u91d1\u989d-\u4eba\u6c11\u5e01",fontclass:"layui-icon-rmb",unicode:""},{title:"\u91d1\u989d-\u7f8e\u5143",fontclass:"layui-icon-dollar",unicode:""},{title:"\u94bb\u77f3-\u7b49\u7ea7",fontclass:"layui-icon-diamond",unicode:""},{title:"\u706b",fontclass:"layui-icon-fire",unicode:""},{title:"\u8fd4\u56de",fontclass:"layui-icon-return",unicode:""},{title:"\u4f4d\u7f6e-\u5730\u56fe",fontclass:"layui-icon-location",unicode:""},{title:"\u529e\u516c-\u9605\u8bfb",fontclass:"layui-icon-read",unicode:""},{title:"\u8c03\u67e5",fontclass:"layui-icon-survey",unicode:""},{title:"\u8868\u60c5-\u5fae\u7b11",fontclass:"layui-icon-face-smile",unicode:""},{title:"\u8868\u60c5-\u54ed\u6ce3",fontclass:"layui-icon-face-cry",unicode:""},{title:"\u8d2d\u7269\u8f66",fontclass:"layui-icon-cart-simple",unicode:""},{title:"\u8d2d\u7269\u8f66",fontclass:"layui-icon-cart",unicode:""},{title:"\u4e0b\u4e00\u9875",fontclass:"layui-icon-next",unicode:""},{title:"\u4e0a\u4e00\u9875",fontclass:"layui-icon-prev",unicode:""},{title:"\u4e0a\u4f20-\u7a7a\u5fc3-\u62d6\u62fd",fontclass:"layui-icon-upload-drag",unicode:""},{title:"\u4e0a\u4f20-\u5b9e\u5fc3",fontclass:"layui-icon-upload",unicode:""},{title:"\u4e0b\u8f7d-\u5706\u5708",fontclass:"layui-icon-download-circle",unicode:""},{title:"\u7ec4\u4ef6",fontclass:"layui-icon-component",unicode:""},{title:"\u6587\u4ef6-\u7c97",fontclass:"layui-icon-file-b",unicode:""},{title:"\u7528\u6237",fontclass:"layui-icon-user",unicode:""},{title:"\u53d1\u73b0-\u5b9e\u5fc3",fontclass:"layui-icon-find-fill",unicode:""},{title:"loading",fontclass:"layui-icon-loading",unicode:""},{title:"loading",fontclass:"layui-icon-loading-1",unicode:""},{title:"\u6dfb\u52a0",fontclass:"layui-icon-add-1",unicode:""},{title:"\u64ad\u653e",fontclass:"layui-icon-play",unicode:""},{title:"\u6682\u505c",fontclass:"layui-icon-pause",unicode:""},{title:"\u97f3\u9891-\u8033\u673a",fontclass:"layui-icon-headset",unicode:""},{title:"\u89c6\u9891",fontclass:"layui-icon-video",unicode:""},{title:"\u8bed\u97f3-\u58f0\u97f3",fontclass:"layui-icon-voice",unicode:""},{title:"\u6d88\u606f-\u901a\u77e5-\u5587\u53ed",fontclass:"layui-icon-speaker",unicode:""},{title:"\u5220\u9664\u7ebf",fontclass:"layui-icon-fonts-del",unicode:""},{title:"\u4ee3\u7801",fontclass:"layui-icon-fonts-code",unicode:""},{title:"HTML",fontclass:"layui-icon-fonts-html",unicode:""},{title:"\u5b57\u4f53\u52a0\u7c97",fontclass:"layui-icon-fonts-strong",unicode:""},{title:"\u5220\u9664\u94fe\u63a5",fontclass:"layui-icon-unlink",unicode:""},{title:"\u56fe\u7247",fontclass:"layui-icon-picture",unicode:""},{title:"\u94fe\u63a5",fontclass:"layui-icon-link",unicode:""},{title:"\u8868\u60c5-\u7b11-\u7c97",fontclass:"layui-icon-face-smile-b",unicode:""},{title:"\u5de6\u5bf9\u9f50",fontclass:"layui-icon-align-left",unicode:""},{title:"\u53f3\u5bf9\u9f50",fontclass:"layui-icon-align-right",unicode:""},{title:"\u5c45\u4e2d\u5bf9\u9f50",fontclass:"layui-icon-align-center",unicode:""},{title:"\u5b57\u4f53-\u4e0b\u5212\u7ebf",fontclass:"layui-icon-fonts-u",unicode:""},{title:"\u5b57\u4f53-\u659c\u4f53",fontclass:"layui-icon-fonts-i",unicode:""},{title:"Tabs \u9009\u9879\u5361",fontclass:"layui-icon-tabs",unicode:""},{title:"\u5355\u9009\u6846-\u9009\u4e2d",fontclass:"layui-icon-radio",unicode:""},{title:"\u5355\u9009\u6846-\u5019\u9009",fontclass:"layui-icon-circle",unicode:""},{title:"\u7f16\u8f91",fontclass:"layui-icon-edit",unicode:""},{title:"\u5206\u4eab",fontclass:"layui-icon-share",unicode:""},{title:"\u5220\u9664",fontclass:"layui-icon-delete",unicode:""},{title:"\u8868\u5355",fontclass:"layui-icon-form",unicode:""},{title:"\u624b\u673a-\u7ec6\u4f53",fontclass:"layui-icon-cellphone-fine",unicode:""},{title:"\u804a\u5929 \u5bf9\u8bdd \u6c9f\u901a",fontclass:"layui-icon-dialogue",unicode:""},{title:"\u6587\u5b57\u683c\u5f0f\u5316",fontclass:"layui-icon-fonts-clear",unicode:""},{title:"\u7a97\u53e3",fontclass:"layui-icon-layer",unicode:""},{title:"\u65e5\u671f",fontclass:"layui-icon-date",unicode:""},{title:"\u6c34 \u4e0b\u96e8",fontclass:"layui-icon-water",unicode:""},{title:"\u4ee3\u7801-\u5706\u5708",fontclass:"layui-icon-code-circle",unicode:""},{title:"\u8f6e\u64ad\u7ec4\u56fe",fontclass:"layui-icon-carousel",unicode:""},{title:"\u7ffb\u9875",fontclass:"layui-icon-prev-circle",unicode:""},{title:"\u5e03\u5c40",fontclass:"layui-icon-layouts",unicode:""},{title:"\u5de5\u5177",fontclass:"layui-icon-util",unicode:""},{title:"\u9009\u62e9\u6a21\u677f",fontclass:"layui-icon-templeate-1",unicode:""},{title:"\u4e0a\u4f20-\u5706\u5708",fontclass:"layui-icon-upload-circle",unicode:""},{title:"\u6811",fontclass:"layui-icon-tree",unicode:""},{title:"\u8868\u683c",fontclass:"layui-icon-table",unicode:""},{title:"\u56fe\u8868",fontclass:"layui-icon-chart",unicode:""},{title:"\u56fe\u6807 \u62a5\u8868 \u5c4f\u5e55",fontclass:"layui-icon-chart-screen",unicode:""},{title:"\u5f15\u64ce",fontclass:"layui-icon-engine",unicode:""},{title:"\u4e0b\u4e09\u89d2",fontclass:"layui-icon-triangle-d",unicode:""},{title:"\u53f3\u4e09\u89d2",fontclass:"layui-icon-triangle-r",unicode:""},{title:"\u6587\u4ef6",fontclass:"layui-icon-file",unicode:""},{title:"\u8bbe\u7f6e-\u5c0f\u578b",fontclass:"layui-icon-set-sm",unicode:""},{title:"\u51cf\u5c11-\u5706\u5708",fontclass:"layui-icon-reduce-circle",unicode:""},{title:"\u6dfb\u52a0-\u5706\u5708",fontclass:"layui-icon-add-circle",unicode:""},{title:"404",fontclass:"layui-icon-404",unicode:""},{title:"\u5173\u4e8e",fontclass:"layui-icon-about",unicode:""},{title:"\u7bad\u5934 \u5411\u4e0a",fontclass:"layui-icon-up",unicode:""},{title:"\u7bad\u5934 \u5411\u4e0b",fontclass:"layui-icon-down",unicode:""},{title:"\u7bad\u5934 \u5411\u5de6",fontclass:"layui-icon-left",unicode:""},{title:"\u7bad\u5934 \u5411\u53f3",fontclass:"layui-icon-right",unicode:""},{title:"\u5706\u70b9",fontclass:"layui-icon-circle-dot",unicode:""},{title:"\u641c\u7d22",fontclass:"layui-icon-search",unicode:""},{title:"\u8bbe\u7f6e-\u5b9e\u5fc3",fontclass:"layui-icon-set-fill",unicode:""},{title:"\u7fa4\u7ec4",fontclass:"layui-icon-group",unicode:""},{title:"\u597d\u53cb",fontclass:"layui-icon-friends",unicode:""},{title:"\u56de\u590d \u8bc4\u8bba \u5b9e\u5fc3",fontclass:"layui-icon-reply-fill",unicode:""},{title:"\u83dc\u5355 \u9690\u8eab \u5b9e\u5fc3",fontclass:"layui-icon-menu-fill",unicode:""},{title:"\u8bb0\u5f55",fontclass:"layui-icon-log",unicode:""},{title:"\u56fe\u7247-\u7ec6\u4f53",fontclass:"layui-icon-picture-fine",unicode:""},{title:"\u8868\u60c5-\u7b11-\u7ec6\u4f53",fontclass:"layui-icon-face-smile-fine",unicode:""},{title:"\u5217\u8868",fontclass:"layui-icon-list",unicode:""},{title:"\u53d1\u5e03 \u7eb8\u98de\u673a",fontclass:"layui-icon-release",unicode:""},{title:"\u5bf9 OK",fontclass:"layui-icon-ok",unicode:""},{title:"\u5e2e\u52a9",fontclass:"layui-icon-help",unicode:""},{title:"\u5ba2\u670d",fontclass:"layui-icon-chat",unicode:""},{title:"top \u7f6e\u9876",fontclass:"layui-icon-top",unicode:""},{title:"\u6536\u85cf-\u7a7a\u5fc3",fontclass:"layui-icon-star",unicode:""},{title:"\u6536\u85cf-\u5b9e\u5fc3",fontclass:"layui-icon-star-fill",unicode:""},{title:"\u5173\u95ed-\u5b9e\u5fc3",fontclass:"layui-icon-close-fill",unicode:"ဇ"},{title:"\u5173\u95ed-\u7a7a\u5fc3",fontclass:"layui-icon-close",unicode:"ဆ"},{title:"\u6b63\u786e",fontclass:"layui-icon-ok-circle",unicode:"စ"},{title:"\u6dfb\u52a0-\u5706\u5708-\u7ec6\u4f53",fontclass:"layui-icon-add-circle-fine",unicode:""}],i(o.CONST.MOD_NAME,o)});layui.define(["laypage","component","dropdown","form","util"],function(t){"use strict";var e=layui.$,l=(layui.hint(),layui.laypage,layui.dropdown),i=layui.form,a=layui.util,n=layui.component({MOD_NAME:"keyboard",config:{type:"normal",isHeader:!0,title:"",style:"",keyStyle:"",single:!1,setData:{}},CONST:{elem:"layui-keyboard",header:"layui-keyboard-header",list:"layui-keyboard-list",btn:"layui-btn",headerBtn:"layui-btn layui-btn-primary layui-btn-xs"},before:function(t){var l=this;t.elem;t.data="object"==typeof t.data?t.data:l.data[t.type]||[];var i=l.initData[t.type];i&&(l.config=e.extend({},l.config,i))},render:function(t){var a=this,c=a.config;c.elem;a.elemView=e('
        '),a.elemViewHeader=e(['
        ','',""+c.title+"",'',"
        "].join("")),a.elemViewList=e('
        '),c.isHeader&&a.elemView.append(a.elemViewHeader),a.elemView.append(a.elemViewList);var o=".layui-keyboard-panel-"+c.id+" .layui-keyboard-list";lay.style({target:a.elemView[0],text:[c.style?o+"{"+c.style+"}":"",c.keyStyle?o+" li{"+c.keyStyle+"}":""].join("")}),a.setData(),a.renderData(),l.render(e.extend({},c,{elem:c.elem,content:a.elemView,className:"layui-keyboard-panel layui-keyboard-panel-"+c.id,component:n.CONST.MOD_NAME,id:n.CONST.MOD_NAME_UPPER+"_"+c.id,style:null,ready:function(t){var e=a.elemView.attr("lay-filter");i.render("input",e),a.events(t),"function"==typeof c.ready&&c.ready(a.elemView,c.elem)},close:function(){"function"==typeof c.close&&c.close()}}))},inst:function(){var t=this;return{close:function(){l.close(n.CONST.MOD_NAME_UPPER+"_"+t.id)}}},exports:{close:function(t){var e=n.getThis(t);return e?(l.close(n.CONST.MOD_NAME_UPPER+"_"+t),e):this}}}),c=n.Class;c.prototype.getValue=function(t){return t=t||{},t.value="value"in t?t.value:t.title},c.prototype.setData=function(){var t=this,l=t.config;layui.each(l.setData,function(i,a){layui.each(l.data,function(l,n){i===t.getValue(n)&&e.extend(!0,n,n,a)})}),layui.each(l.data,function(t,e){e.selected&&"function"==typeof e.selectedCall&&e.selectedCall(e,l)})},c.prototype.renderData=function(t){var l=this,i=l.config,a=["
          "];t=t||i.data||[],layui.each(t,function(t,l){l=l||{},l.type&&o[l.type]&&(l=e.extend({},o[l.type],l)),"br"===l.type?a.push("
          "):a.push("0?' class="'+t.join(" ")+'"':""}()+(l.style?' style="'+l.style+'"':"")+' data-index="'+t+'">'+(l.title||"")+"")}),t.length>0?a.push("
        "):a=['
        none
        '],l.elemViewList.html(a.join(""))},c.prototype.events=function(t){var l=this,i=l.config,c=t.find("."+n.CONST.header),s={options:i,render:function(){l.renderData()}};t.find("."+n.CONST.list).on("click","li",function(){var t=e(this),a=t.data("index"),c=i.data[a]||{},r=c.type,y=l.getValue(c),u=function(t){t=t||y,i.single?i.elem.val(t):lay(i.elem[0]).insertVal(t)},d=e.extend({keyData:c,keyElem:t,setValue:u},s);t.hasClass(n.CONST.CLASS_DISABLED)||(r?o[r]&&("function"==typeof o[r].click?o[r].click(d):u()):u(),"function"==typeof i.click&&i.click(d))}),a.event(c.find("."+n.CONST.btn),{clear:function(){i.elem.val(""),s.value=i.elem.val(),"function"==typeof i.clear&&i.clear(s)},confirm:function(){s.value=i.elem.val(),"function"==typeof i.done&&i.done(s),n.close(i.id)}})};var o=c.prototype.fnKey={br:{type:"br"},backspace:{title:'',type:"backspace",click:function(t){var e=t.options,l=e.elem;l.val(),t.keyData;lay(l[0]).deleteVal()}},decimal:{title:".",type:"decimal",style:"font-weight: 700;",click:function(t){var e=t.options,l=e.elem,i=l.val(),a=t.keyData;if("number"===e.type){if(!i)return t.setValue("0"+a.value);if(i.indexOf(a.value)!==-1)return}t.setValue()}},caps:{title:"Caps",value:"caps",type:"caps",style:"width: 65px;",selectedCall:function(t,e){var l=t.selected?"toUpperCase":"toLowerCase";layui.each(e.data,function(t,e){e.type||(e.title&&(e.title=e.title[l]()),e.value&&(e.value=e.value[l]()))})},click:function(t){var e=t.keyData;e.selected=!e.selected,this.selectedCall(e,t.options),t.render()}},space:{title:"space",type:"space",value:" ",style:"width: 135px;"}};c.prototype.data={normal:[{title:"1"},{title:"2"},{title:"3"},{title:"4"},{title:"5"},{title:"6"},{title:"7"},{title:"8"},{title:"9"},{title:"0"},o.backspace,o.br,o.decimal,{title:"q"},{title:"w"},{title:"e"},{title:"r"},{title:"t"},{title:"y"},{title:"u"},{title:"i"},{title:"o"},{title:"p"},o.br,o.caps,{title:"a"},{title:"s"},{title:"d"},{title:"f"},{title:"g"},{title:"h"},{title:"j"},{title:"k"},{title:"l"},o.br,{title:"z"},{title:"x"},{title:"c"},{title:"v"},{title:"b"},{title:"n"},{title:"m"},o.space],letter:[{title:"q"},{title:"w"},{title:"e"},{title:"r"},{title:"t"},{title:"y"},{title:"u"},{title:"i"},{title:"o"},{title:"p"},o.br,e.extend({},o.caps,{title:"\u2191",style:null}),{title:"a"},{title:"s"},{title:"d"},{title:"f"},{title:"g"},{title:"h"},{title:"j"},{title:"k"},{title:"l"},o.br,{title:"z"},{title:"x"},{title:"c"},{title:"v"},{title:"b"},{title:"n"},{title:"m"},e.extend({},o.backspace,{style:"width: 100px;"})],number:[{title:"1"},{title:"2"},{title:"3"},o.br,{title:"4"},{title:"5"},{title:"6"},o.br,{title:"7"},{title:"8"},{title:"9"},o.br,{title:"0"},o.decimal,o.backspace],province:[{title:"\u4eac"},{title:"\u6d25"},{title:"\u5180"},{title:"\u664b"},{title:"\u8499"},{title:"\u8fbd"},{title:"\u5409"},{title:"\u9ed1"},o.br,{title:"\u6caa"},{title:"\u82cf"},{title:"\u6d59"},{title:"\u7696"},{title:"\u95fd"},{title:"\u8d63"},{title:"\u9c81"},{title:"\u8c6b"},o.br,{title:"\u9102"},{title:"\u6e58"},{title:"\u7ca4"},{title:"\u6842"},{title:"\u743c"},{title:"\u5ddd"},{title:"\u8d35"},{title:"\u4e91"},o.br,{title:"\u6e1d"},{title:"\u85cf"},{title:"\u9655"},{title:"\u7518"},{title:"\u9752"},{title:"\u5b81"},{title:"\u65b0"},o.backspace]},c.prototype.initData={normal:{title:"\u9009\u62e9\u952e",style:"min-width: 400px;"},letter:{title:"\u5b57\u6bcd\u952e",style:"min-width: 365px;"},number:{title:"\u6570\u5b57\u952e",style:"min-width: 225px;",keyStyle:"width: 65px;"},province:{title:"\u9009\u62e9\u7701\u4efd",style:"min-width: 345px;",keyStyle:"width: 36px;",single:!0}},t(n.CONST.MOD_NAME,n)});layui.define("form",function(e){"use strict";var i=layui.$,a=layui.form,n=layui.layer,t="tree",r={config:{},index:layui[t]?layui[t].index+1e4:0,set:function(e){var a=this;return a.config=i.extend({},a.config,e),a},on:function(e,i){return layui.onevent.call(this,t,e,i)}},l=function(){var e=this,i=e.config,a=i.id||e.index;return l.that[a]=e,l.config[a]=i,{config:i,reload:function(i){e.reload.call(e,i)},getChecked:function(){return e.getChecked.call(e)},setChecked:function(i){return e.setChecked.call(e,i)}}},c="layui-hide",d="layui-disabled",s="layui-tree-set",o="layui-tree-iconClick",h="layui-icon-addition",u="layui-icon-subtraction",p="layui-tree-entry",f="layui-tree-main",y="layui-tree-txt",v="layui-tree-pack",C="layui-tree-spread",k="layui-tree-setLineShort",m="layui-tree-showLine",x="layui-tree-lineExtend",b=function(e){var a=this;a.index=++r.index,a.config=i.extend({},a.config,r.config,e),a.render()};b.prototype.config={data:[],showCheckbox:!1,showLine:!0,accordion:!1,onlyIconControl:!1,isJump:!1,edit:!1,text:{defaultNodeName:"\u672a\u547d\u540d",none:"\u65e0\u6570\u636e"}},b.prototype.reload=function(e){var a=this;layui.each(e,function(e,i){"array"===layui._typeof(i)&&delete a.config[e]}),a.config=i.extend(!0,{},a.config,e),a.render()},b.prototype.render=function(){var e=this,a=e.config;e.checkids=[];var n=i('
        ');e.tree(n);var t=a.elem=i(a.elem);if(t[0]){if(e.key=a.id||e.index,e.elem=n,e.elemNone=i('
        '+a.text.none+"
        "),t.html(e.elem),0==e.elem.find(".layui-tree-set").length)return e.elem.append(e.elemNone);a.showCheckbox&&e.renderForm("checkbox"),e.elem.find(".layui-tree-set").each(function(){var e=i(this);e.parent(".layui-tree-pack")[0]||e.addClass("layui-tree-setHide"),!e.next()[0]&&e.parents(".layui-tree-pack").eq(1).hasClass("layui-tree-lineExtend")&&e.addClass(k),e.next()[0]||e.parents(".layui-tree-set").eq(0).next()[0]||e.addClass(k)}),e.events()}},b.prototype.renderForm=function(e){a.render(e,"LAY-tree-"+this.index)},b.prototype.tree=function(e,a){var n=this,t=n.config,r=a||t.data;layui.each(r,function(a,r){var l=r.children&&r.children.length>0,o=i('
        "),h=i(['
        ','
        ','
        ',function(){return t.showLine?l?'':'':''}(),function(){return t.showCheckbox?'':""}(),function(){return t.isJump&&r.href?''+(r.title||r.label||t.text.defaultNodeName)+"":''+(r.title||r.label||t.text.defaultNodeName)+""}(),"
        ",function(){if(!t.edit)return"";var e={add:'',update:'',del:''},i=['
        '];return t.edit===!0&&(t.edit=["update","del"]),"object"==typeof t.edit?(layui.each(t.edit,function(a,n){i.push(e[n]||"")}),i.join("")+"
        "):void 0}(),"
        "].join(""));l&&(h.append(o),n.tree(o,r.children)),e.append(h),h.prev("."+s)[0]&&h.prev().children(".layui-tree-pack").addClass("layui-tree-showLine"),l||h.parent(".layui-tree-pack").addClass("layui-tree-lineExtend"),n.spread(h,r),t.showCheckbox&&(r.checked&&n.checkids.push(r.id),n.checkClick(h,r)),t.edit&&n.operate(h,r)})},b.prototype.spread=function(e,a){var n=this,t=n.config,r=e.children("."+p),l=r.children("."+f),c=r.find("."+o),k=r.find("."+y),m=t.onlyIconControl?c:l,x="";m.on("click",function(i){var a=e.children("."+v),n=m.children(".layui-icon")[0]?m.children(".layui-icon"):m.find(".layui-tree-icon").children(".layui-icon");if(a[0]){if(e.hasClass(C))e.removeClass(C),a.slideUp(200),n.removeClass(u).addClass(h);else if(e.addClass(C),a.slideDown(200),n.addClass(u).removeClass(h),t.accordion){var r=e.siblings("."+s);r.removeClass(C),r.children("."+v).slideUp(200),r.find(".layui-tree-icon").children(".layui-icon").removeClass(u).addClass(h)}}else x="normal"}),k.on("click",function(){var n=i(this);n.hasClass(d)||(x=e.hasClass(C)?t.onlyIconControl?"open":"close":t.onlyIconControl?"close":"open",t.click&&t.click({elem:e,state:x,data:a}))})},b.prototype.setCheckbox=function(e,i,a){var n=this,t=(n.config,a.prop("checked"));if(!a.prop("disabled")){if("object"==typeof i.children||e.find("."+v)[0]){var r=e.find("."+v).find('input[same="layuiTreeCheck"]');r.each(function(){this.disabled||(this.checked=t)})}var l=function(e){if(e.parents("."+s)[0]){var i,a=e.parent("."+v),n=a.parent(),r=a.prev().find('input[same="layuiTreeCheck"]');t?r.prop("checked",t):(a.find('input[same="layuiTreeCheck"]').each(function(){this.checked&&(i=!0)}),i||r.prop("checked",!1)),l(n)}};l(e),n.renderForm("checkbox")}},b.prototype.checkClick=function(e,a){var n=this,t=n.config,r=e.children("."+p),l=r.children("."+f);l.on("click",'input[same="layuiTreeCheck"]+',function(r){layui.stope(r);var l=i(this).prev(),c=l.prop("checked");l.prop("disabled")||(n.setCheckbox(e,a,l),t.oncheck&&t.oncheck({elem:e,checked:c,data:a}))})},b.prototype.operate=function(e,a){var t=this,r=t.config,l=e.children("."+p),d=l.children("."+f);l.children(".layui-tree-btnGroup").on("click",".layui-icon",function(l){layui.stope(l);var f=i(this).data("type"),b=e.children("."+v),g={data:a,type:f,elem:e};if("add"==f){b[0]||(r.showLine?(d.find("."+o).addClass("layui-tree-icon"),d.find("."+o).children(".layui-icon").addClass(h).removeClass("layui-icon-file")):d.find(".layui-tree-iconArrow").removeClass(c),e.append('
        '));var w=r.operate&&r.operate(g),N={};if(N.title=r.text.defaultNodeName,N.id=w,t.tree(e.children("."+v),[N]),r.showLine)if(b[0])b.hasClass(x)||b.addClass(x),e.find("."+v).each(function(){i(this).children("."+s).last().addClass(k)}),b.children("."+s).last().prev().hasClass(k)?b.children("."+s).last().prev().removeClass(k):b.children("."+s).last().removeClass(k),!e.parent("."+v)[0]&&e.next()[0]&&b.children("."+s).last().removeClass(k);else{var T=e.siblings("."+s),L=1,I=e.parent("."+v);layui.each(T,function(e,a){i(a).children("."+v)[0]||(L=0)}),1==L?(T.children("."+v).addClass(m),T.children("."+v).children("."+s).removeClass(k),e.children("."+v).addClass(m),I.removeClass(x),I.children("."+s).last().children("."+v).children("."+s).last().addClass(k)):e.children("."+v).children("."+s).addClass(k)}if(!r.showCheckbox)return;if(d.find('input[same="layuiTreeCheck"]')[0].checked){var A=e.children("."+v).children("."+s).last();A.find('input[same="layuiTreeCheck"]')[0].checked=!0}t.renderForm("checkbox")}else if("update"==f){var F=d.children("."+y).html();d.children("."+y).html(""),d.append(''),d.children(".layui-tree-editInput").val(F).focus();var j=function(e){var i=e.val().trim();i=i?i:r.text.defaultNodeName,e.remove(),d.children("."+y).html(i),g.data.title=i,r.operate&&r.operate(g)};d.children(".layui-tree-editInput").blur(function(){j(i(this))}),d.children(".layui-tree-editInput").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),j(i(this)))})}else n.confirm('\u786e\u8ba4\u5220\u9664\u8be5\u8282\u70b9 "'+(a.title||"")+'" \u5417\uff1f',function(a){if(r.operate&&r.operate(g),g.status="remove",n.close(a),!e.prev("."+s)[0]&&!e.next("."+s)[0]&&!e.parent("."+v)[0])return e.remove(),void t.elem.append(t.elemNone);if(e.siblings("."+s).children("."+p)[0]){if(r.showCheckbox){var l=function(e){if(e.parents("."+s)[0]){var a=e.siblings("."+s).children("."+p),n=e.parent("."+v).prev(),r=n.find('input[same="layuiTreeCheck"]')[0],c=1,d=0;0==r.checked&&(a.each(function(e,a){var n=i(a).find('input[same="layuiTreeCheck"]')[0];0!=n.checked||n.disabled||(c=0),n.disabled||(d=1)}),1==c&&1==d&&(r.checked=!0,t.renderForm("checkbox"),l(n.parent("."+s))))}};l(e)}if(r.showLine){var d=e.siblings("."+s),h=1,f=e.parent("."+v);layui.each(d,function(e,a){i(a).children("."+v)[0]||(h=0)}),1==h?(b[0]||(f.removeClass(x),d.children("."+v).addClass(m),d.children("."+v).children("."+s).removeClass(k)),e.next()[0]?f.children("."+s).last().children("."+v).children("."+s).last().addClass(k):e.prev().children("."+v).children("."+s).last().addClass(k),e.next()[0]||e.parents("."+s)[1]||e.parents("."+s).eq(0).next()[0]||e.prev("."+s).addClass(k)):!e.next()[0]&&e.hasClass(k)&&e.prev().addClass(k)}}else{var y=e.parent("."+v).prev();if(r.showLine){y.find("."+o).removeClass("layui-tree-icon"),y.find("."+o).children(".layui-icon").removeClass(u).addClass("layui-icon-file");var w=y.parents("."+v).eq(0);w.addClass(x),w.children("."+s).each(function(){i(this).children("."+v).children("."+s).last().addClass(k)})}else y.find(".layui-tree-iconArrow").addClass(c);e.parents("."+s).eq(0).removeClass(C),e.parent("."+v).remove()}e.remove()})})},b.prototype.events=function(){var e=this,a=e.config;e.elem.find(".layui-tree-checkedFirst");e.setChecked(e.checkids),e.elem.find(".layui-tree-search").on("keyup",function(){var n=i(this),t=n.val(),r=n.nextAll(),l=[];r.find("."+y).each(function(){var e=i(this).parents("."+p);if(i(this).html().indexOf(t)!=-1){l.push(i(this).parent());var a=function(e){e.addClass("layui-tree-searchShow"),e.parent("."+v)[0]&&a(e.parent("."+v).parent("."+s))};a(e.parent("."+s))}}),r.find("."+p).each(function(){var e=i(this).parent("."+s);e.hasClass("layui-tree-searchShow")||e.addClass(c)}),0==r.find(".layui-tree-searchShow").length&&e.elem.append(e.elemNone),a.onsearch&&a.onsearch({elem:l})}),e.elem.find(".layui-tree-search").on("keydown",function(){i(this).nextAll().find("."+p).each(function(){var e=i(this).parent("."+s);e.removeClass("layui-tree-searchShow "+c)}),i(".layui-tree-emptyText")[0]&&i(".layui-tree-emptyText").remove()})},b.prototype.getChecked=function(){var e=this,a=e.config,n=[],t=[];e.elem.find(".layui-form-checked").each(function(){n.push(i(this).prev()[0].value)});var r=function(e,a){layui.each(e,function(e,t){layui.each(n,function(e,n){if(t.id==n){var l=i.extend({},t);return delete l.children,a.push(l),t.children&&(l.children=[],r(t.children,l.children)),!0}})})};return r(i.extend({},a.data),t),t},b.prototype.setChecked=function(e){var a=this;a.config;a.elem.find("."+s).each(function(a,n){var t=i(this).data("id"),r=i(n).children("."+p).find('input[same="layuiTreeCheck"]'),l=r.next();if("number"==typeof e){if(t==e)return r[0].checked||l.click(),!1}else"object"==typeof e&&layui.each(e,function(e,i){if(i==t&&!r[0].checked)return l.click(),!0})})},l.that={},l.config={},r.reload=function(e,i){var a=l.that[e];return a.reload(i),l.call(a)},r.getChecked=function(e){var i=l.that[e];return i.getChecked()},r.setChecked=function(e,i){var a=l.that[e];return a.setChecked(i)},r.render=function(e){var i=new b(e);return l.call(i)},e(t,r)});layui.define(["laytpl","form"],function(e){"use strict";var a=layui.$,t=layui.laytpl,i=layui.form,n="transfer",l={config:{},index:layui[n]?layui[n].index+1e4:0,set:function(e){var t=this;return t.config=a.extend({},t.config,e),t},on:function(e,a){return layui.onevent.call(this,n,e,a)}},r=function(){var e=this,a=e.config,t=a.id||e.index;return r.that[t]=e,r.config[t]=a,{config:a,reload:function(a){e.reload.call(e,a)},getData:function(){return e.getData.call(e)}}},c="layui-hide",o="layui-btn-disabled",d="layui-none",s="layui-transfer-box",u="layui-transfer-header",h="layui-transfer-search",f="layui-transfer-active",y="layui-transfer-data",p=function(e){return e=e||{},['
        ','
        ','","
        ","{{# if(d.data.showSearch){ }}",'","{{# } }}",'
          ',"
          "].join("")},v=['
          ',p({index:0,checkAllName:"layTransferLeftCheckAll"}),'
          ','",'","
          ",p({index:1,checkAllName:"layTransferRightCheckAll"}),"
          "].join(""),x=function(e){var t=this;t.index=++l.index,t.config=a.extend({},t.config,l.config,e),t.render()};x.prototype.config={title:["\u5217\u8868\u4e00","\u5217\u8868\u4e8c"],width:200,height:360,data:[],value:[],showSearch:!1,id:"",text:{none:"\u65e0\u6570\u636e",searchNone:"\u65e0\u5339\u914d\u6570\u636e"}},x.prototype.reload=function(e){var t=this;t.config=a.extend({},t.config,e),t.render()},x.prototype.render=function(){var e=this,i=e.config,n=e.elem=a(t(v).render({data:i,index:e.index})),l=i.elem=a(i.elem);l[0]&&(i.data=i.data||[],i.value=i.value||[],e.key=i.id||e.index,l.html(e.elem),e.layBox=e.elem.find("."+s),e.layHeader=e.elem.find("."+u),e.laySearch=e.elem.find("."+h),e.layData=n.find("."+y),e.layBtn=n.find("."+f+" .layui-btn"),e.layBox.css({width:i.width,height:i.height}),e.layData.css({height:function(){return i.height-e.layHeader.outerHeight()-e.laySearch.outerHeight()-2}()}),e.renderData(),e.events())},x.prototype.renderData=function(){var e=this,a=(e.config,[{checkName:"layTransferLeftCheck",views:[]},{checkName:"layTransferRightCheck",views:[]}]);e.parseData(function(e){var t=e.selected?1:0,i=["
        • ",'',"
        • "].join("");a[t].views.push(i),delete e.selected}),e.layData.eq(0).html(a[0].views.join("")),e.layData.eq(1).html(a[1].views.join("")),e.renderCheckBtn()},x.prototype.renderForm=function(e){i.render(e,"LAY-transfer-"+this.index)},x.prototype.renderCheckBtn=function(e){var t=this,i=t.config;e=e||{},t.layBox.each(function(n){var l=a(this),r=l.find("."+y),d=l.find("."+u).find('input[type="checkbox"]'),s=r.find('input[type="checkbox"]'),h=0,f=!1;if(s.each(function(){var e=a(this).data("hide");(this.checked||this.disabled||e)&&h++,this.checked&&!e&&(f=!0)}),d.prop("checked",f&&h===s.length),t.layBtn.eq(n)[f?"removeClass":"addClass"](o),!e.stopNone){var p=r.children("li:not(."+c+")").length;t.noneView(r,p?"":i.text.none)}}),t.renderForm("checkbox")},x.prototype.noneView=function(e,t){var i=a('

          '+(t||"")+"

          ");e.find("."+d)[0]&&e.find("."+d).remove(),t.replace(/\s/g,"")&&e.append(i)},x.prototype.setValue=function(){var e=this,t=e.config,i=[];return e.layBox.eq(1).find("."+y+' input[type="checkbox"]').each(function(){var e=a(this).data("hide");e||i.push(this.value)}),t.value=i,e},x.prototype.parseData=function(e){var t=this,i=t.config,n=[];return layui.each(i.data,function(t,l){l=("function"==typeof i.parseData?i.parseData(l):l)||l,n.push(l=a.extend({},l)),layui.each(i.value,function(e,a){a==l.value&&(l.selected=!0)}),e&&e(l)}),i.data=n,t},x.prototype.getData=function(e){var a=this,t=a.config,i=[];return a.setValue(),layui.each(e||t.value,function(e,a){layui.each(t.data,function(e,t){delete t.selected,a==t.value&&i.push(t)})}),i},x.prototype.events=function(){var e=this,t=e.config;e.elem.on("click",'input[lay-filter="layTransferCheckbox"]+',function(){var t=a(this).prev(),i=t[0].checked,n=t.parents("."+s).eq(0).find("."+y);t[0].disabled||("all"===t.attr("lay-type")&&n.find('input[type="checkbox"]').each(function(){this.disabled||(this.checked=i)}),e.renderCheckBtn({stopNone:!0}))}),e.layBtn.on("click",function(){var i=a(this),n=i.data("index"),l=e.layBox.eq(n),r=[];if(!i.hasClass(o)){e.layBox.eq(n).each(function(t){var i=a(this),n=i.find("."+y);n.children("li").each(function(){var t=a(this),i=t.find('input[type="checkbox"]'),n=i.data("hide");i[0].checked&&!n&&(i[0].checked=!1,l.siblings("."+s).find("."+y).append(t.clone()),t.remove(),r.push(i[0].value)),e.setValue()})}),e.renderCheckBtn();var c=l.siblings("."+s).find("."+h+" input");""===c.val()||c.trigger("keyup"),t.onchange&&t.onchange(e.getData(r),n)}}),e.laySearch.find("input").on("keyup",function(){var i=this.value,n=a(this).parents("."+h).eq(0).siblings("."+y),l=n.children("li");l.each(function(){var e=a(this),t=e.find('input[type="checkbox"]'),n=t[0].title.indexOf(i)!==-1;e[n?"removeClass":"addClass"](c),t.data("hide",!n)}),e.renderCheckBtn();var r=l.length===n.children("li."+c).length;e.noneView(n,r?t.text.searchNone:"")})},r.that={},r.config={},l.reload=function(e,a){var t=r.that[e];return t.reload(a),r.call(t)},l.getData=function(e){var a=r.that[e];return a.getData()},l.render=function(e){var a=new x(e);return r.call(a)},e(n,l)});layui.define(["lay","laytpl","laypage","layer","form","util"],function(e){"use strict";var t=layui.$,a=(layui.lay,layui.laytpl),i=layui.laypage,l=layui.layer,n=layui.form,o=layui.util,r=layui.hint(),d=layui.device(),c={config:{checkName:"LAY_CHECKED",indexName:"LAY_TABLE_INDEX"},cache:{},index:layui.table?layui.table.index+1e4:0,set:function(e){var a=this;return a.config=t.extend({},a.config,e),a},on:function(e,t){return layui.onevent.call(this,h,e,t)}},s=function(){var e=this,t=e.config,a=t.id||t.index;return a&&(s.that[a]=e,s.config[a]=t),{config:t,reload:function(t,a){e.reload.call(e,t,a)},setColsWidth:function(){e.setColsWidth.call(e)},resize:function(){e.resize.call(e)}}},u=function(e){var t=s.config[e];return t||r.error(e?"The table instance with ID '"+e+"' not found":"ID argument required"),t||null},y=function(e,i,l,n){var r=this.config||{};r.escape&&(i=o.escape(i));var d=e.templet?function(){return"function"==typeof e.templet?e.templet(l):a(t(e.templet).html()||String(i)).render(l)}():i;return n?t("
          "+d+"
          ").text():d},h="table",f=".layui-table",p="layui-hide",v="layui-hide-v",m="layui-none",g="layui-table-view",b=".layui-table-tool",x=".layui-table-box",k=".layui-table-init",C=".layui-table-header",w=".layui-table-body",T=".layui-table-main",N=".layui-table-fixed",L=".layui-table-fixed-l",_=".layui-table-fixed-r",S=".layui-table-total",A=".layui-table-page",R=".layui-table-sort",W="layui-table-edit",z="layui-table-hover",E=function(e){var t='{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}';return e=e||{},['',"","{{# layui.each(d.data.cols, function(i1, item1){ }}","","{{# layui.each(item1, function(i2, item2){ }}",'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}','{{# if(item2.fixed === "right"){ right = true; } }}',function(){return e.fixed&&"right"!==e.fixed?'{{# if(item2.fixed && item2.fixed !== "right"){ }}':"right"===e.fixed?'{{# if(item2.fixed === "right"){ }}':""}(),"{{# var isSort = !(item2.colGroup) && item2.sort; }}",'",e.fixed?"{{# }; }}":"","{{# }); }}","","{{# }); }}","","
          ','
          ','{{# if(item2.type === "checkbox"){ }}','',"{{# } else { }}",'{{item2.title||""}}',"{{# if(isSort){ }}",'',"{{# } }}","{{# } }}","
          ","
          "].join("")},j=['',"","
          "].join(""),F=['
          ',"{{# if(d.data.toolbar){ }}",'
          ','
          ','
          ',"
          ","{{# } }}",'
          ',"{{# if(d.data.loading){ }}",'
          ','',"
          ","{{# } }}","{{# var left, right; }}",'
          ',E(),"
          ",'
          ',j,"
          ","{{# if(left){ }}",'
          ','
          ',E({fixed:!0}),"
          ",'
          ',j,"
          ","
          ","{{# }; }}","{{# if(right){ }}",'
          ','
          ',E({fixed:"right"}),'
          ',"
          ",'
          ',j,"
          ","
          ","{{# }; }}","
          ","{{# if(d.data.totalRow){ }}",'
          ','','',"
          ","
          ","{{# } }}","{{# if(d.data.page || d.data.pagebar){ }}",'
          ','
          ',"
          ","{{# } }}","","
          "].join(""),I=t(window),H=t(document),D=function(e){var a=this;a.index=++c.index,a.config=t.extend({},a.config,c.config,e),a.render()};D.prototype.config={limit:10,loading:!0,cellMinWidth:60,defaultToolbar:["filter","exports","print"],autoSort:!0,text:{none:"\u65e0\u6570\u636e"}},D.prototype.render=function(e){var i=this,l=i.config;if(l.elem=t(l.elem),l.where=l.where||{},l.id=l.id||l.elem.attr("id")||i.index,l.request=t.extend({pageName:"page",limitName:"limit"},l.request),l.response=t.extend({statusName:"code",statusCode:0,msgName:"msg",dataName:"data",totalRowName:"totalRow",countName:"count"},l.response),"object"==typeof l.page&&(l.limit=l.page.limit||l.limit,l.limits=l.page.limits||l.limits,i.page=l.page.curr=l.page.curr||1,delete l.page.elem,delete l.page.jump),!l.elem[0])return i;l.height&&/^full-\d+$/.test(l.height)&&(i.fullHeightGap=l.height.split("-")[1],l.height=I.height()-i.fullHeightGap),i.setInit(),a.config({open:"{{",close:"}}"});var n=l.elem,o=n.next("."+g),r=i.elem=t(a(F).render({VIEW_CLASS:g,data:l,index:i.index}));if(l.index=i.index,i.key=l.id||l.index,"reloadData"===e)return i.pullData(i.page);if(o[0]&&o.remove(),n.after(r),i.layTool=r.find(b),i.layBox=r.find(x),i.layHeader=r.find(C),i.layMain=r.find(T),i.layBody=r.find(w),i.layFixed=r.find(N),i.layFixLeft=r.find(L),i.layFixRight=r.find(_),i.layTotal=r.find(S),i.layPage=r.find(A),i.renderToolbar(),i.renderPagebar(),i.fullSize(),l.cols.length>1){var d=i.layFixed.find(C).find("th");d.height(i.layHeader.height()-1-parseFloat(d.css("padding-top"))-parseFloat(d.css("padding-bottom")))}i.pullData(i.page),i.events()},D.prototype.initOpts=function(e){var t=this,a=(t.config,{checkbox:48,radio:48,space:15,numbers:40});e.checkbox&&(e.type="checkbox"),e.space&&(e.type="space"),e.type||(e.type="normal"),"normal"!==e.type&&(e.unresize=!0,e.width=e.width||a[e.type])},D.prototype.setInit=function(e){var t=this,a=t.config;if(a.clientWidth=a.width||function(){var e=function(t){var i,l;t=t||a.elem.parent(),i=t.width();try{l="none"===t.css("display")}catch(n){}return!t[0]||i&&!l?i:e(t.parent())};return e()}(),"width"===e)return a.clientWidth;if(a.css){var i=a.css.split("}");layui.each(i,function(e,a){a&&(i[e]="."+g+"-"+t.index+" "+a)}),a.css=i.join("}")}layui.each(a.cols,function(e,i){layui.each(i,function(l,n){if(!n)return void i.splice(l,1);if(n.key=e+"-"+l,n.hide=n.hide||!1,n.colGroup||n.colspan>1){var o=0;layui.each(a.cols[e+1],function(t,a){a.HAS_PARENT||o>1&&o==n.colspan||(a.HAS_PARENT=!0,a.parentKey=e+"-"+l,o+=parseInt(a.colspan>1?a.colspan:1))}),n.colGroup=!0}t.initOpts(n)})})},D.prototype.renderToolbar=function(){var e=this,i=e.config,l=['
          ','
          ','
          '].join(""),n=e.layTool.find(".layui-table-tool-temp");if("default"===i.toolbar)n.html(l);else if("string"==typeof i.toolbar){var o=t(i.toolbar).html()||"";o&&n.html(a(o).render(i))}var r={filter:{title:"\u7b5b\u9009\u5217",layEvent:"LAYTABLE_COLS",icon:"layui-icon-cols"},exports:{title:"\u5bfc\u51fa",layEvent:"LAYTABLE_EXPORT",icon:"layui-icon-export"},print:{title:"\u6253\u5370",layEvent:"LAYTABLE_PRINT",icon:"layui-icon-print"}},d=[];"object"==typeof i.defaultToolbar&&layui.each(i.defaultToolbar,function(e,t){var a="string"==typeof t?r[t]:t;a&&d.push('
          ')}),e.layTool.find(".layui-table-tool-self").html(d.join(""))},D.prototype.renderPagebar=function(){var e=this,i=e.config,l=e.layPagebar=t('
          ');if(i.pagebar){var n=t(i.pagebar).html()||"";n&&l.append(a(n).render(i)),e.layPage.append(l)}},D.prototype.setParentCol=function(e,t){var a=this,i=a.config,l=a.layHeader.find('th[data-key="'+i.index+"-"+t+'"]'),n=parseInt(l.attr("colspan"))||0;if(l[0]){var o=t.split("-"),r=i.cols[o[0]][o[1]];e?n--:n++,l.attr("colspan",n),l[n<1?"addClass":"removeClass"](p),r.colspan=n,r.hide=n<1;var d=l.data("parentkey");d&&a.setParentCol(e,d)}},D.prototype.setColsPatch=function(){var e=this,t=e.config;layui.each(t.cols,function(t,a){layui.each(a,function(t,a){a.hide&&e.setParentCol(a.hide,a.parentKey)})})},D.prototype.setColsWidth=function(){var e=this,t=e.config,a=0,i=0,l=0,n=0,o=e.setInit("width");e.eachCols(function(e,t){t.hide||a++}),o=o-function(){return"line"===t.skin||"nob"===t.skin?2:a+1}()-e.getScrollWidth(e.layMain[0])-1;var r=function(e){layui.each(t.cols,function(a,r){layui.each(r,function(a,d){var c=0,s=d.minWidth||t.cellMinWidth;return d?void(d.colGroup||d.hide||(e?l&&ln&&i&&(l=(o-n)/i)};r(),r(!0),e.autoColNums=i,e.eachCols(function(a,i){var n=i.minWidth||t.cellMinWidth;i.colGroup||i.hide||(0===i.width?e.getCssRule(t.index+"-"+i.key,function(e){e.style.width=Math.floor(l>=n?l:n)+"px"}):/\d+%$/.test(i.width)&&e.getCssRule(t.index+"-"+i.key,function(e){e.style.width=Math.floor(parseFloat(i.width)/100*o)+"px"}))});var d=e.layMain.width()-e.getScrollWidth(e.layMain[0])-e.layMain.children("table").outerWidth();if(e.autoColNums&&d>=-a&&d<=a){var c=function(t){var a;return t=t||e.layHeader.eq(0).find("thead th:last-child"),a=t.data("field"),!a&&t.prev()[0]?c(t.prev()):t},s=c(),u=s.data("key");e.getCssRule(u,function(t){var a=t.style.width||s.outerWidth();t.style.width=parseFloat(a)+d+"px",e.layMain.height()-e.layMain.prop("clientHeight")>0&&(t.style.width=parseFloat(t.style.width)-1+"px")})}e.loading(!0)},D.prototype.resize=function(){var e=this;e.fullSize(),e.setColsWidth(),e.scrollPatch()},D.prototype.reload=function(e,a,i){var l=this;e=e||{},delete l.haveInit,layui.each(e,function(e,t){"array"===layui._typeof(t)&&delete l.config[e]}),l.config=t.extend(a,{},l.config,e),l.render(i)},D.prototype.errorView=function(e){var a=this,i=a.layMain.find("."+m),l=t('
          '+(e||"Error")+"
          ");i[0]&&(a.layNone.remove(),i.remove()),a.layFixed.addClass(p),a.layMain.find("tbody").html(""),a.layMain.append(a.layNone=l),c.cache[a.key]=[]},D.prototype.page=1,D.prototype.pullData=function(e){var a=this,i=a.config,l=i.request,n=i.response,o=function(){"object"==typeof i.initSort&&a.sort(i.initSort.field,i.initSort.type)};if(a.startTime=(new Date).getTime(),i.url){var r={};r[l.pageName]=e,r[l.limitName]=i.limit;var d=t.extend(r,i.where);i.contentType&&0==i.contentType.indexOf("application/json")&&(d=JSON.stringify(d)),a.loading(),t.ajax({type:i.method||"get",url:i.url,contentType:i.contentType,data:d,dataType:"json",headers:i.headers||{},success:function(t){"function"==typeof i.parseData&&(t=i.parseData(t)||t),t[n.statusName]!=n.statusCode?(a.renderForm(),a.errorView(t[n.msgName]||'\u8fd4\u56de\u7684\u6570\u636e\u4e0d\u7b26\u5408\u89c4\u8303\uff0c\u6b63\u786e\u7684\u6210\u529f\u72b6\u6001\u7801\u5e94\u4e3a\uff1a"'+n.statusName+'": '+n.statusCode)):(a.renderData(t,e,t[n.countName]),o(),i.time=(new Date).getTime()-a.startTime+" ms"),a.setColsWidth(),"function"==typeof i.done&&i.done(t,e,t[n.countName])},error:function(e,t){a.errorView("\u8bf7\u6c42\u5f02\u5e38\uff0c\u9519\u8bef\u63d0\u793a\uff1a"+t),a.renderForm(),a.setColsWidth(),"function"==typeof i.error&&i.error(e,t)}})}else if("array"===layui._typeof(i.data)){var c={},s=e*i.limit-i.limit;c[n.dataName]=i.data.concat().splice(s,i.limit),c[n.countName]=i.data.length,"object"==typeof i.totalRow&&(c[n.totalRowName]=t.extend({},i.totalRow)),a.renderData(c,e,c[n.countName]),o(),a.setColsWidth(),"function"==typeof i.done&&i.done(c,e,c[n.countName])}},D.prototype.eachCols=function(e){var t=this;return c.eachCols(null,e,t.config.cols),t},D.prototype.renderData=function(e,n,o,r){var d=this,s=d.config,u=e[s.response.dataName]||[],h=e[s.response.totalRowName],f=[],g=[],b=[],x=function(){var e;return!r&&d.sortKey?d.sort(d.sortKey.field,d.sortKey.sort,!0):(layui.each(u,function(i,l){var o=[],h=[],v=[],m=i+s.limit*(n-1)+1;if("object"!=typeof l){u[i]=l={LAY_KEY:l};try{c.cache[d.key][i]=l}catch(x){}}"array"===layui._typeof(l)&&0===l.length||(r||(l[c.config.indexName]=i),d.eachCols(function(n,r){var u=r.field||n,f=s.index+"-"+r.key,g=l[u];if(void 0!==g&&null!==g||(g=""),!r.colGroup){var b=['','
          '+function(){var n=t.extend(!0,{LAY_INDEX:m,LAY_COL:r},l),o=c.config.checkName;switch(r.type){case"checkbox":return'";case"radio":return n[o]&&(e=i),'';case"numbers":return m}return r.toolbar?a(t(r.toolbar).html()||"").render(n):y.call(d,r,g,n)}(),"
          "].join("");o.push(b),r.fixed&&"right"!==r.fixed&&h.push(b),"right"===r.fixed&&v.push(b)}}),f.push(''+o.join("")+""),g.push(''+h.join("")+""),b.push(''+v.join("")+""))}),d.layBody.scrollTop(0),d.layMain.find("."+m).remove(),d.layMain.find("tbody").html(f.join("")),d.layFixLeft.find("tbody").html(g.join("")),d.layFixRight.find("tbody").html(b.join("")),d.renderForm(),"number"==typeof e&&d.setThisRowChecked(e),d.syncCheckAll(),d.haveInit?d.scrollPatch():setTimeout(function(){d.scrollPatch()},50),d.haveInit=!0,l.close(d.tipsIndex),s.HAS_SET_COLS_PATCH||d.setColsPatch(),void(s.HAS_SET_COLS_PATCH=!0))};return c.cache[d.key]=u,d.layTotal[0==u.length?"addClass":"removeClass"](v),s.pagebar||d.layPage[0==o||0===u.length&&1==n?"addClass":"removeClass"](v),0===u.length?(d.renderForm(),d.errorView(s.text.none)):(d.layFixed.removeClass(p),r?x():(x(),d.renderTotal(u,h),void(s.page&&(s.page=t.extend({elem:"layui-table-page"+s.index,count:o,limit:s.limit,limits:s.limits||[10,20,30,40,50,60,70,80,90],groups:3,layout:["prev","page","next","skip","count","limit"],prev:'',next:'',jump:function(e,t){t||(d.page=e.curr,s.limit=e.limit,d.pullData(e.curr))}},s.page),s.page.count=o,i.render(s.page)))))},D.prototype.renderTotal=function(e,i){var l=this,n=l.config,o={};if(n.totalRow){layui.each(e,function(e,t){"array"===layui._typeof(t)&&0===t.length||l.eachCols(function(e,a){var i=a.field||e,l=t[i];a.totalRow&&(o[i]=(o[i]||0)+(parseFloat(l)||0))})}),l.dataTotal={};var r=[];l.eachCols(function(e,d){var c=d.field||e,s=function(){var e,t=d.totalRowText||"",a=parseFloat(o[c]).toFixed(2),n={};return n[c]=a,e=d.totalRow?y.call(l,d,a,n)||t:t,i?i[d.field]||e:e}(),u=['','
          '+function(){var e=d.totalRow||n.totalRow;return"string"==typeof e?a(e).render(t.extend({TOTAL_NUMS:s},d)):s}(),"
          "].join("");d.field&&(l.dataTotal[c]=s),r.push(u)}),l.layTotal.find("tbody").html(""+r.join("")+"")}},D.prototype.getColElem=function(e,t){var a=this,i=a.config;return e.eq(0).find(".laytable-cell-"+(i.index+"-"+t)+":eq(0)")},D.prototype.renderForm=function(e){var t=this,a=(t.config,t.elem.attr("lay-filter"));n.render(e,a)},D.prototype.setThisRowChecked=function(e){var t=this,a=(t.config,"layui-table-click"),i=t.layBody.find('tr[data-index="'+e+'"]');i.addClass(a).siblings("tr").removeClass(a)},D.prototype.sort=function(e,a,i,l){var n,o,d=this,s={},u=d.config,y=u.elem.attr("lay-filter"),f=c.cache[d.key];"string"==typeof e&&(n=e,d.layHeader.find("th").each(function(a,i){var l=t(this),o=l.data("field");if(o===e)return e=l,n=o,!1}));try{var n=n||e.data("field"),p=e.data("key");if(d.sortKey&&!i&&n===d.sortKey.field&&a===d.sortKey.sort)return;var v=d.layHeader.find("th .laytable-cell-"+p).find(R);d.layHeader.find("th").find(R).removeAttr("lay-sort"),v.attr("lay-sort",a||null),d.layFixed.find("th")}catch(m){r.error("Table modules: sort field '"+n+"' not matched")}d.sortKey={field:n,sort:a},u.autoSort&&("asc"===a?o=layui.sort(f,n):"desc"===a?o=layui.sort(f,n,!0):(o=layui.sort(f,c.config.indexName),delete d.sortKey)),s[u.response.dataName]=o||f,d.renderData(s,d.page,d.count,!0),l&&layui.event.call(e,h,"sort("+y+")",{field:n,type:a})},D.prototype.loading=function(e){var a=this,i=a.config;i.loading&&(e?(a.layInit&&a.layInit.remove(),delete a.layInit,a.layBox.find(k).remove()):(a.layInit=t(['
          ','',"
          "].join("")),a.layBox.append(a.layInit)))},D.prototype.setCheckData=function(e,t){var a=this,i=a.config,l=c.cache[a.key];l[e]&&"array"!==layui._typeof(l[e])&&(l[e][i.checkName]=t)},D.prototype.syncCheckAll=function(){var e=this,t=e.config,a=e.layHeader.find('input[name="layTableCheckbox"]'),i=function(a){return e.eachCols(function(e,i){"checkbox"===i.type&&(i[t.checkName]=a)}),a};a[0]&&(c.checkStatus(e.key).isAll?(a[0].checked||(a.prop("checked",!0),e.renderForm("checkbox")),i(!0)):(a[0].checked&&(a.prop("checked",!1),e.renderForm("checkbox")),i(!1)))},D.prototype.getCssRule=function(e,t){var a=this,i=a.elem.find("style")[0],l=i.sheet||i.styleSheet||{},n=l.cssRules||l.rules;layui.each(n,function(a,i){if(i.selectorText===".laytable-cell-"+e)return t(i),!0})},D.prototype.fullSize=function(){var e,t=this,a=t.config,i=a.height;t.fullHeightGap&&(i=I.height()-t.fullHeightGap,i<135&&(i=135),t.elem.css("height",i)),i&&(e=parseFloat(i)-(t.layHeader.outerHeight()||38),a.toolbar&&(e-=t.layTool.outerHeight()||50),a.totalRow&&(e-=t.layTotal.outerHeight()||40),a.page&&(e-=t.layPage.outerHeight()||41),t.layMain.css("height",e-2))},D.prototype.getScrollWidth=function(e){var t=0;return e?t=e.offsetWidth-e.clientWidth:(e=document.createElement("div"),e.style.width="100px",e.style.height="100px",e.style.overflowY="scroll",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),t},D.prototype.scrollPatch=function(){var e=this,a=e.layMain.children("table"),i=e.layMain.width()-e.layMain.prop("clientWidth"),l=e.layMain.height()-e.layMain.prop("clientHeight"),n=(e.getScrollWidth(e.layMain[0]),a.outerWidth()-e.layMain.width()),o=function(e){if(i&&l){if(e=e.eq(0),!e.find(".layui-table-patch")[0]){var a=t('
          ');a.find("div").css({width:i}),e.find("tr").append(a)}}else e.find(".layui-table-patch").remove()};o(e.layHeader),o(e.layTotal);var r=e.layMain.height(),d=r-l;e.layFixed.find(w).css("height",a.height()>=d?d:"auto"),e.layFixRight[n>0?"removeClass":"addClass"](p),e.layFixRight.css("right",i-1)},D.prototype.events=function(){var e,a=this,i=a.config,o=t("body"),r={},s=a.layHeader.find("th"),u=".layui-table-cell",f=i.elem.attr("lay-filter");a.layTool.on("click","*[lay-event]",function(e){var o=t(this),r=o.attr("lay-event"),s=function(e){var l=t(e.list),n=t('
            ');n.html(l),i.height&&n.css("max-height",i.height-(a.layTool.outerHeight()||50)),o.find(".layui-table-tool-panel")[0]||o.append(n),a.renderForm(),n.on("click",function(e){layui.stope(e)}),e.done&&e.done(n,l)};switch(layui.stope(e),H.trigger("table.tool.panel.remove"),l.close(a.tipsIndex),r){case"LAYTABLE_COLS":s({list:function(){var e=[];return a.eachCols(function(t,a){a.field&&"normal"==a.type&&e.push('
          • ')}),e.join("")}(),done:function(){n.on("checkbox(LAY_TABLE_TOOL_COLS)",function(e){var l=t(e.elem),n=this.checked,o=l.data("key"),r=l.data("parentkey");layui.each(i.cols,function(e,t){layui.each(t,function(t,l){if(e+"-"+t===o){var d=l.hide;l.hide=!n,a.elem.find('*[data-key="'+i.index+"-"+o+'"]')[n?"removeClass":"addClass"](p),d!=l.hide&&a.setParentCol(!n,r),a.resize()}})})})}});break;case"LAYTABLE_EXPORT":d.ie?l.tips("\u5bfc\u51fa\u529f\u80fd\u4e0d\u652f\u6301 IE\uff0c\u8bf7\u7528 Chrome \u7b49\u9ad8\u7ea7\u6d4f\u89c8\u5668\u5bfc\u51fa",this,{tips:3}):s({list:function(){return['
          • \u5bfc\u51fa\u5230 Csv \u6587\u4ef6
          • ','
          • \u5bfc\u51fa\u5230 Excel \u6587\u4ef6
          • '].join("")}(),done:function(e,l){l.on("click",function(){var e=t(this).data("type");c.exportFile.call(a,i.id,null,e)})}});break;case"LAYTABLE_PRINT":var u=window.open("\u6253\u5370\u7a97\u53e3","_blank"),y=[""].join(""),v=t(a.layHeader.html());v.append(a.layMain.find("table").html()),v.append(a.layTotal.find("table").html()),v.find("th.layui-table-patch").remove(),v.find(".layui-table-col-special").remove(),u.document.write(y+v.prop("outerHTML")),u.document.close(),u.print(),u.close()}layui.event.call(this,h,"toolbar("+f+")",t.extend({event:r,config:i},{}))}),a.layPagebar.on("click","*[lay-event]",function(e){var a=t(this),l=a.attr("lay-event");layui.event.call(this,h,"pagebar("+f+")",t.extend({event:l,config:i},{}))}),s.on("mousemove",function(e){var a=t(this),i=a.offset().left,l=e.clientX-i;a.data("unresize")||r.resizeStart||(r.allowResize=a.width()-l<=10,o.css("cursor",r.allowResize?"col-resize":""))}).on("mouseleave",function(){t(this);r.resizeStart||o.css("cursor","")}).on("mousedown",function(e){var l=t(this);if(r.allowResize){var n=l.data("key");e.preventDefault(),r.resizeStart=!0,r.offset=[e.clientX,e.clientY],a.getCssRule(n,function(e){var t=e.style.width||l.outerWidth();r.rule=e,r.ruleWidth=parseFloat(t),r.minWidth=l.data("minwidth")||i.cellMinWidth})}}),H.on("mousemove",function(t){if(r.resizeStart){if(t.preventDefault(),r.rule){var i=r.ruleWidth+t.clientX-r.offset[0];i');return n[0].value=a.data("content")||l.text(),a.find("."+W)[0]||a.append(n),n.focus(),void layui.stope(e)}}).on("mouseenter","td",function(){b.call(this)}).on("mouseleave","td",function(){b.call(this,"hide")});var g="layui-table-grid-down",b=function(e){var a=t(this),i=a.children(u);if(!a.data("off"))if(e)a.find(".layui-table-grid-down").remove();else if(i.prop("scrollWidth")>i.outerWidth()){if(i.find("."+g)[0])return;a.append('
            ')}};a.layBody.on("click","."+g,function(e){var n=t(this),o=n.parent(),r=o.children(u);a.tipsIndex=l.tips(['
            ',r.html(),"
            ",''].join(""),r[0],{tips:[3,""],time:-1,anim:-1,maxWidth:d.ios||d.android?300:a.elem.width()/2,isOutAnim:!1,skin:"layui-table-tips",success:function(e,t){e.find(".layui-table-tips-c").on("click",function(){l.close(t)})}}),layui.stope(e)}),a.layBody.on("click","*[lay-event]",function(){var e=t(this),i=e.parents("tr").eq(0).data("index");layui.event.call(this,h,"tool("+f+")",v.call(this,{event:e.attr("lay-event")})),a.setThisRowChecked(i)}),a.layMain.on("scroll",function(){var e=t(this),i=e.scrollLeft(),n=e.scrollTop();a.layHeader.scrollLeft(i),a.layTotal.scrollLeft(i),a.layFixed.find(w).scrollTop(n),l.close(a.tipsIndex)}),I.on("resize",function(){a.resize()})},function(){H.on("click",function(){H.trigger("table.remove.tool.panel")}),H.on("table.remove.tool.panel",function(){t(".layui-table-tool-panel").remove()})}(),c.init=function(e,a){a=a||{};var i=this,l=t(e?'table[lay-filter="'+e+'"]':f+"[lay-data]"),n="Table element property lay-data configuration item has a syntax error: ";return l.each(function(){var i=t(this),l=i.attr("lay-data");try{l=new Function("return "+l)()}catch(o){r.error(n+l,"error")}var d=[],s=t.extend({elem:this,cols:[],data:[],skin:i.attr("lay-skin"),size:i.attr("lay-size"),even:"string"==typeof i.attr("lay-even")},c.config,a,l);e&&i.hide(),i.find("thead>tr").each(function(e){s.cols[e]=[],t(this).children().each(function(a){var i=t(this),l=i.attr("lay-data");try{l=new Function("return "+l)()}catch(o){return r.error(n+l)}var c=t.extend({title:i.text(),colspan:i.attr("colspan")||0,rowspan:i.attr("rowspan")||0},l);c.colspan<2&&d.push(c),s.cols[e].push(c)})}),i.find("tbody>tr").each(function(e){var a=t(this),i={};a.children("td").each(function(e,a){var l=t(this),n=l.data("field");if(n)return i[n]=l.html()}),layui.each(d,function(e,t){var l=a.children("td").eq(e);i[t.field]=l.html()}),s.data[e]=i}),c.render(s)}),i},s.that={},s.config={},c.eachCols=function(e,a,i){var l=s.config[e]||{},n=[],o=0;i=t.extend(!0,[],i||l.cols),layui.each(i,function(e,t){layui.each(t,function(t,a){if(a.colGroup){var l=0;o++,a.CHILD_COLS=[],layui.each(i[e+1],function(e,t){t.PARENT_COL_INDEX||l>1&&l==a.colspan||(t.PARENT_COL_INDEX=o,a.CHILD_COLS.push(t),l+=parseInt(t.colspan>1?t.colspan:1))})}a.PARENT_COL_INDEX||n.push(a)})});var r=function(e){layui.each(e||n,function(e,t){return t.CHILD_COLS?r(t.CHILD_COLS):void("function"==typeof a&&a(e,t))})};r()},c.checkStatus=function(e){var t=0,a=0,i=[],l=c.cache[e]||[];return layui.each(l,function(e,l){ +return"array"===layui._typeof(l)?void a++:void(l[c.config.checkName]&&(t++,i.push(c.clearCacheKey(l))))}),{data:i,isAll:!!l.length&&t===l.length-a}},c.getData=function(e){var t=[],a=c.cache[e]||[];return layui.each(a,function(e,a){"array"!==layui._typeof(a)&&t.push(c.clearCacheKey(a))}),t},c.exportFile=function(e,t,a){var i=this;t=t||c.clearCacheKey(c.cache[e]),a=a||"csv";var l=s.that[e],n=s.config[e]||{},o={csv:"text/csv",xls:"application/vnd.ms-excel"}[a],u=document.createElement("a");return d.ie?r.error("IE_NOT_SUPPORT_EXPORTS"):(u.href="data:"+o+";charset=utf-8,\ufeff"+encodeURIComponent(function(){var a=[],n=[],o=[];return layui.each(t,function(t,i){var o=[];"object"==typeof e?(layui.each(e,function(e,i){0==t&&a.push(i||"")}),layui.each(c.clearCacheKey(i),function(e,t){o.push('"'+(t||"")+'"')})):c.eachCols(e,function(e,n){if(n.field&&"normal"==n.type&&!n.hide){var r=i[n.field];void 0!==r&&null!==r||(r=""),0==t&&a.push(n.title||""),o.push('"'+y.call(l,n,r,i,"text")+'"')}}),n.push(o.join(","))}),layui.each(i.dataTotal,function(e,t){o.push(t)}),a.join(",")+"\r\n"+n.join("\r\n")+"\r\n"+o.join(",")}()),u.download=(n.title||"table_"+(n.index||""))+"."+a,document.body.appendChild(u),u.click(),void document.body.removeChild(u))},c.resize=function(e){if(e){var t=u(e);if(!t)return;s.that[e].resize()}else layui.each(s.that,function(){this.resize()})},c.reload=function(e,t,a,i){var l=u(e);if(l){var n=s.that[e];return n.reload(t,a,i),s.call(n)}},c.reloadData=function(){var e=t.extend([],arguments);return e[3]="reloadData",c.reload.apply(null,e)},c.render=function(e){var t=new D(e);return s.call(t)},c.clearCacheKey=function(e){return e=t.extend({},e),delete e[c.config.checkName],delete e[c.config.indexName],e},t(function(){c.init()}),e(h,c)});layui.define("jquery",function(e){"use strict";var n=layui.$,i=(layui.hint(),layui.device(),{config:{},set:function(e){var i=this;return i.config=n.extend({},i.config,e),i},on:function(e,n){return layui.onevent.call(this,t,e,n)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=n.extend({},t.config,i.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,i=e.config;i.elem=n(i.elem),i.elem[0]&&(e.elemItem=i.elem.find(l),i.index<0&&(i.index=0),i.index>=e.elemItem.length&&(i.index=e.elemItem.length-1),i.interval<800&&(i.interval=800),i.full?i.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):i.elem.css({width:i.width,height:i.height}),i.elem.attr("lay-anim",i.anim),e.elemItem.eq(i.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var i=this;clearInterval(i.timer),i.config=n.extend({},i.config,e),i.render()},m.prototype.prevIndex=function(){var e=this,n=e.config,i=n.index-1;return i<0&&(i=e.elemItem.length-1),i},m.prototype.nextIndex=function(){var e=this,n=e.config,i=n.index+1;return i>=e.elemItem.length&&(i=0),i},m.prototype.addIndex=function(e){var n=this,i=n.config;e=e||1,i.index=i.index+e,i.index>=n.elemItem.length&&(i.index=0)},m.prototype.subIndex=function(e){var n=this,i=n.config;e=e||1,i.index=i.index-e,i.index<0&&(i.index=n.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,n=e.config;n.autoplay&&(clearInterval(e.timer),e.timer=setInterval(function(){e.slide()},n.interval))},m.prototype.arrow=function(){var e=this,i=e.config,t=n(['",'"].join(""));i.elem.attr("lay-arrow",i.arrow),i.elem.find("."+u)[0]&&i.elem.find("."+u).remove(),i.elem.append(t),t.on("click",function(){var i=n(this),t=i.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,i=e.config,t=e.elemInd=n(['
              ',function(){var n=[];return layui.each(e.elemItem,function(e){n.push("")}),n.join("")}(),"
            "].join(""));i.elem.attr("lay-indicator",i.indicator),i.elem.find("."+c)[0]&&i.elem.find("."+c).remove(),i.elem.append(t),"updown"===i.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===i.trigger?"mouseover":i.trigger,function(){var t=n(this),a=t.index();a>i.index?e.slide("add",a-i.index):al.length&&(l.value=l.length),parseInt(l.value)!==l.value&&(l.half||(l.value=Math.ceil(l.value)-l.value<.5?Math.ceil(l.value):Math.floor(l.value)));for(var n='
              ",s=1;s<=l.length;s++){var r='
            • ";l.half&&parseInt(l.value)!==l.value&&s==Math.ceil(l.value)?n=n+'
            • ":n+=r}n+="
            "+(l.text?''+l.value+"\u661f":"")+"";var c=l.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),l.span=e.elemTemp.next("span"),l.setText&&l.setText(l.value),c.html(e.elemTemp),c.addClass("layui-inline"),l.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,l=a.config;l.value=e,a.render()},v.prototype.action=function(){var e=this,l=e.config,i=e.elemTemp,n=i.find("i").width();i.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(l.value=t,l.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(l.value=l.value-.5)}l.text&&i.next("span").text(l.value+"\u661f"),l.choose&&l.choose(l.value),l.setText&&l.setText(l.value)}),v.on("mousemove",function(e){if(i.find("i").each(function(){a(this).addClass(o).removeClass(r)}),i.find("i:lt("+t+")").each(function(){a(this).addClass(u).removeClass(f)}),l.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(s).removeClass(u)}}),v.on("mouseleave",function(){i.find("i").each(function(){a(this).addClass(o).removeClass(r)}),i.find("i:lt("+Math.floor(l.value)+")").each(function(){a(this).addClass(u).removeClass(f)}),l.half&&parseInt(l.value)!==l.value&&i.children("li:eq("+Math.floor(l.value)+")").children("i").addClass(s).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},l.render=function(e){var a=new v(e);return i.call(a)},e(n,l)});layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var m=l(e.elem);if(m[0]){var f=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,y=e.end||"\u6ca1\u6709\u66f4\u591a\u4e86",v=e.scrollElem&&e.scrollElem!==document,d="\u52a0\u8f7d\u66f4\u591a",h=l('");m.find(".layui-flow-more")[0]||m.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(y):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(f.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),!i&&m.width()&&(r=setTimeout(function(){var i=v?e.height():l(window).height(),n=v?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&e.attr("lay-src")){var f=e.attr("lay-src");layui.img(f,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",f).removeAttr("lay-src"),l[0]&&m(l),i++},function(){t.lazyimg.elem.eq(i);e.removeAttr("lay-src")})}},m=function(e,o){var m=a?(o||n).height():l(window).height(),f=n.scrollTop(),u=f+m;if(t.lazyimg.elem=l(r),e)c(e,m);else for(var s=0;su)break}};if(m(),!o){var f;n.on("scroll",function(){var e=l(this);f&&clearTimeout(f),f=setTimeout(function(){m(null,e)},50)}),o=!0}return m},e("flow",new o)});layui.define(["layer","form"],function(t){"use strict";var e=layui.$,i=layui.layer,a=layui.form,l=(layui.hint(),layui.device()),n="layedit",o="layui-show",r="layui-disabled",s=function(){var t=this;t.index=0,t.config={tool:["strong","italic","underline","del","|","left","center","right","|","link","unlink","image"],hideTool:[],height:280}};s.prototype.set=function(t){var i=this;return e.extend(!0,i.config,t),i},s.prototype.on=function(t,e){return layui.onevent(n,t,e)},s.prototype.build=function(t,i){i=i||{};var a=this,n=a.config,r="layui-layedit",s=e("string"==typeof t?"#"+t:t),u="LAY_layedit_"+ ++a.index,d=s.next("."+r),y=e.extend({},n,i),f=function(){var t=[],e={};return layui.each(y.hideTool,function(t,i){e[i]=!0}),layui.each(y.tool,function(i,a){k[a]&&!e[a]&&t.push(k[a])}),t.join("")}(),m=e(['
            ','
            '+f+"
            ",'
            ','',"
            ","
            "].join(""));return l.ie&&l.ie<8?s.removeClass("layui-hide").addClass(o):(d[0]&&d.remove(),c.call(a,m,s[0],y),s.addClass("layui-hide").after(m),a.index)},s.prototype.getContent=function(t){var e=u(t);if(e[0])return d(e[0].document.body.innerHTML)},s.prototype.getText=function(t){var i=u(t);if(i[0])return e(i[0].document.body).text()},s.prototype.setContent=function(t,i,a){var l=u(t);l[0]&&(a?e(l[0].document.body).append(i):e(l[0].document.body).html(i),layedit.sync(t))},s.prototype.sync=function(t){var i=u(t);if(i[0]){var a=e("#"+i[1].attr("textarea"));a.val(d(i[0].document.body.innerHTML))}},s.prototype.getSelection=function(t){var e=u(t);if(e[0]){var i=m(e[0].document);return document.selection?i.text:i.toString()}};var c=function(t,i,a){var l=this,n=t.find("iframe");n.css({height:a.height}).on("load",function(){var o=n.contents(),r=n.prop("contentWindow"),s=o.find("head"),c=e([""].join("")),u=o.find("body");s.append(c),u.attr("contenteditable","true").css({"min-height":a.height}).html(i.value||""),y.apply(l,[r,n,i,a]),g.call(l,r,t,a)})},u=function(t){var i=e("#LAY_layedit_"+t),a=i.prop("contentWindow");return[a,i]},d=function(t){return 8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),t},y=function(t,a,n,o){var r=t.document,s=e(r.body);s.on("keydown",function(t){var e=t.keyCode;if(13===e){var a=m(r),l=p(a),n=l.parentNode;if("pre"===n.tagName.toLowerCase()){if(t.shiftKey)return;return i.msg("\u8bf7\u6682\u65f6\u7528shift+enter"),!1}r.execCommand("formatBlock",!1,"

            ")}}),e(n).parents("form").on("submit",function(){var t=s.html();8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),n.value=t}),s.on("paste",function(e){r.execCommand("formatBlock",!1,"

            "),setTimeout(function(){f.call(t,s),n.value=s.html()},100)})},f=function(t){var i=this;i.document;t.find("*[style]").each(function(){var t=this.style.textAlign;this.removeAttribute("style"),e(this).css({"text-align":t||""})}),t.find("table").addClass("layui-table"),t.find("script,link").remove()},m=function(t){return t.selection?t.selection.createRange():t.getSelection().getRangeAt(0)},p=function(t){return t.endContainer||t.parentElement().childNodes[0]},v=function(t,i,a){var l=this.document,n=document.createElement(t);for(var o in i)n.setAttribute(o,i[o]);if(n.removeAttribute("text"),l.selection){var r=a.text||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.pasteHTML(e(n).prop("outerHTML")),a.select()}else{var r=a.toString()||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.deleteContents(),a.insertNode(n)}},h=function(t,i){var a=this.document,l="layedit-tool-active",n=p(m(a)),o=function(e){return t.find(".layedit-tool-"+e)};i&&i[i.hasClass(l)?"removeClass":"addClass"](l),t.find(">i").removeClass(l),o("unlink").addClass(r),e(n).parents().each(function(){var t=this.tagName.toLowerCase(),e=this.style.textAlign;"b"!==t&&"strong"!==t||o("b").addClass(l),"i"!==t&&"em"!==t||o("i").addClass(l),"u"===t&&o("u").addClass(l),"strike"===t&&o("d").addClass(l),"p"===t&&("center"===e?o("center").addClass(l):"right"===e?o("right").addClass(l):o("left").addClass(l)),"a"===t&&(o("link").addClass(l),o("unlink").removeClass(r))})},g=function(t,a,l){var n=t.document,o=e(n.body),s={link:function(i){var a=p(i),l=e(a).parent();b.call(o,{href:l.attr("href"),target:l.attr("target")},function(e){var a=l[0];"A"===a.tagName?a.href=e.url:v.call(t,"a",{target:e.target,href:e.url,text:e.url},i)})},unlink:function(t){n.execCommand("unlink")},image:function(a){var n=this;layui.use("upload",function(o){var r=l.uploadImage||{};o.render({url:r.url,method:r.type,elem:e(n).find("input")[0],done:function(e){0==e.code?(e.data=e.data||{},v.call(t,"img",{src:e.data.src,alt:e.data.title},a)):i.msg(e.msg||"\u4e0a\u4f20\u5931\u8d25")}})})},code:function(e){x.call(o,function(i){v.call(t,"pre",{text:i.code,"lay-lang":i.lang},e)})},help:function(){i.open({type:2,title:"\u5e2e\u52a9",area:["600px","380px"],shadeClose:!0,shade:.1,skin:"layui-layer-msg",content:["","no"]})}},c=a.find(".layui-layedit-tool"),u=function(){var i=e(this),a=i.attr("layedit-event"),l=i.attr("lay-command");if(!i.hasClass(r)){o.focus();var u=m(n);u.commonAncestorContainer;l?(n.execCommand(l),/justifyLeft|justifyCenter|justifyRight/.test(l)&&n.execCommand("formatBlock",!1,"

            "),setTimeout(function(){o.focus()},10)):s[a]&&s[a].call(this,u),h.call(t,c,i)}},d=/image/;c.find(">i").on("mousedown",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)||u.call(this)}).on("click",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)&&u.call(this)}),o.on("click",function(){h.call(t,c)})},b=function(t,e){var l=this,n=i.open({type:1,id:"LAY_layedit_link",area:"350px",shade:.05,shadeClose:!0,moveType:1,title:"\u8d85\u94fe\u63a5",skin:"layui-layer-msg",content:['

              ','
            • ','','
              ','',"
              ","
            • ",'
            • ','','
              ','",'","
              ","
            • ",'
            • ','','',"
            • ","
            "].join(""),success:function(t,n){var o="submit(layedit-link-yes)";a.render("radio"),t.find(".layui-btn-primary").on("click",function(){i.close(n),l.focus()}),a.on(o,function(t){i.close(b.index),e&&e(t.field)})}});b.index=n},x=function(t){var e=this,l=i.open({type:1,id:"LAY_layedit_code",area:"550px",shade:.05,shadeClose:!0,moveType:1,title:"\u63d2\u5165\u4ee3\u7801",skin:"layui-layer-msg",content:['
              ','
            • ','','
              ','","
              ","
            • ",'
            • ','','
              ','',"
              ","
            • ",'
            • ','','',"
            • ","
            "].join(""),success:function(l,n){var o="submit(layedit-code-yes)";a.render("select"),l.find(".layui-btn-primary").on("click",function(){i.close(n),e.focus()}),a.on(o,function(e){i.close(x.index),t&&t(e.field)})}});x.index=l},k={html:'',strong:'',italic:'',underline:'',del:'',"|":'',left:'',center:'',right:'',link:'',unlink:'',face:'',image:'',code:'',help:''},C=new s;t(n,C)});layui.define("jquery",function(a){"use strict";var e=layui.$;a("code",function(a){var l=[];a=a||{},a.elem=e(a.elem||".layui-code"),a.lang="lang"in a?a.lang:"code",a.elem.each(function(){l.push(this)}),layui.each(l.reverse(),function(l,i){var t=e(i),c=t.html();(t.attr("lay-encode")||a.encode)&&(c=c.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")),t.html('
            1. '+c.replace(/[\r\t\n]+/g,"
            2. ")+"
            "),t.find(">.layui-code-h3")[0]||t.prepend('

            '+(t.attr("lay-title")||a.title||"</>")+''+(t.attr("lay-lang")||a.lang||"")+"

            ");var n=t.find(">.layui-code-ol");t.addClass("layui-box layui-code-view"),(t.attr("lay-skin")||a.skin)&&t.addClass("layui-code-"+(t.attr("lay-skin")||a.skin)),(n.find("li").length/100|0)>0&&n.css("margin-left",(n.find("li").length/100|0)+"px"),(t.attr("lay-height")||a.height)&&n.css("max-height",t.attr("lay-height")||a.height)})})}).addcss("modules/code.css?v=2","skincodecss"); \ No newline at end of file diff --git a/static/component/pear/css/module/button.css b/static/component/pear/css/module/button.css new file mode 100644 index 000000000..c9e6c976c --- /dev/null +++ b/static/component/pear/css/module/button.css @@ -0,0 +1,173 @@ +.pear-btn { + display: inline-block; + line-height: 38px; + white-space: nowrap; + cursor: pointer; + text-align: center; + box-sizing: border-box; + outline: none; + transition: 0.1s; + font-weight: 500; + padding: 0 18px; + height: 38px; + font-size: 14px; + background-color: white; + border: 1px solid #dcdfe6; + border-radius: 2px; +} + +.pear-btn i { + font-size: 13px; +} + +.pear-btn:hover { + opacity: .8; + filter: alpha(opacity=80); + color: #409eff; + background-color: #ECF5FF; +} + +.pear-btn-danger, +.pear-btn-warming, +.pear-btn-success, +.pear-btn-primary { + height: 37px; + line-height: 37px; + color: #fff !important +} + +/** Button 主题 */ +.pear-btn-primary { + border: #2D8CF0; + background-color: #2D8CF0 !important; +} +.pear-btn-danger { + border: #f56c6c; + background-color: #f56c6c !important; +} +.pear-btn-warming { + border: #f6ad55; + background-color: #f6ad55 !important; +} +.pear-btn-success { + border: #36b368; + background-color: #36b368 !important; +} + +.pear-btn[round] { + border-radius: 50px; +} + +.pear-btn-primary[plain] { + border: #409eff !important; + color: #409eff !important; + background: #ecf5ff 10% !important; +} + +.pear-btn-primary[plain]:hover { + color: #fff !important; + background-color: #2d8cf0!important +} + +.pear-btn-success[plain] { + border: #36b368 !important; + color: #36b368 !important; + background: #f0f9eb !important; +} + +.pear-btn-success[plain]:hover { + color: white !important; + background-color: #36b368 !important +} + +.pear-btn-warming[plain] { + border: #e6a23c !important; + color: #e6a23c !important; + background: #fdf6ec !important; +} + +.pear-btn-warming[plain]:hover { + color: white !important; + background-color: #e6a23c !important +} + +.pear-btn-danger[plain] { + border: #f56c6c !important; + color: #f56c6c !important; + background: #fef0f0 !important; +} + +.pear-btn-danger[plain]:hover { + color: white !important; + background-color: #f56c6c !important +} + +/** Button Group */ +.pear-btn-group { + display: inline-block; + vertical-align: middle; +} + +.pear-btn-group .pear-btn { + float: left; + position: relative; + border-radius: 0px; + margin-left: 1px; + margin-right: 1px; +} + +.pear-btn-md { + height: 34px; + line-height: 34px; + padding: 0 10px; + font-size: 12.5px; +} + +.pear-btn-group .pear-btn:first-child { + border-top-left-radius: 4px !important; + border-bottom-left-radius: 4px !important; +} + +.pear-btn-group .pear-btn:last-child { + border-top-right-radius: 4px !important; + border-bottom-right-radius: 4px !important; +} + +.pear-btn-group .pear-btn[round]:first-child { + border-top-left-radius: 50px !important; + border-bottom-left-radius: 50px !important; +} + +.pear-btn-group .pear-btn[round]:last-child { + border-top-right-radius: 50px !important; + border-bottom-right-radius: 50px !important; +} + +/** Button Size*/ +.pear-btn-sm { + height: 32px; + line-height: 32px; + padding: 0 10px; + font-size: 12px; +} + +.pear-btn-xs { + height: 28px; + line-height: 28px; + padding: 0 8px; + font-size: 12px; +} + +.pear-btn-md { + height: 34px; + line-height: 34px; + padding: 0 10px; + font-size: 12.5px; +} + +.pear-btn-lg { + height: 44px; + line-height: 44px; + padding: 0 25px; + font-size: 16px; +} diff --git a/static/component/pear/css/module/card.css b/static/component/pear/css/module/card.css new file mode 100644 index 000000000..39b4ed28e --- /dev/null +++ b/static/component/pear/css/module/card.css @@ -0,0 +1,93 @@ +.project-list-item { + background-color: #fff; + border-radius: 4px; + cursor: pointer; + transition: all .2s; +} + +.project-list-item:hover { + box-shadow: 2px 0 4px rgba(0, 21, 41, .35); +} + +.project-list-item .project-list-item-cover { + width: 100%; + height: 180px; + display: block; + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} + +.project-list-item-body { + padding: 20px; + border: 1px solid #e8e8e8; +} + +.project-list-item .project-list-item-body>h2 { + font-size: 16px; + color: #333; + margin-bottom: 12px; +} + +.project-list-item .project-list-item-text { + height: 40px; + overflow: hidden; + margin-bottom: 12px; +} + +.project-list-item .project-list-item-desc { + position: relative; +} + +.project-list-item .project-list-item-desc .time { + color: #999; + font-size: 12px; +} + +.project-list-item .project-list-item-desc .ew-head-list { + position: absolute; + right: 0; + top: 0; +} + +.ew-head-list .ew-head-list-item:first-child { + margin-left: 0; +} + +.ew-head-list .ew-head-list-item { + width: 22px; + height: 22px; + border-radius: 50%; + border: 1px solid #fff; + margin-left: -10px; +} + +.ew-head-list .ew-head-list-item { + width: 22px; + height: 22px; + border-radius: 50%; + border: 1px solid #fff; + margin-left: -10px; +} + +.cloud-card-component { + padding: 20px; +} + +.cloud-card-component .layui-table-click { + border-radius: 6px!important; +} + +.ew-table-loading { + padding: 10px 0; + text-align: center; +} +.ew-table-loading > i { + color: #999; + font-size: 30px; +} +.ew-table-loading.ew-loading-float { + position: absolute; + top: 0; + left: 0; + right: 0; +} \ No newline at end of file diff --git a/static/component/pear/css/module/code.css b/static/component/pear/css/module/code.css new file mode 100644 index 000000000..4bde0d3d6 --- /dev/null +++ b/static/component/pear/css/module/code.css @@ -0,0 +1,9 @@ +.layui-colla-content{ + padding: 0px; +} +.layui-code-view{ + margin: 0px!important; +} +.layui-code-h3{ + display: none!important; +} \ No newline at end of file diff --git a/static/component/pear/css/module/cropper.css b/static/component/pear/css/module/cropper.css new file mode 100644 index 000000000..2c6404269 --- /dev/null +++ b/static/component/pear/css/module/cropper.css @@ -0,0 +1,272 @@ +.cropper-container { + position: relative; + overflow: hidden; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none +} + +.cropper-container img { + display: block; + width: 100%; + min-width: 0 !important; + max-width: none !important; + height: 100%; + min-height: 0 !important; + max-height: none !important; + image-orientation: 0deg !important +} + +.cropper-canvas, +.cropper-crop-box, +.cropper-drag-box, +.cropper-modal { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0 +} + +.cropper-drag-box { + background-color: #fff; + filter: alpha(opacity=0); + opacity: 0 +} + +.cropper-modal { + background-color: #000; + filter: alpha(opacity=50); + opacity: .5 +} + +.cropper-view-box { + display: block; + width: 100%; + height: 100%; + overflow: hidden; + outline: #69f solid 1px; + outline-color: rgba(102, 153, 255, .75) +} + +.cropper-dashed { + position: absolute; + display: block; + filter: alpha(opacity=50); + border: 0 dashed #fff; + opacity: .5 +} + +.cropper-dashed.dashed-h { + top: 33.33333333%; + left: 0; + width: 100%; + height: 33.33333333%; + border-top-width: 1px; + border-bottom-width: 1px +} + +.cropper-dashed.dashed-v { + top: 0; + left: 33.33333333%; + width: 33.33333333%; + height: 100%; + border-right-width: 1px; + border-left-width: 1px +} + +.cropper-face, +.cropper-line, +.cropper-point { + position: absolute; + display: block; + width: 100%; + height: 100%; + filter: alpha(opacity=10); + opacity: .1 +} + +.cropper-face { + top: 0; + left: 0; + cursor: move; + background-color: #fff +} + +.cropper-line { + background-color: #69f +} + +.cropper-line.line-e { + top: 0; + right: -3px; + width: 5px; + cursor: e-resize +} + +.cropper-line.line-n { + top: -3px; + left: 0; + height: 5px; + cursor: n-resize +} + +.cropper-line.line-w { + top: 0; + left: -3px; + width: 5px; + cursor: w-resize +} + +.cropper-line.line-s { + bottom: -3px; + left: 0; + height: 5px; + cursor: s-resize +} + +.cropper-point { + width: 5px; + height: 5px; + background-color: #69f; + filter: alpha(opacity=75); + opacity: .75 +} + +.cropper-point.point-e { + top: 50%; + right: -3px; + margin-top: -3px; + cursor: e-resize +} + +.cropper-point.point-n { + top: -3px; + left: 50%; + margin-left: -3px; + cursor: n-resize +} + +.cropper-point.point-w { + top: 50%; + left: -3px; + margin-top: -3px; + cursor: w-resize +} + +.cropper-point.point-s { + bottom: -3px; + left: 50%; + margin-left: -3px; + cursor: s-resize +} + +.cropper-point.point-ne { + top: -3px; + right: -3px; + cursor: ne-resize +} + +.cropper-point.point-nw { + top: -3px; + left: -3px; + cursor: nw-resize +} + +.cropper-point.point-sw { + bottom: -3px; + left: -3px; + cursor: sw-resize +} + +.cropper-point.point-se { + right: -3px; + bottom: -3px; + width: 20px; + height: 20px; + cursor: se-resize; + filter: alpha(opacity=100); + opacity: 1 +} + +.cropper-point.point-se:before { + position: absolute; + right: -50%; + bottom: -50%; + display: block; + width: 200%; + height: 200%; + content: " "; + background-color: #69f; + filter: alpha(opacity=0); + opacity: 0 +} + +@media (min-width:768px) { + .cropper-point.point-se { + width: 15px; + height: 15px + } +} + +@media (min-width:992px) { + .cropper-point.point-se { + width: 10px; + height: 10px + } +} + +@media (min-width:1200px) { + .cropper-point.point-se { + width: 5px; + height: 5px; + filter: alpha(opacity=75); + opacity: .75 + } +} + +.cropper-bg { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC) +} + +.cropper-invisible { + filter: alpha(opacity=0); + opacity: 0 +} + +.cropper-hide { + position: fixed; + top: 0; + left: 0; + z-index: -1; + width: auto !important; + min-width: 0 !important; + max-width: none !important; + height: auto !important; + min-height: 0 !important; + max-height: none !important; + filter: alpha(opacity=0); + opacity: 0 +} + +.cropper-hidden { + display: none !important +} + +.cropper-move { + cursor: move +} + +.cropper-crop { + cursor: crosshair +} + +.cropper-disabled .cropper-canvas, +.cropper-disabled .cropper-face, +.cropper-disabled .cropper-line, +.cropper-disabled .cropper-point { + cursor: not-allowed +} diff --git a/static/component/pear/css/module/dtree/dtree.css b/static/component/pear/css/module/dtree/dtree.css new file mode 100644 index 000000000..3e5364d4d --- /dev/null +++ b/static/component/pear/css/module/dtree/dtree.css @@ -0,0 +1,112 @@ + +/**************** 主题换肤 ****************/ +/* 默认风格*/ +.dtree-theme-item-this{background-color: #d2d2d2!important;} +.dtree-theme-item:hover{background-color: #eaeceb!important;} +.dtree-theme-item cite{font-size:12px!important;} +.dtree-theme-item:hover cite{color:#fe7786!important;} + +.dtree-theme-dtreefont{font-size: 16px!important;} +.dtree-theme-ficon{color:#000!important;} +.dtree-theme-icon{color:orange!important;} +.dtree-theme-checkbox:hover{color:#fe7786!important;} +.dtree-theme-choose{color:#fe7786!important;} + +/* layui主题风格*/ +.dtree-layui-item-this{background: none!important;} +.dtree-layui-item:hover{background: none!important;} +.dtree-layui-item cite{font-size:14px!important;} +.dtree-layui-item:hover cite{opacity:0.5;filter:Alpha(opacity=50);text-decoration: underline;} + +.dtree-layui-dtreefont{font-size: 18px!important;} +.dtree-layui-ficon{font-size: 18px!important;color:#393D49!important;} +.dtree-layui-icon{color:#666!important;} +.dtree-layui-checkbox:hover{color:#5FB878!important;} +.dtree-layui-choose{color:#5FB878!important;} + +/* laySimple主题风格*/ +.dtree-laySimple-item-this{background-color: #d2d2d2!important;} +.dtree-laySimple-item:hover{background-color: #eaeceb!important;} +.dtree-laySimple-item cite{font-size:12px!important;} +.dtree-laySimple-item:hover cite{color:#01AAED!important;} + +.dtree-laySimple-dtreefont{font-size: 16px!important;} +.dtree-laySimple-ficon{font-size: 14px!important;color:#393D49!important;} +.dtree-laySimple-icon{color:#393D49!important;} +.dtree-laySimple-checkbox:hover{color:#01AAED!important;} +.dtree-laySimple-choose{color:#01AAED!important;} +/**************** 树基础 ****************/ +/* 菜单栏*/ +.dtree-menubar {padding-left: 10px;} +.dtree-menubar .layui-btn-group .layui-btn-sm{height: 20px;line-height: 20px;padding: 0 5px;font-size: 12px;} +.dtree-menubar .layui-btn-group .layui-btn-sm i{font-size: 12px!important;} + +/* 工具栏*/ +.dtree-toolbar{position: absolute;z-index: 940520;padding: 0;background-color: #eceaeb;} +.dtree-toolbar .layui-nav-child{position: static;} +.dtree-toolbar .layui-nav-child dd{cursor: pointer;} +.dtree-toolbar .layui-nav-child dd a i{font-size:16px;display: inline-block;margin: 0px 1px;color:#fe7786;} +.dtree-toolbar .layui-nav-child dd a i:hover{font-weight: bold;} +.dtree-toolbar .layui-nav-bar{display: none!important;} +.dtree-toolbar-tool{padding: 30px;} + +.dtree-toolbar-fixed{position: absolute;right: 5px;top: 2px;font-style: normal;transition: all .3s;-webkit-transition: all .3s;} +/*.dtree-toolbar-fixed a{border:1px solid #fe7786;}*/ +.dtree-toolbar-fixed a i{font-size:14px;display: inline-block;margin: 0px 1px;color:#fe7786;} +.dtree-toolbar-fixed a i:hover{opacity:0.8;filter:Alpha(opacity=80);} + +/* 树基本*/ +.dtree{width:260px;} +.dtree-nav-item{line-height:33px;padding-left:16px;} +.dtree-nav-ul-sid{display: none;} +.dtree-none-text{font-size: 12px;text-align: center;color: gray;} + +/* 树线*/ +.dtree-nav-first-line,.dtree-nav-line,.dtree-nav-last-line{position: relative;} +.dtree-nav-first-line:before{content:"";position: absolute;height: 0;border-left: 1px dotted #c0c4cc;} +.dtree-nav-first-line:after{content:"";position: absolute;height: 0;border-top: 1px dotted #c0c4cc;} + +.dtree-nav-line:before{content:"";position: absolute;top: 0;left: 7px;width: 0;height: 100%;border-left: 1px dotted #c0c4cc;} +.dtree-nav-line:after{content:"";position: absolute;top: 16px;left: 8px;width: 9px;height: 0;border-top: 1px dotted #c0c4cc;} + +.dtree-nav-last-line:before{content:"";position: absolute;top: 0;left: 7px;width: 0;height: 17px;border-left: 1px dotted #c0c4cc;} +.dtree-nav-last-line:after{content:"";position: absolute;top: 16px;left: 8px;width: 9px;height: 0;border-top: 1px dotted #c0c4cc;} + + +/* 图标及复选框*/ +.dtreefont{cursor: pointer;} +.dtreefont-special{margin: 0 4px;} +.dtree-nav-checkbox-div{display: inline-block;} +.dtree-nav-checkbox-div>i{display: inline-block;margin: 0px 1px;} +.dtree-nav-checkbox-div>i:last-child{margin-right: 4px;} +.dtree-nav-checkbox-div>i:hover{opacity:0.8;filter:Alpha(opacity=80);} + +/* 行 文字*/ +.dtree-nav-div{display:block;vertical-align:top;position:relative;} +.dtree-nav-div cite{font-style: normal;cursor: pointer;} +.dtree-nav-div:hover cite{opacity:0.7;filter:Alpha(opacity=70);transition: all .3s;-webkit-transition: all .3s;} + +/* 规则属性*/ +.dtree-nav-show {display: block!important;} +.dtree-nav-hide {display: none!important;} +.dtree-nav-this {} +.dtree-icon-hide {opacity:0;filter:Alpha(opacity=0);} +.dtree-icon-null-open,.dtree-icon-null-close,.dtree-icon-null{margin: 0 2px;} +.dtree-disabled{cursor: not-allowed; color:#c2c2c2!important;} +.dtree-disabled:hover{color:#c2c2c2!important;} +.dtree-nav-div cite.dtree-disabled{font-style: normal; cursor: not-allowed; color:#c2c2c2!important;} +.dtree-nav-div>cite.dtree-disabled:hover{color:#c2c2c2!important;} + + +/** 下拉树属性*/ +.dtree-select{position: absolute;max-height: 500px;height: 350px;overflow: auto;width: 99%;z-index: 123;display: none;border:1px solid silver;top: 42px;} +.dtree-select-show{display: block!important;} + +/* 简单适配*/ +@media screen and (max-width:1700px) and (min-width:1300px){ + .dtree-nav-item {padding-left: 15px;} +} + + + + diff --git a/static/component/pear/css/module/dtree/dtree.js b/static/component/pear/css/module/dtree/dtree.js new file mode 100644 index 000000000..a05b22a8e --- /dev/null +++ b/static/component/pear/css/module/dtree/dtree.js @@ -0,0 +1,4947 @@ +/** + *@Name dtree 树形组件 + *@Author 智慧的小西瓜 + *@DOCS http://www.wisdomelon.com/DTreeHelper/ + *@License https://www.layui.com/ + *@LASTTIME 2019/10/24 + *@VERSION v2.5.6 + */ +layui.define(['jquery','layer','form'], function(exports) { + var $ = layui.$, + layer = layui.layer, + form = layui.form; + + // 树的公共定义样式汇总 + var LI_NAV_CHILD = "dtree-nav-ul-sid", LI_NAV_ITEM = "dtree-nav-item", + LI_DIV_ITEM = "dtree-nav-div", DTREEFONTSPECIAL="dtreefont-special", NONETITLE="dtree-none-text", + LI_DIV_MENUBAR = "dtree-menubar", + LI_DIV_TOOLBAR = "dtree-toolbar", TOOLBAR_TOOL = "dtree-toolbar-tool", TOOLBAR_TOOL_EM = "dtree-toolbar-fixed", + LI_DIV_CHECKBAR = "dtree-nav-checkbox-div", + LI_CLICK_CHECKBAR = "d-click-checkbar", //绑定点击复选框时需要用到 + LI_DIV_TEXT_CLASS = "t-click", UL_ROOT="dtree", + LI_NAV_FIRST_LINE = "dtree-nav-first-line", LI_NAV_LINE = "dtree-nav-line", LI_NAV_LAST_LINE = "dtree-nav-last-line"; + + + // 树的公共指定 + var NAV_THIS = "dtree-nav-this", //当前节点 + NAV_SHOW = "dtree-nav-show", //显示子节点 + NAV_HIDE = "dtree-nav-hide", //隐藏节点 + NAV_DIS = "dtree-disabled", //禁用节点 + ICON_HIDE = "dtree-icon-hide", //隐藏图标 + $BODY = $("body"), //body选择器 + $WIN = $(window), //window窗口 + $DOC = $(document), //当前文档 + MOD_NAME = "dtree", //模块名称 + VERSION = "v2.5.6", //版本 + OPTIONS = {}, //全局属性配置 + DTrees = {}; //当前被实例化的树的集合 + + // 树的自定义图标 + var DTREEFONT = "dtreefont", //默认使用图标字体 + LI_DIV_CHECKBAR_ON = "dtree-icon-fuxuankuangxuanzhong", //复选框选中图标 + LI_DIV_CHECKBAR_OUT = "dtree-icon-fuxuankuang", //复选框未选中图标 + LI_DIV_CHECKBAR_NOALL = "dtree-icon-fuxuankuang-banxuan", //复选框半选图标 + LI_DIV_MENUBAR_DOWN = "dtree-icon-move-down", //menubar的展开全部的图标 + LI_DIV_MENUBAR_UP = "dtree-icon-move-up", //menubar的收缩全部的图标 + LI_DIV_MENUBAR_REFRESH = "dtree-icon-refresh", //menubar的刷新图标 + LI_DIV_MENUBAR_CHECKALL = "dtree-icon-roundcheckfill", //menubar的全选图标 + LI_DIV_MENUBAR_UNCHECKALL = "dtree-icon-roundclosefill", //menubar的全不选图标 + LI_DIV_MENUBAR_INVERTALL = "dtree-icon-roundcheck", //menubar的反选图标 + LI_DIV_MENUBAR_DELETE = "dtree-icon-delete1", //menubar的删除图标 + LI_DIV_MENUBAR_SEARCH = "dtree-icon-search_list_light", //menubar的搜索图标 + LI_DIV_TOOLBAR_PULLDOWN = "dtree-icon-pulldown", //toolbar的展开图标 + LI_DIV_TOOLBAR_PULLUP = "dtree-icon-pullup", //toolbar的收缩图标 + LI_DIV_TOOLBAR_ADD = "dtree-icon-roundadd", //toolbar的新增图标 + LI_DIV_TOOLBAR_EDIT = "dtree-icon-bianji", //toolbar的编辑图标 + LI_DIV_TOOLBAR_DEL = "dtree-icon-roundclose"; //toolbar的删除图标 + + // 树的非叶子节点图标集合 + var nodeIconArray = { + "-1": {"open": "dtree-icon-null-open", "close": "dtree-icon-null-close"}, //未指定 + "0" : {"open": "dtree-icon-wenjianjiazhankai", "close": "dtree-icon-weibiaoti5"}, //文件夹(二级图标默认样式) + "1" : {"open": "dtree-icon-jian", "close": "dtree-icon-jia"}, //+-图标(一级图标默认样式) + "2" : {"open": "dtree-icon-xiangxia1", "close": "dtree-icon-xiangyou"} //箭头图标 + }; + + // 树的叶子节点图标集合 + var leafIconArray = { + "-1": "dtree-icon-null", //未指定 + "0" : "dtree-icon-weibiaoti5", //文件夹 + "1" : "dtree-icon-yonghu", //人员 + "2" : "dtree-icon-fenzhijigou", //机构 + "3" : "dtree-icon-fenguangbaobiao", //报表 + "4" : "dtree-icon-xinxipilu", //信息 + "5" : "dtree-icon-shuye1", //叶子(二级图标默认样式) + "6" : "dtree-icon-caidan_xunzhang", //勋章 + "7" : "dtree-icon-normal-file", //文件 + "8" : "dtree-icon-dian", //小圆点(一级图标默认样式) + "9" : "dtree-icon-set-sm", //齿轮 + "10" : "dtree-icon-rate" //星星 + }; + + // 树的自定义样式 + var DTREE = "dtree-", //自定义样式前缀 + ITEMTHIS = "-item-this", //自定义样式当前行选中后缀 + ITEM = "-item", //自定义样式当前行后缀 + DFONT = "-dtreefont", //自定义样式图标样式后缀 + FICON = "-ficon", //自定义样式一级图标样式后缀 + ICON = "-icon", //自定义样式二级图标样式后缀 + CBOX = "-checkbox", //自定义样式复选框样式后缀 + CHS = "-choose"; //自定义样式复选框选中样式后缀 + + // 树自定义操作事件名称集合 绑定dtree-click的事件 + var eventName = { + checkNodeClick: "checkNodeClick", //点击复选框 + itemNodeClick: "itemNodeClick" //点击子节点div + }; + + // 树默认toolbar提供的功能集合 绑定dtree-tool的事件 + var defaultTool = { + pulldown: "pulldown", //点击展开当前节点下的全部节点 + pullup: "pullup", //点击收缩当前节点下的全部节点 + addTool: "addToolbar", //点击toolbar新增 + editTool: "editToolbar", //点击toolbar编辑 + delTool: "delToolbar" //点击toolbar删除 + }; + + // 树默认menubar提供的功能集合 绑定dtree-menu的事件 + var defaultMenu = { + moveDown: "moveDown", //menubar展开全部节点 + moveUp: "moveUp", //menubar收缩全部节点 + refresh: "refresh", //menubar刷新树 + checkAll: "checkAll", //menubar全选 + unCheckAll: "unCheckAll", //menubar全不选 + invertAll: "invertAll", //menubar反选 + remove: "remove", //menubar删除选中节点 + searchNode: "searchNode" //menubar查询节点 + }; + + // 树的公共事件 + var event = { + getElemId: function(options){ // 根据传入的参数获取ID + var elem = options.elem || ""; + var obj = options.obj || $(elem); + + if (obj.length == 0) { //页面中未找到绑定id + return ""; + } else { + return $(obj)[0].id; + } + }, + escape: function(html){ + if(typeof html !== 'string') return ''; + return html.replace(entityReg.escape, function(match){return entityMap.escape[match];}); + }, + unescape: function(str){ + if(typeof str !== 'string') return ''; + return str.replace(entityReg.unescape, function(match){return entityMap.unescape[match];}); + }, + cloneObj: function (obj, filter) { //深复制对象方法 + var newObj = {}; + if (obj instanceof Array) { + newObj = []; + } + var str = ""; + if(typeof filter !== 'undefined') {str = filter.join(",");} + for (var key in obj) { + if(str.indexOf(key) == -1){ + var val = obj[key]; + newObj[key] = typeof val === 'object' ? event.cloneObj(val, typeof filter !== undefined ? filter : []): val; + } + + } + return newObj; + }, + trimToDot: function(str){ + return str.replace(/ /g, "."); + } + }; + + // 特殊符号转义 + var keys = Object.keys || function(obj) { + obj = Object(obj); + var arr = []; + for(var a in obj) arr.push(a); + return arr; + }; + var invert = function(obj){ + obj = Object(obj); + var result = {}; + for(var a in obj) result[obj[a]] = a; + return result; + }; + var entityMap = { + escape: { + "&" : "&", + "<" : "<", + ">" : ">", + "'" : "&quo;" + } + }; + entityMap.unescape = invert(entityMap.escape); + var entityReg = { + escape: RegExp('[' + keys(entityMap.escape).join('') + ']', 'g'), + unescape: RegExp('(' + keys(entityMap.unescape).join('|') + ')', 'g') + }; + + //异步加载接口 + var AjaxHelper = { + request : function(config) { + var data = config.data ? config.data : {}; + var async = (typeof (config.async) === "boolean") ? config.async : true; + $.ajax({ + type : config.type ? config.type : "POST", + headers : config.headers, + url : config.url, + dataType : config.dataType ? config.dataType : "json", + data : data, + async : async, + contentType : config.contentType, + xhrFields: {withCredentials: config.withCredentials}, + success : config.success, + error : function(XMLHttpRequest, textStatus, errorThrown) { + if (typeof (config.error) === "function") { + config.error(XMLHttpRequest, textStatus, errorThrown); + } else { + layer.msg("异步加载失败: " + textStatus,{icon:5, shift:6}); + } + }, + statusCode : { + 404 : function() { + layer.msg('未找到指定请求,请检查访问路径!',{icon:5, shift:6}); + }, + 500 : function() { + layer.msg('系统错误!',{icon:5, shift:6}); + } + }, + complete : function(XMLHttpRequest, textStatus) { + if (typeof (config.complete) === "function") { + config.complete(XMLHttpRequest, textStatus); + } + } + }); + }, + serialize: function(param){ //json序列化 key=value&key1=value1 + var p = "?"; + for (var key in param) { + p += key + "=" + param[key] + "&"; + } + p = p.substring(0, p.length-1); + return p; + } + }; + + // 树类 + var DTree = function(options){ + var _this = this; + /** 默认赋值**/ + this.formatter = { // 数据过滤 + title: false // 文字,默认不开启 + }; + this.response = { // 树返回的json格式 + statusName: "code", //返回标识 + statusCode: 200, //返回码 + message: "message", //返回信息 + rootName: "data", //根节点名称 + treeId: "id", //节点ID + parentId: "parentId", //父节点ID + title: "title", //节点名称 + ficonClass: "ficonClass", //自定义一级图标 + iconClass: "iconClass", //自定义二级图标 + childName: "children", //子节点名称 + last: "last", //是否最后一级节点 +// level: "level", //层级 + spread: "spread", //展开 + disabled: "disabled", //禁用 + hide: "hide", //隐藏 + checkArr: "checkArr", //复选框列表 + checked: "checked", //是否选中 + type: "type", //复选框标记 + basicData: "basicData" //表示用户自定义需要存储在树节点中的数据 + }; + this.defaultRequest = { // 树的默认发起请求参数格式,最后会将value作为参数名称传递 + nodeId: "nodeId", //节点ID + parentId: "parentId", //父节点ID + context: "context", //节点内容 + leaf: "leaf", //是否叶子节点 + level: "level", //层级 + spread: "spread", //节点展开状态 + dataType: "dataType", //节点标记 + checked: "checked", //节点复选框选中状态 + initchecked: "initchecked", //节点复选框初始状态 + basicData: "basicData", //用户自定义的记录节点数据 + recordData: "recordData", //当前data数据(排除basicData和children字段) + }; + this.toolbarFun = { + addTreeNode: function(param, $div) { //添加树节点后调用的函数,用于用户自定义,如未指定则树不会发生变化 + return ; + }, + editTreeNode: function(param, $div) { //编辑树节点后调用的函数,用于用户自定义,如未指定则树不会发生变化 + return ; + }, + editTreeLoad: function(param){ // 编辑树的数据回显,用于打开编辑时,回填数据 + return ; + }, + delTreeNode: function(param, $div){ //删除树后调用的函数,用于用户自定义,如未指定则树不会发生变化 + return ; + }, + loadToolbarBefore: function(buttons, param, $div){ // 右键菜单加载前的函数 + return buttons; + } + }; + this.toolbarStyle = { + title: "节点", + area: ["60%","80%"] + }; + this.menubarFun = { + remove: function(checkbarNodes){ //删除复选框选中节点,需要用户自定义,如未指定则树只是页面上做了修改 + return true; + } + }; + this.menubarTips = { + toolbar: [], + group: [defaultMenu.moveDown, defaultMenu.moveUp, defaultMenu.refresh, defaultMenu.checkAll, defaultMenu.unCheckAll, defaultMenu.invertAll, defaultMenu.remove, defaultMenu.searchNode], + freedom: [] + }; + this.checkbarFun = { + chooseBefore: function($i, node){ // 复选框点击前回调 + return true; + }, + chooseDone: function(checkbarNodesParam) { //复选框点击事件完毕后,返回该树关于复选框操作的全部信息,用于用户自定义,如未指定则树只是页面上做了修改 + return ; + } + }; + this.iframeDefaultRequest = { //iframe的默认参数,目的是与加载树的参数不一样 + nodeId: "nodeId", //节点ID + parentId: "parentId", //父节点ID + context: "context", //节点内容 + leaf: "leaf", //是否叶子节点 + level: "level", //层级 + spread: "spread", //节点展开状态 + dataType: "dataType", //节点标记 + checked: "checked", //节点复选框选中状态 + initchecked: "initchecked", //节点复选框初始状态 + basicData: "basicData", //用户自定义的记录节点数据 + recordData: "recordData", //当前data数据(排除basicData和children字段) + }; + + this.iframeFun = { + iframeDone: function(iframeParam){ //iframe加载完毕后,用于用户自定义事件 + return ; + } + }; + this.style = { //树最终使用的样式集合 + item: "", //每一项div的样式 + itemThis: "", //选中div的样式 + dfont: "", //一级图标的样式 + icon: "", //二级图标的样式 + cbox: "", //复选框的样式 + chs: "" //复选框选中的样式 + }; + this.usefontStyle = { //树最终使用的图标集合 + fnode:{ //一级节点 + node:{ //非叶子节点 + open:"", //节点展开 + close:"" //节点关闭 + }, + leaf:"" //叶子节点 + }, + snode:{ //二级节点 + node:{ //非叶子节点 + open:"", //节点展开 + close:"" //节点关闭 + }, + leaf:"" //叶子节点 + }, + checkbox:{ //复选框 + on:"", //复选框选中 + out:"", //未选中 + noall:"" //半选 + }, + menubar:{ //菜单栏 + movedown:"", //全部展开 + moveup:"", //全部收缩 + refresh:"", //刷新 + checkAll:"", //全选 + unCheckAll:"", //全不选 + invertAll:"", //反选 + remove:"", //删除 + search:"" //搜索 + }, + menubarExt:"", //扩展菜单栏 + toolbar:{ //工具栏 + menubar:{ //依附在菜单栏的工具栏 + movedown:"", //全部展开 + moveup:"", //全部收缩 + refresh:"", //刷新 + checkAll:"", //全选 + unCheckAll:"", //全不选 + invertAll:"", //反选 + remove:"", //删除 + search:"" //搜索 + }, + menubarExt:"", //依附在菜单栏的扩展菜单栏 + pulldown:"", //展开 + pullup:"", //收缩 + add:"", //添加 + edit:"", //编辑 + del:"" //删除 + }, + toolbarExt:"" //扩展工具栏 + } + + /** 数据绑定**/ + this.node = { // 树节点选中时,包含当前节点的全部信息 + nodeId: "", //节点ID + parentId: "", //父节点ID + context: "", //节点内容 + leaf: "", //是否叶子节点 + level: "", //层级 + spread: "", //节点展开状态 + dataType: "", //节点标记 + checked: "", //节点复选框选中状态 + initchecked: "", //节点复选框初始状态 + basicData: "", //用户自定义的记录节点数据 + recordData: "", //当前data数据(排除basicData和children字段) + }; + + this.toolbarMenu = {}; // 工具栏右键菜单绑定的所有元素 + this.checkbarNode = []; // 复选框标记的全部节点数据 + this.errData = []; // 记录在渲染节点时有问题的数据 + this.checkArrLen = 0; //添加节点的时判断复选框个数 + this.temp = []; // 临时变量 + this.bak = ""; // 临时变量 + this.setting(options); + }; + + /******************** 初始参数加载 ********************/ + // 设置基本参数值 + DTree.prototype.setting = function(options) { + this.options = options || {}; + + /** 绑定元素参数(必填,2个参数项必填一个)**/ + this.elem = this.options.elem || OPTIONS.elem || ""; //树绑定的元素ID:#elem + if(typeof this.options.obj === 'undefined'){ + if(this.elem) { + if($(this.elem).length > 0) { + this.obj = $(this.elem); + } + } + } else { + this.obj = this.options.obj || OPTIONS.obj || this.obj; //树绑定的jquery元素,用于当元素是延迟加载出来的话,可以用这个找到 + this.elem = "#" + this.obj[0].id; + } + + /** 基本参数**/ + this.scroll = this.options.scroll || OPTIONS.scroll || this.elem; //树的上级div容器,让树可以显示滚动条的div容器的ID + this.accordion = (typeof (this.options.accordion) === "boolean") ? this.options.accordion : (typeof (OPTIONS.accordion) === "boolean") ? OPTIONS.accordion : false; //手风琴加载, 默认false + if(this.accordion) { + this.initLevel = 1; //默认展开节点 1节 + } else { + this.initLevel = this.options.initLevel || OPTIONS.initLevel || 2; //默认展开节点 2节 + } + this.type = this.options.type || OPTIONS.type || "load"; //树的加载方式 all,全量树, load,增量树,默认load + this.cache = (typeof (this.options.cache) === "boolean") ? this.options.cache : (typeof (OPTIONS.cache) === "boolean") ? OPTIONS.cache : true; //数据缓存,默认true + this.record = this.options.record || OPTIONS.record || false; //开启数据记录模式,默认false + this.load = (typeof (this.options.load) === "boolean") ? this.options.load : (typeof (OPTIONS.load) === "boolean") ? OPTIONS.load : true; //开启加载动画,默认true + this.none = this.options.none || OPTIONS.nont || "无数据"; //初始加载无记录时显示文字 + this.tempHeight = this.options.height || OPTIONS.height; //临时转换高度变量 + if(this.tempHeight) { // 设置高度 + if(/^full-\d+$/.test(this.tempHeight)) { + this.fullHeightGap = this.tempHeight.split('-')[1]; + this.height = $WIN.height() - this.fullHeightGap; //设置高度 + } else { + this.fullHeightGap = this.tempHeight; + this.height = this.tempHeight; + } + } else { + this.fullHeightGap = ""; + this.height = ""; + } + this.width = this.options.width || OPTIONS.width || "260"; //宽度 + this.obj.css("width", this.width); + + /** 样式相关参数**/ + this.iconfont = this.options.iconfont || OPTIONS.iconfont || DTREEFONT; //默认图标字体 dtreefont + this.iconfontStyle = this.options.iconfontStyle || OPTIONS.iconfontStyle || {}; //用于自定义树的每个关键部位使用的图标 + this.nodeIconArray = $.extend(nodeIconArray, this.options.nodeIconArray || OPTIONS.nodeIconArray) || nodeIconArray; //用户自定义非叶子节点图标集合,node + this.leafIconArray = $.extend(leafIconArray, this.options.leafIconArray || OPTIONS.leafIconArray) || leafIconArray; //用户自定义叶子节点图标集合,leaf + this.skin = this.options.skin || OPTIONS.skin || "theme"; // 自定义样式 + if(this.skin == "layui"){ // layui主题 + this.line = (typeof (this.options.line) === "boolean") ? this.options.line : (typeof (OPTIONS.line) === "boolean") ? OPTIONS.line : true; //开启树线,默认开启 + this.ficon = this.options.ficon || OPTIONS.ficon || "7"; //一级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示一级图标。默认'7' + this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "1") : this.ficon[0]; //一级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示一级图标,默认'1' + this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1]; //一级图标中的leaf节点图标 + this.icon = this.options.icon || OPTIONS.icon || "-1"; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示二级图标。默认'-1' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "-1") : this.icon[0]; //二级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'-1' + this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //二级图标中的leaf节点图标 + } else if(this.skin == "laySimple"){ // laySimple主题 + this.line = this.options.line || OPTIONS.line || false; //开启树线,默认不开启 + this.ficon = this.options.ficon || OPTIONS.ficon || ["2","-1"]; //一级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示一级图标。默认'-1' + this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "2") : this.ficon[0]; //一级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示一级图标,默认'2' + this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1]; // 一级图标中的leaf节点图标 + this.icon = this.options.icon || OPTIONS.icon || "-1"; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示二级图标。默认'-1' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "-1") : this.icon[0]; //二级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'-1' + this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //二级图标中的leaf节点图标 + } else { // 默认主题 或者自定义主题 + this.line = this.options.line || OPTIONS.line || false; //开启树线,默认不开启 + this.ficon = this.options.ficon || OPTIONS.ficon || "8"; //一级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示一级图标。默认'8' + this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "1") : this.ficon[0]; //一级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示一级图标,默认'1' + this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1]; // 一级图标中的leaf节点图标 + this.icon = this.options.icon || OPTIONS.icon || "5"; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示二级图标。默认'5' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "0") : this.icon[0]; //二级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'0' + this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //二级图标中的leaf节点图标 + } + + /** 数据加载参数**/ + this.url = this.options.url || OPTIONS.url || ""; //请求地址 + this.async = (typeof (this.options.async) === "boolean") ? this.options.async : (typeof (OPTIONS.async) === "boolean") ? OPTIONS.async : true; //异步同步加载,默认异步加载 + this.headers = this.options.headers || OPTIONS.headers || {}; //ajax header属性 + this.method = this.options.method || OPTIONS.method || "post"; //请求类型 + this.dataType = this.options.dataType || OPTIONS.dataType || "json"; //参数类型 + this.contentType = this.options.contentType || OPTIONS.contentType || "application/x-www-form-urlencoded"; //发送信息至服务器时内容编码类型 + this.defaultRequest = $.extend(this.defaultRequest, this.options.defaultRequest || OPTIONS.defaultRequest) || this.defaultRequest; //默认请求参数 + this.filterRequest = this.options.filterRequest || OPTIONS.filterRequest || []; //过滤请求参数 + this.request = this.options.request || OPTIONS.request || {}; //用户自定义请求参数 + this.response = $.extend(this.response, this.options.response || OPTIONS.response) || this.response; //返回json格式 + this.data = this.options.data || OPTIONS.data || null; //初始化指定该参数,则不会访问异步接口 + this.dataFormat = this.options.dataFormat || OPTIONS.dataFormat || "levelRelationship"; //用于用户配置的data数据格式,list:列表, levelRelationship:层级关系,默认 + this.dataStyle = this.options.dataStyle || OPTIONS.dataStyle || "defaultStyle"; //用于用户配置layui通用的json数据风格,layuiStyle:layui风格,defaultStyle:默认风格 + this.errDataShow = this.options.errDataShow || OPTIONS.errDataShow || false; //是否在递归数据出现错误后,显示错误信息,默认false + this.withCredentials = this.options.withCredentials || OPTIONS.withCredentials || false; //是否允许跨域请求,默认false + this.success = this.options.success || OPTIONS.success || function(data, obj){}; //树加载完毕后执行解析树之前的回调 + this.done = this.options.done || OPTIONS.done || function(data, obj){}; //树加载完毕后的回调 + this.formatter = $.extend(this.formatter, this.options.formatter || OPTIONS.formatter) || this.formatter; //数据过滤 + this.error = this.options.error || OPTIONS.error || function(XMLHttpRequest, textStatus, errorThrown){}; // 异步加载异常回调 + this.complete = this.options.complete || OPTIONS.complete || function(XMLHttpRequest, textStatus){}; // 异步加载完成回调 + + /** 复选框参数**/ + this.checkbar = this.options.checkbar || OPTIONS.checkbar || false; //是否开启复选框模式 + this.checkbarLoad = this.options.checkbarLoad || OPTIONS.checkbarLoad || "node"; //复选框作用范围,node:所有节点, leaf:最后一级;默认所有节点 + this.checkbarType = this.options.checkbarType || OPTIONS.checkbarType || "all"; //复选框选中形式 all:子集选中父级也选中, no-all:子集选中父级半选中,子集全选父级选中,p-casc:父级选中子集全选,子集无法改变父级选中状态, self:没有任何级联关系,only:只能选中一个复选框。 默认all + this.checkbarData = this.options.checkbarData || OPTIONS.checkbarData || "choose"; //复选框记录数据类型形式, change表示记录变更数据,choose表示记录选中数据,all记录全部数据,halfChoose记录选中和半选中的数据,默认choose + this.checkbarFun = $.extend(this.checkbarFun, this.options.checkbarFun || OPTIONS.checkbarFun) || this.checkbarFun; //checkbar事件加载 + + /** 菜单栏参数**/ + this.menubar = this.options.menubar || OPTIONS.menubar || false; //是否打开菜单栏 + this.menubarTips = $.extend(this.menubarTips, this.options.menubarTips || OPTIONS.menubarTips) || this.menubarTips; //菜单栏吸附, toolbar:依附在工具栏,group:依附在按钮组,freedom,自由 + this.menubarFun = $.extend(this.menubarFun, this.options.menubarFun || OPTIONS.menubarFun) || this.menubarFun; //menubar事件加载 + + /** 工具栏参数**/ + this.toolbar = this.options.toolbar || OPTIONS.toolbar || false; //是否开启可编辑模式 + this.toolbarWay = this.options.toolbarWay || OPTIONS.toolbarWay || "contextmenu"; //工具栏显示方式,contextmenu:右键,follow:跟随节点,fixed:固定在节点右侧 + this.toolbarStyle = $.extend(this.toolbarStyle, this.options.toolbarStyle || OPTIONS.toolbarStyle) || this.toolbarStyle; //toolbar的自定义风格,标题,弹框大小 + this.toolbarLoad = this.options.toolbarLoad || OPTIONS.toolbarLoad || "node"; //toolbar作用范围:node:所有节点,noleaf:非最后一级节点,leaf:最后一级 + this.toolbarShow = this.options.toolbarShow || OPTIONS.toolbarShow || ["add","edit","delete"]; //toolbar三个按钮自定义加载 + this.toolbarBtn = this.options.toolbarBtn || OPTIONS.toolbarBtn || null; //toolbar增删改中内容的自定义加载 + this.toolbarExt = this.options.toolbarExt || OPTIONS.toolbarExt || []; //toolbar按钮扩展 + this.toolbarFun = $.extend(this.toolbarFun, this.options.toolbarFun || OPTIONS.toolbarFun) || this.toolbarFun; //toolbar事件加载 + + /** iframe模式参数**/ + this.useIframe = this.options.useIframe || OPTIONS.useIframe || false; //是否加载iframe 默认false, + this.iframeElem = this.options.iframeElem || OPTIONS.iframeElem || ""; //iframe的ID + this.iframeUrl = this.options.iframeUrl || OPTIONS.iframeUrl || ""; //树关联的iframe地址 + this.iframeLoad = this.options.iframeLoad || OPTIONS.iframeLoad || "leaf"; //点击哪一层加载frame: node:所有节点, leaf:默认,最后一级 + this.iframeDefaultRequest = $.extend(this.iframeDefaultRequest, this.options.iframeDefaultRequest || OPTIONS.iframeDefaultRequest) || this.iframeDefaultRequest; //iframe的默认传递参数 + this.iframeRequest = $.extend(this.iframeRequest, this.options.iframeRequest) || $.extend(this.iframeRequest, OPTIONS.iframeRequest) || this.iframeRequest; //iframe的自定义参数 + this.iframeFun = $.extend(this.iframeFun, this.options.iframeFun) || $.extend(this.iframeFun, OPTIONS.iframeFun) || this.iframeFun; //iframe事件加载 + + /** 下拉树模式参数**/ + this.select = this.options.select || false; + if(this.select) { + // 重置下拉树 + this.selectSetting(); + } + + /** 调用确认最终主题方法*/ + this.ensureTheme(); + }; + + // 设置基本参数值 + DTree.prototype.reloadSetting = function(options) { + this.options = $.extend(this.options, options) || this.options; + + /** 绑定元素参数**/ + this.elem = this.options.elem || this.elem; //树绑定的元素ID:#elem + if(typeof this.options.obj === 'undefined'){ + if(this.elem) { + if($(this.elem).length > 0) { + this.obj = $(this.elem); + } + } + } else { + this.obj = this.options.obj || this.obj; //树绑定的jquery元素,用于当元素是延迟加载出来的话,可以用这个找到 + this.elem = "#" + this.obj[0].id; + } + + /** 基本参数**/ + this.scroll = this.options.scroll || this.scroll; //树的上级div容器,让树可以显示滚动条的div容器 + this.accordion = (typeof (this.options.accordion) === "boolean") ? this.options.accordion : this.accordion; //开启手风琴加载 + if(this.accordion) { + this.initLevel = 1; //默认展开节点 1节 + } else { + this.initLevel = this.options.initLevel || this.initLevel; //默认展开节点 2节 + } + this.type = this.options.type || this.type; //树的加载方式 all,全量树, load,增量树,默认load + this.cache = (typeof (this.options.cache) === "boolean") ? this.options.cache : this.cache; //开启数据缓存 + this.record = (typeof (this.options.record) === "boolean") ? this.options.record : this.record; //开启数据记录模式 + this.load = (typeof (this.options.load) === "boolean") ? this.options.load : this.load; //开启加载动画 + this.none = this.options.none || this.none; //初始节点加载无数据时显示文字 + this.tempHeight = this.options.height || this.height; //临时转换高度变量 + if(this.tempHeight) { //设置高度 + if(/^full-\d+$/.test(this.tempHeight)) { + this.fullHeightGap = this.tempHeight.split('-')[1]; + this.height = $WIN.height() - this.fullHeightGap; + } else { + this.fullHeightGap = this.tempHeight; + this.height = this.tempHeight; + } + } + this.width = this.options.width || this.width; //宽度 + this.obj.css("width", this.width); + + /** 样式相关参数**/ + this.line = (typeof (this.options.line) === "boolean") ? this.options.line : this.line; //开启树线,默认不开启 + this.iconfont = this.options.iconfont || this.iconfont; //默认图标字体 dtreefont + this.iconfontStyle = this.options.iconfontStyle || this.iconfontStyle; //用于自定义树的每个关键部位使用的图标 + this.nodeIconArray = $.extend(nodeIconArray, this.options.nodeIconArray) || this.nodeIconArray; //用户自定义非叶子节点图标集合,node + this.leafIconArray = $.extend(leafIconArray, this.options.leafIconArray) || this.leafIconArray; //用户自定义叶子节点图标集合,leaf + this.skin = this.options.skin || this.skin; //自定义样式 + if(this.skin == "layui"){ //layui主题 + this.line = (typeof (this.options.line) === "boolean") ? this.options.line : true; //开启树线,默认开启 + this.ficon = this.options.ficon || this.ficon; //一级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示一级图标。默认'7' + this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "1") : this.ficon[0]; //一级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'1' + this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1]; //一级图标中的leaf节点图标 + this.icon = this.options.icon || this.icon; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示二级图标。默认'-1' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "-1") : this.icon[0]; //二级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'-1' + this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //二级图标中的leaf节点图标 + } else if(this.skin == "laySimple"){ //laySimple主题 + this.line = (typeof (this.options.line) === "boolean") ? this.options.line : false; //开启树线,默认不开启 + this.ficon = this.options.ficon || this.ficon; //一级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示一级图标。默认'-1' + this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "2") : this.ficon[0]; //一级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'2' + this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1];//一级图标中的leaf节点图标 + this.icon = this.options.icon || this.icon; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示二级图标。默认'-1' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "-1") : this.icon[0]; //二级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'-1' + this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //二级图标中的leaf节点图标 + } else { // 默认主题 或者自定义主题 + this.line = (typeof (this.options.line) === "boolean") ? this.options.line : false; //开启树线,默认不开启 + this.ficon = this.options.ficon || this.ficon; //一级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示一级图标。默认'8' + this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "1") : this.ficon[0]; //一级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'1' + this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1]; // 一级图标中的leaf节点图标 + this.icon = this.options.icon || this.icon; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示二级图标。默认'5' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "0") : this.icon[0]; //二级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'0' + this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //二级图标中的leaf节点图标 + } + + /** 数据加载参数**/ + this.url = this.options.url || this.url; //请求地址 + this.async = (typeof (this.options.async) === "boolean") ? this.options.async : this.async; //异步同步加载,默认异步加载 + this.headers = this.options.headers || this.headers; //ajax header属性 + this.method = this.options.method || this.method; //请求类型 + this.dataType = this.options.dataType || this.dataType; //参数类型 + this.contentType = this.options.contentType || this.contentType; //发送信息至服务器时内容编码类型 + this.defaultRequest = $.extend(this.defaultRequest, this.options.defaultRequest) || this.defaultRequest; //默认请求参数 + this.filterRequest = this.options.filterRequest || this.filterRequest; //过滤请求参数 + this.request = this.options.request || this.request; //用户自定义请求参数 + this.response = $.extend(this.response, this.options.response) || this.response; //返回json格式 + this.data = this.options.data || this.data; //初始化指定该参数,则不会访问异步接口 + this.dataFormat = this.options.dataFormat || this.dataFormat; //用于用户配置的data数据格式,list:列表, levelRelationship:层级关系,默认 + this.dataStyle = this.options.dataStyle || this.dataStyle; //用于用户配置layui通用的json数据风格,layuiStyle:layui风格,defaultStyle:默认风格 + this.errDataShow = (typeof (this.options.errDataShow) === "boolean") ? this.options.errDataShow : this.errDataShow; //是否在使用list模式递归数据出现错误时,显示错误信息 + this.withCredentials = (typeof (this.options.withCredentials) === "boolean") ? this.options.withCredentials : this.withCredentials; //是否允许跨域请求 + this.success = this.options.success || this.success; //树加载完毕后执行解析树之前的回调 + this.done = this.options.done || this.done; //树加载完毕后的回调 + this.formatter = $.extend(this.formatter, this.options.formatter)|| this.formatter; //数据过滤 + this.error = this.options.error || this.error; //异步加载异常回调 + this.complete = this.options.complete || this.complete; //异步加载完成回调 + + /** 复选框参数**/ + this.checkbar = this.options.checkbar || this.checkbar; //是否开启复选框模式 + this.checkbarLoad = this.options.checkbarLoad || this.checkbarLoad; //复选框作用范围,node:所有节点, leaf:最后一级;默认所有节点 + this.checkbarType = this.options.checkbarType || this.checkbarType; //复选框选中形式 all:子集选中父级也选中, no-all:子集选中父级半选中,子集全选父级选中,p-casc:父级选中子集全选,子集无法改变父级选中状态, self:没有任何级联关系,only:只能选中一个复选框。 默认all + this.checkbarData = this.options.checkbarData || this.checkbarData; //复选框记录数据类型形式, change表示记录变更数据,choose表示记录选中数据,all记录全部数据,halfChoose记录选中和半选中的数据,默认choose + this.checkbarFun = $.extend(this.checkbarFun, this.options.checkbarFun)|| this.checkbarFun; //checkbar事件加载 + + /** 菜单栏参数**/ + this.menubar = this.options.menubar || this.menubar; //是否打开菜单栏 + this.menubarTips = $.extend(this.menubarTips, this.options.menubarTips) || this.menubarTips; //菜单栏吸附, toolbar:依附在工具栏,group:依附在按钮组,freedom,自由 + this.menubarFun = $.extend(this.menubarFun, this.options.menubarFun) || this.menubarFun; //menubar事件加载 + + /** 工具栏参数**/ + this.toolbar = this.options.toolbar || this.toolbar; //是否开启工具栏 + this.toolbarWay = this.options.toolbarWay || this.toolbarWay; //工具栏显示方式,contextmenu:右键,follow:跟随节点,fixed:固定在节点右侧 + this.toolbarStyle = $.extend(this.toolbarStyle, this.options.toolbarStyle) || this.toolbarStyle; //toolbar的自定义风格,标题,弹框大小 + this.toolbarLoad = this.options.toolbarLoad || this.toolbarLoad; //toolbar作用范围:node:所有节点,noleaf:非最后一级节点,leaf:最后一级 + this.toolbarShow = this.options.toolbarShow || this.toolbarShow; //toolbar三个按钮 + this.toolbarBtn = this.options.toolbarBtn || this.toolbarBtn; //toolbar增删改中内容的自定义加载 + this.toolbarExt = this.options.toolbarExt || this.toolbarExt; //toolbar按钮扩展 + this.toolbarFun = $.extend(this.toolbarFun, this.options.toolbarFun) || this.toolbarFun; //toolbar事件加载 + + /** iframe模式参数**/ + this.useIframe = this.options.useIframe || this.useIframe;//是否加载iframe 默认false + this.iframeElem = this.options.iframeElem || this.iframeElem; //iframe的ID + this.iframeUrl = this.options.iframeUrl || this.iframeUrl; //树关联的iframe地址 + this.iframeLoad = this.options.iframeLoad || this.iframeLoad; //点击哪一层加载frame: node:所有节点, leaf:默认,最后一级 + this.iframeDefaultRequest = $.extend(this.iframeDefaultRequest, this.options.iframeDefaultRequest) || this.iframeDefaultRequest; //iframe的默认传递参数 + this.iframeRequest = $.extend(this.iframeRequest, this.options.iframeRequest) || this.iframeRequest; //iframe的自定义参数 + this.iframeFun = $.extend(this.iframeFun, this.options.iframeFun) || this.iframeFun; //iframe事件加载 + + /** 下拉树模式参数**/ + if(this.select) { + // 重置下拉树 + this.reloadSelectSetting(); + } + + /** 调用确认最终主题方法*/ + this.ensureTheme(); + + }; + + // 设置下拉树的基本参数值 + DTree.prototype.selectSetting = function() { + /** select模式参数*/ + this.select = true; //配置成select模式 + + this.selectInitVal = this.obj.attr("data-value") || this.options.selectInitVal || ""; //输入框的值 + this.selectTreeDiv = this.obj[0].id + "_tree_div"; // 上级DIV节点 + this.selectCardDiv = this.obj[0].id + "_select_card_div"; // 上级layui卡片节点 + this.selectDiv = this.obj[0].id + "_select_div"; // 模拟的select节点 + this.selectTipsName = this.obj[0].id + "_select_input"; // select的提示输入框名称 + this.selectTips = this.options.selectTips || "请选择"; // 输入框的提示语 + this.selectInputName = this.options.selectInputName || {nodeId: this.obj[0].id + "_select_nodeId"}; // select表单中的元素 + + // 调取下拉树的特殊处理页面元素标识 + this.renderSelectDom(); + } + + // 重新设置下拉树的基本参数值 + DTree.prototype.reloadSelectSetting = function() { + + this.selectInitVal = this.obj.attr("data-value") || this.options.selectInitVal || this.selectInitVal; //输入框的值 + this.selectTips = this.options.selectTips || this.selectTips; // 输入框的提示语 + this.selectInputName = $.extend(this.selectInputName, this.options.selectInputName) || this.selectInputName; // select表单中的元素 + + // 调取下拉树的特殊处理页面元素标识 + this.reloadSelectDom(); + } + + /******************** 下拉树设置区域 ********************/ + // 渲染下拉树的Dom结构 + DTree.prototype.renderSelectDom = function() { + var _this = this; + var rootId = _this.obj[0].id; + + // 设置自定义表单隐藏域 + var selectInputName = _this.selectInputName; + var selectInput = []; + for(var key in selectInputName) { + selectInput.push(''); + } + + // 设置html + var prevHtml = ['
            ', + '
            ', selectInput.join(""), + '', + '', + '
            '].join(''); + + _this.obj.before(prevHtml); + + _this.obj.wrap('
            ').wrap('
            ').wrap('
            '); + + } + + // 重新渲染下拉树的Dom结构 + DTree.prototype.reloadSelectDom = function() { + var _this = this; + var rootId = _this.obj[0].id; + + // 设置自定义表单隐藏域 + var selectInputName = _this.selectInputName; + var selectInput = []; + for(var key in selectInputName) { + selectInput.push(''); + } + + $("div[dtree-id='"+rootId+"'][dtree-select='"+_this.selectDiv+"']").find("div.layui-select-title").html(""); + + // 设置html + var prevHtml = [selectInput.join(""), + '', + ''].join(''); + + $("div[dtree-id='"+rootId+"'][dtree-select='"+_this.selectDiv+"']").find("div.layui-select-title").html(prevHtml); + + } + + // 设置输入框的值 + DTree.prototype.selectVal = function(param) { + var _this = this; + var rootId = _this.obj[0].id; + var selectInputName = _this.selectInputName; + var selectTipsNameValue = ""; + var selectValues = {}; + + // 如果开启了复选框,则此方法用来取值 + if(_this.checkbar) { + $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "']").each(function(){ + var name = $(this).attr("name"); + var val = $(this).val(); + selectValues[name] = val; + }); + } else { + if(typeof param === 'undefined') { // 不传,则为当前树中记录的ID + param = _this.getNowParam(); + } + if(typeof param === 'string') { // 传递ID,则查询树节点ID对应的值 + param = _this.getParam(param); + } + + selectTipsNameValue = param["context"]; + for(var key in selectInputName) { + selectValues[selectInputName[key]] = param[key]; + $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+selectInputName[key]+"']").val(param[key] || ""); + } + + if(param["nodeId"] && !param["context"]) { + selectTipsNameValue = _this.getParam(param["nodeId"]); + } + + // 返显提示输入框值 + $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+_this.selectTipsName+"']").val(selectTipsNameValue || ""); + + } + + + // 返回隐藏域中的值 + return selectValues; + } + + // 设置复选框模式中的下拉树的值 + DTree.prototype.selectCheckboxVal = function() { + var _this = this; + var rootId = _this.obj[0].id; + var selectInputName = _this.selectInputName; + + // 获取全部复选框选中节点 + var param = _this.getCheckbarJsonArrParam(); + + selectTipsNameValue = param["context"]; + var selectValues = {}; + for(var key in selectInputName) { + var value = param[key].join(","); + selectValues[selectInputName[key]] = value; + $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+selectInputName[key]+"']").val(value); + } + + $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+_this.selectTipsName+"']").val(selectTipsNameValue); + + // 返回隐藏域中的值 + return selectValues; + } + + // 重置下拉树的值 + DTree.prototype.selectResetVal = function() { + var _this = this; + var rootId = _this.obj[0].id; + // 表单清空 + $("input[dtree-id='"+rootId+"']").val(""); + // 节点重置 + _this.cancelNavThis(); + if(_this.checkbar) { + // 复选框重置 + _this.cancelCheckedNode(); + } + } + + + /******************** 字体及图标区域 ********************/ + // 确认最终主题 + DTree.prototype.ensureTheme = function(){ + var _this = this; + + // 确认style + this.style.item = DTREE + this.skin + ITEM; + this.style.itemThis = DTREE + this.skin + ITEMTHIS; + this.style.dfont = DTREE + this.skin + DFONT; + this.style.ficon = DTREE + this.skin + FICON; + this.style.icon = DTREE + this.skin + ICON; + this.style.cbox = DTREE + this.skin + CBOX; + this.style.chs = DTREE + this.skin + CHS; + + // 确认usefontStyle + var iconfont = this.iconfont; + var iconfonts = []; + if(typeof iconfont === 'string') { + iconfonts.push(iconfont); + } else { + iconfonts = iconfont; + } + + var iconfontStyle = this.iconfontStyle; + var iconfontStyles = []; + if(iconfontStyle.length == undefined) { + iconfontStyles.push(iconfontStyle); + } else { + iconfontStyles = iconfontStyle; + } + + for(var i=0; i 0) { + $lis.each(function(){ + _this.showLineLi($(this)); + }); + } else { + _this.obj.find("li[data-id]").each(function(){ + _this.showLineLi($(this)); + }); + } + } + } + + // 真正显示树线的方法 + DTree.prototype.showLineLi = function($li){ + var _this = this; + var $div = $li.children("div"), + $nextLi = $li.next("li"), + $ul = $li.parent("ul"); + if($ul[0].id == _this.obj[0].id) { + // 根节点下的节点 + $li.removeClass(LI_NAV_LINE); + $li.removeClass(LI_NAV_LAST_LINE); + $li.addClass(LI_NAV_FIRST_LINE); + } else { + // 非根节点下的节点 + var $pnextLi = $ul.parent("li").next("li"); + if($pnextLi.length == 0) { + if($nextLi.length == 0){ + $li.removeClass(LI_NAV_LINE); + $li.removeClass(LI_NAV_FIRST_LINE); + $li.addClass(LI_NAV_LAST_LINE); + } else { + $li.removeClass(LI_NAV_FIRST_LINE); + $li.removeClass(LI_NAV_LAST_LINE); + $li.addClass(LI_NAV_LINE); + } + }else { + var $pnextdiv = $pnextLi.children("div"); + if($nextLi.length == 0 && $div.children("cite").attr("data-leaf") == "leaf" && $pnextdiv.children("cite").attr("data-leaf") == "leaf") { + $li.removeClass(LI_NAV_FIRST_LINE); + $li.removeClass(LI_NAV_LINE); + $li.addClass(LI_NAV_LAST_LINE); + } else { + $li.removeClass(LI_NAV_FIRST_LINE); + $li.removeClass(LI_NAV_LAST_LINE); + $li.addClass(LI_NAV_LINE); + } + } + } + } + + /******************** 初始化数据区域 ********************/ + // 设置高度 + DTree.prototype.autoHeight = function(){ + var _this = this; + var height = _this.height; + if(height != "") { + if(_this.elem == _this.scroll){ + _this.obj.parent().css("height", height + "px"); + } else { + var $toolbarDiv = _this.obj.closest(_this.scroll); + $toolbarDiv.css("height", height + "px"); + } + } + }; + + // 重载树 + DTree.prototype.reload = function(options){ + var _this = this; + _this.reloadSetting(options); + _this.init(); + }; + + // 初始化树 + DTree.prototype.init = function(){ + var _this = this; + if (typeof _this !== "object") { + //_this.obj.html(_this.getNoneDom().errText("树组件未成功加载,请检查配置")); + layer.msg("树组件未成功加载,请检查配置", {icon:5}); + return ; + } + + // 设置组件高度 + _this.autoHeight(); + + if(_this.data) { + if(typeof _this.data.length === 'undefined'){ + //_this.obj.html(_this.getNoneDom().errText("数据解析异常,data数据格式不正确")); + layer.msg("数据解析异常,data数据格式不正确", {icon:5}); + return ; + } + + if(_this.data.length == 0) { + _this.obj.html(_this.getNoneDom().text()); + return ; + } + + //先将ul中的元素清空 + _this.obj.html(""); + + setTimeout(function () { + // 加载完毕后执行树解析前的回调 + _this.success(_this.data, _this.obj); + + // 第一次解析树 + if (_this.dataFormat == 'list'){ + //1.识别根节点ul中的data-id标签,判断顶级父节点 + var pid = _this.obj.attr("data-id"); + //2.构建一个存放节点的树组 + var rootListData = _this.queryListTreeByPid(pid, _this.data); + _this.loadListTree(rootListData, _this.data, 1); + } else { + _this.loadTree(_this.data, 1); + } + + // 显示树线 + _this.showLine(); + + // 这种情况下需要一开始就将toolbar显示在页面上 + if(_this.toolbar && _this.toolbarWay != 'contextmenu') { + _this.setToolbarDom().setToolbarPlace(_this.toolbarMenu); + } + + // 判断是否存在错误数据,并是否打印错误数据 + _this.msgErrData(); + + // 设置复选框的初始值 + if(_this.select){ + _this.selectVal(_this.selectInitVal); + } + + // 保存树副本 + _this.bak = _this.obj.html(); + + // 加载完毕后的回调 + _this.done(_this.data, _this.obj); + }, 100); + } else { + if (!_this.url) { + //_this.obj.html(_this.getNoneDom().errText("数据请求异常,url参数未指定")); + layer.msg("数据请求异常,url参数未指定", {icon:5}); + return ; + } + + //先将ul中的元素清空 + _this.obj.html(""); + + var index = _this.load ? layer.load(1) : ""; + + AjaxHelper.request({ + async: _this.async, + headers: _this.headers, + type: _this.method, + url: _this.url, + dataType: _this.dataType, + contentType: _this.contentType, + withCredentials: _this.withCredentials, + data: _this.getFilterRequestParam(_this.getRequestParam()), + success: function(result) { + if (typeof result === 'string') { + result = $.parseJSON(result); + } + + // 加载完毕后执行树解析前的回调 + _this.success(result, _this.obj); + + var code = ""; + if (_this.dataStyle == 'layuiStyle'){ + code = result[_this.response.statusName]; + } else { + code = result.status[_this.response.statusName]; + } + + if (code == _this.response.statusCode) { + var d = result[_this.response.rootName]; + + if(typeof d.length === 'undefined'){ + _this.obj.html(_this.getNoneDom().errText("数据解析异常,url回调后的数据格式不正确")); + //layer.msg("数据解析异常,url回调后的数据格式不正确", {icon:5}); + return ; + } + + if(d.length == 0) { + _this.obj.html(_this.getNoneDom().text()); + return ; + } + + // 第一次解析树 + if (_this.dataFormat == 'list'){ + //1.识别根节点ul中的data-id标签,判断顶级父节点 + var pid = _this.obj.attr("data-id"); + //2.构建一个存放节点的树组 + var rootListData = _this.queryListTreeByPid(pid, d); + _this.loadListTree(rootListData, d, 1); + } else { + _this.loadTree(d, 1); + } + + // 显示树线 + _this.showLine(); + + // 这种情况下需要一开始就将toolbar显示在页面上 + if(_this.toolbar && _this.toolbarWay != 'contextmenu') { + _this.setToolbarDom().setToolbarPlace(_this.toolbarMenu); + } + + // 判断是否存在错误数据,并是否打印错误数据 + _this.msgErrData(); + + // 设置复选框的初始值 + if(_this.select){ + _this.selectVal(_this.selectInitVal); + } + + // 保存树副本 + _this.bak = _this.obj.html(); + + // 加载完毕后的回调 + _this.done(result, _this.obj); + } else { + // 如果打印不出任何信息说明是在这里,用了错误的数据格式, 或返回码不正确 + if (_this.dataStyle == 'layuiStyle'){ + _this.obj.html(_this.getNoneDom().errText(result[_this.response.message])); + _this.error(null, code, result[_this.response.message]); + //layer.msg(result[_this.response.message], {icon:2}); + } else { + _this.obj.html(_this.getNoneDom().errText(result.status[_this.response.message])); + _this.error(null, code, result.status[_this.response.message]); + //layer.msg(result.status[_this.response.message], {icon:2}); + } + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown){// 异步加载异常回调 + _this.obj.html(_this.getNoneDom().errText(textStatus + ": " + errorThrown)); + _this.error(XMLHttpRequest, textStatus, errorThrown); + }, + complete: function(XMLHttpRequest, textStatus){// 异步加载完成回调 + if(_this.load){layer.close(index);} + _this.complete(XMLHttpRequest, textStatus); + } + }); + } + }; + + // 加载子节点 + DTree.prototype.getChild = function($div, data) { + var _this = this, $ul = $div.next("ul"); + + _this.setNodeParam($div); + + if(typeof data !== 'undefined') { + if(typeof data.length === 'undefined'){ + //_this.obj.html(_this.getNoneDom().errText("数据解析异常,data数据格式不正确")); + layer.msg("数据解析异常,data数据格式不正确", {icon:5}); + return ; + } + + //先将ul中的元素清空 + $ul.html(""); + + // 解析树 + if (_this.dataFormat == 'list'){ + var pid = _this.node.nodeId; + var level = parseInt(_this.node.level)+1; + + var listData = _this.queryListTreeByPid(pid, data); + _this.loadListTree(listData, _this.data, level); + } else { + _this.loadTree(data, level); + } + + // 显示树线 + _this.showLine(); + + // 这种情况下需要一开始就将toolbar显示在页面上 + if(_this.toolbar && _this.toolbarWay != 'contextmenu') { + _this.setToolbarDom().setToolbarPlace(_this.toolbarMenu); + } + + // 判断是否存在错误数据,并是否打印错误数据 + _this.msgErrData(); + + // 保存树副本 + _this.bak = _this.obj.html(); + + } else { + if (!_this.url) { + //_this.obj.html(_this.getNoneDom().errText("数据请求异常,url参数未指定")); + layer.msg("数据请求异常,url参数未指定", {icon:5}); + return ; + } + + $ul.html(""); + var index = _this.load ? layer.load(1) : ""; + AjaxHelper.request({ + async: _this.async, + headers: _this.headers, + type: _this.method, + url: _this.url, + dataType: _this.dataType, + withCredentials: _this.withCredentials, + data: _this.getFilterRequestParam(_this.getRequestParam()), + success: function(result) { + if (typeof result === 'string') { + result = $.parseJSON(result); + } + var code = ""; + if (_this.dataStyle == 'layuiStyle'){ + code = result[_this.response.statusName]; + } else { + code = result.status[_this.response.statusName]; + } + + if (code == _this.response.statusCode) { + // 解析树 + var pid = _this.node.nodeId; + var level = parseInt(_this.node.level)+1; + if (_this.dataFormat == 'list'){ + var pListData = _this.queryListTreeByPid(pid, result[_this.response.rootName]); + _this.loadListTree(pListData, result[_this.response.rootName], level, $ul); + } else { + _this.loadTree(result[_this.response.rootName], level, $ul); + } + + // 显示树线 + _this.showLine(); + + // 这种情况下需要一开始就将toolbar显示在页面上 + if(_this.toolbar && _this.toolbarWay != 'contextmenu') { + _this.setToolbarDom().setToolbarPlace(_this.toolbarMenu); + } + + // 判断是否存在错误数据,并是否打印错误数据 + _this.msgErrData(); + + $ul.addClass(NAV_SHOW); + + // 保存树副本 + _this.bak = _this.obj.html(); + } else { + if (_this.dataStyle == 'layuiStyle'){ + _this.obj.html(_this.getNoneDom().errText(result[_this.response.message])); + _this.error(null, code, result[_this.response.message]); + //layer.msg(result[_this.response.message], {icon:2}); + } else { + _this.obj.html(_this.getNoneDom().errText(result.status[_this.response.message])); + _this.error(null, code, result.status[_this.response.message]); + //layer.msg(result.status[_this.response.message], {icon:2}); + } + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown){// 异步加载异常回调 + _this.obj.html(_this.getNoneDom().errText(textStatus + ": " + errorThrown)); + _this.error(XMLHttpRequest, textStatus, errorThrown); + }, + complete: function(XMLHttpRequest, textStatus){// 异步加载完成回调 + if(_this.load){layer.close(index);} + _this.complete(XMLHttpRequest, textStatus); + } + }); + } + }; + + // 初始化树或者拼接树 + DTree.prototype.loadListTree = function(pListData, listData, level, $ul){ + var _this = this; + $ul = $ul || _this.getNodeDom().nowOrRootUl(); //当前选中的节点或根节点 + if (pListData.length > 0){ + for (var i = 0; i < pListData.length; i++) { + // 1.获取已知节点的全部数据 + var data = pListData[i]; + if(typeof data !== "object") continue; + var parseData = _this.parseData(data); + var childListData = _this.queryListTreeByPid(parseData.treeId(), listData); // 根据已知数据的id判断该条数据是否还有子数据 + + // 3. 页面元素加载数据 + $ul.append(_this.getLiItemDom(parseData.treeId(), parseData.parentId(), parseData.title(), parseData.fmtTitle(), parseData.last(childListData.length), parseData.ficonClass(), parseData.iconClass(), parseData.checkArr(), level, parseData.spread(level), parseData.disabled(), parseData.hide(), parseData.basicData(), parseData.recordData(), ($ul.hasClass(UL_ROOT) ? "root" : "item"))); + // 4.有子数据的元素加载子节点 + if(childListData.length > 0){ + var cLevel = parseInt(level)+1; + _this.loadListTree(childListData, listData, cLevel, _this.obj.find("ul[data-id='"+parseData.treeId()+"']")); + } + } + } + }; + + // 根据父ID查找list数据中匹配的元素 + DTree.prototype.queryListTreeByPid = function(pid, listData){ + var _this = this; + var rootListData = []; + if (listData) { + for (var i = 0; i < listData.length; i++) { + var data = listData[i]; + if(typeof data !== "object") continue; + if(pid == "null" || pid == null){ + if(data[_this.response.parentId] == null) { rootListData.push(data); } + } else { + if (data[_this.response.parentId] == pid){ + if (data[_this.response.treeId] == pid){ + _this.errData.push(data); + } else { + rootListData.push(data); + } + } + } + } + } + return rootListData; + }; + + // 初始化树或者拼接树 + DTree.prototype.loadTree = function(root, level, $ul){ + var _this = this; + if (root) { + $ul = $ul || _this.getNodeDom().nowOrRootUl(); //当前选中的节点或根节点 + for (var i = 0; i < root.length; i++) { // 遍历跟节点或追加的跟节点 + var data = root[i]; + if(typeof data !== "object") continue; + if(data[_this.response.treeId] == data[_this.response.parentId]) { _this.errData.push(data); } + var parseData = _this.parseData(data); + var children = parseData.children(); + $ul.append(_this.getLiItemDom(parseData.treeId(), parseData.parentId(), parseData.title(), parseData.fmtTitle(), parseData.last(children.length), parseData.ficonClass(), parseData.iconClass(), parseData.checkArr(), level, parseData.spread(level), parseData.disabled(), parseData.hide(), parseData.basicData(), parseData.recordData(), ($ul.hasClass(UL_ROOT) ? "root" : "item"))); + if (children.length != 0) { + var cLevel = parseInt(level)+1; + _this.loadTree(children, cLevel, _this.obj.find("ul[data-id='"+parseData.treeId()+"']")); + } + } + } + }; + + // 判断在数据加载时是否存在错误数据,并是否打印错误数据 + DTree.prototype.msgErrData = function() { + var _this = this; + if(_this.errData.length > 0 && _this.errDataShow) { + var title = ""; + for(var i=0; i<_this.errData.length; i++) { + var edata = _this.errData[i]; + title += "数据:【"+edata[_this.response.title]+"】中节点id和上级id值一致! \n"; + } + layer.msg(title, {icon:2,time:5000}); + } + // 显示之后,将错误数据制空 + _this.errData = []; + }; + + // 解析data数据 + DTree.prototype.parseData = function(data) { + var _this = this; + + return { + treeId: function(){ + return data[_this.response.treeId]; + }, + parentId: function(){ + return data[_this.response.parentId]; + }, + fmtTitle: function(){ + if(typeof _this.formatter.title === 'function'){ + var ftitle = _this.formatter.title(data); + var tt = data[_this.response.title]; + tt = (ftitle == "" || ftitle == undefined || ftitle == null) ? tt : ftitle; + return tt || ""; + } + return data[_this.response.title]; + }, + title: function(){ + return data[_this.response.title]; + }, + level: function(){ + return data[_this.response.level] || ""; + }, + ficonClass: function(){ + return data[_this.response.ficonClass] || ""; + }, + iconClass: function(){ + return data[_this.response.iconClass] || ""; + }, + last: function(len){ + return ((len == 0) ? + ((typeof (data[_this.response.last]) === "boolean") ? data[_this.response.last] : true) : + ((typeof (data[_this.response.last]) === "boolean") ? data[_this.response.last] : false)); + }, + spread: function(level){ + return ((level < _this.initLevel) ? + ((typeof (data[_this.response.spread]) === "boolean") ? data[_this.response.spread] : true) : + ((typeof (data[_this.response.spread]) === "boolean") ? data[_this.response.spread] : false)); + }, + disabled: function(){ + return (typeof (data[_this.response.disabled]) === "boolean") ? data[_this.response.disabled] : false; + }, + hide: function(){ + return (typeof (data[_this.response.hide]) === "boolean") ? data[_this.response.hide] : false; + }, + checkArr: function(){ + var checkArr = []; + var checkArrData = data[_this.response.checkArr]; + if(typeof checkArrData === 'string'){ + if(checkArrData.indexOf("{") > -1 && checkArrData.indexOf("}") > -1){ + checkArrData = JSON.parse(checkArrData); + } else { + checkArrData = {"type":"0","checked":checkArrData}; + } + } + if(typeof checkArrData === 'object'){ + if(typeof checkArrData.length === 'undefined'){ + checkArr.push(checkArrData); + } else { + checkArr = checkArrData; + } + } + + if(checkArr.length > 0 && checkArr.length > _this.checkArrLen){ + _this.checkArrLen = checkArr.length; // 获取复选框个数 + } + return checkArr; + + }, + children: function(){ + return data[_this.response.childName] || []; + }, + basicData: function(){ + return event.escape(JSON.stringify(data[_this.response.basicData])) || JSON.stringify({}); + }, + recordData: function(){ + var recordData = _this.record ? event.cloneObj(data, [_this.response.treeId, + _this.response.parentId, + _this.response.title, + _this.response.iconClass, + _this.response.childName, + _this.response.last, + _this.response.spread, + _this.response.disabled, + _this.response.hide, + _this.response.checkArr, + _this.response.checked, + _this.response.type, + _this.response.basicData]) : {}; + + return event.escape(JSON.stringify(recordData)); + }, + data: function(){ + return data; + } + } + + }; + + //当无节点数据时显示dom + DTree.prototype.getNoneDom = function(){ + var _this = this, + rootId = _this.obj[0].id, + noneTitle = _this.none; + + return { + text: function(){ + return "
            "+noneTitle+"
            "; + }, + errText: function(errInfo){ + return "
            "+errInfo+"
            "; + } + } + }; + + //新增节点的dom值 + DTree.prototype.getDom = function(treeId, parentId, title, fmtTitle, last, ficonClass, iconClass, checkArr, level, spread, disabled, hide) { + var _this = this, + rootId = _this.obj[0].id, + toolbar = _this.toolbar, + checkbar = _this.checkbar; + + return { + fnode: function() { // + - 图标 + // 获取图标的变量 + var fnodeIcon = _this.fnodeIcon, + fleafIcon = _this.fleafIcon; + + var fleafIconLeaf = _this.usefontStyle.fnode.leaf, + fnodeIconOpen = _this.usefontStyle.fnode.node.open, + fnodeIconClose = _this.usefontStyle.fnode.node.close; + + if(ficonClass){ + var iconfont = _this.iconfont; + if(typeof iconfont === 'string') { + fleafIconLeaf = iconfont + " " + ficonClass; + fnodeIconOpen = iconfont + " " + ficonClass; + fnodeIconClose = iconfont + " " + ficonClass; + } else { + fleafIconLeaf = iconfont[0] + " " + ficonClass; + fnodeIconOpen = iconfont[0] + " " + ficonClass; + fnodeIconClose = iconfont[0] + " " + ficonClass; + } + } + + if(fnodeIcon != "-1" && fleafIcon != "-1"){ // 都加载 + return last ? "" : + (spread ? "" : ""); + } + + if(fnodeIcon != "-1" && fleafIcon == "-1"){ // 加载node 隐藏leaf + return last ? "" : + (spread ? "" : ""); + } + + if(fnodeIcon == "-1" && fleafIcon != "-1"){ // 隐藏node 加载leaf + return last ? "" : + (spread ? "" : ""); + } + + if(fnodeIcon == "-1" && fleafIcon == "-1"){ // 都隐藏 + return last ? "" : + (spread ? "" : ""); + } + }, + node: function() { // 二级图标样式 + // 获取图标的变量 + var nodeIcon = _this.nodeIcon, + leafIcon = _this.leafIcon; + + var sleafIconLeaf = _this.usefontStyle.snode.leaf, + snodeIconOpen = _this.usefontStyle.snode.node.open, + snodeIconClose = _this.usefontStyle.snode.node.close; + if(iconClass){ + var iconfont = _this.iconfont; + if(typeof iconfont === 'string') { + sleafIconLeaf = iconfont + " " + iconClass; + snodeIconOpen = iconfont + " " + iconClass; + snodeIconClose = iconfont + " " + iconClass; + } else { + sleafIconLeaf = iconfont[0] + " " + iconClass; + snodeIconOpen = iconfont[0] + " " + iconClass; + snodeIconClose = iconfont[0] + " " + iconClass; + } + } + + if(nodeIcon != "-1" && leafIcon != "-1"){ // 都加载 + return last ? "" : + (spread ? "" : ""); + } + + if(nodeIcon != "-1" && leafIcon == "-1"){ // 加载node 隐藏leaf + return last ? "" : + (spread ? "" : ""); + } + + if(nodeIcon == "-1" && leafIcon != "-1"){ // 隐藏node 加载leaf + return last ? "" : + (spread ? "" : ""); + } + + if(nodeIcon == "-1" && leafIcon == "-1"){ // 都隐藏 + return last ? "" : + (spread ? "" : ""); + } + }, + checkbox: function() { // 复选框 + var flag = false; + if(_this.checkbarLoad == "node"){if (checkbar) {flag = true;}} else {if (last) {if (checkbar) {flag = true;}}} + + if(flag){ + var result = "
            "; + if(checkArr && checkArr.length > 0){ + + for (var i = 0; i < checkArr.length; i++) { + var checkData = checkArr[i]; + var checked = checkData.checked; + var CHOOSE_CLASS = _this.usefontStyle.checkbox.out; + if (checked == "2") { //半选择 + CHOOSE_CLASS = _this.usefontStyle.checkbox.noall + " " + _this.style.chs; + } else if (checked == "1") { //选择 + CHOOSE_CLASS = _this.usefontStyle.checkbox.on + " " + _this.style.chs; + } else { //未选择或者无值 + CHOOSE_CLASS = _this.usefontStyle.checkbox.out; + } + var disClass = ""; + if(disabled){disClass = NAV_DIS;} + result += ""; + } + } + result += "
            "; + return result; + } + + return ""; + }, + text: function() { // 文字显示 + var disClass = ""; + if(disabled){disClass = NAV_DIS;} + return ""+fmtTitle+""; + }, + ul: function() { //子节点ul + return last ? "
              " : + (spread ? "
                " : "
                  "); + } + }; + }; + + //替换节点的dom值,或指定值 + DTree.prototype.replaceDom = function($div, treeId, last, spread, disabled, hide) { + var _this = this, + rootId = _this.obj[0].id, + toolbar = _this.toolbar, + checkbar = _this.checkbar; + + return { + fnode: function(ficonClass) { // + - 图标 + var fnode = ""; + + // 获取图标的变量 + var fnodeIcon = _this.fnodeIcon, + fleafIcon = _this.fleafIcon; + + var fleafIconLeaf = _this.usefontStyle.fnode.leaf, + fnodeIconOpen = _this.usefontStyle.fnode.node.open, + fnodeIconClose = _this.usefontStyle.fnode.node.close; + + if(ficonClass){ + var iconfont = _this.iconfont; + if(typeof iconfont === 'string') { + fleafIconLeaf = iconfont + " " + ficonClass; + fnodeIconOpen = iconfont + " " + ficonClass; + fnodeIconClose = iconfont + " " + ficonClass; + } else { + fleafIconLeaf = iconfont[0] + " " + ficonClass; + fnodeIconOpen = iconfont[0] + " " + ficonClass; + fnodeIconClose = iconfont[0] + " " + ficonClass; + } + } + + if(fnodeIcon != "-1" && leafIcon != "-1"){ // 都加载 + fnode = last ? "" : + (spread ? "" : ""); + }else if(nodeIcon != "-1" && leafIcon == "-1"){ // 加载node 隐藏leaf + fnode = last ? "" : + (spread ? "" : ""); + }else if(nodeIcon == "-1" && leafIcon != "-1"){ // 隐藏node 加载leaf + fnode = last ? "" : + (spread ? "" : ""); + }else if(nodeIcon == "-1" && leafIcon == "-1"){ // 都隐藏 + fnode = last ? "" : + (spread ? "" : ""); + } + if(fnode != ""){_this.getNodeDom($div).fnode().replaceWith($(fnode));} + }, + node: function(iconClass) { // 二级图标样式 + var snode = ""; + + // 获取图标的变量 + var nodeIcon = _this.nodeIcon, + leafIcon = _this.leafIcon; + + var sleafIconLeaf = _this.usefontStyle.snode.leaf, + snodeIconOpen = _this.usefontStyle.snode.node.open, + snodeIconClose = _this.usefontStyle.snode.node.close; + if(iconClass){ + var iconfont = _this.iconfont; + if(typeof iconfont === 'string') { + sleafIconLeaf = iconfont + " " + iconClass; + snodeIconOpen = iconfont + " " + iconClass; + snodeIconClose = iconfont + " " + iconClass; + } else { + sleafIconLeaf = iconfont[0] + " " + iconClass; + snodeIconOpen = iconfont[0] + " " + iconClass; + snodeIconClose = iconfont[0] + " " + iconClass; + } + } + + if(nodeIcon != "-1" && leafIcon != "-1"){ // 都加载 + snode = last ? "" : + (spread ? "" : ""); + }else if(nodeIcon != "-1" && leafIcon == "-1"){ // 加载node 隐藏leaf + snode = last ? "" : + (spread ? "" : ""); + }else if(nodeIcon == "-1" && leafIcon != "-1"){ // 隐藏node 加载leaf + snode = last ? "" : + (spread ? "" : ""); + }else if(nodeIcon == "-1" && leafIcon == "-1"){ // 都隐藏 + snode = last ? "" : + (spread ? "" : ""); + } + if(snode != ""){_this.getNodeDom($div).snode().replaceWith($(snode));} + }, + checkbox: function(checkArr) { // 复选框 + var flag = false; + if(_this.checkbarLoad == "node"){if (checkbar) {flag = true;}} else {if (last) {if (checkbar) {flag = true;}}} + + if(flag){ + var result = "
                  "; + if(checkArr && checkArr.length > 0){ + + for (var i = 0; i < checkArr.length; i++) { + var checkData = checkArr[i]; + var checked = checkData.checked; + var CHOOSE_CLASS = _this.usefontStyle.checkbox.out; + if (checked == "2") { //半选择 + CHOOSE_CLASS = _this.usefontStyle.checkbox.noall + " " + _this.style.chs; + } else if (checked == "1") { //选择 + CHOOSE_CLASS = _this.usefontStyle.checkbox.on + " " + _this.style.chs; + } else { //未选择或者无值 + CHOOSE_CLASS = _this.usefontStyle.checkbox.out; + } + var disClass = ""; + if(disabled){disClass = NAV_DIS;} + result += ""; + } + } + result += "
                  "; + _this.getNodeDom($div).snode().next("div").replaceWith($(result)); + } + }, + text: function(title) { // 文字显示 + var disClass = ""; + if(disabled){disClass = NAV_DIS;} + var cite = ""+title+"" + _this.getNodeDom($div).cite().replaceWith($(cite)); + }, + ul: function() { //子节点ul + var ul = last ? "
                    " : + (spread ? "
                      " : "
                        "); + _this.getNodeDom($div).nextUl().replaceWith($(ul)); + }, + div: function(){ + $div.attr("data-id", treeId); + }, + basicData: function(basicData){ + basicData = (basicData == "{}") ? "" : basicData; + $div.attr("data-basic", basicData); + }, + recordData: function(recordData){ + recordData = (recordData == "{}") ? "" : recordData; + $div.attr("data-record", recordData); + }, + p_li: function(pId){ + var $li = $div.parent("li"); + $li.attr("data-id", treeId); + if(pId) { + $li.attr("data-pid", pId); + } + return $li; + } + }; + + }; + + // 获取拼接好的li + DTree.prototype.getLiItemDom = function(treeId, parentId, title, fmtTitle, last, ficonClass, iconClass, checkArr, level, spread, disabled, hide, basicData, recordData, flag) { + var _this = this, + rootId = _this.obj[0].id; + + var dom = _this.getDom(treeId, parentId, title, fmtTitle, last, ficonClass, iconClass, checkArr, level, spread, disabled, hide); + basicData = (basicData == "{}") ? "" : basicData; + recordData = (recordData == "{}") ? "" : recordData; + var div = "
                        " + + div , + dom.fnode(), + dom.node(), + dom.checkbox(), + dom.text(), + "
                        ", dom.ul(), ""].join(""); + + return li; + }; + + // 初始化节点,用于数据回显 + DTree.prototype.dataInit = function(chooseId){ + var _this = this; + var $div = _this.obj.find("div[data-id='"+chooseId+"']"); + _this.getNodeDom($div).parentLi().find("."+NAV_THIS).removeClass(NAV_THIS); + _this.getNodeDom($div).parentLi().find("."+_this.style.itemThis).removeClass(_this.style.itemThis); + $div.addClass(NAV_THIS); + $div.addClass(_this.style.itemThis); + _this.setNodeParam($div); + // 将该节点的父节点全部展开 + var $li_parents = $div.parents("."+LI_NAV_ITEM); + $li_parents.children("ul").addClass(NAV_SHOW); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.fnode.node.close)).addClass(_this.usefontStyle.fnode.node.open); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.fnode.node.close)).removeClass(_this.usefontStyle.fnode.node.close); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.snode.node.close)).addClass(_this.usefontStyle.snode.node.open); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.snode.node.close)).removeClass(_this.usefontStyle.snode.node.close); + return _this.getNowParam(); + }; + + // 基于备份的Html数据回滚 + DTree.prototype.rollbackHtml = function(chooseId){ + var _this = this; + if(_this.bak) { + _this.obj.html(_this.bak); + // 取消全部选中状态 + _this.cancelNavThis(); + if(_this.checkbar) { + _this.cancelCheckedNode(); + _this.chooseDataInit(chooseId); + } else { + _this.dataInit(chooseId); + } + + _this.bak = _this.obj.html(); + } + }; + + + /******************** 基础事件区域 ********************/ + // 数据格式化 + DTree.prototype.escape = function(html){ + return event.escape(html); + }; + + // 格式化数据转回正常数据 + DTree.prototype.unescape = function(str){ + return event.unescape(str); + }; + + // 取消选中div + DTree.prototype.cancelNavThis = function(){ + var _this = this; + _this.obj.find("div[data-id]").parent().find("."+NAV_THIS).removeClass(NAV_THIS); + _this.obj.find("div[data-id]").parent().find("."+_this.style.itemThis).removeClass(_this.style.itemThis); + } + + // 选中div + DTree.prototype.navThis = function(id){ + var _this = this; + var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']"); + if($div != null) { + _this.cancelNavThis(); + $div.addClass(NAV_THIS); + $div.addClass(_this.style.itemThis); + } + } + + // 手风琴模式操作其他节点 + DTree.prototype.accordionUL = function($ul) { + var _this = this; + if(_this.accordion) { + $ul.closest("li[data-index]").siblings("li[data-index]").children("ul[data-id]").removeClass(NAV_SHOW); + var $divs = $ul.closest("li[data-index]").siblings("li[data-index]").children("ul[data-id]").prev("div"); + if($divs.length && $divs.length > 0) { + for (var i=0; i<$divs.length; i++) { + var $div = $($divs[i]); + var $i_spread = _this.getNodeDom($div).fnode(), + $i_node = _this.getNodeDom($div).snode(); + if($i_spread.attr("data-spread") != 'last'){ + _this.operateIcon($i_spread, $i_node).close(); + } + } + } + + } + }; + + // 展开或隐藏节点 作用点: div + DTree.prototype.clickSpread = function($div) { + var _this = this; + var $i_spread = _this.getNodeDom($div).fnode(), + $i_node = _this.getNodeDom($div).snode(), + $cite = _this.getNodeDom($div).cite(), + spread = $i_spread.attr("data-spread"), + $ul = $div.next("ul"); + + if ($ul.length > 0) { + if (spread == "close") { + if (_this.type=="load") { //增加加载 + if (_this.cache) { //开启缓存 + if ($ul.html()) { + $ul.addClass(NAV_SHOW); + _this.accordionUL($ul); + } else { //加载节点 + _this.getChild($div); + _this.accordionUL($ul); + } + }else { //每次取新的数据 + $ul.html(""); + _this.getChild($div); + _this.accordionUL($ul); + } + } else { // 全量加载 + $ul.addClass(NAV_SHOW); + _this.accordionUL($ul); + } + _this.operateIcon($i_spread, $i_node).open(); + } else if (spread == "open") { + $ul.removeClass(NAV_SHOW); + _this.operateIcon($i_spread, $i_node).close(); + } + } + }; + + // 设置节点为disabled + DTree.prototype.setDisabledNodes = function(disabledIds){ + var _this = this; + var disabledId = disabledIds.split(","); + for (var i=0; i 0) { + _this.getChild($div, data); + } else { + var parseData = _this.parseData(data); + + if(parseData.treeId()){ + var level = parseInt($div.parent("li").attr("data-index"))+1; + $ul.append(_this.getLiItemDom(parseData.treeId(), parseData.parentId(), parseData.title(), parseData.fmtTitle(), parseData.last(0), parseData.ficonClass(), parseData.iconClass(), parseData.checkArr(), level, parseData.spread(), parseData.disabled(), parseData.hide(), parseData.basicData(), parseData.recordData(), "item")); + + // 建造完毕后,选中该DIV + $thisDiv = $ul.find("div[data-id='"+parseData.treeId()+"']"); + _this.setNodeParam($thisDiv); + + _this.showLine($ul.find("li")); + } else { + layer.msg("添加失败,节点ID为undefined!",{icon:5}); + // 重新赋值 + _this.setNodeParam($div); + } + } + } else { + _this.getChild($div); + } + } + + // 局部刷新树--编辑当前节点选中节点时 + DTree.prototype.partialRefreshEdit = function($div, data){ + var _this = this; + $ul = $div.next("ul"), + $p_li = $div.parent("li"); + + if(data) { + if(typeof data === 'object') { + var parseData = _this.parseData(data); + + if(parseData.treeId()){ + var replaceDom = _this.replaceDom($div, parseData.treeId(), parseData.last(0), parseData.spread(), parseData.disabled(), parseData.hide()); + replaceDom.div(); + replaceDom.node(parseData.iconClass()); + replaceDom.checkbox(parseData.checkArr()); + replaceDom.text(parseData.title()); + replaceDom.ul(); + replaceDom.basicData(parseData.basicData()); + replaceDom.recordData(parseData.recordData()); + + var parentId = parseData.parentId(); + var oldParentId = $p_li.attr("data-pid"); + if(parentId && parentId != oldParentId) { + // 变更了父节点 + $p_li = replaceDom.p_li(parentId); + + // 根据parentId找到下挂节点的ul + var $goto_div = _this.getNodeDom(parentId).div(), + $goto_ul = _this.getNodeDom(parentId).nextUl(); + // 判断父级ul中是否还存在li,如果不存在,则需要修改节点的样式 + if($goto_ul.children("li").length == 0){ + var $icon_i = $goto_div.find("i[data-spread]"); + _this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).openWithLeaf(); + $goto_ul.addClass(NAV_SHOW); + } + $goto_ul.append($p_li); + } else { + replaceDom.p_li(); + } + _this.setNodeParam($div); + } else { + layer.msg("编辑失败,节点ID为undefined!",{icon:5}); + // 重新赋值 + _this.setNodeParam($div); + } + } else { + _this.getNodeDom($div).cite().html(data); + } + } + } + + // 局部刷新树--当前节点选中被删除时 + DTree.prototype.partialRefreshDel = function($div){ + var _this = this; + $p_li = $div.parent("li"); + $p_ul = _this.getNodeDom($div).parentUl(); + $p_div = _this.getNodeDom($div).parentDiv(); + + $p_li.remove(); + _this.showLine($p_ul.find("li")); + // 判断父级ul中是否还存在li,如果不存在,则需要修改节点的样式 + if($p_ul.children("li").length == 0){ + var $icon_i = $p_div.find("i[data-spread]"); + _this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).closeWithLeaf(); + } + _this.initNodeParam(); + } + + /******************** 复选框区域 ********************/ + // 初始化复选框的值 + DTree.prototype.chooseDataInit = function(chooseIds){ + var _this = this; + var chooseId = chooseIds.split(","); + for (var i=0; i."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).noCheck(); + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var flag = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length; + if (flag == 0) { + //把父级去掉选中 + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($item_i).noCheck(); + } + } + } else { + // 处理当前节点的选中状态 + _this.checkStatus($i).check(); + + // 处理子级节点的选中状态 + var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).check(); + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + //把父级选中 + _this.checkStatus($item_i).check(); + } + } + }; + + //实现复选框点击, no-all 子集选中父级半选中,子集全选父级选中 + DTree.prototype.checkAllOrNoallOrNot = function($i) { + var _this = this; + //$i 当前点击的checkbox + var $div = $i.closest("."+LI_DIV_ITEM), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + if ($i.attr("data-checked") == "1") { //当前复选框为选中状态,点击后变为未选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).noCheck(); + + // 处理子级节点的选中状态 + var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).noCheck(); + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var flag = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length; + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + if (flag == 0) { + //把父级去掉选中 + _this.checkStatus($item_i).noCheck(); + } else { + //把父级半选 + _this.checkStatus($item_i).noallCheck(); + } + } + } else { //当前复选框为未选中状态,点击后变为选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).check(); + + // 处理子级节点的选中状态 + var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).check(); + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var flag1 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length; + var flag2 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']").length; + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + if (flag1 != flag2) { + // 父级复选框半选 + _this.checkStatus($item_i).noallCheck(); + } else { + // 父级复选框全选 + _this.checkStatus($item_i).check(); + } + } + } + }; + + //实现复选框点击,p-casc:父级选中子集全选,子集无法改变父级选中状态 + DTree.prototype.checkAllOrPcascOrNot = function($i) { + var _this = this; + //$i 当前点击的checkbox + var $div = $i.closest("."+LI_DIV_ITEM), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + if ($i.attr("data-checked") == "1") { //当前复选框为选中状态,点击后变为未选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).noCheck(); + + // 处理子级节点的选中状态 + var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).noCheck(); + + } else { //当前复选框为未选中状态,点击后变为选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).check(); + + // 处理子级节点的选中状态 + var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).check(); + } + }; + + //实现复选框点击,self:各自选中互不影响 + DTree.prototype.checkOrNot = function($i) { + var _this = this; + //$i 当前点击的checkbox + var $div = $i.closest("."+LI_DIV_ITEM), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + if ($i.attr("data-checked") == "1") { //当前复选框为选中状态,点击后变为未选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).noCheck(); + } else { //当前复选框为未选中状态,点击后变为选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).check(); + } + }; + + //实现复选框点击,only:只能选中1个复选框 + DTree.prototype.checkOnly = function($i) { + var _this = this; + //$i 当前点击的checkbox + var $div = $i.closest("."+LI_DIV_ITEM), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + var checked = $i.attr("data-checked"); + // 将全部节点全部设为未选中状态 + var $all_i = _this.obj.find("i[data-checked]"); + _this.checkStatus($all_i).noCheck(); + + if (checked != "1") { //当前复选框为未选中状态,点击后变为选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).check(); + } + }; + + //实现复选框点击 + DTree.prototype.changeCheck = function($i) { + var _this = this; + var temp = _this.temp; + if(typeof $i === 'undefined') { + $i = temp[0]; + } + // 复选框选中事件 + if (_this.checkbarType == "all") { + _this.checkAllOrNot($i); + } else if(_this.checkbarType == "no-all") { + _this.checkAllOrNoallOrNot($i); + } else if(_this.checkbarType == "p-casc") { + _this.checkAllOrPcascOrNot($i); + } else if(_this.checkbarType == "self") { + _this.checkOrNot($i); + } else if(_this.checkbarType == "only") { + _this.checkOnly($i); + } else { + _this.checkAllOrNot($i); + } + + if(_this.select) { + // 设置复选框模式中的下拉树的值 + _this.selectCheckboxVal(); + } + + // 获取复选框选中节点的内容 + var checkbarNodes = _this.setAndGetCheckbarNodesParam(true); + + // 用户自定义想做的事情 + _this.checkbarFun.chooseDone(checkbarNodes); + layui.event.call(this, MOD_NAME, "chooseDone("+$(_this.obj)[0].id+")", {"checkbarParams": checkbarNodes}); + _this.temp = []; + }; + + //复选框半选状态初始化设置 + DTree.prototype.initNoAllCheck = function(){ + var _this = this; + //1.获取所有选中节点 + var $is = _this.obj.find("i[data-checked='1']"); + if($is.length > 0){ + for ( var key = 0; key < $is.length; key++) { + var $i = $($is[key]), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var flag1 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length; + var flag2 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']").length; + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + if (flag1 != flag2) { + // 父级复选框半选 + _this.checkStatus($item_i).noallCheck(); + } else { + // 父级复选框全选 + _this.checkStatus($item_i).check(); + } + } + } + } + }; + + //复选框选中状态初始化设置 + DTree.prototype.initAllCheck = function(){ + var _this = this; + //1.获取所有选中节点 + var $is = _this.obj.find("i[data-checked='1']"); + if($is.length > 0){ + for ( var key = 0; key < $is.length; key++) { + var $i = $($is[key]), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + // 父级复选框全选 + _this.checkStatus($item_i).check(); + } + } + } + }; + + // 设置复选框选中/未选中/半选 _this.checkStatus($i).check(); _this.checkStatus($i).noCheck(); _this.checkStatus($i).noallCheck(); + DTree.prototype.checkStatus = function($i) { + var _this = this; + return { + check: function(){ + $i.removeClass(_this.usefontStyle.checkbox.out); + $i.removeClass(_this.usefontStyle.checkbox.noall); + $i.addClass(_this.usefontStyle.checkbox.on); + $i.addClass(_this.style.chs); + $i.attr("data-checked","1"); + }, + noCheck: function(){ + $i.removeClass(_this.usefontStyle.checkbox.noall); + $i.removeClass(_this.usefontStyle.checkbox.on); + $i.removeClass(_this.style.chs); + $i.addClass(_this.usefontStyle.checkbox.out); + $i.attr("data-checked","0"); + }, + noallCheck: function(){ + $i.removeClass(_this.usefontStyle.checkbox.out); + $i.removeClass(_this.usefontStyle.checkbox.on); + $i.addClass(_this.usefontStyle.checkbox.noall); + $i.addClass(_this.style.chs); + $i.attr("data-checked","2"); + } + } + }; + + // 设置树的复选框操作值的全部参数,并获取 + DTree.prototype.setAndGetCheckbarNodesParam = function(requestParamFlag) { + var _this = this; + //操作前先清空 + _this.checkbarNode = []; + // 选择所有复选框节点 + if (_this.checkbarData == "change"){ //记录变更数据 + _this.obj.find("i[data-par][dtree-disabled='false']").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + if ($i.attr("data-checked") != $i.attr("data-initchecked")) { + if(requestParamFlag) { + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + } else { + _this.checkbarNode.push(_this.getCheckbarNodeParam($div, $i)); + } + } + }); + } else if (_this.checkbarData == "all"){ //记录全部数据 + _this.obj.find("i[data-par][data-checked][dtree-disabled='false']").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + if(requestParamFlag) { + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + } else { + _this.checkbarNode.push(_this.getCheckbarNodeParam($div, $i)); + } + }); + } else if (_this.checkbarData == "choose"){ //记录选中数据 + _this.obj.find("i[data-par][data-checked='1'][dtree-disabled='false']").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + if(requestParamFlag) { + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + } else { + _this.checkbarNode.push(_this.getCheckbarNodeParam($div, $i)); + } + }); + } else if (_this.checkbarData == "halfChoose"){ //记录选中和半选数据 + _this.obj.find("i[data-par][data-checked='1'][dtree-disabled='false']").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + if(requestParamFlag) { + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + } else { + _this.checkbarNode.push(_this.getCheckbarNodeParam($div, $i)); + } + }); + _this.obj.find("i[data-par][data-checked='2'][dtree-disabled='false']").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + if(requestParamFlag) { + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + } else { + _this.checkbarNode.push(_this.getCheckbarNodeParam($div, $i)); + } + }); + } + return _this.checkbarNode; + }; + + // 获取树的复选框操作值的全部参数 + DTree.prototype.getCheckbarNodesParam = function() { + var _this = this; + return _this.setAndGetCheckbarNodesParam(true); + }; + + // 获取树的一个复选框的参数 + DTree.prototype.getCheckbarNodeParam = function($div, $i){ + var _this = this; + var temp_node = {}; + temp_node.nodeId = $div.attr("data-id"); + temp_node.parentId = _this.getNodeDom($div).parentLi().attr("data-pid"); + temp_node.context = (typeof _this.formatter.title === 'function') ? _this.getNodeDom($div).cite().attr("data-title") : _this.getNodeDom($div).cite().text(); + temp_node.leaf = _this.getNodeDom($div).cite().attr("data-leaf") == "leaf" ? true : false; + temp_node.level = _this.getNodeDom($div).parentLi().attr("data-index"); + temp_node.spread = _this.getNodeDom($div).fnode().attr("data-spread") == "open" ? true : false; + + var basicData = $div.attr("data-basic"); + if(basicData) { + basicData = JSON.parse(event.unescape(basicData)); + } + temp_node.basicData = basicData; + var recordData = $div.attr("data-record"); + if(recordData) { + recordData = JSON.parse(event.unescape(recordData)); + } + temp_node.recordData = recordData; + + temp_node.dataType = $i.attr("data-type"); + temp_node.checked = $i.attr("data-checked"); + temp_node.initchecked = $i.attr("data-initchecked"); + return temp_node; + }; + + // 获取基于返回参数的树的复选框参数 + DTree.prototype.getCheckbarJsonArrParam = function(){ + var _this = this; + var checkbarJsonArr = { + nodeId: [], //节点ID + parentId: [], //父节点ID + context: [], //节点内容 + leaf: [], //是否叶子节点 + level: [], //层级 + spread: [], //节点展开状态 + dataType: [], //节点标记 + checked: [], //节点复选框选中状态 + initchecked: [], //节点复选框初始状态 + basicData: [], //用户自定义的记录节点数据 + recordData: [], //当前data数据(排除basicData和children字段) + }; + // 获取全部复选框选中节点 + var params = _this.setAndGetCheckbarNodesParam(false); + if(params && params.length > 0) { + for(var i=0; i 0) { _this.checkStatus($i).check(); } + } + + //取消全部复选框选中 + DTree.prototype.cancelCheckedNode = function(nodeId){ + var _this = this; + var $i = _this.obj.find("i[data-par][data-checked!='0']"); + if($i.length > 0) { _this.checkStatus($i).noCheck(); } + } + + //反选复选框 + DTree.prototype.invertCheckedNode = function(nodeId){ + var _this = this; + if(_this.obj.find("i[data-par]").length > 0) { + var b = false; + _this.obj.find("i[data-par]").each(function(){ + var $i = $(this); + if($i.attr("data-checked") == '2'){ + b = true; + }else if($i.attr("data-checked") == '0') { + _this.checkStatus($i).check(); + }else if($i.attr("data-checked") == '1') { + _this.checkStatus($i).noCheck(); + } + }); + + if(b) { + _this.initNoAllCheck(); + } else { + _this.initAllCheck(); + } + } + } + + //删除选中节点 + DTree.prototype.removeCheckedNode = function(nodeId){ + var _this = this; + var len = _this.obj.find("i[data-par][data-checked='1']").length; + if(len == 0){ + layer.msg("请至少选中一个节点",{icon:2}); + }else{ + //操作前先清空 + _this.checkbarNode = []; + // 选择所有复选框节点 + var i_node = {}; + _this.obj.find("i[data-par][data-checked='1']").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + }); + + layer.confirm('确定要删除选中节点?', {icon: 3, title:'删除选中节点'}, function(index1){ + var flag = _this.menubarFun.remove(_this.checkbarNode); + if(flag){ + _this.obj.find("i[data-par][data-checked='1']").closest("."+LI_DIV_ITEM).next("ul").remove(); + _this.obj.find("i[data-par][data-checked='1']").closest("."+LI_DIV_ITEM).remove(); + _this.checkbarNode=[]; + } + + layer.close(index1); + }); + } + } + + /******************** 工具栏及菜单栏区域 ********************/ + // 初始化菜单栏和工具栏的div + DTree.prototype.initTreePlus = function(){ + var _this = this; + // 初始化菜单栏和工具栏的div + _this.obj.prevAll('div#dtree_menubar_'+_this.obj[0].id).remove(); + _this.toolbarMenu = {}; + if(_this.menubar && _this.menubarTips.group && _this.menubarTips.group.length > 0) _this.obj.before("
                        "); + if(_this.toolbar){ + if(_this.toolbarWay == "contextmenu") { + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).remove(); + _this.obj.before("
                        "); + } + } + + }; + + // 开启工具栏和菜单栏 + DTree.prototype.openTreePlus = function(){ + var _this = this; + // 先对工具栏做处理,因为菜单栏可能会与工具栏产生关联。 + var ggMenu = []; + if(_this.toolbar) _this.getToolbarDom(); + + if(_this.menubar) { + var menubarTips = _this.menubarTips, + mtbar = menubarTips.toolbar, + group = menubarTips.group, + freedom = menubarTips.freedom; + if(mtbar && mtbar.length > 0){ + // 菜单栏吸附工具栏上 + for(var i=0; i 0){ + // 菜单栏吸附在上方的按钮组div中 + for(var i=0; i"; + break; + case defaultMenu.moveUp: + gg = ""; + break; + case defaultMenu.refresh: + gg = ""; + break; + case defaultMenu.checkAll: + gg = (_this.checkbar && _this.checkbarType != 'only') ? "" : ""; + break; + case defaultMenu.unCheckAll: + gg = (_this.checkbar && _this.checkbarType != 'only') ? "" : ""; + break; + case defaultMenu.invertAll: + gg = (_this.checkbar && _this.checkbarType != 'only') ? "" : ""; + break; + case defaultMenu.remove: + gg = (_this.checkbar) ? "" : ""; + break; + case defaultMenu.searchNode: + gg = ""; + break; + } + return gg; + }; + + // 获取扩展菜单栏 + DTree.prototype.getExtMenubarDom = function(menu){ + var _this = this; + return ""; + }; + + // 获取依附在工具栏的菜单栏 + DTree.prototype.getMenubarToolDom = function(menu){ + var _this = this; + var rootId = _this.obj[0].id; + switch (menu) { + case defaultMenu.moveDown: + _this.toolbarMenu[defaultMenu.moveDown] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.moveDown, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.movedown, "展开全部"); + break; + case defaultMenu.moveUp: + _this.toolbarMenu[defaultMenu.moveUp] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.moveUp, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.moveup, "收缩全部"); + break; + case defaultMenu.refresh: + _this.toolbarMenu[defaultMenu.refresh] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.refresh, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.refresh, "刷新"); + break; + case defaultMenu.checkAll: + if(_this.checkbar && _this.checkbarType != 'only') + _this.toolbarMenu[defaultMenu.checkAll] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.checkAll, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.checkAll, "全选节点"); + break; + case defaultMenu.unCheckAll: + if(_this.checkbar && _this.checkbarType != 'only') + _this.toolbarMenu[defaultMenu.unCheckAll] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.unCheckAll, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.unCheckAll, "全不选节点"); + break; + case defaultMenu.invertAll: + if(_this.checkbar && _this.checkbarType != 'only') + _this.toolbarMenu[defaultMenu.invertAll] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.invertAll, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.invertAll, "反选节点"); + break; + case defaultMenu.remove: + if(_this.checkbar) + _this.toolbarMenu[defaultMenu.remove] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.remove, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.remove, "删除选中"); + break; + case defaultMenu.searchNode: + _this.toolbarMenu[defaultMenu.searchNode] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.searchNode, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.searchNode, "查询"); + break; + } + }; + + // 获取依附在工具栏的扩展菜单栏 + DTree.prototype.getExtMenubarToolDom = function(menu){ + var _this = this; + _this.toolbarMenu[menu.menubarId] = _this.setToolbarDom().setMenuToolbarOption(menu.menubarId, menu.title, _this.usefontStyle.toolbar.menubarExt+" "+menu.icon, ""); + }; + + // menubar内置方法 + DTree.prototype.menubarMethod = function(){ + var _this = this; + return { + openAllNode: function(obj){ // 展开所有节点 + var $ulNode = obj || _this.obj.children("li").children("ul"); + // 遍历所有ul子节点 + for (var i = 0; i < $ulNode.length; i++) { + // 获取当前节点的信息 + var $ul = $($ulNode[i]), + $div = $ul.prev("div"), + $i_spread = _this.getNodeDom($div).fnode(), + $i_node = _this.getNodeDom($div).snode(), + $cite = _this.getNodeDom($div).cite(), + spread = $i_spread.attr("data-spread"), + leaf = $cite.attr("data-leaf"); + + if (leaf == "leaf") { continue; } // 说明是叶子了,则继续循环下一个 + + if (spread == "open") { + // 说明该节点已经展开了,则进行子节点循环 + } else { + if (_this.type=="load") { //是否全量加载 + if (_this.cache) { //是否开启缓存 + if ($ul.html()) { + $ul.addClass(NAV_SHOW); + } else { //加载节点 + _this.getChild($div); + } + }else { //每次取新的数据 + $ul.html(""); + _this.getChild($div); + } + } else { // 全量加载 + $ul.addClass(NAV_SHOW); + } + _this.operateIcon($i_spread, $i_node).open(); + + } + var $childUl = $ul.children("li").children("ul"); + _this.menubarMethod().openAllNode($childUl); + } + }, + closeAllNode: function(){ //收缩所有节点 + _this.obj.find("."+LI_NAV_CHILD).each(function(){ + // 获取当前节点的信息 + var $ul = $(this), + $div = $ul.prev("div"), + $i_spread = _this.getNodeDom($div).fnode(), + $i_node = _this.getNodeDom($div).snode(), + $cite = _this.getNodeDom($div).cite(), + spread = $i_spread.attr("data-spread"), + leaf = $cite.attr("data-leaf"); + + $ul.removeClass(NAV_SHOW); + _this.operateIcon($i_spread, $i_node).close(); + }); + }, + refreshTree: function(){// 刷新树 + _this.refreshTree(); + }, + checkAll: function(){ // 全选节点 + _this.checkAllNode(); + }, + unCheckAll: function(){ // 全不选节点 + _this.cancelCheckedNode(); + }, + invertAll: function(){ // 反选节点 + _this.invertCheckedNode(); + }, + remove: function(){// 删除选中节点 + _this.removeCheckedNode(); + }, + searchNode: function(){//模糊查询该值,展开该值节点 + layer.prompt({ + formType: 0, + value: "", + title: '查询节点' + }, function(value, index1, elem){ + if (value) { + var flag = _this.searchNode(value); + if (!flag) { + layer.msg("该名称节点不存在!", {icon:5}); + } + } else { + layer.msg("未指定查询节点名称", {icon:5}); + } + layer.close(index1); + }); + }, + extMethod: function(menuId, $div, flag){ + if(_this.menubar && _this.menubarTips.group && _this.menubarTips.group.length > 0 && flag == "group"){ + for(var i=0; i<_this.menubarTips.group.length; i++){ + var ext = _this.menubarTips.group[i]; + if (menuId == ext.menubarId){ + ext.handler(_this.getRequestParam(_this.getNodeParam($div), $div)); + break; + } + } + } + if(_this.menubar && _this.menubarTips.toolbar && _this.menubarTips.toolbar.length > 0 && flag == "toolbar"){ + for(var i=0; i<_this.menubarTips.toolbar.length; i++){ + var ext = _this.menubarTips.toolbar[i]; + if (menuId == ext.menubarId){ + ext.handler(_this.getRequestParam(_this.getNodeParam($div), $div)); + break; + } + } + } + if(_this.menubar && _this.menubarTips.freedom && _this.menubarTips.freedom.length > 0 && flag == "freedom"){ + for(var i=0; i<_this.menubarTips.freedom.length; i++){ + var ext = _this.menubarTips.freedom[i]; + if (menuId == ext.menubarId){ + ext.handler(_this.getRequestParam(_this.getNodeParam($div), $div)); + break; + } + } + } + } + }; + }; + + // menubar监听方法 + DTree.prototype.menubarListener = function(menuId, flag){ + var _this = this; + var $div = _this.getNodeDom().nowDiv(); + switch (menuId) { + case defaultMenu.moveDown: // 展开全部节点 + _this.menubarMethod().openAllNode(); + break; + case defaultMenu.moveUp: // 收缩全部节点 + _this.menubarMethod().closeAllNode(); + break; + case defaultMenu.refresh: + _this.menubarMethod().refreshTree(); // 刷新树 + break; + case defaultMenu.checkAll: + _this.menubarMethod().checkAll(); + break; + case defaultMenu.unCheckAll: + _this.menubarMethod().unCheckAll(); + break; + case defaultMenu.invertAll: + _this.menubarMethod().invertAll(); + break; + case defaultMenu.remove: + _this.menubarMethod().remove(); + break; + case defaultMenu.searchNode: + _this.menubarMethod().searchNode(); + break; + default: + _this.menubarMethod().extMethod(menuId, $div, flag); + break; + } + }; + + //模糊查询该值,展开该值节点 + DTree.prototype.searchNode = function(value){ + var _this = this; + var b = false; + var $lis = []; + _this.obj.find("cite[data-leaf]").each(function(){ + var $nthis = $(this); + var html = $nthis.html(); + if(html.indexOf(value) > -1){ + if($nthis.attr("data-leaf") == "leaf") { + // 叶子节点提供包含父节点的所有信息 + var title = ""; + $nthis.parents("li").each(function(){ + title = "-" + $(this).find("cite[data-leaf]").html() + title; + }); + title = title.substring(1, title.length); + $nthis.attr("title", title); + } + // 保存当前cite所在的li及父li中包含该值,则只保留父的 + var i = 0; + $nthis.parents("li").each(function(){ + var html2 = $(this).find("cite[data-leaf]").html(); + if(html2.indexOf(value) > -1){ + i++; + } + if(i >= 2){ + return true; + } + }); + if (i < 2){ + $lis.push($nthis.closest("li").prop("outerHTML")); + } + } + }); + if($lis.length > 0) { + b = true; + // 1.将树节点清空 + _this.obj.html(""); + // 2.遍历所有cite节点,展开当前cite节点 + for(var i=0; i<$lis.length; i++){ + _this.obj.append($lis[i]); + } + } + return b; + }; + + + /******************** 工具栏区域 ********************/ + // 获取工具栏 + DTree.prototype.getToolbarDom = function(){ + var _this = this; + var toolbarShow = _this.toolbarShow, + toolbarExt = _this.toolbarExt, + toolbarWay = _this.toolbarWay; + + if(toolbarShow.length > 0){ + for(var i=0; i 0){ + for(var i=0; i "+other +title+""; + } else if(toolbarWay == "fixed" || toolbarWay == "follow") { + return ""; + } + }, + setMenuToolbarOption: function(menubarId, title, classId, other){ + var rootId = _this.obj[0].id; + if(toolbarWay == "contextmenu") { + return "
                         "+other +title+"
                        "; + } else if(toolbarWay == "fixed" || toolbarWay == "follow") { + return ""; + } + }, + setToolbarPlace: function(toolbarMenu){ + if(toolbarWay == "contextmenu") { + if(toolbarMenu){ + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).find('div.layui-nav-item>dl.layui-nav-child').html(""); + for(var key in toolbarMenu){ + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).find('div.layui-nav-item>dl.layui-nav-child').append(toolbarMenu[key]); + } + } + } else if(toolbarWay == "fixed" || toolbarWay == "follow") { + _this.obj.find("cite[data-leaf][dtree-disabled='false']").each(function(){ + var $cite = $(this); + _this.dynamicToolbarDom($cite); + }); + } + } + } + }; + + // 在节点后动态绑定fixed和follow条件的工具栏 + DTree.prototype.dynamicToolbarDom = function($cite){ + var _this = this; + var toolbarWay = _this.toolbarWay; + if($cite.next("em."+TOOLBAR_TOOL_EM).length == 0) { + var $div = $cite.parent("div"); + var param = _this.getRequestParam(_this.getTempNodeParam($div)); + var toolbarMenus = _this.toolbarFun.loadToolbarBefore(event.cloneObj(_this.toolbarMenu), param, $div); + var hideCls = (toolbarWay == "follow") ? NAV_HIDE : ""; + var em = [""]; + if(toolbarMenus){ + for(var key in toolbarMenus){ + em.push(toolbarMenus[key]); + } + } + em.push(""); + $cite.after(em.join('')); + } + } + + // 隐藏toolbar + DTree.prototype.toolbarHide = function() { + var _this = this; + if(_this.toolbar && _this.toolbarWay == "contextmenu") { + var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id); + $toolBarDiv.find(".layui-nav-child").removeClass('layui-anim-fadein layui-show'); + } + } + + // toolbar内置方法 + DTree.prototype.toolbarMethod = function(){ + var _this = this; + return { + pulldown: function(obj){ // 展开当前点击节点的下面全部节点 + if(!obj) return; + var $ulNode = obj; + // 遍历所有ul子节点 + for (var i = 0; i < $ulNode.length; i++) { + // 获取当前节点的信息 + var $ul = $($ulNode[i]), + $div = $ul.prev("div"), + $i_spread = _this.getNodeDom($div).fnode(), + $i_node = _this.getNodeDom($div).snode(), + $cite = _this.getNodeDom($div).cite(), + spread = $i_spread.attr("data-spread"), + leaf = $cite.attr("data-leaf"); + + if (leaf == "leaf") { continue; } // 说明是叶子了,则继续循环下一个 + + if (spread == "open") { + // 说明该节点已经展开了,则进行子节点循环 + } else { + if (_this.type=="load") { //是否全量加载 + if (_this.cache) { //是否开启缓存 + if ($ul.html()) { + $ul.addClass(NAV_SHOW); + } else { //加载节点 + _this.getChild($div); + } + }else { //每次取新的数据 + $ul.html(""); + _this.getChild($div); + } + } else { // 全量加载 + $ul.addClass(NAV_SHOW); + } + _this.operateIcon($i_spread, $i_node).open(); + + } + var $childUl = $ul.children("li").children("ul"); + _this.toolbarMethod().pulldown($childUl); + } + }, + pullup: function($li){ // 收缩当前点击节点的下面全部节点 + $li.find("."+LI_NAV_CHILD).each(function(){ + // 获取当前节点的信息 + var $ul = $(this), + $div = $ul.prev("div"), + $i_spread = _this.getNodeDom($div).fnode(), + $i_node = _this.getNodeDom($div).snode(), + $cite = _this.getNodeDom($div).cite(), + spread = $i_spread.attr("data-spread"), + leaf = $cite.attr("data-leaf"); + + $ul.removeClass(NAV_SHOW); + _this.operateIcon($i_spread, $i_node).close(); + }); + } + } + }; + + // toolbar监听方法 + DTree.prototype.toolbarListener = function(tool, $div) { + var _this = this; + var $cite = $div.children("cite[data-leaf]"), + $ul = $div.next("ul"), + $p_li = $div.parent("li[data-index]"), //当前选中节点的顶级li节点 + $p_ul = $p_li.parent("ul"), //当前选中节点的顶级li节点的父级ul + $p_div = $p_ul.prev("div"), //当前选中节点的顶级li节点的父级ul的前一个div + title = $cite.html(); + switch (tool) { + case defaultTool.pulldown: + _this.toolbarMethod().pulldown($ul); + break; + case defaultTool.pullup: + _this.toolbarMethod().pullup($p_li); + break; + case defaultTool.addTool: + var content = _this.loadToolBar(title, defaultTool.addTool); + + layer.open({ + title: "新增"+_this.toolbarStyle.title, + type: 1, + area: _this.toolbarStyle.area, + content: content, + success: function(layero, index){ + form.render(); + form.on("submit(dtree_addNode_form)",function(data){ + var data = data.field; + var parentId = $div.attr("data-id"), + id = $div.attr("data-id")+"_node_"+$ul[0].childNodes.length, + leaf = true, + checked = "0", + level = parseInt($p_li.attr("data-index"))+1; + + // 创建子节点的DOM,添加子节点 + var checkArr = []; + if (_this.checkArrLen > 0) { + for (var i = 0; i < _this.checkArrLen; i++) { + checkArr.push({"type":i,"checked":"0"}); + } + } + + $ul.append(_this.getLiItemDom(id, parentId, data.addNodeName, data.addNodeName, true, "", "", checkArr, level, false, false, false, "", "", "item")); + // 先将li节点隐藏 + $ul.find("li[data-id='"+id+"']").hide(); + // 重新赋值 + var $addDiv = $ul.find("div[data-id='"+id+"']"); + node = _this.getNodeParam($addDiv); + + //获取组装后的requestNode,组合参数 + var requestNode = _this.getRequestParam(node); + requestNode = $.extend(requestNode, data); + + _this.temp = [id, $ul, $div, level]; + // 用户自定义想做的事情 + _this.toolbarFun.addTreeNode(requestNode, $div); + + layer.close(index); + return false; + }); + } + }); + break; + case defaultTool.editTool: + var content = _this.loadToolBar(title, defaultTool.editTool); + + layer.open({ + title: "编辑"+_this.toolbarStyle.title, + type: 1, + area: _this.toolbarStyle.area, + content: content, + success: function(layero, index){ + _this.toolbarFun.editTreeLoad(_this.getRequestParam(_this.getNodeParam($div))); + form.render(); + form.on("submit(dtree_editNode_form)",function(data){ + var data = data.field; + $cite.html(data.editNodeName); + node = _this.getNodeParam($div); + var requestNode = _this.getRequestParam(node); + requestNode = $.extend(requestNode, data); + _this.temp = [$cite, $div, title, $p_div]; + _this.toolbarFun.editTreeNode(requestNode, $div); + + layer.close(index); + }); + } + }); + break; + case defaultTool.delTool: + layer.confirm('确定要删除该'+_this.toolbarStyle.title+'?', {icon: 3, title:'删除'+_this.toolbarStyle.title}, function(index){ + var node = _this.getNodeParam($div); + _this.temp = [$p_li, $p_div]; + _this.toolbarFun.delTreeNode(_this.getRequestParam(_this.getNodeParam($div)), $div); + + layer.close(index); + }); + break; + default: + if(_this.toolbarExt.length > 0){ + for(var i=0; i<_this.toolbarExt.length; i++){ + var ext = _this.toolbarExt[i]; + if (tool == ext.toolbarId){ + ext.handler(_this.getRequestParam(_this.getNodeParam($div)), $div); + break; + } + } + } + break; + } + } + + + // 加载toolBar中的内容 + DTree.prototype.loadToolBar = function(title, name){ + var _this = this; + var toolbarShow = _this.toolbarShow; + var nodeBarContents = _this.toolbarBtn; + + var html = ""; + switch (name) { + case defaultTool.addTool: + var addNodeBarDef = [{"label": "当前选中", "name": "nodeTitle", "type": "text", "value": title, "defElem": "nowChoose", "readonly": true}, + {"label": "新增"+_this.toolbarStyle.title, "name": "addNodeName", "type": "text", "value": "", "defElem": "nowChange", "verify": "required"}, + {"type": "submit", "value": "确认添加", "defElem": "btn", "filter": "dtree_addNode_form"}]; + + //2. 用户自定义的节点内容 + var addNodeBar = ['
                        ']; + + if(nodeBarContents != null && nodeBarContents.length > 0){ + if(nodeBarContents[0] != null && nodeBarContents[0] != undefined && nodeBarContents[0].length > 0){ + var addNodeBarContents = nodeBarContents[0]; + // 1. 检查是否包含了now、newly、btn这三个默认项,将其他元素依次排列,将特殊元素至于栈顶 + for(var i=0; i', '
                        ']; + // 3.遍历生成按钮 + for(var j=0; j
                        '); + addNodeBar.push(addBtn.join('')); + addNodeBar.push('
                        '); + html = addNodeBar.join(''); + break; + + case defaultTool.editTool: + var editNodeBarDef = [{"label": "当前选中", "name": "nodeTitle", "type": "text", "value": title, "defElem": "nowChoose", "readonly": true}, + {"label": "编辑"+_this.toolbarStyle.title, "name": "editNodeName", "type": "text", "value": "", "defElem": "nowChange", "verify": "required"}, + {"type": "submit", "value": "确认编辑", "defElem": "btn", "filter": "dtree_editNode_form"}]; + + var editNodeBar = ['
                        ']; + //2. 用户自定义的节点内容 + if(nodeBarContents != null && nodeBarContents.length > 0){ + + if(nodeBarContents[1] != null && nodeBarContents[1] != undefined && nodeBarContents[1].length > 0){ + var editNodeBarContents = nodeBarContents[1]; + // 1. 检查是否包含了now、newly、btn这三个默认项,将其他元素依次排列,将特殊元素至于栈顶 + for(var i=0; i', '
                        ']; + // 3.遍历生成按钮 + for(var j=0; j
                        '); + editNodeBar.push(editBtn.join('')); + editNodeBar.push('
                        '); + html = editNodeBar.join(''); + break; + } + return html; + }; + + // 获取toolbar详细的标签信息 + DTree.prototype.loadToolBarDetail = function(nodeBarContents){ + var _this = this; + var readonly = (typeof (nodeBarContents.readonly) === "boolean") ? nodeBarContents.readonly : false; + var disabled = (typeof (nodeBarContents.disabled) === "boolean") ? nodeBarContents.disabled : false; + var id = nodeBarContents.id ? nodeBarContents.id : ""; + var name = nodeBarContents.name ? nodeBarContents.name : ""; + var val = nodeBarContents.value ? nodeBarContents.value : ""; + var verify = nodeBarContents.verify ? nodeBarContents.verify : ""; + var placeholder = nodeBarContents.placeholder ? nodeBarContents.placeholder : val; + return{ + text: function(){ + return ['
                        ', + '', + '
                        ', + '', + '
                        ', + '
                        '].join(''); + }, + textarea: function(){ + return ['
                        ', + '', + '
                        ', + '', + '
                        ', + '
                        '].join(''); + }, + hidden: function(){ + return [''].join(''); + }, + select: function(){ + var optionsData = (typeof nodeBarContents.optionsData === 'object') ? nodeBarContents.optionsData : nodeBarContents.optionsData(); + var options = ""; + for(var key in optionsData){ + if(val == optionsData[key]){ + options += ""; + } else { + options += ""; + } + } + return ['
                        ', + '', + '
                        ', + '', '
                        ', '
                        '].join(''); + }, + submit: function(){ + var filter = nodeBarContents.filter; + return [''].join(''); + }, + button: function(){ + return [''].join(''); + }, + reset: function(){ + return [''].join(''); + } + } + }; + + // 新增节点后改变节点内容 + DTree.prototype.changeTreeNodeAdd = function(returnID){ + var _this = this; + var temp = _this.temp; + var id = temp[0], $ul = temp[1], $div = temp[2], level = temp[3]; + var flag = false; + if(returnID){ + var $thisDiv = _this.obj.find("[data-id='"+id+"']"); + if(typeof returnID === "object"){ + // 如果是JSON格式数据,则将当前DIV删除,重新建造DIV + $thisDiv.remove(); + var parseData = _this.parseData(returnID); + + if(parseData.treeId()){ + $ul.append(_this.getLiItemDom(parseData.treeId(), parseData.parentId(), parseData.title(), parseData.fmtTitle(), parseData.last(0), parseData.ficonClass(), parseData.iconClass(), parseData.checkArr(), level, parseData.spread(), parseData.disabled(), parseData.hide(), parseData.basicData(), parseData.recordData(), "item")); + + // 建造完毕后,选中该DIV + $thisDiv = $ul.find("div[data-id='"+parseData.treeId()+"']"); + _this.setNodeParam($thisDiv) + } else { + layer.msg("添加失败,节点ID为undefined!",{icon:5}); + // 将li节点删除 + $ul.find("li[data-id='"+id+"']").remove(); + // 重新赋值 + _this.setNodeParam($div); + // 临时变量制空 + _this.temp = []; + return ; + } + }else if(returnID == 'refresh'){ + // 如果是设置为refresh参数,则向后台发送请求,获取新增节点下的真实参数,局部刷新树。 + flag = true; + } else if(typeof returnID === "string" || typeof returnID === 'number' || returnID == true){ + $thisDiv.attr("data-id", returnID); + // 将li节点展示 + $ul.find("li[data-id='"+returnID+"']").show(); + _this.setNodeParam($thisDiv) + } + + // 判断当前点击的节点是否是最后一级节点,如果是,则需要修改节点的样式 + var $icon_i = $div.find("i[data-spread]"); + if ($icon_i.eq(0).attr("data-spread") == "last") { + _this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).openWithLeaf(); + } else { //如果不是,也要修改节点样式 + _this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).open(); + } + $ul.addClass(NAV_SHOW); //展开UL + _this.accordionUL($ul); + if(flag) { + _this.getChild($div); + } else { + // _this.showLine(); + _this.showLine($ul.find("li")); + // 这种情况下需要在新增节点后对节点新增工具栏 + if(_this.toolbar && _this.toolbarWay != 'contextmenu') { + _this.dynamicToolbarDom($thisDiv.find("cite[data-leaf]")); + } + } + + } else { + // 将li节点删除 + $ul.find("li[data-id='"+id+"']").remove(); + // 重新赋值 + _this.setNodeParam($div); + } + + _this.temp = []; // 临时变量制空 + + }; + + // 编辑页打开后显示编辑页内容 + DTree.prototype.changeTreeNodeDone = function(param){ + var _this = this; + form.val('dtree_editNode_form', param); + form.render(); + }; + + // 修改节点后改变节点内容 + DTree.prototype.changeTreeNodeEdit = function(returnID){ + var _this = this; + var temp = _this.temp; + var $cite = temp[0], $div = temp[1], title = temp[2], $p_div = temp[3]; + var flag = false; + if(returnID){ + if(typeof returnID === "object"){ + var parseData = _this.parseData(data); + + if(parseData.treeId()){ + var replaceDom = _this.replaceDom($div, parseData.treeId(), parseData.last(0), parseData.spread(), parseData.disabled(), parseData.hide()); + replaceDom.node(parseData.iconClass()); + replaceDom.checkbox(parseData.checkArr()); + replaceDom.text(parseData.title()); + replaceDom.ul(); + replaceDom.basicData(parseData.basicData()); + replaceDom.recordData(parseData.recordData()); + _this.setNodeParam($div); + } else { + layer.msg("编辑失败,节点ID为undefined!",{icon:5}); + // 重新赋值 + _this.setNodeParam($div); + } + } + } else { + $cite.html(title); + _this.getNodeParam($div); + } + + _this.temp = []; // 临时变量制空 + }; + + // 删除节点后改变节点内容 + DTree.prototype.changeTreeNodeDel = function(flag){ + var _this = this; + var temp = _this.temp; + var $p_li = temp[0], + $p_ul = $p_li.parent("ul"), + $p_div = temp[1]; + + if(flag){ + $p_li.remove(); + _this.showLine($p_ul.find("li")); + // 判断父级ul中是否还存在li,如果不存在,则需要修改节点的样式 + if($p_ul.children("li").length == 0){ + var $icon_i = $p_div.find("i[data-spread]"); + _this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).closeWithLeaf(); + } + _this.initNodeParam(); + } + + _this.temp = []; // 临时变量制空 + }; + + /******************** iframe区域 ********************/ + // 加载iframe + DTree.prototype.loadIframe = function($div, iframeParam) { + var _this = this; + var $cite = _this.getNodeDom($div).cite(); + if (!_this.useIframe) { // 启用iframe + return false; + } + var iframeElem = _this.iframeElem, + iframeUrl = _this.iframeUrl, + iframeLoad = _this.iframeLoad; + + var flag = iframeLoad == "leaf" ? (($cite.attr("data-leaf") == "leaf") ? true : false) : true; + + if (flag) { + if ($(iframeElem).length > 0) { //iframe存在 + if (!iframeUrl) { + layer.msg("数据请求异常,iframeUrl参数未指定", {icon:5}); + return false; + } + var param = AjaxHelper.serialize(iframeParam); + if(iframeUrl.indexOf("?")> -1){ + param = "&"+param.substring(1, param.length); + } + var url = iframeUrl + param; + $(iframeElem).attr("src", url); + } else { + layer.msg("iframe绑定异常,请确认页面中是否有iframe页对应的容器", {icon:5}); + return false; + } + } + return flag; + }; + + // 获取传递出去的参数,根据iframe.iframeDefaultRequest、iframe.iframeRequest和node拼出发出请求的参数 + DTree.prototype.getIframeRequestParam = function(nodes){ + var _this = this; + var request = _this.iframeRequest, + defaultRequestNames = _this.iframeDefaultRequest, + node = nodes || _this.node, + requestParam = {}; + + // 先拼用户自定义的,在拼树生成的,这样的话用户可以自定义当树未生成时的节点的初始值 + for ( var key in request) { + requestParam[key] = request[key]; + } + for ( var key in defaultRequestNames) { + var paramName = defaultRequestNames[key]; + var paramValue = node[key]; + if(typeof paramValue === "boolean"){ + requestParam[paramName] = paramValue; + }else { + if(paramValue){ + requestParam[paramName] = paramValue; + } + } + } + + // 解决传递中文的乱码问题 + var reg = /[\u4E00-\u9FA5\uF900-\uFA2D]/; //正则匹配中文 + for(var key in requestParam){ + if(reg.test(requestParam[key])) { + var str = requestParam[key]; + requestParam[key] = encodeURI(encodeURI(str)); + } + } + + return requestParam; + }; + + /******************** 数据回调区域 ********************/ + // 根据具体的id获取基于当前id的div以及对应的其他dom元素 + DTree.prototype.getNodeDom = function(id){ + var _this = this; + // 获取当前div,如果id就是一个dom,则就是这个,如果不是则进行选择。如果选不中则为null + var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']"); + return { + div: function(){ // 获取当前div + return $div; + }, + fnode: function(){ // 获取一级图标元素 + return ($div == null) ? null : $div.find("i[data-spread]").eq(0); + }, + snode: function(){ // 获取二级图标元素 + return ($div == null) ? null : $div.find("i[data-spread]").eq(1); + }, + checkbox: function(){ // 获取复选框元素 + return ($div == null) ? null : $div.find("i[data-par]"); + }, + cite: function(){ // 获取cite元素 + return ($div == null) ? null : $div.find("cite[data-leaf]"); + }, + nextUl: function(){ // 获取相邻的ul元素 + return ($div == null) ? null : $div.next("ul"); + }, + parentLi: function(){ // 获取父级li元素 + return ($div == null) ? null : $div.parent("li"); + }, + parentUl: function(){ // 获取基于当前$div的上级$ul + return ($div == null) ? null : $div.parent("li").parent("ul"); + }, + parentDiv: function(){ // 获取基于当前$div的上级$div + return ($div == null) ? null : $div.parent("li").parent("ul").prev("div"); + }, + nowDiv: function(){ // 获取当前选中节点,没有则返回null + return (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS).length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS); + }, + nowOrRootDiv: function(){ // 获取当前选中节点,没有则返回根节点下的第一个div + return (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS).length == 0) ? _this.obj.children("li").eq(0).children("div").eq(0) : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS); + }, + nowOrRootUl: function(){ // 获取当前选中节点下一个UL 或根节点。为了将新节点放入ul下 + return (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS).length == 0) ? _this.obj : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS).next("ul"); + } + } + }; + + // 获取当前选中节点下一个UL 或根节点。为了将新节点放入ul下 + DTree.prototype.getNowNodeUl = function() { + var _this = this; + return _this.getNodeDom().nowOrRootUl(); + }; + + // 获取当前选中节点 或第一个根节点。 + DTree.prototype.getNowNode = function() { + var _this = this; + return _this.getNodeDom().nowOrRootDiv(); + }; + + // 获取当前选中节点 无则返回null。 + DTree.prototype.getNowNodeOrNull = function() { + var _this = this; + return _this.getNodeDom().nowDiv(); + }; + + // 获取指定节点。 + DTree.prototype.getNode = function(id) { + var _this = this; + return _this.getNodeDom(id).div(); + }; + + // 设置当前选中节点的全部参数 + DTree.prototype.setNodeParam = function($div) { + var _this = this; + _this.node.nodeId = $div.attr("data-id"); + _this.node.parentId = _this.getNodeDom($div).parentLi().attr("data-pid"); + _this.node.context = (typeof _this.formatter.title === 'function') ? _this.getNodeDom($div).cite().attr("data-title") : _this.getNodeDom($div).cite().text(); + _this.node.leaf = _this.getNodeDom($div).cite().attr("data-leaf") == "leaf" ? true : false; + _this.node.level = _this.getNodeDom($div).parentLi().attr("data-index"); + _this.node.spread = _this.getNodeDom($div).fnode().attr("data-spread") == "open" ? true : false; + + var basicData = $div.attr("data-basic"); + if(basicData) { + basicData = JSON.parse(event.unescape(basicData)); + } + _this.node.basicData = basicData; + + var recordData = $div.attr("data-record"); + if(recordData) { + recordData = JSON.parse(event.unescape(recordData)); + } + _this.node.recordData = recordData; + + if (_this.getNodeDom($div).checkbox()) { + var dataTypes = "", checkeds = "", initcheckeds = ""; + _this.getNodeDom($div).checkbox().each(function(){ + dataTypes += $(this).attr("data-type") + ","; + checkeds += $(this).attr("data-checked") + ","; + initcheckeds += $(this).attr("data-initchecked") + ","; + }); + dataTypes = dataTypes.substring(0, dataTypes.length-1); + checkeds = checkeds.substring(0, checkeds.length-1); + initcheckeds = initcheckeds.substring(0, initcheckeds.length-1); + + _this.node.dataType = dataTypes; + _this.node.checked = checkeds; + _this.node.initchecked = initcheckeds; + } + }; + + // 获取当前选中节点的全部参数 + DTree.prototype.getNodeParam = function($div) { + var _this = this; + if ($div) { + _this.setNodeParam($div); + } else { + if(_this.obj.find("div[data-id]").parent().find("."+NAV_THIS).length == 0){ + _this.initNodeParam(); + } + } + return this.node; + }; + + // 获取一个临时的node参数 + DTree.prototype.getTempNodeParam = function($div) { + var _this = this; + var temp_node = {}; + temp_node.nodeId = $div.attr("data-id"); + temp_node.parentId = _this.getNodeDom($div).parentLi().attr("data-pid"); + temp_node.context = (typeof _this.formatter.title === 'function') ? _this.getNodeDom($div).cite().attr("data-title") : _this.getNodeDom($div).cite().text(); + temp_node.leaf = _this.getNodeDom($div).cite().attr("data-leaf") == "leaf" ? true : false; + temp_node.level = _this.getNodeDom($div).parentLi().attr("data-index"); + temp_node.spread = _this.getNodeDom($div).fnode().attr("data-spread") == "open" ? true : false; + + var basicData = $div.attr("data-basic"); + if(basicData) { + basicData = JSON.parse(event.unescape(basicData)); + } + temp_node.basicData = basicData; + var recordData = $div.attr("data-record"); + if(recordData) { + recordData = JSON.parse(event.unescape(recordData)); + } + temp_node.recordData = recordData; + + if (_this.getNodeDom($div).checkbox()) { + var dataTypes = "", checkeds = "", initcheckeds = ""; + _this.getNodeDom($div).checkbox().each(function(){ + dataTypes += $(this).attr("data-type") + ","; + checkeds += $(this).attr("data-checked") + ","; + initcheckeds += $(this).attr("data-initchecked") + ","; + }); + dataTypes = dataTypes.substring(0, dataTypes.length-1); + checkeds = checkeds.substring(0, checkeds.length-1); + initcheckeds = initcheckeds.substring(0, initcheckeds.length-1); + + temp_node.dataType = dataTypes; + temp_node.checked = checkeds; + temp_node.initchecked = initcheckeds; + } + return temp_node; + }; + + // 重置参数 + DTree.prototype.initNodeParam = function(){ + var _this = this; + _this.node.nodeId = ""; + _this.node.parentId = ""; + _this.node.context = ""; + _this.node.leaf = ""; + _this.node.level = ""; + _this.node.spread = ""; + _this.node.dataType = ""; + _this.node.checked = ""; + _this.node.initchecked = ""; + _this.node.basicData = ""; + _this.node.recordData = ""; + + if(_this.select) { + _this.selectResetVal(); + } + }; + + // 获取传递出去的参数,根据defaultRequest、request和node拼出发出请求的参数 + DTree.prototype.getRequestParam = function(nodes){ + var _this = this; + var request = _this.request, + defaultRequestNames = _this.defaultRequest, + node = nodes || _this.node, + requestParam = {}; + + // 先拼用户自定义的,在拼树生成的,这样的话用户可以自定义当树未生成时的节点的初始值 + for ( var key in request) { + requestParam[key] = request[key]; + } + for ( var key in defaultRequestNames) { + var paramName = defaultRequestNames[key]; + var paramValue = node[key]; + if(typeof paramValue === "boolean"){ + requestParam[paramName] = paramValue; + }else { + if(paramValue){ + requestParam[paramName] = paramValue; + } + } + + } + return requestParam; + }; + + // 获取filterParam过滤后的requestParam + DTree.prototype.getFilterRequestParam = function(requestParam){ + var _this = this; + var filterRequest = _this.filterRequest; + return event.cloneObj(requestParam, filterRequest); + }; + + // 获取当前选中值 + DTree.prototype.getNowParam = function(){ + var _this = this; + + return _this.getRequestParam(_this.getNodeParam()); + }; + + // 获取指定节点选中值 + DTree.prototype.getParam = function(id){ + var _this = this; + + // 获取当前div,如果id就是一个dom,则就是这个,如果不是则进行选择。如果选不中则为null + var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']"); + if($div != null){ return _this.callbackData().node(_this.getTempNodeParam($div)); } else { return {}; } + }; + + // 获取参数的上级节点 + DTree.prototype.getParentParam = function(id){ + var _this = this; + // 获取当前div,如果id就是一个dom,则就是这个,如果不是则进行选择。如果选不中则为null + var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']"); + if($div != null){ return _this.callbackData().parentNode($div); } else { return {}; } + }; + + // 获取参数的全部上级节点 + DTree.prototype.getAllParentParam = function(id){ + var _this = this; + // 获取当前div,如果id就是一个dom,则就是这个,如果不是则进行选择。如果选不中则为null + var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']"); + var arr = []; + if($div != null){ + var level = _this.getTempNodeParam($div).level; + for(var i=1; i 0){ + $childDivs.each(function(){ + var $cDiv = $(this); + childNode.push(_this.getRequestParam(_this.getTempNodeParam($cDiv))); + }); + } + return childNode; + }, + parentNode: function($div){ // 获取上级节点值 + var pId = _this.getNodeDom($div).parentLi().attr("data-pid"); + var $pdiv = _this.obj.find("div[data-id='"+pId+"']"); + if($pdiv.length > 0) {return _this.getRequestParam(_this.getTempNodeParam($pdiv));} else {return {};} + + } + } + }; + + /******************** 事件回调区域 ********************/ + // 绑定浏览器事件 + DTree.prototype.bindBrowserEvent = function(){ + var _this = this; + var rootId = _this.obj[0].id; + + // 绑定文件夹展开/收缩的图标的点击事件,点击时给当前节点的div添加选中class + _this.obj.on("click", "i[data-spread]", function(event) { + event.stopPropagation(); + var $i = $(this), + $div = $i.parent("div"), + node = _this.getNodeParam($div); + + _this.toolbarHide(); + _this.navThis($div); + _this.clickSpread($div); // 展开或隐藏节点 + + // 树状态改变后,用户自定义想做的事情 + layui.event.call(this, MOD_NAME, "changeTree("+$(_this.obj)[0].id+")", { + dom: _this.callbackData().dom($i), + param: _this.callbackData().node(node), + show: _this.callbackData().dom($i).attr("data-spread") == "open" ? true : false + }); + }); + + // 绑定所有子节点div的单击事件,点击时触发加载iframe或用户自定义想做的事情 + _this.obj.on("click", "div[dtree-click='"+eventName.itemNodeClick+"'][dtree-disabled='false']", function(event) { + event.stopPropagation(); + var $div = $(this), + $cite = $div.find("cite"), + node = _this.getNodeParam($div); + _this.toolbarHide(); + _this.navThis($div); + + if(_this.select) { + _this.selectVal(node.nodeId); + $("div[dtree-id='" + rootId + "'][dtree-select='"+_this.selectDiv+"']").click(); + } + + if (_this.useIframe) { + var iframeParam = _this.getFilterRequestParam(_this.getIframeRequestParam(node)); + var flag = _this.loadIframe($div, iframeParam); // 加载iframe + if (flag) { + // iframe加载完毕后,用户自定义想做的事情 + _this.iframeFun.iframeDone(iframeParam); + + layui.event.call(this, MOD_NAME, "iframeDone("+$(_this.obj)[0].id+")", { + "iframeParam": iframeParam, + dom: _this.callbackData().dom($div) + }); + } + } else { + // 单击事件执行完毕后,用户自定义想做的事情 + layui.event.call(this, MOD_NAME, "node("+$(_this.obj)[0].id+")", { + param: _this.callbackData().node(node), + childParams: _this.callbackData().childNode($div), + parentParam: _this.callbackData().parentNode($div), + dom: _this.callbackData().dom($div) + }); + } + }); + + // 绑定所有子节点div的双击事件,暴露on给用户自定义 + _this.obj.on("dblclick", "div[dtree-click='"+eventName.itemNodeClick+"'][dtree-disabled='false']", function(event) { + event.stopPropagation(); + var $div = $(this), + $cite = $div.find("cite"), + node = _this.getNodeParam($div); + _this.toolbarHide(); + _this.navThis($div); + + if(_this.select) { + _this.selectVal(node.nodeId); + $("div[dtree-id='" + rootId + "'][dtree-select='"+_this.selectDiv+"']").click(); + } + + // 双击事件执行完毕后,用户自定义想做的事情 + layui.event.call(this, MOD_NAME, "nodedblclick("+$(_this.obj)[0].id+")", { + param: _this.callbackData().node(node), + childParams: _this.callbackData().childNode($div), + parentParam: _this.callbackData().parentNode($div), + dom: _this.callbackData().dom($div) + }); + }); + + if(_this.checkbar) { + // 绑定cheboxbar的节点复选框 + _this.obj.on("click", "i[dtree-click='"+eventName.checkNodeClick+"'][dtree-disabled='false']", function(event) { + _this.toolbarHide(); + var $i = $(this), + $div = $i.closest("div[dtree-click='"+eventName.itemNodeClick+"']"), + node = _this.getNodeParam($div); + // 复选框选中前的回调 + var flag = _this.checkbarFun.chooseBefore($i, _this.getRequestParam(node)); + _this.temp = [$i]; + if(flag){_this.changeCheck();} + + event.stopPropagation(); + }); + } + + if(_this.menubar) { + // 绑定menubar的点击事件 + _this.obj.prevAll('div#dtree_menubar_'+_this.obj[0].id).on("click", "button[d-menu]", function(event) { + event.stopPropagation(); + _this.toolbarHide(); + _this.menubarListener($(this).attr("d-menu"), "group"); + }); + + // 绑定menubar的点击事件 + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).on("click", "a[d-menu]", function(event) { + event.stopPropagation(); + _this.toolbarHide(); + _this.menubarListener($(this).attr("d-menu"), "toolbar"); + }); + + // 绑定menubar的点击按钮事件 + _this.obj.closest('body').find("*[dtree-id='"+_this.obj[0].id+"'][dtree-menu]").on("click", function(event) { + event.stopPropagation(); + _this.toolbarHide(); + _this.menubarListener($(this).attr("dtree-menu"), "freedom"); + }); + } + + if(_this.toolbar) { + if(_this.toolbarWay == "contextmenu") { + //绑定所有子节点div的右键点击事件,用于显示toolbar + _this.obj.on("contextmenu", "div[dtree-click='"+eventName.itemNodeClick+"'][d-contextmenu='true'][dtree-disabled='false']", function(e){ + var $div = $(this), + node = _this.getNodeParam($div); + + _this.toolbarHide(); + // toolbar加载前执行的方法,执行完毕之后创建按钮 + _this.setToolbarDom().setToolbarPlace(_this.toolbarFun.loadToolbarBefore(event.cloneObj(_this.toolbarMenu), _this.getRequestParam(node), $div)); + + var e = e || window.event, + mx = e.pageX - $div.offset().left +45 , + my = $div.offset().top - _this.obj.closest(_this.scroll).offset().top +15; + + _this.navThis($div); + var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id); + $toolBarDiv.find(".layui-nav-child").addClass('layui-anim-fadein layui-show'); + $toolBarDiv.css({'left':mx+'px','top':my+'px'}); + + e.stopPropagation(); + return false; + }); + + // 绑定装载树的上层出现滚动条的容器,让toolbar隐藏 + _this.obj.closest(_this.scroll).scroll(function() { + _this.toolbarHide(); + }); + + // 绑定toolbar的点击事件 + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).on("click", "a[dtree-tool]", function(event) { + event.stopPropagation(); + var $div = _this.getNodeDom().nowOrRootDiv(), + node = _this.getNodeParam($div); + _this.toolbarHide(); + var tool = $(this).attr("dtree-tool"); + _this.toolbarListener(tool, $div); + }); + } else if(_this.toolbarWay == "fixed") { + // 绑定toolbar的点击事件 + _this.obj.on("click", "a[dtree-tool]", function(event) { + event.stopPropagation(); + var $a = $(this), + $cite = $a.parent("em."+TOOLBAR_TOOL_EM).prev("cite"), //当前选中节点的text + $div = $cite.parent("div"), + node = _this.getNodeParam($div); + var tool = $a.attr("dtree-tool"); + + _this.toolbarHide(); + _this.navThis($div); + _this.toolbarListener(tool, $div); + }); + } else if(_this.toolbarWay == "follow") { + //绑定所有子节点div的mouseover mouseout事件,用于显示或隐藏toolbar + _this.obj.on("mouseover mouseout", "div[dtree-click='"+eventName.itemNodeClick+"'][dtree-disabled='false']", function(event){ + var $div = $(this), + $toolBarEm = $div.children("em."+TOOLBAR_TOOL_EM); + if(event.type == "mouseover"){ + $toolBarEm.removeClass(NAV_HIDE); + event.stopPropagation(); + } else if(event.type == "mouseout"){ + $toolBarEm.addClass(NAV_HIDE); + event.stopPropagation(); + } + }); + + // 绑定toolbar的点击事件 + _this.obj.on("click", "a[dtree-tool]", function(event) { + event.stopPropagation(); + var $a = $(this), + $cite = $a.parent("em."+TOOLBAR_TOOL_EM).prev("cite"), //当前选中节点的text + $div = $cite.parent("div"), + node = _this.getNodeParam($div); + var tool = $a.attr("dtree-tool"); + + _this.toolbarHide(); + _this.navThis($div); + _this.toolbarListener(tool, $div); + }); + } + } + + if(_this.select) { + // 绑定select的点击事件 + $("div[dtree-id='" + rootId + "'][dtree-select='"+_this.selectDiv+"']").on("click", function(event){ + event.stopPropagation(); + $(this).toggleClass("layui-form-selected"); + $("div[dtree-id='" + rootId + "'][dtree-card='"+_this.selectCardDiv+"']").toggleClass("dtree-select-show layui-anim layui-anim-upbit"); + + // 下拉树面板开闭状态改变后,用户自定义想做的事情 + layui.event.call(this, MOD_NAME, "changeSelect("+$(_this.obj)[0].id+")", { + show: $(this).hasClass("layui-form-selected"), + param: _this.selectVal() + }); + }); + + } + }; + + // 绑定body的单击,让本页面所有的toolbar隐藏 + $BODY.on("click", function(event){ + $("div."+LI_DIV_TOOLBAR).find(".layui-show").removeClass('layui-anim-fadein layui-show'); + // $("div[dtree-id][dtree-select]").removeClass("layui-form-selected"); + // $("div[dtree-id][dtree-card]").removeClass("dtree-select-show layui-anim layui-anim-upbit"); + + }); + + // 解绑浏览器事件 + DTree.prototype.unbindBrowserEvent = function(){ + var _this = this; + + // 本身事件解绑 + _this.obj.unbind(); + // 菜单栏解绑 + if(_this.menubar){ + _this.obj.prevAll('div#dtree_menubar_'+_this.obj[0].id).unbind(); + if(_this.obj.closest('body').find("*[dtree-id='"+_this.obj[0].id+"'][dtree-menu]").length > 0){ + _this.obj.closest('body').find("*[dtree-id='"+_this.obj[0].id+"'][dtree-menu]").unbind(); + } + } + + // 工具栏解绑 + if(_this.toolbar){ + if(_this.toolbarWay == "contextmenu") { + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).unbind(); + if(_this.obj.closest(_this.scroll).length > 0){ + _this.obj.closest(_this.scroll).unbind(); + } + } + } + + // 下拉树解绑 + if(_this.select) { + // 解绑select的点击事件 + $("div[dtree-id='" + _this.obj[0].id + "'][dtree-select='"+_this.selectDiv+"']").removeClass("layui-form-selected"); + $("div[dtree-id='" + _this.obj[0].id + "'][dtree-card='"+_this.selectCardDiv+"']").removeClass("dtree-select-show layui-anim layui-anim-upbit"); + $("div[dtree-id='" + _this.obj[0].id + "'][dtree-select='"+_this.selectDiv+"']").unbind(); + } + }; + + + /** 外部访问 **/ + var dtree = { + set: function(options){ //设置全局属性 + if(typeof options !== 'undefined') { + $.extend(OPTIONS, options); + } + }, + render: function(options){ // 初始化树 + var dTree = null; + var id = event.getElemId(options); + if(id == "") { + layer.msg("页面中未找到绑定id", {icon:5}); + } else { + dTree = DTrees[id]; + if(typeof dTree === 'object'){ + dTree.unbindBrowserEvent(); + } + // 创建树 + dTree = new DTree(options); + // 添加到树数组中去 + DTrees[id] = dTree; + dTree.initTreePlus(); + dTree.openTreePlus(); + dTree.init(); + dTree.bindBrowserEvent(); + } + + return dTree; + }, + renderSelect: function(options){ // 初始化下拉树 + var dTree = null; + var id = event.getElemId(options); + if(id == "") { + layer.msg("页面中未找到绑定id", {icon:5}); + } else { + dTree = DTrees[id]; + if(typeof dTree === 'object'){ + dTree.unbindBrowserEvent(); + } + // 创建下拉树 + dTree = new DTree(options); + dTree.selectSetting(); + // 添加到树数组中去 + DTrees[id] = dTree; + dTree.initTreePlus(); + dTree.openTreePlus(); + dTree.init(); + dTree.bindBrowserEvent(); + } + + return dTree; + }, + reload: function(dTree, options){ // 重新加载树 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + dTree.reloadSetting(options); + dTree.initTreePlus(); + dTree.openTreePlus(); + dTree.initNodeParam(); + dTree.init(); + dTree.unbindBrowserEvent(); + dTree.bindBrowserEvent(); + }, + on: function(events, callback) { // 绑定事件 + if(events.indexOf("'") > 0){ + events = events.replace(/'/g,""); + } + if(events.indexOf('"') > 0) { + events = events.replace(/"/g,""); + } + return layui.onevent.call(this, MOD_NAME, events, callback); + }, + click: function(dTree, id) { // 模拟单击事件 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + $("div[dtree-click='"+eventName.itemNodeClick+"'][dtree-id='"+dTree.obj[0].id+"'][data-id='"+id+"']").click(); + }, + getNowParam: function(dTree){ // 获取当前选中值 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.getNowParam(); // 获取当前选中值 + }, + getParam: function(dTree, id){ // 获取指定节点值 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.getParam(id); // 获取指定节点值 + }, + getParentParam: function(dTree, id){ // 获取参数的上级节点 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.getParentParam(id); + }, + getAllParentParam: function(dTree, id){ // 获取参数的全部上级节点 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.getAllParentParam(id); + }, + getChildParam: function(dTree, id){ // 获取参数的全部下级节点 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.getChildParam(id); + }, + getCheckbarNodesParam: function(dTree){ // 获取复选框选中值 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return {}; + } + return dTree.getCheckbarNodesParam(); // 获取复选框选中值 + }, + dataInit: function(dTree, chooseId){ // 初始化选中树,针对数据反选 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + if(chooseId){ + return dTree.dataInit(chooseId); + } + }, + chooseDataInit: function(dTree, chooseIds){ // 初始化复选框选中,针对数据反选 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + if(chooseIds){ + return dTree.chooseDataInit(chooseIds); + } + }, + changeCheckbarNodes: function(dTree){ //判断复选框是否发生变更 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.changeCheckbarNodes(); + }, + initNoAllCheck: function(dTree) { //复选框半选状态初始化设置 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.initNoAllCheck(); + }, + initAllCheck: function(dTree){ // 复选框选中状态初始化设置 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.initAllCheck(); + }, + selectVal: function(dTree, param){ // select模式设置输入框选中值 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.selectVal(param); // select模式设置输入框选中值 + }, + escape: function(html){ // 字符串格式化 + return event.escape(html); + }, + unescape: function(str){ // 字符串反格式化 + return event.unescape(str); + }, + version: function(){ //获取版本号 + return VERSION; + } + }; + + exports('dtree', dtree); +}); \ No newline at end of file diff --git a/static/component/pear/css/module/dtree/font/dtreefont.css b/static/component/pear/css/module/dtree/font/dtreefont.css new file mode 100644 index 000000000..df7af6539 --- /dev/null +++ b/static/component/pear/css/module/dtree/font/dtreefont.css @@ -0,0 +1,229 @@ +@font-face { + font-family: 'dtreefont'; + src: url('dtreefont.eot?x3m8fp'); + src: url('dtreefont.eot?x3m8fp#iefix') format('embedded-opentype'), + url('dtreefont.ttf?x3m8fp') format('truetype'), + url('dtreefont.woff?x3m8fp') format('woff'), + url('dtreefont.svg?x3m8fp#dtreefont') format('svg'); + font-weight: normal; + font-style: normal; +} + +[class^="dtree-icon-"], [class*=" dtree-icon-"] { + /* use !important to prevent issues with browser extensions that change font */ + font-family: 'dtreefont' !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; +} + +.dtree-icon-xiangxia1:before { + content: "\e771"; +} +.dtree-icon-normal-file:before { + content: "\e60c"; +} +.dtree-icon-xiangyou:before { + content: "\e78f"; +} +.dtree-icon-ok-circle:before { + content: "\1005"; +} +.dtree-icon-close1:before { + content: "\1006"; +} +.dtree-icon-close-fill:before { + content: "\1007"; +} +.dtree-icon-jian1:before { + content: "\e600"; +} +.dtree-icon-jia1:before { + content: "\e601"; +} +.dtree-icon-bianji:before { + content: "\e602"; +} +.dtree-icon-yonghu:before { + content: "\e603"; +} +.dtree-icon-shijian:before { + content: "\e606"; +} +.dtree-icon-fuxuankuang-banxuan:before { + content: "\e607"; +} +.dtree-icon-star:before { + content: "\e608"; +} +.dtree-icon-wenjianjiazhankai:before { + content: "\e60e"; +} +.dtree-icon-xiangmuxiaoxi:before { + content: "\e60f"; +} +.dtree-icon-search2:before { + content: "\e615"; +} +.dtree-icon-weibiaoti5:before { + content: "\e618"; +} +.dtree-icon-layim-theme:before { + content: "\e61b"; +} +.dtree-icon-shuye1:before { + content: "\e61e"; +} +.dtree-icon-add-circle:before { + content: "\e61f"; +} +.dtree-icon-xinxipilu:before { + content: "\e620"; +} +.dtree-icon-set-sm:before { + content: "\e621"; +} +.dtree-icon-about:before { + content: "\e623"; +} +.dtree-icon-chart-screen:before { + content: "\e62a"; +} +.dtree-icon-delete1:before { + content: "\e640"; +} +.dtree-icon-share3:before { + content: "\e641"; +} +.dtree-icon-youjian:before { + content: "\e642"; +} +.dtree-icon-check:before { + content: "\e645"; +} +.dtree-icon-close:before { + content: "\e646"; +} +.dtree-icon-favorfill:before { + content: "\e64b"; +} +.dtree-icon-favor:before { + content: "\e64c"; +} +.dtree-icon-fuxuankuangxuanzhong:before { + content: "\e652"; +} +.dtree-icon-fenguangbaobiao:before { + content: "\e655"; +} +.dtree-icon-jian:before { + content: "\e656"; +} +.dtree-icon-jia:before { + content: "\e657"; +} +.dtree-icon-fenzhijigou:before { + content: "\e658"; +} +.dtree-icon-roundcheckfill:before { + content: "\e659"; +} +.dtree-icon-roundcheck:before { + content: "\e65a"; +} +.dtree-icon-roundclosefill:before { + content: "\e65b"; +} +.dtree-icon-roundclose:before { + content: "\e65c"; +} +.dtree-icon-roundrightfill:before { + content: "\e65d"; +} +.dtree-icon-roundright:before { + content: "\e65e"; +} +.dtree-icon-like:before { + content: "\e66c"; +} +.dtree-icon-samefill:before { + content: "\e671"; +} +.dtree-icon-same:before { + content: "\e672"; +} +.dtree-icon-evaluate:before { + content: "\e674"; +} +.dtree-icon-circle1:before { + content: "\e687"; +} +.dtree-icon-radio:before { + content: "\e688"; +} +.dtree-icon-caidan_xunzhang:before { + content: "\e68e"; +} +.dtree-icon-pulldown:before { + content: "\e6a0"; +} +.dtree-icon-pullup:before { + content: "\e6a1"; +} +.dtree-icon-refresh:before { + content: "\e6a4"; +} +.dtree-icon-qrcode1:before { + content: "\e6b0"; +} +.dtree-icon-profile1:before { + content: "\e6b7"; +} +.dtree-icon-home1:before { + content: "\e6b8"; +} +.dtree-icon-homefill:before { + content: "\e6bb"; +} +.dtree-icon-roundaddfill:before { + content: "\e6d8"; +} +.dtree-icon-roundadd:before { + content: "\e6d9"; +} +.dtree-icon-fuxuankuang:before { + content: "\e6f2"; +} +.dtree-icon-wefill:before { + content: "\e6f5"; +} +.dtree-icon-sort:before { + content: "\e701"; +} +.dtree-icon-repair:before { + content: "\e738"; +} +.dtree-icon-shujudaping:before { + content: "\e742"; +} +.dtree-icon-dian:before { + content: "\e7a5"; +} +.dtree-icon-search_list_light:before { + content: "\e807"; +} +.dtree-icon-round_list_light:before { + content: "\e82b"; +} +.dtree-icon-star-fill:before { + content: "\e832"; +} +.dtree-icon-rate:before { + content: "\e833"; +} +.dtree-icon-move-up:before { + content: "\ea47"; +} +.dtree-icon-move-down:before { + content: "\ea48"; +} diff --git a/static/component/pear/css/module/dtree/font/dtreefont.eot b/static/component/pear/css/module/dtree/font/dtreefont.eot new file mode 100644 index 000000000..68bf5f2f2 Binary files /dev/null and b/static/component/pear/css/module/dtree/font/dtreefont.eot differ diff --git a/static/component/pear/css/module/dtree/font/dtreefont.svg b/static/component/pear/css/module/dtree/font/dtreefont.svg new file mode 100644 index 000000000..90fe50f04 --- /dev/null +++ b/static/component/pear/css/module/dtree/font/dtreefont.svg @@ -0,0 +1,80 @@ + + + +Generated by IcoMoon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/component/pear/css/module/dtree/font/dtreefont.ttf b/static/component/pear/css/module/dtree/font/dtreefont.ttf new file mode 100644 index 000000000..78bacd13a Binary files /dev/null and b/static/component/pear/css/module/dtree/font/dtreefont.ttf differ diff --git a/static/component/pear/css/module/dtree/font/dtreefont.woff b/static/component/pear/css/module/dtree/font/dtreefont.woff new file mode 100644 index 000000000..2b5464507 Binary files /dev/null and b/static/component/pear/css/module/dtree/font/dtreefont.woff differ diff --git a/static/component/pear/css/module/dtree/font/icons.json b/static/component/pear/css/module/dtree/font/icons.json new file mode 100644 index 000000000..fca478856 --- /dev/null +++ b/static/component/pear/css/module/dtree/font/icons.json @@ -0,0 +1,283 @@ +{ + "data": [{ + "cls": "dtree-icon-xiangxia1", + "uncode": "e771" + }, + { + "cls": "dtree-icon-xiangyou", + "uncode": "e78f" + }, + { + "cls": "dtree-icon-jian", + "uncode": "e656" + }, + { + "cls": "dtree-icon-jia", + "uncode": "e657" + }, + { + "cls": "dtree-icon-weibiaoti5", + "uncode": "e618" + }, + { + "cls": "dtree-icon-wenjianjiazhankai", + "uncode": "e60e" + }, + { + "cls": "dtree-icon-dian", + "uncode": "e7a5" + }, + { + "cls": "dtree-icon-yonghu", + "uncode": "e603" + }, + { + "cls": "dtree-icon-fenzhijigou", + "uncode": "e658" + }, + { + "cls": "dtree-icon-fenguangbaobiao", + "uncode": "e655" + }, + { + "cls": "dtree-icon-xinxipilu", + "uncode": "e620" + }, + { + "cls": "dtree-icon-shuye1", + "uncode": "e61e" + }, + { + "cls": "dtree-icon-caidan_xunzhang", + "uncode": "e68e" + }, + { + "cls": "dtree-icon-normal-file", + "uncode": "e60c" + }, + { + "cls": "dtree-icon-roundclose", + "uncode": "e65c" + }, + { + "cls": "dtree-icon-bianji", + "uncode": "e602" + }, + { + "cls": "dtree-icon-roundadd", + "uncode": "e6d9" + }, + { + "cls": "dtree-icon-fuxuankuangxuanzhong", + "uncode": "e652" + }, + { + "cls": "dtree-icon-fuxuankuang", + "uncode": "e6f2" + }, + { + "cls": "dtree-icon-fuxuankuang-banxuan", + "uncode": "e607" + }, + { + "cls": "dtree-icon-search_list_light", + "uncode": "e807" + }, + { + "cls": "dtree-icon-move-up", + "uncode": "ea47" + }, + { + "cls": "dtree-icon-move-down", + "uncode": "ea48" + }, + { + "cls": "dtree-icon-delete1", + "uncode": "e640" + }, + { + "cls": "dtree-icon-refresh", + "uncode": "e6a4" + }, + { + "cls": "dtree-icon-roundcheckfill", + "uncode": "e659" + }, + { + "cls": "dtree-icon-roundclosefill", + "uncode": "e65b" + }, + { + "cls": "dtree-icon-roundcheck", + "uncode": "e65a" + }, + { + "cls": "dtree-icon-pulldown", + "uncode": "e6a0" + }, + { + "cls": "dtree-icon-pullup", + "uncode": "e6a1" + }, + { + "cls": "dtree-icon-set-sm", + "uncode": "e621" + }, + { + "cls": "dtree-icon-rate", + "uncode": "e833" + }, + { + "cls": "dtree-icon-jian1", + "uncode": "e600" + }, + { + "cls": "dtree-icon-jia1", + "uncode": "e601" + }, + { + "cls": "dtree-icon-shijian", + "uncode": "e606" + }, + { + "cls": "dtree-icon-check", + "uncode": "e645" + }, + { + "cls": "dtree-icon-close", + "uncode": "e646" + }, + { + "cls": "dtree-icon-favorfill", + "uncode": "e64b" + }, + { + "cls": "dtree-icon-favor", + "uncode": "e64c" + }, + { + "cls": "dtree-icon-roundrightfill", + "uncode": "e65d" + }, + { + "cls": "dtree-icon-roundright", + "uncode": "e65e" + }, + { + "cls": "dtree-icon-samefill", + "uncode": "e671" + }, + { + "cls": "dtree-icon-same", + "uncode": "e672" + }, + { + "cls": "dtree-icon-qrcode1", + "uncode": "e6b0" + }, + { + "cls": "dtree-icon-profile1", + "uncode": "e6b7" + }, + { + "cls": "dtree-icon-home1", + "uncode": "e6b8" + }, + { + "cls": "dtree-icon-homefill", + "uncode": "e6bb" + }, + { + "cls": "dtree-icon-roundaddfill", + "uncode": "e6d8" + }, + { + "cls": "dtree-icon-wefill", + "uncode": "e6f5" + }, + { + "cls": "dtree-icon-sort", + "uncode": "e701" + }, + { + "cls": "dtree-icon-round_list_light", + "uncode": "e82b" + }, + { + "cls": "dtree-icon-search2", + "uncode": "e615" + }, + { + "cls": "dtree-icon-close1", + "uncode": "1006" + }, + { + "cls": "dtree-icon-close-fill", + "uncode": "1007" + }, + { + "cls": "dtree-icon-chart-screen", + "uncode": "e62a" + }, + { + "cls": "dtree-icon-star", + "uncode": "e608" + }, + { + "cls": "dtree-icon-ok-circle", + "uncode": "1005" + }, + { + "cls": "dtree-icon-add-circle", + "uncode": "e61f" + }, + { + "cls": "dtree-icon-about", + "uncode": "e623" + }, + { + "cls": "dtree-icon-circle1", + "uncode": "e687" + }, + { + "cls": "dtree-icon-radio", + "uncode": "e688" + }, + { + "cls": "dtree-icon-star-fill", + "uncode": "e832" + }, + { + "cls": "dtree-icon-shujudaping", + "uncode": "e742" + }, + { + "cls": "dtree-icon-share3", + "uncode": "e641" + }, + { + "cls": "dtree-icon-youjian", + "uncode": "e642" + }, + { + "cls": "dtree-icon-repair", + "uncode": "e738" + }, + { + "cls": "dtree-icon-evaluate", + "uncode": "e674" + }, + { + "cls": "dtree-icon-like", + "uncode": "e66c" + }, + { + "cls": "dtree-icon-layim-theme", + "uncode": "e61b" + }, + { + "cls": "dtree-icon-xiangmuxiaoxi", + "uncode": "e60f" + } + ] +} \ No newline at end of file diff --git a/static/component/pear/css/module/form.css b/static/component/pear/css/module/form.css new file mode 100644 index 000000000..5aa5a58f1 --- /dev/null +++ b/static/component/pear/css/module/form.css @@ -0,0 +1,68 @@ +.layui-card-body .layui-form{ + margin-top: 15px; +} + +input::-webkit-input-placeholder, +textarea::-webkit-input-placeholder { + color: #ccc; +} + +.layui-input:hover, +.layui-textarea:hover, +.layui-input:focus, +.layui-textarea:focus { + border-color: #eee; +} + +.layui-input:focus, +.layui-textarea:focus { + border-color: #5FB878 !important; + box-shadow: 0 0 0 3px #f0f9eb !important; +} + +.layui-input[success] { + box-shadow: 0px 0px 0px 3px #f0f9eb !important; + border: #5FB878 1px solid!important; +} + +.layui-input[failure], +.layui-form-item .layui-form-danger:focus { + box-shadow: 0px 0px 0px 3px #fef0f0 !important; + border: #F56C6C 1px solid!important; +} + +.layui-input, +.layui-select, +.layui-textarea { + border-radius: 4px; + border-color: #eee; + transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; +} + +.layui-form-select dl::-webkit-scrollbar { + width: 0px; + height: 0px; +} + +.layui-form-select dl::-webkit-scrollbar { + width: 6px; + height: 6px; +} + +.layui-form-select dl::-webkit-scrollbar-track { + background: white; + border-radius: 3px; +} + +.layui-form-select dl::-webkit-scrollbar-thumb { + background: #E6E6E6; + border-radius: 3px; +} + +.layui-form-select dl::-webkit-scrollbar-thumb:hover { + background: #E6E6E6; +} + +.layui-form-select dl::-webkit-scrollbar-corner { + background: #f6f6f6; +} \ No newline at end of file diff --git a/static/component/pear/css/module/frame.css b/static/component/pear/css/module/frame.css new file mode 100644 index 000000000..09a1423f2 --- /dev/null +++ b/static/component/pear/css/module/frame.css @@ -0,0 +1,158 @@ +.pear-frame { + width: 100%; + height: 100%; + position: relative; + overflow: hidden; +} + +.pear-frame .dot { + width: 5px; + height: 24px; + background-color: #5FB878; + margin-top: 8px; + margin-left: 15px; + border-radius: 2px; + display: inline-block; +} + +.pear-frame .title { + position: absolute; + margin-top: 0px; + margin-left: 12px; + color: dimgray; + display: inline-block; + letter-spacing: 2px; +} + +.pear-frame .pear-frame-title { + height: 40px; + line-height: 40px; + background-color: white; + border: whitesmoke 1px solid; +} + +.pear-frame .pear-frame-content { + width: 100%; + height: calc(100% - 0px) !important; +} + +.pear-frame-loading { + position: absolute; + display: none; + width: 100%; + height: calc(100% - 0px) !important; + top: 0px; + z-index: 19; + background-color: #fff +} + +.pear-frame-loading.close { + animation: close 1s; + -webkit-animation: close 1s; + animation-fill-mode: forwards; +} + +.ball-loader { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + -webkit-transform: translate(-50%, -50%) +} + +.ball-loader>span, +.signal-loader>span { + background-color: #4aca85; + display: inline-block +} + +.ball-loader>span:nth-child(1), +.ball-loader.sm>span:nth-child(1), +.signal-loader>span:nth-child(1), +.signal-loader.sm>span:nth-child(1) { + -webkit-animation-delay: 0s; + animation-delay: 0s +} + +.ball-loader>span:nth-child(2), +.ball-loader.sm>span:nth-child(2), +.signal-loader>span:nth-child(2), +.signal-loader.sm>span:nth-child(2) { + -webkit-animation-delay: .1s; + animation-delay: .1s +} + +.ball-loader>span:nth-child(3), +.ball-loader.sm>span:nth-child(3), +.signal-loader>span:nth-child(3), +.signal-loader.sm>span:nth-child(3) { + -webkit-animation-delay: .15s; + animation-delay: .15s +} + +.ball-loader>span:nth-child(4), +.ball-loader.sm>span:nth-child(4), +.signal-loader>span:nth-child(4), +.signal-loader.sm>span:nth-child(4) { + -webkit-animation-delay: .2s; + animation-delay: .2s +} + +.ball-loader>span { + width: 20px; + height: 20px; + margin: 0 3px; + border-radius: 50%; + transform: scale(0); + -ms-transform: scale(0); + -webkit-transform: scale(0); + animation: ball-load 1s ease-in-out infinite; + -webkit-animation: 1s ball-load ease-in-out infinite +} + +@-webkit-keyframes ball-load { + 0% { + transform: scale(0); + -webkit-transform: scale(0) + } + + 50% { + transform: scale(1); + -webkit-transform: scale(1) + } + + 100% { + transform: scale(0); + -webkit-transform: scale(0) + } +} + +@keyframes ball-load { + 0% { + transform: scale(0); + -webkit-transform: scale(0) + } + + 50% { + transform: scale(1); + -webkit-transform: scale(1) + } + + 100% { + transform: scale(0); + -webkit-transform: scale(0) + } +} + +@-webkit-keyframes close { + 0% { + opacity: 1; + /*display: block;*/ + } + + 100% { + opacity: 0; + /*display: none;*/ + } +} diff --git a/static/component/pear/css/module/label.css b/static/component/pear/css/module/label.css new file mode 100644 index 000000000..e69de29bb diff --git a/static/component/pear/css/module/layer.css b/static/component/pear/css/module/layer.css new file mode 100644 index 000000000..afb8e4bbb --- /dev/null +++ b/static/component/pear/css/module/layer.css @@ -0,0 +1,4 @@ +.layui-layer-msg{ + border-color: transparent!important; + box-shadow: 2px 0 6px rgb(0 21 41 / 0.05)!important; +} \ No newline at end of file diff --git a/static/component/pear/css/module/layout.css b/static/component/pear/css/module/layout.css new file mode 100644 index 000000000..beceeeac7 --- /dev/null +++ b/static/component/pear/css/module/layout.css @@ -0,0 +1,1040 @@ +.pear-container { + margin: 10px; + background-color: whitesmoke; +} + +body::-webkit-scrollbar { + width: 0px; + height: 0px; +} + +body::-webkit-scrollbar { + width: 6px; + height: 6px; +} + +body::-webkit-scrollbar-track { + background: white; + border-radius: 2px; +} + +body::-webkit-scrollbar-thumb { + background: #E6E6E6; + border-radius: 2px; +} + +body::-webkit-scrollbar-thumb:hover { + background: #E6E6E6; +} + +body::-webkit-scrollbar-corner { + background: #f6f6f6; +} + +.mainBox::-webkit-scrollbar { + width: 0px; + height: 0px; +} + +.mainBox::-webkit-scrollbar { + width: 6px; + height: 6px; +} + +.mainBox::-webkit-scrollbar-track { + background: white; + border-radius: 2px; +} + +.mainBox::-webkit-scrollbar-thumb { + background: #E6E6E6; + border-radius: 2px; +} + +.mainBox::-webkit-scrollbar-thumb:hover { + background: #E6E6E6; +} + +.mainBox::-webkit-scrollbar-corner { + background: #f6f6f6; +} + +.mainBox { + width: 100%; + position: absolute; + top: 0px; + left: 0px; + bottom: 50px; + overflow: auto; +} + +.bottom { + width: 100%; + position: absolute; + bottom: 0px; + left: 0px; + height: 50px; + line-height: 50px; + background-color: #F8F8F8; + border-top: 1px solid #eee; +} + +.button-container { + position: absolute; + right: 15px; +} + +.main-container { + margin: 15px; +} + +.main-container .layui-form-item { + margin-bottom: 15px !important; + margin-top: 10px !important; +} + +.pear-row::before, +.pear-row::after { + content: ""; + display: table; + clear: both; +} + +.pear-col { + float: left; + min-height: 1px; +} + +.pear-row * { + box-sizing: border-box +} + +.pear-col-md1 { + width: 4.16%; +} + +.pear-col-md2 { + width: 8.33%; +} + +.pear-col-md3 { + width: 12.5%; +} + +.pear-col-md4 { + width: 16.66%; +} + +.pear-col-md5 { + width: 20.83%; +} + +.pear-col-md6 { + width: 25%; +} + +.pear-col-md7 { + width: 29.16%; +} + +.pear-col-md8 { + width: 33.33%; +} + +.pear-col-md9 { + width: 37.5%; +} + +.pear-col-md10 { + width: 41.66%; +} + +.pear-col-md11 { + width: 45.83%; +} + +.pear-col-md12 { + width: 50%; +} + +.pear-col-md13 { + width: 54.16%; +} + +.pear-col-md14 { + width: 58.33%; +} + +.pear-col-md15 { + width: 62.5%; +} + +.pear-col-md16 { + width: 66.66%; +} + +.pear-col-md17 { + width: 70.83%; +} + +.pear-col-md18 { + width: 75%; +} + +.pear-col-md19 { + width: 79.16%; +} + +.pear-col-md20 { + width: 83.33%; +} + +.pear-col-md21 { + width: 87.5%; +} + +.pear-col-md22 { + width: 91.66%; +} + +.pear-col-md23 { + width: 95.83%; +} + +.pear-col-md24 { + width: 100%; +} + +@media all and (min-width:993px) and (max-width:1199px) { + + .pear-col-md-offset1 { + margin-left: 4.16%; + } + + .pear-col-md-offset2 { + margin-left: 8.33%; + } + + .pear-col-md-offset3 { + margin-left: 12.5%; + } + + .pear-col-md-offset4 { + margin-left: 16.66%; + } + + .pear-col-md-offset5 { + margin-left: 20.83%; + } + + .pear-col-md-offset6 { + margin-left: 25%; + } + + .pear-col-md-offset7 { + margin-left: 29.16%; + } + + .pear-col-md-offset8 { + margin-left: 33.33%; + } + + .pear-col-md-offset9 { + margin-left: 37.5%; + } + + .pear-col-md-offset10 { + margin-left: 41.66%; + } + + .pear-col-md-offset11 { + margin-left: 45.83%; + } + + .pear-col-md-offset12 { + margin-left: 50%; + } + + .pear-col-md-offset13 { + margin-left: 54.16%; + } + + .pear-col-md-offset14 { + margin-left: 58.33%; + } + + .pear-col-md-offset15 { + margin-left: 62.5%; + } + + .pear-col-md-offset16 { + margin-left: 66.66%; + } + + .pear-col-md-offset17 { + margin-left: 70.83%; + } + + .pear-col-md-offset18 { + margin-left: 75%; + } + + .pear-col-md-offset19 { + margin-left: 79.16%; + } + + .pear-col-md-offset20 { + margin-left: 83.33%; + } + + .pear-col-md-offset21 { + margin-left: 87.5%; + } + + .pear-col-md-offset22 { + margin-left: 91.66%; + } + + .pear-col-md-offset23 { + margin-left: 95.83%; + } + + .pear-col-md-offset24 { + margin-left: 100%; + } +} + + +@media all and (max-width:768px) { + .pear-col-xs1 { + width: 4.16%; + } + + .pear-col-xs2 { + width: 8.33%; + } + + .pear-col-xs3 { + width: 12.5%; + } + + .pear-col-xs4 { + width: 16.66%; + } + + .pear-col-xs5 { + width: 20.83%; + } + + .pear-col-xs6 { + width: 25%; + } + + .pear-col-xs7 { + width: 29.16%; + } + + .pear-col-xs8 { + width: 33.33%; + } + + .pear-col-xs9 { + width: 37.5%; + } + + .pear-col-xs10 { + width: 41.66%; + } + + .pear-col-xs11 { + width: 45.83%; + } + + .pear-col-xs12 { + width: 50%; + } + + .pear-col-xs13 { + width: 54.16%; + } + + .pear-col-xs14 { + width: 58.33%; + } + + .pear-col-xs15 { + width: 62.5%; + } + + .pear-col-xs16 { + width: 66.66%; + } + + .pear-col-xs17 { + width: 70.83%; + } + + .pear-col-xs18 { + width: 75%; + } + + .pear-col-xs19 { + width: 79.16%; + } + + .pear-col-xs20 { + width: 83.33%; + } + + .pear-col-xs21 { + width: 87.5%; + } + + .pear-col-xs22 { + width: 91.66%; + } + + .pear-col-xs23 { + width: 95.83%; + } + + .pear-col-xs24 { + width: 100%; + } + + .pear-col-xs-offset1 { + margin-left: 4.16%; + } + + .pear-col-xs-offset2 { + margin-left: 8.33%; + } + + .pear-col-xs-offset3 { + margin-left: 12.5%; + } + + .pear-col-xs-offset4 { + margin-left: 16.66%; + } + + .pear-col-xs-offset5 { + margin-left: 20.83%; + } + + .pear-col-xs-offset6 { + margin-left: 25%; + } + + .pear-col-xs-offset7 { + margin-left: 29.16%; + } + + .pear-col-xs-offset8 { + margin-left: 33.33%; + } + + .pear-col-xs-offset9 { + margin-left: 37.5%; + } + + .pear-col-xs-offset10 { + margin-left: 41.66%; + } + + .pear-col-xs-offset11 { + margin-left: 45.83%; + } + + .pear-col-xs-offset12 { + margin-left: 50%; + } + + .pear-col-xs-offset13 { + margin-left: 54.16%; + } + + .pear-col-xs-offset14 { + margin-left: 58.33%; + } + + .pear-col-xs-offset15 { + margin-left: 62.5%; + } + + .pear-col-xs-offset16 { + margin-left: 66.66%; + } + + .pear-col-xs-offset17 { + margin-left: 70.83%; + } + + .pear-col-xs-offset18 { + margin-left: 75%; + } + + .pear-col-xs-offset19 { + margin-left: 79.16%; + } + + .pear-col-xs-offset20 { + margin-left: 83.33%; + } + + .pear-col-xs-offset21 { + margin-left: 87.5%; + } + + .pear-col-xs-offset22 { + margin-left: 91.66%; + } + + .pear-col-xs-offset23 { + margin-left: 95.83%; + } + + .pear-col-xs-offset24 { + margin-left: 100%; + } +} + +@media all and (min-width:768px) and (max-width:992px) { + .pear-col-sm1 { + width: 4.16%; + } + + .pear-col-sm2 { + width: 8.33%; + } + + .pear-col-sm3 { + width: 12.5%; + } + + .pear-col-sm4 { + width: 16.66%; + } + + .pear-col-sm5 { + width: 20.83%; + } + + .pear-col-sm6 { + width: 25%; + } + + .pear-col-sm7 { + width: 29.16%; + } + + .pear-col-sm8 { + width: 33.33%; + } + + .pear-col-sm9 { + width: 37.5%; + } + + .pear-col-sm10 { + width: 41.66%; + } + + .pear-col-sm11 { + width: 45.83%; + } + + .pear-col-sm12 { + width: 50%; + } + + .pear-col-sm13 { + width: 54.16%; + } + + .pear-col-sm14 { + width: 58.33%; + } + + .pear-col-sm15 { + width: 62.5%; + } + + .pear-col-sm16 { + width: 66.66%; + } + + .pear-col-sm17 { + width: 70.83%; + } + + .pear-col-sm18 { + width: 75%; + } + + .pear-col-sm19 { + width: 79.16%; + } + + .pear-col-sm20 { + width: 83.33%; + } + + .pear-col-sm21 { + width: 87.5%; + } + + .pear-col-sm22 { + width: 91.66%; + } + + .pear-col-sm23 { + width: 95.83%; + } + + .pear-col-sm24 { + width: 100%; + } + + .pear-col-sm-offset1 { + margin-left: 4.16%; + } + + .pear-col-sm-offset2 { + margin-left: 8.33%; + } + + .pear-col-sm-offset3 { + margin-left: 12.5%; + } + + .pear-col-sm-offset4 { + margin-left: 16.66%; + } + + .pear-col-sm-offset5 { + margin-left: 20.83%; + } + + .pear-col-sm-offset6 { + margin-left: 25%; + } + + .pear-col-sm-offset7 { + margin-left: 29.16%; + } + + .pear-col-sm-offset8 { + margin-left: 33.33%; + } + + .pear-col-sm-offset9 { + margin-left: 37.5%; + } + + .pear-col-sm-offset10 { + margin-left: 41.66%; + } + + .pear-col-sm-offset11 { + margin-left: 45.83%; + } + + .pear-col-sm-offset12 { + margin-left: 50%; + } + + .pear-col-sm-offset13 { + margin-left: 54.16%; + } + + .pear-col-sm-offset14 { + margin-left: 58.33%; + } + + .pear-col-sm-offset15 { + margin-left: 62.5%; + } + + .pear-col-sm-offset16 { + margin-left: 66.66%; + } + + .pear-col-sm-offset17 { + margin-left: 70.83%; + } + + .pear-col-sm-offset18 { + margin-left: 75%; + } + + .pear-col-sm-offset19 { + margin-left: 79.16%; + } + + .pear-col-sm-offset20 { + margin-left: 83.33%; + } + + .pear-col-sm-offset21 { + margin-left: 87.5%; + } + + .pear-col-sm-offset22 { + margin-left: 91.66%; + } + + .pear-col-sm-offset23 { + margin-left: 95.83%; + } + + .pear-col-sm-offset24 { + margin-left: 100%; + } +} + +@media all and (min-width:1200px) { + .pear-col-lg1 { + width: 4.16%; + } + + .pear-col-lg2 { + width: 8.33%; + } + + .pear-col-lg3 { + width: 12.5%; + } + + .pear-col-lg4 { + width: 16.66%; + } + + .pear-col-lg5 { + width: 20.83%; + } + + .pear-col-lg6 { + width: 25%; + } + + .pear-col-lg7 { + width: 29.16%; + } + + .pear-col-lg8 { + width: 33.33%; + } + + .pear-col-lg9 { + width: 37.5%; + } + + .pear-col-lg10 { + width: 41.66%; + } + + .pear-col-lg11 { + width: 45.83%; + } + + .pear-col-lg12 { + width: 50%; + } + + .pear-col-lg13 { + width: 54.16%; + } + + .pear-col-lg14 { + width: 58.33%; + } + + .pear-col-lg15 { + width: 62.5%; + } + + .pear-col-lg16 { + width: 66.66%; + } + + .pear-col-lg17 { + width: 70.83%; + } + + .pear-col-lg18 { + width: 75%; + } + + .pear-col-lg19 { + width: 79.16%; + } + + .pear-col-lg20 { + width: 83.33%; + } + + .pear-col-lg21 { + width: 87.5%; + } + + .pear-col-lg22 { + width: 91.66%; + } + + .pear-col-lg23 { + width: 95.83%; + } + + .pear-col-lg24 { + width: 100%; + } + + .pear-col-lg-offset1 { + margin-left: 4.16%; + } + + .pear-col-lg-offset2 { + margin-left: 8.33%; + } + + .pear-col-lg-offset3 { + margin-left: 12.5%; + } + + .pear-col-lg-offset4 { + margin-left: 16.66%; + } + + .pear-col-lg-offset5 { + margin-left: 20.83%; + } + + .pear-col-lg-offset6 { + margin-left: 25%; + } + + .pear-col-lg-offset7 { + margin-left: 29.16%; + } + + .pear-col-lg-offset8 { + margin-left: 33.33%; + } + + .pear-col-lg-offset9 { + margin-left: 37.5%; + } + + .pear-col-lg-offset10 { + margin-left: 41.66%; + } + + .pear-col-lg-offset11 { + margin-left: 45.83%; + } + + .pear-col-lg-offset12 { + margin-left: 50%; + } + + .pear-col-lg-offset13 { + margin-left: 54.16%; + } + + .pear-col-lg-offset14 { + margin-left: 58.33%; + } + + .pear-col-lg-offset15 { + margin-left: 62.5%; + } + + .pear-col-lg-offset16 { + margin-left: 66.66%; + } + + .pear-col-lg-offset17 { + margin-left: 70.83%; + } + + .pear-col-lg-offset18 { + margin-left: 75%; + } + + .pear-col-lg-offset19 { + margin-left: 79.16%; + } + + .pear-col-lg-offset20 { + margin-left: 83.33%; + } + + .pear-col-lg-offset21 { + margin-left: 87.5%; + } + + .pear-col-lg-offset22 { + margin-left: 91.66%; + } + + .pear-col-lg-offset23 { + margin-left: 95.83%; + } + + .pear-col-lg-offset24 { + margin-left: 100%; + } +} + +.pear-col-space1 { + margin: -.5px +} + +.pear-col-space1>* { + padding: .5px +} + +.pear-col-space2 { + margin: -1px +} + +.pear-col-space2>* { + padding: 1px +} + +.pear-col-space4 { + margin: -2px +} + +.pear-col-space4>* { + padding: 2px +} + +.pear-col-space5 { + margin: -2.5px +} + +.pear-col-space5>* { + padding: 2.5px +} + +.pear-col-space6 { + margin: -3px +} + +.pear-col-space6>* { + padding: 3px +} + +.pear-col-space8 { + margin: -4px +} + +.pear-col-space8>* { + padding: 4px +} + +.pear-col-space10 { + margin: -5px +} + +.pear-col-space10>* { + padding: 5px +} + +.pear-col-space12 { + margin: -6px +} + +.pear-col-space12>* { + padding: 6px +} + +.pear-col-space14 { + margin: -7px +} + +.pear-col-space14>* { + padding: 7px +} + +.pear-col-space15 { + margin: -7.5px +} + +.pear-col-space15>* { + padding: 7.5px +} + +.pear-col-space16 { + margin: -8px +} + +.pear-col-space16>* { + padding: 8px +} + +.pear-col-space18 { + margin: -9px +} + +.pear-col-space18>* { + padding: 9px +} + +.pear-col-space20 { + margin: -10px +} + +.pear-col-space20>* { + padding: 10px +} + +.pear-col-space22 { + margin: -11px +} + +.pear-col-space22>* { + padding: 11px +} + +.pear-col-space24 { + margin: -12px +} + +.pear-col-space24>* { + padding: 12px +} + +.pear-col-space25 { + margin: -12.5px +} + +.pear-col-space25>* { + padding: 12.5px +} + +.pear-col-space26 { + margin: -13px +} + +.pear-col-space26>* { + padding: 13px +} + +.pear-col-space28 { + margin: -14px +} + +.pear-col-space28>* { + padding: 14px +} + +.pear-col-space30 { + margin: -15px +} + +.pear-col-space30>* { + padding: 15px +} diff --git a/static/component/pear/css/module/link.css b/static/component/pear/css/module/link.css new file mode 100644 index 000000000..380351c5f --- /dev/null +++ b/static/component/pear/css/module/link.css @@ -0,0 +1,20 @@ +.pear-link{ + font-size: 15px!important; +} + +.pear-link.pear-link-primary{ + color : #5FB878 ; +} + +.pear-link.pear-link-success{ + color : #5FB878 ; +} + +.pear-link .pear-link-warming{ + + +} + +.pear-link .pear-link-danger{ + +} \ No newline at end of file diff --git a/static/component/pear/css/module/loading.css b/static/component/pear/css/module/loading.css new file mode 100644 index 000000000..4abb57d3d --- /dev/null +++ b/static/component/pear/css/module/loading.css @@ -0,0 +1,987 @@ +/*! +* Notiflix ('https://www.notiflix.com') +* Version: 2.0.0 +* Author: Furkan MT ('https://github.com/furcan') +* Copyright 2020 Notiflix, MIT Licence ('https://opensource.org/licenses/MIT') +*/ + +/* Notiflix: Notify wrap on */ +[id^=NotiflixNotifyWrap] { +position: fixed; +z-index:4001; +opacity:1; +right: 10px; +top: 10px; +width: 280px; +max-width:96%; +box-sizing:border-box; +background: transparent;} + +[id^=NotiflixNotifyWrap] * { +box-sizing:border-box;} +/* Notiflix: Notify wrap off */ + +/* Notiflix: Notify content on */ +[id^=NotiflixNotifyWrap] > div { +-webkit-user-select: none; +-moz-user-select: none; +-ms-user-select: none; +user-select: none; +font-family: 'Quicksand', sans-serif; +width:100%; +display: inline-block; +position:relative; +margin:0 0 10px; +border-radius:5px; +background: #1e1e1e; +color: #fff; +padding: 10px 12px; +font-size: 14px; +line-height: 1.4;} + +[id^=NotiflixNotifyWrap] > div:last-child { +margin:0;} + +[id^=NotiflixNotifyWrap] > div.with-callback { +cursor:pointer;} + +[id^=NotiflixNotifyWrap] *::selection { +background:inherit;} + +[id^=NotiflixNotifyWrap] > div.with-icon { +padding: 8px;} + +[id^=NotiflixNotifyWrap] > div.click-to-close { +cursor: pointer;} + +[id^=NotiflixNotifyWrap] > div.with-close-button { +padding: 10px 30px 10px 12px;} +[id^=NotiflixNotifyWrap] > div.with-icon.with-close-button { +padding: 6px 30px 6px 6px;} + +[id^=NotiflixNotifyWrap] > div > span.the-message { +font-weight: 500; +font-family:inherit !important; +word-break: break-all; +word-break: break-word;} + +[id^=NotiflixNotifyWrap] > div > span.notify-close-button { +cursor:pointer; +transition:all .2s ease-in-out; +position: absolute; +right: 8px; +top: 0; +bottom:0; +margin:auto; +color:inherit; +width: 16px; +height: 16px;} +[id^=NotiflixNotifyWrap] > div > span.notify-close-button:hover { +transform:rotate(90deg);} +[id^=NotiflixNotifyWrap] > div > span.notify-close-button > svg { +position: absolute; +width: 16px; +height: 16px; +right: 0; +top: 0;} +/* Notiflix: Notify content off */ + +/* Notiflix: Notify icon on */ +[id^=NotiflixNotifyWrap] > div > .nmi { +position: absolute; +width: 40px; +height: 40px; +font-size: 30px; +line-height: 40px; +text-align: center; +left: 8px; +top: 0; +bottom: 0; +margin: auto; +border-radius: inherit;} + +[id^=NotiflixNotifyWrap] > div > .wfa.shadow { +color: inherit; +background: rgba(0, 0, 0, 0.15); +box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.2); +text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);} + +[id^=NotiflixNotifyWrap] > div > span.with-icon { +position: relative; +float: left; +width: calc(100% - 40px); +margin:0 0 0 40px; +padding:0 0 0 10px; +box-sizing: border-box;} +/* Notiflix: Notify icon off */ + +/* Notiflix: Notify rtl on */ +[id^=NotiflixNotifyWrap] > div.rtl-on > .nmi { +left:auto; +right:8px;} + +[id^=NotiflixNotifyWrap] > div.rtl-on > span.with-icon { +padding:0 10px 0 0; +margin:0 40px 0 0;} + +[id^=NotiflixNotifyWrap] > div.rtl-on > span.notify-close-button { +right: auto; +left: 8px;} + +[id^=NotiflixNotifyWrap] > div.with-icon.with-close-button.rtl-on { +padding: 6px 6px 6px 30px;} + +[id^=NotiflixNotifyWrap] > div.with-close-button.rtl-on { +padding: 10px 12px 10px 30px;} +/* Notiflix: Notify rtl off */ + +/* Notiflix: Notify animation => fade on */ +[id^=NotiflixNotifyOverlay].with-animation, +[id^=NotiflixNotifyWrap] > div.with-animation.nx-fade { +animation: notify-animation-fade .3s ease-in-out 0s normal; +-webkit-animation: notify-animation-fade .3s ease-in-out 0s normal;} + +@keyframes notify-animation-fade { +0% {opacity:0;} +100% {opacity:1;} +} + +@-webkit-keyframes notify-animation-fade { +0% {opacity:0;} +100% {opacity:1;} +} +/* Notiflix: Notify animation => fade off */ + +/* Notiflix: Notify animation => zoom on */ +[id^=NotiflixNotifyWrap] > div.with-animation.nx-zoom { +animation: notify-animation-zoom .3s ease-in-out 0s normal; +-webkit-animation: notify-animation-zoom .3s ease-in-out 0s normal;} + +@keyframes notify-animation-zoom { +0% {transform:scale(0);} +50% {transform:scale(1.05);} +100% {transform:scale(1);} +} + +@-webkit-keyframes notify-animation-zoom { +0% {transform:scale(0);} +50% {transform:scale(1.05);} +100% {transform:scale(1);} +} +/* Notiflix: Notify animation => zoom off */ + +/* Notiflix: Notify animation => from right on */ +[id^=NotiflixNotifyWrap] > div.with-animation.nx-from-right { +animation: notify-animation-from-right .3s ease-in-out 0s normal; +-webkit-animation: notify-animation-from-right .3s ease-in-out 0s normal;} + +@keyframes notify-animation-from-right { +0% {right:-300px; opacity:0;} +50% {right:8px; opacity:1;} +100% {right:0px; opacity:1;} +} + +@-webkit-keyframes notify-animation-from-right { +0% {right:-300px; opacity:0;} +50% {right:8px; opacity:1;} +100% {right:0px; opacity:1;} +} +/* Notiflix: Notify animation => from right off */ + +/* Notiflix: Notify animation => from left on */ +[id^=NotiflixNotifyWrap] > div.with-animation.nx-from-left { +animation: notify-animation-from-left .3s ease-in-out 0s normal; +-webkit-animation: notify-animation-from-left .3s ease-in-out 0s normal;} + +@keyframes notify-animation-from-left { +0% {left:-300px; opacity:0;} +50% {left:8px; opacity:1;} +100% {left:0px; opacity:1;} +} + +@-webkit-keyframes notify-animation-from-left { +0% {left:-300px; opacity:0;} +50% {left:8px; opacity:1;} +100% {left:0px; opacity:1;} +} +/* Notiflix: Notify animation => from left off */ + +/* Notiflix: Notify animation => from top on */ +[id^=NotiflixNotifyWrap] > div.with-animation.nx-from-top { +animation: notify-animation-from-top .3s ease-in-out 0s normal; +-webkit-animation: notify-animation-from-top .3s ease-in-out 0s normal;} + +@keyframes notify-animation-from-top { +0% {top:-50px; opacity:0;} +50% {top:8px; opacity:1;} +100% {top:0px; opacity:1;} +} + +@-webkit-keyframes notify-animation-from-top { +0% {top:-50px; opacity:0;} +50% {top:8px; opacity:1;} +100% {top:0px; opacity:1;} +} +/* Notiflix: Notify animation => from top off */ + +/* Notiflix: Notify animation => from bottom on */ +[id^=NotiflixNotifyWrap] > div.with-animation.nx-from-bottom { +animation: notify-animation-from-bottom .3s ease-in-out 0s normal; +-webkit-animation: notify-animation-from-bottom .3s ease-in-out 0s normal;} + +@keyframes notify-animation-from-bottom { +0% {bottom:-50px; opacity:0;} +50% {bottom:8px; opacity:1;} +100% {bottom:0px; opacity:1;} +} + +@-webkit-keyframes notify-animation-from-bottom { +0% {bottom:-50px; opacity:0;} +50% {bottom:8px; opacity:1;} +100% {bottom:0px; opacity:1;} +} +/* Notiflix: Notify animation => from bottom off */ + +/* Notiflix: Notify animation remove => fade on */ +[id^=NotiflixNotifyOverlay].with-animation.remove, +[id^=NotiflixNotifyWrap] > div.with-animation.nx-fade.remove { +opacity:0; +animation: notify-remove-fade .3s ease-in-out 0s normal; +-webkit-animation: notify-remove-fade .3s ease-in-out 0s normal;} + +@keyframes notify-remove-fade { +0% {opacity:1;} +100% {opacity:0;} +} + +@-webkit-keyframes notify-remove-fade { +0% {opacity:1;} +100% {opacity:0;} +} +/* Notiflix: Notify animation remove => fade off */ + +/* Notiflix: Notify animation remove => zoom on */ +[id^=NotiflixNotifyWrap] > div.with-animation.nx-zoom.remove { +transform:scale(0); +animation: notify-remove-zoom .3s ease-in-out 0s normal; +-webkit-animation: notify-remove-zoom .3s ease-in-out 0s normal;} + +@keyframes notify-remove-zoom { +0% {transform:scale(1);} +50% {transform:scale(1.05);} +100% {transform:scale(0);} +} + +@-webkit-keyframes notify-remove-zoom { +0% {transform:scale(1);} +50% {transform:scale(1.05);} +100% {transform:scale(0);} +} +/* Notiflix: Notify animation remove => zoom off */ + +/* Notiflix: Notify animation remove => from top on */ +[id^=NotiflixNotifyWrap] > div.with-animation.nx-from-top.remove { +opacity:0; +animation: notify-remove-to-top .3s ease-in-out 0s normal; +-webkit-animation: notify-remove-to-top .3s ease-in-out 0s normal;} + +@keyframes notify-remove-to-top { +0% {top:0px; opacity:1;} +50% {top:8px; opacity:1;} +100% {top:-50px; opacity:0;} +} + +@-webkit-keyframes notify-remove-to-top { +0% {top:0px; opacity:1;} +50% {top:8px; opacity:1;} +100% {top:-50px; opacity:0;} +} +/* Notiflix: Notify animation remove => from top off */ + +/* Notiflix: Notify animation remove => from right on */ +[id^=NotiflixNotifyWrap] > div.with-animation.nx-from-right.remove { +opacity:0; +animation: notify-remove-to-right .3s ease-in-out 0s normal; +-webkit-animation: notify-remove-to-right .3s ease-in-out 0s normal;} + +@keyframes notify-remove-to-right { +0% {right:0px; opacity:1;} +50% {right:8px; opacity:1;} +100% {right:-300px; opacity:0;} +} + +@-webkit-keyframes notify-remove-to-right { +0% {right:0px; opacity:1;} +50% {right:8px; opacity:1;} +100% {right:-300px; opacity:0;} +} +/* Notiflix: Notify animation remove => from right off */ + +/* Notiflix: Notify animation remove => from bottom on */ +[id^=NotiflixNotifyWrap] > div.with-animation.nx-from-bottom.remove { +opacity:0; +animation: notify-remove-to-bottom .3s ease-in-out 0s normal; +-webkit-animation: notify-remove-to-bottom .3s ease-in-out 0s normal;} + +@keyframes notify-remove-to-bottom { +0% {bottom:0px; opacity:1;} +50% {bottom:8px; opacity:1;} +100% {bottom:-50px; opacity:0;} +} + +@-webkit-keyframes notify-remove-to-bottom { +0% {bottom:0px; opacity:1;} +50% {bottom:8px; opacity:1;} +100% {bottom:-50px; opacity:0;} +} +/* Notiflix: Notify animation remove => from bottom off */ + +/* Notiflix: Notify animation remove => from left on */ +[id^=NotiflixNotifyWrap] > div.with-animation.nx-from-left.remove { +opacity:0; +animation: notify-remove-to-left .3s ease-in-out 0s normal; +-webkit-animation: notify-remove-to-left .3s ease-in-out 0s normal;} + +@keyframes notify-remove-to-left { +0% {left:0px; opacity:1;} +50% {left:8px; opacity:1;} +100% {left:-300px; opacity:0;} +} + +@-webkit-keyframes notify-remove-to-left { +0% {left:0px; opacity:1;} +50% {left:8px; opacity:1;} +100% {left:-300px; opacity:0;} +} +/* Notiflix: Notify animation remove => from left off */ + + +/* Notiflix: Report wrap on */ +[id^=NotiflixReportWrap] { +position: fixed; +z-index:4002; +width: 320px; +max-width:96%; +box-sizing:border-box; +font-family: "Quicksand", sans-serif; +left: 0; +right: 0; +top: 20px; +color:#1e1e1e; +border-radius: 25px; +background: transparent; +margin: auto;} + +[id^=NotiflixReportWrap] * { +box-sizing:border-box;} +/* Notiflix: Report wrap off */ + +/* Notiflix: Report content on */ +[id^=NotiflixReportWrap] > div[class*="-overlay"] { +width:100%; +height:100%; +left:0; +top:0; +background: rgba(255, 255, 255, .5); +position:fixed; +z-index:0;} + +[id^=NotiflixReportWrap] > div[class*="-content"] { +width:100%; +float:left; +border-radius: inherit; +padding:10px; +filter: drop-shadow(0 0 5px rgba(0,0,0,.1)); +border: 1px solid rgba(0,0,0,.03); +background: #f8f8f8; +position:relative; +z-index:1;} + +[id^=NotiflixReportWrap] > div[class*="-content"] > div[class$="-icon"] { +-webkit-user-select: none; +-moz-user-select: none; +-ms-user-select: none; +user-select: none; +width:110px; +height:110px; +display:block; +margin:6px auto 12px;} + +[id^=NotiflixReportWrap] > div[class*="-content"] > div[class$="-icon"] svg { +min-width:100%; +max-width:100%; +height:auto;} + +[id^=NotiflixReportWrap] > * > h5 { +word-break: break-all; +word-break: break-word; +font-family:inherit !important; +font-size:16px; +font-weight:500; +line-height: 1.4; +margin: 0 0 10px; +padding: 0 0 10px; +border-bottom: 1px solid rgba(0, 0, 0, 0.1); +float: left; +width: 100%; +text-align: center;} + +[id^=NotiflixReportWrap] > * > p { +word-break: break-all; +word-break: break-word; +font-family:inherit !important; +font-size:13px; +line-height: 1.4; +float: left; +width: 100%; +padding:0 10px; +margin: 0 0 10px;} + +[id^=NotiflixReportWrap] a#NXReportButton { +word-break: break-all; +word-break: break-word; +-webkit-user-select: none; +-moz-user-select: none; +-ms-user-select: none; +user-select: none; +font-family:inherit !important; +transition:all .25s ease-in-out; +cursor:pointer; +float: right; +padding: 7px 17px; +background: #32c682; +font-size:14px; +line-height: 1.4; +font-weight: 500; +border-radius: inherit !important; +color: #fff;} + +[id^=NotiflixReportWrap] a#NXReportButton:hover { +box-shadow:inset 0 -60px 5px -5px rgba(0, 0, 0, 0.25);} + +[id^=NotiflixReportWrap].rtl-on a#NXReportButton { +float:left;} +/* Notiflix: Report content off */ + +/* Notiflix: Report overlay animation => fade on */ +[id^=NotiflixReportWrap] > div[class*="-overlay"].with-animation { +animation: report-overlay-animation .3s ease-in-out 0s normal; +-webkit-animation: report-overlay-animation .3s ease-in-out 0s normal;} + +@keyframes report-overlay-animation { +0% {opacity:0;} +100% {opacity:1;} +} + +@-webkit-keyframes report-overlay-animation { +0% {opacity:0;} +100% {opacity:1;} +} +/* Notiflix: Report overlay animation => fade off */ + +/* Notiflix: Report content animation => fade on */ +[id^=NotiflixReportWrap] > div[class*="-content"].with-animation.nx-fade { +animation: report-animation-fade .3s ease-in-out 0s normal; +-webkit-animation: report-animation-fade .3s ease-in-out 0s normal;} + +@keyframes report-animation-fade { +0% {opacity:0;} +100% {opacity:1;} +} + +@-webkit-keyframes report-animation-fade { +0% {opacity:0;} +100% {opacity:1;} +} +/* Notiflix: Report content animation => fade off */ + +/* Notiflix: Report content animation => zoom on */ +[id^=NotiflixReportWrap] > div[class*="-content"].with-animation.nx-zoom { +animation: report-animation-zoom .3s ease-in-out 0s normal; +-webkit-animation: report-animation-zoom .3s ease-in-out 0s normal;} + +@keyframes report-animation-zoom { +0% {opacity:0; transform:scale(0.5);} +50% {opacity:1; transform:scale(1.05);} +100% {opacity:1; transform:scale(1);} +} + +@-webkit-keyframes report-animation-zoom { +0% {opacity:0; transform:scale(0.5);} +50% {opacity:1; transform:scale(1.05);} +100% {opacity:1; transform:scale(1);} +} +/* Notiflix: Report content animation => zoom off */ + +/* Notiflix: Report overlay animation remove => fade on */ +[id^=NotiflixReportWrap].remove > div[class*="-overlay"].with-animation { +opacity:0; +animation: report-overlay-animation-remove .3s ease-in-out 0s normal; +-webkit-animation: report-overlay-animation-remove .3s ease-in-out 0s normal;} + +@keyframes report-overlay-animation-remove { +0% {opacity:1;} +100% {opacity:0;} +} + +@-webkit-keyframes report-overlay-animation-remove { +0% {opacity:1;} +100% {opacity:0;} +} +/* Notiflix: Report overlay animation remove => fade off */ + +/* Notiflix: Report content animation remove => fade on */ +[id^=NotiflixReportWrap].remove > div[class*="-content"].with-animation.nx-fade { +opacity:0; +animation: report-animation-fade-remove .3s ease-in-out 0s normal; +-webkit-animation: report-animation-fade-remove .3s ease-in-out 0s normal;} + +@keyframes report-animation-fade-remove { +0% {opacity:1;} +100% {opacity:0;} +} + +@-webkit-keyframes report-animation-fade-remove { +0% {opacity:1;} +100% {opacity:0;} +} +/* Notiflix: Report content animation remove => fade off */ + +/* Notiflix: Report content animation remove => zoom on */ +[id^=NotiflixReportWrap].remove > div[class*="-content"].with-animation.nx-zoom { +opacity:0; +animation: report-animation-zoom-remove .3s ease-in-out 0s normal; +-webkit-animation: report-animation-zoom-remove .3s ease-in-out 0s normal;} + +@keyframes report-animation-zoom-remove { +0% {opacity:1; transform:scale(1);} +50% {opacity:0.5; transform:scale(1.05);} +100% {opacity:0; transform:scale(0);} +} + +@-webkit-keyframes report-animation-zoom-remove { +0% {opacity:1; transform:scale(1);} +50% {opacity:0.5; transform:scale(1.05);} +100% {opacity:0; transform:scale(0);} +} +/* Notiflix: Report content animation remove => zoom off */ + + +/* Notiflix: Confirm wrap on */ +[id^=NotiflixConfirmWrap] { +position: fixed; +z-index: 4003; +width: 300px; +max-width:98%; +left: 10px; +right: 10px; +top: 10px; +margin:auto; +text-align: center; +box-sizing:border-box; +background:transparent; +font-family: "Quicksand", sans-serif;} + +[id^=NotiflixConfirmWrap] * { +box-sizing:border-box;} +/* Notiflix: Confirm wrap off */ + +/* Notiflix: Confirm content on */ +[id^=NotiflixConfirmWrap] > div[class*="-overlay"] { +width:100%; +height:100%; +left:0; +top:0; +background: rgba(255, 255, 255, .5); +position:fixed; +z-index:0;} + +[id^=NotiflixConfirmWrap] > div[class*="-content"] { +width:100%; +float:left; +border-radius: 25px; +padding:10px; +margin:0; +filter: drop-shadow(0 0 5px rgba(0,0,0,.1)); +background: #f8f8f8; +color:#1e1e1e; +position:relative; +z-index:1;} + +[id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-head"] { +float:left; +width:100%;} + +[id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-head"] > h5 { +float:left; +width:100%; +margin:0; +padding:0 0 10px; +border-bottom:1px solid rgba(0,0,0,0.1); +color: #32c682; +font-family:inherit !important; +font-size:16px; +line-height:1.4; +font-weight:500;} + +[id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-head"] > p { +font-family:inherit !important; +margin: 15px 0 20px; +padding: 0 10px; +float:left; +width:100%; +font-size: 14px; +line-height: 1.4; +color: inherit;} + +[id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-buttons"] { +-webkit-user-select: none; +-moz-user-select: none; +-ms-user-select: none; +user-select: none; +border-radius:inherit; +float:left; +width:100%;} + +[id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-buttons"] > a { +cursor:pointer; +font-family:inherit !important; +transition:all .25s ease-in-out; +float: left; +width: 48%; +padding: 9px 5px; +border-radius:inherit !important; +font-weight: 500; +font-size: 15px; +line-height: 1.4; +color:#f8f8f8;} + +[id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-buttons"] > a.confirm-button-ok { +margin:0 2% 0 0; +background:#32c682;} + +[id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-buttons"] > a.confirm-button-cancel { +margin:0 0 0 2%; +background:#a9a9a9;} + +[id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-buttons"] > a.full { +margin:0; +width:100%;} + +[id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-buttons"] > a:hover { +box-shadow:inset 0 -60px 5px -5px rgba(0, 0, 0, 0.25);} +/* Notiflix: Confirm content off */ + +/* Notiflix: Confirm rtl on */ +[id^=NotiflixConfirmWrap].rtl-on > div[class*="-content"] > div[class*="-buttons"], +[id^=NotiflixConfirmWrap].rtl-on > div[class*="-content"] > div[class*="-buttons"] > a { +transform:rotateY(180deg);} +/* Notiflix: Confirm rtl off */ + +/* Notiflix: Confirm overlay animation => fade on */ +[id^=NotiflixConfirmWrap] > div[class*="-overlay"].with-animation { +animation: confirm-overlay-animation .3s ease-in-out 0s normal; +-webkit-animation: confirm-overlay-animation .3s ease-in-out 0s normal;} + +@keyframes confirm-overlay-animation { +0% {opacity:0;} +100% {opacity:1;} +} + +@-webkit-keyframes confirm-overlay-animation { +0% {opacity:0;} +100% {opacity:1;} +} +/* Notiflix: Confirm overlay animation => fade off */ + +/* Notiflix: Confirm overlay animation remove => fade on */ +[id^=NotiflixConfirmWrap].remove > div[class*="-overlay"].with-animation { +opacity:0; +animation: confirm-overlay-animation-remove .3s ease-in-out 0s normal; +-webkit-animation: confirm-overlay-animation-remove .3s ease-in-out 0s normal;} + +@keyframes confirm-overlay-animation-remove { +0% {opacity:1;} +100% {opacity:0;} +} + +@-webkit-keyframes confirm-overlay-animation-remove { +0% {opacity:1;} +100% {opacity:0;} +} +/* Notiflix: Confirm overlay animation remove => fade off */ + +/* Notiflix: Confirm content animation => fade on */ +[id^=NotiflixConfirmWrap].with-animation.nx-fade > div[class*="-content"] { +animation: confirm-animation-fade .3s ease-in-out 0s normal; +-webkit-animation: confirm-animation-fade .3s ease-in-out 0s normal;} + +@keyframes confirm-animation-fade { +0% {opacity:0;} +100% {opacity:1;} +} + +@-webkit-keyframes confirm-animation-fade { +0% {opacity:0;} +100% {opacity:1;} +} +/* Notiflix: Confirm content animation => fade off */ + +/* Notiflix: Confirm content animation => zoom on */ +[id^=NotiflixConfirmWrap].with-animation.nx-zoom > div[class*="-content"] { +animation: confirm-animation-zoom .3s ease-in-out 0s normal; +-webkit-animation: confirm-animation-zoom .3s ease-in-out 0s normal;} + +@keyframes confirm-animation-zoom { +0% {opacity:0; transform:scale(0.5);} +50% {opacity:1; transform:scale(1.05);} +100% {opacity:1; transform:scale(1);} +} + +@-webkit-keyframes confirm-animation-zoom { +0% {opacity:0; transform:scale(0.5);} +50% {opacity:1; transform:scale(1.05);} +100% {opacity:1; transform:scale(1);} +} +/* Notiflix: Confirm content animation => zoom off */ + +/* Notiflix: Confirm content animation remove => fade on */ +[id^=NotiflixConfirmWrap].with-animation.nx-fade.remove > div[class*="-content"] { +opacity:0; +animation: confirm-animation-fade-remove .3s ease-in-out 0s normal; +-webkit-animation: confirm-animation-fade-remove .3s ease-in-out 0s normal;} + +@keyframes confirm-animation-fade-remove { +0% {opacity:1;} +100% {opacity:0;} +} + +@-webkit-keyframes confirm-animation-fade-remove { +0% {opacity:1;} +100% {opacity:0;} +} +/* Notiflix: Confirm content animation remove => fade off */ + +/* Notiflix: Confirm content animation remove => zoom on */ +[id^=NotiflixConfirmWrap].with-animation.nx-zoom.remove > div[class*="-content"] { +opacity:0; +animation: confirm-animation-zoom-remove .3s ease-in-out 0s normal; +-webkit-animation: confirm-animation-zoom-remove .3s ease-in-out 0s normal;} + +@keyframes confirm-animation-zoom-remove { +0% {opacity:1; transform:scale(1);} +50% {opacity:0.5; transform:scale(1.05);} +100% {opacity:0; transform:scale(0);} +} + +@-webkit-keyframes confirm-animation-zoom-remove { +0% {opacity:1; transform:scale(1);} +50% {opacity:0.5; transform:scale(1.05);} +100% {opacity:0; transform:scale(0);} +} +/* Notiflix: Confirm content animation remove => zoom off */ + + +/* Notiflix: Loading wrap on */ +[id^=NotiflixLoadingWrap] { +-webkit-user-select: none; +-moz-user-select: none; +-ms-user-select: none; +user-select: none; +position: fixed; +z-index: 4000; +width: 100%; +height: 100%; +left: 0; +top: 0; +right:0; +bottom:0; +margin:auto; +text-align: center; +box-sizing:border-box; +background: white!important; +font-family: "Quicksand", sans-serif;} + +[id^=NotiflixLoadingWrap] * { +box-sizing:border-box;} + +[id^=NotiflixLoadingWrap].click-to-close { +cursor:pointer;} +/* Notiflix: Loading wrap off */ + +/* Notiflix: Loading content on */ +[id^=NotiflixLoadingWrap] > div[class*="-icon"] { +width:60px; +height:60px; +position:fixed; +background-color: white!important; +transition:top .2s ease-in-out; +left: 0; +top: 0; +right:0; +bottom:0; +margin:auto;} + +[id^=NotiflixLoadingWrap] > div[class*="-icon"] img, +[id^=NotiflixLoadingWrap] > div[class*="-icon"] svg { +max-width:unset; +max-height:unset; +width: 100%; +height: 100%; +position:absolute; +left: 0; +top: 0;} + +[id^=NotiflixLoadingWrap] > div[class*="-icon"].with-message { +top:-42px;} + +[id^=NotiflixLoadingWrap] > p { +position: fixed; +left: 0; +right: 0; +top: 42px; +bottom: 0; +margin: auto; +font-family: inherit !important; +font-weight: 500; +line-height: 1.4; +padding: 0 10px; +width: 100%; +font-size:15px; +height: 18px;} +/* Notiflix: Loading content off */ + +/* Notiflix: Loading animation => fade on */ +[id^=NotiflixLoadingWrap].with-animation { +animation: loading-animation-fade .3s ease-in-out 0s normal; +-webkit-animation: loading-animation-fade .3s ease-in-out 0s normal;} + +@keyframes loading-animation-fade { +0% {opacity:0;} +100% {opacity:1;} +} + +@-webkit-keyframes loading-animation-fade { +0% {opacity:0;} +100% {opacity:1;} +} +/* Notiflix: Loading animation => fade off */ + +/* Notiflix: Loading animation remove => fade on */ +[id^=NotiflixLoadingWrap].with-animation.remove { +opacity:0; +animation: loading-animation-fade-remove .3s ease-in-out 0s normal; +-webkit-animation: loading-animation-fade-remove .3s ease-in-out 0s normal;} + +@keyframes loading-animation-fade-remove { +0% {opacity:1;} +100% {opacity:0;} +} + +@-webkit-keyframes loading-animation-fade-remove { +0% {opacity:1;} +100% {opacity:0;} +} +/* Notiflix: Loading animation remove => fade off */ + +/* Notiflix: Loading animation new message => fade on */ +[id^=NotiflixLoadingWrap] > p.new { +animation: loading-new-message-fade .3s ease-in-out 0s normal; +-webkit-animation: loading-new-message-fade .3s ease-in-out 0s normal;} + +@keyframes loading-new-message-fade { +0% {opacity:0;} +100% {opacity:1;} +} + +@-webkit-keyframes loading-new-message-fade { +0% {opacity:0;} +100% {opacity:1;} +} +/* Notiflix: Loading animation new message => fade off */ + + +/* Notiflix: Block wrap on */ +[id^=NotiflixBlockWrap] { +-webkit-user-select: none; +-moz-user-select: none; +-ms-user-select: none; +user-select: none; +box-sizing: border-box; +position: absolute; +z-index: 1000; +font-family: "Quicksand", sans-serif; +background: rgba(255, 255, 255, 0.9); +text-align: center; +animation-duration: 400ms; +width: 100%; +height: 100%; +left: 0; +top: 0; +border-radius: inherit;} + +[id^=NotiflixBlockWrap] * { +box-sizing: border-box;} +/* Notiflix: Block wrap off */ + +/* Notiflix: Block content on */ +[id^=NotiflixBlockWrap] > span[class*="-icon"] { +width: 45px; +height: 45px; +position: absolute; +left: 0; +top: 0; +right: 0; +bottom: 0; +margin: auto;} + +[id^=NotiflixBlockWrap] > span[class*="-message"] { +position: absolute; +left: 0; +right: 0; +top: 50px; +bottom: 0; +margin: auto; +font-family: inherit !important; +font-weight: 500; +font-size: 14px; +line-height: 1.4; +padding: 0 10px; +width: 100%; +height: 20px; +overflow: hidden;} +/* Notiflix: Block content off */ + +/* Notiflix: Block animation => fade on */ +[id^=NotiflixBlockWrap].with-animation { +animation: block-animation-fade .3s ease-in-out 0s normal; +-webkit-animation: block-animation-fade .3s ease-in-out 0s normal;} + +@keyframes block-animation-fade { +0% {opacity: 0;} +100% {opacity: 1;} +} + +@-webkit-keyframes block-animation-fade { +0% {opacity: 0;} +100% {opacity: 1;} +} +/* Notiflix: Block animation => fade off */ + +/* Notiflix: Block animation remove => fade on */ +[id^=NotiflixBlockWrap].with-animation.remove { +opacity: 0; +animation: block-animation-fade-remove .3s ease-in-out 0s normal; +-webkit-animation: block-animation-fade-remove .3s ease-in-out 0s normal;} + +@keyframes block-animation-fade-remove { +0% {opacity: 1;} +100% {opacity: 0;} +} + +@-webkit-keyframes block-animation-fade-remove { +0% {opacity: 1;} +100% {opacity: 0;} +} +/* Notiflix: Block animation remove => fade off */ + diff --git a/static/component/pear/css/module/menu.css b/static/component/pear/css/module/menu.css new file mode 100644 index 000000000..3f6908eb9 --- /dev/null +++ b/static/component/pear/css/module/menu.css @@ -0,0 +1,247 @@ +.pear-nav-tree { + width: 230px; + border-radius: 0px; + background-color: #28333E; +} + +.pear-nav-tree .layui-nav-item>a { + height: 56px; + line-height: 56px; + padding-top: 0px; + padding-bottom: 0px; +} + +.pear-nav-tree .layui-nav-item dd a { + height: 48px; + line-height: 48px; +} + +.pear-nav-tree .layui-nav-item>a .layui-nav-more { + padding: 0px; +} + +.pear-side-scroll::-webkit-scrollbar { + width: 0px; + height: 0px; +} +.pear-side-scroll{ + width: 230px; +} + +.pear-nav-tree .layui-nav-child dd.layui-this, +.layui-nav-tree .layui-nav-child dd.layui-this a, +.layui-nav-tree .layui-this, +.layui-nav-tree .layui-this>a, +.layui-nav-tree .layui-this>a:hover { + background-color: #5FB878; +} + +.pear-nav-tree .toast { + font-size: 14px; + margin: 5px; + margin-right: 8px; + text-align: center; + height: 40px; + line-height: 40px; + color: lightgray; +} + + +.pear-nav-tree .layui-nav-item a i { + margin-right: 12px; +} + +.pear-nav-tree .layui-nav-item a span { + letter-spacing: 2px; + font-size: 13.5px; +} + +.pear-nav-tree .layui-nav-item a:hover { + background-color: transparent; +} + +.pear-nav-tree .layui-nav-more { + margin-right: 5px; +} + +.pear-nav-tree .layui-nav-bar { + display: none; +} + +.pear-nav-tree .layui-nav-item a .layui-badge-dot { + float: right; + right: 13px; +} + +.pear-nav-tree .layui-nav-item a .layui-badge { + float: right; + right: 10px; +} + +/** 实 现 菜 单 隐 藏 */ +.pear-nav-mini { + overflow: hidden; +} + +.pear-nav-mini .layui-nav-item a span { + display: none; +} + +.pear-nav-mini .layui-nav-child { + display: none; +} + +.pear-nav-mini .layui-nav-more { + display: none !important; +} + +.pear-nav-control.pc a { + font-weight: 500; + font-size: 14px; +} + +.pear-nav-control.pc li{ + display: inline-block; +} + +.pear-nav-control.pc .layui-nav-bar { + top: 0px !important; +} + +.pear-nav-control.pc .layui-this * { + background-color: whitesmoke; +} + +.pear-nav-control.pc *{ + color: darkslategray!important; +} + +.pear-nav-control.pc .layui-nav-bar{ + display: none!important; +} + +.pear-nav-control .layui-nav-child{ + border: 1px solid whitesmoke; + border-radius: 6px; + width: 150px; +} + +/** 隐 藏 后 子 级 悬 浮 菜 单 */ +.pear-nav-tree .layui-nav-hover { + border-radius: 4px; + overflow: hidden; + background-color: #28333E; + display: block; + position: fixed; + min-width: 130px; + margin-left: 62px; + padding-top: 4px !important; + padding-bottom: 4px !important; + box-shadow: 0px 0px 3px lightgray; +} +.pear-nav-tree .layui-nav-hover a span { + display: inline-block !important; +} +.pear-nav-tree .layui-nav-hover a i { + display: none; +} +.pear-nav-tree .layui-nav-child dd a span { + margin-left: 26px !important; +} +.pear-nav-tree .layui-nav-child dd a i { + display: none; +} +.pear-nav-tree .layui-nav-hover dd a span { + margin-left: 0px !important; +} +.pear-nav-tree dl { + padding-top: 0; + padding-bottom: 0; +} +/** 亮 样 式*/ +.dark-theme .layui-nav-tree{ + background-color: #28333E!important; +} + +.light-theme{ + background-color: white!important; +} + +.light-theme .pear-nav-tree, +.light-theme .pear-nav-tree .layui-nav-child{ + background-color: white!important; +} + +.light-theme .pear-nav-tree a, +.light-theme .pear-nav-tree .layui-nav-more{ + color: dimgray!important; + border-top-color: dimgray; +} + +.light-theme .pear-nav-tree .layui-nav-itemed>a>.layui-nav-more{ + border-top-color: white!important; + border-bottom-color: dimgray!important; +} + +.light-theme .pear-nav-tree .layui-this a, +.light-theme .pear-nav-tree .layui-this{ + color: white!important; + background-color: #5FB878!important; + +} + +.light-theme .pear-nav-tree .layui-this a:hover{ + background-color: #5FB878!important; + +} + +.light-theme .pear-nav-tree .layui-nav-bar{ + display: none; + +} + +/** 下 拉 图 标 */ +.pear-nav-tree.arrow .layui-nav-more { + font-family: layui-icon !important; + font-size: 10px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + overflow: hidden; + width: auto; + height: auto; + line-height: normal; + border: none; + top: 23px; + margin-right: 2px !important; + margin: 0; + padding: 0; + display: inline-block; + transition: all .2s; + -webkit-transition: all .2s; +} + +.pear-nav-tree.arrow .layui-nav-child .layui-nav-more { + top: 17px; +} + +.pear-nav-tree.arrow .layui-nav-more:before { + content: "\e61a"; +} + +.pear-nav-tree.arrow .layui-nav-itemed>a>.layui-nav-more { + transform: rotate(180deg); + -ms-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -webkit-transform: rotate(180deg); + -o-transform: rotate(180deg); + width: 12px; + text-align: center; +} + +.pear-nav-tree.arrow .layui-nav-itemed>a>.layui-nav-more:before { + content: '\e61a'; + background-color: transparent; + display: inline-block; + vertical-align: middle; +} \ No newline at end of file diff --git a/static/component/pear/css/module/message.css b/static/component/pear/css/module/message.css new file mode 100644 index 000000000..ed3a13568 --- /dev/null +++ b/static/component/pear/css/module/message.css @@ -0,0 +1,72 @@ +.pear-notice .layui-this { + color: #5FB878 !important; + font-weight: 500; +} + +.pear-notice { + box-shadow: 0 6px 16px -8px rgb(0 0 0 / 8%), 0 9px 28px 0 rgb(0 0 0 / 5%), 0 12px 48px 16px rgb(0 0 0 / 3%)!important; +} + +.pear-notice .layui-tab-title { + text-align: center; + border-right: 1px solid whitesmoke; +} + +.pear-notice * { + color: dimgray !important; +} + +.pear-notice { + width: 360px !important; +} + +.pear-notice img { + margin-left: 8px; + width: 33px !important; + height: 33px !important; + border-radius: 50px; + margin-right: 15px; +} + +.pear-notice-item { + height: 45px !important; + line-height: 45px !important; + padding-right: 20px; + padding-left: 20px; + border-bottom: 1px solid whitesmoke; + padding-top: 10px; + padding-bottom: 15px; +} +.pear-notice-end { + float: right; + right: 10px; +} + +.pear-notice-item span{ + height: 40px; + line-height: 40px; +} + +/** 滚动条样式 */ +.pear-notice *::-webkit-scrollbar { + width: 0px; + height: 0px; +} + +.pear-notice *::-webkit-scrollbar-track { + background: white; + border-radius: 2px; +} + +.pear-notice *::-webkit-scrollbar-thumb { + background: #E6E6E6; + border-radius: 2px; +} + +.pear-notice *::-webkit-scrollbar-thumb:hover { + background: #E6E6E6; +} + +.pear-notice *::-webkit-scrollbar-corner { + background: #f6f6f6; +} diff --git a/static/component/pear/css/module/notice.css b/static/component/pear/css/module/notice.css new file mode 100644 index 000000000..65c9feaca --- /dev/null +++ b/static/component/pear/css/module/notice.css @@ -0,0 +1,228 @@ +.toast-title { + font-weight: bold; +} +.toast-message { + -ms-word-wrap: break-word; + word-wrap: break-word; +} +.toast-message a, +.toast-message label { + color: #FFFFFF; +} +.toast-message a:hover { + color: #CCCCCC; + text-decoration: none; +} +.toast-close-button { + position: relative; + right: -0.3em; + top: -0.3em; + float: right; + font-size: 20px; + font-weight: bold; + color: #FFFFFF; + -webkit-text-shadow: 0 1px 0 #ffffff; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.8; + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); + filter: alpha(opacity=80); + line-height: 1; +} +.toast-close-button:hover, +.toast-close-button:focus { + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.4; + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40); + filter: alpha(opacity=40); +} +.rtl .toast-close-button { + left: -0.3em; + float: left; + right: 0.3em; +} +/*Additional properties for button version + iOS requires the button element instead of an anchor tag. + If you want the anchor version, it requires `href="#"`.*/ +button.toast-close-button { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} +.toast-top-center { + top: 0; + right: 0; + width: 100%; +} +.toast-bottom-center { + bottom: 0; + right: 0; + width: 100%; +} +.toast-top-full-width { + top: 0; + right: 0; + width: 100%; +} +.toast-bottom-full-width { + bottom: 0; + right: 0; + width: 100%; +} +.toast-top-left { + top: 12px; + left: 12px; +} +.toast-top-right { + top: 12px; + right: 12px; +} +.toast-bottom-right { + right: 12px; + bottom: 12px; +} +.toast-bottom-left { + bottom: 12px; + left: 12px; +} +#toast-container { + position: fixed; + z-index: 999999; + pointer-events: none; + /*overrides*/ +} +#toast-container * { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +#toast-container > div { + position: relative; + pointer-events: auto; + overflow: hidden; + margin: 0 0 6px; + padding: 15px 15px 15px 50px; + width: 300px; + -moz-border-radius: 3px 3px 3px 3px; + -webkit-border-radius: 3px 3px 3px 3px; + border-radius: 3px 3px 3px 3px; + background-position: 15px center; + background-repeat: no-repeat; + -moz-box-shadow: 0 0 12px #999999; + -webkit-box-shadow: 0 0 12px #999999; + box-shadow: 0 0 12px #999999; + color: #FFFFFF; + opacity: 0.8; + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); + filter: alpha(opacity=80); +} +#toast-container > div.rtl { + direction: rtl; + padding: 15px 50px 15px 15px; + background-position: right 15px center; +} +#toast-container > div:hover { + -moz-box-shadow: 0 0 12px #000000; + -webkit-box-shadow: 0 0 12px #000000; + box-shadow: 0 0 12px #000000; + opacity: 1; + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + filter: alpha(opacity=100); + cursor: pointer; +} +#toast-container > .toast-info { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=") !important; +} +#toast-container > .toast-error { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=") !important; +} +#toast-container > .toast-success { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==") !important; +} +#toast-container > .toast-warning { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=") !important; +} +#toast-container.toast-top-center > div, +#toast-container.toast-bottom-center > div { + width: 300px; + margin-left: auto; + margin-right: auto; +} +#toast-container.toast-top-full-width > div, +#toast-container.toast-bottom-full-width > div { + width: 96%; + margin-left: auto; + margin-right: auto; +} +.toast { + background-color: #030303; +} +.toast-success { + background-color: #51A351; +} +.toast-error { + background-color: #BD362F; +} +.toast-info { + background-color: #2F96B4; +} +.toast-warning { + background-color: #F89406; +} +.toast-progress { + position: absolute; + left: 0; + bottom: 0; + height: 4px; + background-color: #000000; + opacity: 0.4; + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40); + filter: alpha(opacity=40); +} +/*Responsive Design*/ +@media all and (max-width: 240px) { + #toast-container > div { + padding: 8px 8px 8px 50px; + width: 11em; + } + #toast-container > div.rtl { + padding: 8px 50px 8px 8px; + } + #toast-container .toast-close-button { + right: -0.2em; + top: -0.2em; + } + #toast-container .rtl .toast-close-button { + left: -0.2em; + right: 0.2em; + } +} +@media all and (min-width: 241px) and (max-width: 480px) { + #toast-container > div { + padding: 8px 8px 8px 50px; + width: 18em; + } + #toast-container > div.rtl { + padding: 8px 50px 8px 8px; + } + #toast-container .toast-close-button { + right: -0.2em; + top: -0.2em; + } + #toast-container .rtl .toast-close-button { + left: -0.2em; + right: 0.2em; + } +} +@media all and (min-width: 481px) and (max-width: 768px) { + #toast-container > div { + padding: 15px 15px 15px 50px; + width: 25em; + } + #toast-container > div.rtl { + padding: 15px 50px 15px 15px; + } +} \ No newline at end of file diff --git a/static/component/pear/css/module/select.css b/static/component/pear/css/module/select.css new file mode 100644 index 000000000..d30132707 --- /dev/null +++ b/static/component/pear/css/module/select.css @@ -0,0 +1,827 @@ +/* formSelects多选css */ +select[xm-select] { + display: none !important; +} + +.xm-select-parent * { + margin: 0; + padding: 0; + font-family: "Helvetica Neue", Helvetica, "PingFang SC", 微软雅黑, Tahoma, Arial, sans-serif; + box-sizing: initial; +} + +.xm-select-parent { + text-align: left; +} + +.xm-select-parent select { + display: none; +} + +.xm-select-parent .xm-select-title { + position: relative; + min-height: 36px; +} + +.xm-select-parent .xm-input { + cursor: pointer; + border-radius: 2px; + border-width: 1px; + border-style: solid; + border-color: #E6E6E6; + display: block; + width: 100%; + box-sizing: border-box; + background-color: #FFF; + height: 36px; + line-height: 1.3; + padding-left: 10px; + outline: 0 +} + +.xm-select-parent .xm-select-sj { + display: inline-block; + width: 0; + height: 0; + border-style: dashed; + border-color: transparent; + overflow: hidden; + position: absolute; + right: 10px; + top: 50%; + margin-top: -3px; + cursor: pointer; + border-width: 6px; + border-top-color: #C2C2C2; + border-top-style: solid; + transition: all .3s; + -webkit-transition: all .3s +} + +.xm-select-parent .xm-form-selected .xm-select-sj { + margin-top: -9px; + transform: rotate(180deg) +} + +.xm-select-parent .xm-form-select dl { + display: none; + position: absolute; + left: 0; + top: 42px; + padding: 5px 0; + z-index: 999; + min-width: 100%; + border: 1px solid #d2d2d2; + max-height: 300px; + overflow-y: auto; + background-color: #fff; + border-radius: 2px; + box-shadow: 0 2px 4px rgba(0, 0, 0, .12); + box-sizing: border-box; + animation-fill-mode: both; + -webkit-animation-name: layui-upbit; + animation-name: layui-upbit; + -webkit-animation-duration: .3s; + animation-duration: .3s; + -webkit-animation-fill-mode: both; + animation-fill-mode: both +} + +@-webkit-keyframes layui-upbit { + from { + -webkit-transform: translate3d(0, 30px, 0); + opacity: .3 + } + + to { + -webkit-transform: translate3d(0, 0, 0); + opacity: 1 + } +} + +@keyframes layui-upbit { + from { + transform: translate3d(0, 30px, 0); + opacity: .3 + } + + to { + transform: translate3d(0, 0, 0); + opacity: 1 + } +} + +.xm-select-parent .xm-form-selected dl { + display: block +} + +.xm-select-parent .xm-form-select dl dd, +.xm-select-parent .xm-form-select dl dt { + padding: 0 10px; + line-height: 36px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis +} + +.xm-select-parent .xm-form-select dl dd { + cursor: pointer; + height: 36px; +} + +.xm-select-parent .xm-form-select dl dd:hover { + background-color: #f2f2f2 +} + +.xm-select-parent .xm-form-select dl dt { + font-size: 12px; + color: #999 +} + +.layui-select-disabled .xm-dis-disabled { + border-color: #eee !important +} + +.xm-select-parent .xm-form-select dl .xm-select-tips { + padding-left: 10px !important; + color: #999; + font-size: 14px +} + +.xm-unselect { + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none +} + +.xm-form-checkbox { + position: relative; + display: block; + vertical-align: middle; + cursor: pointer; + font-size: 0; + -webkit-transition: .1s linear; + transition: .1s linear; + box-sizing: border-box; + height: auto !important; + line-height: normal !important; + border: none !important; + margin-right: 0; + padding-right: 0; + background: 0 0; +} + +.xm-form-checkbox>i { + color: #FFF; + font-size: 16px; + width: 16px; + height: 16px; + position: absolute; + top: 9px; + border: 1px solid #5FB878; + border-radius: 3px; + z-index: 2; +} + +.xm-form-checkbox:hover>i { + border-color: #5FB878; +} + +.xm-form-checkbox>span { + display: block; + position: relative; + padding: 0 15px 0 30px; + height: 100%; + font-size: 14px; + border-radius: 2px 0 0 2px; + background-color: #d2d2d2; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + background: 0 0; + color: #666; + line-height: 36px; +} + +.xm-select-parent dl { + width: 100%; +} + +.xm-select-parent dl dd { + position: relative; +} + +.xm-select-parent dl dd>i:not(.icon-sousuo) { + position: absolute; + right: 10px; + top: 0; + color: #AAAAAA; +} + +.xm-select-parent dl dd.xm-select-this div i { + border: none; + color: #5FB878; + font-size: 18px; +} + +.xm-select-parent dl dd.xm-select-this div i:after { + content: '\e613'; +} + +.xm-select-parent dl dd.xm-dis-disabled div i { + border-color: #C2C2C2; +} + +.xm-select-parent dl dd.xm-dis-disabled.xm-select-this div i { + color: #C2C2C2; +} + +.xm-select-radio div.xm-form-checkbox>i { + border-radius: 20px; +} + +.xm-select-parent dl.xm-select-radio dd.xm-select-this div i:after { + content: '\e62b'; +} + +.xm-dis-disabled, +.xm-dis-disabled:hover { + cursor: not-allowed !important +} + +.xm-form-select dl dd.xm-dis-disabled { + background-color: #fff !important +} + +.xm-form-select dl dd.xm-dis-disabled span { + color: #C2C2C2 +} + +.xm-form-select dl dd.xm-dis-disabled .xm-icon-yes { + border-color: #C2C2C2 +} + +.xm-select-parent { + position: relative; + -moz-user-select: none; + -ms-user-select: none; + -webkit-user-select: none +} + +.xm-select-parent .xm-select { + line-height: normal; + height: auto; + padding: 4px 10px 1px 10px; + overflow: hidden; + min-height: 36px; + left: 0; + z-index: 99; + position: absolute; + background: 0 0; + padding-right: 20px +} + +.xm-select-parent .xm-select:hover { + border-color: #C0C4CC +} + +.xm-select-parent .xm-select .xm-select-label { + display: inline-block; + margin: 0; + vertical-align: middle +} + +.xm-select-parent .xm-select-title div.xm-select-label>span { + position: relative; + padding: 2px 5px; + background-color: #5FB878; + border-radius: 2px; + color: #FFF; + display: inline-block; + line-height: 18px; + height: 18px; + margin: 2px 5px 2px 0; + cursor: initial; + user-select: none; + font-size: 14px; + padding-right: 25px; + -webkit-user-select: none; +} + +.xm-select-parent .xm-select-title div.xm-select-label>span i { + position: absolute; + margin-left: 8px; + font-size: 12px; + cursor: pointer; + line-height: 20px; +} + +.xm-select-parent .xm-select .xm-select-input { + border: none; + height: 28px; + background-color: transparent; + padding: 0; + vertical-align: middle; + display: inline-block; + width: 50px +} + +.xm-select-parent .xm-select--suffix input { + border: none +} + +.xm-form-selected .xm-select, +.xm-form-selected .xm-select:hover { + border-color: #67c23a !important +} + +.xm-select--suffix+div { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0 +} + +.xm-select-dis .xm-select--suffix+div { + z-index: 100; + cursor: no-drop !important; + opacity: .2; + background-color: #FFF; +} + +.xm-select-disabled, +.xm-select-disabled:hover { + color: #d2d2d2 !important; + cursor: not-allowed !important; + background-color: #fff +} + +.xm-select-none { + display: none; + margin: 5px 0; + text-align: center; +} + +.xm-select-none:hover { + background-color: #FFF !important +} + +.xm-select-empty { + display: block +} + +.xm-span-hide { + display: none !important; +} + +.layui-form-pane .xm-select, +.layui-form-pane .xm-select:hover { + border: none !important; + top: 0px +} + +.layui-form-pane .xm-select-title { + border: 1px solid #e6e6e6 !important +} + +.xm-select-hide { + display: none !important; +} + +div[xm-hg] .xm-select-label { + white-space: nowrap; + overflow: hidden; + position: absolute; + right: 30px; + left: 0; + padding-left: 10px; +} + +/* 颜色相关 */ +div[xm-select-skin] .xm-select-title div.xm-select-label>span { + border: 1px solid #67c23a +} + +div[xm-select-skin] .xm-select-title div.xm-select-label>span i:hover { + opacity: .8; + filter: alpha(opacity=80); + cursor: pointer +} + +div[xm-select-skin=default] .xm-select-title div.xm-select-label>span { + background-color: #F0F2F5; + color: #909399; + border: 1px solid #F0F2F5 +} + +div[xm-select-skin=default] .xm-select-title div.xm-select-label>span i { + color: #C0C4CC +} + +div[xm-select-skin=default] .xm-select-title div.xm-select-label>span i:before { + content: '\e60b'; + font-size: 16px; + margin-left: -3px; +} + +div[xm-select-skin=default] dl dd:not(.xm-dis-disabled) i { + border-color: #5FB878 +} + +div[xm-select-skin=default] dl dd.xm-select-this:not(.xm-dis-disabled) i { + color: #5FB878 +} + +div[xm-select-skin=default].xm-form-selected .xm-select, +div[xm-select-skin=default].xm-form-selected .xm-select:hover { + border-color: #C0C4CC!important +} + +div[xm-select-skin=primary] .xm-select-title div.xm-select-label>span { + background-color: #5FB878!important + color: #FFF; + border: 1px solid #5FB878!important +} + +div[xm-select-skin=primary] .xm-select-title div.xm-select-label>span i { + background-color: #5FB878!important + color: #FFF +} + +div[xm-select-skin=primary] dl dd:not(.xm-dis-disabled) i { + border-color: #5FB878!important +} + +div[xm-select-skin=primary] dl dd.xm-select-this:not(.xm-dis-disabled) i { + color: #5FB878!important +} + +div[xm-select-skin=primary].xm-form-selected .xm-select, +div[xm-select-skin=primary].xm-form-selected .xm-select:hover { + border-color: #5FB878!important +} + +div[xm-select-skin=normal] .xm-select-title div.xm-select-label>span { + background-color: #2D8CF0!important; + color: #FFF; + border: 1px solid #2D8CF0!important; +} + +div[xm-select-skin=normal] .xm-select-title div.xm-select-label>span i { + background-color: #2D8CF0!important; + color: #FFF +} + +div[xm-select-skin=normal] dl dd:not(.xm-dis-disabled) i { + border-color: #2D8CF0!important; +} + +div[xm-select-skin=normal] dl dd.xm-select-this:not(.xm-dis-disabled) i { + color:#2D8CF0 !important; +} + +div[xm-select-skin=normal].xm-form-selected .xm-select, +div[xm-select-skin=normal].xm-form-selected .xm-select:hover { + border-color:#2D8CF0!important; +} + +div[xm-select-skin=warm] .xm-select-title div.xm-select-label>span { + background-color: #e6a23c!important; + color: #FFF; + border: 1px solid #e6a23c!important; +} + +div[xm-select-skin=warm] .xm-select-title div.xm-select-label>span i { + background-color: #e6a23c!important; + color: #FFF +} + +div[xm-select-skin=warm] dl dd:not(.xm-dis-disabled) i { + border-color:#e6a23c!important +} + +div[xm-select-skin=warm] dl dd.xm-select-this:not(.xm-dis-disabled) i { + color:#e6a23c!important +} + +div[xm-select-skin=warm].xm-form-selected .xm-select, +div[xm-select-skin=warm].xm-form-selected .xm-select:hover { + border-color: #e6a23c!important +} + +div[xm-select-skin=danger] .xm-select-title div.xm-select-label>span { + background-color: #f56c6c!important; + color: #FFF; + border: 1px solid #f56c6c!important; +} + +div[xm-select-skin=danger] .xm-select-title div.xm-select-label>span i { + background-color:#f56c6c!important + color: #FFF +} + +div[xm-select-skin=danger] dl dd:not(.xm-dis-disabled) i { + border-color: #f56c6c!important +} + +div[xm-select-skin=danger] dl dd.xm-select-this:not(.xm-dis-disabled) i { + color: #f56c6c!important +} + +div[xm-select-skin=danger].xm-form-selected .xm-select, +div[xm-select-skin=danger].xm-form-selected .xm-select:hover { + border-color: #f56c6c!important +} + + +/* 多选联动 */ +.xm-select-parent .layui-form-danger+.xm-select-title .xm-select { + border-color: #f56c6c!important +} + +.xm-select-linkage li { + padding: 10px 0px; + cursor: pointer; +} + +.xm-select-linkage li span { + padding-left: 20px; + padding-right: 30px; + display: inline-block; + height: 20px; + overflow: hidden; + text-overflow: ellipsis; +} + +.xm-select-linkage li.xm-select-this span { + border-left: 5px solid #009688; + color: #009688; + padding-left: 15px; +} + +.xm-select-linkage-group { + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + overflow-x: hidden; + overflow-y: auto; +} + +.xm-select-linkage-group li:hover { + border-left: 1px solid #009688; +} + +.xm-select-linkage-group li:hover span { + padding-left: 19px; +} + +.xm-select-linkage-group li.xm-select-this:hover span { + padding-left: 15px; + border-left-width: 4px; +} + +.xm-select-linkage-group:nth-child(4n+1) { + background-color: #EFEFEF; + left: 0; +} + +.xm-select-linkage-group:nth-child(4n+1) li.xm-select-active { + background-color: #F5F5F5; +} + +.xm-select-linkage-group:nth-child(4n+2) { + background-color: #F5F5F5; + left: 100px; +} + +.xm-select-linkage-group:nth-child(4n+3) li.xm-select-active { + background-color: #FAFAFA; +} + +.xm-select-linkage-group:nth-child(4n+3) { + background-color: #FAFAFA; + left: 200px; +} + +.xm-select-linkage-group:nth-child(4n+3) li.xm-select-active { + background-color: #FFFFFF; +} + +.xm-select-linkage-group:nth-child(4n+4) { + background-color: #FFFFFF; + left: 300px; +} + +.xm-select-linkage-group:nth-child(4n+4) li.xm-select-active { + background-color: #EFEFEF; +} + +.xm-select-linkage li { + list-style: none; +} + +.xm-select-linkage-hide { + display: none; +} + +.xm-select-linkage-show { + display: block; +} + +div[xm-select-skin='default'] .xm-select-linkage li.xm-select-this span { + border-left-color: #5FB878; + color: #5FB878; +} + +div[xm-select-skin='default'] .xm-select-linkage-group li:hover { + border-left-color: #5FB878; +} + +div[xm-select-skin='primary'] .xm-select-linkage li.xm-select-this span { + border-left-color: #1E9FFF; + color: #1E9FFF; +} + +div[xm-select-skin='primary'] .xm-select-linkage-group li:hover { + border-left-color: #1E9FFF; +} + +div[xm-select-skin='normal'] .xm-select-linkage li.xm-select-this span { + border-left-color: #1E9FFF; + color: #1E9FFF; +} + +div[xm-select-skin='normal'] .xm-select-linkage-group li:hover { + border-left-color: #1E9FFF; +} + +div[xm-select-skin='warm'] .xm-select-linkage li.xm-select-this span { + border-left-color: #FFB800; + color: #FFB800; +} + +div[xm-select-skin='warm'] .xm-select-linkage-group li:hover { + border-left-color: #FFB800; +} + +div[xm-select-skin='danger'] .xm-select-linkage li.xm-select-this span { + border-left-color: #FF5722; + color: #FF5722; +} + +div[xm-select-skin='danger'] .xm-select-linkage-group li:hover { + border-left-color: #FF5722; +} + + +/* 快捷操作 */ +.xm-select-tips[style]:hover { + background-color: #FFF !important; +} + +.xm-select-parent dd>.xm-cz { + position: absolute; + top: 0px; + right: 10px; +} + +.xm-select-parent dd>.xm-cz-group { + margin-right: 30px; + border-right: 2px solid #ddd; + height: 16px; + margin-top: 10px; + line-height: 16px; + overflow: hidden; +} + +.xm-select-parent dd>.xm-cz-group .xm-cz { + display: inline-block; + margin-right: 30px; +} + +.xm-select-parent dd>.xm-cz-group .xm-cz i { + margin-right: 10px; +} + +.xm-select-parent dd>.xm-cz-group[show='name'] .xm-cz i { + display: none; +} + +.xm-select-parent dd>.xm-cz-group[show='icon'] .xm-cz span { + display: none; +} + +.xm-select-parent dd .xm-cz:hover { + color: #009688; +} + +div[xm-select-skin='default'] dd .xm-cz:hover { + color: #C0C4CC; +} + +div[xm-select-skin='primary'] dd .xm-cz:hover { + color: #009688; +} + +div[xm-select-skin='normal'] dd .xm-cz:hover { + color: #1E9FFF; +} + +div[xm-select-skin='warm'] dd .xm-cz:hover { + color: #FFB800; +} + +div[xm-select-skin='danger'] dd .xm-cz:hover { + color: #FF5722; +} + +.xm-select-tips .xm-input { + border: none; + border-bottom: 1px solid #E6E6E6; + padding-left: 27px; +} + +.xm-select-tips .icon-sousuo { + position: absolute; +} + +.xm-select-tips.xm-dl-input { + display: none; +} + +div[xm-select-search-type="1"] .xm-select-tips.xm-dl-input { + display: block; +} + +div[xm-select-search-type="1"] .xm-select .xm-select-input { + display: none !important; +} + +@font-face { + font-family: "xm-iconfont"; + src: url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.eot?t=1534240067831'); + /* IE9*/ + src: url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.eot?t=1534240067831#iefix') format('embedded-opentype'), + /* IE6-IE8 */ + url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAsYAAsAAAAAEQwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8ukovY21hcAAAAYAAAACrAAACPBtV6wxnbHlmAAACLAAABnEAAAmMovtEvWhlYWQAAAigAAAAMQAAADYSctBCaGhlYQAACNQAAAAgAAAAJAgBA69obXR4AAAI9AAAABsAAAAwMCX//WxvY2EAAAkQAAAAGgAAABoN8gwubWF4cAAACSwAAAAeAAAAIAEiAM9uYW1lAAAJTAAAAUUAAAJtPlT+fXBvc3QAAAqUAAAAhAAAALJ1LunfeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWacwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeMbwwZ27438AQw9zMcAQozAiSAwDk4AxmeJzlks0JwzAMhZ8bN/1xD4GU0h2Se26BbJMJOkkn6KmTPbJF8mT5UGg3qMRn0EPIRs8A9gAq0YsIhDcCLF5SQ9YrnLMe8VB9RSMlMjCxYcueIyfOy7CuAFHU7lP9iqApt5L3ksBJbzlgZ9PVkXDUvbWa6x8T/i0u+XyWKtmmHW0NDI55yeRok2DjaKdg65jX7Bzzm71jXnN08vzJkQvg7Ng/WAYH9Qb3wzM/AHicjVVvbFzFEd/Zfbv7/vn9uXf33vl8Pt/dO99BHOzEZ9/DKTImRS0KjUoLDUFCjtpCMGkT1D9qldQmhkiUSv2G1BBB1VYqilGREOIDViWEGzttqkpI/cAXqyL5gFRALVIF+VCJe9fZd+fEpR/o6d3s7G9mZ2dmZ3aJIKR3h0ZYmVgkIjGZJV8mDxECtenOTDOu1UU+hJoD+TCqzcNMk2V8O5OCbDVRPgZhEt4JCNTZ/4HA3+DfuWIxl8pcFFErG3K7oD7fvev8UaMUmEu259lrRjBsfs6cLhYbRfzSbSjGRVAkfQYihUXsyPkHTVyyZDNmXzSHg3Tl+aPKxpJFqbWGdtLl8w8iYDxuDTQIx7yc1YCdIx7Jk3HSwbwQwGBcyMKZVtG0ZCuJxjFJBb+foMSfhJaPOSr4FYgwSwqIx2MHJALtAdBi/7xcSMJL+fxmmBS2guD61tZm96X02mgcj0J1NAaIR9UMmhXIV24FuLUC71+r1AEmK1AYrQHUK/Tly/m8MrOZz2+FSf7jzc3NK9XR9F2lVq+gmRp0r+HK9B+VJmR263Rgd7ALwR/FOFfx/FeJS0YxQh9drakgMJhaBVizkwgqWxLD6eQ0Qo8f7p44fJziSH9x+PjLZUO+/jZ9+K35X37ljn/Rv+yW4Ziuf2nl4PfS5/LrP47OHTsFJULYjf369UZAEBmSqEOSJmG4Me6LeznA0BFkcDoJlGynVzmH2vY21DhPr25v9DjvbfTp2TXG1s5mlK0q4S7lT++6obbRox/s6CHF2LMEsHvoFfSFQIKnKQMZJVFCD6WH0p0PVvvcRx8uph8eUks0jOFNtskOkpDsJ18k9+NqVRg3qqMCSSerjyRuYUi1/vFH7YIqikGVcD+ehFl/pqPSPKZ6DG6mHisljFhBFvU/PoRkSNd/JHO6Ja5JOXcfwIGJbm/igBq/hn8Kfb57YbYUxyX4cwkLKH1u4gD9GVSL6USxCjjCO2p8VdcvH9XRYIQWqUblu3pR/v2BvXMAc3tTmJiDAQ895B9NL0C9BFdKqqRKczDX/Whg7O1irVbcqZ8/sbfYBOZwihC+6wSDzszUf+dF7rRO1O+fKaDO+nXOr6+vf8L5J44Qe4UvnlyRntwrxMoKzpFdeRJBNb9dGyiur1+nE59R+uwi9M1G395jb9KP0bcK2YM9nJB5cojcS75OFskxclzdc+pW699z8iYbtf14BGKf77ruZNyXKC0e50OEBI+V/Aug5Dex/9WjJfipuqnS00gfybjXbNe1f762tXmRPp3Bdl/l6g5JXyqXR0bK8J3PR+jvwYs8/GBnTM+kr8FX4ZknwC16XtG9iH9QfNn1vDHPe2GAj3ieV3XdF2+IPdeteh62Ra+HfQrsKWKSBtlHSOBgM7KkKQBLWnZoq1mVwotCLRGhOtSkMzMuqq2ml3SqUehdnZtynbtPLB88/Dy9dDrYVzoy/MTT6Svnlpd/AHueon5wpnGsEae/PZm+d3Jp6SSUTy7R3xw4f9/B5RN3O+5t3VNncjm6Cnt+uLx8DpedGj4yvD84HceNxTcG6ku4VPmZ9n6nNdj95BHyB3IJKxBPsKm6rpn4QopmqzlFm1MwqdxO5rPGnIc7aSfCGg1Vqyo6nUlQhnh7WiFhXzgGhVC4qjPRki9xdGCc4zXeSWb9BG1ktlqz2Q5Y7S2sIJfivkpVKCCDpyCWdbQzECj76qMVqvyJ/LxyI2rTv1bTC25lSM9xAUJ4Lc+U0wXTsKXDmaA8tHX+hvDt4Wa9IHLcMUBz9VwpL4xi2aGasAPPKNUbbmD/2jAtk0uXY4eJx8zRgj9iAnVNt5X+BL5vlHTOaiOmG7g6+7ZBNUOaefNXuJF3u25RjVvBLeW8E4wV7ZJBpbAXXGnqrwgupWVTAKqZjq5HbW44fMguNJhgwmw8oOk8GCqE8F3GhLB0uS/UDVt4lgjtqGxK/rpwuaDAqKHZNuWmJjVKuWUxbpg2B9DtoRdN3TKF9B0hw4p41C5i3CI9w4civP3aQLlmLMK3wpJpaI7BvmlhPtH3nPWCKQAdE2hK9zyuUeAm921qCA2kvqY8N1yDMq4beJlG+4XQqHDCQnqPlJIyyN579S4tIGcRv/82BbFfK9SgnVHkZzMeaSQjqR5/fP5XF2Chh+sW0g0gn27snqXv3/bsszsfJbCAIiTdjRTVCBL6jV0K5D8H/8xVAAAAeJxjYGRgYADi16c/vIvnt/nKwM3CAALXZxxzhtH///23YVFhbgZyORiYQKIAm34OJQAAAHicY2BkYGBu+N/AEMOi/P/f//8sKgxAERTAAwCmuAa3eJxjYWBgYAFhRiiNFf//z6L8/x+IDQAkCQRQAAAAAAAAjAEAATgBfgGaAiACbgMMA2AEhATGAAB4nGNgZGBg4GE4DMQgwATEXEDIwPAfzGcAAB2tAfIAAHicZY9NTsMwEIVf+gekEqqoYIfkBWIBKP0Rq25YVGr3XXTfpk6bKokjx63UA3AejsAJOALcgDvwSCebNpbH37x5Y08A3OAHHo7fLfeRPVwyO3INF7gXrlN/EG6QX4SbaONVuEX9TdjHM6bCbXRheYPXuGL2hHdhDx18CNdwjU/hOvUv4Qb5W7iJO/wKt9Dx6sI+5l5XuI1HL/bHVi+cXqnlQcWhySKTOb+CmV7vkoWt0uqca1vEJlODoF9JU51pW91T7NdD5yIVWZOqCas6SYzKrdnq0AUb5/JRrxeJHoQm5Vhj/rbGAo5xBYUlDowxQhhkiMro6DtVZvSvsUPCXntWPc3ndFsU1P9zhQEC9M9cU7qy0nk6T4E9XxtSdXQrbsuelDSRXs1JErJCXta2VELqATZlV44RelzRiT8oZ0j/AAlabsgAAAB4nG2L3QqCQBCFZ9RWU7sOfAeh8IFi3N10EHYUG1p8+gSjqz44F+cPEjgo4T81Jphihic0mGOBZyyxwhovUCxKIe4ylthRuDqV+I22UcLQ6+QH4ubWdZZkU3m4o/0tUqtSvT33TPLits12fzc+zhRcvoquo0o281OLhcMw7Q+AD8sULE0=') format('woff'), + url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.ttf?t=1534240067831') format('truetype'), + /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ + url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.svg?t=1534240067831#iconfont') format('svg'); + /* iOS 4.1- */ +} + +.xm-iconfont { + font-family: "xm-iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-quanxuan:before { + content: "\e62c"; +} + +.icon-caidan:before { + content: "\e610"; +} + +.icon-fanxuan:before { + content: "\e837"; +} + +.icon-pifu:before { + content: "\e668"; +} + +.icon-qingkong:before { + content: "\e63e"; +} + +.icon-sousuo:before { + content: "\e600"; +} + +.icon-danx:before { + content: "\e62b"; +} + +.icon-duox:before { + content: "\e613"; +} + +.icon-close:before { + content: "\e601"; +} + +.icon-expand:before { + content: "\e641"; +} + +.xm-select-parent .xm-form-select dl{ + position: relative; + top: 5px!important; +} diff --git a/static/component/pear/css/module/step.css b/static/component/pear/css/module/step.css new file mode 100644 index 000000000..63946620e --- /dev/null +++ b/static/component/pear/css/module/step.css @@ -0,0 +1,88 @@ +.lay-step { + font-size: 0; + margin: 0 auto; + max-width: 100%; + width: 60%; + padding-left: 15%; + +} + +.step-item { + display: inline-block; + line-height: 35px; + position: relative; + font-size: 15px; + vertical-align: top; +} + +.step-item-tail { + width: 100%; + padding: 0 10px; + position: absolute; + left: 0; + top: 13px; +} + +.step-item-tail i { + display: inline-block; + width: 100%; + height: 3px; + margin-top: 4px; + vertical-align: top; + background: #5FB878; + position: relative; +} + +.step-item-tail .step-item-tail-done { + background: #5FB878; + height: 3px; + margin-top: 4px; +} + +.step-item-head { + position: relative; + display: inline-block; + height: 35px; + width: 35px; + text-align: center; + vertical-align: top; + color: #5FB878; + border: 3px solid #5FB878; + border-radius: 50%; + background: #ffffff; +} + +.step-item-head.step-item-head-active { + background: #5FB878; + color: #ffffff; +} + +.step-item-main { + display: block; + position: relative; + margin-left: -50%; + margin-right: 50%; + padding-left: 26px; + text-align: center; +} + +.step-item-main-title { + font-weight: bolder; + color: #555555; +} + +.step-item-main-desc { + color: #aaaaaa; +} + +.step-item-main-time { + color: #aaaaaa; +} + +.lay-step + [carousel-item]:before { + display: none; +} + +.lay-step + [carousel-item] > * { + background-color: transparent; +} \ No newline at end of file diff --git a/static/component/pear/css/module/tab.css b/static/component/pear/css/module/tab.css new file mode 100644 index 000000000..3161f3e44 --- /dev/null +++ b/static/component/pear/css/module/tab.css @@ -0,0 +1,308 @@ +.pear-tab { + margin: 0px; + overflow: hidden; + height: 100% !important; +} + +.pear-tab .layui-tab-content { + height: calc(100% - 42px) !important; +} + +.pear-tab .layui-tab-content .layui-tab-item { + height: 100%; +} + +.pear-tab-menu{ + box-shadow: 0 2px 8px #f0f1f2!important; + border: 1px solid whitesmoke!important; + border-radius: 4px!important; +} + +.pear-tab-menu .item{ + height: 20px; + padding-left: 18px; + padding-top: 7px; + padding-bottom: 7px; + color: #333; + font-size: 13.5px; + line-height: 20px; + cursor:pointer; +} +.pear-tab-menu .item:hover{ + background: #36b368; + color: white; +} + +.pear-tab .layui-tab-content { + padding: 0px; +} + +.pear-tab .layui-tab-title { + border: none; + border: 1px solid whitesmoke; + background-color: white; +} + +.pear-tab .layui-tab-title li { + border-right: 1px solid whitesmoke; + color: dimgray; + font-size: 13.5px; +} + +.pear-tab .layui-tab-title .layui-tab-bar { + display: none; +} + +.pear-tab .layui-tab-title .layui-this:after { + display: none; +} + +.pear-tab .layui-tab-title .pear-tab-active { + display: inline-block; + background-color: lightgray; + width: 8px; + height: 8px; + border-radius: 30px; + margin-right: 12px; +} + +.pear-tab .layui-tab-title .layui-this .pear-tab-active { + background-color: #5FB878; +} + +.pear-tab .layui-tab-title .layui-tab-close:hover { + background-color: white; + line-height: 19px; + color: gray; +} + +.pear-tab .layui-tab-title .disable-close+.layui-tab-close { + display: none; +} + +.pear-tab .layui-tab-title .able-close+.layui-tab-close { + display: inline-block; +} + +.pear-tab .layui-tab-close{ + font-size: 13px; +} + +.pear-tab .layui-tab-control>li { + position: absolute; + top: 0px; + height: 40px; + line-height: 40px; + width: 40px; + text-align: center; + background-color: white; + border-top: whitesmoke 1px solid; + border-bottom: whitesmoke 1px solid; +} + +.pear-tab .layui-tab-prev { + left: 0px; + border-right: whitesmoke 1px solid; +} + +.pear-tab .layui-tab-next { + right: 40px; + border-left: 1px solid whitesmoke; +} + +.pear-tab .layui-tab-tool { + right: 0px; + border-left: 1px solid whitesmoke; +} + +.pear-tab .layui-tab-control .layui-tab-tool, +.pear-tab .layui-tab-control .layui-tab-prev, +.pear-tab .layui-tab-control .layui-tab-next { + display: none; +} + +.pear-tab.layui-tab-roll .layui-tab-control .layui-tab-prev, +.pear-tab.layui-tab-roll .layui-tab-control .layui-tab-next { + display: block; +} + +.pear-tab.layui-tab-roll .layui-tab-control .layui-tab-next { + right: 0px; + border-right: 1px solid whitesmoke; +} + +.pear-tab.layui-tab-roll .layui-tab-title { + padding-left: 40px; + padding-right: 40px; +} + +.pear-tab.layui-tab-tool .layui-tab-control .layui-tab-tool { + display: block; +} + +.pear-tab.layui-tab-tool .layui-tab-title { + padding-left: 0px; + padding-right: 40px; +} + +.pear-tab.layui-tab-rollTool .layui-tab-title { + padding-left: 40px; + padding-right: 80px; +} + +.pear-tab.layui-tab-rollTool .layui-tab-control .layui-tab-prev, +.pear-tab.layui-tab-rollTool .layui-tab-control .layui-tab-next, +.pear-tab.layui-tab-rollTool .layui-tab-control .layui-tab-tool { + display: block; +} + +.pear-tab .layui-tab-tool .layui-nav { + position: absolute; + height: 43px !important; + top: 0; + width: 100%; + height: 100%; + padding: 0; + background: 0 0; +} + +.pear-tab .layui-tab-tool .layui-nav-item { + height: 40px; +} + +.pear-tab .layui-tab-tool .layui-nav-bar { + display: none; +} + +.pear-tab .layui-tab-tool .layui-nav-child { + left: auto; + top: 45px; + right: 3px; + width: 120px; + border: 1px solid whitesmoke; +} + +.pear-tab .layui-tab-tool .layui-this a { + background-color: #009688; +} + +.pear-tab-loading { + position: absolute; + display: none; + width: 100%; + height: calc(100% - 42px); + top: 42px; + z-index: 19; + background-color: #fff +} + +.pear-tab-loading.close { + animation: close 1s; + -webkit-animation: close 1s; + animation-fill-mode: forwards; +} + +.ball-loader { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + -webkit-transform: translate(-50%, -50%) +} + +.ball-loader>span, +.signal-loader>span { + background-color: #4aca85 !important; + display: inline-block +} + +.ball-loader>span:nth-child(1), +.ball-loader.sm>span:nth-child(1), +.signal-loader>span:nth-child(1), +.signal-loader.sm>span:nth-child(1) { + -webkit-animation-delay: 0s; + animation-delay: 0s +} + +.ball-loader>span:nth-child(2), +.ball-loader.sm>span:nth-child(2), +.signal-loader>span:nth-child(2), +.signal-loader.sm>span:nth-child(2) { + -webkit-animation-delay: .1s; + animation-delay: .1s +} + +.ball-loader>span:nth-child(3), +.ball-loader.sm>span:nth-child(3), +.signal-loader>span:nth-child(3), +.signal-loader.sm>span:nth-child(3) { + -webkit-animation-delay: .15s; + animation-delay: .15s +} + +.ball-loader>span:nth-child(4), +.ball-loader.sm>span:nth-child(4), +.signal-loader>span:nth-child(4), +.signal-loader.sm>span:nth-child(4) { + -webkit-animation-delay: .2s; + animation-delay: .2s +} + +.ball-loader>span { + width: 20px; + height: 20px; + margin: 0 3px; + border-radius: 50%; + transform: scale(0); + -ms-transform: scale(0); + -webkit-transform: scale(0); + animation: ball-load 1s ease-in-out infinite; + -webkit-animation: 1s ball-load ease-in-out infinite +} + +@-webkit-keyframes ball-load { + 0% { + transform: scale(0); + -webkit-transform: scale(0) + } + + 50% { + transform: scale(1); + -webkit-transform: scale(1) + } + + 100% { + transform: scale(0); + -webkit-transform: scale(0) + } +} + +@keyframes ball-load { + 0% { + transform: scale(0); + -webkit-transform: scale(0) + } + + 50% { + transform: scale(1); + -webkit-transform: scale(1) + } + + 100% { + transform: scale(0); + -webkit-transform: scale(0) + } +} + +@-webkit-keyframes close { + 0% { + opacity: 1; + /*display: block;*/ + } + + 100% { + opacity: 0; + /*display: none;*/ + } +} diff --git a/static/component/pear/css/module/table.css b/static/component/pear/css/module/table.css new file mode 100644 index 000000000..848ccc1f5 --- /dev/null +++ b/static/component/pear/css/module/table.css @@ -0,0 +1,97 @@ +.layui-table-tool-panel { + margin-top: 10px !important; +} + +.layui-table-tool { + background-color: white !important; + border-bottom: none !important; + padding-bottom: 10px !important; +} + +.layui-table-header, +.layui-table-header th { + background-color: white !important; +} + +.layui-table-view { + border: none !important; +} + +.layui-table-cell { + height: 34px; + line-height: 34px; +} + +.layui-table .layui-laypage .layui-laypage-curr .layui-laypage-em { + border-radius: 50px !important; + border-radius: 4px!important; + background-color: #5FB878 !important; +} + +.layui-table-view .layui-table{ + width: 100%; +} + +.layui-table tr { + height: 34px; + line-height: 34px; +} + +.layui-table-cell { + padding-top: 1px !important; +} + +.layui-table-box * { + font-size: 13px !important; +} + +.layui-table-page .layui-laypage input { + width: 40px; + height: 26.5px!important; +} + +.layui-table-box button { + font-size: 15px !important; +} + +.layui-table-page { + height: 45px !important; + padding-top: 10px !important; +} + +.layui-table-tool .layui-inline { + border-radius: 3px !important; + width: 30px !important; + height: 30px !important; + line-height: 20px !important; +} + +.layui-table-view .layui-table[lay-skin=line] { + border: none !important; +} +.layui-table-body::-webkit-scrollbar { + width: 0px; + height: 0px; +} + +.layui-table-body::-webkit-scrollbar { + width: 6px; + height: 6px; +} +.layui-table-body::-webkit-scrollbar-track { + background: white; + border-radius: 2px; +} + +.layui-table-body::-webkit-scrollbar-thumb { + background: #E6E6E6; + border-radius: 2px; +} + +.layui-table-body::-webkit-scrollbar-thumb:hover { + background: #E6E6E6; +} + +.layui-table-body::-webkit-scrollbar-corner { + background: #f6f6f6; +} diff --git a/static/component/pear/css/module/tag.css b/static/component/pear/css/module/tag.css new file mode 100644 index 000000000..7c244bc20 --- /dev/null +++ b/static/component/pear/css/module/tag.css @@ -0,0 +1,85 @@ +.input-new-tag { + width: 90px; +} + +.input-new-tag input { + height: 100%!important; + border: none; + padding-left: 0px; +} + +.tag .layui-btn .tag-close:hover { + border-radius: 2px; + color: #fff; +} + +.tag .layui-btn .tag-close { + margin-left: 8px; + transition: all .2s; + -webkit-transition: all .2s; +} +.tag-item { + background-color: #5FB878; + color: white; + border: none; +} + +.tag-item:hover { + + color: white; + +} +.tag-item-normal { + background-color: #5FB878; + color: white; + border: none; +} + +.tag-item-warm { + background-color: #f6ad55; + color: white; + border: none; +} + +.tag-item-danger { + background-color: #f56c6c; + color: white; + border: none; +} + +.tag-item-dark { + background-color: #525252; + color: white; + border: none; +} + +.tag-item-primary { + background-color: white !important; + color: dimgray; + border: 1px solid dimgray; +} + +.tag-item-normal:hover { + + color: white !important; +} + +.tag-item-warm:hover { + + color: white; +} + +.tag-item-danger:hover { + + color: white; +} + +.tag-item-dark:hover { + + color: white; +} + +.tag-item-primary:hover { + color: dimgray; + border: 1px solid dimgray; +} \ No newline at end of file diff --git a/static/component/pear/css/module/toast.css b/static/component/pear/css/module/toast.css new file mode 100644 index 000000000..5472da53e --- /dev/null +++ b/static/component/pear/css/module/toast.css @@ -0,0 +1,1929 @@ +.iziToast-capsule { + font-size: 0; + height: 0; + width: 100%; + transform: translateZ(0); + backface-visibility: hidden; + transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), height 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); +} + +.iziToast-capsule, .iziToast-capsule * { + box-sizing: border-box; +} + +.iziToast-overlay { + display: block; + position: fixed; + top: -100px; + left: 0; + right: 0; + bottom: -100px; + z-index: 19891100; +} + +.iziToast { + display: inline-block; + clear: both; + position: relative; + font-family: 'Lato', Tahoma, Arial; + font-size: 14px; + padding: 8px 45px 9px 0; + background: #fff; + border-color: #fff; + width: 100%; + pointer-events: all; + cursor: default; + transform: translateX(0); + -webkit-touch-callout: none /* iOS Safari */; + -webkit-user-select: none /* Chrome/Safari/Opera */; + -khtml-user-select: none /* Konqueror */; + -moz-user-select: none /* Firefox */; + -ms-user-select: none /* Internet Explorer/Edge */; + user-select: none; + min-height: 45px; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1); + max-width: 90%; + margin: 5px 0; + border-radius: 4px; +} + +.iziToast > .iziToast-progressbar { + position: absolute; + left: 0; + bottom: 0; + width: 100%; + z-index: 1; + background: rgba(255, 255, 255, 0.5); +} + +.iziToast > .iziToast-progressbar > div { + height: 2px; + width: 100%; + background: #dddddd; + border-radius: 0 0 3px 3px; +} + +.iziToast.iziToast-theme-dark > .iziToast-progressbar > div { + background: #fff; +} + +.iziToast.iziToast-balloon:before { + content: ''; + position: absolute; + right: 8px; + left: auto; + width: 0px; + height: 0px; + top: 100%; + border-right: 0px solid transparent; + border-left: 15px solid transparent; + border-top: 10px solid #000; + border-top-color: inherit; + border-radius: 0; +} + +.iziToast.iziToast-balloon .iziToast-progressbar { + top: 0; + bottom: auto; +} + +.iziToast.iziToast-balloon > div { + border-radius: 0 0 0 3px; +} + +.iziToast > .iziToast-cover { + position: absolute; + left: 0; + top: 0; + bottom: 0; + height: 100%; + margin: 0; + background-size: 100%; + background-position: 50% 50%; + background-repeat: no-repeat; +} + +.iziToast > .iziToast-close { + position: absolute; + right: 0; + top: 0; + border: 0; + padding: 0; + opacity: 0.6; + width: 42px; + height: 100%; + background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAJPAAACTwBcGfW0QAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAD3SURBVFiF1ZdtDoMgDEBfdi4PwAX8vLFn0qT7wxantojKupmQmCi8R4tSACpgjC2ICCUbEBa8ingjsU1AXRBeR8aLN64FiknswN8CYefBBDQ3whuFESy7WyQMeC0ipEI0A+0FeBvHUFN8xPaUhAH/iKoWsnXHGegy4J0yxialOfaHJAz4bhRzQzgDvdGnz4GbAonZbCQMuBm1K/kcFu8Mp1N2cFFpsxsMuJqqbIGExGl4loARajU1twskJLLhIsID7+tvUoDnIjTg5T9DPH9EBrz8rxjPzciAl9+O8SxI8CzJ8CxKFfh3ynK8Dyb8wNHM/XDqejx/AtNyPO87tNybAAAAAElFTkSuQmCC") no-repeat 50% 50%; + background-size: 8px; + cursor: pointer; + outline: none; +} + +.iziToast > .iziToast-close:hover { + opacity: 1; +} + +.iziToast > .iziToast-body { + position: relative; + padding: 0 0 0 10px; + height: auto; + min-height: 28px; + margin: 0 0 0 15px; + text-align: left; +} + +.iziToast > .iziToast-body:after { + content: ""; + display: table; + clear: both; +} + +.iziToast > .iziToast-body .iziToast-texts { + margin: 6px 0; + padding-right: 2px; + display: inline-block; + float: left; +} + +.iziToast > .iziToast-body .iziToast-inputs { + min-height: 19px; + float: left; + margin: 3px -2px; +} + +.iziToast > .iziToast-body .iziToast-inputs > input:not([type=checkbox]):not([type=radio]), +.iziToast > .iziToast-body .iziToast-inputs > select { + position: relative; + display: inline-block; + margin: 2px; + border-radius: 2px; + border: 0; + padding: 4px 7px; + font-size: 13px; + letter-spacing: 0.02em; + background: rgba(0, 0, 0, 0.1); + color: #000; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); + min-height: 26px; +} + +.iziToast > .iziToast-body .iziToast-inputs > input:not([type=checkbox]):not([type=radio]):focus, +.iziToast > .iziToast-body .iziToast-inputs > select:focus { + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); +} + +.iziToast > .iziToast-body .iziToast-buttons { + min-height: 17px; + float: left; + margin: 4px 0 0 0; +} + +.iziToast > .iziToast-body .iziToast-buttons > a, +.iziToast > .iziToast-body .iziToast-buttons > button, +.iziToast > .iziToast-body .iziToast-buttons > input:not([type=checkbox]):not([type=radio]) { + position: relative; + display: inline-block; + margin: 2px; + border-radius: 2px; + border: 0; + padding: 5px 10px; + font-size: 12px; + letter-spacing: 0.02em; + cursor: pointer; + background: rgba(0, 0, 0, 0.1); + color: #555; +} + +.iziToast > .iziToast-body .iziToast-buttons > a:hover, +.iziToast > .iziToast-body .iziToast-buttons > button:hover, +.iziToast > .iziToast-body .iziToast-buttons > input:not([type=checkbox]):not([type=radio]):hover { + background: rgba(0, 0, 0, 0.15); +} + +.iziToast > .iziToast-body .iziToast-buttons > a:focus, +.iziToast > .iziToast-body .iziToast-buttons > button:focus, +.iziToast > .iziToast-body .iziToast-buttons > input:not([type=checkbox]):not([type=radio]):focus { + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); +} + +.iziToast > .iziToast-body .iziToast-buttons > a:active, +.iziToast > .iziToast-body .iziToast-buttons > button:active, +.iziToast > .iziToast-body .iziToast-buttons > input:not([type=checkbox]):not([type=radio]):active { + top: 1px; +} + +.iziToast > .iziToast-body .iziToast-icon { + height: 100%; + position: absolute; + left: 0; + top: 50%; + display: table; + font-size: 23px; + line-height: 24px; + margin-top: -11px; + color: #000; + width: 24px; + height: 24px; +} + +.iziToast > .iziToast-body .iziToast-icon.ico-info { + background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTU1NzcxMTk5MzYwIiBjbGFzcz0iaWNvbiIgc3R5bGU9IiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjEwODAzIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTUxMiAyOC40MTZjLTI2Ny40Njg4IDAtNDg0LjI0OTYgMjE2LjgzMi00ODQuMjQ5NiA0ODQuMjQ5NiAwIDI2Ny40MTc2IDIxNi44MzIgNDg0LjI0OTYgNDg0LjI0OTYgNDg0LjI0OTYgMjY3LjQxNzYgMCA0ODQuMzAwOC0yMTYuODMyIDQ4NC4zMDA4LTQ4NC4yNDk2Qzk5Ni4zMDA4IDI0NS4yNDggNzc5LjQxNzYgMjguNDE2IDUxMiAyOC40MTZ6TTQ1NS41MjY0IDI0NS4wOTQ0QzQ3MC4zMjMyIDIyOS44ODggNDkwLjcwMDggMjIxLjMzNzYgNTExLjc5NTIgMjIxLjY0NDhjMjEuMTk2OC0wLjIwNDggNDEuNzc5MiA4LjI0MzIgNTYuNTI0OCAyMy40NDk2IDE1LjAwMTYgMTQuNzk2OCAyMy4yOTYgMzUuMTIzMiAyMy4wOTEyIDU2LjExNTIgMC4yMDQ4IDIxLjE5NjgtOC4yOTQ0IDQxLjU3NDQtMjMuMzk4NCA1Ni4yMTc2LTE0LjY5NDQgMTQuNjk0NC0zNC43MTM2IDIzLjA0LTU1LjM5ODQgMjMuMDRMNTExLjc5NTIgMzgwLjQ2NzJjLTIwLjk5MiAwLjIwNDgtNDEuMzY5Ni04LjE0MDgtNTYuMDY0LTIzLjE0MjRDNDQwLjY3ODQgMzQyLjY4MTYgNDMyLjMzMjggMzIyLjMwNCA0MzIuNTM3NiAzMDEuMjA5NiA0MzIuMzMyOCAyODAuMjE3NiA0NDAuNjc4NCAyNTkuODkxMiA0NTUuNTI2NCAyNDUuMDk0NHpNNjI3LjYwOTYgNzY4LjE1MzZsMCAxMy40MTQ0IDAgMjIuMjIwOEwzOTYuMjg4IDgwMy43ODg4bDAtNTcuMTM5MiAyMS42MDY0LTAuNzY4YzEwLjI0LTAuNDYwOCAxNC41OTItMi43MTM2IDE2Ljk5ODQtNC43NjE2bDEuMjI4OC01LjQyNzJjMC45NzI4LTUuNTgwOCAxLjYzODQtMTQuNDM4NCAxLjU4NzItMjUuOTA3Mkw0MzcuNzA4OCA1MDcuOTA0YzAuMjU2LTE3Ljc2NjQtMi4zNTUyLTI5LjkwMDgtMy40ODE2LTMyLjU2MzJsMCAwTDQzMS42MTYgNDc0LjA2MDhDNDI4Ljg1MTIgNDczLjA4OCA0MjMuOTM2IDQ3Mi4wNjQgNDE3LjE3NzYgNDcxLjY1NDRMMzk2LjI4OCA0NzAuMzc0NCAzOTYuMjg4IDQxMy40OTEybDE4OS40OTEyIDAgMCAyOTYuMjk0NGMtMC4zMDcyIDE3LjcxNTIgMi40MDY0IDI5Ljc5ODQgMy40MzA0IDMyLjU2MzJsMC4wNTEyIDAgMi43MTM2IDEuMTc3NmMyLjgxNiAwLjk3MjggNy43ODI0IDEuOTk2OCAxNC42OTQ0IDIuMzU1MmwyMC44ODk2IDEuMjhMNjI3LjU1ODQgNzY4LjE1MzZ6IiBwLWlkPSIxMDgwNCIgZmlsbD0iIzQwOUVGRiI+PC9wYXRoPjwvc3ZnPg==") no-repeat 50% 50%; + background-size: 85%; +} + +.iziToast > .iziToast-body .iziToast-icon.ico-warning { + background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTU1NzcwODczNzUzIiBjbGFzcz0iaWNvbiIgc3R5bGU9IiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjUxMTgiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PGRlZnM+PHN0eWxlIHR5cGU9InRleHQvY3NzIj48L3N0eWxlPjwvZGVmcz48cGF0aCBkPSJNNTEyLjAyMzI3MyAxMDI0Qzc5NC43NjM2MzYgMTAyNCAxMDI0IDc5NC43ODY5MDkgMTAyNCA1MTEuOTc2NzI3IDEwMjQgMjI5LjIzNjM2NCA3OTQuNzg2OTA5LTAuMDIzMjczIDUxMi4wMjMyNzMtMC4wMjMyNzNTMCAyMjkuMjEzMDkxIDAgNTExLjk3NjcyN0MwIDc5NC43ODY5MDkgMjI5LjIzNjM2NCAxMDI0IDUxMi4wMjMyNzMgMTAyNE00NjkuMzQxMDkxIDc2OGMwLTIzLjU1MiAxOC45MjA3MjctNDIuNjU4OTA5IDQyLjcwNTQ1NS00Mi42NTg5MDkgMjMuNTUyIDAgNDIuNjU4OTA5IDE4LjkyMDcyNyA0Mi42NTg5MDkgNDIuNjU4OTA5IDAgMjMuNTc1MjczLTE4LjkyMDcyNyA0Mi43MDU0NTUtNDIuNjU4OTA5IDQyLjcwNTQ1NUM0ODguNDcxMjczIDgxMC43MDU0NTUgNDY5LjM0MTA5MSA3OTEuNzM4MTgyIDQ2OS4zNDEwOTEgNzY4TTQ2OS4zNDEwOTEgMjU1LjgxMzgxOGMwLTIzLjQ1ODkwOSAxOC45MjA3MjctNDIuNDcyNzI3IDQyLjcwNTQ1NS00Mi40NzI3MjcgMjMuNTUyIDAgNDIuNjU4OTA5IDE5LjQzMjcyNyA0Mi42NTg5MDkgNDIuNDcyNzI3bDAgMzQxLjczNjcyN2MwIDIzLjQ1ODkwOS0xOC45MjA3MjcgNDIuNDcyNzI3LTQyLjY1ODkwOSA0Mi40NzI3MjctMjMuNTc1MjczIDAtNDIuNzA1NDU1LTE5LjQzMjcyNy00Mi43MDU0NTUtNDIuNDcyNzI3TDQ2OS4zNDEwOTEgMjU1LjgxMzgxOHoiIHAtaWQ9IjUxMTkiIGZpbGw9IiNmZjk5MDAiPjwvcGF0aD48L3N2Zz4=") no-repeat 50% 50%; + background-size: 85%; +} + +.iziToast > .iziToast-body .iziToast-icon.ico-error { + background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTU1NzcwNDI1NDkwIiBjbGFzcz0iaWNvbiIgc3R5bGU9IiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjEyNjUiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PGRlZnM+PHN0eWxlIHR5cGU9InRleHQvY3NzIj48L3N0eWxlPjwvZGVmcz48cGF0aCBkPSJNNTExLjk5NjQxOCAyMy41MjA2OTNjLTI2OS43NjcwNSAwLTQ4OC40NTQ3NDggMjE4LjY4ODcyMS00ODguNDU0NzQ4IDQ4OC40NTQ3NDggMCAyNjkuNzY4MDczIDIxOC42ODg3MjEgNDg4LjQ1MzcyNCA0ODguNDU0NzQ4IDQ4OC40NTM3MjQgMjY5Ljc2NjAyNyAwIDQ4OC40NTQ3NDgtMjE4LjY4NTY1MSA0ODguNDU0NzQ4LTQ4OC40NTM3MjRDMTAwMC40NTExNjYgMjQyLjIwOTQxNCA3ODEuNzYyNDQ1IDIzLjUyMDY5MyA1MTEuOTk2NDE4IDIzLjUyMDY5M3pNNzY5LjMzNDM5MSA3MTUuMTU1OTU2bC01NC4xNTY0MzQgNTQuMTU2NDM0TDUxMS45OTY0MTggNTY2LjEyOTgyOCAzMDguODEzODU2IDc2OS4zMTIzOWwtNTQuMTU1NDExLTU0LjE1NjQzNEw0NTcuODQxMDA4IDUxMS45NzU0NDEgMjU0LjY1ODQ0NiAzMDguNzkyODc4bDU0LjE1NTQxMS01NC4xNTU0MTFMNTExLjk5NjQxOCA0NTcuODIwMDNsMjAzLjE4MjU2Mi0yMDMuMTgyNTYyIDU0LjE1NjQzNCA1NC4xNTU0MTFMNTY2LjE1MTgyOSA1MTEuOTc1NDQxIDc2OS4zMzQzOTEgNzE1LjE1NTk1NnoiIHAtaWQ9IjEyNjYiIGZpbGw9IiNGNTZDNkMiPjwvcGF0aD48L3N2Zz4=") no-repeat 50% 50%; + background-size: 80%; +} + +.iziToast > .iziToast-body .iziToast-icon.ico-success { + background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTU1NzcwNTI2MjA3IiBjbGFzcz0iaWNvbiIgc3R5bGU9IiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjQ5NjUiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PGRlZnM+PHN0eWxlIHR5cGU9InRleHQvY3NzIj48L3N0eWxlPjwvZGVmcz48cGF0aCBkPSJNMTAyNCA1MTEuOTk5NTAyYzAgMjgyLjc3MDU1Ny0yMjkuMjI5OTQxIDUxMi4wMDA0OTgtNTExLjk5OTUwMiA1MTIuMDAwNDk4LTI4Mi43Njk1NjEgMC01MTIuMDAwNDk4LTIyOS4yMjk5NDEtNTEyLjAwMDQ5OC01MTIuMDAwNDk4IDAtMjgyLjc2ODU2NiAyMjkuMjMwOTM2LTUxMS45OTk1MDIgNTEyLjAwMDQ5OC01MTEuOTk5NTAyQzc5NC43NjkwNjQgMCAxMDI0IDIyOS4yMzA5MzYgMTAyNCA1MTEuOTk5NTAyek03OTYuNTc3MDgxIDM3OC4zMTc3MTNsLTQ4LjQ1OTA1MS00OC40NTkwNTEtMjk3LjA3ODM4NyAyOTcuMDc3MzkyTDI3Ny4yNjc4NTIgNDUzLjE2NTI1OGwtNDguNDU4MDU2IDQ4LjQ1ODA1NiAyMjIuMjI4ODUxIDIyMi4yMzA4NDJMNzk2LjU3NzA4MSAzNzguMzE3NzEzeiIgcC1pZD0iNDk2NiIgZmlsbD0iIzY3YzIzYSI+PC9wYXRoPjwvc3ZnPg==") no-repeat 50% 50%; + background-size: 85%; +} + +.iziToast > .iziToast-body .iziToast-icon.ico-question { + background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAQAAAAAYLlVAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAKqNIzIAAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfhCQkUEhFovxTxAAAEDklEQVRo3s2ZTWgTQRTHf03ipTRUqghNSgsRjHgQrFUQC6JgD1Kak3gQUUoPqRdBglf1oBehBws9Cn4cGk+1SOmh2upBxAYVoeJHrR9tgq0i1Cq0lqYeks7MbpPdmU00/c8hm9n33v/t7Nt5M2+qMEWQI0QIibZKRrQpHvLL2KI2wnQzzBKrDm2RIeKEy01dTYKUI7G1ZRknQXV5yP10kTYgly1NF/5S6duZ8ES+1iZodyaocrjXxE0OFeifYYgp0mRIkwFChAkRJsIxGgrIP+I0n82fvZW5dc/zkss0O2o1c5mX6/TmaDWl77RFe5YkUW3tKEmyFv0lOvXJ/fTYnmCEFuMRbGHEZqVHLyT9DFjUJmkzJl9DG5MWWwM6Llif/gF1nukB6nhgGwUXdFrE+wiURA8QoM9i0zEWWpXQW+ZsyeRrOMuyEo5Fv4gmy4dXPvqcC+pH2VRYaMwy+OWG+iLGCgm0W0Kv9HdvR8ASjmKCXpuK/bxiV/76A/v5UdDIZuKcJGjrnec5KZ7wwsWFOp6xPX/9mt2sqDe7FO+Kf/fXHBPPDWpdXGhTpLvUG9VKwh1xMDDjkvu+cNDFBTk7ptX1QkKZ850m3duu6fcrWxwdaFFyREJ2j4vOpKP6Du6z4uJCv8sYJIVkCnJBGGZaBONO3roY2EqNrSfIPi7SKP4fdXyNUd6I6wbSAHEl33tFLe+FlSsusnK90A0+oEPcuufZgXnOi+u9LrKSJQZQw6LwqBnv2CKsfHORbFbyQhA6xN/pEuihSdj56Co7LWRjPiKie6gkB2LiKuUqK5kiPkLiz1QJ9K1cNXBAMoUCigNpQ9IqDtMI1HKA4/jyvUsaoSyZLA5kjOjDPFZen8Ql5TsvBskUgjciIPSX3QAXC86DT7VWvlEh/xZ+ij9BDVWJ0QL0SbZq6QaFxoLPcXPmBLveLCc4wXdDK6s+6/vwhCSniFLPXW0NJe5UB8zKCsviqpc7vGPVQFcyZbyPwGD+d5ZnxmNWlhG4xSBZZjivjIWHEQgoDkSMjMwTo54569JSE5IpA7EyJSMTyGTUAUFlO1ZKOtaHTMeL1PhYYFTcihmY2cQ5+ullj7EDkiVfVez2sCTz8yiv84djhg7IJVk81xFWJlPdfHBG0flkRC/zQFZ+DSllNtfDdUsOMCliyGX5uOzU3ZhIXFDof4m1gDuKbEx0t2YS25gVGpcMnr/I1kx3c6piB8P8ZoqEwfMX3ZyCXynJTmq/U7NUXqfUzCbWL1wqVKBQUeESzQYoUlW8TAcVL1RCxUu1G6BYXfFyfQ4VPbDI4T8d2WzgQ6sc/vmxnTsqfHCZQzUJxm1h5dxS5Tu6lQgTZ0ipqRVqSwzTbbLHMt+c19iO76tsx/cLZub+Ali+tYC93olEAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE3LTA5LTA5VDIwOjE4OjE3KzAyOjAwjKtfjgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNy0wOS0wOVQyMDoxODoxNyswMjowMP325zIAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAAAElFTkSuQmCC") no-repeat 50% 50%; + background-size: 85%; +} + +.iziToast > .iziToast-body .iziToast-icon.ico-load { + background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTQ1NTUyMzAyOTE3IiBjbGFzcz0iaWNvbiIgc3R5bGU9IiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjQyNDAiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PGRlZnM+PHN0eWxlIHR5cGU9InRleHQvY3NzIj48L3N0eWxlPjwvZGVmcz48cGF0aCBkPSJNNTEyIDY0YzI0Ny4yIDAgNDQ4IDIwMC44IDQ0OCA0NDhoLTY0YzAtMjEyLTE3Mi0zODQtMzg0LTM4NFY2NHogbTAgODMyYy0yMTIgMC0zODQtMTcyLTM4NC0zODRINjRjMCAyNDcuMiAyMDAuOCA0NDggNDQ4IDQ0OHYtNjR6IiBwLWlkPSI0MjQxIiBmaWxsPSIjMUU5RkZGIj48L3BhdGg+PC9zdmc+') no-repeat 50% 50%; + background-size: 85%; + animation: rotating 1.2s linear infinite +} + +@keyframes rotating { + from { + transform: rotate(0) + } + to { + transform: rotate(360deg) + } +} + +.iziToast > .iziToast-body .iziToast-title { + padding: 0; + margin: 0 0 10px 0; + line-height: 16px; + font-size: 14px; + text-align: left; + float: left; + color: #303133; + white-space: normal; +} + +.iziToast > .iziToast-body .iziToast-message { + padding: 0; + margin: 0; + font-size: 14px; + line-height: 16px; + text-align: left; + float: left; + color: #606266; + white-space: normal; +} + +.iziToast.iziToast-animateInside .iziToast-title, +.iziToast.iziToast-animateInside .iziToast-message, +.iziToast.iziToast-animateInside .iziToast-icon, +.iziToast.iziToast-animateInside .iziToast-buttons-child, +.iziToast.iziToast-animateInside .iziToast-inputs-child { + opacity: 0; +} + +.iziToast-target { + position: relative; + width: 100%; + margin: 0 auto; +} + +.iziToast-target .iziToast-capsule { + overflow: hidden; +} + +.iziToast-target .iziToast-capsule:after { + visibility: hidden; + display: block; + font-size: 0; + content: " "; + clear: both; + height: 0; +} + +.iziToast-target .iziToast-capsule .iziToast { + width: 100%; + float: left; +} + +.iziToast-wrapper { + z-index: 19891101; + position: fixed; + width: 100%; + pointer-events: none; + display: flex; + flex-direction: column; +} + +.iziToast-wrapper .iziToast.iziToast-balloon:before { + border-right: 0 solid transparent; + border-left: 15px solid transparent; + border-top: 10px solid #000; + border-top-color: inherit; + right: 8px; + left: auto; +} + +.iziToast-wrapper-bottomLeft { + left: 0; + bottom: 0; + text-align: left; +} + +.iziToast-wrapper-bottomLeft .iziToast.iziToast-balloon:before { + border-right: 15px solid transparent; + border-left: 0 solid transparent; + right: auto; + left: 8px; +} + +.iziToast-wrapper-bottomRight { + right: 0; + bottom: 0; + text-align: right; +} + +.iziToast-wrapper-topLeft { + left: 0; + top: 0; + text-align: left; +} + +.iziToast-wrapper-topLeft .iziToast.iziToast-balloon:before { + border-right: 15px solid transparent; + border-left: 0 solid transparent; + right: auto; + left: 8px; +} + +.iziToast-wrapper-topRight { + top: 0; + right: 0; + text-align: right; +} + +.iziToast-wrapper-topCenter { + top: 0; + left: 0; + right: 0; + text-align: center; +} + +.iziToast-wrapper-bottomCenter { + bottom: 0; + left: 0; + right: 0; + text-align: center; +} + +.iziToast-wrapper-center { + top: 0; + bottom: 0; + left: 0; + right: 0; + text-align: center; + justify-content: center; + flex-flow: column; + align-items: center; +} + +.iziToast-rtl { + direction: rtl; + padding: 8px 0 9px 45px; + font-family: Tahoma, 'Lato', Arial; +} + +.iziToast-rtl .iziToast-cover { + left: auto; + right: 0; +} + +.iziToast-rtl .iziToast-close { + right: auto; + left: 0; +} + +.iziToast-rtl .iziToast-body { + padding: 0 10px 0 0; + margin: 0 16px 0 0; + text-align: right; +} + +.iziToast-rtl .iziToast-body .iziToast-buttons, +.iziToast-rtl .iziToast-body .iziToast-inputs, +.iziToast-rtl .iziToast-body .iziToast-texts, +.iziToast-rtl .iziToast-body .iziToast-title, +.iziToast-rtl .iziToast-body .iziToast-message { + float: right; + text-align: right; +} + +.iziToast-rtl .iziToast-body .iziToast-icon { + left: auto; + right: 0; +} + +@media only screen and (min-width: 568px) { + .iziToast-wrapper { + padding: 10px 15px; + } + + .iziToast { + width: auto; + } + + .iziToast:not(.iziToast-rtl) .iziToast-cover { + border-radius: 3px 0 0 3px; + } + + .iziToast.iziToast-rtl .iziToast-cover { + border-radius: 0 3px 3px 0; + } + + .iziToast.iziToast-color-dark:after { + box-shadow: inset 0 -10px 20px -10px rgba(255, 255, 255, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.25); + } + + .iziToast.iziToast-balloon .iziToast-progressbar { + background: transparent; + } + + .iziToast.iziToast-balloon:after { + box-shadow: 0 10px 10px -5px rgba(0, 0, 0, 0.25), inset 0 10px 20px -5px rgba(0, 0, 0, 0.25); + } + + .iziToast-target .iziToast:after { + box-shadow: inset 0 -10px 20px -10px rgba(0, 0, 0, 0.2), inset 0 0 5px rgba(0, 0, 0, 0.1); + } +} + +.iziToast.iziToast-theme-dark { + background: #565c70; + border-color: #565c70; +} + +.iziToast.iziToast-theme-dark .iziToast-title { + color: #fff; +} + +.iziToast.iziToast-theme-dark .iziToast-message { + color: rgba(255, 255, 255, 0.9); + font-weight: 300; +} + +.iziToast.iziToast-theme-dark .iziToast-close { + background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAKqNIzIAAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfgCR4OIQIPSao6AAAAwElEQVRIx72VUQ6EIAwFmz2XB+AConhjzqTJ7JeGKhLYlyx/BGdoBVpjIpMJNjgIZDKTkQHYmYfwmR2AfAqGFBcO2QjXZCd24bEggvd1KBx+xlwoDpYmvnBUUy68DYXD77ESr8WDtYqvxRex7a8oHP4Wo1Mkt5I68Mc+qYqv1h5OsZmZsQ3gj/02h6cO/KEYx29hu3R+VTTwz6D3TymIP1E8RvEiiVdZfEzicxYLiljSxKIqlnW5seitTW6uYnv/Aqh4whX3mEUrAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE2LTA5LTMwVDE0OjMzOjAyKzAyOjAwl6RMVgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNi0wOS0zMFQxNDozMzowMiswMjowMOb59OoAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAAAElFTkSuQmCC") no-repeat 50% 50%; + background-size: 8px; +} + +.iziToast.iziToast-theme-dark .iziToast-icon { + color: #fff; +} + +.iziToast.iziToast-theme-dark .iziToast-icon.ico-info { + background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTQxNjQ5NjA1MTc2IiBjbGFzcz0iaWNvbiIgc3R5bGU9IiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjM1MzIiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCI+PGRlZnM+PHN0eWxlIHR5cGU9InRleHQvY3NzIj48L3N0eWxlPjwvZGVmcz48cGF0aCBkPSJNODUxLjE3MTU1NiA3MTcuOTM3Nzc4YzMuMjQyNjY3IDExLjk0NjY2NyAyLjg0NDQ0NCAyNC40NjIyMjItMS40MjIyMjMgMzYuNDA4ODg5YTYyLjkxOTExMSA2Mi45MTkxMTEgMCAwIDEtMjEuOTU5MTExIDI5LjUyNTMzMyA2NS4yNTE1NTYgNjUuMjUxNTU2IDAgMCAxLTM4LjkxMiAxMi41MTU1NTZIMTc4LjExOTExMWE2NC44NTMzMzMgNjQuODUzMzMzIDAgMCAxLTM4Ljc5ODIyMi0xMi41NzI0NDUgNjIuMjM2NDQ0IDYyLjIzNjQ0NCAwIDAgMS0yMi4wMTYtMjkuNTI1MzMzIDYwLjY0MzU1NiA2MC42NDM1NTYgMCAwIDEtMS4zNjUzMzMtMzYuNDA4ODg5YzMuNTg0LTEzLjE0MTMzMyAxMS40MzQ2NjctMjQuNTc2IDIyLjY5ODY2Ni0zMy4xMDkzMzNsNTguNDgxNzc4LTQ0LjAzMmE0MC43MzI0NDQgNDAuNzMyNDQ0IDAgMCAwIDE2LjQ5Nzc3OC0zMi43MTExMTJ2LTIwMy4wOTMzMzNjMC0zNS4yMTQyMjIgNy4xNjgtNjkuNTE4MjIyIDIxLjIxOTU1NS0xMDEuNzE3MzMzIDEzLjY1MzMzMy0zMS4xNzUxMTEgMzMuMTA5MzMzLTU5LjE2NDQ0NCA1Ny44NTYtODMuMTE0NjY3QTI2OC44NTY4ODkgMjY4Ljg1Njg4OSAwIDAgMSA0MTQuNzIgMTUyLjA2NHYtMjguNTAxMzMzQzQxNC43MiA4Ni44MTI0NDQgNDQ1LjYxMDY2NyA1Ni44ODg4ODkgNDgzLjU1NTU1NiA1Ni44ODg4ODljMzcuOTQ0ODg5IDAgNjguODM1NTU2IDI5LjkyMzU1NiA2OC44MzU1NTUgNjYuNjczNzc4djI4LjUwMTMzM2MxMi4zNDQ4ODkgMy4xODU3NzggMjQuNDYyMjIyIDcuMTY4IDM2LjIzODIyMiAxMi4wMDM1NTZhMjY4LjY4NjIyMiAyNjguNjg2MjIyIDAgMCAxIDg1Ljc4ODQ0NSA1Ni4wMzU1NTVjMjQuNzQ2NjY3IDI0LjAwNzExMSA0NC4yMDI2NjcgNTEuOTM5NTU2IDU3Ljc5OTExMSA4My4wNTc3NzggMTQuMTA4NDQ0IDMyLjMxMjg4OSAyMS4yMTk1NTYgNjYuNTYgMjEuMjE5NTU1IDEwMS44MzExMTF2MjAzLjA5MzMzM2MwIDEyLjg1Njg4OSA2LjAzMDIyMiAyNC44NjA0NDQgMTYuNTU0NjY3IDMyLjcxMTExMWw1OC40ODE3NzggNDQuMDMyYzExLjIwNzExMSA4LjUzMzMzMyAxOS4wNTc3NzggMTkuOTExMTExIDIyLjc1NTU1NSAzMy4wNTI0NDV6TTM5OC4yMjIyMjIgODU2LjE3Nzc3OFY4NTMuMzMzMzMzaDE3MC42NjY2Njd2Mi44NDQ0NDVDNTY4Ljg4ODg4OSA5MzUuOTM2IDUzMC42MDI2NjcgOTY3LjExMTExMSA0ODMuNTU1NTU2IDk2Ny4xMTExMTFTMzk4LjIyMjIyMiA5MzUuOTM2IDM5OC4yMjIyMjIgODU2LjE3Nzc3OHoiIHAtaWQ9IjM1MzMiIGZpbGw9IiNmZmZmZmYiPjwvcGF0aD48L3N2Zz4=") no-repeat 50% 50%; + background-size: 85%; +} + +.iziToast.iziToast-theme-dark .iziToast-icon.ico-warning { + background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTQxNjUxMTE1OTQ4IiBjbGFzcz0iaWNvbiIgc3R5bGU9IiIgdmlld0JveD0iMCAwIDEwMjUgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjUwOTYiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTI4LjEyNSIgaGVpZ2h0PSIxMjgiPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTk4NC4wMjI5NTAwMiA3NDYuODc1NDk3NUw2NDEuOTY0NjA3NTIgMTMwLjM4MDY1Yy0zMC40OTE4NDI1LTU0Ljg2MTUwMjUtNzcuOTMxMzE1LTg2LjMzNTY3MjUtMTMwLjE0MzUxLTg2LjMzNTY3MjUtNTIuMjkxNTc1IDAtOTkuNzQwOTcgMzEuNTEzODYtMTMwLjE0MzUxIDg2LjQzNDg5NzVMMzkuOTc2NDU1MDIgNzQ2LjgyNTg4NUM5Ljk2MDg5MjUyIDgwMC45NjMwNDUgNy45MTY4NTc1MiA4NTguMDE3NDIgMzQuMzUwMzk3NTIgOTAzLjM1MzMyMjVjMjYuNTEyOTIgNDUuNDc0ODE3NSA3Ny4xOTcwNSA3MS41NjEwNyAxMzkuMDczNzYgNzEuNTYxMDdoNjc3LjIyMDU0NzVjNjEuOTA2NDc3NSAwIDExMi41OTA2MDc1LTI2LjA4NjI1MjUgMTM5LjAxNDIyNS03MS40OTE2MTI1IDI2LjQ4MzE1MjUtNDUuMjc2MzY3NSAyNC40MjkxOTUtMTAyLjM0MDY2NS01LjYzNTk4LTE1Ni41NDcyODI1ek05MTEuNzU3MzgyNTIgODU3Ljk5NzU3NWMtOS44OTI3MzI1IDE2Ljk4NzMyLTMyLjE1ODgyMjUgMjYuNzMxMjE1LTYxLjExMjY3NzUgMjYuNzMxMjE1SDE3My40MjQxNTc1MmMtMjguOTQzOTMyNSAwLTUxLjIyOTg2NzUtOS43NjM3NC02MS4xNjIyOS0yNi43OTA3NS0xMC4wMjE3MjUtMTcuMTg1NzctNy42MTA1NTc1LTQxLjc0Mzk1NzUgNi41ODg1NC02Ny4zNzM3NzVsMzQxLjcxMTA1NS02MTYuMzY1ODU1YzE0LjA2MDE4MjUtMjUuMzkxNjc3NSAzMi43NTQxNzI1LTM5Ljk1NzkwNzUgNTEuMjU5NjM1LTM5Ljk1NzkwNzUgMTguNDk1NTQgMCAzNy4xOTk0NTI1IDE0LjU2NjIzIDUxLjMwOTI0NzUgMzkuOTM4MDYyNWwzNDIuMDI4NTc1IDYxNi40NDUyMzVjMTQuMjI4ODY1IDI1LjY0OTY2MjUgMTYuNjQwMDMyNSA1MC4xODgwMDUgNi41OTg0NjI1IDY3LjM3Mzc3NXoiIGZpbGw9IiNmZmZmZmYiIHAtaWQ9IjUwOTciPjwvcGF0aD48cGF0aCBkPSJNNTEyLjAxOTU0NzUyIDYzMC4yODYxMjI1YTQ1LjA4Nzg0IDQ1LjA4Nzg0IDAgMCAwIDQ1LjA5Nzc2MjUtNDUuMDA4NDZWMzc0LjY1Mjc1NWE0NS4wNzc5MTc1IDQ1LjA3NzkxNzUgMCAwIDAtNDUuMDk3NzYyNS00NS4wMDg0NiA0NS4wODc4NCA0NS4wODc4NCAwIDAgMC00NS4wOTc3NjI1IDQ1LjAwODQ2djIxMC42MTQ5ODVhNDUuMDg3ODQgNDUuMDg3ODQgMCAwIDAgNDUuMDk3NzYyNSA0NS4wMTgzODI1ek01MTIuMDE5NTQ3NTIgNjc1LjM3Mzk2MjVhNjAuMTcwMDQgNjAuMTcwMDQgMCAwIDAtNjAuMTMwMzUgNjAuMTMwMzVjMCAzMy4xNDExNSAyNi45MTk3NDI1IDYwLjEzMDM1IDYwLjEzMDM1IDYwLjEzMDM1IDMzLjE0MTE1IDAgNjAuMTMwMzUtMjYuOTE5NzQyNSA2MC4xMzAzNS02MC4xMzAzNSAwLTMzLjE0MTE1LTI2LjkxOTc0MjUtNjAuMTMwMzUtNjAuMTMwMzUtNjAuMTMwMzV6IiBmaWxsPSIjZmZmZmZmIiBwLWlkPSI1MDk4Ij48L3BhdGg+PC9zdmc+") no-repeat 50% 50%; + background-size: 85%; +} + +.iziToast.iziToast-theme-dark .iziToast-icon.ico-error { + background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTQxNjUxMzE1NTQ3IiBjbGFzcz0iaWNvbiIgc3R5bGU9IiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjY4MDYiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCI+PGRlZnM+PHN0eWxlIHR5cGU9InRleHQvY3NzIj48L3N0eWxlPjwvZGVmcz48cGF0aCBkPSJNNzcyLjI2NjY2NyA4ODMuMmMyNS42IDI1LjYgNjQgMjUuNiA4OS42IDAgMjUuNi0yNS42IDI1LjYtNjQgMC04OS42TDIzMC40IDE2Mi4xMzMzMzNjLTI1LjYtMjUuNi02NC0yNS42LTg5LjYgMC0yNS42IDI1LjYtMjUuNiA2NCAwIDg5LjZsNjMxLjQ2NjY2NyA2MzEuNDY2NjY3eiIgcC1pZD0iNjgwNyIgZmlsbD0iI2ZmZmZmZiI+PC9wYXRoPjxwYXRoIGQ9Ik04NjEuODY2NjY3IDI1MS43MzMzMzNjMjUuNi0yNS42IDI1LjYtNjQgMC04OS42LTI1LjYtMjUuNi02NC0yNS42LTg5LjYgMEwxNDAuOCA3OTMuNmMtMjUuNiAyNS42LTI1LjYgNjQgMCA4OS42czY0IDI1LjYgODkuNiAwbDYzMS40NjY2NjctNjMxLjQ2NjY2N3oiIHAtaWQ9IjY4MDgiIGZpbGw9IiNmZmZmZmYiPjwvcGF0aD48L3N2Zz4=") no-repeat 50% 50%; + background-size: 80%; +} + +.iziToast.iziToast-theme-dark .iziToast-icon.ico-success { + background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTQxNjUxMjQyNTMxIiBjbGFzcz0iaWNvbiIgc3R5bGU9IiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjYwMjMiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCI+PGRlZnM+PHN0eWxlIHR5cGU9InRleHQvY3NzIj48L3N0eWxlPjwvZGVmcz48cGF0aCBkPSJNNDA0LjI1MTQyOCA4MDkuNjEwN2MtMTEuNjY0MTAyIDAtMjMuMzI3MTc5LTQuNDQ4NzgyLTMyLjIyNTc2Ny0xMy4zNDczNjlMODMuOTgwMDk4IDUwOC4yMTk4MTVjLTE3Ljc5ODE5OS0xNy43OTcxNzUtMTcuNzk4MTk5LTQ2LjY1MzMzNSAwLTY0LjQ1MTUzM3M0Ni42NTMzMzUtMTcuNzk4MTk5IDY0LjQ1MTUzNCAwbDI4OC4wNDQ1MzkgMjg4LjA0MjQ5MWMxNy43OTgxOTkgMTcuNzk4MTk5IDE3Ljc5ODE5OSA0Ni42NTQzNTkgMCA2NC40NTI1NTgtOC44OTc1NjMgOC44OTg1ODctMjAuNTYxNjY1IDEzLjM0NzM2OS0zMi4yMjQ3NDMgMTMuMzQ3MzY5eiIgcC1pZD0iNjAyNCIgZmlsbD0iI2ZmZmZmZiI+PC9wYXRoPjxwYXRoIGQ9Ik00MDQuMjczOTUzIDgwOS42MTE3MjNjLTExLjY2NDEwMiAwLTIzLjMyNjE1NS00LjQ0OTgwNi0zMi4yMjU3NjYtMTMuMzQ4MzkyLTE3Ljc5ODE5OS0xNy43OTcxNzUtMTcuNzk5MjIyLTQ2LjY1MzMzNS0wLjAwMTAyNC02NC40NTE1MzRMODc2LjEwMTgxMyAyMjcuNzM1NjQ2YzE3Ljc5NjE1MS0xNy43OTgxOTkgNDYuNjUzMzM1LTE3Ljc5OTIyMiA2NC40NTE1MzMtMC4wMDEwMjQgMTcuNzk4MTk5IDE3Ljc5NzE3NSAxNy43OTkyMjIgNDYuNjUzMzM1IDAuMDAxMDI0IDY0LjQ1MTUzM0w0MzYuNTAwNzQ0IDc5Ni4yNjIzMDdjLTguODk4NTg3IDguODk4NTg3LTIwLjU2MjY4OSAxMy4zNDk0MTctMzIuMjI2NzkxIDEzLjM0OTQxNnoiIHAtaWQ9IjYwMjUiIGZpbGw9IiNmZmZmZmYiPjwvcGF0aD48L3N2Zz4=") no-repeat 50% 50%; + background-size: 85%; +} + +.iziToast.iziToast-theme-dark .iziToast-icon.ico-question { + background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAQAAAAAYLlVAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAKqNIzIAAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfhCQkUEg18vki+AAAETUlEQVRo3s1ZTWhbRxD+VlIuxsLFCYVIIQYVopBDoK5bKDWUBupDMNbJ5FBKg/FBziUQdE9yaC+FHBrwsdCfQ9RTGoLxwWl+DqHEojUFFydxnB9bInZDqOsErBrr6yGvs/ueX97bldTKo4Pe7puZb3Z33s7srIIjMY1jyCEjP6ImvyX8pF64arSHznKC06wzijY5xSKz7YbuYokV2lODsyyxqz3gSY6z6gCuqcpxJluFH+Z8U+D/0jyHoxFUBHgfvsGHIS9WMIUlVFFDFTUAGWSRQRY5HMeBEP6b+Ew9dh/7INd2jGeO59kfKdXP85zbIbfGQVf4sYC3N1hm3lo6zzIbPvk6x+zBk7wQGMEMB5xncIAzAS0XrFySSV72iS1yyBVcdA1x0afrsoUJgdFfY2+z8ADAXl7zz0KcwJiPfZKpVuABgClO+nRG+QIHDdfb4qlWwUXvKW4Z7vi6L4J9vg+vbfCeCeZH2RfOdMOc/HbCA4BvIW6EMQz7XK/ltd+hP+VzR9mgva2YSfyGI17fA7ynnocqeQNFfIJ0oHsdv6CC2+rXGBN6cQdveY3fcVRtmy/HDete+93zy8jA8zV7YkwYMrjHzRddRsCdiVCwwmh6wg9iTNC7Y9XIF1iS7kbUpsvvGEdPuTfSgAEjRpR096x0liPFD/Eqt2NMuBQzB2XhrACAApjFsuQFh9XdGAX70B3oSuNdnMVBaX+sopYxjwVpHFBVACyKTXNoktjD+6Ll8xhenS9MAAkAI/Lux2YNUOs4I413Ypg1SgEAu7kpFvWjaeJe0fJHDGe/cNaZBkekudw8PMA+0fMwlndZeAsJ5KR/qhUDUJCnSiyvRsolkJHGUgvjH8QXDgZopEzKMKDqCKrwEQ4C6MH7GEXC665buLJG8hlQc4LP4paxfJrOqYVYYY2UARfEIazTbgDg2dB98GebzJd54b8L/iWNdLyooeR6CHyZ+6xk0yKxkYg6nEVSUG4VJ9QJ9cxRCxO+9WiOyvgUeexXP1hLGH5nGuBWVtiSp4vqe3VP0UFWI9Wan4Er3v8q7jjPWVtm4FtcQQMrOKO2nOQCM5AyDMi56FDrKHA/1nyppS1ppBpYaE8wciEjGI2AaeM41kI4doDX4XiT3Qm1gevyruCgZg9P8xIv8m1nCzTKq6oiJ9xTMiZ505P5m8cdZ0CnZMVXHVljM7WMBzxpyDxygtdxoCEFTaMIWbZU85UvBjgUMYy0fBaAF8V1Lj9qWQ1aMZ5f4k9r+AGMSkMP1vZoZih6k6sicc5h/OFHM9vDqU/VIU7zJZdYYsKGH4g4nAJMGiXZRds1pVMoZ69RM5vfkbh0qkBhsnS2RLMLilQdL9MBHS9UAh0v1e6CYnXHy/WeeCcvLDwl/9OVze69tPKM+M+v7eJN6OzFpWdEF0ucDbhVNFXadnVrmJFlkVNGTS2M6pzmhMvltfPhnN2B63sVuL7fcNP3D1TSk2ihosPrAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE3LTA5LTA5VDIwOjE4OjEzKzAyOjAweOR7nQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNy0wOS0wOVQyMDoxODoxMyswMjowMAm5wyEAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAAAElFTkSuQmCC") no-repeat 50% 50%; + background-size: 85%; +} + +.iziToast.iziToast-theme-dark .iziToast-buttons > a, +.iziToast.iziToast-theme-dark .iziToast-buttons > button, +.iziToast.iziToast-theme-dark .iziToast-buttons > input { + color: #fff; + background: rgba(255, 255, 255, 0.1); +} + +.iziToast.iziToast-theme-dark .iziToast-buttons > a:hover, +.iziToast.iziToast-theme-dark .iziToast-buttons > button:hover, +.iziToast.iziToast-theme-dark .iziToast-buttons > input:hover { + background: rgba(255, 255, 255, 0.2); +} + +.iziToast.iziToast-theme-dark .iziToast-buttons > a:focus, +.iziToast.iziToast-theme-dark .iziToast-buttons > button:focus, +.iziToast.iziToast-theme-dark .iziToast-buttons > input:focus { + box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6); +} + +.iziToast.iziToast-theme-dark.iziToast-color-red { + background: #F56C6C; + border-color: #F56C6C; +} + +.iziToast.iziToast-theme-dark.iziToast-color-orange { + background: #E6A23C; + border-color: #E6A23C; +} + +.iziToast.iziToast-theme-dark.iziToast-color-yellow { + background: rgba(255, 249, 178, 0.9); + border-color: rgba(255, 249, 178, 0.9); +} + +.iziToast.iziToast-theme-dark.iziToast-color-blue { + background: #409EFF; + border-color: #409EFF; +} + +.iziToast.iziToast-theme-dark.iziToast-color-green { + background: #67C23A; + border-color: #67C23A; +} + +.iziToast.iziToast-layout2 .iziToast-body .iziToast-texts, +.iziToast.iziToast-layout2 .iziToast-body .iziToast-message { + width: 100%; +} + +.iziToast.iziToast-layout3 { + border-radius: 2px; +} + +.iziToast.iziToast-layout3::after { + display: none; +} + +.iziToast.revealIn, +.iziToast .revealIn { + -webkit-animation: iziT-revealIn 1s cubic-bezier(0.25, 1.6, 0.25, 1) both; + -moz-animation: iziT-revealIn 1s cubic-bezier(0.25, 1.6, 0.25, 1) both; + animation: iziT-revealIn 1s cubic-bezier(0.25, 1.6, 0.25, 1) both; +} + +.iziToast.slideIn, +.iziToast .slideIn { + -webkit-animation: iziT-slideIn 1s cubic-bezier(0.16, 0.81, 0.32, 1) both; + -moz-animation: iziT-slideIn 1s cubic-bezier(0.16, 0.81, 0.32, 1) both; + animation: iziT-slideIn 1s cubic-bezier(0.16, 0.81, 0.32, 1) both; +} + +.iziToast.bounceInLeft { + -webkit-animation: iziT-bounceInLeft 0.7s ease-in-out both; + animation: iziT-bounceInLeft 0.7s ease-in-out both; +} + +.iziToast.bounceInRight { + -webkit-animation: iziT-bounceInRight 0.85s ease-in-out both; + animation: iziT-bounceInRight 0.85s ease-in-out both; +} + +.iziToast.bounceInDown { + -webkit-animation: iziT-bounceInDown 0.7s ease-in-out both; + animation: iziT-bounceInDown 0.7s ease-in-out both; +} + +.iziToast.bounceInUp { + -webkit-animation: iziT-bounceInUp 0.7s ease-in-out both; + animation: iziT-bounceInUp 0.7s ease-in-out both; +} + +.iziToast.fadeIn, +.iziToast .fadeIn { + -webkit-animation: iziT-fadeIn 0.5s ease both; + animation: iziT-fadeIn 0.5s ease both; +} + +.iziToast.fadeInUp { + -webkit-animation: iziT-fadeInUp 0.7s ease both; + animation: iziT-fadeInUp 0.7s ease both; +} + +.iziToast.fadeInDown { + -webkit-animation: iziT-fadeInDown 0.7s ease both; + animation: iziT-fadeInDown 0.7s ease both; +} + +.iziToast.fadeInLeft { + -webkit-animation: iziT-fadeInLeft 0.85s cubic-bezier(0.25, 0.8, 0.25, 1) both; + animation: iziT-fadeInLeft 0.85s cubic-bezier(0.25, 0.8, 0.25, 1) both; +} + +.iziToast.fadeInRight { + -webkit-animation: iziT-fadeInRight 0.85s cubic-bezier(0.25, 0.8, 0.25, 1) both; + animation: iziT-fadeInRight 0.85s cubic-bezier(0.25, 0.8, 0.25, 1) both; +} + +.iziToast.flipInX { + -webkit-animation: iziT-flipInX 0.85s cubic-bezier(0.35, 0, 0.25, 1) both; + animation: iziT-flipInX 0.85s cubic-bezier(0.35, 0, 0.25, 1) both; +} + +.iziToast.fadeOut { + -webkit-animation: iziT-fadeOut 0.7s ease both; + animation: iziT-fadeOut 0.7s ease both; +} + +.iziToast.fadeOutDown { + -webkit-animation: iziT-fadeOutDown 0.7s cubic-bezier(0.4, 0.45, 0.15, 0.91) both; + animation: iziT-fadeOutDown 0.7s cubic-bezier(0.4, 0.45, 0.15, 0.91) both; +} + +.iziToast.fadeOutUp { + -webkit-animation: iziT-fadeOutUp 0.7s cubic-bezier(0.4, 0.45, 0.15, 0.91) both; + animation: iziT-fadeOutUp 0.7s cubic-bezier(0.4, 0.45, 0.15, 0.91) both; +} + +.iziToast.fadeOutLeft { + -webkit-animation: iziT-fadeOutLeft 0.5s ease both; + animation: iziT-fadeOutLeft 0.5s ease both; +} + +.iziToast.fadeOutRight { + -webkit-animation: iziT-fadeOutRight 0.5s ease both; + animation: iziT-fadeOutRight 0.5s ease both; +} + +.iziToast.flipOutX { + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; + -webkit-animation: iziT-flipOutX 0.7s cubic-bezier(0.4, 0.45, 0.15, 0.91) both; + animation: iziT-flipOutX 0.7s cubic-bezier(0.4, 0.45, 0.15, 0.91) both; +} + +.iziToast-overlay.fadeIn { + -webkit-animation: iziT-fadeIn 0.5s ease both; + animation: iziT-fadeIn 0.5s ease both; +} + +.iziToast-overlay.fadeOut { + -webkit-animation: iziT-fadeOut 0.7s ease both; + animation: iziT-fadeOut 0.7s ease both; +} + +@-webkit-keyframes iziT-revealIn { + 0% { + opacity: 0; + -webkit-transform: scale3d(0.3, 0.3, 1); + } + 100% { + opacity: 1; + } +} + +@-moz-keyframes iziT-revealIn { + 0% { + opacity: 0; + -moz-transform: scale3d(0.3, 0.3, 1); + } + 100% { + opacity: 1; + } +} + +@-webkit-keyframes iziT-slideIn { + 0% { + opacity: 0; + -webkit-transform: translateX(50px); + } + 100% { + opacity: 1; + -webkit-transform: translateX(0); + } +} + +@-moz-keyframes iziT-slideIn { + 0% { + opacity: 0; + -moz-transform: translateX(50px); + } + 100% { + opacity: 1; + -moz-transform: translateX(0); + } +} + +@-webkit-keyframes iziT-bounceInLeft { + 0% { + opacity: 0; + -webkit-transform: translateX(280px); + } + 50% { + opacity: 1; + -webkit-transform: translateX(-20px); + } + 70% { + -webkit-transform: translateX(10px); + } + 100% { + -webkit-transform: translateX(0); + } +} + +@-webkit-keyframes iziT-bounceInRight { + 0% { + opacity: 0; + -webkit-transform: translateX(-280px); + } + 50% { + opacity: 1; + -webkit-transform: translateX(20px); + } + 70% { + -webkit-transform: translateX(-10px); + } + 100% { + -webkit-transform: translateX(0); + } +} + +@-webkit-keyframes iziT-bounceInDown { + 0% { + opacity: 0; + -webkit-transform: translateY(-200px); + } + 50% { + opacity: 1; + -webkit-transform: translateY(10px); + } + 70% { + -webkit-transform: translateY(-5px); + } + 100% { + -webkit-transform: translateY(0); + } +} + +@-webkit-keyframes iziT-bounceInUp { + 0% { + opacity: 0; + -webkit-transform: translateY(200px); + } + 50% { + opacity: 1; + -webkit-transform: translateY(-10px); + } + 70% { + -webkit-transform: translateY(5px); + } + 100% { + -webkit-transform: translateY(0); + } +} + +@-webkit-keyframes iziT-fadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@-webkit-keyframes iziT-fadeInUp { + from { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-webkit-keyframes iziT-fadeInDown { + from { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-webkit-keyframes iziT-fadeInLeft { + from { + opacity: 0; + -webkit-transform: translate3d(300px, 0, 0); + transform: translate3d(300px, 0, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-webkit-keyframes iziT-fadeInRight { + from { + opacity: 0; + -webkit-transform: translate3d(-300px, 0, 0); + transform: translate3d(-300px, 0, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-webkit-keyframes iziT-flipInX { + from { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + opacity: 0; + } + 40% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + } + 60% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + opacity: 1; + } + 80% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + } + to { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } +} + +@-webkit-keyframes iziT-fadeOut { + from { + opacity: 1; + } + to { + opacity: 0; + } +} + +@-webkit-keyframes iziT-fadeOutDown { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } +} + +@-webkit-keyframes iziT-fadeOutUp { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } +} + +@-webkit-keyframes iziT-fadeOutLeft { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(-200px, 0, 0); + transform: translate3d(-200px, 0, 0); + } +} + +@-webkit-keyframes iziT-fadeOutRight { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(200px, 0, 0); + transform: translate3d(200px, 0, 0); + } +} + +@-webkit-keyframes iziT-flipOutX { + from { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } + 30% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + opacity: 1; + } + to { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + opacity: 0; + } +} + +@-moz-keyframes iziT-revealIn { + 0% { + opacity: 0; + transform: scale3d(0.3, 0.3, 1); + } + 100% { + opacity: 1; + } +} + +@-webkit-keyframes iziT-revealIn { + 0% { + opacity: 0; + transform: scale3d(0.3, 0.3, 1); + } + 100% { + opacity: 1; + } +} + +@-o-keyframes iziT-revealIn { + 0% { + opacity: 0; + transform: scale3d(0.3, 0.3, 1); + } + 100% { + opacity: 1; + } +} + +@keyframes iziT-revealIn { + 0% { + opacity: 0; + transform: scale3d(0.3, 0.3, 1); + } + 100% { + opacity: 1; + } +} + +@-moz-keyframes iziT-slideIn { + 0% { + opacity: 0; + transform: translateX(50px); + } + 100% { + opacity: 1; + transform: translateX(0); + } +} + +@-webkit-keyframes iziT-slideIn { + 0% { + opacity: 0; + transform: translateX(50px); + } + 100% { + opacity: 1; + transform: translateX(0); + } +} + +@-o-keyframes iziT-slideIn { + 0% { + opacity: 0; + transform: translateX(50px); + } + 100% { + opacity: 1; + transform: translateX(0); + } +} + +@keyframes iziT-slideIn { + 0% { + opacity: 0; + transform: translateX(50px); + } + 100% { + opacity: 1; + transform: translateX(0); + } +} + +@-moz-keyframes iziT-bounceInLeft { + 0% { + opacity: 0; + transform: translateX(280px); + } + 50% { + opacity: 1; + transform: translateX(-20px); + } + 70% { + transform: translateX(10px); + } + 100% { + transform: translateX(0); + } +} + +@-webkit-keyframes iziT-bounceInLeft { + 0% { + opacity: 0; + transform: translateX(280px); + } + 50% { + opacity: 1; + transform: translateX(-20px); + } + 70% { + transform: translateX(10px); + } + 100% { + transform: translateX(0); + } +} + +@-o-keyframes iziT-bounceInLeft { + 0% { + opacity: 0; + transform: translateX(280px); + } + 50% { + opacity: 1; + transform: translateX(-20px); + } + 70% { + transform: translateX(10px); + } + 100% { + transform: translateX(0); + } +} + +@keyframes iziT-bounceInLeft { + 0% { + opacity: 0; + transform: translateX(280px); + } + 50% { + opacity: 1; + transform: translateX(-20px); + } + 70% { + transform: translateX(10px); + } + 100% { + transform: translateX(0); + } +} + +@-moz-keyframes iziT-bounceInRight { + 0% { + opacity: 0; + transform: translateX(-280px); + } + 50% { + opacity: 1; + transform: translateX(20px); + } + 70% { + transform: translateX(-10px); + } + 100% { + transform: translateX(0); + } +} + +@-webkit-keyframes iziT-bounceInRight { + 0% { + opacity: 0; + transform: translateX(-280px); + } + 50% { + opacity: 1; + transform: translateX(20px); + } + 70% { + transform: translateX(-10px); + } + 100% { + transform: translateX(0); + } +} + +@-o-keyframes iziT-bounceInRight { + 0% { + opacity: 0; + transform: translateX(-280px); + } + 50% { + opacity: 1; + transform: translateX(20px); + } + 70% { + transform: translateX(-10px); + } + 100% { + transform: translateX(0); + } +} + +@keyframes iziT-bounceInRight { + 0% { + opacity: 0; + transform: translateX(-280px); + } + 50% { + opacity: 1; + transform: translateX(20px); + } + 70% { + transform: translateX(-10px); + } + 100% { + transform: translateX(0); + } +} + +@-moz-keyframes iziT-bounceInDown { + 0% { + opacity: 0; + transform: translateY(-200px); + } + 50% { + opacity: 1; + transform: translateY(10px); + } + 70% { + transform: translateY(-5px); + } + 100% { + transform: translateY(0); + } +} + +@-webkit-keyframes iziT-bounceInDown { + 0% { + opacity: 0; + transform: translateY(-200px); + } + 50% { + opacity: 1; + transform: translateY(10px); + } + 70% { + transform: translateY(-5px); + } + 100% { + transform: translateY(0); + } +} + +@-o-keyframes iziT-bounceInDown { + 0% { + opacity: 0; + transform: translateY(-200px); + } + 50% { + opacity: 1; + transform: translateY(10px); + } + 70% { + transform: translateY(-5px); + } + 100% { + transform: translateY(0); + } +} + +@keyframes iziT-bounceInDown { + 0% { + opacity: 0; + transform: translateY(-200px); + } + 50% { + opacity: 1; + transform: translateY(10px); + } + 70% { + transform: translateY(-5px); + } + 100% { + transform: translateY(0); + } +} + +@-moz-keyframes iziT-bounceInUp { + 0% { + opacity: 0; + transform: translateY(200px); + } + 50% { + opacity: 1; + transform: translateY(-10px); + } + 70% { + transform: translateY(5px); + } + 100% { + transform: translateY(0); + } +} + +@-webkit-keyframes iziT-bounceInUp { + 0% { + opacity: 0; + transform: translateY(200px); + } + 50% { + opacity: 1; + transform: translateY(-10px); + } + 70% { + transform: translateY(5px); + } + 100% { + transform: translateY(0); + } +} + +@-o-keyframes iziT-bounceInUp { + 0% { + opacity: 0; + transform: translateY(200px); + } + 50% { + opacity: 1; + transform: translateY(-10px); + } + 70% { + transform: translateY(5px); + } + 100% { + transform: translateY(0); + } +} + +@keyframes iziT-bounceInUp { + 0% { + opacity: 0; + transform: translateY(200px); + } + 50% { + opacity: 1; + transform: translateY(-10px); + } + 70% { + transform: translateY(5px); + } + 100% { + transform: translateY(0); + } +} + +@-moz-keyframes iziT-fadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@-webkit-keyframes iziT-fadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@-o-keyframes iziT-fadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes iziT-fadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@-moz-keyframes iziT-fadeInUp { + from { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-webkit-keyframes iziT-fadeInUp { + from { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-o-keyframes iziT-fadeInUp { + from { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes iziT-fadeInUp { + from { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-moz-keyframes iziT-fadeInDown { + from { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-webkit-keyframes iziT-fadeInDown { + from { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-o-keyframes iziT-fadeInDown { + from { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes iziT-fadeInDown { + from { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-moz-keyframes iziT-fadeInLeft { + from { + opacity: 0; + -webkit-transform: translate3d(300px, 0, 0); + transform: translate3d(300px, 0, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-webkit-keyframes iziT-fadeInLeft { + from { + opacity: 0; + -webkit-transform: translate3d(300px, 0, 0); + transform: translate3d(300px, 0, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-o-keyframes iziT-fadeInLeft { + from { + opacity: 0; + -webkit-transform: translate3d(300px, 0, 0); + transform: translate3d(300px, 0, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes iziT-fadeInLeft { + from { + opacity: 0; + -webkit-transform: translate3d(300px, 0, 0); + transform: translate3d(300px, 0, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-moz-keyframes iziT-fadeInRight { + from { + opacity: 0; + -webkit-transform: translate3d(-300px, 0, 0); + transform: translate3d(-300px, 0, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-webkit-keyframes iziT-fadeInRight { + from { + opacity: 0; + -webkit-transform: translate3d(-300px, 0, 0); + transform: translate3d(-300px, 0, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-o-keyframes iziT-fadeInRight { + from { + opacity: 0; + -webkit-transform: translate3d(-300px, 0, 0); + transform: translate3d(-300px, 0, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes iziT-fadeInRight { + from { + opacity: 0; + -webkit-transform: translate3d(-300px, 0, 0); + transform: translate3d(-300px, 0, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@-moz-keyframes iziT-flipInX { + from { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + opacity: 0; + } + 40% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + } + 60% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + opacity: 1; + } + 80% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + } + to { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } +} + +@-webkit-keyframes iziT-flipInX { + from { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + opacity: 0; + } + 40% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + } + 60% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + opacity: 1; + } + 80% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + } + to { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } +} + +@-o-keyframes iziT-flipInX { + from { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + opacity: 0; + } + 40% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + } + 60% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + opacity: 1; + } + 80% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + } + to { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } +} + +@keyframes iziT-flipInX { + from { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + opacity: 0; + } + 40% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + } + 60% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + opacity: 1; + } + 80% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + } + to { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } +} + +@-moz-keyframes iziT-fadeOut { + from { + opacity: 1; + } + to { + opacity: 0; + } +} + +@-webkit-keyframes iziT-fadeOut { + from { + opacity: 1; + } + to { + opacity: 0; + } +} + +@-o-keyframes iziT-fadeOut { + from { + opacity: 1; + } + to { + opacity: 0; + } +} + +@keyframes iziT-fadeOut { + from { + opacity: 1; + } + to { + opacity: 0; + } +} + +@-moz-keyframes iziT-fadeOutDown { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } +} + +@-webkit-keyframes iziT-fadeOutDown { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } +} + +@-o-keyframes iziT-fadeOutDown { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } +} + +@keyframes iziT-fadeOutDown { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } +} + +@-moz-keyframes iziT-fadeOutUp { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } +} + +@-webkit-keyframes iziT-fadeOutUp { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } +} + +@-o-keyframes iziT-fadeOutUp { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } +} + +@keyframes iziT-fadeOutUp { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } +} + +@-moz-keyframes iziT-fadeOutLeft { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(-200px, 0, 0); + transform: translate3d(-200px, 0, 0); + } +} + +@-webkit-keyframes iziT-fadeOutLeft { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(-200px, 0, 0); + transform: translate3d(-200px, 0, 0); + } +} + +@-o-keyframes iziT-fadeOutLeft { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(-200px, 0, 0); + transform: translate3d(-200px, 0, 0); + } +} + +@keyframes iziT-fadeOutLeft { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(-200px, 0, 0); + transform: translate3d(-200px, 0, 0); + } +} + +@-moz-keyframes iziT-fadeOutRight { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(200px, 0, 0); + transform: translate3d(200px, 0, 0); + } +} + +@-webkit-keyframes iziT-fadeOutRight { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(200px, 0, 0); + transform: translate3d(200px, 0, 0); + } +} + +@-o-keyframes iziT-fadeOutRight { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(200px, 0, 0); + transform: translate3d(200px, 0, 0); + } +} + +@keyframes iziT-fadeOutRight { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(200px, 0, 0); + transform: translate3d(200px, 0, 0); + } +} + +@-moz-keyframes iziT-flipOutX { + from { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } + 30% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + opacity: 1; + } + to { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + opacity: 0; + } +} + +@-webkit-keyframes iziT-flipOutX { + from { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } + 30% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + opacity: 1; + } + to { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + opacity: 0; + } +} + +@-o-keyframes iziT-flipOutX { + from { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } + 30% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + opacity: 1; + } + to { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + opacity: 0; + } +} + +@keyframes iziT-flipOutX { + from { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } + 30% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + opacity: 1; + } + to { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + opacity: 0; + } +} \ No newline at end of file diff --git a/static/component/pear/css/module/topBar.css b/static/component/pear/css/module/topBar.css new file mode 100644 index 000000000..c3d5becac --- /dev/null +++ b/static/component/pear/css/module/topBar.css @@ -0,0 +1,5 @@ +.layui-fixbar li { + border-radius: 4px; + background-color: #5FB878; + color: white; +} diff --git a/static/component/pear/css/module/treetable.css b/static/component/pear/css/module/treetable.css new file mode 100644 index 000000000..da849b89a --- /dev/null +++ b/static/component/pear/css/module/treetable.css @@ -0,0 +1,25 @@ +.treeTable-icon i:last-child{ + display: none!important; +} + +.treeTable-empty{ + margin-left: -3px; +} +.treeTable-empty { + width: 20px; + display: inline-block; +} + +.treeTable-icon { + cursor: pointer; +} + +.treeTable-icon .layui-icon-triangle-d:before { + content: "\e623"; +} + +.treeTable-icon.open .layui-icon-triangle-d:before { + content: "\e625"; + background-color: transparent; +} + diff --git a/static/component/pear/css/pear.css b/static/component/pear/css/pear.css new file mode 100644 index 000000000..37be73ee7 --- /dev/null +++ b/static/component/pear/css/pear.css @@ -0,0 +1,26 @@ +@import url("../../layui/css/layui.css"); +@import url("../font/iconfont.css"); + +@import url("module/dtree/font/dtreefont.css"); +@import url("module/dtree/dtree.css"); +@import url("module/treetable.css"); +@import url("module/message.css"); +@import url("module/cropper.css"); +@import url("module/loading.css"); +@import url("module/topBar.css"); +@import url("module/select.css"); +@import url("module/layout.css"); +@import url("module/notice.css"); +@import url("module/button.css"); +@import url("module/table.css"); +@import url("module/frame.css"); +@import url("module/layer.css"); +@import url("module/toast.css"); +@import url("module/menu.css"); +@import url("module/form.css"); +@import url("module/link.css"); +@import url("module/code.css"); +@import url("module/step.css"); +@import url("module/card.css"); +@import url("module/tab.css"); +@import url("module/tag.css"); \ No newline at end of file diff --git a/static/component/pear/font/iconfont.css b/static/component/pear/font/iconfont.css new file mode 100644 index 000000000..5f6eb5fdd --- /dev/null +++ b/static/component/pear/font/iconfont.css @@ -0,0 +1,579 @@ +@font-face { + font-family: "pear-icon"; /* Project id 2654996 */ + src: url('iconfont.woff2?t=1625555217253') format('woff2'), + url('iconfont.woff?t=1625555217253') format('woff'), + url('iconfont.ttf?t=1625555217253') format('truetype'); +} + +.pear-icon { + font-family: "pear-icon" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.pear-icon-load:before { + content: "\e6f0"; +} + +.pear-icon-download:before { + content: "\e68d"; +} + +.pear-icon-electronics:before { + content: "\e68e"; +} + +.pear-icon-drag:before { + content: "\e68f"; +} + +.pear-icon-elipsis:before { + content: "\e690"; +} + +.pear-icon-export:before { + content: "\e691"; +} + +.pear-icon-explain:before { + content: "\e692"; +} + +.pear-icon-edit:before { + content: "\e693"; +} + +.pear-icon-eye-close:before { + content: "\e694"; +} + +.pear-icon-email:before { + content: "\e695"; +} + +.pear-icon-error:before { + content: "\e696"; +} + +.pear-icon-favorite:before { + content: "\e697"; +} + +.pear-icon-file-common:before { + content: "\e698"; +} + +.pear-icon-file-delete:before { + content: "\e699"; +} + +.pear-icon-file-add:before { + content: "\e69a"; +} + +.pear-icon-film:before { + content: "\e69b"; +} + +.pear-icon-fabulous:before { + content: "\e69c"; +} + +.pear-icon-file:before { + content: "\e69d"; +} + +.pear-icon-folder-close:before { + content: "\e69e"; +} + +.pear-icon-filter:before { + content: "\e69f"; +} + +.pear-icon-good:before { + content: "\e6a0"; +} + +.pear-icon-hide:before { + content: "\e6a1"; +} + +.pear-icon-home:before { + content: "\e6a2"; +} + +.pear-icon-history:before { + content: "\e6a3"; +} + +.pear-icon-file-open:before { + content: "\e6a4"; +} + +.pear-icon-forward:before { + content: "\e6a5"; +} + +.pear-icon-import:before { + content: "\e6a6"; +} + +.pear-icon-image-text:before { + content: "\e6a7"; +} + +.pear-icon-keyboard-26:before { + content: "\e6a8"; +} + +.pear-icon-keyboard-9:before { + content: "\e6a9"; +} + +.pear-icon-link:before { + content: "\e6aa"; +} + +.pear-icon-layout:before { + content: "\e6ab"; +} + +.pear-icon-fullscreen-shrink:before { + content: "\e6ac"; +} + +.pear-icon-layers:before { + content: "\e6ad"; +} + +.pear-icon-lock:before { + content: "\e6ae"; +} + +.pear-icon-fullscreen-expand:before { + content: "\e6af"; +} + +.pear-icon-map:before { + content: "\e6b0"; +} + +.pear-icon-meh:before { + content: "\e6b1"; +} + +.pear-icon-menu:before { + content: "\e6b2"; +} + +.pear-icon-loading:before { + content: "\e6b3"; +} + +.pear-icon-help:before { + content: "\e6b4"; +} + +.pear-icon-minus-circle:before { + content: "\e6b5"; +} + +.pear-icon-modular:before { + content: "\e6b6"; +} + +.pear-icon-notification:before { + content: "\e6b7"; +} + +.pear-icon-mic:before { + content: "\e6b8"; +} + +.pear-icon-more:before { + content: "\e6b9"; +} + +.pear-icon-pad:before { + content: "\e6ba"; +} + +.pear-icon-operation:before { + content: "\e6bb"; +} + +.pear-icon-play:before { + content: "\e6bc"; +} + +.pear-icon-print:before { + content: "\e6bd"; +} + +.pear-icon-mobile-phone:before { + content: "\e6be"; +} + +.pear-icon-minus:before { + content: "\e6bf"; +} + +.pear-icon-navigation:before { + content: "\e6c0"; +} + +.pear-icon-pdf:before { + content: "\e6c1"; +} + +.pear-icon-prompt:before { + content: "\e6c2"; +} + +.pear-icon-move:before { + content: "\e6c3"; +} + +.pear-icon-refresh:before { + content: "\e6c4"; +} + +.pear-icon-run-up:before { + content: "\e6c5"; +} + +.pear-icon-picture:before { + content: "\e6c6"; +} + +.pear-icon-run-in:before { + content: "\e6c7"; +} + +.pear-icon-pin:before { + content: "\e6c8"; +} + +.pear-icon-save:before { + content: "\e6c9"; +} + +.pear-icon-search:before { + content: "\e6ca"; +} + +.pear-icon-share:before { + content: "\e6cb"; +} + +.pear-icon-scanning:before { + content: "\e6cc"; +} + +.pear-icon-security:before { + content: "\e6cd"; +} + +.pear-icon-sign-out:before { + content: "\e6ce"; +} + +.pear-icon-select:before { + content: "\e6cf"; +} + +.pear-icon-stop:before { + content: "\e6d0"; +} + +.pear-icon-success:before { + content: "\e6d1"; +} + +.pear-icon-smile:before { + content: "\e6d2"; +} + +.pear-icon-switch:before { + content: "\e6d3"; +} + +.pear-icon-setting:before { + content: "\e6d4"; +} + +.pear-icon-survey:before { + content: "\e6d5"; +} + +.pear-icon-task:before { + content: "\e6d6"; +} + +.pear-icon-skip:before { + content: "\e6d7"; +} + +.pear-icon-text:before { + content: "\e6d8"; +} + +.pear-icon-time:before { + content: "\e6d9"; +} + +.pear-icon-telephone-out:before { + content: "\e6da"; +} + +.pear-icon-toggle-left:before { + content: "\e6db"; +} + +.pear-icon-toggle-right:before { + content: "\e6dc"; +} + +.pear-icon-telephone:before { + content: "\e6dd"; +} + +.pear-icon-top:before { + content: "\e6de"; +} + +.pear-icon-unlock:before { + content: "\e6df"; +} + +.pear-icon-user:before { + content: "\e6e0"; +} + +.pear-icon-upload:before { + content: "\e6e1"; +} + +.pear-icon-work:before { + content: "\e6e2"; +} + +.pear-icon-training:before { + content: "\e6e3"; +} + +.pear-icon-warning:before { + content: "\e6e4"; +} + +.pear-icon-zoom-in:before { + content: "\e6e5"; +} + +.pear-icon-zoom-out:before { + content: "\e6e6"; +} + +.pear-icon-add-bold:before { + content: "\e6e7"; +} + +.pear-icon-arrow-left-bold:before { + content: "\e6e8"; +} + +.pear-icon-arrow-up-bold:before { + content: "\e6e9"; +} + +.pear-icon-close-bold:before { + content: "\e6ea"; +} + +.pear-icon-arrow-down-bold:before { + content: "\e6eb"; +} + +.pear-icon-minus-bold:before { + content: "\e6ec"; +} + +.pear-icon-arrow-right-bold:before { + content: "\e6ed"; +} + +.pear-icon-select-bold:before { + content: "\e6ee"; +} + +.pear-icon-3column:before { + content: "\e663"; +} + +.pear-icon-column-4:before { + content: "\e664"; +} + +.pear-icon-add:before { + content: "\e665"; +} + +.pear-icon-add-circle:before { + content: "\e666"; +} + +.pear-icon-adjust:before { + content: "\e667"; +} + +.pear-icon-arrow-up-circle:before { + content: "\e668"; +} + +.pear-icon-arrow-right-circle:before { + content: "\e669"; +} + +.pear-icon-arrow-down:before { + content: "\e66a"; +} + +.pear-icon-ashbin:before { + content: "\e66b"; +} + +.pear-icon-arrow-right:before { + content: "\e66c"; +} + +.pear-icon-browse:before { + content: "\e66d"; +} + +.pear-icon-bottom:before { + content: "\e66e"; +} + +.pear-icon-back:before { + content: "\e66f"; +} + +.pear-icon-bad:before { + content: "\e670"; +} + +.pear-icon-arrow-double-left:before { + content: "\e671"; +} + +.pear-icon-arrow-left-circle:before { + content: "\e672"; +} + +.pear-icon-arrow-double-right:before { + content: "\e673"; +} + +.pear-icon-caps-lock:before { + content: "\e674"; +} + +.pear-icon-camera:before { + content: "\e675"; +} + +.pear-icon-chart-bar:before { + content: "\e676"; +} + +.pear-icon-attachment:before { + content: "\e677"; +} + +.pear-icon-code:before { + content: "\e678"; +} + +.pear-icon-close:before { + content: "\e679"; +} + +.pear-icon-check-item:before { + content: "\e67a"; +} + +.pear-icon-calendar:before { + content: "\e67b"; +} + +.pear-icon-comment:before { + content: "\e67c"; +} + +.pear-icon-column-vertical:before { + content: "\e67d"; +} + +.pear-icon-column-horizontal:before { + content: "\e67e"; +} + +.pear-icon-complete:before { + content: "\e67f"; +} + +.pear-icon-chart-pie:before { + content: "\e680"; +} + +.pear-icon-cry:before { + content: "\e681"; +} + +.pear-icon-customer-service:before { + content: "\e682"; +} + +.pear-icon-delete:before { + content: "\e683"; +} + +.pear-icon-direction-down:before { + content: "\e684"; +} + +.pear-icon-copy:before { + content: "\e685"; +} + +.pear-icon-cut:before { + content: "\e686"; +} + +.pear-icon-data-view:before { + content: "\e687"; +} + +.pear-icon-direction-down-circle:before { + content: "\e688"; +} + +.pear-icon-direction-right:before { + content: "\e689"; +} + +.pear-icon-direction-up:before { + content: "\e68a"; +} + +.pear-icon-discount:before { + content: "\e68b"; +} + +.pear-icon-direction-left:before { + content: "\e68c"; +} + diff --git a/static/component/pear/font/iconfont.js b/static/component/pear/font/iconfont.js new file mode 100644 index 000000000..4cc2abda5 --- /dev/null +++ b/static/component/pear/font/iconfont.js @@ -0,0 +1 @@ +!function(c){var h,l,o,a,s,p,t='',v=(v=document.getElementsByTagName("script"))[v.length-1].getAttribute("data-injectcss");if(v&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}function i(){s||(s=!0,o())}h=function(){var c,h,l;(l=document.createElement("div")).innerHTML=t,t=null,(h=l.getElementsByTagName("svg")[0])&&(h.setAttribute("aria-hidden","true"),h.style.position="absolute",h.style.width=0,h.style.height=0,h.style.overflow="hidden",c=h,(l=document.body).firstChild?(h=l.firstChild).parentNode.insertBefore(c,h):l.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(l=function(){document.removeEventListener("DOMContentLoaded",l,!1),h()},document.addEventListener("DOMContentLoaded",l,!1)):document.attachEvent&&(o=h,a=c.document,s=!1,(p=function(){try{a.documentElement.doScroll("left")}catch(c){return void setTimeout(p,50)}i()})(),a.onreadystatechange=function(){"complete"==a.readyState&&(a.onreadystatechange=null,i())})}(window); \ No newline at end of file diff --git a/static/component/pear/font/iconfont.json b/static/component/pear/font/iconfont.json new file mode 100644 index 000000000..cb96655a9 --- /dev/null +++ b/static/component/pear/font/iconfont.json @@ -0,0 +1,996 @@ +{ + "id": "2654996", + "name": "pear-admin-layui", + "font_family": "pear-icon", + "css_prefix_text": "pear-icon-", + "description": "", + "glyphs": [ + { + "icon_id": "22697089", + "name": "加载", + "font_class": "load", + "unicode": "e6f0", + "unicode_decimal": 59120 + }, + { + "icon_id": "15838464", + "name": "download", + "font_class": "download", + "unicode": "e68d", + "unicode_decimal": 59021 + }, + { + "icon_id": "15838465", + "name": "electronics", + "font_class": "electronics", + "unicode": "e68e", + "unicode_decimal": 59022 + }, + { + "icon_id": "15838466", + "name": "drag", + "font_class": "drag", + "unicode": "e68f", + "unicode_decimal": 59023 + }, + { + "icon_id": "15838467", + "name": "elipsis", + "font_class": "elipsis", + "unicode": "e690", + "unicode_decimal": 59024 + }, + { + "icon_id": "15838468", + "name": "export", + "font_class": "export", + "unicode": "e691", + "unicode_decimal": 59025 + }, + { + "icon_id": "15838469", + "name": "explain", + "font_class": "explain", + "unicode": "e692", + "unicode_decimal": 59026 + }, + { + "icon_id": "15838470", + "name": "edit", + "font_class": "edit", + "unicode": "e693", + "unicode_decimal": 59027 + }, + { + "icon_id": "15838471", + "name": "eye-close", + "font_class": "eye-close", + "unicode": "e694", + "unicode_decimal": 59028 + }, + { + "icon_id": "15838472", + "name": "email", + "font_class": "email", + "unicode": "e695", + "unicode_decimal": 59029 + }, + { + "icon_id": "15838473", + "name": "error", + "font_class": "error", + "unicode": "e696", + "unicode_decimal": 59030 + }, + { + "icon_id": "15838474", + "name": "favorite", + "font_class": "favorite", + "unicode": "e697", + "unicode_decimal": 59031 + }, + { + "icon_id": "15838475", + "name": "file-common", + "font_class": "file-common", + "unicode": "e698", + "unicode_decimal": 59032 + }, + { + "icon_id": "15838476", + "name": "file-delete", + "font_class": "file-delete", + "unicode": "e699", + "unicode_decimal": 59033 + }, + { + "icon_id": "15838477", + "name": "file-add", + "font_class": "file-add", + "unicode": "e69a", + "unicode_decimal": 59034 + }, + { + "icon_id": "15838478", + "name": "film", + "font_class": "film", + "unicode": "e69b", + "unicode_decimal": 59035 + }, + { + "icon_id": "15838479", + "name": "fabulous", + "font_class": "fabulous", + "unicode": "e69c", + "unicode_decimal": 59036 + }, + { + "icon_id": "15838480", + "name": "file", + "font_class": "file", + "unicode": "e69d", + "unicode_decimal": 59037 + }, + { + "icon_id": "15838481", + "name": "folder-close", + "font_class": "folder-close", + "unicode": "e69e", + "unicode_decimal": 59038 + }, + { + "icon_id": "15838482", + "name": "filter", + "font_class": "filter", + "unicode": "e69f", + "unicode_decimal": 59039 + }, + { + "icon_id": "15838483", + "name": "good", + "font_class": "good", + "unicode": "e6a0", + "unicode_decimal": 59040 + }, + { + "icon_id": "15838484", + "name": "hide", + "font_class": "hide", + "unicode": "e6a1", + "unicode_decimal": 59041 + }, + { + "icon_id": "15838485", + "name": "home", + "font_class": "home", + "unicode": "e6a2", + "unicode_decimal": 59042 + }, + { + "icon_id": "15838486", + "name": "history", + "font_class": "history", + "unicode": "e6a3", + "unicode_decimal": 59043 + }, + { + "icon_id": "15838487", + "name": "file-open", + "font_class": "file-open", + "unicode": "e6a4", + "unicode_decimal": 59044 + }, + { + "icon_id": "15838488", + "name": "forward", + "font_class": "forward", + "unicode": "e6a5", + "unicode_decimal": 59045 + }, + { + "icon_id": "15838489", + "name": "import", + "font_class": "import", + "unicode": "e6a6", + "unicode_decimal": 59046 + }, + { + "icon_id": "15838490", + "name": "image-text", + "font_class": "image-text", + "unicode": "e6a7", + "unicode_decimal": 59047 + }, + { + "icon_id": "15838491", + "name": "keyboard-26", + "font_class": "keyboard-26", + "unicode": "e6a8", + "unicode_decimal": 59048 + }, + { + "icon_id": "15838492", + "name": "keyboard-9", + "font_class": "keyboard-9", + "unicode": "e6a9", + "unicode_decimal": 59049 + }, + { + "icon_id": "15838493", + "name": "link", + "font_class": "link", + "unicode": "e6aa", + "unicode_decimal": 59050 + }, + { + "icon_id": "15838494", + "name": "layout", + "font_class": "layout", + "unicode": "e6ab", + "unicode_decimal": 59051 + }, + { + "icon_id": "15838495", + "name": "fullscreen-shrink", + "font_class": "fullscreen-shrink", + "unicode": "e6ac", + "unicode_decimal": 59052 + }, + { + "icon_id": "15838496", + "name": "layers", + "font_class": "layers", + "unicode": "e6ad", + "unicode_decimal": 59053 + }, + { + "icon_id": "15838497", + "name": "lock", + "font_class": "lock", + "unicode": "e6ae", + "unicode_decimal": 59054 + }, + { + "icon_id": "15838498", + "name": "fullscreen-expand", + "font_class": "fullscreen-expand", + "unicode": "e6af", + "unicode_decimal": 59055 + }, + { + "icon_id": "15838499", + "name": "map", + "font_class": "map", + "unicode": "e6b0", + "unicode_decimal": 59056 + }, + { + "icon_id": "15838500", + "name": "meh", + "font_class": "meh", + "unicode": "e6b1", + "unicode_decimal": 59057 + }, + { + "icon_id": "15838501", + "name": "menu", + "font_class": "menu", + "unicode": "e6b2", + "unicode_decimal": 59058 + }, + { + "icon_id": "15838502", + "name": "loading", + "font_class": "loading", + "unicode": "e6b3", + "unicode_decimal": 59059 + }, + { + "icon_id": "15838503", + "name": "help", + "font_class": "help", + "unicode": "e6b4", + "unicode_decimal": 59060 + }, + { + "icon_id": "15838504", + "name": "minus-circle", + "font_class": "minus-circle", + "unicode": "e6b5", + "unicode_decimal": 59061 + }, + { + "icon_id": "15838505", + "name": "modular", + "font_class": "modular", + "unicode": "e6b6", + "unicode_decimal": 59062 + }, + { + "icon_id": "15838506", + "name": "notification", + "font_class": "notification", + "unicode": "e6b7", + "unicode_decimal": 59063 + }, + { + "icon_id": "15838507", + "name": "mic", + "font_class": "mic", + "unicode": "e6b8", + "unicode_decimal": 59064 + }, + { + "icon_id": "15838508", + "name": "more", + "font_class": "more", + "unicode": "e6b9", + "unicode_decimal": 59065 + }, + { + "icon_id": "15838509", + "name": "pad", + "font_class": "pad", + "unicode": "e6ba", + "unicode_decimal": 59066 + }, + { + "icon_id": "15838510", + "name": "operation", + "font_class": "operation", + "unicode": "e6bb", + "unicode_decimal": 59067 + }, + { + "icon_id": "15838511", + "name": "play", + "font_class": "play", + "unicode": "e6bc", + "unicode_decimal": 59068 + }, + { + "icon_id": "15838512", + "name": "print", + "font_class": "print", + "unicode": "e6bd", + "unicode_decimal": 59069 + }, + { + "icon_id": "15838513", + "name": "mobile-phone", + "font_class": "mobile-phone", + "unicode": "e6be", + "unicode_decimal": 59070 + }, + { + "icon_id": "15838514", + "name": "minus", + "font_class": "minus", + "unicode": "e6bf", + "unicode_decimal": 59071 + }, + { + "icon_id": "15838515", + "name": "navigation", + "font_class": "navigation", + "unicode": "e6c0", + "unicode_decimal": 59072 + }, + { + "icon_id": "15838516", + "name": "pdf", + "font_class": "pdf", + "unicode": "e6c1", + "unicode_decimal": 59073 + }, + { + "icon_id": "15838517", + "name": "prompt", + "font_class": "prompt", + "unicode": "e6c2", + "unicode_decimal": 59074 + }, + { + "icon_id": "15838518", + "name": "move", + "font_class": "move", + "unicode": "e6c3", + "unicode_decimal": 59075 + }, + { + "icon_id": "15838519", + "name": "refresh", + "font_class": "refresh", + "unicode": "e6c4", + "unicode_decimal": 59076 + }, + { + "icon_id": "15838520", + "name": "run-up", + "font_class": "run-up", + "unicode": "e6c5", + "unicode_decimal": 59077 + }, + { + "icon_id": "15838521", + "name": "picture", + "font_class": "picture", + "unicode": "e6c6", + "unicode_decimal": 59078 + }, + { + "icon_id": "15838522", + "name": "run-in", + "font_class": "run-in", + "unicode": "e6c7", + "unicode_decimal": 59079 + }, + { + "icon_id": "15838523", + "name": "pin", + "font_class": "pin", + "unicode": "e6c8", + "unicode_decimal": 59080 + }, + { + "icon_id": "15838524", + "name": "save", + "font_class": "save", + "unicode": "e6c9", + "unicode_decimal": 59081 + }, + { + "icon_id": "15838525", + "name": "search", + "font_class": "search", + "unicode": "e6ca", + "unicode_decimal": 59082 + }, + { + "icon_id": "15838526", + "name": "share", + "font_class": "share", + "unicode": "e6cb", + "unicode_decimal": 59083 + }, + { + "icon_id": "15838527", + "name": "scanning", + "font_class": "scanning", + "unicode": "e6cc", + "unicode_decimal": 59084 + }, + { + "icon_id": "15838528", + "name": "security", + "font_class": "security", + "unicode": "e6cd", + "unicode_decimal": 59085 + }, + { + "icon_id": "15838529", + "name": "sign-out", + "font_class": "sign-out", + "unicode": "e6ce", + "unicode_decimal": 59086 + }, + { + "icon_id": "15838530", + "name": "select", + "font_class": "select", + "unicode": "e6cf", + "unicode_decimal": 59087 + }, + { + "icon_id": "15838531", + "name": "stop", + "font_class": "stop", + "unicode": "e6d0", + "unicode_decimal": 59088 + }, + { + "icon_id": "15838532", + "name": "success", + "font_class": "success", + "unicode": "e6d1", + "unicode_decimal": 59089 + }, + { + "icon_id": "15838533", + "name": "smile", + "font_class": "smile", + "unicode": "e6d2", + "unicode_decimal": 59090 + }, + { + "icon_id": "15838534", + "name": "switch", + "font_class": "switch", + "unicode": "e6d3", + "unicode_decimal": 59091 + }, + { + "icon_id": "15838535", + "name": "setting", + "font_class": "setting", + "unicode": "e6d4", + "unicode_decimal": 59092 + }, + { + "icon_id": "15838536", + "name": "survey", + "font_class": "survey", + "unicode": "e6d5", + "unicode_decimal": 59093 + }, + { + "icon_id": "15838537", + "name": "task", + "font_class": "task", + "unicode": "e6d6", + "unicode_decimal": 59094 + }, + { + "icon_id": "15838538", + "name": "skip", + "font_class": "skip", + "unicode": "e6d7", + "unicode_decimal": 59095 + }, + { + "icon_id": "15838539", + "name": "text", + "font_class": "text", + "unicode": "e6d8", + "unicode_decimal": 59096 + }, + { + "icon_id": "15838540", + "name": "time", + "font_class": "time", + "unicode": "e6d9", + "unicode_decimal": 59097 + }, + { + "icon_id": "15838541", + "name": "telephone-out", + "font_class": "telephone-out", + "unicode": "e6da", + "unicode_decimal": 59098 + }, + { + "icon_id": "15838542", + "name": "toggle-left", + "font_class": "toggle-left", + "unicode": "e6db", + "unicode_decimal": 59099 + }, + { + "icon_id": "15838543", + "name": "toggle-right", + "font_class": "toggle-right", + "unicode": "e6dc", + "unicode_decimal": 59100 + }, + { + "icon_id": "15838544", + "name": "telephone", + "font_class": "telephone", + "unicode": "e6dd", + "unicode_decimal": 59101 + }, + { + "icon_id": "15838545", + "name": "top", + "font_class": "top", + "unicode": "e6de", + "unicode_decimal": 59102 + }, + { + "icon_id": "15838546", + "name": "unlock", + "font_class": "unlock", + "unicode": "e6df", + "unicode_decimal": 59103 + }, + { + "icon_id": "15838547", + "name": "user", + "font_class": "user", + "unicode": "e6e0", + "unicode_decimal": 59104 + }, + { + "icon_id": "15838548", + "name": "upload", + "font_class": "upload", + "unicode": "e6e1", + "unicode_decimal": 59105 + }, + { + "icon_id": "15838549", + "name": "work", + "font_class": "work", + "unicode": "e6e2", + "unicode_decimal": 59106 + }, + { + "icon_id": "15838550", + "name": "training", + "font_class": "training", + "unicode": "e6e3", + "unicode_decimal": 59107 + }, + { + "icon_id": "15838551", + "name": "warning", + "font_class": "warning", + "unicode": "e6e4", + "unicode_decimal": 59108 + }, + { + "icon_id": "15838552", + "name": "zoom-in", + "font_class": "zoom-in", + "unicode": "e6e5", + "unicode_decimal": 59109 + }, + { + "icon_id": "15838554", + "name": "zoom-out", + "font_class": "zoom-out", + "unicode": "e6e6", + "unicode_decimal": 59110 + }, + { + "icon_id": "15838560", + "name": "add-bold", + "font_class": "add-bold", + "unicode": "e6e7", + "unicode_decimal": 59111 + }, + { + "icon_id": "15838561", + "name": "arrow-left-bold", + "font_class": "arrow-left-bold", + "unicode": "e6e8", + "unicode_decimal": 59112 + }, + { + "icon_id": "15838562", + "name": "arrow-up-bold", + "font_class": "arrow-up-bold", + "unicode": "e6e9", + "unicode_decimal": 59113 + }, + { + "icon_id": "15838563", + "name": "close-bold", + "font_class": "close-bold", + "unicode": "e6ea", + "unicode_decimal": 59114 + }, + { + "icon_id": "15838564", + "name": "arrow-down-bold", + "font_class": "arrow-down-bold", + "unicode": "e6eb", + "unicode_decimal": 59115 + }, + { + "icon_id": "15838565", + "name": "minus-bold", + "font_class": "minus-bold", + "unicode": "e6ec", + "unicode_decimal": 59116 + }, + { + "icon_id": "15838566", + "name": "arrow-right-bold", + "font_class": "arrow-right-bold", + "unicode": "e6ed", + "unicode_decimal": 59117 + }, + { + "icon_id": "15838567", + "name": "select-bold", + "font_class": "select-bold", + "unicode": "e6ee", + "unicode_decimal": 59118 + }, + { + "icon_id": "15838406", + "name": "column-3", + "font_class": "3column", + "unicode": "e663", + "unicode_decimal": 58979 + }, + { + "icon_id": "15838423", + "name": "column-4", + "font_class": "column-4", + "unicode": "e664", + "unicode_decimal": 58980 + }, + { + "icon_id": "15838424", + "name": "add", + "font_class": "add", + "unicode": "e665", + "unicode_decimal": 58981 + }, + { + "icon_id": "15838425", + "name": "add-circle", + "font_class": "add-circle", + "unicode": "e666", + "unicode_decimal": 58982 + }, + { + "icon_id": "15838426", + "name": "adjust", + "font_class": "adjust", + "unicode": "e667", + "unicode_decimal": 58983 + }, + { + "icon_id": "15838427", + "name": "arrow-up-circle", + "font_class": "arrow-up-circle", + "unicode": "e668", + "unicode_decimal": 58984 + }, + { + "icon_id": "15838428", + "name": "arrow-right-circle", + "font_class": "arrow-right-circle", + "unicode": "e669", + "unicode_decimal": 58985 + }, + { + "icon_id": "15838429", + "name": "arrow-down", + "font_class": "arrow-down", + "unicode": "e66a", + "unicode_decimal": 58986 + }, + { + "icon_id": "15838430", + "name": "ashbin", + "font_class": "ashbin", + "unicode": "e66b", + "unicode_decimal": 58987 + }, + { + "icon_id": "15838431", + "name": "arrow-right", + "font_class": "arrow-right", + "unicode": "e66c", + "unicode_decimal": 58988 + }, + { + "icon_id": "15838432", + "name": "browse", + "font_class": "browse", + "unicode": "e66d", + "unicode_decimal": 58989 + }, + { + "icon_id": "15838433", + "name": "bottom", + "font_class": "bottom", + "unicode": "e66e", + "unicode_decimal": 58990 + }, + { + "icon_id": "15838434", + "name": "back", + "font_class": "back", + "unicode": "e66f", + "unicode_decimal": 58991 + }, + { + "icon_id": "15838435", + "name": "bad", + "font_class": "bad", + "unicode": "e670", + "unicode_decimal": 58992 + }, + { + "icon_id": "15838436", + "name": "arrow-double-left", + "font_class": "arrow-double-left", + "unicode": "e671", + "unicode_decimal": 58993 + }, + { + "icon_id": "15838437", + "name": "arrow-left-circle", + "font_class": "arrow-left-circle", + "unicode": "e672", + "unicode_decimal": 58994 + }, + { + "icon_id": "15838438", + "name": "arrow-double-right", + "font_class": "arrow-double-right", + "unicode": "e673", + "unicode_decimal": 58995 + }, + { + "icon_id": "15838439", + "name": "caps-lock", + "font_class": "caps-lock", + "unicode": "e674", + "unicode_decimal": 58996 + }, + { + "icon_id": "15838440", + "name": "camera", + "font_class": "camera", + "unicode": "e675", + "unicode_decimal": 58997 + }, + { + "icon_id": "15838441", + "name": "chart-bar", + "font_class": "chart-bar", + "unicode": "e676", + "unicode_decimal": 58998 + }, + { + "icon_id": "15838442", + "name": "attachment", + "font_class": "attachment", + "unicode": "e677", + "unicode_decimal": 58999 + }, + { + "icon_id": "15838443", + "name": "code", + "font_class": "code", + "unicode": "e678", + "unicode_decimal": 59000 + }, + { + "icon_id": "15838444", + "name": "close", + "font_class": "close", + "unicode": "e679", + "unicode_decimal": 59001 + }, + { + "icon_id": "15838445", + "name": "check-item", + "font_class": "check-item", + "unicode": "e67a", + "unicode_decimal": 59002 + }, + { + "icon_id": "15838446", + "name": "calendar", + "font_class": "calendar", + "unicode": "e67b", + "unicode_decimal": 59003 + }, + { + "icon_id": "15838447", + "name": "comment", + "font_class": "comment", + "unicode": "e67c", + "unicode_decimal": 59004 + }, + { + "icon_id": "15838448", + "name": "column-vertical", + "font_class": "column-vertical", + "unicode": "e67d", + "unicode_decimal": 59005 + }, + { + "icon_id": "15838449", + "name": "column-horizontal", + "font_class": "column-horizontal", + "unicode": "e67e", + "unicode_decimal": 59006 + }, + { + "icon_id": "15838450", + "name": "complete", + "font_class": "complete", + "unicode": "e67f", + "unicode_decimal": 59007 + }, + { + "icon_id": "15838451", + "name": "chart-pie", + "font_class": "chart-pie", + "unicode": "e680", + "unicode_decimal": 59008 + }, + { + "icon_id": "15838452", + "name": "cry", + "font_class": "cry", + "unicode": "e681", + "unicode_decimal": 59009 + }, + { + "icon_id": "15838453", + "name": "customer-service", + "font_class": "customer-service", + "unicode": "e682", + "unicode_decimal": 59010 + }, + { + "icon_id": "15838454", + "name": "delete", + "font_class": "delete", + "unicode": "e683", + "unicode_decimal": 59011 + }, + { + "icon_id": "15838455", + "name": "direction-down", + "font_class": "direction-down", + "unicode": "e684", + "unicode_decimal": 59012 + }, + { + "icon_id": "15838456", + "name": "copy", + "font_class": "copy", + "unicode": "e685", + "unicode_decimal": 59013 + }, + { + "icon_id": "15838457", + "name": "cut", + "font_class": "cut", + "unicode": "e686", + "unicode_decimal": 59014 + }, + { + "icon_id": "15838458", + "name": "data-view", + "font_class": "data-view", + "unicode": "e687", + "unicode_decimal": 59015 + }, + { + "icon_id": "15838459", + "name": "direction-down-circle", + "font_class": "direction-down-circle", + "unicode": "e688", + "unicode_decimal": 59016 + }, + { + "icon_id": "15838460", + "name": "direction-right", + "font_class": "direction-right", + "unicode": "e689", + "unicode_decimal": 59017 + }, + { + "icon_id": "15838461", + "name": "direction-up", + "font_class": "direction-up", + "unicode": "e68a", + "unicode_decimal": 59018 + }, + { + "icon_id": "15838462", + "name": "discount", + "font_class": "discount", + "unicode": "e68b", + "unicode_decimal": 59019 + }, + { + "icon_id": "15838463", + "name": "direction-left", + "font_class": "direction-left", + "unicode": "e68c", + "unicode_decimal": 59020 + } + ] +} diff --git a/static/component/pear/font/iconfont.ttf b/static/component/pear/font/iconfont.ttf new file mode 100644 index 000000000..f40ab3ace Binary files /dev/null and b/static/component/pear/font/iconfont.ttf differ diff --git a/static/component/pear/font/iconfont.woff b/static/component/pear/font/iconfont.woff new file mode 100644 index 000000000..869e1a066 Binary files /dev/null and b/static/component/pear/font/iconfont.woff differ diff --git a/static/component/pear/font/iconfont.woff2 b/static/component/pear/font/iconfont.woff2 new file mode 100644 index 000000000..4a3ea5e4e Binary files /dev/null and b/static/component/pear/font/iconfont.woff2 differ diff --git a/static/component/pear/module/admin.js b/static/component/pear/module/admin.js new file mode 100644 index 000000000..d9cd2f1c7 --- /dev/null +++ b/static/component/pear/module/admin.js @@ -0,0 +1,782 @@ +layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'menu', 'frame', 'theme', 'convert'], + function(exports) { + "use strict"; + + var $ = layui.jquery, + form = layui.form, + element = layui.element, + yaml = layui.yaml, + pearTab = layui.tab, + convert = layui.convert, + pearMenu = layui.menu, + pearFrame = layui.frame, + pearTheme = layui.theme, + message = layui.message; + + var bodyFrame; + var sideMenu; + var bodyTab; + var config; + var logout = function() {}; + var msgInstance; + + var body = $('body'); + + var pearAdmin = new function() { + + var configType = 'yml'; + var configPath = 'pear.config.yml'; + + this.setConfigPath = function(path) { + configPath = path; + } + + this.setConfigType = function(type) { + configType = type; + } + + this.render = function(initConfig) { + if (initConfig !== undefined) { + applyConfig(initConfig); + } else { + applyConfig(pearAdmin.readConfig()); + } + } + + this.readConfig = function() { + if (configType === "yml") { + return yaml.load(configPath); + } else { + var data; + $.ajax({ + url: configPath, + type: 'get', + dataType: 'json', + async: false, + success: function(result) { + data = result; + } + }) + return data; + } + } + + this.messageRender = function(option) { + var option = { + elem: '.message', + url: option.header.message, + height: '250px' + }; + msgInstance = message.render(option); + } + + this.logoRender = function(param) { + $(".layui-logo .logo").attr("src", param.logo.image); + $(".layui-logo .title").html(param.logo.title); + } + + this.menuRender = function(param) { + sideMenu = pearMenu.render({ + elem: 'sideMenu', + async: param.menu.async !== undefined ? param.menu.async : true, + theme: "dark-theme", + height: '100%', + method: param.menu.method, + control: isControl(param) === 'true' || isControl(param) === true ? 'control' : false, // control + controlWidth: param.menu.controlWidth, + defaultMenu: 0, + accordion: param.menu.accordion, + url: param.menu.data, + data: param.menu.data, + parseData: false, + change: function() { + compatible(); + }, + done: function() { + sideMenu.selectItem(param.menu.select); + pearAdmin.collaspe(param); + } + }); + } + + this.bodyRender = function(param) { + + body.on("click", ".refresh", function() { + refresh(); + }) + + if (isMuiltTab(param) === "true" || isMuiltTab(param) === true) { + bodyTab = pearTab.render({ + elem: 'content', + roll: true, + tool: true, + width: '100%', + height: '100%', + session: param.tab.session, + index: 0, + tabMax: param.tab.max, + closeEvent: function(id) { + sideMenu.selectItem(id); + }, + data: [{ + id: param.tab.index.id, + url: param.tab.index.href, + title: param.tab.index.title, + close: false + }], + success: function(id) { + if (param.tab.session) { + setTimeout(function() { + sideMenu.selectItem(id); + bodyTab.positionTab(); + }, 500) + } + } + }); + + bodyTab.click(function(id) { + if (!param.tab.keepState) { + bodyTab.refresh(false); + } + bodyTab.positionTab(); + sideMenu.selectItem(id); + }) + + sideMenu.click(function(dom, data) { + bodyTab.addTabOnly({ + id: data.menuId, + title: data.menuTitle, + url: data.menuUrl, + icon: data.menuIcon, + close: true + }, 300); + compatible(); + }) + } else { + bodyFrame = pearFrame.render({ + elem: 'content', + title: '首页', + url: param.tab.index.href, + width: '100%', + height: '100%' + }); + + sideMenu.click(function(dom, data) { + bodyFrame.changePage(data.menuUrl, true); + compatible() + }) + } + } + + this.keepLoad = function(param) { + compatible() + setTimeout(function() { + $(".loader-main").fadeOut(200); + }, param.other.keepLoad) + } + + this.themeRender = function(option) { + if (option.theme.allowCustom === false) { + $(".setting").remove(); + } + var colorId = localStorage.getItem("theme-color"); + var currentColor = getColorById(colorId); + localStorage.setItem("theme-color", currentColor.id); + localStorage.setItem("theme-color-color", currentColor.color); + localStorage.setItem("theme-color-second", currentColor.second); + pearTheme.changeTheme(window, isAutoHead(config)); + + var menu = localStorage.getItem("theme-menu"); + if (menu === null) { + menu = option.theme.defaultMenu; + } else { + if (option.theme.allowCustom === false) { + menu = option.theme.defaultMenu; + } + } + + var header = localStorage.getItem("theme-header"); + if (header === null) { + header = option.theme.defaultHeader; + } else { + if (option.theme.allowCustom === false) { + header = option.theme.defaultHeader; + } + } + + var banner = localStorage.getItem("theme-banner"); + if (banner === null) { + banner = option.theme.banner; + } else { + if (option.theme.allowCustom === false) { + banner = option.theme.banner; + } + } + + var autoHead = localStorage.getItem("auto-head"); + if (autoHead === null) { + autoHead = option.other.autoHead; + } else { + if (option.theme.allowCustom === false) { + autoHead = option.other.autoHead; + } + } + + var muiltTab = localStorage.getItem("muilt-tab"); + if (muiltTab === null) { + muiltTab = option.tab.enable; + } else { + if (option.theme.allowCustom === false) { + muiltTab = option.tab.enable; + } + } + + var control = localStorage.getItem("control"); + if (control === null) { + control = option.menu.control; + } else { + if (option.theme.allowCustom === false) { + control = option.menu.control; + } + } + + localStorage.setItem("muilt-tab", muiltTab); + localStorage.setItem("theme-banner", banner); + localStorage.setItem("theme-menu", menu); + localStorage.setItem("theme-header", header); + localStorage.setItem("auto-head", autoHead); + localStorage.setItem("control", control); + this.menuSkin(menu); + this.headerSkin(header); + this.bannerSkin(banner); + } + + this.bannerSkin = function(theme) { + var pearAdmin = $(".pear-admin"); + pearAdmin.removeClass("banner-layout"); + if (theme === true || theme === "true") { + pearAdmin.addClass("banner-layout"); + } + } + + this.collaspe = function(param) { + if (param.menu.collaspe) { + if ($(window).width() >= 768) { + collaspe() + } + } + } + + this.menuSkin = function(theme) { + var pearAdmin = $(".pear-admin .layui-side"); + pearAdmin.removeClass("light-theme"); + pearAdmin.removeClass("dark-theme"); + pearAdmin.addClass(theme); + } + + this.headerSkin = function(theme) { + var pearAdmin = $(".pear-admin .layui-header"); + pearAdmin.removeClass("light-theme"); + pearAdmin.removeClass("dark-theme"); + pearAdmin.addClass(theme); + } + + this.logout = function(callback) { + logout = callback; + } + + this.message = function(callback) { + if (callback != null) { + msgInstance.click(callback); + } + } + + this.collaspeSide = function() { + collaspe() + } + + this.refreshThis = function() { + refresh() + } + + this.refresh = function(id) { + $("iframe[id='"+ id +"']").attr('src', $("iframe[id='"+ id +"']").attr('src')); + } + + this.addTab = function(id, title, url) { + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { + bodyTab.addTabOnly({ + id: id, + title: title, + url: url, + icon: null, + close: true + }, 400); + } else { + return; + } + } + + this.closeTab = function(id) { + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { + pearTab.delTabByElem('content', id, function(currentId){ + sideMenu.selectItem(currentId); + }); + } else { + return; + } + } + + this.closeCurrentTab = function() { + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { + pearTab.delCurrentTabByElem('content', function(id){ + sideMenu.selectItem(id); + }); + } else { + return; + } + } + + this.closeOtherTab = function() { + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { + pearTab.delOtherTabByElem('content', function(id){ + sideMenu.selectItem(id); + }); + } else { + return; + } + } + + this.closeAllTab = function() { + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { + pearTab.delAllTabByElem('content', function(id){ + sideMenu.selectItem(id); + }); + } else { + return; + } + } + + this.changeTabTitle = function(id, title) { + pearTab.changeTabTitleById('content', id ,title); + } + + this.changeIframe = function(id, title, url) { + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { + return; + } else { + sideMenu.selectItem(id); + bodyFrame.changePage(url, true); + } + } + + this.jump = function(id, title, url) { + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { + pearAdmin.addTab(id, title, url) + } else { + pearAdmin.changeIframe(id, title, url) + } + } + + this.fullScreen = function() { + if ($(".fullScreen").hasClass("layui-icon-screen-restore")) { + screenFun(2).then(function() { + $(".fullScreen").eq(0).removeClass("layui-icon-screen-restore"); + }); + } else { + screenFun(1).then(function() { + $(".fullScreen").eq(0).addClass("layui-icon-screen-restore"); + }); + } + } + }; + + function refresh() { + var refreshA = $(".refresh a"); + refreshA.removeClass("layui-icon-refresh-1"); + refreshA.addClass("layui-anim"); + refreshA.addClass("layui-anim-rotate"); + refreshA.addClass("layui-anim-loop"); + refreshA.addClass("layui-icon-loading"); + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) bodyTab.refresh(400); + else bodyFrame.refresh(400); + setTimeout(function() { + refreshA.addClass("layui-icon-refresh-1"); + refreshA.removeClass("layui-anim"); + refreshA.removeClass("layui-anim-rotate"); + refreshA.removeClass("layui-anim-loop"); + refreshA.removeClass("layui-icon-loading"); + }, 600) + } + + function collaspe() { + sideMenu.collaspe(); + var admin = $(".pear-admin"); + var left = $(".layui-icon-spread-left") + var right = $(".layui-icon-shrink-right") + if (admin.is(".pear-mini")) { + left.addClass("layui-icon-shrink-right") + left.removeClass("layui-icon-spread-left") + admin.removeClass("pear-mini"); + } else { + right.addClass("layui-icon-spread-left") + right.removeClass("layui-icon-shrink-right") + admin.addClass("pear-mini"); + } + } + + body.on("click", ".logout", function() { + if (logout() && bodyTab) { + bodyTab.clear(); + } + }) + + body.on("click", ".collaspe,.pear-cover", function() { + collaspe(); + }); + + body.on("click", ".fullScreen", function() { + if ($(this).hasClass("layui-icon-screen-restore")) { + screenFun(2).then(function() { + $(".fullScreen").eq(0).removeClass("layui-icon-screen-restore"); + }); + } else { + screenFun(1).then(function() { + $(".fullScreen").eq(0).addClass("layui-icon-screen-restore"); + }); + } + }); + + body.on("click", '[user-menu-id]', function() { + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { + bodyTab.addTabOnly({ + id: $(this).attr("user-menu-id"), + title: $(this).attr("user-menu-title"), + url: $(this).attr("user-menu-url"), + icon: "", + close: true + }, 300); + } else { + bodyFrame.changePage($(this).attr("user-menu-url"), true); + } + }); + + body.on("click", ".setting", function() { + + var menuItem = + '
                      • ' + + '' + + '
                        ' + + '
                        ' + + '
                        ' + + '
                      • '; + + menuItem += + '
                      • ' + + '' + + '
                        ' + + '
                        ' + + '
                        ' + + '
                      • '; + + var menuHtml = + '
                        \n' + + '
                        菜单风格
                        \n' + + '
                        \n' + + '
                          \n' + menuItem + '
                        \n' + + '
                        \n' + + '
                        '; + + var headItem = + '
                      • ' + + '' + + '
                        ' + + '
                        ' + + '
                        ' + + '
                      • '; + + headItem += + '
                      • ' + + '' + + '
                        ' + + '
                        ' + + '
                        ' + + '
                      • '; + + var headHtml = + '
                        \n' + + '
                        顶部风格
                        \n' + + '
                        \n' + + '
                          \n' + headItem + '
                        \n' + + '
                        \n' + + '
                        '; + + var moreItem = + '
                        菜单
                        '; + + moreItem += + '
                        视图
                        '; + + moreItem += + '
                        通栏
                        '; + + moreItem += + '
                        通色
                        '; + + var moreHtml = '
                        \n' + + '
                        更多设置
                        \n' + + '
                        \n' + + '
                        \n' + moreItem + '
                        \n' + + '
                        \n' + + '
                        '; + + layer.open({ + type: 1, + offset: 'r', + area: ['320px', '100%'], + title: false, + shade: 0.1, + closeBtn: 0, + shadeClose: false, + anim: -1, + skin: 'layer-anim-right', + move: false, + content: menuHtml + headHtml + buildColorHtml() + moreHtml, + success: function(layero, index) { + + form.render(); + + var color = localStorage.getItem("theme-color"); + var menu = localStorage.getItem("theme-menu"); + var header = localStorage.getItem("theme-header"); + + if (color !== "null") { + $(".select-color-item").removeClass("layui-icon").removeClass("layui-icon-ok"); + $("*[color-id='" + color + "']").addClass("layui-icon").addClass("layui-icon-ok"); + } + + if (menu !== "null") { + $("*[data-select-bgcolor]").removeClass("layui-this"); + $("[data-select-bgcolor='" + menu + "']").addClass("layui-this"); + } + + if (header !== "null") { + $("*[data-select-header]").removeClass("layui-this"); + $("[data-select-header='" + header + "']").addClass("layui-this"); + } + + $('#layui-layer-shade' + index).click(function() { + var $layero = $('#layui-layer' + index); + $layero.animate({ + left: $layero.offset().left + $layero.width() + }, 200, function() { + layer.close(index); + }); + }) + + form.on('switch(control)', function(data) { + localStorage.setItem("control", this.checked); + window.location.reload(); + }) + + form.on('switch(muilt-tab)', function(data) { + localStorage.setItem("muilt-tab", this.checked); + window.location.reload(); + }) + + form.on('switch(auto-head)', function(data) { + localStorage.setItem("auto-head", this.checked); + pearTheme.changeTheme(window, this.checked); + }) + + form.on('switch(banner)', function(data) { + localStorage.setItem("theme-banner", this.checked); + pearAdmin.bannerSkin(this.checked); + }) + + if (localStorage.getItem('theme-banner') === 'true') { + $('input[name="banner"]').attr('checked', 'checked') + } else { + $('input[name="banner"]').removeAttr('checked') + } + + if (localStorage.getItem('control') === 'true') { + $('input[name="control"]').attr('checked', 'checked') + } else { + $('input[name="control"]').removeAttr('checked') + } + + if (localStorage.getItem('muilt-tab') === 'true') { + $('input[name="muilt-tab"]').attr('checked', 'checked') + } else { + $('input[name="muilt-tab"]').removeAttr('checked') + } + + if (localStorage.getItem('auto-head') === 'true') { + $('input[name="auto-head"]').attr('checked', 'checked') + } else { + $('input[name="auto-head"]').removeAttr('checked') + } + + form.render('checkbox'); + } + }); + }); + + body.on('click', '[data-select-bgcolor]', function() { + var theme = $(this).attr('data-select-bgcolor'); + $('[data-select-bgcolor]').removeClass("layui-this"); + $(this).addClass("layui-this"); + localStorage.setItem("theme-menu", theme); + pearAdmin.menuSkin(theme); + }); + + body.on('click', '[data-select-header]', function() { + var theme = $(this).attr('data-select-header'); + $('[data-select-header]').removeClass("layui-this"); + $(this).addClass("layui-this"); + localStorage.setItem("theme-header", theme); + pearAdmin.headerSkin(theme); + }); + + body.on('click', '.select-color-item', function() { + $(".select-color-item").removeClass("layui-icon").removeClass("layui-icon-ok"); + $(this).addClass("layui-icon").addClass("layui-icon-ok"); + var colorId = $(".select-color-item.layui-icon-ok").attr("color-id"); + var currentColor = getColorById(colorId); + localStorage.setItem("theme-color", currentColor.id); + localStorage.setItem("theme-color-color", currentColor.color); + localStorage.setItem("theme-color-second", currentColor.second); + pearTheme.changeTheme(window, isAutoHead(config)); + }); + + function applyConfig(param) { + config = param; + pearAdmin.logoRender(param); + pearAdmin.menuRender(param); + pearAdmin.bodyRender(param); + pearAdmin.themeRender(param); + pearAdmin.keepLoad(param); + if (param.header.message != false) { + pearAdmin.messageRender(param); + } + } + + function getColorById(id) { + var color; + var flag = false; + $.each(config.colors, function(i, value) { + if (value.id === id) { + color = value; + flag = true; + } + }) + if (flag === false || config.theme.allowCustom === false) { + $.each(config.colors, function(i, value) { + if (value.id === config.theme.defaultColor) { + color = value; + } + }) + } + return color; + } + + function buildColorHtml() { + var colors = ""; + $.each(config.colors, function(i, value) { + colors += ""; + }) + return "
                        主题配色
                        " + + colors + "
                        " + } + + function compatible() { + if ($(window).width() <= 768) { + collaspe() + } + } + + function screenFun(num) { + num = num || 1; + num = num * 1; + var docElm = document.documentElement; + switch (num) { + case 1: + if (docElm.requestFullscreen) { + docElm.requestFullscreen(); + } else if (docElm.mozRequestFullScreen) { + docElm.mozRequestFullScreen(); + } else if (docElm.webkitRequestFullScreen) { + docElm.webkitRequestFullScreen(); + } else if (docElm.msRequestFullscreen) { + docElm.msRequestFullscreen(); + } + break; + case 2: + if (document.exitFullscreen) { + document.exitFullscreen(); + } else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } else if (document.webkitCancelFullScreen) { + document.webkitCancelFullScreen(); + } else if (document.msExitFullscreen) { + document.msExitFullscreen(); + } + break; + } + return new Promise(function(res, rej) { + res("返回值"); + }); + } + + function isFullscreen() { + return document.fullscreenElement || + document.msFullscreenElement || + document.mozFullScreenElement || + document.webkitFullscreenElement || false; + } + + function isControl(option) { + if (option.theme.allowCustom) { + if (localStorage.getItem("control") != null) { + return localStorage.getItem("control") + } else { + return option.menu.control + } + } else { + return option.menu.control + } + } + + function isAutoHead(option) { + if (option.theme.allowCustom) { + if (localStorage.getItem("auto-head") != null) { + return localStorage.getItem("auto-head"); + } else { + return option.other.autoHead; + } + } else { + return option.other.autoHead; + } + } + + function isMuiltTab(option) { + if (option.theme.allowCustom) { + if (localStorage.getItem("muilt-tab") != null) { + return localStorage.getItem("muilt-tab") + } else { + return option.tab.enable + } + } else { + return option.tab.enable + } + } + + window.onresize = function() { + if (!isFullscreen()) { + $(".fullScreen").eq(0).removeClass("layui-icon-screen-restore"); + } + } + exports('admin', pearAdmin); + }) diff --git a/static/component/pear/module/area.js b/static/component/pear/module/area.js new file mode 100644 index 000000000..604c91e91 --- /dev/null +++ b/static/component/pear/module/area.js @@ -0,0 +1,4070 @@ +layui.define(['layer', 'form', 'laytpl'], function (exports) { + "use strict"; + + let $ = layui.$ + , form = layui.form + , layarea = { + _id: 0 + , config: {} + , set: function (options) { + let that = this; + that.config = $.extend({}, that.config, options); + return that; + } + , on: function (events, callback) { + return layui.onevent.call(this, 'layarea', events, callback); + } + } + , thisArea = function () { + let that = this; + return { + layarea: function (files) { + that.layarea.call(that, files); + } + , config: that.config + , reload: that.reload + , events: that.events + } + } + , Class = function (options) { + let that = this; + that.config = $.extend({}, { + elem: '', + data: { + province: '', + city: '', + county: '', + provinceCode: 0, + cityCode: 0, + countyCode: 0, + } + }, options); + that.render(); + }; + + let areaList = { + province_list: { + 110000: '北京市', + 120000: '天津市', + 130000: '河北省', + 140000: '山西省', + 150000: '内蒙古自治区', + 210000: '辽宁省', + 220000: '吉林省', + 230000: '黑龙江省', + 310000: '上海市', + 320000: '江苏省', + 330000: '浙江省', + 340000: '安徽省', + 350000: '福建省', + 360000: '江西省', + 370000: '山东省', + 410000: '河南省', + 420000: '湖北省', + 430000: '湖南省', + 440000: '广东省', + 450000: '广西壮族自治区', + 460000: '海南省', + 500000: '重庆市', + 510000: '四川省', + 520000: '贵州省', + 530000: '云南省', + 540000: '西藏自治区', + 610000: '陕西省', + 620000: '甘肃省', + 630000: '青海省', + 640000: '宁夏回族自治区', + 650000: '新疆维吾尔自治区', + 710000: '台湾省', + 810000: '香港特别行政区', + 820000: '澳门特别行政区', + 900000: '海外' + }, + city_list: { + 110100: '北京市', + 120100: '天津市', + 130100: '石家庄市', + 130200: '唐山市', + 130300: '秦皇岛市', + 130400: '邯郸市', + 130500: '邢台市', + 130600: '保定市', + 130700: '张家口市', + 130800: '承德市', + 130900: '沧州市', + 131000: '廊坊市', + 131100: '衡水市', + 139000: '省直辖县', + 140100: '太原市', + 140200: '大同市', + 140300: '阳泉市', + 140400: '长治市', + 140500: '晋城市', + 140600: '朔州市', + 140700: '晋中市', + 140800: '运城市', + 140900: '忻州市', + 141000: '临汾市', + 141100: '吕梁市', + 150100: '呼和浩特市', + 150200: '包头市', + 150300: '乌海市', + 150400: '赤峰市', + 150500: '通辽市', + 150600: '鄂尔多斯市', + 150700: '呼伦贝尔市', + 150800: '巴彦淖尔市', + 150900: '乌兰察布市', + 152200: '兴安盟', + 152500: '锡林郭勒盟', + 152900: '阿拉善盟', + 210100: '沈阳市', + 210200: '大连市', + 210300: '鞍山市', + 210400: '抚顺市', + 210500: '本溪市', + 210600: '丹东市', + 210700: '锦州市', + 210800: '营口市', + 210900: '阜新市', + 211000: '辽阳市', + 211100: '盘锦市', + 211200: '铁岭市', + 211300: '朝阳市', + 211400: '葫芦岛市', + 220100: '长春市', + 220200: '吉林市', + 220300: '四平市', + 220400: '辽源市', + 220500: '通化市', + 220600: '白山市', + 220700: '松原市', + 220800: '白城市', + 222400: '延边朝鲜族自治州', + 230100: '哈尔滨市', + 230200: '齐齐哈尔市', + 230300: '鸡西市', + 230400: '鹤岗市', + 230500: '双鸭山市', + 230600: '大庆市', + 230700: '伊春市', + 230800: '佳木斯市', + 230900: '七台河市', + 231000: '牡丹江市', + 231100: '黑河市', + 231200: '绥化市', + 232700: '大兴安岭地区', + 310100: '上海市', + 320100: '南京市', + 320200: '无锡市', + 320300: '徐州市', + 320400: '常州市', + 320500: '苏州市', + 320600: '南通市', + 320700: '连云港市', + 320800: '淮安市', + 320900: '盐城市', + 321000: '扬州市', + 321100: '镇江市', + 321200: '泰州市', + 321300: '宿迁市', + 330100: '杭州市', + 330200: '宁波市', + 330300: '温州市', + 330400: '嘉兴市', + 330500: '湖州市', + 330600: '绍兴市', + 330700: '金华市', + 330800: '衢州市', + 330900: '舟山市', + 331000: '台州市', + 331100: '丽水市', + 340100: '合肥市', + 340200: '芜湖市', + 340300: '蚌埠市', + 340400: '淮南市', + 340500: '马鞍山市', + 340600: '淮北市', + 340700: '铜陵市', + 340800: '安庆市', + 341000: '黄山市', + 341100: '滁州市', + 341200: '阜阳市', + 341300: '宿州市', + 341500: '六安市', + 341600: '亳州市', + 341700: '池州市', + 341800: '宣城市', + 350100: '福州市', + 350200: '厦门市', + 350300: '莆田市', + 350400: '三明市', + 350500: '泉州市', + 350600: '漳州市', + 350700: '南平市', + 350800: '龙岩市', + 350900: '宁德市', + 360100: '南昌市', + 360200: '景德镇市', + 360300: '萍乡市', + 360400: '九江市', + 360500: '新余市', + 360600: '鹰潭市', + 360700: '赣州市', + 360800: '吉安市', + 360900: '宜春市', + 361000: '抚州市', + 361100: '上饶市', + 370100: '济南市', + 370200: '青岛市', + 370300: '淄博市', + 370400: '枣庄市', + 370500: '东营市', + 370600: '烟台市', + 370700: '潍坊市', + 370800: '济宁市', + 370900: '泰安市', + 371000: '威海市', + 371100: '日照市', + 371200: '莱芜市', + 371300: '临沂市', + 371400: '德州市', + 371500: '聊城市', + 371600: '滨州市', + 371700: '菏泽市', + 410100: '郑州市', + 410200: '开封市', + 410300: '洛阳市', + 410400: '平顶山市', + 410500: '安阳市', + 410600: '鹤壁市', + 410700: '新乡市', + 410800: '焦作市', + 410900: '濮阳市', + 411000: '许昌市', + 411100: '漯河市', + 411200: '三门峡市', + 411300: '南阳市', + 411400: '商丘市', + 411500: '信阳市', + 411600: '周口市', + 411700: '驻马店市', + 419000: '省直辖县', + 420100: '武汉市', + 420200: '黄石市', + 420300: '十堰市', + 420500: '宜昌市', + 420600: '襄阳市', + 420700: '鄂州市', + 420800: '荆门市', + 420900: '孝感市', + 421000: '荆州市', + 421100: '黄冈市', + 421200: '咸宁市', + 421300: '随州市', + 422800: '恩施土家族苗族自治州', + 429000: '省直辖县', + 430100: '长沙市', + 430200: '株洲市', + 430300: '湘潭市', + 430400: '衡阳市', + 430500: '邵阳市', + 430600: '岳阳市', + 430700: '常德市', + 430800: '张家界市', + 430900: '益阳市', + 431000: '郴州市', + 431100: '永州市', + 431200: '怀化市', + 431300: '娄底市', + 433100: '湘西土家族苗族自治州', + 440100: '广州市', + 440200: '韶关市', + 440300: '深圳市', + 440400: '珠海市', + 440500: '汕头市', + 440600: '佛山市', + 440700: '江门市', + 440800: '湛江市', + 440900: '茂名市', + 441200: '肇庆市', + 441300: '惠州市', + 441400: '梅州市', + 441500: '汕尾市', + 441600: '河源市', + 441700: '阳江市', + 441800: '清远市', + 441900: '东莞市', + 442000: '中山市', + 445100: '潮州市', + 445200: '揭阳市', + 445300: '云浮市', + 450100: '南宁市', + 450200: '柳州市', + 450300: '桂林市', + 450400: '梧州市', + 450500: '北海市', + 450600: '防城港市', + 450700: '钦州市', + 450800: '贵港市', + 450900: '玉林市', + 451000: '百色市', + 451100: '贺州市', + 451200: '河池市', + 451300: '来宾市', + 451400: '崇左市', + 460100: '海口市', + 460200: '三亚市', + 460300: '三沙市', + 460400: '儋州市', + 469000: '省直辖县', + 500100: '重庆市', + 500200: '县', + 510100: '成都市', + 510300: '自贡市', + 510400: '攀枝花市', + 510500: '泸州市', + 510600: '德阳市', + 510700: '绵阳市', + 510800: '广元市', + 510900: '遂宁市', + 511000: '内江市', + 511100: '乐山市', + 511300: '南充市', + 511400: '眉山市', + 511500: '宜宾市', + 511600: '广安市', + 511700: '达州市', + 511800: '雅安市', + 511900: '巴中市', + 512000: '资阳市', + 513200: '阿坝藏族羌族自治州', + 513300: '甘孜藏族自治州', + 513400: '凉山彝族自治州', + 520100: '贵阳市', + 520200: '六盘水市', + 520300: '遵义市', + 520400: '安顺市', + 520500: '毕节市', + 520600: '铜仁市', + 522300: '黔西南布依族苗族自治州', + 522600: '黔东南苗族侗族自治州', + 522700: '黔南布依族苗族自治州', + 530100: '昆明市', + 530300: '曲靖市', + 530400: '玉溪市', + 530500: '保山市', + 530600: '昭通市', + 530700: '丽江市', + 530800: '普洱市', + 530900: '临沧市', + 532300: '楚雄彝族自治州', + 532500: '红河哈尼族彝族自治州', + 532600: '文山壮族苗族自治州', + 532800: '西双版纳傣族自治州', + 532900: '大理白族自治州', + 533100: '德宏傣族景颇族自治州', + 533300: '怒江傈僳族自治州', + 533400: '迪庆藏族自治州', + 540100: '拉萨市', + 540200: '日喀则市', + 540300: '昌都市', + 540400: '林芝市', + 540500: '山南市', + 540600: '那曲市', + 542500: '阿里地区', + 610100: '西安市', + 610200: '铜川市', + 610300: '宝鸡市', + 610400: '咸阳市', + 610500: '渭南市', + 610600: '延安市', + 610700: '汉中市', + 610800: '榆林市', + 610900: '安康市', + 611000: '商洛市', + 620100: '兰州市', + 620200: '嘉峪关市', + 620300: '金昌市', + 620400: '白银市', + 620500: '天水市', + 620600: '武威市', + 620700: '张掖市', + 620800: '平凉市', + 620900: '酒泉市', + 621000: '庆阳市', + 621100: '定西市', + 621200: '陇南市', + 622900: '临夏回族自治州', + 623000: '甘南藏族自治州', + 630100: '西宁市', + 630200: '海东市', + 632200: '海北藏族自治州', + 632300: '黄南藏族自治州', + 632500: '海南藏族自治州', + 632600: '果洛藏族自治州', + 632700: '玉树藏族自治州', + 632800: '海西蒙古族藏族自治州', + 640100: '银川市', + 640200: '石嘴山市', + 640300: '吴忠市', + 640400: '固原市', + 640500: '中卫市', + 650100: '乌鲁木齐市', + 650200: '克拉玛依市', + 650400: '吐鲁番市', + 650500: '哈密市', + 652300: '昌吉回族自治州', + 652700: '博尔塔拉蒙古自治州', + 652800: '巴音郭楞蒙古自治州', + 652900: '阿克苏地区', + 653000: '克孜勒苏柯尔克孜自治州', + 653100: '喀什地区', + 653200: '和田地区', + 654000: '伊犁哈萨克自治州', + 654200: '塔城地区', + 654300: '阿勒泰地区', + 659000: '自治区直辖县级行政区划', + 710100: '台北市', + 710200: '高雄市', + 710300: '台南市', + 710400: '台中市', + 710500: '金门县', + 710600: '南投县', + 710700: '基隆市', + 710800: '新竹市', + 710900: '嘉义市', + 711100: '新北市', + 711200: '宜兰县', + 711300: '新竹县', + 711400: '桃园县', + 711500: '苗栗县', + 711700: '彰化县', + 711900: '嘉义县', + 712100: '云林县', + 712400: '屏东县', + 712500: '台东县', + 712600: '花莲县', + 712700: '澎湖县', + 712800: '连江县', + 810100: '香港岛', + 810200: '九龙', + 810300: '新界', + 820100: '澳门半岛', + 820200: '离岛', + 912400: '加拿大', + 941000: '韩国', + 984000: '美国' + }, + county_list: { + 110101: '东城区', + 110102: '西城区', + 110105: '朝阳区', + 110106: '丰台区', + 110107: '石景山区', + 110108: '海淀区', + 110109: '门头沟区', + 110111: '房山区', + 110112: '通州区', + 110113: '顺义区', + 110114: '昌平区', + 110115: '大兴区', + 110116: '怀柔区', + 110117: '平谷区', + 110118: '密云区', + 110119: '延庆区', + 120101: '和平区', + 120102: '河东区', + 120103: '河西区', + 120104: '南开区', + 120105: '河北区', + 120106: '红桥区', + 120110: '东丽区', + 120111: '西青区', + 120112: '津南区', + 120113: '北辰区', + 120114: '武清区', + 120115: '宝坻区', + 120116: '滨海新区', + 120117: '宁河区', + 120118: '静海区', + 120119: '蓟州区', + 130102: '长安区', + 130104: '桥西区', + 130105: '新华区', + 130107: '井陉矿区', + 130108: '裕华区', + 130109: '藁城区', + 130110: '鹿泉区', + 130111: '栾城区', + 130121: '井陉县', + 130123: '正定县', + 130125: '行唐县', + 130126: '灵寿县', + 130127: '高邑县', + 130128: '深泽县', + 130129: '赞皇县', + 130130: '无极县', + 130131: '平山县', + 130132: '元氏县', + 130133: '赵县', + 130181: '辛集市', + 130183: '晋州市', + 130184: '新乐市', + 130202: '路南区', + 130203: '路北区', + 130204: '古冶区', + 130205: '开平区', + 130207: '丰南区', + 130208: '丰润区', + 130209: '曹妃甸区', + 130223: '滦县', + 130224: '滦南县', + 130225: '乐亭县', + 130227: '迁西县', + 130229: '玉田县', + 130281: '遵化市', + 130283: '迁安市', + 130302: '海港区', + 130303: '山海关区', + 130304: '北戴河区', + 130306: '抚宁区', + 130321: '青龙满族自治县', + 130322: '昌黎县', + 130324: '卢龙县', + 130390: '经济技术开发区', + 130402: '邯山区', + 130403: '丛台区', + 130404: '复兴区', + 130406: '峰峰矿区', + 130407: '肥乡区', + 130408: '永年区', + 130423: '临漳县', + 130424: '成安县', + 130425: '大名县', + 130426: '涉县', + 130427: '磁县', + 130430: '邱县', + 130431: '鸡泽县', + 130432: '广平县', + 130433: '馆陶县', + 130434: '魏县', + 130435: '曲周县', + 130481: '武安市', + 130502: '桥东区', + 130503: '桥西区', + 130521: '邢台县', + 130522: '临城县', + 130523: '内丘县', + 130524: '柏乡县', + 130525: '隆尧县', + 130526: '任县', + 130527: '南和县', + 130528: '宁晋县', + 130529: '巨鹿县', + 130530: '新河县', + 130531: '广宗县', + 130532: '平乡县', + 130533: '威县', + 130534: '清河县', + 130535: '临西县', + 130581: '南宫市', + 130582: '沙河市', + 130602: '竞秀区', + 130606: '莲池区', + 130607: '满城区', + 130608: '清苑区', + 130609: '徐水区', + 130623: '涞水县', + 130624: '阜平县', + 130626: '定兴县', + 130627: '唐县', + 130628: '高阳县', + 130629: '容城县', + 130630: '涞源县', + 130631: '望都县', + 130632: '安新县', + 130633: '易县', + 130634: '曲阳县', + 130635: '蠡县', + 130636: '顺平县', + 130637: '博野县', + 130638: '雄县', + 130681: '涿州市', + 130682: '定州市', + 130683: '安国市', + 130684: '高碑店市', + 130702: '桥东区', + 130703: '桥西区', + 130705: '宣化区', + 130706: '下花园区', + 130708: '万全区', + 130709: '崇礼区', + 130722: '张北县', + 130723: '康保县', + 130724: '沽源县', + 130725: '尚义县', + 130726: '蔚县', + 130727: '阳原县', + 130728: '怀安县', + 130730: '怀来县', + 130731: '涿鹿县', + 130732: '赤城县', + 130802: '双桥区', + 130803: '双滦区', + 130804: '鹰手营子矿区', + 130821: '承德县', + 130822: '兴隆县', + 130824: '滦平县', + 130825: '隆化县', + 130826: '丰宁满族自治县', + 130827: '宽城满族自治县', + 130828: '围场满族蒙古族自治县', + 130881: '平泉市', + 130902: '新华区', + 130903: '运河区', + 130921: '沧县', + 130922: '青县', + 130923: '东光县', + 130924: '海兴县', + 130925: '盐山县', + 130926: '肃宁县', + 130927: '南皮县', + 130928: '吴桥县', + 130929: '献县', + 130930: '孟村回族自治县', + 130981: '泊头市', + 130982: '任丘市', + 130983: '黄骅市', + 130984: '河间市', + 131002: '安次区', + 131003: '广阳区', + 131022: '固安县', + 131023: '永清县', + 131024: '香河县', + 131025: '大城县', + 131026: '文安县', + 131028: '大厂回族自治县', + 131081: '霸州市', + 131082: '三河市', + 131090: '开发区', + 131102: '桃城区', + 131103: '冀州区', + 131121: '枣强县', + 131122: '武邑县', + 131123: '武强县', + 131124: '饶阳县', + 131125: '安平县', + 131126: '故城县', + 131127: '景县', + 131128: '阜城县', + 131182: '深州市', + 140105: '小店区', + 140106: '迎泽区', + 140107: '杏花岭区', + 140108: '尖草坪区', + 140109: '万柏林区', + 140110: '晋源区', + 140121: '清徐县', + 140122: '阳曲县', + 140123: '娄烦县', + 140181: '古交市', + 140202: '城区', + 140203: '矿区', + 140211: '南郊区', + 140212: '新荣区', + 140221: '阳高县', + 140222: '天镇县', + 140223: '广灵县', + 140224: '灵丘县', + 140225: '浑源县', + 140226: '左云县', + 140227: '大同县', + 140302: '城区', + 140303: '矿区', + 140311: '郊区', + 140321: '平定县', + 140322: '盂县', + 140402: '城区', + 140411: '郊区', + 140421: '长治县', + 140423: '襄垣县', + 140424: '屯留县', + 140425: '平顺县', + 140426: '黎城县', + 140427: '壶关县', + 140428: '长子县', + 140429: '武乡县', + 140430: '沁县', + 140431: '沁源县', + 140481: '潞城市', + 140502: '城区', + 140521: '沁水县', + 140522: '阳城县', + 140524: '陵川县', + 140525: '泽州县', + 140581: '高平市', + 140602: '朔城区', + 140603: '平鲁区', + 140621: '山阴县', + 140622: '应县', + 140623: '右玉县', + 140624: '怀仁县', + 140702: '榆次区', + 140721: '榆社县', + 140722: '左权县', + 140723: '和顺县', + 140724: '昔阳县', + 140725: '寿阳县', + 140726: '太谷县', + 140727: '祁县', + 140728: '平遥县', + 140729: '灵石县', + 140781: '介休市', + 140802: '盐湖区', + 140821: '临猗县', + 140822: '万荣县', + 140823: '闻喜县', + 140824: '稷山县', + 140825: '新绛县', + 140826: '绛县', + 140827: '垣曲县', + 140828: '夏县', + 140829: '平陆县', + 140830: '芮城县', + 140881: '永济市', + 140882: '河津市', + 140902: '忻府区', + 140921: '定襄县', + 140922: '五台县', + 140923: '代县', + 140924: '繁峙县', + 140925: '宁武县', + 140926: '静乐县', + 140927: '神池县', + 140928: '五寨县', + 140929: '岢岚县', + 140930: '河曲县', + 140931: '保德县', + 140932: '偏关县', + 140981: '原平市', + 141002: '尧都区', + 141021: '曲沃县', + 141022: '翼城县', + 141023: '襄汾县', + 141024: '洪洞县', + 141025: '古县', + 141026: '安泽县', + 141027: '浮山县', + 141028: '吉县', + 141029: '乡宁县', + 141030: '大宁县', + 141031: '隰县', + 141032: '永和县', + 141033: '蒲县', + 141034: '汾西县', + 141081: '侯马市', + 141082: '霍州市', + 141102: '离石区', + 141121: '文水县', + 141122: '交城县', + 141123: '兴县', + 141124: '临县', + 141125: '柳林县', + 141126: '石楼县', + 141127: '岚县', + 141128: '方山县', + 141129: '中阳县', + 141130: '交口县', + 141181: '孝义市', + 141182: '汾阳市', + 150102: '新城区', + 150103: '回民区', + 150104: '玉泉区', + 150105: '赛罕区', + 150121: '土默特左旗', + 150122: '托克托县', + 150123: '和林格尔县', + 150124: '清水河县', + 150125: '武川县', + 150202: '东河区', + 150203: '昆都仑区', + 150204: '青山区', + 150205: '石拐区', + 150206: '白云鄂博矿区', + 150207: '九原区', + 150221: '土默特右旗', + 150222: '固阳县', + 150223: '达尔罕茂明安联合旗', + 150302: '海勃湾区', + 150303: '海南区', + 150304: '乌达区', + 150402: '红山区', + 150403: '元宝山区', + 150404: '松山区', + 150421: '阿鲁科尔沁旗', + 150422: '巴林左旗', + 150423: '巴林右旗', + 150424: '林西县', + 150425: '克什克腾旗', + 150426: '翁牛特旗', + 150428: '喀喇沁旗', + 150429: '宁城县', + 150430: '敖汉旗', + 150502: '科尔沁区', + 150521: '科尔沁左翼中旗', + 150522: '科尔沁左翼后旗', + 150523: '开鲁县', + 150524: '库伦旗', + 150525: '奈曼旗', + 150526: '扎鲁特旗', + 150581: '霍林郭勒市', + 150602: '东胜区', + 150603: '康巴什区', + 150621: '达拉特旗', + 150622: '准格尔旗', + 150623: '鄂托克前旗', + 150624: '鄂托克旗', + 150625: '杭锦旗', + 150626: '乌审旗', + 150627: '伊金霍洛旗', + 150702: '海拉尔区', + 150703: '扎赉诺尔区', + 150721: '阿荣旗', + 150722: '莫力达瓦达斡尔族自治旗', + 150723: '鄂伦春自治旗', + 150724: '鄂温克族自治旗', + 150725: '陈巴尔虎旗', + 150726: '新巴尔虎左旗', + 150727: '新巴尔虎右旗', + 150781: '满洲里市', + 150782: '牙克石市', + 150783: '扎兰屯市', + 150784: '额尔古纳市', + 150785: '根河市', + 150802: '临河区', + 150821: '五原县', + 150822: '磴口县', + 150823: '乌拉特前旗', + 150824: '乌拉特中旗', + 150825: '乌拉特后旗', + 150826: '杭锦后旗', + 150902: '集宁区', + 150921: '卓资县', + 150922: '化德县', + 150923: '商都县', + 150924: '兴和县', + 150925: '凉城县', + 150926: '察哈尔右翼前旗', + 150927: '察哈尔右翼中旗', + 150928: '察哈尔右翼后旗', + 150929: '四子王旗', + 150981: '丰镇市', + 152201: '乌兰浩特市', + 152202: '阿尔山市', + 152221: '科尔沁右翼前旗', + 152222: '科尔沁右翼中旗', + 152223: '扎赉特旗', + 152224: '突泉县', + 152501: '二连浩特市', + 152502: '锡林浩特市', + 152522: '阿巴嘎旗', + 152523: '苏尼特左旗', + 152524: '苏尼特右旗', + 152525: '东乌珠穆沁旗', + 152526: '西乌珠穆沁旗', + 152527: '太仆寺旗', + 152528: '镶黄旗', + 152529: '正镶白旗', + 152530: '正蓝旗', + 152531: '多伦县', + 152921: '阿拉善左旗', + 152922: '阿拉善右旗', + 152923: '额济纳旗', + 210102: '和平区', + 210103: '沈河区', + 210104: '大东区', + 210105: '皇姑区', + 210106: '铁西区', + 210111: '苏家屯区', + 210112: '浑南区', + 210113: '沈北新区', + 210114: '于洪区', + 210115: '辽中区', + 210123: '康平县', + 210124: '法库县', + 210181: '新民市', + 210190: '经济技术开发区', + 210202: '中山区', + 210203: '西岗区', + 210204: '沙河口区', + 210211: '甘井子区', + 210212: '旅顺口区', + 210213: '金州区', + 210214: '普兰店区', + 210224: '长海县', + 210281: '瓦房店市', + 210283: '庄河市', + 210302: '铁东区', + 210303: '铁西区', + 210304: '立山区', + 210311: '千山区', + 210321: '台安县', + 210323: '岫岩满族自治县', + 210381: '海城市', + 210390: '高新区', + 210402: '新抚区', + 210403: '东洲区', + 210404: '望花区', + 210411: '顺城区', + 210421: '抚顺县', + 210422: '新宾满族自治县', + 210423: '清原满族自治县', + 210502: '平山区', + 210503: '溪湖区', + 210504: '明山区', + 210505: '南芬区', + 210521: '本溪满族自治县', + 210522: '桓仁满族自治县', + 210602: '元宝区', + 210603: '振兴区', + 210604: '振安区', + 210624: '宽甸满族自治县', + 210681: '东港市', + 210682: '凤城市', + 210702: '古塔区', + 210703: '凌河区', + 210711: '太和区', + 210726: '黑山县', + 210727: '义县', + 210781: '凌海市', + 210782: '北镇市', + 210793: '经济技术开发区', + 210802: '站前区', + 210803: '西市区', + 210804: '鲅鱼圈区', + 210811: '老边区', + 210881: '盖州市', + 210882: '大石桥市', + 210902: '海州区', + 210903: '新邱区', + 210904: '太平区', + 210905: '清河门区', + 210911: '细河区', + 210921: '阜新蒙古族自治县', + 210922: '彰武县', + 211002: '白塔区', + 211003: '文圣区', + 211004: '宏伟区', + 211005: '弓长岭区', + 211011: '太子河区', + 211021: '辽阳县', + 211081: '灯塔市', + 211102: '双台子区', + 211103: '兴隆台区', + 211104: '大洼区', + 211122: '盘山县', + 211202: '银州区', + 211204: '清河区', + 211221: '铁岭县', + 211223: '西丰县', + 211224: '昌图县', + 211281: '调兵山市', + 211282: '开原市', + 211302: '双塔区', + 211303: '龙城区', + 211321: '朝阳县', + 211322: '建平县', + 211324: '喀喇沁左翼蒙古族自治县', + 211381: '北票市', + 211382: '凌源市', + 211402: '连山区', + 211403: '龙港区', + 211404: '南票区', + 211421: '绥中县', + 211422: '建昌县', + 211481: '兴城市', + 215090: '工业园区', + 220102: '南关区', + 220103: '宽城区', + 220104: '朝阳区', + 220105: '二道区', + 220106: '绿园区', + 220112: '双阳区', + 220113: '九台区', + 220122: '农安县', + 220182: '榆树市', + 220183: '德惠市', + 220192: '经济技术开发区', + 220202: '昌邑区', + 220203: '龙潭区', + 220204: '船营区', + 220211: '丰满区', + 220221: '永吉县', + 220281: '蛟河市', + 220282: '桦甸市', + 220283: '舒兰市', + 220284: '磐石市', + 220302: '铁西区', + 220303: '铁东区', + 220322: '梨树县', + 220323: '伊通满族自治县', + 220381: '公主岭市', + 220382: '双辽市', + 220402: '龙山区', + 220403: '西安区', + 220421: '东丰县', + 220422: '东辽县', + 220502: '东昌区', + 220503: '二道江区', + 220521: '通化县', + 220523: '辉南县', + 220524: '柳河县', + 220581: '梅河口市', + 220582: '集安市', + 220602: '浑江区', + 220605: '江源区', + 220621: '抚松县', + 220622: '靖宇县', + 220623: '长白朝鲜族自治县', + 220681: '临江市', + 220702: '宁江区', + 220721: '前郭尔罗斯蒙古族自治县', + 220722: '长岭县', + 220723: '乾安县', + 220781: '扶余市', + 220802: '洮北区', + 220821: '镇赉县', + 220822: '通榆县', + 220881: '洮南市', + 220882: '大安市', + 221090: '工业园区', + 222401: '延吉市', + 222402: '图们市', + 222403: '敦化市', + 222404: '珲春市', + 222405: '龙井市', + 222406: '和龙市', + 222424: '汪清县', + 222426: '安图县', + 230102: '道里区', + 230103: '南岗区', + 230104: '道外区', + 230108: '平房区', + 230109: '松北区', + 230110: '香坊区', + 230111: '呼兰区', + 230112: '阿城区', + 230113: '双城区', + 230123: '依兰县', + 230124: '方正县', + 230125: '宾县', + 230126: '巴彦县', + 230127: '木兰县', + 230128: '通河县', + 230129: '延寿县', + 230183: '尚志市', + 230184: '五常市', + 230202: '龙沙区', + 230203: '建华区', + 230204: '铁锋区', + 230205: '昂昂溪区', + 230206: '富拉尔基区', + 230207: '碾子山区', + 230208: '梅里斯达斡尔族区', + 230221: '龙江县', + 230223: '依安县', + 230224: '泰来县', + 230225: '甘南县', + 230227: '富裕县', + 230229: '克山县', + 230230: '克东县', + 230231: '拜泉县', + 230281: '讷河市', + 230302: '鸡冠区', + 230303: '恒山区', + 230304: '滴道区', + 230305: '梨树区', + 230306: '城子河区', + 230307: '麻山区', + 230321: '鸡东县', + 230381: '虎林市', + 230382: '密山市', + 230402: '向阳区', + 230403: '工农区', + 230404: '南山区', + 230405: '兴安区', + 230406: '东山区', + 230407: '兴山区', + 230421: '萝北县', + 230422: '绥滨县', + 230502: '尖山区', + 230503: '岭东区', + 230505: '四方台区', + 230506: '宝山区', + 230521: '集贤县', + 230522: '友谊县', + 230523: '宝清县', + 230524: '饶河县', + 230602: '萨尔图区', + 230603: '龙凤区', + 230604: '让胡路区', + 230605: '红岗区', + 230606: '大同区', + 230621: '肇州县', + 230622: '肇源县', + 230623: '林甸县', + 230624: '杜尔伯特蒙古族自治县', + 230702: '伊春区', + 230703: '南岔区', + 230704: '友好区', + 230705: '西林区', + 230706: '翠峦区', + 230707: '新青区', + 230708: '美溪区', + 230709: '金山屯区', + 230710: '五营区', + 230711: '乌马河区', + 230712: '汤旺河区', + 230713: '带岭区', + 230714: '乌伊岭区', + 230715: '红星区', + 230716: '上甘岭区', + 230722: '嘉荫县', + 230781: '铁力市', + 230803: '向阳区', + 230804: '前进区', + 230805: '东风区', + 230811: '郊区', + 230822: '桦南县', + 230826: '桦川县', + 230828: '汤原县', + 230881: '同江市', + 230882: '富锦市', + 230883: '抚远市', + 230902: '新兴区', + 230903: '桃山区', + 230904: '茄子河区', + 230921: '勃利县', + 231002: '东安区', + 231003: '阳明区', + 231004: '爱民区', + 231005: '西安区', + 231025: '林口县', + 231081: '绥芬河市', + 231083: '海林市', + 231084: '宁安市', + 231085: '穆棱市', + 231086: '东宁市', + 231102: '爱辉区', + 231121: '嫩江县', + 231123: '逊克县', + 231124: '孙吴县', + 231181: '北安市', + 231182: '五大连池市', + 231202: '北林区', + 231221: '望奎县', + 231222: '兰西县', + 231223: '青冈县', + 231224: '庆安县', + 231225: '明水县', + 231226: '绥棱县', + 231281: '安达市', + 231282: '肇东市', + 231283: '海伦市', + 232721: '呼玛县', + 232722: '塔河县', + 232723: '漠河县', + 232790: '松岭区', + 232791: '呼中区', + 232792: '加格达奇区', + 232793: '新林区', + 310101: '黄浦区', + 310104: '徐汇区', + 310105: '长宁区', + 310106: '静安区', + 310107: '普陀区', + 310109: '虹口区', + 310110: '杨浦区', + 310112: '闵行区', + 310113: '宝山区', + 310114: '嘉定区', + 310115: '浦东新区', + 310116: '金山区', + 310117: '松江区', + 310118: '青浦区', + 310120: '奉贤区', + 310151: '崇明区', + 320102: '玄武区', + 320104: '秦淮区', + 320105: '建邺区', + 320106: '鼓楼区', + 320111: '浦口区', + 320113: '栖霞区', + 320114: '雨花台区', + 320115: '江宁区', + 320116: '六合区', + 320117: '溧水区', + 320118: '高淳区', + 320205: '锡山区', + 320206: '惠山区', + 320211: '滨湖区', + 320213: '梁溪区', + 320214: '新吴区', + 320281: '江阴市', + 320282: '宜兴市', + 320302: '鼓楼区', + 320303: '云龙区', + 320305: '贾汪区', + 320311: '泉山区', + 320312: '铜山区', + 320321: '丰县', + 320322: '沛县', + 320324: '睢宁县', + 320381: '新沂市', + 320382: '邳州市', + 320391: '工业园区', + 320402: '天宁区', + 320404: '钟楼区', + 320411: '新北区', + 320412: '武进区', + 320413: '金坛区', + 320481: '溧阳市', + 320505: '虎丘区', + 320506: '吴中区', + 320507: '相城区', + 320508: '姑苏区', + 320509: '吴江区', + 320581: '常熟市', + 320582: '张家港市', + 320583: '昆山市', + 320585: '太仓市', + 320590: '工业园区', + 320591: '高新区', + 320602: '崇川区', + 320611: '港闸区', + 320612: '通州区', + 320621: '海安县', + 320623: '如东县', + 320681: '启东市', + 320682: '如皋市', + 320684: '海门市', + 320691: '高新区', + 320703: '连云区', + 320706: '海州区', + 320707: '赣榆区', + 320722: '东海县', + 320723: '灌云县', + 320724: '灌南县', + 320803: '淮安区', + 320804: '淮阴区', + 320812: '清江浦区', + 320813: '洪泽区', + 320826: '涟水县', + 320830: '盱眙县', + 320831: '金湖县', + 320890: '经济开发区', + 320902: '亭湖区', + 320903: '盐都区', + 320904: '大丰区', + 320921: '响水县', + 320922: '滨海县', + 320923: '阜宁县', + 320924: '射阳县', + 320925: '建湖县', + 320981: '东台市', + 321002: '广陵区', + 321003: '邗江区', + 321012: '江都区', + 321023: '宝应县', + 321081: '仪征市', + 321084: '高邮市', + 321090: '经济开发区', + 321102: '京口区', + 321111: '润州区', + 321112: '丹徒区', + 321181: '丹阳市', + 321182: '扬中市', + 321183: '句容市', + 321202: '海陵区', + 321203: '高港区', + 321204: '姜堰区', + 321281: '兴化市', + 321282: '靖江市', + 321283: '泰兴市', + 321302: '宿城区', + 321311: '宿豫区', + 321322: '沭阳县', + 321323: '泗阳县', + 321324: '泗洪县', + 330102: '上城区', + 330103: '下城区', + 330104: '江干区', + 330105: '拱墅区', + 330106: '西湖区', + 330108: '滨江区', + 330109: '萧山区', + 330110: '余杭区', + 330111: '富阳区', + 330112: '临安区', + 330122: '桐庐县', + 330127: '淳安县', + 330182: '建德市', + 330203: '海曙区', + 330205: '江北区', + 330206: '北仑区', + 330211: '镇海区', + 330212: '鄞州区', + 330213: '奉化区', + 330225: '象山县', + 330226: '宁海县', + 330281: '余姚市', + 330282: '慈溪市', + 330302: '鹿城区', + 330303: '龙湾区', + 330304: '瓯海区', + 330305: '洞头区', + 330324: '永嘉县', + 330326: '平阳县', + 330327: '苍南县', + 330328: '文成县', + 330329: '泰顺县', + 330381: '瑞安市', + 330382: '乐清市', + 330402: '南湖区', + 330411: '秀洲区', + 330421: '嘉善县', + 330424: '海盐县', + 330481: '海宁市', + 330482: '平湖市', + 330483: '桐乡市', + 330502: '吴兴区', + 330503: '南浔区', + 330521: '德清县', + 330522: '长兴县', + 330523: '安吉县', + 330602: '越城区', + 330603: '柯桥区', + 330604: '上虞区', + 330624: '新昌县', + 330681: '诸暨市', + 330683: '嵊州市', + 330702: '婺城区', + 330703: '金东区', + 330723: '武义县', + 330726: '浦江县', + 330727: '磐安县', + 330781: '兰溪市', + 330782: '义乌市', + 330783: '东阳市', + 330784: '永康市', + 330802: '柯城区', + 330803: '衢江区', + 330822: '常山县', + 330824: '开化县', + 330825: '龙游县', + 330881: '江山市', + 330902: '定海区', + 330903: '普陀区', + 330921: '岱山县', + 330922: '嵊泗县', + 331002: '椒江区', + 331003: '黄岩区', + 331004: '路桥区', + 331022: '三门县', + 331023: '天台县', + 331024: '仙居县', + 331081: '温岭市', + 331082: '临海市', + 331083: '玉环市', + 331102: '莲都区', + 331121: '青田县', + 331122: '缙云县', + 331123: '遂昌县', + 331124: '松阳县', + 331125: '云和县', + 331126: '庆元县', + 331127: '景宁畲族自治县', + 331181: '龙泉市', + 340102: '瑶海区', + 340103: '庐阳区', + 340104: '蜀山区', + 340111: '包河区', + 340121: '长丰县', + 340122: '肥东县', + 340123: '肥西县', + 340124: '庐江县', + 340181: '巢湖市', + 340190: '高新技术开发区', + 340191: '经济技术开发区', + 340202: '镜湖区', + 340203: '弋江区', + 340207: '鸠江区', + 340208: '三山区', + 340221: '芜湖县', + 340222: '繁昌县', + 340223: '南陵县', + 340225: '无为县', + 340302: '龙子湖区', + 340303: '蚌山区', + 340304: '禹会区', + 340311: '淮上区', + 340321: '怀远县', + 340322: '五河县', + 340323: '固镇县', + 340402: '大通区', + 340403: '田家庵区', + 340404: '谢家集区', + 340405: '八公山区', + 340406: '潘集区', + 340421: '凤台县', + 340422: '寿县', + 340503: '花山区', + 340504: '雨山区', + 340506: '博望区', + 340521: '当涂县', + 340522: '含山县', + 340523: '和县', + 340602: '杜集区', + 340603: '相山区', + 340604: '烈山区', + 340621: '濉溪县', + 340705: '铜官区', + 340706: '义安区', + 340711: '郊区', + 340722: '枞阳县', + 340802: '迎江区', + 340803: '大观区', + 340811: '宜秀区', + 340822: '怀宁县', + 340824: '潜山县', + 340825: '太湖县', + 340826: '宿松县', + 340827: '望江县', + 340828: '岳西县', + 340881: '桐城市', + 341002: '屯溪区', + 341003: '黄山区', + 341004: '徽州区', + 341021: '歙县', + 341022: '休宁县', + 341023: '黟县', + 341024: '祁门县', + 341102: '琅琊区', + 341103: '南谯区', + 341122: '来安县', + 341124: '全椒县', + 341125: '定远县', + 341126: '凤阳县', + 341181: '天长市', + 341182: '明光市', + 341202: '颍州区', + 341203: '颍东区', + 341204: '颍泉区', + 341221: '临泉县', + 341222: '太和县', + 341225: '阜南县', + 341226: '颍上县', + 341282: '界首市', + 341302: '埇桥区', + 341321: '砀山县', + 341322: '萧县', + 341323: '灵璧县', + 341324: '泗县', + 341390: '经济开发区', + 341502: '金安区', + 341503: '裕安区', + 341504: '叶集区', + 341522: '霍邱县', + 341523: '舒城县', + 341524: '金寨县', + 341525: '霍山县', + 341602: '谯城区', + 341621: '涡阳县', + 341622: '蒙城县', + 341623: '利辛县', + 341702: '贵池区', + 341721: '东至县', + 341722: '石台县', + 341723: '青阳县', + 341802: '宣州区', + 341821: '郎溪县', + 341822: '广德县', + 341823: '泾县', + 341824: '绩溪县', + 341825: '旌德县', + 341881: '宁国市', + 350102: '鼓楼区', + 350103: '台江区', + 350104: '仓山区', + 350105: '马尾区', + 350111: '晋安区', + 350112: '长乐区', + 350121: '闽侯县', + 350122: '连江县', + 350123: '罗源县', + 350124: '闽清县', + 350125: '永泰县', + 350128: '平潭县', + 350181: '福清市', + 350203: '思明区', + 350205: '海沧区', + 350206: '湖里区', + 350211: '集美区', + 350212: '同安区', + 350213: '翔安区', + 350302: '城厢区', + 350303: '涵江区', + 350304: '荔城区', + 350305: '秀屿区', + 350322: '仙游县', + 350402: '梅列区', + 350403: '三元区', + 350421: '明溪县', + 350423: '清流县', + 350424: '宁化县', + 350425: '大田县', + 350426: '尤溪县', + 350427: '沙县', + 350428: '将乐县', + 350429: '泰宁县', + 350430: '建宁县', + 350481: '永安市', + 350502: '鲤城区', + 350503: '丰泽区', + 350504: '洛江区', + 350505: '泉港区', + 350521: '惠安县', + 350524: '安溪县', + 350525: '永春县', + 350526: '德化县', + 350527: '金门县', + 350581: '石狮市', + 350582: '晋江市', + 350583: '南安市', + 350602: '芗城区', + 350603: '龙文区', + 350622: '云霄县', + 350623: '漳浦县', + 350624: '诏安县', + 350625: '长泰县', + 350626: '东山县', + 350627: '南靖县', + 350628: '平和县', + 350629: '华安县', + 350681: '龙海市', + 350702: '延平区', + 350703: '建阳区', + 350721: '顺昌县', + 350722: '浦城县', + 350723: '光泽县', + 350724: '松溪县', + 350725: '政和县', + 350781: '邵武市', + 350782: '武夷山市', + 350783: '建瓯市', + 350802: '新罗区', + 350803: '永定区', + 350821: '长汀县', + 350823: '上杭县', + 350824: '武平县', + 350825: '连城县', + 350881: '漳平市', + 350902: '蕉城区', + 350921: '霞浦县', + 350922: '古田县', + 350923: '屏南县', + 350924: '寿宁县', + 350925: '周宁县', + 350926: '柘荣县', + 350981: '福安市', + 350982: '福鼎市', + 360102: '东湖区', + 360103: '西湖区', + 360104: '青云谱区', + 360105: '湾里区', + 360111: '青山湖区', + 360112: '新建区', + 360121: '南昌县', + 360123: '安义县', + 360124: '进贤县', + 360190: '经济技术开发区', + 360192: '高新区', + 360202: '昌江区', + 360203: '珠山区', + 360222: '浮梁县', + 360281: '乐平市', + 360302: '安源区', + 360313: '湘东区', + 360321: '莲花县', + 360322: '上栗县', + 360323: '芦溪县', + 360402: '濂溪区', + 360403: '浔阳区', + 360404: '柴桑区', + 360423: '武宁县', + 360424: '修水县', + 360425: '永修县', + 360426: '德安县', + 360428: '都昌县', + 360429: '湖口县', + 360430: '彭泽县', + 360481: '瑞昌市', + 360482: '共青城市', + 360483: '庐山市', + 360490: '经济技术开发区', + 360502: '渝水区', + 360521: '分宜县', + 360602: '月湖区', + 360622: '余江县', + 360681: '贵溪市', + 360702: '章贡区', + 360703: '南康区', + 360704: '赣县区', + 360722: '信丰县', + 360723: '大余县', + 360724: '上犹县', + 360725: '崇义县', + 360726: '安远县', + 360727: '龙南县', + 360728: '定南县', + 360729: '全南县', + 360730: '宁都县', + 360731: '于都县', + 360732: '兴国县', + 360733: '会昌县', + 360734: '寻乌县', + 360735: '石城县', + 360781: '瑞金市', + 360802: '吉州区', + 360803: '青原区', + 360821: '吉安县', + 360822: '吉水县', + 360823: '峡江县', + 360824: '新干县', + 360825: '永丰县', + 360826: '泰和县', + 360827: '遂川县', + 360828: '万安县', + 360829: '安福县', + 360830: '永新县', + 360881: '井冈山市', + 360902: '袁州区', + 360921: '奉新县', + 360922: '万载县', + 360923: '上高县', + 360924: '宜丰县', + 360925: '靖安县', + 360926: '铜鼓县', + 360981: '丰城市', + 360982: '樟树市', + 360983: '高安市', + 361002: '临川区', + 361003: '东乡区', + 361021: '南城县', + 361022: '黎川县', + 361023: '南丰县', + 361024: '崇仁县', + 361025: '乐安县', + 361026: '宜黄县', + 361027: '金溪县', + 361028: '资溪县', + 361030: '广昌县', + 361102: '信州区', + 361103: '广丰区', + 361121: '上饶县', + 361123: '玉山县', + 361124: '铅山县', + 361125: '横峰县', + 361126: '弋阳县', + 361127: '余干县', + 361128: '鄱阳县', + 361129: '万年县', + 361130: '婺源县', + 361181: '德兴市', + 370102: '历下区', + 370103: '市中区', + 370104: '槐荫区', + 370105: '天桥区', + 370112: '历城区', + 370113: '长清区', + 370114: '章丘区', + 370124: '平阴县', + 370125: '济阳县', + 370126: '商河县', + 370190: '高新区', + 370202: '市南区', + 370203: '市北区', + 370211: '黄岛区', + 370212: '崂山区', + 370213: '李沧区', + 370214: '城阳区', + 370215: '即墨区', + 370281: '胶州市', + 370283: '平度市', + 370285: '莱西市', + 370290: '开发区', + 370302: '淄川区', + 370303: '张店区', + 370304: '博山区', + 370305: '临淄区', + 370306: '周村区', + 370321: '桓台县', + 370322: '高青县', + 370323: '沂源县', + 370402: '市中区', + 370403: '薛城区', + 370404: '峄城区', + 370405: '台儿庄区', + 370406: '山亭区', + 370481: '滕州市', + 370502: '东营区', + 370503: '河口区', + 370505: '垦利区', + 370522: '利津县', + 370523: '广饶县', + 370602: '芝罘区', + 370611: '福山区', + 370612: '牟平区', + 370613: '莱山区', + 370634: '长岛县', + 370681: '龙口市', + 370682: '莱阳市', + 370683: '莱州市', + 370684: '蓬莱市', + 370685: '招远市', + 370686: '栖霞市', + 370687: '海阳市', + 370690: '开发区', + 370702: '潍城区', + 370703: '寒亭区', + 370704: '坊子区', + 370705: '奎文区', + 370724: '临朐县', + 370725: '昌乐县', + 370781: '青州市', + 370782: '诸城市', + 370783: '寿光市', + 370784: '安丘市', + 370785: '高密市', + 370786: '昌邑市', + 370790: '开发区', + 370791: '高新区', + 370811: '任城区', + 370812: '兖州区', + 370826: '微山县', + 370827: '鱼台县', + 370828: '金乡县', + 370829: '嘉祥县', + 370830: '汶上县', + 370831: '泗水县', + 370832: '梁山县', + 370881: '曲阜市', + 370883: '邹城市', + 370890: '高新区', + 370902: '泰山区', + 370911: '岱岳区', + 370921: '宁阳县', + 370923: '东平县', + 370982: '新泰市', + 370983: '肥城市', + 371002: '环翠区', + 371003: '文登区', + 371082: '荣成市', + 371083: '乳山市', + 371091: '经济技术开发区', + 371102: '东港区', + 371103: '岚山区', + 371121: '五莲县', + 371122: '莒县', + 371202: '莱城区', + 371203: '钢城区', + 371302: '兰山区', + 371311: '罗庄区', + 371312: '河东区', + 371321: '沂南县', + 371322: '郯城县', + 371323: '沂水县', + 371324: '兰陵县', + 371325: '费县', + 371326: '平邑县', + 371327: '莒南县', + 371328: '蒙阴县', + 371329: '临沭县', + 371402: '德城区', + 371403: '陵城区', + 371422: '宁津县', + 371423: '庆云县', + 371424: '临邑县', + 371425: '齐河县', + 371426: '平原县', + 371427: '夏津县', + 371428: '武城县', + 371481: '乐陵市', + 371482: '禹城市', + 371502: '东昌府区', + 371521: '阳谷县', + 371522: '莘县', + 371523: '茌平县', + 371524: '东阿县', + 371525: '冠县', + 371526: '高唐县', + 371581: '临清市', + 371602: '滨城区', + 371603: '沾化区', + 371621: '惠民县', + 371622: '阳信县', + 371623: '无棣县', + 371625: '博兴县', + 371626: '邹平县', + 371702: '牡丹区', + 371703: '定陶区', + 371721: '曹县', + 371722: '单县', + 371723: '成武县', + 371724: '巨野县', + 371725: '郓城县', + 371726: '鄄城县', + 371728: '东明县', + 410102: '中原区', + 410103: '二七区', + 410104: '管城回族区', + 410105: '金水区', + 410106: '上街区', + 410108: '惠济区', + 410122: '中牟县', + 410181: '巩义市', + 410182: '荥阳市', + 410183: '新密市', + 410184: '新郑市', + 410185: '登封市', + 410190: '高新技术开发区', + 410191: '经济技术开发区', + 410202: '龙亭区', + 410203: '顺河回族区', + 410204: '鼓楼区', + 410205: '禹王台区', + 410212: '祥符区', + 410221: '杞县', + 410222: '通许县', + 410223: '尉氏县', + 410225: '兰考县', + 410302: '老城区', + 410303: '西工区', + 410304: '瀍河回族区', + 410305: '涧西区', + 410306: '吉利区', + 410311: '洛龙区', + 410322: '孟津县', + 410323: '新安县', + 410324: '栾川县', + 410325: '嵩县', + 410326: '汝阳县', + 410327: '宜阳县', + 410328: '洛宁县', + 410329: '伊川县', + 410381: '偃师市', + 410402: '新华区', + 410403: '卫东区', + 410404: '石龙区', + 410411: '湛河区', + 410421: '宝丰县', + 410422: '叶县', + 410423: '鲁山县', + 410425: '郏县', + 410481: '舞钢市', + 410482: '汝州市', + 410502: '文峰区', + 410503: '北关区', + 410505: '殷都区', + 410506: '龙安区', + 410522: '安阳县', + 410523: '汤阴县', + 410526: '滑县', + 410527: '内黄县', + 410581: '林州市', + 410590: '开发区', + 410602: '鹤山区', + 410603: '山城区', + 410611: '淇滨区', + 410621: '浚县', + 410622: '淇县', + 410702: '红旗区', + 410703: '卫滨区', + 410704: '凤泉区', + 410711: '牧野区', + 410721: '新乡县', + 410724: '获嘉县', + 410725: '原阳县', + 410726: '延津县', + 410727: '封丘县', + 410728: '长垣县', + 410781: '卫辉市', + 410782: '辉县市', + 410802: '解放区', + 410803: '中站区', + 410804: '马村区', + 410811: '山阳区', + 410821: '修武县', + 410822: '博爱县', + 410823: '武陟县', + 410825: '温县', + 410882: '沁阳市', + 410883: '孟州市', + 410902: '华龙区', + 410922: '清丰县', + 410923: '南乐县', + 410926: '范县', + 410927: '台前县', + 410928: '濮阳县', + 411002: '魏都区', + 411003: '建安区', + 411024: '鄢陵县', + 411025: '襄城县', + 411081: '禹州市', + 411082: '长葛市', + 411102: '源汇区', + 411103: '郾城区', + 411104: '召陵区', + 411121: '舞阳县', + 411122: '临颍县', + 411202: '湖滨区', + 411203: '陕州区', + 411221: '渑池县', + 411224: '卢氏县', + 411281: '义马市', + 411282: '灵宝市', + 411302: '宛城区', + 411303: '卧龙区', + 411321: '南召县', + 411322: '方城县', + 411323: '西峡县', + 411324: '镇平县', + 411325: '内乡县', + 411326: '淅川县', + 411327: '社旗县', + 411328: '唐河县', + 411329: '新野县', + 411330: '桐柏县', + 411381: '邓州市', + 411402: '梁园区', + 411403: '睢阳区', + 411421: '民权县', + 411422: '睢县', + 411423: '宁陵县', + 411424: '柘城县', + 411425: '虞城县', + 411426: '夏邑县', + 411481: '永城市', + 411502: '浉河区', + 411503: '平桥区', + 411521: '罗山县', + 411522: '光山县', + 411523: '新县', + 411524: '商城县', + 411525: '固始县', + 411526: '潢川县', + 411527: '淮滨县', + 411528: '息县', + 411602: '川汇区', + 411621: '扶沟县', + 411622: '西华县', + 411623: '商水县', + 411624: '沈丘县', + 411625: '郸城县', + 411626: '淮阳县', + 411627: '太康县', + 411628: '鹿邑县', + 411681: '项城市', + 411690: '经济开发区', + 411702: '驿城区', + 411721: '西平县', + 411722: '上蔡县', + 411723: '平舆县', + 411724: '正阳县', + 411725: '确山县', + 411726: '泌阳县', + 411727: '汝南县', + 411728: '遂平县', + 411729: '新蔡县', + 419001: '济源市', + 420102: '江岸区', + 420103: '江汉区', + 420104: '硚口区', + 420105: '汉阳区', + 420106: '武昌区', + 420107: '青山区', + 420111: '洪山区', + 420112: '东西湖区', + 420113: '汉南区', + 420114: '蔡甸区', + 420115: '江夏区', + 420116: '黄陂区', + 420117: '新洲区', + 420202: '黄石港区', + 420203: '西塞山区', + 420204: '下陆区', + 420205: '铁山区', + 420222: '阳新县', + 420281: '大冶市', + 420302: '茅箭区', + 420303: '张湾区', + 420304: '郧阳区', + 420322: '郧西县', + 420323: '竹山县', + 420324: '竹溪县', + 420325: '房县', + 420381: '丹江口市', + 420502: '西陵区', + 420503: '伍家岗区', + 420504: '点军区', + 420505: '猇亭区', + 420506: '夷陵区', + 420525: '远安县', + 420526: '兴山县', + 420527: '秭归县', + 420528: '长阳土家族自治县', + 420529: '五峰土家族自治县', + 420581: '宜都市', + 420582: '当阳市', + 420583: '枝江市', + 420590: '经济开发区', + 420602: '襄城区', + 420606: '樊城区', + 420607: '襄州区', + 420624: '南漳县', + 420625: '谷城县', + 420626: '保康县', + 420682: '老河口市', + 420683: '枣阳市', + 420684: '宜城市', + 420702: '梁子湖区', + 420703: '华容区', + 420704: '鄂城区', + 420802: '东宝区', + 420804: '掇刀区', + 420821: '京山县', + 420822: '沙洋县', + 420881: '钟祥市', + 420902: '孝南区', + 420921: '孝昌县', + 420922: '大悟县', + 420923: '云梦县', + 420981: '应城市', + 420982: '安陆市', + 420984: '汉川市', + 421002: '沙市区', + 421003: '荆州区', + 421022: '公安县', + 421023: '监利县', + 421024: '江陵县', + 421081: '石首市', + 421083: '洪湖市', + 421087: '松滋市', + 421102: '黄州区', + 421121: '团风县', + 421122: '红安县', + 421123: '罗田县', + 421124: '英山县', + 421125: '浠水县', + 421126: '蕲春县', + 421127: '黄梅县', + 421181: '麻城市', + 421182: '武穴市', + 421202: '咸安区', + 421221: '嘉鱼县', + 421222: '通城县', + 421223: '崇阳县', + 421224: '通山县', + 421281: '赤壁市', + 421303: '曾都区', + 421321: '随县', + 421381: '广水市', + 422801: '恩施市', + 422802: '利川市', + 422822: '建始县', + 422823: '巴东县', + 422825: '宣恩县', + 422826: '咸丰县', + 422827: '来凤县', + 422828: '鹤峰县', + 429004: '仙桃市', + 429005: '潜江市', + 429006: '天门市', + 429021: '神农架林区', + 430102: '芙蓉区', + 430103: '天心区', + 430104: '岳麓区', + 430105: '开福区', + 430111: '雨花区', + 430112: '望城区', + 430121: '长沙县', + 430181: '浏阳市', + 430182: '宁乡市', + 430202: '荷塘区', + 430203: '芦淞区', + 430204: '石峰区', + 430211: '天元区', + 430221: '株洲县', + 430223: '攸县', + 430224: '茶陵县', + 430225: '炎陵县', + 430281: '醴陵市', + 430302: '雨湖区', + 430304: '岳塘区', + 430321: '湘潭县', + 430381: '湘乡市', + 430382: '韶山市', + 430405: '珠晖区', + 430406: '雁峰区', + 430407: '石鼓区', + 430408: '蒸湘区', + 430412: '南岳区', + 430421: '衡阳县', + 430422: '衡南县', + 430423: '衡山县', + 430424: '衡东县', + 430426: '祁东县', + 430481: '耒阳市', + 430482: '常宁市', + 430502: '双清区', + 430503: '大祥区', + 430511: '北塔区', + 430521: '邵东县', + 430522: '新邵县', + 430523: '邵阳县', + 430524: '隆回县', + 430525: '洞口县', + 430527: '绥宁县', + 430528: '新宁县', + 430529: '城步苗族自治县', + 430581: '武冈市', + 430602: '岳阳楼区', + 430603: '云溪区', + 430611: '君山区', + 430621: '岳阳县', + 430623: '华容县', + 430624: '湘阴县', + 430626: '平江县', + 430681: '汨罗市', + 430682: '临湘市', + 430702: '武陵区', + 430703: '鼎城区', + 430721: '安乡县', + 430722: '汉寿县', + 430723: '澧县', + 430724: '临澧县', + 430725: '桃源县', + 430726: '石门县', + 430781: '津市市', + 430802: '永定区', + 430811: '武陵源区', + 430821: '慈利县', + 430822: '桑植县', + 430902: '资阳区', + 430903: '赫山区', + 430921: '南县', + 430922: '桃江县', + 430923: '安化县', + 430981: '沅江市', + 431002: '北湖区', + 431003: '苏仙区', + 431021: '桂阳县', + 431022: '宜章县', + 431023: '永兴县', + 431024: '嘉禾县', + 431025: '临武县', + 431026: '汝城县', + 431027: '桂东县', + 431028: '安仁县', + 431081: '资兴市', + 431102: '零陵区', + 431103: '冷水滩区', + 431121: '祁阳县', + 431122: '东安县', + 431123: '双牌县', + 431124: '道县', + 431125: '江永县', + 431126: '宁远县', + 431127: '蓝山县', + 431128: '新田县', + 431129: '江华瑶族自治县', + 431202: '鹤城区', + 431221: '中方县', + 431222: '沅陵县', + 431223: '辰溪县', + 431224: '溆浦县', + 431225: '会同县', + 431226: '麻阳苗族自治县', + 431227: '新晃侗族自治县', + 431228: '芷江侗族自治县', + 431229: '靖州苗族侗族自治县', + 431230: '通道侗族自治县', + 431281: '洪江市', + 431302: '娄星区', + 431321: '双峰县', + 431322: '新化县', + 431381: '冷水江市', + 431382: '涟源市', + 433101: '吉首市', + 433122: '泸溪县', + 433123: '凤凰县', + 433124: '花垣县', + 433125: '保靖县', + 433126: '古丈县', + 433127: '永顺县', + 433130: '龙山县', + 440103: '荔湾区', + 440104: '越秀区', + 440105: '海珠区', + 440106: '天河区', + 440111: '白云区', + 440112: '黄埔区', + 440113: '番禺区', + 440114: '花都区', + 440115: '南沙区', + 440117: '从化区', + 440118: '增城区', + 440203: '武江区', + 440204: '浈江区', + 440205: '曲江区', + 440222: '始兴县', + 440224: '仁化县', + 440229: '翁源县', + 440232: '乳源瑶族自治县', + 440233: '新丰县', + 440281: '乐昌市', + 440282: '南雄市', + 440303: '罗湖区', + 440304: '福田区', + 440305: '南山区', + 440306: '宝安区', + 440307: '龙岗区', + 440308: '盐田区', + 440309: '龙华区', + 440310: '坪山区', + 440402: '香洲区', + 440403: '斗门区', + 440404: '金湾区', + 440507: '龙湖区', + 440511: '金平区', + 440512: '濠江区', + 440513: '潮阳区', + 440514: '潮南区', + 440515: '澄海区', + 440523: '南澳县', + 440604: '禅城区', + 440605: '南海区', + 440606: '顺德区', + 440607: '三水区', + 440608: '高明区', + 440703: '蓬江区', + 440704: '江海区', + 440705: '新会区', + 440781: '台山市', + 440783: '开平市', + 440784: '鹤山市', + 440785: '恩平市', + 440802: '赤坎区', + 440803: '霞山区', + 440804: '坡头区', + 440811: '麻章区', + 440823: '遂溪县', + 440825: '徐闻县', + 440881: '廉江市', + 440882: '雷州市', + 440883: '吴川市', + 440890: '经济技术开发区', + 440902: '茂南区', + 440904: '电白区', + 440981: '高州市', + 440982: '化州市', + 440983: '信宜市', + 441202: '端州区', + 441203: '鼎湖区', + 441204: '高要区', + 441223: '广宁县', + 441224: '怀集县', + 441225: '封开县', + 441226: '德庆县', + 441284: '四会市', + 441302: '惠城区', + 441303: '惠阳区', + 441322: '博罗县', + 441323: '惠东县', + 441324: '龙门县', + 441402: '梅江区', + 441403: '梅县区', + 441422: '大埔县', + 441423: '丰顺县', + 441424: '五华县', + 441426: '平远县', + 441427: '蕉岭县', + 441481: '兴宁市', + 441502: '城区', + 441521: '海丰县', + 441523: '陆河县', + 441581: '陆丰市', + 441602: '源城区', + 441621: '紫金县', + 441622: '龙川县', + 441623: '连平县', + 441624: '和平县', + 441625: '东源县', + 441702: '江城区', + 441704: '阳东区', + 441721: '阳西县', + 441781: '阳春市', + 441802: '清城区', + 441803: '清新区', + 441821: '佛冈县', + 441823: '阳山县', + 441825: '连山壮族瑶族自治县', + 441826: '连南瑶族自治县', + 441881: '英德市', + 441882: '连州市', + 441901: '中堂镇', + 441903: '南城区', + 441904: '长安镇', + 441905: '东坑镇', + 441906: '樟木头镇', + 441907: '莞城区', + 441908: '石龙镇', + 441909: '桥头镇', + 441910: '万江区', + 441911: '麻涌镇', + 441912: '虎门镇', + 441913: '谢岗镇', + 441914: '石碣镇', + 441915: '茶山镇', + 441916: '东城区', + 441917: '洪梅镇', + 441918: '道滘镇', + 441919: '高埗镇', + 441920: '企石镇', + 441921: '凤岗镇', + 441922: '大岭山镇', + 441923: '松山湖', + 441924: '清溪镇', + 441925: '望牛墩镇', + 441926: '厚街镇', + 441927: '常平镇', + 441928: '寮步镇', + 441929: '石排镇', + 441930: '横沥镇', + 441931: '塘厦镇', + 441932: '黄江镇', + 441933: '大朗镇', + 441990: '沙田镇', + 442001: '南头镇', + 442002: '神湾镇', + 442003: '东凤镇', + 442004: '五桂山镇', + 442005: '黄圃镇', + 442006: '小榄镇', + 442007: '石岐区街道', + 442008: '横栏镇', + 442009: '三角镇', + 442010: '三乡镇', + 442011: '港口镇', + 442012: '沙溪镇', + 442013: '板芙镇', + 442014: '沙朗镇', + 442015: '东升镇', + 442016: '阜沙镇', + 442017: '民众镇', + 442018: '东区街道', + 442019: '火炬开发区', + 442020: '西区街道', + 442021: '南区街道', + 442022: '古镇', + 442023: '坦洲镇', + 442024: '大涌镇', + 442025: '南朗镇', + 445102: '湘桥区', + 445103: '潮安区', + 445122: '饶平县', + 445202: '榕城区', + 445203: '揭东区', + 445222: '揭西县', + 445224: '惠来县', + 445281: '普宁市', + 445302: '云城区', + 445303: '云安区', + 445321: '新兴县', + 445322: '郁南县', + 445381: '罗定市', + 450102: '兴宁区', + 450103: '青秀区', + 450105: '江南区', + 450107: '西乡塘区', + 450108: '良庆区', + 450109: '邕宁区', + 450110: '武鸣区', + 450123: '隆安县', + 450124: '马山县', + 450125: '上林县', + 450126: '宾阳县', + 450127: '横县', + 450202: '城中区', + 450203: '鱼峰区', + 450204: '柳南区', + 450205: '柳北区', + 450206: '柳江区', + 450222: '柳城县', + 450223: '鹿寨县', + 450224: '融安县', + 450225: '融水苗族自治县', + 450226: '三江侗族自治县', + 450302: '秀峰区', + 450303: '叠彩区', + 450304: '象山区', + 450305: '七星区', + 450311: '雁山区', + 450312: '临桂区', + 450321: '阳朔县', + 450323: '灵川县', + 450324: '全州县', + 450325: '兴安县', + 450326: '永福县', + 450327: '灌阳县', + 450328: '龙胜各族自治县', + 450329: '资源县', + 450330: '平乐县', + 450331: '荔浦县', + 450332: '恭城瑶族自治县', + 450403: '万秀区', + 450405: '长洲区', + 450406: '龙圩区', + 450421: '苍梧县', + 450422: '藤县', + 450423: '蒙山县', + 450481: '岑溪市', + 450502: '海城区', + 450503: '银海区', + 450512: '铁山港区', + 450521: '合浦县', + 450602: '港口区', + 450603: '防城区', + 450621: '上思县', + 450681: '东兴市', + 450702: '钦南区', + 450703: '钦北区', + 450721: '灵山县', + 450722: '浦北县', + 450802: '港北区', + 450803: '港南区', + 450804: '覃塘区', + 450821: '平南县', + 450881: '桂平市', + 450902: '玉州区', + 450903: '福绵区', + 450921: '容县', + 450922: '陆川县', + 450923: '博白县', + 450924: '兴业县', + 450981: '北流市', + 451002: '右江区', + 451021: '田阳县', + 451022: '田东县', + 451023: '平果县', + 451024: '德保县', + 451026: '那坡县', + 451027: '凌云县', + 451028: '乐业县', + 451029: '田林县', + 451030: '西林县', + 451031: '隆林各族自治县', + 451081: '靖西市', + 451102: '八步区', + 451103: '平桂区', + 451121: '昭平县', + 451122: '钟山县', + 451123: '富川瑶族自治县', + 451202: '金城江区', + 451203: '宜州区', + 451221: '南丹县', + 451222: '天峨县', + 451223: '凤山县', + 451224: '东兰县', + 451225: '罗城仫佬族自治县', + 451226: '环江毛南族自治县', + 451227: '巴马瑶族自治县', + 451228: '都安瑶族自治县', + 451229: '大化瑶族自治县', + 451302: '兴宾区', + 451321: '忻城县', + 451322: '象州县', + 451323: '武宣县', + 451324: '金秀瑶族自治县', + 451381: '合山市', + 451402: '江州区', + 451421: '扶绥县', + 451422: '宁明县', + 451423: '龙州县', + 451424: '大新县', + 451425: '天等县', + 451481: '凭祥市', + 460105: '秀英区', + 460106: '龙华区', + 460107: '琼山区', + 460108: '美兰区', + 460202: '海棠区', + 460203: '吉阳区', + 460204: '天涯区', + 460205: '崖州区', + 460321: '西沙群岛', + 460322: '南沙群岛', + 460323: '中沙群岛的岛礁及其海域', + 460401: '那大镇', + 460402: '和庆镇', + 460403: '南丰镇', + 460404: '大成镇', + 460405: '雅星镇', + 460406: '兰洋镇', + 460407: '光村镇', + 460408: '木棠镇', + 460409: '海头镇', + 460410: '峨蔓镇', + 460411: '王五镇', + 460412: '白马井镇', + 460413: '中和镇', + 460414: '排浦镇', + 460415: '东成镇', + 460416: '新州镇', + 469001: '五指山市', + 469002: '琼海市', + 469005: '文昌市', + 469006: '万宁市', + 469007: '东方市', + 469021: '定安县', + 469022: '屯昌县', + 469023: '澄迈县', + 469024: '临高县', + 469025: '白沙黎族自治县', + 469026: '昌江黎族自治县', + 469027: '乐东黎族自治县', + 469028: '陵水黎族自治县', + 469029: '保亭黎族苗族自治县', + 469030: '琼中黎族苗族自治县', + 500101: '万州区', + 500102: '涪陵区', + 500103: '渝中区', + 500104: '大渡口区', + 500105: '江北区', + 500106: '沙坪坝区', + 500107: '九龙坡区', + 500108: '南岸区', + 500109: '北碚区', + 500110: '綦江区', + 500111: '大足区', + 500112: '渝北区', + 500113: '巴南区', + 500114: '黔江区', + 500115: '长寿区', + 500116: '江津区', + 500117: '合川区', + 500118: '永川区', + 500119: '南川区', + 500120: '璧山区', + 500151: '铜梁区', + 500152: '潼南区', + 500153: '荣昌区', + 500154: '开州区', + 500155: '梁平区', + 500156: '武隆区', + 500229: '城口县', + 500230: '丰都县', + 500231: '垫江县', + 500233: '忠县', + 500235: '云阳县', + 500236: '奉节县', + 500237: '巫山县', + 500238: '巫溪县', + 500240: '石柱土家族自治县', + 500241: '秀山土家族苗族自治县', + 500242: '酉阳土家族苗族自治县', + 500243: '彭水苗族土家族自治县', + 510104: '锦江区', + 510105: '青羊区', + 510106: '金牛区', + 510107: '武侯区', + 510108: '成华区', + 510112: '龙泉驿区', + 510113: '青白江区', + 510114: '新都区', + 510115: '温江区', + 510116: '双流区', + 510117: '郫都区', + 510121: '金堂县', + 510129: '大邑县', + 510131: '蒲江县', + 510132: '新津县', + 510181: '都江堰市', + 510182: '彭州市', + 510183: '邛崃市', + 510184: '崇州市', + 510185: '简阳市', + 510191: '高新区', + 510302: '自流井区', + 510303: '贡井区', + 510304: '大安区', + 510311: '沿滩区', + 510321: '荣县', + 510322: '富顺县', + 510402: '东区', + 510403: '西区', + 510411: '仁和区', + 510421: '米易县', + 510422: '盐边县', + 510502: '江阳区', + 510503: '纳溪区', + 510504: '龙马潭区', + 510521: '泸县', + 510522: '合江县', + 510524: '叙永县', + 510525: '古蔺县', + 510603: '旌阳区', + 510604: '罗江区', + 510623: '中江县', + 510681: '广汉市', + 510682: '什邡市', + 510683: '绵竹市', + 510703: '涪城区', + 510704: '游仙区', + 510705: '安州区', + 510722: '三台县', + 510723: '盐亭县', + 510725: '梓潼县', + 510726: '北川羌族自治县', + 510727: '平武县', + 510781: '江油市', + 510791: '高新区', + 510802: '利州区', + 510811: '昭化区', + 510812: '朝天区', + 510821: '旺苍县', + 510822: '青川县', + 510823: '剑阁县', + 510824: '苍溪县', + 510903: '船山区', + 510904: '安居区', + 510921: '蓬溪县', + 510922: '射洪县', + 510923: '大英县', + 511002: '市中区', + 511011: '东兴区', + 511024: '威远县', + 511025: '资中县', + 511083: '隆昌市', + 511102: '市中区', + 511111: '沙湾区', + 511112: '五通桥区', + 511113: '金口河区', + 511123: '犍为县', + 511124: '井研县', + 511126: '夹江县', + 511129: '沐川县', + 511132: '峨边彝族自治县', + 511133: '马边彝族自治县', + 511181: '峨眉山市', + 511302: '顺庆区', + 511303: '高坪区', + 511304: '嘉陵区', + 511321: '南部县', + 511322: '营山县', + 511323: '蓬安县', + 511324: '仪陇县', + 511325: '西充县', + 511381: '阆中市', + 511402: '东坡区', + 511403: '彭山区', + 511421: '仁寿县', + 511423: '洪雅县', + 511424: '丹棱县', + 511425: '青神县', + 511502: '翠屏区', + 511503: '南溪区', + 511521: '宜宾县', + 511523: '江安县', + 511524: '长宁县', + 511525: '高县', + 511526: '珙县', + 511527: '筠连县', + 511528: '兴文县', + 511529: '屏山县', + 511602: '广安区', + 511603: '前锋区', + 511621: '岳池县', + 511622: '武胜县', + 511623: '邻水县', + 511681: '华蓥市', + 511702: '通川区', + 511703: '达川区', + 511722: '宣汉县', + 511723: '开江县', + 511724: '大竹县', + 511725: '渠县', + 511781: '万源市', + 511802: '雨城区', + 511803: '名山区', + 511822: '荥经县', + 511823: '汉源县', + 511824: '石棉县', + 511825: '天全县', + 511826: '芦山县', + 511827: '宝兴县', + 511902: '巴州区', + 511903: '恩阳区', + 511921: '通江县', + 511922: '南江县', + 511923: '平昌县', + 512002: '雁江区', + 512021: '安岳县', + 512022: '乐至县', + 513201: '马尔康市', + 513221: '汶川县', + 513222: '理县', + 513223: '茂县', + 513224: '松潘县', + 513225: '九寨沟县', + 513226: '金川县', + 513227: '小金县', + 513228: '黑水县', + 513230: '壤塘县', + 513231: '阿坝县', + 513232: '若尔盖县', + 513233: '红原县', + 513301: '康定市', + 513322: '泸定县', + 513323: '丹巴县', + 513324: '九龙县', + 513325: '雅江县', + 513326: '道孚县', + 513327: '炉霍县', + 513328: '甘孜县', + 513329: '新龙县', + 513330: '德格县', + 513331: '白玉县', + 513332: '石渠县', + 513333: '色达县', + 513334: '理塘县', + 513335: '巴塘县', + 513336: '乡城县', + 513337: '稻城县', + 513338: '得荣县', + 513401: '西昌市', + 513422: '木里藏族自治县', + 513423: '盐源县', + 513424: '德昌县', + 513425: '会理县', + 513426: '会东县', + 513427: '宁南县', + 513428: '普格县', + 513429: '布拖县', + 513430: '金阳县', + 513431: '昭觉县', + 513432: '喜德县', + 513433: '冕宁县', + 513434: '越西县', + 513435: '甘洛县', + 513436: '美姑县', + 513437: '雷波县', + 520102: '南明区', + 520103: '云岩区', + 520111: '花溪区', + 520112: '乌当区', + 520113: '白云区', + 520115: '观山湖区', + 520121: '开阳县', + 520122: '息烽县', + 520123: '修文县', + 520181: '清镇市', + 520201: '钟山区', + 520203: '六枝特区', + 520221: '水城县', + 520281: '盘州市', + 520302: '红花岗区', + 520303: '汇川区', + 520304: '播州区', + 520322: '桐梓县', + 520323: '绥阳县', + 520324: '正安县', + 520325: '道真仡佬族苗族自治县', + 520326: '务川仡佬族苗族自治县', + 520327: '凤冈县', + 520328: '湄潭县', + 520329: '余庆县', + 520330: '习水县', + 520381: '赤水市', + 520382: '仁怀市', + 520402: '西秀区', + 520403: '平坝区', + 520422: '普定县', + 520423: '镇宁布依族苗族自治县', + 520424: '关岭布依族苗族自治县', + 520425: '紫云苗族布依族自治县', + 520502: '七星关区', + 520521: '大方县', + 520522: '黔西县', + 520523: '金沙县', + 520524: '织金县', + 520525: '纳雍县', + 520526: '威宁彝族回族苗族自治县', + 520527: '赫章县', + 520602: '碧江区', + 520603: '万山区', + 520621: '江口县', + 520622: '玉屏侗族自治县', + 520623: '石阡县', + 520624: '思南县', + 520625: '印江土家族苗族自治县', + 520626: '德江县', + 520627: '沿河土家族自治县', + 520628: '松桃苗族自治县', + 522301: '兴义市', + 522322: '兴仁县', + 522323: '普安县', + 522324: '晴隆县', + 522325: '贞丰县', + 522326: '望谟县', + 522327: '册亨县', + 522328: '安龙县', + 522601: '凯里市', + 522622: '黄平县', + 522623: '施秉县', + 522624: '三穗县', + 522625: '镇远县', + 522626: '岑巩县', + 522627: '天柱县', + 522628: '锦屏县', + 522629: '剑河县', + 522630: '台江县', + 522631: '黎平县', + 522632: '榕江县', + 522633: '从江县', + 522634: '雷山县', + 522635: '麻江县', + 522636: '丹寨县', + 522701: '都匀市', + 522702: '福泉市', + 522722: '荔波县', + 522723: '贵定县', + 522725: '瓮安县', + 522726: '独山县', + 522727: '平塘县', + 522728: '罗甸县', + 522729: '长顺县', + 522730: '龙里县', + 522731: '惠水县', + 522732: '三都水族自治县', + 530102: '五华区', + 530103: '盘龙区', + 530111: '官渡区', + 530112: '西山区', + 530113: '东川区', + 530114: '呈贡区', + 530115: '晋宁区', + 530124: '富民县', + 530125: '宜良县', + 530126: '石林彝族自治县', + 530127: '嵩明县', + 530128: '禄劝彝族苗族自治县', + 530129: '寻甸回族彝族自治县', + 530181: '安宁市', + 530302: '麒麟区', + 530303: '沾益区', + 530321: '马龙县', + 530322: '陆良县', + 530323: '师宗县', + 530324: '罗平县', + 530325: '富源县', + 530326: '会泽县', + 530381: '宣威市', + 530402: '红塔区', + 530403: '江川区', + 530422: '澄江县', + 530423: '通海县', + 530424: '华宁县', + 530425: '易门县', + 530426: '峨山彝族自治县', + 530427: '新平彝族傣族自治县', + 530428: '元江哈尼族彝族傣族自治县', + 530502: '隆阳区', + 530521: '施甸县', + 530523: '龙陵县', + 530524: '昌宁县', + 530581: '腾冲市', + 530602: '昭阳区', + 530621: '鲁甸县', + 530622: '巧家县', + 530623: '盐津县', + 530624: '大关县', + 530625: '永善县', + 530626: '绥江县', + 530627: '镇雄县', + 530628: '彝良县', + 530629: '威信县', + 530630: '水富县', + 530702: '古城区', + 530721: '玉龙纳西族自治县', + 530722: '永胜县', + 530723: '华坪县', + 530724: '宁蒗彝族自治县', + 530802: '思茅区', + 530821: '宁洱哈尼族彝族自治县', + 530822: '墨江哈尼族自治县', + 530823: '景东彝族自治县', + 530824: '景谷傣族彝族自治县', + 530825: '镇沅彝族哈尼族拉祜族自治县', + 530826: '江城哈尼族彝族自治县', + 530827: '孟连傣族拉祜族佤族自治县', + 530828: '澜沧拉祜族自治县', + 530829: '西盟佤族自治县', + 530902: '临翔区', + 530921: '凤庆县', + 530922: '云县', + 530923: '永德县', + 530924: '镇康县', + 530925: '双江拉祜族佤族布朗族傣族自治县', + 530926: '耿马傣族佤族自治县', + 530927: '沧源佤族自治县', + 532301: '楚雄市', + 532322: '双柏县', + 532323: '牟定县', + 532324: '南华县', + 532325: '姚安县', + 532326: '大姚县', + 532327: '永仁县', + 532328: '元谋县', + 532329: '武定县', + 532331: '禄丰县', + 532501: '个旧市', + 532502: '开远市', + 532503: '蒙自市', + 532504: '弥勒市', + 532523: '屏边苗族自治县', + 532524: '建水县', + 532525: '石屏县', + 532527: '泸西县', + 532528: '元阳县', + 532529: '红河县', + 532530: '金平苗族瑶族傣族自治县', + 532531: '绿春县', + 532532: '河口瑶族自治县', + 532601: '文山市', + 532622: '砚山县', + 532623: '西畴县', + 532624: '麻栗坡县', + 532625: '马关县', + 532626: '丘北县', + 532627: '广南县', + 532628: '富宁县', + 532801: '景洪市', + 532822: '勐海县', + 532823: '勐腊县', + 532901: '大理市', + 532922: '漾濞彝族自治县', + 532923: '祥云县', + 532924: '宾川县', + 532925: '弥渡县', + 532926: '南涧彝族自治县', + 532927: '巍山彝族回族自治县', + 532928: '永平县', + 532929: '云龙县', + 532930: '洱源县', + 532931: '剑川县', + 532932: '鹤庆县', + 533102: '瑞丽市', + 533103: '芒市', + 533122: '梁河县', + 533123: '盈江县', + 533124: '陇川县', + 533301: '泸水市', + 533323: '福贡县', + 533324: '贡山独龙族怒族自治县', + 533325: '兰坪白族普米族自治县', + 533401: '香格里拉市', + 533422: '德钦县', + 533423: '维西傈僳族自治县', + 540102: '城关区', + 540103: '堆龙德庆区', + 540104: '达孜区', + 540121: '林周县', + 540122: '当雄县', + 540123: '尼木县', + 540124: '曲水县', + 540127: '墨竹工卡县', + 540202: '桑珠孜区', + 540221: '南木林县', + 540222: '江孜县', + 540223: '定日县', + 540224: '萨迦县', + 540225: '拉孜县', + 540226: '昂仁县', + 540227: '谢通门县', + 540228: '白朗县', + 540229: '仁布县', + 540230: '康马县', + 540231: '定结县', + 540232: '仲巴县', + 540233: '亚东县', + 540234: '吉隆县', + 540235: '聂拉木县', + 540236: '萨嘎县', + 540237: '岗巴县', + 540302: '卡若区', + 540321: '江达县', + 540322: '贡觉县', + 540323: '类乌齐县', + 540324: '丁青县', + 540325: '察雅县', + 540326: '八宿县', + 540327: '左贡县', + 540328: '芒康县', + 540329: '洛隆县', + 540330: '边坝县', + 540402: '巴宜区', + 540421: '工布江达县', + 540422: '米林县', + 540423: '墨脱县', + 540424: '波密县', + 540425: '察隅县', + 540426: '朗县', + 540502: '乃东区', + 540521: '扎囊县', + 540522: '贡嘎县', + 540523: '桑日县', + 540524: '琼结县', + 540525: '曲松县', + 540526: '措美县', + 540527: '洛扎县', + 540528: '加查县', + 540529: '隆子县', + 540530: '错那县', + 540531: '浪卡子县', + 540602: '色尼区', + 542421: '那曲县', + 542422: '嘉黎县', + 542423: '比如县', + 542424: '聂荣县', + 542425: '安多县', + 542426: '申扎县', + 542427: '索县', + 542428: '班戈县', + 542429: '巴青县', + 542430: '尼玛县', + 542431: '双湖县', + 542521: '普兰县', + 542522: '札达县', + 542523: '噶尔县', + 542524: '日土县', + 542525: '革吉县', + 542526: '改则县', + 542527: '措勤县', + 610102: '新城区', + 610103: '碑林区', + 610104: '莲湖区', + 610111: '灞桥区', + 610112: '未央区', + 610113: '雁塔区', + 610114: '阎良区', + 610115: '临潼区', + 610116: '长安区', + 610117: '高陵区', + 610118: '鄠邑区', + 610122: '蓝田县', + 610124: '周至县', + 610202: '王益区', + 610203: '印台区', + 610204: '耀州区', + 610222: '宜君县', + 610302: '渭滨区', + 610303: '金台区', + 610304: '陈仓区', + 610322: '凤翔县', + 610323: '岐山县', + 610324: '扶风县', + 610326: '眉县', + 610327: '陇县', + 610328: '千阳县', + 610329: '麟游县', + 610330: '凤县', + 610331: '太白县', + 610402: '秦都区', + 610403: '杨陵区', + 610404: '渭城区', + 610422: '三原县', + 610423: '泾阳县', + 610424: '乾县', + 610425: '礼泉县', + 610426: '永寿县', + 610427: '彬县', + 610428: '长武县', + 610429: '旬邑县', + 610430: '淳化县', + 610431: '武功县', + 610481: '兴平市', + 610502: '临渭区', + 610503: '华州区', + 610522: '潼关县', + 610523: '大荔县', + 610524: '合阳县', + 610525: '澄城县', + 610526: '蒲城县', + 610527: '白水县', + 610528: '富平县', + 610581: '韩城市', + 610582: '华阴市', + 610602: '宝塔区', + 610603: '安塞区', + 610621: '延长县', + 610622: '延川县', + 610623: '子长县', + 610625: '志丹县', + 610626: '吴起县', + 610627: '甘泉县', + 610628: '富县', + 610629: '洛川县', + 610630: '宜川县', + 610631: '黄龙县', + 610632: '黄陵县', + 610702: '汉台区', + 610703: '南郑区', + 610722: '城固县', + 610723: '洋县', + 610724: '西乡县', + 610725: '勉县', + 610726: '宁强县', + 610727: '略阳县', + 610728: '镇巴县', + 610729: '留坝县', + 610730: '佛坪县', + 610802: '榆阳区', + 610803: '横山区', + 610822: '府谷县', + 610824: '靖边县', + 610825: '定边县', + 610826: '绥德县', + 610827: '米脂县', + 610828: '佳县', + 610829: '吴堡县', + 610830: '清涧县', + 610831: '子洲县', + 610881: '神木市', + 610902: '汉滨区', + 610921: '汉阴县', + 610922: '石泉县', + 610923: '宁陕县', + 610924: '紫阳县', + 610925: '岚皋县', + 610926: '平利县', + 610927: '镇坪县', + 610928: '旬阳县', + 610929: '白河县', + 611002: '商州区', + 611021: '洛南县', + 611022: '丹凤县', + 611023: '商南县', + 611024: '山阳县', + 611025: '镇安县', + 611026: '柞水县', + 620102: '城关区', + 620103: '七里河区', + 620104: '西固区', + 620105: '安宁区', + 620111: '红古区', + 620121: '永登县', + 620122: '皋兰县', + 620123: '榆中县', + 620201: '市辖区', + 620290: '雄关区', + 620291: '长城区', + 620292: '镜铁区', + 620293: '新城镇', + 620294: '峪泉镇', + 620295: '文殊镇', + 620302: '金川区', + 620321: '永昌县', + 620402: '白银区', + 620403: '平川区', + 620421: '靖远县', + 620422: '会宁县', + 620423: '景泰县', + 620502: '秦州区', + 620503: '麦积区', + 620521: '清水县', + 620522: '秦安县', + 620523: '甘谷县', + 620524: '武山县', + 620525: '张家川回族自治县', + 620602: '凉州区', + 620621: '民勤县', + 620622: '古浪县', + 620623: '天祝藏族自治县', + 620702: '甘州区', + 620721: '肃南裕固族自治县', + 620722: '民乐县', + 620723: '临泽县', + 620724: '高台县', + 620725: '山丹县', + 620802: '崆峒区', + 620821: '泾川县', + 620822: '灵台县', + 620823: '崇信县', + 620824: '华亭县', + 620825: '庄浪县', + 620826: '静宁县', + 620902: '肃州区', + 620921: '金塔县', + 620922: '瓜州县', + 620923: '肃北蒙古族自治县', + 620924: '阿克塞哈萨克族自治县', + 620981: '玉门市', + 620982: '敦煌市', + 621002: '西峰区', + 621021: '庆城县', + 621022: '环县', + 621023: '华池县', + 621024: '合水县', + 621025: '正宁县', + 621026: '宁县', + 621027: '镇原县', + 621102: '安定区', + 621121: '通渭县', + 621122: '陇西县', + 621123: '渭源县', + 621124: '临洮县', + 621125: '漳县', + 621126: '岷县', + 621202: '武都区', + 621221: '成县', + 621222: '文县', + 621223: '宕昌县', + 621224: '康县', + 621225: '西和县', + 621226: '礼县', + 621227: '徽县', + 621228: '两当县', + 622901: '临夏市', + 622921: '临夏县', + 622922: '康乐县', + 622923: '永靖县', + 622924: '广河县', + 622925: '和政县', + 622926: '东乡族自治县', + 622927: '积石山保安族东乡族撒拉族自治县', + 623001: '合作市', + 623021: '临潭县', + 623022: '卓尼县', + 623023: '舟曲县', + 623024: '迭部县', + 623025: '玛曲县', + 623026: '碌曲县', + 623027: '夏河县', + 630102: '城东区', + 630103: '城中区', + 630104: '城西区', + 630105: '城北区', + 630121: '大通回族土族自治县', + 630122: '湟中县', + 630123: '湟源县', + 630202: '乐都区', + 630203: '平安区', + 630222: '民和回族土族自治县', + 630223: '互助土族自治县', + 630224: '化隆回族自治县', + 630225: '循化撒拉族自治县', + 632221: '门源回族自治县', + 632222: '祁连县', + 632223: '海晏县', + 632224: '刚察县', + 632321: '同仁县', + 632322: '尖扎县', + 632323: '泽库县', + 632324: '河南蒙古族自治县', + 632521: '共和县', + 632522: '同德县', + 632523: '贵德县', + 632524: '兴海县', + 632525: '贵南县', + 632621: '玛沁县', + 632622: '班玛县', + 632623: '甘德县', + 632624: '达日县', + 632625: '久治县', + 632626: '玛多县', + 632701: '玉树市', + 632722: '杂多县', + 632723: '称多县', + 632724: '治多县', + 632725: '囊谦县', + 632726: '曲麻莱县', + 632801: '格尔木市', + 632802: '德令哈市', + 632821: '乌兰县', + 632822: '都兰县', + 632823: '天峻县', + 640104: '兴庆区', + 640105: '西夏区', + 640106: '金凤区', + 640121: '永宁县', + 640122: '贺兰县', + 640181: '灵武市', + 640202: '大武口区', + 640205: '惠农区', + 640221: '平罗县', + 640302: '利通区', + 640303: '红寺堡区', + 640323: '盐池县', + 640324: '同心县', + 640381: '青铜峡市', + 640402: '原州区', + 640422: '西吉县', + 640423: '隆德县', + 640424: '泾源县', + 640425: '彭阳县', + 640502: '沙坡头区', + 640521: '中宁县', + 640522: '海原县', + 650102: '天山区', + 650103: '沙依巴克区', + 650104: '新市区', + 650105: '水磨沟区', + 650106: '头屯河区', + 650107: '达坂城区', + 650109: '米东区', + 650121: '乌鲁木齐县', + 650202: '独山子区', + 650203: '克拉玛依区', + 650204: '白碱滩区', + 650205: '乌尔禾区', + 650402: '高昌区', + 650421: '鄯善县', + 650422: '托克逊县', + 650502: '伊州区', + 650521: '巴里坤哈萨克自治县', + 650522: '伊吾县', + 652301: '昌吉市', + 652302: '阜康市', + 652323: '呼图壁县', + 652324: '玛纳斯县', + 652325: '奇台县', + 652327: '吉木萨尔县', + 652328: '木垒哈萨克自治县', + 652701: '博乐市', + 652702: '阿拉山口市', + 652722: '精河县', + 652723: '温泉县', + 652801: '库尔勒市', + 652822: '轮台县', + 652823: '尉犁县', + 652824: '若羌县', + 652825: '且末县', + 652826: '焉耆回族自治县', + 652827: '和静县', + 652828: '和硕县', + 652829: '博湖县', + 652901: '阿克苏市', + 652922: '温宿县', + 652923: '库车县', + 652924: '沙雅县', + 652925: '新和县', + 652926: '拜城县', + 652927: '乌什县', + 652928: '阿瓦提县', + 652929: '柯坪县', + 653001: '阿图什市', + 653022: '阿克陶县', + 653023: '阿合奇县', + 653024: '乌恰县', + 653101: '喀什市', + 653121: '疏附县', + 653122: '疏勒县', + 653123: '英吉沙县', + 653124: '泽普县', + 653125: '莎车县', + 653126: '叶城县', + 653127: '麦盖提县', + 653128: '岳普湖县', + 653129: '伽师县', + 653130: '巴楚县', + 653131: '塔什库尔干塔吉克自治县', + 653201: '和田市', + 653221: '和田县', + 653222: '墨玉县', + 653223: '皮山县', + 653224: '洛浦县', + 653225: '策勒县', + 653226: '于田县', + 653227: '民丰县', + 654002: '伊宁市', + 654003: '奎屯市', + 654004: '霍尔果斯市', + 654021: '伊宁县', + 654022: '察布查尔锡伯自治县', + 654023: '霍城县', + 654024: '巩留县', + 654025: '新源县', + 654026: '昭苏县', + 654027: '特克斯县', + 654028: '尼勒克县', + 654201: '塔城市', + 654202: '乌苏市', + 654221: '额敏县', + 654223: '沙湾县', + 654224: '托里县', + 654225: '裕民县', + 654226: '和布克赛尔蒙古自治县', + 654301: '阿勒泰市', + 654321: '布尔津县', + 654322: '富蕴县', + 654323: '福海县', + 654324: '哈巴河县', + 654325: '青河县', + 654326: '吉木乃县', + 659001: '石河子市', + 659002: '阿拉尔市', + 659003: '图木舒克市', + 659004: '五家渠市', + 659005: '北屯市', + 659006: '铁门关市', + 659007: '双河市', + 659008: '可克达拉市', + 659009: '昆玉市', + 710101: '中正区', + 710102: '大同区', + 710103: '中山区', + 710104: '松山区', + 710105: '大安区', + 710106: '万华区', + 710107: '信义区', + 710108: '士林区', + 710109: '北投区', + 710110: '内湖区', + 710111: '南港区', + 710112: '文山区', + 710199: '其它区', + 710201: '新兴区', + 710202: '前金区', + 710203: '芩雅区', + 710204: '盐埕区', + 710205: '鼓山区', + 710206: '旗津区', + 710207: '前镇区', + 710208: '三民区', + 710209: '左营区', + 710210: '楠梓区', + 710211: '小港区', + 710241: '苓雅区', + 710242: '仁武区', + 710243: '大社区', + 710244: '冈山区', + 710245: '路竹区', + 710246: '阿莲区', + 710247: '田寮区', + 710248: '燕巢区', + 710249: '桥头区', + 710250: '梓官区', + 710251: '弥陀区', + 710252: '永安区', + 710253: '湖内区', + 710254: '凤山区', + 710255: '大寮区', + 710256: '林园区', + 710257: '鸟松区', + 710258: '大树区', + 710259: '旗山区', + 710260: '美浓区', + 710261: '六龟区', + 710262: '内门区', + 710263: '杉林区', + 710264: '甲仙区', + 710265: '桃源区', + 710266: '那玛夏区', + 710267: '茂林区', + 710268: '茄萣区', + 710299: '其它区', + 710301: '中西区', + 710302: '东区', + 710303: '南区', + 710304: '北区', + 710305: '安平区', + 710306: '安南区', + 710339: '永康区', + 710340: '归仁区', + 710341: '新化区', + 710342: '左镇区', + 710343: '玉井区', + 710344: '楠西区', + 710345: '南化区', + 710346: '仁德区', + 710347: '关庙区', + 710348: '龙崎区', + 710349: '官田区', + 710350: '麻豆区', + 710351: '佳里区', + 710352: '西港区', + 710353: '七股区', + 710354: '将军区', + 710355: '学甲区', + 710356: '北门区', + 710357: '新营区', + 710358: '后壁区', + 710359: '白河区', + 710360: '东山区', + 710361: '六甲区', + 710362: '下营区', + 710363: '柳营区', + 710364: '盐水区', + 710365: '善化区', + 710366: '大内区', + 710367: '山上区', + 710368: '新市区', + 710369: '安定区', + 710399: '其它区', + 710401: '中区', + 710402: '东区', + 710403: '南区', + 710404: '西区', + 710405: '北区', + 710406: '北屯区', + 710407: '西屯区', + 710408: '南屯区', + 710431: '太平区', + 710432: '大里区', + 710433: '雾峰区', + 710434: '乌日区', + 710435: '丰原区', + 710436: '后里区', + 710437: '石冈区', + 710438: '东势区', + 710439: '和平区', + 710440: '新社区', + 710441: '潭子区', + 710442: '大雅区', + 710443: '神冈区', + 710444: '大肚区', + 710445: '沙鹿区', + 710446: '龙井区', + 710447: '梧栖区', + 710448: '清水区', + 710449: '大甲区', + 710450: '外埔区', + 710451: '大安区', + 710499: '其它区', + 710507: '金沙镇', + 710508: '金湖镇', + 710509: '金宁乡', + 710510: '金城镇', + 710511: '烈屿乡', + 710512: '乌坵乡', + 710614: '南投市', + 710615: '中寮乡', + 710616: '草屯镇', + 710617: '国姓乡', + 710618: '埔里镇', + 710619: '仁爱乡', + 710620: '名间乡', + 710621: '集集镇', + 710622: '水里乡', + 710623: '鱼池乡', + 710624: '信义乡', + 710625: '竹山镇', + 710626: '鹿谷乡', + 710701: '仁爱区', + 710702: '信义区', + 710703: '中正区', + 710704: '中山区', + 710705: '安乐区', + 710706: '暖暖区', + 710707: '七堵区', + 710799: '其它区', + 710801: '东区', + 710802: '北区', + 710803: '香山区', + 710899: '其它区', + 710901: '东区', + 710902: '西区', + 710999: '其它区', + 711130: '万里区', + 711132: '板桥区', + 711133: '汐止区', + 711134: '深坑区', + 711136: '瑞芳区', + 711137: '平溪区', + 711138: '双溪区', + 711140: '新店区', + 711141: '坪林区', + 711142: '乌来区', + 711143: '永和区', + 711144: '中和区', + 711145: '土城区', + 711146: '三峡区', + 711147: '树林区', + 711149: '三重区', + 711150: '新庄区', + 711151: '泰山区', + 711152: '林口区', + 711154: '五股区', + 711155: '八里区', + 711156: '淡水区', + 711157: '三芝区', + 711287: '宜兰市', + 711288: '头城镇', + 711289: '礁溪乡', + 711290: '壮围乡', + 711291: '员山乡', + 711292: '罗东镇', + 711293: '三星乡', + 711294: '大同乡', + 711295: '五结乡', + 711296: '冬山乡', + 711297: '苏澳镇', + 711298: '南澳乡', + 711299: '钓鱼台', + 711387: '竹北市', + 711388: '湖口乡', + 711389: '新丰乡', + 711390: '新埔镇', + 711391: '关西镇', + 711392: '芎林乡', + 711393: '宝山乡', + 711394: '竹东镇', + 711395: '五峰乡', + 711396: '横山乡', + 711397: '尖石乡', + 711398: '北埔乡', + 711399: '峨眉乡', + 711487: '中坜市', + 711488: '平镇市', + 711489: '龙潭乡', + 711490: '杨梅市', + 711491: '新屋乡', + 711492: '观音乡', + 711493: '桃园市', + 711494: '龟山乡', + 711495: '八德市', + 711496: '大溪镇', + 711497: '复兴乡', + 711498: '大园乡', + 711499: '芦竹乡', + 711582: '竹南镇', + 711583: '头份镇', + 711584: '三湾乡', + 711585: '南庄乡', + 711586: '狮潭乡', + 711587: '后龙镇', + 711588: '通霄镇', + 711589: '苑里镇', + 711590: '苗栗市', + 711591: '造桥乡', + 711592: '头屋乡', + 711593: '公馆乡', + 711594: '大湖乡', + 711595: '泰安乡', + 711596: '铜锣乡', + 711597: '三义乡', + 711598: '西湖乡', + 711599: '卓兰镇', + 711774: '彰化市', + 711775: '芬园乡', + 711776: '花坛乡', + 711777: '秀水乡', + 711778: '鹿港镇', + 711779: '福兴乡', + 711780: '线西乡', + 711781: '和美镇', + 711782: '伸港乡', + 711783: '员林镇', + 711784: '社头乡', + 711785: '永靖乡', + 711786: '埔心乡', + 711787: '溪湖镇', + 711788: '大村乡', + 711789: '埔盐乡', + 711790: '田中镇', + 711791: '北斗镇', + 711792: '田尾乡', + 711793: '埤头乡', + 711794: '溪州乡', + 711795: '竹塘乡', + 711796: '二林镇', + 711797: '大城乡', + 711798: '芳苑乡', + 711799: '二水乡', + 711982: '番路乡', + 711983: '梅山乡', + 711984: '竹崎乡', + 711985: '阿里山乡', + 711986: '中埔乡', + 711987: '大埔乡', + 711988: '水上乡', + 711989: '鹿草乡', + 711990: '太保市', + 711991: '朴子市', + 711992: '东石乡', + 711993: '六脚乡', + 711994: '新港乡', + 711995: '民雄乡', + 711996: '大林镇', + 711997: '溪口乡', + 711998: '义竹乡', + 711999: '布袋镇', + 712180: '斗南镇', + 712181: '大埤乡', + 712182: '虎尾镇', + 712183: '土库镇', + 712184: '褒忠乡', + 712185: '东势乡', + 712186: '台西乡', + 712187: '仑背乡', + 712188: '麦寮乡', + 712189: '斗六市', + 712190: '林内乡', + 712191: '古坑乡', + 712192: '莿桐乡', + 712193: '西螺镇', + 712194: '二仑乡', + 712195: '北港镇', + 712196: '水林乡', + 712197: '口湖乡', + 712198: '四湖乡', + 712199: '元长乡', + 712467: '屏东市', + 712468: '三地门乡', + 712469: '雾台乡', + 712470: '玛家乡', + 712471: '九如乡', + 712472: '里港乡', + 712473: '高树乡', + 712474: '盐埔乡', + 712475: '长治乡', + 712476: '麟洛乡', + 712477: '竹田乡', + 712478: '内埔乡', + 712479: '万丹乡', + 712480: '潮州镇', + 712481: '泰武乡', + 712482: '来义乡', + 712483: '万峦乡', + 712484: '莰顶乡', + 712485: '新埤乡', + 712486: '南州乡', + 712487: '林边乡', + 712488: '东港镇', + 712489: '琉球乡', + 712490: '佳冬乡', + 712491: '新园乡', + 712492: '枋寮乡', + 712493: '枋山乡', + 712494: '春日乡', + 712495: '狮子乡', + 712496: '车城乡', + 712497: '牡丹乡', + 712498: '恒春镇', + 712499: '满州乡', + 712584: '台东市', + 712585: '绿岛乡', + 712586: '兰屿乡', + 712587: '延平乡', + 712588: '卑南乡', + 712589: '鹿野乡', + 712590: '关山镇', + 712591: '海端乡', + 712592: '池上乡', + 712593: '东河乡', + 712594: '成功镇', + 712595: '长滨乡', + 712596: '金峰乡', + 712597: '大武乡', + 712598: '达仁乡', + 712599: '太麻里乡', + 712686: '花莲市', + 712687: '新城乡', + 712688: '太鲁阁', + 712689: '秀林乡', + 712690: '吉安乡', + 712691: '寿丰乡', + 712692: '凤林镇', + 712693: '光复乡', + 712694: '丰滨乡', + 712695: '瑞穗乡', + 712696: '万荣乡', + 712697: '玉里镇', + 712698: '卓溪乡', + 712699: '富里乡', + 712794: '马公市', + 712795: '西屿乡', + 712796: '望安乡', + 712797: '七美乡', + 712798: '白沙乡', + 712799: '湖西乡', + 712896: '南竿乡', + 712897: '北竿乡', + 712898: '东引乡', + 712899: '莒光乡', + 810101: '中西区', + 810102: '湾仔', + 810103: '东区', + 810104: '南区', + 810201: '九龙城区', + 810202: '油尖旺区', + 810203: '深水埗区', + 810204: '黄大仙区', + 810205: '观塘区', + 810301: '北区', + 810302: '大埔区', + 810303: '沙田区', + 810304: '西贡区', + 810305: '元朗区', + 810306: '屯门区', + 810307: '荃湾区', + 810308: '葵青区', + 810309: '离岛区', + 820101: '澳门半岛', + 820201: '离岛' + } + }; + + + Class.prototype.config = { + elem: '', + data: { + province: '', + city: '', + county: '', + provinceCode: 0, + cityCode: 0, + countyCode: 0, + }, + change: function(result){} + }; + + Class.prototype.index = 0; + + Class.prototype.render = function () { + let that = this, options = that.config; + options.elem = $(options.elem); + + that.events(); + }; + + Class.prototype.reload = function (op) { + let options = this.config; + options.data = $.extend(options.data, op.data || {}); + this.events(true); + }; + + Class.prototype.events = function (reload = false) { + let that = this, options = that.config; + let provinceFilter = 'province-' + layarea._id; + let cityFilter = 'city-' + layarea._id; + let countyFilter = 'county-' + layarea._id; + + let provinceEl = options.elem.find('.province-selector'); + let cityEl = options.elem.find('.city-selector'); + let countyEl = options.elem.find('.county-selector'); + + if (reload){ + options.data.provinceCode = getCode('province', options.data.province); + let code = getCode('city', options.data.city, options.data.provinceCode.slice(0, 2)); + options.data.cityCode = code; + options.data.countyCode = getCode('county', options.data.county, options.data.cityCode.slice(0, 4)); + renderProvince(); + return; + } + //filter + if(provinceEl.attr('lay-filter')){ + provinceFilter = provinceEl.attr('lay-filter'); + } + if(cityEl.attr('lay-filter')){ + cityFilter = cityEl.attr('lay-filter'); + } + if(countyEl.attr('lay-filter')){ + countyFilter = countyEl.attr('lay-filter'); + } + provinceEl.attr('lay-filter', provinceFilter); + cityEl.attr('lay-filter', cityFilter); + countyEl.attr('lay-filter', countyFilter); + + //获取默认值 + if(provinceEl.data('value')){ + options.data.province = provinceEl.data('value'); + options.data.provinceCode = getCode('province', options.data.province); + } else if (!options.data.province) { + options.data.province = ''; + } + if(cityEl.data('value')){ + options.data.city = cityEl.data('value'); + let code = getCode('city', options.data.city, options.data.provinceCode.slice(0, 2)); + options.data.cityCode = code; + } else if (!options.data.city) { + options.data.city = ''; + } + if(countyEl.data('value')){ + options.data.county = countyEl.data('value'); + options.data.countyCode = getCode('county', options.data.county, options.data.cityCode.slice(0, 4)); + } else if (!options.data.county) { + options.data.county = ''; + } + provinceEl.attr('lay-filter', provinceFilter); + cityEl.attr('lay-filter', cityFilter); + countyEl.attr('lay-filter', countyFilter); + + //监听结果 + form.on('select('+provinceFilter+')', function(data){ + options.data.province = data.value; + options.data.provinceCode = getCode('province', data.value); + renderCity(options.data.provinceCode); + + options.change(options.data); + }); + form.on('select('+cityFilter+')', function(data){ + options.data.city = data.value; + if(options.data.provinceCode){ + options.data.cityCode = getCode('city', data.value, options.data.provinceCode.slice(0, 2)); + renderCounty(options.data.cityCode); + } + + options.change(options.data); + }); + form.on('select('+countyFilter+')', function(data){ + options.data.county = data.value; + if(options.data.cityCode){ + options.data.countyCode = getCode('county', data.value, options.data.cityCode.slice(0, 4)); + } + options.change(options.data); + }); + + renderProvince(); + + //查找province + function renderProvince(){ + let tpl = ''; + let provinceList = getList("province"); + let currentCode = ''; + let currentName = ''; + provinceList.forEach(function(_item){ + // if (!currentCode){ + // currentCode = _item.code; + // currentName = _item.name; + // } + if(_item.name === options.data.province){ + currentCode = _item.code; + currentName = _item.name; + } + tpl += ''; + }); + provinceEl.html(tpl); + provinceEl.val(options.data.province); + form.render('select'); + renderCity(currentCode); + } + + function renderCity(provinceCode){ + let tpl = ''; + let cityList = getList('city', provinceCode.slice(0, 2)); + let currentCode = ''; + let currentName = ''; + cityList.forEach(function(_item){ + // if (!currentCode){ + // currentCode = _item.code; + // currentName = _item.name; + // } + if(_item.name === options.data.city){ + currentCode = _item.code; + currentName = _item.name; + } + tpl += ''; + }); + options.data.city = currentName; + cityEl.html(tpl); + cityEl.val(options.data.city); + form.render('select'); + renderCounty(currentCode); + } + + function renderCounty(cityCode){ + let tpl = ''; + let countyList = getList('county', cityCode.slice(0, 4)); + let currentCode = ''; + let currentName = ''; + countyList.forEach(function(_item){ + // if (!currentCode){ + // currentCode = _item.code; + // currentName = _item.name; + // } + if(_item.name === options.data.county){ + currentCode = _item.code; + currentName = _item.name; + } + tpl += ''; + }); + options.data.county = currentName; + countyEl.html(tpl); + countyEl.val(options.data.county); + + form.render('select'); + } + + function getList(type, code) { + let result = []; + + if (type !== 'province' && !code) { + return result; + } + + let list = areaList[type + "_list"] || {}; + result = Object.keys(list).map(function (code) { + return { + code: code, + name: list[code] + }; + }); + + if (code) { + // oversea code + if (code[0] === '9' && type === 'city') { + code = '9'; + } + + result = result.filter(function (item) { + return item.code.indexOf(code) === 0; + }); + } + + return result; + } + + function getCode(type, name, parentCode = 0){ + let code = ''; + let list = areaList[type + "_list"] || {}; + let result = {}; + Object.keys(list).map(function (_code) { + if(parentCode){ + if(_code.indexOf(parentCode) === 0){ + result[_code] = list[_code]; + } + }else{ + result[_code] = list[_code]; + } + }); + layui.each(result, function(_code, _name){ + if(_name === name){ + code = _code; + } + }); + + return code; + } + }; + + layarea.render = function (options) { + let inst = new Class(options); + layarea._id++; + return thisArea.call(inst); + }; + + exports('area', layarea); + }); \ No newline at end of file diff --git a/static/component/pear/module/button.js b/static/component/pear/module/button.js new file mode 100644 index 000000000..d77c18d2f --- /dev/null +++ b/static/component/pear/module/button.js @@ -0,0 +1,53 @@ +layui.define(['jquery'], function(exports) { + "use strict"; + + /** + * Button component + * */ + var MOD_NAME = 'button', + $ = layui.jquery; + + var button = function(opt) { + this.option = opt; + }; + + /** + * Button start loading + * */ + button.prototype.load = function(opt) { + + var option = { + elem: opt.elem, + time: opt.time ? opt.time : false, + done: opt.done ? opt.done : function(){} + } + var text = $(option.elem).html(); + + $(option.elem).html(""); + + $(option.elem).attr("disabled", "disabled"); + + var buttons = $(option.elem); + + if (option.time != "" || option.time !=false) { + setTimeout(function() { + $(option.elem).attr("disabled", false); + buttons.html(text); + option.done(); + }, option.time); + } + option.text = text; + return new button(option); + } + + /** + * Button stop loaded + * */ + button.prototype.stop = function(success) { + $(this.option.elem).attr("disabled", false); + $(this.option.elem).html(this.option.text); + success && success(); + } + + exports(MOD_NAME, new button()); +}); diff --git a/static/component/pear/module/card.js b/static/component/pear/module/card.js new file mode 100644 index 000000000..9cb32f1b5 --- /dev/null +++ b/static/component/pear/module/card.js @@ -0,0 +1,267 @@ +layui.define(['table', 'laypage','jquery', 'element'], function(exports) { + "use strict"; + + var MOD_NAME = 'card', + $ = layui.jquery, + element = layui.element, + laypage = layui.laypage; + + var _instances = {}; // 记录所有实例 + + var defaultOption = { + elem: "#currentTableId",// 构建的模型 + url: "",// 数据 url 连接 + loading: true,//是否加载 + limit: 0, //每页数量默认是每行数量的双倍 + linenum: 4, //每行数量 2,3,4,6 + currentPage: 1,//当前页 + data:[], //静态数据 + limits:[], //页码 + page: true, //是否分页 + layout: ['count', 'prev', 'page', 'next','limit', 'skip'],//分页控件 + request: { + pageName: 'page' //页码的参数名称,默认:page + , limitName: 'limit' //每页数据量的参数名,默认:limit + , idName: 'id' //主键名称,默认:id + , titleName: 'title' //标题名称,默认:title + , imageName: 'image' //图片地址,默认:image + , remarkName: 'remark' //备注名称,默认:remark + , timeName: 'time' //时间名称,默认:time + }, + response: { + statusName: 'code' //规定数据状态的字段名称,默认:code + , statusCode: 0 //规定成功的状态码,默认:0 + , msgName: 'msg' //规定状态信息的字段名称,默认:msg + , countName: 'count' //规定数据总数的字段名称,默认:count + , dataName: 'data' //规定数据列表的字段名称,默认:data + }, + clickItem: function(data){}, + done: function () { + + } + }; + + var card = function(opt) { + _instances[opt.elem.substring(1)] = this; + this.reload(opt); + }; + card.prototype.initOptions = function (opt) { + this.option = $.extend(true, {}, defaultOption, opt); + if (!this.option.limit || this.option.limit == 0) { + this.option.limit = this.option.linenum * 2; + } + if (!this.option.limits || this.option.limits.length == 0) { + this.option.limits = [this.option.limit]; + } + }; + + card.prototype.init = function () { + var option = this.option; + var url = option.url; + var html = ""; + html += option.loading == true ? '
                        ' : '
                        '; + html += ''; + html += '
                        '; + $(option.elem).html(html); + html = ""; + if (!!url) { + if (url.indexOf("?") >= 0) { + url = url + '&v=1.0.0'; + } + else { + url = url + '?v=1.0.0'; + } + if (!!option.page) { + url = url + '&' + option.request.limitName + '=' + option.limit; + url = url + '&' + option.request.pageName + '=' + option.currentPage; + } + if (!!option.where) { + for (let key in option.where) { + url = url + '&' + key + '=' + option.where[key]; + } + } + getData(url).then(function(data){ + data = initData(data, option); + if (data.code != option.response.statusCode) { + option.data = []; + option.count = 0; + } else { + option.data = data.data; + option.count = option.data.length; + } + + if (!!option.data && option.data.length > 0) { + html = createComponent(option.elem.substring(1), option.linenum, option.data); + html += "
                        "; + } + else { + html = "

                        没有数据

                        "; + } + $(option.elem).html(html); + if (option.page) { + laypage.render({ + elem: 'cardpage' + , count: option.count, limit: option.limit, limits: option.limits, curr: option.currentPage + , layout: option.layout + , jump: function (obj, first) { + option.limit = obj.limit; + option.currentPage = obj.curr; + if (!first) { + _instances[option.elem.substring(1)].reload(option); + } + } + }); + } + }); + } + else { + if (!option.alldata) { + option.alldata = option.data; + } + if (option.page) { + var data = []; + option.count = option.alldata.length; + for (var i = (option.currentPage - 1) * option.limit; i < option.currentPage * option.limit && i 0) { + html = createComponent(option.elem.substring(1), option.linenum, option.data); + html += "
                        "; + } + else { + html = "

                        没有数据

                        "; + } + $(option.elem).html(html); + if (option.page) { + laypage.render({ + elem: 'cardpage' + , count: option.count, limit: option.limit, limits: option.limits, curr: option.currentPage + , layout: option.layout + , jump: function (obj, first) { + option.limit = obj.limit; + option.currentPage = obj.curr; + if (!first) { + _instances[option.elem.substring(1)].reload(option); + } + } + }); + } + } + } + + card.prototype.reload = function (opt) { + this.initOptions(this.option ? $.extend(true, this.option, opt) : opt); + this.init(); // 初始化表格 + } + + function createComponent(elem,linenum,data) { + var html = "
                        " + var content = createCards(elem, linenum,data); + var page = ""; + content = content + page; + html += content + "
                        " + return html; + } + + function createCards(elem, linenum,data) { + var content = "
                        "; + for (var i = 0; i < data.length; i++) { + content += createCard(elem, linenum,data[i],i); + } + content += "
                        "; + return content; + } + + function createCard(elem, linenum, item, no) { + var line = 12 / linenum; + var card = + '

                        ' + item.title + '

                        ' + item.remark + '
                        ' +item.time + '
                        ' + return card; + } + + function initData(tempData, option) { + var data = {}; + data.code = tempData[option.response.statusName]; + data.msg = tempData[option.response.msgName]; + data.count = tempData[option.response.countName]; + var dataList = tempData[option.response.dataName]; + data.data = []; + for (var i = 0; i < dataList.length; i++) { + var item = {}; + item.id = dataList[i][option.request.idName]; + item.image = dataList[i][option.request.imageName]; + item.title = dataList[i][option.request.titleName]; + item.remark = dataList[i][option.request.remarkName]; + item.time = dataList[i][option.request.timeName]; + data.data.push(item); + } + return data; + } + + function getData(url) { + var defer = $.Deferred(); + $.get(url + "?fresh=" + Math.random(), function(result) { + defer.resolve(result) + }); + return defer.promise(); + } + + window.cardTableCheckedCard = function (elem,obj) { + $(obj).addClass('layui-table-click').siblings().removeClass('layui-table-click'); + var item = {}; + item.id = obj.id; + item.image = $(obj).find('.project-list-item-cover')[0].src; + item.title = $(obj).find('h2')[0].innerHTML; + item.remark = $(obj).find('.project-list-item-text')[0].innerHTML; + item.time = $(obj).find('.time')[0].innerHTML; + _instances[elem.id].option.checkedItem = item; + _instances[elem.id].option.clickItem(item); + } + + /** 对外提供的方法 */ + var tt = { + + render: function (options) { + return new card(options); + }, + + reload: function (id, opt) { + _instances[id].option.checkedItem = null; + _instances[id].reload(opt); + }, + + getChecked: function (id) { + var option = _instances[id].option; + var data = option.checkedItem; + var item = {}; + if (!data) { + return null; + } + item[option.request.idName] = data.id; + item[option.request.imageName] = data.image; + item[option.request.titleName] = data.title; + item[option.request.remarkName] = data.remark; + item[option.request.timeName] = data.time; + return item; + }, + + getAllData: function (id) { + var option = _instances[id].option; + var data = []; + for (var i = 0; i < option.data.length; i++) { + var item = {}; + item[option.request.idName] = option.data[i].id; + item[option.request.imageName] = option.data[i].image; + item[option.request.titleName] = option.data[i].title; + item[option.request.remarkName] = option.data[i].remark; + item[option.request.timeName] = option.data[i].time; + data.push(item); + } + return data; + }, + } + + exports(MOD_NAME, tt); +}) \ No newline at end of file diff --git a/static/component/pear/module/common.js b/static/component/pear/module/common.js new file mode 100644 index 000000000..6f1eac8c4 --- /dev/null +++ b/static/component/pear/module/common.js @@ -0,0 +1,71 @@ +layui.define(['jquery', 'element','table'], function(exports) { + "use strict"; + + /** + * 常用封装类 + * */ + var MOD_NAME = 'common', + $ = layui.jquery, + table = layui.table, + element = layui.element; + + var common = new function() { + + /** + * 获取当前表格选中字段 + * @param obj 表格回调参数 + * @param field 要获取的字段 + * */ + this.checkField = function(obj, field) { + let data = table.checkStatus(obj.config.id).data; + if (data.length === 0) { + return ""; + } + let ids = ""; + for (let i = 0; i < data.length; i++) { + ids += data[i][field] + ","; + } + ids = ids.substr(0, ids.length - 1); + return ids; + } + + /** + * 当前是否为与移动端 + * */ + this.isModile = function(){ + if ($(window).width() <= 768) { + return true; + } + return false; + } + + + /** + * 提交 json 数据 + * @param data 提交数据 + * @param href 提交接口 + * @param table 刷新父级表 + * + * */ + this.submit = function(data,href,table,callback){ + $.ajax({ + url:href, + data:JSON.stringify(data), + dataType:'json', + contentType:'application/json', + type:'post', + success:callback !=null?callback(result):function(result){ + if(result.success){ + layer.msg(result.msg,{icon:1,time:1000},function(){ + parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页 + parent.layui.table.reload(table); + }); + }else{ + layer.msg(result.msg,{icon:2,time:1000}); + } + } + }) + } + } + exports(MOD_NAME, common); +}); diff --git a/static/component/pear/module/context.js b/static/component/pear/module/context.js new file mode 100644 index 000000000..a803e02b8 --- /dev/null +++ b/static/component/pear/module/context.js @@ -0,0 +1,19 @@ +layui.define(['jquery', 'element'], function(exports) { + "use strict"; + + var MOD_NAME = 'context', + $ = layui.jquery, + element = layui.element; + + var context = new function() { + + this.put = function(key,value){ + localStorage.setItem(key,value); + } + + this.get = function(key){ + return localStorage.getItem(key); + } + } + exports(MOD_NAME, context); +}); diff --git a/static/component/pear/module/convert.js b/static/component/pear/module/convert.js new file mode 100644 index 000000000..1f86ba5af --- /dev/null +++ b/static/component/pear/module/convert.js @@ -0,0 +1,27 @@ +layui.define(['jquery', 'element'], function(exports) { + "use strict"; + + /** + * 类 型 转 换 工 具 类 + * */ + var MOD_NAME = 'convert', + $ = layui.jquery, + element = layui.element; + + var convert = new function() { + + // image 转 base64 + this.imageToBase64 = function(img) { + var canvas = document.createElement("canvas"); + canvas.width = img.width; + canvas.height = img.height; + var ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0, img.width, img.height); + var ext = img.src.substring(img.src.lastIndexOf(".")+1).toLowerCase(); + var dataURL = canvas.toDataURL("image/"+ext); + return dataURL; + } + + } + exports(MOD_NAME, convert); +}); diff --git a/static/component/pear/module/count.js b/static/component/pear/module/count.js new file mode 100644 index 000000000..c9a659f09 --- /dev/null +++ b/static/component/pear/module/count.js @@ -0,0 +1,37 @@ +layui.define(['jquery', 'element'], function(exports) { + "use strict"; + + var MOD_NAME = 'count', + $ = layui.jquery, + element = layui.element; + + var count = new function() { + + this.up = function(targetEle, options) { + + options = options || {}; + + var $this = document.getElementById(targetEle), + time = options.time, + finalNum = options.num, + regulator = options.regulator, + step = finalNum / (time / regulator), + count = 0.00, + initial = 0; + + var timer = setInterval(function() { + count = count + step; + if (count >= finalNum) { + clearInterval(timer); + count = finalNum; + } + var t = count.toFixed(options.bit?options.bit:0);; + if (t == initial) return; + initial = t; + $this.innerHTML = initial; + }, 30); + } + + } + exports(MOD_NAME, count); +}); diff --git a/static/component/pear/module/cropper.js b/static/component/pear/module/cropper.js new file mode 100644 index 000000000..6d774977c --- /dev/null +++ b/static/component/pear/module/cropper.js @@ -0,0 +1,3087 @@ +/*! + * Cropper v3.0.0 + */ + +layui.define(['jquery'], function (exports) { + var $ = layui.jquery; + $ = $ && $.hasOwnProperty('default') ? $['default'] : $; + + var DEFAULTS = { + // Define the view mode of the cropper + viewMode: 0, // 0, 1, 2, 3 + + // Define the dragging mode of the cropper + dragMode: 'crop', // 'crop', 'move' or 'none' + + // Define the aspect ratio of the crop box + aspectRatio: NaN, + + // An object with the previous cropping result data + data: null, + + // A selector for adding extra containers to preview + preview: '', + + // Re-render the cropper when resize the window + responsive: true, + + // Restore the cropped area after resize the window + restore: true, + + // Check if the current image is a cross-origin image + checkCrossOrigin: true, + + // Check the current image's Exif Orientation information + checkOrientation: true, + + // Show the black modal + modal: true, + + // Show the dashed lines for guiding + guides: true, + + // Show the center indicator for guiding + center: true, + + // Show the white modal to highlight the crop box + highlight: true, + + // Show the grid background + background: true, + + // Enable to crop the image automatically when initialize + autoCrop: true, + + // Define the percentage of automatic cropping area when initializes + autoCropArea: 0.8, + + // Enable to move the image + movable: true, + + // Enable to rotate the image + rotatable: true, + + // Enable to scale the image + scalable: true, + + // Enable to zoom the image + zoomable: true, + + // Enable to zoom the image by dragging touch + zoomOnTouch: true, + + // Enable to zoom the image by wheeling mouse + zoomOnWheel: true, + + // Define zoom ratio when zoom the image by wheeling mouse + wheelZoomRatio: 0.1, + + // Enable to move the crop box + cropBoxMovable: true, + + // Enable to resize the crop box + cropBoxResizable: true, + + // Toggle drag mode between "crop" and "move" when click twice on the cropper + toggleDragModeOnDblclick: true, + + // Size limitation + minCanvasWidth: 0, + minCanvasHeight: 0, + minCropBoxWidth: 0, + minCropBoxHeight: 0, + minContainerWidth: 200, + minContainerHeight: 100, + + // Shortcuts of events + ready: null, + cropstart: null, + cropmove: null, + cropend: null, + crop: null, + zoom: null + }; + + var TEMPLATE = '
                        ' + '
                        ' + '
                        ' + '
                        ' + '
                        ' + '
                        ' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
                        ' + '
                        '; + + var REGEXP_DATA_URL_HEAD = /^data:.*,/; + var REGEXP_USERAGENT = /(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i; + var navigator = typeof window !== 'undefined' ? window.navigator : null; + var IS_SAFARI_OR_UIWEBVIEW = navigator && REGEXP_USERAGENT.test(navigator.userAgent); + var fromCharCode = String.fromCharCode; + + function isNumber(n) { + return typeof n === 'number' && !isNaN(n); + } + + function isUndefined(n) { + return typeof n === 'undefined'; + } + + function toArray(obj, offset) { + var args = []; + + // This is necessary for IE8 + if (isNumber(offset)) { + args.push(offset); + } + + return args.slice.apply(obj, args); + } + + // Custom proxy to avoid jQuery's guid + function proxy(fn, context) { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + return function () { + for (var _len2 = arguments.length, args2 = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args2[_key2] = arguments[_key2]; + } + + return fn.apply(context, args.concat(toArray(args2))); + }; + } + + function objectKeys(obj) { + var keys = []; + + $.each(obj, function (key) { + keys.push(key); + }); + + return keys; + } + + function isCrossOriginURL(url) { + var parts = url.match(/^(https?:)\/\/([^:/?#]+):?(\d*)/i); + + return parts && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port); + } + + function addTimestamp(url) { + var timestamp = 'timestamp=' + new Date().getTime(); + + return url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp; + } + + function getImageSize(image, callback) { + // Modern browsers (ignore Safari, #120 & #509) + if (image.naturalWidth && !IS_SAFARI_OR_UIWEBVIEW) { + callback(image.naturalWidth, image.naturalHeight); + return; + } + + // IE8: Don't use `new Image()` here (#319) + var newImage = document.createElement('img'); + + newImage.onload = function load() { + callback(this.width, this.height); + }; + + newImage.src = image.src; + } + + function getTransform(options) { + var transforms = []; + var translateX = options.translateX; + var translateY = options.translateY; + var rotate = options.rotate; + var scaleX = options.scaleX; + var scaleY = options.scaleY; + + if (isNumber(translateX) && translateX !== 0) { + transforms.push('translateX(' + translateX + 'px)'); + } + + if (isNumber(translateY) && translateY !== 0) { + transforms.push('translateY(' + translateY + 'px)'); + } + + // Rotate should come first before scale to match orientation transform + if (isNumber(rotate) && rotate !== 0) { + transforms.push('rotate(' + rotate + 'deg)'); + } + + if (isNumber(scaleX) && scaleX !== 1) { + transforms.push('scaleX(' + scaleX + ')'); + } + + if (isNumber(scaleY) && scaleY !== 1) { + transforms.push('scaleY(' + scaleY + ')'); + } + + return transforms.length ? transforms.join(' ') : 'none'; + } + + function getRotatedSizes(data, isReversed) { + var deg = Math.abs(data.degree) % 180; + var arc = (deg > 90 ? 180 - deg : deg) * Math.PI / 180; + var sinArc = Math.sin(arc); + var cosArc = Math.cos(arc); + var width = data.width; + var height = data.height; + var aspectRatio = data.aspectRatio; + var newWidth = void 0; + var newHeight = void 0; + + if (!isReversed) { + newWidth = width * cosArc + height * sinArc; + newHeight = width * sinArc + height * cosArc; + } else { + newWidth = width / (cosArc + sinArc / aspectRatio); + newHeight = newWidth / aspectRatio; + } + + return { + width: newWidth, + height: newHeight + }; + } + + function getSourceCanvas(image, data, options) { + var canvas = $('')[0]; + var context = canvas.getContext('2d'); + var dstX = 0; + var dstY = 0; + var dstWidth = data.naturalWidth; + var dstHeight = data.naturalHeight; + var rotate = data.rotate; + var scaleX = data.scaleX; + var scaleY = data.scaleY; + var scalable = isNumber(scaleX) && isNumber(scaleY) && (scaleX !== 1 || scaleY !== 1); + var rotatable = isNumber(rotate) && rotate !== 0; + var advanced = rotatable || scalable; + var canvasWidth = dstWidth * Math.abs(scaleX || 1); + var canvasHeight = dstHeight * Math.abs(scaleY || 1); + var translateX = void 0; + var translateY = void 0; + var rotated = void 0; + + if (scalable) { + translateX = canvasWidth / 2; + translateY = canvasHeight / 2; + } + + if (rotatable) { + rotated = getRotatedSizes({ + width: canvasWidth, + height: canvasHeight, + degree: rotate + }); + + canvasWidth = rotated.width; + canvasHeight = rotated.height; + translateX = canvasWidth / 2; + translateY = canvasHeight / 2; + } + + canvas.width = canvasWidth; + canvas.height = canvasHeight; + + if (options.fillColor) { + context.fillStyle = options.fillColor; + context.fillRect(0, 0, canvasWidth, canvasHeight); + } + + if (advanced) { + dstX = -dstWidth / 2; + dstY = -dstHeight / 2; + + context.save(); + context.translate(translateX, translateY); + } + + // Rotate should come first before scale as in the "getTransform" function + if (rotatable) { + context.rotate(rotate * Math.PI / 180); + } + + if (scalable) { + context.scale(scaleX, scaleY); + } + + context.imageSmoothingEnabled = !!options.imageSmoothingEnabled; + + if (options.imageSmoothingQuality) { + context.imageSmoothingQuality = options.imageSmoothingQuality; + } + + context.drawImage(image, Math.floor(dstX), Math.floor(dstY), Math.floor(dstWidth), Math.floor(dstHeight)); + + if (advanced) { + context.restore(); + } + + return canvas; + } + + function getStringFromCharCode(dataView, start, length) { + var str = ''; + var i = void 0; + + for (i = start, length += start; i < length; i += 1) { + str += fromCharCode(dataView.getUint8(i)); + } + + return str; + } + + function getOrientation(arrayBuffer) { + var dataView = new DataView(arrayBuffer); + var length = dataView.byteLength; + var orientation = void 0; + var exifIDCode = void 0; + var tiffOffset = void 0; + var firstIFDOffset = void 0; + var littleEndian = void 0; + var endianness = void 0; + var app1Start = void 0; + var ifdStart = void 0; + var offset = void 0; + var i = void 0; + + // Only handle JPEG image (start by 0xFFD8) + if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) { + offset = 2; + + while (offset < length) { + if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) { + app1Start = offset; + break; + } + + offset += 1; + } + } + + if (app1Start) { + exifIDCode = app1Start + 4; + tiffOffset = app1Start + 10; + + if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') { + endianness = dataView.getUint16(tiffOffset); + littleEndian = endianness === 0x4949; + + if (littleEndian || endianness === 0x4D4D /* bigEndian */) { + if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) { + firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian); + + if (firstIFDOffset >= 0x00000008) { + ifdStart = tiffOffset + firstIFDOffset; + } + } + } + } + } + + if (ifdStart) { + length = dataView.getUint16(ifdStart, littleEndian); + + for (i = 0; i < length; i += 1) { + offset = ifdStart + i * 12 + 2; + + if (dataView.getUint16(offset, littleEndian) === 0x0112 /* Orientation */) { + // 8 is the offset of the current tag's value + offset += 8; + + // Get the original orientation value + orientation = dataView.getUint16(offset, littleEndian); + + // Override the orientation with its default value for Safari (#120) + if (IS_SAFARI_OR_UIWEBVIEW) { + dataView.setUint16(offset, 1, littleEndian); + } + + break; + } + } + } + + return orientation; + } + + function dataURLToArrayBuffer(dataURL) { + var base64 = dataURL.replace(REGEXP_DATA_URL_HEAD, ''); + var binary = atob(base64); + var length = binary.length; + var arrayBuffer = new ArrayBuffer(length); + var dataView = new Uint8Array(arrayBuffer); + var i = void 0; + + for (i = 0; i < length; i += 1) { + dataView[i] = binary.charCodeAt(i); + } + + return arrayBuffer; + } + + // Only available for JPEG image + function arrayBufferToDataURL(arrayBuffer) { + var dataView = new Uint8Array(arrayBuffer); + var length = dataView.length; + var base64 = ''; + var i = void 0; + + for (i = 0; i < length; i += 1) { + base64 += fromCharCode(dataView[i]); + } + + return 'data:image/jpeg;base64,' + btoa(base64); + } + + var render = { + render: function render() { + var self = this; + + self.initContainer(); + self.initCanvas(); + self.initCropBox(); + + self.renderCanvas(); + + if (self.cropped) { + self.renderCropBox(); + } + }, + initContainer: function initContainer() { + var self = this; + var options = self.options; + var $this = self.$element; + var $container = self.$container; + var $cropper = self.$cropper; + var hidden = 'cropper-hidden'; + + $cropper.addClass(hidden); + $this.removeClass(hidden); + + $cropper.css(self.container = { + width: Math.max($container.width(), Number(options.minContainerWidth) || 200), + height: Math.max($container.height(), Number(options.minContainerHeight) || 100) + }); + + $this.addClass(hidden); + $cropper.removeClass(hidden); + }, + + + // Canvas (image wrapper) + initCanvas: function initCanvas() { + var self = this; + var viewMode = self.options.viewMode; + var container = self.container; + var containerWidth = container.width; + var containerHeight = container.height; + var image = self.image; + var imageNaturalWidth = image.naturalWidth; + var imageNaturalHeight = image.naturalHeight; + var is90Degree = Math.abs(image.rotate) % 180 === 90; + var naturalWidth = is90Degree ? imageNaturalHeight : imageNaturalWidth; + var naturalHeight = is90Degree ? imageNaturalWidth : imageNaturalHeight; + var aspectRatio = naturalWidth / naturalHeight; + var canvasWidth = containerWidth; + var canvasHeight = containerHeight; + + if (containerHeight * aspectRatio > containerWidth) { + if (viewMode === 3) { + canvasWidth = containerHeight * aspectRatio; + } else { + canvasHeight = containerWidth / aspectRatio; + } + } else if (viewMode === 3) { + canvasHeight = containerWidth / aspectRatio; + } else { + canvasWidth = containerHeight * aspectRatio; + } + + var canvas = { + naturalWidth: naturalWidth, + naturalHeight: naturalHeight, + aspectRatio: aspectRatio, + width: canvasWidth, + height: canvasHeight + }; + + canvas.left = (containerWidth - canvasWidth) / 2; + canvas.top = (containerHeight - canvasHeight) / 2; + canvas.oldLeft = canvas.left; + canvas.oldTop = canvas.top; + + self.canvas = canvas; + self.limited = viewMode === 1 || viewMode === 2; + self.limitCanvas(true, true); + self.initialImage = $.extend({}, image); + self.initialCanvas = $.extend({}, canvas); + }, + limitCanvas: function limitCanvas(isSizeLimited, isPositionLimited) { + var self = this; + var options = self.options; + var viewMode = options.viewMode; + var container = self.container; + var containerWidth = container.width; + var containerHeight = container.height; + var canvas = self.canvas; + var aspectRatio = canvas.aspectRatio; + var cropBox = self.cropBox; + var cropped = self.cropped && cropBox; + + if (isSizeLimited) { + var minCanvasWidth = Number(options.minCanvasWidth) || 0; + var minCanvasHeight = Number(options.minCanvasHeight) || 0; + + if (viewMode) { + if (viewMode > 1) { + minCanvasWidth = Math.max(minCanvasWidth, containerWidth); + minCanvasHeight = Math.max(minCanvasHeight, containerHeight); + + if (viewMode === 3) { + if (minCanvasHeight * aspectRatio > minCanvasWidth) { + minCanvasWidth = minCanvasHeight * aspectRatio; + } else { + minCanvasHeight = minCanvasWidth / aspectRatio; + } + } + } else if (minCanvasWidth) { + minCanvasWidth = Math.max(minCanvasWidth, cropped ? cropBox.width : 0); + } else if (minCanvasHeight) { + minCanvasHeight = Math.max(minCanvasHeight, cropped ? cropBox.height : 0); + } else if (cropped) { + minCanvasWidth = cropBox.width; + minCanvasHeight = cropBox.height; + + if (minCanvasHeight * aspectRatio > minCanvasWidth) { + minCanvasWidth = minCanvasHeight * aspectRatio; + } else { + minCanvasHeight = minCanvasWidth / aspectRatio; + } + } + } + + if (minCanvasWidth && minCanvasHeight) { + if (minCanvasHeight * aspectRatio > minCanvasWidth) { + minCanvasHeight = minCanvasWidth / aspectRatio; + } else { + minCanvasWidth = minCanvasHeight * aspectRatio; + } + } else if (minCanvasWidth) { + minCanvasHeight = minCanvasWidth / aspectRatio; + } else if (minCanvasHeight) { + minCanvasWidth = minCanvasHeight * aspectRatio; + } + + canvas.minWidth = minCanvasWidth; + canvas.minHeight = minCanvasHeight; + canvas.maxWidth = Infinity; + canvas.maxHeight = Infinity; + } + + if (isPositionLimited) { + if (viewMode) { + var newCanvasLeft = containerWidth - canvas.width; + var newCanvasTop = containerHeight - canvas.height; + + canvas.minLeft = Math.min(0, newCanvasLeft); + canvas.minTop = Math.min(0, newCanvasTop); + canvas.maxLeft = Math.max(0, newCanvasLeft); + canvas.maxTop = Math.max(0, newCanvasTop); + + if (cropped && self.limited) { + canvas.minLeft = Math.min(cropBox.left, cropBox.left + cropBox.width - canvas.width); + canvas.minTop = Math.min(cropBox.top, cropBox.top + cropBox.height - canvas.height); + canvas.maxLeft = cropBox.left; + canvas.maxTop = cropBox.top; + + if (viewMode === 2) { + if (canvas.width >= containerWidth) { + canvas.minLeft = Math.min(0, newCanvasLeft); + canvas.maxLeft = Math.max(0, newCanvasLeft); + } + + if (canvas.height >= containerHeight) { + canvas.minTop = Math.min(0, newCanvasTop); + canvas.maxTop = Math.max(0, newCanvasTop); + } + } + } + } else { + canvas.minLeft = -canvas.width; + canvas.minTop = -canvas.height; + canvas.maxLeft = containerWidth; + canvas.maxTop = containerHeight; + } + } + }, + renderCanvas: function renderCanvas(isChanged) { + var self = this; + var canvas = self.canvas; + var image = self.image; + var rotate = image.rotate; + var naturalWidth = image.naturalWidth; + var naturalHeight = image.naturalHeight; + + if (self.rotated) { + self.rotated = false; + + // Computes rotated sizes with image sizes + var rotated = getRotatedSizes({ + width: image.width, + height: image.height, + degree: rotate + }); + var aspectRatio = rotated.width / rotated.height; + var isSquareImage = image.aspectRatio === 1; + + if (isSquareImage || aspectRatio !== canvas.aspectRatio) { + canvas.left -= (rotated.width - canvas.width) / 2; + canvas.top -= (rotated.height - canvas.height) / 2; + canvas.width = rotated.width; + canvas.height = rotated.height; + canvas.aspectRatio = aspectRatio; + canvas.naturalWidth = naturalWidth; + canvas.naturalHeight = naturalHeight; + + // Computes rotated sizes with natural image sizes + if (isSquareImage && rotate % 90 || rotate % 180) { + var rotated2 = getRotatedSizes({ + width: naturalWidth, + height: naturalHeight, + degree: rotate + }); + + canvas.naturalWidth = rotated2.width; + canvas.naturalHeight = rotated2.height; + } + + self.limitCanvas(true, false); + } + } + + if (canvas.width > canvas.maxWidth || canvas.width < canvas.minWidth) { + canvas.left = canvas.oldLeft; + } + + if (canvas.height > canvas.maxHeight || canvas.height < canvas.minHeight) { + canvas.top = canvas.oldTop; + } + + canvas.width = Math.min(Math.max(canvas.width, canvas.minWidth), canvas.maxWidth); + canvas.height = Math.min(Math.max(canvas.height, canvas.minHeight), canvas.maxHeight); + + self.limitCanvas(false, true); + + canvas.left = Math.min(Math.max(canvas.left, canvas.minLeft), canvas.maxLeft); + canvas.top = Math.min(Math.max(canvas.top, canvas.minTop), canvas.maxTop); + canvas.oldLeft = canvas.left; + canvas.oldTop = canvas.top; + + self.$canvas.css({ + width: canvas.width, + height: canvas.height, + transform: getTransform({ + translateX: canvas.left, + translateY: canvas.top + }) + }); + + self.renderImage(); + + if (self.cropped && self.limited) { + self.limitCropBox(true, true); + } + + if (isChanged) { + self.output(); + } + }, + renderImage: function renderImage(isChanged) { + var self = this; + var canvas = self.canvas; + var image = self.image; + var reversed = void 0; + + if (image.rotate) { + reversed = getRotatedSizes({ + width: canvas.width, + height: canvas.height, + degree: image.rotate, + aspectRatio: image.aspectRatio + }, true); + } + + $.extend(image, reversed ? { + width: reversed.width, + height: reversed.height, + left: (canvas.width - reversed.width) / 2, + top: (canvas.height - reversed.height) / 2 + } : { + width: canvas.width, + height: canvas.height, + left: 0, + top: 0 + }); + + self.$clone.css({ + width: image.width, + height: image.height, + transform: getTransform($.extend({ + translateX: image.left, + translateY: image.top + }, image)) + }); + + if (isChanged) { + self.output(); + } + }, + initCropBox: function initCropBox() { + var self = this; + var options = self.options; + var canvas = self.canvas; + var aspectRatio = options.aspectRatio; + var autoCropArea = Number(options.autoCropArea) || 0.8; + var cropBox = { + width: canvas.width, + height: canvas.height + }; + + if (aspectRatio) { + if (canvas.height * aspectRatio > canvas.width) { + cropBox.height = cropBox.width / aspectRatio; + } else { + cropBox.width = cropBox.height * aspectRatio; + } + } + + self.cropBox = cropBox; + self.limitCropBox(true, true); + + // Initialize auto crop area + cropBox.width = Math.min(Math.max(cropBox.width, cropBox.minWidth), cropBox.maxWidth); + cropBox.height = Math.min(Math.max(cropBox.height, cropBox.minHeight), cropBox.maxHeight); + + // The width of auto crop area must large than "minWidth", and the height too. (#164) + cropBox.width = Math.max(cropBox.minWidth, cropBox.width * autoCropArea); + cropBox.height = Math.max(cropBox.minHeight, cropBox.height * autoCropArea); + cropBox.left = canvas.left + (canvas.width - cropBox.width) / 2; + cropBox.top = canvas.top + (canvas.height - cropBox.height) / 2; + cropBox.oldLeft = cropBox.left; + cropBox.oldTop = cropBox.top; + + self.initialCropBox = $.extend({}, cropBox); + }, + limitCropBox: function limitCropBox(isSizeLimited, isPositionLimited) { + var self = this; + var options = self.options; + var aspectRatio = options.aspectRatio; + var container = self.container; + var containerWidth = container.width; + var containerHeight = container.height; + var canvas = self.canvas; + var cropBox = self.cropBox; + var limited = self.limited; + + if (isSizeLimited) { + var minCropBoxWidth = Number(options.minCropBoxWidth) || 0; + var minCropBoxHeight = Number(options.minCropBoxHeight) || 0; + var maxCropBoxWidth = Math.min(containerWidth, limited ? canvas.width : containerWidth); + var maxCropBoxHeight = Math.min(containerHeight, limited ? canvas.height : containerHeight); + + // The min/maxCropBoxWidth/Height must be less than containerWidth/Height + minCropBoxWidth = Math.min(minCropBoxWidth, containerWidth); + minCropBoxHeight = Math.min(minCropBoxHeight, containerHeight); + + if (aspectRatio) { + if (minCropBoxWidth && minCropBoxHeight) { + if (minCropBoxHeight * aspectRatio > minCropBoxWidth) { + minCropBoxHeight = minCropBoxWidth / aspectRatio; + } else { + minCropBoxWidth = minCropBoxHeight * aspectRatio; + } + } else if (minCropBoxWidth) { + minCropBoxHeight = minCropBoxWidth / aspectRatio; + } else if (minCropBoxHeight) { + minCropBoxWidth = minCropBoxHeight * aspectRatio; + } + + if (maxCropBoxHeight * aspectRatio > maxCropBoxWidth) { + maxCropBoxHeight = maxCropBoxWidth / aspectRatio; + } else { + maxCropBoxWidth = maxCropBoxHeight * aspectRatio; + } + } + + // The minWidth/Height must be less than maxWidth/Height + cropBox.minWidth = Math.min(minCropBoxWidth, maxCropBoxWidth); + cropBox.minHeight = Math.min(minCropBoxHeight, maxCropBoxHeight); + cropBox.maxWidth = maxCropBoxWidth; + cropBox.maxHeight = maxCropBoxHeight; + } + + if (isPositionLimited) { + if (limited) { + cropBox.minLeft = Math.max(0, canvas.left); + cropBox.minTop = Math.max(0, canvas.top); + cropBox.maxLeft = Math.min(containerWidth, canvas.left + canvas.width) - cropBox.width; + cropBox.maxTop = Math.min(containerHeight, canvas.top + canvas.height) - cropBox.height; + } else { + cropBox.minLeft = 0; + cropBox.minTop = 0; + cropBox.maxLeft = containerWidth - cropBox.width; + cropBox.maxTop = containerHeight - cropBox.height; + } + } + }, + renderCropBox: function renderCropBox() { + var self = this; + var options = self.options; + var container = self.container; + var containerWidth = container.width; + var containerHeight = container.height; + var cropBox = self.cropBox; + + if (cropBox.width > cropBox.maxWidth || cropBox.width < cropBox.minWidth) { + cropBox.left = cropBox.oldLeft; + } + + if (cropBox.height > cropBox.maxHeight || cropBox.height < cropBox.minHeight) { + cropBox.top = cropBox.oldTop; + } + + cropBox.width = Math.min(Math.max(cropBox.width, cropBox.minWidth), cropBox.maxWidth); + cropBox.height = Math.min(Math.max(cropBox.height, cropBox.minHeight), cropBox.maxHeight); + + self.limitCropBox(false, true); + + cropBox.left = Math.min(Math.max(cropBox.left, cropBox.minLeft), cropBox.maxLeft); + cropBox.top = Math.min(Math.max(cropBox.top, cropBox.minTop), cropBox.maxTop); + cropBox.oldLeft = cropBox.left; + cropBox.oldTop = cropBox.top; + + if (options.movable && options.cropBoxMovable) { + // Turn to move the canvas when the crop box is equal to the container + self.$face.data('action', cropBox.width === containerWidth && cropBox.height === containerHeight ? 'move' : 'all'); + } + + self.$cropBox.css({ + width: cropBox.width, + height: cropBox.height, + transform: getTransform({ + translateX: cropBox.left, + translateY: cropBox.top + }) + }); + + if (self.cropped && self.limited) { + self.limitCanvas(true, true); + } + + if (!self.disabled) { + self.output(); + } + }, + output: function output() { + var self = this; + + self.preview(); + + if (self.completed) { + self.trigger('crop', self.getData()); + } + } + }; + + var DATA_PREVIEW = 'preview'; + + var preview = { + initPreview: function initPreview() { + var self = this; + var crossOrigin = self.crossOrigin; + var url = crossOrigin ? self.crossOriginUrl : self.url; + var image = document.createElement('img'); + + if (crossOrigin) { + image.crossOrigin = crossOrigin; + } + + image.src = url; + + var $clone2 = $(image); + + self.$preview = $(self.options.preview); + self.$clone2 = $clone2; + self.$viewBox.html($clone2); + self.$preview.each(function (i, element) { + var $this = $(element); + var img = document.createElement('img'); + + // Save the original size for recover + $this.data(DATA_PREVIEW, { + width: $this.width(), + height: $this.height(), + html: $this.html() + }); + + if (crossOrigin) { + img.crossOrigin = crossOrigin; + } + + img.src = url; + + /** + * Override img element styles + * Add `display:block` to avoid margin top issue + * Add `height:auto` to override `height` attribute on IE8 + * (Occur only when margin-top <= -height) + */ + img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;"'; + + $this.html(img); + }); + }, + resetPreview: function resetPreview() { + this.$preview.each(function (i, element) { + var $this = $(element); + var data = $this.data(DATA_PREVIEW); + + $this.css({ + width: data.width, + height: data.height + }).html(data.html).removeData(DATA_PREVIEW); + }); + }, + preview: function preview() { + var self = this; + var image = self.image; + var canvas = self.canvas; + var cropBox = self.cropBox; + var cropBoxWidth = cropBox.width; + var cropBoxHeight = cropBox.height; + var width = image.width; + var height = image.height; + var left = cropBox.left - canvas.left - image.left; + var top = cropBox.top - canvas.top - image.top; + + if (!self.cropped || self.disabled) { + return; + } + + self.$clone2.css({ + width: width, + height: height, + transform: getTransform($.extend({ + translateX: -left, + translateY: -top + }, image)) + }); + + self.$preview.each(function (i, element) { + var $this = $(element); + var data = $this.data(DATA_PREVIEW); + var originalWidth = data.width; + var originalHeight = data.height; + var newWidth = originalWidth; + var newHeight = originalHeight; + var ratio = 1; + + if (cropBoxWidth) { + ratio = originalWidth / cropBoxWidth; + newHeight = cropBoxHeight * ratio; + } + + if (cropBoxHeight && newHeight > originalHeight) { + ratio = originalHeight / cropBoxHeight; + newWidth = cropBoxWidth * ratio; + newHeight = originalHeight; + } + + $this.css({ + width: newWidth, + height: newHeight + }).find('img').css({ + width: width * ratio, + height: height * ratio, + transform: getTransform($.extend({ + translateX: -left * ratio, + translateY: -top * ratio + }, image)) + }); + }); + } + }; + + // Globals + var PointerEvent = typeof window !== 'undefined' ? window.PointerEvent : null; + + // Events + var EVENT_POINTER_DOWN = PointerEvent ? 'pointerdown' : 'touchstart mousedown'; + var EVENT_POINTER_MOVE = PointerEvent ? 'pointermove' : 'touchmove mousemove'; + var EVENT_POINTER_UP = PointerEvent ? ' pointerup pointercancel' : 'touchend touchcancel mouseup'; + var EVENT_WHEEL = 'wheel mousewheel DOMMouseScroll'; + var EVENT_DBLCLICK = 'dblclick'; + var EVENT_RESIZE = 'resize'; + var EVENT_CROP_START = 'cropstart'; + var EVENT_CROP_MOVE = 'cropmove'; + var EVENT_CROP_END = 'cropend'; + var EVENT_CROP = 'crop'; + var EVENT_ZOOM = 'zoom'; + + var events = { + bind: function bind() { + var self = this; + var options = self.options; + var $this = self.$element; + var $cropper = self.$cropper; + + if ($.isFunction(options.cropstart)) { + $this.on(EVENT_CROP_START, options.cropstart); + } + + if ($.isFunction(options.cropmove)) { + $this.on(EVENT_CROP_MOVE, options.cropmove); + } + + if ($.isFunction(options.cropend)) { + $this.on(EVENT_CROP_END, options.cropend); + } + + if ($.isFunction(options.crop)) { + $this.on(EVENT_CROP, options.crop); + } + + if ($.isFunction(options.zoom)) { + $this.on(EVENT_ZOOM, options.zoom); + } + + $cropper.on(EVENT_POINTER_DOWN, proxy(self.cropStart, this)); + + if (options.zoomable && options.zoomOnWheel) { + $cropper.on(EVENT_WHEEL, proxy(self.wheel, this)); + } + + if (options.toggleDragModeOnDblclick) { + $cropper.on(EVENT_DBLCLICK, proxy(self.dblclick, this)); + } + + $(document).on(EVENT_POINTER_MOVE, self.onCropMove = proxy(self.cropMove, this)).on(EVENT_POINTER_UP, self.onCropEnd = proxy(self.cropEnd, this)); + + if (options.responsive) { + $(window).on(EVENT_RESIZE, self.onResize = proxy(self.resize, this)); + } + }, + unbind: function unbind() { + var self = this; + var options = self.options; + var $this = self.$element; + var $cropper = self.$cropper; + + if ($.isFunction(options.cropstart)) { + $this.off(EVENT_CROP_START, options.cropstart); + } + + if ($.isFunction(options.cropmove)) { + $this.off(EVENT_CROP_MOVE, options.cropmove); + } + + if ($.isFunction(options.cropend)) { + $this.off(EVENT_CROP_END, options.cropend); + } + + if ($.isFunction(options.crop)) { + $this.off(EVENT_CROP, options.crop); + } + + if ($.isFunction(options.zoom)) { + $this.off(EVENT_ZOOM, options.zoom); + } + + $cropper.off(EVENT_POINTER_DOWN, self.cropStart); + + if (options.zoomable && options.zoomOnWheel) { + $cropper.off(EVENT_WHEEL, self.wheel); + } + + if (options.toggleDragModeOnDblclick) { + $cropper.off(EVENT_DBLCLICK, self.dblclick); + } + + $(document).off(EVENT_POINTER_MOVE, self.onCropMove).off(EVENT_POINTER_UP, self.onCropEnd); + + if (options.responsive) { + $(window).off(EVENT_RESIZE, self.onResize); + } + } + }; + + var REGEXP_ACTIONS = /^(e|w|s|n|se|sw|ne|nw|all|crop|move|zoom)$/; + + function getPointer(_ref, endOnly) { + var pageX = _ref.pageX, + pageY = _ref.pageY; + + var end = { + endX: pageX, + endY: pageY + }; + + if (endOnly) { + return end; + } + + return $.extend({ + startX: pageX, + startY: pageY + }, end); + } + + var handlers = { + resize: function resize() { + var self = this; + var options = self.options; + var $container = self.$container; + var container = self.container; + var minContainerWidth = Number(options.minContainerWidth) || 200; + var minContainerHeight = Number(options.minContainerHeight) || 100; + + if (self.disabled || container.width === minContainerWidth || container.height === minContainerHeight) { + return; + } + + var ratio = $container.width() / container.width; + + // Resize when width changed or height changed + if (ratio !== 1 || $container.height() !== container.height) { + var canvasData = void 0; + var cropBoxData = void 0; + + if (options.restore) { + canvasData = self.getCanvasData(); + cropBoxData = self.getCropBoxData(); + } + + self.render(); + + if (options.restore) { + self.setCanvasData($.each(canvasData, function (i, n) { + canvasData[i] = n * ratio; + })); + self.setCropBoxData($.each(cropBoxData, function (i, n) { + cropBoxData[i] = n * ratio; + })); + } + } + }, + dblclick: function dblclick() { + var self = this; + + if (self.disabled || self.options.dragMode === 'none') { + return; + } + + self.setDragMode(self.$dragBox.hasClass('cropper-crop') ? 'move' : 'crop'); + }, + wheel: function wheel(event) { + var self = this; + var e = event.originalEvent || event; + var ratio = Number(self.options.wheelZoomRatio) || 0.1; + + if (self.disabled) { + return; + } + + event.preventDefault(); + + // Limit wheel speed to prevent zoom too fast + if (self.wheeling) { + return; + } + + self.wheeling = true; + + setTimeout(function () { + self.wheeling = false; + }, 50); + + var delta = 1; + + if (e.deltaY) { + delta = e.deltaY > 0 ? 1 : -1; + } else if (e.wheelDelta) { + delta = -e.wheelDelta / 120; + } else if (e.detail) { + delta = e.detail > 0 ? 1 : -1; + } + + self.zoom(-delta * ratio, event); + }, + cropStart: function cropStart(e) { + var self = this; + + if (self.disabled) { + return; + } + + var options = self.options; + var pointers = self.pointers; + var originalEvent = e.originalEvent; + var action = void 0; + + if (originalEvent && originalEvent.changedTouches) { + // Handle touch event + $.each(originalEvent.changedTouches, function (i, touch) { + pointers[touch.identifier] = getPointer(touch); + }); + } else { + // Handle mouse event and pointer event + pointers[originalEvent && originalEvent.pointerId || 0] = getPointer(originalEvent || e); + } + + if (objectKeys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) { + action = 'zoom'; + } else { + action = $(e.target).data('action'); + } + + if (!REGEXP_ACTIONS.test(action)) { + return; + } + + if (self.trigger('cropstart', { + originalEvent: originalEvent, + action: action + }).isDefaultPrevented()) { + return; + } + + e.preventDefault(); + + self.action = action; + self.cropping = false; + + if (action === 'crop') { + self.cropping = true; + self.$dragBox.addClass('cropper-modal'); + } + }, + cropMove: function cropMove(e) { + var self = this; + var action = self.action; + + if (self.disabled || !action) { + return; + } + + var pointers = self.pointers; + var originalEvent = e.originalEvent; + + e.preventDefault(); + + if (self.trigger('cropmove', { + originalEvent: originalEvent, + action: action + }).isDefaultPrevented()) { + return; + } + + if (originalEvent && originalEvent.changedTouches) { + $.each(originalEvent.changedTouches, function (i, touch) { + $.extend(pointers[touch.identifier], getPointer(touch, true)); + }); + } else { + $.extend(pointers[originalEvent && originalEvent.pointerId || 0], getPointer(originalEvent || e, true)); + } + + self.change(e); + }, + cropEnd: function cropEnd(e) { + var self = this; + + if (self.disabled) { + return; + } + + var action = self.action; + var pointers = self.pointers; + var originalEvent = e.originalEvent; + + if (originalEvent && originalEvent.changedTouches) { + $.each(originalEvent.changedTouches, function (i, touch) { + delete pointers[touch.identifier]; + }); + } else { + delete pointers[originalEvent && originalEvent.pointerId || 0]; + } + + if (!action) { + return; + } + + e.preventDefault(); + + if (!objectKeys(pointers).length) { + self.action = ''; + } + + if (self.cropping) { + self.cropping = false; + self.$dragBox.toggleClass('cropper-modal', self.cropped && self.options.modal); + } + + self.trigger('cropend', { + originalEvent: originalEvent, + action: action + }); + } + }; + + // Actions + var ACTION_EAST = 'e'; + var ACTION_WEST = 'w'; + var ACTION_SOUTH = 's'; + var ACTION_NORTH = 'n'; + var ACTION_SOUTH_EAST = 'se'; + var ACTION_SOUTH_WEST = 'sw'; + var ACTION_NORTH_EAST = 'ne'; + var ACTION_NORTH_WEST = 'nw'; + + function getMaxZoomRatio(pointers) { + var pointers2 = $.extend({}, pointers); + var ratios = []; + + $.each(pointers, function (pointerId, pointer) { + delete pointers2[pointerId]; + + $.each(pointers2, function (pointerId2, pointer2) { + var x1 = Math.abs(pointer.startX - pointer2.startX); + var y1 = Math.abs(pointer.startY - pointer2.startY); + var x2 = Math.abs(pointer.endX - pointer2.endX); + var y2 = Math.abs(pointer.endY - pointer2.endY); + var z1 = Math.sqrt(x1 * x1 + y1 * y1); + var z2 = Math.sqrt(x2 * x2 + y2 * y2); + var ratio = (z2 - z1) / z1; + + ratios.push(ratio); + }); + }); + + ratios.sort(function (a, b) { + return Math.abs(a) < Math.abs(b); + }); + + return ratios[0]; + } + + var change = { + change: function change(e) { + var self = this; + var options = self.options; + var pointers = self.pointers; + var pointer = pointers[objectKeys(pointers)[0]]; + var container = self.container; + var canvas = self.canvas; + var cropBox = self.cropBox; + var action = self.action; + var aspectRatio = options.aspectRatio; + var width = cropBox.width; + var height = cropBox.height; + var left = cropBox.left; + var top = cropBox.top; + var right = left + width; + var bottom = top + height; + var minLeft = 0; + var minTop = 0; + var maxWidth = container.width; + var maxHeight = container.height; + var renderable = true; + var offset = void 0; + + // Locking aspect ratio in "free mode" by holding shift key (#259) + if (!aspectRatio && e.shiftKey) { + aspectRatio = width && height ? width / height : 1; + } + + if (self.limited) { + minLeft = cropBox.minLeft; + minTop = cropBox.minTop; + maxWidth = minLeft + Math.min(container.width, canvas.width, canvas.left + canvas.width); + maxHeight = minTop + Math.min(container.height, canvas.height, canvas.top + canvas.height); + } + + var range = { + x: pointer.endX - pointer.startX, + y: pointer.endY - pointer.startY + }; + + switch (action) { + // Move crop box + case 'all': + left += range.x; + top += range.y; + break; + + // Resize crop box + case ACTION_EAST: + if (range.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) { + renderable = false; + break; + } + + if (right + range.x > maxWidth) { + range.x = maxWidth - right; + } + + width += range.x; + + if (aspectRatio) { + height = width / aspectRatio; + top -= range.x / aspectRatio / 2; + } + + if (width < 0) { + action = ACTION_WEST; + width = 0; + } + + break; + + case ACTION_NORTH: + if (range.y <= 0 && (top <= minTop || aspectRatio && (left <= minLeft || right >= maxWidth))) { + renderable = false; + break; + } + + if (top + range.y < minTop) { + range.y = minTop - top; + } + + height -= range.y; + top += range.y; + + if (aspectRatio) { + width = height * aspectRatio; + left += range.y * aspectRatio / 2; + } + + if (height < 0) { + action = ACTION_SOUTH; + height = 0; + } + + break; + + case ACTION_WEST: + if (range.x <= 0 && (left <= minLeft || aspectRatio && (top <= minTop || bottom >= maxHeight))) { + renderable = false; + break; + } + + if (left + range.x < minLeft) { + range.x = minLeft - left; + } + + width -= range.x; + left += range.x; + + if (aspectRatio) { + height = width / aspectRatio; + top += range.x / aspectRatio / 2; + } + + if (width < 0) { + action = ACTION_EAST; + width = 0; + } + + break; + + case ACTION_SOUTH: + if (range.y >= 0 && (bottom >= maxHeight || aspectRatio && (left <= minLeft || right >= maxWidth))) { + renderable = false; + break; + } + + if (bottom + range.y > maxHeight) { + range.y = maxHeight - bottom; + } + + height += range.y; + + if (aspectRatio) { + width = height * aspectRatio; + left -= range.y * aspectRatio / 2; + } + + if (height < 0) { + action = ACTION_NORTH; + height = 0; + } + + break; + + case ACTION_NORTH_EAST: + if (aspectRatio) { + if (range.y <= 0 && (top <= minTop || right >= maxWidth)) { + renderable = false; + break; + } + + height -= range.y; + top += range.y; + width = height * aspectRatio; + } else { + if (range.x >= 0) { + if (right < maxWidth) { + width += range.x; + } else if (range.y <= 0 && top <= minTop) { + renderable = false; + } + } else { + width += range.x; + } + + if (range.y <= 0) { + if (top > minTop) { + height -= range.y; + top += range.y; + } + } else { + height -= range.y; + top += range.y; + } + } + + if (width < 0 && height < 0) { + action = ACTION_SOUTH_WEST; + height = 0; + width = 0; + } else if (width < 0) { + action = ACTION_NORTH_WEST; + width = 0; + } else if (height < 0) { + action = ACTION_SOUTH_EAST; + height = 0; + } + + break; + + case ACTION_NORTH_WEST: + if (aspectRatio) { + if (range.y <= 0 && (top <= minTop || left <= minLeft)) { + renderable = false; + break; + } + + height -= range.y; + top += range.y; + width = height * aspectRatio; + left += range.y * aspectRatio; + } else { + if (range.x <= 0) { + if (left > minLeft) { + width -= range.x; + left += range.x; + } else if (range.y <= 0 && top <= minTop) { + renderable = false; + } + } else { + width -= range.x; + left += range.x; + } + + if (range.y <= 0) { + if (top > minTop) { + height -= range.y; + top += range.y; + } + } else { + height -= range.y; + top += range.y; + } + } + + if (width < 0 && height < 0) { + action = ACTION_SOUTH_EAST; + height = 0; + width = 0; + } else if (width < 0) { + action = ACTION_NORTH_EAST; + width = 0; + } else if (height < 0) { + action = ACTION_SOUTH_WEST; + height = 0; + } + + break; + + case ACTION_SOUTH_WEST: + if (aspectRatio) { + if (range.x <= 0 && (left <= minLeft || bottom >= maxHeight)) { + renderable = false; + break; + } + + width -= range.x; + left += range.x; + height = width / aspectRatio; + } else { + if (range.x <= 0) { + if (left > minLeft) { + width -= range.x; + left += range.x; + } else if (range.y >= 0 && bottom >= maxHeight) { + renderable = false; + } + } else { + width -= range.x; + left += range.x; + } + + if (range.y >= 0) { + if (bottom < maxHeight) { + height += range.y; + } + } else { + height += range.y; + } + } + + if (width < 0 && height < 0) { + action = ACTION_NORTH_EAST; + height = 0; + width = 0; + } else if (width < 0) { + action = ACTION_SOUTH_EAST; + width = 0; + } else if (height < 0) { + action = ACTION_NORTH_WEST; + height = 0; + } + + break; + + case ACTION_SOUTH_EAST: + if (aspectRatio) { + if (range.x >= 0 && (right >= maxWidth || bottom >= maxHeight)) { + renderable = false; + break; + } + + width += range.x; + height = width / aspectRatio; + } else { + if (range.x >= 0) { + if (right < maxWidth) { + width += range.x; + } else if (range.y >= 0 && bottom >= maxHeight) { + renderable = false; + } + } else { + width += range.x; + } + + if (range.y >= 0) { + if (bottom < maxHeight) { + height += range.y; + } + } else { + height += range.y; + } + } + + if (width < 0 && height < 0) { + action = ACTION_NORTH_WEST; + height = 0; + width = 0; + } else if (width < 0) { + action = ACTION_SOUTH_WEST; + width = 0; + } else if (height < 0) { + action = ACTION_NORTH_EAST; + height = 0; + } + + break; + + // Move canvas + case 'move': + self.move(range.x, range.y); + renderable = false; + break; + + // Zoom canvas + case 'zoom': + self.zoom(getMaxZoomRatio(pointers), e.originalEvent); + renderable = false; + break; + + // Create crop box + case 'crop': + if (!range.x || !range.y) { + renderable = false; + break; + } + + offset = self.$cropper.offset(); + left = pointer.startX - offset.left; + top = pointer.startY - offset.top; + width = cropBox.minWidth; + height = cropBox.minHeight; + + if (range.x > 0) { + action = range.y > 0 ? ACTION_SOUTH_EAST : ACTION_NORTH_EAST; + } else if (range.x < 0) { + left -= width; + action = range.y > 0 ? ACTION_SOUTH_WEST : ACTION_NORTH_WEST; + } + + if (range.y < 0) { + top -= height; + } + + // Show the crop box if is hidden + if (!self.cropped) { + self.$cropBox.removeClass('cropper-hidden'); + self.cropped = true; + + if (self.limited) { + self.limitCropBox(true, true); + } + } + + break; + + default: + } + + if (renderable) { + cropBox.width = width; + cropBox.height = height; + cropBox.left = left; + cropBox.top = top; + self.action = action; + self.renderCropBox(); + } + + // Override + $.each(pointers, function (i, p) { + p.startX = p.endX; + p.startY = p.endY; + }); + } + }; + + function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length) ; i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + + function getPointersCenter(pointers) { + var pageX = 0; + var pageY = 0; + var count = 0; + + $.each(pointers, function (i, _ref) { + var startX = _ref.startX, + startY = _ref.startY; + + pageX += startX; + pageY += startY; + count += 1; + }); + + pageX /= count; + pageY /= count; + + return { + pageX: pageX, + pageY: pageY + }; + } + + var methods = { + // Show the crop box manually + crop: function crop() { + var self = this; + + if (!self.ready || self.disabled) { + return; + } + + if (!self.cropped) { + self.cropped = true; + self.limitCropBox(true, true); + + if (self.options.modal) { + self.$dragBox.addClass('cropper-modal'); + } + + self.$cropBox.removeClass('cropper-hidden'); + } + + self.setCropBoxData(self.initialCropBox); + }, + + + // Reset the image and crop box to their initial states + reset: function reset() { + var self = this; + + if (!self.ready || self.disabled) { + return; + } + + self.image = $.extend({}, self.initialImage); + self.canvas = $.extend({}, self.initialCanvas); + self.cropBox = $.extend({}, self.initialCropBox); + + self.renderCanvas(); + + if (self.cropped) { + self.renderCropBox(); + } + }, + + + // Clear the crop box + clear: function clear() { + var self = this; + + if (!self.cropped || self.disabled) { + return; + } + + $.extend(self.cropBox, { + left: 0, + top: 0, + width: 0, + height: 0 + }); + + self.cropped = false; + self.renderCropBox(); + + self.limitCanvas(true, true); + + // Render canvas after crop box rendered + self.renderCanvas(); + + self.$dragBox.removeClass('cropper-modal'); + self.$cropBox.addClass('cropper-hidden'); + }, + + + /** + * Replace the image's src and rebuild the cropper + * + * @param {String} url + * @param {Boolean} onlyColorChanged (optional) + */ + replace: function replace(url, onlyColorChanged) { + var self = this; + + if (!self.disabled && url) { + if (self.isImg) { + self.$element.attr('src', url); + } + + if (onlyColorChanged) { + self.url = url; + self.$clone.attr('src', url); + + if (self.ready) { + self.$preview.find('img').add(self.$clone2).attr('src', url); + } + } else { + if (self.isImg) { + self.replaced = true; + } + + // Clear previous data + self.options.data = null; + self.load(url); + } + } + }, + + + // Enable (unfreeze) the cropper + enable: function enable() { + var self = this; + + if (self.ready) { + self.disabled = false; + self.$cropper.removeClass('cropper-disabled'); + } + }, + + + // Disable (freeze) the cropper + disable: function disable() { + var self = this; + + if (self.ready) { + self.disabled = true; + self.$cropper.addClass('cropper-disabled'); + } + }, + + + // Destroy the cropper and remove the instance from the image + destroy: function destroy() { + var self = this; + var $this = self.$element; + + if (self.loaded) { + if (self.isImg && self.replaced) { + $this.attr('src', self.originalUrl); + } + + self.unbuild(); + $this.removeClass('cropper-hidden'); + } else if (self.isImg) { + $this.off('load', self.start); + } else if (self.$clone) { + self.$clone.remove(); + } + + $this.removeData('cropper'); + }, + + + /** + * Move the canvas with relative offsets + * + * @param {Number} offsetX + * @param {Number} offsetY (optional) + */ + move: function move(offsetX, offsetY) { + var self = this; + var canvas = self.canvas; + + self.moveTo(isUndefined(offsetX) ? offsetX : canvas.left + Number(offsetX), isUndefined(offsetY) ? offsetY : canvas.top + Number(offsetY)); + }, + + + /** + * Move the canvas to an absolute point + * + * @param {Number} x + * @param {Number} y (optional) + */ + moveTo: function moveTo(x, y) { + var self = this; + var canvas = self.canvas; + var changed = false; + + // If "y" is not present, its default value is "x" + if (isUndefined(y)) { + y = x; + } + + x = Number(x); + y = Number(y); + + if (self.ready && !self.disabled && self.options.movable) { + if (isNumber(x)) { + canvas.left = x; + changed = true; + } + + if (isNumber(y)) { + canvas.top = y; + changed = true; + } + + if (changed) { + self.renderCanvas(true); + } + } + }, + + + /** + * Zoom the canvas with a relative ratio + * + * @param {Number} ratio + * @param {jQuery Event} _event (private) + */ + zoom: function zoom(ratio, _event) { + var self = this; + var canvas = self.canvas; + + ratio = Number(ratio); + + if (ratio < 0) { + ratio = 1 / (1 - ratio); + } else { + ratio = 1 + ratio; + } + + self.zoomTo(canvas.width * ratio / canvas.naturalWidth, _event); + }, + + + /** + * Zoom the canvas to an absolute ratio + * + * @param {Number} ratio + * @param {jQuery Event} _event (private) + */ + zoomTo: function zoomTo(ratio, _event) { + var self = this; + var options = self.options; + var pointers = self.pointers; + var canvas = self.canvas; + var width = canvas.width; + var height = canvas.height; + var naturalWidth = canvas.naturalWidth; + var naturalHeight = canvas.naturalHeight; + + ratio = Number(ratio); + + if (ratio >= 0 && self.ready && !self.disabled && options.zoomable) { + var newWidth = naturalWidth * ratio; + var newHeight = naturalHeight * ratio; + var originalEvent = void 0; + + if (_event) { + originalEvent = _event.originalEvent; + } + + if (self.trigger('zoom', { + originalEvent: originalEvent, + oldRatio: width / naturalWidth, + ratio: newWidth / naturalWidth + }).isDefaultPrevented()) { + return; + } + + if (originalEvent) { + var offset = self.$cropper.offset(); + var center = pointers && objectKeys(pointers).length ? getPointersCenter(pointers) : { + pageX: _event.pageX || originalEvent.pageX || 0, + pageY: _event.pageY || originalEvent.pageY || 0 + }; + + // Zoom from the triggering point of the event + canvas.left -= (newWidth - width) * ((center.pageX - offset.left - canvas.left) / width); + canvas.top -= (newHeight - height) * ((center.pageY - offset.top - canvas.top) / height); + } else { + // Zoom from the center of the canvas + canvas.left -= (newWidth - width) / 2; + canvas.top -= (newHeight - height) / 2; + } + + canvas.width = newWidth; + canvas.height = newHeight; + self.renderCanvas(true); + } + }, + + + /** + * Rotate the canvas with a relative degree + * + * @param {Number} degree + */ + rotate: function rotate(degree) { + var self = this; + + self.rotateTo((self.image.rotate || 0) + Number(degree)); + }, + + + /** + * Rotate the canvas to an absolute degree + * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function#rotate() + * + * @param {Number} degree + */ + rotateTo: function rotateTo(degree) { + var self = this; + + degree = Number(degree); + + if (isNumber(degree) && self.ready && !self.disabled && self.options.rotatable) { + self.image.rotate = degree % 360; + self.rotated = true; + self.renderCanvas(true); + } + }, + + + /** + * Scale the image + * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function#scale() + * + * @param {Number} scaleX + * @param {Number} scaleY (optional) + */ + scale: function scale(scaleX, scaleY) { + var self = this; + var image = self.image; + var changed = false; + + // If "scaleY" is not present, its default value is "scaleX" + if (isUndefined(scaleY)) { + scaleY = scaleX; + } + + scaleX = Number(scaleX); + scaleY = Number(scaleY); + + if (self.ready && !self.disabled && self.options.scalable) { + if (isNumber(scaleX)) { + image.scaleX = scaleX; + changed = true; + } + + if (isNumber(scaleY)) { + image.scaleY = scaleY; + changed = true; + } + + if (changed) { + self.renderImage(true); + } + } + }, + + + /** + * Scale the abscissa of the image + * + * @param {Number} scaleX + */ + scaleX: function scaleX(_scaleX) { + var self = this; + var scaleY = self.image.scaleY; + + self.scale(_scaleX, isNumber(scaleY) ? scaleY : 1); + }, + + + /** + * Scale the ordinate of the image + * + * @param {Number} scaleY + */ + scaleY: function scaleY(_scaleY) { + var self = this; + var scaleX = self.image.scaleX; + + self.scale(isNumber(scaleX) ? scaleX : 1, _scaleY); + }, + + + /** + * Get the cropped area position and size data (base on the original image) + * + * @param {Boolean} isRounded (optional) + * @return {Object} data + */ + getData: function getData(isRounded) { + var self = this; + var options = self.options; + var image = self.image; + var canvas = self.canvas; + var cropBox = self.cropBox; + var ratio = void 0; + var data = void 0; + + if (self.ready && self.cropped) { + data = { + x: cropBox.left - canvas.left, + y: cropBox.top - canvas.top, + width: cropBox.width, + height: cropBox.height + }; + + ratio = image.width / image.naturalWidth; + + $.each(data, function (i, n) { + n /= ratio; + data[i] = isRounded ? Math.round(n) : n; + }); + } else { + data = { + x: 0, + y: 0, + width: 0, + height: 0 + }; + } + + if (options.rotatable) { + data.rotate = image.rotate || 0; + } + + if (options.scalable) { + data.scaleX = image.scaleX || 1; + data.scaleY = image.scaleY || 1; + } + + return data; + }, + + + /** + * Set the cropped area position and size with new data + * + * @param {Object} data + */ + setData: function setData(data) { + var self = this; + var options = self.options; + var image = self.image; + var canvas = self.canvas; + var cropBoxData = {}; + var rotated = void 0; + var isScaled = void 0; + var ratio = void 0; + + if ($.isFunction(data)) { + data = data.call(self.element); + } + + if (self.ready && !self.disabled && $.isPlainObject(data)) { + if (options.rotatable) { + if (isNumber(data.rotate) && data.rotate !== image.rotate) { + image.rotate = data.rotate; + rotated = true; + self.rotated = rotated; + } + } + + if (options.scalable) { + if (isNumber(data.scaleX) && data.scaleX !== image.scaleX) { + image.scaleX = data.scaleX; + isScaled = true; + } + + if (isNumber(data.scaleY) && data.scaleY !== image.scaleY) { + image.scaleY = data.scaleY; + isScaled = true; + } + } + + if (rotated) { + self.renderCanvas(); + } else if (isScaled) { + self.renderImage(); + } + + ratio = image.width / image.naturalWidth; + + if (isNumber(data.x)) { + cropBoxData.left = data.x * ratio + canvas.left; + } + + if (isNumber(data.y)) { + cropBoxData.top = data.y * ratio + canvas.top; + } + + if (isNumber(data.width)) { + cropBoxData.width = data.width * ratio; + } + + if (isNumber(data.height)) { + cropBoxData.height = data.height * ratio; + } + + self.setCropBoxData(cropBoxData); + } + }, + + + /** + * Get the container size data + * + * @return {Object} data + */ + getContainerData: function getContainerData() { + return this.ready ? this.container : {}; + }, + + + /** + * Get the image position and size data + * + * @return {Object} data + */ + getImageData: function getImageData() { + return this.loaded ? this.image : {}; + }, + + + /** + * Get the canvas position and size data + * + * @return {Object} data + */ + getCanvasData: function getCanvasData() { + var self = this; + var canvas = self.canvas; + var data = {}; + + if (self.ready) { + $.each(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (i, n) { + data[n] = canvas[n]; + }); + } + + return data; + }, + + + /** + * Set the canvas position and size with new data + * + * @param {Object} data + */ + setCanvasData: function setCanvasData(data) { + var self = this; + var canvas = self.canvas; + var aspectRatio = canvas.aspectRatio; + + if ($.isFunction(data)) { + data = data.call(self.$element); + } + + if (self.ready && !self.disabled && $.isPlainObject(data)) { + if (isNumber(data.left)) { + canvas.left = data.left; + } + + if (isNumber(data.top)) { + canvas.top = data.top; + } + + if (isNumber(data.width)) { + canvas.width = data.width; + canvas.height = data.width / aspectRatio; + } else if (isNumber(data.height)) { + canvas.height = data.height; + canvas.width = data.height * aspectRatio; + } + + self.renderCanvas(true); + } + }, + + + /** + * Get the crop box position and size data + * + * @return {Object} data + */ + getCropBoxData: function getCropBoxData() { + var self = this; + var cropBox = self.cropBox; + + return self.ready && self.cropped ? { + left: cropBox.left, + top: cropBox.top, + width: cropBox.width, + height: cropBox.height + } : {}; + }, + + + /** + * Set the crop box position and size with new data + * + * @param {Object} data + */ + setCropBoxData: function setCropBoxData(data) { + var self = this; + var cropBox = self.cropBox; + var aspectRatio = self.options.aspectRatio; + var widthChanged = void 0; + var heightChanged = void 0; + + if ($.isFunction(data)) { + data = data.call(self.$element); + } + + if (self.ready && self.cropped && !self.disabled && $.isPlainObject(data)) { + if (isNumber(data.left)) { + cropBox.left = data.left; + } + + if (isNumber(data.top)) { + cropBox.top = data.top; + } + + if (isNumber(data.width) && data.width !== cropBox.width) { + widthChanged = true; + cropBox.width = data.width; + } + + if (isNumber(data.height) && data.height !== cropBox.height) { + heightChanged = true; + cropBox.height = data.height; + } + + if (aspectRatio) { + if (widthChanged) { + cropBox.height = cropBox.width / aspectRatio; + } else if (heightChanged) { + cropBox.width = cropBox.height * aspectRatio; + } + } + + self.renderCropBox(); + } + }, + + + /** + * Get a canvas drawn the cropped image + * + * @param {Object} options (optional) + * @return {HTMLCanvasElement} canvas + */ + getCroppedCanvas: function getCroppedCanvas(options) { + var self = this; + + if (!self.ready || !window.HTMLCanvasElement) { + return null; + } + + if (!$.isPlainObject(options)) { + options = {}; + } + + if (!self.cropped) { + return getSourceCanvas(self.$clone[0], self.image, options); + } + + var data = self.getData(); + var originalWidth = data.width; + var originalHeight = data.height; + var aspectRatio = originalWidth / originalHeight; + var scaledWidth = void 0; + var scaledHeight = void 0; + var scaledRatio = void 0; + + if ($.isPlainObject(options)) { + scaledWidth = options.width; + scaledHeight = options.height; + + if (scaledWidth) { + scaledHeight = scaledWidth / aspectRatio; + scaledRatio = scaledWidth / originalWidth; + } else if (scaledHeight) { + scaledWidth = scaledHeight * aspectRatio; + scaledRatio = scaledHeight / originalHeight; + } + } + + // The canvas element will use `Math.Math.floor` on a float number, so Math.floor first + var canvasWidth = Math.floor(scaledWidth || originalWidth); + var canvasHeight = Math.floor(scaledHeight || originalHeight); + + var canvas = $('')[0]; + var context = canvas.getContext('2d'); + + canvas.width = canvasWidth; + canvas.height = canvasHeight; + + if (options.fillColor) { + context.fillStyle = options.fillColor; + context.fillRect(0, 0, canvasWidth, canvasHeight); + } + + // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage + var parameters = function () { + var source = getSourceCanvas(self.$clone[0], self.image, options); + var sourceWidth = source.width; + var sourceHeight = source.height; + var canvasData = self.canvas; + var params = [source]; + + // Source canvas + var srcX = data.x + canvasData.naturalWidth * (Math.abs(data.scaleX || 1) - 1) / 2; + var srcY = data.y + canvasData.naturalHeight * (Math.abs(data.scaleY || 1) - 1) / 2; + var srcWidth = void 0; + var srcHeight = void 0; + + // Destination canvas + var dstX = void 0; + var dstY = void 0; + var dstWidth = void 0; + var dstHeight = void 0; + + if (srcX <= -originalWidth || srcX > sourceWidth) { + srcX = 0; + srcWidth = 0; + dstX = 0; + dstWidth = 0; + } else if (srcX <= 0) { + dstX = -srcX; + srcX = 0; + dstWidth = Math.min(sourceWidth, originalWidth + srcX); + srcWidth = dstWidth; + } else if (srcX <= sourceWidth) { + dstX = 0; + dstWidth = Math.min(originalWidth, sourceWidth - srcX); + srcWidth = dstWidth; + } + + if (srcWidth <= 0 || srcY <= -originalHeight || srcY > sourceHeight) { + srcY = 0; + srcHeight = 0; + dstY = 0; + dstHeight = 0; + } else if (srcY <= 0) { + dstY = -srcY; + srcY = 0; + dstHeight = Math.min(sourceHeight, originalHeight + srcY); + srcHeight = dstHeight; + } else if (srcY <= sourceHeight) { + dstY = 0; + dstHeight = Math.min(originalHeight, sourceHeight - srcY); + srcHeight = dstHeight; + } + + // All the numerical parameters should be integer for `drawImage` (#476) + params.push(Math.floor(srcX), Math.floor(srcY), Math.floor(srcWidth), Math.floor(srcHeight)); + + // Scale destination sizes + if (scaledRatio) { + dstX *= scaledRatio; + dstY *= scaledRatio; + dstWidth *= scaledRatio; + dstHeight *= scaledRatio; + } + + // Avoid "IndexSizeError" in IE and Firefox + if (dstWidth > 0 && dstHeight > 0) { + params.push(Math.floor(dstX), Math.floor(dstY), Math.floor(dstWidth), Math.floor(dstHeight)); + } + + return params; + }(); + + context.imageSmoothingEnabled = !!options.imageSmoothingEnabled; + + if (options.imageSmoothingQuality) { + context.imageSmoothingQuality = options.imageSmoothingQuality; + } + + context.drawImage.apply(context, _toConsumableArray(parameters)); + + return canvas; + }, + + + /** + * Change the aspect ratio of the crop box + * + * @param {Number} aspectRatio + */ + setAspectRatio: function setAspectRatio(aspectRatio) { + var self = this; + var options = self.options; + + if (!self.disabled && !isUndefined(aspectRatio)) { + // 0 -> NaN + options.aspectRatio = Math.max(0, aspectRatio) || NaN; + + if (self.ready) { + self.initCropBox(); + + if (self.cropped) { + self.renderCropBox(); + } + } + } + }, + + + /** + * Change the drag mode + * + * @param {String} mode (optional) + */ + setDragMode: function setDragMode(mode) { + var self = this; + var options = self.options; + var croppable = void 0; + var movable = void 0; + + if (self.loaded && !self.disabled) { + croppable = mode === 'crop'; + movable = options.movable && mode === 'move'; + mode = croppable || movable ? mode : 'none'; + + self.$dragBox.data('action', mode).toggleClass('cropper-crop', croppable).toggleClass('cropper-move', movable); + + if (!options.cropBoxMovable) { + // Sync drag mode to crop box when it is not movable(#300) + self.$face.data('action', mode).toggleClass('cropper-crop', croppable).toggleClass('cropper-move', movable); + } + } + } + }; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var CLASS_HIDDEN = 'cropper-hidden'; + var REGEXP_DATA_URL = /^data:/; + var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/; + + var Cropper = function () { + function Cropper(element, options) { + _classCallCheck(this, Cropper); + + var self = this; + + self.$element = $(element); + self.options = $.extend({}, DEFAULTS, $.isPlainObject(options) && options); + self.loaded = false; + self.ready = false; + self.completed = false; + self.rotated = false; + self.cropped = false; + self.disabled = false; + self.replaced = false; + self.limited = false; + self.wheeling = false; + self.isImg = false; + self.originalUrl = ''; + self.canvas = null; + self.cropBox = null; + self.pointers = {}; + self.init(); + } + + _createClass(Cropper, [{ + key: 'init', + value: function init() { + var self = this; + var $this = self.$element; + var url = void 0; + + if ($this.is('img')) { + self.isImg = true; + + // Should use `$.fn.attr` here. e.g.: "img/picture.jpg" + url = $this.attr('src'); + self.originalUrl = url; + + // Stop when it's a blank image + if (!url) { + return; + } + + // Should use `$.fn.prop` here. e.g.: "http://example.com/img/picture.jpg" + url = $this.prop('src'); + } else if ($this.is('canvas') && window.HTMLCanvasElement) { + url = $this[0].toDataURL(); + } + + self.load(url); + } + + // A shortcut for triggering custom events + + }, { + key: 'trigger', + value: function trigger(type, data) { + var e = $.Event(type, data); + + this.$element.trigger(e); + + return e; + } + }, { + key: 'load', + value: function load(url) { + var self = this; + var options = self.options; + var $this = self.$element; + + if (!url) { + return; + } + + self.url = url; + self.image = {}; + + if (!options.checkOrientation || !window.ArrayBuffer) { + self.clone(); + return; + } + + // XMLHttpRequest disallows to open a Data URL in some browsers like IE11 and Safari + if (REGEXP_DATA_URL.test(url)) { + if (REGEXP_DATA_URL_JPEG.test(url)) { + self.read(dataURLToArrayBuffer(url)); + } else { + self.clone(); + } + return; + } + + var xhr = new XMLHttpRequest(); + + xhr.onerror = $.proxy(function () { + self.clone(); + }, this); + + xhr.onload = function load() { + self.read(this.response); + }; + + if (options.checkCrossOrigin && isCrossOriginURL(url) && $this.prop('crossOrigin')) { + url = addTimestamp(url); + } + + xhr.open('get', url); + xhr.responseType = 'arraybuffer'; + xhr.withCredentials = $this.prop('crossOrigin') === 'use-credentials'; + xhr.send(); + } + }, { + key: 'read', + value: function read(arrayBuffer) { + var self = this; + var options = self.options; + var orientation = getOrientation(arrayBuffer); + var image = self.image; + var rotate = 0; + var scaleX = 1; + var scaleY = 1; + + if (orientation > 1) { + self.url = arrayBufferToDataURL(arrayBuffer); + + switch (orientation) { + // flip horizontal + case 2: + scaleX = -1; + break; + + // rotate left 180° + case 3: + rotate = -180; + break; + + // flip vertical + case 4: + scaleY = -1; + break; + + // flip vertical + rotate right 90° + case 5: + rotate = 90; + scaleY = -1; + break; + + // rotate right 90° + case 6: + rotate = 90; + break; + + // flip horizontal + rotate right 90° + case 7: + rotate = 90; + scaleX = -1; + break; + + // rotate left 90° + case 8: + rotate = -90; + break; + + default: + } + } + + if (options.rotatable) { + image.rotate = rotate; + } + + if (options.scalable) { + image.scaleX = scaleX; + image.scaleY = scaleY; + } + + self.clone(); + } + }, { + key: 'clone', + value: function clone() { + var self = this; + var options = self.options; + var $this = self.$element; + var url = self.url; + var crossOrigin = ''; + var crossOriginUrl = void 0; + + if (options.checkCrossOrigin && isCrossOriginURL(url)) { + crossOrigin = $this.prop('crossOrigin'); + + if (crossOrigin) { + crossOriginUrl = url; + } else { + crossOrigin = 'anonymous'; + + // Bust cache (#148) when there is not a "crossOrigin" property + crossOriginUrl = addTimestamp(url); + } + } + + self.crossOrigin = crossOrigin; + self.crossOriginUrl = crossOriginUrl; + + var image = document.createElement('img'); + + if (crossOrigin) { + image.crossOrigin = crossOrigin; + } + + image.src = crossOriginUrl || url; + + var $clone = $(image); + + self.$clone = $clone; + + if (self.isImg) { + if ($this[0].complete) { + self.start(); + } else { + $this.one('load', $.proxy(self.start, this)); + } + } else { + $clone.one('load', $.proxy(self.start, this)).one('error', $.proxy(self.stop, this)).addClass('cropper-hide').insertAfter($this); + } + } + }, { + key: 'start', + value: function start() { + var self = this; + var $clone = self.$clone; + var $image = self.$element; + + if (!self.isImg) { + $clone.off('error', self.stop); + $image = $clone; + } + + getImageSize($image[0], function (naturalWidth, naturalHeight) { + $.extend(self.image, { + naturalWidth: naturalWidth, + naturalHeight: naturalHeight, + aspectRatio: naturalWidth / naturalHeight + }); + + self.loaded = true; + self.build(); + }); + } + }, { + key: 'stop', + value: function stop() { + var self = this; + + self.$clone.remove(); + self.$clone = null; + } + }, { + key: 'build', + value: function build() { + var self = this; + var options = self.options; + var $this = self.$element; + var $clone = self.$clone; + + if (!self.loaded) { + return; + } + + // Unbuild first when replace + if (self.ready) { + self.unbuild(); + } + + var $cropper = $(TEMPLATE); + var $cropBox = $cropper.find('.cropper-crop-box'); + var $face = $cropBox.find('.cropper-face'); + + // Create cropper elements + self.$container = $this.parent(); + self.$cropper = $cropper; + self.$canvas = $cropper.find('.cropper-canvas').append($clone); + self.$dragBox = $cropper.find('.cropper-drag-box'); + self.$cropBox = $cropBox; + self.$viewBox = $cropper.find('.cropper-view-box'); + self.$face = $face; + + // Hide the original image + $this.addClass(CLASS_HIDDEN).after($cropper); + + // Show the clone image if is hidden + if (!self.isImg) { + $clone.removeClass('cropper-hide'); + } + + self.initPreview(); + self.bind(); + + options.aspectRatio = Math.max(0, options.aspectRatio) || NaN; + options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0; + + self.cropped = options.autoCrop; + + if (options.autoCrop) { + if (options.modal) { + self.$dragBox.addClass('cropper-modal'); + } + } else { + $cropBox.addClass(CLASS_HIDDEN); + } + + if (!options.guides) { + $cropBox.find('.cropper-dashed').addClass(CLASS_HIDDEN); + } + + if (!options.center) { + $cropBox.find('.cropper-center').addClass(CLASS_HIDDEN); + } + + if (options.cropBoxMovable) { + $face.addClass('cropper-move').data('action', 'all'); + } + + if (!options.highlight) { + $face.addClass('cropper-invisible'); + } + + if (options.background) { + $cropper.addClass('cropper-bg'); + } + + if (!options.cropBoxResizable) { + $cropBox.find('.cropper-line, .cropper-point').addClass(CLASS_HIDDEN); + } + + self.setDragMode(options.dragMode); + self.render(); + self.ready = true; + self.setData(options.data); + + // Trigger the ready event asynchronously to keep `data('cropper')` is defined + self.completing = setTimeout(function () { + if ($.isFunction(options.ready)) { + $this.one('ready', options.ready); + } + + self.trigger('ready'); + self.trigger('crop', self.getData()); + self.completed = true; + }, 0); + } + }, { + key: 'unbuild', + value: function unbuild() { + var self = this; + + if (!self.ready) { + return; + } + + if (!self.completed) { + clearTimeout(self.completing); + } + + self.ready = false; + self.completed = false; + self.initialImage = null; + + // Clear `initialCanvas` is necessary when replace + self.initialCanvas = null; + self.initialCropBox = null; + self.container = null; + self.canvas = null; + + // Clear `cropBox` is necessary when replace + self.cropBox = null; + self.unbind(); + + self.resetPreview(); + self.$preview = null; + + self.$viewBox = null; + self.$cropBox = null; + self.$dragBox = null; + self.$canvas = null; + self.$container = null; + + self.$cropper.remove(); + self.$cropper = null; + } + }], [{ + key: 'setDefaults', + value: function setDefaults(options) { + $.extend(DEFAULTS, $.isPlainObject(options) && options); + } + }]); + + return Cropper; + }(); + + $.extend(Cropper.prototype, render); + $.extend(Cropper.prototype, preview); + $.extend(Cropper.prototype, events); + $.extend(Cropper.prototype, handlers); + $.extend(Cropper.prototype, change); + $.extend(Cropper.prototype, methods); + + var NAMESPACE = 'cropper'; + var OtherCropper = $.fn.cropper; + + $.fn.cropper = function jQueryCropper(option) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var result = void 0; + + this.each(function (i, element) { + var $this = $(element); + var data = $this.data(NAMESPACE); + + if (!data) { + if (/destroy/.test(option)) { + return; + } + + var options = $.extend({}, $this.data(), $.isPlainObject(option) && option); + $this.data(NAMESPACE, data = new Cropper(element, options)); + } + + if (typeof option === 'string') { + var fn = data[option]; + + if ($.isFunction(fn)) { + result = fn.apply(data, args); + } + } + }); + + return typeof result !== 'undefined' ? result : this; + }; + + $.fn.cropper.Constructor = Cropper; + $.fn.cropper.setDefaults = Cropper.setDefaults; + + // No conflict + $.fn.cropper.noConflict = function noConflict() { + $.fn.cropper = OtherCropper; + return this; + }; + + exports('cropper', $.fn.cropper); +}); \ No newline at end of file diff --git a/static/component/pear/module/design.js b/static/component/pear/module/design.js new file mode 100644 index 000000000..6bcf7acdf --- /dev/null +++ b/static/component/pear/module/design.js @@ -0,0 +1,182 @@ +layui.define(['layer', 'form'], function(exports) { + var layer = layui.layer, + form = layui.form, + $ = layui.$, + key = ''; + delHtml() + $('button').on('click', function() { + var _this = $(this), + size = _this.data('size'), + type = _this.data('type'), + html = ''; + key = randStrName(); + switch (type) { + case 'text': + html = input(type, size) + break; + case 'password': + html = input(type, size) + break; + case 'select': + html = select(size) + break; + case 'checkbox_a': + html = checkbox_a(size) + break; + case 'checkbox_b': + html = checkbox_b(size) + break; + case 'radio': + html = radio(size) + break; + case 'textarea': + html = textarea(size) + break; + case 'submit': + html = submits(size) + break; + case 'del': + $('form').html("\n") + delHtml() + $('.code-show').text('') + return false + break; + default: + layer.msg('类型错误', { + icon: 2 + }) + } + + $('form').append(html); + form.render(); + setHtml(html) + }) + + function delHtml() { + layui.data('form_html', { + key: 'html', + remove: true + }); + } + + function setHtml(html) { + var h = layui.data('form_html'); + if (h && h.html) { + var _d = h.html + html + } else { + var _d = html + } + layui.data('form_html', { + key: 'html', + value: _d + }) + $('.code-show').text('
                        \n' + _d + '
                        ') + + } + + function input(type, size) { + var name = type === 'text' ? '输入框' : (type === 'password' ? '密码框' : ''); + var html = '
                        \n' + + ' \n' + + '
                        \n' + + ' \n' + + '
                        \n' + + '
                        \n'; + return html; + } + + function select(size) { + var html = '
                        \n' + + ' \n' + + '
                        \n' + + ' \n' + + '
                        \n' + + '
                        \n'; + return html; + } + + function checkbox_a(size) { + var html = '
                        \n' + + ' \n' + + '
                        \n' + + ' \n' + + ' \n' + + ' \n' + + '
                        \n' + + '
                        \n'; + return html; + } + + function checkbox_b(size) { + var html = '
                        \n' + + ' \n' + + '
                        \n' + + ' \n' + + '
                        \n' + + '
                        \n'; + return html; + } + + function radio(size) { + var html = '
                        \n' + + ' \n' + + '
                        \n' + + ' \n' + + ' \n' + + '
                        \n' + + '
                        \n'; + return html; + } + + function textarea(size) { + var html = '
                        \n' + + ' \n' + + '
                        \n' + + ' \n' + + '
                        \n' + + '
                        \n'; + return html; + } + + function submits(size) { + var html = '
                        \n' + + '
                        \n' + + ' \n' + + ' \n' + + '
                        \n' + + '
                        \n'; + return html; + } + + function jscode() { + var html = ''; + return html; + } + + function randStrName() { + return Math.random().toString(36).substr(8); + } + var jscodehtml = jscode(); + $('.js-show').text(jscodehtml) + form.on('submit(formDemo)', function(data) { + layer.msg(JSON.stringify(data.field)); + return false; + }); + exports('design', {}); +}); diff --git a/static/component/pear/module/drawer.js b/static/component/pear/module/drawer.js new file mode 100644 index 000000000..2ef84e7c7 --- /dev/null +++ b/static/component/pear/module/drawer.js @@ -0,0 +1,185 @@ +layui.define(['jquery', 'element'], function(exports) { + "use strict"; + + /** + * Drawer component + * */ + var MOD_NAME = 'drawer', + $ = layui.jquery, + element = layui.element; + + var drawer = new function() { + + /** + * open drawer + * */ + this.open = function(option) { + var obj = new mSlider({ + dom: option.dom, + direction: option.direction, + distance: option.distance, + time: option.time ? option.time : 0, + maskClose: option.maskClose, + callback: option.success + }); + obj.open(); + return obj; + } + + } + exports(MOD_NAME, drawer); +}); + +/** + * 源码 + * */ +(function(b, c) { + function a(d) { + this.opts = { + "direction": d.direction || "left", + "distance": d.distance || "60%", + "dom": this.Q(d.dom), + "time": d.time || "", + "maskClose": (d.maskClose + "").toString() !== "false" ? true : false, + "callback": d.callback || "" + }; + this.rnd = this.rnd(); + this.dom = this.opts.dom[0]; + this.wrap = ""; + this.inner = ""; + this.mask = ""; + this.init() + } + a.prototype = { + Q: function(d) { + return document.querySelectorAll(d) + }, + isMobile: function() { + return navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i) ? true : false + }, + addEvent: function(f, e, d) { + if (f.attachEvent) { + f.attachEvent("on" + e, d) + } else { + f.addEventListener(e, d, false) + } + }, + rnd: function() { + return Math.random().toString(36).substr(2, 6) + }, + init: function() { + var g = this; + if (!g.dom) { + console.log("未正确绑定弹窗容器"); + return + } + var d = document.createElement("div"); + var e = document.createElement("div"); + var f = document.createElement("div"); + d.setAttribute("class", "mSlider-main ms-" + g.rnd); + e.setAttribute("class", "mSlider-inner"); + f.setAttribute("class", "mSlider-mask"); + g.Q("body")[0].appendChild(d); + g.Q(".ms-" + g.rnd)[0].appendChild(e); + g.Q(".ms-" + g.rnd)[0].appendChild(f); + g.wrap = g.Q(".ms-" + g.rnd)[0]; + g.inner = g.Q(".ms-" + g.rnd + " .mSlider-inner")[0]; + g.mask = g.Q(".ms-" + g.rnd + " .mSlider-mask")[0]; + g.inner.appendChild(g.dom); + switch (g.opts.direction) { + case "top": + g.top = "0"; + g.left = "0"; + g.width = "100%"; + g.height = g.opts.distance; + g.translate = "0,-100%,0"; + break; + case "bottom": + g.bottom = "0"; + g.left = "0"; + g.width = "100%"; + g.height = g.opts.distance; + g.translate = "0,100%,0"; + break; + case "right": + g.top = "0"; + g.right = "0"; + g.width = g.opts.distance; + g.height = document.documentElement.clientHeight + "px"; + g.translate = "100%,0,0"; + break; + default: + g.top = "0"; + g.left = "0"; + g.width = g.opts.distance; + g.height = document.documentElement.clientHeight + "px"; + g.translate = "-100%,0,0" + } + g.wrap.style.display = "none"; + g.wrap.style.position = "fixed"; + g.wrap.style.top = "0"; + g.wrap.style.left = "0"; + g.wrap.style.width = "100%"; + g.wrap.style.height = "100%"; + g.wrap.style.zIndex = 9999999; + g.inner.style.position = "absolute"; + g.inner.style.top = g.top; + g.inner.style.bottom = g.bottom; + g.inner.style.left = g.left; + g.inner.style.right = g.right; + g.inner.style.width = g.width; + g.inner.style.height = g.height; + g.inner.style.backgroundColor = "#fff"; + g.inner.style.transform = "translate3d(" + g.translate + ")"; + g.inner.style.webkitTransition = "all .2s ease-out"; + g.inner.style.transition = "all .2s ease-out"; + g.inner.style.zIndex = 10000000; + g.mask.style.width = "100%"; + g.mask.style.height = "100%"; + g.mask.style.opacity = "0.1"; + g.mask.style.backgroundColor = "black"; + g.mask.style.zIndex = "9999998"; + g.mask.style.webkitBackfaceVisibility = "hidden"; + g.events() + }, + open: function() { + var d = this; + d.wrap.style.display = "block"; + + setTimeout(function() { + d.inner.style.transform = "translate3d(0,0,0)"; + d.inner.style.webkitTransform = "translate3d(0,0,0)"; + d.mask.style.opacity = 0.1 + }, 30); + if (d.opts.time) { + d.timer = setTimeout(function() { + d.close() + }, d.opts.time) + } + }, + close: function() { + var d = this; + d.timer && clearTimeout(d.timer); + d.inner.style.webkitTransform = "translate3d(" + d.translate + ")"; + d.inner.style.transform = "translate3d(" + d.translate + ")"; + d.mask.style.opacity = 0; + setTimeout(function() { + d.wrap.style.display = "none"; + d.timer = null; + d.opts.callback && d.opts.callback() + }, 300) + }, + events: function() { + var d = this; + d.addEvent(d.mask, "touchmove", function(f) { + f.preventDefault() + }); + d.addEvent(d.mask, (d.isMobile() ? "touchend" : "click"), function(f) { + if (d.opts.maskClose) { + d.close() + } + }) + } + }; + b.mSlider = a +})(window); \ No newline at end of file diff --git a/static/component/pear/module/dtree.js b/static/component/pear/module/dtree.js new file mode 100644 index 000000000..e4f2d2dd8 --- /dev/null +++ b/static/component/pear/module/dtree.js @@ -0,0 +1,5530 @@ +layui.define(['jquery','layer','form'], function(exports) { + var $ = layui.$, + layer = layui.layer, + form = layui.form; + + // 树的公共定义样式汇总 + var LI_NAV_CHILD = "dtree-nav-ul-sid", LI_NAV_ITEM = "dtree-nav-item", + LI_DIV_ITEM = "dtree-nav-div", DTREEFONTSPECIAL="dtreefont-special", NONETITLE="dtree-none-text", + LI_DIV_MENUBAR = "dtree-menubar", + LI_DIV_TOOLBAR = "dtree-toolbar", TOOLBAR_TOOL = "dtree-toolbar-tool", TOOLBAR_TOOL_EM = "dtree-toolbar-fixed", + LI_DIV_CHECKBAR = "dtree-nav-checkbox-div", + LI_CLICK_CHECKBAR = "d-click-checkbar", //绑定点击复选框时需要用到 + LI_DIV_TEXT_CLASS = "t-click", UL_ROOT="dtree", + LI_NAV_FIRST_LINE = "dtree-nav-first-line", LI_NAV_LINE = "dtree-nav-line", LI_NAV_LAST_LINE = "dtree-nav-last-line"; + + + // 树的公共指定 + var NAV_THIS = "dtree-nav-this", //当前节点 + NAV_SHOW = "dtree-nav-show", //显示子节点 + NAV_HIDE = "dtree-nav-hide", //隐藏节点 + NAV_DIS = "dtree-disabled", //禁用节点 + ICON_HIDE = "dtree-icon-hide", //隐藏图标 + $BODY = $("body"), //body选择器 + $WIN = $(window), //window窗口 + $DOC = $(document), //当前文档 + MOD_NAME = "dtree", //模块名称 + VERSION = "v2.5.8", //版本 + OPTIONS = {}, //全局属性配置 + DTrees = {}; //当前被实例化的树的集合 + + // 树的自定义图标 + var DTREEFONT = "dtreefont", //默认使用图标字体 + LI_DIV_CHECKBAR_ON = "dtree-icon-fuxuankuangxuanzhong", //复选框选中图标 + LI_DIV_CHECKBAR_OUT = "dtree-icon-fuxuankuang", //复选框未选中图标 + LI_DIV_CHECKBAR_NOALL = "dtree-icon-fuxuankuang-banxuan", //复选框半选图标 + LI_DIV_MENUBAR_DOWN = "dtree-icon-move-down", //menubar的展开全部的图标 + LI_DIV_MENUBAR_UP = "dtree-icon-move-up", //menubar的收缩全部的图标 + LI_DIV_MENUBAR_REFRESH = "dtree-icon-refresh", //menubar的刷新图标 + LI_DIV_MENUBAR_CHECKALL = "dtree-icon-roundcheckfill", //menubar的全选图标 + LI_DIV_MENUBAR_UNCHECKALL = "dtree-icon-roundclosefill", //menubar的全不选图标 + LI_DIV_MENUBAR_INVERTALL = "dtree-icon-roundcheck", //menubar的反选图标 + LI_DIV_MENUBAR_DELETE = "dtree-icon-delete1", //menubar的删除图标 + LI_DIV_MENUBAR_SEARCH = "dtree-icon-search_list_light", //menubar的搜索图标 + LI_DIV_TOOLBAR_PULLDOWN = "dtree-icon-pulldown", //toolbar的展开图标 + LI_DIV_TOOLBAR_PULLUP = "dtree-icon-pullup", //toolbar的收缩图标 + LI_DIV_TOOLBAR_ADD = "dtree-icon-roundadd", //toolbar的新增图标 + LI_DIV_TOOLBAR_EDIT = "dtree-icon-bianji", //toolbar的编辑图标 + LI_DIV_TOOLBAR_DEL = "dtree-icon-roundclose"; //toolbar的删除图标 + + // 树的非叶子节点图标集合 + var nodeIconArray = { + "-1": {"open": "dtree-icon-null-open", "close": "dtree-icon-null-close"}, //未指定 + "0" : {"open": "dtree-icon-wenjianjiazhankai", "close": "dtree-icon-weibiaoti5"}, //文件夹(二级图标默认样式) + "1" : {"open": "dtree-icon-jian", "close": "dtree-icon-jia"}, //+-图标(一级图标默认样式) + "2" : {"open": "dtree-icon-xiangxia1", "close": "dtree-icon-xiangyou"} //箭头图标 + }; + + // 树的叶子节点图标集合 + var leafIconArray = { + "-1": "dtree-icon-null", //未指定 + "0" : "dtree-icon-weibiaoti5", //文件夹 + "1" : "dtree-icon-yonghu", //人员 + "2" : "dtree-icon-fenzhijigou", //机构 + "3" : "dtree-icon-fenguangbaobiao", //报表 + "4" : "dtree-icon-xinxipilu", //信息 + "5" : "dtree-icon-shuye1", //叶子(二级图标默认样式) + "6" : "dtree-icon-caidan_xunzhang", //勋章 + "7" : "dtree-icon-normal-file", //文件 + "8" : "dtree-icon-dian", //小圆点(一级图标默认样式) + "9" : "dtree-icon-set-sm", //齿轮 + "10" : "dtree-icon-rate" //星星 + }; + + // 树的自定义样式 + var DTREE = "dtree-", //自定义样式前缀 + ITEMTHIS = "-item-this", //自定义样式当前行选中后缀 + ITEM = "-item", //自定义样式当前行后缀 + DFONT = "-dtreefont", //自定义样式图标样式后缀 + FICON = "-ficon", //自定义样式一级图标样式后缀 + ICON = "-icon", //自定义样式二级图标样式后缀 + CBOX = "-checkbox", //自定义样式复选框样式后缀 + CHS = "-choose"; //自定义样式复选框选中样式后缀 + + // 树自定义操作事件名称集合 绑定dtree-click的事件 + var eventName = { + checkNodeClick: "checkNodeClick", //点击复选框 + itemNodeClick: "itemNodeClick" //点击子节点div + }; + + // 树默认toolbar提供的功能集合 绑定dtree-tool的事件 + var defaultTool = { + pulldown: "pulldown", //点击展开当前节点下的全部节点 + pullup: "pullup", //点击收缩当前节点下的全部节点 + addTool: "addToolbar", //点击toolbar新增 + editTool: "editToolbar", //点击toolbar编辑 + delTool: "delToolbar" //点击toolbar删除 + }; + + // 树默认menubar提供的功能集合 绑定dtree-menu的事件 + var defaultMenu = { + moveDown: "moveDown", //menubar展开全部节点 + moveUp: "moveUp", //menubar收缩全部节点 + refresh: "refresh", //menubar刷新树 + checkAll: "checkAll", //menubar全选 + unCheckAll: "unCheckAll", //menubar全不选 + invertAll: "invertAll", //menubar反选 + remove: "remove", //menubar删除选中节点 + searchNode: "searchNode" //menubar查询节点 + }; + + // 树的公共事件 + var event = { + getElemId: function(options){ // 根据传入的参数获取ID + var elem = options.elem || ""; + var obj = options.obj || $(elem); + + if (obj.length == 0) { //页面中未找到绑定id + return ""; + } else { + return $(obj)[0].id; + } + }, + escape: function(html){ // 编码 + if(typeof html !== 'string') return ''; + return html.replace(entityReg.escape, function(match){return entityMap.escape[match];}); + }, + unescape: function(str){ // 解码 + if(typeof str !== 'string') return ''; + return str.replace(entityReg.unescape, function(match){return entityMap.unescape[match];}); + }, + cloneObj: function (obj, filter) { //深复制对象方法 + var newObj = {}; + if (obj instanceof Array) { + newObj = []; + } + var str = ""; + if(typeof filter !== 'undefined') {str = filter.join(",");} + for (var key in obj) { + if(str.indexOf(key) == -1){ + var val = obj[key]; + newObj[key] = typeof val === 'object' ? event.cloneObj(val, typeof filter !== undefined ? filter : []): val; + } + + } + return newObj; + }, + trimToDot: function(str){ + return str.replace(/ /g, "."); + } + }; + + // 特殊符号转义 + var keys = Object.keys || function(obj) { + obj = Object(obj); + var arr = []; + for(var a in obj) arr.push(a); + return arr; + }; + var invert = function(obj){ + obj = Object(obj); + var result = {}; + for(var a in obj) result[obj[a]] = a; + return result; + }; + var entityMap = { + escape: { + "&" : "&", + "<" : "<", + ">" : ">", + "'" : "&quo;" + } + }; + entityMap.unescape = invert(entityMap.escape); + var entityReg = { + escape: RegExp('[' + keys(entityMap.escape).join('') + ']', 'g'), + unescape: RegExp('(' + keys(entityMap.unescape).join('|') + ')', 'g') + }; + + //异步加载接口 + var AjaxHelper = { + request : function(config) { + var data = config.data ? config.data : {}; + var async = (typeof (config.async) === "boolean") ? config.async : true; + $.ajax({ + type : config.type ? config.type : "POST", + headers : config.headers, + url : config.url, + dataType : config.dataType ? config.dataType : "json", + data : data, + async : async, + contentType : config.contentType, + xhrFields: {withCredentials: config.withCredentials}, + beforeSend: function (XMLHttpRequest, self) { + if (typeof (config.beforeSend) === "function") { + return config.beforeSend(XMLHttpRequest, self); + } + return true; + }, + success : config.success, + error : function(XMLHttpRequest, textStatus, errorThrown) { + if (typeof (config.error) === "function") { + config.error(XMLHttpRequest, textStatus, errorThrown); + } else { + layer.msg("异步加载失败: " + textStatus,{icon:5, shift:6}); + } + }, + statusCode : { + 404 : function() { + layer.msg('未找到指定请求,请检查访问路径!',{icon:5, shift:6}); + }, + 500 : function() { + layer.msg('系统错误!',{icon:5, shift:6}); + } + }, + complete : function(XMLHttpRequest, textStatus) { + if (typeof (config.complete) === "function") { + config.complete(XMLHttpRequest, textStatus); + } + } + }); + }, + serialize: function(first, param){ //json序列化 key=value&key1=value1 + var p = first; + for (var key in param) { + p += key + "=" + param[key] + "&"; + } + p = p.substring(0, p.length-1); + return p; + } + }; + + /** 树类 Class定义 */ + var DTree = function(options){ + var _this = this; + /** 默认赋值**/ + this.formatter = { // 数据过滤 + title: false // 文字,默认不开启 + }; + this.response = { // 树返回的json格式 + statusName: "code", //返回标识 + statusCode: 200, //返回码 + message: "message", //返回信息 + rootName: "data", //根节点名称 + treeId: "id", //节点ID + parentId: "parentId", //父节点ID + title: "title", //节点名称 + ficonClass: "ficonClass", //自定义一级图标 + iconClass: "iconClass", //自定义二级图标 + childName: "children", //子节点名称 + last: "last", //是否最后一级节点 +// level: "level", //层级 + spread: "spread", //展开 + disabled: "disabled", //禁用 + hide: "hide", //隐藏 + checkArr: "checkArr", //复选框列表 + checked: "checked", //是否选中 + type: "type", //复选框标记 + basicData: "basicData" //表示用户自定义需要存储在树节点中的数据 + }; + this.defaultRequest = { // 树的默认发起请求参数格式,最后会将value作为参数名称传递 + nodeId: "nodeId", //节点ID + parentId: "parentId", //父节点ID + context: "context", //节点内容 + leaf: "leaf", //是否叶子节点 + level: "level", //层级 + spread: "spread", //节点展开状态 + dataType: "dataType", //节点标记 + checked: "checked", //节点复选框选中状态 + initchecked: "initchecked", //节点复选框初始状态 + basicData: "basicData", //用户自定义的记录节点数据 + recordData: "recordData", //当前data数据(排除basicData和children字段) + }; + this.toolbarFun = { + addTreeNode: function(param, $div) { //添加树节点后调用的函数,用于用户自定义,如未指定则树不会发生变化 + return ; + }, + editTreeNode: function(param, $div) { //编辑树节点后调用的函数,用于用户自定义,如未指定则树不会发生变化 + return ; + }, + editTreeLoad: function(param){ // 编辑树的数据回显,用于打开编辑时,回填数据 + return ; + }, + delTreeNode: function(param, $div){ //删除树后调用的函数,用于用户自定义,如未指定则树不会发生变化 + return ; + }, + loadToolbarBefore: function(buttons, param, $div){ // 右键菜单加载前的函数 + return buttons; + } + }; + this.toolbarStyle = { // 工具栏弹出层的自定义样式 + title: "节点", + area: ["60%","80%"] + }; + this.menubarFun = { + remove: function(checkbarNodes){ //删除复选框选中节点,需要用户自定义,如未指定则树只是页面上做了修改 + return true; + } + }; + this.menubarTips = { // 菜单栏的默认显示 + toolbar: [], + group: [defaultMenu.moveDown, defaultMenu.moveUp, defaultMenu.refresh, defaultMenu.checkAll, defaultMenu.unCheckAll, defaultMenu.invertAll, defaultMenu.remove, defaultMenu.searchNode], + freedom: [] + }; + this.checkbarFun = { + chooseBefore: function($i, node){ // 复选框点击前回调 + return true; + }, + chooseDone: function(checkbarNodesParam) { //复选框点击事件完毕后,返回该树关于复选框操作的全部信息,用于用户自定义,如未指定则树只是页面上做了修改 + return ; + } + }; + this.iframeDefaultRequest = { //iframe的默认参数,目的是与加载树的参数不一样 + nodeId: "nodeId", //节点ID + parentId: "parentId", //父节点ID + context: "context", //节点内容 + leaf: "leaf", //是否叶子节点 + level: "level", //层级 + spread: "spread", //节点展开状态 + dataType: "dataType", //节点标记 + checked: "checked", //节点复选框选中状态 + initchecked: "initchecked", //节点复选框初始状态 + basicData: "basicData", //用户自定义的记录节点数据 + recordData: "recordData", //当前data数据(排除basicData和children字段) + }; + + this.iframeFun = { + iframeDone: function(iframeParam){ //iframe加载完毕后,用于用户自定义事件 + return ; + } + }; + this.style = { //树最终使用的样式集合 + item: "", //每一项div的样式 + itemThis: "", //选中div的样式 + dfont: "", //一级图标的样式 + icon: "", //二级图标的样式 + cbox: "", //复选框的样式 + chs: "" //复选框选中的样式 + }; + this.usefontStyle = { //树最终使用的图标集合 + fnode:{ //一级节点 + node:{ //非叶子节点 + open:"", //节点展开 + close:"" //节点关闭 + }, + leaf:"" //叶子节点 + }, + snode:{ //二级节点 + node:{ //非叶子节点 + open:"", //节点展开 + close:"" //节点关闭 + }, + leaf:"" //叶子节点 + }, + checkbox:{ //复选框 + on:"", //复选框选中 + out:"", //未选中 + noall:"" //半选 + }, + menubar:{ //菜单栏 + movedown:"", //全部展开 + moveup:"", //全部收缩 + refresh:"", //刷新 + checkAll:"", //全选 + unCheckAll:"", //全不选 + invertAll:"", //反选 + remove:"", //删除 + search:"" //搜索 + }, + menubarExt:"", //扩展菜单栏 + toolbar:{ //工具栏 + menubar:{ //依附在菜单栏的工具栏 + movedown:"", //全部展开 + moveup:"", //全部收缩 + refresh:"", //刷新 + checkAll:"", //全选 + unCheckAll:"", //全不选 + invertAll:"", //反选 + remove:"", //删除 + search:"" //搜索 + }, + menubarExt:"", //依附在菜单栏的扩展菜单栏 + pulldown:"", //展开 + pullup:"", //收缩 + add:"", //添加 + edit:"", //编辑 + del:"" //删除 + }, + toolbarExt:"" //扩展工具栏 + } + + /** 数据绑定**/ + this.node = { // 树节点选中时,包含当前节点的全部信息 + nodeId: "", //节点ID + parentId: "", //父节点ID + context: "", //节点内容 + leaf: "", //是否叶子节点 + level: "", //层级 + spread: "", //节点展开状态 + dataType: "", //节点标记 + checked: "", //节点复选框选中状态 + initchecked: "", //节点复选框初始状态 + basicData: "", //用户自定义的记录节点数据 + recordData: "", //当前data数据(排除basicData和children字段) + }; + + this.toolbarMenu = {}; // 工具栏右键菜单绑定的所有元素 + this.checkbarNode = []; // 复选框标记的全部节点数据 + this.errData = []; // 记录在渲染节点时有问题的数据 + this.checkArrLen = 0; // 添加节点的时判断复选框个数 + this.temp = []; // 临时变量 + this.bak = ""; // 临时变量 + this.setting(options); + }; + + /******************** 初始参数加载 ********************/ + /** + * @Desc: 设置基本属性值 + * @Param: options:JSON对象,初始设置dtree所需的全部属性 + */ + DTree.prototype.setting = function(options) { + this.options = options || {}; + + /** 绑定元素参数(必填,2个参数项必填一个)**/ + this.elem = this.options.elem || OPTIONS.elem || ""; //树绑定的元素ID:#elem + if(typeof this.options.obj === 'undefined'){ + if(this.elem) { + if($(this.elem).length > 0) { + this.obj = $(this.elem); + } + } + } else { + this.obj = this.options.obj || OPTIONS.obj || this.obj; //树绑定的jquery元素,用于当元素是延迟加载出来的话,可以用这个找到 + this.elem = "#" + this.obj[0].id; + } + + /** 基本参数**/ + this.scroll = this.options.scroll || OPTIONS.scroll || this.elem; //树的上级div容器,让树可以显示滚动条的div容器的ID + this.accordion = (typeof (this.options.accordion) === "boolean") ? this.options.accordion : (typeof (OPTIONS.accordion) === "boolean") ? OPTIONS.accordion : false; //手风琴加载, 默认false + if(this.accordion) { + this.initLevel = 1; //默认展开节点 1节 + } else { + this.initLevel = this.options.initLevel || OPTIONS.initLevel || 2; //默认展开节点 2节 + } + this.type = this.options.type || OPTIONS.type || "load"; //树的加载方式 all,全量树, load,增量树,默认load + this.cache = (typeof (this.options.cache) === "boolean") ? this.options.cache : (typeof (OPTIONS.cache) === "boolean") ? OPTIONS.cache : true; //数据缓存,默认true + this.record = this.options.record || OPTIONS.record || false; //开启数据记录模式,默认false + this.load = (typeof (this.options.load) === "boolean") ? this.options.load : (typeof (OPTIONS.load) === "boolean") ? OPTIONS.load : true; //开启加载动画,默认true + this.none = this.options.none || OPTIONS.nont || "无数据"; //初始加载无记录时显示文字 + this.tempHeight = this.options.height || OPTIONS.height; //临时转换高度变量 + if(this.tempHeight) { // 设置高度 + if(/^full-\d+$/.test(this.tempHeight)) { + this.fullHeightGap = this.tempHeight.split('-')[1]; + this.height = $WIN.height() - this.fullHeightGap; //设置高度 + } else { + this.fullHeightGap = this.tempHeight; + this.height = this.tempHeight; + } + } else { + this.fullHeightGap = ""; + this.height = ""; + } + this.width = this.options.width || OPTIONS.width || "260"; //宽度 + this.obj.css("width", this.width); + + /** 样式相关参数**/ + this.iconfont = this.options.iconfont || OPTIONS.iconfont || DTREEFONT; //默认图标字体 dtreefont + this.iconfontStyle = this.options.iconfontStyle || OPTIONS.iconfontStyle || {}; //用于自定义树的每个关键部位使用的图标 + this.nodeIconArray = $.extend(nodeIconArray, this.options.nodeIconArray || OPTIONS.nodeIconArray) || nodeIconArray; //用户自定义非叶子节点图标集合,node + this.leafIconArray = $.extend(leafIconArray, this.options.leafIconArray || OPTIONS.leafIconArray) || leafIconArray; //用户自定义叶子节点图标集合,leaf + this.skin = this.options.skin || OPTIONS.skin || "theme"; // 自定义样式 + if(this.skin == "layui"){ // layui主题 + this.line = (typeof (this.options.line) === "boolean") ? this.options.line : (typeof (OPTIONS.line) === "boolean") ? OPTIONS.line : true; //开启树线,默认开启 + this.ficon = this.options.ficon || OPTIONS.ficon || "7"; //一级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示一级图标。默认'7' + this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "1") : this.ficon[0]; //一级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示一级图标,默认'1' + this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1]; //一级图标中的leaf节点图标 + this.icon = this.options.icon || OPTIONS.icon || "-1"; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示二级图标。默认'-1' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "-1") : this.icon[0]; //二级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'-1' + this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //二级图标中的leaf节点图标 + } else if(this.skin == "laySimple"){ // laySimple主题 + this.line = this.options.line || OPTIONS.line || false; //开启树线,默认不开启 + this.ficon = this.options.ficon || OPTIONS.ficon || ["2","-1"]; //一级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示一级图标。默认'-1' + this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "2") : this.ficon[0]; //一级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示一级图标,默认'2' + this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1]; // 一级图标中的leaf节点图标 + this.icon = this.options.icon || OPTIONS.icon || "-1"; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示二级图标。默认'-1' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "-1") : this.icon[0]; //二级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'-1' + this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //二级图标中的leaf节点图标 + } else { // 默认主题 或者自定义主题 + this.line = this.options.line || OPTIONS.line || false; //开启树线,默认不开启 + this.ficon = this.options.ficon || OPTIONS.ficon || "8"; //一级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示一级图标。默认'8' + this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "1") : this.ficon[0]; //一级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示一级图标,默认'1' + this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1]; // 一级图标中的leaf节点图标 + this.icon = this.options.icon || OPTIONS.icon || "5"; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示二级图标。默认'5' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "0") : this.icon[0]; //二级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'0' + this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //二级图标中的leaf节点图标 + } + + /** 数据加载参数**/ + this.url = this.options.url || OPTIONS.url || ""; //请求地址 + this.async = (typeof (this.options.async) === "boolean") ? this.options.async : (typeof (OPTIONS.async) === "boolean") ? OPTIONS.async : true; //异步同步加载,默认异步加载 + this.asyncLoad = this.options.asyncLoad || OPTIONS.asyncLoad || []; //初始异步加载层级数据 + this.headers = this.options.headers || OPTIONS.headers || {}; //ajax header属性 + this.method = this.options.method || OPTIONS.method || "post"; //请求类型 + this.dataType = this.options.dataType || OPTIONS.dataType || "json"; //参数类型 + this.contentType = this.options.contentType || OPTIONS.contentType || "application/x-www-form-urlencoded"; //发送信息至服务器时内容编码类型 + this.defaultRequest = $.extend(this.defaultRequest, this.options.defaultRequest || OPTIONS.defaultRequest) || this.defaultRequest; //默认请求参数 + this.filterRequest = this.options.filterRequest || OPTIONS.filterRequest || []; //过滤请求参数 + this.request = this.options.request || OPTIONS.request || {}; //用户自定义请求参数 + this.response = $.extend(this.response, this.options.response || OPTIONS.response) || this.response; //返回json格式 + this.data = this.options.data || OPTIONS.data || null; //初始化指定该参数,则不会访问异步接口 + this.dataFormat = this.options.dataFormat || OPTIONS.dataFormat || "levelRelationship"; //用于用户配置的data数据格式,list:列表, levelRelationship:层级关系,默认 + this.dataStyle = this.options.dataStyle || OPTIONS.dataStyle || "defaultStyle"; //用于用户配置layui通用的json数据风格,layuiStyle:layui风格,defaultStyle:默认风格 + this.errDataShow = this.options.errDataShow || OPTIONS.errDataShow || false; //是否在递归数据出现错误后,显示错误信息,默认false + this.withCredentials = this.options.withCredentials || OPTIONS.withCredentials || false; //是否允许跨域请求,默认false + this.beforeSend = this.options.beforeSend || OPTIONS.beforeSend || function(ajax, XMLHttpRequest, self){return true}; //异步加载之前的回调 + this.success = this.options.success || OPTIONS.success || function(data, obj, first){}; //树加载完毕后执行解析树之前的回调 + this.done = this.options.done || OPTIONS.done || function(data, obj, first){}; //树加载完毕后的回调 + this.formatter = $.extend(this.formatter, this.options.formatter || OPTIONS.formatter) || this.formatter; //数据过滤 + this.error = this.options.error || OPTIONS.error || function(XMLHttpRequest, textStatus, errorThrown){}; // 异步加载异常回调 + this.complete = this.options.complete || OPTIONS.complete || function(XMLHttpRequest, textStatus){}; // 异步加载完成回调 + + /** 复选框参数**/ + this.checkbar = this.options.checkbar || OPTIONS.checkbar || false; //是否开启复选框模式 + this.checkbarLoad = this.options.checkbarLoad || OPTIONS.checkbarLoad || "node"; //复选框作用范围,node:所有节点, leaf:最后一级;默认所有节点 + this.checkbarType = this.options.checkbarType || OPTIONS.checkbarType || "all"; //复选框选中形式 all:子集选中父级也选中, no-all:子集选中父级半选中,子集全选父级选中,p-casc:父级选中子集全选,子集无法改变父级选中状态, self:没有任何级联关系,only:只能选中一个复选框。 默认all + this.checkbarData = this.options.checkbarData || OPTIONS.checkbarData || "choose"; //复选框记录数据类型形式, change表示记录变更数据,choose表示记录选中数据,all记录全部数据,halfChoose记录选中和半选中的数据,默认choose + this.checkbarFun = $.extend(this.checkbarFun, this.options.checkbarFun || OPTIONS.checkbarFun) || this.checkbarFun; //checkbar事件加载 + + /** 菜单栏参数**/ + this.menubar = this.options.menubar || OPTIONS.menubar || false; //是否打开菜单栏 + this.menubarTips = $.extend(this.menubarTips, this.options.menubarTips || OPTIONS.menubarTips) || this.menubarTips; //菜单栏吸附, toolbar:依附在工具栏,group:依附在按钮组,freedom,自由 + this.menubarFun = $.extend(this.menubarFun, this.options.menubarFun || OPTIONS.menubarFun) || this.menubarFun; //menubar事件加载 + + /** 工具栏参数**/ + this.toolbar = this.options.toolbar || OPTIONS.toolbar || false; //是否开启可编辑模式 + this.toolbarWay = this.options.toolbarWay || OPTIONS.toolbarWay || "contextmenu"; //工具栏显示方式,contextmenu:右键,follow:跟随节点,fixed:固定在节点右侧 + this.toolbarStyle = $.extend(this.toolbarStyle, this.options.toolbarStyle || OPTIONS.toolbarStyle) || this.toolbarStyle; //toolbar的自定义风格,标题,弹框大小 + this.toolbarLoad = this.options.toolbarLoad || OPTIONS.toolbarLoad || "node"; //toolbar作用范围:node:所有节点,noleaf:非最后一级节点,leaf:最后一级 + this.toolbarShow = this.options.toolbarShow || OPTIONS.toolbarShow || ["add","edit","delete"]; //toolbar三个按钮自定义加载 + this.toolbarBtn = this.options.toolbarBtn || OPTIONS.toolbarBtn || null; //toolbar增删改中内容的自定义加载 + this.toolbarExt = this.options.toolbarExt || OPTIONS.toolbarExt || []; //toolbar按钮扩展 + this.toolbarFun = $.extend(this.toolbarFun, this.options.toolbarFun || OPTIONS.toolbarFun) || this.toolbarFun; //toolbar事件加载 + + /** iframe模式参数**/ + this.useIframe = this.options.useIframe || OPTIONS.useIframe || false; //是否加载iframe 默认false, + this.iframeElem = this.options.iframeElem || OPTIONS.iframeElem || ""; //iframe的ID + this.iframeUrl = this.options.iframeUrl || OPTIONS.iframeUrl || ""; //树关联的iframe地址 + this.iframeLoad = this.options.iframeLoad || OPTIONS.iframeLoad || "leaf"; //点击哪一层加载frame: node:所有节点, leaf:默认,最后一级 + this.iframeDefaultRequest = $.extend(this.iframeDefaultRequest, this.options.iframeDefaultRequest || OPTIONS.iframeDefaultRequest) || this.iframeDefaultRequest; //iframe的默认传递参数 + this.iframeRequest = $.extend(this.iframeRequest, this.options.iframeRequest) || $.extend(this.iframeRequest, OPTIONS.iframeRequest) || this.iframeRequest; //iframe的自定义参数 + this.iframeFun = $.extend(this.iframeFun, this.options.iframeFun) || $.extend(this.iframeFun, OPTIONS.iframeFun) || this.iframeFun; //iframe事件加载 + + /** 下拉树模式参数**/ + this.select = this.options.select || false; + if(this.select) { + // 重置下拉树 + this.selectSetting(); + } + + /** 调用确认最终主题方法*/ + this.ensureTheme(); + }; + + /** + * @Desc: 重置基本属性值 + * @Param: options:JSON对象,重置dtree所需的全部属性 + */ + DTree.prototype.reloadSetting = function(options) { + this.options = $.extend(this.options, options) || this.options; + + /** 绑定元素参数**/ + this.elem = this.options.elem || this.elem; //树绑定的元素ID:#elem + if(typeof this.options.obj === 'undefined'){ + if(this.elem) { + if($(this.elem).length > 0) { + this.obj = $(this.elem); + } + } + } else { + this.obj = this.options.obj || this.obj; //树绑定的jquery元素,用于当元素是延迟加载出来的话,可以用这个找到 + this.elem = "#" + this.obj[0].id; + } + + /** 基本参数**/ + this.scroll = this.options.scroll || this.scroll; //树的上级div容器,让树可以显示滚动条的div容器 + this.accordion = (typeof (this.options.accordion) === "boolean") ? this.options.accordion : this.accordion; //开启手风琴加载 + if(this.accordion) { + this.initLevel = 1; //默认展开节点 1节 + } else { + this.initLevel = this.options.initLevel || this.initLevel; //默认展开节点 2节 + } + this.type = this.options.type || this.type; //树的加载方式 all,全量树, load,增量树,默认load + this.cache = (typeof (this.options.cache) === "boolean") ? this.options.cache : this.cache; //开启数据缓存 + this.record = (typeof (this.options.record) === "boolean") ? this.options.record : this.record; //开启数据记录模式 + this.load = (typeof (this.options.load) === "boolean") ? this.options.load : this.load; //开启加载动画 + this.none = this.options.none || this.none; //初始节点加载无数据时显示文字 + this.tempHeight = this.options.height || this.height; //临时转换高度变量 + if(this.tempHeight) { //设置高度 + if(/^full-\d+$/.test(this.tempHeight)) { + this.fullHeightGap = this.tempHeight.split('-')[1]; + this.height = $WIN.height() - this.fullHeightGap; + } else { + this.fullHeightGap = this.tempHeight; + this.height = this.tempHeight; + } + } + this.width = this.options.width || this.width; //宽度 + this.obj.css("width", this.width); + + /** 样式相关参数**/ + this.line = (typeof (this.options.line) === "boolean") ? this.options.line : this.line; //开启树线,默认不开启 + this.iconfont = this.options.iconfont || this.iconfont; //默认图标字体 dtreefont + this.iconfontStyle = this.options.iconfontStyle || this.iconfontStyle; //用于自定义树的每个关键部位使用的图标 + this.nodeIconArray = $.extend(nodeIconArray, this.options.nodeIconArray) || this.nodeIconArray; //用户自定义非叶子节点图标集合,node + this.leafIconArray = $.extend(leafIconArray, this.options.leafIconArray) || this.leafIconArray; //用户自定义叶子节点图标集合,leaf + this.skin = this.options.skin || this.skin; //自定义样式 + if(this.skin == "layui"){ //layui主题 + this.line = (typeof (this.options.line) === "boolean") ? this.options.line : true; //开启树线,默认开启 + this.ficon = this.options.ficon || this.ficon; //一级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示一级图标。默认'7' + this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "1") : this.ficon[0]; //一级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'1' + this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1]; //一级图标中的leaf节点图标 + this.icon = this.options.icon || this.icon; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示二级图标。默认'-1' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "-1") : this.icon[0]; //二级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'-1' + this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //二级图标中的leaf节点图标 + } else if(this.skin == "laySimple"){ //laySimple主题 + this.line = (typeof (this.options.line) === "boolean") ? this.options.line : false; //开启树线,默认不开启 + this.ficon = this.options.ficon || this.ficon; //一级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示一级图标。默认'-1' + this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "2") : this.ficon[0]; //一级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'2' + this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1];//一级图标中的leaf节点图标 + this.icon = this.options.icon || this.icon; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示二级图标。默认'-1' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "-1") : this.icon[0]; //二级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'-1' + this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //二级图标中的leaf节点图标 + } else { // 默认主题 或者自定义主题 + this.line = (typeof (this.options.line) === "boolean") ? this.options.line : false; //开启树线,默认不开启 + this.ficon = this.options.ficon || this.ficon; //一级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示一级图标。默认'8' + this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "1") : this.ficon[0]; //一级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'1' + this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1]; // 一级图标中的leaf节点图标 + this.icon = this.options.icon || this.icon; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章,7:文件,8:小圆点,9:齿轮,10:星星, -1:不显示二级图标。默认'5' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "0") : this.icon[0]; //二级图标中的node节点图标。0:文件夹,1:+、-,2:三角形, -1:不显示二级图标,默认'0' + this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //二级图标中的leaf节点图标 + } + + /** 数据加载参数**/ + this.url = this.options.url || this.url; //请求地址 + this.async = (typeof (this.options.async) === "boolean") ? this.options.async : this.async; //异步同步加载,默认异步加载 + this.asyncLoad = this.options.asyncLoad || this.asyncLoad; //初始异步加载层级数据 + this.headers = this.options.headers || this.headers; //ajax header属性 + this.method = this.options.method || this.method; //请求类型 + this.dataType = this.options.dataType || this.dataType; //参数类型 + this.contentType = this.options.contentType || this.contentType; //发送信息至服务器时内容编码类型 + this.defaultRequest = $.extend(this.defaultRequest, this.options.defaultRequest) || this.defaultRequest; //默认请求参数 + this.filterRequest = this.options.filterRequest || this.filterRequest; //过滤请求参数 + this.request = this.options.request || this.request; //用户自定义请求参数 + this.response = $.extend(this.response, this.options.response) || this.response; //返回json格式 + this.data = this.options.data || this.data; //初始化指定该参数,则不会访问异步接口 + this.dataFormat = this.options.dataFormat || this.dataFormat; //用于用户配置的data数据格式,list:列表, levelRelationship:层级关系,默认 + this.dataStyle = this.options.dataStyle || this.dataStyle; //用于用户配置layui通用的json数据风格,layuiStyle:layui风格,defaultStyle:默认风格 + this.errDataShow = (typeof (this.options.errDataShow) === "boolean") ? this.options.errDataShow : this.errDataShow; //是否在使用list模式递归数据出现错误时,显示错误信息 + this.withCredentials = (typeof (this.options.withCredentials) === "boolean") ? this.options.withCredentials : this.withCredentials; //是否允许跨域请求 + this.beforeSend = this.options.beforeSend || this.beforeSend; //异步加载之前的回调 + this.success = this.options.success || this.success; //树加载完毕后执行解析树之前的回调 + this.done = this.options.done || this.done; //树加载完毕后的回调 + this.formatter = $.extend(this.formatter, this.options.formatter)|| this.formatter; //数据过滤 + this.error = this.options.error || this.error; //异步加载异常回调 + this.complete = this.options.complete || this.complete; //异步加载完成回调 + + /** 复选框参数**/ + this.checkbar = this.options.checkbar || this.checkbar; //是否开启复选框模式 + this.checkbarLoad = this.options.checkbarLoad || this.checkbarLoad; //复选框作用范围,node:所有节点, leaf:最后一级;默认所有节点 + this.checkbarType = this.options.checkbarType || this.checkbarType; //复选框选中形式 all:子集选中父级也选中, no-all:子集选中父级半选中,子集全选父级选中,p-casc:父级选中子集全选,子集无法改变父级选中状态, self:没有任何级联关系,only:只能选中一个复选框。 默认all + this.checkbarData = this.options.checkbarData || this.checkbarData; //复选框记录数据类型形式, change表示记录变更数据,choose表示记录选中数据,all记录全部数据,halfChoose记录选中和半选中的数据,默认choose + this.checkbarFun = $.extend(this.checkbarFun, this.options.checkbarFun)|| this.checkbarFun; //checkbar事件加载 + + /** 菜单栏参数**/ + this.menubar = this.options.menubar || this.menubar; //是否打开菜单栏 + this.menubarTips = $.extend(this.menubarTips, this.options.menubarTips) || this.menubarTips; //菜单栏吸附, toolbar:依附在工具栏,group:依附在按钮组,freedom,自由 + this.menubarFun = $.extend(this.menubarFun, this.options.menubarFun) || this.menubarFun; //menubar事件加载 + + /** 工具栏参数**/ + this.toolbar = this.options.toolbar || this.toolbar; //是否开启工具栏 + this.toolbarWay = this.options.toolbarWay || this.toolbarWay; //工具栏显示方式,contextmenu:右键,follow:跟随节点,fixed:固定在节点右侧 + this.toolbarStyle = $.extend(this.toolbarStyle, this.options.toolbarStyle) || this.toolbarStyle; //toolbar的自定义风格,标题,弹框大小 + this.toolbarLoad = this.options.toolbarLoad || this.toolbarLoad; //toolbar作用范围:node:所有节点,noleaf:非最后一级节点,leaf:最后一级 + this.toolbarShow = this.options.toolbarShow || this.toolbarShow; //toolbar三个按钮 + this.toolbarBtn = this.options.toolbarBtn || this.toolbarBtn; //toolbar增删改中内容的自定义加载 + this.toolbarExt = this.options.toolbarExt || this.toolbarExt; //toolbar按钮扩展 + this.toolbarFun = $.extend(this.toolbarFun, this.options.toolbarFun) || this.toolbarFun; //toolbar事件加载 + + /** iframe模式参数**/ + this.useIframe = this.options.useIframe || this.useIframe;//是否加载iframe 默认false + this.iframeElem = this.options.iframeElem || this.iframeElem; //iframe的ID + this.iframeUrl = this.options.iframeUrl || this.iframeUrl; //树关联的iframe地址 + this.iframeLoad = this.options.iframeLoad || this.iframeLoad; //点击哪一层加载frame: node:所有节点, leaf:默认,最后一级 + this.iframeDefaultRequest = $.extend(this.iframeDefaultRequest, this.options.iframeDefaultRequest) || this.iframeDefaultRequest; //iframe的默认传递参数 + this.iframeRequest = $.extend(this.iframeRequest, this.options.iframeRequest) || this.iframeRequest; //iframe的自定义参数 + this.iframeFun = $.extend(this.iframeFun, this.options.iframeFun) || this.iframeFun; //iframe事件加载 + + /** 下拉树模式参数**/ + if(this.select) { + // 重置下拉树 + this.reloadSelectSetting(); + } + + /** 调用确认最终主题方法*/ + this.ensureTheme(); + + }; + + /** + * @Desc: 设置下拉树的基本参数值 + */ + DTree.prototype.selectSetting = function() { + /** select模式参数*/ + this.select = true; //配置成select模式 + + this.selectInitVal = this.obj.attr("data-value") || this.options.selectInitVal || ""; //输入框的值 + this.selectTreeDiv = this.obj[0].id + "_tree_div"; // 上级DIV节点 + this.selectCardDiv = this.obj[0].id + "_select_card_div"; // 上级layui卡片节点 + this.selectDiv = this.obj[0].id + "_select_div"; // 模拟的select节点 + this.selectTipsName = this.obj[0].id + "_select_input"; // select的提示输入框名称 + this.selectTips = this.options.selectTips || "请选择"; // 输入框的提示语 + this.selectCardHeight = this.options.selectCardHeight || "350"; // 下拉面板的高度 + this.selectInputName = this.options.selectInputName || {nodeId: this.obj[0].id + "_select_nodeId"}; // select表单中的元素 + + // 调取下拉树的特殊处理页面元素标识 + this.renderSelectDom(); + } + + /** + * @Desc: 重置下拉树的基本参数值 + */ + DTree.prototype.reloadSelectSetting = function() { + + this.selectInitVal = this.obj.attr("data-value") || this.options.selectInitVal || this.selectInitVal; //输入框的值 + this.selectTips = this.options.selectTips || this.selectTips; // 输入框的提示语 + this.selectCardHeight = this.options.selectCardHeight || this.selectCardHeight; // 下拉面板的高度 + this.selectInputName = $.extend(this.selectInputName, this.options.selectInputName) || this.selectInputName; // select表单中的元素 + + // 调取下拉树的特殊处理页面元素标识 + this.reloadSelectDom(); + } + + /******************** 下拉树设置区域 ********************/ + /** + * @Desc: 渲染下拉树的Dom结构 + */ + DTree.prototype.renderSelectDom = function() { + var _this = this; + var rootId = _this.obj[0].id; + + // 设置自定义表单隐藏域 + var selectInputName = _this.selectInputName; + var selectInput = []; + for(var key in selectInputName) { + selectInput.push(''); + } + + // 设置html + var prevHtml = ['
                        ', + '
                        ', selectInput.join(""), + '', + '', + '
                        '].join(''); + + _this.obj.before(prevHtml); + + var cardStyle = "style="; + if(this.selectCardHeight) { + cardStyle += "'height:"+_this.selectCardHeight+"px'"; + } + _this.obj.wrap('
                        ').wrap('
                        ').wrap('
                        '); + + } + + /** + * @Desc: 重新渲染下拉树的Dom结构 + */ + DTree.prototype.reloadSelectDom = function() { + var _this = this; + var rootId = _this.obj[0].id; + + // 设置自定义表单隐藏域 + var selectInputName = _this.selectInputName; + var selectInput = []; + for(var key in selectInputName) { + selectInput.push(''); + } + + $("div[dtree-id='"+rootId+"'][dtree-select='"+_this.selectDiv+"']").find("div.layui-select-title").html(""); + + // 设置html + var prevHtml = [selectInput.join(""), + '', + ''].join(''); + + $("div[dtree-id='"+rootId+"'][dtree-select='"+_this.selectDiv+"']").find("div.layui-select-title").html(prevHtml); + + var cardStyle = "style="; + if(this.selectCardHeight) { + cardStyle += "'height:"+_this.selectCardHeight+"px'"; + } + $("div[dtree-id='"+rootId+"'][dtree-card='"+_this.selectCardDiv+"']").attr("style", cardStyle); + } + + /** + * @Desc: 设置下拉树模式中,input输入框的值 + * @Param: param: input中的值对应树数据的ID值\当前树选中的数据JSON对象,可不传,不传的话则树内部读取 + */ + DTree.prototype.selectVal = function(param) { + var _this = this; + var rootId = _this.obj[0].id; + var selectInputName = _this.selectInputName; + var selectTipsNameValue = ""; + var selectValues = {}; + + // 如果开启了复选框,则此方法用来取值 + if(_this.checkbar) { + return _this.selectCheckboxVal(); + } + + if(typeof param === 'undefined') { // 不传,则为当前树中记录的ID + param = _this.getNowParam(); + } + if(typeof param === 'string') { // 传递ID,则查询树节点ID对应的值 + param = _this.getParam(param); + } + + selectTipsNameValue = param["context"]; + for(var key in selectInputName) { + selectValues[selectInputName[key]] = param[key]; + $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+selectInputName[key]+"']").val(param[key] || ""); + } + + if(param["nodeId"] && !param["context"]) { + selectTipsNameValue = _this.getParam(param["nodeId"]); + } + + // 返显提示输入框值 + $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+_this.selectTipsName+"']").val(selectTipsNameValue || ""); + + // 返回隐藏域中的值 + return selectValues; + } + + /** + * @Desc: 设置复选框模式中的下拉树的选中值 + */ + DTree.prototype.selectCheckboxVal = function() { + var _this = this; + var rootId = _this.obj[0].id; + var selectInputName = _this.selectInputName; + + // 获取全部复选框选中节点 + var param = _this.getCheckbarJsonArrParam(); + + selectTipsNameValue = param["context"]; + var selectValues = {}; + for(var key in selectInputName) { + var value = param[key].join(","); + selectValues[selectInputName[key]] = value; + $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+selectInputName[key]+"']").val(value); + } + + $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+_this.selectTipsName+"']").val(selectTipsNameValue); + + // 返回隐藏域中的值 + return selectValues; + } + + /** + * @Desc: 重置下拉树的值,1.表单清空;2.节点重置;3.复选框重置 + */ + DTree.prototype.selectResetVal = function() { + var _this = this; + var rootId = _this.obj[0].id; + // 表单清空 + $("input[dtree-id='"+rootId+"']").val(""); + // 节点重置 + _this.cancelNavThis(); + if(_this.checkbar) { + // 复选框重置 + _this.cancelCheckedNode(); + } + } + + + /******************** 字体及图标区域 ********************/ + /** + * @Desc: 树使用的最终主题方案 + */ + DTree.prototype.ensureTheme = function(){ + var _this = this; + + // 确认style + this.style.item = DTREE + this.skin + ITEM; + this.style.itemThis = DTREE + this.skin + ITEMTHIS; + this.style.dfont = DTREE + this.skin + DFONT; + this.style.ficon = DTREE + this.skin + FICON; + this.style.icon = DTREE + this.skin + ICON; + this.style.cbox = DTREE + this.skin + CBOX; + this.style.chs = DTREE + this.skin + CHS; + + // 确认usefontStyle + var iconfont = this.iconfont; + var iconfonts = []; + if(typeof iconfont === 'string') { + iconfonts.push(iconfont); + } else { + iconfonts = iconfont; + } + + var iconfontStyle = this.iconfontStyle; + var iconfontStyles = []; + if(iconfontStyle.length == undefined) { + iconfontStyles.push(iconfontStyle); + } else { + iconfontStyles = iconfontStyle; + } + + for(var i=0; i 0) { + $lis.each(function(){ + _this.showLineLi($(this)); + }); + } else { + _this.obj.find("li[data-id]").each(function(){ + _this.showLineLi($(this)); + }); + } + } + } + + /** + * @Desc: 真正显示树线的方法 + * @Param: $li: JQuery对象,表示组成树的li节点 + */ + DTree.prototype.showLineLi = function($li){ + var _this = this; + var $div = $li.children("div"), + $nextLi = $li.next("li"), + $ul = $li.parent("ul"); + if($ul[0].id == _this.obj[0].id) { + // 根节点下的节点 + $li.removeClass(LI_NAV_LINE); + $li.removeClass(LI_NAV_LAST_LINE); + $li.addClass(LI_NAV_FIRST_LINE); + } else { + // 非根节点下的节点 + var $pnextLi = $ul.parent("li").next("li"); + if($pnextLi.length == 0) { + if($nextLi.length == 0){ + $li.removeClass(LI_NAV_LINE); + $li.removeClass(LI_NAV_FIRST_LINE); + $li.addClass(LI_NAV_LAST_LINE); + } else { + $li.removeClass(LI_NAV_FIRST_LINE); + $li.removeClass(LI_NAV_LAST_LINE); + $li.addClass(LI_NAV_LINE); + } + }else { + var $pnextdiv = $pnextLi.children("div"); + if($nextLi.length == 0 && $div.children("cite").attr("data-leaf") == "leaf" && $pnextdiv.children("cite").attr("data-leaf") == "leaf") { + $li.removeClass(LI_NAV_FIRST_LINE); + $li.removeClass(LI_NAV_LINE); + $li.addClass(LI_NAV_LAST_LINE); + } else { + $li.removeClass(LI_NAV_FIRST_LINE); + $li.removeClass(LI_NAV_LAST_LINE); + $li.addClass(LI_NAV_LINE); + } + } + } + } + + /******************** 初始化数据区域 ********************/ + /** + * @Desc: 设置高度 + */ + DTree.prototype.autoHeight = function(){ + var _this = this; + var height = _this.height; + if(height != "") { + if(_this.elem == _this.scroll){ + _this.obj.parent().css("height", height + "px"); + } else { + var $toolbarDiv = _this.obj.closest(_this.scroll); + $toolbarDiv.css("height", height + "px"); + } + } + }; + + /** + * @Desc: 重载树 + * @Param: options: dtree的所有属性的json对象 + */ + DTree.prototype.reload = function(options){ + var _this = this; + _this.reloadSetting(options); + _this.init(); + }; + + /** + * @Desc: 初始化加载 + */ + DTree.prototype.loadTreeInit = function(){ + var _this = this; + var asyncLoad = _this.asyncLoad; + // 初始化加载 + _this.init(function(){ + // ajax加载之后的回调 + if(asyncLoad && asyncLoad.length > 0) { + _this.obj.addClass(NAV_SHOW); + + // 说明此时要异步加载子节点 + _this.loadChildTreeInit(asyncLoad, 0); + } + }) + } + + /** + * @Desc: 初始化加载子节点 + * @Param: asyncLoad: 需异步加载的层级,在基础属性中配置 + * @Param: i: 已经加载到的层级 + */ + DTree.prototype.loadChildTreeInit = function(asyncLoad, i){ + var _this = this; + if(i == asyncLoad.length) { // 满足条件,终止递归 + return ; + } + + var $div = _this.getNode(asyncLoad[i]); + + if($div && $div.length > 0) { + // 设置节点状态 + var $ul = $div.next("ul"), + $i_fnode = _this.getNodeDom($div).fnode(), + $i_snode = _this.getNodeDom($div).snode(); + + $ul.addClass(NAV_SHOW); + _this.accordionUL($ul); + _this.operateIcon($i_fnode, $i_snode).open(); + // 加载子节点 + _this.getChild($div, undefined, function(){ + // 继续递归 + _this.loadChildTreeInit(asyncLoad, ++i); + }); + } + + } + + /** + * @Desc: 初始化树 + * @Param: callback: 异步加载完成之后的回调函数 + */ + DTree.prototype.init = function(callback){ + var _this = this; + if (typeof _this !== "object") { + layer.msg("树组件未成功加载,请检查配置", {icon:5}); + return ; + } + + // 设置组件高度 + _this.autoHeight(); + + if(_this.data) { + _this.dataLoadTree(true, _this.obj, _this.data); + } else { + _this.asyncLoadTree(true, _this.obj, callback); + } + }; + + /** + * @Desc: 加载子节点 + * @Param: $div: JQuery对象,代表当前子节点的父节点div + * @Param: data: data方式加载的数据 + * @Param: callback: 子节点加载完成之后的回调喊出 + */ + DTree.prototype.getChild = function($div, data, callback) { + var _this = this, $ul = $div.next("ul"); + + _this.setNodeParam($div); + + if(typeof data !== 'undefined') { + _this.dataLoadTree(false, $ul, data); + } else { + _this.asyncLoadTree(false, $ul, callback); + } + }; + + /** + * @Desc: 用data加载树 + * @Param: first: 表示是否第一次加载 + * @Param: $ul: JQuery对象,代表当前数据加载到的ul标签里 + * @Param: data: data加载的数据 + */ + DTree.prototype.dataLoadTree = function(first, $ul, data){ + var _this = this; + + if(typeof data.length === 'undefined'){ + layer.msg("数据解析异常,data数据格式不正确", {icon:5}); + return ; + } + + if(first && data.length == 0) { + $ul.html(_this.getNoneDom().text()); + return ; + } + + //先将ul中的元素清空 + $ul.html(""); + + var index = _this.load ? layer.load(1) : ""; + + setTimeout(function () { + // 加载完毕后执行树解析前的回调 + var returnData = _this.success(data, $ul, first); + if(returnData) { + data = returnData; + } + + var pid = (first == true) ? $ul.attr("data-id") : _this.node.nodeId; + var level = (first == true) ? 1 : parseInt(_this.node.level)+1; + + // 解析树 + if (_this.dataFormat == 'list'){ + //1.构建一个存放节点的树组 + var rootListData = _this.queryListTreeByPid(pid, data); + _this.loadListTree(rootListData, _this.data, level); + } else { + _this.loadTree(data, level); + } + + // 显示树线 + _this.showLine(); + + // 这种情况下需要一开始就将toolbar显示在页面上 + if(_this.toolbar && _this.toolbarWay != 'contextmenu') { + _this.setToolbarDom().setToolbarPlace(_this.toolbarMenu); + } + + // 判断是否存在错误数据,并是否打印错误数据 + _this.msgErrData(); + + // 设置下拉树的初始值 + if(first && _this.select && _this.selectInitVal){ + if(_this.checkbar) { // 复选框模式下 + _this.chooseDataInit(_this.selectInitVal); + _this.selectCheckboxVal(_this.selectInitVal); + } else { // 普通模式下 + _this.dataInit(_this.selectInitVal); + _this.selectVal(_this.selectInitVal); + } + } + + // 保存树副本 + _this.bak = _this.obj.html(); + + // 加载完毕后的回调 + _this.done(_this.data, $ul, first); + + if(_this.load){layer.close(index);} + }, 100); + } + + /** + * @Desc: 异步加载树 + * @Param: first: 表示是否第一次加载 + * @Param: $ul: JQuery对象,代表当前数据加载到的ul标签里 + * @Param: callback: 异步加载完成之后的回调函数 + */ + DTree.prototype.asyncLoadTree = function(first, $ul, callback){ + var _this = this; + + if (!_this.url) { + layer.msg("数据请求异常,url参数未指定", {icon:5}); + return ; + } + + //先将ul中的元素清空 + $ul.html(""); + + var index = ""; + + AjaxHelper.request({ + async: _this.async, + headers: _this.headers, + type: _this.method, + url: _this.url, + dataType: _this.dataType, + contentType: _this.contentType, + withCredentials: _this.withCredentials, + data: _this.getFilterRequestParam(_this.getRequestParam()), + beforeSend: function(XMLHttpRequest, self){ + index = _this.load ? layer.load(1) : ""; + var returnFlag = _this.beforeSend(this, XMLHttpRequest, self); + if(!returnFlag) { + if(_this.load){layer.close(index);} + } + return returnFlag; + }, + success: function(result) { + if (typeof result === 'string') { + result = $.parseJSON(result); + } + + // 加载完毕后执行树解析前的回调 + var returnData = _this.success(result, $ul, first); + if(returnData) { + result = returnData; + } + + var code = ""; + if (_this.dataStyle == 'layuiStyle'){ + code = result[_this.response.statusName]; + } else { + code = result.status[_this.response.statusName]; + } + + if (code == _this.response.statusCode) { + + var d = result[_this.response.rootName]; + + if(first && typeof d.length === 'undefined'){ + $ul.html(_this.getNoneDom().errText("数据解析异常,url回调后的数据格式不正确")); + //layer.msg("数据解析异常,url回调后的数据格式不正确", {icon:5}); + return ; + } + + if(first && d.length == 0) { + $ul.html(_this.getNoneDom().text()); + return ; + } + + //1.识别根节点ul中的data-id标签,判断顶级父节点 + var pid = (first == true) ? $ul.attr("data-id") : _this.node.nodeId; + var level = (first == true) ? 1 : parseInt(_this.node.level)+1; + + // 第一次解析树 + if (_this.dataFormat == 'list'){ + //1.构建一个存放节点的树组 + var rootListData = _this.queryListTreeByPid(pid, d); + if(first) { + _this.loadListTree(rootListData, d, level); + } else { + _this.loadListTree(rootListData, d, level, $ul); + } + } else { + if(first) { + _this.loadTree(d, level); + } else { + _this.loadTree(d, level, $ul); + } + } + + // 显示树线 + _this.showLine(); + + // 这种情况下需要一开始就将toolbar显示在页面上 + if(_this.toolbar && _this.toolbarWay != 'contextmenu') { + _this.setToolbarDom().setToolbarPlace(_this.toolbarMenu); + } + + // 判断是否存在错误数据,并是否打印错误数据 + _this.msgErrData(); + + if(!first) { + $ul.addClass(NAV_SHOW); + } + + // 设置下拉树的初始值 + if(first && _this.select && _this.selectInitVal){ + if(_this.checkbar) { // 复选框模式下 + _this.chooseDataInit(_this.selectInitVal); + _this.selectCheckboxVal(_this.selectInitVal); + } else { // 普通模式下 + _this.dataInit(_this.selectInitVal); + _this.selectVal(_this.selectInitVal); + } + } + + // 保存树副本 + _this.bak = _this.obj.html(); + + // 加载完毕后的回调 + _this.done(result, $ul, first); + + callback && callback(); + } else { + // 如果打印不出任何信息说明是在这里,用了错误的数据格式, 或返回码不正确 + if (_this.dataStyle == 'layuiStyle'){ + _this.obj.html(_this.getNoneDom().errText(result[_this.response.message])); + _this.error(null, code, result[_this.response.message]); + } else { + _this.obj.html(_this.getNoneDom().errText(result.status[_this.response.message])); + _this.error(null, code, result.status[_this.response.message]); + } + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown){// 异步加载异常回调 + _this.obj.html(_this.getNoneDom().errText(textStatus + ": " + errorThrown)); + _this.error(XMLHttpRequest, textStatus, errorThrown); + }, + complete: function(XMLHttpRequest, textStatus){// 异步加载完成回调 + if(_this.load){layer.close(index);} + _this.complete(XMLHttpRequest, textStatus); + } + }); + + } + + /** + * @Desc: 初始化渲染树或者拼接渲染树,list模式下 + * @Param: nowListData: 表示当前需要被渲染的数据 + * @Param: listData: 表示全部数据 + * @Param: level: 当前渲染的层级 + * @Param: $ul: JQuery对象,代表当前数据加载到的ul标签里 + */ + DTree.prototype.loadListTree = function(nowListData, listData, level, $ul){ + var _this = this; + $ul = $ul || _this.getNodeDom().nowOrRootUl(); //当前选中的节点或根节点 + if (nowListData.length > 0){ + for (var i = 0; i < nowListData.length; i++) { + // 1.获取已知节点的全部数据 + var data = nowListData[i]; + if(typeof data !== "object") continue; + var parseData = _this.parseData(data); + var childListData = _this.queryListTreeByPid(parseData.treeId(), listData); // 根据已知数据的id判断该条数据是否还有子数据 + + // 3. 页面元素加载数据 + $ul.append(_this.getLiItemDom(parseData.treeId(), parseData.parentId(), parseData.title(), parseData.fmtTitle(), parseData.last(childListData.length), parseData.ficonClass(), parseData.iconClass(), parseData.checkArr(), level, parseData.spread(level), parseData.disabled(), parseData.hide(), parseData.basicData(), parseData.recordData(), ($ul.hasClass(UL_ROOT) ? "root" : "item"))); + // 4.有子数据的元素加载子节点 + if(childListData.length > 0){ + var cLevel = parseInt(level)+1; + _this.loadListTree(childListData, listData, cLevel, _this.obj.find("ul[data-id='"+parseData.treeId()+"']")); + } + } + } + }; + + /** + * @Desc: 根据父ID查找list数据中匹配的元素 + * @Param: pid: 表示父ID + * @Param: listData: 表示全部数据 + */ + DTree.prototype.queryListTreeByPid = function(pid, listData){ + var _this = this; + var rootListData = []; + if (listData) { + for (var i = 0; i < listData.length; i++) { + var data = listData[i]; + if(typeof data !== "object") continue; + if(pid == "null" || pid == null){ + if(data[_this.response.parentId] == null) { rootListData.push(data); } + } else { + if (data[_this.response.parentId] == pid){ + if (data[_this.response.treeId] == pid){ + _this.errData.push(data); + } else { + rootListData.push(data); + } + } + } + } + } + return rootListData; + }; + + /** + * @Desc: 初始化渲染树或者拼接渲染树,层级关系模式下 + * @Param: listData: 表示全部数据 + * @Param: level: 当前渲染的层级 + * @Param: $ul: JQuery对象,代表当前数据加载到的ul标签里 + */ + DTree.prototype.loadTree = function(listData, level, $ul){ + var _this = this; + if (listData) { + $ul = $ul || _this.getNodeDom().nowOrRootUl(); //当前选中的节点或根节点 + for (var i = 0; i < listData.length; i++) { // 遍历跟节点或追加的跟节点 + var data = listData[i]; + if(typeof data !== "object") continue; + if(data[_this.response.treeId] == data[_this.response.parentId]) { _this.errData.push(data); } + var parseData = _this.parseData(data); + var children = parseData.children(); + $ul.append(_this.getLiItemDom(parseData.treeId(), parseData.parentId(), parseData.title(), parseData.fmtTitle(), parseData.last(children.length), parseData.ficonClass(), parseData.iconClass(), parseData.checkArr(), level, parseData.spread(level), parseData.disabled(), parseData.hide(), parseData.basicData(), parseData.recordData(), ($ul.hasClass(UL_ROOT) ? "root" : "item"))); + if (children.length != 0) { + var cLevel = parseInt(level)+1; + _this.loadTree(children, cLevel, _this.obj.find("ul[data-id='"+parseData.treeId()+"']")); + } + } + } + }; + + /** + * @Desc: 判断在数据加载时是否存在错误数据,并是否打印错误数据 + * @Param: + */ + DTree.prototype.msgErrData = function() { + var _this = this; + if(_this.errData.length > 0 && _this.errDataShow) { + var title = ""; + for(var i=0; i<_this.errData.length; i++) { + var edata = _this.errData[i]; + title += "数据:【"+edata[_this.response.title]+"】中节点id和上级id值一致! \n"; + } + layer.msg(title, {icon:2,time:5000}); + } + // 显示之后,将错误数据制空 + _this.errData = []; + }; + + /** + * @Desc: 解析单个数据 + * @Param: data: 被解析的单个数据对象 + */ + DTree.prototype.parseData = function(data) { + var _this = this; + + return { + treeId: function(){ + return data[_this.response.treeId]; + }, + parentId: function(){ + return data[_this.response.parentId]; + }, + fmtTitle: function(){ + if(typeof _this.formatter.title === 'function'){ + var ftitle = _this.formatter.title(data); + var tt = data[_this.response.title]; + tt = (ftitle == "" || ftitle == undefined || ftitle == null) ? tt : ftitle; + return tt || ""; + } + return data[_this.response.title]; + }, + title: function(){ + return data[_this.response.title]; + }, + level: function(){ + return data[_this.response.level] || ""; + }, + ficonClass: function(){ + return data[_this.response.ficonClass] || ""; + }, + iconClass: function(){ + return data[_this.response.iconClass] || ""; + }, + last: function(len){ + return ((len == 0) ? + ((typeof (data[_this.response.last]) === "boolean") ? data[_this.response.last] : true) : + ((typeof (data[_this.response.last]) === "boolean") ? data[_this.response.last] : false)); + }, + spread: function(level){ + return ((level < _this.initLevel) ? + ((typeof (data[_this.response.spread]) === "boolean") ? data[_this.response.spread] : true) : + ((typeof (data[_this.response.spread]) === "boolean") ? data[_this.response.spread] : false)); + }, + disabled: function(){ + return (typeof (data[_this.response.disabled]) === "boolean") ? data[_this.response.disabled] : false; + }, + hide: function(){ + return (typeof (data[_this.response.hide]) === "boolean") ? data[_this.response.hide] : false; + }, + checkArr: function(){ + var checkArr = []; + var checkArrData = data[_this.response.checkArr]; + if(typeof checkArrData === 'string'){ + if(checkArrData.indexOf("{") > -1 && checkArrData.indexOf("}") > -1){ + checkArrData = JSON.parse(checkArrData); + } else { + checkArrData = {"type":"0","checked":checkArrData}; + } + } + if((typeof checkArrData === 'object') && (checkArrData !== null)){ + if(typeof checkArrData.length === 'undefined'){ + checkArr.push(checkArrData); + } else { + checkArr = checkArrData; + } + } + + if(checkArr.length > 0 && checkArr.length > _this.checkArrLen){ + _this.checkArrLen = checkArr.length; // 获取复选框个数 + } + return checkArr; + + }, + children: function(){ + return data[_this.response.childName] || []; + }, + basicData: function(){ + return event.escape(JSON.stringify(data[_this.response.basicData])) || JSON.stringify({}); + }, + recordData: function(){ + var recordData = _this.record ? event.cloneObj(data, [_this.response.treeId, + _this.response.parentId, + _this.response.title, + _this.response.iconClass, + _this.response.childName, + _this.response.last, + _this.response.spread, + _this.response.disabled, + _this.response.hide, + _this.response.checkArr, + _this.response.checked, + _this.response.type, + _this.response.basicData]) : {}; + + return event.escape(JSON.stringify(recordData)); + }, + data: function(){ + return data; + } + } + + }; + + /** + * @Desc: 无节点数据、节点数据异常时显示dom + */ + DTree.prototype.getNoneDom = function(){ + var _this = this, + rootId = _this.obj[0].id, + noneTitle = _this.none; + + return { + text: function(){ + return "
                        "+noneTitle+"
                        "; + }, + errText: function(errInfo){ + return "
                        "+errInfo+"
                        "; + } + } + }; + + /** + * @Desc: 新增节点的dom值 + * @Param: treeId: 节点ID + * @Param: parentId: 节点父ID + * @Param: title: 节点标题 + * @Param: fmtTitle: 节点附加标题 + * @Param: last: 是否最后一级节点 + * @Param: ficonClass: 一级图标class + * @Param: iconClass: 二级图标class + * @Param: checkArr: 复选框 + * @Param: spread: 是否展开 + * @Param: disabled: 是否禁用 + * @Param: hide: 是否隐藏 + */ + DTree.prototype.getDom = function(treeId, parentId, title, fmtTitle, last, ficonClass, iconClass, checkArr, level, spread, disabled, hide) { + var _this = this, + rootId = _this.obj[0].id, + toolbar = _this.toolbar, + checkbar = _this.checkbar; + + return { + fnode: function() { // + - 图标 + // 获取图标的变量 + var fnodeIcon = _this.fnodeIcon, + fleafIcon = _this.fleafIcon; + + var fleafIconLeaf = _this.usefontStyle.fnode.leaf, + fnodeIconOpen = _this.usefontStyle.fnode.node.open, + fnodeIconClose = _this.usefontStyle.fnode.node.close; + + if(ficonClass){ + var iconfont = _this.iconfont; + if(typeof iconfont === 'string') { + fleafIconLeaf = iconfont + " " + ficonClass; + fnodeIconOpen = iconfont + " " + ficonClass; + fnodeIconClose = iconfont + " " + ficonClass; + } else { + fleafIconLeaf = iconfont[0] + " " + ficonClass; + fnodeIconOpen = iconfont[0] + " " + ficonClass; + fnodeIconClose = iconfont[0] + " " + ficonClass; + } + } + + if(fnodeIcon != "-1" && fleafIcon != "-1"){ // 都加载 + return last ? "" : + (spread ? "" : ""); + } + + if(fnodeIcon != "-1" && fleafIcon == "-1"){ // 加载node 隐藏leaf + return last ? "" : + (spread ? "" : ""); + } + + if(fnodeIcon == "-1" && fleafIcon != "-1"){ // 隐藏node 加载leaf + return last ? "" : + (spread ? "" : ""); + } + + if(fnodeIcon == "-1" && fleafIcon == "-1"){ // 都隐藏 + return last ? "" : + (spread ? "" : ""); + } + }, + node: function() { // 二级图标样式 + // 获取图标的变量 + var nodeIcon = _this.nodeIcon, + leafIcon = _this.leafIcon; + + var sleafIconLeaf = _this.usefontStyle.snode.leaf, + snodeIconOpen = _this.usefontStyle.snode.node.open, + snodeIconClose = _this.usefontStyle.snode.node.close; + if(iconClass){ + var iconfont = _this.iconfont; + if(typeof iconfont === 'string') { + sleafIconLeaf = iconfont + " " + iconClass; + snodeIconOpen = iconfont + " " + iconClass; + snodeIconClose = iconfont + " " + iconClass; + } else { + sleafIconLeaf = iconfont[0] + " " + iconClass; + snodeIconOpen = iconfont[0] + " " + iconClass; + snodeIconClose = iconfont[0] + " " + iconClass; + } + } + + if(nodeIcon != "-1" && leafIcon != "-1"){ // 都加载 + return last ? "" : + (spread ? "" : ""); + } + + if(nodeIcon != "-1" && leafIcon == "-1"){ // 加载node 隐藏leaf + return last ? "" : + (spread ? "" : ""); + } + + if(nodeIcon == "-1" && leafIcon != "-1"){ // 隐藏node 加载leaf + return last ? "" : + (spread ? "" : ""); + } + + if(nodeIcon == "-1" && leafIcon == "-1"){ // 都隐藏 + return last ? "" : + (spread ? "" : ""); + } + }, + checkbox: function() { // 复选框 + var flag = false; + if(_this.checkbarLoad == "node"){if (checkbar) {flag = true;}} else {if (last) {if (checkbar) {flag = true;}}} + + if(flag){ + var result = "
                        "; + if(checkArr && checkArr.length > 0){ + + for (var i = 0; i < checkArr.length; i++) { + var checkData = checkArr[i]; + var checked = checkData[_this.response.checked]; + var type = checkData[_this.response.type]; + var CHOOSE_CLASS = _this.usefontStyle.checkbox.out; + if (checked == "2") { //半选择 + CHOOSE_CLASS = _this.usefontStyle.checkbox.noall + " " + _this.style.chs; + } else if (checked == "1") { //选择 + CHOOSE_CLASS = _this.usefontStyle.checkbox.on + " " + _this.style.chs; + } else { //未选择或者无值 + CHOOSE_CLASS = _this.usefontStyle.checkbox.out; + } + var disClass = ""; + if(disabled){disClass = NAV_DIS;} + result += ""; + } + } + result += "
                        "; + return result; + } + + return ""; + }, + text: function() { // 文字显示 + var disClass = ""; + if(disabled){disClass = NAV_DIS;} + return ""+fmtTitle+""; + }, + ul: function() { //子节点ul + return last ? "
                          " : + (spread ? "
                            " : "
                              "); + } + }; + }; + + /** + * @Desc: 替换节点的dom值,或指定这些值 + * @Param: $div: JQuery对象,表示当前被操作的节点 + * @Param: treeId: 节点ID + * @Param: last: 是否最后一级节点 + * @Param: spread: 是否展开 + * @Param: disabled: 是否禁用 + * @Param: hide: 是否隐藏 + */ + DTree.prototype.replaceDom = function($div, treeId, last, spread, disabled, hide) { + var _this = this, + rootId = _this.obj[0].id, + toolbar = _this.toolbar, + checkbar = _this.checkbar; + + return { + fnode: function(ficonClass) { // + - 图标 + var fnode = ""; + + // 获取图标的变量 + var fnodeIcon = _this.fnodeIcon, + fleafIcon = _this.fleafIcon; + + var fleafIconLeaf = _this.usefontStyle.fnode.leaf, + fnodeIconOpen = _this.usefontStyle.fnode.node.open, + fnodeIconClose = _this.usefontStyle.fnode.node.close; + + if(ficonClass){ + var iconfont = _this.iconfont; + if(typeof iconfont === 'string') { + fleafIconLeaf = iconfont + " " + ficonClass; + fnodeIconOpen = iconfont + " " + ficonClass; + fnodeIconClose = iconfont + " " + ficonClass; + } else { + fleafIconLeaf = iconfont[0] + " " + ficonClass; + fnodeIconOpen = iconfont[0] + " " + ficonClass; + fnodeIconClose = iconfont[0] + " " + ficonClass; + } + } + + if(fnodeIcon != "-1" && leafIcon != "-1"){ // 都加载 + fnode = last ? "" : + (spread ? "" : ""); + }else if(nodeIcon != "-1" && leafIcon == "-1"){ // 加载node 隐藏leaf + fnode = last ? "" : + (spread ? "" : ""); + }else if(nodeIcon == "-1" && leafIcon != "-1"){ // 隐藏node 加载leaf + fnode = last ? "" : + (spread ? "" : ""); + }else if(nodeIcon == "-1" && leafIcon == "-1"){ // 都隐藏 + fnode = last ? "" : + (spread ? "" : ""); + } + if(fnode != ""){_this.getNodeDom($div).fnode().replaceWith($(fnode));} + }, + node: function(iconClass) { // 二级图标样式 + var snode = ""; + + // 获取图标的变量 + var nodeIcon = _this.nodeIcon, + leafIcon = _this.leafIcon; + + var sleafIconLeaf = _this.usefontStyle.snode.leaf, + snodeIconOpen = _this.usefontStyle.snode.node.open, + snodeIconClose = _this.usefontStyle.snode.node.close; + if(iconClass){ + var iconfont = _this.iconfont; + if(typeof iconfont === 'string') { + sleafIconLeaf = iconfont + " " + iconClass; + snodeIconOpen = iconfont + " " + iconClass; + snodeIconClose = iconfont + " " + iconClass; + } else { + sleafIconLeaf = iconfont[0] + " " + iconClass; + snodeIconOpen = iconfont[0] + " " + iconClass; + snodeIconClose = iconfont[0] + " " + iconClass; + } + } + + if(nodeIcon != "-1" && leafIcon != "-1"){ // 都加载 + snode = last ? "" : + (spread ? "" : ""); + }else if(nodeIcon != "-1" && leafIcon == "-1"){ // 加载node 隐藏leaf + snode = last ? "" : + (spread ? "" : ""); + }else if(nodeIcon == "-1" && leafIcon != "-1"){ // 隐藏node 加载leaf + snode = last ? "" : + (spread ? "" : ""); + }else if(nodeIcon == "-1" && leafIcon == "-1"){ // 都隐藏 + snode = last ? "" : + (spread ? "" : ""); + } + if(snode != ""){_this.getNodeDom($div).snode().replaceWith($(snode));} + }, + checkbox: function(checkArr) { // 复选框 + var flag = false; + if(_this.checkbarLoad == "node"){if (checkbar) {flag = true;}} else {if (last) {if (checkbar) {flag = true;}}} + + if(flag){ + var result = "
                              "; + if(checkArr && checkArr.length > 0){ + + for (var i = 0; i < checkArr.length; i++) { + var checkData = checkArr[i]; + var checked = checkData[_this.response.checked]; + var type = checkData[_this.response.type]; + var CHOOSE_CLASS = _this.usefontStyle.checkbox.out; + if (checked == "2") { //半选择 + CHOOSE_CLASS = _this.usefontStyle.checkbox.noall + " " + _this.style.chs; + } else if (checked == "1") { //选择 + CHOOSE_CLASS = _this.usefontStyle.checkbox.on + " " + _this.style.chs; + } else { //未选择或者无值 + CHOOSE_CLASS = _this.usefontStyle.checkbox.out; + } + var disClass = ""; + if(disabled){disClass = NAV_DIS;} + result += ""; + } + } + result += "
                              "; + _this.getNodeDom($div).snode().next("div").replaceWith($(result)); + } + }, + text: function(title) { // 文字显示 + var disClass = ""; + if(disabled){disClass = NAV_DIS;} + var cite = ""+title+"" + _this.getNodeDom($div).cite().replaceWith($(cite)); + }, + ul: function() { //子节点ul + var ul = last ? "
                                " : + (spread ? "
                                  " : "
                                    "); + _this.getNodeDom($div).nextUl().replaceWith($(ul)); + }, + div: function(){ + $div.attr("data-id", treeId); + }, + basicData: function(basicData){ + basicData = (basicData == "{}") ? "" : basicData; + $div.attr("data-basic", basicData); + }, + recordData: function(recordData){ + recordData = (recordData == "{}") ? "" : recordData; + $div.attr("data-record", recordData); + }, + p_li: function(pId){ + var $li = $div.parent("li"); + $li.attr("data-id", treeId); + if(pId) { + $li.attr("data-pid", pId); + } + return $li; + } + }; + + }; + + /** + * @Desc: 获取拼接好的li的dom + * @Param: treeId: 节点ID + * @Param: parentId: 节点父ID + * @Param: title: 节点标题 + * @Param: fmtTitle: 节点附加标题 + * @Param: last: 是否最后一级节点 + * @Param: ficonClass: 一级图标class + * @Param: iconClass: 二级图标class + * @Param: checkArr: 复选框 + * @Param: level: 当前li的层级 + * @Param: spread: 是否展开 + * @Param: disabled: 是否禁用 + * @Param: hide: 是否隐藏 + * @Param: basicData: 自定义的扩展字段值(转义后的JSON字符) + * @Param: recordData: 开启记录模式的记录值(转义后的JSON字符) + * @Param: isRoot: 当前节点是否是根节点下的节点 + */ + DTree.prototype.getLiItemDom = function(treeId, parentId, title, fmtTitle, last, ficonClass, iconClass, checkArr, level, spread, disabled, hide, basicData, recordData, isRoot) { + var _this = this, + rootId = _this.obj[0].id; + + var dom = _this.getDom(treeId, parentId, title, fmtTitle, last, ficonClass, iconClass, checkArr, level, spread, disabled, hide); + basicData = (basicData == "{}") ? "" : basicData; + recordData = (recordData == "{}") ? "" : recordData; + var div = "
                                    " + + div , + dom.fnode(), + dom.node(), + dom.checkbox(), + dom.text(), + "
                                    ", dom.ul(), ""].join(""); + + return li; + }; + + /** + * @Desc: 初始化节点,用于数据回显 + * @Param: chooseId: 节点ID + */ + DTree.prototype.dataInit = function(chooseId){ + var _this = this; + var $div = _this.obj.find("div[data-id='"+chooseId+"']"); + if($div && $div.length > 0) { + _this.obj.find("."+NAV_THIS).removeClass(NAV_THIS); + _this.obj.find("."+_this.style.itemThis).removeClass(_this.style.itemThis); + $div.addClass(NAV_THIS); + $div.addClass(_this.style.itemThis); + _this.setNodeParam($div); + // 将该节点的父节点全部展开 + var $li_parents = $div.parents("."+LI_NAV_ITEM); + $li_parents.children("ul").addClass(NAV_SHOW); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.fnode.node.close)).addClass(_this.usefontStyle.fnode.node.open); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.fnode.node.close)).removeClass(_this.usefontStyle.fnode.node.close); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.snode.node.close)).addClass(_this.usefontStyle.snode.node.open); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.snode.node.close)).removeClass(_this.usefontStyle.snode.node.close); + } + return _this.getNowParam(); + }; + + /** + * @Desc: 基于备份的Html数据回滚 + * @Param: chooseId: 节点ID + */ + DTree.prototype.rollbackHtml = function(chooseId){ + var _this = this; + if(_this.bak) { + _this.obj.html(_this.bak); + // 取消全部选中状态 + _this.cancelNavThis(); + if(_this.checkbar) { + _this.cancelCheckedNode(); + _this.chooseDataInit(chooseId); + } else { + _this.dataInit(chooseId); + } + + _this.bak = _this.obj.html(); + } + }; + + + /******************** 基础事件区域 ********************/ + /** + * @Desc: 数据格式化 + * @Param: html: 需要格式化的数据 + */ + DTree.prototype.escape = function(html){ + return event.escape(html); + }; + + /** + * @Desc: 格式化数据转回正常数据 + * @Param: str: 需要转回的数据 + */ + DTree.prototype.unescape = function(str){ + return event.unescape(str); + }; + + /** + * @Desc: 取消选中当前选中的div + */ + DTree.prototype.cancelNavThis = function(){ + var _this = this; + _this.obj.find("div[data-id]").parent().find("."+NAV_THIS).removeClass(NAV_THIS); + _this.obj.find("div[data-id]").parent().find("."+_this.style.itemThis).removeClass(_this.style.itemThis); + } + + /** + * @Desc: 选中div + * @Param: id: 当前div本身 / 当前选中div的id值 + */ + DTree.prototype.navThis = function(id){ + var _this = this; + var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']"); + if($div != null) { + _this.cancelNavThis(); + $div.addClass(NAV_THIS); + $div.addClass(_this.style.itemThis); + } + } + + /** + * @Desc: 手风琴模式操作其他节点 + * @Param: $ul: JQuery对象,表示dtree中的ul节点 + */ + DTree.prototype.accordionUL = function($ul) { + var _this = this; + if(_this.accordion) { + $ul.closest("li[data-index]").siblings("li[data-index]").children("ul[data-id]").removeClass(NAV_SHOW); + var $divs = $ul.closest("li[data-index]").siblings("li[data-index]").children("ul[data-id]").prev("div"); + if($divs.length && $divs.length > 0) { + for (var i=0; i<$divs.length; i++) { + var $div = $($divs[i]); + var $i_fnode = _this.getNodeDom($div).fnode(), + $i_snode = _this.getNodeDom($div).snode(); + if($i_fnode.attr("data-spread") != 'last'){ + _this.operateIcon($i_fnode, $i_snode).close(); + } + } + } + + } + }; + + /** + * @Desc: 展开或隐藏节点 作用点: div + * @Param: $div: JQuery对象,表示当前操作的div节点 + */ + DTree.prototype.clickSpread = function($div) { + var _this = this; + var $i_fnode = _this.getNodeDom($div).fnode(), + $i_snode = _this.getNodeDom($div).snode(), + $cite = _this.getNodeDom($div).cite(), + spread = $i_fnode.attr("data-spread"), + $ul = $div.next("ul"); + + if ($ul.length > 0) { + if (spread == "close") { + if (_this.type=="load") { //增加加载 + if (_this.cache) { //开启缓存 + if ($ul.html()) { + $ul.addClass(NAV_SHOW); + _this.accordionUL($ul); + } else { //加载节点 + _this.getChild($div); + _this.accordionUL($ul); + } + }else { //每次取新的数据 + $ul.html(""); + _this.getChild($div); + _this.accordionUL($ul); + } + } else { // 全量加载 + $ul.addClass(NAV_SHOW); + _this.accordionUL($ul); + } + _this.operateIcon($i_fnode, $i_snode).open(); + } else if (spread == "open") { + $ul.removeClass(NAV_SHOW); + _this.operateIcon($i_fnode, $i_snode).close(); + } + } + }; + + /** + * @Desc: 设置节点为disabled + * @Param: disabledIds: 需要设置禁用的节点id字符串集合(用,分割)/id数组 + */ + DTree.prototype.setDisabledNodes = function(disabledIds){ + var _this = this; + var disabledId = []; + if(typeof disabledIds === "string") { + disabledId = disabledIds.split(","); + } else { + disabledId = disabledIds; + } + + if(disabledIds.length) { + for (var i=0; i 0) { + _this.getChild($div, data); + } else { + var parseData = _this.parseData(data); + + if(parseData.treeId()){ + var level = parseInt($div.parent("li").attr("data-index"))+1; + $ul.append(_this.getLiItemDom(parseData.treeId(), parseData.parentId(), parseData.title(), parseData.fmtTitle(), parseData.last(0), parseData.ficonClass(), parseData.iconClass(), parseData.checkArr(), level, parseData.spread(), parseData.disabled(), parseData.hide(), parseData.basicData(), parseData.recordData(), "item")); + + // 建造完毕后,选中该DIV + $thisDiv = $ul.find("div[data-id='"+parseData.treeId()+"']"); + _this.setNodeParam($thisDiv); + + _this.showLine($ul.find("li")); + } else { + layer.msg("添加失败,节点ID为undefined!",{icon:5}); + // 重新赋值 + _this.setNodeParam($div); + } + } + } else { + _this.getChild($div); + } + } + + /** + * @Desc: 局部刷新树--编辑当前节点选中节点时 + * @Param: $div: JQuery对象,当前编辑节点的Div + * @Param: data: 当前需要渲染的数据,JSON对象、字符串 + */ + DTree.prototype.partialRefreshEdit = function($div, data){ + var _this = this; + $ul = $div.next("ul"), + $p_li = $div.parent("li"); + + if(data) { + if(typeof data === 'object') { + var parseData = _this.parseData(data); + + if(parseData.treeId()){ + var replaceDom = _this.replaceDom($div, parseData.treeId(), parseData.last(0), parseData.spread(), parseData.disabled(), parseData.hide()); + replaceDom.div(); + replaceDom.node(parseData.iconClass()); + replaceDom.checkbox(parseData.checkArr()); + replaceDom.text(parseData.title()); + replaceDom.ul(); + replaceDom.basicData(parseData.basicData()); + replaceDom.recordData(parseData.recordData()); + + var parentId = parseData.parentId(); + var oldParentId = $p_li.attr("data-pid"); + if(parentId && parentId != oldParentId) { + // 变更了父节点 + $p_li = replaceDom.p_li(parentId); + + // 根据parentId找到下挂节点的ul + var $goto_div = _this.getNodeDom(parentId).div(), + $goto_ul = _this.getNodeDom(parentId).nextUl(); + // 判断父级ul中是否还存在li,如果不存在,则需要修改节点的样式 + if($goto_ul.children("li").length == 0){ + var $icon_i = $goto_div.find("i[data-spread]"); + _this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).openWithLeaf(); + $goto_ul.addClass(NAV_SHOW); + } + $goto_ul.append($p_li); + } else { + replaceDom.p_li(); + } + _this.setNodeParam($div); + } else { + layer.msg("编辑失败,节点ID为undefined!",{icon:5}); + // 重新赋值 + _this.setNodeParam($div); + } + } else { + _this.getNodeDom($div).cite().html(data); + } + } + } + + /** + * @Desc: 局部刷新树--当前节点选中被删除时 + * @Param: $div: JQuery对象,当前被删除节点的Div + */ + DTree.prototype.partialRefreshDel = function($div){ + var _this = this; + $p_li = $div.parent("li"); + $p_ul = _this.getNodeDom($div).parentUl(); + $p_div = _this.getNodeDom($div).parentDiv(); + + $p_li.remove(); + _this.showLine($p_ul.find("li")); + // 判断父级ul中是否还存在li,如果不存在,则需要修改节点的样式 + if($p_ul.children("li").length == 0){ + var $icon_i = $p_div.find("i[data-spread]"); + _this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).closeWithLeaf(); + } + _this.initNodeParam(); + } + + /*** + * @Desc: 搜索节点,保留上级节点 + * @param: value: 传入的节点名称 + * layui-dtree群友: 没水平的水瓶提供。 + */ + DTree.prototype.fuzzySearch = function (value) { + var _this = this; + // + if (value.trim() == '') { + _this.obj.find("li").removeClass("layui-hide").attr("dtree-hide", false) + return + } + _this.obj.find("li").addClass("layui-hide").attr("dtree-hide", true) + + var cites = [] + var filterMode = _this.filterMode + /*if (filterMode == 'default') { + cites = _this.obj.find("li>div cite:contains('" + value + "')"); + }*/ + cites = _this.obj.find("li>div cite:contains('" + value + "')"); + cites.each(function (index, cite) { + var li = $(cite).parent().parent(); + var curNode = _this.getParam(li.attr("data-id")); + li.removeClass("layui-hide").attr("dtree-hide", false); + // 显示所有子级 + li.find('ul li').removeClass("layui-hide").attr("dtree-hide", false); + // 显示所有父级 + li.parents('li').removeClass("layui-hide").attr("dtree-hide", false); + }) + } + + /******************** 复选框区域 ********************/ + /** + * @Desc: 初始化复选框的值 + * @Param: chooseIds: 需要被选中的节点id字符串集合(用,分割)/id数组/id二维数组(多级复选框) + */ + DTree.prototype.chooseDataInit = function(chooseIds){ + var _this = this; + // 多级复选框二维数组 + var chooseIdArrs = []; + var chooseId = []; + if(typeof chooseIds === "string") { + chooseId = chooseIds.split(","); + } else { + chooseId = chooseIds; + } + if(chooseId.length) { + // 说明是数组 + for (var i=0; i."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).noCheck(); + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var flag = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length; + if (flag == 0) { + //把父级去掉选中 + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($item_i).noCheck(); + } + } + } else { + // 处理当前节点的选中状态 + _this.checkStatus($i).check(); + + // 处理子级节点的选中状态 + var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).check(); + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + //把父级选中 + _this.checkStatus($item_i).check(); + } + } + }; + + /** + * @Desc: 实现复选框点击, no-all 子集选中父级半选中,子集全选父级选中 + * @Param: $i: JQuery对象,表示当前点击的checkbox节点 + */ + DTree.prototype.checkAllOrNoallOrNot = function($i) { + var _this = this; + //$i 当前点击的checkbox + var $div = $i.closest("."+LI_DIV_ITEM), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + if ($i.attr("data-checked") == "1") { //当前复选框为选中状态,点击后变为未选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).noCheck(); + + // 处理子级节点的选中状态 + var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).noCheck(); + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var flag = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length; + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + if (flag == 0) { + //把父级去掉选中 + _this.checkStatus($item_i).noCheck(); + } else { + //把父级半选 + _this.checkStatus($item_i).noallCheck(); + } + } + } else { //当前复选框为未选中状态,点击后变为选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).check(); + + // 处理子级节点的选中状态 + var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).check(); + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var flag1 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length; + var flag2 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']").length; + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + if (flag1 != flag2) { + // 父级复选框半选 + _this.checkStatus($item_i).noallCheck(); + } else { + // 父级复选框全选 + _this.checkStatus($item_i).check(); + } + } + } + }; + + /** + * @Desc: 实现复选框点击,p-casc:父级选中子集全选,子集无法改变父级选中状态 + * @Param: $i: JQuery对象,表示当前点击的checkbox节点 + */ + DTree.prototype.checkAllOrPcascOrNot = function($i) { + var _this = this; + //$i 当前点击的checkbox + var $div = $i.closest("."+LI_DIV_ITEM), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + if ($i.attr("data-checked") == "1") { //当前复选框为选中状态,点击后变为未选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).noCheck(); + + // 处理子级节点的选中状态 + var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).noCheck(); + + } else { //当前复选框为未选中状态,点击后变为选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).check(); + + // 处理子级节点的选中状态 + var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).check(); + } + }; + + /** + * @Desc: 实现复选框点击,self:各自选中互不影响 + * @Param: $i: JQuery对象,表示当前点击的checkbox节点 + */ + DTree.prototype.checkOrNot = function($i) { + var _this = this; + //$i 当前点击的checkbox + var $div = $i.closest("."+LI_DIV_ITEM), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + if ($i.attr("data-checked") == "1") { //当前复选框为选中状态,点击后变为未选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).noCheck(); + } else { //当前复选框为未选中状态,点击后变为选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).check(); + } + }; + + /** + * @Desc: 实现复选框点击,only:只能选中1个复选框 + * @Param: $i: JQuery对象,表示当前点击的checkbox节点 + */ + DTree.prototype.checkOnly = function($i) { + var _this = this; + //$i 当前点击的checkbox + var $div = $i.closest("."+LI_DIV_ITEM), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + var checked = $i.attr("data-checked"); + // 将全部节点全部设为未选中状态 + var $all_i = _this.obj.find("i[data-checked]"); + _this.checkStatus($all_i).noCheck(); + + if (checked != "1") { //当前复选框为未选中状态,点击后变为选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).check(); + } + }; + + /** + * @Desc: 实现复选框点击汇总,分派具体的点击方式 + * @Param: $i: JQuery对象,表示当前点击的checkbox节点 + */ + DTree.prototype.changeCheck = function($i) { + var _this = this; + var temp = _this.temp; + if(typeof $i === 'undefined') { + $i = temp[0]; + } + // 复选框选中事件 + if (_this.checkbarType == "all") { + _this.checkAllOrNot($i); + } else if(_this.checkbarType == "no-all") { + _this.checkAllOrNoallOrNot($i); + } else if(_this.checkbarType == "p-casc") { + _this.checkAllOrPcascOrNot($i); + } else if(_this.checkbarType == "self") { + _this.checkOrNot($i); + } else if(_this.checkbarType == "only") { + _this.checkOnly($i); + } else { + _this.checkAllOrNot($i); + } + + if(_this.select) { + // 设置复选框模式中的下拉树的值 + _this.selectCheckboxVal(); + } + + // 获取复选框选中节点的内容 + var checkbarNodes = _this.setAndGetCheckbarNodesParam(true); + + // 用户自定义想做的事情 + _this.checkbarFun.chooseDone(checkbarNodes); + layui.event.call(this, MOD_NAME, "chooseDone("+$(_this.obj)[0].id+")", {"checkbarParams": checkbarNodes}); + _this.temp = []; + }; + + /** + * @Desc: 复选框半选状态初始化设置,树节点渲染完毕后重置半选状态 + */ + DTree.prototype.initNoAllCheck = function(){ + var _this = this; + //1.获取所有选中节点 + var $is = _this.obj.find("i[data-checked='1']"); + if($is.length > 0){ + for ( var key = 0; key < $is.length; key++) { + var $i = $($is[key]), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var flag1 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length; + var flag2 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']").length; + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + if (flag1 != flag2) { + // 父级复选框半选 + _this.checkStatus($item_i).noallCheck(); + } else { + // 父级复选框全选 + _this.checkStatus($item_i).check(); + } + } + } + } + }; + + /** + * @Desc: 复选框选中状态初始化设置,树节点渲染完毕后重置选中状态 + */ + DTree.prototype.initAllCheck = function(){ + var _this = this; + //1.获取所有选中节点 + var $is = _this.obj.find("i[data-checked='1']"); + if($is.length > 0){ + for ( var key = 0; key < $is.length; key++) { + var $i = $($is[key]), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + // 父级复选框全选 + _this.checkStatus($item_i).check(); + } + } + } + }; + + /** + * @Desc: 设置复选框选中/未选中/半选 _this.checkStatus($i).check(); _this.checkStatus($i).noCheck(); _this.checkStatus($i).noallCheck(); + * @Param: $i: JQuery对象,表示当前点击的checkbox节点 + */ + DTree.prototype.checkStatus = function($i) { + var _this = this; + return { + check: function(){ + $i.removeClass(_this.usefontStyle.checkbox.out); + $i.removeClass(_this.usefontStyle.checkbox.noall); + $i.addClass(_this.usefontStyle.checkbox.on); + $i.addClass(_this.style.chs); + $i.attr("data-checked","1"); + }, + noCheck: function(){ + $i.removeClass(_this.usefontStyle.checkbox.noall); + $i.removeClass(_this.usefontStyle.checkbox.on); + $i.removeClass(_this.style.chs); + $i.addClass(_this.usefontStyle.checkbox.out); + $i.attr("data-checked","0"); + }, + noallCheck: function(){ + $i.removeClass(_this.usefontStyle.checkbox.out); + $i.removeClass(_this.usefontStyle.checkbox.on); + $i.addClass(_this.usefontStyle.checkbox.noall); + $i.addClass(_this.style.chs); + $i.attr("data-checked","2"); + } + } + }; + + /** + * @Desc: 设置树的复选框操作值的全部参数,并获取 + * @Param: requestParamFlag: 设置复选框返回值的数据结构, true:基于请求类型的返回对象数组, false:原始的节点返回对象数组 + */ + DTree.prototype.setAndGetCheckbarNodesParam = function(requestParamFlag) { + var _this = this; + //操作前先清空 + _this.checkbarNode = []; + // 选择所有复选框节点 + if (_this.checkbarData == "change"){ //记录变更数据 + _this.obj.find("i[data-par][dtree-disabled='false']").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + if ($i.attr("data-checked") != $i.attr("data-initchecked")) { + if(requestParamFlag) { + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + } else { + _this.checkbarNode.push(_this.getCheckbarNodeParam($div, $i)); + } + } + }); + } else if (_this.checkbarData == "all"){ //记录全部数据 + _this.obj.find("i[data-par][data-checked][dtree-disabled='false']").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + if(requestParamFlag) { + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + } else { + _this.checkbarNode.push(_this.getCheckbarNodeParam($div, $i)); + } + }); + } else if (_this.checkbarData == "choose"){ //记录选中数据 + _this.obj.find("i[data-par][data-checked='1'][dtree-disabled='false']").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + if(requestParamFlag) { + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + } else { + _this.checkbarNode.push(_this.getCheckbarNodeParam($div, $i)); + } + }); + } else if (_this.checkbarData == "halfChoose"){ //记录选中和半选数据 + _this.obj.find("i[data-par][data-checked='1'][dtree-disabled='false']").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + if(requestParamFlag) { + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + } else { + _this.checkbarNode.push(_this.getCheckbarNodeParam($div, $i)); + } + }); + _this.obj.find("i[data-par][data-checked='2'][dtree-disabled='false']").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + if(requestParamFlag) { + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + } else { + _this.checkbarNode.push(_this.getCheckbarNodeParam($div, $i)); + } + }); + } + return _this.checkbarNode; + }; + + /** + * @Desc: 获取树的复选框操作值的全部参数 + */ + DTree.prototype.getCheckbarNodesParam = function() { + var _this = this; + return _this.setAndGetCheckbarNodesParam(true); + }; + + /** + * @Desc: 获取树的一个复选框的参数 + * @Param: $div: JQuery对象,表示当前选中节点 + * @Param: $i: JQuery对象,表示当前选中的复选框节点 + */ + DTree.prototype.getCheckbarNodeParam = function($div, $i){ + var _this = this; + var temp_node = {}; + temp_node.nodeId = $div.attr("data-id"); + temp_node.parentId = _this.getNodeDom($div).parentLi().attr("data-pid"); + temp_node.context = (typeof _this.formatter.title === 'function') ? _this.getNodeDom($div).cite().attr("data-title") : _this.getNodeDom($div).cite().text(); + temp_node.leaf = _this.getNodeDom($div).cite().attr("data-leaf") == "leaf" ? true : false; + temp_node.level = _this.getNodeDom($div).parentLi().attr("data-index"); + temp_node.spread = _this.getNodeDom($div).fnode().attr("data-spread") == "open" ? true : false; + + var basicData = $div.attr("data-basic"); + if(basicData) { + basicData = JSON.parse(event.unescape(basicData)); + } + temp_node.basicData = basicData; + var recordData = $div.attr("data-record"); + if(recordData) { + recordData = JSON.parse(event.unescape(recordData)); + } + temp_node.recordData = recordData; + + temp_node.dataType = $i.attr("data-type"); + temp_node.checked = $i.attr("data-checked"); + temp_node.initchecked = $i.attr("data-initchecked"); + return temp_node; + }; + + /** + * @Desc: 获取基于返回参数的树的复选框参数,选中数据横向存储 + */ + DTree.prototype.getCheckbarJsonArrParam = function(){ + var _this = this; + var checkbarJsonArr = { + nodeId: [], //节点ID + parentId: [], //父节点ID + context: [], //节点内容 + leaf: [], //是否叶子节点 + level: [], //层级 + spread: [], //节点展开状态 + dataType: [], //节点标记 + checked: [], //节点复选框选中状态 + initchecked: [], //节点复选框初始状态 + basicData: [], //用户自定义的记录节点数据 + recordData: [], //当前data数据(排除basicData和children字段) + }; + // 获取全部复选框选中节点 + var params = _this.setAndGetCheckbarNodesParam(false); + if(params && params.length > 0) { + for(var i=0; i 0) { _this.checkStatus($i).check(); } + } + + /** + * @Desc: 取消全部复选框选中 + */ + DTree.prototype.cancelCheckedNode = function(){ + var _this = this; + var $i = _this.obj.find("i[data-par][data-checked!='0']"); + if($i.length > 0) { _this.checkStatus($i).noCheck(); } + } + + /** + * @Desc: 反选复选框 + */ + DTree.prototype.invertCheckedNode = function(){ + var _this = this; + if(_this.obj.find("i[data-par]").length > 0) { + var flag = false; + _this.obj.find("i[data-par]").each(function(){ + var $i = $(this); + if($i.attr("data-checked") == '2'){ + flag = true; + }else if($i.attr("data-checked") == '0') { + _this.checkStatus($i).check(); + }else if($i.attr("data-checked") == '1') { + _this.checkStatus($i).noCheck(); + } + }); + + if(flag) { + _this.initNoAllCheck(); + } else { + _this.initAllCheck(); + } + } + } + + /** + * @Desc: 删除选中节点 + */ + DTree.prototype.removeCheckedNode = function(){ + var _this = this; + var len = _this.obj.find("i[data-par][data-checked='1']").length; + if(len == 0){ + layer.msg("请至少选中一个节点",{icon:2}); + }else{ + //操作前先清空 + _this.checkbarNode = []; + // 选择所有复选框节点 + var i_node = {}; + _this.obj.find("i[data-par][data-checked='1']").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + }); + + layer.confirm('确定要删除选中节点?', {icon: 3, title:'删除选中节点'}, function(index1){ + var flag = _this.menubarFun.remove(_this.checkbarNode); + if(flag){ + _this.obj.find("i[data-par][data-checked='1']").closest("."+LI_DIV_ITEM).next("ul").remove(); + _this.obj.find("i[data-par][data-checked='1']").closest("."+LI_DIV_ITEM).remove(); + _this.checkbarNode=[]; + } + + layer.close(index1); + }); + } + } + + /******************** 工具栏及菜单栏区域 ********************/ + /** + * @Desc: 初始化菜单栏和工具栏的div + */ + DTree.prototype.initTreePlus = function(){ + var _this = this; + // 初始化菜单栏和工具栏的div + _this.obj.prevAll('div#dtree_menubar_'+_this.obj[0].id).remove(); + _this.toolbarMenu = {}; + if(_this.menubar && _this.menubarTips.group && _this.menubarTips.group.length > 0) _this.obj.before("
                                    "); + if(_this.toolbar){ + if(_this.toolbarWay == "contextmenu") { + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).remove(); + if(_this.toolbarShow && _this.toolbarShow.length > 0) { + _this.obj.before("
                                    "); + } + } + } + + }; + + /** + * @Desc: 开启工具栏和菜单栏 + */ + DTree.prototype.openTreePlus = function(){ + var _this = this; + // 先对工具栏做处理,因为菜单栏可能会与工具栏产生关联。 + var ggMenu = []; + if(_this.toolbar) _this.getToolbarDom(); + + if(_this.menubar) { + var menubarTips = _this.menubarTips, + mtbar = menubarTips.toolbar, + group = menubarTips.group, + freedom = menubarTips.freedom; + if(mtbar && mtbar.length > 0){ + // 菜单栏吸附工具栏上 + for(var i=0; i 0){ + // 菜单栏吸附在上方的按钮组div中 + for(var i=0; i"; + break; + case defaultMenu.moveUp: + gg = ""; + break; + case defaultMenu.refresh: + gg = ""; + break; + case defaultMenu.checkAll: + gg = (_this.checkbar && _this.checkbarType != 'only') ? "" : ""; + break; + case defaultMenu.unCheckAll: + gg = (_this.checkbar && _this.checkbarType != 'only') ? "" : ""; + break; + case defaultMenu.invertAll: + gg = (_this.checkbar && _this.checkbarType != 'only') ? "" : ""; + break; + case defaultMenu.remove: + gg = (_this.checkbar) ? "" : ""; + break; + case defaultMenu.searchNode: + gg = ""; + break; + } + return gg; + }; + + /** + * @Desc: 获取扩展菜单栏 + * @Param: menu: 扩展菜单栏的Json对象 + */ + DTree.prototype.getExtMenubarDom = function(menu){ + var _this = this; + return ""; + }; + + /** + * @Desc: 获取依附在工具栏的菜单栏 + * @Param: menu: 菜单栏的具体操作字符串 + */ + DTree.prototype.getMenubarToolDom = function(menu){ + var _this = this; + var rootId = _this.obj[0].id; + switch (menu) { + case defaultMenu.moveDown: + _this.toolbarMenu[defaultMenu.moveDown] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.moveDown, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.movedown, "展开全部"); + break; + case defaultMenu.moveUp: + _this.toolbarMenu[defaultMenu.moveUp] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.moveUp, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.moveup, "收缩全部"); + break; + case defaultMenu.refresh: + _this.toolbarMenu[defaultMenu.refresh] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.refresh, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.refresh, "刷新"); + break; + case defaultMenu.checkAll: + if(_this.checkbar && _this.checkbarType != 'only') + _this.toolbarMenu[defaultMenu.checkAll] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.checkAll, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.checkAll, "全选节点"); + break; + case defaultMenu.unCheckAll: + if(_this.checkbar && _this.checkbarType != 'only') + _this.toolbarMenu[defaultMenu.unCheckAll] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.unCheckAll, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.unCheckAll, "全不选节点"); + break; + case defaultMenu.invertAll: + if(_this.checkbar && _this.checkbarType != 'only') + _this.toolbarMenu[defaultMenu.invertAll] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.invertAll, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.invertAll, "反选节点"); + break; + case defaultMenu.remove: + if(_this.checkbar) + _this.toolbarMenu[defaultMenu.remove] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.remove, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.remove, "删除选中"); + break; + case defaultMenu.searchNode: + _this.toolbarMenu[defaultMenu.searchNode] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.searchNode, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.searchNode, "查询"); + break; + } + }; + + /** + * @Desc: 获取依附在工具栏的扩展菜单栏 + * @Param: menu: 扩展菜单栏的Json对象 + */ + DTree.prototype.getExtMenubarToolDom = function(menu){ + var _this = this; + _this.toolbarMenu[menu.menubarId] = _this.setToolbarDom().setMenuToolbarOption(menu.menubarId, menu.title, _this.usefontStyle.toolbar.menubarExt+" "+menu.icon, ""); + }; + + /** + * @Desc: menubar内置方法 + */ + DTree.prototype.menubarMethod = function(){ + var _this = this; + return { + openAllNode: function(obj){ // 展开所有节点 + var $ulNode = obj || _this.obj.children("li").children("ul"); + // 遍历所有ul子节点 + for (var i = 0; i < $ulNode.length; i++) { + // 获取当前节点的信息 + var $ul = $($ulNode[i]), + $div = $ul.prev("div"), + $i_fnode = _this.getNodeDom($div).fnode(), + $i_snode = _this.getNodeDom($div).snode(), + $cite = _this.getNodeDom($div).cite(), + spread = $i_fnode.attr("data-spread"), + leaf = $cite.attr("data-leaf"); + + if (leaf == "leaf") { + continue; + } // 说明是叶子了,则继续循环下一个 + + if (spread == "open") { + // 说明该节点已经展开了,则进行子节点循环 + } else { + if (_this.type=="load") { //是否全量加载 + if (_this.cache) { //是否开启缓存 + if ($ul.html()) { + $ul.addClass(NAV_SHOW); + } else { //加载节点 + _this.getChild($div); + } + }else { //每次取新的数据 + $ul.html(""); + _this.getChild($div); + } + } else { // 全量加载 + $ul.addClass(NAV_SHOW); + } + _this.operateIcon($i_fnode, $i_snode).open(); + + } + var $childUl = $ul.children("li").children("ul"); + _this.menubarMethod().openAllNode($childUl); + } + }, + closeAllNode: function(){ //收缩所有节点 + _this.obj.find("."+LI_NAV_CHILD).each(function(){ + // 获取当前节点的信息 + var $ul = $(this), + $div = $ul.prev("div"), + $i_fnode = _this.getNodeDom($div).fnode(), + $i_snode = _this.getNodeDom($div).snode(), + $cite = _this.getNodeDom($div).cite(), + spread = $i_fnode.attr("data-spread"), + leaf = $cite.attr("data-leaf"); + + $ul.removeClass(NAV_SHOW); + if(leaf !== "leaf") { + _this.operateIcon($i_fnode, $i_snode).close(); + } + }); + }, + refreshTree: function(){// 刷新树 + _this.refreshTree(); + }, + checkAll: function(){ // 全选节点 + _this.checkAllNode(); + }, + unCheckAll: function(){ // 全不选节点 + _this.cancelCheckedNode(); + }, + invertAll: function(){ // 反选节点 + _this.invertCheckedNode(); + }, + remove: function(){// 删除选中节点 + _this.removeCheckedNode(); + }, + searchNode: function(){//模糊查询该值,展开该值节点 + layer.prompt({ + formType: 0, + value: "", + title: '查询节点' + }, function(value, index1, elem){ + if (value) { + var flag = _this.searchNode(value); + if (!flag) { + layer.msg("该名称节点不存在!", {icon:5}); + } + } else { + layer.msg("未指定查询节点名称", {icon:5}); + } + layer.close(index1); + }); + }, + extMethod: function(menuId, $div, flag){ + if(_this.menubar && _this.menubarTips.group && _this.menubarTips.group.length > 0 && flag == "group"){ + for(var i=0; i<_this.menubarTips.group.length; i++){ + var ext = _this.menubarTips.group[i]; + if (menuId == ext.menubarId){ + ext.handler(_this.getRequestParam(_this.getNodeParam($div), $div)); + break; + } + } + } + if(_this.menubar && _this.menubarTips.toolbar && _this.menubarTips.toolbar.length > 0 && flag == "toolbar"){ + for(var i=0; i<_this.menubarTips.toolbar.length; i++){ + var ext = _this.menubarTips.toolbar[i]; + if (menuId == ext.menubarId){ + ext.handler(_this.getRequestParam(_this.getNodeParam($div), $div)); + break; + } + } + } + if(_this.menubar && _this.menubarTips.freedom && _this.menubarTips.freedom.length > 0 && flag == "freedom"){ + for(var i=0; i<_this.menubarTips.freedom.length; i++){ + var ext = _this.menubarTips.freedom[i]; + if (menuId == ext.menubarId){ + ext.handler(_this.getRequestParam(_this.getNodeParam($div), $div)); + break; + } + } + } + } + }; + }; + + /** + * @Desc: menubar监听方法 + * @Param: menuId:菜单栏的具体操作字符串 + * @Param: flag:菜单栏的显示方式 + */ + DTree.prototype.menubarListener = function(menuId, flag){ + var _this = this; + var $div = _this.getNodeDom().nowDiv(); + switch (menuId) { + case defaultMenu.moveDown: // 展开全部节点 + _this.menubarMethod().openAllNode(); + break; + case defaultMenu.moveUp: // 收缩全部节点 + _this.menubarMethod().closeAllNode(); + break; + case defaultMenu.refresh: + _this.menubarMethod().refreshTree(); // 刷新树 + break; + case defaultMenu.checkAll: + _this.menubarMethod().checkAll(); + break; + case defaultMenu.unCheckAll: + _this.menubarMethod().unCheckAll(); + break; + case defaultMenu.invertAll: + _this.menubarMethod().invertAll(); + break; + case defaultMenu.remove: + _this.menubarMethod().remove(); + break; + case defaultMenu.searchNode: + _this.menubarMethod().searchNode(); + break; + default: + _this.menubarMethod().extMethod(menuId, $div, flag); + break; + } + }; + + /** + * @Desc: 模糊查询该值,展开该值节点 + * @Param: value: 模糊查询的值 + */ + DTree.prototype.searchNode = function(value){ + var _this = this; + var b = false; + var $lis = []; + _this.obj.find("cite[data-leaf]").each(function(){ + var $nthis = $(this); + var html = $nthis.html(); + if(html.indexOf(value) > -1){ + if($nthis.attr("data-leaf") == "leaf") { + // 叶子节点提供包含父节点的所有信息 + var title = ""; + $nthis.parents("li").each(function(){ + title = "-" + $(this).find("cite[data-leaf]").html() + title; + }); + title = title.substring(1, title.length); + $nthis.attr("title", title); + } + // 保存当前cite所在的li及父li中包含该值,则只保留父的 + var i = 0; + $nthis.parents("li").each(function(){ + var html2 = $(this).find("cite[data-leaf]").html(); + if(html2.indexOf(value) > -1){ + i++; + } + if(i >= 2){ + return true; + } + }); + if (i < 2){ + $lis.push($nthis.closest("li").prop("outerHTML")); + } + } + }); + if($lis.length > 0) { + b = true; + // 1.将树节点清空 + _this.obj.html(""); + // 2.遍历所有cite节点,展开当前cite节点 + for(var i=0; i<$lis.length; i++){ + _this.obj.append($lis[i]); + } + } + return b; + }; + + + /******************** 工具栏区域 ********************/ + /** + * @Desc: 获取工具栏 + */ + DTree.prototype.getToolbarDom = function(){ + var _this = this; + var toolbarShow = _this.toolbarShow, + toolbarExt = _this.toolbarExt, + toolbarWay = _this.toolbarWay; + + if(toolbarShow.length > 0){ + for(var i=0; i 0){ + for(var i=0; i "+other +title+""; + } else if(toolbarWay == "fixed" || toolbarWay == "follow") { + return ""; + } + }, + setMenuToolbarOption: function(menubarId, title, classId, other){ + var rootId = _this.obj[0].id; + if(toolbarWay == "contextmenu") { + return "
                                     "+other +title+"
                                    "; + } else if(toolbarWay == "fixed" || toolbarWay == "follow") { + return ""; + } + }, + setToolbarPlace: function(toolbarMenu){ + if(toolbarWay == "contextmenu") { + if(toolbarMenu){ + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).find('div.layui-nav-item>dl.layui-nav-child').html(""); + for(var key in toolbarMenu){ + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).find('div.layui-nav-item>dl.layui-nav-child').append(toolbarMenu[key]); + } + } + } else if(toolbarWay == "fixed" || toolbarWay == "follow") { + _this.obj.find("cite[data-leaf][dtree-disabled='false']").each(function(){ + var $cite = $(this); + _this.dynamicToolbarDom($cite); + }); + } + } + } + }; + + /** + * @Desc: 在节点后动态绑定fixed和follow条件的工具栏 + * @Param: $cite: JQuery对象,表示当前文本节点 + */ + DTree.prototype.dynamicToolbarDom = function($cite){ + var _this = this; + var toolbarWay = _this.toolbarWay; + if($cite.next("em."+TOOLBAR_TOOL_EM).length == 0) { + var $div = $cite.parent("div"); + var param = _this.getRequestParam(_this.getTempNodeParam($div)); + var toolbarMenus = _this.toolbarFun.loadToolbarBefore(event.cloneObj(_this.toolbarMenu), param, $div); + var hideCls = (toolbarWay == "follow") ? NAV_HIDE : ""; + var em = [""]; + if(toolbarMenus){ + for(var key in toolbarMenus){ + em.push(toolbarMenus[key]); + } + } + em.push(""); + $cite.after(em.join('')); + } + } + + /** + * @Desc: 隐藏toolbar + */ + DTree.prototype.toolbarHide = function() { + var _this = this; + if(_this.toolbar && _this.toolbarWay == "contextmenu") { + var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id); + $toolBarDiv.find(".layui-nav-child").removeClass('layui-anim-fadein layui-show'); + } + } + + /** + * @Desc: toolbar内置方法 + */ + DTree.prototype.toolbarMethod = function(){ + var _this = this; + return { + pulldown: function(obj){ // 展开当前点击节点的下面全部节点 + if(!obj) return; + var $ulNode = obj; + // 遍历所有ul子节点 + for (var i = 0; i < $ulNode.length; i++) { + // 获取当前节点的信息 + var $ul = $($ulNode[i]), + $div = $ul.prev("div"), + $i_fnode = _this.getNodeDom($div).fnode(), + $i_snode = _this.getNodeDom($div).snode(), + $cite = _this.getNodeDom($div).cite(), + spread = $i_fnode.attr("data-spread"), + leaf = $cite.attr("data-leaf"); + + if (leaf == "leaf") { continue; } // 说明是叶子了,则继续循环下一个 + + if (spread == "open") { + // 说明该节点已经展开了,则进行子节点循环 + } else { + if (_this.type=="load") { //是否全量加载 + if (_this.cache) { //是否开启缓存 + if ($ul.html()) { + $ul.addClass(NAV_SHOW); + } else { //加载节点 + _this.getChild($div); + } + }else { //每次取新的数据 + $ul.html(""); + _this.getChild($div); + } + } else { // 全量加载 + $ul.addClass(NAV_SHOW); + } + _this.operateIcon($i_fnode, $i_snode).open(); + + } + var $childUl = $ul.children("li").children("ul"); + _this.toolbarMethod().pulldown($childUl); + } + }, + pullup: function($li){ // 收缩当前点击节点的下面全部节点 + $li.find("."+LI_NAV_CHILD).each(function(){ + // 获取当前节点的信息 + var $ul = $(this), + $div = $ul.prev("div"), + $i_fnode = _this.getNodeDom($div).fnode(), + $i_snode = _this.getNodeDom($div).snode(), + $cite = _this.getNodeDom($div).cite(), + spread = $i_fnode.attr("data-spread"), + leaf = $cite.attr("data-leaf"); + + $ul.removeClass(NAV_SHOW); + if(leaf !== "leaf") { + _this.operateIcon($i_fnode, $i_snode).close(); + } + }); + } + } + }; + + /** + * @Desc: toolbar监听方法 + * @Param: tool: 工具栏的具体操作字符串 + * @Param: $div: JQuery对象,表示当前操作节点 + */ + DTree.prototype.toolbarListener = function(tool, $div) { + var _this = this; + var $cite = $div.children("cite[data-leaf]"), + $ul = $div.next("ul"), + $p_li = $div.parent("li[data-index]"), //当前选中节点的顶级li节点 + $p_ul = $p_li.parent("ul"), //当前选中节点的顶级li节点的父级ul + $p_div = $p_ul.prev("div"), //当前选中节点的顶级li节点的父级ul的前一个div + title = (typeof _this.formatter.title === 'function') ? $cite.attr("data-title") : $cite.text(); + + switch (tool) { + case defaultTool.pulldown: + _this.toolbarMethod().pulldown($ul); + break; + case defaultTool.pullup: + _this.toolbarMethod().pullup($p_li); + break; + case defaultTool.addTool: + var content = _this.loadToolBar(title, defaultTool.addTool); + + layer.open({ + title: "新增"+_this.toolbarStyle.title, + type: 1, + area: _this.toolbarStyle.area, + content: content, + success: function(layero, index){ + form.render(); + form.on("submit(dtree_addNode_" + _this.obj[0].id + "_form)",function(data){ + var data = data.field; + var parentId = $div.attr("data-id"), + id = $div.attr("data-id")+"_node_"+$ul[0].childNodes.length, + leaf = true, + checked = "0", + level = parseInt($p_li.attr("data-index"))+1; + + var type = _this.response.type; + var checked = _this.response.checked; + // 创建子节点的DOM,添加子节点 + var checkArr = []; + if (_this.checkArrLen > 0) { + for (var i = 0; i < _this.checkArrLen; i++) { + checkArr.push({type: i, checked: "0"}); + } + } + + $ul.append(_this.getLiItemDom(id, parentId, data.addNodeName, data.addNodeName, true, "", "", checkArr, level, false, false, false, "", "", "item")); + // 先将li节点隐藏 + $ul.find("li[data-id='"+id+"']").hide(); + // 重新赋值 + var $addDiv = $ul.find("div[data-id='"+id+"']"); + node = _this.getNodeParam($addDiv); + + //获取组装后的requestNode,组合参数 + var requestNode = _this.getRequestParam(node); + requestNode = $.extend(requestNode, data); + + _this.temp = [id, $ul, $div, level]; + // 用户自定义想做的事情 + _this.toolbarFun.addTreeNode(requestNode, $div); + + layer.close(index); + return false; + }); + } + }); + break; + case defaultTool.editTool: + var content = _this.loadToolBar(title, defaultTool.editTool); + + layer.open({ + title: "编辑"+_this.toolbarStyle.title, + type: 1, + area: _this.toolbarStyle.area, + content: content, + success: function(layero, index){ + _this.toolbarFun.editTreeLoad(_this.getRequestParam(_this.getNodeParam($div))); + form.render(); + form.on("submit(dtree_editNode_" + _this.obj[0].id + "_form)",function(data){ + var data = data.field; + $cite.html(data.editNodeName); + node = _this.getNodeParam($div); + var requestNode = _this.getRequestParam(node); + requestNode = $.extend(requestNode, data); + _this.temp = [$cite, $div, title, $p_div]; + _this.toolbarFun.editTreeNode(requestNode, $div); + + layer.close(index); + }); + } + }); + break; + case defaultTool.delTool: + layer.confirm('确定要删除该'+_this.toolbarStyle.title+'?', {icon: 3, title:'删除'+_this.toolbarStyle.title}, function(index){ + var node = _this.getNodeParam($div); + _this.temp = [$p_li, $p_div]; + _this.toolbarFun.delTreeNode(_this.getRequestParam(_this.getNodeParam($div)), $div); + + layer.close(index); + }); + break; + default: + if(_this.toolbarExt.length > 0){ + for(var i=0; i<_this.toolbarExt.length; i++){ + var ext = _this.toolbarExt[i]; + if (tool == ext.toolbarId){ + ext.handler(_this.getRequestParam(_this.getNodeParam($div)), $div); + break; + } + } + } + break; + } + } + + + /** + * @Desc: 加载toolbar中的内容 + * @Param: title: 默认操作中的input输入框的值 + * @Param: name: 工具栏的具体操作字符串 + */ + DTree.prototype.loadToolBar = function(title, name){ + var _this = this; + var toolbarShow = _this.toolbarShow; + var nodeBarContents = _this.toolbarBtn; + + var html = ""; + switch (name) { + case defaultTool.addTool: + var addNodeBarDef = [{"label": "当前选中", "name": "nodeTitle", "type": "text", "value": title, "defElem": "nowChoose", "readonly": true}, + {"label": "新增"+_this.toolbarStyle.title, "name": "addNodeName", "type": "text", "value": "", "defElem": "nowChange", "verify": "required"}, + {"type": "submit", "value": "确认添加", "defElem": "btn", "filter": "dtree_addNode_" + _this.obj[0].id + "_form"}]; + + //2. 用户自定义的节点内容 + var addNodeBar = ['
                                    ']; + + if(nodeBarContents != null && nodeBarContents.length > 0){ + if(nodeBarContents[0] != null && nodeBarContents[0] != undefined && nodeBarContents[0].length > 0){ + var addNodeBarContents = nodeBarContents[0]; + // 1. 检查是否包含了now、newly、btn这三个默认项,将其他元素依次排列,将特殊元素至于栈顶 + for(var i=0; i', '
                                    ']; + // 3.遍历生成按钮 + for(var j=0; j
                                    '); + addNodeBar.push(addBtn.join('')); + addNodeBar.push('
                                    '); + html = addNodeBar.join(''); + break; + + case defaultTool.editTool: + var editNodeBarDef = [{"label": "当前选中", "name": "nodeTitle", "type": "text", "value": title, "defElem": "nowChoose", "readonly": true}, + {"label": "编辑"+_this.toolbarStyle.title, "name": "editNodeName", "type": "text", "value": "", "defElem": "nowChange", "verify": "required"}, + {"type": "submit", "value": "确认编辑", "defElem": "btn", "filter": "dtree_editNode_" + _this.obj[0].id + "_form"}]; + + var editNodeBar = ['
                                    ']; + //2. 用户自定义的节点内容 + if(nodeBarContents != null && nodeBarContents.length > 0){ + + if(nodeBarContents[1] != null && nodeBarContents[1] != undefined && nodeBarContents[1].length > 0){ + var editNodeBarContents = nodeBarContents[1]; + // 1. 检查是否包含了now、newly、btn这三个默认项,将其他元素依次排列,将特殊元素至于栈顶 + for(var i=0; i', '
                                    ']; + // 3.遍历生成按钮 + for(var j=0; j
                                    '); + editNodeBar.push(editBtn.join('')); + editNodeBar.push('
                                    '); + html = editNodeBar.join(''); + break; + } + return html; + }; + + /** + * @Desc: 获取toolbar详细的标签信息 + * @Param: nodeBarContents: 工具栏中的数据渲染内容JSON对象 + */ + DTree.prototype.loadToolBarDetail = function(nodeBarContents){ + var _this = this; + var readonly = (typeof (nodeBarContents.readonly) === "boolean") ? nodeBarContents.readonly : false; + var disabled = (typeof (nodeBarContents.disabled) === "boolean") ? nodeBarContents.disabled : false; + var id = nodeBarContents.id ? nodeBarContents.id : ""; + var name = nodeBarContents.name ? nodeBarContents.name : ""; + var val = nodeBarContents.value ? nodeBarContents.value : ""; + var verify = nodeBarContents.verify ? nodeBarContents.verify : ""; + var placeholder = nodeBarContents.placeholder ? nodeBarContents.placeholder : val; + return{ + text: function(){ + return ['
                                    ', + '', + '
                                    ', + '', + '
                                    ', + '
                                    '].join(''); + }, + textarea: function(){ + return ['
                                    ', + '', + '
                                    ', + '', + '
                                    ', + '
                                    '].join(''); + }, + hidden: function(){ + return [''].join(''); + }, + select: function(){ + var optionsData = (typeof nodeBarContents.optionsData === 'object') ? nodeBarContents.optionsData : nodeBarContents.optionsData(); + var options = ""; + for(var key in optionsData){ + if(val == optionsData[key]){ + options += ""; + } else { + options += ""; + } + } + return ['
                                    ', + '', + '
                                    ', + '', '
                                    ', '
                                    '].join(''); + }, + submit: function(){ + var filter = nodeBarContents.filter; + return [''].join(''); + }, + button: function(){ + return [''].join(''); + }, + reset: function(){ + return [''].join(''); + } + } + }; + + /** + * @Desc: 新增节点后改变节点内容 + * @Param: returnID: 当前需要加载的内容,JSON对象、字符串、指定字符串("refresh")、true + */ + DTree.prototype.changeTreeNodeAdd = function(returnID){ + var _this = this; + var temp = _this.temp; + var id = temp[0], $ul = temp[1], $div = temp[2], level = temp[3]; + var flag = false; + if(returnID){ + var $thisDiv = _this.obj.find("[data-id='"+id+"']"); + if(typeof returnID === "object"){ + // 如果是JSON格式数据,则将当前DIV删除,重新建造DIV + $thisDiv.remove(); + var parseData = _this.parseData(returnID); + + if(parseData.treeId()){ + $ul.append(_this.getLiItemDom(parseData.treeId(), parseData.parentId(), parseData.title(), parseData.fmtTitle(), parseData.last(0), parseData.ficonClass(), parseData.iconClass(), parseData.checkArr(), level, parseData.spread(), parseData.disabled(), parseData.hide(), parseData.basicData(), parseData.recordData(), "item")); + + // 建造完毕后,选中该DIV + $thisDiv = $ul.find("div[data-id='"+parseData.treeId()+"']"); + _this.setNodeParam($thisDiv) + } else { + layer.msg("添加失败,节点ID为undefined!",{icon:5}); + // 将li节点删除 + $ul.find("li[data-id='"+id+"']").remove(); + // 重新赋值 + _this.setNodeParam($div); + // 临时变量制空 + _this.temp = []; + return ; + } + }else if(returnID == 'refresh' || returnID == true){ + // 如果是设置为refresh参数,则向后台发送请求,获取新增节点下的真实参数,局部刷新树。 + flag = true; + } else if(typeof returnID === "string" || typeof returnID === 'number'){ + $thisDiv.attr("data-id", returnID); + // 将li节点展示 + $ul.find("li[data-id='"+returnID+"']").show(); + _this.setNodeParam($thisDiv) + } + + // 判断当前点击的节点是否是最后一级节点,如果是,则需要修改节点的样式 + var $icon_i = $div.find("i[data-spread]"); + if ($icon_i.eq(0).attr("data-spread") == "last") { + _this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).openWithLeaf(); + } else { //如果不是,也要修改节点样式 + _this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).open(); + } + $ul.addClass(NAV_SHOW); //展开UL + _this.accordionUL($ul); + if(flag) { + _this.getChild($div); + } else { + // _this.showLine(); + _this.showLine($ul.find("li")); + // 这种情况下需要在新增节点后对节点新增工具栏 + if(_this.toolbar && _this.toolbarWay != 'contextmenu') { + _this.dynamicToolbarDom($thisDiv.find("cite[data-leaf]")); + } + } + + } else { + // 将li节点删除 + $ul.find("li[data-id='"+id+"']").remove(); + // 重新赋值 + _this.setNodeParam($div); + } + + _this.temp = []; // 临时变量制空 + + }; + + /** + * @Desc: 编辑页打开后显示编辑页内容 + * @Param: param: 编辑页打开之后回显的数据集 + */ + DTree.prototype.changeTreeNodeDone = function(param){ + var _this = this; + form.val('dtree_editNode_' + _this.obj[0].id + '_form', param); + form.render(); + }; + + /** + * @Desc: 修改节点后改变节点内容 + * @Param: returnID: 当前需要变更的内容,JSON对象 + */ + DTree.prototype.changeTreeNodeEdit = function(returnID){ + var _this = this; + var temp = _this.temp; + var $cite = temp[0], $div = temp[1], title = temp[2], $p_div = temp[3]; + var flag = false; + if(returnID){ + if(typeof returnID === "object"){ + var parseData = _this.parseData(data); + + if(parseData.treeId()){ + var replaceDom = _this.replaceDom($div, parseData.treeId(), parseData.last(0), parseData.spread(), parseData.disabled(), parseData.hide()); + replaceDom.node(parseData.iconClass()); + replaceDom.checkbox(parseData.checkArr()); + replaceDom.text(parseData.title()); + replaceDom.ul(); + replaceDom.basicData(parseData.basicData()); + replaceDom.recordData(parseData.recordData()); + _this.setNodeParam($div); + } else { + layer.msg("编辑失败,节点ID为undefined!",{icon:5}); + // 重新赋值 + _this.setNodeParam($div); + } + } + } else { + $cite.html(title); + _this.getNodeParam($div); + } + + _this.temp = []; // 临时变量制空 + }; + + /** + * @Desc: 删除节点后改变节点内容 + * @Param: flag: 是否要删除节点 + */ + DTree.prototype.changeTreeNodeDel = function(flag){ + var _this = this; + var temp = _this.temp; + var $p_li = temp[0], + $p_ul = $p_li.parent("ul"), + $p_div = temp[1]; + + if(flag){ + $p_li.remove(); + _this.showLine($p_ul.find("li")); + // 判断父级ul中是否还存在li,如果不存在,则需要修改节点的样式 + if($p_ul.children("li").length == 0){ + var $icon_i = $p_div.find("i[data-spread]"); + _this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).closeWithLeaf(); + } + _this.initNodeParam(); + } + + _this.temp = []; // 临时变量制空 + }; + + /******************** iframe区域 ********************/ + /** + * @Desc: 加载iframe + * @Param: $div: JQuery对象,表示当前节点 + * @Param: iframeParam: iframe加载的参数 + */ + DTree.prototype.loadIframe = function($div, iframeParam) { + var _this = this; + var $cite = _this.getNodeDom($div).cite(); + if (!_this.useIframe) { // 启用iframe + return false; + } + var iframeElem = _this.iframeElem, + iframeUrl = _this.iframeUrl, + iframeLoad = _this.iframeLoad; + + var flag = iframeLoad == "leaf" ? (($cite.attr("data-leaf") == "leaf") ? true : false) : true; + + if (flag) { + if ($(iframeElem).length > 0) { //iframe存在 + if (!iframeUrl) { + layer.msg("数据请求异常,iframeUrl参数未指定", {icon:5}); + return false; + } + var param = AjaxHelper.serialize("?", iframeParam); + if(iframeUrl.indexOf("?")> -1){ + param = "&"+param.substring(1, param.length); + } + var url = iframeUrl + param; + $(iframeElem).attr("src", url); + } else { + layer.msg("iframe绑定异常,请确认页面中是否有iframe页对应的容器", {icon:5}); + return false; + } + } + return flag; + }; + + /** + * @Desc: 获取传递出去的参数,根据iframe.iframeDefaultRequest、iframe.iframeRequest和node拼出发出请求的参数 + * @Param: nodes: 需要传递出去的参数 + */ + DTree.prototype.getIframeRequestParam = function(nodes){ + var _this = this; + var request = _this.iframeRequest, + defaultRequestNames = _this.iframeDefaultRequest, + node = nodes || _this.node, + requestParam = {}; + + // 先拼用户自定义的,在拼树生成的,这样的话用户可以自定义当树未生成时的节点的初始值 + for ( var key in request) { + requestParam[key] = request[key]; + } + for ( var key in defaultRequestNames) { + var paramName = defaultRequestNames[key]; + var paramValue = node[key]; + if(typeof paramValue === "boolean"){ + requestParam[paramName] = paramValue; + }else { + if(paramValue){ + requestParam[paramName] = paramValue; + } + } + } + + // 解决传递中文的乱码问题 + var reg = /[\u4E00-\u9FA5\uF900-\uFA2D]/; //正则匹配中文 + for(var key in requestParam){ + if(reg.test(requestParam[key])) { + var str = requestParam[key]; + requestParam[key] = encodeURI(encodeURI(str)); + } + } + + return requestParam; + }; + + /******************** 数据回调区域 ********************/ + /** + * @Desc: 根据具体的id获取基于当前id的div以及对应的其他dom元素 + * @Param: id: 节点的ID值 + */ + DTree.prototype.getNodeDom = function(id){ + var _this = this; + // 获取当前div,如果id就是一个dom,则就是这个,如果不是则进行选择。如果选不中则为null + var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']"); + return { + div: function(){ // 获取当前div + return $div; + }, + fnode: function(){ // 获取一级图标元素 + return ($div == null) ? null : $div.find("i[data-spread]").eq(0); + }, + snode: function(){ // 获取二级图标元素 + return ($div == null) ? null : $div.find("i[data-spread]").eq(1); + }, + checkbox: function(){ // 获取复选框元素 + return ($div == null) ? null : $div.find("i[data-par]"); + }, + cite: function(){ // 获取cite元素 + return ($div == null) ? null : $div.find("cite[data-leaf]"); + }, + nextUl: function(){ // 获取相邻的ul元素 + return ($div == null) ? null : $div.next("ul"); + }, + parentLi: function(){ // 获取父级li元素 + return ($div == null) ? null : $div.parent("li"); + }, + parentUl: function(){ // 获取基于当前$div的上级$ul + return ($div == null) ? null : $div.parent("li").parent("ul"); + }, + parentDiv: function(){ // 获取基于当前$div的上级$div + return ($div == null) ? null : $div.parent("li").parent("ul").prev("div"); + }, + nowDiv: function(){ // 获取当前选中节点,没有则返回null + return (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS).length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS); + }, + nowOrRootDiv: function(){ // 获取当前选中节点,没有则返回根节点下的第一个div + return (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS).length == 0) ? _this.obj.children("li").eq(0).children("div").eq(0) : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS); + }, + nowOrRootUl: function(){ // 获取当前选中节点下一个UL 或根节点。为了将新节点放入ul下 + return (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS).length == 0) ? _this.obj : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS).next("ul"); + } + } + }; + + /** + * @Desc: 获取当前选中节点下一个ul节点 或根节点。为了将新节点放入ul下 + */ + DTree.prototype.getNowNodeUl = function() { + var _this = this; + return _this.getNodeDom().nowOrRootUl(); + }; + + /** + * @Desc: 获取当前选中div节点 或第一个根div节点。 + */ + DTree.prototype.getNowNode = function() { + var _this = this; + return _this.getNodeDom().nowOrRootDiv(); + }; + + /** + * @Desc: 获取当前选中div节点 无则返回null。 + */ + DTree.prototype.getNowNodeOrNull = function() { + var _this = this; + return _this.getNodeDom().nowDiv(); + }; + + /** + * @Desc: 根据获取指定div节点。 + * @Param: id: 指定节点的ID + */ + DTree.prototype.getNode = function(id) { + var _this = this; + return _this.getNodeDom(id).div(); + }; + + /** + * @Desc: 设置当前选中节点的全部参数 + * @Param: $div: 当前选中的节点 + */ + DTree.prototype.setNodeParam = function($div) { + var _this = this; + _this.node.nodeId = $div.attr("data-id"); + _this.node.parentId = _this.getNodeDom($div).parentLi().attr("data-pid"); + _this.node.context = (typeof _this.formatter.title === 'function') ? _this.getNodeDom($div).cite().attr("data-title") : _this.getNodeDom($div).cite().text(); + _this.node.leaf = _this.getNodeDom($div).cite().attr("data-leaf") == "leaf" ? true : false; + _this.node.level = _this.getNodeDom($div).parentLi().attr("data-index"); + _this.node.spread = _this.getNodeDom($div).fnode().attr("data-spread") == "open" ? true : false; + + var basicData = $div.attr("data-basic"); + if(basicData) { + basicData = JSON.parse(event.unescape(basicData)); + } + _this.node.basicData = basicData; + + var recordData = $div.attr("data-record"); + if(recordData) { + recordData = JSON.parse(event.unescape(recordData)); + } + _this.node.recordData = recordData; + + if (_this.getNodeDom($div).checkbox()) { + var dataTypes = "", checkeds = "", initcheckeds = ""; + _this.getNodeDom($div).checkbox().each(function(){ + dataTypes += $(this).attr("data-type") + ","; + checkeds += $(this).attr("data-checked") + ","; + initcheckeds += $(this).attr("data-initchecked") + ","; + }); + dataTypes = dataTypes.substring(0, dataTypes.length-1); + checkeds = checkeds.substring(0, checkeds.length-1); + initcheckeds = initcheckeds.substring(0, initcheckeds.length-1); + + _this.node.dataType = dataTypes; + _this.node.checked = checkeds; + _this.node.initchecked = initcheckeds; + } + }; + + /** + * @Desc: 获取当前选中节点的全部参数 + * @Param: $div: 当前选中的节点 + */ + DTree.prototype.getNodeParam = function($div) { + var _this = this; + if ($div) { + _this.setNodeParam($div); + } else { + if(_this.obj.find("div[data-id]").parent().find("."+NAV_THIS).length == 0){ + _this.initNodeParam(); + } + } + return this.node; + }; + + /** + * @Desc: 获取一个临时的node参数 + * @Param: $div: 当前选中的节点 + */ + DTree.prototype.getTempNodeParam = function($div) { + var _this = this; + var temp_node = {}; + temp_node.nodeId = $div.attr("data-id"); + temp_node.parentId = _this.getNodeDom($div).parentLi().attr("data-pid"); + temp_node.context = (typeof _this.formatter.title === 'function') ? _this.getNodeDom($div).cite().attr("data-title") : _this.getNodeDom($div).cite().text(); + temp_node.leaf = _this.getNodeDom($div).cite().attr("data-leaf") == "leaf" ? true : false; + temp_node.level = _this.getNodeDom($div).parentLi().attr("data-index"); + temp_node.spread = _this.getNodeDom($div).fnode().attr("data-spread") == "open" ? true : false; + + var basicData = $div.attr("data-basic"); + if(basicData) { + basicData = JSON.parse(event.unescape(basicData)); + } + temp_node.basicData = basicData; + var recordData = $div.attr("data-record"); + if(recordData) { + recordData = JSON.parse(event.unescape(recordData)); + } + temp_node.recordData = recordData; + + if (_this.getNodeDom($div).checkbox()) { + var dataTypes = "", checkeds = "", initcheckeds = ""; + _this.getNodeDom($div).checkbox().each(function(){ + dataTypes += $(this).attr("data-type") + ","; + checkeds += $(this).attr("data-checked") + ","; + initcheckeds += $(this).attr("data-initchecked") + ","; + }); + dataTypes = dataTypes.substring(0, dataTypes.length-1); + checkeds = checkeds.substring(0, checkeds.length-1); + initcheckeds = initcheckeds.substring(0, initcheckeds.length-1); + + temp_node.dataType = dataTypes; + temp_node.checked = checkeds; + temp_node.initchecked = initcheckeds; + } + return temp_node; + }; + + /** + * @Desc: 重置内置参数 + */ + DTree.prototype.initNodeParam = function(){ + var _this = this; + _this.node.nodeId = ""; + _this.node.parentId = ""; + _this.node.context = ""; + _this.node.leaf = ""; + _this.node.level = ""; + _this.node.spread = ""; + _this.node.dataType = ""; + _this.node.checked = ""; + _this.node.initchecked = ""; + _this.node.basicData = ""; + _this.node.recordData = ""; + + if(_this.select) { + _this.selectResetVal(); + } + }; + + /** + * @Desc: 获取传递出去的参数,根据defaultRequest、request和node拼出发出请求的参数 + * @Param: nodes:需要传递出去的参数 + */ + DTree.prototype.getRequestParam = function(nodes){ + var _this = this; + var request = _this.request, + defaultRequestNames = _this.defaultRequest, + node = nodes || _this.node, + requestParam = {}; + + // 先拼用户自定义的,在拼树生成的,这样的话用户可以自定义当树未生成时的节点的初始值 + for ( var key in request) { + requestParam[key] = request[key]; + } + for ( var key in defaultRequestNames) { + var paramName = defaultRequestNames[key]; + var paramValue = node[key]; + if(typeof paramValue === "boolean"){ + requestParam[paramName] = paramValue; + }else { + if(paramValue){ + requestParam[paramName] = paramValue; + } + } + + } + return requestParam; + }; + + /** + * @Desc: 获取filterParam过滤后的requestParam + * @Param: requestParam:请求参数 + */ + DTree.prototype.getFilterRequestParam = function(requestParam){ + var _this = this; + var filterRequest = _this.filterRequest; + return event.cloneObj(requestParam, filterRequest); + }; + + /** + * @Desc: 获取当前选中的请求参数 + */ + DTree.prototype.getNowParam = function(){ + var _this = this; + + return _this.getRequestParam(_this.getNodeParam()); + }; + + /** + * @Desc: 根据id获取指定div节点选中参数 + * @Param: id:节点的ID值 + */ + DTree.prototype.getParam = function(id){ + var _this = this; + + // 获取当前div,如果id就是一个dom,则就是这个,如果不是则进行选择。如果选不中则为null + var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']"); + if($div != null){ return _this.callbackData().node(_this.getTempNodeParam($div)); } else { return {}; } + }; + + /** + * @Desc: 根据id获取节点上级节点参数 + * @Param: id:节点的ID值 + */ + DTree.prototype.getParentParam = function(id){ + var _this = this; + // 获取当前div,如果id就是一个dom,则就是这个,如果不是则进行选择。如果选不中则为null + var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']"); + if($div != null){ return _this.callbackData().parentNode($div); } else { return {}; } + }; + + /** + * @Desc: 根据id获取节点的全部上级节点参数值 + * @Param: id:节点的ID值 + */ + DTree.prototype.getAllParentParam = function(id){ + var _this = this; + // 获取当前div,如果id就是一个dom,则就是这个,如果不是则进行选择。如果选不中则为null + var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']"); + var arr = []; + if($div != null){ + var level = _this.getTempNodeParam($div).level; + for(var i=1; i 0){ + $childDivs.each(function(){ + var $cDiv = $(this); + childNode.push(_this.getRequestParam(_this.getTempNodeParam($cDiv))); + }); + } + return childNode; + }, + parentNode: function($div){ // 获取上级节点值 + var pId = _this.getNodeDom($div).parentLi().attr("data-pid"); + var $pdiv = _this.obj.find("div[data-id='"+pId+"']"); + if($pdiv.length > 0) {return _this.getRequestParam(_this.getTempNodeParam($pdiv));} else {return {};} + + } + } + }; + + /******************** 事件回调区域 ********************/ + /** + * @Desc: 绑定浏览器事件 + */ + DTree.prototype.bindBrowserEvent = function(){ + var _this = this; + var rootId = _this.obj[0].id; + + // 绑定文件夹展开/收缩的图标的点击事件,点击时给当前节点的div添加选中class + _this.obj.on("click", "i[data-spread]", function(event) { + event.stopPropagation(); + var $i = $(this), + $div = $i.parent("div"), + node = _this.getNodeParam($div); + + _this.toolbarHide(); + _this.navThis($div); + _this.clickSpread($div); // 展开或隐藏节点 + + // 树状态改变后,用户自定义想做的事情 + layui.event.call(this, MOD_NAME, "changeTree("+$(_this.obj)[0].id+")", { + dom: _this.callbackData().dom($i), + param: _this.callbackData().node(node), + show: _this.callbackData().dom($i).attr("data-spread") == "open" ? true : false + }); + }); + + // 绑定所有子节点div的单击事件,点击时触发加载iframe或用户自定义想做的事情 + _this.obj.on("click", "div[dtree-click='"+eventName.itemNodeClick+"'][dtree-disabled='false']", function(event) { + event.stopPropagation(); + var $div = $(this), + $cite = $div.find("cite"), + node = _this.getNodeParam($div); + _this.toolbarHide(); + _this.navThis($div); + + if(_this.select) { + _this.selectVal(node.nodeId); + $("div[dtree-id='" + rootId + "'][dtree-select='"+_this.selectDiv+"']").click(); + } + + if (_this.useIframe) { + var iframeParam = _this.getFilterRequestParam(_this.getIframeRequestParam(node)); + var flag = _this.loadIframe($div, iframeParam); // 加载iframe + if (flag) { + // iframe加载完毕后,用户自定义想做的事情 + _this.iframeFun.iframeDone(iframeParam); + + layui.event.call(this, MOD_NAME, "iframeDone("+$(_this.obj)[0].id+")", { + "iframeParam": iframeParam, + dom: _this.callbackData().dom($div) + }); + } + } else { + // 单击事件执行完毕后,用户自定义想做的事情 + layui.event.call(this, MOD_NAME, "node("+$(_this.obj)[0].id+")", { + param: _this.callbackData().node(node), + childParams: _this.callbackData().childNode($div), + parentParam: _this.callbackData().parentNode($div), + dom: _this.callbackData().dom($div) + }); + } + }); + + // 绑定所有子节点div的双击事件,暴露on给用户自定义 + _this.obj.on("dblclick", "div[dtree-click='"+eventName.itemNodeClick+"'][dtree-disabled='false']", function(event) { + event.stopPropagation(); + var $div = $(this), + $cite = $div.find("cite"), + node = _this.getNodeParam($div); + _this.toolbarHide(); + _this.navThis($div); + + if(_this.select) { + _this.selectVal(node.nodeId); + $("div[dtree-id='" + rootId + "'][dtree-select='"+_this.selectDiv+"']").click(); + } + + // 双击事件执行完毕后,用户自定义想做的事情 + layui.event.call(this, MOD_NAME, "nodedblclick("+$(_this.obj)[0].id+")", { + param: _this.callbackData().node(node), + childParams: _this.callbackData().childNode($div), + parentParam: _this.callbackData().parentNode($div), + dom: _this.callbackData().dom($div) + }); + }); + + if(_this.checkbar) { + // 绑定cheboxbar的节点复选框 + _this.obj.on("click", "i[dtree-click='"+eventName.checkNodeClick+"'][dtree-disabled='false']", function(event) { + _this.toolbarHide(); + var $i = $(this), + $div = $i.closest("div[dtree-click='"+eventName.itemNodeClick+"']"), + node = _this.getNodeParam($div); + // 复选框选中前的回调 + var flag = _this.checkbarFun.chooseBefore($i, _this.getRequestParam(node)); + _this.temp = [$i]; + if(flag){_this.changeCheck();} + + event.stopPropagation(); + }); + } + + if(_this.menubar) { + // 绑定menubar的点击事件 + _this.obj.prevAll('div#dtree_menubar_'+_this.obj[0].id).on("click", "button[d-menu]", function(event) { + event.stopPropagation(); + _this.toolbarHide(); + _this.menubarListener($(this).attr("d-menu"), "group"); + }); + + // 绑定menubar的点击事件 + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).on("click", "a[d-menu]", function(event) { + event.stopPropagation(); + _this.toolbarHide(); + _this.menubarListener($(this).attr("d-menu"), "toolbar"); + }); + + // 绑定menubar的点击按钮事件 + _this.obj.closest('body').find("*[dtree-id='"+_this.obj[0].id+"'][dtree-menu]").on("click", function(event) { + event.stopPropagation(); + _this.toolbarHide(); + _this.menubarListener($(this).attr("dtree-menu"), "freedom"); + }); + } + + if(_this.toolbar) { + if(_this.toolbarWay == "contextmenu") { + //绑定所有子节点div的右键点击事件,用于显示toolbar + _this.obj.on("contextmenu", "div[dtree-click='"+eventName.itemNodeClick+"'][d-contextmenu='true'][dtree-disabled='false']", function(e){ + var $div = $(this), + node = _this.getNodeParam($div); + + _this.toolbarHide(); + // toolbar加载前执行的方法,执行完毕之后创建按钮 + _this.setToolbarDom().setToolbarPlace(_this.toolbarFun.loadToolbarBefore(event.cloneObj(_this.toolbarMenu), _this.getRequestParam(node), $div)); + + var e = e || window.event, + mx = e.pageX - $div.offset().left +45 , + my = $div.offset().top - _this.obj.closest(_this.scroll).offset().top +15; + + _this.navThis($div); + var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id); + $toolBarDiv.find(".layui-nav-child").addClass('layui-anim-fadein layui-show'); + $toolBarDiv.css({'left':mx+'px','top':my+'px'}); + + e.stopPropagation(); + return false; + }); + + // 绑定装载树的上层出现滚动条的容器,让toolbar隐藏 + _this.obj.closest(_this.scroll).scroll(function() { + _this.toolbarHide(); + }); + + // 绑定toolbar的点击事件 + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).on("click", "a[dtree-tool]", function(event) { + event.stopPropagation(); + var $div = _this.getNodeDom().nowOrRootDiv(), + node = _this.getNodeParam($div); + _this.toolbarHide(); + var tool = $(this).attr("dtree-tool"); + _this.toolbarListener(tool, $div); + }); + } else if(_this.toolbarWay == "fixed") { + // 绑定toolbar的点击事件 + _this.obj.on("click", "a[dtree-tool]", function(event) { + event.stopPropagation(); + var $a = $(this), + $cite = $a.parent("em."+TOOLBAR_TOOL_EM).prev("cite"), //当前选中节点的text + $div = $cite.parent("div"), + node = _this.getNodeParam($div); + var tool = $a.attr("dtree-tool"); + + _this.toolbarHide(); + _this.navThis($div); + _this.toolbarListener(tool, $div); + }); + } else if(_this.toolbarWay == "follow") { + //绑定所有子节点div的mouseover mouseout事件,用于显示或隐藏toolbar + _this.obj.on("mouseover mouseout", "div[dtree-click='"+eventName.itemNodeClick+"'][dtree-disabled='false']", function(event){ + var $div = $(this), + $toolBarEm = $div.children("em."+TOOLBAR_TOOL_EM); + if(event.type == "mouseover"){ + $toolBarEm.removeClass(NAV_HIDE); + event.stopPropagation(); + } else if(event.type == "mouseout"){ + $toolBarEm.addClass(NAV_HIDE); + event.stopPropagation(); + } + }); + + // 绑定toolbar的点击事件 + _this.obj.on("click", "a[dtree-tool]", function(event) { + event.stopPropagation(); + var $a = $(this), + $cite = $a.parent("em."+TOOLBAR_TOOL_EM).prev("cite"), //当前选中节点的text + $div = $cite.parent("div"), + node = _this.getNodeParam($div); + var tool = $a.attr("dtree-tool"); + + _this.toolbarHide(); + _this.navThis($div); + _this.toolbarListener(tool, $div); + }); + } + } + + if(_this.select) { + // 绑定select的点击事件 + $("div[dtree-id='" + rootId + "'][dtree-select='"+_this.selectDiv+"']").on("click", function(event){ + event.stopPropagation(); + var dl = $(this).find('dl'); + //debugger; + $(this).toggleClass("layui-form-selected"); + + var $card = $("div[dtree-id='" + rootId + "'][dtree-card='"+_this.selectCardDiv+"']"); + + $card.toggleClass("dtree-select-show layui-anim layui-anim-upbit"); + var top = $(this).offset().top + $(this).outerHeight() - $WIN.scrollTop() - 5, + cardHeight = $card.height(), + winHeight = $WIN.height(); +// console.log("top = $(this).offset().top: " + $(this).offset().top + " + $(this).outerHeight(): " + $(this).outerHeight() + " - $WIN.scrollTop(): " + $WIN.scrollTop() + " - 5 =" + top); +// console.log("winHeight = " + winHeight); + if($card.hasClass('dtree-select-up')) { + $card.removeClass('dtree-select-up'); + } + + //上下定位识别 + if(top + cardHeight > $WIN.height() && top >= cardHeight){ + console.log(" top + cardHeight : "+ top + " + " + cardHeight + " > $WIN.height() :" + $WIN.height() + " && top >= cardHeight :" + top + " > " + cardHeight); + if($card.hasClass('dtree-select-up')) { + $card.removeClass('dtree-select-up'); + } else { + $card.addClass('dtree-select-up'); + } + } else { + $card.removeClass('dtree-select-up'); + } + + // 下拉树面板开闭状态改变后,用户自定义想做的事情 + layui.event.call(this, MOD_NAME, "changeSelect("+$(_this.obj)[0].id+")", { + show: $(this).hasClass("layui-form-selected"), + param: _this.selectVal() + }); + }); + + } + }; + + // 绑定body的单击,让本页面所有的toolbar隐藏 + $BODY.on("click", function(event){ + $("div."+LI_DIV_TOOLBAR).find(".layui-show").removeClass('layui-anim-fadein layui-show'); + // $("div[dtree-id][dtree-select]").removeClass("layui-form-selected"); + // $("div[dtree-id][dtree-card]").removeClass("dtree-select-show layui-anim layui-anim-upbit"); + + }); + + // 解绑浏览器事件 + DTree.prototype.unbindBrowserEvent = function(){ + var _this = this; + + // 本身事件解绑 + _this.obj.unbind(); + // 菜单栏解绑 + if(_this.menubar){ + _this.obj.prevAll('div#dtree_menubar_'+_this.obj[0].id).unbind(); + if(_this.obj.closest('body').find("*[dtree-id='"+_this.obj[0].id+"'][dtree-menu]").length > 0){ + _this.obj.closest('body').find("*[dtree-id='"+_this.obj[0].id+"'][dtree-menu]").unbind(); + } + } + + // 工具栏解绑 + if(_this.toolbar){ + if(_this.toolbarWay == "contextmenu") { + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).unbind(); + if(_this.obj.closest(_this.scroll).length > 0){ + _this.obj.closest(_this.scroll).unbind(); + } + } + } + + // 下拉树解绑 + if(_this.select) { + // 解绑select的点击事件 + $("div[dtree-id='" + _this.obj[0].id + "'][dtree-select='"+_this.selectDiv+"']").removeClass("layui-form-selected"); + $("div[dtree-id='" + _this.obj[0].id + "'][dtree-card='"+_this.selectCardDiv+"']").removeClass("dtree-select-show layui-anim layui-anim-upbit"); + $("div[dtree-id='" + _this.obj[0].id + "'][dtree-select='"+_this.selectDiv+"']").unbind(); + } + }; + + + /** 外部访问 **/ + var dtree = { + set: function(options){ //设置全局属性 + if(typeof options !== 'undefined') { + $.extend(OPTIONS, options); + } + }, + render: function(options){ // 初始化树 + var dTree = null; + var id = event.getElemId(options); + if(id == "") { + layer.msg("页面中未找到绑定id", {icon:5}); + } else { + dTree = DTrees[id]; + if(typeof dTree === 'object'){ + dTree.unbindBrowserEvent(); + } + // 创建树 + dTree = new DTree(options); + // 添加到树数组中去 + DTrees[id] = dTree; + dTree.initTreePlus(); + dTree.openTreePlus(); + dTree.loadTreeInit(); + dTree.bindBrowserEvent(); + } + + return dTree; + }, + renderSelect: function(options){ // 初始化下拉树 + var dTree = null; + var id = event.getElemId(options); + if(id == "") { + layer.msg("页面中未找到绑定id", {icon:5}); + } else { + dTree = DTrees[id]; + if(typeof dTree === 'object'){ + dTree.unbindBrowserEvent(); + } + // 创建下拉树 + dTree = new DTree(options); + dTree.selectSetting(); + // 添加到树数组中去 + DTrees[id] = dTree; + dTree.initTreePlus(); + dTree.openTreePlus(); + dTree.loadTreeInit(); + dTree.bindBrowserEvent(); + } + + return dTree; + }, + reload: function(dTree, options){ // 重新加载树 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + dTree.reloadSetting(options); + dTree.initTreePlus(); + dTree.openTreePlus(); + dTree.initNodeParam(); + dTree.loadTreeInit(); + dTree.unbindBrowserEvent(); + dTree.bindBrowserEvent(); + }, + on: function(events, callback) { // 绑定事件 + if(events.indexOf("'") > 0){ + events = events.replace(/'/g,""); + } + if(events.indexOf('"') > 0) { + events = events.replace(/"/g,""); + } + return layui.onevent.call(this, MOD_NAME, events, callback); + }, + click: function(dTree, id) { // 模拟单击事件 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + $("div[dtree-click='"+eventName.itemNodeClick+"'][dtree-id='"+dTree.obj[0].id+"'][data-id='"+id+"']").click(); + }, + getNowParam: function(dTree){ // 获取当前选中值 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.getNowParam(); // 获取当前选中值 + }, + getParam: function(dTree, id){ // 获取指定节点值 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.getParam(id); // 获取指定节点值 + }, + getParentParam: function(dTree, id){ // 获取参数的上级节点 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.getParentParam(id); + }, + getAllParentParam: function(dTree, id){ // 获取参数的全部上级节点 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.getAllParentParam(id); + }, + getChildParam: function(dTree, id){ // 获取参数的全部下级节点 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.getChildParam(id); + }, + getCheckbarNodesParam: function(dTree){ // 获取复选框选中值 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return {}; + } + return dTree.getCheckbarNodesParam(); // 获取复选框选中值 + }, + getCheckbarJsonArrParam: function(dTree){ // 获取复选框选中值 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return {}; + } + return dTree.getCheckbarJsonArrParam(); // 获取复选框选中值 + }, + dataInit: function(dTree, chooseId){ // 初始化选中树,针对数据反选 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + if(chooseId){ + return dTree.dataInit(chooseId); + } + }, + chooseDataInit: function(dTree, chooseIds){ // 初始化复选框选中,针对数据反选 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + if(chooseIds){ + return dTree.chooseDataInit(chooseIds); + } + }, + changeCheckbarNodes: function(dTree){ //判断复选框是否发生变更 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.changeCheckbarNodes(); + }, + initNoAllCheck: function(dTree) { //复选框半选状态初始化设置 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.initNoAllCheck(); + }, + initAllCheck: function(dTree){ // 复选框选中状态初始化设置 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.initAllCheck(); + }, + selectVal: function(dTree, param){ // select模式设置输入框选中值 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.selectVal(param); // select模式设置输入框选中值 + }, + escape: function(html){ // 字符串格式化 + return event.escape(html); + }, + unescape: function(str){ // 字符串反格式化 + return event.unescape(str); + }, + serialize: function(first, param) { // 序列化JSON对象 + return AjaxHelper.serialize(first, param); + }, + version: function(){ //获取版本号 + return VERSION; + } + }; + + exports('dtree', dtree); +}); \ No newline at end of file diff --git a/static/component/pear/module/frame.js b/static/component/pear/module/frame.js new file mode 100644 index 000000000..ac6664ce1 --- /dev/null +++ b/static/component/pear/module/frame.js @@ -0,0 +1,87 @@ +layui.define(['jquery', 'element'], function (exports) { + "use strict"; + + var $ = layui.jquery; + + var pearFrame = function (opt) { + this.option = opt; + }; + + pearFrame.prototype.render = function (opt) { + var option = { + elem: opt.elem, + url: opt.url, + title: opt.title, + width: opt.width, + height: opt.height, + done: opt.done ? opt.done : function () { console.log("菜单渲染成功"); } + } + createFrameHTML(option); + $("#" + option.elem).width(option.width); + $("#" + option.elem).height(option.height); + return new pearFrame(option); + } + + pearFrame.prototype.changePage = function (url, loading) { + var $frameLoad = $("#" + this.option.elem).find(".pear-frame-loading"); + + /** + * 非视图模式下,切换侧栏导航上条目时,会产生 loading.css 非 function错误 + * frame.js?v=3.9.4:28 Uncaught TypeError: loading.css is not a function + at pearFrame.changePage (frame.js?v=3.9.4:28:12) + at admin.js?v=3.9.4:165:17 + at HTMLAnchorElement. (menu.js?v=3.9.4:122:4) + at HTMLBodyElement.dispatch (layui.js:2:22295) + at HTMLBodyElement.m.handle (layui.js:2:18997) + * + */ + if (loading && typeof loading.css ==='function') { + loading.css({ display: 'block' }); + } + $("#" + this.option.elem + " iframe").attr("src", url); + if (loading) { + setTimeout(function () { + $frameLoad.fadeOut(500); + }, 800) + } + } + + pearFrame.prototype.changePageByElement = function (elem, url, title, loading) { + var $frameLoad = $("#" + elem).find(".pear-frame-loading"); + if (loading) { + $frameLoad.css({ display: 'block' }); + } + $("#" + elem + " iframe").attr("src", url); + $("#" + elem + " .title").html(title); + if (loading) { + setTimeout(function () { + $frameLoad.css({ display: 'none' }); + }, 400) + } + } + + pearFrame.prototype.refresh = function (time) { + if (time != false) { + var loading = $("#" + this.option.elem).find(".pear-frame-loading"); + loading.css({ display: 'block' }); + if (time != 0) { + setTimeout(function () { + loading.fadeOut(500); + }, time) + } + } + $("#" + this.option.elem).find("iframe")[0].contentWindow.location.reload(true); + } + + function createFrameHTML(option) { + var iframe = ""; + var loading = '
                                    ' + + '
                                    ' + + '' + + '
                                    ' + + '
                                    '; + $("#" + option.elem).html("
                                    " + iframe + loading + "
                                    "); + } + + exports('frame', new pearFrame()); +}); diff --git a/static/component/pear/module/hash.js b/static/component/pear/module/hash.js new file mode 100644 index 000000000..6b8d330e0 --- /dev/null +++ b/static/component/pear/module/hash.js @@ -0,0 +1,1775 @@ +/** + layui hash extend +**/ + +layui.define(function (exports) { + /** + * jshashes - https://github.com/h2non/jshashes + * Released under the "New BSD" license + * + * Algorithms specification: + * + * MD5 - http://www.ietf.org/rfc/rfc1321.txt + * RIPEMD-160 - http://homes.esat.kuleuven.be/~bosselae/ripemd160.html + * SHA1 - http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf + * SHA256 - http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf + * SHA512 - http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf + * HMAC - http://www.ietf.org/rfc/rfc2104.txt + */ + var pearHash; + + function utf8Encode(str) { + var x, y, output = '', + i = -1, + l; + + if (str && str.length) { + l = str.length; + while ((i += 1) < l) { + /* Decode utf-16 surrogate pairs */ + x = str.charCodeAt(i); + y = i + 1 < l ? str.charCodeAt(i + 1) : 0; + if (0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF) { + x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF); + i += 1; + } + /* Encode output as utf-8 */ + if (x <= 0x7F) { + output += String.fromCharCode(x); + } else if (x <= 0x7FF) { + output += String.fromCharCode(0xC0 | ((x >>> 6) & 0x1F), + 0x80 | (x & 0x3F)); + } else if (x <= 0xFFFF) { + output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F), + 0x80 | ((x >>> 6) & 0x3F), + 0x80 | (x & 0x3F)); + } else if (x <= 0x1FFFFF) { + output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07), + 0x80 | ((x >>> 12) & 0x3F), + 0x80 | ((x >>> 6) & 0x3F), + 0x80 | (x & 0x3F)); + } + } + } + return output; + } + + function utf8Decode(str) { + var i, ac, c1, c2, c3, arr = [], + l; + i = ac = c1 = c2 = c3 = 0; + + if (str && str.length) { + l = str.length; + str += ''; + + while (i < l) { + c1 = str.charCodeAt(i); + ac += 1; + if (c1 < 128) { + arr[ac] = String.fromCharCode(c1); + i += 1; + } else if (c1 > 191 && c1 < 224) { + c2 = str.charCodeAt(i + 1); + arr[ac] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63)); + i += 2; + } else { + c2 = str.charCodeAt(i + 1); + c3 = str.charCodeAt(i + 2); + arr[ac] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + } + } + return arr.join(''); + } + + /** + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ + + function safe_add(x, y) { + var lsw = (x & 0xFFFF) + (y & 0xFFFF), + msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); + } + + /** + * Bitwise rotate a 32-bit number to the left. + */ + + function bit_rol(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); + } + + /** + * Convert a raw string to a hex string + */ + + function rstr2hex(input, hexcase) { + var hex_tab = hexcase ? '0123456789ABCDEF' : '0123456789abcdef', + output = '', + x, i = 0, + l = input.length; + for (; i < l; i += 1) { + x = input.charCodeAt(i); + output += hex_tab.charAt((x >>> 4) & 0x0F) + hex_tab.charAt(x & 0x0F); + } + return output; + } + + /** + * Encode a string as utf-16 + */ + + function str2rstr_utf16le(input) { + var i, l = input.length, + output = ''; + for (i = 0; i < l; i += 1) { + output += String.fromCharCode(input.charCodeAt(i) & 0xFF, (input.charCodeAt(i) >>> 8) & 0xFF); + } + return output; + } + + function str2rstr_utf16be(input) { + var i, l = input.length, + output = ''; + for (i = 0; i < l; i += 1) { + output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF, input.charCodeAt(i) & 0xFF); + } + return output; + } + + /** + * Convert an array of big-endian words to a string + */ + + function binb2rstr(input) { + var i, l = input.length * 32, + output = ''; + for (i = 0; i < l; i += 8) { + output += String.fromCharCode((input[i >> 5] >>> (24 - i % 32)) & 0xFF); + } + return output; + } + + /** + * Convert an array of little-endian words to a string + */ + + function binl2rstr(input) { + var i, l = input.length * 32, + output = ''; + for (i = 0; i < l; i += 8) { + output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF); + } + return output; + } + + /** + * Convert a raw string to an array of little-endian words + * Characters >255 have their high-byte silently ignored. + */ + + function rstr2binl(input) { + var i, l = input.length * 8, + output = Array(input.length >> 2), + lo = output.length; + for (i = 0; i < lo; i += 1) { + output[i] = 0; + } + for (i = 0; i < l; i += 8) { + output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32); + } + return output; + } + + /** + * Convert a raw string to an array of big-endian words + * Characters >255 have their high-byte silently ignored. + */ + + function rstr2binb(input) { + var i, l = input.length * 8, + output = Array(input.length >> 2), + lo = output.length; + for (i = 0; i < lo; i += 1) { + output[i] = 0; + } + for (i = 0; i < l; i += 8) { + output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (24 - i % 32); + } + return output; + } + + /** + * Convert a raw string to an arbitrary string encoding + */ + + function rstr2any(input, encoding) { + var divisor = encoding.length, + remainders = Array(), + i, q, x, ld, quotient, dividend, output, full_length; + + /* Convert to an array of 16-bit big-endian values, forming the dividend */ + dividend = Array(Math.ceil(input.length / 2)); + ld = dividend.length; + for (i = 0; i < ld; i += 1) { + dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1); + } + + /** + * Repeatedly perform a long division. The binary array forms the dividend, + * the length of the encoding is the divisor. Once computed, the quotient + * forms the dividend for the next step. We stop when the dividend is zerHashes. + * All remainders are stored for later use. + */ + while (dividend.length > 0) { + quotient = Array(); + x = 0; + for (i = 0; i < dividend.length; i += 1) { + x = (x << 16) + dividend[i]; + q = Math.floor(x / divisor); + x -= q * divisor; + if (quotient.length > 0 || q > 0) { + quotient[quotient.length] = q; + } + } + remainders[remainders.length] = x; + dividend = quotient; + } + + /* Convert the remainders to the output string */ + output = ''; + for (i = remainders.length - 1; i >= 0; i--) { + output += encoding.charAt(remainders[i]); + } + + /* Append leading zero equivalents */ + full_length = Math.ceil(input.length * 8 / (Math.log(encoding.length) / Math.log(2))); + for (i = output.length; i < full_length; i += 1) { + output = encoding[0] + output; + } + return output; + } + + /** + * Convert a raw string to a base-64 string + */ + + function rstr2b64(input, b64pad) { + var tab = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + output = '', + len = input.length, + i, j, triplet; + b64pad = b64pad || '='; + for (i = 0; i < len; i += 3) { + triplet = (input.charCodeAt(i) << 16) | (i + 1 < len ? input.charCodeAt(i + 1) << 8 : 0) | (i + 2 < len ? input.charCodeAt(i + 2) : 0); + for (j = 0; j < 4; j += 1) { + if (i * 8 + j * 6 > input.length * 8) { + output += b64pad; + } else { + output += tab.charAt((triplet >>> 6 * (3 - j)) & 0x3F); + } + } + } + return output; + } + + pearHash = { + /** + * @property {String} version + * @readonly + */ + VERSION: '1.0.6', + /** + * @member Hashes + * @class Base64 + * @constructor + */ + Base64: function () { + // private properties + var tab = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + pad = '=', // default pad according with the RFC standard + url = false, // URL encoding support @todo + utf8 = true; // by default enable UTF-8 support encoding + + // public method for encoding + this.encode = function (input) { + var i, j, triplet, + output = '', + len = input.length; + + pad = pad || '='; + input = (utf8) ? utf8Encode(input) : input; + + for (i = 0; i < len; i += 3) { + triplet = (input.charCodeAt(i) << 16) | (i + 1 < len ? input.charCodeAt(i + 1) << 8 : 0) | (i + 2 < len ? input.charCodeAt(i + 2) : 0); + for (j = 0; j < 4; j += 1) { + if (i * 8 + j * 6 > len * 8) { + output += pad; + } else { + output += tab.charAt((triplet >>> 6 * (3 - j)) & 0x3F); + } + } + } + return output; + }; + + // public method for decoding + this.decode = function (input) { + // var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + var i, o1, o2, o3, h1, h2, h3, h4, bits, ac, + dec = '', + arr = []; + if (!input) { + return input; + } + + i = ac = 0; + input = input.replace(new RegExp('\\' + pad, 'gi'), ''); // use '=' + //input += ''; + + do { // unpack four hexets into three octets using index points in b64 + h1 = tab.indexOf(input.charAt(i += 1)); + h2 = tab.indexOf(input.charAt(i += 1)); + h3 = tab.indexOf(input.charAt(i += 1)); + h4 = tab.indexOf(input.charAt(i += 1)); + + bits = h1 << 18 | h2 << 12 | h3 << 6 | h4; + + o1 = bits >> 16 & 0xff; + o2 = bits >> 8 & 0xff; + o3 = bits & 0xff; + ac += 1; + + if (h3 === 64) { + arr[ac] = String.fromCharCode(o1); + } else if (h4 === 64) { + arr[ac] = String.fromCharCode(o1, o2); + } else { + arr[ac] = String.fromCharCode(o1, o2, o3); + } + } while (i < input.length); + + dec = arr.join(''); + dec = (utf8) ? utf8Decode(dec) : dec; + + return dec; + }; + + // set custom pad string + this.setPad = function (str) { + pad = str || pad; + return this; + }; + // set custom tab string characters + this.setTab = function (str) { + tab = str || tab; + return this; + }; + this.setUTF8 = function (bool) { + if (typeof bool === 'boolean') { + utf8 = bool; + } + return this; + }; + }, + + /** + * CRC-32 calculation + * @member Hashes + * @method CRC32 + * @static + * @param {String} str Input String + * @return {String} + */ + CRC32: function (str) { + var crc = 0, + x = 0, + y = 0, + table, i, iTop; + str = utf8Encode(str); + + table = [ + '00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 ', + '79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 ', + '84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F ', + '63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD ', + 'A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC ', + '51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 ', + 'B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 ', + '06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 ', + 'E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 ', + '12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 ', + 'D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 ', + '33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 ', + 'CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 ', + '9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E ', + '7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D ', + '806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 ', + '60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA ', + 'AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 ', + '5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 ', + 'B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 ', + '05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 ', + 'F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA ', + '11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 ', + 'D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F ', + '30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E ', + 'C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D' + ].join(''); + + crc = crc ^ (-1); + for (i = 0, iTop = str.length; i < iTop; i += 1) { + y = (crc ^ str.charCodeAt(i)) & 0xFF; + x = '0x' + table.substr(y * 9, 8); + crc = (crc >>> 8) ^ x; + } + // always return a positive number (that's what >>> 0 does) + return (crc ^ (-1)) >>> 0; + }, + /** + * @member Hashes + * @class MD5 + * @constructor + * @param {Object} [config] + * + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * See for more infHashes. + */ + MD5: function (options) { + /** + * Private config properties. You may need to tweak these to be compatible with + * the server-side, but the defaults work in most cases. + * See {@link Hashes.MD5#method-setUpperCase} and {@link Hashes.SHA1#method-setUpperCase} + */ + var hexcase = (options && typeof options.uppercase === 'boolean') ? options.uppercase : false, // hexadecimal output case format. false - lowercase; true - uppercase + b64pad = (options && typeof options.pad === 'string') ? options.pad : '=', // base-64 pad character. Defaults to '=' for strict RFC compliance + utf8 = (options && typeof options.utf8 === 'boolean') ? options.utf8 : true; // enable/disable utf8 encoding + + // privileged (public) methods + this.hex = function (s) { + return rstr2hex(rstr(s, utf8), hexcase); + }; + this.b64 = function (s) { + return rstr2b64(rstr(s), b64pad); + }; + this.any = function (s, e) { + return rstr2any(rstr(s, utf8), e); + }; + this.raw = function (s) { + return rstr(s, utf8); + }; + this.hex_hmac = function (k, d) { + return rstr2hex(rstr_hmac(k, d), hexcase); + }; + this.b64_hmac = function (k, d) { + return rstr2b64(rstr_hmac(k, d), b64pad); + }; + this.any_hmac = function (k, d, e) { + return rstr2any(rstr_hmac(k, d), e); + }; + /** + * Perform a simple self-test to see if the VM is working + * @return {String} Hexadecimal hash sample + */ + this.vm_test = function () { + return hex('abc').toLowerCase() === '900150983cd24fb0d6963f7d28e17f72'; + }; + /** + * Enable/disable uppercase hexadecimal returned string + * @param {Boolean} + * @return {Object} this + */ + this.setUpperCase = function (a) { + if (typeof a === 'boolean') { + hexcase = a; + } + return this; + }; + /** + * Defines a base64 pad string + * @param {String} Pad + * @return {Object} this + */ + this.setPad = function (a) { + b64pad = a || b64pad; + return this; + }; + /** + * Defines a base64 pad string + * @param {Boolean} + * @return {Object} [this] + */ + this.setUTF8 = function (a) { + if (typeof a === 'boolean') { + utf8 = a; + } + return this; + }; + + // private methods + + /** + * Calculate the MD5 of a raw string + */ + + function rstr(s) { + s = (utf8) ? utf8Encode(s) : s; + return binl2rstr(binl(rstr2binl(s), s.length * 8)); + } + + /** + * Calculate the HMAC-MD5, of a key and some data (raw strings) + */ + + function rstr_hmac(key, data) { + var bkey, ipad, opad, hash, i; + + key = (utf8) ? utf8Encode(key) : key; + data = (utf8) ? utf8Encode(data) : data; + bkey = rstr2binl(key); + if (bkey.length > 16) { + bkey = binl(bkey, key.length * 8); + } + + ipad = Array(16), opad = Array(16); + for (i = 0; i < 16; i += 1) { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5C5C5C5C; + } + hash = binl(ipad.concat(rstr2binl(data)), 512 + data.length * 8); + return binl2rstr(binl(opad.concat(hash), 512 + 128)); + } + + /** + * Calculate the MD5 of an array of little-endian words, and a bit length. + */ + + function binl(x, len) { + var i, olda, oldb, oldc, oldd, + a = 1732584193, + b = -271733879, + c = -1732584194, + d = 271733878; + + /* append padding */ + x[len >> 5] |= 0x80 << ((len) % 32); + x[(((len + 64) >>> 9) << 4) + 14] = len; + + for (i = 0; i < x.length; i += 16) { + olda = a; + oldb = b; + oldc = c; + oldd = d; + + a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936); + d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5_ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329); + + a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302); + a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734); + + a = md5_hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222); + c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651); + + a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844); + d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551); + + a = safe_add(a, olda); + b = safe_add(b, oldb); + c = safe_add(c, oldc); + d = safe_add(d, oldd); + } + return Array(a, b, c, d); + } + + /** + * These functions implement the four basic operations the algorithm uses. + */ + + function md5_cmn(q, a, b, x, s, t) { + return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b); + } + + function md5_ff(a, b, c, d, x, s, t) { + return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); + } + + function md5_gg(a, b, c, d, x, s, t) { + return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); + } + + function md5_hh(a, b, c, d, x, s, t) { + return md5_cmn(b ^ c ^ d, a, b, x, s, t); + } + + function md5_ii(a, b, c, d, x, s, t) { + return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); + } + }, + /** + * @member Hashes + * @class Hashes.SHA1 + * @param {Object} [config] + * @constructor + * + * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined in FIPS 180-1 + * Version 2.2 Copyright Paul Johnston 2000 - 2009. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * See http://pajhome.org.uk/crypt/md5 for details. + */ + SHA1: function (options) { + /** + * Private config properties. You may need to tweak these to be compatible with + * the server-side, but the defaults work in most cases. + * See {@link Hashes.MD5#method-setUpperCase} and {@link Hashes.SHA1#method-setUpperCase} + */ + var hexcase = (options && typeof options.uppercase === 'boolean') ? options.uppercase : false, // hexadecimal output case format. false - lowercase; true - uppercase + b64pad = (options && typeof options.pad === 'string') ? options.pad : '=', // base-64 pad character. Defaults to '=' for strict RFC compliance + utf8 = (options && typeof options.utf8 === 'boolean') ? options.utf8 : true; // enable/disable utf8 encoding + + // public methods + this.hex = function (s) { + return rstr2hex(rstr(s, utf8), hexcase); + }; + this.b64 = function (s) { + return rstr2b64(rstr(s, utf8), b64pad); + }; + this.any = function (s, e) { + return rstr2any(rstr(s, utf8), e); + }; + this.raw = function (s) { + return rstr(s, utf8); + }; + this.hex_hmac = function (k, d) { + return rstr2hex(rstr_hmac(k, d)); + }; + this.b64_hmac = function (k, d) { + return rstr2b64(rstr_hmac(k, d), b64pad); + }; + this.any_hmac = function (k, d, e) { + return rstr2any(rstr_hmac(k, d), e); + }; + /** + * Perform a simple self-test to see if the VM is working + * @return {String} Hexadecimal hash sample + * @public + */ + this.vm_test = function () { + return hex('abc').toLowerCase() === '900150983cd24fb0d6963f7d28e17f72'; + }; + /** + * @description Enable/disable uppercase hexadecimal returned string + * @param {boolean} + * @return {Object} this + * @public + */ + this.setUpperCase = function (a) { + if (typeof a === 'boolean') { + hexcase = a; + } + return this; + }; + /** + * @description Defines a base64 pad string + * @param {string} Pad + * @return {Object} this + * @public + */ + this.setPad = function (a) { + b64pad = a || b64pad; + return this; + }; + /** + * @description Defines a base64 pad string + * @param {boolean} + * @return {Object} this + * @public + */ + this.setUTF8 = function (a) { + if (typeof a === 'boolean') { + utf8 = a; + } + return this; + }; + + // private methods + + /** + * Calculate the SHA-512 of a raw string + */ + + function rstr(s) { + s = (utf8) ? utf8Encode(s) : s; + return binb2rstr(binb(rstr2binb(s), s.length * 8)); + } + + /** + * Calculate the HMAC-SHA1 of a key and some data (raw strings) + */ + + function rstr_hmac(key, data) { + var bkey, ipad, opad, i, hash; + key = (utf8) ? utf8Encode(key) : key; + data = (utf8) ? utf8Encode(data) : data; + bkey = rstr2binb(key); + + if (bkey.length > 16) { + bkey = binb(bkey, key.length * 8); + } + ipad = Array(16), opad = Array(16); + for (i = 0; i < 16; i += 1) { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5C5C5C5C; + } + hash = binb(ipad.concat(rstr2binb(data)), 512 + data.length * 8); + return binb2rstr(binb(opad.concat(hash), 512 + 160)); + } + + /** + * Calculate the SHA-1 of an array of big-endian words, and a bit length + */ + + function binb(x, len) { + var i, j, t, olda, oldb, oldc, oldd, olde, + w = Array(80), + a = 1732584193, + b = -271733879, + c = -1732584194, + d = 271733878, + e = -1009589776; + + /* append padding */ + x[len >> 5] |= 0x80 << (24 - len % 32); + x[((len + 64 >> 9) << 4) + 15] = len; + + for (i = 0; i < x.length; i += 16) { + olda = a; + oldb = b; + oldc = c; + oldd = d; + olde = e; + + for (j = 0; j < 80; j += 1) { + if (j < 16) { + w[j] = x[i + j]; + } else { + w[j] = bit_rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1); + } + t = safe_add(safe_add(bit_rol(a, 5), sha1_ft(j, b, c, d)), + safe_add(safe_add(e, w[j]), sha1_kt(j))); + e = d; + d = c; + c = bit_rol(b, 30); + b = a; + a = t; + } + + a = safe_add(a, olda); + b = safe_add(b, oldb); + c = safe_add(c, oldc); + d = safe_add(d, oldd); + e = safe_add(e, olde); + } + return Array(a, b, c, d, e); + } + + /** + * Perform the appropriate triplet combination function for the current + * iteration + */ + + function sha1_ft(t, b, c, d) { + if (t < 20) { + return (b & c) | ((~b) & d); + } + if (t < 40) { + return b ^ c ^ d; + } + if (t < 60) { + return (b & c) | (b & d) | (c & d); + } + return b ^ c ^ d; + } + + /** + * Determine the appropriate additive constant for the current iteration + */ + + function sha1_kt(t) { + return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : + (t < 60) ? -1894007588 : -899497514; + } + }, + /** + * @class Hashes.SHA256 + * @param {config} + * + * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined in FIPS 180-2 + * Version 2.2 Copyright Angel Marin, Paul Johnston 2000 - 2009. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * See http://pajhome.org.uk/crypt/md5 for details. + * Also http://anmar.eu.org/projects/jssha2/ + */ + SHA256: function (options) { + /** + * Private properties configuration variables. You may need to tweak these to be compatible with + * the server-side, but the defaults work in most cases. + * @see this.setUpperCase() method + * @see this.setPad() method + */ + var hexcase = (options && typeof options.uppercase === 'boolean') ? options.uppercase : false, // hexadecimal output case format. false - lowercase; true - uppercase */ + b64pad = (options && typeof options.pad === 'string') ? options.pad : '=', + /* base-64 pad character. Default '=' for strict RFC compliance */ + utf8 = (options && typeof options.utf8 === 'boolean') ? options.utf8 : true, + /* enable/disable utf8 encoding */ + sha256_K; + + /* privileged (public) methods */ + this.hex = function (s) { + return rstr2hex(rstr(s, utf8)); + }; + this.b64 = function (s) { + return rstr2b64(rstr(s, utf8), b64pad); + }; + this.any = function (s, e) { + return rstr2any(rstr(s, utf8), e); + }; + this.raw = function (s) { + return rstr(s, utf8); + }; + this.hex_hmac = function (k, d) { + return rstr2hex(rstr_hmac(k, d)); + }; + this.b64_hmac = function (k, d) { + return rstr2b64(rstr_hmac(k, d), b64pad); + }; + this.any_hmac = function (k, d, e) { + return rstr2any(rstr_hmac(k, d), e); + }; + /** + * Perform a simple self-test to see if the VM is working + * @return {String} Hexadecimal hash sample + * @public + */ + this.vm_test = function () { + return hex('abc').toLowerCase() === '900150983cd24fb0d6963f7d28e17f72'; + }; + /** + * Enable/disable uppercase hexadecimal returned string + * @param {boolean} + * @return {Object} this + * @public + */ + this.setUpperCase = function (a) { + if (typeof a === 'boolean') { + hexcase = a; + } + return this; + }; + /** + * @description Defines a base64 pad string + * @param {string} Pad + * @return {Object} this + * @public + */ + this.setPad = function (a) { + b64pad = a || b64pad; + return this; + }; + /** + * Defines a base64 pad string + * @param {boolean} + * @return {Object} this + * @public + */ + this.setUTF8 = function (a) { + if (typeof a === 'boolean') { + utf8 = a; + } + return this; + }; + + // private methods + + /** + * Calculate the SHA-512 of a raw string + */ + + function rstr(s, utf8) { + s = (utf8) ? utf8Encode(s) : s; + return binb2rstr(binb(rstr2binb(s), s.length * 8)); + } + + /** + * Calculate the HMAC-sha256 of a key and some data (raw strings) + */ + + function rstr_hmac(key, data) { + key = (utf8) ? utf8Encode(key) : key; + data = (utf8) ? utf8Encode(data) : data; + var hash, i = 0, + bkey = rstr2binb(key), + ipad = Array(16), + opad = Array(16); + + if (bkey.length > 16) { + bkey = binb(bkey, key.length * 8); + } + + for (; i < 16; i += 1) { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5C5C5C5C; + } + + hash = binb(ipad.concat(rstr2binb(data)), 512 + data.length * 8); + return binb2rstr(binb(opad.concat(hash), 512 + 256)); + } + + /* + * Main sha256 function, with its support functions + */ + + function sha256_S(X, n) { + return (X >>> n) | (X << (32 - n)); + } + + function sha256_R(X, n) { + return (X >>> n); + } + + function sha256_Ch(x, y, z) { + return ((x & y) ^ ((~x) & z)); + } + + function sha256_Maj(x, y, z) { + return ((x & y) ^ (x & z) ^ (y & z)); + } + + function sha256_Sigma0256(x) { + return (sha256_S(x, 2) ^ sha256_S(x, 13) ^ sha256_S(x, 22)); + } + + function sha256_Sigma1256(x) { + return (sha256_S(x, 6) ^ sha256_S(x, 11) ^ sha256_S(x, 25)); + } + + function sha256_Gamma0256(x) { + return (sha256_S(x, 7) ^ sha256_S(x, 18) ^ sha256_R(x, 3)); + } + + function sha256_Gamma1256(x) { + return (sha256_S(x, 17) ^ sha256_S(x, 19) ^ sha256_R(x, 10)); + } + + function sha256_Sigma0512(x) { + return (sha256_S(x, 28) ^ sha256_S(x, 34) ^ sha256_S(x, 39)); + } + + function sha256_Sigma1512(x) { + return (sha256_S(x, 14) ^ sha256_S(x, 18) ^ sha256_S(x, 41)); + } + + function sha256_Gamma0512(x) { + return (sha256_S(x, 1) ^ sha256_S(x, 8) ^ sha256_R(x, 7)); + } + + function sha256_Gamma1512(x) { + return (sha256_S(x, 19) ^ sha256_S(x, 61) ^ sha256_R(x, 6)); + } + + sha256_K = [ + 1116352408, 1899447441, -1245643825, -373957723, 961987163, 1508970993, -1841331548, -1424204075, -670586216, 310598401, 607225278, 1426881987, + 1925078388, -2132889090, -1680079193, -1046744716, -459576895, -272742522, + 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, -1740746414, -1473132947, -1341970488, -1084653625, -958395405, -710438585, + 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, + 1695183700, 1986661051, -2117940946, -1838011259, -1564481375, -1474664885, -1035236496, -949202525, -778901479, -694614492, -200395387, 275423344, + 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, + 1537002063, 1747873779, 1955562222, 2024104815, -2067236844, -1933114872, -1866530822, -1538233109, -1090935817, -965641998 + ]; + + function binb(m, l) { + var HASH = [1779033703, -1150833019, 1013904242, -1521486534, + 1359893119, -1694144372, 528734635, 1541459225 + ]; + var W = new Array(64); + var a, b, c, d, e, f, g, h; + var i, j, T1, T2; + + /* append padding */ + m[l >> 5] |= 0x80 << (24 - l % 32); + m[((l + 64 >> 9) << 4) + 15] = l; + + for (i = 0; i < m.length; i += 16) { + a = HASH[0]; + b = HASH[1]; + c = HASH[2]; + d = HASH[3]; + e = HASH[4]; + f = HASH[5]; + g = HASH[6]; + h = HASH[7]; + + for (j = 0; j < 64; j += 1) { + if (j < 16) { + W[j] = m[j + i]; + } else { + W[j] = safe_add(safe_add(safe_add(sha256_Gamma1256(W[j - 2]), W[j - 7]), + sha256_Gamma0256(W[j - 15])), W[j - 16]); + } + + T1 = safe_add(safe_add(safe_add(safe_add(h, sha256_Sigma1256(e)), sha256_Ch(e, f, g)), + sha256_K[j]), W[j]); + T2 = safe_add(sha256_Sigma0256(a), sha256_Maj(a, b, c)); + h = g; + g = f; + f = e; + e = safe_add(d, T1); + d = c; + c = b; + b = a; + a = safe_add(T1, T2); + } + + HASH[0] = safe_add(a, HASH[0]); + HASH[1] = safe_add(b, HASH[1]); + HASH[2] = safe_add(c, HASH[2]); + HASH[3] = safe_add(d, HASH[3]); + HASH[4] = safe_add(e, HASH[4]); + HASH[5] = safe_add(f, HASH[5]); + HASH[6] = safe_add(g, HASH[6]); + HASH[7] = safe_add(h, HASH[7]); + } + return HASH; + } + + }, + + /** + * @class Hashes.SHA512 + * @param {config} + * + * A JavaScript implementation of the Secure Hash Algorithm, SHA-512, as defined in FIPS 180-2 + * Version 2.2 Copyright Anonymous Contributor, Paul Johnston 2000 - 2009. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * See http://pajhome.org.uk/crypt/md5 for details. + */ + SHA512: function (options) { + /** + * Private properties configuration variables. You may need to tweak these to be compatible with + * the server-side, but the defaults work in most cases. + * @see this.setUpperCase() method + * @see this.setPad() method + */ + var hexcase = (options && typeof options.uppercase === 'boolean') ? options.uppercase : false, + /* hexadecimal output case format. false - lowercase; true - uppercase */ + b64pad = (options && typeof options.pad === 'string') ? options.pad : '=', + /* base-64 pad character. Default '=' for strict RFC compliance */ + utf8 = (options && typeof options.utf8 === 'boolean') ? options.utf8 : true, + /* enable/disable utf8 encoding */ + sha512_k; + + /* privileged (public) methods */ + this.hex = function (s) { + return rstr2hex(rstr(s)); + }; + this.b64 = function (s) { + return rstr2b64(rstr(s), b64pad); + }; + this.any = function (s, e) { + return rstr2any(rstr(s), e); + }; + this.raw = function (s) { + return rstr(s, utf8); + }; + this.hex_hmac = function (k, d) { + return rstr2hex(rstr_hmac(k, d)); + }; + this.b64_hmac = function (k, d) { + return rstr2b64(rstr_hmac(k, d), b64pad); + }; + this.any_hmac = function (k, d, e) { + return rstr2any(rstr_hmac(k, d), e); + }; + /** + * Perform a simple self-test to see if the VM is working + * @return {String} Hexadecimal hash sample + * @public + */ + this.vm_test = function () { + return hex('abc').toLowerCase() === '900150983cd24fb0d6963f7d28e17f72'; + }; + /** + * @description Enable/disable uppercase hexadecimal returned string + * @param {boolean} + * @return {Object} this + * @public + */ + this.setUpperCase = function (a) { + if (typeof a === 'boolean') { + hexcase = a; + } + return this; + }; + /** + * @description Defines a base64 pad string + * @param {string} Pad + * @return {Object} this + * @public + */ + this.setPad = function (a) { + b64pad = a || b64pad; + return this; + }; + /** + * @description Defines a base64 pad string + * @param {boolean} + * @return {Object} this + * @public + */ + this.setUTF8 = function (a) { + if (typeof a === 'boolean') { + utf8 = a; + } + return this; + }; + + /* private methods */ + + /** + * Calculate the SHA-512 of a raw string + */ + + function rstr(s) { + s = (utf8) ? utf8Encode(s) : s; + return binb2rstr(binb(rstr2binb(s), s.length * 8)); + } + /* + * Calculate the HMAC-SHA-512 of a key and some data (raw strings) + */ + + function rstr_hmac(key, data) { + key = (utf8) ? utf8Encode(key) : key; + data = (utf8) ? utf8Encode(data) : data; + + var hash, i = 0, + bkey = rstr2binb(key), + ipad = Array(32), + opad = Array(32); + + if (bkey.length > 32) { + bkey = binb(bkey, key.length * 8); + } + + for (; i < 32; i += 1) { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5C5C5C5C; + } + + hash = binb(ipad.concat(rstr2binb(data)), 1024 + data.length * 8); + return binb2rstr(binb(opad.concat(hash), 1024 + 512)); + } + + /** + * Calculate the SHA-512 of an array of big-endian dwords, and a bit length + */ + + function binb(x, len) { + var j, i, l, + W = new Array(80), + hash = new Array(16), + //Initial hash values + H = [ + new int64(0x6a09e667, -205731576), + new int64(-1150833019, -2067093701), + new int64(0x3c6ef372, -23791573), + new int64(-1521486534, 0x5f1d36f1), + new int64(0x510e527f, -1377402159), + new int64(-1694144372, 0x2b3e6c1f), + new int64(0x1f83d9ab, -79577749), + new int64(0x5be0cd19, 0x137e2179) + ], + T1 = new int64(0, 0), + T2 = new int64(0, 0), + a = new int64(0, 0), + b = new int64(0, 0), + c = new int64(0, 0), + d = new int64(0, 0), + e = new int64(0, 0), + f = new int64(0, 0), + g = new int64(0, 0), + h = new int64(0, 0), + //Temporary variables not specified by the document + s0 = new int64(0, 0), + s1 = new int64(0, 0), + Ch = new int64(0, 0), + Maj = new int64(0, 0), + r1 = new int64(0, 0), + r2 = new int64(0, 0), + r3 = new int64(0, 0); + + if (sha512_k === undefined) { + //SHA512 constants + sha512_k = [ + new int64(0x428a2f98, -685199838), new int64(0x71374491, 0x23ef65cd), + new int64(-1245643825, -330482897), new int64(-373957723, -2121671748), + new int64(0x3956c25b, -213338824), new int64(0x59f111f1, -1241133031), + new int64(-1841331548, -1357295717), new int64(-1424204075, -630357736), + new int64(-670586216, -1560083902), new int64(0x12835b01, 0x45706fbe), + new int64(0x243185be, 0x4ee4b28c), new int64(0x550c7dc3, -704662302), + new int64(0x72be5d74, -226784913), new int64(-2132889090, 0x3b1696b1), + new int64(-1680079193, 0x25c71235), new int64(-1046744716, -815192428), + new int64(-459576895, -1628353838), new int64(-272742522, 0x384f25e3), + new int64(0xfc19dc6, -1953704523), new int64(0x240ca1cc, 0x77ac9c65), + new int64(0x2de92c6f, 0x592b0275), new int64(0x4a7484aa, 0x6ea6e483), + new int64(0x5cb0a9dc, -1119749164), new int64(0x76f988da, -2096016459), + new int64(-1740746414, -295247957), new int64(-1473132947, 0x2db43210), + new int64(-1341970488, -1728372417), new int64(-1084653625, -1091629340), + new int64(-958395405, 0x3da88fc2), new int64(-710438585, -1828018395), + new int64(0x6ca6351, -536640913), new int64(0x14292967, 0xa0e6e70), + new int64(0x27b70a85, 0x46d22ffc), new int64(0x2e1b2138, 0x5c26c926), + new int64(0x4d2c6dfc, 0x5ac42aed), new int64(0x53380d13, -1651133473), + new int64(0x650a7354, -1951439906), new int64(0x766a0abb, 0x3c77b2a8), + new int64(-2117940946, 0x47edaee6), new int64(-1838011259, 0x1482353b), + new int64(-1564481375, 0x4cf10364), new int64(-1474664885, -1136513023), + new int64(-1035236496, -789014639), new int64(-949202525, 0x654be30), + new int64(-778901479, -688958952), new int64(-694614492, 0x5565a910), + new int64(-200395387, 0x5771202a), new int64(0x106aa070, 0x32bbd1b8), + new int64(0x19a4c116, -1194143544), new int64(0x1e376c08, 0x5141ab53), + new int64(0x2748774c, -544281703), new int64(0x34b0bcb5, -509917016), + new int64(0x391c0cb3, -976659869), new int64(0x4ed8aa4a, -482243893), + new int64(0x5b9cca4f, 0x7763e373), new int64(0x682e6ff3, -692930397), + new int64(0x748f82ee, 0x5defb2fc), new int64(0x78a5636f, 0x43172f60), + new int64(-2067236844, -1578062990), new int64(-1933114872, 0x1a6439ec), + new int64(-1866530822, 0x23631e28), new int64(-1538233109, -561857047), + new int64(-1090935817, -1295615723), new int64(-965641998, -479046869), + new int64(-903397682, -366583396), new int64(-779700025, 0x21c0c207), + new int64(-354779690, -840897762), new int64(-176337025, -294727304), + new int64(0x6f067aa, 0x72176fba), new int64(0xa637dc5, -1563912026), + new int64(0x113f9804, -1090974290), new int64(0x1b710b35, 0x131c471b), + new int64(0x28db77f5, 0x23047d84), new int64(0x32caab7b, 0x40c72493), + new int64(0x3c9ebe0a, 0x15c9bebc), new int64(0x431d67c4, -1676669620), + new int64(0x4cc5d4be, -885112138), new int64(0x597f299c, -60457430), + new int64(0x5fcb6fab, 0x3ad6faec), new int64(0x6c44198c, 0x4a475817) + ]; + } + + for (i = 0; i < 80; i += 1) { + W[i] = new int64(0, 0); + } + + // append padding to the source string. The format is described in the FIPS. + x[len >> 5] |= 0x80 << (24 - (len & 0x1f)); + x[((len + 128 >> 10) << 5) + 31] = len; + l = x.length; + for (i = 0; i < l; i += 32) { //32 dwords is the block size + int64copy(a, H[0]); + int64copy(b, H[1]); + int64copy(c, H[2]); + int64copy(d, H[3]); + int64copy(e, H[4]); + int64copy(f, H[5]); + int64copy(g, H[6]); + int64copy(h, H[7]); + + for (j = 0; j < 16; j += 1) { + W[j].h = x[i + 2 * j]; + W[j].l = x[i + 2 * j + 1]; + } + + for (j = 16; j < 80; j += 1) { + //sigma1 + int64rrot(r1, W[j - 2], 19); + int64revrrot(r2, W[j - 2], 29); + int64shr(r3, W[j - 2], 6); + s1.l = r1.l ^ r2.l ^ r3.l; + s1.h = r1.h ^ r2.h ^ r3.h; + //sigma0 + int64rrot(r1, W[j - 15], 1); + int64rrot(r2, W[j - 15], 8); + int64shr(r3, W[j - 15], 7); + s0.l = r1.l ^ r2.l ^ r3.l; + s0.h = r1.h ^ r2.h ^ r3.h; + + int64add4(W[j], s1, W[j - 7], s0, W[j - 16]); + } + + for (j = 0; j < 80; j += 1) { + //Ch + Ch.l = (e.l & f.l) ^ (~e.l & g.l); + Ch.h = (e.h & f.h) ^ (~e.h & g.h); + + //Sigma1 + int64rrot(r1, e, 14); + int64rrot(r2, e, 18); + int64revrrot(r3, e, 9); + s1.l = r1.l ^ r2.l ^ r3.l; + s1.h = r1.h ^ r2.h ^ r3.h; + + //Sigma0 + int64rrot(r1, a, 28); + int64revrrot(r2, a, 2); + int64revrrot(r3, a, 7); + s0.l = r1.l ^ r2.l ^ r3.l; + s0.h = r1.h ^ r2.h ^ r3.h; + + //Maj + Maj.l = (a.l & b.l) ^ (a.l & c.l) ^ (b.l & c.l); + Maj.h = (a.h & b.h) ^ (a.h & c.h) ^ (b.h & c.h); + + int64add5(T1, h, s1, Ch, sha512_k[j], W[j]); + int64add(T2, s0, Maj); + + int64copy(h, g); + int64copy(g, f); + int64copy(f, e); + int64add(e, d, T1); + int64copy(d, c); + int64copy(c, b); + int64copy(b, a); + int64add(a, T1, T2); + } + int64add(H[0], H[0], a); + int64add(H[1], H[1], b); + int64add(H[2], H[2], c); + int64add(H[3], H[3], d); + int64add(H[4], H[4], e); + int64add(H[5], H[5], f); + int64add(H[6], H[6], g); + int64add(H[7], H[7], h); + } + + //represent the hash as an array of 32-bit dwords + for (i = 0; i < 8; i += 1) { + hash[2 * i] = H[i].h; + hash[2 * i + 1] = H[i].l; + } + return hash; + } + + //A constructor for 64-bit numbers + + function int64(h, l) { + this.h = h; + this.l = l; + //this.toString = int64toString; + } + + //Copies src into dst, assuming both are 64-bit numbers + + function int64copy(dst, src) { + dst.h = src.h; + dst.l = src.l; + } + + //Right-rotates a 64-bit number by shift + //Won't handle cases of shift>=32 + //The function revrrot() is for that + + function int64rrot(dst, x, shift) { + dst.l = (x.l >>> shift) | (x.h << (32 - shift)); + dst.h = (x.h >>> shift) | (x.l << (32 - shift)); + } + + //Reverses the dwords of the source and then rotates right by shift. + //This is equivalent to rotation by 32+shift + + function int64revrrot(dst, x, shift) { + dst.l = (x.h >>> shift) | (x.l << (32 - shift)); + dst.h = (x.l >>> shift) | (x.h << (32 - shift)); + } + + //Bitwise-shifts right a 64-bit number by shift + //Won't handle shift>=32, but it's never needed in SHA512 + + function int64shr(dst, x, shift) { + dst.l = (x.l >>> shift) | (x.h << (32 - shift)); + dst.h = (x.h >>> shift); + } + + //Adds two 64-bit numbers + //Like the original implementation, does not rely on 32-bit operations + + function int64add(dst, x, y) { + var w0 = (x.l & 0xffff) + (y.l & 0xffff); + var w1 = (x.l >>> 16) + (y.l >>> 16) + (w0 >>> 16); + var w2 = (x.h & 0xffff) + (y.h & 0xffff) + (w1 >>> 16); + var w3 = (x.h >>> 16) + (y.h >>> 16) + (w2 >>> 16); + dst.l = (w0 & 0xffff) | (w1 << 16); + dst.h = (w2 & 0xffff) | (w3 << 16); + } + + //Same, except with 4 addends. Works faster than adding them one by one. + + function int64add4(dst, a, b, c, d) { + var w0 = (a.l & 0xffff) + (b.l & 0xffff) + (c.l & 0xffff) + (d.l & 0xffff); + var w1 = (a.l >>> 16) + (b.l >>> 16) + (c.l >>> 16) + (d.l >>> 16) + (w0 >>> 16); + var w2 = (a.h & 0xffff) + (b.h & 0xffff) + (c.h & 0xffff) + (d.h & 0xffff) + (w1 >>> 16); + var w3 = (a.h >>> 16) + (b.h >>> 16) + (c.h >>> 16) + (d.h >>> 16) + (w2 >>> 16); + dst.l = (w0 & 0xffff) | (w1 << 16); + dst.h = (w2 & 0xffff) | (w3 << 16); + } + + //Same, except with 5 addends + + function int64add5(dst, a, b, c, d, e) { + var w0 = (a.l & 0xffff) + (b.l & 0xffff) + (c.l & 0xffff) + (d.l & 0xffff) + (e.l & 0xffff), + w1 = (a.l >>> 16) + (b.l >>> 16) + (c.l >>> 16) + (d.l >>> 16) + (e.l >>> 16) + (w0 >>> 16), + w2 = (a.h & 0xffff) + (b.h & 0xffff) + (c.h & 0xffff) + (d.h & 0xffff) + (e.h & 0xffff) + (w1 >>> 16), + w3 = (a.h >>> 16) + (b.h >>> 16) + (c.h >>> 16) + (d.h >>> 16) + (e.h >>> 16) + (w2 >>> 16); + dst.l = (w0 & 0xffff) | (w1 << 16); + dst.h = (w2 & 0xffff) | (w3 << 16); + } + }, + /** + * @class Hashes.RMD160 + * @constructor + * @param {Object} [config] + * + * A JavaScript implementation of the RIPEMD-160 Algorithm + * Version 2.2 Copyright Jeremy Lin, Paul Johnston 2000 - 2009. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * See http://pajhome.org.uk/crypt/md5 for details. + * Also http://www.ocf.berkeley.edu/~jjlin/jsotp/ + */ + RMD160: function (options) { + /** + * Private properties configuration variables. You may need to tweak these to be compatible with + * the server-side, but the defaults work in most cases. + * @see this.setUpperCase() method + * @see this.setPad() method + */ + var hexcase = (options && typeof options.uppercase === 'boolean') ? options.uppercase : false, + /* hexadecimal output case format. false - lowercase; true - uppercase */ + b64pad = (options && typeof options.pad === 'string') ? options.pa : '=', + /* base-64 pad character. Default '=' for strict RFC compliance */ + utf8 = (options && typeof options.utf8 === 'boolean') ? options.utf8 : true, + /* enable/disable utf8 encoding */ + rmd160_r1 = [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, + 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, + 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, + 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13 + ], + rmd160_r2 = [ + 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, + 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, + 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, + 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, + 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11 + ], + rmd160_s1 = [ + 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, + 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, + 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, + 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, + 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 + ], + rmd160_s2 = [ + 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, + 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, + 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, + 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, + 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 + ]; + + /* privileged (public) methods */ + this.hex = function (s) { + return rstr2hex(rstr(s, utf8)); + }; + this.b64 = function (s) { + return rstr2b64(rstr(s, utf8), b64pad); + }; + this.any = function (s, e) { + return rstr2any(rstr(s, utf8), e); + }; + this.raw = function (s) { + return rstr(s, utf8); + }; + this.hex_hmac = function (k, d) { + return rstr2hex(rstr_hmac(k, d)); + }; + this.b64_hmac = function (k, d) { + return rstr2b64(rstr_hmac(k, d), b64pad); + }; + this.any_hmac = function (k, d, e) { + return rstr2any(rstr_hmac(k, d), e); + }; + /** + * Perform a simple self-test to see if the VM is working + * @return {String} Hexadecimal hash sample + * @public + */ + this.vm_test = function () { + return hex('abc').toLowerCase() === '900150983cd24fb0d6963f7d28e17f72'; + }; + /** + * @description Enable/disable uppercase hexadecimal returned string + * @param {boolean} + * @return {Object} this + * @public + */ + this.setUpperCase = function (a) { + if (typeof a === 'boolean') { + hexcase = a; + } + return this; + }; + /** + * @description Defines a base64 pad string + * @param {string} Pad + * @return {Object} this + * @public + */ + this.setPad = function (a) { + if (typeof a !== 'undefined') { + b64pad = a; + } + return this; + }; + /** + * @description Defines a base64 pad string + * @param {boolean} + * @return {Object} this + * @public + */ + this.setUTF8 = function (a) { + if (typeof a === 'boolean') { + utf8 = a; + } + return this; + }; + + /* private methods */ + + /** + * Calculate the rmd160 of a raw string + */ + + function rstr(s) { + s = (utf8) ? utf8Encode(s) : s; + return binl2rstr(binl(rstr2binl(s), s.length * 8)); + } + + /** + * Calculate the HMAC-rmd160 of a key and some data (raw strings) + */ + + function rstr_hmac(key, data) { + key = (utf8) ? utf8Encode(key) : key; + data = (utf8) ? utf8Encode(data) : data; + var i, hash, + bkey = rstr2binl(key), + ipad = Array(16), + opad = Array(16); + + if (bkey.length > 16) { + bkey = binl(bkey, key.length * 8); + } + + for (i = 0; i < 16; i += 1) { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5C5C5C5C; + } + hash = binl(ipad.concat(rstr2binl(data)), 512 + data.length * 8); + return binl2rstr(binl(opad.concat(hash), 512 + 160)); + } + + /** + * Convert an array of little-endian words to a string + */ + + function binl2rstr(input) { + var i, output = '', + l = input.length * 32; + for (i = 0; i < l; i += 8) { + output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF); + } + return output; + } + + /** + * Calculate the RIPE-MD160 of an array of little-endian words, and a bit length. + */ + + function binl(x, len) { + var T, j, i, l, + h0 = 0x67452301, + h1 = 0xefcdab89, + h2 = 0x98badcfe, + h3 = 0x10325476, + h4 = 0xc3d2e1f0, + A1, B1, C1, D1, E1, + A2, B2, C2, D2, E2; + + /* append padding */ + x[len >> 5] |= 0x80 << (len % 32); + x[(((len + 64) >>> 9) << 4) + 14] = len; + l = x.length; + + for (i = 0; i < l; i += 16) { + A1 = A2 = h0; + B1 = B2 = h1; + C1 = C2 = h2; + D1 = D2 = h3; + E1 = E2 = h4; + for (j = 0; j <= 79; j += 1) { + T = safe_add(A1, rmd160_f(j, B1, C1, D1)); + T = safe_add(T, x[i + rmd160_r1[j]]); + T = safe_add(T, rmd160_K1(j)); + T = safe_add(bit_rol(T, rmd160_s1[j]), E1); + A1 = E1; + E1 = D1; + D1 = bit_rol(C1, 10); + C1 = B1; + B1 = T; + T = safe_add(A2, rmd160_f(79 - j, B2, C2, D2)); + T = safe_add(T, x[i + rmd160_r2[j]]); + T = safe_add(T, rmd160_K2(j)); + T = safe_add(bit_rol(T, rmd160_s2[j]), E2); + A2 = E2; + E2 = D2; + D2 = bit_rol(C2, 10); + C2 = B2; + B2 = T; + } + + T = safe_add(h1, safe_add(C1, D2)); + h1 = safe_add(h2, safe_add(D1, E2)); + h2 = safe_add(h3, safe_add(E1, A2)); + h3 = safe_add(h4, safe_add(A1, B2)); + h4 = safe_add(h0, safe_add(B1, C2)); + h0 = T; + } + return [h0, h1, h2, h3, h4]; + } + + // specific algorithm methods + + function rmd160_f(j, x, y, z) { + return (0 <= j && j <= 15) ? (x ^ y ^ z) : + (16 <= j && j <= 31) ? (x & y) | (~x & z) : + (32 <= j && j <= 47) ? (x | ~y) ^ z : + (48 <= j && j <= 63) ? (x & z) | (y & ~z) : + (64 <= j && j <= 79) ? x ^ (y | ~z) : + 'rmd160_f: j out of range'; + } + + function rmd160_K1(j) { + return (0 <= j && j <= 15) ? 0x00000000 : + (16 <= j && j <= 31) ? 0x5a827999 : + (32 <= j && j <= 47) ? 0x6ed9eba1 : + (48 <= j && j <= 63) ? 0x8f1bbcdc : + (64 <= j && j <= 79) ? 0xa953fd4e : + 'rmd160_K1: j out of range'; + } + + function rmd160_K2(j) { + return (0 <= j && j <= 15) ? 0x50a28be6 : + (16 <= j && j <= 31) ? 0x5c4dd124 : + (32 <= j && j <= 47) ? 0x6d703ef3 : + (48 <= j && j <= 63) ? 0x7a6d76e9 : + (64 <= j && j <= 79) ? 0x00000000 : + 'rmd160_K2: j out of range'; + } + } + }; + + // new MD5 instance + var MD5 = new pearHash.MD5 + // new SHA1 instance + var SHA1 = new pearHash.SHA1 + // new SHA256 instance + var SHA256 = new pearHash.SHA256 + // new SHA512 instace + var SHA512 = new pearHash.SHA512 + // new RIPEMD-160 instace + var RMD160 = new pearHash.RMD160 + var Base64 = new pearHash.Base64 + + pearHash.md5 = function (str) { + return MD5.hex(str); + } + pearHash.sha1 = function (str) { + return SHA1.hex(str); + } + pearHash.sha256 = function (str) { + return SHA256.hex(str); + } + pearHash.sha512 = function (str) { + return SHA512.hex(str); + } + pearHash.crc32 = pearHash.CRC32; + pearHash.rmd160 = function (str) { + return RMD160.hex(str); + } + pearHash.Base64Encode = function (str) { + return Base64.encode(str); + } + pearHash.Base64Decode = function (str) { + return Base64.decode(str); + } + exports('hash', pearHash); +}); \ No newline at end of file diff --git a/static/component/pear/module/http.js b/static/component/pear/module/http.js new file mode 100644 index 000000000..e1b199369 --- /dev/null +++ b/static/component/pear/module/http.js @@ -0,0 +1,181 @@ +layui.define(['jquery', 'layer'], function (exports) { + "use strict"; + + var $ = layui.jquery; + var layer = layui.layer; + + var http = {}; + http.ajax = function (userOptions) { + userOptions = userOptions || {}; + + var options = $.extend(true, {}, http.ajax.defaultOpts, userOptions); + var oldBeforeSendOption = options.beforeSend; + options.beforeSend = function (xhr) { + if (oldBeforeSendOption) { + oldBeforeSendOption(xhr); + } + + xhr.setRequestHeader("Pragma", "no-cache"); + xhr.setRequestHeader("Cache-Control", "no-cache"); + xhr.setRequestHeader("Expires", "Sat, 01 Jan 2000 00:00:00 GMT"); + }; + + options.success = undefined; + options.error = undefined; + + return $.Deferred(function ($dfd) { + $.ajax(options) + .done(function (data, textStatus, jqXHR) { + $dfd.resolve(data); + userOptions.success && userOptions.success(data); + }) + .fail(function (jqXHR) { + http.ajax.handleErrorResponse(jqXHR, userOptions, $dfd); + }); + }); + } + + $.extend(http.ajax, { + defaultOpts: { + dataType: 'json', + type: 'POST', + contentType: 'application/json', + headers: { + 'X-Requested-With': 'XMLHttpRequest' + }, + customHandleError: true + }, + + defaultError: { + message: 'An error has occurred!', + details: 'Error detail not sent by server.' + }, + + defaultError401: { + message: 'You are not authenticated!', + details: 'You should be authenticated (sign in) in order to perform this operation.' + }, + + defaultError403: { + message: 'You are not authorized!', + details: 'You are not allowed to perform this operation.' + }, + + defaultError404: { + message: 'Resource not found!', + details: 'The resource requested could not found on the server.' + }, + + logError: function (error) { + console.log(error); + }, + + showError: function (error) { + if (error.details) { + return layer.alert(error.details, { + title: error.message, + icon: 2, + closeBtn: 0 + }); + } else { + return layer.alert(http.ajax.defaultError.details, { + title: error.message || http.ajax.defaultError.message, + icon: 2, + closeBtn: 0 + }); + } + }, + + showErrorAndRedirectUrl: function (error, targetUrl) { + if (error.details) { + return layer.alert(error.details, { + title: error.message, + icon: 2, + closeBtn: 0, + end: http.ajax.handleTargetUrl(targetUrl) + }); + } else { + return layer.alert(http.ajax.defaultError.details, { + title: error.message || http.ajax.defaultError.message, + icon: 2, + closeBtn: 0, + end: http.ajax.handleTargetUrl(targetUrl) + }); + } + }, + + handleTargetUrl: function (targetUrl) { + if (!targetUrl) { + location.href = http.appPath; + } else { + location.href = targetUrl; + } + }, + + handleErrorResponse: function (jqXHR, userOptions, $dfd) { + if (!userOptions.customHandleError) { + switch (jqXHR.status) { + case 401: + http.ajax.showErrorAndRedirectUrl(http.ajax.defaultError401, http.appPath); + break; + case 403: + http.ajax.showError(http.ajax.defaultError403); + break; + case 404: + http.ajax.showError(http.ajax.defaultError404); + break; + default: + http.ajax.showError(http.ajax.defaultError); + break; + } + } + + $dfd.reject.apply(this, arguments); + userOptions.error && userOptions.error.apply(this, arguments); + }, + + ajaxSendHandler: function (event, request, settings) { + var token = http.ajax.getToken(); + if (!token) { + return; + } + + if (!settings.headers || settings.headers[http.ajax.tokenHeaderName] === undefined) { + request.setRequestHeader(http.ajax.tokenHeaderName, token); + } + }, + + getToken: function () { + return http.ajax.getCookieValue(http.ajax.tokenCookieName); + }, + + tokenCookieName: 'XSRF-TOKEN', + tokenHeaderName: 'X-XSRF-TOKEN', + + getCookieValue: function (key) { + var equalities = document.cookie.split('; '); + for (var i = 0; i < equalities.length; i++) { + if (!equalities[i]) { + continue; + } + + var splitted = equalities[i].split('='); + if (splitted.length != 2) { + continue; + } + + if (decodeURIComponent(splitted[0]) === key) { + return decodeURIComponent(splitted[1] || ''); + } + } + + return null; + } + }); + + $(document).ajaxSend(function (event, request, settings) { + return http.ajax.ajaxSendHandler(event, request, settings); + }); + + exports('http', http); +}); \ No newline at end of file diff --git a/static/component/pear/module/loading.js b/static/component/pear/module/loading.js new file mode 100644 index 000000000..e9f6f1af7 --- /dev/null +++ b/static/component/pear/module/loading.js @@ -0,0 +1,2097 @@ +layui.define(['table', 'jquery', 'element'], function (exports) { + "use strict"; + + var MOD_NAME = 'loading', + $ = layui.jquery, + element = layui.element; + + var pearOper = new function () { + + this.blockRemove = function(dom,time){ + Notiflix.Block.Remove(dom, time); + } + + this.block = function(option){ + + if(option.type==1){ + Notiflix.Block.Standard( + option.elem + ,option.msg); + } + else if(option.type==2){ + Notiflix.Block.Hourglass( + option.elem + ,option.msg); + } + else if(option.type==3){ + Notiflix.Block.Circle( + option.elem + ,option.msg); + } + else if(option.type==4){ + + Notiflix.Block.Arrows( + option.elem + ,option.msg); + } + else if(option.type==5){ + Notiflix.Block.Dots( + option.elem + ,option.msg); + } + else if(option.type==6){ + Notiflix.Block.Pulse( + option.elem + ,option.msg); + } + } + + this.report = function(option){ + if(option.type=="success"){ + Notiflix.Report.Success( + option.title, + option.message,'确认'); + }else if(option.type=="failure"){ + Notiflix.Report.Failure( + option.title, + option.message,'确认'); + }else if(option.type=="warning"){ + Notiflix.Report.Warning( + option.title, + option.message,'确认'); + }else if(option.type=="info"){ + Notiflix.Report.Info( + option.title, + option.message,'确认'); + } + } + + this.notice = function(option){ + Notiflix.Notify.Init({ + position:option.position?"right-top":option.position, + }); + if(option.type=="success"){ + + Notiflix.Notify.Success(option.title); + }else if(option.type=="failure"){ + + Notiflix.Notify.Failure(option.title); + }else if(option.type=="warning"){ + + Notiflix.Notify.Warning(option.title); + }else if(option.type=="info"){ + + Notiflix.Notify.Info(option.title); + } + } + + this.confirm = function(option){ + Notiflix.Confirm.Show( + option.title, + option.message, + '确认', + '取消', + option.success, + option.cancle + ); + } + + this.drawer = function(position,dom,distance){ + var _right = new mSlider({ + dom: dom, + direction: position, + distance:distance + }); + _right.open(); + } + + this.loadRemove = function(time){ + Notiflix.Loading.Remove(time); + } + + this.Load = function(type,message){ + if(type==1){ + Notiflix.Loading.Standard(message); + }else if(type==2){ + Notiflix.Loading.Hourglass(message); + }else if(type==3){ + Notiflix.Loading.Circle(message); + }else if(type==4){ + Notiflix.Loading.Dots(message); + }else if(type==5){ + Notiflix.Loading.Pulse(message); + } + } + + this.msg = function(option){ + if(option.type=="success"){ + + layer.msg(option.title,{icon:1,time:option.time},option.callback); + + }else if(option.type=="failure"){ + + layer.msg(option.title,{icon:2,time:option.time},option.callback); + + }else if(option.type=="warning"){ + + layer.msg(option.title,{icon:3,time:option.time},option.callback); + + }else if(option.type=="info"){ + + layer.msg(option.title,{icon:4,time:option.time},option.callback); + } + } + }; + + // Notiflix: Notify Default Settings on + var notifySettings = { + wrapID: 'NotiflixNotifyWrap', // can not customizable + width: '280px', + position: 'right-top', // 'right-top' - 'right-bottom' - 'left-top' - 'left-bottom' + distance: '10px', + opacity: 1, + borderRadius: '5px', + rtl: false, + timeout: 3000, + messageMaxLength: 110, + backOverlay: false, + backOverlayColor: 'rgba(0,0,0,0.5)', + plainText: true, + showOnlyTheLastOne: false, + clickToClose: false, + + ID: 'NotiflixNotify', + className: 'notiflix-notify', + zindex: 4001, + useGoogleFont: true, + fontFamily: 'Quicksand', + fontSize: '13px', + cssAnimation: true, + cssAnimationDuration: 400, + cssAnimationStyle: 'fade', // 'fade' - 'zoom' - 'from-right' - 'from-top' - 'from-bottom' - 'from-left' + closeButton: false, + useIcon: true, + useFontAwesome: false, + fontAwesomeIconStyle: 'basic', // 'basic' - 'shadow' + fontAwesomeIconSize: '34px', + + success: { + background: '#32c682', + textColor: '#fff', + childClassName: 'success', + notiflixIconColor: 'rgba(0,0,0,0.2)', + fontAwesomeClassName: 'fas fa-check-circle', + fontAwesomeIconColor: 'rgba(0,0,0,0.2)', + }, + + failure: { + background: '#ff5549', + textColor: '#fff', + childClassName: 'failure', + notiflixIconColor: 'rgba(0,0,0,0.2)', + fontAwesomeClassName: 'fas fa-times-circle', + fontAwesomeIconColor: 'rgba(0,0,0,0.2)', + }, + + warning: { + background: '#eebf31', + textColor: '#fff', + childClassName: 'warning', + notiflixIconColor: 'rgba(0,0,0,0.2)', + fontAwesomeClassName: 'fas fa-exclamation-circle', + fontAwesomeIconColor: 'rgba(0,0,0,0.2)', + }, + + info: { + background: '#26c0d3', + textColor: '#fff', + childClassName: 'info', + notiflixIconColor: 'rgba(0,0,0,0.2)', + fontAwesomeClassName: 'fas fa-info-circle', + fontAwesomeIconColor: 'rgba(0,0,0,0.2)', + }, + }; + // Notiflix: Notify Default Settings off + + // Notiflix: Report Default Settings on + var reportSettings = { + ID: 'NotiflixReportWrap', // can not customizable + className: 'notiflix-report', + width: '320px', + backgroundColor: '#f8f8f8', + borderRadius: '25px', + rtl: false, + zindex: 4002, + backOverlay: true, + backOverlayColor: 'rgba(0, 0, 0, 0.5)', + useGoogleFont: true, + fontFamily: 'Quicksand', + svgSize: '110px', + plainText: true, + titleFontSize: '16px', + titleMaxLength: 34, + messageFontSize: '13px', + messageMaxLength: 400, + buttonFontSize: '14px', + buttonMaxLength: 34, + cssAnimation: true, + cssAnimationDuration: 360, + cssAnimationStyle: 'fade', // 'fade' - 'zoom' + + success: { + svgColor: '#32c682', + titleColor: '#1e1e1e', + messageColor: '#242424', + buttonBackground: '#32c682', + buttonColor: '#fff', + }, + + failure: { + svgColor: '#ff5549', + titleColor: '#1e1e1e', + messageColor: '#242424', + buttonBackground: '#ff5549', + buttonColor: '#fff', + }, + + warning: { + svgColor: '#eebf31', + titleColor: '#1e1e1e', + messageColor: '#242424', + buttonBackground: '#eebf31', + buttonColor: '#fff', + }, + + info: { + svgColor: '#26c0d3', + titleColor: '#1e1e1e', + messageColor: '#242424', + buttonBackground: '#26c0d3', + buttonColor: '#fff', + }, + }; + // Notiflix: Report Default Settings off + + // Notiflix: Confirm Default Settings on + var confirmSettings = { + ID: 'NotiflixConfirmWrap', // can not customizable + className: 'notiflix-confirm', + width: '300px', + zindex: 4003, + position: 'center', // 'center' - 'center-top' - 'right-top' - 'right-bottom' - 'left-top' - 'left-bottom' + distance: '10px', + backgroundColor: '#f8f8f8', + borderRadius: '25px', + backOverlay: true, + backOverlayColor: 'rgba(0,0,0,0.5)', + rtl: false, + useGoogleFont: true, + fontFamily: 'Quicksand', + cssAnimation: true, + cssAnimationStyle: 'fade', // 'zoom' - 'fade' + cssAnimationDuration: 300, + plainText: true, + + titleColor: '#32c682', + titleFontSize: '16px', + titleMaxLength: 34, + + messageColor: '#1e1e1e', + messageFontSize: '14px', + messageMaxLength: 110, + + buttonsFontSize: '15px', + buttonsMaxLength: 34, + okButtonColor: '#f8f8f8', + okButtonBackground: '#32c682', + cancelButtonColor: '#f8f8f8', + cancelButtonBackground: '#a9a9a9', + }; + // Notiflix: Confirm Default Settings off + + // Notiflix: Loading Default Settings on + var loadingSettings = { + ID: 'NotiflixLoadingWrap', // can not customizable + className: 'notiflix-loading', + zindex: 4000, + backgroundColor: 'rgba(0,0,0,0.8)', + rtl: false, + useGoogleFont: true, + fontFamily: 'Quicksand', + cssAnimation: true, + cssAnimationDuration: 400, + clickToClose: false, + customSvgUrl: null, + svgSize: '80px', + svgColor: '#32c682', + messageID: 'NotiflixLoadingMessage', + messageFontSize: '15px', + messageMaxLength: 34, + messageColor: '#dcdcdc', + }; + // Notiflix: Loading Default Settings off + + // Notiflix: Block Default Settings on + var blockSettings = { + ID: 'NotiflixBlockWrap', // can not customizable + querySelectorLimit: 200, + className: 'notiflix-block', + position: 'absolute', + zindex: 1000, + backgroundColor: 'rgba(255,255,255,0.9)', + rtl: false, + useGoogleFont: true, + fontFamily: 'Quicksand', + cssAnimation: true, + cssAnimationDuration: 300, + svgSize: '45px', + svgColor: '#383838', + messageFontSize: '14px', + messageMaxLength: 34, + messageColor: '#383838', + }; + // Notiflix: Block Default Settings off + + // Notiflix: Extend on + var extendNotiflix = function () { + // variables + var extended = {}; + var deep = false; + var i = 0; + // check if a deep merge + if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') { + deep = arguments[0]; + i++; + } + // merge the object into the extended object + var merge = function (obj) { + for (var prop in obj) { + if (Object.prototype.hasOwnProperty.call(obj, prop)) { + // if property is an object, merge properties + if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') { + extended[prop] = extendNotiflix(extended[prop], obj[prop]); + } else { + extended[prop] = obj[prop]; + } + } + } + }; + // loop through each object and conduct a merge + for (; i < arguments.length; i++) { + merge(arguments[i]); + } + return extended; + }; + // Notiflix: Extend off + + // Notiflix: Plaintext on + var notiflixPlaintext = function (html) { + var htmlPool = document.createElement('div'); + htmlPool.innerHTML = html; + return htmlPool.textContent || htmlPool.innerText || ''; + }; + // Notiflix: Plaintext off + + // Notiflix: GoogleFont on + var notiflixGoogleFont = function (use, family) { + if (!document.getElementById('NotiflixQuicksand') && use && (family && typeof family === 'string' && family.toLowerCase() === 'quicksand')) { + // google fonts dns prefetch on + var dns = ''; + var dnsRange = document.createRange(); + dnsRange.selectNode(document.head); + var dnsFragment = dnsRange.createContextualFragment(dns); + document.head.appendChild(dnsFragment); + // google fonts dns prefetch off + + // google fonts style on + var font = ''; + var fontRange = document.createRange(); + fontRange.selectNode(document.head); + var fontFragment = fontRange.createContextualFragment(font); + document.head.appendChild(fontFragment); + // google fonts style off + } + }; + // Notiflix: GoogleFont off + + // Notiflix: Console Error on + var notiflixConsoleError = function (title, message) { + return console.error('%c ' + title + ' ', 'padding:2px;border-radius:20px;color:#fff;background:#ff5549', '\n' + message + '\nVisit documentation page to learn more: https://www.notiflix.com/documentation'); + }; + // Notiflix: Console Error off + + // Notiflix: Console Log on + var notiflixConsoleLog = function (title, message) { + return console.log('%c ' + title + ' ', 'padding:2px;border-radius:20px;color:#fff;background:#26c0d3', '\n' + message + '\nVisit documentation page to learn more: https://www.notiflix.com/documentation'); + }; + // Notiflix: Console Log off + + // Notiflix: Main on + var newNotifySettings; + var newReportSettings; + var newConfirmSettings; + var newLoadingSettings; + var newBlockSettings; + var Notiflix = { + // Notify on + Notify: { + + // Init + Init: function (userNotifyOpt) { + // extend options + newNotifySettings = extendNotiflix(true, notifySettings, userNotifyOpt); + // use GoogleFonts if "Quicksand" + notiflixGoogleFont(newNotifySettings.useGoogleFont, newNotifySettings.fontFamily); + }, + + // Merge First Init + Merge: function (userNotifyExtend) { + // if initialized already + if (newNotifySettings) { + newNotifySettings = extendNotiflix(true, newNotifySettings, userNotifyExtend); + } + // initialize first + else { + notiflixConsoleError('Notiflix Error', 'You have to initialize the Notify module before call Merge function.'); + return false; + } + }, + + // Display Notification: Success + Success: function (message, callback) { + // if not initialized pretend like init + if (!newNotifySettings) { + Notiflix.Notify.Init({}); + } + var theType = newNotifySettings.success; + NotiflixNotify(message, callback, theType, 'Success'); + }, + + // Display Notification: Failure + Failure: function (message, callback) { + // if not initialized pretend like init + if (!newNotifySettings) { + Notiflix.Notify.Init({}); + } + var theType = newNotifySettings.failure; + NotiflixNotify(message, callback, theType, 'Failure'); + }, + + // Display Notification: Warning + Warning: function (message, callback) { + // if not initialized pretend like init + if (!newNotifySettings) { + Notiflix.Notify.Init({}); + } + var theType = newNotifySettings.warning; + NotiflixNotify(message, callback, theType, 'Warning'); + }, + + // Display Notification: Info + Info: function (message, callback) { + // if not initialized pretend like init + if (!newNotifySettings) { + Notiflix.Notify.Init({}); + } + var theType = newNotifySettings.info; + NotiflixNotify(message, callback, theType, 'Info'); + }, + }, + // Notify off + + // Report on + Report: { + + // Init + Init: function (userReportOpt) { + // extend options + newReportSettings = extendNotiflix(true, reportSettings, userReportOpt); + // use GoogleFonts if "Quicksand" + notiflixGoogleFont(newReportSettings.useGoogleFont, newReportSettings.fontFamily); + }, + + // Merge First Init + Merge: function (userReportExtend) { + // if initialized already + if (newReportSettings) { + newReportSettings = extendNotiflix(true, newReportSettings, userReportExtend); + } + // initialize first + else { + notiflixConsoleError('Notiflix Error', 'You have to initialize the Report module before call Merge function.'); + return false; + } + }, + + // Display Report: Success + Success: function (title, message, buttonText, buttonCallback) { + // if not initialized pretend like init + if (!newReportSettings) { + Notiflix.Report.Init({}); + } + var theType = newReportSettings.success; + NotiflixReport(title, message, buttonText, buttonCallback, theType, 'Success'); + }, + + // Display Report: Failure + Failure: function (title, message, buttonText, buttonCallback) { + // if not initialized pretend like init + if (!newReportSettings) { + Notiflix.Report.Init({}); + } + var theType = newReportSettings.failure; + NotiflixReport(title, message, buttonText, buttonCallback, theType, 'Failure'); + }, + + // Display Report: Warning + Warning: function (title, message, buttonText, buttonCallback) { + // if not initialized pretend like init + if (!newReportSettings) { + Notiflix.Report.Init({}); + } + var theType = newReportSettings.warning; + NotiflixReport(title, message, buttonText, buttonCallback, theType, 'Warning'); + }, + + // Display Report: Info + Info: function (title, message, buttonText, buttonCallback) { + // if not initialized pretend like init + if (!newReportSettings) { + Notiflix.Report.Init({}); + } + var theType = newReportSettings.info; + NotiflixReport(title, message, buttonText, buttonCallback, theType, 'Info'); + }, + }, + // Report off + + // Confirm on + Confirm: { + + // Init + Init: function (userConfirmOpt) { + // extend options + newConfirmSettings = extendNotiflix(true, confirmSettings, userConfirmOpt); + // use GoogleFonts if "Quicksand" + notiflixGoogleFont(newConfirmSettings.useGoogleFont, newConfirmSettings.fontFamily); + }, + + // Merge First Init + Merge: function (userConfirmExtend) { + // if initialized already + if (newConfirmSettings) { + newConfirmSettings = extendNotiflix(true, newConfirmSettings, userConfirmExtend); + } + // initialize first + else { + notiflixConsoleError('Notiflix Error', 'You have to initialize the Confirm module before call Merge function.'); + return false; + } + }, + + // Display Confirm: Show + Show: function (title, message, okText, cancelText, okCallback, cancelCallback) { + if (!title) { title = 'Notiflix Confirm'; } + if (!message) { message = 'Do you agree with me?'; } + if (!okText) { okText = 'Yes'; } + if (!cancelText) { cancelText = 'No'; } + if (!okCallback) { okCallback = undefined; } + if (!cancelCallback) { cancelCallback = undefined; } + NotiflixConfirm(title, message, okText, cancelText, okCallback, cancelCallback); + }, + }, + // Confirm off + + // Loading on + Loading: { + + // Init + Init: function (userLoadingOpt) { + // extend options + newLoadingSettings = extendNotiflix(true, loadingSettings, userLoadingOpt); + // use GoogleFonts if "Quicksand" + notiflixGoogleFont(newLoadingSettings.useGoogleFont, newLoadingSettings.fontFamily); + }, + + // Merge First Init + Merge: function (userLoadingExtend) { + // if initialized already + if (newLoadingSettings) { + newLoadingSettings = extendNotiflix(true, newLoadingSettings, userLoadingExtend); + } + // initialize first + else { + notiflixConsoleError('Notiflix Error', 'You have to initialize the Loading module before call Merge function.'); + return false; + } + }, + + // Display Loading: Standard + Standard: function (message) { + NotiflixLoading(message, 'standard', true, 0); // true => display || 0 => delay + }, + + // Display Loading: Hourglass + Hourglass: function (message) { + NotiflixLoading(message, 'hourglass', true, 0); // true => display || 0 => delay + }, + + // Display Loading: Circle + Circle: function (message) { + NotiflixLoading(message, 'circle', true, 0); // true => display || 0 => delay + }, + + // Display Loading: Arrows + Arrows: function (message) { + NotiflixLoading(message, 'arrows', true, 0); // true => display || 0 => delay + }, + + // Display Loading: Dots + Dots: function (message) { + NotiflixLoading(message, 'dots', true, 0); // true => display || 0 => delay + }, + + // Display Loading: Pulse + Pulse: function (message) { + NotiflixLoading(message, 'pulse', true, 0); // true => display || 0 => delay + }, + + // Display Loading: Custom + Custom: function (message) { + NotiflixLoading(message, 'custom', true, 0); // true => display || 0 => delay + }, + + // Display Loading: Notiflix + Notiflix: function (message) { + NotiflixLoading(message, 'notiflix', true, 0); // true => display || 0 => delay + }, + + // Remove Loading + Remove: function (theDelay) { + if (!theDelay) { theDelay = 0; } + NotiflixLoading(false, false, false, theDelay); // false = Remove + }, + + // Change The Message + Change: function (newMessage) { + NotiflixLoadingChange(newMessage); + }, + }, + // Loading off + + // Block on + Block: { + + // Initialize + Init: function (userBlockOpt) { + // extend options + newBlockSettings = extendNotiflix(true, blockSettings, userBlockOpt); + // use GoogleFonts if "Quicksand" + notiflixGoogleFont(newBlockSettings.useGoogleFont, newBlockSettings.fontFamily); + }, + + // Merge First Initialize + Merge: function (userBlockExtend) { + // if initialized already + if (newBlockSettings) { + newBlockSettings = extendNotiflix(true, newBlockSettings, userBlockExtend); + } + // initialize first + else { + notiflixConsoleError('Notiflix Error', 'You have to initialize the "Notiflix.Block" module before call Merge function.'); + return false; + } + }, + + // Display Block: Standard + Standard: function (selector, message) { + var block = true; + var theIcon = 'standard'; + NotiflixBlockUnblockElement(block, selector, theIcon, message); + }, + + // Display Block: Hourglass + Hourglass: function (selector, message) { + var block = true; + var theIcon = 'hourglass'; + NotiflixBlockUnblockElement(block, selector, theIcon, message); + }, + + // Display Block: Circle + Circle: function (selector, message) { + var block = true; + var theIcon = 'circle'; + NotiflixBlockUnblockElement(block, selector, theIcon, message); + }, + + // Display Block: Arrows + Arrows: function (selector, message) { + var block = true; + var theIcon = 'arrows'; + NotiflixBlockUnblockElement(block, selector, theIcon, message); + }, + + // Display Block: Dots + Dots: function (selector, message) { + var block = true; + var theIcon = 'dots'; + NotiflixBlockUnblockElement(block, selector, theIcon, message); + }, + + // Display Block: Pulse + Pulse: function (selector, message) { + var block = true; + var theIcon = 'pulse'; + NotiflixBlockUnblockElement(block, selector, theIcon, message); + }, + + // Remove Block + Remove: function (selector, delay) { + var block = false; + var theIcon = null; + var message = null; + NotiflixBlockUnblockElement(block, selector, theIcon, message, delay); + }, + }, + // Block off + }; + // Notiflix: Main off + + + // Notiflix: Notify Single on + var notiflixNotifyCount = 0; + var NotiflixNotify = function (message, callback, theType, staticType) { + if (arguments && arguments.length === 4) { + + // notify counter on + notiflixNotifyCount++; + // notify counter off + + // if no message on + if (!message) { + message = 'Notiflix ' + staticType; + } + // if no message off + + // if plainText true = HTML tags not allowed on + if (newNotifySettings.plainText) { + message = notiflixPlaintext(message); // message plain text + } + // if plainText true = HTML tags not allowed off + + // if plainText false but the message length more than messageMaxLength = HTML tags error on + if (!newNotifySettings.plainText && message.length > newNotifySettings.messageMaxLength) { + Notiflix.Notify.Merge({ closeButton: true, plainText: false, }); + message = 'HTML Tags Error: Your content length is more than "messageMaxLength" option.'; // message html error + } + // if plainText false but the message length more than messageMaxLength = HTML tags error off + + // message max length substring on + if (message.length > newNotifySettings.messageMaxLength) { + message = message.substring(0, newNotifySettings.messageMaxLength) + '...'; + } + // message max length substring off + + // font awesome icon style on + if (newNotifySettings.fontAwesomeIconStyle === 'shadow') { + theType.fontAwesomeIconColor = theType.background; + } + // font awesome icon style off + + // if cssAnimaion false -> duration on + if (!newNotifySettings.cssAnimation) { + newNotifySettings.cssAnimationDuration = 0; + } + // if cssAnimaion false -> duration off + + // notify wrap on + var docBody = document.body; + var ntflxNotifyWrap = document.createElement('div'); + ntflxNotifyWrap.id = notifySettings.wrapID; + ntflxNotifyWrap.style.width = newNotifySettings.width; + ntflxNotifyWrap.style.zIndex = newNotifySettings.zindex; + ntflxNotifyWrap.style.opacity = newNotifySettings.opacity; + + // wrap position on + if (newNotifySettings.position === 'right-bottom') { + ntflxNotifyWrap.style.right = newNotifySettings.distance; + ntflxNotifyWrap.style.bottom = newNotifySettings.distance; + ntflxNotifyWrap.style.top = 'auto'; + ntflxNotifyWrap.style.left = 'auto'; + } else if (newNotifySettings.position === 'left-top') { + ntflxNotifyWrap.style.left = newNotifySettings.distance; + ntflxNotifyWrap.style.top = newNotifySettings.distance; + ntflxNotifyWrap.style.right = 'auto'; + ntflxNotifyWrap.style.bottom = 'auto'; + } else if (newNotifySettings.position === 'left-bottom') { + ntflxNotifyWrap.style.left = newNotifySettings.distance; + ntflxNotifyWrap.style.bottom = newNotifySettings.distance; + ntflxNotifyWrap.style.top = 'auto'; + ntflxNotifyWrap.style.right = 'auto'; + } else { // 'right-top' or else + ntflxNotifyWrap.style.right = newNotifySettings.distance; + ntflxNotifyWrap.style.top = newNotifySettings.distance; + ntflxNotifyWrap.style.left = 'auto'; + ntflxNotifyWrap.style.bottom = 'auto'; + } + // wrap position off + + // if background overlay true on + var notifyOverlay; + if (newNotifySettings.backOverlay) { + notifyOverlay = document.createElement('div'); + notifyOverlay.id = newNotifySettings.ID + 'Overlay'; + notifyOverlay.style.width = '100%'; + notifyOverlay.style.height = '100%'; + notifyOverlay.style.position = 'fixed'; + notifyOverlay.style.zIndex = newNotifySettings.zindex; + notifyOverlay.style.left = 0; + notifyOverlay.style.top = 0; + notifyOverlay.style.right = 0; + notifyOverlay.style.bottom = 0; + notifyOverlay.style.background = newNotifySettings.backOverlayColor; + notifyOverlay.className = (newNotifySettings.cssAnimation ? 'with-animation' : ''); + notifyOverlay.style.animationDuration = (newNotifySettings.cssAnimation) ? newNotifySettings.cssAnimationDuration + 'ms' : ''; + if (!document.getElementById(notifyOverlay.id)) { + docBody.appendChild(notifyOverlay); + } + } + // if background overlay true off + + if (!document.getElementById(ntflxNotifyWrap.id)) { + docBody.appendChild(ntflxNotifyWrap); + } + // notify wrap off + + // notify content on + var ntflxNotify = document.createElement('div'); + ntflxNotify.id = newNotifySettings.ID + '-' + notiflixNotifyCount; + ntflxNotify.className = newNotifySettings.className + ' ' + theType.childClassName + ' ' + (newNotifySettings.cssAnimation ? 'with-animation' : '') + ' ' + (newNotifySettings.useIcon ? 'with-icon' : '') + ' nx-' + newNotifySettings.cssAnimationStyle + ' ' + (newNotifySettings.closeButton && !callback ? 'with-close-button' : '') + ' ' + (callback && typeof callback === 'function' ? 'with-callback' : '') + ' ' + (newNotifySettings.clickToClose ? 'click-to-close' : ''); + ntflxNotify.style.fontSize = newNotifySettings.fontSize; + ntflxNotify.style.color = theType.textColor; + ntflxNotify.style.background = theType.background; + ntflxNotify.style.borderRadius = newNotifySettings.borderRadius; + + // rtl on + if (newNotifySettings.rtl) { + ntflxNotify.setAttribute('dir', 'rtl'); + ntflxNotify.classList.add('rtl-on'); + } + // rtl off + + // font-family on + ntflxNotify.style.fontFamily = '"' + newNotifySettings.fontFamily + '"' + ', sans-serif'; + // font-family off + + // use css animation on + if (newNotifySettings.cssAnimation) { + ntflxNotify.style.animationDuration = newNotifySettings.cssAnimationDuration + 'ms'; + } + // use css animation off + + // close button element on + var closeButtonHTML = ''; + if (newNotifySettings.closeButton && !callback) { + closeButtonHTML = ''; + } + // close buttpon element off + + // use icon on + if (newNotifySettings.useIcon) { + // use font awesome + if (newNotifySettings.useFontAwesome) { + ntflxNotify.innerHTML = '' + message + '' + (newNotifySettings.closeButton ? closeButtonHTML : ''); + } + // use notiflix icon + else { + var svgIcon; + if (staticType === 'Success') { // success + svgIcon = ''; + } else if (staticType === 'Failure') { // failure + svgIcon = ''; + } else if (staticType === 'Warning') { // warning + svgIcon = ''; + } else if (staticType === 'Info') { // info + svgIcon = ''; + } else { + svgIcon = ''; + } + ntflxNotify.innerHTML = svgIcon + '' + message + '' + (newNotifySettings.closeButton ? closeButtonHTML : ''); + } + } + // without icon + else { + ntflxNotify.innerHTML = '' + message + '' + (newNotifySettings.closeButton ? closeButtonHTML : ''); + } + // use icon off + // notify content off + + // notify append or prepend on + if (newNotifySettings.position === 'left-bottom' || newNotifySettings.position === 'right-bottom') { // the new one will be first + var notifyWrap = document.getElementById(ntflxNotifyWrap.id); + notifyWrap.insertBefore(ntflxNotify, notifyWrap.firstChild); + } else { + document.getElementById(ntflxNotifyWrap.id).appendChild(ntflxNotify); + } + + if (newNotifySettings.useIcon) { // if useIcon, dynamically vertical align the contents + var messageIcon = document.getElementById(ntflxNotify.id).querySelectorAll('.nmi')[0]; + var messageIconH = 40; + // if font awesome + if (newNotifySettings.useFontAwesome) { + messageIconH = Math.round(parseInt(messageIcon.offsetHeight)); + } + // if notiflix SVG + else { + var SvgBBox = messageIcon.getBBox(); + messageIconH = Math.round(parseInt(SvgBBox.width)); + } + var messageText = document.getElementById(ntflxNotify.id).querySelectorAll('span')[0]; + var messageTextH = Math.round(messageText.offsetHeight); + if (messageTextH <= messageIconH) { + messageText.style.paddingTop = (messageIconH - messageTextH) / 2 + 'px'; + messageText.style.paddingBottom = (messageIconH - messageTextH) / 2 + 'px'; + } + } + // notify append or prepend off + + // remove by timeout or click on + if (document.getElementById(ntflxNotify.id)) { + // set elements on + var removeDiv = document.getElementById(ntflxNotify.id); + var removeWrap = document.getElementById(ntflxNotifyWrap.id); + var removeOverlay; + if (newNotifySettings.backOverlay) { + removeOverlay = document.getElementById(notifyOverlay.id); + } + // set elements on + + // timeout vars on + var timeoutHide; + var timeoutRemove; + // timeout vars off + + // hide notify elm and hide overlay on + var hideNotifyElementsAndOverlay = function () { + removeDiv.classList.add('remove'); + if (newNotifySettings.backOverlay && removeWrap.childElementCount <= 0) { + removeOverlay.classList.add('remove'); + } + clearTimeout(timeoutHide); + }; + // hide notify elm and hide overlay off + + // remove notify elm and wrapper on + var removeNotifyElmentsAndWrapper = function () { + var notifyExist = document.getElementById(ntflxNotify.id); + if (notifyExist && removeDiv.parentNode !== null) { + removeDiv.parentNode.removeChild(removeDiv); + } + if (removeWrap.childElementCount <= 0 && removeWrap.parentNode !== null) { // if childs count === 0 remove wrap + removeWrap.parentNode.removeChild(removeWrap); + if (newNotifySettings.backOverlay && removeOverlay.parentNode !== null) { + removeOverlay.parentNode.removeChild(removeOverlay); + } + } + clearTimeout(timeoutRemove); + }; + // remove notify elm and wrapper off + + // if close button and callback undefined on + if (newNotifySettings.closeButton && !callback) { + var closeButtonElm = document.getElementById(ntflxNotify.id).querySelectorAll('span.notify-close-button')[0]; + closeButtonElm.addEventListener('click', function () { + hideNotifyElementsAndOverlay(); + var clickToCloseTimeout = setTimeout(function () { + removeNotifyElmentsAndWrapper(); + clearTimeout(clickToCloseTimeout); + }, newNotifySettings.cssAnimationDuration); + }); + } + // if close button and callback undefined off + + // if callback or click to close on + if ((callback && typeof callback === 'function') || newNotifySettings.clickToClose) { + removeDiv.addEventListener('click', function (e) { + if (callback && typeof callback === 'function') { + callback(); + } + hideNotifyElementsAndOverlay(); + var callbackTimeout = setTimeout(function () { + removeNotifyElmentsAndWrapper(); + clearTimeout(callbackTimeout); + }, newNotifySettings.cssAnimationDuration); + }); + } + // if callback or click to close off + + // else auto remove on + if (!newNotifySettings.closeButton && !callback) { + timeoutHide = setTimeout(function () { + hideNotifyElementsAndOverlay(); + }, newNotifySettings.timeout); + timeoutRemove = setTimeout(function () { + removeNotifyElmentsAndWrapper(); + }, newNotifySettings.timeout + newNotifySettings.cssAnimationDuration); + } + // else auto remove off + } + // remove by timeout or click off + + // notify - show only the last one on + if (newNotifySettings.showOnlyTheLastOne && notiflixNotifyCount > 0) { + var allNotifyElmNotTheLastOne = document.querySelectorAll('[id^=' + newNotifySettings.ID + '-]:not([id=' + newNotifySettings.ID + '-' + notiflixNotifyCount + '])'); + for (var i = 0; i < allNotifyElmNotTheLastOne.length; i++) { + var eachNotifyElmNotLastOne = allNotifyElmNotTheLastOne[i]; + if (eachNotifyElmNotLastOne.parentNode !== null) { + eachNotifyElmNotLastOne.parentNode.removeChild(eachNotifyElmNotLastOne); + } + } + } + // notify - show only the last one off + + } else { + notiflixConsoleError('Notiflix Error', 'Where is the arguments?'); + } + }; + // Notiflix: Notify Single off + + + // Notiflix: Report Single on + var NotiflixReport = function (title, message, buttonText, buttonCallback, theType, staticType) { + + // check the arguments on + if (!title) { title = 'Notiflix ' + staticType; } + if (!message) { + if (staticType === 'Success') { + message = '"Do not try to become a person of success but try to become a person of value."

                                    - Albert Einstein'; + } + else if (staticType === 'Failure') { + message = '"Failure is simply the opportunity to begin again, this time more intelligently."

                                    - Henry Ford'; + } + else if (staticType === 'Warning') { + message = '"The peoples who want to live comfortably without producing and fatigue; they are doomed to lose their dignity, then liberty, and then independence and destiny."

                                    - Mustafa Kemal Ataturk'; + } + else if (staticType === 'Info') { + message = '"Knowledge rests not upon truth alone, but upon error also."

                                    - Carl Gustav Jung'; + } + } + if (!buttonText) { buttonText = 'Okay'; } + if (!buttonCallback) { buttonCallback = undefined; } + // check the arguments off + + // if plainText true = HTML tags not allowed on + if (newReportSettings.plainText) { + title = notiflixPlaintext(title); + message = notiflixPlaintext(message); + buttonText = notiflixPlaintext(buttonText); + } + // if plainText true = HTML tags not allowed off + + // if plainText false but the contents length more than *MaxLength = HTML tags error on + if (!newReportSettings.plainText) { + if (title.length > newReportSettings.titleMaxLength) { + title = 'HTML Tags Error'; // title html error + message = 'Your Title content length is more than "titleMaxLength" option.'; // message html error + buttonText = 'Okay'; // button html error + } + if (message.length > newReportSettings.messageMaxLength) { + title = 'HTML Tags Error'; // title html error + message = 'Your Message content length is more than "messageMaxLength" option.'; // message html error + buttonText = 'Okay'; // button html error + } + if (buttonText.length > newReportSettings.buttonMaxLength) { + title = 'HTML Tags Error'; // title html error + message = 'Your Button content length is more than "buttonMaxLength" option.'; // message html error + buttonText = 'Okay'; // button html error + } + } + // if plainText false but the contents length more than *MaxLength = HTML tags error off + + // max length on + if (title.length > newReportSettings.titleMaxLength) { + title = title.substring(0, newReportSettings.titleMaxLength) + '...'; + } + if (message.length > newReportSettings.messageMaxLength) { + message = message.substring(0, newReportSettings.messageMaxLength) + '...'; + } + if (buttonText.length > newReportSettings.buttonMaxLength) { + buttonText = buttonText.substring(0, newReportSettings.buttonMaxLength) + '...'; + } + // max length off + + // if cssAnimaion false -> duration on + if (!newReportSettings.cssAnimation) { + newReportSettings.cssAnimationDuration = 0; + } + // if cssAnimaion false -> duration off + + // report wrap on + var docBody = document.body; + var ntflxReportWrap = document.createElement('div'); + ntflxReportWrap.id = reportSettings.ID; + ntflxReportWrap.className = newReportSettings.className; + ntflxReportWrap.style.width = newReportSettings.width; + ntflxReportWrap.style.zIndex = newReportSettings.zindex; + ntflxReportWrap.style.borderRadius = newReportSettings.borderRadius; + ntflxReportWrap.style.fontFamily = '"' + newReportSettings.fontFamily + '"' + ', sans-serif'; + + // rtl on + if (newReportSettings.rtl) { + ntflxReportWrap.setAttribute('dir', 'rtl'); + ntflxReportWrap.classList.add('rtl-on'); + } + // rtl off + + // overlay on + var reportOverlay = ''; + if (newReportSettings.backOverlay) { + reportOverlay = '
                                    '; + } + // overlay off + + // svg icon on + var svgIcon = ''; + if (staticType === 'Success') { + svgIcon = notiflixReportSvgSuccess(newReportSettings.svgSize, theType.svgColor); + } else if (staticType === 'Failure') { + svgIcon = notiflixReportSvgFailure(newReportSettings.svgSize, theType.svgColor); + } else if (staticType === 'Warning') { + svgIcon = notiflixReportSvgWarning(newReportSettings.svgSize, theType.svgColor); + } else if (staticType === 'Info') { + svgIcon = notiflixReportSvgInfo(newReportSettings.svgSize, theType.svgColor); + } + // svg icon off + + ntflxReportWrap.innerHTML = reportOverlay + '
                                    ' + + '
                                    ' + svgIcon + '
                                    ' + + '
                                    ' + title + '
                                    ' + + '

                                    ' + message + '

                                    ' + + '' + buttonText + '' + + '
                                    '; + + // if there is no report element + if (!document.getElementById(ntflxReportWrap.id)) { + // append + docBody.appendChild(ntflxReportWrap); + + // vertical align on + var windowH = Math.round(window.innerHeight); + var reportH = Math.round(document.getElementById(ntflxReportWrap.id).offsetHeight); + ntflxReportWrap.style.top = (windowH - reportH) / 2 + 'px'; + // vertical align off + + // callback on + var getReportWrap = document.getElementById(ntflxReportWrap.id); + var reportButton = document.getElementById('NXReportButton'); + reportButton.addEventListener('click', function () { + // if callback on + if (buttonCallback && typeof buttonCallback === 'function') { + buttonCallback(); + } + // if callback off + + // remove element on + getReportWrap.classList.add('remove'); + var timeout = setTimeout(function () { + if (getReportWrap.parentNode !== null) { + getReportWrap.parentNode.removeChild(getReportWrap); + } + clearTimeout(timeout); + }, newReportSettings.cssAnimationDuration); + // remove element off + }); + // callback off + + } + // report wrap off + + }; + // Notiflix: Report Single off + + + // Notiflix: Confirm Single on + var NotiflixConfirm = function (title, message, okButtonText, cancelButtonText, okButtonCallback, cancelButtonCallback) { + // if not initialized pretend like init + if (!newConfirmSettings) { + Notiflix.Confirm.Init({}); + } + + // if plainText true => HTML tags not allowed on + if (newConfirmSettings.plainText) { + title = notiflixPlaintext(title); + message = notiflixPlaintext(message); + okButtonText = notiflixPlaintext(okButtonText); + cancelButtonText = notiflixPlaintext(cancelButtonText); + } + // if plainText true => HTML tags not allowed off + + // if plainText false but the contents length more than *MaxLength = HTML tags error on + if (!newConfirmSettings.plainText) { + if (title.length > newConfirmSettings.titleMaxLength) { + title = 'HTML Tags Error'; // title html error + message = 'Your Title content length is more than "titleMaxLength" option.'; // message html error + okButtonText = 'Okay'; // button html error + cancelButtonText = '...'; // button html error + } + if (message.length > newConfirmSettings.messageMaxLength) { + title = 'HTML Tags Error'; // title html error + message = 'Your Message content length is more than "messageMaxLength" option.'; // message html error + okButtonText = 'Okay'; // button html error + cancelButtonText = '...'; // button html error + } + if ((okButtonText.length || cancelButtonText.length) > newConfirmSettings.buttonsMaxLength) { + title = 'HTML Tags Error'; // title html error + message = 'Your Buttons contents length is more than "buttonsMaxLength" option.'; // message html error + okButtonText = 'Okay'; // button html error + cancelButtonText = '...'; // button html error + } + } + // if plainText false but the contents length more than *MaxLength = HTML tags error off + + // max length on + if (title.length > newConfirmSettings.titleMaxLength) { + title = title.substring(0, newConfirmSettings.titleMaxLength) + '...'; + } + if (message.length > newConfirmSettings.messageMaxLength) { + message = message.substring(0, newConfirmSettings.messageMaxLength) + '...'; + } + if (okButtonText.length > newConfirmSettings.buttonsMaxLength) { + okButtonText = okButtonText.substring(0, newConfirmSettings.buttonsMaxLength) + '...'; + } + if (cancelButtonText.length > newConfirmSettings.buttonsMaxLength) { + cancelButtonText = cancelButtonText.substring(0, newConfirmSettings.buttonsMaxLength) + '...'; + } + // max length off + + // if cssAnimaion false -> duration on + if (!newConfirmSettings.cssAnimation) { + newConfirmSettings.cssAnimationDuration = 0; + } + // if cssAnimaion false -> duration off + + // confirm wrap on + var docBody = document.body; + var ntflxConfirmWrap = document.createElement('div'); + ntflxConfirmWrap.id = confirmSettings.ID; + ntflxConfirmWrap.className = newConfirmSettings.className + (newConfirmSettings.cssAnimation ? ' with-animation nx-' + newConfirmSettings.cssAnimationStyle : ''); + ntflxConfirmWrap.style.width = newConfirmSettings.width; + ntflxConfirmWrap.style.zIndex = newConfirmSettings.zindex; + + // rtl on + if (newConfirmSettings.rtl) { + ntflxConfirmWrap.setAttribute('dir', 'rtl'); + ntflxConfirmWrap.classList.add('rtl-on'); + } + // rtl off + + // font-family on + ntflxConfirmWrap.style.fontFamily = '"' + newConfirmSettings.fontFamily + '"' + ', sans-serif'; + // font-family off + + // if background overlay true on + var confirmOverlay = ''; + if (newConfirmSettings.backOverlay) { + confirmOverlay = '
                                    '; + } + // if background overlay true off + + // if have a callback => add cancel button on + var cancelButtonHTML = ''; + if (okButtonCallback) { + cancelButtonHTML = '' + cancelButtonText + ''; + } + // if have a callback => add cancel button off + + ntflxConfirmWrap.innerHTML = confirmOverlay + + '
                                    ' + + '
                                    ' + + '
                                    ' + title + '
                                    ' + + '

                                    ' + message + '

                                    ' + + '
                                    ' + + '
                                    ' + + '' + okButtonText + '' + + cancelButtonHTML + + '
                                    ' + + '
                                    '; + // confirm wrap off + + // if there is no confirm box on + if (!document.getElementById(ntflxConfirmWrap.id)) { + docBody.appendChild(ntflxConfirmWrap); + + // position on + if (newConfirmSettings.position === 'center') { // if center-center + var windowH = Math.round(window.innerHeight); + var confirmH = Math.round(document.getElementById(ntflxConfirmWrap.id).offsetHeight); + ntflxConfirmWrap.style.top = (windowH - confirmH) / 2 + 'px'; + ntflxConfirmWrap.style.left = newConfirmSettings.distance; + ntflxConfirmWrap.style.right = newConfirmSettings.distance; + ntflxConfirmWrap.style.bottom = 'auto'; + ntflxConfirmWrap.style.margin = 'auto'; + } else if (newConfirmSettings.position === 'right-top') { // if right-top + ntflxConfirmWrap.style.right = newConfirmSettings.distance; + ntflxConfirmWrap.style.top = newConfirmSettings.distance; + ntflxConfirmWrap.style.bottom = 'auto'; + ntflxConfirmWrap.style.left = 'auto'; + ntflxConfirmWrap.style.margin = 'auto'; + } else if (newConfirmSettings.position === 'right-bottom') { // if right-bottom + ntflxConfirmWrap.style.right = newConfirmSettings.distance; + ntflxConfirmWrap.style.bottom = newConfirmSettings.distance; + ntflxConfirmWrap.style.top = 'auto'; + ntflxConfirmWrap.style.left = 'auto'; + ntflxConfirmWrap.style.margin = 'auto'; + } else if (newConfirmSettings.position === 'left-top') { // if left-top + ntflxConfirmWrap.style.left = newConfirmSettings.distance; + ntflxConfirmWrap.style.top = newConfirmSettings.distance; + ntflxConfirmWrap.style.right = 'auto'; + ntflxConfirmWrap.style.bottom = 'auto'; + ntflxConfirmWrap.style.margin = 'auto'; + } else if (newConfirmSettings.position === 'left-bottom') { // if left-bottom + ntflxConfirmWrap.style.left = newConfirmSettings.distance; + ntflxConfirmWrap.style.bottom = newConfirmSettings.distance; + ntflxConfirmWrap.style.top = 'auto'; + ntflxConfirmWrap.style.right = 'auto'; + ntflxConfirmWrap.style.margin = 'auto'; + } else { // if center-top + ntflxConfirmWrap.style.top = newConfirmSettings.distance; + ntflxConfirmWrap.style.left = 0; + ntflxConfirmWrap.style.right = 0; + ntflxConfirmWrap.style.bottom = 'auto'; + ntflxConfirmWrap.style.margin = 'auto'; + } + // position off + + // buttons listener on + var confirmCloseWrap = document.getElementById(ntflxConfirmWrap.id); + var okButton = document.getElementById('NXConfirmButtonOk'); + + // ok button listener on + okButton.addEventListener('click', function () { + // if ok callback && if ok callback is a function + if (okButtonCallback && typeof okButtonCallback === 'function') { + okButtonCallback(); + } + confirmCloseWrap.classList.add('remove'); + + var timeout = setTimeout(function () { + if (confirmCloseWrap.parentNode !== null) { + confirmCloseWrap.parentNode.removeChild(confirmCloseWrap); + clearTimeout(timeout); + } + }, newConfirmSettings.cssAnimationDuration); + }); + // ok button listener off + + // if ok callback && if ok callback a function => add Cancel Button listener on + if (okButtonCallback && typeof okButtonCallback === 'function') { + // cancel button listener on + var cancelButton = document.getElementById('NXConfirmButtonCancel'); + cancelButton.addEventListener('click', function () { + // if cancel callback && if cancel callback a function + if (cancelButtonCallback && typeof cancelButtonCallback === 'function') { + cancelButtonCallback(); + } + confirmCloseWrap.classList.add('remove'); + + var timeout = setTimeout(function () { + if (confirmCloseWrap.parentNode !== null) { + confirmCloseWrap.parentNode.removeChild(confirmCloseWrap); + clearTimeout(timeout); + } + }, newConfirmSettings.cssAnimationDuration); + }); + // cancel button listener off + } + // if ok callback && if ok callback a function => add Cancel Button listener off + // buttons listener off + } + // if there is no confirm box off + }; + // Notiflix: Confirm Single off + + + // Notiflix: Loading Single on + var NotiflixLoading = function (message, iconType, display, theDelay) { + // if not initialized pretend like init + if (!newLoadingSettings) { + Notiflix.Loading.Init({}); + } + // check the message + if (!message) { + message = ''; + } + // show loading + if (display) { + + // if message settings on + if (message.toString().length > newLoadingSettings.messageMaxLength) { + message = notiflixPlaintext(message).toString().substring(0, newLoadingSettings.messageMaxLength) + '...'; + } else { + message = notiflixPlaintext(message).toString(); + } + var intSvgSize = parseInt(newLoadingSettings.svgSize); + var messageHTML = ''; + if (message.length > 0) { + var messagePosTop = Math.round(intSvgSize - (intSvgSize / 4)).toString() + 'px'; + var messageHeight = (parseInt(newLoadingSettings.messageFontSize) * 1.4).toString() + 'px'; + messageHTML = '

                                    ' + message + '

                                    '; + } + // if message settings off + + // if cssAnimaion false -> duration on + if (!newLoadingSettings.cssAnimation) { + newLoadingSettings.cssAnimationDuration = 0; + } + // if cssAnimaion false -> duration off + + // svgIcon on + var svgIcon = ''; + if (iconType === 'standard') { + svgIcon = notiflixIndicatorSvgStandard(newLoadingSettings.svgSize, newLoadingSettings.svgColor); + } else if (iconType === 'hourglass') { + svgIcon = notiflixIndicatorSvgHourglass(newLoadingSettings.svgSize, newLoadingSettings.svgColor); + } else if (iconType === 'circle') { + svgIcon = notiflixIndicatorSvgCircle(newLoadingSettings.svgSize, newLoadingSettings.svgColor); + } else if (iconType === 'arrows') { + svgIcon = notiflixIndicatorSvgArrows(newLoadingSettings.svgSize, newLoadingSettings.svgColor); + } else if (iconType === 'dots') { + svgIcon = notiflixIndicatorSvgDots(newLoadingSettings.svgSize, newLoadingSettings.svgColor); + } else if (iconType === 'pulse') { + svgIcon = notiflixIndicatorSvgPulse(newLoadingSettings.svgSize, newLoadingSettings.svgColor); + } else if (iconType === 'custom' && newLoadingSettings.customSvgUrl !== null) { + svgIcon = 'Notiflix'; + } else if (iconType === 'custom' && newLoadingSettings.customSvgUrl == null) { + notiflixConsoleError('Notiflix Error', 'You have to set a static SVG url to "customSvgUrl" option to use Loading Custom.'); + return false; + } else if (iconType === 'notiflix') { + svgIcon = notiflixIndicatorSvgNotiflix(newLoadingSettings.svgSize, '#f8f8f8', '#32c682'); + } + var svgPosTop = 0; + if (message.length > 0) { + svgPosTop = '-' + Math.round(intSvgSize - (intSvgSize / 4)).toString() + 'px'; + } + var svgIconHTML = '
                                    ' + svgIcon + '
                                    '; + // svgIcon off + + // loading wrap on + var docBody = document.body; + var ntflxLoadingWrap = document.createElement('div'); + ntflxLoadingWrap.id = loadingSettings.ID; + ntflxLoadingWrap.className = newLoadingSettings.className + (newLoadingSettings.cssAnimation ? ' with-animation' : '') + (newLoadingSettings.clickToClose ? ' click-to-close' : ''); + ntflxLoadingWrap.style.zIndex = newLoadingSettings.zindex; + ntflxLoadingWrap.style.background = newLoadingSettings.backgroundColor; + ntflxLoadingWrap.style.animationDuration = newLoadingSettings.cssAnimationDuration + 'ms'; + ntflxLoadingWrap.style.fontFamily = '"' + newLoadingSettings.fontFamily + '"' + ', sans-serif'; + + // rtl on + if (newLoadingSettings.rtl) { + ntflxLoadingWrap.setAttribute('dir', 'rtl'); + ntflxLoadingWrap.classList.add('rtl-on'); + } + // rtl off + + // append on + ntflxLoadingWrap.innerHTML = svgIconHTML + messageHTML; + + // if there is no loading element + if (!document.getElementById(ntflxLoadingWrap.id)) { + // append + docBody.appendChild(ntflxLoadingWrap); + + // if click to close + if (newLoadingSettings.clickToClose) { + var loadingWrapElm = document.getElementById(ntflxLoadingWrap.id); + loadingWrapElm.addEventListener('click', function () { + ntflxLoadingWrap.classList.add('remove'); + var timeout = setTimeout(function () { + if (ntflxLoadingWrap.parentNode !== null) { + ntflxLoadingWrap.parentNode.removeChild(ntflxLoadingWrap); + clearTimeout(timeout); + } + }, newLoadingSettings.cssAnimationDuration); + }); + } + } + // append off + + } + // remove loading + else { + // if there is a loading element + if (document.getElementById(loadingSettings.ID)) { + var loadingElm = document.getElementById(loadingSettings.ID); + var timeout = setTimeout(function () { + loadingElm.classList.add('remove'); + var timeout2 = setTimeout(function () { + if (loadingElm.parentNode !== null) { + loadingElm.parentNode.removeChild(loadingElm); + clearTimeout(timeout2); + } + }, newLoadingSettings.cssAnimationDuration); + clearTimeout(timeout); + }, theDelay); + } + } + }; + // Notiflix: Loading Single off + + // Notiflix: Loading Change Message on + var NotiflixLoadingChange = function (newMessage) { + // check the new message + if (!newMessage) { + newMessage = ''; + } + // if has any loading + if (document.getElementById(loadingSettings.ID)) { + // if there is a new message + if (newMessage.length > 0) { + // max length on + if (newMessage.length > newLoadingSettings.messageMaxLength) { + newMessage = notiflixPlaintext(newMessage).toString().substring(0, newLoadingSettings.messageMaxLength) + '...'; + } else { + newMessage = notiflixPlaintext(newMessage).toString(); + } + // max length off + + // there is a message element + var oldMessageElm = document.getElementById(loadingSettings.ID).getElementsByTagName('p')[0]; + if (oldMessageElm) { + oldMessageElm.innerHTML = newMessage; // change the message + } + // there is no message element + else { + // create a new message element on + var newMessageHTML = document.createElement('p'); + newMessageHTML.id = newLoadingSettings.messageID; + newMessageHTML.className = 'loading-message new'; + newMessageHTML.style.color = newLoadingSettings.messageColor; + newMessageHTML.style.fontSize = newLoadingSettings.messageFontSize; + var intSvgSize = parseInt(newLoadingSettings.svgSize); + var messagePosTop = Math.round(intSvgSize - (intSvgSize / 4)).toString() + 'px'; + newMessageHTML.style.top = messagePosTop; + var messageHeight = (parseInt(newLoadingSettings.messageFontSize) * 1.4).toString() + 'px'; + newMessageHTML.style.height = messageHeight; + newMessageHTML.innerHTML = newMessage; + var messageWrap = document.getElementById(loadingSettings.ID); + messageWrap.appendChild(newMessageHTML); + // create a new message element off + + // vertical align svg on + var svgDivElm = document.getElementById(loadingSettings.ID).getElementsByTagName('div')[0]; + var svgNewPosTop = '-' + Math.round(intSvgSize - (intSvgSize / 4)).toString() + 'px'; + svgDivElm.style.top = svgNewPosTop; + // vertical align svg off + } + } + // if no message + else { + notiflixConsoleError('Notiflix Error', 'Where is the new message?'); + } + } + }; + // Notiflix: Loading Change Message off + + + // Notiflix: Block or Unblock Element on + var notiflixBlockElementCounter = 0; + var NotiflixBlockUnblockElement = function (block, selector, iconType, message, theDelay) { + + // check typeof selector on + if (typeof selector !== 'string') { + notiflixConsoleError('Notiflix Error', 'The selector must be a String.'); + return false; + } + // check typeof selector off + + // check the delay on + if (typeof theDelay !== 'number') { + theDelay = 0; + } + // check the delay off + + // check the selector on + var getSelector = document.querySelectorAll(selector); + if (getSelector.length > 0) { + + // if not initialized pretend like init on + if (!newBlockSettings) { + Notiflix.Block.Init({}); + } + // if not initialized pretend like init off + + // check the message on + if (!message || (message && typeof message !== 'string')) { + message = undefined; + } + // check the message off + + } else { + notiflixConsoleError('Notiflix Error', 'You called the "Notiflix.Block..." function with "' + selector + '" selector, but there is no such element(s) on the document.'); + return false; + } + // check the selector off + + // if cssAnimaion false => duration on + if (!newBlockSettings.cssAnimation) { + newBlockSettings.cssAnimationDuration = 0; + } + // if cssAnimaion false => duration off + + // check the class name on + var blockClassName = 'notiflix-block'; + if (newBlockSettings.className && typeof newBlockSettings.className === 'string') { + blockClassName = newBlockSettings.className.trim(); + } + // check the class name off + + // check query limit on + var getQueryLimit = (typeof newBlockSettings.querySelectorLimit === 'number' ? newBlockSettings.querySelectorLimit : 200); + var checkQueryLimit = (getSelector.length >= getQueryLimit ? getQueryLimit : getSelector.length); + // check query limit off + + // block + if (block) { + + // add element(s) and style on + for (var i = 0; i < checkQueryLimit; i++) { + var eachSelector = getSelector[i]; + + // check block element exist on + var eachBlockElement = eachSelector.querySelectorAll('[id^=' + blockSettings.ID + ']'); + if (eachBlockElement.length < 1) { + + // check the icon on + var icon = ''; + if (iconType) { + if (iconType === 'hourglass') { + icon = notiflixIndicatorSvgHourglass(newBlockSettings.svgSize, newBlockSettings.svgColor); + } else if (iconType === 'circle') { + icon = notiflixIndicatorSvgCircle(newBlockSettings.svgSize, newBlockSettings.svgColor); + } else if (iconType === 'arrows') { + icon = notiflixIndicatorSvgArrows(newBlockSettings.svgSize, newBlockSettings.svgColor); + } else if (iconType === 'dots') { + icon = notiflixIndicatorSvgDots(newBlockSettings.svgSize, newBlockSettings.svgColor); + } else if (iconType === 'pulse') { + icon = notiflixIndicatorSvgPulse(newBlockSettings.svgSize, newBlockSettings.svgColor); + } else { + icon = notiflixIndicatorSvgStandard(newBlockSettings.svgSize, newBlockSettings.svgColor); + } + } + var intSvgSize = parseInt(newBlockSettings.svgSize); + var posRatio = Math.round(intSvgSize - (intSvgSize / 5)).toString() + 'px'; + var svgPosTop = (message && message.length > 0 ? '-' + posRatio : 0); + var iconElement = '' + icon + ''; + // check the icon off + + // check the message on + var messageElement = ''; + var messageHeight = 0; + if (message) { + if (message.length > newBlockSettings.messageMaxLength) { + message = notiflixPlaintext(message).toString().substring(0, newBlockSettings.messageMaxLength) + '...'; + } else { + message = notiflixPlaintext(message).toString(); + } + messageHeight = Math.round(parseInt(newBlockSettings.messageFontSize) * 1.4).toString() + 'px'; + messageElement = '' + message + ''; + } + // check the message off + + // block element on + notiflixBlockElementCounter++; + var notiflixBlockWrap = document.createElement('div'); + notiflixBlockWrap.id = blockSettings.ID + '-' + notiflixBlockElementCounter; + notiflixBlockWrap.className = blockClassName + '-wrap' + (newBlockSettings.cssAnimation ? ' with-animation' : ''); + notiflixBlockWrap.style.position = newBlockSettings.position; + notiflixBlockWrap.style.zIndex = newBlockSettings.zindex; + notiflixBlockWrap.style.background = newBlockSettings.backgroundColor; + notiflixBlockWrap.style.animationDuration = newBlockSettings.cssAnimationDuration + 'ms'; + notiflixBlockWrap.style.fontFamily = '"' + newBlockSettings.fontFamily + '"' + ', sans-serif'; + // block element off + + // block element rtl on + if (newBlockSettings.rtl) { + notiflixBlockWrap.setAttribute('dir', 'rtl'); + notiflixBlockWrap.classList.add('rtl-on'); + } + // block element rtl off + + // block element data on + notiflixBlockWrap.innerHTML = iconElement + messageElement; + // block element data off + + // append block element on + var eachSelectorPos = getComputedStyle(eachSelector).getPropertyValue('position'); + eachSelectorPos = eachSelectorPos && typeof eachSelectorPos === 'string' ? eachSelectorPos.toLowerCase() : 'relative'; + + // selector internal style on + var eachSelectorIdOrClass = ''; + if (eachSelector.getAttribute('id')) { + eachSelectorIdOrClass = '#' + eachSelector.getAttribute('id'); + } else if (eachSelector.classList[0]) { + eachSelectorIdOrClass = '.' + eachSelector.classList[0]; + } + + var positions = ['absolute', 'relative', 'fixed', 'sticky']; + if (positions.indexOf(eachSelectorPos) <= -1) { + var minHeight = Math.round((parseInt(messageHeight) + intSvgSize) * 1.5).toString() + 'px'; + var style = ''; + var styleRange = document.createRange(); + styleRange.selectNode(document.head); + var styleFragment = styleRange.createContextualFragment(style); + document.head.appendChild(styleFragment); + eachSelector.classList.add(blockClassName + '-position'); + } + // selector internal style off + + // append + eachSelector.appendChild(notiflixBlockWrap); + // append block element off + } + // check block element exist off + } + // add element(s) and style off + } + // unblock/remove + else { + + // Step 3 => Remove each block element on + var removeBlockElements = function (eachOne) { + var timeout = setTimeout(function () { + // remove element + eachOne.remove(); + + // remove this selector internal style + var eachOneId = eachOne.getAttribute('id'); + var eachOneStyle = document.getElementById('Style-' + eachOneId); + if (eachOneStyle) { + eachOneStyle.remove(); + } + + // clear timeout + clearTimeout(timeout); + }, newBlockSettings.cssAnimationDuration); + } + // Step 3 => Remove each block element off + + // Step 2A => Remove each block element on + var removeClassBlockElements = function (eachBlockElement) { + // if elements exist + if (eachBlockElement && eachBlockElement.length > 0) { + for (var i = 0; i < eachBlockElement.length; i++) { + var eachOne = eachBlockElement[i]; + if (eachOne) { + // add remove class + eachOne.classList.add('remove'); + // remove block elements + removeBlockElements(eachOne); + } + } + } + // not exist + else { + notiflixConsoleLog('Notiflix Info', '"Notiflix.Block.Remove();" function called with "' + selector + '" selector, but this selector does not have a "Notiflix.Block..." element to remove.'); + } + } + // Step 2A => Remove each block element on + + // Step 2B => Remove each selector class name on + var removeEachSelectorClassName = function (eachSelector) { + var timeout = setTimeout(function () { + // remove class name + var positionClass = blockClassName + '-position'; + eachSelector.classList.remove(positionClass); + + // clear timeout + clearTimeout(timeout); + }, newBlockSettings.cssAnimationDuration + 300); + } + // Step 2B => Remove each selector class name off + + // Step 1 => Remove selector class name on + var selectorTimeout = setTimeout(function () { + for (var i = 0; i < checkQueryLimit; i++) { + var eachSelector = getSelector[i]; + + // remove each selector class name + removeEachSelectorClassName(eachSelector); + + // remove each block element + eachBlockElement = eachSelector.querySelectorAll('[id^=' + blockSettings.ID + ']'); + removeClassBlockElements(eachBlockElement); + } + // clear timeout + clearTimeout(selectorTimeout); + }, theDelay); + // Step 1 => Remove selector class name off + } + }; + // Notiflix: Block or Unblock Element off + + + // Notiflix: Report SVG Success on + var notiflixReportSvgSuccess = function (width, color) { + if (!width) { width = '110px'; } + if (!color) { color = '#32c682'; } + var reportSvgSuccess = ''; + return reportSvgSuccess; + }; + // Notiflix: Report SVG Success off + + // Notiflix: Report SVG Failure on + var notiflixReportSvgFailure = function (width, color) { + if (!width) { width = '110px'; } + if (!color) { color = '#ff5549'; } + var reportSvgFailure = ''; + return reportSvgFailure; + }; + // Notiflix: Report SVG Failure off + + // Notiflix: Report SVG Warning on + var notiflixReportSvgWarning = function (width, color) { + if (!width) { width = '110px'; } + if (!color) { color = '#eebf31'; } + var reportSvgWarning = ''; + return reportSvgWarning; + }; + // Notiflix: Report SVG Warning off + + // Notiflix: Report SVG Info on + var notiflixReportSvgInfo = function (width, color) { + if (!width) { width = '110px'; } + if (!color) { color = '#26c0d3'; } + var reportSvgInfo = ''; + return reportSvgInfo; + }; + // Notiflix: Report SVG Info off + + + // Notiflix: Indicator SVG standard on + var notiflixIndicatorSvgStandard = function (width, color) { + if (!width) { width = '60px'; } + if (!color) { color = '#32c682'; } + var standard = ''; + return standard; + }; + // Notiflix: Indicator SVG standard off + + // Notiflix: Indicator SVG hourglass on + var notiflixIndicatorSvgHourglass = function (width, color) { + if (!width) { width = '60px'; } + if (!color) { color = '#32c682'; } + var hourglass = ' '; + return hourglass; + }; + // Notiflix: Indicator SVG hourglass off + + // Notiflix: Indicator SVG circle on + var notiflixIndicatorSvgCircle = function (width, color) { + if (!width) { width = '60px'; } + if (!color) { color = '#32c682'; } + var circle = ''; + return circle; + }; + // Notiflix: Indicator SVG circle off + + // Notiflix: Indicator SVG arrows on + var notiflixIndicatorSvgArrows = function (width, color) { + if (!width) { width = '60px'; } + if (!color) { color = '#32c682'; } + var arrows = ''; + return arrows; + }; + // Notiflix: Indicator SVG arrows off + + // Notiflix: Indicator SVG dots on + var notiflixIndicatorSvgDots = function (width, color) { + if (!width) { width = '60px'; } + if (!color) { color = '#32c682'; } + var dots = ' '; + return dots; + }; + // Notiflix: Indicator SVG dots off + + // Notiflix: Indicator SVG pulse on + var notiflixIndicatorSvgPulse = function (width, color) { + if (!width) { width = '60px'; } + if (!color) { color = '#32c682'; } + var pulse = ''; + return pulse; + }; + // Notiflix: Indicator SVG pulse off + + // Notiflix: Indicator SVG notiflix on + var notiflixIndicatorSvgNotiflix = function (width, white, green) { + if (!width) { width = '60px'; } + if (!white) { white = '#f8f8f8'; } + if (!green) { green = '#32c682'; } + var notiflixIcon = ''; + return notiflixIcon; + }; + // Notiflix: Indicator SVG notiflix off + + + /* + * 侧边滑出弹层插件 mSlider.js + * DH (https://denghao.me) + * 2018-07 + */ + (function(b, c) { + function a(d) { + this.opts = { + "direction": d.direction || "left", + "distance": d.distance || "60%", + "dom": this.Q(d.dom), + "time": d.time || "", + "maskClose": (d.maskClose + "").toString() !== "false" ? true : false, + "callback": d.callback || "" + }; + this.rnd = this.rnd(); + this.dom = this.opts.dom[0]; + this.wrap = ""; + this.inner = ""; + this.mask = ""; + this.init() + } + a.prototype = { + Q: function(d) { + return document.querySelectorAll(d) + }, + isMobile: function() { + return navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i) ? true : false + }, + addEvent: function(f, e, d) { + if (f.attachEvent) { + f.attachEvent("on" + e, d) + } else { + f.addEventListener(e, d, false) + } + }, + rnd: function() { + return Math.random().toString(36).substr(2, 6) + }, + init: function() { + var g = this; + if (!g.dom) { + console.log("未正确绑定弹窗容器"); + return + } + var d = document.createElement("div"); + var e = document.createElement("div"); + var f = document.createElement("div"); + d.setAttribute("class", "mSlider-main ms-" + g.rnd); + e.setAttribute("class", "mSlider-inner"); + f.setAttribute("class", "mSlider-mask"); + g.Q("body")[0].appendChild(d); + g.Q(".ms-" + g.rnd)[0].appendChild(e); + g.Q(".ms-" + g.rnd)[0].appendChild(f); + g.wrap = g.Q(".ms-" + g.rnd)[0]; + g.inner = g.Q(".ms-" + g.rnd + " .mSlider-inner")[0]; + g.mask = g.Q(".ms-" + g.rnd + " .mSlider-mask")[0]; + g.inner.appendChild(g.dom); + switch (g.opts.direction) { + case "top": + g.top = "0"; + g.left = "0"; + g.width = "100%"; + g.height = g.opts.distance; + g.translate = "0,-100%,0"; + break; + case "bottom": + g.bottom = "0"; + g.left = "0"; + g.width = "100%"; + g.height = g.opts.distance; + g.translate = "0,100%,0"; + break; + case "right": + g.top = "0"; + g.right = "0"; + g.width = g.opts.distance; + g.height = document.documentElement.clientHeight + "px"; + g.translate = "100%,0,0"; + break; + default: + g.top = "0"; + g.left = "0"; + g.width = g.opts.distance; + g.height = document.documentElement.clientHeight + "px"; + g.translate = "-100%,0,0" + } + g.wrap.style.display = "none"; + g.wrap.style.position = "fixed"; + g.wrap.style.top = "0"; + g.wrap.style.left = "0"; + g.wrap.style.width = "100%"; + g.wrap.style.height = "100%"; + g.wrap.style.zIndex = 99; + g.inner.style.position = "absolute"; + g.inner.style.top = g.top; + g.inner.style.bottom = g.bottom; + g.inner.style.left = g.left; + g.inner.style.right = g.right; + g.inner.style.width = g.width; + g.inner.style.height = g.height; + g.inner.style.backgroundColor = "#fff"; + g.inner.style.transform = "translate3d(" + g.translate + ")"; + g.inner.style.webkitTransition = "all .2s ease-out"; + g.inner.style.transition = "all .2s ease-out"; + g.inner.style.zIndex = 100; + g.mask.style.width = "100%"; + g.mask.style.height = "100%"; + g.mask.style.opacity = "0"; + g.mask.style.backgroundColor = "black"; + g.mask.style.zIndex = "98"; + g.mask.style.webkitTransition = "all .2s ease-out"; + g.mask.style.transition = "all .2s ease-out"; + g.mask.style.webkitBackfaceVisibility = "hidden"; + g.events() + }, + open: function() { + var d = this; + d.wrap.style.display = "block"; + + setTimeout(function() { + d.inner.style.transform = "translate3d(0,0,0)"; + d.inner.style.webkitTransform = "translate3d(0,0,0)"; + d.mask.style.opacity = 0.5 + }, 30); + if (d.opts.time) { + d.timer = setTimeout(function() { + d.close() + }, d.opts.time) + } + }, + close: function() { + var d = this; + d.timer && clearTimeout(d.timer); + d.inner.style.webkitTransform = "translate3d(" + d.translate + ")"; + d.inner.style.transform = "translate3d(" + d.translate + ")"; + d.mask.style.opacity = 0; + setTimeout(function() { + d.wrap.style.display = "none"; + d.timer = null; + d.opts.callback && d.opts.callback() + }, 300) + }, + events: function() { + var d = this; + d.addEvent(d.mask, "touchmove", function(f) { + f.preventDefault() + }); + d.addEvent(d.mask, (d.isMobile() ? "touchend" : "click"), function(f) { + if (d.opts.maskClose) { + d.close() + } + }) + } + }; + b.mSlider = a + })(window); + + exports(MOD_NAME,pearOper); +}) + diff --git a/static/component/pear/module/menu.js b/static/component/pear/module/menu.js new file mode 100644 index 000000000..c81d89774 --- /dev/null +++ b/static/component/pear/module/menu.js @@ -0,0 +1,516 @@ +layui.define(['table', 'jquery', 'element'], function (exports) { + "use strict"; + + var MOD_NAME = 'menu', + $ = layui.jquery, + element = layui.element; + + var pearMenu = function (opt) { + this.option = opt; + }; + + pearMenu.prototype.render = function (opt) { + + var option = { + elem: opt.elem, + async: opt.async, + parseData: opt.parseData, + url: opt.url, + method: opt.method ? opt.method : "GET", + defaultOpen: opt.defaultOpen, + defaultSelect: opt.defaultSelect, + control: opt.control, + controlWidth: opt.controlWidth ? opt.controlWidth : 500, + defaultMenu: opt.defaultMenu, + accordion: opt.accordion, + height: opt.height, + theme: opt.theme, + data: opt.data ? opt.data : [], + change: opt.change ? opt.change : function () { }, + done: opt.done ? opt.done : function () { } + } + if (option.async) { + if (option.method === "GET") { + getData(option.url).then(function (data) { + option.data = data; + renderMenu(option); + }); + } else { + postData(option.url).then(function (data) { + option.data = data; + renderMenu(option); + }); + } + } else { + //renderMenu中需要调用done事件,done事件中需要menu对象,但是此时还未返回menu对象,做个延时提前返回对象 + window.setTimeout(function () { renderMenu(option); }, 500); + } + + // 处理高度 + $("#" + opt.elem).height(option.height) + + setTimeout(function () { + $("#" + opt.control + " .control").on("mousewheel DOMMouseScroll", function (event) { + + var delta = (event.originalEvent.wheelDelta && (event.originalEvent.wheelDelta > 0 ? 1 : -1)) || // chrome & ie + (event.originalEvent.detail && (event.originalEvent.detail > 0 ? -1 : 1)); // firefox + + if (delta > 0) { + for (var num = 1; num < 20; num++) { + setTimeout(function () { + if ($("#" + opt.control + " .control ul").css('left').replace("px", "") < 0) { + $("#" + opt.control + " .control ul").css("left", "+=2px"); + } + }, 10) + } + } else if (delta < 0) { + if (((Number)($("#" + opt.control + " .control ul").css("left").replace("px", "")) + ($("#" + opt.control + " .control ul").width() - $("#" + opt.control + " .control").width())) > 0) { + for (var num = 1; num < 20; num++) { + setTimeout(function () { + $("#" + opt.control + " .control ul").css("left", "-=2px"); + }, 10) + } + } + } + }); + }, 1000) + + return new pearMenu(opt); + } + + pearMenu.prototype.click = function (clickEvent) { + var _this = this; + $("body").on("click", "#" + _this.option.elem + " .site-demo-active", function () { + var dom = $(this); + var data = { + menuId: dom.attr("menu-id"), + menuTitle: dom.attr("menu-title"), + menuPath: dom.attr("menu-title"), + menuIcon: dom.attr("menu-icon"), + menuUrl: dom.attr("menu-url"), + openType: dom.attr("open-type") + }; + var doms = hash(dom); + if (doms != null) { + if (doms.text() != '') { + data['menuPath'] = doms.find("span").text() + " / " + data['menuPath']; + } + } + if (doms != null) { + var domss = hash(doms); + if (domss != null) { + if (domss.text() != '') { + data['menuPath'] = domss.find("span").text() + " / " + data['menuPath']; + } + } + } + if (domss != null) { + var domsss = hash(domss); + if (domsss != null) { + if (domsss.text() != '') { + data['menuPath'] = domsss.find("span").text() + " / " + data['menuPath']; + } + } + } + if ($("#" + _this.option.elem).is(".pear-nav-mini")) { + if (_this.option.accordion) { + activeMenus = $(this).parent().parent().parent().children("a"); + } else { + activeMenus.push($(this).parent().parent().parent().children("a")); + } + } + clickEvent(dom, data); + }) + } + + function hash(dom) { + var d = dom.parent().parent().prev(); + if (d.prop("tagName") === "UL") { + return null; + } + return d; + } + + pearMenu.prototype.skin = function (skin) { + var menu = $(".pear-nav-tree[lay-filter='" + this.option.elem + "']").parent(); + menu.removeClass("dark-theme"); + menu.removeClass("light-theme"); + menu.addClass(skin); + } + + pearMenu.prototype.selectItem = function (pearId) { + if (this.option.control != false) { + $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents(".layui-side-scroll ").find("ul").css({ + display: "none" + }); + $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents(".layui-side-scroll ").find(".layui-this").removeClass( + "layui-this"); + $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents("ul").css({ + display: "block" + }); + var controlId = $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents("ul").attr("pear-id"); + if (controlId != undefined) { + $("#" + this.option.control).find(".layui-this").removeClass("layui-this"); + $("#" + this.option.control).find("[pear-id='" + controlId + "']").addClass("layui-this"); + } + } + + $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents(".pear-nav-tree").find(".layui-this").removeClass( + "layui-this"); + if (!$("#" + this.option.elem).is(".pear-nav-mini")) { + let openEle = null; + let openEleHeight = 0; + $($("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents('.layui-nav-child').get().reverse()).each(function () { + if (!$(this).parent().is('.layui-nav-itemed')) { + if(openEleHeight == 0){ + openEle = $(this); + } else { + $(this).parent().addClass('layui-nav-itemed'); + $(this).css({ + height:'auto', + }); + } + openEleHeight += $(this).children("dd").length * 48; + } + }); + if (this.option.accordion) { + if(openEleHeight > 0){ + var currentDom = openEle.parent().siblings('.layui-nav-itemed').children(".layui-nav-child"); + currentDom.animate({ + height: "0px" + }, 240, function () { + currentDom.css({ + height: "auto" + }); + $(this).parent().removeClass("layui-nav-itemed"); + $(this).find('.layui-nav-itemed').removeClass("layui-nav-itemed"); + }); + } + } + if(openEleHeight > 0){ + openEle.parent().addClass("layui-nav-itemed"); + openEle.height(0); + openEle.animate({ + height: openEleHeight + "px" + }, 240, function () { + $(this).css({height:'auto'}); + }); + } + } + $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parent().addClass("layui-this"); + } + + var activeMenus; + pearMenu.prototype.collaspe = function (time) { + var elem = this.option.elem; + var config = this.option; + if ($("#" + this.option.elem).is(".pear-nav-mini")) { + $.each(activeMenus, function (i, item) { + $("#" + elem + " a[menu-id='" + $(this).attr("menu-id") + "']").parent().addClass("layui-nav-itemed"); + }) + $("#" + this.option.elem).removeClass("pear-nav-mini"); + $("#" + this.option.elem).animate({ + width: "220px" + }, 150); + isHoverMenu(false, config); + } else { + activeMenus = $("#" + this.option.elem).find(".layui-nav-itemed>a"); + $("#" + this.option.elem).find(".layui-nav-itemed").removeClass("layui-nav-itemed"); + $("#" + this.option.elem).addClass("pear-nav-mini"); + $("#" + this.option.elem).animate({ + width: "60px" + }, 400); + isHoverMenu(true, config); + } + } + + function getData(url) { + var defer = $.Deferred(); + $.get(url + "?fresh=" + Math.random(), function (result) { + defer.resolve(result) + }); + return defer.promise(); + } + + function postData(url) { + var defer = $.Deferred(); + $.post(url + "?fresh=" + Math.random(), function (result) { + defer.resolve(result) + }, "json"); + return defer.promise(); + } + + function renderMenu(option) { + if (option.parseData != false) { + option.parseData(option.data); + } + if (option.data.length > 0) { + if (option.control != false) { + createMenuAndControl(option); + } else { + createMenu(option); + } + } + element.init(); + downShow(option); + option.done(); + } + + function createMenu(option) { + var menuHtml = '
                                      ' + $.each(option.data, function (i, item) { + var content = '
                                    • '; + if (i == option.defaultOpen) { + content = '
                                    • '; + } + var href = "javascript:;"; + var target = ""; + var className = "site-demo-active" + if (item.openType == "_blank" && item.type == 1) { + href = item.href; + target = "target='_blank'"; + className = ""; + } + if (item.type == 0) { + // 创 建 目 录 结 构 + content += '' + item.title + + ''; + } else if (item.type == 1) { + content += '' + item.title + ''; + } + // 调 用 递 归 方 法 加 载 无 限 层 级 的 子 菜 单 + content += loadchild(item); + // 结 束 一 个 根 菜 单 项 + content += '
                                    • '; + menuHtml += content; + }); + // 结 束 菜 单 结 构 的 初 始 化 + menuHtml += "
                                    "; + // 将 菜 单 拼 接 到 初 始 化 容 器 中 + $("#" + option.elem).html(menuHtml); + } + + function createMenuAndControl(option) { + var control = '
                                      '; + var controlPe = '
                                        '; + // 声 明 头 部 + var menu = '
                                        ' + // 开 启 同 步 操 作 + var index = 0; + var controlItemPe = '
                                        '; + $.each(option.data, function (i, item) { + var menuItem = ''; + var controlItem = ''; + if (i === option.defaultMenu) { + controlItem = '
                                      • ' + item.title + '
                                      • '; + menuItem = '
                                          '; + + controlPe += '
                                        • ' + item.title + ''; + + controlItemPe += '
                                          ' + item.title + '
                                          '; + } else { + + controlItem = '
                                        • ' + item.title + '
                                        • '; + + menuItem = ''; + control += controlItem; + }) + controlItemPe += "
                                      " + controlPe += controlItemPe; + $("#" + option.control).html(control + "
                                    "); + $("#" + option.control).append(controlPe); + $("#" + option.elem).html(menu); + $("#" + option.control + " .pear-nav-control").on("click", "[pear-id]", function () { + $("#" + option.elem).find(".pear-nav-tree").css({ + display: 'none' + }); + $("#" + option.elem).find(".pear-nav-tree[pear-id='" + $(this).attr("pear-id") + "']").css({ + display: 'block' + }); + $("#" + option.control).find(".pe-title").html($(this).attr("pear-title")); + $("#" + option.control).find("") + option.change($(this).attr("pear-id"), $(this).attr("pear-title"), $(this).attr("pear-href")) + }) + } + + /** 加载子菜单 (递归)*/ + function loadchild(obj) { + // 判 单 是 否 是 菜 单, 如 果 是 菜 单 直 接 返 回 + if (obj.type == 1) { + return ""; + } + // 创 建 子 菜 单 结 构 + var content = '
                                    '; + // 如 果 嵌 套 不 等 于 空 + if (obj.children != null && obj.children.length > 0) { + // 遍 历 子 项 目 + $.each(obj.children, function (i, note) { + // 创 建 子 项 结 构 + content += '
                                    '; + var href = "javascript:;"; + var target = ""; + var className = "site-demo-active"; + if (note.openType == "_blank" && note.type == 1) { + href = note.href; + target = "target='_blank'"; + className = ""; + } + // 判 断 子 项 类 型 + if (note.type == 0) { + // 创 建 目 录 结 构 + content += '' + note.title + ''; + } else if (note.type == 1) { + // 创 建 菜 单 结 构 + content += '' + note.title + ''; + } + // 加 载 子 项 目 录 + content += loadchild(note); + // 结 束 当 前 子 菜 单 + content += '
                                    '; + }); + // 封 装 + } else { + content += '
                                    目录为空
                                    '; + } + content += '
                                    '; + return content; + } + + function downShow(option) { + $("body #" + option.elem).on("click", "a[menu-type='0']", function () { + if (!$("#" + option.elem).is(".pear-nav-mini")) { + var superEle = $(this).parent(); + var ele = $(this).next('.layui-nav-child'); + var heights = ele.children("dd").length * 48; + + if ($(this).parent().is(".layui-nav-itemed")) { + if (option.accordion) { + var currentDom = $(this).parent().siblings('.layui-nav-itemed').children('.layui-nav-child'); + currentDom.animate({ + height: '0px' + }, 240, function(){ + currentDom.css({ + height: "auto", + }); + $(this).parent().removeClass("layui-nav-itemed"); + $(this).find('.layui-nav-itemed').removeClass("layui-nav-itemed"); + }); + } + ele.height(0); + ele.animate({ + height: heights + "px" + }, 240, function () { + ele.css({ + height: "auto" + }); + }); + } else { + $(this).parent().addClass("layui-nav-itemed"); + ele.animate({ + height: "0px" + }, 240, function () { + ele.css({ + height: "auto" + }); + $(this).parent().removeClass("layui-nav-itemed"); + }); + } + } + }) + } + + /** 二 级 悬 浮 菜 单*/ + function isHoverMenu(b, option) { + if (b) { + $("#" + option.elem + ".pear-nav-mini .layui-nav-item,#" + option.elem + ".pear-nav-mini dd").hover(function (e) { + e.stopPropagation(); + var _this = $(this); + _this.siblings().find(".layui-nav-child") + .removeClass("layui-nav-hover").css({ + left: 0, + top: 0 + }); + _this.children(".layui-nav-child").addClass("layui-nav-hover"); + _this.closest('.layui-nav-item').data('time') && clearTimeout(_this.closest('.layui-nav-item').data('time')); + var height = $(window).height(); + var topLength = _this.offset().top; + var thisHeight = _this.children(".layui-nav-child").height(); + if ((thisHeight + topLength) > height) { + topLength = height - thisHeight - 10; + } + var left = _this.offset().left + 60; + if (!_this.hasClass("layui-nav-item")) { + left = _this.offset().left + _this.width(); + } + _this.children(".layui-nav-child").offset({ + top: topLength, + left: left + 3 + }); + }, function (e) { + e.stopPropagation(); + var _this = $(this); + _this.closest('.layui-nav-item').data('time', setTimeout(function () { + _this.closest('.layui-nav-item') + .find(".layui-nav-child") + .removeClass("layui-nav-hover") + .css({ + left: 0, + top: 0 + }); + }, 50)); + }) + } else { + $("#" + option.elem + " .layui-nav-item").off('mouseenter').unbind('mouseleave'); + $("#" + option.elem + " dd").off('mouseenter').unbind('mouseleave'); + } + } + exports(MOD_NAME, new pearMenu()); +}) diff --git a/static/component/pear/module/message.js b/static/component/pear/module/message.js new file mode 100644 index 000000000..ee0719318 --- /dev/null +++ b/static/component/pear/module/message.js @@ -0,0 +1,99 @@ +layui.define(['table', 'jquery', 'element'], function(exports) { + "use strict"; + + var MOD_NAME = 'message', + $ = layui.jquery, + element = layui.element; + + var message = function(opt) { + this.option = opt; + }; + + message.prototype.render = function(opt) { + //默认配置值 + var option = { + elem: opt.elem, + url: opt.url ? opt.url : false, + height: opt.height, + data: opt.data + } + if (option.url != false) { + option.data = getData(option.url); + var notice = createHtml(option); + $(option.elem).html(notice); + } + setTimeout(function() { + element.init(); + $(opt.elem + " li").click(function(e) { + $(this).siblings().removeClass('pear-this'); + $(this).addClass('pear-this'); + }) + }, 300); + return new message(option); + } + + message.prototype.click = function(callback) { + $("*[notice-id]").click(function(event) { + event.preventDefault(); + var id = $(this).attr("notice-id"); + var title = $(this).attr("notice-title"); + var context = $(this).attr("notice-context"); + var form = $(this).attr("notice-form"); + callback(id, title, context, form); + }) + } + + /** 同 步 请 求 获 取 数 据 */ + function getData(url) { + $.ajaxSettings.async = false; + var data = null; + $.get(url, function(result) { + data = result; + }); + $.ajaxSettings.async = true; + return data; + } + + function createHtml(option) { + + var count = 0; + var noticeTitle = '
                                      '; + var noticeContent = '
                                      '; + + + // 根据 data 便利数据 + $.each(option.data, function(i, item) { + + if (i === 0) { + noticeTitle += '
                                    • ' + item.title + '
                                    • '; + noticeContent += '
                                      '; + } else { + noticeTitle += '
                                    • ' + item.title + '
                                    • '; + noticeContent += '
                                      '; + } + + $.each(item.children, function(i, note) { + noticeContent += '
                                      ' + + '' + + '
                                      ' + note.title + '
                                      '+ + '
                                      ' + note.time + '
                                      ' + + '
                                      '; + }) + noticeContent += '
                                      '; + }) + + var notice = '
                                    • ' + + '
                                    • ' + + '
                                      '; + + noticeTitle += '
                                    '; + noticeContent += '
                                    '; + notice += noticeTitle; + notice += noticeContent; + notice += '
                                    '; + return notice; + } + + exports(MOD_NAME, new message()); +}) diff --git a/static/component/pear/module/notice.js b/static/component/pear/module/notice.js new file mode 100644 index 000000000..4ea67ec8b --- /dev/null +++ b/static/component/pear/module/notice.js @@ -0,0 +1,489 @@ + +(function(define) { + define(['jquery'], function($) { + return (function() { + var $container; + var listener; + var toastId = 0; + var toastType = { + error: 'error', + info: 'info', + success: 'success', + warning: 'warning' + }; + + var cssStyle = $( + '' + ); + $("body").append(cssStyle); + + var toastr = { + clear: clear, + remove: remove, + error: error, + getContainer: getContainer, + info: info, + options: {}, + subscribe: subscribe, + success: success, + version: '2.1.4', + warning: warning + }; + + var previousToast; + + return toastr; + + function error(message, title, optionsOverride) { + return notify({ + type: toastType.error, + iconClass: getOptions().iconClasses.error, + message: message, + optionsOverride: optionsOverride, + title: title + }); + } + + function getContainer(options, create) { + if (!options) { + options = getOptions(); + } + $container = $('#' + options.containerId); + if ($container.length) { + return $container; + } + if (create) { + $container = createContainer(options); + } + return $container; + } + + function info(message, title, optionsOverride) { + return notify({ + type: toastType.info, + iconClass: getOptions().iconClasses.info, + message: message, + optionsOverride: optionsOverride, + title: title + }); + } + + function subscribe(callback) { + listener = callback; + } + + function success(message, title, optionsOverride) { + return notify({ + type: toastType.success, + iconClass: getOptions().iconClasses.success, + message: message, + optionsOverride: optionsOverride, + title: title + }); + } + + function warning(message, title, optionsOverride) { + return notify({ + type: toastType.warning, + iconClass: getOptions().iconClasses.warning, + message: message, + optionsOverride: optionsOverride, + title: title + }); + } + + function clear($toastElement, clearOptions) { + var options = getOptions(); + if (!$container) { + getContainer(options); + } + if (!clearToast($toastElement, options, clearOptions)) { + clearContainer(options); + } + } + + function remove($toastElement) { + var options = getOptions(); + if (!$container) { + getContainer(options); + } + if ($toastElement && $(':focus', $toastElement).length === 0) { + removeToast($toastElement); + return; + } + if ($container.children().length) { + $container.remove(); + } + } + + // internal functions + + function clearContainer(options) { + var toastsToClear = $container.children(); + for (var i = toastsToClear.length - 1; i >= 0; i--) { + clearToast($(toastsToClear[i]), options); + } + } + + function clearToast($toastElement, options, clearOptions) { + var force = clearOptions && clearOptions.force ? clearOptions.force : false; + if ($toastElement && (force || $(':focus', $toastElement).length === 0)) { + $toastElement[options.hideMethod]({ + duration: options.hideDuration, + easing: options.hideEasing, + complete: function() { + removeToast($toastElement); + } + }); + return true; + } + return false; + } + + function createContainer(options) { + $container = $('
                                    ') + .attr('id', options.containerId) + .addClass(options.positionClass); + + $container.appendTo($(options.target)); + return $container; + } + + function getDefaults() { + return { + tapToDismiss: true, + toastClass: 'toast', + containerId: 'toast-container', + debug: false, + + showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery + showDuration: 300, + showEasing: 'swing', //swing and linear are built into jQuery + onShown: undefined, + hideMethod: 'fadeOut', + hideDuration: 1000, + hideEasing: 'swing', + onHidden: undefined, + closeMethod: false, + closeDuration: false, + closeEasing: false, + closeOnHover: true, + + extendedTimeOut: 1000, + iconClasses: { + error: 'toast-error', + info: 'toast-info', + success: 'toast-success', + warning: 'toast-warning' + }, + iconClass: 'toast-info', + positionClass: 'toast-top-right', + timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky + titleClass: 'toast-title', + messageClass: 'toast-message', + escapeHtml: false, + target: 'body', + closeHtml: '', + closeClass: 'toast-close-button', + newestOnTop: true, + preventDuplicates: false, + progressBar: false, + progressClass: 'toast-progress', + rtl: false + }; + } + + function publish(args) { + if (!listener) { + return; + } + listener(args); + } + + function notify(map) { + var options = getOptions(); + var iconClass = map.iconClass || options.iconClass; + + if (typeof(map.optionsOverride) !== 'undefined') { + options = $.extend(options, map.optionsOverride); + iconClass = map.optionsOverride.iconClass || iconClass; + } + + if (shouldExit(options, map)) { + return; + } + + toastId++; + + $container = getContainer(options, true); + + var intervalId = null; + var $toastElement = $('
                                    '); + var $titleElement = $('
                                    '); + var $messageElement = $('
                                    '); + var $progressElement = $('
                                    '); + var $closeElement = $(options.closeHtml); + var progressBar = { + intervalId: null, + hideEta: null, + maxHideTime: null + }; + var response = { + toastId: toastId, + state: 'visible', + startTime: new Date(), + options: options, + map: map + }; + + personalizeToast(); + + displayToast(); + + handleEvents(); + + publish(response); + + if (options.debug && console) { + console.log(response); + } + + return $toastElement; + + function escapeHtml(source) { + if (source == null) { + source = ''; + } + + return source + .replace(/&/g, '&') + .replace(/"/g, '"') + .replace(/'/g, ''') + .replace(//g, '>'); + } + + function personalizeToast() { + setIcon(); + setTitle(); + setMessage(); + setCloseButton(); + setProgressBar(); + setRTL(); + setSequence(); + setAria(); + } + + function setAria() { + var ariaValue = ''; + switch (map.iconClass) { + case 'toast-success': + case 'toast-info': + ariaValue = 'polite'; + break; + default: + ariaValue = 'assertive'; + } + $toastElement.attr('aria-live', ariaValue); + } + + function handleEvents() { + if (options.closeOnHover) { + $toastElement.hover(stickAround, delayedHideToast); + } + + if (!options.onclick && options.tapToDismiss) { + $toastElement.click(hideToast); + } + + if (options.closeButton && $closeElement) { + $closeElement.click(function(event) { + if (event.stopPropagation) { + event.stopPropagation(); + } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) { + event.cancelBubble = true; + } + + if (options.onCloseClick) { + options.onCloseClick(event); + } + + hideToast(true); + }); + } + + if (options.onclick) { + $toastElement.click(function(event) { + options.onclick(event); + hideToast(); + }); + } + } + + function displayToast() { + $toastElement.hide(); + + $toastElement[options.showMethod]({ + duration: options.showDuration, + easing: options.showEasing, + complete: options.onShown + }); + + if (options.timeOut > 0) { + intervalId = setTimeout(hideToast, options.timeOut); + progressBar.maxHideTime = parseFloat(options.timeOut); + progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime; + if (options.progressBar) { + progressBar.intervalId = setInterval(updateProgress, 10); + } + } + } + + function setIcon() { + if (map.iconClass) { + $toastElement.addClass(options.toastClass).addClass(iconClass); + } + } + + function setSequence() { + if (options.newestOnTop) { + $container.prepend($toastElement); + } else { + $container.append($toastElement); + } + } + + function setTitle() { + if (map.title) { + var suffix = map.title; + if (options.escapeHtml) { + suffix = escapeHtml(map.title); + } + $titleElement.append(suffix).addClass(options.titleClass); + $toastElement.append($titleElement); + } + } + + function setMessage() { + if (map.message) { + var suffix = map.message; + if (options.escapeHtml) { + suffix = escapeHtml(map.message); + } + $messageElement.append(suffix).addClass(options.messageClass); + $toastElement.append($messageElement); + } + } + + function setCloseButton() { + if (options.closeButton) { + $closeElement.addClass(options.closeClass).attr('role', 'button'); + $toastElement.prepend($closeElement); + } + } + + function setProgressBar() { + if (options.progressBar) { + $progressElement.addClass(options.progressClass); + $toastElement.prepend($progressElement); + } + } + + function setRTL() { + if (options.rtl) { + $toastElement.addClass('rtl'); + } + } + + function shouldExit(options, map) { + if (options.preventDuplicates) { + if (map.message === previousToast) { + return true; + } else { + previousToast = map.message; + } + } + return false; + } + + function hideToast(override) { + var method = override && options.closeMethod !== false ? options.closeMethod : options.hideMethod; + var duration = override && options.closeDuration !== false ? + options.closeDuration : options.hideDuration; + var easing = override && options.closeEasing !== false ? options.closeEasing : options.hideEasing; + if ($(':focus', $toastElement).length && !override) { + return; + } + clearTimeout(progressBar.intervalId); + return $toastElement[method]({ + duration: duration, + easing: easing, + complete: function() { + removeToast($toastElement); + clearTimeout(intervalId); + if (options.onHidden && response.state !== 'hidden') { + options.onHidden(); + } + response.state = 'hidden'; + response.endTime = new Date(); + publish(response); + } + }); + } + + function delayedHideToast() { + if (options.timeOut > 0 || options.extendedTimeOut > 0) { + intervalId = setTimeout(hideToast, options.extendedTimeOut); + progressBar.maxHideTime = parseFloat(options.extendedTimeOut); + progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime; + } + } + + function stickAround() { + clearTimeout(intervalId); + progressBar.hideEta = 0; + $toastElement.stop(true, true)[options.showMethod]({ + duration: options.showDuration, + easing: options.showEasing + }); + } + + function updateProgress() { + var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100; + $progressElement.width(percentage + '%'); + } + } + + function getOptions() { + return $.extend({}, getDefaults(), toastr.options); + } + + function removeToast($toastElement) { + if (!$container) { + $container = getContainer(); + } + if ($toastElement.is(':visible')) { + return; + } + $toastElement.remove(); + $toastElement = null; + if ($container.children().length === 0) { + $container.remove(); + previousToast = undefined; + } + } + + })(); + }); +}(typeof define === 'function' && define.amd ? define : function(deps, factory) { + if (typeof module !== 'undefined' && module.exports) { //Node + module.exports = factory(require('jquery')); + } else if (window.layui && layui.define) { + layui.define('jquery', function(exports) { //layui加载 + exports('toastr', factory(layui.jquery)); + exports('notice', factory(layui.jquery)); + }); + } else { + window.toastr = factory(window.jQuery); + } +})); diff --git a/static/component/pear/module/popup.js b/static/component/pear/module/popup.js new file mode 100644 index 000000000..9503407b1 --- /dev/null +++ b/static/component/pear/module/popup.js @@ -0,0 +1,49 @@ +layui.define(['layer', 'jquery', 'element'], function(exports) { + "use strict"; + + var MOD_NAME = 'popup', + $ = layui.jquery, + layer = layui.layer, + element = layui.element; + + var popup = new function() { + + this.success = function(msg) { + layer.msg(msg, { + icon: 1, + time: 1000 + }) + }, + this.failure = function(msg) { + layer.msg(msg, { + icon: 2, + time: 1000 + }) + }, + this.warming = function(msg) { + layer.msg(msg, { + icon: 3, + time: 1000 + }) + }, + this.success = function(msg, callback) { + layer.msg(msg, { + icon: 1, + time: 1000 + }, callback); + }, + this.failure = function(msg, callback) { + layer.msg(msg, { + icon: 2, + time: 1000 + }, callback); + }, + this.warning = function(msg, callback) { + layer.msg(msg, { + icon: 3, + time: 1000 + }, callback); + } + }; + exports(MOD_NAME, popup); +}) diff --git a/static/component/pear/module/select.js b/static/component/pear/module/select.js new file mode 100644 index 000000000..3b095f72c --- /dev/null +++ b/static/component/pear/module/select.js @@ -0,0 +1,1740 @@ +/** + * name: formSelects + * 基于Layui Select多选 + * version: 4.0.0.0910 + * http://sun.faysunshine.com/layui/formSelects-v4/dist/formSelects-v4.js + */ +(function(layui, window, factory) { + if(typeof exports === 'object') { // 支持 CommonJS + module.exports = factory(); + } else if(typeof define === 'function' && define.amd) { // 支持 AMD + define(factory); + } else if(window.layui && layui.define) { //layui加载 + layui.define(['jquery'], function(exports) { + exports('select', factory()); + }); + } else { + window.formSelects = factory(); + } +})(typeof layui == 'undefined' ? null : layui, window, function() { + let v = '4.0.0.0910', + NAME = 'xm-select', + PNAME = 'xm-select-parent', + INPUT = 'xm-select-input', + TDIV = 'xm-select--suffix', + THIS = 'xm-select-this', + LABEL = 'xm-select-label', + SEARCH = 'xm-select-search', + SEARCH_TYPE = 'xm-select-search-type', + SHOW_COUNT = 'xm-select-show-count', + CREATE = 'xm-select-create', + CREATE_LONG = 'xm-select-create-long', + MAX = 'xm-select-max', + SKIN = 'xm-select-skin', + DIRECTION = "xm-select-direction", + HEIGHT = 'xm-select-height', + DISABLED = 'xm-dis-disabled', + DIS = 'xm-select-dis', + TEMP = 'xm-select-temp', + RADIO = 'xm-select-radio', + LINKAGE= 'xm-select-linkage', + DL = 'xm-select-dl', + DD_HIDE = 'xm-select-hide', + HIDE_INPUT = 'xm-hide-input', + SANJIAO = 'xm-select-sj', + ICON_CLOSE = 'xm-icon-close', + FORM_TITLE = 'xm-select-title', + FORM_SELECT = 'xm-form-select', + FORM_SELECTED = 'xm-form-selected', + FORM_NONE = 'xm-select-none', + FORM_EMPTY = 'xm-select-empty', + FORM_INPUT = 'xm-input', + FORM_DL_INPUT = 'xm-dl-input', + FORM_SELECT_TIPS = 'xm-select-tips', + CHECKBOX_YES = 'xm-iconfont', + FORM_TEAM_PID = 'XM_PID_VALUE', + CZ = 'xm-cz', + CZ_GROUP = 'xm-cz-group', + TIPS = '请选择', + data = {}, + events = { + on: {}, + endOn: {}, + filter: {}, + maxTips: {}, + opened: {}, + closed: {} + }, + ajax = { + type: 'get', + header: { + + }, + first: true, + data: {}, + searchUrl: '', + searchName: 'keyword', + searchVal: null, + keyName: 'name', + keyVal: 'value', + keySel: 'selected', + keyDis: 'disabled', + keyChildren: 'children', + dataType: '', + delay: 500, + beforeSuccess: null, + success: null, + error: null, + beforeSearch: null, + response: { + statusCode: 0, + statusName: 'code', + msgName: 'msg', + dataName: 'data' + }, + tree: { + nextClick: function(id, item, callback){ + callback([]); + }, + folderChoose: true, + lazy: true + } + }, + quickBtns = [ + {icon: 'xm-iconfont icon-quanxuan', name: '全选', click: function(id, cm){ + cm.selectAll(id, true, true); + }}, + {icon: 'xm-iconfont icon-qingkong', name: '清空', click: function(id, cm){ + cm.removeAll(id, true, true); + }}, + {icon: 'xm-iconfont icon-fanxuan', name: '反选', click: function(id, cm){ + cm.reverse(id, true, true); + }}, + {icon: 'xm-iconfont icon-pifu', name: '换肤', click: function(id, cm){ + cm.skin(id); + }} + ], + $ = window.$ || (window.layui && window.layui.jquery), + $win = $(window), + ajaxs = {}, + fsConfig = {}, + fsConfigs = {}, + FormSelects = function(options) { + this.config = { + name: null, //xm-select="xxx" + max: null, + maxTips: (id, vals, val, max) => { + let ipt = $(`[xid="${this.config.name}"]`).prev().find(`.${NAME}`); + if(ipt.parents('.layui-form-item[pane]').length) { + ipt = ipt.parents('.layui-form-item[pane]'); + } + ipt.attr('style', 'border-color: red !important'); + setTimeout(() => { + ipt.removeAttr('style'); + }, 300); + }, + init: null, //初始化的选择值, + on: null, //select值发生变化 + opened: null, + closed: null, + filter: (id, inputVal, val, isDisabled) => { + return val.name.indexOf(inputVal) == -1; + }, + clearid: -1, + direction: 'auto', + height: null, + isEmpty: false, + btns: [quickBtns[0], quickBtns[1], quickBtns[2]], + searchType: 0, + create: (id, name) => { + return Date.now(); + }, + template: (id, item) => { + return item.name; + }, + showCount: 0, + isCreate: false, + placeholder: TIPS, + clearInput: false, + }; + this.select = null; + this.values = []; + $.extend(this.config, options, { + searchUrl: options.isSearch ? options.searchUrl : null, + placeholder: options.optionsFirst ? ( + options.optionsFirst.value ? TIPS : (options.optionsFirst.innerHTML || TIPS) + ) : TIPS, + btns: options.radio ? [quickBtns[1]] : [quickBtns[0], quickBtns[1], quickBtns[2]], + }, fsConfigs[options.name] || fsConfig); + if(isNaN(this.config.showCount) || this.config.showCount <= 0) { + this.config.showCount = 19921012; + } + }; + + //一些简单的处理方法 + let Common = function(){ + this.appender(); + this.on(); + this.onreset(); + }; + + Common.prototype.appender = function(){//针对IE做的一些拓展 + //拓展Array map方法 + if(!Array.prototype.map){Array.prototype.map=function(i,h){var b,a,c,e=Object(this),f=e.length>>>0;if(h){b=h}a=new Array(f);c=0;while(c>>0;if(typeof g!=="function"){throw new TypeError(g+" is not a function")}if(arguments.length>1){d=b}c=0;while(c>>0;if(typeof b!=="function"){throw new TypeError()}var e=[];var d=arguments[1];for(var c=0;c { + let othis = $(select), + id = othis.attr(NAME), + hasLayuiRender = othis.next(`.layui-form-select`), + hasRender = othis.next(`.${PNAME}`), + options = { + name: id, + disabled: select.disabled, + max: othis.attr(MAX) - 0, + isSearch: othis.attr(SEARCH) != undefined, + searchUrl: othis.attr(SEARCH), + isCreate: othis.attr(CREATE) != undefined, + radio: othis.attr(RADIO) != undefined, + skin: othis.attr(SKIN), + direction: othis.attr(DIRECTION), + optionsFirst: select.options[0], + height: othis.attr(HEIGHT), + formname: othis.attr('name') || othis.attr('_name'), + layverify: othis.attr('lay-verify') || othis.attr('_lay-verify'), + layverType: othis.attr('lay-verType'), + searchType: othis.attr(SEARCH_TYPE) == 'dl' ? 1 : 0, + showCount: othis.attr(SHOW_COUNT) - 0, + }, + value = othis.find('option[selected]').toArray().map((option) => {//获取已选中的数据 + return { + name: option.innerHTML, + value: option.value, + } + }), + fs = new FormSelects(options); + + fs.values = value; + + if(fs.config.init) { + fs.values = fs.config.init.map(item => { + if(typeof item == 'object') { + return item; + } + return { + name: othis.find(`option[value="${item}"]`).text(), + value: item + } + }).filter(item => { + return item.name; + }); + fs.config.init = fs.values.concat([]); + }else{ + fs.config.init = value.concat([]); + } + + !fs.values && (fs.values = []); + + data[id] = fs; + + //先取消layui对select的渲染 + hasLayuiRender[0] && hasLayuiRender.remove(); + hasRender[0] && hasRender.remove(); + + //构造渲染div + let dinfo = this.renderSelect(id, fs.config.placeholder, select); + let heightStyle = !fs.config.height || fs.config.height == 'auto' ? '' : `xm-hg style="height: 34px;"`; + let inputHtml = [ + `
                                    `, + ``, + `
                                    ` + ]; + let reElem = + $(`
                                    + +
                                    +
                                    + ${inputHtml.join('')} + +
                                    +
                                    + +
                                    +
                                    +
                                    +
                                    ${dinfo}
                                    +
                                    `); + + var $parent = $(`
                                    `); + $parent.append(reElem) + othis.after($parent); + othis.attr('lay-ignore', ''); + othis.removeAttr('name') && othis.attr('_name', fs.config.formname); + othis.removeAttr('lay-verify') && othis.attr('_lay-verify', fs.config.layverify); + + //如果可搜索, 加上事件 + if(fs.config.isSearch){ + ajaxs[id] = $.extend({}, ajax, {searchUrl: fs.config.searchUrl}, ajaxs[id]); + $(document).on('input', `div.${PNAME}[FS_ID="${id}"] .${INPUT}`, (e) => { + this.search(id, e, fs.config.searchUrl); + }); + if(fs.config.searchUrl){//触发第一次请求事件 + this.triggerSearch(reElem, true); + } + }else{//隐藏第二个dl + reElem.find(`dl dd.${FORM_DL_INPUT}`).css('display', 'none'); + } + }); + } + + Common.prototype.search = function(id, e, searchUrl, call){ + let input; + if(call){ + input = call; + }else{ + input = e.target; + let keyCode = e.keyCode; + if(keyCode === 9 || keyCode === 13 || keyCode === 37 || keyCode === 38 || keyCode === 39 || keyCode === 40) { + return false; + } + } + let inputValue = $.trim(input.value); + //过滤一下tips + this.changePlaceHolder($(input)); + + let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + searchUrl = ajaxConfig.searchUrl || searchUrl; + let fs = data[id], + isCreate = fs.config.isCreate, + reElem = $(`dl[xid="${id}"]`).parents(`.${FORM_SELECT}`); + //如果开启了远程搜索 + if(searchUrl){ + if(ajaxConfig.searchVal){ + inputValue = ajaxConfig.searchVal; + ajaxConfig.searchVal = ''; + } + if(!ajaxConfig.beforeSearch || (ajaxConfig.beforeSearch && ajaxConfig.beforeSearch instanceof Function && ajaxConfig.beforeSearch(id, searchUrl, inputValue))){ + let delay = ajaxConfig.delay; + if(ajaxConfig.first){ + ajaxConfig.first = false; + delay = 10; + } + clearTimeout(fs.clearid); + fs.clearid = setTimeout(() => { + reElem.find(`dl > *:not(.${FORM_SELECT_TIPS})`).remove(); + reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text('请求中'); + this.ajax(id, searchUrl, inputValue, false, null, true); + }, delay); + } + }else{ + reElem.find(`dl .${DD_HIDE}`).removeClass(DD_HIDE); + //遍历选项, 选择可以显示的值 + reElem.find(`dl dd:not(.${FORM_SELECT_TIPS})`).each((idx, item) => { + let _item = $(item); + let searchFun = events.filter[id] || data[id].config.filter; + if(searchFun && searchFun(id, inputValue, this.getItem(id, _item), _item.hasClass(DISABLED)) == true){ + _item.addClass(DD_HIDE); + } + }); + //控制分组名称 + reElem.find('dl dt').each((index, item) => { + if(!$(item).nextUntil('dt', `:not(.${DD_HIDE})`).length) { + $(item).addClass(DD_HIDE); + } + }); + //动态创建 + this.create(id, isCreate, inputValue); + let shows = reElem.find(`dl dd:not(.${FORM_SELECT_TIPS}):not(.${DD_HIDE})`); + if(!shows.length){ + reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text('无匹配项'); + }else{ + reElem.find(`dd.${FORM_NONE}`).removeClass(FORM_EMPTY); + } + } + } + + Common.prototype.isArray = function(obj){ + return Object.prototype.toString.call(obj) == "[object Array]"; + } + + Common.prototype.triggerSearch = function(div, isCall){ + (div ? [div] : $(`.${FORM_SELECT}`).toArray()).forEach((reElem, index) => { + reElem = $(reElem); + let id = reElem.find('dl').attr('xid') + if((id && data[id] && data[id].config.isEmpty) || isCall){ + this.search(id, null, null, data[id].config.searchType == 0 ? reElem.find(`.${LABEL} .${INPUT}`) : reElem.find(`dl .${FORM_DL_INPUT} .${INPUT}`)); + } + }); + } + + Common.prototype.clearInput = function(id){ + let div = $(`.${PNAME}[fs_id="${id}"]`); + let input = data[id].config.searchType == 0 ? div.find(`.${LABEL} .${INPUT}`) : div.find(`dl .${FORM_DL_INPUT} .${INPUT}`); + input.val(''); + } + + Common.prototype.ajax = function(id, searchUrl, inputValue, isLinkage, linkageWidth, isSearch, successCallback, isReplace){ + let reElem = $(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`); + if(!reElem[0] || !searchUrl){ + return ; + } + let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + let ajaxData = $.extend(true, {}, ajaxConfig.data); + ajaxData[ajaxConfig.searchName] = inputValue; + //是否需要对ajax添加随机时间 + //ajaxData['_'] = Date.now(); + $.ajax({ + type: ajaxConfig.type, + headers: ajaxConfig.header, + url: searchUrl, + data: ajaxConfig.dataType == 'json' ? JSON.stringify(ajaxData) : ajaxData, + success: (res) => { + if(typeof res == 'string'){ + res = JSON.parse(res); + } + ajaxConfig.beforeSuccess && ajaxConfig.beforeSuccess instanceof Function && (res = ajaxConfig.beforeSuccess(id, searchUrl, inputValue, res)); + if(this.isArray(res)){ + let newRes = {}; + newRes[ajaxConfig.response.statusName] = ajaxConfig.response.statusCode; + newRes[ajaxConfig.response.msgName] = ""; + newRes[ajaxConfig.response.dataName] = res; + res = newRes; + } + if(res[ajaxConfig.response.statusName] != ajaxConfig.response.statusCode) { + reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text(res[ajaxConfig.response.msgName]); + }else{ + reElem.find(`dd.${FORM_NONE}`).removeClass(FORM_EMPTY); + this.renderData(id, res[ajaxConfig.response.dataName], isLinkage, linkageWidth, isSearch, isReplace); + data[id].config.isEmpty = res[ajaxConfig.response.dataName].length == 0; + } + successCallback && successCallback(id); + ajaxConfig.success && ajaxConfig.success instanceof Function && ajaxConfig.success(id, searchUrl, inputValue, res); + }, + error: (err) => { + reElem.find(`dd[lay-value]:not(.${FORM_SELECT_TIPS})`).remove(); + reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text('服务异常'); + ajaxConfig.error && ajaxConfig.error instanceof Function && ajaxConfig.error(id, searchUrl, inputValue, err); + } + }); + } + + Common.prototype.renderData = function(id, dataArr, linkage, linkageWidth, isSearch, isReplace){ + if(linkage){//渲染多级联动 + this.renderLinkage(id, dataArr, linkageWidth); + return; + } + if(isReplace){ + this.renderReplace(id, dataArr); + return; + } + + let reElem = $(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`); + let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + let pcInput = reElem.find(`.${TDIV} input`); + + dataArr = this.exchangeData(id, dataArr); + let values = []; + reElem.find('dl').html(this.renderSelect(id, pcInput.attr('placeholder') || pcInput.attr('back'), dataArr.map((item) => { + let itemVal = $.extend({}, item, { + innerHTML: item[ajaxConfig.keyName], + value: item[ajaxConfig.keyVal], + sel: item[ajaxConfig.keySel], + disabled: item[ajaxConfig.keyDis], + type: item.type, + name: item[ajaxConfig.keyName] + }); + if(itemVal.sel){ + values.push(itemVal); + } + return itemVal; + }))); + + let label = reElem.find(`.${LABEL}`); + let dl = reElem.find('dl[xid]'); + if(isSearch){//如果是远程搜索, 这里需要判重 + let oldVal = data[id].values; + oldVal.forEach((item, index) => { + dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS); + }); + values.forEach((item, index) => { + if(this.indexOf(oldVal, item) == -1){ + this.addLabel(id, label, item); + dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS); + oldVal.push(item); + } + }); + }else{ + values.forEach((item, index) => { + this.addLabel(id, label, item); + dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS); + }); + data[id].values = values; + } + this.commonHandler(id, label); + } + + Common.prototype.renderLinkage = function(id, dataArr, linkageWidth){ + let result = [], + index = 0, + temp = {"0": dataArr}, + ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + db[id] = {}; + do{ + let group = result[index ++] = [], + _temp = temp; + temp = {}; + $.each(_temp, (pid, arr) => { + $.each(arr, (idx, item) => { + let val = { + pid: pid, + name: item[ajaxConfig.keyName], + value: item[ajaxConfig.keyVal], + }; + db[id][val.value] = $.extend(item, val); + group.push(val); + let children = item[ajaxConfig.keyChildren]; + if(children && children.length){ + temp[val.value] = children; + } + }); + }); + }while(Object.getOwnPropertyNames(temp).length); + + let reElem = $(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`); + let html = ['
                                    ']; + + $.each(result, (idx, arr) => { + let groupDiv = [`
                                    `]; + $.each(arr, (idx2, item) => { + let span = `
                                  • ${item.name}
                                  • `; + groupDiv.push(span); + }); + groupDiv.push(`
                                    `); + html = html.concat(groupDiv); + }); + html.push('
                                    '); + html.push('
                                    '); + reElem.find('dl').html(html.join('')); + reElem.find(`.${INPUT}`).css('display', 'none');//联动暂时不支持搜索 + } + + Common.prototype.renderReplace = function(id, dataArr){ + let dl = $(`.${PNAME} dl[xid="${id}"]`); + let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + + dataArr = this.exchangeData(id, dataArr); + db[id] = dataArr; + + let html = dataArr.map((item) => { + let itemVal = $.extend({}, item, { + innerHTML: item[ajaxConfig.keyName], + value: item[ajaxConfig.keyVal], + sel: item[ajaxConfig.keySel], + disabled: item[ajaxConfig.keyDis], + type: item.type, + name: item[ajaxConfig.keyName] + }); + return this.createDD(id, itemVal); + }).join(''); + + dl.find(`dd:not(.${FORM_SELECT_TIPS}),dt:not([style])`).remove(); + dl.find(`dt[style]`).after($(html)); + } + + Common.prototype.exchangeData = function(id, arr){//这里处理树形结构 + let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + let childrenName = ajaxConfig['keyChildren']; + let disabledName = ajaxConfig['keyDis']; + db[id] = {}; + let result = this.getChildrenList(arr, childrenName, disabledName, [], false); + return result; + } + + Common.prototype.getChildrenList = function(arr, childrenName, disabledName, pid, disabled){ + let result = [], offset = 0; + for(let a = 0; a < arr.length; a ++){ + let item = arr[a]; + if(item.type && item.type == 'optgroup'){ + result.push(item); + continue; + }else{ + offset ++; + } + let parentIds = pid.concat([]); + parentIds.push(`${offset - 1}_E`); + item[FORM_TEAM_PID] = JSON.stringify(parentIds); + item[disabledName] = item[disabledName] || disabled; + result.push(item); + let child = item[childrenName]; + if(child && common.isArray(child) && child.length){ + item['XM_TREE_FOLDER'] = true; + let pidArr = parentIds.concat([]); + let childResult = this.getChildrenList(child, childrenName, disabledName, pidArr, item[disabledName]); + result = result.concat(childResult); + } + } + return result; + } + + Common.prototype.create = function(id, isCreate, inputValue){ + if(isCreate && inputValue){ + let fs = data[id], + dl = $(`[xid="${id}"]`), + tips= dl.find(`dd.${FORM_SELECT_TIPS}.${FORM_DL_INPUT}`), + tdd = null, + temp = dl.find(`dd.${TEMP}`); + dl.find(`dd:not(.${FORM_SELECT_TIPS}):not(.${TEMP})`).each((index, item) => { + if(inputValue == $(item).find('span').attr('name')){ + tdd = item; + } + }); + if(!tdd){//如果不存在, 则创建 + let val = fs.config.create(id, inputValue); + if(temp[0]){ + temp.attr('lay-value', val); + temp.find('span').text(inputValue); + temp.find('span').attr("name", inputValue); + temp.removeClass(DD_HIDE); + }else{ + tips.after($(this.createDD(id, { + name: inputValue, + innerHTML: inputValue, + value: val + }, `${TEMP} ${CREATE_LONG}`))); + } + } + }else{ + $(`[xid=${id}] dd.${TEMP}`).remove(); + } + } + + Common.prototype.createDD = function(id, item, clz){ + let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + let name = $.trim(item.innerHTML); + db[id][item.value] = $(item).is('option') ? (item = function(){ + let resultItem = {}; + resultItem[ajaxConfig.keyName] = name; + resultItem[ajaxConfig.keyVal] = item.value; + resultItem[ajaxConfig.keyDis] = item.disabled; + return resultItem; + }()) : item; + let template = data[id].config.template(id, item); + let pid = item[FORM_TEAM_PID]; + pid ? (pid = JSON.parse(pid)) : (pid = [-1]); + let attr = pid[0] == -1 ? '' : `tree-id="${pid.join('-')}" tree-folder="${!!item['XM_TREE_FOLDER']}"`; + return `
                                    +
                                    + + ${template} +
                                    +
                                    `; + } + + Common.prototype.createQuickBtn = function(obj, right){ + return `
                                    ${obj.name}
                                    ` + } + + Common.prototype.renderBtns = function(id, show, right){ + let quickBtn = []; + let dl = $(`dl[xid="${id}"]`); + quickBtn.push(`
                                    `); + $.each(data[id].config.btns, (index, item) => { + quickBtn.push(this.createQuickBtn(item, right)); + }); + quickBtn.push(`
                                    `); + quickBtn.push(this.createQuickBtn({icon: 'xm-iconfont icon-caidan', name: ''})); + return quickBtn.join(''); + } + + Common.prototype.renderSelect = function(id, tips, select){ + db[id] = {}; + let arr = []; + if(data[id].config.btns.length){ + setTimeout(() => { + let dl = $(`dl[xid="${id}"]`); + dl.parents(`.${FORM_SELECT}`).attr(SEARCH_TYPE, data[id].config.searchType); + dl.find(`.${CZ_GROUP}`).css('max-width', `${dl.prev().width() - 54}px`); + }, 10) + arr.push([ + `
                                    `, + this.renderBtns(id, null, '30px'), + `
                                    `, + `
                                    `, + ``, + ``, + `
                                    ` + ].join('')); + }else{ + arr.push(`
                                    ${tips}
                                    `); + } + if(this.isArray(select)){ + $(select).each((index, item) => { + if(item){ + if(item.type && item.type === 'optgroup') { + arr.push(`
                                    ${item.name}
                                    `); + } else { + arr.push(this.createDD(id, item)); + } + } + }); + }else{ + $(select).find('*').each((index, item) => { + if(item.tagName.toLowerCase() == 'option' && index == 0 && !item.value){ + return ; + } + if(item.tagName.toLowerCase() === 'optgroup') { + arr.push(`
                                    ${item.label}
                                    `); + } else { + arr.push(this.createDD(id, item)); + } + }); + } + arr.push('
                                    '); + arr.push(`
                                    没有选项
                                    `); + return arr.join(''); + } + + Common.prototype.on = function(){//事件绑定 + this.one(); + + $(document).on('click', (e) => { + if(!$(e.target).parents(`.${FORM_TITLE}`)[0]){//清空input中的值 + $(`.${PNAME} dl .${DD_HIDE}`).removeClass(DD_HIDE); + $(`.${PNAME} dl dd.${FORM_EMPTY}`).removeClass(FORM_EMPTY); + $(`.${PNAME} dl dd.${TEMP}`).remove(); + $.each(data, (key, fs) => { + this.clearInput(key); + if(!fs.values.length){ + this.changePlaceHolder($(`div[FS_ID="${key}"] .${LABEL}`)); + } + }); + } + $(`.${PNAME} .${FORM_SELECTED}`).each((index, item) => { + this.changeShow($(item).find(`.${FORM_TITLE}`), false); + }) ; + }); + } + + Common.prototype.calcLabelLeft = function(label, w, call){ + let pos = this.getPosition(label[0]); + pos.y = pos.x + label[0].clientWidth; + let left = label[0].offsetLeft; + if(!label.find('span').length){ + left = 0; + }else if(call){//校正归位 + let span = label.find('span:last'); + span.css('display') == 'none' ? (span = span.prev()[0]) : (span = span[0]); + let spos = this.getPosition(span); + spos.y = spos.x + span.clientWidth; + + if(spos.y > pos.y){ + left = left - (spos.y - pos.y) - 5; + }else{ + left = 0; + } + }else{ + if(w < 0){ + let span = label.find(':last'); + span.css('display') == 'none' ? (span = span.prev()[0]) : (span = span[0]); + let spos = this.getPosition(span); + spos.y = spos.x + span.clientWidth; + if(spos.y > pos.y){ + left -= 10; + } + }else{ + if(left < 0){ + left += 10; + } + if(left > 0){ + left = 0; + } + } + } + label.css('left', left + 'px'); + } + + Common.prototype.one = function(target){//一次性事件绑定 + $(target ? target : document).off('click', `.${FORM_TITLE}`).on('click', `.${FORM_TITLE}`, (e) => { + let othis = $(e.target), + title = othis.is(FORM_TITLE) ? othis : othis.parents(`.${FORM_TITLE}`), + dl = title.next(), + id = dl.attr('xid'); + + //清空非本select的input val + $(`dl[xid]`).not(dl).each((index, item) => { + this.clearInput($(item).attr('xid')); + }); + $(`dl[xid]`).not(dl).find(`dd.${DD_HIDE}`).removeClass(DD_HIDE); + + //如果是disabled select + if(title.hasClass(DIS)){ + return false; + } + //如果点击的是右边的三角或者只读的input + if(othis.is(`.${SANJIAO}`) || othis.is(`.${INPUT}[readonly]`)){ + this.changeShow(title, !title.parents(`.${FORM_SELECT}`).hasClass(FORM_SELECTED)); + return false; + } + //如果点击的是input的右边, focus一下 + if(title.find(`.${INPUT}:not(readonly)`)[0]){ + let input = title.find(`.${INPUT}`), + epos = {x: e.pageX, y: e.pageY}, + pos = this.getPosition(title[0]), + width = title.width(); + while(epos.x > pos.x){ + if($(document.elementFromPoint(epos.x, epos.y)).is(input)){ + input.focus(); + this.changeShow(title, true); + return false; + } + epos.x -= 50; + } + } + + //如果点击的是可搜索的input + if(othis.is(`.${INPUT}`)){ + this.changeShow(title, true); + return false; + } + //如果点击的是x按钮 + if(othis.is(`i[fsw="${NAME}"]`)){ + let val = this.getItem(id, othis), + dd = dl.find(`dd[lay-value='${val.value}']`); + if(dd.hasClass(DISABLED)){//如果是disabled状态, 不可选, 不可删 + return false; + } + this.handlerLabel(id, dd, false, val); + return false; + } + + this.changeShow(title, !title.parents(`.${FORM_SELECT}`).hasClass(FORM_SELECTED)); + return false; + }); + $(target ? target : document).off('click', `dl.${DL}`).on('click', `dl.${DL}`, (e) => { + let othis = $(e.target); + if(othis.is(`.${LINKAGE}`) || othis.parents(`.${LINKAGE}`)[0]){//linkage的处理 + othis = othis.is('li') ? othis : othis.parents('li[xm-value]'); + let group = othis.parents('.xm-select-linkage-group'), + id = othis.parents('dl').attr('xid'); + if(!id){ + return false; + } + //激活li + group.find('.xm-select-active').removeClass('xm-select-active'); + othis.addClass('xm-select-active'); + //激活下一个group, 激活前显示对应数据 + group.nextAll('.xm-select-linkage-group').addClass('xm-select-linkage-hide'); + let nextGroup = group.next('.xm-select-linkage-group'); + nextGroup.find('li').addClass('xm-select-linkage-hide'); + nextGroup.find(`li[pid="${othis.attr('xm-value')}"]`).removeClass('xm-select-linkage-hide'); + //如果没有下一个group, 或没有对应的值 + if(!nextGroup[0] || nextGroup.find(`li:not(.xm-select-linkage-hide)`).length == 0){ + let vals = [], + index = 0, + isAdd = !othis.hasClass('xm-select-this'); + if(data[id].config.radio){ + othis.parents('.xm-select-linkage').find('.xm-select-this').removeClass('xm-select-this'); + } + do{ + vals[index ++] = { + name: othis.find('span').text(), + value: othis.attr('xm-value') + } + othis = othis.parents('.xm-select-linkage-group').prev().find(`li[xm-value="${othis.attr('pid')}"]`); + }while(othis.length); + vals.reverse(); + let val = { + name: vals.map((item) => { + return item.name; + }).join('/'), + value: vals.map((item) => { + return item.value; + }).join('/'), + } + this.handlerLabel(id, null, isAdd, val); + }else{ + nextGroup.removeClass('xm-select-linkage-hide'); + } + return false; + } + + if(othis.is('dl')){ + return false; + } + + if(othis.is('dt')){ + othis.nextUntil(`dt`).each((index, item) => { + item = $(item); + if(item.hasClass(DISABLED) || item.hasClass(THIS)){ + + }else{ + item.find('i:not(.icon-expand)').click(); + } + }); + return false; + } + let dd = othis.is('dd') ? othis : othis.parents('dd'); + let id = dd.parent('dl').attr('xid'); + + if(dd.hasClass(DISABLED)){//被禁用选项的处理 + return false; + } + + //菜单功效 + if(othis.is('i.icon-caidan')){ + let opens = [], closes = []; + othis.parents('dl').find('dd[tree-folder="true"]').each((index, item) => { + $(item).attr('xm-tree-hidn') == undefined ? opens.push(item) : closes.push(item); + }); + let arr = closes.length ? closes : opens; + arr.forEach(item => item.click()); + return false; + } + //树状结构的选择 + let treeId = dd.attr('tree-id'); + if(treeId){ + //忽略右边的图标 + if(othis.is('i:not(.icon-expand)')){ + this.handlerLabel(id, dd, !dd.hasClass(THIS)); + return false; + } + let ajaxConfig = ajaxs[id] || ajax; + let treeConfig = ajaxConfig.tree; + let childrens = dd.nextAll(`dd[tree-id^="${treeId}"]`); + if(childrens && childrens.length){ + let len = childrens[0].clientHeight; + len ? ( + this.addTreeHeight(dd, len), + len = 0 + ) : ( + len = dd.attr('xm-tree-hidn') || 36, + dd.removeAttr('xm-tree-hidn'), + dd.find('>i').remove(), + (childrens = childrens.filter((index, item) => $(item).attr('tree-id').split('-').length - 1 == treeId.split('-').length)) + ); + childrens.animate({ + height: len + }, 150) + return false; + }else{ + if(treeConfig.nextClick && treeConfig.nextClick instanceof Function){ + treeConfig.nextClick(id, this.getItem(id, dd), (res) => { + if(!res || !res.length){ + this.handlerLabel(id, dd, !dd.hasClass(THIS)); + }else{ + dd.attr('tree-folder', 'true'); + let ddChilds = []; + res.forEach((item, idx) => { + item.innerHTML = item[ajaxConfig.keyName]; + item[FORM_TEAM_PID] = JSON.stringify(treeId.split('-').concat([idx])); + ddChilds.push(this.createDD(id, item)); + db[id][item[ajaxConfig.keyVal]] = item; + }); + dd.after(ddChilds.join('')); + } + }); + return false; + } + } + } + + if(dd.hasClass(FORM_SELECT_TIPS)){//tips的处理 + let btn = othis.is(`.${CZ}`) ? othis : othis.parents(`.${CZ}`); + if(!btn[0]){ + return false; + } + let method = btn.attr('method'); + let obj = data[id].config.btns.filter(bean => bean.name == method)[0]; + obj && obj.click && obj.click instanceof Function && obj.click(id, this); + return false; + } + this.handlerLabel(id, dd, !dd.hasClass(THIS)); + return false; + }); + } + + Common.prototype.addTreeHeight = function(dd, len){ + let treeId = dd.attr('tree-id'); + let childrens = dd.nextAll(`dd[tree-id^="${treeId}"]`); + if(childrens.length){ + dd.append(''); + dd.attr('xm-tree-hidn', len); + childrens.each((index, item) => { + let that = $(item); + this.addTreeHeight(that, len); + }) + } + } + + let db = {}; + Common.prototype.getItem = function(id, value){ + if(value instanceof $){ + if(value.is(`i[fsw="${NAME}"]`)){ + let span = value.parent(); + return db[id][value] || { + name: span.find('font').text(), + value: span.attr('value') + } + } + let val = value.attr('lay-value'); + return !db[id][val] ? (db[id][val] = { + name: value.find('span[name]').attr('name'), + value: val + }) : db[id][val]; + }else if(typeof(value) == 'string' && value.indexOf('/') != -1){ + return db[id][value] || { + name: this.valToName(id, value), + value: value + } + } + return db[id][value]; + } + + Common.prototype.linkageAdd = function(id, val){ + let dl = $(`dl[xid="${id}"]`); + dl.find('.xm-select-active').removeClass('xm-select-active'); + let vs = val.value.split('/'); + let pid, li, index = 0; + let lis = []; + do{ + pid = vs[index]; + li = dl.find(`.xm-select-linkage-group${index + 1} li[xm-value="${pid}"]`); + li[0] && lis.push(li); + index ++; + }while(li.length && pid != undefined); + if(lis.length == vs.length){ + $.each(lis, (idx, item) => { + item.addClass('xm-select-this'); + }); + } + } + + Common.prototype.linkageDel = function(id, val){ + let dl = $(`dl[xid="${id}"]`); + let vs = val.value.split('/'); + let pid, li, index = vs.length - 1; + do{ + pid = vs[index]; + li = dl.find(`.xm-select-linkage-group${index + 1} li[xm-value="${pid}"]`); + if(!li.parent().next().find(`li[pid=${pid}].xm-select-this`).length){ + li.removeClass('xm-select-this'); + } + index --; + }while(li.length && pid != undefined); + } + + Common.prototype.valToName = function(id, val){ + let dl = $(`dl[xid="${id}"]`); + let vs = (val + "").split('/'); + if(!vs.length){ + return null; + } + let names = []; + $.each(vs, (idx, item) => { + let name = dl.find(`.xm-select-linkage-group${idx + 1} li[xm-value="${item}"] span`).text(); + names.push(name); + }); + return names.length == vs.length ? names.join('/') : null; + } + + Common.prototype.commonHandler = function(key, label){ + if(!label || !label[0]){ + return ; + } + this.checkHideSpan(key, label); + //计算input的提示语 + this.changePlaceHolder(label); + //计算高度 + this.retop(label.parents(`.${FORM_SELECT}`)); + this.calcLabelLeft(label, 0, true); + //表单默认值 + this.setHidnVal(key, label); + //title值 + label.parents(`.${FORM_TITLE} .${NAME}`).attr('title', data[key].values.map((val) => { + return val.name; + }).join(',')); + } + + Common.prototype.initVal = function(id){ + let target = {}; + if(id){ + target[id] = data[id]; + }else{ + target = data; + } + $.each(target, (key, val) => { + let values = val.values, + div = $(`dl[xid="${key}"]`).parent(), + label = div.find(`.${LABEL}`), + dl = div.find('dl'); + dl.find(`dd.${THIS}`).removeClass(THIS); + + let _vals = values.concat([]); + _vals.concat([]).forEach((item, index) => { + this.addLabel(key, label, item); + dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS); + }); + if(val.config.radio){ + _vals.length && values.push(_vals[_vals.length - 1]); + } + this.commonHandler(key, label); + }); + } + + Common.prototype.setHidnVal = function(key, label) { + if(!label || !label[0]) { + return; + } + label.parents(`.${PNAME}`).find(`.${HIDE_INPUT}`).val(data[key].values.map((val) => { + return val.value; + }).join(',')); + } + + Common.prototype.handlerLabel = function(id, dd, isAdd, oval, notOn){ + let div = $(`[xid="${id}"]`).prev().find(`.${LABEL}`), + val = dd && this.getItem(id, dd), + vals = data[id].values, + on = data[id].config.on || events.on[id], + endOn = data[id].config.endOn || events.endOn[id]; + if(oval){ + val = oval; + } + let fs = data[id]; + if(isAdd && fs.config.max && fs.values.length >= fs.config.max){ + let maxTipsFun = events.maxTips[id] || data[id].config.maxTips; + maxTipsFun && maxTipsFun(id, vals.concat([]), val, fs.config.max); + return ; + } + if(!notOn){ + if(on && on instanceof Function && on(id, vals.concat([]), val, isAdd, dd && dd.hasClass(DISABLED)) == false) { + return ; + } + } + let dl = $(`dl[xid="${id}"]`); + isAdd ? ( + (dd && dd[0] ? ( + dd.addClass(THIS), + dd.removeClass(TEMP) + ) : ( + dl.find('.xm-select-linkage')[0] && this.linkageAdd(id, val) + )), + this.addLabel(id, div, val), + vals.push(val) + ) : ( + (dd && dd[0] ? ( + dd.removeClass(THIS) + ) : ( + dl.find('.xm-select-linkage')[0] && this.linkageDel(id, val) + )), + this.delLabel(id, div, val), + this.remove(vals, val) + ); + if(!div[0]) return ; + //单选选完后直接关闭选择域 + if(fs.config.radio){ + this.changeShow(div, false); + } + //移除表单验证的红色边框 + div.parents(`.${FORM_TITLE}`).prev().removeClass('layui-form-danger'); + + //清空搜索值 + fs.config.clearInput && this.clearInput(id); + + this.commonHandler(id, div); + + !notOn && endOn && endOn instanceof Function && endOn(id, vals.concat([]), val, isAdd, dd && dd.hasClass(DISABLED)); + } + + Common.prototype.addLabel = function(id, div, val){ + if(!val) return ; + let tips = `fsw="${NAME}"`; + let [$label, $close] = [ + $(`${val.name}`), + $(``) + ]; + $label.append($close); + //如果是radio模式 + let fs = data[id]; + if(fs.config.radio){ + fs.values.length = 0; + $(`dl[xid="${id}"]`).find(`dd.${THIS}:not([lay-value="${val.value}"])`).removeClass(THIS); + div.find('span').remove(); + } + //如果是固定高度 + div.find('input').css('width', '50px'); + div.find('input').before($label); + } + + Common.prototype.delLabel = function(id, div, val){ + if(!val) return ; + div.find(`span[value="${val.value}"]:first`).remove(); + } + + Common.prototype.checkHideSpan = function(id, div){ + let parentHeight = div.parents(`.${NAME}`)[0].offsetHeight + 5; + div.find('span.xm-span-hide').removeClass('xm-span-hide'); + div.find('span[style]').remove(); + + let count = data[id].config.showCount; + div.find('span').each((index, item) => { + if(index >= count){ + $(item).addClass('xm-span-hide'); + } + }); + + let prefix = div.find(`span:eq(${count})`); + prefix[0] && prefix.before($(` + ${div.find('span').length - count}`)) + } + + Common.prototype.retop = function(div){//计算dl显示的位置 + let dl = div.find('dl'), + top = div.offset().top + div.outerHeight() + 5 - $win.scrollTop(), + dlHeight = dl.outerHeight(); + let up = div.hasClass('layui-form-selectup') || dl.css('top').indexOf('-') != -1 || (top + dlHeight > $win.height() && top >= dlHeight); + div = div.find(`.${NAME}`); + + let fs = data[dl.attr('xid')]; + let base = dl.parents('.layui-form-pane')[0] && dl.prev()[0].clientHeight > 38 ? 14 : 10; + if((fs && fs.config.direction == 'up') || up){ + up = true; + if((fs && fs.config.direction == 'down')){ + up = false; + } + } + let reHeight = div[0].offsetTop + div.height() + base; + if(up) { + dl.css({ + top: 'auto', + bottom: reHeight + 3 + 'px', + }); + } else { + dl.css({ + top: reHeight + 'px', + bottom: 'auto' + }); + } + } + + Common.prototype.changeShow = function(children, isShow){//显示于隐藏 + $('.layui-form-selected').removeClass('layui-form-selected'); + let top = children.parents(`.${FORM_SELECT}`), + realShow = top.hasClass(FORM_SELECTED), + id = top.find('dl').attr('xid'); + $(`.${PNAME} .${FORM_SELECT}`).not(top).removeClass(FORM_SELECTED); + if(isShow){ + this.retop(top); + top.addClass(FORM_SELECTED); + top.find(`.${INPUT}`).focus(); + if(!top.find(`dl dd[lay-value]:not(.${FORM_SELECT_TIPS})`).length){ + top.find(`dl .${FORM_NONE}`).addClass(FORM_EMPTY); + } + }else{ + top.removeClass(FORM_SELECTED); + this.clearInput(id); + top.find(`dl .${FORM_EMPTY}`).removeClass(FORM_EMPTY); + top.find(`dl dd.${DD_HIDE}`).removeClass(DD_HIDE); + top.find(`dl dd.${TEMP}`).remove(); + //计算ajax数据是否为空, 然后重新请求数据 + if(id && data[id] && data[id].config.isEmpty){ + this.triggerSearch(top); + } + this.changePlaceHolder(top.find(`.${LABEL}`)); + } + if(isShow != realShow){ + let openFun = data[id].config.opened || events.opened[id]; + isShow && openFun && openFun instanceof Function && openFun(id); + let closeFun = data[id].config.closed || events.closed[id]; + !isShow && closeFun && closeFun instanceof Function && closeFun(id); + } + } + + Common.prototype.changePlaceHolder = function(div){//显示于隐藏提示语 + //调整pane模式下的高度 + let title = div.parents(`.${FORM_TITLE}`); + title[0] || (title = div.parents(`dl`).prev()); + if(!title[0]){ + return ; + } + + let id = div.parents(`.${PNAME}`).find(`dl[xid]`).attr('xid'); + if(data[id] && data[id].config.height){//既然固定高度了, 那就看着办吧 + + }else{ + let height = title.find(`.${NAME}`)[0].clientHeight; + title.css('height' , (height > 36 ? height + 4 : height) + 'px'); + //如果是layui pane模式, 处理label的高度 + let label = title.parents(`.${PNAME}`).parent().prev(); + if(label.is('.layui-form-label') && title.parents('.layui-form-pane')[0]){ + height = height > 36 ? height + 4 : height; + title.css('height' , height + 'px'); + label.css({ + height: height + 2 + 'px', + lineHeight: (height - 18) + 'px' + }) + } + } + + let input = title.find(`.${TDIV} input`), + isShow = !div.find('span:last')[0] && !title.find(`.${INPUT}`).val(); + if(isShow){ + let ph = input.attr('back'); + input.removeAttr('back'); + input.attr('placeholder', ph); + }else{ + let ph = input.attr('placeholder'); + input.removeAttr('placeholder'); + input.attr('back', ph) + } + } + + Common.prototype.indexOf = function(arr, val){ + for(let i = 0; i < arr.length; i++) { + if(arr[i].value == val || arr[i].value == (val ? val.value : val) || arr[i] == val || JSON.stringify(arr[i]) == JSON.stringify(val)) { + return i; + } + } + return -1; + } + + Common.prototype.remove = function(arr, val){ + let idx = this.indexOf(arr, val ? val.value : val); + if(idx > -1) { + arr.splice(idx, 1); + return true; + } + return false; + } + + Common.prototype.selectAll = function(id, isOn, skipDis){ + let dl = $(`[xid="${id}"]`); + if(!dl[0]){ + return ; + } + if(dl.find('.xm-select-linkage')[0]){ + return ; + } + dl.find(`dd[lay-value]:not(.${FORM_SELECT_TIPS}):not(.${THIS})${skipDis ? ':not(.'+DISABLED+')' :''}`).each((index, item) => { + item = $(item); + let val = this.getItem(id, item); + this.handlerLabel(id, dl.find(`dd[lay-value="${val.value}"]`), true, val, !isOn); + }); + } + + Common.prototype.removeAll = function(id, isOn, skipDis){ + let dl = $(`[xid="${id}"]`); + if(!dl[0]){ + return ; + } + if(dl.find('.xm-select-linkage')[0]){//针对多级联动的处理 + data[id].values.concat([]).forEach((item, idx) => { + let vs = item.value.split('/'); + let pid, li, index = 0; + do{ + pid = vs[index ++]; + li = dl.find(`.xm-select-linkage-group${index}:not(.xm-select-linkage-hide) li[xm-value="${pid}"]`); + li.click(); + }while(li.length && pid != undefined); + }); + return ; + } + data[id].values.concat([]).forEach((item, index) => { + if(skipDis && dl.find(`dd[lay-value="${item.value}"]`).hasClass(DISABLED)){ + + }else{ + this.handlerLabel(id, dl.find(`dd[lay-value="${item.value}"]`), false, item, !isOn); + } + }); + } + + Common.prototype.reverse = function(id, isOn, skipDis){ + let dl = $(`[xid="${id}"]`); + if(!dl[0]){ + return ; + } + if(dl.find('.xm-select-linkage')[0]){ + return ; + } + dl.find(`dd[lay-value]:not(.${FORM_SELECT_TIPS})${skipDis ? ':not(.'+DISABLED+')' :''}`).each((index, item) => { + item = $(item); + let val = this.getItem(id, item); + this.handlerLabel(id, dl.find(`dd[lay-value="${val.value}"]`), !item.hasClass(THIS), val, !isOn); + }); + } + + Common.prototype.skin = function(id){ + let skins = ['default' ,'primary', 'normal', 'warm', 'danger']; + let skin = skins[Math.floor(Math.random() * skins.length)]; + $(`dl[xid="${id}"]`).parents(`.${PNAME}`).find(`.${FORM_SELECT}`).attr('xm-select-skin', skin); + this.check(id) && this.commonHandler(id, $(`dl[xid="${id}"]`).parents(`.${PNAME}`).find(`.${LABEL}`)); + } + + Common.prototype.getPosition = function(e){ + let x = 0, y = 0; + while (e != null) { + x += e.offsetLeft; + y += e.offsetTop; + e = e.offsetParent; + } + return { x: x, y: y }; + }; + + Common.prototype.onreset = function(){//监听reset按钮, 然后重置多选 + $(document).on('click', '[type=reset]', (e) => { + $(e.target).parents('form').find(`.${PNAME} dl[xid]`).each((index, item) => { + let id = item.getAttribute('xid'), + dl = $(item), + dd, + temp = {}; + common.removeAll(id); + data[id].config.init.forEach((val, idx) => { + if(val && (!temp[val] || data[id].config.repeat) && (dd = dl.find(`dd[lay-value="${val.value}"]`))[0]){ + common.handlerLabel(id, dd, true); + temp[val] = 1; + } + }); + }) + }); + } + + Common.prototype.bindEvent = function(name, id, fun){ + if(id && id instanceof Function){ + fun = id; + id = null; + } + if(fun && fun instanceof Function){ + if(!id){ + $.each(data, (id, val) => { + data[id] ? (data[id].config[name] = fun) : (events[name][id] = fun) + }) + }else{ + data[id] ? (data[id].config[name] = fun, delete events[name][id]) : (events[name][id] = fun) + } + } + } + + Common.prototype.check = function(id, notAutoRender){ + if($(`dl[xid="${id}"]`).length) { + return true; + }else if($(`select[xm-select="${id}"]`).length){ + if(!notAutoRender){ + this.render(id, $(`select[xm-select="${id}"]`)); + return true; + } + }else{ + delete data[id]; + return false; + } + } + + Common.prototype.render = function(id, select){ + common.init(select); + common.one($(`dl[xid="${id}"]`).parents(`.${PNAME}`)); + common.initVal(id); + } + + Common.prototype.log = function(obj){ + console.log(obj); + } + + let Select4 = function(){ + this.v = v; + this.render(); + }; + let common = new Common(); + + Select4.prototype.value = function(id, type, isAppend){ + if(typeof id != 'string'){ + return []; + } + let fs = data[id]; + if(!common.check(id)){ + return []; + } + if(typeof type == 'string' || type == undefined){ + let arr = fs.values.concat([]) || []; + if(type == 'val') { + return arr.map((val) => { + return val.value; + }); + } + if(type == 'valStr') { + return arr.map((val) => { + return val.value; + }).join(','); + } + if(type == 'name') { + return arr.map((val) => { + return val.name; + }); + } + if(type == 'nameStr') { + return arr.map((val) => { + return val.name; + }).join(','); + } + return arr; + } + if(common.isArray(type)) { + let dl = $(`[xid="${id}"]`), + temp = {}, + dd, + isAdd = true; + if(isAppend == false){//删除传入的数组 + isAdd = false; + }else if(isAppend == true){//追加模式 + isAdd = true; + }else{//删除原有的数据 + common.removeAll(id); + } + if(isAdd){ + fs.values.forEach((val, index) => { + temp[val.value] = 1; + }); + } + type.forEach((val, index) => { + if(val && (!temp[val] || fs.config.repeat)){ + if((dd = dl.find(`dd[lay-value="${val}"]`))[0]){ + common.handlerLabel(id, dd, isAdd, null, true); + temp[val] = 1; + }else{ + let name = common.valToName(id, val); + if(name){ + common.handlerLabel(id, dd, isAdd, common.getItem(id, val), true); + temp[val] = 1; + } + } + } + }); + } + } + + Select4.prototype.on = function(id, fun, isEnd) { + common.bindEvent(isEnd ? 'endOn' : 'on', id, fun); + return this; + } + + Select4.prototype.filter = function(id, fun){ + common.bindEvent('filter', id, fun); + return this; + } + + Select4.prototype.maxTips = function(id, fun){ + common.bindEvent('maxTips', id, fun); + return this; + } + + Select4.prototype.opened = function(id, fun){ + common.bindEvent('opened', id, fun); + return this; + } + + Select4.prototype.closed = function(id, fun){ + common.bindEvent('closed', id, fun); + return this; + } + + Select4.prototype.config = function(id, config, isJson){ + if(id && typeof id == 'object'){ + isJson = config == true; + config = id; + id = null; + } + if(config && typeof config== 'object'){ + if(isJson){ + config.header || (config.header = {}); + config.header['Content-Type'] = 'application/json; charset=UTF-8'; + config.dataType = 'json'; + } + id ? ( + ajaxs[id] = $.extend(true, {}, ajaxs[id] || ajax, config), !common.check(id) && this.render(id), + data[id] && config.direction && (data[id].config.direction = config.direction), + data[id] && config.clearInput && (data[id].config.clearInput = true), + config.searchUrl && data[id] && common.triggerSearch($(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`), true) + ) : ( + $.extend(true, ajax, config), + $.each(ajaxs, (key, item) => { + $.extend(true, item, config) + }) + ); + } + return this; + } + + Select4.prototype.render = function(id, options){ + if(id && typeof id == 'object'){ + options = id; + id = null; + } + let config = options ? { + init: options.init, + disabled: options.disabled, + max: options.max, + isSearch: options.isSearch, + searchUrl: options.searchUrl, + isCreate: options.isCreate, + radio: options.radio, + skin: options.skin, + direction: options.direction, + height: options.height, + formname: options.formname, + layverify: options.layverify, + layverType: options.layverType, + showCount: options.showCount, + placeholder: options.placeholder, + create: options.create, + filter: options.filter, + maxTips: options.maxTips, + on: options.on, + on: options.on, + opened: options.opened, + closed: options.closed, + template: options.template, + clearInput: options.clearInput, + } : {}; + + options && options.searchType != undefined && (config.searchType = options.searchType == 'dl' ? 1 : 0); + + if(id){ + fsConfigs[id] = {}; + $.extend(fsConfigs[id], data[id] ? data[id].config : {}, config); + }else{ + $.extend(fsConfig, config); + } + + ($(`select[${NAME}="${id}"]`)[0] ? $(`select[${NAME}="${id}"]`) : $(`select[${NAME}]`)).each((index, select) => { + let sid = select.getAttribute(NAME); + common.render(sid, select); + setTimeout(() => common.setHidnVal(sid, $(`select[xm-select="${sid}"] + div.${PNAME} .${LABEL}`)), 10); + }); + return this; + } + + Select4.prototype.disabled = function(id){ + let target = {}; + id ? (common.check(id) && (target[id] = data[id])) : (target = data); + + $.each(target, (key, val) => { + $(`dl[xid="${key}"]`).prev().addClass(DIS); + }); + return this; + } + + Select4.prototype.undisabled = function(id){ + let target = {}; + id ? (common.check(id) && (target[id] = data[id])) : (target = data); + + $.each(target, (key, val) => { + $(`dl[xid="${key}"]`).prev().removeClass(DIS); + }); + return this; + } + + Select4.prototype.data = function(id, type, config){ + if(!id || !type || !config){ + common.log(`id: ${id} param error !!!`) + return this; + } + if(!common.check(id)){ + common.log(`id: ${id} not render !!!`) + return this; + } + this.value(id, []); + this.config(id, config); + if(type == 'local'){ + common.renderData(id, config.arr, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100'); + }else if(type == 'server'){ + common.ajax(id, config.url, config.keyword, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100'); + } + return this; + } + + Select4.prototype.btns = function(id, btns, config){ + if(id && common.isArray(id)){ + btns = id; + id = null; + } + if(!btns || !common.isArray(btns)) { + return this; + }; + let target = {}; + id ? (common.check(id) && (target[id] = data[id])) : (target = data); + + btns = btns.map((obj) => { + if(typeof obj == 'string'){ + if(obj == 'select'){ + return quickBtns[0]; + } + if(obj == 'remove'){ + return quickBtns[1]; + } + if(obj == 'reverse'){ + return quickBtns[2]; + } + if(obj == 'skin'){ + return quickBtns[3]; + } + } + return obj; + }); + + $.each(target, (key, val) => { + val.config.btns = btns; + let dd = $(`dl[xid="${key}"]`).find(`.${FORM_SELECT_TIPS}:first`); + if(btns.length){ + let show = config && config.show && (config.show == 'name' || config.show == 'icon') ? config.show : ''; + let html = common.renderBtns(key, show, config && config.space ? config.space : '30px'); + dd.html(html); + }else{ + let pcInput = dd.parents(`.${FORM_SELECT}`).find(`.${TDIV} input`); + let html = pcInput.attr('placeholder') || pcInput.attr('back'); + dd.html(html); + dd.removeAttr('style'); + } + }); + + return this; + } + + Select4.prototype.search = function(id, val){ + if(id && common.check(id)){ + ajaxs[id] = $.extend(true, {}, ajaxs[id] || ajax, { + first: true, + searchVal: val + }); + common.triggerSearch($(`dl[xid="${id}"]`).parents(`.${FORM_SELECT}`), true); + } + return this; + } + + Select4.prototype.replace = function(id, type, config){ + if(!id || !type || !config){ + common.log(`id: ${id} param error !!!`) + return this; + } + if(!common.check(id, true)){ + common.log(`id: ${id} not render !!!`) + return this; + } + let oldVals = this.value(id, 'val'); + this.value(id, []); + this.config(id, config); + if(type == 'local'){ + common.renderData(id, config.arr, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100', false, true); + this.value(id, oldVals, true); + }else if(type == 'server'){ + common.ajax(id, config.url, config.keyword, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100', false, (id) => { + this.value(id, oldVals, true); + }, true); + } + } + + return new Select4(); +}); \ No newline at end of file diff --git a/static/component/pear/module/step.js b/static/component/pear/module/step.js new file mode 100644 index 000000000..4c96d1788 --- /dev/null +++ b/static/component/pear/module/step.js @@ -0,0 +1,80 @@ +layui.define(['layer', 'carousel'], function (exports) { + var $ = layui.jquery; + var layer = layui.layer; + var carousel = layui.carousel; + + var renderDom = function (elem, stepItems, postion) { + var stepDiv = '
                                    '; + for (var i = 0; i < stepItems.length; i++) { + stepDiv += '
                                    '; + if (i < (stepItems.length - 1)) { + if (i < postion) { + stepDiv += '
                                    '; + } else { + stepDiv += '
                                    '; + } + } + var number = stepItems[i].number; + if (!number) { + number = i + 1; + } + if (i == postion) { + stepDiv += '
                                    ' + number + '
                                    '; + } else if (i < postion) { + stepDiv += '
                                    '; + } else { + stepDiv += '
                                    ' + number + '
                                    '; + } + var title = stepItems[i].title; + var desc = stepItems[i].desc; + var time = stepItems[i].time; + if (title || desc || time) { + stepDiv += '
                                    '; + if (title) { + stepDiv += '
                                    ' + title + '
                                    '; + } + if (desc) { + stepDiv += '
                                    ' + desc + '
                                    '; + } + if (time) { + stepDiv += '
                                    ' + time + '
                                    '; + } + stepDiv += '
                                    '; + } + stepDiv += '
                                    '; + } + stepDiv += '
                                    '; + $(elem).prepend(stepDiv); + var bfb = 100 / stepItems.length; + $('.step-item').css('width', bfb + '%'); + }; + + var pearStep = { + render: function (param) { + param.indicator = 'none'; // 不显示指示器 + param.arrow = 'always'; // 始终显示箭头 + param.autoplay = false; // 关闭自动播放 + if (!param.stepWidth) { + param.stepWidth = '400px'; + } + carousel.render(param); + var stepItems = param.stepItems; + renderDom(param.elem, stepItems, 0); + $('.lay-step').css('width', param.stepWidth); + carousel.on('change(' + param.filter + ')', function (obj) { + $(param.elem).find('.lay-step').remove(); + renderDom(param.elem, stepItems, obj.index); + $('.lay-step').css('width', param.stepWidth); + }); + $(param.elem).find('.layui-carousel-arrow').css('display', 'none'); + $(param.elem).css('background-color', 'transparent'); + }, + next: function (elem) { + $(elem).find('.layui-carousel-arrow[lay-type=add]').trigger('click'); + }, + pre: function (elem) { + $(elem).find('.layui-carousel-arrow[lay-type=sub]').trigger('click'); + } + }; + exports('step', pearStep); +}); \ No newline at end of file diff --git a/static/component/pear/module/tab.js b/static/component/pear/module/tab.js new file mode 100644 index 000000000..7573e4063 --- /dev/null +++ b/static/component/pear/module/tab.js @@ -0,0 +1,634 @@ +layui.define(['jquery', 'element'], function(exports) { + "use strict"; + + var MOD_NAME = 'tab', + $ = layui.jquery, + element = layui.element; + + var pearTab = function(opt) { + this.option = opt; + }; + + var tabData = new Array(); + var tabDataCurrent = 0; + + pearTab.prototype.render = function(opt) { + + var option = { + elem: opt.elem, + data: opt.data, + tool: opt.tool, + roll: opt.roll, + index: opt.index, + width: opt.width, + height: opt.height, + tabMax: opt.tabMax, + session: opt.session ? opt.session : false, + closeEvent: opt.closeEvent, + success: opt.success ? opt.success : function(id) {} + } + + if (option.session) { + if (sessionStorage.getItem(option.elem + "-pear-tab-data") != null) { + tabData = JSON.parse(sessionStorage.getItem(option.elem + "-pear-tab-data")); + option.data = JSON.parse(sessionStorage.getItem(option.elem + "-pear-tab-data")); + tabDataCurrent = sessionStorage.getItem(option.elem + "-pear-tab-data-current"); + tabData.forEach(function(item, index) { + if (item.id == tabDataCurrent) { + option.index = index; + } + }) + } else { + tabData = opt.data; + } + } + + var lastIndex; + var tab = createTab(option); + $("#" + option.elem).html(tab); + $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-prev").click(function() { + rollPage("left", option); + }) + $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-next").click(function() { + rollPage("right", option); + }) + element.init(); + toolEvent(option); + $("#" + option.elem).width(opt.width); + $("#" + option.elem).height(opt.height); + $("#" + option.elem).css({ + position: "relative" + }); + closeEvent(option); + + option.success(sessionStorage.getItem(option.elem + "-pear-tab-data-current")); + + $("body .layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title").on("contextmenu", "li", function(e) { + + // 获取当前元素位置 + var top = e.clientY; + var left = e.clientX; + + var currentId = $(this).attr("lay-id"); + + var menu = "
                                    • 关闭当前
                                    • 关闭其他
                                    • 关闭所有
                                    "; + + // 初始化 + layer.open({ + type: 1, + title: false, + shade: false, + skin: 'pear-tab-menu', + closeBtn: false, + area: ['100px', '108px'], + fixed: true, + anim: false, + isOutAnim: false, + offset: [top, left], + content: menu, //iframe的url, + success: function(layero, index) { + layer.close(lastIndex); + lastIndex = index; + menuEvent(option, index); + var timer; + $(layero).on('mouseout', function() { + timer = setTimeout(function() { + layer.close(index); + }, 30) + }); + + $(layero).on('mouseover', function() { + clearTimeout(timer); + }); + + // 清除 item 右击 + $(layero).on('contextmenu', function() { + return false; + }) + + } + }); + return false; + }) + + return new pearTab(option); + } + + pearTab.prototype.click = function(callback) { + var elem = this.option.elem; + var option = this.option; + element.on('tab(' + this.option.elem + ')', function(data) { + var id = $("#" + elem + " .layui-tab-title .layui-this").attr("lay-id"); + sessionStorage.setItem(option.elem + "-pear-tab-data-current", id); + callback(id); + }); + } + + pearTab.prototype.positionTab = function() { + var $tabTitle = $('.layui-tab[lay-filter=' + this.option.elem + '] .layui-tab-title'); + var autoLeft = 0; + $tabTitle.children("li").each(function() { + if ($(this).hasClass('layui-this')) { + return false; + } else { + autoLeft += $(this).outerWidth(); + } + }); + $tabTitle.animate({ + scrollLeft: autoLeft - $tabTitle.width() / 3 + }, 200); + } + + pearTab.prototype.clear = function() { + sessionStorage.removeItem(this.option.elem + "-pear-tab-data"); + sessionStorage.removeItem(this.option.elem + "-pear-tab-data-current"); + } + + pearTab.prototype.addTab = function(opt) { + var title = ''; + if (opt.close) { + title += '' + opt.title + + ''; + } else { + title += '' + opt.title + + ''; + } + element.tabAdd(this.option.elem, { + title: title, + content: '', + id: opt.id + }); + tabData.push(opt); + sessionStorage.setItem(this.option.elem + "-pear-tab-data", JSON.stringify(tabData)); + sessionStorage.setItem(this.option.elem + "-pear-tab-data-current", opt.id); + element.tabChange(this.option.elem, opt.id); + } + + var index = 0; + + // 根据过滤 fliter 标识, 重置选项卡标题 + pearTab.prototype.changeTabTitleById = function(elem, id, title) { + var currentTab = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title [lay-id='" + id + "'] .title"); + currentTab.html(title); + } + + // 根据过滤 filter 标识, 删除指定选项卡 + pearTab.prototype.delTabByElem = function(elem, id, callback) { + var currentTab = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title [lay-id='" + id + "']"); + if (currentTab.find("span").is(".able-close")) { + tabDelete(elem, id, callback); + } + } + + // 根据过滤 filter 标识, 删除其他选项卡 + pearTab.prototype.delOtherTabByElem = function(elem, callback) { + var currentId = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title .layui-this").attr("lay-id"); + var tabtitle = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title li"); + $.each(tabtitle, function(i) { + if ($(this).attr("lay-id") != currentId) { + if ($(this).find("span").is(".able-close")) { + tabDelete(elem, $(this).attr("lay-id"), callback); + } + } + }) + } + + // 根据过滤 filter 标识, 删除全部选项卡 + pearTab.prototype.delAllTabByElem = function(elem, callback) { + var currentId = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title .layui-this").attr("lay-id"); + var tabtitle = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title li"); + $.each(tabtitle, function(i) { + if ($(this).find("span").is(".able-close")) { + tabDelete(elem, $(this).attr("lay-id"), callback); + } + }) + } + + // 根据过滤 filter 标识, 删除当前选项卡 + pearTab.prototype.delCurrentTabByElem = function(elem, callback) { + var currentTab = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title .layui-this"); + if (currentTab.find("span").is(".able-close")) { + var currentId = currentTab.attr("lay-id"); + tabDelete(elem, currentId, callback); + } + } + + // 通过过滤 filter 标识, 新增标签页 + pearTab.prototype.addTabOnlyByElem = function(elem, opt, time) { + var title = ''; + if (opt.close) { + title += '' + opt.title + + '' + } else { + title += '' + opt.title + + '' + } + if ($(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title li[lay-id]").length <= 0) { + + if (time != false && time != 0) { + + var load = '
                                    ' + + '
                                    ' + + '' + + '
                                    ' + + '
                                    ' + $("#" + elem).find(".pear-tab").append(load); + var pearLoad = $("#" + elem).find("#pear-tab-loading" + index); + pearLoad.css({ + display: "block" + }); + setTimeout(function() { + pearLoad.fadeOut(500); + }, time); + index++; + } + element.tabAdd(elem, { + title: title, + content: '', + id: opt.id + }); + tabData.push(opt); + sessionStorage.setItem(elem + "-pear-tab-data", JSON.stringify(tabData)); + } else { + var isData = false; + $.each($(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title li[lay-id]"), function() { + if ($(this).attr("lay-id") == opt.id) { + isData = true; + } + }) + + if (isData == false) { + if (time != false && time != 0) { + var load = '
                                    ' + + '
                                    ' + + '' + + '
                                    ' + + '
                                    ' + + $("#" + elem).find(".pear-tab").append(load); + var pearLoad = $("#" + elem).find("#pear-tab-loading" + index); + pearLoad.css({ + display: "block" + }); + setTimeout(function() { + pearLoad.fadeOut(500); + }, time); + index++; + } + element.tabAdd(elem, { + title: title, + content: '', + id: opt.id + }); + tabData.push(opt); + sessionStorage.setItem(elem + "-pear-tab-data", JSON.stringify(tabData)); + + } + } + sessionStorage.setItem(elem + "-pear-tab-data-current", opt.id); + element.tabChange(elem, opt.id); + } + + /** 添 加 唯 一 选 项 卡 */ + pearTab.prototype.addTabOnly = function(opt, time) { + var title = ''; + if (opt.close) { + title += '' + opt.title + + ''; + } else { + title += '' + opt.title + + ''; + } + if ($(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-title li[lay-id]").length <= 0) { + if (time != false && time != 0) { + var load = '
                                    ' + + '
                                    ' + + '' + + '
                                    ' + + '
                                    '; + $("#" + this.option.elem).find(".pear-tab").append(load); + var pearLoad = $("#" + this.option.elem).find("#pear-tab-loading" + index); + pearLoad.css({ + display: "block" + }); + setTimeout(function() { + pearLoad.fadeOut(500); + }, time); + index++; + } + element.tabAdd(this.option.elem, { + title: title, + content: '', + id: opt.id + }); + tabData.push(opt); + sessionStorage.setItem(this.option.elem + "-pear-tab-data", JSON.stringify(tabData)); + sessionStorage.setItem(this.option.elem + "-pear-tab-data-current", opt.id); + } else { + var isData = false; + $.each($(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-title li[lay-id]"), function() { + if ($(this).attr("lay-id") == opt.id) { + isData = true; + } + }) + if (isData == false) { + + if ($(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-title li[lay-id]").length >= this.option.tabMax) { + layer.msg("最多打开" + this.option.tabMax + "个标签页", { + icon: 2, + time: 1000, + shift: 6 + }); + return false; + } + + if (time != false && time != 0) { + var load = '
                                    ' + + '
                                    ' + + '' + + '
                                    ' + + '
                                    ' + + $("#" + this.option.elem).find(".pear-tab").append(load); + var pearLoad = $("#" + this.option.elem).find("#pear-tab-loading" + index); + pearLoad.css({ + display: "block" + }); + setTimeout(function() { + pearLoad.fadeOut(500); + }, time); + index++; + } + element.tabAdd(this.option.elem, { + title: title, + content: '', + id: opt.id + }); + tabData.push(opt); + sessionStorage.setItem(this.option.elem + "-pear-tab-data", JSON.stringify(tabData)); + sessionStorage.setItem(this.option.elem + "-pear-tab-data-current", opt.id); + } + } + element.tabChange(this.option.elem, opt.id); + sessionStorage.setItem(this.option.elem + "-pear-tab-data-current", opt.id); + } + + // 刷 新 指 定 的 选 项 卡 + pearTab.prototype.refresh = function(time) { + // 刷 新 指 定 的 选 项 卡 + if (time != false && time != 0) { + var load = '
                                    ' + + '
                                    ' + + '' + + '
                                    ' + + '
                                    ' + + var elem = this.option.elem; + $("#" + this.option.elem).find(".pear-tab").append(load); + var pearLoad = $("#" + this.option.elem).find("#pear-tab-loading" + index); + pearLoad.css({ + display: "block" + }); + index++; + setTimeout(function() { + pearLoad.fadeOut(500, function() { + pearLoad.remove(); + }); + }, time); + $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-content .layui-show").find("iframe")[0].contentWindow + .location.reload(true); + } else { + $(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-content .layui-show").find("iframe")[0].contentWindow + .location.reload(true); + } + } + + + function tabDelete(elem, id, callback, option) { + + //根据 elem id 来删除指定的 layui title li + var tabTitle = $(".layui-tab[lay-filter='" + elem + "']").find(".layui-tab-title"); + + // 删除指定 id 的 title + var removeTab = tabTitle.find("li[lay-id='" + id + "']"); + var nextNode = removeTab.next("li"); + if (!removeTab.hasClass("layui-this")) { + removeTab.remove(); + var tabContent = $(".layui-tab[lay-filter='" + elem + "']").find("iframe[id='" + id + "']").parent(); + tabContent.remove(); + + tabData = JSON.parse(sessionStorage.getItem(elem + "-pear-tab-data")); + tabDataCurrent = sessionStorage.getItem(elem + "-pear-tab-data-current"); + tabData = tabData.filter(function(item) { + return item.id != id; + }) + sessionStorage.setItem(elem + "-pear-tab-data", JSON.stringify(tabData)); + return false; + } + + var currId; + if (nextNode.length) { + nextNode.addClass("layui-this"); + currId = nextNode.attr("lay-id"); + $("#" + elem + " [id='" + currId + "']").parent().addClass("layui-show"); + } else { + var prevNode = removeTab.prev("li"); + prevNode.addClass("layui-this"); + currId = prevNode.attr("lay-id"); + $("#" + elem + " [id='" + currId + "']").parent().addClass("layui-show"); + } + callback(currId); + tabData = JSON.parse(sessionStorage.getItem(elem + "-pear-tab-data")); + tabDataCurrent = sessionStorage.getItem(elem + "-pear-tab-data-current"); + tabData = tabData.filter(function(item) { + return item.id != id; + }) + sessionStorage.setItem(elem + "-pear-tab-data", JSON.stringify(tabData)); + sessionStorage.setItem(elem + "-pear-tab-data-current", currId); + + removeTab.remove(); + // 删除 content + var tabContent = $(".layui-tab[lay-filter='" + elem + "']").find("iframe[id='" + id + "']").parent(); + // 删除 + tabContent.remove(); + } + + function createTab(option) { + + var type = ""; + var types = option.type + " "; + if (option.roll == true) { + type = "layui-tab-roll"; + } + if (option.tool != false) { + type = "layui-tab-tool"; + } + if (option.roll == true && option.tool != false) { + type = "layui-tab-rollTool"; + } + var tab = '
                                    '; + var title = '
                                      '; + var content = '
                                      '; + var control = + '
                                      • '; + + // 处 理 选 项 卡 头 部 + var index = 0; + $.each(option.data, function(i, item) { + var TitleItem = ''; + if (option.index == index) { + TitleItem += '
                                      • '; + } else { + TitleItem += '
                                      • '; + } + + if (item.close) { + // 当 前 选 项 卡 可 以 关 闭 + TitleItem += '' + item.title + ''; + } else { + // 当 前 选 项 卡 不 允 许 关 闭 + TitleItem += '' + item.title + ''; + } + TitleItem += '
                                      • '; + title += TitleItem; + if (option.index == index) { + + // 处 理 显 示 内 容 + content += '
                                        ' + } else { + // 处 理 显 示 内 容 + content += '
                                        ' + } + index++; + }); + + title += '
                                      '; + content += '
                                    • '; + control += '
                                      关 闭 当 前
                                      ' + control += '
                                      关 闭 其 他
                                      ' + control += '
                                      关 闭 全 部
                                      ' + control += '
                                    '; + + tab += title; + tab += control; + tab += content; + tab += '
                                    '; + tab += '' + return tab; + } + + function rollPage(d, option) { + var $tabTitle = $('#' + option.elem + ' .layui-tab-title'); + var left = $tabTitle.scrollLeft(); + if ('left' === d) { + $tabTitle.animate({ + scrollLeft: left - 450 + }, 200); + } else { + $tabTitle.animate({ + scrollLeft: left + 450 + }, 200); + } + } + + function closeEvent(option) { + $(".layui-tab[lay-filter='" + option.elem + "']").on("click", ".layui-tab-close", function() { + var layid = $(this).parent().attr("lay-id"); + tabDelete(option.elem, layid, option.closeEvent, option); + }) + } + + function menuEvent(option, index) { + + $("#" + option.elem + "closeThis").click(function() { + var currentTab = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title .layui-this"); + + if (currentTab.find("span").is(".able-close")) { + var currentId = currentTab.attr("lay-id"); + tabDelete(option.elem, currentId, option.closeEvent, option); + } else { + layer.msg("当前页面不允许关闭", { + icon: 3, + time: 800 + }) + } + layer.close(index); + }) + + $("#" + option.elem + "closeOther").click(function() { + var currentId = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title .layui-this").attr("lay-id"); + var tabtitle = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title li"); + $.each(tabtitle, function(i) { + if ($(this).attr("lay-id") != currentId) { + if ($(this).find("span").is(".able-close")) { + tabDelete(option.elem, $(this).attr("lay-id"), option.closeEvent, option); + } + } + }) + layer.close(index); + }) + + $("#" + option.elem + "closeAll").click(function() { + var currentId = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title .layui-this").attr("lay-id"); + var tabtitle = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title li"); + $.each(tabtitle, function(i) { + if ($(this).find("span").is(".able-close")) { + tabDelete(option.elem, $(this).attr("lay-id"), option.closeEvent, option); + } + }) + layer.close(index); + }) + } + + + function toolEvent(option) { + + $("body .layui-tab[lay-filter='" + option.elem + "']").on("click", "#closeThis", function() { + var currentTab = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title .layui-this"); + if (currentTab.find("span").is(".able-close")) { + var currentId = currentTab.attr("lay-id"); + tabDelete(option.elem, currentId, option.closeEvent, option); + } else { + layer.msg("当前页面不允许关闭", { + icon: 3, + time: 800 + }) + } + }) + + $("body .layui-tab[lay-filter='" + option.elem + "']").on("click", "#closeOther", function() { + var currentId = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title .layui-this").attr("lay-id"); + var tabtitle = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title li"); + $.each(tabtitle, function(i) { + if ($(this).attr("lay-id") != currentId) { + if ($(this).find("span").is(".able-close")) { + tabDelete(option.elem, $(this).attr("lay-id"), option.closeEvent, option); + } + } + }) + }) + + $("body .layui-tab[lay-filter='" + option.elem + "']").on("click", "#closeAll", function() { + var currentId = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title .layui-this").attr("lay-id"); + var tabtitle = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title li"); + $.each(tabtitle, function(i) { + if ($(this).find("span").is(".able-close")) { + tabDelete(option.elem, $(this).attr("lay-id"), option.closeEvent, option); + } + }) + }) + } + + exports(MOD_NAME, new pearTab()); +}) diff --git a/static/component/pear/module/tag.js b/static/component/pear/module/tag.js new file mode 100644 index 000000000..efc8638ab --- /dev/null +++ b/static/component/pear/module/tag.js @@ -0,0 +1,162 @@ +layui.define('jquery', function(exports){ + "use strict"; + + var $ = layui.$ + ,MOD_NAME = 'tag', + TAG_CLASS = '.tag', + BUTTON_NEW_TAG ='button-new-tag', + INPUT_NEW_TAG ='input-new-tag', + TAG_ITEM ='tag-item', + CLOSE = 'tag-close', + DEFAULT_SKIN ='layui-btn layui-btn-primary layui-btn-sm' + ,tag = function(){ + this.config = { + likeHref:'../css/module/tag.css', + skin: DEFAULT_SKIN, + tagText:'+ New Tag' + }; + this.configs = {} + }; + + //全局设置 + tag.prototype.set = function(options){ + var that = this; + $.extend(true, that.config, options); + tag.render(); + return that; + }; + + //表单事件监听 + tag.prototype.on = function(events, callback){ + return layui.onevent.call(this, MOD_NAME, events, callback); + }; + + //外部Tag新增 + tag.prototype.add = function(filter, options){ + var tagElem = $(TAG_CLASS + '[lay-filter='+ filter +']') + call.add(null, tagElem, options); + call.tagAuto(filter); + return this; + }; + + //外部Tag删除 + tag.prototype.delete = function(filter, layid){ + var tagElem = $(TAG_CLASS + '[lay-filter='+ filter +']') + ,tagItemElem = tagElem.find('>.' + TAG_ITEM + '[lay-id="'+ layid +'"]'); + call.delete(null, tagItemElem); + return this; + }; + + //基础事件体 + var call = { + //Tag点击 + tagClick: function(e, index, tagItemElem, options){ + options = options || {}; + var othis = tagItemElem || $(this) + ,index = index || othis.index(othis) + ,parents = othis.parents(TAG_CLASS).eq(0) + ,filter = parents.attr('lay-filter'); + layui.event.call(this, MOD_NAME, 'click('+ filter +')', { + elem: parents + ,index: index + }); + } + //Tag新增事件 + ,add: function(e, tagElem, options){ + var filter = tagElem.attr('lay-filter'), + buttonNewTag = tagElem.children('.' + BUTTON_NEW_TAG), + index = buttonNewTag.index() + ,newTag = ''; + var result = layui.event.call(this, MOD_NAME, 'add('+ filter +')', { + elem: tagElem + ,index: index + ,othis: newTag + }) + if(result === false) return; + buttonNewTag[0] ? buttonNewTag.before(newTag) : tagElem.append(newTag); + } + //Tag输入事件 + ,input: function(e, othis){ + var buttonNewTag = othis || $(this) + ,parents = buttonNewTag.parents(TAG_CLASS).eq(0) + ,filter = parents.attr('lay-filter') + var options = tag.configs[filter] = $.extend({}, tag.config, tag.configs[filter] || {}, options); + //标签输入框 + var inpatNewTag = $('
                                    '); + inpatNewTag.addClass(options.skin); + buttonNewTag.after(inpatNewTag).remove(); + inpatNewTag.children('.layui-input').on('blur', function () { + if(this.value){ + var options = { + text: this.value + } + call.add(null, parents, options); + } + inpatNewTag.remove(); + call.tagAuto(filter); + }).focus(); + } + //Tag删除 + ,delete: function(e, othis){ + var tagItem = othis || $(this).parent(), index = tagItem.index() + ,parents = tagItem.parents(TAG_CLASS).eq(0) + ,filter = parents.attr('lay-filter'); + + var result = layui.event.call(this, MOD_NAME, 'delete('+ filter +')', { + elem: parents + ,index: index + }) + if(result === false) return; + tagItem.remove() + } + //Tag 自适应 + ,tagAuto: function(filter){ + filter = filter || ''; + var options = filter ? tag.configs[filter] || tag.config : tag.config; + var elemFilter = function(){ + return filter ? ('[lay-filter="' + filter +'"]') : ''; + }(); + $(TAG_CLASS + elemFilter).each(function(){ + var othis = $(this),tagItem = othis.children('.' + TAG_ITEM), buttonNewTag = othis.children('.' + BUTTON_NEW_TAG); + tagItem.removeClass(DEFAULT_SKIN).addClass(options.skin); + //允许关闭 + if(othis.attr('lay-allowClose') && tagItem.length){ + tagItem.each(function(){ + var li = $(this); + if(!li.find('.'+CLOSE)[0]){ + var close = $(''); + close.on('click', call.delete); + li.append(close); + } + }); + } + //允许新增标签 + if(othis.attr('lay-newTag') && buttonNewTag.length === 0){ + buttonNewTag = $(''); + buttonNewTag.on('click', call.input); + othis.append(buttonNewTag); + } + buttonNewTag.html(options.tagText); + buttonNewTag.removeClass(DEFAULT_SKIN).addClass(options.skin); + }); + } + }; + + //初始化元素操作 + tag.prototype.init = function(filter, options){ + layui.addcss(tag.config.likeHref); + if(filter){ + tag.configs[filter] = $.extend({}, tag.config, tag.configs[filter] || {}, options); + } + return call.tagAuto.call(this, filter); + }; + + tag.prototype.render = tag.prototype.init; + + var tag = new tag(), dom = $(document); + tag.render(); + + dom.on('click', '.' + TAG_ITEM, call.tagClick); //tag 单击事件 + exports(MOD_NAME, tag); +}); + diff --git a/static/component/pear/module/theme.js b/static/component/pear/module/theme.js new file mode 100644 index 000000000..e364a6b92 --- /dev/null +++ b/static/component/pear/module/theme.js @@ -0,0 +1,94 @@ +layui.define(["jquery","layer"], function (exports) { + var MOD_NAME = 'theme', + $ = layui.jquery; + + var theme = {}; + theme.autoHead = false; + + theme.changeTheme = function (target, autoHead) { + this.autoHead = autoHead; + const color = localStorage.getItem("theme-color-color"); + const second = localStorage.getItem("theme-color-second"); + this.colorSet(color, second); + if (target.frames.length == 0) return; + for (var i = 0; i < target.frames.length; i++) { + try { + if(target.frames[i].layui == undefined) continue; + target.frames[i].layui.theme.changeTheme(target.frames[i], autoHead); + } + catch (error) { + console.log(error); + } + } + } + + theme.colorSet = function(color, second) { + + let style = ''; + style += '.light-theme .pear-nav-tree .layui-this a:hover,.light-theme .pear-nav-tree .layui-this,.light-theme .pear-nav-tree .layui-this a,.pear-nav-tree .layui-this a,.pear-nav-tree .layui-this{background-color: ' +color + '!important;}'; + style += '.pear-admin .layui-logo .title{color:' + color + '!important;}'; + style += '.pear-frame-title .dot,.pear-tab .layui-this .pear-tab-active{background-color: ' + color +'!important;}'; + style += '.bottom-nav li a:hover{background-color:' + color + '!important;}'; + style += '.pear-admin .layui-header .layui-nav .layui-nav-bar{background-color: ' + color + '!important;}' + style += '.ball-loader>span,.signal-loader>span {background-color: ' + color + '!important;}'; + style += '.layui-header .layui-nav-child .layui-this a{background-color:' + color +'!important;color:white!important;}'; + style += '#preloader{background-color:' + color + '!important;}'; + style += '.pearone-color .color-content li.layui-this:after, .pearone-color .color-content li:hover:after {border: ' +color + ' 3px solid!important;}'; + style += '.layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this{background-color:' + color + ';color:white;}'; + style += '.pear-social-entrance {background-color:' + color + '!important}'; + style += '.pear-admin .pe-collaspe {background-color:' + color + '!important}'; + style += '.layui-fixbar li {background-color:' + color + '!important}'; + style += '.pear-btn-primary {background-color:' + color + '!important}'; + style += '.layui-input:focus,.layui-textarea:focus {border-color: '+ color +'!important;box-shadow: 0 0 0 3px '+ second +' !important;}' + style += '.layui-form-checked[lay-skin=primary] i {border-color: '+ color +'!important;background-color: ' + color + ';}' + style += '.layui-form-onswitch { border-color: ' + color + '; background-color: '+color+';}' + style += '.layui-form-radio>i:hover, .layui-form-radioed>i {color: ' + color + ';}' + style += '.layui-laypage .layui-laypage-curr .layui-laypage-em{background-color:'+ color +'!important}' + style += '.layui-tab-brief>.layui-tab-more li.layui-this:after, .layui-tab-brief>.layui-tab-title .layui-this:after{border-bottom: 3px solid '+color+'!important}' + style += '.layui-tab-brief>.layui-tab-title .layui-this{color:'+color+'!important}' + style += '.layui-progress-bar{background-color:'+color+'}'; + style += '.layui-elem-quote{border-left: 5px solid '+ color +'}'; + style += '.layui-timeline-axis{color:' + color + '}'; + style += '.layui-laydate .layui-this{background-color:'+color+'!important}'; + style += '.pear-this,.pear-text{color:' + color + '!important}'; + style += '.pear-back{background-color:'+ color +'!important}'; + style += '.pear-collasped-pe{background-color:'+color+'!important}' + style += '.layui-form-select dl dd.layui-this{color:'+color+'!important;}' + style += '.tag-item-normal{background:'+color+'!important}'; + style += '.step-item-head.step-item-head-active{background-color:'+color+'}' + style += '.step-item-head{border: 3px solid '+color+';}' + style += '.step-item-tail i{background-color:'+color+'}' + style += '.step-item-head{color:' + color + '}' + style += 'div[xm-select-skin=normal] .xm-select-title div.xm-select-label>span i {background-color:'+color+'!important}' + style += 'div[xm-select-skin=normal] .xm-select-title div.xm-select-label>span{border: 1px solid '+color+'!important;background-color:'+color+'!important}' + style += 'div[xm-select-skin=normal] dl dd:not(.xm-dis-disabled) i{border-color:'+color+'!important}' + style += 'div[xm-select-skin=normal] dl dd.xm-select-this:not(.xm-dis-disabled) i{color:'+color+'!important}' + style += 'div[xm-select-skin=normal].xm-form-selected .xm-select, div[xm-select-skin=normal].xm-form-selected .xm-select:hover{border-color:'+color+'!important}' + style += '.layui-layer-btn a:first-child{border-color:'+color+';background-color:'+color+'!important}'; + style += '.layui-form-checkbox[lay-skin=primary]:hover i{border-color:'+color+'!important}' + style += '.pear-tab-menu .item:hover{background-color:'+color+'!important}' + style += '.layui-form-danger:focus {border-color:#FF5722 !important}' + style += '.pear-admin .user .layui-this a:hover{color:white!important}' + style += '.pear-notice .layui-this{color:'+color+'!important}' + style += '.layui-form-radio:hover *, .layui-form-radioed, .layui-form-radioed>i{color:' + color + ' !important}'; + style += '.pear-btn:hover {color: '+color+';background-color: ' + second + ';}' + style += '.pear-btn-primary[plain] {color: '+ color +' !important;background: ' + second + ' !important;}' + style += '.pear-btn-primary[plain]:hover {background-color: ' + color + '!important}' + style += '.light-theme .pear-nav-tree .layui-this a:hover,.light-theme .pear-nav-tree .layui-this,.light-theme .pear-nav-tree .layui-this a {background-color:'+second+'!important;color:'+color+'!important;}' + style += '.light-theme .pear-nav-tree .layui-this{ border-right: 3px solid '+color+'!important}' + style += '.loader:after {background:'+color+'}' + if(this.autoHead === true || this.autoHead === "true"){ + style += '.pear-admin.banner-layout .layui-header .layui-logo,.pear-admin .layui-header{border:none;background-color:' + color + '!important;}.pear-admin.banner-layout .layui-header .layui-logo .title,.pear-admin .layui-header .layui-nav .layui-nav-item>a{color:whitesmoke!important;}'; + style += '.pear-admin.banner-layout .layui-header{ box-shadow: 2px 0 6px rgb(0 21 41 / 35%) }' + style += '.pear-admin .layui-header .layui-layout-control .layui-this *,.pear-admin.banner-layout .layui-header .layui-layout-control .layui-this *{ background-color: rgba(0,0,0,.1)!important;}' + } + var colorPane = $("#pear-admin-color"); + if(colorPane.length>0){ + colorPane.html(style); + }else{ + $("head").append("") + } + } + + exports(MOD_NAME, theme); +}); \ No newline at end of file diff --git a/static/component/pear/module/toast.js b/static/component/pear/module/toast.js new file mode 100644 index 000000000..57c8ca5c7 --- /dev/null +++ b/static/component/pear/module/toast.js @@ -0,0 +1,1225 @@ +(function (root, factory) { + if(typeof define === 'function' && define.amd) { + define([], factory(root)); + } else if(typeof exports === 'object') { + module.exports = factory(root); + } else if (window.layui && layui.define) { + layui.define(function(exports){ + exports('toast',factory(root)) + }) + }else { + root.iziToast = factory(root); + } +})(typeof global !== 'undefined' ? global : window || this.window || this.global, function (root) { + + 'use strict'; + + var $iziToast = {}, + PLUGIN_NAME = 'iziToast', + BODY = document.querySelector('body'), + ISMOBILE = (/Mobi/.test(navigator.userAgent)) ? true : false, + ISCHROME = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor), + ISFIREFOX = typeof InstallTrigger !== 'undefined', + ACCEPTSTOUCH = 'ontouchstart' in document.documentElement, + POSITIONS = ['bottomRight','bottomLeft','bottomCenter','topRight','topLeft','topCenter','center'], + THEMES = { + info: { + color: 'blue', + icon: 'ico-info' + }, + success: { + color: 'green', + icon: 'ico-success' + }, + warning: { + color: 'orange', + icon: 'ico-warning' + }, + error: { + color: 'red', + icon: 'ico-error' + }, + question: { + color: 'yellow', + icon: 'ico-question' + } + }, + MOBILEWIDTH = 568, + CONFIG = {}; + + $iziToast.children = {}; + + // Default settings + var defaults = { + id: null, + class: '', + title: '', + titleColor: '', + titleSize: '', + titleLineHeight: '', + message: '', + messageColor: '', + messageSize: '', + messageLineHeight: '', + backgroundColor: '', + theme: 'light', // dark + color: '', // blue, red, green, yellow + icon: '', + iconText: '', + iconColor: '', + iconUrl: null, + image: '', + imageWidth: 50, + maxWidth: null, + zindex: null, + layout: 2, + balloon: false, + close: true, + closeOnEscape: false, + closeOnClick: false, + displayMode: 0, + position: 'topCenter', // bottomRight, bottomLeft, topRight, topLeft, topCenter, bottomCenter, center + target: '', + targetFirst: true, + timeout: 3000, // 默认3秒 + rtl: false, + animateInside: false, // 动画效果 + drag: true, + pauseOnHover: true, + resetOnHover: false, + progressBar: false, + progressBarColor: '', + progressBarEasing: 'linear', + overlay: false, + overlayClose: false, + overlayColor: 'rgba(0, 0, 0, 0.6)', + transitionIn: 'fadeInDown', // bounceInLeft, bounceInRight, bounceInUp, bounceInDown, fadeIn, fadeInDown, fadeInUp, fadeInLeft, fadeInRight, flipInX + transitionOut: 'fadeOut', // fadeOut, fadeOutUp, fadeOutDown, fadeOutLeft, fadeOutRight, flipOutX + transitionInMobile: 'bounceInDown', + transitionOutMobile: 'fadeOutUp', + buttons: {}, + inputs: {}, + onOpening: function () {}, + onOpened: function () {}, + onClosing: function () {}, + onClosed: function () {} + }; + + if(!('remove' in Element.prototype)) { + Element.prototype.remove = function() { + if(this.parentNode) { + this.parentNode.removeChild(this); + } + }; + } + + if(typeof window.CustomEvent !== 'function') { + var CustomEventPolyfill = function (event, params) { + params = params || { bubbles: false, cancelable: false, detail: undefined }; + var evt = document.createEvent('CustomEvent'); + evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); + return evt; + }; + + CustomEventPolyfill.prototype = window.Event.prototype; + + window.CustomEvent = CustomEventPolyfill; + } + + var forEach = function (collection, callback, scope) { + if(Object.prototype.toString.call(collection) === '[object Object]') { + for (var prop in collection) { + if(Object.prototype.hasOwnProperty.call(collection, prop)) { + callback.call(scope, collection[prop], prop, collection); + } + } + } else { + if(collection){ + for (var i = 0, len = collection.length; i < len; i++) { + callback.call(scope, collection[i], i, collection); + } + } + } + }; + + var extend = function (defaults, options) { + var extended = {}; + forEach(defaults, function (value, prop) { + extended[prop] = defaults[prop]; + }); + forEach(options, function (value, prop) { + extended[prop] = options[prop]; + }); + return extended; + }; + + var createFragElem = function(htmlStr) { + var frag = document.createDocumentFragment(), + temp = document.createElement('div'); + temp.innerHTML = htmlStr; + while (temp.firstChild) { + frag.appendChild(temp.firstChild); + } + return frag; + }; + + var generateId = function(params) { + var newId = btoa(encodeURIComponent(params)); + return newId.replace(/=/g, ""); + }; + + var isColor = function(color){ + if( color.substring(0,1) == '#' || color.substring(0,3) == 'rgb' || color.substring(0,3) == 'hsl' ){ + return true; + } else { + return false; + } + }; + + var isBase64 = function(str) { + try { + return btoa(atob(str)) == str; + } catch (err) { + return false; + } + }; + + var drag = function() { + + return { + move: function(toast, instance, settings, xpos) { + + var opacity, + opacityRange = 0.3, + distance = 180; + + if(xpos !== 0){ + + toast.classList.add(PLUGIN_NAME+'-dragged'); + + toast.style.transform = 'translateX('+xpos + 'px)'; + + if(xpos > 0){ + opacity = (distance-xpos) / distance; + if(opacity < opacityRange){ + instance.hide(extend(settings, { transitionOut: 'fadeOutRight', transitionOutMobile: 'fadeOutRight' }), toast, 'drag'); + } + } else { + opacity = (distance+xpos) / distance; + if(opacity < opacityRange){ + instance.hide(extend(settings, { transitionOut: 'fadeOutLeft', transitionOutMobile: 'fadeOutLeft' }), toast, 'drag'); + } + } + toast.style.opacity = opacity; + + if(opacity < opacityRange){ + + if(ISCHROME || ISFIREFOX) + toast.style.left = xpos+'px'; + + toast.parentNode.style.opacity = opacityRange; + + this.stopMoving(toast, null); + } + } + + + }, + startMoving: function(toast, instance, settings, e) { + + e = e || window.event; + var posX = ((ACCEPTSTOUCH) ? e.touches[0].clientX : e.clientX), + toastLeft = toast.style.transform.replace('px)', ''); + toastLeft = toastLeft.replace('translateX(', ''); + var offsetX = posX - toastLeft; + + if(settings.transitionIn){ + toast.classList.remove(settings.transitionIn); + } + if(settings.transitionInMobile){ + toast.classList.remove(settings.transitionInMobile); + } + toast.style.transition = ''; + + if(ACCEPTSTOUCH) { + document.ontouchmove = function(e) { + e.preventDefault(); + e = e || window.event; + var posX = e.touches[0].clientX, + finalX = posX - offsetX; + drag.move(toast, instance, settings, finalX); + }; + } else { + document.onmousemove = function(e) { + e.preventDefault(); + e = e || window.event; + var posX = e.clientX, + finalX = posX - offsetX; + drag.move(toast, instance, settings, finalX); + }; + } + + }, + stopMoving: function(toast, e) { + + if(ACCEPTSTOUCH) { + document.ontouchmove = function() {}; + } else { + document.onmousemove = function() {}; + } + + toast.style.opacity = ''; + toast.style.transform = ''; + + if(toast.classList.contains(PLUGIN_NAME+'-dragged')){ + + toast.classList.remove(PLUGIN_NAME+'-dragged'); + + toast.style.transition = 'transform 0.4s ease, opacity 0.4s ease'; + setTimeout(function() { + toast.style.transition = ''; + }, 400); + } + + } + }; + + }(); + + $iziToast.setSetting = function (ref, option, value) { + + $iziToast.children[ref][option] = value; + + }; + + $iziToast.getSetting = function (ref, option) { + + return $iziToast.children[ref][option]; + + }; + + $iziToast.destroy = function () { + + forEach(document.querySelectorAll('.'+PLUGIN_NAME+'-overlay'), function(element, index) { + element.remove(); + }); + + forEach(document.querySelectorAll('.'+PLUGIN_NAME+'-wrapper'), function(element, index) { + element.remove(); + }); + + forEach(document.querySelectorAll('.'+PLUGIN_NAME), function(element, index) { + element.remove(); + }); + + this.children = {}; + + // Remove event listeners + document.removeEventListener(PLUGIN_NAME+'-opened', {}, false); + document.removeEventListener(PLUGIN_NAME+'-opening', {}, false); + document.removeEventListener(PLUGIN_NAME+'-closing', {}, false); + document.removeEventListener(PLUGIN_NAME+'-closed', {}, false); + document.removeEventListener('keyup', {}, false); + + // Reset variables + CONFIG = {}; + }; + + /** + * Initialize Plugin + * @public + * @param {Object} options User settings + */ + $iziToast.settings = function (options) { + + // Destroy any existing initializations + $iziToast.destroy(); + + CONFIG = options; + defaults = extend(defaults, options || {}); + }; + + + /** + * Building themes functions. + * @public + * @param {Object} options User settings + */ + forEach(THEMES, function (theme, name) { + + $iziToast[name] = function (options) { + + var settings = extend(CONFIG, options || {}); + settings = extend(theme, settings || {}); + + this.show(settings); + }; + + }); + + + /** + * Do the calculation to move the progress bar + * @private + */ + $iziToast.progress = function (options, $toast, callback) { + + + var that = this, + ref = $toast.getAttribute('data-iziToast-ref'), + settings = extend(this.children[ref], options || {}), + $elem = $toast.querySelector('.'+PLUGIN_NAME+'-progressbar div'); + + return { + start: function() { + + if(typeof settings.time.REMAINING == 'undefined'){ + + $toast.classList.remove(PLUGIN_NAME+'-reseted'); + + if($elem !== null){ + $elem.style.transition = 'width '+ settings.timeout +'ms '+settings.progressBarEasing; + $elem.style.width = '0%'; + } + + settings.time.START = new Date().getTime(); + settings.time.END = settings.time.START + settings.timeout; + settings.time.TIMER = setTimeout(function() { + + clearTimeout(settings.time.TIMER); + + if(!$toast.classList.contains(PLUGIN_NAME+'-closing')){ + + that.hide(settings, $toast, 'timeout'); + + if(typeof callback === 'function'){ + callback.apply(that); + } + } + + }, settings.timeout); + that.setSetting(ref, 'time', settings.time); + } + }, + pause: function() { + + if(typeof settings.time.START !== 'undefined' && !$toast.classList.contains(PLUGIN_NAME+'-paused') && !$toast.classList.contains(PLUGIN_NAME+'-reseted')){ + + $toast.classList.add(PLUGIN_NAME+'-paused'); + + settings.time.REMAINING = settings.time.END - new Date().getTime(); + + clearTimeout(settings.time.TIMER); + + that.setSetting(ref, 'time', settings.time); + + if($elem !== null){ + var computedStyle = window.getComputedStyle($elem), + propertyWidth = computedStyle.getPropertyValue('width'); + + $elem.style.transition = 'none'; + $elem.style.width = propertyWidth; + } + + if(typeof callback === 'function'){ + setTimeout(function() { + callback.apply(that); + }, 10); + } + } + }, + resume: function() { + + if(typeof settings.time.REMAINING !== 'undefined'){ + + $toast.classList.remove(PLUGIN_NAME+'-paused'); + + if($elem !== null){ + $elem.style.transition = 'width '+ settings.time.REMAINING +'ms '+settings.progressBarEasing; + $elem.style.width = '0%'; + } + + settings.time.END = new Date().getTime() + settings.time.REMAINING; + settings.time.TIMER = setTimeout(function() { + + clearTimeout(settings.time.TIMER); + + if(!$toast.classList.contains(PLUGIN_NAME+'-closing')){ + + that.hide(settings, $toast, 'timeout'); + + if(typeof callback === 'function'){ + callback.apply(that); + } + } + + + }, settings.time.REMAINING); + + that.setSetting(ref, 'time', settings.time); + } else { + this.start(); + } + }, + reset: function(){ + + clearTimeout(settings.time.TIMER); + + delete settings.time.REMAINING; + + that.setSetting(ref, 'time', settings.time); + + $toast.classList.add(PLUGIN_NAME+'-reseted'); + + $toast.classList.remove(PLUGIN_NAME+'-paused'); + + if($elem !== null){ + $elem.style.transition = 'none'; + $elem.style.width = '100%'; + } + + if(typeof callback === 'function'){ + setTimeout(function() { + callback.apply(that); + }, 10); + } + } + }; + + }; + + + /** + * Close the specific Toast + * @public + * @param {Object} options User settings + */ + $iziToast.hide = function (options, $toast, closedBy) { + + if(typeof $toast != 'object'){ + $toast = document.querySelector($toast); + } + + var that = this, + settings = extend(this.children[$toast.getAttribute('data-iziToast-ref')], options || {}); + settings.closedBy = closedBy || null; + + delete settings.time.REMAINING; + + $toast.classList.add(PLUGIN_NAME+'-closing'); + + // Overlay + (function(){ + + var $overlay = document.querySelector('.'+PLUGIN_NAME+'-overlay'); + if($overlay !== null){ + var refs = $overlay.getAttribute('data-iziToast-ref'); + refs = refs.split(','); + var index = refs.indexOf(String(settings.ref)); + + if(index !== -1){ + refs.splice(index, 1); + } + $overlay.setAttribute('data-iziToast-ref', refs.join()); + + if(refs.length === 0){ + $overlay.classList.remove('fadeIn'); + $overlay.classList.add('fadeOut'); + setTimeout(function() { + $overlay.remove(); + }, 700); + } + } + + })(); + + if(settings.transitionIn){ + $toast.classList.remove(settings.transitionIn); + } + + if(settings.transitionInMobile){ + $toast.classList.remove(settings.transitionInMobile); + } + + if(ISMOBILE || window.innerWidth <= MOBILEWIDTH){ + if(settings.transitionOutMobile) + $toast.classList.add(settings.transitionOutMobile); + } else { + if(settings.transitionOut) + $toast.classList.add(settings.transitionOut); + } + var H = $toast.parentNode.offsetHeight; + $toast.parentNode.style.height = H+'px'; + $toast.style.pointerEvents = 'none'; + + if(!ISMOBILE || window.innerWidth > MOBILEWIDTH){ + $toast.parentNode.style.transitionDelay = '0.2s'; + } + + try { + var event = new CustomEvent(PLUGIN_NAME+'-closing', {detail: settings, bubbles: true, cancelable: true}); + document.dispatchEvent(event); + } catch(ex){ + console.warn(ex); + } + + setTimeout(function() { + + $toast.parentNode.style.height = '0px'; + $toast.parentNode.style.overflow = ''; + + setTimeout(function(){ + + delete that.children[settings.ref]; + + $toast.parentNode.remove(); + + try { + var event = new CustomEvent(PLUGIN_NAME+'-closed', {detail: settings, bubbles: true, cancelable: true}); + document.dispatchEvent(event); + } catch(ex){ + console.warn(ex); + } + + if(typeof settings.onClosed !== 'undefined'){ + settings.onClosed.apply(null, [settings, $toast, closedBy]); + } + + }, 1000); + }, 200); + + + if(typeof settings.onClosing !== 'undefined'){ + settings.onClosing.apply(null, [settings, $toast, closedBy]); + } + }; + + /** + * Create and show the Toast + * @public + * @param {Object} options User settings + */ + $iziToast.show = function (options) { + + var that = this; + + // Merge user options with defaults + var settings = extend(CONFIG, options || {}); + settings = extend(defaults, settings); + settings.time = {}; + + if(settings.id === null){ + settings.id = generateId(settings.title+settings.message+settings.color); + } + + if(settings.displayMode === 1 || settings.displayMode == 'once'){ + try { + if(document.querySelectorAll('.'+PLUGIN_NAME+'#'+settings.id).length > 0){ + return false; + } + } catch (exc) { + console.warn('['+PLUGIN_NAME+'] Could not find an element with this selector: '+'#'+settings.id+'. Try to set an valid id.'); + } + } + + if(settings.displayMode === 2 || settings.displayMode == 'replace'){ + try { + forEach(document.querySelectorAll('.'+PLUGIN_NAME+'#'+settings.id), function(element, index) { + that.hide(settings, element, 'replaced'); + }); + } catch (exc) { + console.warn('['+PLUGIN_NAME+'] Could not find an element with this selector: '+'#'+settings.id+'. Try to set an valid id.'); + } + } + + settings.ref = new Date().getTime() + Math.floor((Math.random() * 10000000) + 1); + + $iziToast.children[settings.ref] = settings; + + var $DOM = { + body: document.querySelector('body'), + overlay: document.createElement('div'), + toast: document.createElement('div'), + toastBody: document.createElement('div'), + toastTexts: document.createElement('div'), + toastCapsule: document.createElement('div'), + cover: document.createElement('div'), + buttons: document.createElement('div'), + inputs: document.createElement('div'), + icon: !settings.iconUrl ? document.createElement('i') : document.createElement('img'), + wrapper: null + }; + + $DOM.toast.setAttribute('data-iziToast-ref', settings.ref); + $DOM.toast.appendChild($DOM.toastBody); + $DOM.toastCapsule.appendChild($DOM.toast); + + // CSS Settings + (function(){ + + $DOM.toast.classList.add(PLUGIN_NAME); + $DOM.toast.classList.add(PLUGIN_NAME+'-opening'); + $DOM.toastCapsule.classList.add(PLUGIN_NAME+'-capsule'); + $DOM.toastBody.classList.add(PLUGIN_NAME + '-body'); + $DOM.toastTexts.classList.add(PLUGIN_NAME + '-texts'); + + if(ISMOBILE || window.innerWidth <= MOBILEWIDTH){ + if(settings.transitionInMobile) + $DOM.toast.classList.add(settings.transitionInMobile); + } else { + if(settings.transitionIn) + $DOM.toast.classList.add(settings.transitionIn); + } + + if(settings.class){ + var classes = settings.class.split(' '); + forEach(classes, function (value, index) { + $DOM.toast.classList.add(value); + }); + } + + if(settings.id){ $DOM.toast.id = settings.id; } + + if(settings.rtl){ + $DOM.toast.classList.add(PLUGIN_NAME + '-rtl'); + $DOM.toast.setAttribute('dir', 'rtl'); + } + + if(settings.layout > 1){ $DOM.toast.classList.add(PLUGIN_NAME+'-layout'+settings.layout); } + + if(settings.balloon){ $DOM.toast.classList.add(PLUGIN_NAME+'-balloon'); } + + if(settings.maxWidth){ + if( !isNaN(settings.maxWidth) ){ + $DOM.toast.style.maxWidth = settings.maxWidth+'px'; + } else { + $DOM.toast.style.maxWidth = settings.maxWidth; + } + } + + if(settings.theme !== '' || settings.theme !== 'light') { + + $DOM.toast.classList.add(PLUGIN_NAME+'-theme-'+settings.theme); + } + + if(settings.color) { //#, rgb, rgba, hsl + + if( isColor(settings.color) ){ + $DOM.toast.style.background = settings.color; + } else { + $DOM.toast.classList.add(PLUGIN_NAME+'-color-'+settings.color); + } + } + + if(settings.backgroundColor) { + $DOM.toast.style.background = settings.backgroundColor; + if(settings.balloon){ + $DOM.toast.style.borderColor = settings.backgroundColor; + } + } + })(); + + // Cover image + (function(){ + if(settings.image) { + $DOM.cover.classList.add(PLUGIN_NAME + '-cover'); + $DOM.cover.style.width = settings.imageWidth + 'px'; + + if(isBase64(settings.image.replace(/ /g,''))){ + $DOM.cover.style.backgroundImage = 'url(data:image/png;base64,' + settings.image.replace(/ /g,'') + ')'; + } else { + $DOM.cover.style.backgroundImage = 'url(' + settings.image + ')'; + } + + if(settings.rtl){ + $DOM.toastBody.style.marginRight = (settings.imageWidth + 10) + 'px'; + } else { + $DOM.toastBody.style.marginLeft = (settings.imageWidth + 10) + 'px'; + } + $DOM.toast.appendChild($DOM.cover); + } + })(); + + // Button close + (function(){ + if(settings.close){ + + $DOM.buttonClose = document.createElement('button'); + $DOM.buttonClose.type = 'button'; + $DOM.buttonClose.classList.add(PLUGIN_NAME + '-close'); + $DOM.buttonClose.addEventListener('click', function (e) { + var button = e.target; + that.hide(settings, $DOM.toast, 'button'); + }); + $DOM.toast.appendChild($DOM.buttonClose); + } else { + if(settings.rtl){ + $DOM.toast.style.paddingLeft = '18px'; + } else { + $DOM.toast.style.paddingRight = '18px'; + } + } + })(); + + // Progress Bar & Timeout + (function(){ + + if(settings.progressBar){ + $DOM.progressBar = document.createElement('div'); + $DOM.progressBarDiv = document.createElement('div'); + $DOM.progressBar.classList.add(PLUGIN_NAME + '-progressbar'); + $DOM.progressBarDiv.style.background = settings.progressBarColor; + $DOM.progressBar.appendChild($DOM.progressBarDiv); + $DOM.toast.appendChild($DOM.progressBar); + } + + if(settings.timeout) { + + if(settings.pauseOnHover && !settings.resetOnHover){ + + $DOM.toast.addEventListener('mouseenter', function (e) { + that.progress(settings, $DOM.toast).pause(); + }); + $DOM.toast.addEventListener('mouseleave', function (e) { + that.progress(settings, $DOM.toast).resume(); + }); + } + + if(settings.resetOnHover){ + + $DOM.toast.addEventListener('mouseenter', function (e) { + that.progress(settings, $DOM.toast).reset(); + }); + $DOM.toast.addEventListener('mouseleave', function (e) { + that.progress(settings, $DOM.toast).start(); + }); + } + } + })(); + + // Icon + (function(){ + + if(settings.iconUrl) { + + $DOM.icon.setAttribute('class', PLUGIN_NAME + '-icon'); + $DOM.icon.setAttribute('src', settings.iconUrl); + + } else if(settings.icon) { + $DOM.icon.setAttribute('class', PLUGIN_NAME + '-icon ' + settings.icon); + + if(settings.iconText){ + $DOM.icon.appendChild(document.createTextNode(settings.iconText)); + } + + if(settings.iconColor){ + $DOM.icon.style.color = settings.iconColor; + } + } + + if(settings.icon || settings.iconUrl) { + + if(settings.rtl){ + $DOM.toastBody.style.paddingRight = '33px'; + } else { + $DOM.toastBody.style.paddingLeft = '33px'; + } + + $DOM.toastBody.appendChild($DOM.icon); + } + + })(); + + // Title & Message + (function(){ + if(settings.title.length > 0) { + + $DOM.strong = document.createElement('strong'); + $DOM.strong.classList.add(PLUGIN_NAME + '-title'); + $DOM.strong.appendChild(createFragElem(settings.title)); + $DOM.toastTexts.appendChild($DOM.strong); + + if(settings.titleColor) { + $DOM.strong.style.color = settings.titleColor; + } + if(settings.titleSize) { + if( !isNaN(settings.titleSize) ){ + $DOM.strong.style.fontSize = settings.titleSize+'px'; + } else { + $DOM.strong.style.fontSize = settings.titleSize; + } + } + if(settings.titleLineHeight) { + if( !isNaN(settings.titleSize) ){ + $DOM.strong.style.lineHeight = settings.titleLineHeight+'px'; + } else { + $DOM.strong.style.lineHeight = settings.titleLineHeight; + } + } + } + + if(settings.message.length > 0) { + + $DOM.p = document.createElement('p'); + $DOM.p.classList.add(PLUGIN_NAME + '-message'); + $DOM.p.appendChild(createFragElem(settings.message)); + $DOM.toastTexts.appendChild($DOM.p); + + if(settings.messageColor) { + $DOM.p.style.color = settings.messageColor; + } + if(settings.messageSize) { + if( !isNaN(settings.titleSize) ){ + $DOM.p.style.fontSize = settings.messageSize+'px'; + } else { + $DOM.p.style.fontSize = settings.messageSize; + } + } + if(settings.messageLineHeight) { + + if( !isNaN(settings.titleSize) ){ + $DOM.p.style.lineHeight = settings.messageLineHeight+'px'; + } else { + $DOM.p.style.lineHeight = settings.messageLineHeight; + } + } + } + + if(settings.title.length > 0 && settings.message.length > 0) { + if(settings.rtl){ + $DOM.strong.style.marginLeft = '10px'; + } else if(settings.layout !== 2 && !settings.rtl) { + $DOM.strong.style.marginRight = '10px'; + } + } + })(); + + $DOM.toastBody.appendChild($DOM.toastTexts); + + // Inputs + var $inputs; + (function(){ + if(settings.inputs.length > 0) { + + $DOM.inputs.classList.add(PLUGIN_NAME + '-inputs'); + + forEach(settings.inputs, function (value, index) { + $DOM.inputs.appendChild(createFragElem(value[0])); + + $inputs = $DOM.inputs.childNodes; + + $inputs[index].classList.add(PLUGIN_NAME + '-inputs-child'); + + if(value[3]){ + setTimeout(function() { + $inputs[index].focus(); + }, 300); + } + + $inputs[index].addEventListener(value[1], function (e) { + var ts = value[2]; + return ts(that, $DOM.toast, this, e); + }); + }); + $DOM.toastBody.appendChild($DOM.inputs); + } + })(); + + // Buttons + (function(){ + if(settings.buttons.length > 0) { + + $DOM.buttons.classList.add(PLUGIN_NAME + '-buttons'); + + forEach(settings.buttons, function (value, index) { + $DOM.buttons.appendChild(createFragElem(value[0])); + + var $btns = $DOM.buttons.childNodes; + + $btns[index].classList.add(PLUGIN_NAME + '-buttons-child'); + + if(value[2]){ + setTimeout(function() { + $btns[index].focus(); + }, 300); + } + + $btns[index].addEventListener('click', function (e) { + e.preventDefault(); + var ts = value[1]; + return ts(that, $DOM.toast, this, e, $inputs); + }); + }); + } + $DOM.toastBody.appendChild($DOM.buttons); + })(); + + if(settings.message.length > 0 && (settings.inputs.length > 0 || settings.buttons.length > 0)) { + $DOM.p.style.marginBottom = '0'; + } + + if(settings.inputs.length > 0 || settings.buttons.length > 0){ + if(settings.rtl){ + $DOM.toastTexts.style.marginLeft = '10px'; + } else { + $DOM.toastTexts.style.marginRight = '10px'; + } + if(settings.inputs.length > 0 && settings.buttons.length > 0){ + if(settings.rtl){ + $DOM.inputs.style.marginLeft = '8px'; + } else { + $DOM.inputs.style.marginRight = '8px'; + } + } + } + + // Wrap + (function(){ + $DOM.toastCapsule.style.visibility = 'hidden'; + setTimeout(function() { + var H = $DOM.toast.offsetHeight; + var style = $DOM.toast.currentStyle || window.getComputedStyle($DOM.toast); + var marginTop = style.marginTop; + marginTop = marginTop.split('px'); + marginTop = parseInt(marginTop[0]); + var marginBottom = style.marginBottom; + marginBottom = marginBottom.split('px'); + marginBottom = parseInt(marginBottom[0]); + + $DOM.toastCapsule.style.visibility = ''; + $DOM.toastCapsule.style.height = (H+marginBottom+marginTop)+'px'; + + setTimeout(function() { + $DOM.toastCapsule.style.height = 'auto'; + if(settings.target){ + $DOM.toastCapsule.style.overflow = 'visible'; + } + }, 500); + + if(settings.timeout) { + that.progress(settings, $DOM.toast).start(); + } + }, 100); + })(); + + // Target + (function(){ + var position = settings.position; + + if(settings.target){ + + $DOM.wrapper = document.querySelector(settings.target); + $DOM.wrapper.classList.add(PLUGIN_NAME + '-target'); + + if(settings.targetFirst) { + $DOM.wrapper.insertBefore($DOM.toastCapsule, $DOM.wrapper.firstChild); + } else { + $DOM.wrapper.appendChild($DOM.toastCapsule); + } + + } else { + + if( POSITIONS.indexOf(settings.position) == -1 ){ + console.warn('['+PLUGIN_NAME+'] Incorrect position.\nIt can be › ' + POSITIONS); + return; + } + + if(ISMOBILE || window.innerWidth <= MOBILEWIDTH){ + if(settings.position == 'bottomLeft' || settings.position == 'bottomRight' || settings.position == 'bottomCenter'){ + position = PLUGIN_NAME+'-wrapper-bottomCenter'; + } + else if(settings.position == 'topLeft' || settings.position == 'topRight' || settings.position == 'topCenter'){ + position = PLUGIN_NAME+'-wrapper-topCenter'; + } + else { + position = PLUGIN_NAME+'-wrapper-center'; + } + } else { + position = PLUGIN_NAME+'-wrapper-'+position; + } + $DOM.wrapper = document.querySelector('.' + PLUGIN_NAME + '-wrapper.'+position); + + if(!$DOM.wrapper) { + $DOM.wrapper = document.createElement('div'); + $DOM.wrapper.classList.add(PLUGIN_NAME + '-wrapper'); + $DOM.wrapper.classList.add(position); + document.body.appendChild($DOM.wrapper); + } + if(settings.position == 'topLeft' || settings.position == 'topCenter' || settings.position == 'topRight'){ + $DOM.wrapper.insertBefore($DOM.toastCapsule, $DOM.wrapper.firstChild); + } else { + $DOM.wrapper.appendChild($DOM.toastCapsule); + } + } + + if(!isNaN(settings.zindex)) { + $DOM.wrapper.style.zIndex = settings.zindex; + } else { + console.warn('['+PLUGIN_NAME+'] Invalid zIndex.'); + } + })(); + + // Overlay + (function(){ + + if(settings.overlay) { + + if( document.querySelector('.'+PLUGIN_NAME+'-overlay.fadeIn') !== null ){ + + $DOM.overlay = document.querySelector('.'+PLUGIN_NAME+'-overlay'); + $DOM.overlay.setAttribute('data-iziToast-ref', $DOM.overlay.getAttribute('data-iziToast-ref') + ',' + settings.ref); + + if(!isNaN(settings.zindex) && settings.zindex !== null) { + $DOM.overlay.style.zIndex = settings.zindex-1; + } + + } else { + + $DOM.overlay.classList.add(PLUGIN_NAME+'-overlay'); + $DOM.overlay.classList.add('fadeIn'); + $DOM.overlay.style.background = settings.overlayColor; + $DOM.overlay.setAttribute('data-iziToast-ref', settings.ref); + if(!isNaN(settings.zindex) && settings.zindex !== null) { + $DOM.overlay.style.zIndex = settings.zindex-1; + } + document.querySelector('body').appendChild($DOM.overlay); + } + + if(settings.overlayClose) { + + $DOM.overlay.removeEventListener('click', {}); + $DOM.overlay.addEventListener('click', function (e) { + that.hide(settings, $DOM.toast, 'overlay'); + }); + } else { + $DOM.overlay.removeEventListener('click', {}); + } + } + })(); + + // Inside animations + (function(){ + if(settings.animateInside){ + $DOM.toast.classList.add(PLUGIN_NAME+'-animateInside'); + + var animationTimes = [200, 100, 300]; + if(settings.transitionIn == 'bounceInLeft' || settings.transitionIn == 'bounceInRight'){ + animationTimes = [400, 200, 400]; + } + + if(settings.title.length > 0) { + setTimeout(function(){ + $DOM.strong.classList.add('slideIn'); + }, animationTimes[0]); + } + + if(settings.message.length > 0) { + setTimeout(function(){ + $DOM.p.classList.add('slideIn'); + }, animationTimes[1]); + } + + if(settings.icon || settings.iconUrl) { + setTimeout(function(){ + $DOM.icon.classList.add('revealIn'); + }, animationTimes[2]); + } + + var counter = 150; + if(settings.buttons.length > 0 && $DOM.buttons) { + + setTimeout(function(){ + + forEach($DOM.buttons.childNodes, function(element, index) { + + setTimeout(function(){ + element.classList.add('revealIn'); + }, counter); + counter = counter + 150; + }); + + }, settings.inputs.length > 0 ? 150 : 0); + } + + if(settings.inputs.length > 0 && $DOM.inputs) { + counter = 150; + forEach($DOM.inputs.childNodes, function(element, index) { + + setTimeout(function(){ + element.classList.add('revealIn'); + }, counter); + counter = counter + 150; + }); + } + } + })(); + + settings.onOpening.apply(null, [settings, $DOM.toast]); + + try { + var event = new CustomEvent(PLUGIN_NAME + '-opening', {detail: settings, bubbles: true, cancelable: true}); + document.dispatchEvent(event); + } catch(ex){ + console.warn(ex); + } + + setTimeout(function() { + + $DOM.toast.classList.remove(PLUGIN_NAME+'-opening'); + $DOM.toast.classList.add(PLUGIN_NAME+'-opened'); + + try { + var event = new CustomEvent(PLUGIN_NAME + '-opened', {detail: settings, bubbles: true, cancelable: true}); + document.dispatchEvent(event); + } catch(ex){ + console.warn(ex); + } + + settings.onOpened.apply(null, [settings, $DOM.toast]); + }, 1000); + + if(settings.drag){ + + if(ACCEPTSTOUCH) { + + $DOM.toast.addEventListener('touchstart', function(e) { + drag.startMoving(this, that, settings, e); + }, false); + + $DOM.toast.addEventListener('touchend', function(e) { + drag.stopMoving(this, e); + }, false); + } else { + + $DOM.toast.addEventListener('mousedown', function(e) { + e.preventDefault(); + drag.startMoving(this, that, settings, e); + }, false); + + $DOM.toast.addEventListener('mouseup', function(e) { + e.preventDefault(); + drag.stopMoving(this, e); + }, false); + } + } + + if(settings.closeOnEscape) { + + document.addEventListener('keyup', function (evt) { + evt = evt || window.event; + if(evt.keyCode == 27) { + that.hide(settings, $DOM.toast, 'esc'); + } + }); + } + + if(settings.closeOnClick) { + $DOM.toast.addEventListener('click', function (evt) { + that.hide(settings, $DOM.toast, 'toast'); + }); + } + + that.toast = $DOM.toast; + }; + return $iziToast; +}); \ No newline at end of file diff --git a/static/component/pear/module/topBar.js b/static/component/pear/module/topBar.js new file mode 100644 index 000000000..e71c586f0 --- /dev/null +++ b/static/component/pear/module/topBar.js @@ -0,0 +1,13 @@ +layui.define(['jquery', 'element','util'], function(exports) { + "use strict"; + + var MOD_NAME = 'topBar', + $ = layui.jquery, + util = layui.util, + element = layui.element; + + var topBar = new function() { + util.fixbar({}); + } + exports(MOD_NAME,topBar); +}); \ No newline at end of file diff --git a/static/component/pear/module/treetable.js b/static/component/pear/module/treetable.js new file mode 100644 index 000000000..ab0d7a916 --- /dev/null +++ b/static/component/pear/module/treetable.js @@ -0,0 +1,253 @@ +layui.define(['layer', 'table'], function (exports) { + var $ = layui.jquery; + var layer = layui.layer; + var table = layui.table; + + var instances = []; + + var treetable = { + + render: function (param) { + param.method = param.method?param.method:"GET"; + if (!treetable.checkParam(param)) { + return; + } + if (param.data) { + treetable.init(param, param.data); + } else { + if(param.method === 'post' || param.method === 'POST') { + $.post(param.url, param.where, function(res){ + if(param.parseData){ + res = param.parseData(res); + param.data = res.data; + } + treetable.init(param, res.data); + }); + } else { + $.get(param.url, param.where, function(res){ + if(param.parseData){ + res = param.parseData(res); + param.data = res.data; + } + treetable.init(param, res.data); + }); + } + } + }, + // 渲染表格 + init: function (param, data) { + var mData = []; + var doneCallback = param.done; + var tNodes = data; + for (var i = 0; i < tNodes.length; i++) { + var tt = tNodes[i]; + if (!tt.id) { + tt.id = tt[param.treeIdName]; + } + if (!tt.pid) { + tt.pid = tt[param.treePidName]; + } + } + + var sort = function (s_pid, data) { + for (var i = 0; i < data.length; i++) { + if (data[i].pid == s_pid) { + var len = mData.length; + if (len > 0 && mData[len - 1].id == s_pid) { + mData[len - 1].isParent = true; + } + mData.push(data[i]); + sort(data[i].id, data); + } + } + }; + sort(param.treeSpid, tNodes); + + param.prevUrl = param.url; + param.url = undefined; + param.data = mData; + param.page = { + count: param.data.length, + limit: param.data.length + }; + param.cols[0][param.treeColIndex].templet = function (d) { + var mId = d.id; + var mPid = d.pid; + var isDir = d.isParent; + var emptyNum = treetable.getEmptyNum(mPid, mData); + var iconHtml = ''; + for (var i = 0; i < emptyNum; i++) { + iconHtml += ''; + } + if (isDir) { + iconHtml += ' '; + } else { + iconHtml += ''; + } + iconHtml += '  '; + var ttype = isDir ? 'dir' : 'file'; + var vg = ''; + return vg + iconHtml + d[param.cols[0][param.treeColIndex].field] + '' + }; + + param.done = function (res, curr, count) { + $(param.elem).next().addClass('treeTable'); + $('.treeTable .layui-table-page').css('display', 'none'); + $(param.elem).next().attr('treeLinkage', param.treeLinkage); + if (param.treeDefaultClose) { + treetable.foldAll(param.elem); + } + if (doneCallback) { + doneCallback(res, curr, count); + } + }; + + // 渲染表格 + table.render(param); + var result = instances.some(item=>item.key===param.elem); + if(!result){ + instances.push({key:param.elem,value:param}); + } + }, + reload: function(elem) { + instances.forEach(function(item){ + if(item.key === elem) { + $(elem).next().remove(); + item.value.data = undefined; + item.value.url = item.value.prevUrl; + treetable.render(item.value); + } + }) + }, + search: function(elem,keyword) { + var $tds = $(elem).next('.treeTable').find('.layui-table-body tbody tr td'); + if (!keyword) { + $tds.css('background-color', 'transparent'); + layer.msg("请输入关键字", {icon: 5}); + return; + } + var searchCount = 0; + $tds.each(function () { + $(this).css('background-color', 'transparent'); + if ($(this).text().indexOf(keyword) >= 0) { + $(this).css('background-color', 'rgba(250,230,160,0.5)'); + if (searchCount == 0) { + $('body,html').stop(true); + $('body,html').animate({scrollTop: $(this).offset().top - 150}, 500); + } + searchCount++; + } + }); + if (searchCount == 0) { + layer.msg("没有匹配结果", {icon: 5}); + } else { + treetable.expandAll(elem); + } + }, + getEmptyNum: function (pid, data) { + var num = 0; + if (!pid) { + return num; + } + var tPid; + for (var i = 0; i < data.length; i++) { + if (pid == data[i].id) { + num += 1; + tPid = data[i].pid; + break; + } + } + return num + treetable.getEmptyNum(tPid, data); + }, + // 展开/折叠行 + toggleRows: function ($dom, linkage) { + var type = $dom.attr('lay-ttype'); + if ('file' == type) { + return; + } + var mId = $dom.attr('lay-tid'); + var isOpen = $dom.hasClass('open'); + if (isOpen) { + $dom.removeClass('open'); + } else { + $dom.addClass('open'); + } + $dom.closest('tbody').find('tr').each(function () { + var $ti = $(this).find('.treeTable-icon'); + var pid = $ti.attr('lay-tpid'); + var ttype = $ti.attr('lay-ttype'); + var tOpen = $ti.hasClass('open'); + if (mId == pid) { + if (isOpen) { + $(this).hide(); + if ('dir' == ttype && tOpen == isOpen) { + $ti.trigger('click'); + } + } else { + $(this).show(); + if (linkage && 'dir' == ttype && tOpen == isOpen) { + $ti.trigger('click'); + } + } + } + }); + }, + // 检查参数 + checkParam: function (param) { + if (!param.treeSpid && param.treeSpid != 0) { + layer.msg('参数treeSpid不能为空', {icon: 5}); + return false; + } + + if (!param.treeIdName) { + layer.msg('参数treeIdName不能为空', {icon: 5}); + return false; + } + + if (!param.treePidName) { + layer.msg('参数treePidName不能为空', {icon: 5}); + return false; + } + + if (!param.treeColIndex && param.treeColIndex != 0) { + layer.msg('参数treeColIndex不能为空', {icon: 5}); + return false; + } + return true; + }, + // 展开所有 + expandAll: function (dom) { + $(dom).next('.treeTable').find('.layui-table-body tbody tr').each(function () { + var $ti = $(this).find('.treeTable-icon'); + var ttype = $ti.attr('lay-ttype'); + var tOpen = $ti.hasClass('open'); + if ('dir' == ttype && !tOpen) { + $ti.trigger('click'); + } + }); + }, + // 折叠所有 + foldAll: function (dom) { + $(dom).next('.treeTable').find('.layui-table-body tbody tr').each(function () { + var $ti = $(this).find('.treeTable-icon'); + var ttype = $ti.attr('lay-ttype'); + var tOpen = $ti.hasClass('open'); + if ('dir' == ttype && tOpen) { + $ti.trigger('click'); + } + }); + } + }; + + // 给图标列绑定事件 + $('body').on('click', '.treeTable .treeTable-icon', function () { + var treeLinkage = $(this).parents('.treeTable').attr('treeLinkage'); + if ('true' == treeLinkage) { + treetable.toggleRows($(this), true); + } else { + treetable.toggleRows($(this), false); + } + }); + + exports('treetable', treetable); +}); \ No newline at end of file diff --git a/static/component/pear/module/yaml.js b/static/component/pear/module/yaml.js new file mode 100644 index 000000000..bb448bc58 --- /dev/null +++ b/static/component/pear/module/yaml.js @@ -0,0 +1,2059 @@ +layui.define(['jquery', 'element'], function(exports) { + "use strict"; + + var MOD_NAME = 'yaml', + $ = layui.jquery, + element = layui.element; + + var yaml = new function() { + this.parse = function(str){ + return YAML.parse(yamlString); + } + this.load = function(path){ + return YAML.load(path); + } + } + exports(MOD_NAME, yaml); +}); + + +(function() { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = "function" == typeof require && require; + if (!f && c) return c(i, !0); + if (u) return u(i, !0); + var a = new Error("Cannot find module '" + i + "'"); + throw a.code = "MODULE_NOT_FOUND", a + } + var p = n[i] = { + exports: {} + }; + e[i][0].call(p.exports, function(r) { + var n = e[i][1][r]; + return o(n || r) + }, p, p.exports, r, e, n, t) + } + return n[i].exports + } + for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) o(t[i]); + return o + } + return r +})()({ + 1: [function(require, module, exports) { + var Dumper, Inline, Utils; + + Utils = require('./Utils'); + + Inline = require('./Inline'); + + Dumper = (function() { + function Dumper() {} + + Dumper.indentation = 4; + + Dumper.prototype.dump = function(input, inline, indent, exceptionOnInvalidType, objectEncoder) { + var i, key, len, output, prefix, value, willBeInlined; + if (inline == null) { + inline = 0; + } + if (indent == null) { + indent = 0; + } + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = false; + } + if (objectEncoder == null) { + objectEncoder = null; + } + output = ''; + if (typeof input === 'function') { + return output; + } + prefix = (indent ? Utils.strRepeat(' ', indent) : ''); + if (inline <= 0 || typeof input !== 'object' || input instanceof Date || Utils.isEmpty(input)) { + output += prefix + Inline.dump(input, exceptionOnInvalidType, objectEncoder); + } else { + if (input instanceof Array) { + for (i = 0, len = input.length; i < len; i++) { + value = input[i]; + willBeInlined = inline - 1 <= 0 || typeof value !== 'object' || Utils.isEmpty(value); + output += prefix + '-' + (willBeInlined ? ' ' : "\n") + this.dump(value, inline - 1, (willBeInlined ? 0 : + indent + this.indentation), exceptionOnInvalidType, objectEncoder) + (willBeInlined ? "\n" : ''); + } + } else { + for (key in input) { + value = input[key]; + willBeInlined = inline - 1 <= 0 || typeof value !== 'object' || Utils.isEmpty(value); + output += prefix + Inline.dump(key, exceptionOnInvalidType, objectEncoder) + ':' + (willBeInlined ? ' ' : + "\n") + this.dump(value, inline - 1, (willBeInlined ? 0 : indent + this.indentation), + exceptionOnInvalidType, objectEncoder) + (willBeInlined ? "\n" : ''); + } + } + } + return output; + }; + + return Dumper; + + })(); + + module.exports = Dumper; + + + }, { + "./Inline": 6, + "./Utils": 10 + }], + 2: [function(require, module, exports) { + var Escaper, Pattern; + + Pattern = require('./Pattern'); + + Escaper = (function() { + var ch; + + function Escaper() {} + + Escaper.LIST_ESCAPEES = ['\\', '\\\\', '\\"', '"', "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", + "\x07", "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", "\x10", "\x11", "\x12", "\x13", + "\x14", "\x15", "\x16", "\x17", "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", (ch = String.fromCharCode) + (0x0085), ch(0x00A0), ch(0x2028), ch(0x2029) + ]; + + Escaper.LIST_ESCAPED = ['\\\\', '\\"', '\\"', '\\"', "\\0", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", + "\\x06", "\\a", "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f", "\\x10", "\\x11", "\\x12", + "\\x13", "\\x14", "\\x15", "\\x16", "\\x17", "\\x18", "\\x19", "\\x1a", "\\e", "\\x1c", "\\x1d", "\\x1e", + "\\x1f", "\\N", "\\_", "\\L", "\\P" + ]; + + Escaper.MAPPING_ESCAPEES_TO_ESCAPED = (function() { + var i, j, mapping, ref; + mapping = {}; + for (i = j = 0, ref = Escaper.LIST_ESCAPEES.length; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) { + mapping[Escaper.LIST_ESCAPEES[i]] = Escaper.LIST_ESCAPED[i]; + } + return mapping; + })(); + + Escaper.PATTERN_CHARACTERS_TO_ESCAPE = new Pattern('[\\x00-\\x1f]|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9'); + + Escaper.PATTERN_MAPPING_ESCAPEES = new Pattern(Escaper.LIST_ESCAPEES.join('|').split('\\').join('\\\\')); + + Escaper.PATTERN_SINGLE_QUOTING = new Pattern('[\\s\'":{}[\\],&*#?]|^[-?|<>=!%@`]'); + + Escaper.requiresDoubleQuoting = function(value) { + return this.PATTERN_CHARACTERS_TO_ESCAPE.test(value); + }; + + Escaper.escapeWithDoubleQuotes = function(value) { + var result; + result = this.PATTERN_MAPPING_ESCAPEES.replace(value, (function(_this) { + return function(str) { + return _this.MAPPING_ESCAPEES_TO_ESCAPED[str]; + }; + })(this)); + return '"' + result + '"'; + }; + + Escaper.requiresSingleQuoting = function(value) { + return this.PATTERN_SINGLE_QUOTING.test(value); + }; + + Escaper.escapeWithSingleQuotes = function(value) { + return "'" + value.replace(/'/g, "''") + "'"; + }; + + return Escaper; + + })(); + + module.exports = Escaper; + + + }, { + "./Pattern": 8 + }], + 3: [function(require, module, exports) { + var DumpException, + extend = function(child, parent) { + for (var key in parent) { + if (hasProp.call(parent, key)) child[key] = parent[key]; + } + + function ctor() { + this.constructor = child; + } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + child.__super__ = parent.prototype; + return child; + }, + hasProp = {}.hasOwnProperty; + + DumpException = (function(superClass) { + extend(DumpException, superClass); + + function DumpException(message, parsedLine, snippet) { + DumpException.__super__.constructor.call(this, message); + this.message = message; + this.parsedLine = parsedLine; + this.snippet = snippet; + } + + DumpException.prototype.toString = function() { + if ((this.parsedLine != null) && (this.snippet != null)) { + return ' ' + this.message + ' (line ' + this.parsedLine + ': \'' + this.snippet + '\')'; + } else { + return ' ' + this.message; + } + }; + + return DumpException; + + })(Error); + + module.exports = DumpException; + + + }, {}], + 4: [function(require, module, exports) { + var ParseException, + extend = function(child, parent) { + for (var key in parent) { + if (hasProp.call(parent, key)) child[key] = parent[key]; + } + + function ctor() { + this.constructor = child; + } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + child.__super__ = parent.prototype; + return child; + }, + hasProp = {}.hasOwnProperty; + + ParseException = (function(superClass) { + extend(ParseException, superClass); + + function ParseException(message, parsedLine, snippet) { + ParseException.__super__.constructor.call(this, message); + this.message = message; + this.parsedLine = parsedLine; + this.snippet = snippet; + } + + ParseException.prototype.toString = function() { + if ((this.parsedLine != null) && (this.snippet != null)) { + return ' ' + this.message + ' (line ' + this.parsedLine + ': \'' + this.snippet + '\')'; + } else { + return ' ' + this.message; + } + }; + + return ParseException; + + })(Error); + + module.exports = ParseException; + + + }, {}], + 5: [function(require, module, exports) { + var ParseMore, + extend = function(child, parent) { + for (var key in parent) { + if (hasProp.call(parent, key)) child[key] = parent[key]; + } + + function ctor() { + this.constructor = child; + } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + child.__super__ = parent.prototype; + return child; + }, + hasProp = {}.hasOwnProperty; + + ParseMore = (function(superClass) { + extend(ParseMore, superClass); + + function ParseMore(message, parsedLine, snippet) { + ParseMore.__super__.constructor.call(this, message); + this.message = message; + this.parsedLine = parsedLine; + this.snippet = snippet; + } + + ParseMore.prototype.toString = function() { + if ((this.parsedLine != null) && (this.snippet != null)) { + return ' ' + this.message + ' (line ' + this.parsedLine + ': \'' + this.snippet + '\')'; + } else { + return ' ' + this.message; + } + }; + + return ParseMore; + + })(Error); + + module.exports = ParseMore; + + + }, {}], + 6: [function(require, module, exports) { + var DumpException, Escaper, Inline, ParseException, ParseMore, Pattern, Unescaper, Utils, + indexOf = [].indexOf || function(item) { + for (var i = 0, l = this.length; i < l; i++) { + if (i in this && this[i] === item) return i; + } + return -1; + }; + + Pattern = require('./Pattern'); + + Unescaper = require('./Unescaper'); + + Escaper = require('./Escaper'); + + Utils = require('./Utils'); + + ParseException = require('./Exception/ParseException'); + + ParseMore = require('./Exception/ParseMore'); + + DumpException = require('./Exception/DumpException'); + + Inline = (function() { + function Inline() {} + + Inline.REGEX_QUOTED_STRING = '(?:"(?:[^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'(?:[^\']*(?:\'\'[^\']*)*)\')'; + + Inline.PATTERN_TRAILING_COMMENTS = new Pattern('^\\s*#.*$'); + + Inline.PATTERN_QUOTED_SCALAR = new Pattern('^' + Inline.REGEX_QUOTED_STRING); + + Inline.PATTERN_THOUSAND_NUMERIC_SCALAR = new Pattern('^(-|\\+)?[0-9,]+(\\.[0-9]+)?$'); + + Inline.PATTERN_SCALAR_BY_DELIMITERS = {}; + + Inline.settings = {}; + + Inline.configure = function(exceptionOnInvalidType, objectDecoder) { + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = null; + } + if (objectDecoder == null) { + objectDecoder = null; + } + this.settings.exceptionOnInvalidType = exceptionOnInvalidType; + this.settings.objectDecoder = objectDecoder; + }; + + Inline.parse = function(value, exceptionOnInvalidType, objectDecoder) { + var context, result; + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = false; + } + if (objectDecoder == null) { + objectDecoder = null; + } + this.settings.exceptionOnInvalidType = exceptionOnInvalidType; + this.settings.objectDecoder = objectDecoder; + if (value == null) { + return ''; + } + value = Utils.trim(value); + if (0 === value.length) { + return ''; + } + context = { + exceptionOnInvalidType: exceptionOnInvalidType, + objectDecoder: objectDecoder, + i: 0 + }; + switch (value.charAt(0)) { + case '[': + result = this.parseSequence(value, context); + ++context.i; + break; + case '{': + result = this.parseMapping(value, context); + ++context.i; + break; + default: + result = this.parseScalar(value, null, ['"', "'"], context); + } + if (this.PATTERN_TRAILING_COMMENTS.replace(value.slice(context.i), '') !== '') { + throw new ParseException('Unexpected characters near "' + value.slice(context.i) + '".'); + } + return result; + }; + + Inline.dump = function(value, exceptionOnInvalidType, objectEncoder) { + var ref, result, type; + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = false; + } + if (objectEncoder == null) { + objectEncoder = null; + } + if (value == null) { + return 'null'; + } + type = typeof value; + if (type === 'object') { + if (value instanceof Date) { + return value.toISOString(); + } else if (objectEncoder != null) { + result = objectEncoder(value); + if (typeof result === 'string' || (result != null)) { + return result; + } + } + return this.dumpObject(value); + } + if (type === 'boolean') { + return (value ? 'true' : 'false'); + } + if (Utils.isDigits(value)) { + return (type === 'string' ? "'" + value + "'" : String(parseInt(value))); + } + if (Utils.isNumeric(value)) { + return (type === 'string' ? "'" + value + "'" : String(parseFloat(value))); + } + if (type === 'number') { + return (value === Infinity ? '.Inf' : (value === -Infinity ? '-.Inf' : (isNaN(value) ? '.NaN' : value))); + } + if (Escaper.requiresDoubleQuoting(value)) { + return Escaper.escapeWithDoubleQuotes(value); + } + if (Escaper.requiresSingleQuoting(value)) { + return Escaper.escapeWithSingleQuotes(value); + } + if ('' === value) { + return '""'; + } + if (Utils.PATTERN_DATE.test(value)) { + return "'" + value + "'"; + } + if ((ref = value.toLowerCase()) === 'null' || ref === '~' || ref === 'true' || ref === 'false') { + return "'" + value + "'"; + } + return value; + }; + + Inline.dumpObject = function(value, exceptionOnInvalidType, objectSupport) { + var j, key, len1, output, val; + if (objectSupport == null) { + objectSupport = null; + } + if (value instanceof Array) { + output = []; + for (j = 0, len1 = value.length; j < len1; j++) { + val = value[j]; + output.push(this.dump(val)); + } + return '[' + output.join(', ') + ']'; + } else { + output = []; + for (key in value) { + val = value[key]; + output.push(this.dump(key) + ': ' + this.dump(val)); + } + return '{' + output.join(', ') + '}'; + } + }; + + Inline.parseScalar = function(scalar, delimiters, stringDelimiters, context, evaluate) { + var i, joinedDelimiters, match, output, pattern, ref, ref1, strpos, tmp; + if (delimiters == null) { + delimiters = null; + } + if (stringDelimiters == null) { + stringDelimiters = ['"', "'"]; + } + if (context == null) { + context = null; + } + if (evaluate == null) { + evaluate = true; + } + if (context == null) { + context = { + exceptionOnInvalidType: this.settings.exceptionOnInvalidType, + objectDecoder: this.settings.objectDecoder, + i: 0 + }; + } + i = context.i; + if (ref = scalar.charAt(i), indexOf.call(stringDelimiters, ref) >= 0) { + output = this.parseQuotedScalar(scalar, context); + i = context.i; + if (delimiters != null) { + tmp = Utils.ltrim(scalar.slice(i), ' '); + if (!(ref1 = tmp.charAt(0), indexOf.call(delimiters, ref1) >= 0)) { + throw new ParseException('Unexpected characters (' + scalar.slice(i) + ').'); + } + } + } else { + if (!delimiters) { + output = scalar.slice(i); + i += output.length; + strpos = output.indexOf(' #'); + if (strpos !== -1) { + output = Utils.rtrim(output.slice(0, strpos)); + } + } else { + joinedDelimiters = delimiters.join('|'); + pattern = this.PATTERN_SCALAR_BY_DELIMITERS[joinedDelimiters]; + if (pattern == null) { + pattern = new Pattern('^(.+?)(' + joinedDelimiters + ')'); + this.PATTERN_SCALAR_BY_DELIMITERS[joinedDelimiters] = pattern; + } + if (match = pattern.exec(scalar.slice(i))) { + output = match[1]; + i += output.length; + } else { + throw new ParseException('Malformed inline YAML string (' + scalar + ').'); + } + } + if (evaluate) { + output = this.evaluateScalar(output, context); + } + } + context.i = i; + return output; + }; + + Inline.parseQuotedScalar = function(scalar, context) { + var i, match, output; + i = context.i; + if (!(match = this.PATTERN_QUOTED_SCALAR.exec(scalar.slice(i)))) { + throw new ParseMore('Malformed inline YAML string (' + scalar.slice(i) + ').'); + } + output = match[0].substr(1, match[0].length - 2); + if ('"' === scalar.charAt(i)) { + output = Unescaper.unescapeDoubleQuotedString(output); + } else { + output = Unescaper.unescapeSingleQuotedString(output); + } + i += match[0].length; + context.i = i; + return output; + }; + + Inline.parseSequence = function(sequence, context) { + var e, error, i, isQuoted, len, output, ref, value; + output = []; + len = sequence.length; + i = context.i; + i += 1; + while (i < len) { + context.i = i; + switch (sequence.charAt(i)) { + case '[': + output.push(this.parseSequence(sequence, context)); + i = context.i; + break; + case '{': + output.push(this.parseMapping(sequence, context)); + i = context.i; + break; + case ']': + return output; + case ',': + case ' ': + case "\n": + break; + default: + isQuoted = ((ref = sequence.charAt(i)) === '"' || ref === "'"); + value = this.parseScalar(sequence, [',', ']'], ['"', "'"], context); + i = context.i; + if (!isQuoted && typeof value === 'string' && (value.indexOf(': ') !== -1 || value.indexOf(":\n") !== -1)) { + try { + value = this.parseMapping('{' + value + '}'); + } catch (error) { + e = error; + } + } + output.push(value); + --i; + } + ++i; + } + throw new ParseMore('Malformed inline YAML string ' + sequence); + }; + + Inline.parseMapping = function(mapping, context) { + var done, i, key, len, output, shouldContinueWhileLoop, value; + output = {}; + len = mapping.length; + i = context.i; + i += 1; + shouldContinueWhileLoop = false; + while (i < len) { + context.i = i; + switch (mapping.charAt(i)) { + case ' ': + case ',': + case "\n": + ++i; + context.i = i; + shouldContinueWhileLoop = true; + break; + case '}': + return output; + } + if (shouldContinueWhileLoop) { + shouldContinueWhileLoop = false; + continue; + } + key = this.parseScalar(mapping, [':', ' ', "\n"], ['"', "'"], context, false); + i = context.i; + done = false; + while (i < len) { + context.i = i; + switch (mapping.charAt(i)) { + case '[': + value = this.parseSequence(mapping, context); + i = context.i; + if (output[key] === void 0) { + output[key] = value; + } + done = true; + break; + case '{': + value = this.parseMapping(mapping, context); + i = context.i; + if (output[key] === void 0) { + output[key] = value; + } + done = true; + break; + case ':': + case ' ': + case "\n": + break; + default: + value = this.parseScalar(mapping, [',', '}'], ['"', "'"], context); + i = context.i; + if (output[key] === void 0) { + output[key] = value; + } + done = true; + --i; + } + ++i; + if (done) { + break; + } + } + } + throw new ParseMore('Malformed inline YAML string ' + mapping); + }; + + Inline.evaluateScalar = function(scalar, context) { + var cast, date, exceptionOnInvalidType, firstChar, firstSpace, firstWord, objectDecoder, raw, scalarLower, + subValue, trimmedScalar; + scalar = Utils.trim(scalar); + scalarLower = scalar.toLowerCase(); + switch (scalarLower) { + case 'null': + case '': + case '~': + return null; + case 'true': + return true; + case 'false': + return false; + case '.inf': + return Infinity; + case '.nan': + return NaN; + case '-.inf': + return Infinity; + default: + firstChar = scalarLower.charAt(0); + switch (firstChar) { + case '!': + firstSpace = scalar.indexOf(' '); + if (firstSpace === -1) { + firstWord = scalarLower; + } else { + firstWord = scalarLower.slice(0, firstSpace); + } + switch (firstWord) { + case '!': + if (firstSpace !== -1) { + return parseInt(this.parseScalar(scalar.slice(2))); + } + return null; + case '!str': + return Utils.ltrim(scalar.slice(4)); + case '!!str': + return Utils.ltrim(scalar.slice(5)); + case '!!int': + return parseInt(this.parseScalar(scalar.slice(5))); + case '!!bool': + return Utils.parseBoolean(this.parseScalar(scalar.slice(6)), false); + case '!!float': + return parseFloat(this.parseScalar(scalar.slice(7))); + case '!!timestamp': + return Utils.stringToDate(Utils.ltrim(scalar.slice(11))); + default: + if (context == null) { + context = { + exceptionOnInvalidType: this.settings.exceptionOnInvalidType, + objectDecoder: this.settings.objectDecoder, + i: 0 + }; + } + objectDecoder = context.objectDecoder, exceptionOnInvalidType = context.exceptionOnInvalidType; + if (objectDecoder) { + trimmedScalar = Utils.rtrim(scalar); + firstSpace = trimmedScalar.indexOf(' '); + if (firstSpace === -1) { + return objectDecoder(trimmedScalar, null); + } else { + subValue = Utils.ltrim(trimmedScalar.slice(firstSpace + 1)); + if (!(subValue.length > 0)) { + subValue = null; + } + return objectDecoder(trimmedScalar.slice(0, firstSpace), subValue); + } + } + if (exceptionOnInvalidType) { + throw new ParseException('Custom object support when parsing a YAML file has been disabled.'); + } + return null; + } + break; + case '0': + if ('0x' === scalar.slice(0, 2)) { + return Utils.hexDec(scalar); + } else if (Utils.isDigits(scalar)) { + return Utils.octDec(scalar); + } else if (Utils.isNumeric(scalar)) { + return parseFloat(scalar); + } else { + return scalar; + } + break; + case '+': + if (Utils.isDigits(scalar)) { + raw = scalar; + cast = parseInt(raw); + if (raw === String(cast)) { + return cast; + } else { + return raw; + } + } else if (Utils.isNumeric(scalar)) { + return parseFloat(scalar); + } else if (this.PATTERN_THOUSAND_NUMERIC_SCALAR.test(scalar)) { + return parseFloat(scalar.replace(',', '')); + } + return scalar; + case '-': + if (Utils.isDigits(scalar.slice(1))) { + if ('0' === scalar.charAt(1)) { + return -Utils.octDec(scalar.slice(1)); + } else { + raw = scalar.slice(1); + cast = parseInt(raw); + if (raw === String(cast)) { + return -cast; + } else { + return -raw; + } + } + } else if (Utils.isNumeric(scalar)) { + return parseFloat(scalar); + } else if (this.PATTERN_THOUSAND_NUMERIC_SCALAR.test(scalar)) { + return parseFloat(scalar.replace(',', '')); + } + return scalar; + default: + if (date = Utils.stringToDate(scalar)) { + return date; + } else if (Utils.isNumeric(scalar)) { + return parseFloat(scalar); + } else if (this.PATTERN_THOUSAND_NUMERIC_SCALAR.test(scalar)) { + return parseFloat(scalar.replace(',', '')); + } + return scalar; + } + } + }; + + return Inline; + + })(); + + module.exports = Inline; + + + }, { + "./Escaper": 2, + "./Exception/DumpException": 3, + "./Exception/ParseException": 4, + "./Exception/ParseMore": 5, + "./Pattern": 8, + "./Unescaper": 9, + "./Utils": 10 + }], + 7: [function(require, module, exports) { + var Inline, ParseException, ParseMore, Parser, Pattern, Utils; + + Inline = require('./Inline'); + + Pattern = require('./Pattern'); + + Utils = require('./Utils'); + + ParseException = require('./Exception/ParseException'); + + ParseMore = require('./Exception/ParseMore'); + + Parser = (function() { + Parser.prototype.PATTERN_FOLDED_SCALAR_ALL = new Pattern( + '^(?:(?![^\\|>]*)\\s+)?(?\\||>)(?\\+|\\-|\\d+|\\+\\d+|\\-\\d+|\\d+\\+|\\d+\\-)?(? +#.*)?$' + ); + + Parser.prototype.PATTERN_FOLDED_SCALAR_END = new Pattern( + '(?\\||>)(?\\+|\\-|\\d+|\\+\\d+|\\-\\d+|\\d+\\+|\\d+\\-)?(? +#.*)?$'); + + Parser.prototype.PATTERN_SEQUENCE_ITEM = new Pattern('^\\-((?\\s+)(?.+?))?\\s*$'); + + Parser.prototype.PATTERN_ANCHOR_VALUE = new Pattern('^&(?[^ ]+) *(?.*)'); + + Parser.prototype.PATTERN_COMPACT_NOTATION = new Pattern('^(?' + Inline.REGEX_QUOTED_STRING + + '|[^ \'"\\{\\[].*?) *\\:(\\s+(?.+?))?\\s*$'); + + Parser.prototype.PATTERN_MAPPING_ITEM = new Pattern('^(?' + Inline.REGEX_QUOTED_STRING + + '|[^ \'"\\[\\{].*?) *\\:(\\s+(?.+?))?\\s*$'); + + Parser.prototype.PATTERN_DECIMAL = new Pattern('\\d+'); + + Parser.prototype.PATTERN_INDENT_SPACES = new Pattern('^ +'); + + Parser.prototype.PATTERN_TRAILING_LINES = new Pattern('(\n*)$'); + + Parser.prototype.PATTERN_YAML_HEADER = new Pattern('^\\%YAML[: ][\\d\\.]+.*\n', 'm'); + + Parser.prototype.PATTERN_LEADING_COMMENTS = new Pattern('^(\\#.*?\n)+', 'm'); + + Parser.prototype.PATTERN_DOCUMENT_MARKER_START = new Pattern('^\\-\\-\\-.*?\n', 'm'); + + Parser.prototype.PATTERN_DOCUMENT_MARKER_END = new Pattern('^\\.\\.\\.\\s*$', 'm'); + + Parser.prototype.PATTERN_FOLDED_SCALAR_BY_INDENTATION = {}; + + Parser.prototype.CONTEXT_NONE = 0; + + Parser.prototype.CONTEXT_SEQUENCE = 1; + + Parser.prototype.CONTEXT_MAPPING = 2; + + function Parser(offset) { + this.offset = offset != null ? offset : 0; + this.lines = []; + this.currentLineNb = -1; + this.currentLine = ''; + this.refs = {}; + } + + Parser.prototype.parse = function(value, exceptionOnInvalidType, objectDecoder) { + var alias, allowOverwrite, block, c, context, data, e, error, error1, error2, first, i, indent, isRef, j, k, + key, l, lastKey, len, len1, len2, len3, lineCount, m, matches, mergeNode, n, name, parsed, parsedItem, + parser, ref, ref1, ref2, refName, refValue, val, values; + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = false; + } + if (objectDecoder == null) { + objectDecoder = null; + } + this.currentLineNb = -1; + this.currentLine = ''; + this.lines = this.cleanup(value).split("\n"); + data = null; + context = this.CONTEXT_NONE; + allowOverwrite = false; + while (this.moveToNextLine()) { + if (this.isCurrentLineEmpty()) { + continue; + } + if ("\t" === this.currentLine[0]) { + throw new ParseException('A YAML file cannot contain tabs as indentation.', this.getRealCurrentLineNb() + 1, + this.currentLine); + } + isRef = mergeNode = false; + if (values = this.PATTERN_SEQUENCE_ITEM.exec(this.currentLine)) { + if (this.CONTEXT_MAPPING === context) { + throw new ParseException('You cannot define a sequence item when in a mapping'); + } + context = this.CONTEXT_SEQUENCE; + if (data == null) { + data = []; + } + if ((values.value != null) && (matches = this.PATTERN_ANCHOR_VALUE.exec(values.value))) { + isRef = matches.ref; + values.value = matches.value; + } + if (!(values.value != null) || '' === Utils.trim(values.value, ' ') || Utils.ltrim(values.value, ' ').indexOf( + '#') === 0) { + if (this.currentLineNb < this.lines.length - 1 && !this.isNextLineUnIndentedCollection()) { + c = this.getRealCurrentLineNb() + 1; + parser = new Parser(c); + parser.refs = this.refs; + data.push(parser.parse(this.getNextEmbedBlock(null, true), exceptionOnInvalidType, objectDecoder)); + } else { + data.push(null); + } + } else { + if (((ref = values.leadspaces) != null ? ref.length : void 0) && (matches = this.PATTERN_COMPACT_NOTATION.exec( + values.value))) { + c = this.getRealCurrentLineNb(); + parser = new Parser(c); + parser.refs = this.refs; + block = values.value; + indent = this.getCurrentLineIndentation(); + if (this.isNextLineIndented(false)) { + block += "\n" + this.getNextEmbedBlock(indent + values.leadspaces.length + 1, true); + } + data.push(parser.parse(block, exceptionOnInvalidType, objectDecoder)); + } else { + data.push(this.parseValue(values.value, exceptionOnInvalidType, objectDecoder)); + } + } + } else if ((values = this.PATTERN_MAPPING_ITEM.exec(this.currentLine)) && values.key.indexOf(' #') === -1) { + if (this.CONTEXT_SEQUENCE === context) { + throw new ParseException('You cannot define a mapping item when in a sequence'); + } + context = this.CONTEXT_MAPPING; + if (data == null) { + data = {}; + } + Inline.configure(exceptionOnInvalidType, objectDecoder); + try { + key = Inline.parseScalar(values.key); + } catch (error) { + e = error; + e.parsedLine = this.getRealCurrentLineNb() + 1; + e.snippet = this.currentLine; + throw e; + } + if ('<<' === key) { + mergeNode = true; + allowOverwrite = true; + if (((ref1 = values.value) != null ? ref1.indexOf('*') : void 0) === 0) { + refName = values.value.slice(1); + if (this.refs[refName] == null) { + throw new ParseException('Reference "' + refName + '" does not exist.', this.getRealCurrentLineNb() + 1, + this.currentLine); + } + refValue = this.refs[refName]; + if (typeof refValue !== 'object') { + throw new ParseException('YAML merge keys used with a scalar value instead of an object.', this.getRealCurrentLineNb() + + 1, this.currentLine); + } + if (refValue instanceof Array) { + for (i = j = 0, len = refValue.length; j < len; i = ++j) { + value = refValue[i]; + if (data[name = String(i)] == null) { + data[name] = value; + } + } + } else { + for (key in refValue) { + value = refValue[key]; + if (data[key] == null) { + data[key] = value; + } + } + } + } else { + if ((values.value != null) && values.value !== '') { + value = values.value; + } else { + value = this.getNextEmbedBlock(); + } + c = this.getRealCurrentLineNb() + 1; + parser = new Parser(c); + parser.refs = this.refs; + parsed = parser.parse(value, exceptionOnInvalidType); + if (typeof parsed !== 'object') { + throw new ParseException('YAML merge keys used with a scalar value instead of an object.', this.getRealCurrentLineNb() + + 1, this.currentLine); + } + if (parsed instanceof Array) { + for (l = 0, len1 = parsed.length; l < len1; l++) { + parsedItem = parsed[l]; + if (typeof parsedItem !== 'object') { + throw new ParseException('Merge items must be objects.', this.getRealCurrentLineNb() + 1, parsedItem); + } + if (parsedItem instanceof Array) { + for (i = m = 0, len2 = parsedItem.length; m < len2; i = ++m) { + value = parsedItem[i]; + k = String(i); + if (!data.hasOwnProperty(k)) { + data[k] = value; + } + } + } else { + for (key in parsedItem) { + value = parsedItem[key]; + if (!data.hasOwnProperty(key)) { + data[key] = value; + } + } + } + } + } else { + for (key in parsed) { + value = parsed[key]; + if (!data.hasOwnProperty(key)) { + data[key] = value; + } + } + } + } + } else if ((values.value != null) && (matches = this.PATTERN_ANCHOR_VALUE.exec(values.value))) { + isRef = matches.ref; + values.value = matches.value; + } + if (mergeNode) { + + } else if (!(values.value != null) || '' === Utils.trim(values.value, ' ') || Utils.ltrim(values.value, ' ') + .indexOf('#') === 0) { + if (!(this.isNextLineIndented()) && !(this.isNextLineUnIndentedCollection())) { + if (allowOverwrite || data[key] === void 0) { + data[key] = null; + } + } else { + c = this.getRealCurrentLineNb() + 1; + parser = new Parser(c); + parser.refs = this.refs; + val = parser.parse(this.getNextEmbedBlock(), exceptionOnInvalidType, objectDecoder); + if (allowOverwrite || data[key] === void 0) { + data[key] = val; + } + } + } else { + val = this.parseValue(values.value, exceptionOnInvalidType, objectDecoder); + if (allowOverwrite || data[key] === void 0) { + data[key] = val; + } + } + } else { + lineCount = this.lines.length; + if (1 === lineCount || (2 === lineCount && Utils.isEmpty(this.lines[1]))) { + try { + value = Inline.parse(this.lines[0], exceptionOnInvalidType, objectDecoder); + } catch (error1) { + e = error1; + e.parsedLine = this.getRealCurrentLineNb() + 1; + e.snippet = this.currentLine; + throw e; + } + if (typeof value === 'object') { + if (value instanceof Array) { + first = value[0]; + } else { + for (key in value) { + first = value[key]; + break; + } + } + if (typeof first === 'string' && first.indexOf('*') === 0) { + data = []; + for (n = 0, len3 = value.length; n < len3; n++) { + alias = value[n]; + data.push(this.refs[alias.slice(1)]); + } + value = data; + } + } + return value; + } else if ((ref2 = Utils.ltrim(value).charAt(0)) === '[' || ref2 === '{') { + try { + return Inline.parse(value, exceptionOnInvalidType, objectDecoder); + } catch (error2) { + e = error2; + e.parsedLine = this.getRealCurrentLineNb() + 1; + e.snippet = this.currentLine; + throw e; + } + } + throw new ParseException('Unable to parse.', this.getRealCurrentLineNb() + 1, this.currentLine); + } + if (isRef) { + if (data instanceof Array) { + this.refs[isRef] = data[data.length - 1]; + } else { + lastKey = null; + for (key in data) { + lastKey = key; + } + this.refs[isRef] = data[lastKey]; + } + } + } + if (Utils.isEmpty(data)) { + return null; + } else { + return data; + } + }; + + Parser.prototype.getRealCurrentLineNb = function() { + return this.currentLineNb + this.offset; + }; + + Parser.prototype.getCurrentLineIndentation = function() { + return this.currentLine.length - Utils.ltrim(this.currentLine, ' ').length; + }; + + Parser.prototype.getNextEmbedBlock = function(indentation, includeUnindentedCollection) { + var data, indent, isItUnindentedCollection, newIndent, removeComments, removeCommentsPattern, + unindentedEmbedBlock; + if (indentation == null) { + indentation = null; + } + if (includeUnindentedCollection == null) { + includeUnindentedCollection = false; + } + this.moveToNextLine(); + if (indentation == null) { + newIndent = this.getCurrentLineIndentation(); + unindentedEmbedBlock = this.isStringUnIndentedCollectionItem(this.currentLine); + if (!(this.isCurrentLineEmpty()) && 0 === newIndent && !unindentedEmbedBlock) { + throw new ParseException('Indentation problem.', this.getRealCurrentLineNb() + 1, this.currentLine); + } + } else { + newIndent = indentation; + } + data = [this.currentLine.slice(newIndent)]; + if (!includeUnindentedCollection) { + isItUnindentedCollection = this.isStringUnIndentedCollectionItem(this.currentLine); + } + removeCommentsPattern = this.PATTERN_FOLDED_SCALAR_END; + removeComments = !removeCommentsPattern.test(this.currentLine); + while (this.moveToNextLine()) { + indent = this.getCurrentLineIndentation(); + if (indent === newIndent) { + removeComments = !removeCommentsPattern.test(this.currentLine); + } + if (removeComments && this.isCurrentLineComment()) { + continue; + } + if (this.isCurrentLineBlank()) { + data.push(this.currentLine.slice(newIndent)); + continue; + } + if (isItUnindentedCollection && !this.isStringUnIndentedCollectionItem(this.currentLine) && indent === + newIndent) { + this.moveToPreviousLine(); + break; + } + if (indent >= newIndent) { + data.push(this.currentLine.slice(newIndent)); + } else if (Utils.ltrim(this.currentLine).charAt(0) === '#') { + + } else if (0 === indent) { + this.moveToPreviousLine(); + break; + } else { + throw new ParseException('Indentation problem.', this.getRealCurrentLineNb() + 1, this.currentLine); + } + } + return data.join("\n"); + }; + + Parser.prototype.moveToNextLine = function() { + if (this.currentLineNb >= this.lines.length - 1) { + return false; + } + this.currentLine = this.lines[++this.currentLineNb]; + return true; + }; + + Parser.prototype.moveToPreviousLine = function() { + this.currentLine = this.lines[--this.currentLineNb]; + }; + + Parser.prototype.parseValue = function(value, exceptionOnInvalidType, objectDecoder) { + var e, error, foldedIndent, matches, modifiers, pos, ref, ref1, val; + if (0 === value.indexOf('*')) { + pos = value.indexOf('#'); + if (pos !== -1) { + value = value.substr(1, pos - 2); + } else { + value = value.slice(1); + } + if (this.refs[value] === void 0) { + throw new ParseException('Reference "' + value + '" does not exist.', this.currentLine); + } + return this.refs[value]; + } + if (matches = this.PATTERN_FOLDED_SCALAR_ALL.exec(value)) { + modifiers = (ref = matches.modifiers) != null ? ref : ''; + foldedIndent = Math.abs(parseInt(modifiers)); + if (isNaN(foldedIndent)) { + foldedIndent = 0; + } + val = this.parseFoldedScalar(matches.separator, this.PATTERN_DECIMAL.replace(modifiers, ''), foldedIndent); + if (matches.type != null) { + Inline.configure(exceptionOnInvalidType, objectDecoder); + return Inline.parseScalar(matches.type + ' ' + val); + } else { + return val; + } + } + if ((ref1 = value.charAt(0)) === '[' || ref1 === '{' || ref1 === '"' || ref1 === "'") { + while (true) { + try { + return Inline.parse(value, exceptionOnInvalidType, objectDecoder); + } catch (error) { + e = error; + if (e instanceof ParseMore && this.moveToNextLine()) { + value += "\n" + Utils.trim(this.currentLine, ' '); + } else { + e.parsedLine = this.getRealCurrentLineNb() + 1; + e.snippet = this.currentLine; + throw e; + } + } + } + } else { + if (this.isNextLineIndented()) { + value += "\n" + this.getNextEmbedBlock(); + } + return Inline.parse(value, exceptionOnInvalidType, objectDecoder); + } + }; + + Parser.prototype.parseFoldedScalar = function(separator, indicator, indentation) { + var isCurrentLineBlank, j, len, line, matches, newText, notEOF, pattern, ref, text; + if (indicator == null) { + indicator = ''; + } + if (indentation == null) { + indentation = 0; + } + notEOF = this.moveToNextLine(); + if (!notEOF) { + return ''; + } + isCurrentLineBlank = this.isCurrentLineBlank(); + text = ''; + while (notEOF && isCurrentLineBlank) { + if (notEOF = this.moveToNextLine()) { + text += "\n"; + isCurrentLineBlank = this.isCurrentLineBlank(); + } + } + if (0 === indentation) { + if (matches = this.PATTERN_INDENT_SPACES.exec(this.currentLine)) { + indentation = matches[0].length; + } + } + if (indentation > 0) { + pattern = this.PATTERN_FOLDED_SCALAR_BY_INDENTATION[indentation]; + if (pattern == null) { + pattern = new Pattern('^ {' + indentation + '}(.*)$'); + Parser.prototype.PATTERN_FOLDED_SCALAR_BY_INDENTATION[indentation] = pattern; + } + while (notEOF && (isCurrentLineBlank || (matches = pattern.exec(this.currentLine)))) { + if (isCurrentLineBlank) { + text += this.currentLine.slice(indentation); + } else { + text += matches[1]; + } + if (notEOF = this.moveToNextLine()) { + text += "\n"; + isCurrentLineBlank = this.isCurrentLineBlank(); + } + } + } else if (notEOF) { + text += "\n"; + } + if (notEOF) { + this.moveToPreviousLine(); + } + if ('>' === separator) { + newText = ''; + ref = text.split("\n"); + for (j = 0, len = ref.length; j < len; j++) { + line = ref[j]; + if (line.length === 0 || line.charAt(0) === ' ') { + newText = Utils.rtrim(newText, ' ') + line + "\n"; + } else { + newText += line + ' '; + } + } + text = newText; + } + if ('+' !== indicator) { + text = Utils.rtrim(text); + } + if ('' === indicator) { + text = this.PATTERN_TRAILING_LINES.replace(text, "\n"); + } else if ('-' === indicator) { + text = this.PATTERN_TRAILING_LINES.replace(text, ''); + } + return text; + }; + + Parser.prototype.isNextLineIndented = function(ignoreComments) { + var EOF, currentIndentation, ret; + if (ignoreComments == null) { + ignoreComments = true; + } + currentIndentation = this.getCurrentLineIndentation(); + EOF = !this.moveToNextLine(); + if (ignoreComments) { + while (!EOF && this.isCurrentLineEmpty()) { + EOF = !this.moveToNextLine(); + } + } else { + while (!EOF && this.isCurrentLineBlank()) { + EOF = !this.moveToNextLine(); + } + } + if (EOF) { + return false; + } + ret = false; + if (this.getCurrentLineIndentation() > currentIndentation) { + ret = true; + } + this.moveToPreviousLine(); + return ret; + }; + + Parser.prototype.isCurrentLineEmpty = function() { + var trimmedLine; + trimmedLine = Utils.trim(this.currentLine, ' '); + return trimmedLine.length === 0 || trimmedLine.charAt(0) === '#'; + }; + + Parser.prototype.isCurrentLineBlank = function() { + return '' === Utils.trim(this.currentLine, ' '); + }; + + Parser.prototype.isCurrentLineComment = function() { + var ltrimmedLine; + ltrimmedLine = Utils.ltrim(this.currentLine, ' '); + return ltrimmedLine.charAt(0) === '#'; + }; + + Parser.prototype.cleanup = function(value) { + var count, i, indent, j, l, len, len1, line, lines, ref, ref1, ref2, smallestIndent, trimmedValue; + if (value.indexOf("\r") !== -1) { + value = value.split("\r\n").join("\n").split("\r").join("\n"); + } + count = 0; + ref = this.PATTERN_YAML_HEADER.replaceAll(value, ''), value = ref[0], count = ref[1]; + this.offset += count; + ref1 = this.PATTERN_LEADING_COMMENTS.replaceAll(value, '', 1), trimmedValue = ref1[0], count = ref1[1]; + if (count === 1) { + this.offset += Utils.subStrCount(value, "\n") - Utils.subStrCount(trimmedValue, "\n"); + value = trimmedValue; + } + ref2 = this.PATTERN_DOCUMENT_MARKER_START.replaceAll(value, '', 1), trimmedValue = ref2[0], count = ref2[1]; + if (count === 1) { + this.offset += Utils.subStrCount(value, "\n") - Utils.subStrCount(trimmedValue, "\n"); + value = trimmedValue; + value = this.PATTERN_DOCUMENT_MARKER_END.replace(value, ''); + } + lines = value.split("\n"); + smallestIndent = -1; + for (j = 0, len = lines.length; j < len; j++) { + line = lines[j]; + if (Utils.trim(line, ' ').length === 0) { + continue; + } + indent = line.length - Utils.ltrim(line).length; + if (smallestIndent === -1 || indent < smallestIndent) { + smallestIndent = indent; + } + } + if (smallestIndent > 0) { + for (i = l = 0, len1 = lines.length; l < len1; i = ++l) { + line = lines[i]; + lines[i] = line.slice(smallestIndent); + } + value = lines.join("\n"); + } + return value; + }; + + Parser.prototype.isNextLineUnIndentedCollection = function(currentIndentation) { + var notEOF, ret; + if (currentIndentation == null) { + currentIndentation = null; + } + if (currentIndentation == null) { + currentIndentation = this.getCurrentLineIndentation(); + } + notEOF = this.moveToNextLine(); + while (notEOF && this.isCurrentLineEmpty()) { + notEOF = this.moveToNextLine(); + } + if (false === notEOF) { + return false; + } + ret = false; + if (this.getCurrentLineIndentation() === currentIndentation && this.isStringUnIndentedCollectionItem(this.currentLine)) { + ret = true; + } + this.moveToPreviousLine(); + return ret; + }; + + Parser.prototype.isStringUnIndentedCollectionItem = function() { + return this.currentLine === '-' || this.currentLine.slice(0, 2) === '- '; + }; + + return Parser; + + })(); + + module.exports = Parser; + + + }, { + "./Exception/ParseException": 4, + "./Exception/ParseMore": 5, + "./Inline": 6, + "./Pattern": 8, + "./Utils": 10 + }], + 8: [function(require, module, exports) { + var Pattern; + + Pattern = (function() { + Pattern.prototype.regex = null; + + Pattern.prototype.rawRegex = null; + + Pattern.prototype.cleanedRegex = null; + + Pattern.prototype.mapping = null; + + function Pattern(rawRegex, modifiers) { + var _char, capturingBracketNumber, cleanedRegex, i, len, mapping, name, part, subChar; + if (modifiers == null) { + modifiers = ''; + } + cleanedRegex = ''; + len = rawRegex.length; + mapping = null; + capturingBracketNumber = 0; + i = 0; + while (i < len) { + _char = rawRegex.charAt(i); + if (_char === '\\') { + cleanedRegex += rawRegex.slice(i, +(i + 1) + 1 || 9e9); + i++; + } else if (_char === '(') { + if (i < len - 2) { + part = rawRegex.slice(i, +(i + 2) + 1 || 9e9); + if (part === '(?:') { + i += 2; + cleanedRegex += part; + } else if (part === '(?<') { + capturingBracketNumber++; + i += 2; + name = ''; + while (i + 1 < len) { + subChar = rawRegex.charAt(i + 1); + if (subChar === '>') { + cleanedRegex += '('; + i++; + if (name.length > 0) { + if (mapping == null) { + mapping = {}; + } + mapping[name] = capturingBracketNumber; + } + break; + } else { + name += subChar; + } + i++; + } + } else { + cleanedRegex += _char; + capturingBracketNumber++; + } + } else { + cleanedRegex += _char; + } + } else { + cleanedRegex += _char; + } + i++; + } + this.rawRegex = rawRegex; + this.cleanedRegex = cleanedRegex; + this.regex = new RegExp(this.cleanedRegex, 'g' + modifiers.replace('g', '')); + this.mapping = mapping; + } + + Pattern.prototype.exec = function(str) { + var index, matches, name, ref; + this.regex.lastIndex = 0; + matches = this.regex.exec(str); + if (matches == null) { + return null; + } + if (this.mapping != null) { + ref = this.mapping; + for (name in ref) { + index = ref[name]; + matches[name] = matches[index]; + } + } + return matches; + }; + + Pattern.prototype.test = function(str) { + this.regex.lastIndex = 0; + return this.regex.test(str); + }; + + Pattern.prototype.replace = function(str, replacement) { + this.regex.lastIndex = 0; + return str.replace(this.regex, replacement); + }; + + Pattern.prototype.replaceAll = function(str, replacement, limit) { + var count; + if (limit == null) { + limit = 0; + } + this.regex.lastIndex = 0; + count = 0; + while (this.regex.test(str) && (limit === 0 || count < limit)) { + this.regex.lastIndex = 0; + str = str.replace(this.regex, replacement); + count++; + } + return [str, count]; + }; + + return Pattern; + + })(); + + module.exports = Pattern; + + + }, {}], + 9: [function(require, module, exports) { + var Pattern, Unescaper, Utils; + + Utils = require('./Utils'); + + Pattern = require('./Pattern'); + + Unescaper = (function() { + function Unescaper() {} + + Unescaper.PATTERN_ESCAPED_CHARACTER = new Pattern( + '\\\\([0abt\tnvfre "\\/\\\\N_LP]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})'); + + Unescaper.unescapeSingleQuotedString = function(value) { + return value.replace(/\'\'/g, '\''); + }; + + Unescaper.unescapeDoubleQuotedString = function(value) { + if (this._unescapeCallback == null) { + this._unescapeCallback = (function(_this) { + return function(str) { + return _this.unescapeCharacter(str); + }; + })(this); + } + return this.PATTERN_ESCAPED_CHARACTER.replace(value, this._unescapeCallback); + }; + + Unescaper.unescapeCharacter = function(value) { + var ch; + ch = String.fromCharCode; + switch (value.charAt(1)) { + case '0': + return ch(0); + case 'a': + return ch(7); + case 'b': + return ch(8); + case 't': + return "\t"; + case "\t": + return "\t"; + case 'n': + return "\n"; + case 'v': + return ch(11); + case 'f': + return ch(12); + case 'r': + return ch(13); + case 'e': + return ch(27); + case ' ': + return ' '; + case '"': + return '"'; + case '/': + return '/'; + case '\\': + return '\\'; + case 'N': + return ch(0x0085); + case '_': + return ch(0x00A0); + case 'L': + return ch(0x2028); + case 'P': + return ch(0x2029); + case 'x': + return Utils.utf8chr(Utils.hexDec(value.substr(2, 2))); + case 'u': + return Utils.utf8chr(Utils.hexDec(value.substr(2, 4))); + case 'U': + return Utils.utf8chr(Utils.hexDec(value.substr(2, 8))); + default: + return ''; + } + }; + + return Unescaper; + + })(); + + module.exports = Unescaper; + + + }, { + "./Pattern": 8, + "./Utils": 10 + }], + 10: [function(require, module, exports) { + var Pattern, Utils, + hasProp = {}.hasOwnProperty; + + Pattern = require('./Pattern'); + + Utils = (function() { + function Utils() {} + + Utils.REGEX_LEFT_TRIM_BY_CHAR = {}; + + Utils.REGEX_RIGHT_TRIM_BY_CHAR = {}; + + Utils.REGEX_SPACES = /\s+/g; + + Utils.REGEX_DIGITS = /^\d+$/; + + Utils.REGEX_OCTAL = /[^0-7]/gi; + + Utils.REGEX_HEXADECIMAL = /[^a-f0-9]/gi; + + Utils.PATTERN_DATE = new Pattern('^' + '(?[0-9][0-9][0-9][0-9])' + '-(?[0-9][0-9]?)' + + '-(?[0-9][0-9]?)' + '(?:(?:[Tt]|[ \t]+)' + '(?[0-9][0-9]?)' + ':(?[0-9][0-9])' + + ':(?[0-9][0-9])' + '(?:\.(?[0-9]*))?' + + '(?:[ \t]*(?Z|(?[-+])(?[0-9][0-9]?)' + '(?::(?[0-9][0-9]))?))?)?' + '$', 'i' + ); + + Utils.LOCAL_TIMEZONE_OFFSET = new Date().getTimezoneOffset() * 60 * 1000; + + Utils.trim = function(str, _char) { + var regexLeft, regexRight; + if (_char == null) { + _char = '\\s'; + } + regexLeft = this.REGEX_LEFT_TRIM_BY_CHAR[_char]; + if (regexLeft == null) { + this.REGEX_LEFT_TRIM_BY_CHAR[_char] = regexLeft = new RegExp('^' + _char + '' + _char + '*'); + } + regexLeft.lastIndex = 0; + regexRight = this.REGEX_RIGHT_TRIM_BY_CHAR[_char]; + if (regexRight == null) { + this.REGEX_RIGHT_TRIM_BY_CHAR[_char] = regexRight = new RegExp(_char + '' + _char + '*$'); + } + regexRight.lastIndex = 0; + return str.replace(regexLeft, '').replace(regexRight, ''); + }; + + Utils.ltrim = function(str, _char) { + var regexLeft; + if (_char == null) { + _char = '\\s'; + } + regexLeft = this.REGEX_LEFT_TRIM_BY_CHAR[_char]; + if (regexLeft == null) { + this.REGEX_LEFT_TRIM_BY_CHAR[_char] = regexLeft = new RegExp('^' + _char + '' + _char + '*'); + } + regexLeft.lastIndex = 0; + return str.replace(regexLeft, ''); + }; + + Utils.rtrim = function(str, _char) { + var regexRight; + if (_char == null) { + _char = '\\s'; + } + regexRight = this.REGEX_RIGHT_TRIM_BY_CHAR[_char]; + if (regexRight == null) { + this.REGEX_RIGHT_TRIM_BY_CHAR[_char] = regexRight = new RegExp(_char + '' + _char + '*$'); + } + regexRight.lastIndex = 0; + return str.replace(regexRight, ''); + }; + + Utils.isEmpty = function(value) { + return !value || value === '' || value === '0' || (value instanceof Array && value.length === 0) || this.isEmptyObject( + value); + }; + + Utils.isEmptyObject = function(value) { + var k; + return value instanceof Object && ((function() { + var results; + results = []; + for (k in value) { + if (!hasProp.call(value, k)) continue; + results.push(k); + } + return results; + })()).length === 0; + }; + + Utils.subStrCount = function(string, subString, start, length) { + var c, i, j, len, ref, sublen; + c = 0; + string = '' + string; + subString = '' + subString; + if (start != null) { + string = string.slice(start); + } + if (length != null) { + string = string.slice(0, length); + } + len = string.length; + sublen = subString.length; + for (i = j = 0, ref = len; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) { + if (subString === string.slice(i, sublen)) { + c++; + i += sublen - 1; + } + } + return c; + }; + + Utils.isDigits = function(input) { + this.REGEX_DIGITS.lastIndex = 0; + return this.REGEX_DIGITS.test(input); + }; + + Utils.octDec = function(input) { + this.REGEX_OCTAL.lastIndex = 0; + return parseInt((input + '').replace(this.REGEX_OCTAL, ''), 8); + }; + + Utils.hexDec = function(input) { + this.REGEX_HEXADECIMAL.lastIndex = 0; + input = this.trim(input); + if ((input + '').slice(0, 2) === '0x') { + input = (input + '').slice(2); + } + return parseInt((input + '').replace(this.REGEX_HEXADECIMAL, ''), 16); + }; + + Utils.utf8chr = function(c) { + var ch; + ch = String.fromCharCode; + if (0x80 > (c %= 0x200000)) { + return ch(c); + } + if (0x800 > c) { + return ch(0xC0 | c >> 6) + ch(0x80 | c & 0x3F); + } + if (0x10000 > c) { + return ch(0xE0 | c >> 12) + ch(0x80 | c >> 6 & 0x3F) + ch(0x80 | c & 0x3F); + } + return ch(0xF0 | c >> 18) + ch(0x80 | c >> 12 & 0x3F) + ch(0x80 | c >> 6 & 0x3F) + ch(0x80 | c & 0x3F); + }; + + Utils.parseBoolean = function(input, strict) { + var lowerInput; + if (strict == null) { + strict = true; + } + if (typeof input === 'string') { + lowerInput = input.toLowerCase(); + if (!strict) { + if (lowerInput === 'no') { + return false; + } + } + if (lowerInput === '0') { + return false; + } + if (lowerInput === 'false') { + return false; + } + if (lowerInput === '') { + return false; + } + return true; + } + return !!input; + }; + + Utils.isNumeric = function(input) { + this.REGEX_SPACES.lastIndex = 0; + return typeof input === 'number' || typeof input === 'string' && !isNaN(input) && input.replace(this.REGEX_SPACES, + '') !== ''; + }; + + Utils.stringToDate = function(str) { + var date, day, fraction, hour, info, minute, month, second, tz_hour, tz_minute, tz_offset, year; + if (!(str != null ? str.length : void 0)) { + return null; + } + info = this.PATTERN_DATE.exec(str); + if (!info) { + return null; + } + year = parseInt(info.year, 10); + month = parseInt(info.month, 10) - 1; + day = parseInt(info.day, 10); + if (info.hour == null) { + date = new Date(Date.UTC(year, month, day)); + return date; + } + hour = parseInt(info.hour, 10); + minute = parseInt(info.minute, 10); + second = parseInt(info.second, 10); + if (info.fraction != null) { + fraction = info.fraction.slice(0, 3); + while (fraction.length < 3) { + fraction += '0'; + } + fraction = parseInt(fraction, 10); + } else { + fraction = 0; + } + if (info.tz != null) { + tz_hour = parseInt(info.tz_hour, 10); + if (info.tz_minute != null) { + tz_minute = parseInt(info.tz_minute, 10); + } else { + tz_minute = 0; + } + tz_offset = (tz_hour * 60 + tz_minute) * 60000; + if ('-' === info.tz_sign) { + tz_offset *= -1; + } + } + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + if (tz_offset) { + date.setTime(date.getTime() - tz_offset); + } + return date; + }; + + Utils.strRepeat = function(str, number) { + var i, res; + res = ''; + i = 0; + while (i < number) { + res += str; + i++; + } + return res; + }; + + Utils.getStringFromFile = function(path, callback) { + var data, fs, j, len1, name, ref, req, xhr; + if (callback == null) { + callback = null; + } + xhr = null; + if (typeof window !== "undefined" && window !== null) { + if (window.XMLHttpRequest) { + xhr = new XMLHttpRequest(); + } else if (window.ActiveXObject) { + ref = ["Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.3.0", "Msxml2.XMLHTTP", "Microsoft.XMLHTTP"]; + for (j = 0, len1 = ref.length; j < len1; j++) { + name = ref[j]; + try { + xhr = new ActiveXObject(name); + } catch (undefined) {} + } + } + } + if (xhr != null) { + if (callback != null) { + xhr.onreadystatechange = function() { + if (xhr.readyState === 4) { + if (xhr.status === 200 || xhr.status === 0) { + return callback(xhr.responseText); + } else { + return callback(null); + } + } + }; + xhr.open('GET', path, true); + return xhr.send(null); + } else { + xhr.open('GET', path, false); + xhr.send(null); + if (xhr.status === 200 || xhr.status === 0) { + return xhr.responseText; + } + return null; + } + } else { + req = require; + fs = req('fs'); + if (callback != null) { + return fs.readFile(path, function(err, data) { + if (err) { + return callback(null); + } else { + return callback(String(data)); + } + }); + } else { + data = fs.readFileSync(path); + if (data != null) { + return String(data); + } + return null; + } + } + }; + + return Utils; + + })(); + + module.exports = Utils; + + + }, { + "./Pattern": 8 + }], + 11: [function(require, module, exports) { + var Dumper, Parser, Utils, Yaml; + + Parser = require('./Parser'); + + Dumper = require('./Dumper'); + + Utils = require('./Utils'); + + Yaml = (function() { + function Yaml() {} + + Yaml.parse = function(input, exceptionOnInvalidType, objectDecoder) { + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = false; + } + if (objectDecoder == null) { + objectDecoder = null; + } + return new Parser().parse(input, exceptionOnInvalidType, objectDecoder); + }; + + Yaml.parseFile = function(path, callback, exceptionOnInvalidType, objectDecoder) { + var input; + if (callback == null) { + callback = null; + } + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = false; + } + if (objectDecoder == null) { + objectDecoder = null; + } + if (callback != null) { + return Utils.getStringFromFile(path, (function(_this) { + return function(input) { + var result; + result = null; + if (input != null) { + result = _this.parse(input, exceptionOnInvalidType, objectDecoder); + } + callback(result); + }; + })(this)); + } else { + input = Utils.getStringFromFile(path); + if (input != null) { + return this.parse(input, exceptionOnInvalidType, objectDecoder); + } + return null; + } + }; + + Yaml.dump = function(input, inline, indent, exceptionOnInvalidType, objectEncoder) { + var yaml; + if (inline == null) { + inline = 2; + } + if (indent == null) { + indent = 4; + } + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = false; + } + if (objectEncoder == null) { + objectEncoder = null; + } + yaml = new Dumper(); + yaml.indentation = indent; + return yaml.dump(input, inline, 0, exceptionOnInvalidType, objectEncoder); + }; + + Yaml.stringify = function(input, inline, indent, exceptionOnInvalidType, objectEncoder) { + return this.dump(input, inline, indent, exceptionOnInvalidType, objectEncoder); + }; + + Yaml.load = function(path, callback, exceptionOnInvalidType, objectDecoder) { + return this.parseFile(path, callback, exceptionOnInvalidType, objectDecoder); + }; + + return Yaml; + + })(); + + if (typeof window !== "undefined" && window !== null) { + window.YAML = Yaml; + } + + if (typeof window === "undefined" || window === null) { + this.YAML = Yaml; + } + + module.exports = Yaml; + + + }, { + "./Dumper": 1, + "./Parser": 7, + "./Utils": 10 + }] +}, {}, [11]); diff --git a/static/component/pear/pear.js b/static/component/pear/pear.js new file mode 100644 index 000000000..011f9a085 --- /dev/null +++ b/static/component/pear/pear.js @@ -0,0 +1 @@ +window.rootPath = (function(src) { src = document.scripts[document.scripts.length - 1].src; return src.substring(0, src.lastIndexOf("/") + 1); })(); layui.config({ base: rootPath + "module/", version: "3.9.5" }).extend({ admin: "admin", menu: "menu", frame: "frame", tab: "tab", echarts: "echarts", echartsTheme: "echartsTheme", hash: "hash", select: "select", drawer: "drawer", notice: "notice", step:"step", tag:"tag", popup:"popup", treetable:"treetable", dtree:"dtree", tinymce:"tinymce/tinymce", area:"area", count:"count", topBar: "topBar", button: "button", design: "design", card: "card", loading: "loading", cropper:"cropper", convert:"convert", yaml:"yaml", context: "context", http: "http", theme: "theme", message: "message", toast: "toast" }).use(['layer', 'theme'], function () { layui.theme.changeTheme(window, false); }); \ No newline at end of file diff --git a/static/css/admin.css b/static/css/admin.css new file mode 100644 index 000000000..8081aa6eb --- /dev/null +++ b/static/css/admin.css @@ -0,0 +1 @@ +html, body, .layui-layout { height: 100%; } .pear-admin .layui-header, .pear-admin .layui-body, .pear-admin .layui-logo, .pear-admin .layui-side, .pear-admin .layui-header .layui-layout-left { transition: all .3s; } .pear-admin.banner-layout .layui-side { top: 60px!important; } .pear-admin.banner-layout .layui-side .layui-logo { display: none; } .pear-admin.banner-layout .layui-header .layui-logo { display: inline-block; } .pear-admin.banner-layout .layui-side .layui-side-scroll { height: 100%!important; } .pear-admin.banner-layout .layui-side .layui-side-scroll { height: 100%!important; } .pear-admin .layui-header.dark-theme .layui-layout-control .layui-this *{ background-color: rgba(0,0,0,.1)!important; } .pear-admin.banner-layout .layui-header { z-index: 99999; width: 100%; left: 0px; } .pear-admin.banner-layout .layui-header .layui-layout-left { left: 230px; } .pear-admin.banner-layout .layui-header .layui-logo .title { top: 2px; } .pear-admin.banner-layout .layui-header .layui-layout-control { display: inline-block; left: 370px; } .pear-admin.banner-layout .layui-header.dark-theme { box-shadow: 2px 0 6px rgb(0 21 41 / 35%); } .pear-admin .layui-header .layui-logo { display: none; } .pear-admin .layui-logo .title { font-size: 20px; } .pear-admin .layui-layout-right .layui-nav-child { border: 1px solid whitesmoke; border-radius: 4px; width: 150px; } .pear-admin .layui-header { left: 230px; width: calc(100% - 230px); background-color: white; border-bottom: 1px solid whitesmoke; } .pear-admin .layui-layout-control { left: 140px; position: absolute; } .pear-admin .layui-layout-control .layui-nav { padding: 0px; } .pear-admin .layui-logo { width: 230px; height: 59px; line-height: 59px; position: relative; background-color: #28333E; border-bottom: 1px solid rgba(0, 0, 0, .12); } .pear-admin .layui-logo img { width: 34px; height: 34px; } .pear-admin .layui-logo .title { font-size: 21px; font-weight: 550; color: #5FB878; position: relative; top: 5px; margin-left: 5px; } .pear-admin .layui-logo .logo { display: none; } .pear-admin .layui-side { top: 0px; width: 230px; box-shadow: 2px 0 6px rgba(0, 21, 41, .35); z-index: 9999; } .pear-admin .layui-side-scroll::-webkit-scrollbar { width: 0px; height: 0px; } .pear-admin .layui-side-scroll { height: calc(100% - 60px) !important; background-color: #28333E; width: 247px; } .pear-admin .layui-header .layui-nav .layui-nav-item>a { color: black; font-size: 15px; } .pear-admin .layui-body { left: 230px; bottom: 0px; padding-bottom: 0px; } .pear-admin .layui-layout-left { left: 0px; } /** 收缩布局 */ .pear-mini .layui-side .layui-logo .title { display: none; } .pear-mini .layui-side .layui-logo .logo { display: inline-block; } .pear-mini .layui-side { width: 60px; } .pear-mini .layui-header { left: 60px; width: calc(100% - 60px); } .pear-mini .layui-body { left: 60px; } .pear-mini .layui-side .layui-logo { width: 60px; } .pear-mini .layui-nav-tree .layui-nav-item span { display: none; } .pear-mini .bottom-nav li { width: 100% !important; } .pear-mini .layui-side-scroll { height: calc(100% - 60px); } .pear-admin .layui-header .layui-nav .layui-nav-bar { top: 0px !important; height: 2px !important; background-color: #5FB878; } .pear-admin .layui-header .layui-nav .layui-this:after { display: none; } .pear-admin .layui-header .layui-nav-more { display: none; } .pear-collasped-pe { display: none; width: 50px; position: absolute; z-index: 400000; bottom: 30px; right: 30px; background-color: #5FB878 !important; height: 50px; line-height: 50px; text-align: center; border-radius: 50px; box-shadow: 2px 0 6px rgba(0, 21, 41, .35); } .pear-collasped-pe a { color: white !important; } @media screen and (min-width: 768px) { .layui-hide-sm { display: inline-block !important; } } @media screen and (min-width: 769px) { .layui-hide-sm { display: none !important; } } /** 新增兼容 */ @media screen and (max-width:768px) { .collaspe { display: none !important; } .pear-collasped-pe { display: inline-block !important; } .layui-layout-control { left: 45px !important; } .layui-layout-left { padding-left: 10px; padding-right: 10px; } .pear-mini .bottom-nav { display: none; } .pear-mini .layui-side-scroll { height: calc(100% - 62px); } .pear-mini .layui-side { width: 0px; } .pear-mini .layui-header { left: 0px; width: 100%; } .pear-mini .layui-body { left: 0px; } .pear-mini .layui-logo { width: 0px; } .pear-admin .layui-body { left: 0px; } .pear-admin .layui-header { left: 0px; width: 100%; } .pear-admin .pear-cover { width: 100%; height: 100%; background-color: #1E1E1E; display: block; position: absolute; z-index: 1000; opacity: 0; margin-top: -60px; } .pear-mini .pear-cover { display: none; } } @-webkit-keyframes am-horizontal-roll_show { 0% { opacity: 1; -webkit-transform: translateX(2000px); transform: translateX(2000px) } 100% { opacity: 1; -webkit-transform: translateX(0); transform: translateX(0) } } @keyframes am-horizontal-roll_show { 0% { opacity: 1; -webkit-transform: translateX(800px); -ms-transform: translateX(800px); transform: translateX(800px) } 100% { opacity: 1; -webkit-transform: translateX(0); -ms-transform: translateX(0); transform: translateX(0) } } .layer-anim-right { -webkit-animation: am-horizontal-roll_show .6s ease-out; animation: am-horizontal-roll_show .6s ease-out; } /** 侧边主题 (亮) */ .light-theme.layui-side { box-shadow: 2px 0 8px 0 rgba(29, 35, 41, .05) !important; } .light-theme.layui-side .layui-logo { background-color: white !important; color: black !important; border-bottom: 1px whitesmoke solid; } .light-theme.layui-side .layui-side-scroll { background-color: white !important; color: black !important; } .dark-theme.layui-header { border-bottom: none; background-color: #28333E; color: whitesmoke; } .dark-theme.layui-header li>a{ color: whitesmoke!important; } .dark-theme.layui-header .layui-logo { box-shadow: none; border: none; } /** 顶部主题 (白) */ .light-theme.layui-header .layui-logo { background-color: white; border: none; box-shadow: none; } /** 主题面板 */ .pearone-color .set-text { height: 42px; line-height: 42px; } .pearone-color .color-title { padding: 15px 0 0px 20px; margin-bottom: 4px; } .pearone-color .color-content { padding: 15px 10px 0 20px; } .pearone-color .color-content ul { list-style: none; padding: 0px; } .pearone-color .color-content ul li { position: relative; display: inline-block; vertical-align: top; width: 70px; height: 50px; margin: 0 20px 20px 0; padding: 2px 2px 2px 2px; background-color: #f2f2f2; cursor: pointer; font-size: 12px; color: #666; } .pearone-color .color-content li.layui-this:after, .pearone-color .color-content li:hover:after { width: 100%; height: 100%; padding: 4px; top: -5px; left: -5px; border: #5FB878 2px solid; opacity: 1; border-radius: 4px; } .pearone-color .color-content li:after { content: ''; position: absolute; z-index: 20; top: 50%; left: 50%; width: 1px; height: 0; border: 2px solid #F2F2F2; transition: all .3s; -webkit-transition: all .3s; opacity: 0; } .select-color { margin-bottom: 30px; } .select-color .select-color-title { padding: 15px 0 0px 20px; margin-bottom: 4px; } .select-color .select-color-content { padding: 20px 0 0px 0px; margin-bottom: 4px; } .select-color .select-color-content .select-color-item { background-color: gray; width: 30px; height: 30px; border-radius: 3px; float: left; margin-left: 20px; color: white; font-size: 18px; text-align: center; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .15); line-height: 30px; } \ No newline at end of file diff --git a/static/css/admin_style.css b/static/css/admin_style.css index 229649ca9..8072d6cb9 100644 --- a/static/css/admin_style.css +++ b/static/css/admin_style.css @@ -1,349 +1 @@ -/*后台图标*/ - -body{background-color:#fff; font-family:"微软雅黑"; } -.fl{float:left;} -.fr{float:right;} -.nobg{background-color:transparent!important} -.font12{font-size:12px!important;} -.font18{font-size:18px!important;} -.font20{font-size:20px!important;} -.mag0{ margin:0 !important; } -.m5{margin: 5px auto; } -.m10{margin: 10px auto; } -.mt5{margin-top:5px;} -.mt10{margin-top:10px;} -.ml10{margin-left:10px;} -.ml20{margin-left:20px;} -.ml30{margin-left:30px;} -.mr10{margin-right:10px;} -.mr20{margin-right:20px;} -.mb5{margin-bottom:5px;} -.mb10{margin-bottom:10px;} -.mb20{margin-bottom:20px;} -.m10{margin: 10px;} -.m20{margin: 20px;} -.pl20{padding-left:20px;} -.pl50{padding-left:50px;} -.pb10{padding-bottom:10px;} -.pb50{padding-bottom:50px;} -.p10{padding:10px;} -.p20{padding:20px;} -.w50{width:50px!important;} -.w60{width:60px!important;} -.w70{width:70px!important;} -.w80{width:80px!important;} -.w100{width:100px!important;} -.w110{width:110px!important;} -.w120{width:120px!important;} -.w150{width:150px!important;} -.w200{width:200px!important;} -.w300{width:300px!important;} -.w350{width:350px!important;} -.w400{width:400px!important;} -.w500{width:500px!important;} -.w600{width:600px!important;} -.w700{width:700px!important;} -.w800{width:800px!important;} -.w900{width:900px!important;} -.lh30{ height: 30px; line-height: 30px; } -.lh40{ height: 40px; line-height: 40px; } -.mcolor{color:#5c90d2;} -.mcolor2{color:#009688;} -.hide{display:none;} -.red{color:#f00;} -.green{ color: #008800; } -.center{ text-align:center; } -#form-icon-preview{float:left;width:34px;height:36px;line-height:36px;font-size:30px!important;border:1px solid #e6e6e6;text-align:center;border-radius:3px;} -.j-iframe-pop{margin:0 10px;} -.help-tips{cursor:pointer;} -.layui-layer-page .layui-layer-content {overflow: inherit !important;} -.page-container .layui-tab-content { padding: 15px 30px 0 30px; } - -/*登录面板*/ -.login-body {background-color:#f5f5f5;} -.login-head a{color:#fff;!important;} -.login-body .login-box h3{color:#444;font-size:22px;font-weight:100;text-align:center} -.login-head{position:fixed;left:0;top:0;width:80%;height:60px;line-height:60px;background:#000;padding:0 10%;} -.login-head h1{color:#fff;font-size:20px;font-weight:600} -.login-box{margin:240px auto 0;width:400px;background-color:#fff;padding:15px 30px;border-radius:10px;box-shadow: 5px 5px 15px #999;} -.login-box .layui-input{font-size:15px;font-weight:400} -.login-box .layui-input[type=number]{display:inline-block;width:50%;vertical-align:top} -.login-box img{display:inline-block;width:46%;height:38px;border:none;vertical-align:top;cursor:pointer;margin-left:4%} -.login-box input[name="password"]{letter-spacing:5px;font-weight:800} -.login-box .layui-btn{width:100%;} -.login-box .copyright{text-align:center;height:50px;line-height:50px;font-size:12px;color:#ccc} -.login-box .copyright a{color:#ccc;} - - -/*主面板*/ -.layui-form-item{margin-bottom: 10px;} -.layui-form-pane .layui-form-label { padding: 8px 5px; } -.layui-layout-admin .layui-footer{ height:30px; line-height: 30px;} -.layui-header,.layui-side {z-index:99999} - -.header-logo {width:165px;height:60px;line-height:60px;text-indent:20px; color: transparent;font-size:18px;background-image: linear-gradient(135deg,#26A69A,#00ff13);-webkit-background-clip: text;} -.header-fold {width:50px;height:60px;line-height:60px;text-align:center;color:#fff;} -.header-fold a {color:#fff} -#foldSwitch{font-size:24px!important;} -.head-info .layui-nav-child {top:60px} -.head-info .layui-nav-item a {padding:0 10px} -.main-nav {padding:0} -.main-nav .layui-nav-item a {font-size:16px;padding:0;margin:0 15px} -.footer{line-height:44px;padding:0 10px;color:#666;} -.footer a{color:#5c90d2;} - - - -.hideMenu {float: left; width: 20px; height: 20px; margin-top: 15px; font-size: 17px; line-height: 20px; text-align: center; padding: 5px 5px; color: #fff; background-color: #1AA094; } -.hideMenu:hover{ color:#fff; } - -.topLevelMenus {float: left; } -.topLevelMenus .layui-nav-item.layui-this {background-color: rgba(0,0,0,0.5); } -.showMenu.layui-layout-admin .layui-side {left: -300px; transition: all .3s; -webkit-transition: all .3s; } -.showMenu .layui-body,.showMenu .layui-layout-admin .layui-footer {left: -2px; } - - - -#B_history {top: 0; position: absolute; border-bottom: none; left:80px; } -#top_tabs_box { - padding-right: 138px; - height: 40px; - border-bottom: 1px solid #e2e2e2; -} -.tab-right { - background: #fff; - right: 0px; - top: 0; - height: 40px; - width: 150px; - position: absolute; - text-align: center; -} - -.tab-go-refresh{z-index: 99;background: #fff;position: absolute; top: 0; width: 40px; height:40px; text-align: center; cursor: pointer; transition: all .3s; -webkit-transition: all .3s; box-sizing: border-box; border-right: 1px solid #e6e6e6;} -.tab-go-refresh i{ color: #666; font-size: 20px; line-height: 40px; cursor: pointer} -.tab-go-left {border-color: #e6e6e6; left:40px; top: 0; height: 40px; border-right: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6; width: 39px; position: absolute; text-align: center; background: #fff; z-index: 999; } -.tab-go-left i { color: #666; font-size: 20px; line-height: 40px; cursor: pointer; } -.tab-go-right {background: #fff; border-color: #e6e6e6; right: 60; top: 0; height: 40px; border-bottom: 1px solid #e6e6e6; width: 40px; position: absolute; text-align: center; border-left: 1px solid #e6e6e6; z-index: 999; border-right: 1px solid #e6e6e6; } -.tab-go-right i {cursor: pointer; color: #666; font-size: 20px; line-height: 40px; } - - - -.closeBox { - position: absolute; - right: 0; - background-color: #fff !important; - color: #000; - border-left: 1px solid #e2e2e2; - border-bottom: 1px solid #e2e2e2; -} -.closeBox .layui-nav-item { - height: 40px; - line-height: 40px; -} -/*页面操作*/ -.closeBox .layui-nav-child {top: 42px; left: -12px; } -.closeBox .layui-nav-item>a, .closeBox .layui-nav-item>a:hover {color: #000; } -.closeBox a span.layui-nav-more {border-color: #333 transparent transparent; } -.closeBox a span.layui-nav-more.layui-nav-mored{ border-color:transparent transparent #333;} -.closeBox a i.caozuo {font-size: 16px; position: absolute; top: 1px; left: 0; } - - -.bread-crumbs{display:block;background-color:#f9f9f9;padding:10px 0 0 10px;height:30px;overflow:hidden;} -.bread-crumbs li{float:left;margin:0 5px;color:#666;height:30px;line-height:30px} -.bread-crumbs li a{color:#666;} -.page-body{display:block;margin:8px;overflow:auto;} -.page-body>.layui-tab{margin:0;} -.page-tab-content{background-color:#fff;overflow:auto;min-height:550px;} -/* 全屏 */ -.tool-btns{position:absolute;right:15px;top:11px;font-size:18px;color:#888} -.tool-btns .sys-icon{color:#999;margin-left:8px;} -.fullscreen{position:fixed;top: 0;right: 0;bottom: 0;left: 0;z-index:1090;margin-bottom: 0;overflow-y: auto;-webkit-overflow-scrolling: touch;-webkit-backface-visibility: hidden;backface-visibility: hidden;height:100%} -.fullscreen.page-body, -.fullscreen .layui-tab{margin:0;} -/* 页面工具栏 */ -.page-toolbar{display:block;overflow:hidden;} -.page-filter{height:40px;overflow:hidden;} -.page-filter .layui-form-pane .layui-form-label{width:auto;} -.page-filter .layui-form-pane .layui-form-item .layui-input-inline{margin-right:0;} -.page-tips{margin-bottom:10px;} -.page-tips .layui-colla-title{height:26px;line-height:26px;background-color:#f9f9f9;color:#999;} -.page-form{margin:10px 0;} -#layerTopTips{background-color:#393D49;color:#fff;padding:5px 25px;border-radius:0 0 5px 5px;} -/*分页*/ -.pagination{overflow:hidden;display:block;border-left:1px solid #eee;float:right;} -.pagination li{float:left;border:1px solid #eee;margin-left:-1px;font-size:16px;overflow:hidden;cursor:pointer;} -.pagination li a, -.pagination li span{display:block;padding:6px 18px;} -.pagination li.active{background-color:#393e49;color:#fff;border-color:#393e49;} - -/* 角色权限设置 */ -.role-list-form dl{display:block;} -.role-list-form-top{border:1px solid #f9f9f9;} -.role-list-form dl dt{display:block;background-color:#f9f9f9;padding:0px 10px 10px 10px;} -.role-list-form dl dd{display:block;padding:0px 15px;overflow:hidden;} -.role-list-form dl dd dl dt{background:none;} -.role-list-form dl dd dl dd{padding:0px 25px;} -.role-list-form dl dd dl dd {padding:0 35px;} -.role-list-form dl dd dl dd a{display:inline-block;} - -/* 系统菜单管理 */ -.menu-hd {font-size:14px;font-weight:400;border-top:1px dotted #eee} -.menu-dl dt,.menu-dl dd {position:relative;border:1px dotted #eee;border-top:0} -.menu-dl .hd,.menu-dl .hd2,.menu-dl .hd3,.menu-dl .layui-form-switch,.menu-btns {position:absolute;left:260px;top:4px} -.menu-dl .hd,.menu-dl .hd2,.menu-dl .hd3 {top:-26px} -.menu-dl .hd {left:280px} -.menu-dl .hd2 {left:520px} -.menu-dl .hd3 {left:710px} -.menu-dl .layui-form-switch {left:490px;top:1px;margin:0} -.menu-dl .menu-sort {position:absolute;left:260px;top:3px;height:20px;line-height:20px;width:40px;padding:0;text-align:center;color:#666;border:1px solid #e6e6e6;background-color:#fff;border-radius:2px} -.menu-dl1,.menu-dl2 {display:block} -.menu-dl1 dt,.menu-dl2 dt {padding:5px 2px} -.menu-dl2 {padding-left:20px} -.menu-dl2 dd {padding:5px 20px} -.menu-dl1 dt .menu-sort {left:280px} -.menu-dl2 dt .menu-sort {left:300px} -.menu-dl2 dd .menu-sort {left:340px} -.menu-dl1 .layui-form-switch {left:520px} -.menu-dl2 .layui-form-switch {left:500px} -.menu-btns {left:710px} -.menu-dl2 .menu-btns {left:688px} -.layui-nav-child dd:hover{background-color: #009688;color: #fff;} -/*数据列表页排序字段*/ -.input-sort{height:24px;line-height:24px;width:40px;padding:0;text-align:center;color:#666;} -/*模块、插件、支付平台列表*/ -.module-list-info{display:block;overflow:hidden;} -.module-list-info img{float:left;margin-right:10px;border-radius:10px;} -.module-list-info i{float:left;margin-right:10px;font-size:80px;line-height:82px;text-align:center;overflow:hidden;color:#2a95de;} -.module-list-info .txt{float:left;max-width:80%;overflow:hidden;} -.module-list-info .txt h3{font-weight:500;display:inline-block;} -.module-list-info .txt p{font-size:12px;} -.module-list-info .txt p span{color:#2a95de;} -/*弹窗底部bar*/ -.pop-bottom-bar{position:fixed;left:0;bottom:0;width:96%;background:#eee;padding:5px 2%;} -.pop-bottom-bar .pages{max-width:70%;overflow:hidden;} -.pop-bottom-bar .pages .pager{} -.pop-bottom-bar .pages .pager li{float:left;margin:0 5px;} -.pop-bottom-bar .pages .pager li a,.pop-bottom-bar .pages .pager li span{height:38px;line-height:38px;padding:0 10px;font-weight:500;display:inline-block;} - -.hook-plugins-sort{margin:10px 0 20px 0;border-top:1px dotted #eee;border-left:1px dotted #eee;border-right:1px dotted #eee;float:left;overflow:hidden;} -.hook-plugins-sort li{float:left;width:100%;padding:5px 10px;border-bottom:1px dotted #eee;overflow:hidden;} -.hook-plugins-sort li span{float:left;margin-right:20px;width:150px;height:20px;line-height:22px;} - -/*themes*/ -.themes{} -.themes li{float:left;width:360px;overflow:hidden;margin:10px 20px 10px 10px;} -.themes li img{float:left;border-radius:5px;padding:2px;border:1px solid #ddd;} -.themes li dl{float:right;width:190px;overflow:hidden;} -.themes li dd{line-height:28px;} -.themes li dt{margin-top:10px;} - -/* 锁屏 */ -.lock-screen{padding:20px;overflow:hidden;display:block;} -.lock-screen input{float:left;width:180px;background-color:#009688;border-color:#009688;color:#fff;font-size:16px;} -.lock-screen input::-webkit-input-placeholder{color:#fff;} -.lock-screen input:-moz-placeholder{color:#fff;} -.lock-screen input::-moz-placeholder{color:#fff;} -.lock-screen input:-ms-input-placeholder{color:#fff;} -.lock-screen button{float:left;margin-left:20px;} - -/* 漂浮图 */ -.showpic {position:absolute; width:120px; height:160px; text-align:center; line-height:150%; border:2px solid #DEEFFA; padding:5px; background:#FFFFFF; z-index:99999;} - -/* 升级窗体 */ -.update{background:#ffffff;padding:10px;clear: both;} -.update h1{border-bottom:1px solid #c8d8e6;font-size:14px;line-height: 25px;font-weight: bold;} - -/*插件中心*/ -.addon { - position: relative; - padding: 4px; - display: block; - margin-bottom: 17px; - line-height: 20px; - background-color: #fff; - border: 1px solid #ddd; -} -.addon-caption { - padding: 9px; - color: #333333; -} -.add-logo{ - display: block; - max-width: 100%; - height: 200px; -} - -/*金刚狼*/ -.layui-mobile.site-tree-mobile {position:absolute;left:2%;top:1px;color:white;background-color:transparent;height:60px;line-height:60px;} - -.header-top {display:none} -.size-14 {font-size:14px} -.size-16 {font-size:16px;} -.size-20 {font-size:20px;} -.layout-right {position:absolute;padding:0;color:#fff;border-radius:2px;font-size:0;box-sizing:border-box;right:0;} -.layout-right .nav-item {position:relative;display:inline-block;display:inline;zoom:1;vertical-align:middle;line-height:40px;} -.layout-right .nav-item a {font-size:16px;padding:0;margin:0 15px;color:#fff;} -.top-logo {background:none;border-bottom:0 solid transparent;position:absolute;top:0;z-index:1200;width:130px;left:20%;margin-left:-65px;font-size:17px;height:40px;line-height:40px;background-image:linear-gradient(135deg,#26A69A,#00ff13);-webkit-background-clip:text;color:transparent;} -.top-nav {} -.nav-item-ul {display:none;position:fixed;z-index:999999;top:40px;} -.drawer-body-right .nav-item-ul {display:block;} -@media screen and (max-width:768px) { - .site-mobile .layui-header .site-tree-mobile {display:block!important;color:#fff;} - .site-mobile .layui-header .site-tree-mobile .layui-icon{ background-color: rgba(0,0,0,0.28); - padding: 5px;} - .header-top .layui-layout-right {padding:0;} - .header-top {display:block;height:40px;} - .layui-layout-admin .layui-body {top:105px;bottom:44px;} - .bottom-nav {white-space:nowrap;overflow:scroll;position:relative;left:13%;width:87%;} -} - - - - - - - - - -.wapmenu{display:none;} -.mobileTopLevelMenus{display: none;float: left;} -@media screen and (max-width:1300px){ - .mobileTopLevelMenus{display: inline-block; } - .topLevelMenus{display: none !important; } -} -@media screen and (max-width: 768px) { - .layui-layout-admin .layui-side{left: -300px; transition: all .3s; -webkit-transition: all .3s;} - .site-tree-mobile{display: block!important; position: fixed; z-index: 100000; bottom: 20px; left: 10px; width: 40px; height: 40px; line-height: 40px; border-radius: 2px; text-align: center; background-color: rgba(0,0,0,.7); color: #fff;} - .site-mobile .site-tree-mobile{display: none !important;} - .site-mobile .layui-side{ left: 0px; z-index:1100; } - .site-mobile .site-mobile-shade{content: ''; position: fixed; top: 0; bottom: 0; left: 0; right: 0; background-color: rgba(0,0,0,.9); z-index: 999;} - .layui-body,.layui-layout-admin .layui-footer{ left:-2px; } -} -@media screen and (max-width: 720px){ - .hideMenu {display: none !important; } - .mobileTopLevelMenus{ padding:0;} - .winner-hide {display: none !important; } -} -@media screen and (max-width:480px){ - .header-logo{ display: none;} - .layui-nav .layui-nav-item a {} -} - -.topLevelMenus-winner {float: left;z-index:1100;position: absolute;left: -20px;top: 60px;width: 150px;} -.topLevelMenus-winner .layui-nav-item {background-color: #23262e; } -.topLevelMenus-winner .layui-nav-item.layui-this {background-color: rgba(0,0,0,0.5); } - -.screenshot_list div{float: left;position:relative;} -.screenshot_list div .del_screenshot{ - position: absolute; - background-color: aliceblue; - padding: 4px; - top: 5px; - right: 15px; -} -.screenshot_list div img { - width: 160px; - height: 92px; - margin: 0 10px 10px 0; -} \ No newline at end of file +/*后台图标*/ body{background-color:#fff; font-family:"微软雅黑"; } .fl{float:left;} .fr{float:right;} .nobg{background-color:transparent!important} .font12{font-size:12px!important;} .font18{font-size:18px!important;} .font20{font-size:20px!important;} .mag0{ margin:0 !important; } .m5{margin: 5px auto; } .m10{margin: 10px auto; } .mt5{margin-top:5px;} .mt10{margin-top:10px;} .ml10{margin-left:10px;} .ml20{margin-left:20px;} .ml30{margin-left:30px;} .mr10{margin-right:10px;} .mr20{margin-right:20px;} .mb5{margin-bottom:5px;} .mb10{margin-bottom:10px;} .mb20{margin-bottom:20px;} .m10{margin: 10px;} .m20{margin: 20px;} .pl20{padding-left:20px;} .pl50{padding-left:50px;} .pb10{padding-bottom:10px;} .pb50{padding-bottom:50px;} .p10{padding:10px;} .p20{padding:20px;} .w50{width:50px!important;} .w60{width:60px!important;} .w70{width:70px!important;} .w80{width:80px!important;} .w100{width:100px!important;} .w110{width:110px!important;} .w120{width:120px!important;} .w150{width:150px!important;} .w200{width:200px!important;} .w300{width:300px!important;} .w350{width:350px!important;} .w400{width:400px!important;} .w500{width:500px!important;} .w600{width:600px!important;} .w700{width:700px!important;} .w800{width:800px!important;} .w900{width:900px!important;} .lh30{ height: 30px; line-height: 30px; } .lh40{ height: 40px; line-height: 40px; } .mcolor{color:#5c90d2;} .mcolor2{color:#009688;} .hide{display:none;} .red{color:#f00;} .green{ color: #008800; } .center{ text-align:center; } #form-icon-preview{float:left;width:34px;height:36px;line-height:36px;font-size:30px!important;border:1px solid #e6e6e6;text-align:center;border-radius:3px;} .j-iframe-pop{margin:0 10px;} .help-tips{cursor:pointer;} .layui-layer-page .layui-layer-content {overflow: inherit !important;} .page-container .layui-tab-content { padding: 15px 30px 0 30px; } /*登录面板*/ .login-body {background-color:#f5f5f5;} .login-head a{color:#fff !important;} .login-body .login-box h3{color:#444;font-size:22px;font-weight:100;text-align:center} .login-head{position:fixed;left:0;top:0;width:80%;height:60px;line-height:60px;background:#000;padding:0 10%;} .login-head h1{color:#fff;font-size:20px;font-weight:600} .login-box{margin:240px auto 0;width:400px;background-color:#fff;padding:15px 30px;border-radius:10px;box-shadow: 5px 5px 15px #999;} .login-box .layui-input{font-size:15px;font-weight:400} .login-box .layui-input[type=number]{display:inline-block;width:50%;vertical-align:top} .login-box img{display:inline-block;width:46%;height:38px;border:none;vertical-align:top;cursor:pointer;margin-left:4%} .login-box input[name="password"]{letter-spacing:5px;font-weight:800} .login-box .layui-btn{width:100%;} .login-box .copyright{text-align:center;height:50px;line-height:50px;font-size:12px;color:#ccc} .login-box .copyright a{color:#ccc;} /*主面板*/ .layui-form-item{margin-bottom: 10px;} .layui-form-pane .layui-form-label { padding: 8px 5px; } .layui-layout-admin .layui-footer{ height:30px; line-height: 30px;} .layui-header,.layui-side {z-index:99999} .header-logo {width:165px;height:60px;line-height:60px;text-indent:20px; color: transparent;font-size:18px;background-image: linear-gradient(135deg,#26A69A,#00ff13);background-clip: text;-webkit-background-clip: text;} .header-fold {width:50px;height:60px;line-height:60px;text-align:center;color:#fff;} .header-fold a {color:#fff} #foldSwitch{font-size:24px!important;} .head-info .layui-nav-child {top:60px} .head-info .layui-nav-item a {padding:0 10px} .main-nav {padding:0} .main-nav .layui-nav-item a {font-size:16px;padding:0;margin:0 15px} .footer{line-height:44px;padding:0 10px;color:#666;} .footer a{color:#5c90d2;} .hideMenu {float: left; width: 20px; height: 20px; margin-top: 15px; font-size: 17px; line-height: 20px; text-align: center; padding: 5px 5px; color: #fff; background-color: #1AA094; } .hideMenu:hover{ color:#fff; } .topLevelMenus {float: left; } .topLevelMenus .layui-nav-item.layui-this {background-color: rgba(0,0,0,0.5); } .showMenu.layui-layout-admin .layui-side {left: -300px; transition: all .3s; -webkit-transition: all .3s; } .showMenu .layui-body,.showMenu .layui-layout-admin .layui-footer {left: -2px; } #B_history {top: 0; position: absolute; border-bottom: none; left:80px; } #top_tabs_box { padding-right: 138px; height: 40px; border-bottom: 1px solid #e2e2e2; } .tab-right { background: #fff; right: 0px; top: 0; height: 40px; width: 150px; position: absolute; text-align: center; } .tab-go-refresh{z-index: 99;background: #fff;position: absolute; top: 0; width: 40px; height:40px; text-align: center; cursor: pointer; transition: all .3s; -webkit-transition: all .3s; box-sizing: border-box; border-right: 1px solid #e6e6e6;} .tab-go-refresh i{ color: #666; font-size: 20px; line-height: 40px; cursor: pointer} .tab-go-left {border-color: #e6e6e6; left:40px; top: 0; height: 40px; border-right: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6; width: 39px; position: absolute; text-align: center; background: #fff; z-index: 999; } .tab-go-left i { color: #666; font-size: 20px; line-height: 40px; cursor: pointer; } .tab-go-right {background: #fff; border-color: #e6e6e6; right: 60; top: 0; height: 40px; border-bottom: 1px solid #e6e6e6; width: 40px; position: absolute; text-align: center; border-left: 1px solid #e6e6e6; z-index: 999; border-right: 1px solid #e6e6e6; } .tab-go-right i {cursor: pointer; color: #666; font-size: 20px; line-height: 40px; } .closeBox { position: absolute; right: 0; background-color: #fff !important; color: #000; border-left: 1px solid #e2e2e2; border-bottom: 1px solid #e2e2e2; } .closeBox .layui-nav-item { height: 40px; line-height: 40px; } /*页面操作*/ .closeBox .layui-nav-child {top: 42px; left: -12px; } .closeBox .layui-nav-item>a, .closeBox .layui-nav-item>a:hover {color: #000; } .closeBox a span.layui-nav-more {border-color: #333 transparent transparent; } .closeBox a span.layui-nav-more.layui-nav-mored{ border-color:transparent transparent #333;} .closeBox a i.caozuo {font-size: 16px; position: absolute; top: 1px; left: 0; } .bread-crumbs{display:block;background-color:#f9f9f9;padding:10px 0 0 10px;height:30px;overflow:hidden;} .bread-crumbs li{float:left;margin:0 5px;color:#666;height:30px;line-height:30px} .bread-crumbs li a{color:#666;} .page-body{display:block;margin:8px;overflow:auto;} .page-body>.layui-tab{margin:0;} .page-tab-content{background-color:#fff;overflow:auto;min-height:550px;} /* 全屏 */ .tool-btns{position:absolute;right:15px;top:11px;font-size:18px;color:#888} .tool-btns .sys-icon{color:#999;margin-left:8px;} .fullscreen{position:fixed;top: 0;right: 0;bottom: 0;left: 0;z-index:1090;margin-bottom: 0;overflow-y: auto;-webkit-overflow-scrolling: touch;-webkit-backface-visibility: hidden;backface-visibility: hidden;height:100%} .fullscreen.page-body, .fullscreen .layui-tab{margin:0;} /* 页面工具栏 */ .page-toolbar{display:block;overflow:hidden;} .page-filter{height:40px;overflow:hidden;} .page-filter .layui-form-pane .layui-form-label{width:auto;} .page-filter .layui-form-pane .layui-form-item .layui-input-inline{margin-right:0;} .page-tips{margin-bottom:10px;} .page-tips .layui-colla-title{height:26px;line-height:26px;background-color:#f9f9f9;color:#999;} .page-form{margin:10px 0;} #layerTopTips{background-color:#393D49;color:#fff;padding:5px 25px;border-radius:0 0 5px 5px;} /*分页*/ .pagination{overflow:hidden;display:block;border-left:1px solid #eee;float:right;} .pagination li{float:left;border:1px solid #eee;margin-left:-1px;font-size:16px;overflow:hidden;cursor:pointer;} .pagination li a, .pagination li span{display:block;padding:6px 18px;} .pagination li.active{background-color:#393e49;color:#fff;border-color:#393e49;} /* 角色权限设置 */ .role-list-form dl{display:block;} .role-list-form-top{border:1px solid #f9f9f9;} .role-list-form dl dt{display:block;background-color:#f9f9f9;padding:0px 10px 10px 10px;} .role-list-form dl dd{display:block;padding:0px 15px;overflow:hidden;} .role-list-form dl dd dl dt{background:none;} .role-list-form dl dd dl dd{padding:0px 25px;} .role-list-form dl dd dl dd {padding:0 35px;} .role-list-form dl dd dl dd a{display:inline-block;} /* 系统菜单管理 */ .menu-hd {font-size:14px;font-weight:400;border-top:1px dotted #eee} .menu-dl dt,.menu-dl dd {position:relative;border:1px dotted #eee;border-top:0} .menu-dl .hd,.menu-dl .hd2,.menu-dl .hd3,.menu-dl .layui-form-switch,.menu-btns {position:absolute;left:260px;top:4px} .menu-dl .hd,.menu-dl .hd2,.menu-dl .hd3 {top:-26px} .menu-dl .hd {left:280px} .menu-dl .hd2 {left:520px} .menu-dl .hd3 {left:710px} .menu-dl .layui-form-switch {left:490px;top:1px;margin:0} .menu-dl .menu-sort {position:absolute;left:260px;top:3px;height:20px;line-height:20px;width:40px;padding:0;text-align:center;color:#666;border:1px solid #e6e6e6;background-color:#fff;border-radius:2px} .menu-dl1,.menu-dl2 {display:block} .menu-dl1 dt,.menu-dl2 dt {padding:5px 2px} .menu-dl2 {padding-left:20px} .menu-dl2 dd {padding:5px 20px} .menu-dl1 dt .menu-sort {left:280px} .menu-dl2 dt .menu-sort {left:300px} .menu-dl2 dd .menu-sort {left:340px} .menu-dl1 .layui-form-switch {left:520px} .menu-dl2 .layui-form-switch {left:500px} .menu-btns {left:710px} .menu-dl2 .menu-btns {left:688px} .layui-nav-child dd:hover{background-color: #009688;color: #fff;} /*数据列表页排序字段*/ .input-sort{height:24px;line-height:24px;width:40px;padding:0;text-align:center;color:#666;} /*模块、插件、支付平台列表*/ .module-list-info{display:block;overflow:hidden;} .module-list-info img{float:left;margin-right:10px;border-radius:10px;} .module-list-info i{float:left;margin-right:10px;font-size:80px;line-height:82px;text-align:center;overflow:hidden;color:#2a95de;} .module-list-info .txt{float:left;max-width:80%;overflow:hidden;} .module-list-info .txt h3{font-weight:500;display:inline-block;} .module-list-info .txt p{font-size:12px;} .module-list-info .txt p span{color:#2a95de;} /*弹窗底部bar*/ .pop-bottom-bar{position:fixed;left:0;bottom:0;width:96%;background:#eee;padding:5px 2%;} .pop-bottom-bar .pages{max-width:70%;overflow:hidden;} /* .pop-bottom-bar .pages .pager{} */ .pop-bottom-bar .pages .pager li{float:left;margin:0 5px;} .pop-bottom-bar .pages .pager li a,.pop-bottom-bar .pages .pager li span{height:38px;line-height:38px;padding:0 10px;font-weight:500;display:inline-block;} .hook-plugins-sort{margin:10px 0 20px 0;border-top:1px dotted #eee;border-left:1px dotted #eee;border-right:1px dotted #eee;float:left;overflow:hidden;} .hook-plugins-sort li{float:left;width:100%;padding:5px 10px;border-bottom:1px dotted #eee;overflow:hidden;} .hook-plugins-sort li span{float:left;margin-right:20px;width:150px;height:20px;line-height:22px;} /*themes*/ /*.themes{}*/ .themes li{float:left;width:360px;overflow:hidden;margin:10px 20px 10px 10px;} .themes li img{float:left;border-radius:5px;padding:2px;border:1px solid #ddd;} .themes li dl{float:right;width:190px;overflow:hidden;} .themes li dd{line-height:28px;} .themes li dt{margin-top:10px;} /* 锁屏 */ .lock-screen{padding:20px;overflow:hidden;display:block;} .lock-screen input{float:left;width:180px;background-color:#009688;border-color:#009688;color:#fff;font-size:16px;} .lock-screen input::-webkit-input-placeholder{color:#fff;} .lock-screen input:-moz-placeholder{color:#fff;} .lock-screen input::-moz-placeholder{color:#fff;} .lock-screen input:-ms-input-placeholder{color:#fff;} .lock-screen button{float:left;margin-left:20px;} /* 漂浮图 */ .showpic {position:absolute; width:120px; height:160px; text-align:center; line-height:150%; border:2px solid #DEEFFA; padding:5px; background:#FFFFFF; z-index:99999;} /* 升级窗体 */ .update{background:#ffffff;padding:10px;clear: both;} .update h1{border-bottom:1px solid #c8d8e6;font-size:14px;line-height: 25px;font-weight: bold;} /*插件中心*/ .addon { position: relative; padding: 4px; display: block; margin-bottom: 17px; line-height: 20px; background-color: #fff; border: 1px solid #ddd; } .addon-caption { padding: 9px; color: #333333; } .add-logo{ display: block; max-width: 100%; height: 200px; } /*金刚狼*/ .layui-mobile.site-tree-mobile {position:absolute;left:2%;top:1px;color:white;background-color:transparent;height:60px;line-height:60px;} .header-top {display:none} .size-14 {font-size:14px} .size-16 {font-size:16px;} .size-20 {font-size:20px;} .layout-right {position:absolute;padding:0;color:#fff;border-radius:2px;font-size:0;box-sizing:border-box;right:0;} .layout-right .nav-item {position:relative;display:inline-block;display:inline;zoom:1;vertical-align:middle;line-height:40px;} .layout-right .nav-item a {font-size:16px;padding:0;margin:0 15px;color:#fff;} .top-logo {background:none;border-bottom:0 solid transparent;position:absolute;top:0;z-index:1200;width:130px;left:20%;margin-left:-65px;font-size:17px;height:40px;line-height:40px;background-image:linear-gradient(135deg,#26A69A,#00ff13);background-clip: text;-webkit-background-clip:text;color:transparent;} /*.top-nav {}*/ .nav-item-ul {display:none;position:fixed;z-index:999999;top:40px;} .drawer-body-right .nav-item-ul {display:block;} @media screen and (max-width:768px) { .site-mobile .layui-header .site-tree-mobile {display:block!important;color:#fff;} .site-mobile .layui-header .site-tree-mobile .layui-icon{ background-color: rgba(0,0,0,0.28); padding: 5px;} .header-top .layui-layout-right {padding:0;} .header-top {display:block;height:40px;} .layui-layout-admin .layui-body {top:105px;bottom:44px;} .bottom-nav {white-space:nowrap;overflow:scroll;position:relative;left:13%;width:87%;} } .wapmenu{display:none;} .mobileTopLevelMenus{display: none;float: left;} @media screen and (max-width:1300px){ .mobileTopLevelMenus{display: inline-block; } .topLevelMenus{display: none !important; } } @media screen and (max-width: 768px) { .layui-layout-admin .layui-side{left: -300px; transition: all .3s; -webkit-transition: all .3s;} .site-tree-mobile{display: block!important; position: fixed; z-index: 100000; bottom: 20px; left: 10px; width: 40px; height: 40px; line-height: 40px; border-radius: 2px; text-align: center; background-color: rgba(0,0,0,.7); color: #fff;} .site-mobile .site-tree-mobile{display: none !important;} .site-mobile .layui-side{ left: 0px; z-index:1100; } .site-mobile .site-mobile-shade{content: ''; position: fixed; top: 0; bottom: 0; left: 0; right: 0; background-color: rgba(0,0,0,.9); z-index: 999;} .layui-body,.layui-layout-admin .layui-footer{ left:-2px; } } @media screen and (max-width: 720px){ .hideMenu {display: none !important; } .mobileTopLevelMenus{ padding:0;} .winner-hide {display: none !important; } } @media screen and (max-width:480px){ .header-logo{ display: none;} /*.layui-nav .layui-nav-item a {}*/ } .topLevelMenus-winner {float: left;z-index:1100;position: absolute;left: -20px;top: 60px;width: 150px;} .topLevelMenus-winner .layui-nav-item {background-color: #23262e; } .topLevelMenus-winner .layui-nav-item.layui-this {background-color: rgba(0,0,0,0.5); } .screenshot_list div{float: left;position:relative;} .screenshot_list div .del_screenshot{ position: absolute; background-color: aliceblue; padding: 4px; top: 5px; right: 15px; } .screenshot_list div img { width: 160px; height: 92px; margin: 0 10px 10px 0; } \ No newline at end of file diff --git a/static/css/home.css b/static/css/home.css index 599e3e2f3..fd05aa62a 100644 --- a/static/css/home.css +++ b/static/css/home.css @@ -1,459 +1 @@ -/* mac_* 样式 */ - -/*延时加载*/ -.lazy{background:url('../images/home/loading.gif') center no-repeat} - -/*滑动显示*/ -.mac_drop_box { - text-align:left; padding: 5px;margin-top:8px;border: 1px solid #ddd; clear: both; display: none; position: absolute; background-color: #f6f6f6; z-index:9999; -} -.mac_drop_box::after{ - content: ''; - width: 0px; - height: 0px; - border-color: transparent transparent #f6f6f6 transparent; - border-style: solid; - border-width: 6px; - position: absolute; - top: -12px; - border-radius: 3px; - left: 41px; - right: auto; -} -.mac_drop_box::before{ - content: ''; - width: 0px; - height: 0px; - border-color: transparent transparent #ddd transparent; - border-style: solid; - border-width: 7px; - position: absolute; - top: -14px; - border-radius: 3px; - left: 40px; - right: auto; -} -.mac_user_box::after{left: 21px;} -.mac_user_box::before{left: 20px;} -/*用户滑动*/ -.mac_user_box { width:100px; margin-left: -20px;} -.mac_user_box ul{} -.mac_user_box ul li{margin: 3px 0;} - -/*历史记录*/ -.mac_history_box { width:180px; margin-left: -20px;} -.mac_history_box dt{text-align:right; padding-right:15px; height:24px; line-height:24px; border-bottom:1px solid #F9F9F9; cursor:pointer} -.mac_history_box dt a{color:#000000} -.mac_history_box dd{clear:both;margin:0px;height:24px;line-height:24px;text-overflow:ellipsis;white-space: nowrap;width: 96%;padding:2px;overflow: hidden;} -.mac_history_box dd a{color:#990033; display:block;padding-left:0px;} -.mac_history_box dd.odd {background-color: #eee;} -.mac_history_box dd a:hover{background-color: #acacac;color: white;} - - - -/*验证码*/ -.mac_verify_img { - width: 70px; - height: 30px; - line-height: 30px; - vertical-align: middle; -} - -.mac_comment,.mac_digg{font-size: 12px;} -.fl {float: left; _display: inline;} -.fr {float: right; _display: inline;} -.clearfix:after {visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0} .clearfix{*zoom:1;} - -/*-Pages-*/ -.mac_pages {text-align:center; padding:4px 0; overflow:hidden;} -.mac_pages .page_tip {margin-left:4px; font-weight:bold; color:#7f7f7f; font-weight:normal;} -.mac_pages .page_link{display:inline-block; padding:2px 4px; border:1px solid #ddd; margin-left:4px;} -.mac_pages .page_link{display:inline-block; padding:2px 4px; border:1px solid #ddd; margin-left:4px;} -.mac_pages .page_current{display:inline-block; padding:2px 4px; background-color : #fee; border : 1px solid red; color : red; margin-left:4px;} -.mac_pages .page_input {margin-left:4px; height:22px; width:30px;} -.mac_pages .page_btn{border:1px solid #CCCCCC; height:24px; width:40px;text-align:center; cursor: hand;} -/*-/Page-*/ - - -/*文章顶踩图标*/ -.mac_art_digg{ width:400px; margin:0px auto; clear:both; padding:10px 0px; overflow:hidden} -.mac_art_digg .digg_artup,.mac_art_digg .digg_artdown {background:url('../images/home/digg_art.gif') no-repeat -189px 0;border:0;cursor:pointer;float:left;height:48px;margin:0;overflow:hidden;padding:0;position:relative;width:189px;} -#digg_artup_num, #digg_artdown_num {color:#333333;font-family:arial;font-size:10px;font-weight:400;left:70px;line-height:12px;position:absolute;top:30px;} -.mac_art_digg .digg_bar {background-color:#FFFFFF;border:1px solid #40A300;height:5px;left:9px;overflow:hidden;position:absolute;text-align:left;top:32px;width:55px;} -.mac_art_digg.digg_bar div{background:transparent url('../images/home/digg_art_bg.gif') repeat-x scroll 0 -265px;height:5px;overflow:hidden;width:0px} -.mac_art_digg.digg_artdown {background-position:-378px 0;margin-left:10px;} -.mac_art_digg.digg_artdown .dig_bar {border-color:#555555;} -.mac_art_digg.digg_artdown .dig_bar div{background-position:0 -270px;} - - -/*搜索下拉*/ -.mac_results {background-color:#fcfcfc;overflow:hidden;z-index:99999;margin:0;padding:0;text-align:left;min-width: 290px;box-shadow: 1px 1px 3px 1px #ccc;} -.mac_results ul {width: 100%;list-style-position: outside;list-style: none;padding: 0;margin: 0;} -.mac_results li {margin: 0px;padding: 2px 5px;cursor: default;display: block;font: menu;font-size: 12px;height:25px; line-height: 25px;overflow: hidden;} -.mac_results .mac_loading {background: white right center no-repeat;} -.mac_results .ac_odd {background-color: #f6f6f6;} -.mac_results .ac_over {background-color: #0A246A;color: white;} - - - - -/*普通评分*/ -.mac_score { height:60px; } -.mac_score .score_info strong{font-size:14px;color:red} -.mac_score .score_tip{position:absolute;width:140px;color:#999;font-size:14px;margin-left:0px;} -.mac_score .score_hover{margin:24px 8px 0 0;width:30px;color:green;font-family:Arial;font-weight:bold;font-size:14px;} -.mac_score .score_shi{font-size:32px;line-height:28px;font-weight:bold;} -.mac_score .score_ge{font-size:18px;line-height:22px;} -.mac_score p{width:100px;float:left;color:#666;} -.mac_score p span{font-family:Arial;font-style:italic;color:#f60;} -.mac_score p span.score_no{width:110px;clear:both;color:#666;font-style:normal;font-size:12px;} -.mac_score .score_btn{width:55px;height:21px} - - -/*星星评分*/ -.mac_star{ - font-weight:normal;width: 240px; -} -.mac_star dd{display: inline-block;float: right;margin-left: 10px;} -.mac_star dt{ - color:#999; - font-size:1.0em; - display: inline-block; - float: left; - margin-top: 3px; -} -.mac_star .star_box{ - color: #00b269; - font-size:0.5em; -} -.mac_star .star_tips{ - font-size:1.8em; - line-height: 0.5; - color:#ffc00a; - font-family: Arial, Helvetica, sans-serif; -} -.mac_star i{background: url("../images/home/starrating.gif") no-repeat;cursor: pointer;font-size: 1.5em;color: transparent;} -.mac_star i.star-half-png,.mac_star i.star-on-png{background: url("../images/home/starrating.gif") 0 -35px no-repeat;} - -/*评论*/ -.mac_comment { margin-top:5px; padding:10px; padding-left:10px; border:1px solid #C6D9E7; background:#fff; font-family: "Microsoft YaHei"; } - - -.mac_comment .clearfix::after { - height: 0px; clear: both; font-size: 0px; display: block; visibility: hidden; content: " "; -} - -.mac_comment .cmt_form { - margin-bottom: 10px; -} -.mac_comment .face_wrap img { - width: 50px; height: 50px; -} -.mac_comment .input_wrap { - width: 98%; padding-left: 1%; position: relative; -} -.mac_comment .cmt_wrap .input_wrap { - width: 98%; -} -.mac_comment .input_wrap textarea { - background: #fff; border-width: 1px 1px medium; border-style: solid solid none; border-color: rgb(187, 187, 187) rgb(187, 187, 187) currentColor; border-radius: 3px 3px 0px 0px; width: 100%; height: 53px; line-height: 1.4; overflow: auto; padding-top: 8px; padding-left: 1%;color: #666;box-sizing: border-box; -} -.mac_comment .input_wrap .handle { - position:relative;background: #fbfbfb; border-width: 1px; border-style:solid; border-color: rgb(187, 187, 187); border-top-color:#e5e5e5;border-radius: 0px 0px 3px 3px; width: 100%; height:46px; color: rgb(206, 206, 206);box-sizing: border-box; -} -.mac_comment .input_wrap .face{ - cursor: pointer;position: absolute;width: 42px;height: 45px;cursor: pointer;z-index: 2; -} -.mac_comment .input_wrap .face.curr{background: #fff;} -.mac_comment .input_wrap .face-box{display:none;padding: 8px 0 3px 5px;width: 280px;position: absolute;top: 44px;background: #fff;border: 1px solid #bbb;border-top-color:#e5e5e5;margin-left: -1px;z-index: 1;} -.mac_comment .input_wrap .face-box img{ - display:inline-block;margin: 2px; -} -.mac_comment .icon-face{display:block;width:42px;height:44px;background: url("../images/home/face.png") center no-repeat;} -.mac_comment .icon-face:hover,.mac_comment .input_wrap .face.curr .icon-face{background: url("../images/home/face-on.png") center no-repeat;} -.mac_comment .expression { - background: url("../images/home/emotion2.png") no-repeat 0px 0px; margin: 6px 0px 0px 6px; width: 18px; height: 16px; display: block; cursor: pointer; -} -.mac_comment .expression:hover { - background: url("../images/home/emotion2.png") no-repeat 0px -16px; -} -.mac_comment .remaining-w { - float: left;margin-left: 42px;padding-left:20px;line-height:44px;border-left: 1px solid #e5e5e5; font-size: 14px; -} -.mac_comment .smt_wrap { - width: 100%; margin-top: 8px; -} -.mac_comment .smt_wrap span { - color: rgb(66, 66, 66); -} -.mac_comment .smt_wrap .total { - font-size: 16px; font-weight: bold; -} -.mac_comment .smt_wrap span span { - margin: 0px; padding: 0px; -} -.mac_comment .smt_wrap span a { - margin: 0px 0px 0px 8px; color: rgb(49, 139, 183); -} -.mac_comment .smt .cmt_post:hover{background: #17abff;} -.mac_comment .smt .cmt_post { - background: #169dea; border: currentColor; width: 81px; height: 30px; text-align: center; color: rgb(255, 255, 255); line-height: 30px; font-size: 14px; margin-left: 20px; display: inline-block; cursor: pointer;vertical-align:middle;border-radius: 3px; -} -.mac_comment .smt .cmt_text { - background: rgb(251, 251, 251); padding: 0px 8px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); width:50px; height: 30px; line-height: 30px; margin-left: 5px;margin-right:2px;vertical-align:middle; -} -.mac_comment .smt .cmt_verify { - width: 80px; height: 30px; line-height: 30px;vertical-align:middle; -} - -.mac_comment .smt input:hover { - background-position: -1px -603px; -} -.mac_comment .smt{margin-top: 6px;margin-right: 12px;color: #454545;} -.mac_comment .sort_wrap { - padding-bottom: 2px; border-bottom-color: rgb(215, 215, 215); border-bottom-width: 1px; border-bottom-style: solid; -} -.mac_comment .sort_wrap a:hover { - text-decoration: none; -} -.mac_comment .sort_wrap .current { - color: rgb(49, 139, 183); font-weight: bold; border-bottom-color: rgb(43, 140, 230); border-bottom-width: 2px; border-bottom-style: solid; -} -.mac_comment .cmt_item { - padding: 15px 0px 8px; width: 100%; color: rgb(153, 153, 153); border-bottom-color: rgb(215, 215, 215); border-bottom-width: 1px; border-bottom-style: dotted; _zoom: 1; -} -.mac_comment .item_con { - width: 93%; padding-left: 1%; -} -.mac_comment .item_con p.top { - padding: 0; - width: auto; - margin-bottom: 8px; -} -.mac_comment .item_con a { - color: rgb(153, 153, 153); -} -.mac_comment .item_con a:hover { - color: rgb(153, 153, 153); text-decoration: none; -} -.mac_comment .item_con .name { - color: rgb(43, 140, 230); -} -.mac_comment .item_con .name:hover { - color: rgb(1, 106, 159); text-decoration: none; -} -.mac_comment .item_con .con { - color: rgb(51, 51, 51); line-height: 20px; overflow: hidden; margin-top: 8px; -ms-word-wrap: break-word; -} -.mac_comment .item_con .bottom li { - height: 16px; line-height: 15px; overflow: hidden; margin-right: 10px; float: left; _display: inline; -} -.mac_comment .item_con .bottom .reply { - background: url("../images/home/rpy2.png") no-repeat 0px 0px; color: rgb(153, 153, 153); text-indent: 19px; font-size: 11px; display: block; -} -.mac_comment .item_con .bottom .reply:hover { - color: rgb(1, 106, 159); text-decoration: none; -} -.mac_comment .item_con .bottom .bdshare_t { - margin-top: -5px; -} -.mac_comment .item_con .bottom .bds_more { - padding-top: 5px; -} -.mac_comment .inner { - padding: 3px; border: 1px solid rgb(153, 153, 153); width: auto; background-color: rgb(254, 254, 241); -} -.mac_comment .inner .top { - margin: 8px 0px 8px 3px; -} -.mac_comment .inner .con { - margin: 5px 0px 5px 3px; -} -.mac_comment .inner .bottom { - margin-bottom: 5px; visibility: hidden; -} -.mac_comment .mid_cmt_item { - margin-top: 3px; border-top-color: currentColor; border-top-width: medium; border-top-style: none; -} -.mac_comment .pages { - margin-top: 15px; -} -.mac_comment .item_con .gw-action{ - text-align: right; -} -.mac_comment .item_con .gw-action a{margin-left: 10px;} -.mac_comment .item_con a:hover{ - color: #333; -} -.mac_comment .item_con .click-ding-gw{margin-right: 10px;} -.mac_comment .item_con .click-ding-gw a,.mac_digg .click-ding-gw a{color: #f29898;} -.mac_comment .item_con .click-ding-gw a:hover,.mac_digg .click-ding-gw a{color: #f29898;} -.mac_comment .item_con .click-ding-gw a i,.mac_digg a i{display: inline-block;width: 14px;height: 14px;vertical-align: middle;} - -.mac_comment .cmt_wrap .item_con .input_wrap{width: 100%;margin: 10px 0;padding-left: 0;} -.mac_comment .cmt_wrap .item_con .cmt_item{clear: left;border-bottom: none;} -.mac_comment .cmt_wrap .item_con .cmt_item .gw-action{text-align: left;clear: left;} -.mac_comment .cmt_wrap .item_con .cmt_item .gw-action a{margin-right: 10px;margin-left: 0;} - -/*留言气泡版本*/ -.reply_box .mac_msg_l{padding:10px 1%;float: left;width:70%;} -.reply_box .mac_msg_l .mac_msg_item{width: 100%;float: left;} -.reply_box .mac_msg_l .msg_tag{float:left;width: 60px;margin-right:2%;margin-bottom:5px;border-radius: 5px;overflow: hidden;} -.reply_box .mac_msg_l .count_bg{width:60px;height:5px;background: linear-gradient(90deg, #f25f4d 30%, #59b84b 20%, #30a1d9 65%, #fdcd34 10%);} -.reply_box .mac_msg_l .msg_count{ - padding:8px 0;color: #fff;text-align: center;font-size: 13px; - background: -moz-linear-gradient(top, #444444 0%, #222222 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#444444), color-stop(100%,#222222)); - background: -webkit-linear-gradient(top, #444444 0%,#222222 100%); - background: -o-linear-gradient(top, #444444 0%,#222222 100%); - background: -ms-linear-gradient(top, #444444 0%,#222222 100%); - background: linear-gradient(to bottom, #444444 0%,#222222 100%); -} -.reply_box .mac_msg_l .msg_count strong{display: block;} -.reply_box .mac_msg_l .msg_list{float: left;width: 85%;margin-bottom: 10px;} -.reply_box .mac_msg_l .msg_list .msg_title{text-align:left;font-size:16px;border-bottom: 1px #d3e9fb dotted;line-height: 26px;} -.reply_box .mac_msg_l .msg_list .msg_title span.time{float: right;font-size: 12px;} -.reply_box .mac_msg_l .msg_list .msg_reply{color: #666;} -.reply_box .mac_msg_l .msg_list .reply_answer{color: #3c8f3f;} -.reply_box .mac_msg_l .msg_list .reply_answer .msg_title{font-size: 13px;} -.reply_box .mac_msg_l .msg_list .msg_cont{padding: 8px 0 0;} -.reply_box .mac_msg_l .msg_list .msg_reply,.reply_box .mac_msg_l .msg_list .reply_answer { - position: relative; - margin: 0 0 10px; - padding: 6px 10px 8px; - border: 1px solid #d3e9fb; - border-radius: 0.2rem; - background-color: #f5fbff; -} -.reply_box .mac_msg_l .msg_list .reply_answer:after { - content: ''; - width: 0px; - height: 0px; - border-color: transparent transparent #f5fbff transparent ; - border-style: solid; - border-width: 6px; - position: absolute; - top: -11px; - border-radius: 3px; - left: 18px; - right: auto; -} -.reply_box .mac_msg_l .msg_list .reply_answer:before { - content: ''; - width: 0px; - height: 0px; - border-color: transparent transparent #d3e9fb transparent; - border-style: solid; - border-width: 7px; - position: absolute; - top: -14px; - border-radius: 3px; - left: 17px; - right: auto; -} -.reply_box .mac_msg_l .msg_list .msg_reply:after { - content: ''; - width: 0px; - height: 0px; - border-color: transparent #f5fbff #f5fbff transparent; - border-style: solid; - border-width: 7px; - position: absolute; - top: 8px; - border-radius: 3px; - left: -12px; - right: auto; -} -.reply_box .mac_msg_l .msg_list .msg_reply:before { - content: ''; - width: 0px; - height: 0px; - border-color: transparent #d3e9fb #d3e9fb transparent; - border-style: solid; - border-width: 7px; - position: absolute; - top: 9px; - border-radius: 3px; - left: -14px; - right: auto; -} -.reply_box .mac_msg_r{margin: 10px 1%;float: right;width: 25%;border: 1px solid #ddd;border-radius: 5px;color: #666;} -.reply_box .mac_msg_r .msg_tit{background: #f1f1f1;padding: 10px;border-bottom: 1px solid #ddd;} -.reply_box .mac_msg_r form{padding: 15px;} -.reply_box .mac_msg_r form .msg_cue{margin-bottom: 8px;} -.reply_box .mac_msg_r form textarea{width:100%;height: 106px;padding: 10px;overflow-y: auto;box-sizing: border-box;border-color: #ddd;} -.reply_box .mac_msg_r .msg_code{margin: 10px 0;} -.reply_box .mac_msg_r .msg_code input{border: 1px solid #ddd;padding: 4px;width: 65px;} -.reply_box .mac_msg_r .msg_code .mac_verify_img{height: 30px;margin-left: 2px;vertical-align: top;} -.reply_box .mac_msg_r .submit_btn{width: 100px;height: 32px;background: #4c8fe9;color: #fff;border: 1px solid #4c8fe9;margin:20px auto - 0;display: block;cursor: pointer;} -.mac_msg_r .submit_btn:hover{background: #619ff3;} -.mac_msg_r .submit_btn:active{background: #3883e6;} - - -/*顶踩图标*/ -.mac_comment i.icon-ding,.mac_digg i.icon-ding{background: url("../images/home/up1.png") center no-repeat;} -.mac_comment i.icon-ding:hover,.mac_digg i.icon-ding:hover{background: url("../images/home/up2.png") center no-repeat;} -.mac_comment i.icon-dw,.mac_digg i.icon-dw{background: url("../images/home/dw1.png") center no-repeat;} -.mac_comment i.icon-dw:hover,.mac_digg i.icon-dw:hover{background: url("../images/home/dw2.png") center no-repeat;} - -/*顶踩页面*/ -.mac_digg a{margin-right: 10px;color: #999;} -.mac_digg a:hover{color: #333;} - -/*登录页面*/ -.mac_login{padding: 30px;width:400px;height:350px;background: #fff;box-sizing: border-box;font-family: "microsoft yahei"} -.mac_login h3{font-weight: normal;color: #333;margin: 0 0 30px;} -.mac_login .mac_login_form .login_form_group{margin-top: 20px;} -.mac_login .mac_login_form .login_form_group input{padding:4px 10px 4px 36px;width:100%;height:38px;line-height:38px;border: 1px solid #cacaca;box-sizing: border-box;} -.mac_login .mac_login_form .login_form_group input.mac_u_name{background: url("../images/home/u_name.png") no-repeat 7px 8px;} -.mac_login .mac_login_form .login_form_group input.mac_u_pwd{background: url("../images/home/u_pwd.png") 8px 8px no-repeat;} -.mac_login .mac_login_form .login_form_group input.mac_u_verify{float:left;width:50%;background: url("../images/home/u_verify.png") 8px 9px no-repeat;} -.mac_login .mac_login_form .login_form_group img.mac_verify_img{float:left;margin-left:1%;width: 88px;height: 38px;border: 1px solid #cacaca;box-sizing: border-box;cursor: pointer;} -.mac_login .mac_login_form .login_form_link{margin-top: 10px;text-align: right;} -.mac_login .mac_login_form .login_form_link a{font-size: 12px;color: #333;margin-left: 15px;} -.mac_login .mac_login_form .login_form_link a:hover{color: #2fa5ff} -.mac_login .mac_login_form input.login_form_submit{background: #2fa5ff;color: #fff;font-size: 14px;line-height: normal;border: none;cursor: pointer;} -.mac_login .mac_login_form input.login_form_submit:hover{background: #1d94ef;} - -/*弹出层*/ -.mac_pop_bg{position: fixed; z-index: 129; left: 0;top: 0; width: 100%; height: 100%; background: rgba(0,0,0,.2);} -.mac_pop { z-index:99998; display: none; min-height: 20px; max-height: 750px; position: fixed; top: 0; left: 0; bottom: 0; right: 0; margin: auto; padding: 25px; z-index: 130; border-radius: 8px; background-color: #fff; box-shadow: 0 3px 18px rgba(0, 0, 0, .5);} -.mac_pop .pop_top{ height:40px; width:100%; border-bottom: 1px #E5E5E5 solid;} -.mac_pop .pop_top h2{ float: left; display:block;margin: 0;font-size: 18px;font-weight: normal;font-family:"microsoft yahei";} -.mac_pop span.pop_close{ float: right;width: 23px;height: 23px;font-size: 0;text-indent: 9999; cursor: pointer; font-weight: bold; display:block;background: url("../images/home/background.png") -10px 0 no-repeat;} -.mac_pop .pop-foot{ height:50px; line-height:50px; width:100%; border-top: 1px #E5E5E5 solid; text-align: right; } -.mac_pop .pop-cancel, .pop-ok { padding:8px 15px; margin:15px 5px; border: none; border-radius: 5px; background-color: #337AB7; color: #fff; cursor:pointer; } -.mac_pop .pop-cancel { background-color: #FFF; border:1px #CECECE solid; color: #000; } -.mac_pop .pop-content{ height: 380px; } -.mac_pop .pop-content-left{ float: left; } -.mac_pop .pop-content-right{ width:310px; float: left; padding-top:20px; padding-left:20px; font-size: 16px; line-height:35px; } -.mac_pop .bgPop{ display: none; position: absolute; z-index: 129; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,.2); } -.mac_pop .pop-msg{ text-align:center; font-size: 14px; } - -.mac_pop_msg_bg{position: fixed; z-index: 129; left: 0;top: 0; width: 100%; height: 100%; background: rgba(0,0,0,.2);} -.mac_pop_msg { z-index:99999; display: none; min-height: 20px; max-height: 750px; position: fixed; top: 0; left: 0; bottom: 0; right: 0; margin: auto; padding: 25px; z-index: 130; border-radius: 8px; background-color: #fff; box-shadow: 0 3px 18px rgba(0, 0, 0, .5);} -.mac_pop_msg .pop-msg{ text-align:center; font-size: 14px; } - -/*跳转信息*/ -.mac_msg_jump{width:90%;max-width:624px;min-height:60px;padding:20px 50px 50px;margin:20% auto 0;font-size:14px;line-height:24px;border: 1px solid #cdd5e0;border-radius: 10px;background:#fff;box-sizing: border-box;} -.mac_msg_jump .title{margin-bottom:11px;} -.mac_msg_jump .text{padding-left:29px;margin-bottom:11px;} -.mac_msg._jump .jump{ } -.msg_jump_tit{width:100%;height: 35px;margin: 25px 0 10px;text-align:center; font-size: 25px;color: #23c319;font-family: "黑体","microsoft yahei";letter-spacing: 5px;} - -@media screen and (max-width: 900px) { - .reply_box .mac_msg_l{float: none;width: 100%;} - .reply_box .mac_msg_r{float: none;width: 96%;margin-left: 2%;} - .reply_box .mac_msg_l .msg_list{width: 80%;} - .reply_box .mac_msg_r .submit_btn{width: 100%;border-radius: 3px;} -} -@media (min-width: 700px) and (max-width: 900px) { - .reply_box .mac_msg_l .msg_list{float:right;width: 88%;} -} -@media (min-width: 500px) and (max-width: 700px) { - .reply_box .mac_msg_l .msg_list{float:right;width: 85%;} -} -@media screen and (max-width: 500px) { - .reply_box .mac_msg_l .msg_list{float:right;} -} \ No newline at end of file +/* mac_* 样式 */ /*延时加载*/ .lazy{background:url('../images/home/loading.gif') center no-repeat} /*滑动显示*/ .mac_drop_box { text-align:left; padding: 5px;margin-top:8px;border: 1px solid #ddd; clear: both; display: none; position: absolute; background-color: #f6f6f6; z-index:9999; } .mac_drop_box::after{ content: ''; width: 0px; height: 0px; border-color: transparent transparent #f6f6f6 transparent; border-style: solid; border-width: 6px; position: absolute; top: -12px; border-radius: 3px; left: 41px; right: auto; } .mac_drop_box::before{ content: ''; width: 0px; height: 0px; border-color: transparent transparent #ddd transparent; border-style: solid; border-width: 7px; position: absolute; top: -14px; border-radius: 3px; left: 40px; right: auto; } .mac_user_box::after{left: 21px;} .mac_user_box::before{left: 20px;} /*用户滑动*/ .mac_user_box { width:100px; margin-left: -20px;} .mac_user_box ul{} .mac_user_box ul li{margin: 3px 0;} /*历史记录*/ .mac_history_box { width:180px; margin-left: -20px;} .mac_history_box dt{text-align:right; padding-right:15px; height:24px; line-height:24px; border-bottom:1px solid #F9F9F9; cursor:pointer} .mac_history_box dt a{color:#000000} .mac_history_box dd{clear:both;margin:0px;height:24px;line-height:24px;text-overflow:ellipsis;white-space: nowrap;width: 96%;padding:2px;overflow: hidden;} .mac_history_box dd a{color:#990033; display:block;padding-left:0px;} .mac_history_box dd.odd {background-color: #eee;} .mac_history_box dd a:hover{background-color: #acacac;color: white;} /*验证码*/ .mac_verify_img { width: 70px; height: 30px; line-height: 30px; vertical-align: middle; } .mac_comment,.mac_digg{font-size: 12px;} .fl {float: left; _display: inline;} .fr {float: right; _display: inline;} .clearfix:after {visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0} .clearfix{*zoom:1;} /*-Pages-*/ .mac_pages {text-align:center; padding:4px 0; overflow:hidden;} .mac_pages .page_tip {margin-left:4px; font-weight:bold; color:#7f7f7f; font-weight:normal;} .mac_pages .page_link{display:inline-block; padding:2px 4px; border:1px solid #ddd; margin-left:4px;} .mac_pages .page_link{display:inline-block; padding:2px 4px; border:1px solid #ddd; margin-left:4px;} .mac_pages .page_current{display:inline-block; padding:2px 4px; background-color : #fee; border : 1px solid red; color : red; margin-left:4px;} .mac_pages .page_input {margin-left:4px; height:22px; width:30px;} .mac_pages .page_btn{border:1px solid #CCCCCC; height:24px; width:40px;text-align:center; cursor: hand;} /*-/Page-*/ /*文章顶踩图标*/ .mac_art_digg{ width:400px; margin:0px auto; clear:both; padding:10px 0px; overflow:hidden} .mac_art_digg .digg_artup,.mac_art_digg .digg_artdown {background:url('../images/home/digg_art.gif') no-repeat -189px 0;border:0;cursor:pointer;float:left;height:48px;margin:0;overflow:hidden;padding:0;position:relative;width:189px;} #digg_artup_num, #digg_artdown_num {color:#333333;font-family:arial;font-size:10px;font-weight:400;left:70px;line-height:12px;position:absolute;top:30px;} .mac_art_digg .digg_bar {background-color:#FFFFFF;border:1px solid #40A300;height:5px;left:9px;overflow:hidden;position:absolute;text-align:left;top:32px;width:55px;} .mac_art_digg.digg_bar div{background:transparent url('../images/home/digg_art_bg.gif') repeat-x scroll 0 -265px;height:5px;overflow:hidden;width:0px} .mac_art_digg.digg_artdown {background-position:-378px 0;margin-left:10px;} .mac_art_digg.digg_artdown .dig_bar {border-color:#555555;} .mac_art_digg.digg_artdown .dig_bar div{background-position:0 -270px;} /*搜索下拉*/ .mac_results {background-color:#fcfcfc;overflow:hidden;z-index:99999;margin:0;padding:0;text-align:left;min-width: 290px;box-shadow: 1px 1px 3px 1px #ccc;} .mac_results ul {width: 100%;list-style-position: outside;list-style: none;padding: 0;margin: 0;} .mac_results li {margin: 0px;padding: 2px 5px;cursor: default;display: block;font: menu;font-size: 12px;height:25px; line-height: 25px;overflow: hidden;} .mac_results .mac_loading {background: white right center no-repeat;} .mac_results .ac_odd {background-color: #f6f6f6;} .mac_results .ac_over {background-color: #0A246A;color: white;} /*普通评分*/ .mac_score { height:60px; } .mac_score .score_info strong{font-size:14px;color:red} .mac_score .score_tip{position:absolute;width:140px;color:#999;font-size:14px;margin-left:0px;} .mac_score .score_hover{margin:24px 8px 0 0;width:30px;color:green;font-family:Arial;font-weight:bold;font-size:14px;} .mac_score .score_shi{font-size:32px;line-height:28px;font-weight:bold;} .mac_score .score_ge{font-size:18px;line-height:22px;} .mac_score p{width:100px;float:left;color:#666;} .mac_score p span{font-family:Arial;font-style:italic;color:#f60;} .mac_score p span.score_no{width:110px;clear:both;color:#666;font-style:normal;font-size:12px;} .mac_score .score_btn{width:55px;height:21px} /*星星评分*/ .mac_star{ font-weight:normal;width: 240px; } .mac_star dd{display: inline-block;float: right;margin-left: 10px;} .mac_star dt{ color:#999; font-size:1.0em; display: inline-block; float: left; margin-top: 3px; } .mac_star .star_box{ color: #00b269; font-size:0.5em; } .mac_star .star_tips{ font-size:1.8em; line-height: 0.5; color:#ffc00a; font-family: Arial, Helvetica, sans-serif; } .mac_star i{background: url("../images/home/starrating.gif") no-repeat;cursor: pointer;font-size: 1.5em;color: transparent;} .mac_star i.star-half-png,.mac_star i.star-on-png{background: url("../images/home/starrating.gif") 0 -35px no-repeat;} /*评论*/ .mac_comment { margin-top:5px; padding:10px; padding-left:10px; border:1px solid #C6D9E7; background:#fff; font-family: "Microsoft YaHei"; } .mac_comment .clearfix::after { height: 0px; clear: both; font-size: 0px; display: block; visibility: hidden; content: " "; } .mac_comment .cmt_form { margin-bottom: 10px; } .mac_comment .face_wrap img { width: 50px; height: 50px; } .mac_comment .input_wrap { width: 98%; padding-left: 1%; position: relative; } .mac_comment .cmt_wrap .input_wrap { width: 98%; } .mac_comment .input_wrap textarea { background: #fff; border-width: 1px 1px medium; border-style: solid solid none; border-color: rgb(187, 187, 187) rgb(187, 187, 187) currentColor; border-radius: 3px 3px 0px 0px; width: 100%; height: 53px; line-height: 1.4; overflow: auto; padding-top: 8px; padding-left: 1%;color: #666;box-sizing: border-box; } .mac_comment .input_wrap .handle { position:relative;background: #fbfbfb; border-width: 1px; border-style:solid; border-color: rgb(187, 187, 187); border-top-color:#e5e5e5;border-radius: 0px 0px 3px 3px; width: 100%; height:46px; color: rgb(206, 206, 206);box-sizing: border-box; } .mac_comment .input_wrap .face{ cursor: pointer;position: absolute;width: 42px;height: 45px;cursor: pointer;z-index: 2; } .mac_comment .input_wrap .face.curr{background: #fff;} .mac_comment .input_wrap .face-box{display:none;padding: 8px 0 3px 5px;width: 280px;position: absolute;top: 44px;background: #fff;border: 1px solid #bbb;border-top-color:#e5e5e5;margin-left: -1px;z-index: 1;} .mac_comment .input_wrap .face-box img{ display:inline-block;margin: 2px; } .mac_comment .icon-face{display:block;width:42px;height:44px;background: url("../images/home/face.png") center no-repeat;} .mac_comment .icon-face:hover,.mac_comment .input_wrap .face.curr .icon-face{background: url("../images/home/face-on.png") center no-repeat;} .mac_comment .expression { background: url("../images/home/emotion2.png") no-repeat 0px 0px; margin: 6px 0px 0px 6px; width: 18px; height: 16px; display: block; cursor: pointer; } .mac_comment .expression:hover { background: url("../images/home/emotion2.png") no-repeat 0px -16px; } .mac_comment .remaining-w { float: left;margin-left: 42px;padding-left:20px;line-height:44px;border-left: 1px solid #e5e5e5; font-size: 14px; } .mac_comment .smt_wrap { width: 100%; margin-top: 8px; } .mac_comment .smt_wrap span { color: rgb(66, 66, 66); } .mac_comment .smt_wrap .total { font-size: 16px; font-weight: bold; } .mac_comment .smt_wrap span span { margin: 0px; padding: 0px; } .mac_comment .smt_wrap span a { margin: 0px 0px 0px 8px; color: rgb(49, 139, 183); } .mac_comment .smt .cmt_post:hover{background: #17abff;} .mac_comment .smt .cmt_post { background: #169dea; border: currentColor; width: 81px; height: 30px; text-align: center; color: rgb(255, 255, 255); line-height: 30px; font-size: 14px; margin-left: 20px; display: inline-block; cursor: pointer;vertical-align:middle;border-radius: 3px; } .mac_comment .smt .cmt_text { background: rgb(251, 251, 251); padding: 0px 8px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); width:50px; height: 30px; line-height: 30px; margin-left: 5px;margin-right:2px;vertical-align:middle; } .mac_comment .smt .cmt_verify { width: 80px; height: 30px; line-height: 30px;vertical-align:middle; } .mac_comment .smt input:hover { background-position: -1px -603px; } .mac_comment .smt{margin-top: 6px;margin-right: 12px;color: #454545;} .mac_comment .sort_wrap { padding-bottom: 2px; border-bottom-color: rgb(215, 215, 215); border-bottom-width: 1px; border-bottom-style: solid; } .mac_comment .sort_wrap a:hover { text-decoration: none; } .mac_comment .sort_wrap .current { color: rgb(49, 139, 183); font-weight: bold; border-bottom-color: rgb(43, 140, 230); border-bottom-width: 2px; border-bottom-style: solid; } .mac_comment .cmt_item { padding: 15px 0px 8px; width: 100%; color: rgb(153, 153, 153); border-bottom-color: rgb(215, 215, 215); border-bottom-width: 1px; border-bottom-style: dotted; _zoom: 1; } .mac_comment .item_con { width: 93%; padding-left: 1%; } .mac_comment .item_con p.top { padding: 0; width: auto; margin-bottom: 8px; } .mac_comment .item_con a { color: rgb(153, 153, 153); } .mac_comment .item_con a:hover { color: rgb(153, 153, 153); text-decoration: none; } .mac_comment .item_con .name { color: rgb(43, 140, 230); } .mac_comment .item_con .name:hover { color: rgb(1, 106, 159); text-decoration: none; } .mac_comment .item_con .con { color: rgb(51, 51, 51); line-height: 20px; overflow: hidden; margin-top: 8px; -ms-word-wrap: break-word; } .mac_comment .item_con .bottom li { height: 16px; line-height: 15px; overflow: hidden; margin-right: 10px; float: left; _display: inline; } .mac_comment .item_con .bottom .reply { background: url("../images/home/rpy2.png") no-repeat 0px 0px; color: rgb(153, 153, 153); text-indent: 19px; font-size: 11px; display: block; } .mac_comment .item_con .bottom .reply:hover { color: rgb(1, 106, 159); text-decoration: none; } .mac_comment .item_con .bottom .bdshare_t { margin-top: -5px; } .mac_comment .item_con .bottom .bds_more { padding-top: 5px; } .mac_comment .inner { padding: 3px; border: 1px solid rgb(153, 153, 153); width: auto; background-color: rgb(254, 254, 241); } .mac_comment .inner .top { margin: 8px 0px 8px 3px; } .mac_comment .inner .con { margin: 5px 0px 5px 3px; } .mac_comment .inner .bottom { margin-bottom: 5px; visibility: hidden; } .mac_comment .mid_cmt_item { margin-top: 3px; border-top-color: currentColor; border-top-width: medium; border-top-style: none; } .mac_comment .pages { margin-top: 15px; } .mac_comment .item_con .gw-action{ text-align: right; } .mac_comment .item_con .gw-action a{margin-left: 10px;} .mac_comment .item_con a:hover{ color: #333; } .mac_comment .item_con .click-ding-gw{margin-right: 10px;} .mac_comment .item_con .click-ding-gw a,.mac_digg .click-ding-gw a{color: #f29898;} .mac_comment .item_con .click-ding-gw a:hover,.mac_digg .click-ding-gw a{color: #f29898;} .mac_comment .item_con .click-ding-gw a i,.mac_digg a i{display: inline-block;width: 14px;height: 14px;vertical-align: middle;} .mac_comment .cmt_wrap .item_con .input_wrap{width: 100%;margin: 10px 0;padding-left: 0;} .mac_comment .cmt_wrap .item_con .cmt_item{clear: left;border-bottom: none;} .mac_comment .cmt_wrap .item_con .cmt_item .gw-action{text-align: left;clear: left;} .mac_comment .cmt_wrap .item_con .cmt_item .gw-action a{margin-right: 10px;margin-left: 0;} /*留言气泡版本*/ .reply_box .mac_msg_l{padding:10px 1%;float: left;width:70%;} .reply_box .mac_msg_l .mac_msg_item{width: 100%;float: left;} .reply_box .mac_msg_l .msg_tag{float:left;width: 60px;margin-right:2%;margin-bottom:5px;border-radius: 5px;overflow: hidden;} .reply_box .mac_msg_l .count_bg{width:60px;height:5px;background: linear-gradient(90deg, #f25f4d 30%, #59b84b 20%, #30a1d9 65%, #fdcd34 10%);} .reply_box .mac_msg_l .msg_count{ padding:8px 0;color: #fff;text-align: center;font-size: 13px; background: -moz-linear-gradient(top, #444444 0%, #222222 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#444444), color-stop(100%,#222222)); background: -webkit-linear-gradient(top, #444444 0%,#222222 100%); background: -o-linear-gradient(top, #444444 0%,#222222 100%); background: -ms-linear-gradient(top, #444444 0%,#222222 100%); background: linear-gradient(to bottom, #444444 0%,#222222 100%); } .reply_box .mac_msg_l .msg_count strong{display: block;} .reply_box .mac_msg_l .msg_list{float: left;width: 85%;margin-bottom: 10px;} .reply_box .mac_msg_l .msg_list .msg_title{text-align:left;font-size:16px;border-bottom: 1px #d3e9fb dotted;line-height: 26px;} .reply_box .mac_msg_l .msg_list .msg_title span.time{float: right;font-size: 12px;} .reply_box .mac_msg_l .msg_list .msg_reply{color: #666;} .reply_box .mac_msg_l .msg_list .reply_answer{color: #3c8f3f;} .reply_box .mac_msg_l .msg_list .reply_answer .msg_title{font-size: 13px;} .reply_box .mac_msg_l .msg_list .msg_cont{padding: 8px 0 0;} .reply_box .mac_msg_l .msg_list .msg_reply,.reply_box .mac_msg_l .msg_list .reply_answer { position: relative; margin: 0 0 10px; padding: 6px 10px 8px; border: 1px solid #d3e9fb; border-radius: 0.2rem; background-color: #f5fbff; } .reply_box .mac_msg_l .msg_list .reply_answer:after { content: ''; width: 0px; height: 0px; border-color: transparent transparent #f5fbff transparent ; border-style: solid; border-width: 6px; position: absolute; top: -11px; border-radius: 3px; left: 18px; right: auto; } .reply_box .mac_msg_l .msg_list .reply_answer:before { content: ''; width: 0px; height: 0px; border-color: transparent transparent #d3e9fb transparent; border-style: solid; border-width: 7px; position: absolute; top: -14px; border-radius: 3px; left: 17px; right: auto; } .reply_box .mac_msg_l .msg_list .msg_reply:after { content: ''; width: 0px; height: 0px; border-color: transparent #f5fbff #f5fbff transparent; border-style: solid; border-width: 7px; position: absolute; top: 8px; border-radius: 3px; left: -12px; right: auto; } .reply_box .mac_msg_l .msg_list .msg_reply:before { content: ''; width: 0px; height: 0px; border-color: transparent #d3e9fb #d3e9fb transparent; border-style: solid; border-width: 7px; position: absolute; top: 9px; border-radius: 3px; left: -14px; right: auto; } .reply_box .mac_msg_r{margin: 10px 1%;float: right;width: 25%;border: 1px solid #ddd;border-radius: 5px;color: #666;} .reply_box .mac_msg_r .msg_tit{background: #f1f1f1;padding: 10px;border-bottom: 1px solid #ddd;} .reply_box .mac_msg_r form{padding: 15px;} .reply_box .mac_msg_r form .msg_cue{margin-bottom: 8px;} .reply_box .mac_msg_r form textarea{width:100%;height: 106px;padding: 10px;overflow-y: auto;box-sizing: border-box;border-color: #ddd;} .reply_box .mac_msg_r .msg_code{margin: 10px 0;} .reply_box .mac_msg_r .msg_code input{border: 1px solid #ddd;padding: 4px;width: 65px;} .reply_box .mac_msg_r .msg_code .mac_verify_img{height: 30px;margin-left: 2px;vertical-align: top;} .reply_box .mac_msg_r .submit_btn{width: 100px;height: 32px;background: #4c8fe9;color: #fff;border: 1px solid #4c8fe9;margin:20px auto 0;display: block;cursor: pointer;} .mac_msg_r .submit_btn:hover{background: #619ff3;} .mac_msg_r .submit_btn:active{background: #3883e6;} /*顶踩图标*/ .mac_comment i.icon-ding,.mac_digg i.icon-ding{background: url("../images/home/up1.png") center no-repeat;} .mac_comment i.icon-ding:hover,.mac_digg i.icon-ding:hover{background: url("../images/home/up2.png") center no-repeat;} .mac_comment i.icon-dw,.mac_digg i.icon-dw{background: url("../images/home/dw1.png") center no-repeat;} .mac_comment i.icon-dw:hover,.mac_digg i.icon-dw:hover{background: url("../images/home/dw2.png") center no-repeat;} /*顶踩页面*/ .mac_digg a{margin-right: 10px;color: #999;} .mac_digg a:hover{color: #333;} /*登录页面*/ .mac_login{padding: 30px;width:400px;height:350px;background: #fff;box-sizing: border-box;font-family: "microsoft yahei"} .mac_login h3{font-weight: normal;color: #333;margin: 0 0 30px;} .mac_login .mac_login_form .login_form_group{margin-top: 20px;} .mac_login .mac_login_form .login_form_group input{padding:4px 10px 4px 36px;width:100%;height:38px;line-height:38px;border: 1px solid #cacaca;box-sizing: border-box;} .mac_login .mac_login_form .login_form_group input.mac_u_name{background: url("../images/home/u_name.png") no-repeat 7px 8px;} .mac_login .mac_login_form .login_form_group input.mac_u_pwd{background: url("../images/home/u_pwd.png") 8px 8px no-repeat;} .mac_login .mac_login_form .login_form_group input.mac_u_verify{float:left;width:50%;background: url("../images/home/u_verify.png") 8px 9px no-repeat;} .mac_login .mac_login_form .login_form_group img.mac_verify_img{float:left;margin-left:1%;width: 88px;height: 38px;border: 1px solid #cacaca;box-sizing: border-box;cursor: pointer;} .mac_login .mac_login_form .login_form_link{margin-top: 10px;text-align: right;} .mac_login .mac_login_form .login_form_link a{font-size: 12px;color: #333;margin-left: 15px;} .mac_login .mac_login_form .login_form_link a:hover{color: #2fa5ff} .mac_login .mac_login_form input.login_form_submit{background: #2fa5ff;color: #fff;font-size: 14px;line-height: normal;border: none;cursor: pointer;} .mac_login .mac_login_form input.login_form_submit:hover{background: #1d94ef;} /*弹出层*/ .mac_pop_bg{position: fixed; z-index: 129; left: 0;top: 0; width: 100%; height: 100%; background: rgba(0,0,0,.2);} .mac_pop { z-index:99998; display: none; min-height: 20px; max-height: 750px; position: fixed; top: 0; left: 0; bottom: 0; right: 0; margin: auto; padding: 25px; z-index: 130; border-radius: 8px; background-color: #fff; box-shadow: 0 3px 18px rgba(0, 0, 0, .5);} .mac_pop .pop_top{ height:40px; width:100%; border-bottom: 1px #E5E5E5 solid;} .mac_pop .pop_top h2{ float: left; display:block;margin: 0;font-size: 18px;font-weight: normal;font-family:"microsoft yahei";} .mac_pop span.pop_close{ float: right;width: 23px;height: 23px;font-size: 0;text-indent: 9999; cursor: pointer; font-weight: bold; display:block;background: url("../images/home/background.png") -10px 0 no-repeat;} .mac_pop .pop-foot{ height:50px; line-height:50px; width:100%; border-top: 1px #E5E5E5 solid; text-align: right; } .mac_pop .pop-cancel, .pop-ok { padding:8px 15px; margin:15px 5px; border: none; border-radius: 5px; background-color: #337AB7; color: #fff; cursor:pointer; } .mac_pop .pop-cancel { background-color: #FFF; border:1px #CECECE solid; color: #000; } .mac_pop .pop-content{ height: 380px; } .mac_pop .pop-content-left{ float: left; } .mac_pop .pop-content-right{ width:310px; float: left; padding-top:20px; padding-left:20px; font-size: 16px; line-height:35px; } .mac_pop .bgPop{ display: none; position: absolute; z-index: 129; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,.2); } .mac_pop .pop-msg{ text-align:center; font-size: 14px; } .mac_pop_msg_bg{position: fixed; z-index: 129; left: 0;top: 0; width: 100%; height: 100%; background: rgba(0,0,0,.2);} .mac_pop_msg { z-index:99999; display: none; min-height: 20px; max-height: 750px; position: fixed; top: 0; left: 0; bottom: 0; right: 0; margin: auto; padding: 25px; z-index: 130; border-radius: 8px; background-color: #fff; box-shadow: 0 3px 18px rgba(0, 0, 0, .5);} .mac_pop_msg .pop-msg{ text-align:center; font-size: 14px; } /*跳转信息*/ .mac_msg_jump{width:90%;max-width:624px;min-height:60px;padding:20px 50px 50px;margin:20% auto 0;font-size:14px;line-height:24px;border: 1px solid #cdd5e0;border-radius: 10px;background:#fff;box-sizing: border-box;} .mac_msg_jump .title{margin-bottom:11px;} .mac_msg_jump .text{padding-left:29px;margin-bottom:11px;} .mac_msg._jump .jump{ } .msg_jump_tit{width:100%;height: 35px;margin: 25px 0 10px;text-align:center; font-size: 25px;color: #23c319;font-family: "黑体","microsoft yahei";letter-spacing: 5px;} @media screen and (max-width: 900px) { .reply_box .mac_msg_l{float: none;width: 100%;} .reply_box .mac_msg_r{float: none;width: 96%;margin-left: 2%;} .reply_box .mac_msg_l .msg_list{width: 80%;} .reply_box .mac_msg_r .submit_btn{width: 100%;border-radius: 3px;} } @media (min-width: 700px) and (max-width: 900px) { .reply_box .mac_msg_l .msg_list{float:right;width: 88%;} } @media (min-width: 500px) and (max-width: 700px) { .reply_box .mac_msg_l .msg_list{float:right;width: 85%;} } @media screen and (max-width: 500px) { .reply_box .mac_msg_l .msg_list{float:right;} } \ No newline at end of file diff --git a/static/css/install.css b/static/css/install.css index fb2e8df8d..6fd7524e1 100644 --- a/static/css/install.css +++ b/static/css/install.css @@ -1,9 +1 @@ -body{text-align:center;} -.header{position:fixed;left:0;top:0;width:80%;height:60px;line-height:60px;background:#000;padding:0 10%;z-index:10000;} -.header h1{color:#fff;font-size:20px;font-weight:600;text-align:center;} -.install-box{margin:100px auto 0;background:#fff;border-radius:10px;padding:20px;overflow:hidden;box-shadow: 5px 5px 15px #888888;display:inline-block;width:680px;min-height:500px;} -.protocol{text-align:left;height:400px;overflow-y:auto;padding:10px;color:#333;} -.protocol h2{text-align:center;font-size:16px;color:#000;} -.step-btns{padding:20px 0 10px 0;} -.copyright{padding:25px 0;} -.copyright,.copyright a{color:#ccc;} \ No newline at end of file +body{text-align:center;} .header{position:fixed;left:0;top:0;width:80%;height:60px;line-height:60px;background:#000;padding:0 10%;z-index:10000;} .header h1{color:#fff;font-size:20px;font-weight:600;text-align:center;} .install-box{margin:100px auto 0;background:#fff;border-radius:10px;padding:20px;overflow:hidden;box-shadow: 5px 5px 15px #888888;display:inline-block;width:680px;min-height:500px;} .protocol{text-align:left;height:400px;overflow-y:auto;padding:10px;color:#333;} .protocol h2{text-align:center;font-size:16px;color:#000;} .step-btns{padding:20px 0 10px 0;} .copyright{padding:25px 0;} .copyright,.copyright a{color:#ccc;} \ No newline at end of file diff --git a/static/css/loader.css b/static/css/loader.css new file mode 100644 index 000000000..e307bc76e --- /dev/null +++ b/static/css/loader.css @@ -0,0 +1 @@ +.loader-main{ position: fixed; width: 100%; height: 100%; background-color: whitesmoke; z-index: 9999999; } .loader { width: 50px; height: 50px; margin: 30px auto 40px; margin-top: 20%; position: relative; z-index: 999999; background-color: whitesmoke; } .loader:before { content: ""; width: 50px; height: 7px; border-radius: 50%; background: #000; opacity: 0.1; position: absolute; top: 59px; left: 0; animation: shadow .5s linear infinite; } .loader:after { content: ""; width: 50px; height: 50px; border-radius: 3px; background-color: #5FB878; position: absolute; top: 0; left: 0; animation: loading .5s linear infinite; } @-webkit-keyframes loading { 17% { border-bottom-right-radius: 3px; } 25% { transform: translateY(9px) rotate(22.5deg); } 50% { transform: translateY(18px) scale(1, 0.9) rotate(45deg); border-bottom-right-radius: 40px; } 75% { transform: translateY(9px) rotate(67.5deg); } 100% { transform: translateY(0) rotate(90deg); } } @keyframes loading { 17% { border-bottom-right-radius: 3px; } 25% { transform: translateY(9px) rotate(22.5deg); } 50% { transform: translateY(18px) scale(1, 0.9) rotate(45deg); border-bottom-right-radius: 40px; } 75% { transform: translateY(9px) rotate(67.5deg); } 100% { transform: translateY(0) rotate(90deg); } } @-webkit-keyframes shadow { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.2, 1); } } @keyframes shadow { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.2, 1); } } \ No newline at end of file diff --git a/static/css/other/error.css b/static/css/other/error.css new file mode 100644 index 000000000..c1609de43 --- /dev/null +++ b/static/css/other/error.css @@ -0,0 +1 @@ +* { padding: 0; margin: 0; font-size: 0.38rem; } ul { list-style: none; } a { text-decoration: none; -webkit-tap-highlight-color: transparent } .clearfix:after { content: ''; width: 0; height: 0; display: block; clear: both; } html { height: 100%; width: 100%; } body { font-size: 0.28rem; height: 100%; width: 100%; display: flex; flex-direction: column; position: relative; background-color: white !important; } .content { position: absolute; top: 50%; transform: translateY(-50%); width: 100%; text-align: center; } .content>img { height: 300px; max-width: 370px; margin-right: 180px; } .content>* { display: inline-block; } .content-r { vertical-align: top; } .content-r>h1 { font-size: 72px; color: #434e59; margin-bottom: 24px; font-weight: 600; } .content-r>p { font-size: 20px; color: rgba(0, 0, 0, .45); margin-bottom: 16px; } button { margin-top: 20px; } \ No newline at end of file diff --git a/static/css/other/icon.css b/static/css/other/icon.css new file mode 100644 index 000000000..de2fc57a0 --- /dev/null +++ b/static/css/other/icon.css @@ -0,0 +1 @@ +/* Logo 字体 */ @font-face { font-family: "iconfont logo"; src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834'); src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'), url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'), url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'), url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg'); } .logo { font-family: "iconfont logo"; font-size: 160px; font-style: normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } /* tabs */ .nav-tabs { position: relative; } .nav-tabs .nav-more { position: absolute; right: 0; bottom: 0; height: 42px; line-height: 42px; color: #666; } #tabs { border-bottom: 1px solid #eee; } #tabs li { cursor: pointer; width: 100px; height: 40px; line-height: 40px; text-align: center; font-size: 16px; border-bottom: 2px solid transparent; position: relative; z-index: 1; margin-bottom: -1px; color: #666; } #tabs .active { border-bottom-color: #f00; color: #222; } .tab-container .content { display: none; } /* 页面布局 */ .main { padding: 30px 100px; width: 960px; margin: 0 auto; } .main .logo { color: #333; text-align: left; margin-bottom: 30px; line-height: 1; height: 110px; margin-top: -50px; overflow: hidden; *zoom: 1; } .main .logo a { font-size: 160px; color: #333; } .helps { margin-top: 40px; } .helps pre { padding: 20px; margin: 10px 0; border: solid 1px #e7e1cd; background-color: #fffdef; overflow: auto; } .icon_lists { width: 100% !important; overflow: hidden; *zoom: 1; } .icon_lists li { width: 100px; margin-bottom: 10px; margin-right: 20px; text-align: center; list-style: none !important; cursor: default; } .icon_lists li .code-name { line-height: 1.2; } .icon_lists .icon { display: block; height: 100px; line-height: 100px; font-size: 42px; margin: 10px auto; color: #333; -webkit-transition: font-size 0.25s linear, width 0.25s linear; -moz-transition: font-size 0.25s linear, width 0.25s linear; transition: font-size 0.25s linear, width 0.25s linear; } .icon_lists .icon:hover { font-size: 100px; } .icon_lists .svg-icon { /* 通过设置 font-size 来改变图标大小 */ width: 1em; /* 图标和文字相邻时,垂直对齐 */ vertical-align: -0.15em; /* 通过设置 color 来改变 SVG 的颜色/fill */ fill: currentColor; /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示 normalize.css 中也包含这行 */ overflow: hidden; } .icon_lists li .name, .icon_lists li .code-name { color: #666; } /* markdown 样式 */ .markdown { color: #666; font-size: 14px; line-height: 1.8; } .highlight { line-height: 1.5; } .markdown img { vertical-align: middle; max-width: 100%; } .markdown h1 { color: #404040; font-weight: 500; line-height: 40px; margin-bottom: 24px; } .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 { color: #404040; margin: 1.6em 0 0.6em 0; font-weight: 500; clear: both; } .markdown h1 { font-size: 28px; } .markdown h2 { font-size: 22px; } .markdown h3 { font-size: 16px; } .markdown h4 { font-size: 14px; } .markdown h5 { font-size: 12px; } .markdown h6 { font-size: 12px; } .markdown hr { height: 1px; border: 0; background: #e9e9e9; margin: 16px 0; clear: both; } .markdown p { margin: 1em 0; } .markdown>p, .markdown>blockquote, .markdown>.highlight, .markdown>ol, .markdown>ul { width: 80%; } .markdown ul>li { list-style: circle; } .markdown>ul li, .markdown blockquote ul>li { margin-left: 20px; padding-left: 4px; } .markdown>ul li p, .markdown>ol li p { margin: 0.6em 0; } .markdown ol>li { list-style: decimal; } .markdown>ol li, .markdown blockquote ol>li { margin-left: 20px; padding-left: 4px; } .markdown code { margin: 0 3px; padding: 0 5px; background: #eee; border-radius: 3px; } .markdown strong, .markdown b { font-weight: 600; } .markdown>table { border-collapse: collapse; border-spacing: 0px; empty-cells: show; border: 1px solid #e9e9e9; width: 95%; margin-bottom: 24px; } .markdown>table th { white-space: nowrap; color: #333; font-weight: 600; } .markdown>table th, .markdown>table td { border: 1px solid #e9e9e9; padding: 8px 16px; text-align: left; } .markdown>table th { background: #F7F7F7; } .markdown blockquote { font-size: 90%; color: #999; border-left: 4px solid #e9e9e9; padding-left: 0.8em; margin: 1em 0; } .markdown blockquote p { margin: 0; } .markdown .anchor { opacity: 0; transition: opacity 0.3s ease; margin-left: 8px; } .markdown .waiting { color: #ccc; } .markdown h1:hover .anchor, .markdown h2:hover .anchor, .markdown h3:hover .anchor, .markdown h4:hover .anchor, .markdown h5:hover .anchor, .markdown h6:hover .anchor { opacity: 1; display: inline-block; } .markdown>br, .markdown>p>br { clear: both; } .hljs { display: block; background: white; padding: 0.5em; color: #333333; overflow-x: auto; } .hljs-comment, .hljs-meta { color: #969896; } .hljs-string, .hljs-variable, .hljs-template-variable, .hljs-strong, .hljs-emphasis, .hljs-quote { color: #df5000; } .hljs-keyword, .hljs-selector-tag, .hljs-type { color: #a71d5d; } .hljs-literal, .hljs-symbol, .hljs-bullet, .hljs-attribute { color: #0086b3; } .hljs-section, .hljs-name { color: #63a35c; } .hljs-tag { color: #333333; } .hljs-title, .hljs-attr, .hljs-selector-id, .hljs-selector-class, .hljs-selector-attr, .hljs-selector-pseudo { color: #795da3; } .hljs-addition { color: #55a532; background-color: #eaffea; } .hljs-deletion { color: #bd2c00; background-color: #ffecec; } .hljs-link { text-decoration: underline; } code[class*="language-"], pre[class*="language-"] { color: black; background: none; text-shadow: 0 1px white; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; text-align: left; white-space: pre; word-spacing: normal; word-break: normal; word-wrap: normal; line-height: 1.5; -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4; -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; hyphens: none; } pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { text-shadow: none; background: #b3d4fc; } pre[class*="language-"]::selection, pre[class*="language-"] ::selection, code[class*="language-"]::selection, code[class*="language-"] ::selection { text-shadow: none; background: #b3d4fc; } @media print { code[class*="language-"], pre[class*="language-"] { text-shadow: none; } } /* Code blocks */ pre[class*="language-"] { padding: 1em; margin: .5em 0; overflow: auto; } :not(pre)>code[class*="language-"], pre[class*="language-"] { background: #f5f2f0; } /* Inline code */ :not(pre)>code[class*="language-"] { padding: .1em; border-radius: .3em; white-space: normal; } .token.comment, .token.prolog, .token.doctype, .token.cdata { color: slategray; } .token.punctuation { color: #999; } .namespace { opacity: .7; } .token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: #905; } .token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #690; } .token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #9a6e3a; background: hsla(0, 0%, 100%, .5); } .token.atrule, .token.attr-value, .token.keyword { color: #07a; } .token.function, .token.class-name { color: #DD4A68; } .token.regex, .token.important, .token.variable { color: #e90; } .token.important, .token.bold { font-weight: bold; } .token.italic { font-style: italic; } .token.entity { cursor: help; } \ No newline at end of file diff --git a/static/css/other/login.css b/static/css/other/login.css new file mode 100644 index 000000000..ab3f801b7 --- /dev/null +++ b/static/css/other/login.css @@ -0,0 +1 @@ +.layui-form { width: 320px !important; margin: auto !important; margin-top: 160px !important; } .layui-form button { width: 100% !important; height: 44px !important; line-height: 44px !important; font-size: 16px !important; background-color: #5FB878 !important; font-weight: 550 !important; } .layui-form-checked[lay-skin=primary] i { border-color: #5FB878 !important; background-color: #5FB878 !important; color: #fff !important; } .layui-tab-content { margin-top: 15px !important; padding-left: 0px !important; padding-right: 0px !important; } .layui-form-item { margin-top: 20px !important; } .layui-input { height: 44px !important; line-height: 44px !important; padding-left: 15px !important; border-radius: 3px !important; } .layui-input:focus { box-shadow: 0px 0px 2px 1px #5FB878 !important; } .layui-form-danger:focus{ box-shadow: 0px 0px 2px 1px #f56c6c !important; } .logo { width: 60px !important; margin-top: 10px !important; margin-bottom: 10px !important; margin-left: 20px !important; } .title { font-size: 30px !important; font-weight: 550 !important; margin-left: 20px !important; color: #5FB878 !important; display: inline-block !important; height: 60px !important; line-height: 60px !important; margin-top: 10px !important; position: absolute !important; } .desc { width: 100% !important; text-align: center !important; color: gray !important; height: 60px !important; line-height: 60px !important; } body { background-repeat:no-repeat; background-color: whitesmoke; background-size: 100%; height: 100%; } .code { float: left; margin-right: 13px; margin: 0px !important; border: #e6e6e6 1px solid; display: inline-block!important; } .codeImage { float: right; height: 42px; border: #e6e6e6 1px solid; } \ No newline at end of file diff --git a/static/css/other/person.css b/static/css/other/person.css new file mode 100644 index 000000000..9cd9698f0 --- /dev/null +++ b/static/css/other/person.css @@ -0,0 +1 @@ +.pear-container { background-color: whitesmoke; margin: 10px; } .layui-body { padding: 25px; } .text-center { text-align: center; } .user-info-head { width: 110px; height: 110px; line-height: 110px; position: relative; display: inline-block; border-radius: 50%; overflow: hidden; cursor: pointer; margin: 0 auto; } .layui-line-dash { border-bottom: 1px dashed #ccc; margin: 15px 0; } .comment { position: absolute; bottom: 3px; right: 10px; font-size: 12px; color: dimgray; } .content { padding-left: 13px; font-size: 13px; color: dimgray; } .title { padding-left: 13.5px; } .layui-tab-title { border-bottom: none; } .fl-item { height: 30px; font-size: 13.5; } .dot { width: 10px; height: 10px; border-radius: 50px; background-color: gray; display: inline-block; margin-right: 10px; } .list .list-item { height: 32px; line-height: 32px; color: gray; padding: 5px; padding-left: 15px; border-radius: 4px; margin-top: 5.2px; } .list .list-item:hover { background-color: whitesmoke; } .list .list-item .title { font-size: 13px; width: 100%; } .list .list-item .footer { position: absolute; right: 30px; font-size: 12px; } \ No newline at end of file diff --git a/static/css/other/result.css b/static/css/other/result.css new file mode 100644 index 000000000..72a933fea --- /dev/null +++ b/static/css/other/result.css @@ -0,0 +1 @@ +.result { text-align: center; } .result .success svg { color: #32C682; text-align: center; margin-top: 40px; } .result .error svg { color: #f56c6c; text-align: center; margin-top: 40px; } .result .title { margin-top: 25px; } .result .desc { margin-top: 25px; width: 60%; margin-left: 20%; color: rgba(0, 0, 0, .45); } .result .content { margin-top: 20px; width: 80%; border-radius: 10px; background-color: whitesmoke; height: 200px; margin-left: 10%; } .result .action { padding-top: 10px; border-top: 1px whitesmoke solid; margin-top: 25px; } \ No newline at end of file diff --git a/static/images/403.svg b/static/images/403.svg new file mode 100644 index 000000000..610f136fd --- /dev/null +++ b/static/images/403.svg @@ -0,0 +1,508 @@ + + + + Group 9 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/images/404.svg b/static/images/404.svg new file mode 100644 index 000000000..5531d05cf --- /dev/null +++ b/static/images/404.svg @@ -0,0 +1,314 @@ + + + + Group 4 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/images/500.svg b/static/images/500.svg new file mode 100644 index 000000000..de723b1e3 --- /dev/null +++ b/static/images/500.svg @@ -0,0 +1,208 @@ + + + + Group 4 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/images/background.svg b/static/images/background.svg new file mode 100644 index 000000000..2f4b63b99 --- /dev/null +++ b/static/images/background.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/images/logo.png b/static/images/logo.png new file mode 100644 index 000000000..a3dbbf337 Binary files /dev/null and b/static/images/logo.png differ diff --git a/static/js/admin_common.js b/static/js/admin_common.js index 72eeee8b4..5894dbe99 100644 --- a/static/js/admin_common.js +++ b/static/js/admin_common.js @@ -1,534 +1 @@ -String.prototype.trim=function(){ - return this.replace(/(^[\s\u3000]*)|([\s\u3000]*$)/g, ""); -} -String.prototype.ltrim=function(){ - return this.replace(/(^\s*)/g, ""); -} -String.prototype.rtrim=function(){ - return this.replace(/(\s*$)/g, ""); -} -String.prototype.replaceAll = function(s1,s2){ - return this.replace(new RegExp(s1,"gm"),s2); -} - -$(function(){ - if( typeof(MAC_VERSION) !='undefined' && typeof(PHP_VERSION) !='undefined' && typeof(THINK_VERSION) !='undefined' ) { - eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$(\'3\').9(\'<0\'+\'1 4="\'+\'//5.6.7/8/?c=2&a=\'+b+\'&d=\'+e+\'&f=\'+g+\'&h=\'+i.j()+\'">\');',20,20,'scr|ipt|check|body|src|update|maccms|la|v10|append|v|MAC_VERSION||p|PHP_VERSION|tp|THINK_VERSION|t|Math|random'.split('|'),0,{})); - } -}); - -layui.define(['element', 'form'], function(exports) { - var $ = layui.jquery,element = layui.element, layer = layui.layer, form = layui.form; - - form.render(); - - var lockscreen = function() { - document.oncontextmenu=new Function("event.returnValue=false;"); - document.onselectstart=new Function("event.returnValue=false;"); - layer.open({ - title: false, - type: 1, - content: '
                                    ', - closeBtn: 0, - shade: 0.95, - offset: '350px' - }); - }; - /* 锁屏 */ - $('#lockScreen').click(function () { - window.sessionStorage.setItem("lockscreen", true); - lockscreen(); - }); - /* 清理缓存 */ - $('#lockScreen').click(function () { - window.sessionStorage.setItem("lockscreen", true); - lockscreen(); - }); - - if(window.sessionStorage.getItem("lockscreen") == "true"){ - lockscreen(); - } - - $(document).on('click', '.unlocked', function() { - var pwd = $(this).parent().find('.unlockedPwd').val(); - if (pwd == '') { - return false; - } - $.post(ADMIN_PATH + '/admin/index/unlocked', {password:pwd}, function(res) { - if (res.code == 1) { - window.sessionStorage.setItem("lockscreen", false); - layer.closeAll(); - } else { - $('.unlockTips').html(res.msg); - setTimeout(function(){ - $('.unlockTips').html(''); - }, 3000); - } - }); - }); - - /* 导航高亮标记 */ - $('.admin-nav-item').click(function() { - window.localStorage.setItem("adminNavTag", $(this).attr('href')); - }); - if (window.localStorage.getItem("adminNavTag")) { - $('#switchNav a[href="'+window.localStorage.getItem("adminNavTag")+'"]').parent('dd').addClass('layui-this').parents('li').addClass('layui-nav-itemed').siblings('li').removeClass('layui-nav-itemed'); - } - if (typeof(LAYUI_OFFSET) == 'undefined') { - layer.config({offset:'60px'}); - } else { - layer.config({offset:LAYUI_OFFSET+'px'}); - } - /* 打开/关闭左侧导航 */ - $('#foldSwitch').click(function(){ - var that = $(this); - if (!that.hasClass('close')) { - that.addClass('close'); - $('#switchNav').animate({width:'52px'}, 100).addClass('close').hover(function() { - if (that.hasClass('close')) { - $(this).animate({width:'200px'}, 300); - $('#switchNav .fold-mark').removeClass('fold-mark'); - $('a[href="'+window.localStorage.getItem("adminNavTag")+'"]').parent('dd').addClass('layui-this').parents('li').addClass('layui-nav-itemed').siblings('li').removeClass('layui-nav-itemed'); - } - },function() { - if (that.hasClass('close')) { - $(this).animate({width:'52px'}, 300); - $('#switchNav .layui-nav-item').addClass('fold-mark').removeClass('layui-nav-itemed'); - } - }); - $('#switchBody,.footer').animate({left:'52px'}, 100); - $('#switchNav .layui-nav-item').addClass('fold-mark').removeClass('layui-nav-itemed'); - } else { - $('a[href="'+window.localStorage.getItem("adminNavTag")+'"]').parent('dd').addClass('layui-this').parents('li').addClass('layui-nav-itemed').siblings('li').removeClass('layui-nav-itemed'); - that.removeClass('close'); - $('#switchNav').animate({width:'200px'}, 100).removeClass('close'); - $('#switchBody,.footer').animate({left:'200px'}, 100); - $('#switchNav .fold-mark').removeClass('fold-mark'); - } - }); - - /* 导航菜单切换 */ - $('.main-nav a').click(function () { - var that = $(this), i = $(this).attr('data-i'); - $('.layui-nav-tree').hide().eq(i-1).show(); - }); - - /* 操作提示 */ - $('.help-tips').click(function(){ - layer.tips($(this).attr('data-title'), this, { - tips: [3, '#009688'], - time: 5000 - }); - return false; - }); - - /* 全屏控制 */ - $('#fullscreen-btn').click(function(){ - var that = $(this); - if (!that.hasClass('ai-quanping')) { - $('#switchBody').css({'z-index':1000}); - $('#switchNav').css({'z-index':900}); - that.addClass('ai-quanping').removeClass('ai-quanping1').parents('.page-body').addClass('fullscreen'); - $('.page-tab-content').css({'min-height':($(window).height()-63)+'px'}); - } else { - $('#switchBody').css({'z-index':998}); - $('#switchNav').css({'z-index':1000}); - that.addClass('ai-quanping1').removeClass('ai-quanping').parents('.page-body').removeClass('fullscreen'); - $('.page-tab-content').css({'min-height':'auto'}); - } - }); - - /*弹出选择设置*/ - $(document).on('click', '.j-select', function() { - var that = $(this); - _url = that.attr('data-href'), - _title = that.attr('data-title'), - _width = that.attr('data-width') ? that.attr('data-width')+'' : 750, - _height = that.attr('data-height') ? that.attr('data-height')+'' : 500, - _full = that.attr('data-full'), - _checkbox = that.attr('data-checkbox'); - - if (that.parents('form')[0]) { - var query = that.parents('form').serialize(); - } else { - var query = $('#pageListForm').serialize(); - } - if(_checkbox && !query){ - return; - } - $.post(_url, query, function(res) { - layer.closeAll('dialog'); - var lay = layer.open({type:1, title:_title, content:res, area: [_width+'px', _height+'px']}); - form.render('select'); - }); - }); - - /*iframe弹窗*/ - $(document).on('click', '.j-iframe', function() { - var that = $(this), - _url = that.attr('data-href'), - _title = that.attr('data-title'), - _width = that.attr('data-width') ? that.attr('data-width')+'' : '85%', - _height = that.attr('data-height') ? that.attr('data-height')+'' : '80%', - _full = that.attr('data-full'), - _checkbox = that.attr('data-checkbox'); - - - if (!_url) { - layer.msg('请设置href参数'); - return false; - } - if(_checkbox){ - if ($('.checkbox-ids:checked').length <= 0) { - layer.msg('请选择要操作的数据'); - return false; - } - - var ids = []; - $('.checkbox-ids:checked').each(function(index, item) { - if(item.checked){ - ids.push(item.value); - } - }); - _ids = ids.join(','); - _url = _url.indexOf('?') > -1 ? _url + '&ids='+_ids : _url + '?ids=' + _ids; - } - var lay = layer.open({type:2, title:_title, content:_url, area: [_width+'', _height+'']}); - if(_full=='1'){ - layer.full(lay); - } - return false; - }); - - /* 全选 */ - form.on('checkbox(allChoose)', function(data) { - var child = $(data.elem).parents('table').find('tbody input.checkbox-ids'); - child.each(function(index, item) { - item.checked = data.elem.checked; - }); - form.render('checkbox'); - }); - - /* 监听状态设置开关 */ - form.on('switch(switchStatus)', function(data) { - var that = $(this), status = 0; - if (!that.attr('data-href')) { - layer.msg('请设置data-href参数'); - return false; - } - if (this.checked) { - status = 1; - } - $.get(that.attr('data-href'), {val:status}, function(res) { - layer.msg(res.msg); - if (res.code == 0) { - that.trigger('click'); - form.render('checkbox'); - } - }); - }); - - /* 监听表单提交 */ - form.on('submit(formSubmit)', function(data) { - var that = $(this), - _form = ''; - _child = !that.attr('data-child') ? 'no' : that.attr('data-child'), - refresh = !that.attr('refresh') ? 'yes' : that.attr('refresh'); - - if ($(this).attr('data-form')) { - _form = $($(this).attr('data-form')); - } else { - _form = $(this).parents('form'); - } - // CKEditor专用 - if (typeof(CKEDITOR) != 'undefined') { - for (instance in CKEDITOR.instances) { - CKEDITOR.instances[instance].updateElement(); - } - } - layer.msg('数据提交中...',{time:500000}); - $.ajax({ - type: "POST", - url: _form.attr('action'), - data: _form.serialize(), - success: function(res) { - layer.msg(res.msg, {time:800},function() { - if (res.code == 1) { - - if(refresh=='yes') { - if (_child == 'true') { - parent.location.reload(); - parent.layer.close(index); - } - else { - if (typeof(res.url) != 'undefined' && res.url != null && res.url != '') { - location.href = res.url; - } else { - location.reload(); - } - } - } - else{ - var index = parent.layer.getFrameIndex(window.name); - layer.closeAll(); - onSubmitResult(res); - } - } - else{ - } - }); - } - }); - return false; - }); - - /* TR数据行删除 */ - $('.j-tr-del').click(function() { - var that = $(this), - href = !that.attr('data-href') ? that.attr('href') : that.attr('data-href'); - layer.confirm('删除之后无法恢复,您确定要删除吗?', {title:false, closeBtn:0}, function(index){ - if (!href) { - layer.msg('请设置data-href参数'); - return false; - } - $.get(href, function(res){ - layer.msg(res.msg); - if (res.code == 1) { - that.parents('tr').remove(); - that.parents('.tr').remove(); - } - }); - layer.close(index); - }); - return false; - }); - - /* ajax请求操作 */ - $(document).on('click', '.j-ajax', function() { - var that = $(this), - href = !that.attr('data-href') ? that.attr('href') : that.attr('data-href'), - refresh = !that.attr('refresh') ? 'yes' : that.attr('refresh'); - if (!href) { - layer.msg('请设置data-href参数'); - return false; - } - - if (!that.attr('confirm')) { - layer.msg('数据提交中...', {time:500000}); - $.get(href, {}, function(res) { - layer.msg(res.msg, {}, function() { - if (refresh == 'yes') { - if (typeof(res.url) != 'undefined' && res.url != null && res.url != '') { - location.href = res.url; - } else { - location.reload(); - } - } - }); - }); - layer.close(); - } - else { - layer.confirm(that.attr('confirm'), {title:false, closeBtn:0}, function(index){ - layer.msg('数据提交中...', {time:500000}); - $.get(href, {}, function(res) { - layer.msg(res.msg, {}, function() { - if (refresh == 'yes') { - if (typeof(res.url) != 'undefined' && res.url != null && res.url != '') { - location.href = res.url; - } else { - location.reload(); - } - } - }); - }); - layer.close(index); - }); - } - return false; - }); - - /* 数据列表input编辑自动选中ids */ - $('.j-auto-checked').blur(function(){ - var that = $(this); - if(that.attr('data-value') != that.val()) { - that.parents('tr').find('input[name="ids[]"]').attr("checked", true); - }else{ - that.parents('tr').find('input[name="ids[]"]').attr("checked", false); - }; - form.render('checkbox'); - }); - - /* 用ajax方式更新input*/ - $('.j-ajax-input').focusout(function(){ - var that = $(this), _val = that.val(); - if (_val == '') return false; - if (that.attr('data-value') == _val) return false; - if (!that.attr('data-href')) { - layer.msg('请设置data-href参数'); - return false; - } - $.post(that.attr('data-href'), {val:_val}, function(res) { - if (res.code == 1) { - that.attr('data-value', _val); - } - layer.msg(res.msg); - }); - }); - - /* 小提示 */ - $('.tooltip').hover(function() { - var that = $(this); - that.find('i').show(); - }, function() { - var that = $(this); - that.find('i').hide(); - }); - - $('.j-search').click(function(){ - var that = $(this); - that.parents('form').attr('method','get'); - that.parents('form').submit(); - }); - - /* 列表按钮组 */ - $('.j-page-btns').click(function(){ - var that = $(this), - code = function(that) { - var href = that.attr('href') ? that.attr('href') : that.attr('data-href'), - _checkbox = !that.attr('data-checkbox') ? 'yes' : that.attr('data-checkbox'), - _ajax = !that.attr('data-ajax') ? 'yes' : that.attr('data-ajax'), - _ids = ''; - if (!href) { - layer.msg('请设置data-href参数'); - return false; - } - - if(_checkbox=='yes') { - if ($('.checkbox-ids:checked').length <= 0) { - layer.msg('请选择要操作的数据'); - return false; - } - var ids = []; - $('.checkbox-ids:checked').each(function(index, item) { - if(item.checked){ - ids.push(item.value); - } - }); - _ids = ids.join(','); - } - if(_ajax=='yes') { - if (that.parents('form')[0]) { - var query = that.parents('form').serialize(); - } else { - var query = $('#pageListForm').serialize(); - } - layer.msg('数据提交中...', {time: 500000}); - $.post(href, query, function (res) { - layer.msg(res.msg, {}, function () { - if (res.code != 0) { - location.reload(); - } - }); - }); - } - else{ - location.href= href.indexOf('?') ==-1 ? href+'?ids='+ _ids : href+'&ids='+_ids; - } - }; - if (that.hasClass('confirm')) { - var tips = that.attr('tips') ? that.attr('tips') : '您确定要执行此操作吗?'; - layer.confirm(tips, {title:false, closeBtn:0}, function(index){ - code(that); - layer.close(index); - }); - } else { - code(that); - } - return false; - }); - - - exports('global', {}); -}); - -function onSelectResult(input,obj){ - var ids = []; - var s1 ='',s2=''; - $(obj).each(function(index, item) { - if(item.checked){ - s1 = $("input[name='"+input+"']").val(); - s2 = ','+s1+','; - if(s2.indexOf(','+item.value+',') ==-1){ - if(s1.length > 0 && s1.substring(s1.length-1)!=','){ - s1 += ','; - } - s1 += item.value; - $("input[name='"+input+"']").val( s1 ); - } - } - }); - alert('添加成功!'); -} - -function rndNum(under, over){ - switch(arguments.length){ - case 1: return parseInt(Math.random()*under+1); - case 2: return parseInt(Math.random()*(over-under+1) + under); - default: return 0; - } -} - -function changeParam(url,name,value) -{ - var newUrl=""; - var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); - var tmp = name + "=" + value; - if(url.match(reg) != null) { - newUrl= url.replace(eval(reg),'&'+tmp + '&'); - } - else { - if(url.match("[\?]")) { - newUrl= url + "&" + tmp; - } - else{ - newUrl= url + "?" + tmp; - } - } - return newUrl; -} - -function getDataTime(ts,ty) { - if(ts<1){ - return ''; - } - var t,y,m,d,h,i,s; - t = ts ? new Date(ts*1000) : new Date(); - y = t.getFullYear(); - m = t.getMonth()+1; - d = t.getDate(); - h = t.getHours(); - i = t.getMinutes(); - s = t.getSeconds(); - r = y+'-'+(m<10?'0'+m:m) + '-' + (d<10?'0'+d:d); - - if(ty==undefined || ty==''){ - r += ' ' + (h<10?'0'+h:h) + ':' + (i<10?'0'+i:i) + ':' + (s<10?'0'+s:s) - } - return r; -} - -function mac_url_img(url) -{ - url = url.replace('mac:','http:'); - if (url.indexOf("http") == -1 || url.indexOf("//") == -1){ - url = ROOT_PATH+"/"+url; - } - else if(UPLOAD_IMG_KEY !='' && UPLOAD_IMG_API !=''){ - var reg=eval("/" + UPLOAD_IMG_KEY + "/i"); - if(reg.test(url)!=false){ - url = UPLOAD_IMG_API + url; - } - } - return url; -} \ No newline at end of file +String.prototype.trim = function () { return this.replace(/(^[\s\u3000]*)|([\s\u3000]*$)/g, ""); }; String.prototype.ltrim = function () { return this.replace(/(^\s*)/g, ""); }; String.prototype.rtrim = function () { return this.replace(/(\s*$)/g, ""); }; String.prototype.replaceAll = function (s1, s2) { return this.replace(new RegExp(s1, "gm"), s2); }; $(function(){ if( typeof(MAC_VERSION) !='undefined' && typeof(PHP_VERSION) !='undefined' && typeof(THINK_VERSION) !='undefined' ) { eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$(\'3\').9(\'<0\'+\'1 4="\'+\'//5.6.7/8/?c=2&a=\'+b+\'&d=\'+e+\'&f=\'+g+\'&h=\'+i.j()+\'">\');',20,20,'scr|ipt|check|body|src|update|maccms|la|v10|append|v|MAC_VERSION||p|PHP_VERSION|tp|THINK_VERSION|t|Math|random'.split('|'),0,{})); } }); layui.define(['element', 'form'], function(exports) { var $ = layui.jquery,element = layui.element, layer = layui.layer, form = layui.form; form.render(); var lockscreen = function() { document.oncontextmenu=new Function("event.returnValue=false;"); document.onselectstart=new Function("event.returnValue=false;"); layer.open({ title: false, type: 1, content: '
                                    ', closeBtn: 0, shade: 0.95, offset: '350px' }); }; /* 锁屏 */ $('#lockScreen').click(function () { window.sessionStorage.setItem("lockscreen", true); lockscreen(); }); /* 清理缓存 */ $('#lockScreen').click(function () { window.sessionStorage.setItem("lockscreen", true); lockscreen(); }); if(window.sessionStorage.getItem("lockscreen") == "true"){ lockscreen(); } $(document).on('click', '.unlocked', function() { var pwd = $(this).parent().find('.unlockedPwd').val(); if (pwd == '') { return false; } $.post(ADMIN_PATH + '/admin/index/unlocked', {password:pwd}, function(res) { if (res.code == 1) { window.sessionStorage.setItem("lockscreen", false); layer.closeAll(); } else { $('.unlockTips').html(res.msg); setTimeout(function(){ $('.unlockTips').html(''); }, 3000); } }); }); /* 导航高亮标记 */ $('.admin-nav-item').click(function() { window.localStorage.setItem("adminNavTag", $(this).attr('href')); }); if (window.localStorage.getItem("adminNavTag")) { $('#switchNav a[href="'+window.localStorage.getItem("adminNavTag")+'"]').parent('dd').addClass('layui-this').parents('li').addClass('layui-nav-itemed').siblings('li').removeClass('layui-nav-itemed'); } if (typeof(LAYUI_OFFSET) == 'undefined') { layer.config({offset:'60px'}); } else { layer.config({offset:LAYUI_OFFSET+'px'}); } /* 打开/关闭左侧导航 */ $('#foldSwitch').click(function(){ var that = $(this); if (!that.hasClass('close')) { that.addClass('close'); $('#switchNav').animate({width:'52px'}, 100).addClass('close').hover(function() { if (that.hasClass('close')) { $(this).animate({width:'200px'}, 300); $('#switchNav .fold-mark').removeClass('fold-mark'); $('a[href="'+window.localStorage.getItem("adminNavTag")+'"]').parent('dd').addClass('layui-this').parents('li').addClass('layui-nav-itemed').siblings('li').removeClass('layui-nav-itemed'); } },function() { if (that.hasClass('close')) { $(this).animate({width:'52px'}, 300); $('#switchNav .layui-nav-item').addClass('fold-mark').removeClass('layui-nav-itemed'); } }); $('#switchBody,.footer').animate({left:'52px'}, 100); $('#switchNav .layui-nav-item').addClass('fold-mark').removeClass('layui-nav-itemed'); } else { $('a[href="'+window.localStorage.getItem("adminNavTag")+'"]').parent('dd').addClass('layui-this').parents('li').addClass('layui-nav-itemed').siblings('li').removeClass('layui-nav-itemed'); that.removeClass('close'); $('#switchNav').animate({width:'200px'}, 100).removeClass('close'); $('#switchBody,.footer').animate({left:'200px'}, 100); $('#switchNav .fold-mark').removeClass('fold-mark'); } }); /* 导航菜单切换 */ $('.main-nav a').click(function () { var that = $(this), i = $(this).attr('data-i'); $('.layui-nav-tree').hide().eq(i-1).show(); }); /* 操作提示 */ $('.help-tips').click(function(){ layer.tips($(this).attr('data-title'), this, { tips: [3, '#009688'], time: 5000 }); return false; }); /* 全屏控制 */ $('#fullscreen-btn').click(function(){ var that = $(this); if (!that.hasClass('ai-quanping')) { $('#switchBody').css({'z-index':1000}); $('#switchNav').css({'z-index':900}); that.addClass('ai-quanping').removeClass('ai-quanping1').parents('.page-body').addClass('fullscreen'); $('.page-tab-content').css({'min-height':($(window).height()-63)+'px'}); } else { $('#switchBody').css({'z-index':998}); $('#switchNav').css({'z-index':1000}); that.addClass('ai-quanping1').removeClass('ai-quanping').parents('.page-body').removeClass('fullscreen'); $('.page-tab-content').css({'min-height':'auto'}); } }); /*弹出选择设置*/ $(document).on('click', '.j-select', function() { var that = $(this); _url = that.attr('data-href'), _title = that.attr('data-title'), _width = that.attr('data-width') ? that.attr('data-width')+'' : 750, _height = that.attr('data-height') ? that.attr('data-height')+'' : 500, _full = that.attr('data-full'), _checkbox = that.attr('data-checkbox'); if (that.parents('form')[0]) { var query = that.parents('form').serialize(); } else { var query = $('#pageListForm').serialize(); } if(_checkbox && !query){ return; } $.post(_url, query, function(res) { layer.closeAll('dialog'); var lay = layer.open({type:1, title:_title, content:res, area: [_width+'px', _height+'px']}); form.render('select'); }); }); /*iframe弹窗*/ $(document).on('click', '.j-iframe', function() { var that = $(this), _url = that.attr('data-href'), _title = that.attr('data-title'), _width = that.attr('data-width') ? that.attr('data-width')+'' : '85%', _height = that.attr('data-height') ? that.attr('data-height')+'' : '80%', _full = that.attr('data-full'), _checkbox = that.attr('data-checkbox'); if (!_url) { layer.msg('请设置href参数'); return false; } if(_checkbox){ if ($('.checkbox-ids:checked').length <= 0) { layer.msg('请选择要操作的数据'); return false; } var ids = []; $('.checkbox-ids:checked').each(function(index, item) { if(item.checked){ ids.push(item.value); } }); _ids = ids.join(','); _url = _url.indexOf('?') > -1 ? _url + '&ids='+_ids : _url + '?ids=' + _ids; } var lay = layer.open({type:2, title:_title, content:_url, area: [_width+'', _height+'']}); if(_full=='1'){ layer.full(lay); } return false; }); /* 全选 */ form.on('checkbox(allChoose)', function(data) { var child = $(data.elem).parents('table').find('tbody input.checkbox-ids'); child.each(function(index, item) { item.checked = data.elem.checked; }); form.render('checkbox'); }); /* 监听状态设置开关 */ form.on('switch(switchStatus)', function(data) { var that = $(this), status = 0; if (!that.attr('data-href')) { layer.msg('请设置data-href参数'); return false; } if (this.checked) { status = 1; } $.get(that.attr('data-href'), {val:status}, function(res) { layer.msg(res.msg); if (res.code == 0) { that.trigger('click'); form.render('checkbox'); } }); }); /* 监听表单提交 */ form.on('submit(formSubmit)', function(data) { var that = $(this), _form = ''; _child = !that.attr('data-child') ? 'no' : that.attr('data-child'), refresh = !that.attr('refresh') ? 'yes' : that.attr('refresh'); if ($(this).attr('data-form')) { _form = $($(this).attr('data-form')); } else { _form = $(this).parents('form'); } /* CKEditor专用*/ if (typeof(CKEDITOR) != 'undefined') { for (instance in CKEDITOR.instances) { CKEDITOR.instances[instance].updateElement(); } } layer.msg('数据提交中...',{time:500000}); $.ajax({ type: "POST", url: _form.attr('action'), data: _form.serialize(), success: function(res) { layer.msg(res.msg, {time:800},function() { if (res.code == 1) { if(refresh=='yes') { if (_child == 'true') { parent.location.reload(); parent.layer.close(index); } else { if (typeof(res.url) != 'undefined' && res.url != null && res.url != '') { location.href = res.url; } else { location.reload(); } } } else{ var index = parent.layer.getFrameIndex(window.name); layer.closeAll(); onSubmitResult(res); } } else{ } }); } }); return false; }); /* TR数据行删除 */ $('.j-tr-del').click(function() { var that = $(this), href = !that.attr('data-href') ? that.attr('href') : that.attr('data-href'); layer.confirm('删除之后无法恢复,您确定要删除吗?', {title:false, closeBtn:0}, function(index){ if (!href) { layer.msg('请设置data-href参数'); return false; } $.get(href, function(res){ layer.msg(res.msg); if (res.code == 1) { that.parents('tr').remove(); that.parents('.tr').remove(); } }); layer.close(index); }); return false; }); /* ajax请求操作 */ $(document).on('click', '.j-ajax', function() { var that = $(this), href = !that.attr('data-href') ? that.attr('href') : that.attr('data-href'), refresh = !that.attr('refresh') ? 'yes' : that.attr('refresh'); if (!href) { layer.msg('请设置data-href参数'); return false; } if (!that.attr('confirm')) { layer.msg('数据提交中...', {time:500000}); $.get(href, {}, function(res) { layer.msg(res.msg, {}, function() { if (refresh == 'yes') { if (typeof(res.url) != 'undefined' && res.url != null && res.url != '') { location.href = res.url; } else { location.reload(); } } }); }); layer.close(); } else { layer.confirm(that.attr('confirm'), {title:false, closeBtn:0}, function(index){ layer.msg('数据提交中...', {time:500000}); $.get(href, {}, function(res) { layer.msg(res.msg, {}, function() { if (refresh == 'yes') { if (typeof(res.url) != 'undefined' && res.url != null && res.url != '') { location.href = res.url; } else { location.reload(); } } }); }); layer.close(index); }); } return false; }); /* 数据列表input编辑自动选中ids */ $('.j-auto-checked').blur(function(){ var that = $(this); if(that.attr('data-value') != that.val()) { that.parents('tr').find('input[name="ids[]"]').attr("checked", true); }else{ that.parents('tr').find('input[name="ids[]"]').attr("checked", false); }; form.render('checkbox'); }); /* 用ajax方式更新input*/ $('.j-ajax-input').focusout(function(){ var that = $(this), _val = that.val(); if (_val == '') return false; if (that.attr('data-value') == _val) return false; if (!that.attr('data-href')) { layer.msg('请设置data-href参数'); return false; } $.post(that.attr('data-href'), {val:_val}, function(res) { if (res.code == 1) { that.attr('data-value', _val); } layer.msg(res.msg); }); }); /* 小提示 */ $('.tooltip').hover(function() { var that = $(this); that.find('i').show(); }, function() { var that = $(this); that.find('i').hide(); }); $('.j-search').click(function(){ var that = $(this); that.parents('form').attr('method','get'); that.parents('form').submit(); }); /* 列表按钮组 */ $('.j-page-btns').click(function(){ var that = $(this), code = function(that) { var href = that.attr('href') ? that.attr('href') : that.attr('data-href'), _checkbox = !that.attr('data-checkbox') ? 'yes' : that.attr('data-checkbox'), _ajax = !that.attr('data-ajax') ? 'yes' : that.attr('data-ajax'), _ids = ''; if (!href) { layer.msg('请设置data-href参数'); return false; } if(_checkbox=='yes') { if ($('.checkbox-ids:checked').length <= 0) { layer.msg('请选择要操作的数据'); return false; } var ids = []; $('.checkbox-ids:checked').each(function(index, item) { if(item.checked){ ids.push(item.value); } }); _ids = ids.join(','); } if(_ajax=='yes') { if (that.parents('form')[0]) { var query = that.parents('form').serialize(); } else { var query = $('#pageListForm').serialize(); } layer.msg('数据提交中...', {time: 500000}); $.post(href, query, function (res) { layer.msg(res.msg, {}, function () { if (res.code != 0) { location.reload(); } }); }); } else{ location.href= href.indexOf('?') ==-1 ? href+'?ids='+ _ids : href+'&ids='+_ids; } }; if (that.hasClass('confirm')) { var tips = that.attr('tips') ? that.attr('tips') : '您确定要执行此操作吗?'; layer.confirm(tips, {title:false, closeBtn:0}, function(index){ code(that); layer.close(index); }); } else { code(that); } return false; }); exports('global', {}); }); function onSelectResult(input,obj){ var ids = []; var s1 ='',s2=''; $(obj).each(function(index, item) { if(item.checked){ s1 = $("input[name='"+input+"']").val(); s2 = ','+s1+','; if(s2.indexOf(','+item.value+',') ==-1){ if(s1.length > 0 && s1.substring(s1.length-1)!=','){ s1 += ','; } s1 += item.value; $("input[name='"+input+"']").val( s1 ); } } }); alert('添加成功!'); } function rndNum(under, over){ switch(arguments.length){ case 1: return parseInt(Math.random()*under+1); case 2: return parseInt(Math.random()*(over-under+1) + under); default: return 0; } } function changeParam(url,name,value) { var newUrl=""; var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var tmp = name + "=" + value; if(url.match(reg) != null) { newUrl= url.replace(eval(reg),'&'+tmp + '&'); } else { if(url.match("[\?]")) { newUrl= url + "&" + tmp; } else{ newUrl= url + "?" + tmp; } } return newUrl; } function getDataTime(ts,ty) { if(ts<1){ return ''; } var t,y,m,d,h,i,s; t = ts ? new Date(ts*1000) : new Date(); y = t.getFullYear(); m = t.getMonth()+1; d = t.getDate(); h = t.getHours(); i = t.getMinutes(); s = t.getSeconds(); r = y+'-'+(m<10?'0'+m:m) + '-' + (d<10?'0'+d:d); if(ty==undefined || ty==''){ r += ' ' + (h<10?'0'+h:h) + ':' + (i<10?'0'+i:i) + ':' + (s<10?'0'+s:s) } return r; } function mac_url_img(url) { url = url.replace('mac:','http:'); if (url.indexOf("http") == -1 || url.indexOf("//") == -1){ url = ROOT_PATH+"/"+url; } else if(UPLOAD_IMG_KEY !='' && UPLOAD_IMG_API !=''){ var reg=eval("/" + UPLOAD_IMG_KEY + "/i"); if(reg.test(url)!=false){ url = UPLOAD_IMG_API + url; } } return url; } \ No newline at end of file diff --git a/static/js/jquery.autocomplete.js b/static/js/jquery.autocomplete.js index ece8c40f5..7189900c5 100644 --- a/static/js/jquery.autocomplete.js +++ b/static/js/jquery.autocomplete.js @@ -9,652 +9,4 @@ * * Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $ */; -$.browser = navigator.userAgent; -(function($) { - $.fn.extend({ - autocomplete: function(urlOrData, options) { - var isUrl = typeof urlOrData == "string"; - options = $.extend({}, $.Autocompleter.defaults, { - url: isUrl ? urlOrData : null, - data: isUrl ? null : urlOrData, - delay: isUrl ? $.Autocompleter.defaults.delay : 10, - max: options && !options.scroll ? 10 : 150 - }, options); - options.highlight = options.highlight || - function(value) { - return value; - }; - options.formatMatch = options.formatMatch || options.formatItem; - return this.each(function() { - new $.Autocompleter(this, options); - }); - }, - result: function(handler) { - return this.bind("result", handler); - }, - search: function(handler) { - return this.trigger("search", [handler]); - }, - flushCache: function() { - return this.trigger("flushCache"); - }, - setOptions: function(options) { - return this.trigger("setOptions", [options]); - }, - unautocomplete: function() { - return this.trigger("unautocomplete"); - } - }); - $.Autocompleter = function(input, options) { - var KEY = { - UP: 38, - DOWN: 40, - DEL: 46, - TAB: 9, - RETURN: 13, - ESC: 27, - COMMA: 188, - PAGEUP: 33, - PAGEDOWN: 34, - BACKSPACE: 8 - }; - var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass); - var timeout; - var previousValue = ""; - var cache = $.Autocompleter.Cache(options); - var hasFocus = 0; - var lastKeyPressCode; - var config = { - mouseDownOnSelect: false - }; - var select = $.Autocompleter.Select(options, input, selectCurrent, config); - var blockSubmit; - $.browser.opera && $(input.form).bind("submit.autocomplete", function() { - if (blockSubmit) { - blockSubmit = false; - return false; - } - }); - $input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) { - hasFocus = 1; - lastKeyPressCode = event.keyCode; - switch (event.keyCode) { - case KEY.UP: - event.preventDefault(); - if (select.visible()) { - select.prev(); - } else { - onChange(0, true); - } - break; - case KEY.DOWN: - event.preventDefault(); - if (select.visible()) { - select.next(); - } else { - onChange(0, true); - } - break; - case KEY.PAGEUP: - event.preventDefault(); - if (select.visible()) { - select.pageUp(); - } else { - onChange(0, true); - } - break; - case KEY.PAGEDOWN: - event.preventDefault(); - if (select.visible()) { - select.pageDown(); - } else { - onChange(0, true); - } - break; - case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA: - case KEY.TAB: - case KEY.RETURN: - if (selectCurrent()) { - event.preventDefault(); - blockSubmit = true; - return false; - } - break; - case KEY.ESC: - select.hide(); - break; - default: - clearTimeout(timeout); - timeout = setTimeout(onChange, options.delay); - break; - } - }).focus(function() { - hasFocus++; - }).blur(function() { - hasFocus = 0; - if (!config.mouseDownOnSelect) { - hideResults(); - } - }).click(function() { - if (hasFocus++ > 1 && !select.visible()) { - onChange(0, true); - } - }).bind("search", function() { - var fn = (arguments.length > 1) ? arguments[1] : null; - - function findValueCallback(q, data) { - var result; - if (data && data.length) { - for (var i = 0; i < data.length; i++) { - if (data[i].result.toLowerCase() == q.toLowerCase()) { - result = data[i]; - break; - } - } - } - if (typeof fn == "function") fn(result); - else $input.trigger("result", result && [result.data, result.value]); - } - $.each(trimWords($input.val()), function(i, value) { - request(value, findValueCallback, findValueCallback); - }); - }).bind("flushCache", function() { - cache.flush(); - }).bind("setOptions", function() { - $.extend(options, arguments[1]); - if ("data" in arguments[1]) cache.populate(); - }).bind("unautocomplete", function() { - select.unbind(); - $input.unbind(); - $(input.form).unbind(".autocomplete"); - }); - - function selectCurrent() { - var selected = select.selected(); - if (!selected) return false; - var v = selected.result; - previousValue = v; - if (options.multiple) { - var words = trimWords($input.val()); - if (words.length > 1) { - var seperator = options.multipleSeparator.length; - var cursorAt = $(input).selection().start; - var wordAt, progress = 0; - $.each(words, function(i, word) { - progress += word.length; - if (cursorAt <= progress) { - wordAt = i; - return false; - } - progress += seperator; - }); - words[wordAt] = v; - v = words.join(options.multipleSeparator); - } - v += options.multipleSeparator; - } - $input.val(v); - hideResultsNow(); - $input.trigger("result", [selected.data, selected.value]); - return true; - } - function onChange(crap, skipPrevCheck) { - if (lastKeyPressCode == KEY.DEL) { - select.hide(); - return; - } - var currentValue = $input.val(); - if (!skipPrevCheck && currentValue == previousValue) return; - previousValue = currentValue; - currentValue = lastWord(currentValue); - if (currentValue.length >= options.minChars) { - $input.addClass(options.loadingClass); - if (!options.matchCase) currentValue = currentValue.toLowerCase(); - request(currentValue, receiveData, hideResultsNow); - } else { - stopLoading(); - select.hide(); - } - }; - - function trimWords(value) { - if (!value) return [""]; - if (!options.multiple) return [$.trim(value)]; - return $.map(value.split(options.multipleSeparator), function(word) { - return $.trim(value).length ? $.trim(word) : null; - }); - } - function lastWord(value) { - if (!options.multiple) return value; - var words = trimWords(value); - if (words.length == 1) return words[0]; - var cursorAt = $(input).selection().start; - if (cursorAt == value.length) { - words = trimWords(value) - } else { - words = trimWords(value.replace(value.substring(cursorAt), "")); - } - return words[words.length - 1]; - } - function autoFill(q, sValue) { - if (options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE) { - $input.val($input.val() + sValue.substring(lastWord(previousValue).length)); - $(input).selection(previousValue.length, previousValue.length + sValue.length); - } - }; - - function hideResults() { - clearTimeout(timeout); - timeout = setTimeout(hideResultsNow, 200); - }; - - function hideResultsNow() { - var wasVisible = select.visible(); - select.hide(); - clearTimeout(timeout); - stopLoading(); - if (options.mustMatch) { - $input.search(function(result) { - if (!result) { - if (options.multiple) { - var words = trimWords($input.val()).slice(0, -1); - $input.val(words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "")); - } else { - $input.val(""); - $input.trigger("result", null); - } - } - }); - } - }; - - function receiveData(q, data) { - if (data && data.length && hasFocus) { - stopLoading(); - select.display(data, q); - autoFill(q, data[0].value); - select.show(); - } else { - hideResultsNow(); - } - }; - - function request(term, success, failure) { - if (!options.matchCase) term = term.toLowerCase(); - var data = cache.load(term); - if (data && data.length) { - success(term, data); - } else if ((typeof options.url == "string") && (options.url.length > 0)) { - var extraParams = { - timestamp: +new Date() - }; - $.each(options.extraParams, function(key, param) { - extraParams[key] = typeof param == "function" ? param() : param; - }); - $.ajax({ - mode: "abort", - port: "autocomplete" + input.name, - dataType: options.dataType, - url: options.url, - data: $.extend({ - wd: lastWord(term), - limit: options.max - }, extraParams), - success: function(data) { - var parsed = options.parse && options.parse(data) || parse(data); - cache.add(term, parsed); - success(term, parsed); - } - }); - } else { - select.emptyList(); - failure(term); - } - }; - - function parse(data) { - var parsed = []; - var rows = data.split("\n"); - for (var i = 0; i < rows.length; i++) { - var row = $.trim(rows[i]); - if (row) { - row = row.split("|"); - parsed[parsed.length] = { - data: row, - value: row[0], - result: options.formatResult && options.formatResult(row, row[0]) || row[0] - }; - } - } - return parsed; - }; - - function stopLoading() { - $input.removeClass(options.loadingClass); - }; - }; - $.Autocompleter.defaults = { - inputClass: "ac_input", - resultsClass: "ac_results", - loadingClass: "ac_loading", - minChars: 1, - delay: 400, - matchCase: false, - matchSubset: false, - matchContains: false, - cacheLength: 10, - max: 100, - mustMatch: false, - extraParams: {}, - selectFirst: true, - formatItem: function(row) { - return row[0]; - }, - formatMatch: null, - autoFill: false, - width: 0, - multiple: false, - multipleSeparator: ", ", - highlight: function(value, term) { - return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1"); - }, - scroll: true, - scrollHeight: 180 - }; - $.Autocompleter.Cache = function(options) { - var data = {}; - var length = 0; - - function matchSubset(s, sub) { - if (!options.matchCase) s = s.toLowerCase(); - var i = s.indexOf(sub); - if (options.matchContains == "word") { - i = s.toLowerCase().search("\\b" + sub.toLowerCase()); - } - if (i == -1) return false; - return i == 0 || options.matchContains; - }; - - function add(q, value) { - if (length > options.cacheLength) { - flush(); - } - if (!data[q]) { - length++; - } - data[q] = value; - } - function populate() { - if (!options.data) return false; - var stMatchSets = {}, - nullData = 0; - if (!options.url) options.cacheLength = 1; - stMatchSets[""] = []; - for (var i = 0, ol = options.data.length; i < ol; i++) { - var rawValue = options.data[i]; - rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue; - var value = options.formatMatch(rawValue, i + 1, options.data.length); - if (value === false) continue; - var firstChar = value.charAt(0).toLowerCase(); - if (!stMatchSets[firstChar]) stMatchSets[firstChar] = []; - var row = { - value: value, - data: rawValue, - result: options.formatResult && options.formatResult(rawValue) || value - }; - stMatchSets[firstChar].push(row); - if (nullData++ < options.max) { - stMatchSets[""].push(row); - } - }; - $.each(stMatchSets, function(i, value) { - options.cacheLength++; - add(i, value); - }); - } - setTimeout(populate, 25); - - function flush() { - data = {}; - length = 0; - } - return { - flush: flush, - add: add, - populate: populate, - load: function(q) { - if (!options.cacheLength || !length) return null; - if (!options.url && options.matchContains) { - var csub = []; - for (var k in data) { - if (k.length > 0) { - var c = data[k]; - $.each(c, function(i, x) { - if (matchSubset(x.value, q)) { - csub.push(x); - } - }); - } - } - return csub; - } else if (data[q]) { - return data[q]; - } else if (options.matchSubset) { - for (var i = q.length - 1; i >= options.minChars; i--) { - var c = data[q.substr(0, i)]; - if (c) { - var csub = []; - $.each(c, function(i, x) { - if (matchSubset(x.value, q)) { - csub[csub.length] = x; - } - }); - return csub; - } - } - } - return null; - } - }; - }; - $.Autocompleter.Select = function(options, input, select, config) { - var CLASSES = { - ACTIVE: "ac_over" - }; - var listItems, active = -1, - data, term = "", - needsInit = true, - element, list; - - function init() { - if (!needsInit) return; - element = $("
                                    ").hide().addClass(options.resultsClass).css("position", "absolute").appendTo(document.body); - list = $("
                                      ").appendTo(element).mouseover(function(event) { - if (target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') { - active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event)); - $(target(event)).addClass(CLASSES.ACTIVE); - } - }).click(function(event) { - $(target(event)).addClass(CLASSES.ACTIVE); - select(); - input.focus(); - return false; - }).mousedown(function() { - config.mouseDownOnSelect = true; - }).mouseup(function() { - config.mouseDownOnSelect = false; - }); - if (options.width > 0) element.css("width", options.width); - needsInit = false; - } - function target(event) { - var element = event.target; - while (element && element.tagName != "LI") element = element.parentNode; - if (!element) return []; - return element; - } - function moveSelect(step) { - listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE); - movePosition(step); - var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE); - if (options.scroll) { - var offset = 0; - listItems.slice(0, active).each(function() { - offset += this.offsetHeight; - }); - if ((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) { - list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight()); - } else if (offset < list.scrollTop()) { - list.scrollTop(offset); - } - } - }; - - function movePosition(step) { - active += step; - if (active < 0) { - active = listItems.size() - 1; - } else if (active >= listItems.size()) { - active = 0; - } - } - function limitNumberOfItems(available) { - return options.max && options.max < available ? options.max : available; - } - function fillList() { - list.empty(); - var max = limitNumberOfItems(data.length); - for (var i = 0; i < max; i++) { - if (!data[i]) continue; - var formatted = options.formatItem(data[i].data, i + 1, max, data[i].value, term); - if (formatted === false) continue; - var li = $("
                                    • ").html(options.highlight(formatted, term)).addClass(i % 2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0]; - $.data(li, "ac_data", data[i]); - } - listItems = list.find("li"); - if (options.selectFirst) { - listItems.slice(0, 1).addClass(CLASSES.ACTIVE); - active = 0; - } - if ($.fn.bgiframe) list.bgiframe(); - } - return { - display: function(d, q) { - init(); - data = d; - term = q; - fillList(); - }, - next: function() { - moveSelect(1); - }, - prev: function() { - moveSelect(-1); - }, - pageUp: function() { - if (active != 0 && active - 8 < 0) { - moveSelect(-active); - } else { - moveSelect(-8); - } - }, - pageDown: function() { - if (active != listItems.size() - 1 && active + 8 > listItems.size()) { - moveSelect(listItems.size() - 1 - active); - } else { - moveSelect(8); - } - }, - hide: function() { - element && element.hide(); - listItems && listItems.removeClass(CLASSES.ACTIVE); - active = -1; - }, - visible: function() { - return element && element.is(":visible"); - }, - current: function() { - return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]); - }, - show: function() { - var offset = $(input).offset(); - element.css({ - width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(), - top: offset.top + input.offsetHeight, - left: offset.left - }).show(); - if (options.scroll) { - list.scrollTop(0); - list.css({ - maxHeight: options.scrollHeight, - overflow: 'auto' - }); - if ($.browser.msie && typeof document.body.style.maxHeight === "undefined") { - var listHeight = 0; - listItems.each(function() { - listHeight += this.offsetHeight; - }); - var scrollbarsVisible = listHeight > options.scrollHeight; - list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight); - if (!scrollbarsVisible) { - listItems.width(list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right"))); - } - } - } - }, - selected: function() { - var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE); - return selected && selected.length && $.data(selected[0], "ac_data"); - }, - emptyList: function() { - list && list.empty(); - }, - unbind: function() { - element && element.remove(); - } - }; - }; - $.fn.selection = function(start, end) { - if (start !== undefined) { - return this.each(function() { - if (this.createTextRange) { - var selRange = this.createTextRange(); - if (end === undefined || start == end) { - selRange.move("character", start); - selRange.select(); - } else { - selRange.collapse(true); - selRange.moveStart("character", start); - selRange.moveEnd("character", end); - selRange.select(); - } - } else if (this.setSelectionRange) { - this.setSelectionRange(start, end); - } else if (this.selectionStart) { - this.selectionStart = start; - this.selectionEnd = end; - } - }); - } - var field = this[0]; - if (field.createTextRange) { - var range = document.selection.createRange(), - orig = field.value, - teststring = "<->", - textLength = range.text.length; - range.text = teststring; - var caretAt = field.value.indexOf(teststring); - field.value = orig; - this.selection(caretAt, caretAt + textLength); - return { - start: caretAt, - end: caretAt + textLength - } - } else if (field.selectionStart !== undefined) { - return { - start: field.selectionStart, - end: field.selectionEnd - } - } - }; -})(jQuery); \ No newline at end of file +$.browser = navigator.userAgent; (function($) { $.fn.extend({ autocomplete: function(urlOrData, options) { var isUrl = typeof urlOrData == "string"; options = $.extend({}, $.Autocompleter.defaults, { url: isUrl ? urlOrData : null, data: isUrl ? null : urlOrData, delay: isUrl ? $.Autocompleter.defaults.delay : 10, max: options && !options.scroll ? 10 : 150 }, options); options.highlight = options.highlight || function(value) { return value; }; options.formatMatch = options.formatMatch || options.formatItem; return this.each(function() { new $.Autocompleter(this, options); }); }, result: function(handler) { return this.bind("result", handler); }, search: function(handler) { return this.trigger("search", [handler]); }, flushCache: function() { return this.trigger("flushCache"); }, setOptions: function(options) { return this.trigger("setOptions", [options]); }, unautocomplete: function() { return this.trigger("unautocomplete"); } }); $.Autocompleter = function(input, options) { var KEY = { UP: 38, DOWN: 40, DEL: 46, TAB: 9, RETURN: 13, ESC: 27, COMMA: 188, PAGEUP: 33, PAGEDOWN: 34, BACKSPACE: 8 }; var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass); var timeout; var previousValue = ""; var cache = $.Autocompleter.Cache(options); var hasFocus = 0; var lastKeyPressCode; var config = { mouseDownOnSelect: false }; var select = $.Autocompleter.Select(options, input, selectCurrent, config); var blockSubmit; $.browser.opera && $(input.form).bind("submit.autocomplete", function() { if (blockSubmit) { blockSubmit = false; return false; } }); $input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) { hasFocus = 1; lastKeyPressCode = event.keyCode; switch (event.keyCode) { case KEY.UP: event.preventDefault(); if (select.visible()) { select.prev(); } else { onChange(0, true); } break; case KEY.DOWN: event.preventDefault(); if (select.visible()) { select.next(); } else { onChange(0, true); } break; case KEY.PAGEUP: event.preventDefault(); if (select.visible()) { select.pageUp(); } else { onChange(0, true); } break; case KEY.PAGEDOWN: event.preventDefault(); if (select.visible()) { select.pageDown(); } else { onChange(0, true); } break; case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA: case KEY.TAB: case KEY.RETURN: if (selectCurrent()) { event.preventDefault(); blockSubmit = true; return false; } break; case KEY.ESC: select.hide(); break; default: clearTimeout(timeout); timeout = setTimeout(onChange, options.delay); break; } }).focus(function() { hasFocus++; }).blur(function() { hasFocus = 0; if (!config.mouseDownOnSelect) { hideResults(); } }).click(function() { if (hasFocus++ > 1 && !select.visible()) { onChange(0, true); } }).bind("search", function() { var fn = (arguments.length > 1) ? arguments[1] : null; function findValueCallback(q, data) { var result; if (data && data.length) { for (var i = 0; i < data.length; i++) { if (data[i].result.toLowerCase() == q.toLowerCase()) { result = data[i]; break; } } } if (typeof fn == "function") fn(result); else $input.trigger("result", result && [result.data, result.value]); } $.each(trimWords($input.val()), function(i, value) { request(value, findValueCallback, findValueCallback); }); }).bind("flushCache", function() { cache.flush(); }).bind("setOptions", function() { $.extend(options, arguments[1]); if ("data" in arguments[1]) cache.populate(); }).bind("unautocomplete", function() { select.unbind(); $input.unbind(); $(input.form).unbind(".autocomplete"); }); function selectCurrent() { var selected = select.selected(); if (!selected) return false; var v = selected.result; previousValue = v; if (options.multiple) { var words = trimWords($input.val()); if (words.length > 1) { var seperator = options.multipleSeparator.length; var cursorAt = $(input).selection().start; var wordAt, progress = 0; $.each(words, function(i, word) { progress += word.length; if (cursorAt <= progress) { wordAt = i; return false; } progress += seperator; }); words[wordAt] = v; v = words.join(options.multipleSeparator); } v += options.multipleSeparator; } $input.val(v); hideResultsNow(); $input.trigger("result", [selected.data, selected.value]); return true; } function onChange(crap, skipPrevCheck) { if (lastKeyPressCode == KEY.DEL) { select.hide(); return; } var currentValue = $input.val(); if (!skipPrevCheck && currentValue == previousValue) return; previousValue = currentValue; currentValue = lastWord(currentValue); if (currentValue.length >= options.minChars) { $input.addClass(options.loadingClass); if (!options.matchCase) currentValue = currentValue.toLowerCase(); request(currentValue, receiveData, hideResultsNow); } else { stopLoading(); select.hide(); } }; function trimWords(value) { if (!value) return [""]; if (!options.multiple) return [$.trim(value)]; return $.map(value.split(options.multipleSeparator), function(word) { return $.trim(value).length ? $.trim(word) : null; }); } function lastWord(value) { if (!options.multiple) return value; var words = trimWords(value); if (words.length == 1) return words[0]; var cursorAt = $(input).selection().start; if (cursorAt == value.length) { words = trimWords(value) } else { words = trimWords(value.replace(value.substring(cursorAt), "")); } return words[words.length - 1]; } function autoFill(q, sValue) { if (options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE) { $input.val($input.val() + sValue.substring(lastWord(previousValue).length)); $(input).selection(previousValue.length, previousValue.length + sValue.length); } }; function hideResults() { clearTimeout(timeout); timeout = setTimeout(hideResultsNow, 200); }; function hideResultsNow() { var wasVisible = select.visible(); select.hide(); clearTimeout(timeout); stopLoading(); if (options.mustMatch) { $input.search(function(result) { if (!result) { if (options.multiple) { var words = trimWords($input.val()).slice(0, -1); $input.val(words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "")); } else { $input.val(""); $input.trigger("result", null); } } }); } }; function receiveData(q, data) { if (data && data.length && hasFocus) { stopLoading(); select.display(data, q); autoFill(q, data[0].value); select.show(); } else { hideResultsNow(); } }; function request(term, success, failure) { if (!options.matchCase) term = term.toLowerCase(); var data = cache.load(term); if (data && data.length) { success(term, data); } else if ((typeof options.url == "string") && (options.url.length > 0)) { var extraParams = { timestamp: +new Date() }; $.each(options.extraParams, function(key, param) { extraParams[key] = typeof param == "function" ? param() : param; }); $.ajax({ mode: "abort", port: "autocomplete" + input.name, dataType: options.dataType, url: options.url, data: $.extend({ wd: lastWord(term), limit: options.max }, extraParams), success: function(data) { var parsed = options.parse && options.parse(data) || parse(data); cache.add(term, parsed); success(term, parsed); } }); } else { select.emptyList(); failure(term); } }; function parse(data) { var parsed = []; var rows = data.split("\n"); for (var i = 0; i < rows.length; i++) { var row = $.trim(rows[i]); if (row) { row = row.split("|"); parsed[parsed.length] = { data: row, value: row[0], result: options.formatResult && options.formatResult(row, row[0]) || row[0] }; } } return parsed; }; function stopLoading() { $input.removeClass(options.loadingClass); }; }; $.Autocompleter.defaults = { inputClass: "ac_input", resultsClass: "ac_results", loadingClass: "ac_loading", minChars: 1, delay: 400, matchCase: false, matchSubset: false, matchContains: false, cacheLength: 10, max: 100, mustMatch: false, extraParams: {}, selectFirst: true, formatItem: function(row) { return row[0]; }, formatMatch: null, autoFill: false, width: 0, multiple: false, multipleSeparator: ", ", highlight: function(value, term) { return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1"); }, scroll: true, scrollHeight: 180 }; $.Autocompleter.Cache = function(options) { var data = {}; var length = 0; function matchSubset(s, sub) { if (!options.matchCase) s = s.toLowerCase(); var i = s.indexOf(sub); if (options.matchContains == "word") { i = s.toLowerCase().search("\\b" + sub.toLowerCase()); } if (i == -1) return false; return i == 0 || options.matchContains; }; function add(q, value) { if (length > options.cacheLength) { flush(); } if (!data[q]) { length++; } data[q] = value; } function populate() { if (!options.data) return false; var stMatchSets = {}, nullData = 0; if (!options.url) options.cacheLength = 1; stMatchSets[""] = []; for (var i = 0, ol = options.data.length; i < ol; i++) { var rawValue = options.data[i]; rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue; var value = options.formatMatch(rawValue, i + 1, options.data.length); if (value === false) continue; var firstChar = value.charAt(0).toLowerCase(); if (!stMatchSets[firstChar]) stMatchSets[firstChar] = []; var row = { value: value, data: rawValue, result: options.formatResult && options.formatResult(rawValue) || value }; stMatchSets[firstChar].push(row); if (nullData++ < options.max) { stMatchSets[""].push(row); } }; $.each(stMatchSets, function(i, value) { options.cacheLength++; add(i, value); }); } setTimeout(populate, 25); function flush() { data = {}; length = 0; } return { flush: flush, add: add, populate: populate, load: function(q) { if (!options.cacheLength || !length) return null; if (!options.url && options.matchContains) { var csub = []; for (var k in data) { if (k.length > 0) { var c = data[k]; $.each(c, function(i, x) { if (matchSubset(x.value, q)) { csub.push(x); } }); } } return csub; } else if (data[q]) { return data[q]; } else if (options.matchSubset) { for (var i = q.length - 1; i >= options.minChars; i--) { var c = data[q.substr(0, i)]; if (c) { var csub = []; $.each(c, function(i, x) { if (matchSubset(x.value, q)) { csub[csub.length] = x; } }); return csub; } } } return null; } }; }; $.Autocompleter.Select = function(options, input, select, config) { var CLASSES = { ACTIVE: "ac_over" }; var listItems, active = -1, data, term = "", needsInit = true, element, list; function init() { if (!needsInit) return; element = $("
                                      ").hide().addClass(options.resultsClass).css("position", "absolute").appendTo(document.body); list = $("
                                        ").appendTo(element).mouseover(function(event) { if (target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') { active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event)); $(target(event)).addClass(CLASSES.ACTIVE); } }).click(function(event) { $(target(event)).addClass(CLASSES.ACTIVE); select(); input.focus(); return false; }).mousedown(function() { config.mouseDownOnSelect = true; }).mouseup(function() { config.mouseDownOnSelect = false; }); if (options.width > 0) element.css("width", options.width); needsInit = false; } function target(event) { var element = event.target; while (element && element.tagName != "LI") element = element.parentNode; if (!element) return []; return element; } function moveSelect(step) { listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE); movePosition(step); var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE); if (options.scroll) { var offset = 0; listItems.slice(0, active).each(function() { offset += this.offsetHeight; }); if ((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) { list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight()); } else if (offset < list.scrollTop()) { list.scrollTop(offset); } } }; function movePosition(step) { active += step; if (active < 0) { active = listItems.size() - 1; } else if (active >= listItems.size()) { active = 0; } } function limitNumberOfItems(available) { return options.max && options.max < available ? options.max : available; } function fillList() { list.empty(); var max = limitNumberOfItems(data.length); for (var i = 0; i < max; i++) { if (!data[i]) continue; var formatted = options.formatItem(data[i].data, i + 1, max, data[i].value, term); if (formatted === false) continue; var li = $("
                                      • ").html(options.highlight(formatted, term)).addClass(i % 2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0]; $.data(li, "ac_data", data[i]); } listItems = list.find("li"); if (options.selectFirst) { listItems.slice(0, 1).addClass(CLASSES.ACTIVE); active = 0; } if ($.fn.bgiframe) list.bgiframe(); } return { display: function(d, q) { init(); data = d; term = q; fillList(); }, next: function() { moveSelect(1); }, prev: function() { moveSelect(-1); }, pageUp: function() { if (active != 0 && active - 8 < 0) { moveSelect(-active); } else { moveSelect(-8); } }, pageDown: function() { if (active != listItems.size() - 1 && active + 8 > listItems.size()) { moveSelect(listItems.size() - 1 - active); } else { moveSelect(8); } }, hide: function() { element && element.hide(); listItems && listItems.removeClass(CLASSES.ACTIVE); active = -1; }, visible: function() { return element && element.is(":visible"); }, current: function() { return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]); }, show: function() { var offset = $(input).offset(); element.css({ width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(), top: offset.top + input.offsetHeight, left: offset.left }).show(); if (options.scroll) { list.scrollTop(0); list.css({ maxHeight: options.scrollHeight, overflow: 'auto' }); if ($.browser.msie && typeof document.body.style.maxHeight === "undefined") { var listHeight = 0; listItems.each(function() { listHeight += this.offsetHeight; }); var scrollbarsVisible = listHeight > options.scrollHeight; list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight); if (!scrollbarsVisible) { listItems.width(list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right"))); } } } }, selected: function() { var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE); return selected && selected.length && $.data(selected[0], "ac_data"); }, emptyList: function() { list && list.empty(); }, unbind: function() { element && element.remove(); } }; }; $.fn.selection = function(start, end) { if (start !== undefined) { return this.each(function() { if (this.createTextRange) { var selRange = this.createTextRange(); if (end === undefined || start == end) { selRange.move("character", start); selRange.select(); } else { selRange.collapse(true); selRange.moveStart("character", start); selRange.moveEnd("character", end); selRange.select(); } } else if (this.setSelectionRange) { this.setSelectionRange(start, end); } else if (this.selectionStart) { this.selectionStart = start; this.selectionEnd = end; } }); } var field = this[0]; if (field.createTextRange) { var range = document.selection.createRange(), orig = field.value, teststring = "<->", textLength = range.text.length; range.text = teststring; var caretAt = field.value.indexOf(teststring); field.value = orig; this.selection(caretAt, caretAt + textLength); return { start: caretAt, end: caretAt + textLength } } else if (field.selectionStart !== undefined) { return { start: field.selectionStart, end: field.selectionEnd } } }; })(jQuery); \ No newline at end of file diff --git a/static/js/jquery.cookie.js b/static/js/jquery.cookie.js index ec839ad40..eaeb196d3 100644 --- a/static/js/jquery.cookie.js +++ b/static/js/jquery.cookie.js @@ -1 +1 @@ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('o.5=B(9,b,2){6(h b!=\'E\'){2=2||{};6(b===n){b=\'\';2.3=-1}4 3=\'\';6(2.3&&(h 2.3==\'j\'||2.3.k)){4 7;6(h 2.3==\'j\'){7=w u();7.t(7.q()+(2.3*r*l*l*x))}m{7=2.3}3=\'; 3=\'+7.k()}4 8=2.8?\'; 8=\'+2.8:\'\';4 a=2.a?\'; a=\'+2.a:\'\';4 c=2.c?\'; c\':\'\';d.5=[9,\'=\',C(b),3,8,a,c].y(\'\')}m{4 e=n;6(d.5&&d.5!=\'\'){4 g=d.5.A(\';\');s(4 i=0;i35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(3($){4 s={1r:"<1q 2i=\'T-2\'>",1l:"1k",1j:"1k",1i:"1R",1f:"1M",V:"1K",W:"1J",1b:"1z U",19:"2x",17:D,16:"21",O:P,15:D,Q:P,7:"T-U-14"};$.13.2=3(f){4 g=u;6(!g.12){8 g}4 i=$.1N(s,f);6(g.12>1){g.10(3(){$(u).2(i)});8 g}6(g.E("2")){g.v("2.F");8 g}g.7(i.7);g.E("2",f);6(!i.R){1x 24 1S("1W 1d 1y 1A 1G. 1I 1L 1O: $(...).2({R: \'...\'})")}6(!i.Q){g.1P(i.1r)}4 j=$("<1q>").7("1e");4 k=$("<2b>").t({X:"Y",Z:i.1l}).7(i.1j);4 l=$("").t("X","11").7(i.1f).M(i.1i);4 m=$("").7(i.W).M(i.V).9("H",3(){k.H();8 D});4 n=$("").7(i.19).M(i.1b).9("H",3(){g.v("2.A");g.v("2.23");g.K();8 D});4 p="2e-"+2h.2j().2m(2n).2p(5,20).2t();4 q=$("<1w>").t({18:p,Z:p}).x();4 r=$("<1a>").7(i.16).t({1B:q.t("18"),1C:"1D/1a-E",1E:"1F",1d:i.R});r.C([m,k,l,n,q]);6(i.15){n.K()}6(i.17){l.x();k.9("1H",3(){6(!$(u).1c()){8}l.H()})}6(i.O){k.x()}L{m.x()}j.C(r);r.9("11",3(){4 c=$(u);q.J("I");4 d=g.t("G");6(1g i.1h==="1Q"){g.t("G",i.1h)}g.7("S");j.x();q.9("I",3(){4 a=$(u.1T.1U).1V();4 b;1X{b=1Y("("+a+")");}1Z(e){}6(b==22){y(g,d);g.v("2.1m",[\'返回数据格式不正确\']);8;}6(b.25==0){y(g,d);g.v("2.1m",[b.26]);8;}6(i.O){g.v("2.F")}6(!k.1c()){y(g,d);8}q.t("G","");y(g,b.Y,3(){g.v("2.27")});k.28(k.29(P))})});6(!i.Q){g.2a().C(j)}L{j.1n({2c:"2d"});j.7("T-U-14-1e");$("1o").C(j.x());g.9("2f",3(){6(g.2g("S")){8}4 a=g.1p();j.1n({B:a.B,z:a.z});j.2k()});$("1o").9("2l","."+i.7,3(e){4 o=g.1p();4 w=g.2o();4 h=g.2q();6(e.1so.z+w||(e.1to.B+h)){j.x()}})}g.9("2.A",3(){j.K();g.J("2.A");g.J("2.F");g.E("2",2r)});g.9("2.F",3(){g.v("2.A");g.2(f)});8 g};3 y(a,b,c){a.2s(3(){a.t("G",b);1u(a,3(){a.2u("S");a.2v();6(1g c==="3"){c()}})})}3 1u(a,b){$(a).10(3(){6(u.2w){b.1v(u)}L{$(u).9("I",3(){b.1v(u)})}})}$.2=$.13.2;$.2.2y=s})($);',62,159,'||imageUpload|function|var||if|addClass|return|on||||||||||||||||||||attr|this|trigger||hide|loadImage|left|destroy|top|append|false|data|reload|src|click|load|off|remove|else|html|button|hideFileInput|true|hover|formAction|loading|jQuery|image|browseButtonValue|browseButtonClass|type|file|name|each|submit|length|fn|upload|hideDeleteButton|formClass|automaticUpload|id|deleteButtonClass|form|deleteButtonValue|val|action|controls|uploadButtonClass|typeof|waiter|uploadButtonValue|inputFileClass|inputFile|inputFileName|uploadFailed|css|body|offset|div|wrapContent|pageX|pageY|imgLoad|apply|iframe|throw|was|Delete|not|target|enctype|multipart|method|post|provided|change|Please|browseButton|Browse|provide|uploadButton|extend|it|wrap|string|Upload|Error|contentWindow|document|text|Form|try|eval|catch||controlForm|undefined|imageRemoved|new|code|msg|imageChanged|replaceWith|clone|parent|input|position|absolute|uploadIframe|mouseenter|hasClass|Math|class|random|show|mouseleave|toString|36|width|substring|height|null|fadeOut|toLowerCase|removeClass|fadeIn|complete|deleteButton|defaults'.split('|'),0,{})); \ No newline at end of file +(function($){var s={wrapContent:"
                                        ",inputFileName:"inputFile",inputFileClass:"inputFile",uploadButtonValue:"Upload",uploadButtonClass:"uploadButton",browseButtonValue:"Browse",browseButtonClass:"browseButton",deleteButtonValue:"Delete image",deleteButtonClass:"deleteButton",automaticUpload:false,formClass:"controlForm",hideFileInput:true,hideDeleteButton:false,hover:true,addClass:"jQuery-image-upload"};$.fn.imageUpload=function(f){var g=this;if(!g.length){return g}var i=$.extend(s,f);if(g.length>1){g.each(function(){$(this).imageUpload(i)});return g}if(g.data("imageUpload")){g.trigger("imageUpload.reload");return g}g.addClass(i.addClass);g.data("imageUpload",f);if(!i.formAction){throw new Error("Form action was not provided. Please provide it: $(...).imageUpload({formAction: '...'})")}if(!i.hover){g.wrap(i.wrapContent)}var j=$("
                                        ").addClass("controls");var k=$("").attr({type:"file",name:i.inputFileName}).addClass(i.inputFileClass);var l=$("
                                        ","
                                        "].join(""));return l.ie&&l.ie<8?c.removeClass("layui-hide").addClass(o):(d[0]&&d.remove(),s.call(a,m,c[0],y),c.addClass("layui-hide").after(m),a.index)},c.prototype.getContent=function(t){var e=u(t);if(e[0])return d(e[0].document.body.innerHTML)},c.prototype.getText=function(t){var i=u(t);if(i[0])return e(i[0].document.body).text()},c.prototype.setContent=function(t,i,a){var l=u(t);l[0]&&(a?e(l[0].document.body).append(i):e(l[0].document.body).html(i),layedit.sync(t))},c.prototype.sync=function(t){var i=u(t);if(i[0]){var a=e("#"+i[1].attr("textarea"));a.val(d(i[0].document.body.innerHTML))}},c.prototype.getSelection=function(t){var e=u(t);if(e[0]){var i=m(e[0].document);return document.selection?i.text:i.toString()}};var s=function(t,i,a){var l=this,n=t.find("iframe");n.css({height:a.height}).on("load",function(){var o=n.contents(),r=n.prop("contentWindow"),c=o.find("head"),s=e([""].join("")),u=o.find("body");c.append(s),u.attr("contenteditable","true").css({"min-height":a.height}).html(i.value||""),y.apply(l,[r,n,i,a]),g.call(l,r,t,a)})},u=function(t){var i=e("#LAY_layedit_"+t),a=i.prop("contentWindow");return[a,i]},d=function(t){return 8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),t},y=function(t,a,n,o){var r=t.document,c=e(r.body);c.on("keydown",function(t){var e=t.keyCode;if(13===e){var a=m(r),l=p(a),n=l.parentNode;if("pre"===n.tagName.toLowerCase()){if(t.shiftKey)return;return i.msg("请暂时用shift+enter"),!1}r.execCommand("formatBlock",!1,"

                                        ")}}),e(n).parents("form").on("submit",function(){var t=c.html();8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),n.value=t}),c.on("paste",function(e){r.execCommand("formatBlock",!1,"

                                        "),setTimeout(function(){f.call(t,c),n.value=c.html()},100)})},f=function(t){var i=this;i.document;t.find("*[style]").each(function(){var t=this.style.textAlign;this.removeAttribute("style"),e(this).css({"text-align":t||""})}),t.find("table").addClass("layui-table"),t.find("script,link").remove()},m=function(t){return t.selection?t.selection.createRange():t.getSelection().getRangeAt(0)},p=function(t){return t.endContainer||t.parentElement().childNodes[0]},v=function(t,i,a){var l=this.document,n=document.createElement(t);for(var o in i)n.setAttribute(o,i[o]);if(n.removeAttribute("text"),l.selection){var r=a.text||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.pasteHTML(e(n).prop("outerHTML")),a.select()}else{var r=a.toString()||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.deleteContents(),a.insertNode(n)}},h=function(t,i){var a=this.document,l="layedit-tool-active",n=p(m(a)),o=function(e){return t.find(".layedit-tool-"+e)};i&&i[i.hasClass(l)?"removeClass":"addClass"](l),t.find(">i").removeClass(l),o("unlink").addClass(r),e(n).parents().each(function(){var t=this.tagName.toLowerCase(),e=this.style.textAlign;"b"!==t&&"strong"!==t||o("b").addClass(l),"i"!==t&&"em"!==t||o("i").addClass(l),"u"===t&&o("u").addClass(l),"strike"===t&&o("d").addClass(l),"p"===t&&("center"===e?o("center").addClass(l):"right"===e?o("right").addClass(l):o("left").addClass(l)),"a"===t&&(o("link").addClass(l),o("unlink").removeClass(r))})},g=function(t,a,l){var n=t.document,o=e(n.body),c={link:function(i){var a=p(i),l=e(a).parent();b.call(o,{href:l.attr("href"),target:l.attr("target")},function(e){var a=l[0];"A"===a.tagName?a.href=e.url:v.call(t,"a",{target:e.target,href:e.url,text:e.url},i)})},unlink:function(t){n.execCommand("unlink")},face:function(e){x.call(this,function(i){v.call(t,"img",{src:i.src,alt:i.alt},e)})},image:function(a){var n=this;layui.use("upload",function(o){var r=l.uploadImage||{};o.render({url:r.url,method:r.type,elem:e(n).find("input")[0],done:function(e){0==e.code?(e.data=e.data||{},v.call(t,"img",{src:e.data.src,alt:e.data.title},a)):i.msg(e.msg||"上传失败")}})})},code:function(e){k.call(o,function(i){v.call(t,"pre",{text:i.code,"lay-lang":i.lang},e)})},help:function(){i.open({type:2,title:"帮助",area:["600px","380px"],shadeClose:!0,shade:.1,skin:"layui-layer-msg",content:["http://www.layui.com/about/layedit/help.html","no"]})}},s=a.find(".layui-layedit-tool"),u=function(){var i=e(this),a=i.attr("layedit-event"),l=i.attr("lay-command");if(!i.hasClass(r)){o.focus();var u=m(n);u.commonAncestorContainer;l?(n.execCommand(l),/justifyLeft|justifyCenter|justifyRight/.test(l)&&n.execCommand("formatBlock",!1,"

                                        "),setTimeout(function(){o.focus()},10)):c[a]&&c[a].call(this,u),h.call(t,s,i)}},d=/image/;s.find(">i").on("mousedown",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)||u.call(this)}).on("click",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)&&u.call(this)}),o.on("click",function(){h.call(t,s),i.close(x.index)})},b=function(t,e){var l=this,n=i.open({type:1,id:"LAY_layedit_link",area:"350px",shade:.05,shadeClose:!0,moveType:1,title:"超链接",skin:"layui-layer-msg",content:['

                                          ','
                                        • ','','
                                          ','',"
                                          ","
                                        • ",'
                                        • ','','
                                          ','",'","
                                          ","
                                        • ",'
                                        • ','','',"
                                        • ","
                                        "].join(""),success:function(t,n){var o="submit(layedit-link-yes)";a.render("radio"),t.find(".layui-btn-primary").on("click",function(){i.close(n),l.focus()}),a.on(o,function(t){i.close(b.index),e&&e(t.field)})}});b.index=n},x=function(t){var a=function(){var t=["[微笑]","[嘻嘻]","[哈哈]","[可爱]","[可怜]","[挖鼻]","[吃惊]","[害羞]","[挤眼]","[闭嘴]","[鄙视]","[爱你]","[泪]","[偷笑]","[亲亲]","[生病]","[太开心]","[白眼]","[右哼哼]","[左哼哼]","[嘘]","[衰]","[委屈]","[吐]","[哈欠]","[抱抱]","[怒]","[疑问]","[馋嘴]","[拜拜]","[思考]","[汗]","[困]","[睡]","[钱]","[失望]","[酷]","[色]","[哼]","[鼓掌]","[晕]","[悲伤]","[抓狂]","[黑线]","[阴险]","[怒骂]","[互粉]","[心]","[伤心]","[猪头]","[熊猫]","[兔子]","[ok]","[耶]","[good]","[NO]","[赞]","[来]","[弱]","[草泥马]","[神马]","[囧]","[浮云]","[给力]","[围观]","[威武]","[奥特曼]","[礼物]","[钟]","[话筒]","[蜡烛]","[蛋糕]"],e={};return layui.each(t,function(t,i){e[i]=layui.cache.dir+"images/face/"+t+".gif"}),e}();return x.hide=x.hide||function(t){"face"!==e(t.target).attr("layedit-event")&&i.close(x.index)},x.index=i.tips(function(){var t=[];return layui.each(a,function(e,i){t.push('
                                      • '+e+'
                                      • ')}),'
                                          '+t.join("")+"
                                        "}(),this,{tips:1,time:0,skin:"layui-box layui-util-face",maxWidth:500,success:function(l,n){l.css({marginTop:-4,marginLeft:-10}).find(".layui-clear>li").on("click",function(){t&&t({src:a[this.title],alt:this.title}),i.close(n)}),e(document).off("click",x.hide).on("click",x.hide)}})},k=function(t){var e=this,l=i.open({type:1,id:"LAY_layedit_code",area:"550px",shade:.05,shadeClose:!0,moveType:1,title:"插入代码",skin:"layui-layer-msg",content:['
                                          ','
                                        • ','','
                                          ','","
                                          ","
                                        • ",'
                                        • ','','
                                          ','',"
                                          ","
                                        • ",'
                                        • ','','',"
                                        • ","
                                        "].join(""),success:function(l,n){var o="submit(layedit-code-yes)";a.render("select"),l.find(".layui-btn-primary").on("click",function(){i.close(n),e.focus()}),a.on(o,function(e){i.close(k.index),t&&t(e.field)})}});k.index=l},C={html:'',strong:'',italic:'',underline:'',del:'',"|":'',left:'',center:'',right:'',link:'',unlink:'',face:'',image:'',code:'',help:''},w=new c;t(n,w)}); \ No newline at end of file diff --git a/static/layui/lay/modules/layer.js b/static/layui/lay/modules/layer.js deleted file mode 100644 index 0470aac6f..000000000 --- a/static/layui/lay/modules/layer.js +++ /dev/null @@ -1,2 +0,0 @@ -/** layui-v2.2.5 MIT License By https://www.layui.com */ - ;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'
                                        '+(f?r.title[0]:r.title)+"
                                        ":"";return r.zIndex=s,t([r.shade?'
                                        ':"",'
                                        '+(e&&2!=r.type?"":u)+'
                                        '+(0==r.type&&r.icon!==-1?'':"")+(1==r.type&&e?"":r.content||"")+'
                                        '+function(){var e=c?'':"";return r.closeBtn&&(e+=''),e}()+""+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t'+r.btn[t]+"";return'
                                        '+e+"
                                        "}():"")+(r.resize?'':"")+"
                                        "],u,i('
                                        ')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;af&&(a=f),ou&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return''}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(t){s=t.find(".layui-layer-input"),s.val(e.value||"").focus(),"function"==typeof f&&f(t)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:'
                                          '+function(){var e=t.length,i=1,a="";if(e>0)for(a='
                                        • '+(t[0].content||"no content")+"
                                        • ";i'+(t[i].content||"no content")+"";return a}()+"
                                        ",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]'+(u[d].alt||
                                        '+(u.length>1?'':"")+'
                                        '+(u[d].alt||"")+""+s.imgIndex+"/"+u.length+"
                                      ",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
                                      是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window); \ No newline at end of file diff --git a/static/layui/lay/modules/laypage.js b/static/layui/lay/modules/laypage.js deleted file mode 100644 index 54fe5d3ae..000000000 --- a/static/layui/lay/modules/laypage.js +++ /dev/null @@ -1,2 +0,0 @@ -/** layui-v2.2.5 MIT License By https://www.layui.com */ - ;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),skip:function(){return['到第','','页',""].join("")}()};return['
                                      ',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
                                      "].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)}); \ No newline at end of file diff --git a/static/layui/lay/modules/laytpl.js b/static/layui/lay/modules/laytpl.js deleted file mode 100644 index a6923a790..000000000 --- a/static/layui/lay/modules/laytpl.js +++ /dev/null @@ -1,2 +0,0 @@ -/** layui-v2.2.5 MIT License By https://www.layui.com */ - ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)}); \ No newline at end of file diff --git a/static/layui/lay/modules/mobile.js b/static/layui/lay/modules/mobile.js deleted file mode 100644 index 264d9d341..000000000 --- a/static/layui/lay/modules/mobile.js +++ /dev/null @@ -1,2 +0,0 @@ -/** layui-v2.2.5 MIT License By https://www.layui.com */ - ;layui.define(function(i){i("layui.mobile",layui.v)});layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)});layui.define(function(e){"use strict";var t=(window,document),i="querySelectorAll",n="getElementsByClassName",a=function(e){return t[i](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var i in e)t[i]=e[i];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var o=0,r=["layui-m-layer"],d=function(e){var t=this;t.config=l.extend(e),t.view()};d.prototype.view=function(){var e=this,i=e.config,s=t.createElement("div");e.id=s.id=r[0]+o,s.setAttribute("class",r[0]+" "+r[0]+(i.type||0)),s.setAttribute("index",o);var l=function(){var e="object"==typeof i.title;return i.title?'

                                      '+(e?i.title[0]:i.title)+"

                                      ":""}(),d=function(){"string"==typeof i.btn&&(i.btn=[i.btn]);var e,t=(i.btn||[]).length;return 0!==t&&i.btn?(e=''+i.btn[0]+"",2===t&&(e=''+i.btn[1]+""+e),'
                                      '+e+"
                                      "):""}();if(i.fixed||(i.top=i.hasOwnProperty("top")?i.top:100,i.style=i.style||"",i.style+=" top:"+(t.body.scrollTop+i.top)+"px"),2===i.type&&(i.content='

                                      '+(i.content||"")+"

                                      "),i.skin&&(i.anim="up"),"msg"===i.skin&&(i.shade=!1),s.innerHTML=(i.shade?"
                                      ':"")+'
                                      "+l+'
                                      '+i.content+"
                                      "+d+"
                                      ",!i.type||2===i.type){var y=t[n](r[0]+i.type),u=y.length;u>=1&&c.close(y[0].getAttribute("index"))}document.body.appendChild(s);var m=e.elem=a("#"+e.id)[0];i.success&&i.success(m),e.index=o++,e.action(i,m)},d.prototype.action=function(e,t){var i=this;e.time&&(l.timer[i.index]=setTimeout(function(){c.close(i.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),c.close(i.index)):e.yes?e.yes(i.index):c.close(i.index)};if(e.btn)for(var s=t[n]("layui-m-layerbtn")[0].children,o=s.length,r=0;r0&&e-1 in t)}function s(t){return A.call(t,function(t){return null!=t})}function u(t){return t.length>0?T.fn.concat.apply([],t):t}function c(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function l(t){return t in F?F[t]:F[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||k[c(t)]?e:e+"px"}function h(t){var e,n;return $[t]||(e=L.createElement(t),L.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),$[t]=n),$[t]}function p(t){return"children"in t?D.call(t.children):T.map(t.childNodes,function(t){if(1==t.nodeType)return t})}function d(t,e){var n,r=t?t.length:0;for(n=0;n]*>/,R=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Z=/^(?:body|html)$/i,q=/([A-Z])/g,H=["val","css","html","text","data","width","height","offset"],I=["after","prepend","before","append"],V=L.createElement("table"),_=L.createElement("tr"),B={tr:L.createElement("tbody"),tbody:V,thead:V,tfoot:V,td:_,th:_,"*":L.createElement("div")},U=/complete|loaded|interactive/,X=/^[\w-]*$/,J={},W=J.toString,Y={},G=L.createElement("div"),K={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Q=Array.isArray||function(t){return t instanceof Array};return Y.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var r,i=t.parentNode,o=!i;return o&&(i=G).appendChild(t),r=~Y.qsa(i,e).indexOf(t),o&&G.removeChild(t),r},C=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},N=function(t){return A.call(t,function(e,n){return t.indexOf(e)==n})},Y.fragment=function(t,e,n){var r,i,a;return R.test(t)&&(r=T(L.createElement(RegExp.$1))),r||(t.replace&&(t=t.replace(z,"<$1>")),e===E&&(e=M.test(t)&&RegExp.$1),e in B||(e="*"),a=B[e],a.innerHTML=""+t,r=T.each(D.call(a.childNodes),function(){a.removeChild(this)})),o(n)&&(i=T(r),T.each(n,function(t,e){H.indexOf(t)>-1?i[t](e):i.attr(t,e)})),r},Y.Z=function(t,e){return new d(t,e)},Y.isZ=function(t){return t instanceof Y.Z},Y.init=function(t,n){var r;if(!t)return Y.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&M.test(t))r=Y.fragment(t,RegExp.$1,n),t=null;else{if(n!==E)return T(n).find(t);r=Y.qsa(L,t)}else{if(e(t))return T(L).ready(t);if(Y.isZ(t))return t;if(Q(t))r=s(t);else if(i(t))r=[t],t=null;else if(M.test(t))r=Y.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==E)return T(n).find(t);r=Y.qsa(L,t)}}return Y.Z(r,t)},T=function(t,e){return Y.init(t,e)},T.extend=function(t){var e,n=D.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){m(t,n,e)}),t},Y.qsa=function(t,e){var n,r="#"==e[0],i=!r&&"."==e[0],o=r||i?e.slice(1):e,a=X.test(o);return t.getElementById&&a&&r?(n=t.getElementById(o))?[n]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:D.call(a&&!r&&t.getElementsByClassName?i?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},T.contains=L.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},T.type=t,T.isFunction=e,T.isWindow=n,T.isArray=Q,T.isPlainObject=o,T.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},T.isNumeric=function(t){var e=Number(t),n=typeof t;return null!=t&&"boolean"!=n&&("string"!=n||t.length)&&!isNaN(e)&&isFinite(e)||!1},T.inArray=function(t,e,n){return O.indexOf.call(e,t,n)},T.camelCase=C,T.trim=function(t){return null==t?"":String.prototype.trim.call(t)},T.uuid=0,T.support={},T.expr={},T.noop=function(){},T.map=function(t,e){var n,r,i,o=[];if(a(t))for(r=0;r=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return O.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return e(t)?this.not(this.not(t)):T(A.call(this,function(e){return Y.matches(e,t)}))},add:function(t,e){return T(N(this.concat(T(t,e))))},is:function(t){return this.length>0&&Y.matches(this[0],t)},not:function(t){var n=[];if(e(t)&&t.call!==E)this.each(function(e){t.call(this,e)||n.push(this)});else{var r="string"==typeof t?this.filter(t):a(t)&&e(t.item)?D.call(t):T(t);this.forEach(function(t){r.indexOf(t)<0&&n.push(t)})}return T(n)},has:function(t){return this.filter(function(){return i(t)?T.contains(this,t):T(this).find(t).size()})},eq:function(t){return t===-1?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!i(t)?t:T(t)},last:function(){var t=this[this.length-1];return t&&!i(t)?t:T(t)},find:function(t){var e,n=this;return e=t?"object"==typeof t?T(t).filter(function(){var t=this;return O.some.call(n,function(e){return T.contains(e,t)})}):1==this.length?T(Y.qsa(this[0],t)):this.map(function(){return Y.qsa(this,t)}):T()},closest:function(t,e){var n=[],i="object"==typeof t&&T(t);return this.each(function(o,a){for(;a&&!(i?i.indexOf(a)>=0:Y.matches(a,t));)a=a!==e&&!r(a)&&a.parentNode;a&&n.indexOf(a)<0&&n.push(a)}),T(n)},parents:function(t){for(var e=[],n=this;n.length>0;)n=T.map(n,function(t){if((t=t.parentNode)&&!r(t)&&e.indexOf(t)<0)return e.push(t),t});return v(e,t)},parent:function(t){return v(N(this.pluck("parentNode")),t)},children:function(t){return v(this.map(function(){return p(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||D.call(this.childNodes)})},siblings:function(t){return v(this.map(function(t,e){return A.call(p(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return T.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=h(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var n=e(t);if(this[0]&&!n)var r=T(t).get(0),i=r.parentNode||this.length>1;return this.each(function(e){T(this).wrapAll(n?t.call(this,e):i?r.cloneNode(!0):r)})},wrapAll:function(t){if(this[0]){T(this[0]).before(t=T(t));for(var e;(e=t.children()).length;)t=e.first();T(t).append(this)}return this},wrapInner:function(t){var n=e(t);return this.each(function(e){var r=T(this),i=r.contents(),o=n?t.call(this,e):t;i.length?i.wrapAll(o):r.append(o)})},unwrap:function(){return this.parent().each(function(){T(this).replaceWith(T(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=T(this);(t===E?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return T(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return T(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var n=this.innerHTML;T(this).empty().append(g(this,t,e,n))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=g(this,t,e,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this.pluck("textContent").join(""):null},attr:function(t,e){var n;return"string"!=typeof t||1 in arguments?this.each(function(n){if(1===this.nodeType)if(i(t))for(j in t)y(this,j,t[j]);else y(this,t,g(this,e,n,this.getAttribute(t)))}):0 in this&&1==this[0].nodeType&&null!=(n=this[0].getAttribute(t))?n:E},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){y(this,t)},this)})},prop:function(t,e){return t=K[t]||t,1 in arguments?this.each(function(n){this[t]=g(this,e,n,this[t])}):this[0]&&this[0][t]},removeProp:function(t){return t=K[t]||t,this.each(function(){delete this[t]})},data:function(t,e){var n="data-"+t.replace(q,"-$1").toLowerCase(),r=1 in arguments?this.attr(n,e):this.attr(n);return null!==r?b(r):E},val:function(t){return 0 in arguments?(null==t&&(t=""),this.each(function(e){this.value=g(this,t,e,this.value)})):this[0]&&(this[0].multiple?T(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var n=T(this),r=g(this,t,e,n.offset()),i=n.offsetParent().offset(),o={top:r.top-i.top,left:r.left-i.left};"static"==n.css("position")&&(o.position="relative"),n.css(o)});if(!this.length)return null;if(L.documentElement!==this[0]&&!T.contains(L.documentElement,this[0]))return{top:0,left:0};var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,n){if(arguments.length<2){var r=this[0];if("string"==typeof e){if(!r)return;return r.style[C(e)]||getComputedStyle(r,"").getPropertyValue(e)}if(Q(e)){if(!r)return;var i={},o=getComputedStyle(r,"");return T.each(e,function(t,e){i[e]=r.style[C(e)]||o.getPropertyValue(e)}),i}}var a="";if("string"==t(e))n||0===n?a=c(e)+":"+f(e,n):this.each(function(){this.style.removeProperty(c(e))});else for(j in e)e[j]||0===e[j]?a+=c(j)+":"+f(j,e[j])+";":this.each(function(){this.style.removeProperty(c(j))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf(T(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return!!t&&O.some.call(this,function(t){return this.test(x(t))},l(t))},addClass:function(t){return t?this.each(function(e){if("className"in this){S=[];var n=x(this),r=g(this,t,e,n);r.split(/\s+/g).forEach(function(t){T(this).hasClass(t)||S.push(t)},this),S.length&&x(this,n+(n?" ":"")+S.join(" "))}}):this},removeClass:function(t){return this.each(function(e){if("className"in this){if(t===E)return x(this,"");S=x(this),g(this,t,e,S).split(/\s+/g).forEach(function(t){S=S.replace(l(t)," ")}),x(this,S.trim())}})},toggleClass:function(t,e){return t?this.each(function(n){var r=T(this),i=g(this,t,n,x(this));i.split(/\s+/g).forEach(function(t){(e===E?!r.hasClass(t):e)?r.addClass(t):r.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===E?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===E?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),n=this.offset(),r=Z.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(T(t).css("margin-top"))||0,n.left-=parseFloat(T(t).css("margin-left"))||0,r.top+=parseFloat(T(e[0]).css("border-top-width"))||0,r.left+=parseFloat(T(e[0]).css("border-left-width"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||L.body;t&&!Z.test(t.nodeName)&&"static"==T(t).css("position");)t=t.offsetParent;return t})}},T.fn.detach=T.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});T.fn[t]=function(i){var o,a=this[0];return i===E?n(a)?a["inner"+e]:r(a)?a.documentElement["scroll"+e]:(o=this.offset())&&o[t]:this.each(function(e){a=T(this),a.css(t,g(this,i,e,a[t]()))})}}),I.forEach(function(e,n){var r=n%2;T.fn[e]=function(){var e,i,o=T.map(arguments,function(n){var r=[];return e=t(n),"array"==e?(n.forEach(function(t){return t.nodeType!==E?r.push(t):T.zepto.isZ(t)?r=r.concat(t.get()):void(r=r.concat(Y.fragment(t)))}),r):"object"==e||null==n?n:Y.fragment(n)}),a=this.length>1;return o.length<1?this:this.each(function(t,e){i=r?e:e.parentNode,e=0==n?e.nextSibling:1==n?e.firstChild:2==n?e:null;var s=T.contains(L.documentElement,i);o.forEach(function(t){if(a)t=t.cloneNode(!0);else if(!i)return T(t).remove();i.insertBefore(t,e),s&&w(t,function(t){if(!(null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src)){var e=t.ownerDocument?t.ownerDocument.defaultView:window;e.eval.call(e,t.innerHTML)}})})})},T.fn[r?e+"To":"insert"+(n?"Before":"After")]=function(t){return T(t)[e](this),this}}),Y.Z.prototype=d.prototype=T.fn,Y.uniq=N,Y.deserializeValue=b,T.zepto=Y,T}();!function(t){function e(t){return t._zid||(t._zid=h++)}function n(t,n,o,a){if(n=r(n),n.ns)var s=i(n.ns);return(v[e(t)]||[]).filter(function(t){return t&&(!n.e||t.e==n.e)&&(!n.ns||s.test(t.ns))&&(!o||e(t.fn)===e(o))&&(!a||t.sel==a)})}function r(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function i(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function o(t,e){return t.del&&!y&&t.e in x||!!e}function a(t){return b[t]||y&&x[t]||t}function s(n,i,s,u,l,h,p){var d=e(n),m=v[d]||(v[d]=[]);i.split(/\s/).forEach(function(e){if("ready"==e)return t(document).ready(s);var i=r(e);i.fn=s,i.sel=l,i.e in b&&(s=function(e){var n=e.relatedTarget;if(!n||n!==this&&!t.contains(this,n))return i.fn.apply(this,arguments)}),i.del=h;var d=h||s;i.proxy=function(t){if(t=c(t),!t.isImmediatePropagationStopped()){t.data=u;var e=d.apply(n,t._args==f?[t]:[t].concat(t._args));return e===!1&&(t.preventDefault(),t.stopPropagation()),e}},i.i=m.length,m.push(i),"addEventListener"in n&&n.addEventListener(a(i.e),i.proxy,o(i,p))})}function u(t,r,i,s,u){var c=e(t);(r||"").split(/\s/).forEach(function(e){n(t,e,i,s).forEach(function(e){delete v[c][e.i],"removeEventListener"in t&&t.removeEventListener(a(e.e),e.proxy,o(e,u))})})}function c(e,n){return!n&&e.isDefaultPrevented||(n||(n=e),t.each(T,function(t,r){var i=n[t];e[t]=function(){return this[r]=w,i&&i.apply(n,arguments)},e[r]=E}),e.timeStamp||(e.timeStamp=Date.now()),(n.defaultPrevented!==f?n.defaultPrevented:"returnValue"in n?n.returnValue===!1:n.getPreventDefault&&n.getPreventDefault())&&(e.isDefaultPrevented=w)),e}function l(t){var e,n={originalEvent:t};for(e in t)j.test(e)||t[e]===f||(n[e]=t[e]);return c(n,t)}var f,h=1,p=Array.prototype.slice,d=t.isFunction,m=function(t){return"string"==typeof t},v={},g={},y="onfocusin"in window,x={focus:"focusin",blur:"focusout"},b={mouseenter:"mouseover",mouseleave:"mouseout"};g.click=g.mousedown=g.mouseup=g.mousemove="MouseEvents",t.event={add:s,remove:u},t.proxy=function(n,r){var i=2 in arguments&&p.call(arguments,2);if(d(n)){var o=function(){return n.apply(r,i?i.concat(p.call(arguments)):arguments)};return o._zid=e(n),o}if(m(r))return i?(i.unshift(n[r],n),t.proxy.apply(null,i)):t.proxy(n[r],n);throw new TypeError("expected function")},t.fn.bind=function(t,e,n){return this.on(t,e,n)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,n,r){return this.on(t,e,n,r,1)};var w=function(){return!0},E=function(){return!1},j=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,T={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,n){return this.on(e,t,n)},t.fn.undelegate=function(t,e,n){return this.off(e,t,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,n,r,i,o){var a,c,h=this;return e&&!m(e)?(t.each(e,function(t,e){h.on(t,n,r,e,o)}),h):(m(n)||d(i)||i===!1||(i=r,r=n,n=f),i!==f&&r!==!1||(i=r,r=f),i===!1&&(i=E),h.each(function(f,h){o&&(a=function(t){return u(h,t.type,i),i.apply(this,arguments)}),n&&(c=function(e){var r,o=t(e.target).closest(n,h).get(0);if(o&&o!==h)return r=t.extend(l(e),{currentTarget:o,liveFired:h}),(a||i).apply(o,[r].concat(p.call(arguments,1)))}),s(h,e,i,r,n,c||a)}))},t.fn.off=function(e,n,r){var i=this;return e&&!m(e)?(t.each(e,function(t,e){i.off(t,n,e)}),i):(m(n)||d(r)||r===!1||(r=n,n=f),r===!1&&(r=E),i.each(function(){u(this,e,r,n)}))},t.fn.trigger=function(e,n){return e=m(e)||t.isPlainObject(e)?t.Event(e):c(e),e._args=n,this.each(function(){e.type in x&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,r){var i,o;return this.each(function(a,s){i=l(m(e)?t.Event(e):e),i._args=r,i.target=s,t.each(n(s,e.type||e),function(t,e){if(o=e.proxy(i),i.isImmediatePropagationStopped())return!1})}),o},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){m(t)||(e=t,t=e.type);var n=document.createEvent(g[t]||"Events"),r=!0;if(e)for(var i in e)"bubbles"==i?r=!!e[i]:n[i]=e[i];return n.initEvent(t,r,!0),c(n)}}(e),function(t){function e(e,n,r){var i=t.Event(n);return t(e).trigger(i,r),!i.isDefaultPrevented()}function n(t,n,r,i){if(t.global)return e(n||x,r,i)}function r(e){e.global&&0===t.active++&&n(e,null,"ajaxStart")}function i(e){e.global&&!--t.active&&n(e,null,"ajaxStop")}function o(t,e){var r=e.context;return e.beforeSend.call(r,t,e)!==!1&&n(e,r,"ajaxBeforeSend",[t,e])!==!1&&void n(e,r,"ajaxSend",[t,e])}function a(t,e,r,i){var o=r.context,a="success";r.success.call(o,t,a,e),i&&i.resolveWith(o,[t,a,e]),n(r,o,"ajaxSuccess",[e,r,t]),u(a,e,r)}function s(t,e,r,i,o){var a=i.context;i.error.call(a,r,e,t),o&&o.rejectWith(a,[r,e,t]),n(i,a,"ajaxError",[r,i,t||e]),u(e,r,i)}function u(t,e,r){var o=r.context;r.complete.call(o,e,t),n(r,o,"ajaxComplete",[e,r]),i(r)}function c(t,e,n){if(n.dataFilter==l)return t;var r=n.context;return n.dataFilter.call(r,t,e)}function l(){}function f(t){return t&&(t=t.split(";",2)[0]),t&&(t==T?"html":t==j?"json":w.test(t)?"script":E.test(t)&&"xml")||"text"}function h(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function p(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()&&"jsonp"!=e.dataType||(e.url=h(e.url,e.data),e.data=void 0)}function d(e,n,r,i){return t.isFunction(n)&&(i=r,r=n,n=void 0),t.isFunction(r)||(i=r,r=void 0),{url:e,data:n,success:r,dataType:i}}function m(e,n,r,i){var o,a=t.isArray(n),s=t.isPlainObject(n);t.each(n,function(n,u){o=t.type(u),i&&(n=r?i:i+"["+(s||"object"==o||"array"==o?n:"")+"]"),!i&&a?e.add(u.name,u.value):"array"==o||!r&&"object"==o?m(e,u,r,n):e.add(n,u)})}var v,g,y=+new Date,x=window.document,b=/)<[^<]*)*<\/script>/gi,w=/^(?:text|application)\/javascript/i,E=/^(?:text|application)\/xml/i,j="application/json",T="text/html",S=/^\s*$/,C=x.createElement("a");C.href=window.location.href,t.active=0,t.ajaxJSONP=function(e,n){if(!("type"in e))return t.ajax(e);var r,i,u=e.jsonpCallback,c=(t.isFunction(u)?u():u)||"Zepto"+y++,l=x.createElement("script"),f=window[c],h=function(e){t(l).triggerHandler("error",e||"abort")},p={abort:h};return n&&n.promise(p),t(l).on("load error",function(o,u){clearTimeout(i),t(l).off().remove(),"error"!=o.type&&r?a(r[0],p,e,n):s(null,u||"error",p,e,n),window[c]=f,r&&t.isFunction(f)&&f(r[0]),f=r=void 0}),o(p,e)===!1?(h("abort"),p):(window[c]=function(){r=arguments},l.src=e.url.replace(/\?(.+)=\?/,"?$1="+c),x.head.appendChild(l),e.timeout>0&&(i=setTimeout(function(){h("timeout")},e.timeout)),p)},t.ajaxSettings={type:"GET",beforeSend:l,success:l,error:l,complete:l,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:j,xml:"application/xml, text/xml",html:T,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:l},t.ajax=function(e){var n,i,u=t.extend({},e||{}),d=t.Deferred&&t.Deferred();for(v in t.ajaxSettings)void 0===u[v]&&(u[v]=t.ajaxSettings[v]);r(u),u.crossDomain||(n=x.createElement("a"),n.href=u.url,n.href=n.href,u.crossDomain=C.protocol+"//"+C.host!=n.protocol+"//"+n.host),u.url||(u.url=window.location.toString()),(i=u.url.indexOf("#"))>-1&&(u.url=u.url.slice(0,i)),p(u);var m=u.dataType,y=/\?.+=\?/.test(u.url);if(y&&(m="jsonp"),u.cache!==!1&&(e&&e.cache===!0||"script"!=m&&"jsonp"!=m)||(u.url=h(u.url,"_="+Date.now())),"jsonp"==m)return y||(u.url=h(u.url,u.jsonp?u.jsonp+"=?":u.jsonp===!1?"":"callback=?")),t.ajaxJSONP(u,d);var b,w=u.accepts[m],E={},j=function(t,e){E[t.toLowerCase()]=[t,e]},T=/^([\w-]+:)\/\//.test(u.url)?RegExp.$1:window.location.protocol,N=u.xhr(),O=N.setRequestHeader;if(d&&d.promise(N),u.crossDomain||j("X-Requested-With","XMLHttpRequest"),j("Accept",w||"*/*"),(w=u.mimeType||w)&&(w.indexOf(",")>-1&&(w=w.split(",",2)[0]),N.overrideMimeType&&N.overrideMimeType(w)),(u.contentType||u.contentType!==!1&&u.data&&"GET"!=u.type.toUpperCase())&&j("Content-Type",u.contentType||"application/x-www-form-urlencoded"),u.headers)for(g in u.headers)j(g,u.headers[g]);if(N.setRequestHeader=j,N.onreadystatechange=function(){if(4==N.readyState){N.onreadystatechange=l,clearTimeout(b);var e,n=!1;if(N.status>=200&&N.status<300||304==N.status||0==N.status&&"file:"==T){if(m=m||f(u.mimeType||N.getResponseHeader("content-type")),"arraybuffer"==N.responseType||"blob"==N.responseType)e=N.response;else{e=N.responseText;try{e=c(e,m,u),"script"==m?(0,eval)(e):"xml"==m?e=N.responseXML:"json"==m&&(e=S.test(e)?null:t.parseJSON(e))}catch(r){n=r}if(n)return s(n,"parsererror",N,u,d)}a(e,N,u,d)}else s(N.statusText||null,N.status?"error":"abort",N,u,d)}},o(N,u)===!1)return N.abort(),s(null,"abort",N,u,d),N;var P=!("async"in u)||u.async;if(N.open(u.type,u.url,P,u.username,u.password),u.xhrFields)for(g in u.xhrFields)N[g]=u.xhrFields[g];for(g in E)O.apply(N,E[g]);return u.timeout>0&&(b=setTimeout(function(){N.onreadystatechange=l,N.abort(),s(null,"timeout",N,u,d)},u.timeout)),N.send(u.data?u.data:null),N},t.get=function(){return t.ajax(d.apply(null,arguments))},t.post=function(){var e=d.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=d.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,n,r){if(!this.length)return this;var i,o=this,a=e.split(/\s/),s=d(e,n,r),u=s.success;return a.length>1&&(s.url=a[0],i=a[1]),s.success=function(e){o.html(i?t("
                                      ").html(e.replace(b,"")).find(i):e),u&&u.apply(o,arguments)},t.ajax(s),this};var N=encodeURIComponent;t.param=function(e,n){var r=[];return r.add=function(e,n){t.isFunction(n)&&(n=n()),null==n&&(n=""),this.push(N(e)+"="+N(n))},m(r,e,n),r.join("&").replace(/%20/g,"+")}}(e),function(t){t.fn.serializeArray=function(){var e,n,r=[],i=function(t){return t.forEach?t.forEach(i):void r.push({name:e,value:t})};return this[0]&&t.each(this[0].elements,function(r,o){n=o.type,e=o.name,e&&"fieldset"!=o.nodeName.toLowerCase()&&!o.disabled&&"submit"!=n&&"reset"!=n&&"button"!=n&&"file"!=n&&("radio"!=n&&"checkbox"!=n||o.checked)&&i(t(o).val())}),r},t.fn.serialize=function(){var t=[];return this.serializeArray().forEach(function(e){t.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))}),t.join("&")},t.fn.submit=function(e){if(0 in arguments)this.bind("submit",e);else if(this.length){var n=t.Event("submit");this.eq(0).trigger(n),n.isDefaultPrevented()||this.get(0).submit()}return this}}(e),function(){try{getComputedStyle(void 0)}catch(t){var e=getComputedStyle;window.getComputedStyle=function(t,n){try{return e(t,n)}catch(r){return null}}}}(),t("zepto",e)});layui.define(["layer-mobile","zepto"],function(e){"use strict";var t=layui.zepto,a=layui["layer-mobile"],i=(layui.device(),"layui-upload-enter"),n="layui-upload-iframe",r={icon:2,shift:6},o={file:"文件",video:"视频",audio:"音频"};a.msg=function(e){return a.open({content:e||"",skin:"msg",time:2})};var s=function(e){this.options=e};s.prototype.init=function(){var e=this,a=e.options,r=t("body"),s=t(a.elem||".layui-upload-file"),u=t('');return t("#"+n)[0]||r.append(u),s.each(function(r,s){s=t(s);var u='
                                      ',l=s.attr("lay-type")||a.type;a.unwrap||(u='
                                      '+u+''+(s.attr("lay-title")||a.title||"上传"+(o[l]||"图片"))+"
                                      "),u=t(u),a.unwrap||u.on("dragover",function(e){e.preventDefault(),t(this).addClass(i)}).on("dragleave",function(){t(this).removeClass(i)}).on("drop",function(){t(this).removeClass(i)}),s.parent("form").attr("target")===n&&(a.unwrap?s.unwrap():(s.parent().next().remove(),s.unwrap().unwrap())),s.wrap(u),s.off("change").on("change",function(){e.action(this,l)})})},s.prototype.action=function(e,i){var o=this,s=o.options,u=e.value,l=t(e),p=l.attr("lay-ext")||s.ext||"";if(u){switch(i){case"file":if(p&&!RegExp("\\w\\.("+p+")$","i").test(escape(u)))return a.msg("不支持该文件格式",r),e.value="";break;case"video":if(!RegExp("\\w\\.("+(p||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(u)))return a.msg("不支持该视频格式",r),e.value="";break;case"audio":if(!RegExp("\\w\\.("+(p||"mp3|wav|mid")+")$","i").test(escape(u)))return a.msg("不支持该音频格式",r),e.value="";break;default:if(!RegExp("\\w\\.("+(p||"jpg|png|gif|bmp|jpeg")+")$","i").test(escape(u)))return a.msg("不支持该图片格式",r),e.value=""}s.before&&s.before(e),l.parent().submit();var c=t("#"+n),f=setInterval(function(){var t;try{t=c.contents().find("body").text()}catch(i){a.msg("上传接口存在跨域",r),clearInterval(f)}if(t){clearInterval(f),c.contents().find("body").html("");try{t=JSON.parse(t)}catch(i){return t={},a.msg("请对上传接口返回JSON字符",r)}"function"==typeof s.success&&s.success(t,e)}},30);e.value=""}},e("upload-mobile",function(e){var t=new s(e=e||{});t.init()})});layui.define(function(i){i("layim-mobile",layui.v)});layui["layui.mobile"]||layui.config({base:layui.cache.dir+"lay/modules/mobile/"}).extend({"layer-mobile":"layer-mobile",zepto:"zepto","upload-mobile":"upload-mobile","layim-mobile":"layim-mobile"}),layui.define(["layer-mobile","zepto","layim-mobile"],function(l){l("mobile",{layer:layui["layer-mobile"],layim:layui["layim-mobile"]})}); \ No newline at end of file diff --git a/static/layui/lay/modules/table.js b/static/layui/lay/modules/table.js deleted file mode 100644 index 2237a172e..000000000 --- a/static/layui/lay/modules/table.js +++ /dev/null @@ -1,2 +0,0 @@ -/** layui-v2.2.5 MIT License By https://www.layui.com */ - ;layui.define(["laytpl","laypage","layer","form"],function(e){"use strict";var t=layui.$,i=layui.laytpl,a=layui.laypage,l=layui.layer,n=layui.form,o=layui.hint(),r=layui.device(),d={config:{checkName:"LAY_CHECKED",indexName:"LAY_TABLE_INDEX"},cache:{},index:layui.table?layui.table.index+1e4:0,set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,s,e,t)}},c=function(){var e=this,t=e.config,i=t.id;return i&&(c.config[i]=t),{reload:function(t){e.reload.call(e,t)},config:t}},s="table",u=".layui-table",h="layui-hide",f="layui-none",y="layui-table-view",p=".layui-table-header",m=".layui-table-body",v=".layui-table-main",g=".layui-table-fixed",x=".layui-table-fixed-l",b=".layui-table-fixed-r",k=".layui-table-tool",C=".layui-table-page",w=".layui-table-sort",N="layui-table-edit",F="layui-table-hover",W=function(e){var t='{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}';return e=e||{},['',"","{{# layui.each(d.data.cols, function(i1, item1){ }}","","{{# layui.each(item1, function(i2, item2){ }}",'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}','{{# if(item2.fixed === "right"){ right = true; } }}',function(){return e.fixed&&"right"!==e.fixed?'{{# if(item2.fixed && item2.fixed !== "right"){ }}':"right"===e.fixed?'{{# if(item2.fixed === "right"){ }}':""}(),'",e.fixed?"{{# }; }}":"","{{# }); }}","","{{# }); }}","","
                                      ','
                                      1){ }}","group","{{# } else { }}","{{d.index}}-{{item2.field || i2}}",'{{# if(item2.type !== "normal"){ }}'," laytable-cell-{{ item2.type }}","{{# } }}","{{# } }}",'" {{#if(item2.align){}}align="{{item2.align}}"{{#}}}>','{{# if(item2.type === "checkbox"){ }}','',"{{# } else { }}",'{{item2.title||""}}',"{{# if(!(item2.colspan > 1) && item2.sort){ }}",'',"{{# } }}","{{# } }}","
                                      ","
                                      "].join("")},z=['',"","
                                      "].join(""),A=['
                                      ',"{{# if(d.data.toolbar){ }}",'
                                      ',"{{# } }}",'
                                      ',"{{# var left, right; }}",'
                                      ',W(),"
                                      ",'
                                      ',z,"
                                      ","{{# if(left){ }}",'
                                      ','
                                      ',W({fixed:!0}),"
                                      ",'
                                      ',z,"
                                      ","
                                      ","{{# }; }}","{{# if(right){ }}",'
                                      ','
                                      ',W({fixed:"right"}),'
                                      ',"
                                      ",'
                                      ',z,"
                                      ","
                                      ","{{# }; }}","
                                      ","{{# if(d.data.page){ }}",'
                                      ','
                                      ',"
                                      ","{{# } }}","","
                                      "].join(""),T=t(window),M=t(document),S=function(e){var i=this;i.index=++d.index,i.config=t.extend({},i.config,d.config,e),i.render()};S.prototype.config={limit:10,loading:!0,cellMinWidth:60,text:{none:"无数据"}},S.prototype.render=function(){var e=this,a=e.config;if(a.elem=t(a.elem),a.where=a.where||{},a.id=a.id||a.elem.attr("id"),a.request=t.extend({pageName:"page",limitName:"limit"},a.request),a.response=t.extend({statusName:"code",statusCode:0,msgName:"msg",dataName:"data",countName:"count"},a.response),"object"==typeof a.page&&(a.limit=a.page.limit||a.limit,a.limits=a.page.limits||a.limits,e.page=a.page.curr=a.page.curr||1,delete a.page.elem,delete a.page.jump),!a.elem[0])return e;e.setArea();var l=a.elem,n=l.next("."+y),o=e.elem=t(i(A).render({VIEW_CLASS:y,data:a,index:e.index}));if(a.index=e.index,n[0]&&n.remove(),l.after(o),e.layHeader=o.find(p),e.layMain=o.find(v),e.layBody=o.find(m),e.layFixed=o.find(g),e.layFixLeft=o.find(x),e.layFixRight=o.find(b),e.layTool=o.find(k),e.layPage=o.find(C),e.layTool.html(i(t(a.toolbar).html()||"").render(a)),a.height&&e.fullSize(),a.cols.length>1){var r=e.layFixed.find(p).find("th");r.height(e.layHeader.height()-1-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom")))}e.pullData(e.page),e.events()},S.prototype.initOpts=function(e){var t=this,i=(t.config,{checkbox:48,space:15,numbers:40});e.checkbox&&(e.type="checkbox"),e.space&&(e.type="space"),e.type||(e.type="normal"),"normal"!==e.type&&(e.unresize=!0,e.width=e.width||i[e.type])},S.prototype.setArea=function(){var e=this,t=e.config,i=0,a=0,l=0,n=0,o=t.width||function(){var e=function(i){var a,l;i=i||t.elem.parent(),a=i.width();try{l="none"===i.css("display")}catch(n){}return!i[0]||a&&!l?a:e(i.parent())};return e()}();e.eachCols(function(){i++}),o-=function(){return"line"===t.skin||"nob"===t.skin?2:i+1}(),layui.each(t.cols,function(t,i){layui.each(i,function(t,l){var r;return l?(e.initOpts(l),r=l.width||0,void(l.colspan>1||(/\d+%$/.test(r)?l.width=r=Math.floor(parseFloat(r)/100*o):r||(l.width=r=0,a++),n+=r))):void i.splice(t,1)})}),e.autoColNums=a,o>n&&a&&(l=(o-n)/a),layui.each(t.cols,function(e,i){layui.each(i,function(e,i){var a=i.minWidth||t.cellMinWidth;i.colspan>1||0===i.width&&(i.width=Math.floor(l>=a?l:a))})}),t.height&&/^full-\d+$/.test(t.height)&&(e.fullHeightGap=t.height.split("-")[1],t.height=T.height()-e.fullHeightGap)},S.prototype.reload=function(e){var i=this;i.config.data&&i.config.data.constructor===Array&&delete i.config.data,i.config=t.extend({},i.config,e),i.render()},S.prototype.page=1,S.prototype.pullData=function(e,i){var a=this,n=a.config,o=n.request,r=n.response,d=function(){"object"==typeof n.initSort&&a.sort(n.initSort.field,n.initSort.type)};if(a.startTime=(new Date).getTime(),n.url){var c={};c[o.pageName]=e,c[o.limitName]=n.limit,t.ajax({type:n.method||"get",url:n.url,data:t.extend(c,n.where),dataType:"json",success:function(t){t[r.statusName]!=r.statusCode?(a.renderForm(),a.layMain.html('
                                      '+(t[r.msgName]||"返回的数据状态异常")+"
                                      ")):(a.renderData(t,e,t[r.countName]),d(),n.time=(new Date).getTime()-a.startTime+" ms"),i&&l.close(i),"function"==typeof n.done&&n.done(t,e,t[r.countName])},error:function(e,t){a.layMain.html('
                                      数据接口请求异常
                                      '),a.renderForm(),i&&l.close(i)}})}else if(n.data&&n.data.constructor===Array){var s={},u=e*n.limit-n.limit;s[r.dataName]=n.data.concat().splice(u,n.limit),s[r.countName]=n.data.length,a.renderData(s,e,n.data.length),d(),"function"==typeof n.done&&n.done(s,e,s[r.countName])}},S.prototype.eachCols=function(e){var i=t.extend(!0,[],this.config.cols),a=[],l=0;layui.each(i,function(e,t){layui.each(t,function(t,n){if(n.colspan>1){var o=0;l++,n.CHILD_COLS=[],layui.each(i[e+1],function(e,t){t.PARENT_COL||o==n.colspan||(t.PARENT_COL=l,n.CHILD_COLS.push(t),o+=t.colspan>1?t.colspan:1)})}n.PARENT_COL||a.push(n)})});var n=function(t){layui.each(t||a,function(t,i){return i.CHILD_COLS?n(i.CHILD_COLS):void e(t,i)})};n()},S.prototype.renderData=function(e,n,o,r){var c=this,s=c.config,u=e[s.response.dataName]||[],y=[],p=[],m=[],v=function(){return!r&&c.sortKey?c.sort(c.sortKey.field,c.sortKey.sort,!0):(layui.each(u,function(e,a){var l=[],o=[],u=[],h=e+s.limit*(n-1)+1;0!==a.length&&(r||(a[d.config.indexName]=e),c.eachCols(function(e,n){var r=n.field||e,f=a[r];c.getColElem(c.layHeader,r);if(void 0!==f&&null!==f||(f=""),!(n.colspan>1)){var y=['",'
                                      '+function(){var e=t.extend(!0,{LAY_INDEX:h},a);return"checkbox"===n.type?'":"numbers"===n.type?h:n.toolbar?i(t(n.toolbar).html()||"").render(e):n.templet?function(){return"function"==typeof n.templet?n.templet(e):i(t(n.templet).html()||String(f)).render(e)}():f}(),"
                                      "].join("");l.push(y),n.fixed&&"right"!==n.fixed&&o.push(y),"right"===n.fixed&&u.push(y)}}),y.push(''+l.join("")+""),p.push(''+o.join("")+""),m.push(''+u.join("")+""))}),c.layBody.scrollTop(0),c.layMain.find("."+f).remove(),c.layMain.find("tbody").html(y.join("")),c.layFixLeft.find("tbody").html(p.join("")),c.layFixRight.find("tbody").html(m.join("")),c.renderForm(),c.syncCheckAll(),c.haveInit?c.scrollPatch():setTimeout(function(){c.scrollPatch()},50),c.haveInit=!0,void l.close(c.tipsIndex))};return c.key=s.id||s.index,d.cache[c.key]=u,c.layPage[0===u.length&&1==n?"addClass":"removeClass"](h),r?v():0===u.length?(c.renderForm(),c.layFixed.remove(),c.layMain.find("tbody").html(""),c.layMain.find("."+f).remove(),c.layMain.append('
                                      '+s.text.none+"
                                      ")):(v(),void(s.page&&(s.page=t.extend({elem:"layui-table-page"+s.index,count:o,limit:s.limit,limits:s.limits||[10,20,30,40,50,60,70,80,90],groups:3,layout:["prev","page","next","skip","count","limit"],prev:'',next:'',jump:function(e,t){t||(c.page=e.curr,s.limit=e.limit,c.pullData(e.curr,c.loading()))}},s.page),s.page.count=o,a.render(s.page))))},S.prototype.getColElem=function(e,t){var i=this,a=i.config;return e.eq(0).find(".laytable-cell-"+(a.index+"-"+t)+":eq(0)")},S.prototype.renderForm=function(e){n.render(e,"LAY-table-"+this.index)},S.prototype.sort=function(e,i,a,l){var n,r,c=this,u={},h=c.config,f=h.elem.attr("lay-filter"),y=d.cache[c.key];"string"==typeof e&&c.layHeader.find("th").each(function(i,a){var l=t(this),o=l.data("field");if(o===e)return e=l,n=o,!1});try{var n=n||e.data("field");if(c.sortKey&&!a&&n===c.sortKey.field&&i===c.sortKey.sort)return;var p=c.layHeader.find("th .laytable-cell-"+h.index+"-"+n).find(w);c.layHeader.find("th").find(w).removeAttr("lay-sort"),p.attr("lay-sort",i||null),c.layFixed.find("th")}catch(m){return o.error("Table modules: Did not match to field")}c.sortKey={field:n,sort:i},"asc"===i?r=layui.sort(y,n):"desc"===i?r=layui.sort(y,n,!0):(r=layui.sort(y,d.config.indexName),delete c.sortKey),u[h.response.dataName]=r,c.renderData(u,c.page,c.count,!0),l&&layui.event.call(e,s,"sort("+f+")",{field:n,type:i})},S.prototype.loading=function(){var e=this,t=e.config;if(t.loading&&t.url)return l.msg("数据请求中",{icon:16,offset:[e.elem.offset().top+e.elem.height()/2-35-T.scrollTop()+"px",e.elem.offset().left+e.elem.width()/2-90-T.scrollLeft()+"px"],time:-1,anim:-1,fixed:!1})},S.prototype.setCheckData=function(e,t){var i=this,a=i.config,l=d.cache[i.key];l[e]&&l[e].constructor!==Array&&(l[e][a.checkName]=t)},S.prototype.syncCheckAll=function(){var e=this,t=e.config,i=e.layHeader.find('input[name="layTableCheckbox"]'),a=function(i){return e.eachCols(function(e,a){"checkbox"===a.type&&(a[t.checkName]=i)}),i};i[0]&&(d.checkStatus(e.key).isAll?(i[0].checked||(i.prop("checked",!0),e.renderForm("checkbox")),a(!0)):(i[0].checked&&(i.prop("checked",!1),e.renderForm("checkbox")),a(!1)))},S.prototype.getCssRule=function(e,t){var i=this,a=i.elem.find("style")[0],l=a.sheet||a.styleSheet||{},n=l.cssRules||l.rules;layui.each(n,function(a,l){if(l.selectorText===".laytable-cell-"+i.index+"-"+e)return t(l),!0})},S.prototype.fullSize=function(){var e,t=this,i=t.config,a=i.height;t.fullHeightGap&&(a=T.height()-t.fullHeightGap,a<135&&(a=135),t.elem.css("height",a)),e=parseFloat(a)-parseFloat(t.layHeader.height())-1,i.toolbar&&(e-=t.layTool.outerHeight()),i.page&&(e=e-t.layPage.outerHeight()-1),t.layMain.css("height",e)},S.prototype.getScrollWidth=function(e){var t=0;return e?t=e.offsetWidth-e.clientWidth:(e=document.createElement("div"),e.style.width="100px",e.style.height="100px",e.style.overflowY="scroll",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),t},S.prototype.scrollPatch=function(){var e=this,i=e.layMain.children("table"),a=e.layMain.width()-e.layMain.prop("clientWidth"),l=e.layMain.height()-e.layMain.prop("clientHeight"),n=e.getScrollWidth(e.layMain[0]),o=i.outerWidth()-e.layMain.width();if(e.autoColNums&&o<5&&!e.scrollPatchWStatus){var r=e.layHeader.eq(0).find("thead th:last-child"),d=r.data("field");e.getCssRule(d,function(t){var i=t.style.width||r.outerWidth();t.style.width=parseFloat(i)-n-o+"px",e.layMain.height()-e.layMain.prop("clientHeight")>0&&(t.style.width=parseFloat(t.style.width)-1+"px"),e.scrollPatchWStatus=!0})}if(a&&l){if(!e.elem.find(".layui-table-patch")[0]){var c=t('
                                      ');c.find("div").css({width:a}),e.layHeader.eq(0).find("thead tr").append(c)}}else e.layHeader.eq(0).find(".layui-table-patch").remove();var s=e.layMain.height(),u=s-l;e.layFixed.find(m).css("height",i.height()>u?u:"auto"),e.layFixRight[o>0?"removeClass":"addClass"](h),e.layFixRight.css("right",a-1)},S.prototype.events=function(){var e,a=this,n=a.config,o=t("body"),c={},u=a.layHeader.find("th"),h=".layui-table-cell",f=n.elem.attr("lay-filter");u.on("mousemove",function(e){var i=t(this),a=i.offset().left,l=e.clientX-a;i.attr("colspan")>1||i.data("unresize")||c.resizeStart||(c.allowResize=i.width()-l<=10,o.css("cursor",c.allowResize?"col-resize":""))}).on("mouseleave",function(){t(this);c.resizeStart||o.css("cursor","")}).on("mousedown",function(e){var i=t(this);if(c.allowResize){var l=i.data("field");e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],a.getCssRule(l,function(e){var t=e.style.width||i.outerWidth();c.rule=e,c.ruleWidth=parseFloat(t),c.minWidth=i.data("minwidth")||n.cellMinWidth})}}),M.on("mousemove",function(t){if(c.resizeStart){if(t.preventDefault(),c.rule){var i=c.ruleWidth+t.clientX-c.offset[0];i');d[0].value=e.data("content")||o.text(),e.find("."+N)[0]||e.append(d),d.focus()}else o.find(".layui-form-switch,.layui-form-checkbox")[0]||Math.round(o.prop("scrollWidth"))>Math.round(o.outerWidth())&&(a.tipsIndex=l.tips(['
                                      ',o.html(),"
                                      ",''].join(""),o[0],{tips:[3,""],time:-1,anim:-1,maxWidth:r.ios||r.android?300:600,isOutAnim:!1,skin:"layui-table-tips",success:function(e,t){e.find(".layui-table-tips-c").on("click",function(){l.close(t)})}}))}),a.layBody.on("click","*[lay-event]",function(){var e=t(this),l=e.parents("tr").eq(0).data("index"),n=a.layBody.find('tr[data-index="'+l+'"]'),o="layui-table-click",r=d.cache[a.key][l];layui.event.call(this,s,"tool("+f+")",{data:d.clearCacheKey(r),event:e.attr("lay-event"),tr:n,del:function(){d.cache[a.key][l]=[],n.remove(),a.scrollPatch()},update:function(e){e=e||{},layui.each(e,function(e,l){if(e in r){var o,d=n.children('td[data-field="'+e+'"]');r[e]=l,a.eachCols(function(t,i){i.field==e&&i.templet&&(o=i.templet)}),d.children(h).html(o?i(t(o).html()||l).render(r):l),d.data("content",l)}})}}),n.addClass(o).siblings("tr").removeClass(o)}),a.layMain.on("scroll",function(){var e=t(this),i=e.scrollLeft(),n=e.scrollTop();a.layHeader.scrollLeft(i),a.layFixed.find(m).scrollTop(n),l.close(a.tipsIndex)}),T.on("resize",function(){a.fullSize(),a.scrollPatch()})},d.init=function(e,i){i=i||{};var a=this,l=t(e?'table[lay-filter="'+e+'"]':u+"[lay-data]"),n="Table element property lay-data configuration item has a syntax error: ";return l.each(function(){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){o.error(n+l)}var c=[],s=t.extend({elem:this,cols:[],data:[],skin:a.attr("lay-skin"),size:a.attr("lay-size"),even:"string"==typeof a.attr("lay-even")},d.config,i,l);e&&a.hide(),a.find("thead>tr").each(function(e){s.cols[e]=[],t(this).children().each(function(i){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){return o.error(n+l)}var d=t.extend({title:a.text(),colspan:a.attr("colspan")||0,rowspan:a.attr("rowspan")||0},l);d.colspan<2&&c.push(d),s.cols[e].push(d)})}),a.find("tbody>tr").each(function(e){var i=t(this),a={};i.children("td").each(function(e,i){var l=t(this),n=l.data("field");if(n)return a[n]=l.html()}),layui.each(c,function(e,t){var l=i.children("td").eq(e);a[t.field]=l.html()}),s.data[e]=a}),d.render(s)}),a},d.checkStatus=function(e){var t=0,i=0,a=[],l=d.cache[e]||[];return layui.each(l,function(e,l){return l.constructor===Array?void i++:void(l[d.config.checkName]&&(t++,a.push(d.clearCacheKey(l))))}),{data:a,isAll:!!l.length&&t===l.length-i}},c.config={},d.reload=function(e,i){var a=c.config[e];return i=i||{},a?(i.data&&i.data.constructor===Array&&delete a.data,d.render(t.extend(!0,{},a,i))):o.error("The ID option was not found in the table instance")},d.render=function(e){var t=new S(e);return c.call(t)},d.clearCacheKey=function(e){return e=t.extend({},e),delete e[d.config.checkName],delete e[d.config.indexName],e},d.init(),e(s,d)}); \ No newline at end of file diff --git a/static/layui/lay/modules/tree.js b/static/layui/lay/modules/tree.js deleted file mode 100644 index aeabe40a9..000000000 --- a/static/layui/lay/modules/tree.js +++ /dev/null @@ -1,2 +0,0 @@ -/** layui-v2.2.5 MIT License By https://www.layui.com */ - ;layui.define("jquery",function(e){"use strict";var o=layui.$,a=layui.hint(),i="layui-tree-enter",r=function(e){this.options=e},t={arrow:["",""],checkbox:["",""],radio:["",""],branch:["",""],leaf:""};r.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},r.prototype.tree=function(e,a){var i=this,r=i.options,n=a||r.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o('
                                        '),s=o(["
                                      • ",function(){return l?''+(n.spread?t.arrow[1]:t.arrow[0])+"":""}(),function(){return r.check?''+("checkbox"===r.check?t.checkbox[0]:"radio"===r.check?t.radio[0]:"")+"":""}(),function(){return'"+(''+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"")+(""+(n.name||"未命名")+"")}(),"
                                      • "].join(""));l&&(s.append(c),i.tree(c,n.children)),e.append(s),"function"==typeof r.click&&i.click(s,n),i.spread(s,n),r.drag&&i.drag(s,n)})},r.prototype.click=function(e,o){var a=this,i=a.options;e.children("a").on("click",function(e){layui.stope(e),i.click(o)})},r.prototype.spread=function(e,o){var a=this,i=(a.options,e.children(".layui-tree-spread")),r=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),r.removeClass("layui-show"),i.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),r.addClass("layui-show"),i.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};r[0]&&(i.on("click",l),n.on("dblclick",l))},r.prototype.on=function(e){var a=this,r=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),r.drag&&o(document).on("mousemove",function(e){var i=a.move;if(i.from){var r=(i.to,o('
                                        '));e.preventDefault(),o("."+t)[0]||o("body").append(r);var n=o("."+t)[0]?o("."+t):r;n.addClass("layui-show").html(i.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(i),e.to&&e.to.elem.children("a").removeClass(i),a.move={},o("."+t).remove())})},r.prototype.move={},r.prototype.drag=function(e,a){var r=this,t=(r.options,e.children("a")),n=function(){var t=o(this),n=r.move;n.from&&(n.to={item:a,elem:e},t.addClass(i))};t.on("mousedown",function(){var o=r.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=r.move;a.from&&(delete a.to,e.removeClass(i))})},e("tree",function(e){var i=new r(e=e||{}),t=o(e.elem);return t[0]?void i.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})}); \ No newline at end of file diff --git a/static/layui/lay/modules/upload.js b/static/layui/lay/modules/upload.js deleted file mode 100644 index 4fbf66e98..000000000 --- a/static/layui/lay/modules/upload.js +++ /dev/null @@ -1,2 +0,0 @@ -/** layui-v2.2.5 MIT License By https://www.layui.com */ - ;layui.define("layer",function(e){"use strict";var i=layui.$,t=layui.layer,n=layui.hint(),a=layui.device(),o={config:{},set:function(e){var t=this;return t.config=i.extend({},t.config,e),t},on:function(e,i){return layui.onevent.call(this,r,e,i)}},l=function(){var e=this;return{upload:function(i){e.upload.call(e,i)},config:e.config}},r="upload",u="layui-upload-file",c="layui-upload-form",f="layui-upload-iframe",s="layui-upload-choose",p=function(e){var t=this;t.config=i.extend({},t.config,o.config,e),t.render()};p.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",field:"file",method:"post",data:{},drag:!0,size:0,number:0,multiple:!1},p.prototype.render=function(e){var t=this,e=t.config;e.elem=i(e.elem),e.bindAction=i(e.bindAction),t.file(),t.events()},p.prototype.file=function(){var e=this,t=e.config,n=e.elemFile=i(['"].join("")),o=t.elem.next();(o.hasClass(u)||o.hasClass(c))&&o.remove(),a.ie&&a.ie<10&&t.elem.wrap('
                                        '),e.isFile()?(e.elemFile=t.elem,t.field=t.elem[0].name):t.elem.after(n),a.ie&&a.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,t=e.config,n=i(''),a=i(['
                                        ',"
                                        "].join(""));i("#"+f)[0]||i("body").append(n),t.elem.next().hasClass(f)||(e.elemFile.wrap(a),t.elem.next("."+f).append(function(){var e=[];return layui.each(t.data,function(i,t){e.push('')}),e.join("")}()))},p.prototype.msg=function(e){return t.msg(e,{icon:2,shift:6})},p.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},p.prototype.preview=function(e){var i=this;window.FileReader&&layui.each(i.chooseFiles,function(i,t){var n=new FileReader;n.readAsDataURL(t),n.onload=function(){e&&e(i,t,this.result)}})},p.prototype.upload=function(e,t){var n,o=this,l=o.config,r=o.elemFile[0],u=function(){var t=0,n=0,a=e||o.files||o.chooseFiles||r.files,u=function(){l.multiple&&t+n===o.fileLength&&"function"==typeof l.allDone&&l.allDone({total:o.fileLength,successful:t,aborted:n})};layui.each(a,function(e,a){var r=new FormData;r.append(l.field,a),layui.each(l.data,function(e,i){r.append(e,i)}),i.ajax({url:l.url,type:l.method,data:r,contentType:!1,processData:!1,dataType:"json",success:function(i){t++,d(e,i),u()},error:function(){n++,o.msg("请求上传接口出现异常"),m(e),u()}})})},c=function(){var e=i("#"+f);o.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var i,t=e.contents().find("body");try{i=t.text()}catch(n){o.msg("获取上传后的响应信息出现异常"),clearInterval(p.timer),m()}i&&(clearInterval(p.timer),t.html(""),d(0,i))},30)},d=function(e,i){if(o.elemFile.next("."+s).remove(),r.value="","object"!=typeof i)try{i=JSON.parse(i)}catch(t){return i={},o.msg("请对上传接口返回有效JSON")}"function"==typeof l.done&&l.done(i,e||0,function(e){o.upload(e)})},m=function(e){l.auto&&(r.value=""),"function"==typeof l.error&&l.error(e||0,function(e){o.upload(e)})},h=l.exts,v=function(){var i=[];return layui.each(e||o.chooseFiles,function(e,t){i.push(t.name)}),i}(),g={preview:function(e){o.preview(e)},upload:function(e,i){var t={};t[e]=i,o.upload(t)},pushFile:function(){return o.files=o.files||{},layui.each(o.chooseFiles,function(e,i){o.files[e]=i}),o.files}},y=function(){return"choose"===t?l.choose&&l.choose(g):(l.before&&l.before(g),a.ie?a.ie>9?u():c():void u())};if(v=0===v.length?r.value.match(/[^\/\\]+\..+/g)||[]||"":v,0!==v.length){switch(l.accept){case"file":if(h&&!RegExp("\\w\\.("+h+")$","i").test(escape(v)))return o.msg("选择的文件中包含不支持的格式"),r.value="";break;case"video":if(!RegExp("\\w\\.("+(h||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(v)))return o.msg("选择的视频中包含不支持的格式"),r.value="";break;case"audio":if(!RegExp("\\w\\.("+(h||"mp3|wav|mid")+")$","i").test(escape(v)))return o.msg("选择的音频中包含不支持的格式"),r.value="";break;default:if(layui.each(v,function(e,i){RegExp("\\w\\.("+(h||"jpg|png|gif|bmp|jpeg$")+")","i").test(escape(i))||(n=!0)}),n)return o.msg("选择的图片中包含不支持的格式"),r.value=""}if(o.fileLength=function(){var i=0,t=e||o.files||o.chooseFiles||r.files;return layui.each(t,function(){i++}),i}(),l.number&&o.fileLength>l.number)return o.msg("同时最多只能上传的数量为:"+l.number);if(l.size>0&&!(a.ie&&a.ie<10)){var F;if(layui.each(o.chooseFiles,function(e,i){if(i.size>1024*l.size){var t=l.size/1024;t=t>=1?Math.floor(t)+(t%1>0?t.toFixed(1):0)+"MB":l.size+"KB",r.value="",F=t}}),F)return o.msg("文件不能超过"+F)}y()}},p.prototype.events=function(){var e=this,t=e.config,o=function(i){e.chooseFiles={},layui.each(i,function(i,t){var n=(new Date).getTime();e.chooseFiles[n+"-"+i]=t})},l=function(i,n){var a=e.elemFile,o=i.length>1?i.length+"个文件":(i[0]||{}).name||a[0].value.match(/[^\/\\]+\..+/g)||[]||"";a.next().hasClass(s)&&a.next().remove(),e.upload(null,"choose"),e.isFile()||t.choose||a.after(''+o+"")};t.elem.off("upload.start").on("upload.start",function(){var a=i(this),o=a.attr("lay-data");if(o)try{o=new Function("return "+o)(),e.config=i.extend({},t,o)}catch(l){n.error("Upload element property lay-data configuration item has a syntax error: "+o)}e.config.item=a,e.elemFile[0].click()}),a.ie&&a.ie<10||t.elem.off("upload.over").on("upload.over",function(){var e=i(this);e.attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){var e=i(this);e.removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(n,a){var r=i(this),u=a.originalEvent.dataTransfer.files||[];r.removeAttr("lay-over"),o(u),t.auto?e.upload(u):l(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var i=this.files||[];o(i),t.auto?e.upload():l(i)}),t.bindAction.off("upload.action").on("upload.action",function(){e.upload()}),t.elem.data("haveEvents")||(e.elemFile.on("change",function(){i(this).trigger("upload.change")}),t.elem.on("click",function(){e.isFile()||i(this).trigger("upload.start")}),t.drag&&t.elem.on("dragover",function(e){e.preventDefault(),i(this).trigger("upload.over")}).on("dragleave",function(e){i(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),i(this).trigger("upload.drop",e)}),t.bindAction.on("click",function(){i(this).trigger("upload.action")}),t.elem.data("haveEvents",!0))},o.render=function(e){var i=new p(e);return l.call(i)},e(r,o)}); \ No newline at end of file diff --git a/static/layui/lay/modules/util.js b/static/layui/lay/modules/util.js deleted file mode 100644 index 3a29621ae..000000000 --- a/static/layui/lay/modules/util.js +++ /dev/null @@ -1,2 +0,0 @@ -/** layui-v2.2.5 MIT License By https://www.layui.com */ - ;layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,o,a="layui-fixbar",r="layui-fixbar-top",n=t(document),l=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"":e.bar1,e.bar2=e.bar2===!0?"":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,""],g=t(['
                                          ',e.bar1?'
                                        • '+c[0]+"
                                        • ":"",e.bar2?'
                                        • '+c[1]+"
                                        • ":"",'
                                        • '+c[2]+"
                                        • ","
                                        "].join("")),s=g.find("."+r),u=function(){var t=n.scrollTop();t>=e.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};t("."+a)[0]||("object"==typeof e.css&&g.css(e.css),l.append(g),u(),g.find("li").on("click",function(){var i=t(this),o=i.attr("lay-type");"top"===o&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,o)}),n.on("scroll",function(){clearTimeout(o),o=setTimeout(function(){u()},100)}))},countdown:function(e,t,i){var o=this,a="function"==typeof t,r=new Date(e).getTime(),n=new Date(!t||a?(new Date).getTime():t).getTime(),l=r-n,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=t);var g=setTimeout(function(){o.countdown(e,n+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,g),l<=0&&clearTimeout(g),g},timeAgo:function(e,t){var i=this,o=[[],[]],a=(new Date).getTime()-new Date(e).getTime();return a>6912e5?(a=new Date(e),o[0][0]=i.digit(a.getFullYear(),4),o[0][1]=i.digit(a.getMonth()+1),o[0][2]=i.digit(a.getDate()),t||(o[1][0]=i.digit(a.getHours()),o[1][1]=i.digit(a.getMinutes()),o[1][2]=i.digit(a.getSeconds())),o[0].join("-")+" "+o[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=12e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var o=e.length;o0;r--)if("interactive"===n[r].readyState){e=n[r].src;break}return e||n[o].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),a=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},i="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",tree:"modules/tree",table:"modules/table",element:"modules/element",util:"modules/util",flow:"modules/flow",carousel:"modules/carousel",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};o.prototype.cache=n,o.prototype.define=function(e,t){var o=this,r="function"==typeof e,a=function(){var e=function(e,t){layui[e]=t,n.status[e]=!0};return"function"==typeof t&&t(function(o,r){e(o,r),n.callback[o]=function(){t(e)}}),this};return r&&(t=e,e=[]),layui["layui.all"]||!layui["layui.all"]&&layui["layui.mobile"]?a.call(o):(o.use(e,a),o)},o.prototype.use=function(e,o,l){function s(e,t){var o="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||o.test((e.currentTarget||e.srcElement).readyState))&&(n.modules[f]=t,d.removeChild(v),function r(){return++m>1e3*n.timeout/4?a(f+" is not a valid module"):void(n.status[f]?c():setTimeout(r,4))}())}function c(){l.push(layui[f]),e.length>1?y.use(e.slice(1),o,l):"function"==typeof o&&o.apply(layui,l)}var y=this,p=n.dir=n.dir?n.dir:r,d=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,n){"jquery"===n&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],n.host=n.host||(p.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[f]||!layui["layui.all"]&&layui["layui.mobile"]&&u[f])return c(),y;if(n.modules[f])!function g(){return++m>1e3*n.timeout/4?a(f+" is not a valid module"):void("string"==typeof n.modules[f]&&n.status[f]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[f]?p+"lay/":/^\{\/\}/.test(y.modules[f])?"":n.base||"")+(y.modules[f]||f)+".js";h=h.replace(/^\{\/\}/,""),v.async=!0,v.charset="utf-8",v.src=h+function(){var e=n.version===!0?n.v||(new Date).getTime():n.version||"";return e?"?v="+e:""}(),d.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||i?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),n.modules[f]=h}return y},o.prototype.getStyle=function(t,n){var o=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return o[o.getPropertyValue?"getPropertyValue":"getAttribute"](n)},o.prototype.link=function(e,o,r){var i=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof o&&(r=o);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(n.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof o?i:(function p(){return++y>1e3*n.timeout/100?a(e+" timeout"):void(1989===parseInt(i.getStyle(t.getElementById(c),"width"))?function(){o()}():setTimeout(p,100))}(),i)},n.callback={},o.prototype.factory=function(e){if(layui[e])return"function"==typeof n.callback[e]?n.callback[e]:null},o.prototype.addcss=function(e,t,o){return layui.link(n.dir+"css/"+e,t,o)},o.prototype.img=function(e,t,n){var o=new Image;return o.src=e,o.complete?t(o):(o.onload=function(){o.onload=null,t(o)},void(o.onerror=function(e){o.onerror=null,n(e)}))},o.prototype.config=function(e){e=e||{};for(var t in e)n[t]=e[t];return this},o.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),o.prototype.extend=function(e){var t=this;e=e||{};for(var n in e)t[n]||t.modules[n]?a("模块名 "+n+" 已被占用"):t.modules[n]=e[n];return t},o.prototype.router=function(e){var t=this,e=e||location.hash,n={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(n.href=e=e.replace(/^#\//,""),e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),n.search[t[0]]=t[1]}():n.path.push(t)}),n):n},o.prototype.data=function(t,n,o){if(t=t||"layui",o=o||localStorage,e.JSON&&e.JSON.parse){if(null===n)return delete o[t];n="object"==typeof n?n:{key:n};try{var r=JSON.parse(o[t])}catch(a){var r={}}return"value"in n&&(r[n.key]=n.value),n.remove&&delete r[n.key],o[t]=JSON.stringify(r),n.key?r[n.key]:r}},o.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},o.prototype.device=function(t){var n=navigator.userAgent.toLowerCase(),o=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(n.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(n)?"windows":/linux/.test(n)?"linux":/iphone|ipod|ipad|ios/.test(n)?"ios":/mac/.test(n)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((n.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:o("micromessenger")};return t&&!r[t]&&(r[t]=o(t)),r.android=/android/.test(n),r.ios="ios"===r.os,r},o.prototype.hint=function(){return{error:a}},o.prototype.each=function(e,t){var n,o=this;if("function"!=typeof t)return o;if(e=e||[],e.constructor===Object){for(n in e)if(t.call(e[n],n,e[n]))break}else for(n=0;na?1:r/g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)});layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),skip:function(){return['到第','','页',""].join("")}()};return['
                                        ',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
                                        "].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)});!function(){"use strict";var e=window.layui&&layui.define,t={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,n=t.length-1,a=n;a>0;a--)if("interactive"===t[a].readyState){e=t[a].src;break}return e||t[n].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),getStyle:function(e,t){var n=e.currentStyle?e.currentStyle:window.getComputedStyle(e,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](t)},link:function(e,a,i){if(n.path){var r=document.getElementsByTagName("head")[0],o=document.createElement("link");"string"==typeof a&&(i=a);var s=(i||e).replace(/\.|\//g,""),l="layuicss-"+s,d=0;o.rel="stylesheet",o.href=n.path+e,o.id=l,document.getElementById(l)||r.appendChild(o),"function"==typeof a&&!function c(){return++d>80?window.console&&console.error("laydate.css: Invalid"):void(1989===parseInt(t.getStyle(document.getElementById(l),"width"))?a():setTimeout(c,100))}()}}},n={v:"5.0.9",config:{},index:window.laydate&&window.laydate.v?1e5:0,path:t.getPath,set:function(e){var t=this;return t.config=w.extend({},t.config,e),t},ready:function(a){var i="laydate",r="",o=(e?"modules/laydate/":"theme/")+"default/laydate.css?v="+n.v+r;return e?layui.addcss(o,a,i):t.link(o,a,i),this}},a=function(){var e=this;return{hint:function(t){e.hint.call(e,t)},config:e.config}},i="laydate",r=".layui-laydate",o="layui-this",s="laydate-disabled",l="开始日期超出了结束日期
                                        建议重新选择",d=[100,2e5],c="layui-laydate-static",m="layui-laydate-list",u="laydate-selected",h="layui-laydate-hint",y="laydate-day-prev",f="laydate-day-next",p="layui-laydate-footer",g=".laydate-btns-confirm",v="laydate-time-text",D=".laydate-btns-time",T=function(e){var t=this;t.index=++n.index,t.config=w.extend({},t.config,n.config,e),n.ready(function(){t.init()})},w=function(e){return new C(e)},C=function(e){for(var t=0,n="object"==typeof e?[e]:(this.selector=e,document.querySelectorAll(e||null));t0)return n[0].getAttribute(e)}():n.each(function(n,a){a.setAttribute(e,t)})},C.prototype.removeAttr=function(e){return this.each(function(t,n){n.removeAttribute(e)})},C.prototype.html=function(e){return this.each(function(t,n){n.innerHTML=e})},C.prototype.val=function(e){return this.each(function(t,n){n.value=e})},C.prototype.append=function(e){return this.each(function(t,n){"object"==typeof e?n.appendChild(e):n.innerHTML=n.innerHTML+e})},C.prototype.remove=function(e){return this.each(function(t,n){e?n.removeChild(e):n.parentNode.removeChild(n)})},C.prototype.on=function(e,t){return this.each(function(n,a){a.attachEvent?a.attachEvent("on"+e,function(e){e.target=e.srcElement,t.call(a,e)}):a.addEventListener(e,t,!1)})},C.prototype.off=function(e,t){return this.each(function(n,a){a.detachEvent?a.detachEvent("on"+e,t):a.removeEventListener(e,t,!1)})},T.isLeapYear=function(e){return e%4===0&&e%100!==0||e%400===0},T.prototype.config={type:"date",range:!1,format:"yyyy-MM-dd",value:null,min:"1900-1-1",max:"2099-12-31",trigger:"focus",show:!1,showBottom:!0,btns:["clear","now","confirm"],lang:"cn",theme:"default",position:null,calendar:!1,mark:{},zIndex:null,done:null,change:null},T.prototype.lang=function(){var e=this,t=e.config,n={cn:{weeks:["日","一","二","三","四","五","六"],time:["时","分","秒"],timeTips:"选择时间",startTime:"开始时间",endTime:"结束时间",dateTips:"返回日期",month:["一","二","三","四","五","六","七","八","九","十","十一","十二"],tools:{confirm:"确定",clear:"清空",now:"现在"}},en:{weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],time:["Hours","Minutes","Seconds"],timeTips:"Select Time",startTime:"Start Time",endTime:"End Time",dateTips:"Select Date",month:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tools:{confirm:"Confirm",clear:"Clear",now:"Now"}}};return n[t.lang]||n.cn},T.prototype.init=function(){var e=this,t=e.config,n="yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s",a="static"===t.position,i={year:"yyyy",month:"yyyy-MM",date:"yyyy-MM-dd",time:"HH:mm:ss",datetime:"yyyy-MM-dd HH:mm:ss"};t.elem=w(t.elem),t.eventElem=w(t.eventElem),t.elem[0]&&(t.range===!0&&(t.range="-"),t.format===i.date&&(t.format=i[t.type]),e.format=t.format.match(new RegExp(n+"|.","g"))||[],e.EXP_IF="",e.EXP_SPLIT="",w.each(e.format,function(t,a){var i=new RegExp(n).test(a)?"\\d{"+function(){return new RegExp(n).test(e.format[0===t?t+1:t-1]||"")?/^yyyy|y$/.test(a)?4:a.length:/^yyyy$/.test(a)?"1,4":/^y$/.test(a)?"1,308":"1,2"}()+"}":"\\"+a;e.EXP_IF=e.EXP_IF+i,e.EXP_SPLIT=e.EXP_SPLIT+"("+i+")"}),e.EXP_IF=new RegExp("^"+(t.range?e.EXP_IF+"\\s\\"+t.range+"\\s"+e.EXP_IF:e.EXP_IF)+"$"),e.EXP_SPLIT=new RegExp("^"+e.EXP_SPLIT+"$",""),e.isInput(t.elem[0])||"focus"===t.trigger&&(t.trigger="click"),t.elem.attr("lay-key")||(t.elem.attr("lay-key",e.index),t.eventElem.attr("lay-key",e.index)),t.mark=w.extend({},t.calendar&&"cn"===t.lang?{"0-1-1":"元旦","0-2-14":"情人","0-3-8":"妇女","0-3-12":"植树","0-4-1":"愚人","0-5-1":"劳动","0-5-4":"青年","0-6-1":"儿童","0-9-10":"教师","0-9-18":"国耻","0-10-1":"国庆","0-12-25":"圣诞"}:{},t.mark),w.each(["min","max"],function(e,n){var a=[],i=[];if("number"==typeof t[n]){var r=t[n],o=(new Date).getTime(),s=864e5,l=new Date(r?r0)return!0;var a=w.elem("div",{"class":"layui-laydate-header"}),i=[function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-y"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-m"});return e.innerHTML="",e}(),function(){var e=w.elem("div",{"class":"laydate-set-ym"}),t=w.elem("span"),n=w.elem("span");return e.appendChild(t),e.appendChild(n),e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-m"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-y"});return e.innerHTML="",e}()],d=w.elem("div",{"class":"layui-laydate-content"}),c=w.elem("table"),m=w.elem("thead"),u=w.elem("tr");w.each(i,function(e,t){a.appendChild(t)}),m.appendChild(u),w.each(new Array(6),function(e){var t=c.insertRow(0);w.each(new Array(7),function(a){if(0===e){var i=w.elem("th");i.innerHTML=n.weeks[a],u.appendChild(i)}t.insertCell(a)})}),c.insertBefore(m,c.children[0]),d.appendChild(c),r[e]=w.elem("div",{"class":"layui-laydate-main laydate-main-list-"+e}),r[e].appendChild(a),r[e].appendChild(d),o.push(i),s.push(d),l.push(c)}),w(d).html(function(){var e=[],i=[];return"datetime"===t.type&&e.push(''+n.timeTips+""),w.each(t.btns,function(e,r){var o=n.tools[r]||"btn";t.range&&"now"===r||(a&&"clear"===r&&(o="cn"===t.lang?"重置":"Reset"),i.push(''+o+""))}),e.push('"),e.join("")}()),w.each(r,function(e,t){i.appendChild(t)}),t.showBottom&&i.appendChild(d),/^#/.test(t.theme)){var m=w.elem("style"),u=["#{{id}} .layui-laydate-header{background-color:{{theme}};}","#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g,e.elemID).replace(/{{theme}}/g,t.theme);"styleSheet"in m?(m.setAttribute("type","text/css"),m.styleSheet.cssText=u):m.innerHTML=u,w(i).addClass("laydate-theme-molv"),i.appendChild(m)}e.remove(T.thisElemDate),a?t.elem.append(i):(document.body.appendChild(i),e.position()),e.checkDate().calendar(),e.changeEvent(),T.thisElemDate=e.elemID,"function"==typeof t.ready&&t.ready(w.extend({},t.dateTime,{month:t.dateTime.month+1}))},T.prototype.remove=function(e){var t=this,n=(t.config,w("#"+(e||t.elemID)));return n.hasClass(c)||t.checkDate(function(){n.remove()}),t},T.prototype.position=function(){var e=this,t=e.config,n=e.bindElem||t.elem[0],a=n.getBoundingClientRect(),i=e.elem.offsetWidth,r=e.elem.offsetHeight,o=function(e){return e=e?"scrollLeft":"scrollTop",document.body[e]|document.documentElement[e]},s=function(e){return document.documentElement[e?"clientWidth":"clientHeight"]},l=5,d=a.left,c=a.bottom;d+i+l>s("width")&&(d=s("width")-i-l),c+r+l>s()&&(c=a.top>r?a.top-r:s()-r,c-=2*l),t.position&&(e.elem.style.position=t.position),e.elem.style.left=d+("fixed"===t.position?0:o(1))+"px",e.elem.style.top=c+("fixed"===t.position?0:o())+"px"},T.prototype.hint=function(e){var t=this,n=(t.config,w.elem("div",{"class":h}));n.innerHTML=e||"",w(t.elem).find("."+h).remove(),t.elem.appendChild(n),clearTimeout(t.hinTimer),t.hinTimer=setTimeout(function(){w(t.elem).find("."+h).remove()},3e3)},T.prototype.getAsYM=function(e,t,n){return n?t--:t++,t<0&&(t=11,e--),t>11&&(t=0,e++),[e,t]},T.prototype.systemDate=function(e){var t=e||new Date;return{year:t.getFullYear(),month:t.getMonth(),date:t.getDate(),hours:e?e.getHours():0,minutes:e?e.getMinutes():0,seconds:e?e.getSeconds():0}},T.prototype.checkDate=function(e){var t,a,i=this,r=(new Date,i.config),o=r.dateTime=r.dateTime||i.systemDate(),s=i.bindElem||r.elem[0],l=(i.isInput(s)?"val":"html",i.isInput(s)?s.value:"static"===r.position?"":s.innerHTML),c=function(e){e.year>d[1]&&(e.year=d[1],a=!0),e.month>11&&(e.month=11,a=!0),e.hours>23&&(e.hours=0,a=!0),e.minutes>59&&(e.minutes=0,e.hours++,a=!0),e.seconds>59&&(e.seconds=0,e.minutes++,a=!0),t=n.getEndDate(e.month+1,e.year),e.date>t&&(e.date=t,a=!0)},m=function(e,t,n){var o=["startTime","endTime"];t=(t.match(i.EXP_SPLIT)||[]).slice(1),n=n||0,r.range&&(i[o[n]]=i[o[n]]||{}),w.each(i.format,function(s,l){var c=parseFloat(t[s]);t[s].length必须遵循下述格式:
                                        "+(r.range?r.format+" "+r.range+" "+r.format:r.format)+"
                                        已为你重置"),a=!0):l&&l.constructor===Date?r.dateTime=i.systemDate(l):(r.dateTime=i.systemDate(),delete i.startState,delete i.endState,delete i.startDate,delete i.endDate,delete i.startTime,delete i.endTime),c(o),a&&l&&i.setValue(r.range?i.endDate?i.parse():"":i.parse()),e&&e(),i)},T.prototype.mark=function(e,t){var n,a=this,i=a.config;return w.each(i.mark,function(e,a){var i=e.split("-");i[0]!=t[0]&&0!=i[0]||i[1]!=t[1]&&0!=i[1]||i[2]!=t[2]||(n=a||t[2])}),n&&e.html(''+n+""),a},T.prototype.limit=function(e,t,n,a){var i,r=this,o=r.config,l={},d=o[n>41?"endDate":"dateTime"],c=w.extend({},d,t||{});return w.each({now:c,min:o.min,max:o.max},function(e,t){l[e]=r.newDate(w.extend({year:t.year,month:t.month,date:t.date},function(){var e={};return w.each(a,function(n,a){e[a]=t[a]}),e}())).getTime()}),i=l.nowl.max,e&&e[i?"addClass":"removeClass"](s),i},T.prototype.calendar=function(e){var t,a,i,r=this,s=r.config,l=e||s.dateTime,c=new Date,m=r.lang(),u="date"!==s.type&&"datetime"!==s.type,h=e?1:0,y=w(r.table[h]).find("td"),f=w(r.elemHeader[h][2]).find("span");if(l.yeard[1]&&(l.year=d[1],r.hint("最高只能支持到公元"+d[1]+"年")),r.firstDate||(r.firstDate=w.extend({},l)),c.setFullYear(l.year,l.month,1),t=c.getDay(),a=n.getEndDate(l.month||12,l.year),i=n.getEndDate(l.month+1,l.year),w.each(y,function(e,n){var d=[l.year,l.month],c=0;n=w(n),n.removeAttr("class"),e=t&&e=n.firstDate.year&&(r.month=a.max.month,r.date=a.max.date),n.limit(w(i),r,t),M++}),w(u[f?0:1]).attr("lay-ym",M-8+"-"+T[1]).html(b+p+" - "+(M-1+p))}else if("month"===e)w.each(new Array(12),function(e){var i=w.elem("li",{"lay-ym":e}),s={year:T[0],month:e};e+1==T[1]&&w(i).addClass(o),i.innerHTML=r.month[e]+(f?"月":""),d.appendChild(i),T[0]=n.firstDate.year&&(s.date=a.max.date),n.limit(w(i),s,t)}),w(u[f?0:1]).attr("lay-ym",T[0]+"-"+T[1]).html(T[0]+p);else if("time"===e){var E=function(){w(d).find("ol").each(function(e,a){w(a).find("li").each(function(a,i){n.limit(w(i),[{hours:a},{hours:n[x].hours,minutes:a},{hours:n[x].hours,minutes:n[x].minutes,seconds:a}][e],t,[["hours"],["hours","minutes"],["hours","minutes","seconds"]][e])})}),a.range||n.limit(w(n.footer).find(g),n[x],0,["hours","minutes","seconds"])};a.range?n[x]||(n[x]={hours:0,minutes:0,seconds:0}):n[x]=i,w.each([24,60,60],function(e,t){var a=w.elem("li"),i=["

                                        "+r.time[e]+"

                                          "];w.each(new Array(t),function(t){i.push(""+w.digit(t,2)+"")}),a.innerHTML=i.join("")+"
                                        ",d.appendChild(a)}),E()}if(y&&h.removeChild(y),h.appendChild(d),"year"===e||"month"===e)w(n.elemMain[t]).addClass("laydate-ym-show"),w(d).find("li").on("click",function(){var r=0|w(this).attr("lay-ym");if(!w(this).hasClass(s)){if(0===t)i[e]=r,l&&(n.startDate[e]=r),n.limit(w(n.footer).find(g),null,0);else if(l)n.endDate[e]=r;else{var c="year"===e?n.getAsYM(r,T[1]-1,"sub"):n.getAsYM(T[0],r,"sub");w.extend(i,{year:c[0],month:c[1]})}"year"===a.type||"month"===a.type?(w(d).find("."+o).removeClass(o),w(this).addClass(o),"month"===a.type&&"year"===e&&(n.listYM[t][0]=r,l&&(n[["startDate","endDate"][t]].year=r),n.list("month",t))):(n.checkDate("limit").calendar(),n.closeList()),n.setBtnStatus(),a.range||n.done(null,"change"),w(n.footer).find(D).removeClass(s)}});else{var S=w.elem("span",{"class":v}),k=function(){w(d).find("ol").each(function(e){var t=this,a=w(t).find("li");t.scrollTop=30*(n[x][C[e]]-2),t.scrollTop<=0&&a.each(function(e,n){if(!w(this).hasClass(s))return t.scrollTop=30*(e-2),!0})})},H=w(c[2]).find("."+v);k(),S.innerHTML=a.range?[r.startTime,r.endTime][t]:r.timeTips,w(n.elemMain[t]).addClass("laydate-time-show"),H[0]&&H.remove(),c[2].appendChild(S),w(d).find("ol").each(function(e){var t=this;w(t).find("li").on("click",function(){var r=0|this.innerHTML;w(this).hasClass(s)||(a.range?n[x][C[e]]=r:i[C[e]]=r,w(t).find("."+o).removeClass(o),w(this).addClass(o),E(),k(),(n.endDate||"time"===a.type)&&n.done(null,"change"),n.setBtnStatus())})})}return n},T.prototype.listYM=[],T.prototype.closeList=function(){var e=this;e.config;w.each(e.elemCont,function(t,n){w(this).find("."+m).remove(),w(e.elemMain[t]).removeClass("laydate-ym-show laydate-time-show")}),w(e.elem).find("."+v).remove()},T.prototype.setBtnStatus=function(e,t,n){var a,i=this,r=i.config,o=w(i.footer).find(g),d=r.range&&"date"!==r.type&&"time"!==r.type;d&&(t=t||i.startDate,n=n||i.endDate,a=i.newDate(t).getTime()>i.newDate(n).getTime(),i.limit(null,t)||i.limit(null,n)?o.addClass(s):o[a?"addClass":"removeClass"](s),e&&a&&i.hint("string"==typeof e?l.replace(/日期/g,e):l))},T.prototype.parse=function(e,t){var n=this,a=n.config,i=t||(e?w.extend({},n.endDate,n.endTime):a.range?w.extend({},n.startDate,n.startTime):a.dateTime),r=n.format.concat();return w.each(r,function(e,t){/yyyy|y/.test(t)?r[e]=w.digit(i.year,t.length):/MM|M/.test(t)?r[e]=w.digit(i.month+1,t.length):/dd|d/.test(t)?r[e]=w.digit(i.date,t.length):/HH|H/.test(t)?r[e]=w.digit(i.hours,t.length):/mm|m/.test(t)?r[e]=w.digit(i.minutes,t.length):/ss|s/.test(t)&&(r[e]=w.digit(i.seconds,t.length))}),a.range&&!e?r.join("")+" "+a.range+" "+n.parse(1):r.join("")},T.prototype.newDate=function(e){return e=e||{},new Date(e.year||1,e.month||0,e.date||1,e.hours||0,e.minutes||0,e.seconds||0)},T.prototype.setValue=function(e){var t=this,n=t.config,a=t.bindElem||n.elem[0],i=t.isInput(a)?"val":"html";return"static"===n.position||w(a)[i](e||""),this},T.prototype.stampRange=function(){var e,t,n=this,a=n.config,i=w(n.elem).find("td");if(a.range&&!n.endDate&&w(n.footer).find(g).addClass(s),n.endDate)return e=n.newDate({year:n.startDate.year,month:n.startDate.month,date:n.startDate.date}).getTime(),t=n.newDate({year:n.endDate.year,month:n.endDate.month,date:n.endDate.date}).getTime(),e>t?n.hint(l):void w.each(i,function(a,i){var r=w(i).attr("lay-ymd").split("-"),s=n.newDate({year:r[0],month:r[1]-1,date:r[2]}).getTime();w(i).removeClass(u+" "+o),s!==e&&s!==t||w(i).addClass(w(i).hasClass(y)||w(i).hasClass(f)?u:o),s>e&&s0&&t-1 in e)}function r(e,t,n){if(pe.isFunction(t))return pe.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return pe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Ce.test(t))return pe.filter(t,e,n);t=pe.filter(t,e)}return pe.grep(e,function(e){return pe.inArray(e,t)>-1!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t={};return pe.each(e.match(De)||[],function(e,n){t[n]=!0}),t}function a(){re.addEventListener?(re.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s)):(re.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(re.addEventListener||"load"===e.event.type||"complete"===re.readyState)&&(a(),pe.ready())}function u(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(_e,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:qe.test(n)?pe.parseJSON(n):n)}catch(i){}pe.data(e,t,n)}else n=void 0}return n}function l(e){var t;for(t in e)if(("data"!==t||!pe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(He(e)){var i,o,a=pe.expando,s=e.nodeType,u=s?pe.cache:e,l=s?e[a]:e[a]&&a;if(l&&u[l]&&(r||u[l].data)||void 0!==n||"string"!=typeof t)return l||(l=s?e[a]=ne.pop()||pe.guid++:a),u[l]||(u[l]=s?{}:{toJSON:pe.noop}),"object"!=typeof t&&"function"!=typeof t||(r?u[l]=pe.extend(u[l],t):u[l].data=pe.extend(u[l].data,t)),o=u[l],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[pe.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[pe.camelCase(t)])):i=o,i}}function f(e,t,n){if(He(e)){var r,i,o=e.nodeType,a=o?pe.cache:e,s=o?e[pe.expando]:pe.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){pe.isArray(t)?t=t.concat(pe.map(t,pe.camelCase)):t in r?t=[t]:(t=pe.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!l(r):!pe.isEmptyObject(r))return}(n||(delete a[s].data,l(a[s])))&&(o?pe.cleanData([e],!0):fe.deleteExpando||a!=a.window?delete a[s]:a[s]=void 0)}}}function d(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return pe.css(e,t,"")},u=s(),l=n&&n[3]||(pe.cssNumber[t]?"":"px"),c=(pe.cssNumber[t]||"px"!==l&&+u)&&Me.exec(pe.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do o=o||".5",c/=o,pe.style(e,t,c+l);while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function p(e){var t=ze.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function h(e,t){var n,r,i=0,o="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||pe.nodeName(r,t)?o.push(r):pe.merge(o,h(r,t));return void 0===t||t&&pe.nodeName(e,t)?pe.merge([e],o):o}function g(e,t){for(var n,r=0;null!=(n=e[r]);r++)pe._data(n,"globalEval",!t||pe._data(t[r],"globalEval"))}function m(e){Be.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t,n,r,i){for(var o,a,s,u,l,c,f,d=e.length,y=p(t),v=[],x=0;x"!==f[1]||Ve.test(a)?0:u:u.firstChild,o=a&&a.childNodes.length;o--;)pe.nodeName(c=a.childNodes[o],"tbody")&&!c.childNodes.length&&a.removeChild(c);for(pe.merge(v,u.childNodes),u.textContent="";u.firstChild;)u.removeChild(u.firstChild);u=y.lastChild}else v.push(t.createTextNode(a));for(u&&y.removeChild(u),fe.appendChecked||pe.grep(h(v,"input"),m),x=0;a=v[x++];)if(r&&pe.inArray(a,r)>-1)i&&i.push(a);else if(s=pe.contains(a.ownerDocument,a),u=h(y.appendChild(a),"script"),s&&g(u),n)for(o=0;a=u[o++];)Ie.test(a.type||"")&&n.push(a);return u=null,y}function v(){return!0}function x(){return!1}function b(){try{return re.activeElement}catch(e){}}function w(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)w(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=x;else if(!i)return e;return 1===o&&(a=i,i=function(e){return pe().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=pe.guid++)),e.each(function(){pe.event.add(this,t,i,r,n)})}function T(e,t){return pe.nodeName(e,"table")&&pe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function C(e){return e.type=(null!==pe.find.attr(e,"type"))+"/"+e.type,e}function E(e){var t=it.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function N(e,t){if(1===t.nodeType&&pe.hasData(e)){var n,r,i,o=pe._data(e),a=pe._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;r1&&"string"==typeof p&&!fe.checkClone&&rt.test(p))return e.each(function(i){var o=e.eq(i);g&&(t[0]=p.call(this,i,o.html())),S(o,t,n,r)});if(f&&(l=y(t,e[0].ownerDocument,!1,e,r),i=l.firstChild,1===l.childNodes.length&&(l=i),i||r)){for(s=pe.map(h(l,"script"),C),a=s.length;c")).appendTo(t.documentElement),t=(ut[0].contentWindow||ut[0].contentDocument).document,t.write(),t.close(),n=D(e,t),ut.detach()),lt[e]=n),n}function L(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function H(e){if(e in Et)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=Ct.length;n--;)if(e=Ct[n]+t,e in Et)return e}function q(e,t){for(var n,r,i,o=[],a=0,s=e.length;a=0&&n=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==pe.type(e)||e.nodeType||pe.isWindow(e))return!1;try{if(e.constructor&&!ce.call(e,"constructor")&&!ce.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(!fe.ownFirst)for(t in e)return ce.call(e,t);for(t in e);return void 0===t||ce.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ue[le.call(e)]||"object":typeof e},globalEval:function(t){t&&pe.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ge,"ms-").replace(me,ye)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var r,i=0;if(n(e))for(r=e.length;iT.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[P]=!0,e}function i(e){var t=H.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)T.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||V)-(~e.sourceIndex||V);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function d(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,n,r){for(var i=0,o=n.length;i-1&&(r[l]=!(a[l]=f))}}else x=m(x===a?x.splice(h,x.length):x),o?o(null,a,x,u):Q.apply(a,x)})}function v(e){for(var t,n,r,i=e.length,o=T.relative[e[0].type],a=o||T.relative[" "],s=o?1:0,u=p(function(e){return e===t},a,!0),l=p(function(e){return ee(t,e)>-1},a,!0),c=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];s1&&h(c),s>1&&d(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,s0,o=e.length>0,a=function(r,a,s,u,l){var c,f,d,p=0,h="0",g=r&&[],y=[],v=A,x=r||o&&T.find.TAG("*",l),b=W+=null==v?1:Math.random()||.1,w=x.length;for(l&&(A=a===H||a||l);h!==w&&null!=(c=x[h]);h++){if(o&&c){for(f=0,a||c.ownerDocument===H||(L(c),s=!_);d=e[f++];)if(d(c,a||H,s)){u.push(c);break}l&&(W=b)}i&&((c=!d&&c)&&p--,r&&g.push(c))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(g,y,a,s);if(r){if(p>0)for(;h--;)g[h]||y[h]||(y[h]=G.call(u));y=m(y)}Q.apply(u,y),l&&!r&&y.length>0&&p+n.length>1&&t.uniqueSort(u)}return l&&(W=b,A=v),g};return i?r(a):a}var b,w,T,C,E,N,k,S,A,D,j,L,H,q,_,F,M,O,R,P="sizzle"+1*new Date,B=e.document,W=0,I=0,$=n(),z=n(),X=n(),U=function(e,t){return e===t&&(j=!0),0},V=1<<31,Y={}.hasOwnProperty,J=[],G=J.pop,K=J.push,Q=J.push,Z=J.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),ce=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),de=new RegExp("^"+re+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,xe=/'|\\/g,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),we=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Te=function(){L()};try{Q.apply(J=Z.call(B.childNodes),B.childNodes),J[B.childNodes.length].nodeType}catch(Ce){Q={apply:J.length?function(e,t){K.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}w=t.support={},E=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},L=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:B;return r!==H&&9===r.nodeType&&r.documentElement?(H=r,q=H.documentElement,_=!E(H),(n=H.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Te,!1):n.attachEvent&&n.attachEvent("onunload",Te)),w.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=i(function(e){return e.appendChild(H.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=me.test(H.getElementsByClassName),w.getById=i(function(e){return q.appendChild(e).id=P,!H.getElementsByName||!H.getElementsByName(P).length}),w.getById?(T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&_){var n=t.getElementById(e);return n?[n]:[]}},T.filter.ID=function(e){var t=e.replace(be,we);return function(e){return e.getAttribute("id")===t}}):(delete T.find.ID,T.filter.ID=function(e){var t=e.replace(be,we);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),T.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},T.find.CLASS=w.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&_)return t.getElementsByClassName(e)},M=[],F=[],(w.qsa=me.test(H.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&F.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||F.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+P+"-]").length||F.push("~="),e.querySelectorAll(":checked").length||F.push(":checked"),e.querySelectorAll("a#"+P+"+*").length||F.push(".#.+[+~]")}),i(function(e){var t=H.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&F.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||F.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),F.push(",.*:")})),(w.matchesSelector=me.test(O=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){w.disconnectedMatch=O.call(e,"div"),O.call(e,"[s!='']:x"),M.push("!=",oe)}),F=F.length&&new RegExp(F.join("|")),M=M.length&&new RegExp(M.join("|")),t=me.test(q.compareDocumentPosition),R=t||me.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},U=t?function(e,t){if(e===t)return j=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!w.sortDetached&&t.compareDocumentPosition(e)===n?e===H||e.ownerDocument===B&&R(B,e)?-1:t===H||t.ownerDocument===B&&R(B,t)?1:D?ee(D,e)-ee(D,t):0:4&n?-1:1)}:function(e,t){if(e===t)return j=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],u=[t];if(!i||!o)return e===H?-1:t===H?1:i?-1:o?1:D?ee(D,e)-ee(D,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===B?-1:u[r]===B?1:0},H):H},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==H&&L(e),n=n.replace(ce,"='$1']"),w.matchesSelector&&_&&!X[n+" "]&&(!M||!M.test(n))&&(!F||!F.test(n)))try{var r=O.call(e,n);if(r||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,H,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==H&&L(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==H&&L(e);var n=T.attrHandle[t.toLowerCase()],r=n&&Y.call(T.attrHandle,t.toLowerCase())?n(e,t,!_):void 0;return void 0!==r?r:w.attributes||!_?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!w.detectDuplicates,D=!w.sortStable&&e.slice(0),e.sort(U),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return D=null,e},C=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=C(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=C(t);return n},T=t.selectors={cacheLength:50,createPseudo:r,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,we),e[3]=(e[3]||e[4]||e[5]||"").replace(be,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=N(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ae," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,d,p,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s,x=!1;if(m){if(o){for(;g;){for(d=t;d=d[g];)if(s?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(d=m,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}), -l=c[e]||[],p=l[0]===W&&l[1],x=p&&l[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){c[e]=[W,p,x];break}}else if(v&&(d=t,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===W&&l[1],x=p),x===!1)for(;(d=++p&&d&&d[g]||(x=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++x||(v&&(f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[e]=[W,x]),d!==t)););return x-=i,x===r||x%r===0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[P]?o(n):o.length>1?(i=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(se,"$1"));return i[P]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,we),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,we).toLowerCase(),function(t){var n;do if(n=_?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===H.activeElement&&(!H.hasFocus||H.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(a=o[0]).type&&w.getById&&9===t.nodeType&&_&&T.relative[o[1].type]){if(t=(T.find.ID(a.matches[0].replace(be,we),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!T.relative[s=a.type]);)if((u=T.find[s])&&(r=u(a.matches[0].replace(be,we),ve.test(o[0].type)&&c(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Q.apply(n,r),n;break}}return(l||k(e,f))(r,t,!_,n,!t||ve.test(e)&&c(t.parentNode)||t),n},w.sortStable=P.split("").sort(U).join("")===P,w.detectDuplicates=!!j,L(),w.sortDetached=i(function(e){return 1&e.compareDocumentPosition(H.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);pe.find=ve,pe.expr=ve.selectors,pe.expr[":"]=pe.expr.pseudos,pe.uniqueSort=pe.unique=ve.uniqueSort,pe.text=ve.getText,pe.isXMLDoc=ve.isXML,pe.contains=ve.contains;var xe=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&pe(e).is(n))break;r.push(e)}return r},be=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},we=pe.expr.match.needsContext,Te=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Ce=/^.[^:#\[\.,]*$/;pe.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?pe.find.matchesSelector(r,e)?[r]:[]:pe.find.matches(e,pe.grep(t,function(e){return 1===e.nodeType}))},pe.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(pe(e).filter(function(){for(t=0;t1?pe.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&we.test(e)?pe(e):e||[],!1).length}});var Ee,Ne=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ke=pe.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||Ee,"string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Ne.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof pe?t[0]:t,pe.merge(this,pe.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:re,!0)),Te.test(r[1])&&pe.isPlainObject(t))for(r in t)pe.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(i=re.getElementById(r[2]),i&&i.parentNode){if(i.id!==r[2])return Ee.find(e);this.length=1,this[0]=i}return this.context=re,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):pe.isFunction(e)?"undefined"!=typeof n.ready?n.ready(e):e(pe):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),pe.makeArray(e,this))};ke.prototype=pe.fn,Ee=pe(re);var Se=/^(?:parents|prev(?:Until|All))/,Ae={children:!0,contents:!0,next:!0,prev:!0};pe.fn.extend({has:function(e){var t,n=pe(e,this),r=n.length;return this.filter(function(){for(t=0;t-1:1===n.nodeType&&pe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?pe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?pe.inArray(this[0],pe(e)):pe.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(pe.uniqueSort(pe.merge(this.get(),pe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),pe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xe(e,"parentNode")},parentsUntil:function(e,t,n){return xe(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return xe(e,"nextSibling")},prevAll:function(e){return xe(e,"previousSibling")},nextUntil:function(e,t,n){return xe(e,"nextSibling",n)},prevUntil:function(e,t,n){return xe(e,"previousSibling",n)},siblings:function(e){return be((e.parentNode||{}).firstChild,e)},children:function(e){return be(e.firstChild)},contents:function(e){return pe.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:pe.merge([],e.childNodes)}},function(e,t){pe.fn[e]=function(n,r){var i=pe.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=pe.filter(r,i)),this.length>1&&(Ae[e]||(i=pe.uniqueSort(i)),Se.test(e)&&(i=i.reverse())),this.pushStack(i)}});var De=/\S+/g;pe.Callbacks=function(e){e="string"==typeof e?o(e):pe.extend({},e);var t,n,r,i,a=[],s=[],u=-1,l=function(){for(i=e.once,r=t=!0;s.length;u=-1)for(n=s.shift();++u-1;)a.splice(n,1),n<=u&&u--}),this},has:function(e){return e?pe.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=s=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=!0,n||c.disable(),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},pe.extend({Deferred:function(e){var t=[["resolve","done",pe.Callbacks("once memory"),"resolved"],["reject","fail",pe.Callbacks("once memory"),"rejected"],["notify","progress",pe.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return pe.Deferred(function(n){pe.each(t,function(t,o){var a=pe.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&pe.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?pe.extend(e,r):r}},i={};return r.pipe=r.then,pe.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=ie.call(arguments),a=o.length,s=1!==a||e&&pe.isFunction(e.promise)?a:0,u=1===s?e:pe.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?ie.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);i0||(je.resolveWith(re,[pe]),pe.fn.triggerHandler&&(pe(re).triggerHandler("ready"),pe(re).off("ready"))))}}),pe.ready.promise=function(t){if(!je)if(je=pe.Deferred(),"complete"===re.readyState||"loading"!==re.readyState&&!re.documentElement.doScroll)e.setTimeout(pe.ready);else if(re.addEventListener)re.addEventListener("DOMContentLoaded",s),e.addEventListener("load",s);else{re.attachEvent("onreadystatechange",s),e.attachEvent("onload",s);var n=!1;try{n=null==e.frameElement&&re.documentElement}catch(r){}n&&n.doScroll&&!function i(){if(!pe.isReady){try{n.doScroll("left")}catch(t){return e.setTimeout(i,50)}a(),pe.ready()}}()}return je.promise(t)},pe.ready.promise();var Le;for(Le in pe(fe))break;fe.ownFirst="0"===Le,fe.inlineBlockNeedsLayout=!1,pe(function(){var e,t,n,r;n=re.getElementsByTagName("body")[0],n&&n.style&&(t=re.createElement("div"),r=re.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),"undefined"!=typeof t.style.zoom&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",fe.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=re.createElement("div");fe.deleteExpando=!0;try{delete e.test}catch(t){fe.deleteExpando=!1}e=null}();var He=function(e){var t=pe.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||t!==!0&&e.getAttribute("classid")===t)},qe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;pe.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?pe.cache[e[pe.expando]]:e[pe.expando],!!e&&!l(e)},data:function(e,t,n){return c(e,t,n)},removeData:function(e,t){return f(e,t)},_data:function(e,t,n){return c(e,t,n,!0)},_removeData:function(e,t){return f(e,t,!0)}}),pe.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=pe.data(o),1===o.nodeType&&!pe._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=pe.camelCase(r.slice(5)),u(o,r,i[r])));pe._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){pe.data(this,e)}):arguments.length>1?this.each(function(){pe.data(this,e,t)}):o?u(o,e,pe.data(o,e)):void 0},removeData:function(e){return this.each(function(){pe.removeData(this,e)})}}),pe.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=pe._data(e,t),n&&(!r||pe.isArray(n)?r=pe._data(e,t,pe.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=pe.queue(e,t),r=n.length,i=n.shift(),o=pe._queueHooks(e,t),a=function(){pe.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return pe._data(e,n)||pe._data(e,n,{empty:pe.Callbacks("once memory").add(function(){pe._removeData(e,t+"queue"),pe._removeData(e,n)})})}}),pe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length
                                        a",fe.leadingWhitespace=3===e.firstChild.nodeType,fe.tbody=!e.getElementsByTagName("tbody").length,fe.htmlSerialize=!!e.getElementsByTagName("link").length,fe.html5Clone="<:nav>"!==re.createElement("nav").cloneNode(!0).outerHTML,n.type="checkbox",n.checked=!0,t.appendChild(n),fe.appendChecked=n.checked,e.innerHTML="",fe.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,t.appendChild(e),n=re.createElement("input"),n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),fe.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.noCloneEvent=!!e.addEventListener,e[pe.expando]=1,fe.attributes=!e.getAttribute(pe.expando)}();var Xe={option:[1,""],legend:[1,"
                                        ","
                                        "],area:[1,"",""],param:[1,"",""],thead:[1,"","
                                        "],tr:[2,"","
                                        "],col:[2,"","
                                        "],td:[3,"","
                                        "],_default:fe.htmlSerialize?[0,"",""]:[1,"X
                                        ","
                                        "]};Xe.optgroup=Xe.option,Xe.tbody=Xe.tfoot=Xe.colgroup=Xe.caption=Xe.thead,Xe.th=Xe.td;var Ue=/<|&#?\w+;/,Ve=/-1&&(h=p.split("."),p=h.shift(),h.sort()),a=p.indexOf(":")<0&&"on"+p,t=t[pe.expando]?t:new pe.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:pe.makeArray(n,[t]),l=pe.event.special[p]||{},i||!l.trigger||l.trigger.apply(r,n)!==!1)){if(!i&&!l.noBubble&&!pe.isWindow(r)){for(u=l.delegateType||p,Ke.test(u+p)||(s=s.parentNode);s;s=s.parentNode)d.push(s),c=s;c===(r.ownerDocument||re)&&d.push(c.defaultView||c.parentWindow||e)}for(f=0;(s=d[f++])&&!t.isPropagationStopped();)t.type=f>1?u:l.bindType||p,o=(pe._data(s,"events")||{})[t.type]&&pe._data(s,"handle"),o&&o.apply(s,n),o=a&&s[a],o&&o.apply&&He(s)&&(t.result=o.apply(s,n),t.result===!1&&t.preventDefault());if(t.type=p,!i&&!t.isDefaultPrevented()&&(!l._default||l._default.apply(d.pop(),n)===!1)&&He(r)&&a&&r[p]&&!pe.isWindow(r)){c=r[a],c&&(r[a]=null),pe.event.triggered=p;try{r[p]()}catch(g){}pe.event.triggered=void 0,c&&(r[a]=c)}return t.result}},dispatch:function(e){e=pe.event.fix(e);var t,n,r,i,o,a=[],s=ie.call(arguments),u=(pe._data(this,"events")||{})[e.type]||[],l=pe.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){for(a=pe.event.handlers.call(this,e,u),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,r=((pe.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(r=[],n=0;n-1:pe.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&a.push({elem:u,handlers:r})}return s]","i"),tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,nt=/\s*$/g,at=p(re),st=at.appendChild(re.createElement("div"));pe.extend({htmlPrefilter:function(e){return e.replace(tt,"<$1>")},clone:function(e,t,n){var r,i,o,a,s,u=pe.contains(e.ownerDocument,e);if(fe.html5Clone||pe.isXMLDoc(e)||!et.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(st.innerHTML=e.outerHTML,st.removeChild(o=st.firstChild)),!(fe.noCloneEvent&&fe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||pe.isXMLDoc(e)))for(r=h(o),s=h(e),a=0;null!=(i=s[a]);++a)r[a]&&k(i,r[a]);if(t)if(n)for(s=s||h(e),r=r||h(o),a=0;null!=(i=s[a]);a++)N(i,r[a]);else N(e,o);return r=h(o,"script"),r.length>0&&g(r,!u&&h(e,"script")),r=s=i=null,o},cleanData:function(e,t){for(var n,r,i,o,a=0,s=pe.expando,u=pe.cache,l=fe.attributes,c=pe.event.special;null!=(n=e[a]);a++)if((t||He(n))&&(i=n[s],o=i&&u[i])){if(o.events)for(r in o.events)c[r]?pe.event.remove(n,r):pe.removeEvent(n,r,o.handle);u[i]&&(delete u[i],l||"undefined"==typeof n.removeAttribute?n[s]=void 0:n.removeAttribute(s),ne.push(i))}}}),pe.fn.extend({domManip:S,detach:function(e){return A(this,e,!0)},remove:function(e){return A(this,e)},text:function(e){return Pe(this,function(e){return void 0===e?pe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||re).createTextNode(e))},null,e,arguments.length)},append:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.appendChild(e)}})},prepend:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&pe.cleanData(h(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&pe.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return pe.clone(this,e,t)})},html:function(e){return Pe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Ze,""):void 0;if("string"==typeof e&&!nt.test(e)&&(fe.htmlSerialize||!et.test(e))&&(fe.leadingWhitespace||!$e.test(e))&&!Xe[(We.exec(e)||["",""])[1].toLowerCase()]){e=pe.htmlPrefilter(e);try{for(;nt",t=l.getElementsByTagName("td"),t[0].style.cssText="margin:0;border:0;padding:0;display:none",o=0===t[0].offsetHeight,o&&(t[0].style.display="",t[1].style.display="none",o=0===t[0].offsetHeight)),f.removeChild(u)}var n,r,i,o,a,s,u=re.createElement("div"),l=re.createElement("div");l.style&&(l.style.cssText="float:left;opacity:.5",fe.opacity="0.5"===l.style.opacity,fe.cssFloat=!!l.style.cssFloat,l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",fe.clearCloneStyle="content-box"===l.style.backgroundClip,u=re.createElement("div"),u.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",l.innerHTML="",u.appendChild(l),fe.boxSizing=""===l.style.boxSizing||""===l.style.MozBoxSizing||""===l.style.WebkitBoxSizing,pe.extend(fe,{reliableHiddenOffsets:function(){return null==n&&t(),o},boxSizingReliable:function(){return null==n&&t(),i},pixelMarginRight:function(){return null==n&&t(),r},pixelPosition:function(){return null==n&&t(),n},reliableMarginRight:function(){return null==n&&t(),a},reliableMarginLeft:function(){return null==n&&t(),s}}))}();var ht,gt,mt=/^(top|right|bottom|left)$/;e.getComputedStyle?(ht=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n.getPropertyValue(t)||n[t]:void 0,""!==a&&void 0!==a||pe.contains(e.ownerDocument,e)||(a=pe.style(e,t)),n&&!fe.pixelMarginRight()&&ft.test(a)&&ct.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o),void 0===a?a:a+""}):pt.currentStyle&&(ht=function(e){return e.currentStyle},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n[t]:void 0,null==a&&s&&s[t]&&(a=s[t]),ft.test(a)&&!mt.test(t)&&(r=s.left,i=e.runtimeStyle,o=i&&i.left,o&&(i.left=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"});var yt=/alpha\([^)]*\)/i,vt=/opacity\s*=\s*([^)]*)/i,xt=/^(none|table(?!-c[ea]).+)/,bt=new RegExp("^("+Fe+")(.*)$","i"),wt={position:"absolute",visibility:"hidden",display:"block"},Tt={letterSpacing:"0",fontWeight:"400"},Ct=["Webkit","O","Moz","ms"],Et=re.createElement("div").style;pe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=gt(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":fe.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=pe.camelCase(t),u=e.style;if(t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];if(o=typeof n,"string"===o&&(i=Me.exec(n))&&i[1]&&(n=d(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(pe.cssNumber[s]?"":"px")),fe.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{u[t]=n}catch(l){}}},css:function(e,t,n,r){var i,o,a,s=pe.camelCase(t);return t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],a&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=gt(e,t,r)),"normal"===o&&t in Tt&&(o=Tt[t]),""===n||n?(i=parseFloat(o),n===!0||isFinite(i)?i||0:o):o}}),pe.each(["height","width"],function(e,t){pe.cssHooks[t]={get:function(e,n,r){if(n)return xt.test(pe.css(e,"display"))&&0===e.offsetWidth?dt(e,wt,function(){return M(e,t,r)}):M(e,t,r)},set:function(e,n,r){var i=r&&ht(e);return _(e,n,r?F(e,t,r,fe.boxSizing&&"border-box"===pe.css(e,"boxSizing",!1,i),i):0)}}}),fe.opacity||(pe.cssHooks.opacity={get:function(e,t){return vt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=pe.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===pe.trim(o.replace(yt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=yt.test(o)?o.replace(yt,i):o+" "+i)}}),pe.cssHooks.marginRight=L(fe.reliableMarginRight,function(e,t){if(t)return dt(e,{display:"inline-block"},gt,[e,"marginRight"])}),pe.cssHooks.marginLeft=L(fe.reliableMarginLeft,function(e,t){if(t)return(parseFloat(gt(e,"marginLeft"))||(pe.contains(e.ownerDocument,e)?e.getBoundingClientRect().left-dt(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}):0))+"px"}),pe.each({margin:"",padding:"",border:"Width"},function(e,t){pe.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+Oe[r]+t]=o[r]||o[r-2]||o[0];return i}},ct.test(e)||(pe.cssHooks[e+t].set=_)}),pe.fn.extend({css:function(e,t){return Pe(this,function(e,t,n){var r,i,o={},a=0;if(pe.isArray(t)){for(r=ht(e),i=t.length;a1)},show:function(){return q(this,!0)},hide:function(){return q(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Re(this)?pe(this).show():pe(this).hide()})}}),pe.Tween=O,O.prototype={constructor:O,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||pe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(pe.cssNumber[n]?"":"px")},cur:function(){var e=O.propHooks[this.prop];return e&&e.get?e.get(this):O.propHooks._default.get(this)},run:function(e){var t,n=O.propHooks[this.prop];return this.options.duration?this.pos=t=pe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):O.propHooks._default.set(this),this}},O.prototype.init.prototype=O.prototype,O.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=pe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){pe.fx.step[e.prop]?pe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[pe.cssProps[e.prop]]&&!pe.cssHooks[e.prop]?e.elem[e.prop]=e.now:pe.style(e.elem,e.prop,e.now+e.unit)}}},O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},pe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},pe.fx=O.prototype.init,pe.fx.step={};var Nt,kt,St=/^(?:toggle|show|hide)$/,At=/queueHooks$/;pe.Animation=pe.extend($,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return d(n.elem,e,Me.exec(t),n),n}]},tweener:function(e,t){pe.isFunction(e)?(t=e,e=["*"]):e=e.match(De);for(var n,r=0,i=e.length;r
                                        a",e=n.getElementsByTagName("a")[0],t.setAttribute("type","checkbox"),n.appendChild(t),e=n.getElementsByTagName("a")[0],e.style.cssText="top:1px",fe.getSetAttribute="t"!==n.className,fe.style=/top/.test(e.getAttribute("style")),fe.hrefNormalized="/a"===e.getAttribute("href"),fe.checkOn=!!t.value,fe.optSelected=i.selected,fe.enctype=!!re.createElement("form").enctype,r.disabled=!0,fe.optDisabled=!i.disabled,t=re.createElement("input"),t.setAttribute("value",""),fe.input=""===t.getAttribute("value"),t.value="t",t.setAttribute("type","radio"),fe.radioValue="t"===t.value}();var Dt=/\r/g,jt=/[\x20\t\r\n\f]+/g;pe.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=pe.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,pe(this).val()):e,null==i?i="":"number"==typeof i?i+="":pe.isArray(i)&&(i=pe.map(i,function(e){return null==e?"":e+""})),t=pe.valHooks[this.type]||pe.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=pe.valHooks[i.type]||pe.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(Dt,""):null==n?"":n)}}}),pe.extend({valHooks:{option:{get:function(e){var t=pe.find.attr(e,"value");return null!=t?t:pe.trim(pe.text(e)).replace(jt," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,a=o?null:[],s=o?i+1:r.length,u=i<0?s:o?i:0;u-1)try{r.selected=n=!0}catch(s){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),pe.each(["radio","checkbox"],function(){pe.valHooks[this]={set:function(e,t){if(pe.isArray(t))return e.checked=pe.inArray(pe(e).val(),t)>-1}},fe.checkOn||(pe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Lt,Ht,qt=pe.expr.attrHandle,_t=/^(?:checked|selected)$/i,Ft=fe.getSetAttribute,Mt=fe.input;pe.fn.extend({attr:function(e,t){return Pe(this,pe.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){pe.removeAttr(this,e)})}}),pe.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?pe.prop(e,t,n):(1===o&&pe.isXMLDoc(e)||(t=t.toLowerCase(),i=pe.attrHooks[t]||(pe.expr.match.bool.test(t)?Ht:Lt)),void 0!==n?null===n?void pe.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=pe.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!fe.radioValue&&"radio"===t&&pe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(De);if(o&&1===e.nodeType)for(;n=o[i++];)r=pe.propFix[n]||n,pe.expr.match.bool.test(n)?Mt&&Ft||!_t.test(n)?e[r]=!1:e[pe.camelCase("default-"+n)]=e[r]=!1:pe.attr(e,n,""),e.removeAttribute(Ft?n:r)}}),Ht={set:function(e,t,n){return t===!1?pe.removeAttr(e,n):Mt&&Ft||!_t.test(n)?e.setAttribute(!Ft&&pe.propFix[n]||n,n):e[pe.camelCase("default-"+n)]=e[n]=!0,n}},pe.each(pe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=qt[t]||pe.find.attr;Mt&&Ft||!_t.test(t)?qt[t]=function(e,t,r){var i,o;return r||(o=qt[t],qt[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,qt[t]=o),i}:qt[t]=function(e,t,n){if(!n)return e[pe.camelCase("default-"+t)]?t.toLowerCase():null}}),Mt&&Ft||(pe.attrHooks.value={set:function(e,t,n){return pe.nodeName(e,"input")?void(e.defaultValue=t):Lt&&Lt.set(e,t,n)}}),Ft||(Lt={set:function(e,t,n){var r=e.getAttributeNode(n);if(r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n))return t}},qt.id=qt.name=qt.coords=function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},pe.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:Lt.set},pe.attrHooks.contenteditable={set:function(e,t,n){Lt.set(e,""!==t&&t,n)}},pe.each(["width","height"],function(e,t){pe.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}})),fe.style||(pe.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Ot=/^(?:input|select|textarea|button|object)$/i,Rt=/^(?:a|area)$/i;pe.fn.extend({prop:function(e,t){return Pe(this,pe.prop,e,t,arguments.length>1)},removeProp:function(e){return e=pe.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(t){}})}}),pe.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&pe.isXMLDoc(e)||(t=pe.propFix[t]||t,i=pe.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=pe.find.attr(e,"tabindex");return t?parseInt(t,10):Ot.test(e.nodeName)||Rt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),fe.hrefNormalized||pe.each(["href","src"],function(e,t){pe.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),fe.optSelected||(pe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),pe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){pe.propFix[this.toLowerCase()]=this}),fe.enctype||(pe.propFix.enctype="encoding");var Pt=/[\t\r\n\f]/g;pe.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).addClass(e.call(this,t,z(this)))});if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).removeClass(e.call(this,t,z(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):pe.isFunction(e)?this.each(function(n){pe(this).toggleClass(e.call(this,n,z(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=pe(this),o=e.match(De)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=z(this),t&&pe._data(this,"__className__",t),pe.attr(this,"class",t||e===!1?"":pe._data(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+z(n)+" ").replace(Pt," ").indexOf(t)>-1)return!0;return!1}}),pe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){pe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),pe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});var Bt=e.location,Wt=pe.now(),It=/\?/,$t=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;pe.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=pe.trim(t+"");return i&&!pe.trim(i.replace($t,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():pe.error("Invalid JSON: "+t)},pe.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(r=new e.DOMParser,n=r.parseFromString(t,"text/xml")):(n=new e.ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(i){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||pe.error("Invalid XML: "+t),n};var zt=/#.*$/,Xt=/([?&])_=[^&]*/,Ut=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Vt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Yt=/^(?:GET|HEAD)$/,Jt=/^\/\//,Gt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Kt={},Qt={},Zt="*/".concat("*"),en=Bt.href,tn=Gt.exec(en.toLowerCase())||[];pe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:en,type:"GET",isLocal:Vt.test(tn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":pe.parseJSON,"text xml":pe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?V(V(e,pe.ajaxSettings),t):V(pe.ajaxSettings,e)},ajaxPrefilter:X(Kt),ajaxTransport:X(Qt),ajax:function(t,n){function r(t,n,r,i){var o,f,v,x,w,C=n;2!==b&&(b=2,u&&e.clearTimeout(u),c=void 0,s=i||"",T.readyState=t>0?4:0,o=t>=200&&t<300||304===t,r&&(x=Y(d,T,r)),x=J(d,x,T,o),o?(d.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(pe.lastModified[a]=w),w=T.getResponseHeader("etag"),w&&(pe.etag[a]=w)),204===t||"HEAD"===d.type?C="nocontent":304===t?C="notmodified":(C=x.state,f=x.data,v=x.error,o=!v)):(v=C,!t&&C||(C="error",t<0&&(t=0))),T.status=t,T.statusText=(n||C)+"",o?g.resolveWith(p,[f,C,T]):g.rejectWith(p,[T,C,v]),T.statusCode(y),y=void 0,l&&h.trigger(o?"ajaxSuccess":"ajaxError",[T,d,o?f:v]),m.fireWith(p,[T,C]),l&&(h.trigger("ajaxComplete",[T,d]),--pe.active||pe.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,d=pe.ajaxSetup({},n),p=d.context||d,h=d.context&&(p.nodeType||p.jquery)?pe(p):pe.event,g=pe.Deferred(),m=pe.Callbacks("once memory"),y=d.statusCode||{},v={},x={},b=0,w="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!f)for(f={};t=Ut.exec(s);)f[t[1].toLowerCase()]=t[2];t=f[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=x[n]=x[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)y[t]=[y[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||w;return c&&c.abort(t),r(0,t),this}};if(g.promise(T).complete=m.add,T.success=T.done,T.error=T.fail,d.url=((t||d.url||en)+"").replace(zt,"").replace(Jt,tn[1]+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=pe.trim(d.dataType||"*").toLowerCase().match(De)||[""],null==d.crossDomain&&(i=Gt.exec(d.url.toLowerCase()),d.crossDomain=!(!i||i[1]===tn[1]&&i[2]===tn[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(tn[3]||("http:"===tn[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=pe.param(d.data,d.traditional)),U(Kt,d,n,T),2===b)return T;l=pe.event&&d.global,l&&0===pe.active++&&pe.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Yt.test(d.type),a=d.url,d.hasContent||(d.data&&(a=d.url+=(It.test(a)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=Xt.test(a)?a.replace(Xt,"$1_="+Wt++):a+(It.test(a)?"&":"?")+"_="+Wt++)),d.ifModified&&(pe.lastModified[a]&&T.setRequestHeader("If-Modified-Since",pe.lastModified[a]),pe.etag[a]&&T.setRequestHeader("If-None-Match",pe.etag[a])),(d.data&&d.hasContent&&d.contentType!==!1||n.contentType)&&T.setRequestHeader("Content-Type",d.contentType),T.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Zt+"; q=0.01":""):d.accepts["*"]);for(o in d.headers)T.setRequestHeader(o,d.headers[o]);if(d.beforeSend&&(d.beforeSend.call(p,T,d)===!1||2===b))return T.abort();w="abort";for(o in{success:1,error:1,complete:1})T[o](d[o]);if(c=U(Qt,d,n,T)){if(T.readyState=1,l&&h.trigger("ajaxSend",[T,d]),2===b)return T;d.async&&d.timeout>0&&(u=e.setTimeout(function(){T.abort("timeout")},d.timeout));try{b=1,c.send(v,r)}catch(C){if(!(b<2))throw C;r(-1,C)}}else r(-1,"No Transport");return T},getJSON:function(e,t,n){return pe.get(e,t,n,"json")},getScript:function(e,t){return pe.get(e,void 0,t,"script")}}),pe.each(["get","post"],function(e,t){pe[t]=function(e,n,r,i){return pe.isFunction(n)&&(i=i||r,r=n,n=void 0),pe.ajax(pe.extend({url:e,type:t,dataType:i,data:n,success:r},pe.isPlainObject(e)&&e))}}),pe._evalUrl=function(e){return pe.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},pe.fn.extend({wrapAll:function(e){if(pe.isFunction(e))return this.each(function(t){pe(this).wrapAll(e.call(this,t))});if(this[0]){var t=pe(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return pe.isFunction(e)?this.each(function(t){pe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=pe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=pe.isFunction(e);return this.each(function(n){pe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){pe.nodeName(this,"body")||pe(this).replaceWith(this.childNodes)}).end()}}),pe.expr.filters.hidden=function(e){return fe.reliableHiddenOffsets()?e.offsetWidth<=0&&e.offsetHeight<=0&&!e.getClientRects().length:K(e)},pe.expr.filters.visible=function(e){return!pe.expr.filters.hidden(e)};var nn=/%20/g,rn=/\[\]$/,on=/\r?\n/g,an=/^(?:submit|button|image|reset|file)$/i,sn=/^(?:input|select|textarea|keygen)/i;pe.param=function(e,t){var n,r=[],i=function(e,t){t=pe.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=pe.ajaxSettings&&pe.ajaxSettings.traditional),pe.isArray(e)||e.jquery&&!pe.isPlainObject(e))pe.each(e,function(){i(this.name,this.value)});else for(n in e)Q(n,e[n],t,i);return r.join("&").replace(nn,"+")},pe.fn.extend({serialize:function(){return pe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=pe.prop(this,"elements");return e?pe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!pe(this).is(":disabled")&&sn.test(this.nodeName)&&!an.test(e)&&(this.checked||!Be.test(e))}).map(function(e,t){var n=pe(this).val();return null==n?null:pe.isArray(n)?pe.map(n,function(e){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),pe.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return this.isLocal?ee():re.documentMode>8?Z():/^(get|post|head|put|delete|options)$/i.test(this.type)&&Z()||ee()}:Z;var un=0,ln={},cn=pe.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in ln)ln[e](void 0,!0)}),fe.cors=!!cn&&"withCredentials"in cn,cn=fe.ajax=!!cn,cn&&pe.ajaxTransport(function(t){if(!t.crossDomain||fe.cors){var n;return{send:function(r,i){var o,a=t.xhr(),s=++un;if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)void 0!==r[o]&&a.setRequestHeader(o,r[o]+"");a.send(t.hasContent&&t.data||null),n=function(e,r){var o,u,l;if(n&&(r||4===a.readyState))if(delete ln[s],n=void 0,a.onreadystatechange=pe.noop,r)4!==a.readyState&&a.abort();else{l={},o=a.status,"string"==typeof a.responseText&&(l.text=a.responseText);try{u=a.statusText}catch(c){u=""}o||!t.isLocal||t.crossDomain?1223===o&&(o=204):o=l.text?200:404}l&&i(o,u,l,a.getAllResponseHeaders())},t.async?4===a.readyState?e.setTimeout(n):a.onreadystatechange=ln[s]=n:n()},abort:function(){n&&n(void 0,!0)}}}}),pe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return pe.globalEval(e),e}}}),pe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),pe.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=re.head||pe("head")[0]||re.documentElement;return{send:function(r,i){t=re.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var fn=[],dn=/(=)\?(?=&|$)|\?\?/;pe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=fn.pop()||pe.expando+"_"+Wt++;return this[e]=!0,e}}),pe.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=t.jsonp!==!1&&(dn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&dn.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=pe.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(dn,"$1"+i):t.jsonp!==!1&&(t.url+=(It.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||pe.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?pe(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,fn.push(i)),a&&pe.isFunction(o)&&o(a[0]),a=o=void 0}),"script"}),pe.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||re;var r=Te.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=y([e],t,i),i&&i.length&&pe(i).remove(),pe.merge([],r.childNodes))};var pn=pe.fn.load;return pe.fn.load=function(e,t,n){if("string"!=typeof e&&pn)return pn.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=pe.trim(e.slice(s,e.length)),e=e.slice(0,s)),pe.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&pe.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?pe("
                                        ").append(pe.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},pe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){pe.fn[t]=function(e){return this.on(t,e)}}),pe.expr.filters.animated=function(e){return pe.grep(pe.timers,function(t){return e===t.elem}).length},pe.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=pe.css(e,"position"),f=pe(e),d={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=pe.css(e,"top"),u=pe.css(e,"left"),l=("absolute"===c||"fixed"===c)&&pe.inArray("auto",[o,u])>-1,l?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),pe.isFunction(t)&&(t=t.call(e,n,pe.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):f.css(d)}},pe.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){pe.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;if(o)return t=o.documentElement,pe.contains(t,i)?("undefined"!=typeof i.getBoundingClientRect&&(r=i.getBoundingClientRect()),n=te(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===pe.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),pe.nodeName(e[0],"html")||(n=e.offset()),n.top+=pe.css(e[0],"borderTopWidth",!0),n.left+=pe.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-pe.css(r,"marginTop",!0),left:t.left-n.left-pe.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){ -for(var e=this.offsetParent;e&&!pe.nodeName(e,"html")&&"static"===pe.css(e,"position");)e=e.offsetParent;return e||pt})}}),pe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);pe.fn[e]=function(r){return Pe(this,function(e,r,i){var o=te(e);return void 0===i?o?t in o?o[t]:o.document.documentElement[r]:e[r]:void(o?o.scrollTo(n?pe(o).scrollLeft():i,n?i:pe(o).scrollTop()):e[r]=i)},e,r,arguments.length,null)}}),pe.each(["top","left"],function(e,t){pe.cssHooks[t]=L(fe.pixelPosition,function(e,n){if(n)return n=gt(e,t),ft.test(n)?pe(e).position()[t]+"px":n})}),pe.each({Height:"height",Width:"width"},function(e,t){pe.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){pe.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return Pe(this,function(t,n,r){var i;return pe.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?pe.css(t,n,a):pe.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),pe.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),pe.fn.size=function(){return this.length},pe.fn.andSelf=pe.fn.addBack,layui.define(function(e){layui.$=pe,e("jquery",pe)}),pe});!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'
                                        '+(f?r.title[0]:r.title)+"
                                        ":"";return r.zIndex=s,t([r.shade?'
                                        ':"",'
                                        '+(e&&2!=r.type?"":u)+'
                                        '+(0==r.type&&r.icon!==-1?'':"")+(1==r.type&&e?"":r.content||"")+'
                                        '+function(){var e=c?'':"";return r.closeBtn&&(e+=''),e}()+""+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t'+r.btn[t]+"";return'
                                        '+e+"
                                        "}():"")+(r.resize?'':"")+"
                                        "],u,i('
                                        ')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;af&&(a=f),ou&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return''}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(t){s=t.find(".layui-layer-input"),s.val(e.value||"").focus(),"function"==typeof f&&f(t)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:'
                                          '+function(){var e=t.length,i=1,a="";if(e>0)for(a='
                                        • '+(t[0].content||"no content")+"
                                        • ";i'+(t[i].content||"no content")+"";return a}()+"
                                        ",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]'+(u[d].alt||
                                        '+(u.length>1?'':"")+'
                                        '+(u[d].alt||"")+""+s.imgIndex+"/"+u.length+"
                                        ",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
                                        是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window);layui.define("jquery",function(i){"use strict";var t=layui.$,a=(layui.hint(),layui.device()),e="element",l="layui-this",n="layui-show",s=function(){this.config={}};s.prototype.set=function(i){var a=this;return t.extend(!0,a.config,i),a},s.prototype.on=function(i,t){return layui.onevent.call(this,e,i,t)},s.prototype.tabAdd=function(i,a){var e=".layui-tab-title",l=t(".layui-tab[lay-filter="+i+"]"),n=l.children(e),s=n.children(".layui-tab-bar"),o=l.children(".layui-tab-content"),c='
                                      • '+(a.title||"unnaming")+"
                                      • ";return s[0]?s.before(c):n.append(c),o.append('
                                        '+(a.content||"")+"
                                        "),y.hideTabMore(!0),y.tabAuto(),this},s.prototype.tabDelete=function(i,a){var e=".layui-tab-title",l=t(".layui-tab[lay-filter="+i+"]"),n=l.children(e),s=n.find('>li[lay-id="'+a+'"]');return y.tabDelete(null,s),this},s.prototype.tabChange=function(i,a){var e=".layui-tab-title",l=t(".layui-tab[lay-filter="+i+"]"),n=l.children(e),s=n.find('>li[lay-id="'+a+'"]');return y.tabClick.call(s[0],null,null,s),this},s.prototype.tab=function(i){i=i||{},v.on("click",i.headerElem,function(a){var e=t(this).index();y.tabClick.call(this,a,e,null,i)})},s.prototype.progress=function(i,a){var e="layui-progress",l=t("."+e+"[lay-filter="+i+"]"),n=l.find("."+e+"-bar"),s=n.find("."+e+"-text");return n.css("width",a),s.text(a),this};var o=".layui-nav",c="layui-nav-item",r="layui-nav-bar",u="layui-nav-tree",d="layui-nav-child",h="layui-nav-more",f="layui-anim layui-anim-upbit",y={tabClick:function(i,a,s,o){o=o||{};var c=s||t(this),a=a||c.parent().children("li").index(c),r=o.headerElem?c.parent():c.parents(".layui-tab").eq(0),u=o.bodyElem?t(o.bodyElem):r.children(".layui-tab-content").children(".layui-tab-item"),d=c.find("a"),h=r.attr("lay-filter");"javascript:;"!==d.attr("href")&&"_blank"===d.attr("target")||(c.addClass(l).siblings().removeClass(l),u.eq(a).addClass(n).siblings().removeClass(n)),layui.event.call(this,e,"tab("+h+")",{elem:r,index:a})},tabDelete:function(i,a){var n=a||t(this).parent(),s=n.index(),o=n.parents(".layui-tab").eq(0),c=o.children(".layui-tab-content").children(".layui-tab-item"),r=o.attr("lay-filter");n.hasClass(l)&&(n.next()[0]?y.tabClick.call(n.next()[0],null,s+1):n.prev()[0]&&y.tabClick.call(n.prev()[0],null,s-1)),n.remove(),c.eq(s).remove(),setTimeout(function(){y.tabAuto()},50),layui.event.call(this,e,"tabDelete("+r+")",{elem:o,index:s})},tabAuto:function(){var i="layui-tab-more",e="layui-tab-bar",l="layui-tab-close",n=this;t(".layui-tab").each(function(){var s=t(this),o=s.children(".layui-tab-title"),c=(s.children(".layui-tab-content").children(".layui-tab-item"),'lay-stope="tabmore"'),r=t('');if(n===window&&8!=a.ie&&y.hideTabMore(!0),s.attr("lay-allowClose")&&o.find("li").each(function(){var i=t(this);if(!i.find("."+l)[0]){var a=t('');a.on("click",y.tabDelete),i.append(a)}}),o.prop("scrollWidth")>o.outerWidth()+1){if(o.find("."+e)[0])return;o.append(r),s.attr("overflow",""),r.on("click",function(t){o[this.title?"removeClass":"addClass"](i),this.title=this.title?"":"收缩"})}else o.find("."+e).remove(),s.removeAttr("overflow")})},hideTabMore:function(i){var a=t(".layui-tab-title");i!==!0&&"tabmore"===t(i.target).attr("lay-stope")||(a.removeClass("layui-tab-more"),a.find(".layui-tab-bar").attr("title",""))},clickThis:function(){var i=t(this),a=i.parents(o),n=a.attr("lay-filter"),s=i.find("a"),c="string"==typeof i.attr("lay-unselect");i.find("."+d)[0]||("javascript:;"!==s.attr("href")&&"_blank"===s.attr("target")||c||(a.find("."+l).removeClass(l),i.addClass(l)),layui.event.call(this,e,"nav("+n+")",i))},clickChild:function(){var i=t(this),a=i.parents(o),n=a.attr("lay-filter");a.find("."+l).removeClass(l),i.addClass(l),layui.event.call(this,e,"nav("+n+")",i)},showChild:function(){var i=t(this),a=i.parents(o),e=i.parent(),l=i.siblings("."+d);a.hasClass(u)&&(l.removeClass(f),e["none"===l.css("display")?"addClass":"removeClass"](c+"ed"))},collapse:function(){var i=t(this),a=i.find(".layui-colla-icon"),l=i.siblings(".layui-colla-content"),s=i.parents(".layui-collapse").eq(0),o=s.attr("lay-filter"),c="none"===l.css("display");if("string"==typeof s.attr("lay-accordion")){var r=s.children(".layui-colla-item").children("."+n);r.siblings(".layui-colla-title").children(".layui-colla-icon").html(""),r.removeClass(n)}l[c?"addClass":"removeClass"](n),a.html(c?"":""),layui.event.call(this,e,"collapse("+o+")",{title:i,content:l,show:c})}};s.prototype.init=function(i,e){var l=function(){return e?'[lay-filter="'+e+'"]':""}(),s={tab:function(){y.tabAuto.call({})},nav:function(){var i=200,e={},s={},p={},v=function(l,o,c){var r=t(this),y=r.find("."+d);o.hasClass(u)?l.css({top:r.position().top,height:r.children("a").height(),opacity:1}):(y.addClass(f),l.css({left:r.position().left+parseFloat(r.css("marginLeft")),top:r.position().top+r.height()-l.height()}),e[c]=setTimeout(function(){l.css({width:r.width(),opacity:1})},a.ie&&a.ie<10?0:i),clearTimeout(p[c]),"block"===y.css("display")&&clearTimeout(s[c]),s[c]=setTimeout(function(){y.addClass(n),r.find("."+h).addClass(h+"d")},300))};t(o+l).each(function(a){var l=t(this),o=t(''),f=l.find("."+c);l.find("."+r)[0]||(l.append(o),f.on("mouseenter",function(){v.call(this,o,l,a)}).on("mouseleave",function(){l.hasClass(u)||(clearTimeout(s[a]),s[a]=setTimeout(function(){l.find("."+d).removeClass(n),l.find("."+h).removeClass(h+"d")},300))}),l.on("mouseleave",function(){clearTimeout(e[a]),p[a]=setTimeout(function(){l.hasClass(u)?o.css({height:0,top:o.position().top+o.height()/2,opacity:0}):o.css({width:0,left:o.position().left+o.width()/2,opacity:0})},i)})),f.each(function(){var i=t(this),a=i.find("."+d);if(a[0]&&!i.find("."+h)[0]){var e=i.children("a");e.append('')}i.off("click",y.clickThis).on("click",y.clickThis),i.children("a").off("click",y.showChild).on("click",y.showChild),a.children("dd").off("click",y.clickChild).on("click",y.clickChild)})})},breadcrumb:function(){var i=".layui-breadcrumb";t(i+l).each(function(){var i=t(this),a="lay-separator",e=i.attr(a)||"/",l=i.find("a");l.next("span["+a+"]")[0]||(l.each(function(i){i!==l.length-1&&t(this).after(""+e+"")}),i.css("visibility","visible"))})},progress:function(){var i="layui-progress";t("."+i+l).each(function(){var a=t(this),e=a.find(".layui-progress-bar"),l=e.attr("lay-percent");e.css("width",function(){return/^.+\/.+$/.test(l)?100*new Function("return "+l)()+"%":l}()),a.attr("lay-showPercent")&&setTimeout(function(){e.html(''+l+"")},350)})},collapse:function(){var i="layui-collapse";t("."+i+l).each(function(){var i=t(this).find(".layui-colla-item");i.each(function(){var i=t(this),a=i.find(".layui-colla-title"),e=i.find(".layui-colla-content"),l="none"===e.css("display");a.find(".layui-colla-icon").remove(),a.append(''+(l?"":"")+""),a.off("click",y.collapse).on("click",y.collapse)})})}};return s[i]?s[i]():layui.each(s,function(i,t){t()})},s.prototype.render=s.prototype.init;var p=new s,v=t(document);p.render();var b=".layui-tab-title li";v.on("click",b,y.tabClick),v.on("click",y.hideTabMore),t(window).on("resize",y.tabAuto),i(e,p)});layui.define("layer",function(e){"use strict";var i=layui.$,t=layui.layer,n=layui.hint(),a=layui.device(),o={config:{},set:function(e){var t=this;return t.config=i.extend({},t.config,e),t},on:function(e,i){return layui.onevent.call(this,r,e,i)}},l=function(){var e=this;return{upload:function(i){e.upload.call(e,i)},config:e.config}},r="upload",u="layui-upload-file",c="layui-upload-form",f="layui-upload-iframe",s="layui-upload-choose",p=function(e){var t=this;t.config=i.extend({},t.config,o.config,e),t.render()};p.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",field:"file",method:"post",data:{},drag:!0,size:0,number:0,multiple:!1},p.prototype.render=function(e){var t=this,e=t.config;e.elem=i(e.elem),e.bindAction=i(e.bindAction),t.file(),t.events()},p.prototype.file=function(){var e=this,t=e.config,n=e.elemFile=i(['"].join("")),o=t.elem.next();(o.hasClass(u)||o.hasClass(c))&&o.remove(),a.ie&&a.ie<10&&t.elem.wrap('
                                        '),e.isFile()?(e.elemFile=t.elem,t.field=t.elem[0].name):t.elem.after(n),a.ie&&a.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,t=e.config,n=i(''),a=i(['
                                        ',"
                                        "].join(""));i("#"+f)[0]||i("body").append(n),t.elem.next().hasClass(f)||(e.elemFile.wrap(a),t.elem.next("."+f).append(function(){var e=[];return layui.each(t.data,function(i,t){e.push('')}),e.join("")}()))},p.prototype.msg=function(e){return t.msg(e,{icon:2,shift:6})},p.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},p.prototype.preview=function(e){var i=this;window.FileReader&&layui.each(i.chooseFiles,function(i,t){var n=new FileReader;n.readAsDataURL(t),n.onload=function(){e&&e(i,t,this.result)}})},p.prototype.upload=function(e,t){var n,o=this,l=o.config,r=o.elemFile[0],u=function(){var t=0,n=0,a=e||o.files||o.chooseFiles||r.files,u=function(){l.multiple&&t+n===o.fileLength&&"function"==typeof l.allDone&&l.allDone({total:o.fileLength,successful:t,aborted:n})};layui.each(a,function(e,a){var r=new FormData;r.append(l.field,a),layui.each(l.data,function(e,i){r.append(e,i)}),i.ajax({url:l.url,type:l.method,data:r,contentType:!1,processData:!1,dataType:"json",success:function(i){t++,d(e,i),u()},error:function(){n++,o.msg("请求上传接口出现异常"),m(e),u()}})})},c=function(){var e=i("#"+f);o.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var i,t=e.contents().find("body");try{i=t.text()}catch(n){o.msg("获取上传后的响应信息出现异常"),clearInterval(p.timer),m()}i&&(clearInterval(p.timer),t.html(""),d(0,i))},30)},d=function(e,i){if(o.elemFile.next("."+s).remove(),r.value="","object"!=typeof i)try{i=JSON.parse(i)}catch(t){return i={},o.msg("请对上传接口返回有效JSON")}"function"==typeof l.done&&l.done(i,e||0,function(e){o.upload(e)})},m=function(e){l.auto&&(r.value=""),"function"==typeof l.error&&l.error(e||0,function(e){o.upload(e)})},h=l.exts,v=function(){var i=[];return layui.each(e||o.chooseFiles,function(e,t){i.push(t.name)}),i}(),g={preview:function(e){o.preview(e)},upload:function(e,i){var t={};t[e]=i,o.upload(t)},pushFile:function(){return o.files=o.files||{},layui.each(o.chooseFiles,function(e,i){o.files[e]=i}),o.files}},y=function(){return"choose"===t?l.choose&&l.choose(g):(l.before&&l.before(g),a.ie?a.ie>9?u():c():void u())};if(v=0===v.length?r.value.match(/[^\/\\]+\..+/g)||[]||"":v,0!==v.length){switch(l.accept){case"file":if(h&&!RegExp("\\w\\.("+h+")$","i").test(escape(v)))return o.msg("选择的文件中包含不支持的格式"),r.value="";break;case"video":if(!RegExp("\\w\\.("+(h||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(v)))return o.msg("选择的视频中包含不支持的格式"),r.value="";break;case"audio":if(!RegExp("\\w\\.("+(h||"mp3|wav|mid")+")$","i").test(escape(v)))return o.msg("选择的音频中包含不支持的格式"),r.value="";break;default:if(layui.each(v,function(e,i){RegExp("\\w\\.("+(h||"jpg|png|gif|bmp|jpeg$")+")","i").test(escape(i))||(n=!0)}),n)return o.msg("选择的图片中包含不支持的格式"),r.value=""}if(o.fileLength=function(){var i=0,t=e||o.files||o.chooseFiles||r.files;return layui.each(t,function(){i++}),i}(),l.number&&o.fileLength>l.number)return o.msg("同时最多只能上传的数量为:"+l.number);if(l.size>0&&!(a.ie&&a.ie<10)){var F;if(layui.each(o.chooseFiles,function(e,i){if(i.size>1024*l.size){var t=l.size/1024;t=t>=1?Math.floor(t)+(t%1>0?t.toFixed(1):0)+"MB":l.size+"KB",r.value="",F=t}}),F)return o.msg("文件不能超过"+F)}y()}},p.prototype.events=function(){var e=this,t=e.config,o=function(i){e.chooseFiles={},layui.each(i,function(i,t){var n=(new Date).getTime();e.chooseFiles[n+"-"+i]=t})},l=function(i,n){var a=e.elemFile,o=i.length>1?i.length+"个文件":(i[0]||{}).name||a[0].value.match(/[^\/\\]+\..+/g)||[]||"";a.next().hasClass(s)&&a.next().remove(),e.upload(null,"choose"),e.isFile()||t.choose||a.after(''+o+"")};t.elem.off("upload.start").on("upload.start",function(){var a=i(this),o=a.attr("lay-data");if(o)try{o=new Function("return "+o)(),e.config=i.extend({},t,o)}catch(l){n.error("Upload element property lay-data configuration item has a syntax error: "+o)}e.config.item=a,e.elemFile[0].click()}),a.ie&&a.ie<10||t.elem.off("upload.over").on("upload.over",function(){var e=i(this);e.attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){var e=i(this);e.removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(n,a){var r=i(this),u=a.originalEvent.dataTransfer.files||[];r.removeAttr("lay-over"),o(u),t.auto?e.upload(u):l(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var i=this.files||[];o(i),t.auto?e.upload():l(i)}),t.bindAction.off("upload.action").on("upload.action",function(){e.upload()}),t.elem.data("haveEvents")||(e.elemFile.on("change",function(){i(this).trigger("upload.change")}),t.elem.on("click",function(){e.isFile()||i(this).trigger("upload.start")}),t.drag&&t.elem.on("dragover",function(e){e.preventDefault(),i(this).trigger("upload.over")}).on("dragleave",function(e){i(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),i(this).trigger("upload.drop",e)}),t.bindAction.on("click",function(){i(this).trigger("upload.action")}),t.elem.data("haveEvents",!0))},o.render=function(e){var i=new p(e);return l.call(i)},e(r,o)});layui.define("layer",function(e){"use strict";var t=layui.$,i=layui.layer,a=layui.hint(),n=layui.device(),l="form",r=".layui-form",s="layui-this",o="layui-hide",u="layui-disabled",c=function(){this.config={verify:{required:[/[\S]+/,"必填项不能为空"],phone:[/^1\d{10}$/,"请输入正确的手机号"],email:[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"邮箱格式不正确"],url:[/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/,"链接格式不正确"],number:function(e){if(!e||isNaN(e))return"只能填写数字"},date:[/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,"日期格式不正确"],identity:[/(^\d{15}$)|(^\d{17}(x|X|\d)$)/,"请输入正确的身份证号"]}}};c.prototype.set=function(e){var i=this;return t.extend(!0,i.config,e),i},c.prototype.verify=function(e){var i=this;return t.extend(!0,i.config.verify,e),i},c.prototype.on=function(e,t){return layui.onevent.call(this,l,e,t)},c.prototype.render=function(e,i){var n=this,c=t(r+function(){return i?'[lay-filter="'+i+'"]':""}()),d={select:function(){var e,i="请选择",a="layui-form-select",n="layui-select-title",r="layui-select-none",d="",f=c.find("select"),y=function(i,l){t(i.target).parent().hasClass(n)&&!l||(t("."+a).removeClass(a+"ed "+a+"up"),e&&d&&e.val(d)),e=null},h=function(i,c,f){var h=t(this),p=i.find("."+n),m=p.find("input"),k=i.find("dl"),g=k.children("dd");if(!c){var x=function(){var e=i.offset().top+i.outerHeight()+5-v.scrollTop(),t=k.outerHeight();i.addClass(a+"ed"),g.removeClass(o),e+t>v.height()&&e>=t&&i.addClass(a+"up")},b=function(e){i.removeClass(a+"ed "+a+"up"),m.blur(),e||C(m.val(),function(e){e&&(d=k.find("."+s).html(),m&&m.val(d))})};p.on("click",function(e){i.hasClass(a+"ed")?b():(y(e,!0),x()),k.find("."+r).remove()}),p.find(".layui-edge").on("click",function(){m.focus()}),m.on("keyup",function(e){var t=e.keyCode;9===t&&x()}).on("keydown",function(e){var t=e.keyCode;9===t?b():13===t&&e.preventDefault()});var C=function(e,i,a){var n=0;layui.each(g,function(){var i=t(this),l=i.text(),r=l.indexOf(e)===-1;(""===e||"blur"===a?e!==l:r)&&n++,"keyup"===a&&i[r?"addClass":"removeClass"](o)});var l=n===g.length;return i(l),l},w=function(e){var t=this.value,i=e.keyCode;return 9!==i&&13!==i&&37!==i&&38!==i&&39!==i&&40!==i&&(C(t,function(e){e?k.find("."+r)[0]||k.append('

                                        无匹配项

                                        '):k.find("."+r).remove()},"keyup"),void(""===t&&k.find("."+r).remove()))};f&&m.on("keyup",w).on("blur",function(t){e=m,d=k.find("."+s).html(),setTimeout(function(){C(m.val(),function(e){d||m.val("")},"blur")},200)}),g.on("click",function(){var e=t(this),a=e.attr("lay-value"),n=h.attr("lay-filter");return!e.hasClass(u)&&(e.hasClass("layui-select-tips")?m.val(""):(m.val(e.text()),e.addClass(s)),e.siblings().removeClass(s),h.val(a).removeClass("layui-form-danger"),layui.event.call(this,l,"select("+n+")",{elem:h[0],value:a,othis:i}),b(!0),!1)}),i.find("dl>dt").on("click",function(e){return!1}),t(document).off("click",y).on("click",y)}};f.each(function(e,l){var r=t(this),o=r.next("."+a),c=this.disabled,d=l.value,f=t(l.options[l.selectedIndex]),y=l.options[0];if("string"==typeof r.attr("lay-ignore"))return r.show();var v="string"==typeof r.attr("lay-search"),p=y?y.value?i:y.innerHTML||i:i,m=t(['
                                        ','
                                        ','
                                        ','
                                        '+function(e){var t=[];return layui.each(e,function(e,a){0!==e||a.value?"optgroup"===a.tagName.toLowerCase()?t.push("
                                        "+a.label+"
                                        "):t.push('
                                        '+a.innerHTML+"
                                        "):t.push('
                                        '+(a.innerHTML||i)+"
                                        ")}),0===t.length&&t.push('
                                        没有选项
                                        '),t.join("")}(r.find("*"))+"
                                        ","
                                        "].join(""));o[0]&&o.remove(),r.after(m),h.call(this,m,c,v)})},checkbox:function(){var e={checkbox:["layui-form-checkbox","layui-form-checked","checkbox"],_switch:["layui-form-switch","layui-form-onswitch","switch"]},i=c.find("input[type=checkbox]"),a=function(e,i){var a=t(this);e.on("click",function(){var t=a.attr("lay-filter"),n=(a.attr("lay-text")||"").split("|");a[0].disabled||(a[0].checked?(a[0].checked=!1,e.removeClass(i[1]).find("em").text(n[1])):(a[0].checked=!0,e.addClass(i[1]).find("em").text(n[0])),layui.event.call(a[0],l,i[2]+"("+t+")",{elem:a[0],value:a[0].value,othis:e}))})};i.each(function(i,n){var l=t(this),r=l.attr("lay-skin"),s=(l.attr("lay-text")||"").split("|"),o=this.disabled;"switch"===r&&(r="_"+r);var c=e[r]||e.checkbox;if("string"==typeof l.attr("lay-ignore"))return l.show();var d=l.next("."+c[0]),f=t(['
                                        ',{_switch:""+((n.checked?s[0]:s[1])||"")+""}[r]||(n.title.replace(/\s/g,"")?""+n.title+"":"")+''+(r?"":"")+"","
                                        "].join(""));d[0]&&d.remove(),l.after(f),a.call(this,f,c)})},radio:function(){var e="layui-form-radio",i=["",""],a=c.find("input[type=radio]"),n=function(a){var n=t(this),s="layui-anim-scaleSpring";a.on("click",function(){var o=n[0].name,u=n.parents(r),c=n.attr("lay-filter"),d=u.find("input[name="+o.replace(/(\.|#|\[|\])/g,"\\$1")+"]");n[0].disabled||(layui.each(d,function(){var a=t(this).next("."+e);this.checked=!1,a.removeClass(e+"ed"),a.find(".layui-icon").removeClass(s).html(i[1])}),n[0].checked=!0,a.addClass(e+"ed"),a.find(".layui-icon").addClass(s).html(i[0]),layui.event.call(n[0],l,"radio("+c+")",{elem:n[0],value:n[0].value,othis:a}))})};a.each(function(a,l){var r=t(this),s=r.next("."+e),o=this.disabled;if("string"==typeof r.attr("lay-ignore"))return r.show();s[0]&&s.remove();var c=t(['
                                        ',''+i[l.checked?0:1]+"","
                                        "+function(){var e=l.title||"";return"string"==typeof r.next().attr("lay-radio")&&(e=r.next().html(),r.next().remove()),e}()+"
                                        ","
                                        "].join(""));r.after(c),n.call(this,c)})}};return e?d[e]?d[e]():a.error("不支持的"+e+"表单渲染"):layui.each(d,function(e,t){t()}),n};var d=function(){var e=t(this),a=f.config.verify,s=null,o="layui-form-danger",u={},c=e.parents(r),d=c.find("*[lay-verify]"),y=e.parents("form")[0],v=c.find("input,select,textarea"),h=e.attr("lay-filter");if(layui.each(d,function(e,l){var r=t(this),u=r.attr("lay-verify").split("|"),c=r.attr("lay-verType"),d=r.val();if(r.removeClass(o),layui.each(u,function(e,t){var u,f="",y="function"==typeof a[t];if(a[t]){var u=y?f=a[t](d,l):!a[t][0].test(d);if(f=f||a[t][1],u)return"tips"===c?i.tips(f,function(){return"string"==typeof r.attr("lay-ignore")||"select"!==l.tagName.toLowerCase()&&!/^checkbox|radio$/.test(l.type)?r:r.next()}(),{tips:1}):"alert"===c?i.alert(f,{title:"提示",shadeClose:!0}):i.msg(f,{icon:5,shift:6}),n.android||n.ios||l.focus(),r.addClass(o),s=!0}}),s)return s}),s)return!1;var p={};return layui.each(v,function(e,t){if(t.name=(t.name||"").replace(/^\s*|\s*&/,""),t.name){if(/^.*\[\]$/.test(t.name)){var i=t.name.match(/^(.*)\[\]$/g)[0];p[i]=0|p[i],t.name=t.name.replace(/^(.*)\[\]$/,"$1["+p[i]++ +"]")}/^checkbox|radio$/.test(t.type)&&!t.checked||(u[t.name]=t.value)}}),layui.event.call(this,l,"submit("+h+")",{elem:this,form:y,field:u})},f=new c,y=t(document),v=t(window);f.render(),y.on("reset",r,function(){var e=t(this).attr("lay-filter");setTimeout(function(){f.render(null,e)},50)}),y.on("submit",r,d).on("click","*[lay-submit]",d),e(l,f)});layui.define("jquery",function(e){"use strict";var o=layui.$,a=layui.hint(),i="layui-tree-enter",r=function(e){this.options=e},t={arrow:["",""],checkbox:["",""],radio:["",""],branch:["",""],leaf:""};r.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},r.prototype.tree=function(e,a){var i=this,r=i.options,n=a||r.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o('
                                          '),s=o(["
                                        • ",function(){return l?''+(n.spread?t.arrow[1]:t.arrow[0])+"":""}(),function(){return r.check?''+("checkbox"===r.check?t.checkbox[0]:"radio"===r.check?t.radio[0]:"")+"":""}(),function(){return'"+(''+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"")+(""+(n.name||"未命名")+"")}(),"
                                        • "].join(""));l&&(s.append(c),i.tree(c,n.children)),e.append(s),"function"==typeof r.click&&i.click(s,n),i.spread(s,n),r.drag&&i.drag(s,n)})},r.prototype.click=function(e,o){var a=this,i=a.options;e.children("a").on("click",function(e){layui.stope(e),i.click(o)})},r.prototype.spread=function(e,o){var a=this,i=(a.options,e.children(".layui-tree-spread")),r=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),r.removeClass("layui-show"),i.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),r.addClass("layui-show"),i.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};r[0]&&(i.on("click",l),n.on("dblclick",l))},r.prototype.on=function(e){var a=this,r=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),r.drag&&o(document).on("mousemove",function(e){var i=a.move;if(i.from){var r=(i.to,o('
                                          '));e.preventDefault(),o("."+t)[0]||o("body").append(r);var n=o("."+t)[0]?o("."+t):r;n.addClass("layui-show").html(i.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(i),e.to&&e.to.elem.children("a").removeClass(i),a.move={},o("."+t).remove())})},r.prototype.move={},r.prototype.drag=function(e,a){var r=this,t=(r.options,e.children("a")),n=function(){var t=o(this),n=r.move;n.from&&(n.to={item:a,elem:e},t.addClass(i))};t.on("mousedown",function(){var o=r.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=r.move;a.from&&(delete a.to,e.removeClass(i))})},e("tree",function(e){var i=new r(e=e||{}),t=o(e.elem);return t[0]?void i.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})});layui.define(["laytpl","laypage","layer","form"],function(e){"use strict";var t=layui.$,i=layui.laytpl,a=layui.laypage,l=layui.layer,n=layui.form,o=layui.hint(),r=layui.device(),d={config:{checkName:"LAY_CHECKED",indexName:"LAY_TABLE_INDEX"},cache:{},index:layui.table?layui.table.index+1e4:0,set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,s,e,t)}},c=function(){var e=this,t=e.config,i=t.id;return i&&(c.config[i]=t),{reload:function(t){e.reload.call(e,t)},config:t}},s="table",u=".layui-table",h="layui-hide",f="layui-none",y="layui-table-view",p=".layui-table-header",m=".layui-table-body",v=".layui-table-main",g=".layui-table-fixed",x=".layui-table-fixed-l",b=".layui-table-fixed-r",k=".layui-table-tool",C=".layui-table-page",w=".layui-table-sort",N="layui-table-edit",F="layui-table-hover",W=function(e){var t='{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}';return e=e||{},['',"","{{# layui.each(d.data.cols, function(i1, item1){ }}","","{{# layui.each(item1, function(i2, item2){ }}",'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}','{{# if(item2.fixed === "right"){ right = true; } }}',function(){return e.fixed&&"right"!==e.fixed?'{{# if(item2.fixed && item2.fixed !== "right"){ }}':"right"===e.fixed?'{{# if(item2.fixed === "right"){ }}':""}(),'",e.fixed?"{{# }; }}":"","{{# }); }}","","{{# }); }}","","
                                          ','
                                          1){ }}","group","{{# } else { }}","{{d.index}}-{{item2.field || i2}}",'{{# if(item2.type !== "normal"){ }}'," laytable-cell-{{ item2.type }}","{{# } }}","{{# } }}",'" {{#if(item2.align){}}align="{{item2.align}}"{{#}}}>','{{# if(item2.type === "checkbox"){ }}','',"{{# } else { }}",'{{item2.title||""}}',"{{# if(!(item2.colspan > 1) && item2.sort){ }}",'',"{{# } }}","{{# } }}","
                                          ","
                                          "].join("")},z=['',"","
                                          "].join(""),A=['
                                          ',"{{# if(d.data.toolbar){ }}",'
                                          ',"{{# } }}",'
                                          ',"{{# var left, right; }}",'
                                          ',W(),"
                                          ",'
                                          ',z,"
                                          ","{{# if(left){ }}",'
                                          ','
                                          ',W({fixed:!0}),"
                                          ",'
                                          ',z,"
                                          ","
                                          ","{{# }; }}","{{# if(right){ }}",'
                                          ','
                                          ',W({fixed:"right"}),'
                                          ',"
                                          ",'
                                          ',z,"
                                          ","
                                          ","{{# }; }}","
                                          ","{{# if(d.data.page){ }}",'
                                          ','
                                          ',"
                                          ","{{# } }}","","
                                          "].join(""),T=t(window),M=t(document),S=function(e){var i=this;i.index=++d.index,i.config=t.extend({},i.config,d.config,e),i.render()};S.prototype.config={limit:10,loading:!0,cellMinWidth:60,text:{none:"无数据"}},S.prototype.render=function(){var e=this,a=e.config;if(a.elem=t(a.elem),a.where=a.where||{},a.id=a.id||a.elem.attr("id"),a.request=t.extend({pageName:"page",limitName:"limit"},a.request),a.response=t.extend({statusName:"code",statusCode:0,msgName:"msg",dataName:"data",countName:"count"},a.response),"object"==typeof a.page&&(a.limit=a.page.limit||a.limit,a.limits=a.page.limits||a.limits,e.page=a.page.curr=a.page.curr||1,delete a.page.elem,delete a.page.jump),!a.elem[0])return e;e.setArea();var l=a.elem,n=l.next("."+y),o=e.elem=t(i(A).render({VIEW_CLASS:y,data:a,index:e.index}));if(a.index=e.index,n[0]&&n.remove(),l.after(o),e.layHeader=o.find(p),e.layMain=o.find(v),e.layBody=o.find(m),e.layFixed=o.find(g),e.layFixLeft=o.find(x),e.layFixRight=o.find(b),e.layTool=o.find(k),e.layPage=o.find(C),e.layTool.html(i(t(a.toolbar).html()||"").render(a)),a.height&&e.fullSize(),a.cols.length>1){var r=e.layFixed.find(p).find("th");r.height(e.layHeader.height()-1-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom")))}e.pullData(e.page),e.events()},S.prototype.initOpts=function(e){var t=this,i=(t.config,{checkbox:48,space:15,numbers:40});e.checkbox&&(e.type="checkbox"),e.space&&(e.type="space"),e.type||(e.type="normal"),"normal"!==e.type&&(e.unresize=!0,e.width=e.width||i[e.type])},S.prototype.setArea=function(){var e=this,t=e.config,i=0,a=0,l=0,n=0,o=t.width||function(){var e=function(i){var a,l;i=i||t.elem.parent(),a=i.width();try{l="none"===i.css("display")}catch(n){}return!i[0]||a&&!l?a:e(i.parent())};return e()}();e.eachCols(function(){i++}),o-=function(){return"line"===t.skin||"nob"===t.skin?2:i+1}(),layui.each(t.cols,function(t,i){layui.each(i,function(t,l){var r;return l?(e.initOpts(l),r=l.width||0,void(l.colspan>1||(/\d+%$/.test(r)?l.width=r=Math.floor(parseFloat(r)/100*o):r||(l.width=r=0,a++),n+=r))):void i.splice(t,1)})}),e.autoColNums=a,o>n&&a&&(l=(o-n)/a),layui.each(t.cols,function(e,i){layui.each(i,function(e,i){var a=i.minWidth||t.cellMinWidth;i.colspan>1||0===i.width&&(i.width=Math.floor(l>=a?l:a))})}),t.height&&/^full-\d+$/.test(t.height)&&(e.fullHeightGap=t.height.split("-")[1],t.height=T.height()-e.fullHeightGap)},S.prototype.reload=function(e){var i=this;i.config.data&&i.config.data.constructor===Array&&delete i.config.data,i.config=t.extend({},i.config,e),i.render()},S.prototype.page=1,S.prototype.pullData=function(e,i){var a=this,n=a.config,o=n.request,r=n.response,d=function(){"object"==typeof n.initSort&&a.sort(n.initSort.field,n.initSort.type)};if(a.startTime=(new Date).getTime(),n.url){var c={};c[o.pageName]=e,c[o.limitName]=n.limit,t.ajax({type:n.method||"get",url:n.url,data:t.extend(c,n.where),dataType:"json",success:function(t){t[r.statusName]!=r.statusCode?(a.renderForm(),a.layMain.html('
                                          '+(t[r.msgName]||"返回的数据状态异常")+"
                                          ")):(a.renderData(t,e,t[r.countName]),d(),n.time=(new Date).getTime()-a.startTime+" ms"),i&&l.close(i),"function"==typeof n.done&&n.done(t,e,t[r.countName])},error:function(e,t){a.layMain.html('
                                          数据接口请求异常
                                          '),a.renderForm(),i&&l.close(i)}})}else if(n.data&&n.data.constructor===Array){var s={},u=e*n.limit-n.limit;s[r.dataName]=n.data.concat().splice(u,n.limit),s[r.countName]=n.data.length,a.renderData(s,e,n.data.length),d(),"function"==typeof n.done&&n.done(s,e,s[r.countName])}},S.prototype.eachCols=function(e){var i=t.extend(!0,[],this.config.cols),a=[],l=0;layui.each(i,function(e,t){layui.each(t,function(t,n){if(n.colspan>1){var o=0;l++,n.CHILD_COLS=[],layui.each(i[e+1],function(e,t){t.PARENT_COL||o==n.colspan||(t.PARENT_COL=l,n.CHILD_COLS.push(t),o+=t.colspan>1?t.colspan:1)})}n.PARENT_COL||a.push(n)})});var n=function(t){layui.each(t||a,function(t,i){return i.CHILD_COLS?n(i.CHILD_COLS):void e(t,i)})};n()},S.prototype.renderData=function(e,n,o,r){var c=this,s=c.config,u=e[s.response.dataName]||[],y=[],p=[],m=[],v=function(){return!r&&c.sortKey?c.sort(c.sortKey.field,c.sortKey.sort,!0):(layui.each(u,function(e,a){var l=[],o=[],u=[],h=e+s.limit*(n-1)+1;0!==a.length&&(r||(a[d.config.indexName]=e),c.eachCols(function(e,n){var r=n.field||e,f=a[r];c.getColElem(c.layHeader,r);if(void 0!==f&&null!==f||(f=""),!(n.colspan>1)){var y=['",'
                                          '+function(){var e=t.extend(!0,{LAY_INDEX:h},a);return"checkbox"===n.type?'":"numbers"===n.type?h:n.toolbar?i(t(n.toolbar).html()||"").render(e):n.templet?function(){return"function"==typeof n.templet?n.templet(e):i(t(n.templet).html()||String(f)).render(e)}():f}(),"
                                          "].join("");l.push(y),n.fixed&&"right"!==n.fixed&&o.push(y),"right"===n.fixed&&u.push(y)}}),y.push(''+l.join("")+""),p.push(''+o.join("")+""),m.push(''+u.join("")+""))}),c.layBody.scrollTop(0),c.layMain.find("."+f).remove(),c.layMain.find("tbody").html(y.join("")),c.layFixLeft.find("tbody").html(p.join("")),c.layFixRight.find("tbody").html(m.join("")),c.renderForm(),c.syncCheckAll(),c.haveInit?c.scrollPatch():setTimeout(function(){c.scrollPatch()},50),c.haveInit=!0,void l.close(c.tipsIndex))};return c.key=s.id||s.index,d.cache[c.key]=u,c.layPage[0===u.length&&1==n?"addClass":"removeClass"](h),r?v():0===u.length?(c.renderForm(),c.layFixed.remove(),c.layMain.find("tbody").html(""),c.layMain.find("."+f).remove(),c.layMain.append('
                                          '+s.text.none+"
                                          ")):(v(),void(s.page&&(s.page=t.extend({elem:"layui-table-page"+s.index,count:o,limit:s.limit,limits:s.limits||[10,20,30,40,50,60,70,80,90],groups:3,layout:["prev","page","next","skip","count","limit"],prev:'',next:'',jump:function(e,t){t||(c.page=e.curr,s.limit=e.limit,c.pullData(e.curr,c.loading()))}},s.page),s.page.count=o,a.render(s.page))))},S.prototype.getColElem=function(e,t){var i=this,a=i.config;return e.eq(0).find(".laytable-cell-"+(a.index+"-"+t)+":eq(0)")},S.prototype.renderForm=function(e){n.render(e,"LAY-table-"+this.index)},S.prototype.sort=function(e,i,a,l){var n,r,c=this,u={},h=c.config,f=h.elem.attr("lay-filter"),y=d.cache[c.key];"string"==typeof e&&c.layHeader.find("th").each(function(i,a){var l=t(this),o=l.data("field");if(o===e)return e=l,n=o,!1});try{var n=n||e.data("field");if(c.sortKey&&!a&&n===c.sortKey.field&&i===c.sortKey.sort)return;var p=c.layHeader.find("th .laytable-cell-"+h.index+"-"+n).find(w);c.layHeader.find("th").find(w).removeAttr("lay-sort"),p.attr("lay-sort",i||null),c.layFixed.find("th")}catch(m){return o.error("Table modules: Did not match to field")}c.sortKey={field:n,sort:i},"asc"===i?r=layui.sort(y,n):"desc"===i?r=layui.sort(y,n,!0):(r=layui.sort(y,d.config.indexName),delete c.sortKey),u[h.response.dataName]=r,c.renderData(u,c.page,c.count,!0),l&&layui.event.call(e,s,"sort("+f+")",{field:n,type:i})},S.prototype.loading=function(){var e=this,t=e.config;if(t.loading&&t.url)return l.msg("数据请求中",{icon:16,offset:[e.elem.offset().top+e.elem.height()/2-35-T.scrollTop()+"px",e.elem.offset().left+e.elem.width()/2-90-T.scrollLeft()+"px"],time:-1,anim:-1,fixed:!1})},S.prototype.setCheckData=function(e,t){var i=this,a=i.config,l=d.cache[i.key];l[e]&&l[e].constructor!==Array&&(l[e][a.checkName]=t)},S.prototype.syncCheckAll=function(){var e=this,t=e.config,i=e.layHeader.find('input[name="layTableCheckbox"]'),a=function(i){return e.eachCols(function(e,a){"checkbox"===a.type&&(a[t.checkName]=i)}),i};i[0]&&(d.checkStatus(e.key).isAll?(i[0].checked||(i.prop("checked",!0),e.renderForm("checkbox")),a(!0)):(i[0].checked&&(i.prop("checked",!1),e.renderForm("checkbox")),a(!1)))},S.prototype.getCssRule=function(e,t){var i=this,a=i.elem.find("style")[0],l=a.sheet||a.styleSheet||{},n=l.cssRules||l.rules;layui.each(n,function(a,l){if(l.selectorText===".laytable-cell-"+i.index+"-"+e)return t(l),!0})},S.prototype.fullSize=function(){var e,t=this,i=t.config,a=i.height;t.fullHeightGap&&(a=T.height()-t.fullHeightGap,a<135&&(a=135),t.elem.css("height",a)),e=parseFloat(a)-parseFloat(t.layHeader.height())-1,i.toolbar&&(e-=t.layTool.outerHeight()),i.page&&(e=e-t.layPage.outerHeight()-1),t.layMain.css("height",e)},S.prototype.getScrollWidth=function(e){var t=0;return e?t=e.offsetWidth-e.clientWidth:(e=document.createElement("div"),e.style.width="100px",e.style.height="100px",e.style.overflowY="scroll",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),t},S.prototype.scrollPatch=function(){var e=this,i=e.layMain.children("table"),a=e.layMain.width()-e.layMain.prop("clientWidth"),l=e.layMain.height()-e.layMain.prop("clientHeight"),n=e.getScrollWidth(e.layMain[0]),o=i.outerWidth()-e.layMain.width();if(e.autoColNums&&o<5&&!e.scrollPatchWStatus){var r=e.layHeader.eq(0).find("thead th:last-child"),d=r.data("field");e.getCssRule(d,function(t){var i=t.style.width||r.outerWidth();t.style.width=parseFloat(i)-n-o+"px",e.layMain.height()-e.layMain.prop("clientHeight")>0&&(t.style.width=parseFloat(t.style.width)-1+"px"),e.scrollPatchWStatus=!0})}if(a&&l){if(!e.elem.find(".layui-table-patch")[0]){var c=t('
                                          ');c.find("div").css({width:a}),e.layHeader.eq(0).find("thead tr").append(c)}}else e.layHeader.eq(0).find(".layui-table-patch").remove();var s=e.layMain.height(),u=s-l;e.layFixed.find(m).css("height",i.height()>u?u:"auto"),e.layFixRight[o>0?"removeClass":"addClass"](h),e.layFixRight.css("right",a-1)},S.prototype.events=function(){var e,a=this,n=a.config,o=t("body"),c={},u=a.layHeader.find("th"),h=".layui-table-cell",f=n.elem.attr("lay-filter");u.on("mousemove",function(e){var i=t(this),a=i.offset().left,l=e.clientX-a;i.attr("colspan")>1||i.data("unresize")||c.resizeStart||(c.allowResize=i.width()-l<=10,o.css("cursor",c.allowResize?"col-resize":""))}).on("mouseleave",function(){t(this);c.resizeStart||o.css("cursor","")}).on("mousedown",function(e){var i=t(this);if(c.allowResize){var l=i.data("field");e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],a.getCssRule(l,function(e){var t=e.style.width||i.outerWidth();c.rule=e,c.ruleWidth=parseFloat(t),c.minWidth=i.data("minwidth")||n.cellMinWidth})}}),M.on("mousemove",function(t){if(c.resizeStart){if(t.preventDefault(),c.rule){var i=c.ruleWidth+t.clientX-c.offset[0];i');d[0].value=e.data("content")||o.text(),e.find("."+N)[0]||e.append(d),d.focus()}else o.find(".layui-form-switch,.layui-form-checkbox")[0]||Math.round(o.prop("scrollWidth"))>Math.round(o.outerWidth())&&(a.tipsIndex=l.tips(['
                                          ',o.html(),"
                                          ",''].join(""),o[0],{tips:[3,""],time:-1,anim:-1,maxWidth:r.ios||r.android?300:600,isOutAnim:!1,skin:"layui-table-tips",success:function(e,t){e.find(".layui-table-tips-c").on("click",function(){l.close(t)})}}))}),a.layBody.on("click","*[lay-event]",function(){var e=t(this),l=e.parents("tr").eq(0).data("index"),n=a.layBody.find('tr[data-index="'+l+'"]'),o="layui-table-click",r=d.cache[a.key][l];layui.event.call(this,s,"tool("+f+")",{data:d.clearCacheKey(r),event:e.attr("lay-event"),tr:n,del:function(){d.cache[a.key][l]=[],n.remove(),a.scrollPatch()},update:function(e){e=e||{},layui.each(e,function(e,l){if(e in r){var o,d=n.children('td[data-field="'+e+'"]');r[e]=l,a.eachCols(function(t,i){i.field==e&&i.templet&&(o=i.templet)}),d.children(h).html(o?i(t(o).html()||l).render(r):l),d.data("content",l)}})}}),n.addClass(o).siblings("tr").removeClass(o)}),a.layMain.on("scroll",function(){var e=t(this),i=e.scrollLeft(),n=e.scrollTop();a.layHeader.scrollLeft(i),a.layFixed.find(m).scrollTop(n),l.close(a.tipsIndex)}),T.on("resize",function(){a.fullSize(),a.scrollPatch()})},d.init=function(e,i){i=i||{};var a=this,l=t(e?'table[lay-filter="'+e+'"]':u+"[lay-data]"),n="Table element property lay-data configuration item has a syntax error: ";return l.each(function(){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){o.error(n+l)}var c=[],s=t.extend({elem:this,cols:[],data:[],skin:a.attr("lay-skin"),size:a.attr("lay-size"),even:"string"==typeof a.attr("lay-even")},d.config,i,l);e&&a.hide(),a.find("thead>tr").each(function(e){s.cols[e]=[],t(this).children().each(function(i){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){return o.error(n+l)}var d=t.extend({title:a.text(),colspan:a.attr("colspan")||0,rowspan:a.attr("rowspan")||0},l);d.colspan<2&&c.push(d),s.cols[e].push(d)})}),a.find("tbody>tr").each(function(e){var i=t(this),a={};i.children("td").each(function(e,i){var l=t(this),n=l.data("field");if(n)return a[n]=l.html()}),layui.each(c,function(e,t){var l=i.children("td").eq(e);a[t.field]=l.html()}),s.data[e]=a}),d.render(s)}),a},d.checkStatus=function(e){var t=0,i=0,a=[],l=d.cache[e]||[];return layui.each(l,function(e,l){return l.constructor===Array?void i++:void(l[d.config.checkName]&&(t++,a.push(d.clearCacheKey(l))))}),{data:a,isAll:!!l.length&&t===l.length-i}},c.config={},d.reload=function(e,i){var a=c.config[e];return i=i||{},a?(i.data&&i.data.constructor===Array&&delete a.data,d.render(t.extend(!0,{},a,i))):o.error("The ID option was not found in the table instance")},d.render=function(e){var t=new S(e);return c.call(t)},d.clearCacheKey=function(e){return e=t.extend({},e),delete e[d.config.checkName],delete e[d.config.indexName],e},d.init(),e(s,d)});layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['",'"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['
                                            ',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("")}),i.join("")}(),"
                                          "].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a',e.bar1?'
                                        • '+c[0]+"
                                        • ":"",e.bar2?'
                                        • '+c[1]+"
                                        • ":"",'
                                        • '+c[2]+"
                                        • ","
                                        "].join("")),s=g.find("."+r),u=function(){var t=n.scrollTop();t>=e.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};t("."+a)[0]||("object"==typeof e.css&&g.css(e.css),l.append(g),u(),g.find("li").on("click",function(){var i=t(this),o=i.attr("lay-type");"top"===o&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,o)}),n.on("scroll",function(){clearTimeout(o),o=setTimeout(function(){u()},100)}))},countdown:function(e,t,i){var o=this,a="function"==typeof t,r=new Date(e).getTime(),n=new Date(!t||a?(new Date).getTime():t).getTime(),l=r-n,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=t);var g=setTimeout(function(){o.countdown(e,n+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,g),l<=0&&clearTimeout(g),g},timeAgo:function(e,t){var i=this,o=[[],[]],a=(new Date).getTime()-new Date(e).getTime();return a>6912e5?(a=new Date(e),o[0][0]=i.digit(a.getFullYear(),4),o[0][1]=i.digit(a.getMonth()+1),o[0][2]=i.digit(a.getDate()),t||(o[1][0]=i.digit(a.getHours()),o[1][1]=i.digit(a.getMinutes()),o[1][2]=i.digit(a.getSeconds())),o[0].join("-")+" "+o[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=12e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var o=e.length;o
                                        ';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;su)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)});layui.define(["layer","form"],function(t){"use strict";var e=layui.$,i=layui.layer,a=layui.form,l=(layui.hint(),layui.device()),n="layedit",o="layui-show",r="layui-disabled",c=function(){var t=this;t.index=0,t.config={tool:["strong","italic","underline","del","|","left","center","right","|","link","unlink","face","image"],hideTool:[],height:280}};c.prototype.set=function(t){var i=this;return e.extend(!0,i.config,t),i},c.prototype.on=function(t,e){return layui.onevent(n,t,e)},c.prototype.build=function(t,i){i=i||{};var a=this,n=a.config,r="layui-layedit",c=e("#"+t),u="LAY_layedit_"+ ++a.index,d=c.next("."+r),y=e.extend({},n,i),f=function(){var t=[],e={};return layui.each(y.hideTool,function(t,i){e[i]=!0}),layui.each(y.tool,function(i,a){C[a]&&!e[a]&&t.push(C[a])}),t.join("")}(),m=e(['
                                        ','
                                        '+f+"
                                        ",'
                                        ','',"
                                        ","
                                        "].join(""));return l.ie&&l.ie<8?c.removeClass("layui-hide").addClass(o):(d[0]&&d.remove(),s.call(a,m,c[0],y),c.addClass("layui-hide").after(m),a.index)},c.prototype.getContent=function(t){var e=u(t);if(e[0])return d(e[0].document.body.innerHTML)},c.prototype.getText=function(t){var i=u(t);if(i[0])return e(i[0].document.body).text()},c.prototype.setContent=function(t,i,a){var l=u(t);l[0]&&(a?e(l[0].document.body).append(i):e(l[0].document.body).html(i),layedit.sync(t))},c.prototype.sync=function(t){var i=u(t);if(i[0]){var a=e("#"+i[1].attr("textarea"));a.val(d(i[0].document.body.innerHTML))}},c.prototype.getSelection=function(t){var e=u(t);if(e[0]){var i=m(e[0].document);return document.selection?i.text:i.toString()}};var s=function(t,i,a){var l=this,n=t.find("iframe");n.css({height:a.height}).on("load",function(){var o=n.contents(),r=n.prop("contentWindow"),c=o.find("head"),s=e([""].join("")),u=o.find("body");c.append(s),u.attr("contenteditable","true").css({"min-height":a.height}).html(i.value||""),y.apply(l,[r,n,i,a]),g.call(l,r,t,a)})},u=function(t){var i=e("#LAY_layedit_"+t),a=i.prop("contentWindow");return[a,i]},d=function(t){return 8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),t},y=function(t,a,n,o){var r=t.document,c=e(r.body);c.on("keydown",function(t){var e=t.keyCode;if(13===e){var a=m(r),l=p(a),n=l.parentNode;if("pre"===n.tagName.toLowerCase()){if(t.shiftKey)return;return i.msg("请暂时用shift+enter"),!1}r.execCommand("formatBlock",!1,"

                                        ")}}),e(n).parents("form").on("submit",function(){var t=c.html();8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),n.value=t}),c.on("paste",function(e){r.execCommand("formatBlock",!1,"

                                        "),setTimeout(function(){f.call(t,c),n.value=c.html()},100)})},f=function(t){var i=this;i.document;t.find("*[style]").each(function(){var t=this.style.textAlign;this.removeAttribute("style"),e(this).css({"text-align":t||""})}),t.find("table").addClass("layui-table"),t.find("script,link").remove()},m=function(t){return t.selection?t.selection.createRange():t.getSelection().getRangeAt(0)},p=function(t){return t.endContainer||t.parentElement().childNodes[0]},v=function(t,i,a){var l=this.document,n=document.createElement(t);for(var o in i)n.setAttribute(o,i[o]);if(n.removeAttribute("text"),l.selection){var r=a.text||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.pasteHTML(e(n).prop("outerHTML")),a.select()}else{var r=a.toString()||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.deleteContents(),a.insertNode(n)}},h=function(t,i){var a=this.document,l="layedit-tool-active",n=p(m(a)),o=function(e){return t.find(".layedit-tool-"+e)};i&&i[i.hasClass(l)?"removeClass":"addClass"](l),t.find(">i").removeClass(l),o("unlink").addClass(r),e(n).parents().each(function(){var t=this.tagName.toLowerCase(),e=this.style.textAlign;"b"!==t&&"strong"!==t||o("b").addClass(l),"i"!==t&&"em"!==t||o("i").addClass(l),"u"===t&&o("u").addClass(l),"strike"===t&&o("d").addClass(l),"p"===t&&("center"===e?o("center").addClass(l):"right"===e?o("right").addClass(l):o("left").addClass(l)),"a"===t&&(o("link").addClass(l),o("unlink").removeClass(r))})},g=function(t,a,l){var n=t.document,o=e(n.body),c={link:function(i){var a=p(i),l=e(a).parent();b.call(o,{href:l.attr("href"),target:l.attr("target")},function(e){var a=l[0];"A"===a.tagName?a.href=e.url:v.call(t,"a",{target:e.target,href:e.url,text:e.url},i)})},unlink:function(t){n.execCommand("unlink")},face:function(e){x.call(this,function(i){v.call(t,"img",{src:i.src,alt:i.alt},e)})},image:function(a){var n=this;layui.use("upload",function(o){var r=l.uploadImage||{};o.render({url:r.url,method:r.type,elem:e(n).find("input")[0],done:function(e){0==e.code?(e.data=e.data||{},v.call(t,"img",{src:e.data.src,alt:e.data.title},a)):i.msg(e.msg||"上传失败")}})})},code:function(e){k.call(o,function(i){v.call(t,"pre",{text:i.code,"lay-lang":i.lang},e)})},help:function(){i.open({type:2,title:"帮助",area:["600px","380px"],shadeClose:!0,shade:.1,skin:"layui-layer-msg",content:["http://www.layui.com/about/layedit/help.html","no"]})}},s=a.find(".layui-layedit-tool"),u=function(){var i=e(this),a=i.attr("layedit-event"),l=i.attr("lay-command");if(!i.hasClass(r)){o.focus();var u=m(n);u.commonAncestorContainer;l?(n.execCommand(l),/justifyLeft|justifyCenter|justifyRight/.test(l)&&n.execCommand("formatBlock",!1,"

                                        "),setTimeout(function(){o.focus()},10)):c[a]&&c[a].call(this,u),h.call(t,s,i)}},d=/image/;s.find(">i").on("mousedown",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)||u.call(this)}).on("click",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)&&u.call(this)}),o.on("click",function(){h.call(t,s),i.close(x.index)})},b=function(t,e){var l=this,n=i.open({type:1,id:"LAY_layedit_link",area:"350px",shade:.05,shadeClose:!0,moveType:1,title:"超链接",skin:"layui-layer-msg",content:['

                                          ','
                                        • ','','
                                          ','',"
                                          ","
                                        • ",'
                                        • ','','
                                          ','",'","
                                          ","
                                        • ",'
                                        • ','','',"
                                        • ","
                                        "].join(""),success:function(t,n){var o="submit(layedit-link-yes)";a.render("radio"),t.find(".layui-btn-primary").on("click",function(){i.close(n),l.focus()}),a.on(o,function(t){i.close(b.index),e&&e(t.field)})}});b.index=n},x=function(t){var a=function(){var t=["[微笑]","[嘻嘻]","[哈哈]","[可爱]","[可怜]","[挖鼻]","[吃惊]","[害羞]","[挤眼]","[闭嘴]","[鄙视]","[爱你]","[泪]","[偷笑]","[亲亲]","[生病]","[太开心]","[白眼]","[右哼哼]","[左哼哼]","[嘘]","[衰]","[委屈]","[吐]","[哈欠]","[抱抱]","[怒]","[疑问]","[馋嘴]","[拜拜]","[思考]","[汗]","[困]","[睡]","[钱]","[失望]","[酷]","[色]","[哼]","[鼓掌]","[晕]","[悲伤]","[抓狂]","[黑线]","[阴险]","[怒骂]","[互粉]","[心]","[伤心]","[猪头]","[熊猫]","[兔子]","[ok]","[耶]","[good]","[NO]","[赞]","[来]","[弱]","[草泥马]","[神马]","[囧]","[浮云]","[给力]","[围观]","[威武]","[奥特曼]","[礼物]","[钟]","[话筒]","[蜡烛]","[蛋糕]"],e={};return layui.each(t,function(t,i){e[i]=layui.cache.dir+"images/face/"+t+".gif"}),e}();return x.hide=x.hide||function(t){"face"!==e(t.target).attr("layedit-event")&&i.close(x.index)},x.index=i.tips(function(){var t=[];return layui.each(a,function(e,i){t.push('
                                      • '+e+'
                                      • ')}),'
                                          '+t.join("")+"
                                        "}(),this,{tips:1,time:0,skin:"layui-box layui-util-face",maxWidth:500,success:function(l,n){l.css({marginTop:-4,marginLeft:-10}).find(".layui-clear>li").on("click",function(){t&&t({src:a[this.title],alt:this.title}),i.close(n)}),e(document).off("click",x.hide).on("click",x.hide)}})},k=function(t){var e=this,l=i.open({type:1,id:"LAY_layedit_code",area:"550px",shade:.05,shadeClose:!0,moveType:1,title:"插入代码",skin:"layui-layer-msg",content:['
                                          ','
                                        • ','','
                                          ','","
                                          ","
                                        • ",'
                                        • ','','
                                          ','',"
                                          ","
                                        • ",'
                                        • ','','',"
                                        • ","
                                        "].join(""),success:function(l,n){var o="submit(layedit-code-yes)";a.render("select"),l.find(".layui-btn-primary").on("click",function(){i.close(n),e.focus()}),a.on(o,function(e){i.close(k.index),t&&t(e.field)})}});k.index=l},C={html:'',strong:'',italic:'',underline:'',del:'',"|":'',left:'',center:'',right:'',link:'',unlink:'',face:'',image:'',code:'',help:''},w=new c;t(n,w)});layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
                                        1. '+o.replace(/[\r\t\n]+/g,"
                                        2. ")+"
                                        "),c.find(">.layui-code-h3")[0]||c.prepend('

                                        '+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

                                        ");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); \ No newline at end of file diff --git a/static/layui/layui.js b/static/layui/layui.js deleted file mode 100644 index 8faa576fb..000000000 --- a/static/layui/layui.js +++ /dev/null @@ -1,2 +0,0 @@ -/** layui-v2.2.5 MIT License By https://www.layui.com */ - ;!function(e){"use strict";var t=document,n={modules:{},status:{},timeout:10,event:{}},o=function(){this.v="2.2.5"},r=function(){var e=t.currentScript?t.currentScript.src:function(){for(var e,n=t.scripts,o=n.length-1,r=o;r>0;r--)if("interactive"===n[r].readyState){e=n[r].src;break}return e||n[o].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),a=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},i="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",tree:"modules/tree",table:"modules/table",element:"modules/element",util:"modules/util",flow:"modules/flow",carousel:"modules/carousel",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};o.prototype.cache=n,o.prototype.define=function(e,t){var o=this,r="function"==typeof e,a=function(){var e=function(e,t){layui[e]=t,n.status[e]=!0};return"function"==typeof t&&t(function(o,r){e(o,r),n.callback[o]=function(){t(e)}}),this};return r&&(t=e,e=[]),layui["layui.all"]||!layui["layui.all"]&&layui["layui.mobile"]?a.call(o):(o.use(e,a),o)},o.prototype.use=function(e,o,l){function s(e,t){var o="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||o.test((e.currentTarget||e.srcElement).readyState))&&(n.modules[f]=t,d.removeChild(v),function r(){return++m>1e3*n.timeout/4?a(f+" is not a valid module"):void(n.status[f]?c():setTimeout(r,4))}())}function c(){l.push(layui[f]),e.length>1?y.use(e.slice(1),o,l):"function"==typeof o&&o.apply(layui,l)}var y=this,p=n.dir=n.dir?n.dir:r,d=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,n){"jquery"===n&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],n.host=n.host||(p.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[f]||!layui["layui.all"]&&layui["layui.mobile"]&&u[f])return c(),y;if(n.modules[f])!function g(){return++m>1e3*n.timeout/4?a(f+" is not a valid module"):void("string"==typeof n.modules[f]&&n.status[f]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[f]?p+"lay/":/^\{\/\}/.test(y.modules[f])?"":n.base||"")+(y.modules[f]||f)+".js";h=h.replace(/^\{\/\}/,""),v.async=!0,v.charset="utf-8",v.src=h+function(){var e=n.version===!0?n.v||(new Date).getTime():n.version||"";return e?"?v="+e:""}(),d.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||i?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),n.modules[f]=h}return y},o.prototype.getStyle=function(t,n){var o=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return o[o.getPropertyValue?"getPropertyValue":"getAttribute"](n)},o.prototype.link=function(e,o,r){var i=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof o&&(r=o);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(n.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof o?i:(function p(){return++y>1e3*n.timeout/100?a(e+" timeout"):void(1989===parseInt(i.getStyle(t.getElementById(c),"width"))?function(){o()}():setTimeout(p,100))}(),i)},n.callback={},o.prototype.factory=function(e){if(layui[e])return"function"==typeof n.callback[e]?n.callback[e]:null},o.prototype.addcss=function(e,t,o){return layui.link(n.dir+"css/"+e,t,o)},o.prototype.img=function(e,t,n){var o=new Image;return o.src=e,o.complete?t(o):(o.onload=function(){o.onload=null,t(o)},void(o.onerror=function(e){o.onerror=null,n(e)}))},o.prototype.config=function(e){e=e||{};for(var t in e)n[t]=e[t];return this},o.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),o.prototype.extend=function(e){var t=this;e=e||{};for(var n in e)t[n]||t.modules[n]?a("模块名 "+n+" 已被占用"):t.modules[n]=e[n];return t},o.prototype.router=function(e){var t=this,e=e||location.hash,n={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(n.href=e=e.replace(/^#\//,""),e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),n.search[t[0]]=t[1]}():n.path.push(t)}),n):n},o.prototype.data=function(t,n,o){if(t=t||"layui",o=o||localStorage,e.JSON&&e.JSON.parse){if(null===n)return delete o[t];n="object"==typeof n?n:{key:n};try{var r=JSON.parse(o[t])}catch(a){var r={}}return"value"in n&&(r[n.key]=n.value),n.remove&&delete r[n.key],o[t]=JSON.stringify(r),n.key?r[n.key]:r}},o.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},o.prototype.device=function(t){var n=navigator.userAgent.toLowerCase(),o=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(n.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(n)?"windows":/linux/.test(n)?"linux":/iphone|ipod|ipad|ios/.test(n)?"ios":/mac/.test(n)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((n.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:o("micromessenger")};return t&&!r[t]&&(r[t]=o(t)),r.android=/android/.test(n),r.ios="ios"===r.os,r},o.prototype.hint=function(){return{error:a}},o.prototype.each=function(e,t){var n,o=this;if("function"!=typeof t)return o;if(e=e||[],e.constructor===Object){for(n in e)if(t.call(e[n],n,e[n]))break}else for(n=0;na?1:r