Forráskód Böngészése

用户查看内容权限

任敬轩 3 éve
szülő
commit
522380ab1a
100 módosított fájl, 4250 hozzáadás és 69 törlés
  1. 3 1
      Modules/Admin/Database/Migrations/2022_05_11_103753_update_users_table.php
  2. 19 23
      Modules/Admin/Http/Controllers/UsersController.php
  3. 9 24
      Modules/Admin/Resources/views/roles.blade.php
  4. 53 13
      Modules/Camera/Http/Controllers/CameraController.php
  5. 1 1
      Modules/Camera/Resources/views/camera_list.blade.php
  6. 1 2
      Modules/Mine/Http/Controllers/MineController.php
  7. 1 1
      Modules/Mine/Http/Controllers/SurfaceController.php
  8. 15 2
      Modules/Mine/Services/MineServices.php
  9. 6 2
      Modules/Mine/Services/SurfaceServices.php
  10. 547 0
      public/js/admin/layui/admin.js
  11. 2 0
      public/js/admin/layui/css/layui.css
  12. 2 0
      public/js/admin/layui/css/layui.mobile.css
  13. 2 0
      public/js/admin/layui/css/modules/code.css
  14. 2 0
      public/js/admin/layui/css/modules/laydate/default/laydate.css
  15. BIN
      public/js/admin/layui/css/modules/layer/default/icon-ext.png
  16. BIN
      public/js/admin/layui/css/modules/layer/default/icon.png
  17. 2 0
      public/js/admin/layui/css/modules/layer/default/layer.css
  18. BIN
      public/js/admin/layui/css/modules/layer/default/loading-0.gif
  19. BIN
      public/js/admin/layui/css/modules/layer/default/loading-1.gif
  20. BIN
      public/js/admin/layui/css/modules/layer/default/loading-2.gif
  21. 76 0
      public/js/admin/layui/eleDel.js
  22. 571 0
      public/js/admin/layui/extends/authtree.js
  23. 1417 0
      public/js/admin/layui/extends/eleTree.js
  24. 1 0
      public/js/admin/layui/extends/formSelects-v4.min.js
  25. 288 0
      public/js/admin/layui/extends/selectM.js
  26. 279 0
      public/js/admin/layui/extends/selectN.js
  27. 468 0
      public/js/admin/layui/extends/tabmenu.js
  28. BIN
      public/js/admin/layui/font/iconfont.eot
  29. 485 0
      public/js/admin/layui/font/iconfont.svg
  30. BIN
      public/js/admin/layui/font/iconfont.ttf
  31. BIN
      public/js/admin/layui/font/iconfont.woff
  32. BIN
      public/js/admin/layui/font/iconfont.woff2
  33. BIN
      public/js/admin/layui/images/face/0.gif
  34. BIN
      public/js/admin/layui/images/face/1.gif
  35. BIN
      public/js/admin/layui/images/face/10.gif
  36. BIN
      public/js/admin/layui/images/face/11.gif
  37. BIN
      public/js/admin/layui/images/face/12.gif
  38. BIN
      public/js/admin/layui/images/face/13.gif
  39. BIN
      public/js/admin/layui/images/face/14.gif
  40. BIN
      public/js/admin/layui/images/face/15.gif
  41. BIN
      public/js/admin/layui/images/face/16.gif
  42. BIN
      public/js/admin/layui/images/face/17.gif
  43. BIN
      public/js/admin/layui/images/face/18.gif
  44. BIN
      public/js/admin/layui/images/face/19.gif
  45. BIN
      public/js/admin/layui/images/face/2.gif
  46. BIN
      public/js/admin/layui/images/face/20.gif
  47. BIN
      public/js/admin/layui/images/face/21.gif
  48. BIN
      public/js/admin/layui/images/face/22.gif
  49. BIN
      public/js/admin/layui/images/face/23.gif
  50. BIN
      public/js/admin/layui/images/face/24.gif
  51. BIN
      public/js/admin/layui/images/face/25.gif
  52. BIN
      public/js/admin/layui/images/face/26.gif
  53. BIN
      public/js/admin/layui/images/face/27.gif
  54. BIN
      public/js/admin/layui/images/face/28.gif
  55. BIN
      public/js/admin/layui/images/face/29.gif
  56. BIN
      public/js/admin/layui/images/face/3.gif
  57. BIN
      public/js/admin/layui/images/face/30.gif
  58. BIN
      public/js/admin/layui/images/face/31.gif
  59. BIN
      public/js/admin/layui/images/face/32.gif
  60. BIN
      public/js/admin/layui/images/face/33.gif
  61. BIN
      public/js/admin/layui/images/face/34.gif
  62. BIN
      public/js/admin/layui/images/face/35.gif
  63. BIN
      public/js/admin/layui/images/face/36.gif
  64. BIN
      public/js/admin/layui/images/face/37.gif
  65. BIN
      public/js/admin/layui/images/face/38.gif
  66. BIN
      public/js/admin/layui/images/face/39.gif
  67. BIN
      public/js/admin/layui/images/face/4.gif
  68. BIN
      public/js/admin/layui/images/face/40.gif
  69. BIN
      public/js/admin/layui/images/face/41.gif
  70. BIN
      public/js/admin/layui/images/face/42.gif
  71. BIN
      public/js/admin/layui/images/face/43.gif
  72. BIN
      public/js/admin/layui/images/face/44.gif
  73. BIN
      public/js/admin/layui/images/face/45.gif
  74. BIN
      public/js/admin/layui/images/face/46.gif
  75. BIN
      public/js/admin/layui/images/face/47.gif
  76. BIN
      public/js/admin/layui/images/face/48.gif
  77. BIN
      public/js/admin/layui/images/face/49.gif
  78. BIN
      public/js/admin/layui/images/face/5.gif
  79. BIN
      public/js/admin/layui/images/face/50.gif
  80. BIN
      public/js/admin/layui/images/face/51.gif
  81. BIN
      public/js/admin/layui/images/face/52.gif
  82. BIN
      public/js/admin/layui/images/face/53.gif
  83. BIN
      public/js/admin/layui/images/face/54.gif
  84. BIN
      public/js/admin/layui/images/face/55.gif
  85. BIN
      public/js/admin/layui/images/face/56.gif
  86. BIN
      public/js/admin/layui/images/face/57.gif
  87. BIN
      public/js/admin/layui/images/face/58.gif
  88. BIN
      public/js/admin/layui/images/face/59.gif
  89. BIN
      public/js/admin/layui/images/face/6.gif
  90. BIN
      public/js/admin/layui/images/face/60.gif
  91. BIN
      public/js/admin/layui/images/face/61.gif
  92. BIN
      public/js/admin/layui/images/face/62.gif
  93. BIN
      public/js/admin/layui/images/face/63.gif
  94. BIN
      public/js/admin/layui/images/face/64.gif
  95. BIN
      public/js/admin/layui/images/face/65.gif
  96. BIN
      public/js/admin/layui/images/face/66.gif
  97. BIN
      public/js/admin/layui/images/face/67.gif
  98. BIN
      public/js/admin/layui/images/face/68.gif
  99. BIN
      public/js/admin/layui/images/face/69.gif
  100. 0 0
      public/js/admin/layui/images/face/7.gif

+ 3 - 1
Modules/Admin/Database/Migrations/2022_05_11_103753_update_users_table.php

@@ -13,7 +13,9 @@ class UpdateUsersTable extends Migration
      */
     public function up()
     {
-        //
+        Schema::table('users', function (Blueprint $table) {
+            $table->string('mine_role')->nullable()->comment('区域权限');
+        });
     }
 
     /**

+ 19 - 23
Modules/Admin/Http/Controllers/UsersController.php

@@ -53,7 +53,7 @@ class UsersController extends BaseController
                 'isShow' => function ($item) {
                     return true;
                 },
-                'isJump' => 1,
+
             ],
             [
                 'name'   => '重置密码',
@@ -196,34 +196,30 @@ class UsersController extends BaseController
     //权限修改
     public function roles(Request $request)
     {
+        $params = $request->all();
         if ($request->isMethod('post')) {
-//            $roleData['title']      = $request->input('name');
-//            $roleData['guard_name'] = 'admin';
-//            $roleData['name']       = implode(array_map(function ($v) {
-//                return ucfirst($v);
-//            }, pinyin($request->input('name'))));
-//
-//            // 添加角色
-//            $roler = Role::updateOrCreate(['id' => $request->input('id') ?? ''], $roleData);
-//            if ($request->has('id')) {  // 同步权限
-//                $roler->syncPermissions($request->input('authids'));
-//            } else {  // 添加权限
-//                $roler->givePermissionTo($request->input('authids'));
-//            }
-//            return $this->redirect('/admin/roles/list');
-            dd(123);
+            $res['mine_role'] = "";
+            if(isset($params['mine_id'])){
+                foreach($params['mine_id'] as $k=>$v){
+                    $res['mine_role'] = $res['mine_role'] . $v . ';';
+                }
+                $res['mine_role'] = substr($res['mine_role'], 0, strlen($res['mine_role']) - 1);
+            }
+            DB::table('users')->where('staff_num',$params['staff_num'])->update($res);
+            $data['code'] = 0;
+            return $data;
         }
+
         $mine_parent = DB::table('mine_list')->where('parent_id',0)->where('deleted_at',null)->get();
         $data['menusAll'] = $mine_parent;
         $data['title']    = '更改权限';
-
-        if (!$request->has('id')) {
-            return $this->redirect('/admin/users/list');
+        $user = DB::table('users')->where('staff_num',$params['staff_num'])->first();
+        $checkedId = explode(';',$user->mine_role);
+        foreach($checkedId as $k=>$v){
+            $checkedId[$k] = (int)$v;
         }
-
-//        $roler             = Role::find($request->input('id'));
-//        $data['checkedId'] = $roler->getAllPermissions()->pluck('name')->all();
-//        $data['roler']     = $roler;
+        $data['checkedId'] = $checkedId;
+        $data['staff_num'] = $params['staff_num'];
         return $this->view('admin::roles', $data);
     }
 }

+ 9 - 24
Modules/Admin/Resources/views/roles.blade.php

@@ -4,10 +4,7 @@
 
 <form class="layui-form">
     <div class="layui-form-item">
-        @if(isset($roler))
-            <input type="hidden" name="id" value="{{ $roler['id'] }}">
-        @endif
-
+         <input type="hidden" name="staff_num" id="staff_num" value="{{ $staff_num }}">
     </div>
 
     <div class="layui-form-item">
@@ -40,16 +37,13 @@
         var form = layui.form;
         var layer = layui.layer;
         // 初始化
-
         var trees = authtree.listConvert(@json($menusAll), {
             primaryKey: 'id'
             , startPid: 0
             , parentKey: 'parent_id'
             , nameKey: 'title'
-            , valueKey: 'slug'
-            @if(isset($roler))
-            , checkedKey: @json($checkedId)
-            @endif
+            , valueKey: 'id'
+            , checkedKey: eval(<?php echo json_encode($checkedId);?>)
         });
 
         // 渲染时传入渲染目标ID,树形结构数据(具体结构看样例,checked表示默认选中),以及input表单的名字
@@ -82,22 +76,13 @@
         form.on('submit(LAY-auth-tree-submit)', function (obj) {
             var authids = authtree.getChecked('#LAY-auth-tree-index');
             console.log('Choosed authids is', authids);
-            $.ajax({
-                @if(isset($path))
-                url: '{{ $path }}',
-                @else
-                url: '/admin/roles/edit',
-                @endif
-                method: 'post',
-                dataType: 'json',
-                data: obj.field,
-                success: function (res) {
-                    if (res.code === 0) {
-                        layer.msg('提交成功!');
-                        location.href = res.data.url;
-                    }
+            var staff_num = $('#staff_num').val();
+            $.post('/admin/users/roles/edit',{'staff_num':staff_num,'mine_id':authids},function(res){
+                if (res.code === 0) {
+                    layer.msg('提交成功!');
+                    location.href = '/admin/users/list';
                 }
-            });
+            })
             return false;
         });
 

+ 53 - 13
Modules/Camera/Http/Controllers/CameraController.php

@@ -42,10 +42,20 @@ class CameraController extends BaseController
         $this->menusActive[0] = 'adminCamera';
         $this->menusActive[1] = 'adminCameraList';
 
+        //查询当前登录用户权限内的区域
+        $user = DB::table('users')->where('staff_num',$request->user()->staff_num)->first();
+        $mine_array = explode(';',$user->mine_role);//权限内的矿区
+        $mine_all = DB::table('mine_list')->where('deleted_at',null)->get();//所有区域
+        $mine_use = [];//权限内矿区下所有区域
+        foreach($mine_all as $k=>$v){
+            if(in_array(explode('|',$v->degree)[0],$mine_array)){
+                $mine_use[] = $v->id;
+            }
+        }
+
         $camera_list = CameraList::join(
             'mine_list', 'camera_list.mine_id', '=', 'mine_list.id'
-        )->orderBy('camera_list.sort', 'desc');
-
+        )->whereIn('mine_list.id',$mine_use)->orderBy('camera_list.sort', 'desc');
 
         if ($request->has('mine_name') && $request->input('mine_name')) {
             $mine_id = MineList::where('title', 'like', '%' . $request->input('mine_name') . '%')->where('parent_id', 0)->get();
@@ -169,7 +179,7 @@ class CameraController extends BaseController
         $data                        += \Illuminate\Support\Facades\Request::except('_token');
 
         //区域列表
-        $mine_list = DB::table('mine_list')->where('parent_id',0)->where('deleted_at',null)->get();
+        $mine_list = DB::table('mine_list')->whereIn('id',$mine_array)->where('parent_id',0)->where('deleted_at',null)->get();
         $tree_data = [];
         foreach($mine_list as $k=>$v){
             $tree_data[$v->id]['id'] = $v->id;
@@ -187,9 +197,21 @@ class CameraController extends BaseController
     }
 
     //摄像头管理区域列表ajax
-    public function mineList(){
+    public function mineList(Request $request){
+        //查询当前登录用户权限内的区域
+        $user = DB::table('users')->where('staff_num',$request->user()->staff_num)->first();
+        $mine_array = explode(';',$user->mine_role);//权限内的矿区
+        $mine_all = DB::table('mine_list')->where('deleted_at',null)->get();//所有区域
+        $mine_use = [];//权限内矿区下所有区域
+        foreach($mine_all as $k=>$v){
+            if(in_array(explode('|',$v->degree)[0],$mine_array)){
+                $mine_use[] = $v->id;
+            }
+        }
+
         //区域列表
-        $mine_list = DB::table('mine_list')->where('parent_id',0)->where('deleted_at',null)->get();
+        $mine_list = DB::table('mine_list')->whereIn('id',$mine_use)->where('parent_id',0)->where('deleted_at',null)->get();
+
         $tree_data = [];
         foreach($mine_list as $k=>$v){
             $tree_data[$v->id]['id'] = $v->id;
@@ -206,14 +228,21 @@ class CameraController extends BaseController
     }
 
     //摄像头管理区域列表ajax
-    public function cameraUpdate(){
-//        $camera_list = DB::table('camera_list')->where('mine_id',$_GET['id'])->get();
-//        foreach($camera_list as $k=>$v){
-//            $v->camera_type =   CameraEnum::CAMERA_TYPE_EXCHANGE[$v->camera_type];
-//        }
+    public function cameraUpdate(Request $request){
+        //查询当前登录用户权限内的区域
+        $user = DB::table('users')->where('staff_num',$request->user()->staff_num)->first();
+        $mine_array = explode(';',$user->mine_role);//权限内的矿区
+        $mine_all = DB::table('mine_list')->where('deleted_at',null)->get();//所有区域
+        $mine_use = [];//权限内矿区下所有区域
+        foreach($mine_all as $k=>$v){
+            if(in_array(explode('|',$v->degree)[0],$mine_array)){
+                $mine_use[] = $v->id;
+            }
+        }
+
         $camera_list = CameraList::join(
             'mine_list', 'camera_list.mine_id', '=', 'mine_list.id'
-        )->orderBy('camera_list.sort', 'desc');
+        )->whereIn('mine_list.id',$mine_use)->orderBy('camera_list.sort', 'desc');
 
         if ($_GET['mine_id'] != '' && $_GET['mine_id'] != null) {
             $camera_list = $camera_list->where('camera_list.mine_id', $_GET['mine_id']);
@@ -254,10 +283,21 @@ class CameraController extends BaseController
     }
 
     //摄像头管理区域列表ajax
-    public function camerapage(){
+    public function camerapage(Request $request){
+        //查询当前登录用户权限内的区域
+        $user = DB::table('users')->where('staff_num',$request->user()->staff_num)->first();
+        $mine_array = explode(';',$user->mine_role);//权限内的矿区
+        $mine_all = DB::table('mine_list')->where('deleted_at',null)->get();//所有区域
+        $mine_use = [];//权限内矿区下所有区域
+        foreach($mine_all as $k=>$v){
+            if(in_array(explode('|',$v->degree)[0],$mine_array)){
+                $mine_use[] = $v->id;
+            }
+        }
+
         $camera_list = CameraList::join(
             'mine_list', 'camera_list.mine_id', '=', 'mine_list.id'
-        )->orderBy('camera_list.sort', 'desc');
+        )->whereIn('mine_list.id',$mine_use)->orderBy('camera_list.sort', 'desc');
 
         if ($_GET['mine_id'] != '' && $_GET['mine_id'] != null) {
             $camera_list = $camera_list->where('camera_list.mine_id', $_GET['mine_id']);

+ 1 - 1
Modules/Camera/Resources/views/camera_list.blade.php

@@ -94,7 +94,7 @@
 
 <div @if(request()->ajax()) style="max-height: 600px;overflow-y: auto;" @endif>
     @if(count($searchs) > 0)
-        <div style="width:200px;max-height:615px;position:absolute;" id="mine_list">
+        <div style="width:200px;height:615px;position:absolute;" id="mine_list">
             <div class="row">
                 <div class="col-sm-6">
                     <div class="widget-box" style="margin-top:0;width:130%;">

+ 1 - 2
Modules/Mine/Http/Controllers/MineController.php

@@ -29,8 +29,7 @@ class MineController extends BaseController
     {
         $this->menusActive[0] = 'adminMine';
         $this->menusActive[1] = 'adminMineList';
-
-        $list = MineServices::getAdminMineList();
+        $list = MineServices::getAdminMineList($request->user()->staff_num);
         $tableObj = new TreeAuxiliary('mine/list', $list);
         $tableObj->column('title', '区域名称');
         $tableObj->column('sort', '排序');

+ 1 - 1
Modules/Mine/Http/Controllers/SurfaceController.php

@@ -36,7 +36,7 @@ class SurfaceController extends BaseController
         $this->menusActive[0] = 'adminSurface';
         $this->menusActive[1] = 'adminSurfaceList';
 
-        $list = SurfaceServices::getSurfaceList();
+        $list = SurfaceServices::getSurfaceList($request->user()->staff_num);
 
         $tableObj = new TableAuxiliary('surface/list', $list);
         $tableObj->column('title', '矿区单位名称');

+ 15 - 2
Modules/Mine/Services/MineServices.php

@@ -19,6 +19,7 @@ use Modules\Camera\Http\Controllers\Api\HaiKangController;
 use Modules\Mine\Entities\MineList;
 use Modules\Mine\Entities\MineListExt;
 use Modules\Mine\Enum\MineEnum;
+use DB;
 
 class MineServices{
 
@@ -196,9 +197,21 @@ class MineServices{
     }
 
     //查询后台矿区列表
-    public static function getAdminMineList()
+    public static function getAdminMineList($staff_num)
     {
-        $mine_list = MineList::orderBy('sort', 'desc')->get()->toArray();
+        //查询当前登录用户权限内的区域
+        $user = DB::table('users')->where('staff_num',$staff_num)->first();
+        $mine_array = explode(';',$user->mine_role);//权限内的矿区
+        $mine_all = DB::table('mine_list')->where('deleted_at',null)->get();//所有区域
+        $mine_use = [];//权限内矿区下所有区域
+        foreach($mine_all as $k=>$v){
+            if(in_array(explode('|',$v->degree)[0],$mine_array)){
+                $mine_use[] = $v->id;
+            }
+        }
+
+        $mine_list = MineList::whereIn('id',$mine_use)->orderBy('sort', 'desc')->get()->toArray();
+
         if ($mine_list) {
             $result = self::sortMineListExt($mine_list);
             foreach ($result as $key => $val) {

+ 6 - 2
Modules/Mine/Services/SurfaceServices.php

@@ -19,15 +19,19 @@ use Modules\Mine\Entities\MineList;
 use Modules\Mine\Entities\WorkingSurface;
 use Modules\Mine\Entities\WorkingSurfaceCamera;
 use Modules\Mine\Enum\SurfaceEnum;
+use DB;
 
 class SurfaceServices{
 
     //获取工作面列表
-    public static function getSurfaceList()
+    public static function getSurfaceList($staff_num)
     {
+        $user = DB::table('users')->where('staff_num',$staff_num)->first();
+        $mine_array = explode(';',$user->mine_role);
+
         $query = WorkingSurface::join(
             'mine_list', 'working_surface.mine_id', '=', 'mine_list.id'
-        )->orderBy('working_surface.created_at', 'desc')->select(
+        )->whereIn('mine_id',$mine_array)->orderBy('working_surface.created_at', 'desc')->select(
             [
                 'working_surface.id',
                 'working_surface.surface_name',

+ 547 - 0
public/js/admin/layui/admin.js

@@ -0,0 +1,547 @@
+/*
+ * @Author: https://github.com/WangEn
+ * @Author: https://gitee.com/lovetime/
+ * @Date:   2018-01-01
+ * @lastModify 2018-3-27 15:00:35
+ * +----------------------------------------------------------------------
+ * | Weadmin [ 后台管理模板 ]
+ * | 基于Layui http://www.layui.com/
+ * +----------------------------------------------------------------------
+ */
+
+layui.define(['jquery', 'form', 'layer', 'element'], function (exports) {
+    var $ = layui.jquery,
+        form = layui.form,
+        layer = layui.layer,
+        element = layui.element;
+    var menu = [];
+    var curMenu;
+
+    /*
+     * @todo 初始化加载完成执行方法
+     * 打开或刷新后执行
+     */
+    $(function () {
+        /*
+         * @todo 读取本地存储中记录的已打开的tab项
+         * 刷新后,读取记录,打开原来已打开的tab项
+         */
+
+        /*
+         * @todo table事件
+         */
+        tableCheck = {
+            init: function () {
+                $(".layui-form-checkbox").click(function (event) {
+                    if ($(this).hasClass('layui-form-checked')) {
+                        $(this).removeClass('layui-form-checked');
+                        if ($(this).hasClass('header')) {
+                            $(".layui-form-checkbox").removeClass('layui-form-checked');
+                        }
+                    } else {
+                        $(this).addClass('layui-form-checked');
+                        if ($(this).hasClass('header')) {
+                            $(".layui-form-checkbox").addClass('layui-form-checked');
+                        }
+                    }
+                });
+            },
+            getData: function () {
+                var obj = $(".layui-form-checked").not('.header');
+                var arr = [];
+                obj.each(function (index, el) {
+                    arr.push(obj.eq(index).attr('data-id'));
+                });
+                return arr;
+            }
+        }
+        //开启表格多选
+        tableCheck.init();
+        //延时加载
+        setTimeout(function () {
+            if (sessionStorage.getItem("menu")) {
+                menu = JSON.parse(sessionStorage.getItem("menu"));
+                for (var i = 0; i < menu.length; i++) {
+                    tab.tabAdd(menu[i].title, menu[i].url, menu[i].id);
+                }
+            } else {
+                return false;
+            }
+            if (sessionStorage.getItem("curMenu")) {
+                $('.layui-tab-title').find('layui-this').removeClass('layui-class');
+                curMenu = JSON.parse(sessionStorage.getItem("curMenu"));
+                id = curMenu.id;
+                if (id) { //因为默认桌面首页不存在lay-id,所以要对此判断
+                    $('.layui-tab-title li[lay-id="' + id + '"]').addClass('layui-this');
+                    tab.tabChange(id);
+                } else {
+                    $(".layui-tab-title li").eq(0).addClass('layui-this'); //未生效
+                    $('.layui-tab-content iframe').eq(0).parent().addClass('layui-show');
+                }
+            } else {
+                $(".layui-tab-title li").eq(0).addClass('layui-this'); //未生效
+                $('.layui-tab-content iframe').eq(0).parent().addClass('layui-show');
+            }
+        }, 100);
+        //点击tab标题时,触发reloadTab函数
+        // $('#tabName').on('click','li',function(){
+        // 	reloadTab(this);
+        // });
+
+        //初始化加载结束
+    });
+
+    /*
+     * @todo 左侧导航菜单的显示和隐藏
+     */
+    // $('.container .left_open i').click(function(event) {
+    $('.container').on('click', '.left_open i', function (event) {
+        if ($('.left-nav').css('left') == '0px') {
+            //此处左侧菜单是显示状态,点击隐藏
+            $('.left-nav').animate({
+                left: '-321px'
+            }, 100);
+            $('.page-content').animate({
+                left: '0px'
+            }, 100);
+            $('.page-content-bg').hide();
+        } else {
+            //此处左侧菜单是隐藏状态,点击显示
+            $('.left-nav').animate({
+                left: '0px'
+            }, 100);
+            $('.page-content').animate({
+                left: '321px'
+            }, 100);
+            //点击显示后,判断屏幕宽度较小时显示遮罩背景
+            if ($(window).width() < 768) {
+                $('.page-content-bg').show();
+            }
+        }
+    });
+    //点击遮罩背景,左侧菜单隐藏
+    $('.page-content-bg').click(function (event) {
+        $('.left-nav').animate({
+            left: '-321px'
+        }, 100);
+        $('.page-content').animate({
+            left: '0px'
+        }, 100);
+        $(this).hide();
+    });
+
+    /*
+     * @todo 左侧菜单事件
+     * 如果有子级就展开,没有就打开frame
+     */
+    $('body').on('click', '.left-nav #nav li', function (event) {
+        if ($(this).children('.sub-menu').length) {
+            if ($(this).hasClass('open')) {
+                $(this).removeClass('open');
+                $(this).find('.nav_right').html('&#xe697;');
+                $(this).children('.sub-menu').stop().slideUp();
+                $(this).siblings().children('.sub-menu').slideUp();
+            } else {
+                $(this).addClass('open');
+                $(this).children('a').find('.nav_right').html('&#xe6a6;');
+                $(this).children('.sub-menu').stop().slideDown();
+                $(this).siblings().children('.sub-menu').stop().slideUp();
+                $(this).siblings().find('.nav_right').html('&#xe697;');
+                $(this).siblings().removeClass('open');
+            }
+        } else {
+            var url = $(this).children('a').attr('_href');
+            var title = $(this).find('cite').html();
+            // var index = $('.left-nav #nav li').index($(this));
+            var index = $(this).attr('id');
+
+            // for (var i = 0; i < $('.weIframe').length; i++) {
+            //     if ($('.weIframe').eq(i).attr('tab-id') == index + 1) {
+            //         tab.tabChange(index + 1);
+            //         event.stopPropagation();
+            //         return;
+            //     }
+            // }
+            for (var i = 0; i < $('.weIframe').length; i++) {
+                if ($('.weIframe').eq(i).attr('tab-id') == index) {
+                    tab.tabChange(index);
+                    event.stopPropagation();
+                    return;
+                }
+            }
+
+            // tab.tabAdd(title, url, index + 1);
+            tab.tabAdd(title, url, index);
+            // tab.tabChange(index + 1);
+            tab.tabChange(index);
+        }
+        event.stopPropagation(); //不触发任何前辈元素上的事件处理函数
+    });
+
+    /*
+     * @todo tab触发事件:增加、删除、切换
+     */
+    var tab = {
+        tabAdd: function (title, url, id) {
+            //判断当前id的元素是否存在于tab中
+            var li = $("#WeTabTip li[lay-id=" + id + "]").length;
+            //console.log(li);
+            if (li > 0) {
+                //tab已经存在,直接切换到指定Tab项
+                //console.log(">0");
+                element.tabChange('wenav_tab', id); //切换到:用户管理
+            } else {
+                //该id不存在,新增一个Tab项
+                //console.log("<0");
+                element.tabAdd('wenav_tab', {
+                    title: title,
+                    content: '<iframe tab-id="' + id + '" frameborder="0" src="' + url + '" scrolling="yes" class="weIframe"></iframe>',
+                    id: id,
+                });
+                //当前窗口内容
+                setStorageMenu(title, url, id);
+
+            }
+            CustomRightClick(id); //绑定右键菜单
+            FrameWH(); //计算框架高度
+
+        },
+        tabDelete: function (id) {
+            element.tabDelete("wenav_tab", id); //删除
+            removeStorageMenu(id);
+        },
+        tabChange: function (id) {
+            //切换到指定Tab项
+            element.tabChange('wenav_tab', id);
+        },
+        tabDeleteAll: function (ids) { //删除所有
+            $.each(ids, function (i, item) {
+                element.tabDelete("wenav_tab", item);
+            })
+            sessionStorage.removeItem('menu');
+        }
+    };
+
+    /*
+     * @todo 监听右键事件,绑定右键菜单
+     * 先取消默认的右键事件,再绑定菜单,触发不同的点击事件
+     */
+    function CustomRightClick(id) {
+        //取消右键
+        $('.layui-tab-title li').on('contextmenu', function () {
+            return false;
+        })
+        $('.layui-tab-title,.layui-tab-title li').on('click', function () {
+            $('.rightMenu').hide();
+        });
+        //桌面点击右击
+        $('.layui-tab-title li').on('contextmenu', function (e) {
+            var aid = $(this).attr("lay-id"); //获取右键时li的lay-id属性
+            var popupmenu = $(".rightMenu");
+            popupmenu.find("li").attr("data-id", aid);
+            //console.log("popopmenuId:" + popupmenu.find("li").attr("data-id"));
+            l = ($(document).width() - e.clientX) < popupmenu.width() ? (e.clientX - popupmenu.width()) : e.clientX;
+            t = ($(document).height() - e.clientY) < popupmenu.height() ? (e.clientY - popupmenu.height()) : e.clientY;
+            popupmenu.css({
+                left: l,
+                top: t
+            }).show();
+            //alert("右键菜单")
+            return false;
+        });
+    }
+
+    $("#rightMenu li").click(function () {
+        var type = $(this).attr("data-type");
+        var layId = $(this).attr("data-id")
+        if (type == "current") {
+            //console.log("close this:" + layId);
+            tab.tabDelete(layId);
+        } else if (type == "all") {
+            //console.log("closeAll");
+            var tabtitle = $(".layui-tab-title li");
+            var ids = new Array();
+            $.each(tabtitle, function (i) {
+                ids[i] = $(this).attr("lay-id");
+            })
+            tab.tabDeleteAll(ids);
+        } else if (type == "fresh") {
+            //console.log("fresh:" + layId);
+            tab.tabChange($(this).attr("data-id"));
+            var othis = $('.layui-tab-title').find('>li[lay-id="' + layId + '"]'),
+                index = othis.parent().children('li').index(othis),
+                parents = othis.parents('.layui-tab').eq(0),
+                item = parents.children('.layui-tab-content').children('.layui-tab-item'),
+                src = item.eq(index).find('iframe').attr("src");
+            item.eq(index).find('iframe').attr("src", src);
+        } else if (type == "other") {
+            var thisId = layId;
+            $('.layui-tab-title').find('li').each(function (i, o) {
+                var layId = $(o).attr('lay-id');
+                if (layId != thisId && layId != 0) {
+                    tab.tabDelete(layId);
+                }
+            });
+        }
+        $('.rightMenu').hide();
+    });
+
+    /*
+     * @todo 重新计算iframe高度
+     */
+    function FrameWH() {
+        var h = $(window).height() - 90;
+        // console.log(h);
+        $("iframe[tab-id]").css("height", h + "px");
+    }
+
+    $(window).resize(function () {
+        FrameWH();
+    });
+
+    window.TopTabMenu = function (title, url, id) {
+        tab.tabAdd(title, url, id);
+        tab.tabChange(id);
+    }
+
+    /*
+     * @todo 弹出层,弹窗方法
+     * layui.use 加载layui.define 定义的模块,当外部 js 或 onclick调用 use 内部函数时,需要在 use 中定义 window 函数供外部引用
+     * http://blog.csdn.net/xcmonline/article/details/75647144
+     */
+    /*
+        参数解释:
+        title   标题
+        url     请求的url
+        id      需要操作的数据id
+        w       弹出层宽度(缺省调默认值)
+        h       弹出层高度(缺省调默认值)
+    */
+    window.WeAdminShow = function (title, url, w, h) {
+        if (title == null || title == '') {
+            title = false;
+        }
+        ;
+        if (url == null || url == '') {
+            url = "404.html";
+        }
+        ;
+        if (w == null || w == '') {
+            w = ($(window).width() * 0.9);
+        }
+        ;
+        if (h == null || h == '') {
+            h = ($(window).height() - 50);
+        }
+        ;
+        layer.open({
+            type: 2,
+            area: [w + 'px', h + 'px'],
+            fix: false, //不固定
+            maxmin: true,
+            shadeClose: true,
+            shade: 0.4,
+            title: title,
+            content: url
+        });
+    }
+    /*弹出层+传递ID参数*/
+    window.WeAdminEdit = function (title, url, id, w, h) {
+        if (title == null || title == '') {
+            title = false;
+        }
+        ;
+        if (url == null || url == '') {
+            url = "404.html";
+        }
+        ;
+        if (w == null || w == '') {
+            w = ($(window).width() * 0.9);
+        }
+        ;
+        if (h == null || h == '') {
+            h = ($(window).height() - 50);
+        }
+        ;
+        layer.open({
+            type: 2,
+            area: [w + 'px', h + 'px'],
+            fix: false, //不固定
+            maxmin: true,
+            shadeClose: true,
+            shade: 0.4,
+            title: title,
+            content: url,
+            success: function (layero, index) {
+                //向iframe页的id=house的元素传值  // 参考 https://yq.aliyun.com/ziliao/133150
+                var body = layer.getChildFrame('body', index);
+                body.contents().find("#dataId").val(id);
+                console.log(id);
+            },
+            error: function (layero, index) {
+                alert("aaa");
+            }
+        });
+    }
+
+    /**
+     *@todo tab监听:点击tab项对应的关闭按钮事件
+     */
+    $('.layui-tab-close').click(function (event) {
+        $('.layui-tab-title li').eq(0).find('i').remove();
+    });
+    /**
+     *@todo tab切换监听
+     * tab切换监听不能写字初始化加载$(function())方法内,否则不执行
+     */
+    element.on('tab(wenav_tab)', function (data) {
+        // console.log(this, $(this).attr('lay-id')); //当前Tab标题所在的原始DOM元素
+        $('.left-nav #nav li').removeClass('active open');
+        $('.left-nav #nav .sub-menu').stop().slideUp();
+        $('.left-nav #nav li .nav_right').html('&#xe697;');
+        $('#' + $(this).attr('lay-id')).addClass('active').parents('li').addClass('open');
+        $('.left-nav #nav li.open > a .nav_right').html('&#xe6a6')
+        var open_li = $('.left-nav #nav li.open');
+        // open_li.find('.nav_right').html('&#xe6a6');
+        open_li.children('.sub-menu').stop().slideDown('normal', function () {
+            $(this).attr('style', 'display:block;');
+        });
+        $('#' + $(this).attr('lay-id')).siblings().find('.nav_right').html('&#xe697;');
+        setStorageCurMenu();
+    });
+    /*
+     * @todo 监听layui Tab项的关闭按钮,改变本地存储
+     */
+    element.on('tabDelete(wenav_tab)', function (data) {
+        var layId = $(this).parent('li').attr('lay-id');
+        // console.log(layId);
+        removeStorageMenu(layId);
+    });
+
+    /**
+     *@todo 本地存储 localStorage
+     * 为了保持统一,将sessionStorage更换为存储周期更长的localStorage
+     */
+    //本地存储记录所有打开的窗口
+    function setStorageMenu(title, url, id) {
+        var menu = JSON.parse(sessionStorage.getItem('menu'));
+        if (menu) {
+            var deep = false;
+            for (var i = 0; i < menu.length; i++) {
+                if (menu[i].id == id) {
+                    deep = true;
+                    menu[i].title = title;
+                    menu[i].url = url;
+                    menu[i].id = id;
+                }
+            }
+            if (!deep) {
+                menu.push({
+                    title: title,
+                    url: url,
+                    id: id
+                })
+            }
+        } else {
+            var menu = [{
+                title: title,
+                url: url,
+                id: id
+            }]
+        }
+        sessionStorage.setItem('menu', JSON.stringify(menu));
+    }
+
+    //本地存储记录当前打开窗口
+    function setStorageCurMenu() {
+        var curMenu = sessionStorage.getItem('curMenu');
+        var text = $('.layui-tab-title').find('.layui-this').text();
+        text = text.split('ဆ')[0];
+        var url = $('.layui-tab-content').find('.layui-show').find('.weIframe').attr('src');
+        var id = $('.layui-tab-title').find('.layui-this').attr('lay-id');
+        //console.log(text);
+        curMenu = {
+            title: text,
+            url: url,
+            id: id
+        }
+        if (url.indexOf("?") != -1) {
+            sessionStorage.setItem('fileClassName', parse_url(url)[0])
+        }
+        sessionStorage.setItem('curMenu', JSON.stringify(curMenu));
+    }
+
+    // 获取url参数
+    function parse_url(_url) {
+        var name, value, info = [];
+        var str = _url
+        var num = str.indexOf("?");
+        str = str.substr(num + 1);
+        var arr = str.split("&");
+        for (var i = 0; i < arr.length; i++) {
+            num = arr[i].indexOf("=");
+            if (num > 0) {
+                name = arr[i].substring(0, num);
+                value = arr[i].substr(num + 1);
+                this[name] = value;
+                info.push(value)
+            }
+        }
+        return info
+    }
+
+    //本地存储中移除删除的元素
+    function removeStorageMenu(id) {
+        var menu = JSON.parse(sessionStorage.getItem('menu'));
+        //var curMenu = JSON.parse(localStorage.getItem('curMenu'));
+        if (menu) {
+            var deep = false;
+            for (var i = 0; i < menu.length; i++) {
+                if (menu[i].id == id) {
+                    deep = true;
+                    menu.splice(i, 1);
+                }
+            }
+        } else {
+            return false;
+        }
+        sessionStorage.setItem('menu', JSON.stringify(menu));
+    }
+
+    /**
+     *@todo 模拟登录
+     * 判断初次登录时,跳转到登录页
+     */
+    var login = localStorage.getItem('login');
+    $('.loginout').click(function () {
+        login = 0;
+        localStorage.setItem('login', login);
+    });
+    $('.loginin').click(function () {
+        login = 1;
+        localStorage.setItem('login', login);
+    });
+
+    /*
+     *Tab加载后刷新
+     * 判断是刷新后第一次点击时,刷新frame子页面
+     * */
+    window.reloadTab = function (which) {
+        var len = $('.layui-tab-title').children('li').length;
+        var layId = $(which).attr('lay-id');
+        var i = 1;
+        if ($(which).attr('data-bit')) {
+            return false; //判断页面打开后第一次点击,执行刷新
+        } else {
+            $(which).attr('data-bit', i);
+            var frame = $('.weIframe[tab-id=' + layId + ']');
+            frame.attr('src', frame.attr('src'));
+            console.log("reload:" + $(which).attr('data-bit'));
+        }
+    }
+    /**
+     *@todo Frame内部的按钮点击打开其他frame的tab
+     */
+
+    exports('admin', {});
+});

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2 - 0
public/js/admin/layui/css/layui.css


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2 - 0
public/js/admin/layui/css/layui.mobile.css


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2 - 0
public/js/admin/layui/css/modules/code.css


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2 - 0
public/js/admin/layui/css/modules/laydate/default/laydate.css


BIN
public/js/admin/layui/css/modules/layer/default/icon-ext.png


BIN
public/js/admin/layui/css/modules/layer/default/icon.png


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2 - 0
public/js/admin/layui/css/modules/layer/default/layer.css


BIN
public/js/admin/layui/css/modules/layer/default/loading-0.gif


BIN
public/js/admin/layui/css/modules/layer/default/loading-1.gif


BIN
public/js/admin/layui/css/modules/layer/default/loading-2.gif


+ 76 - 0
public/js/admin/layui/eleDel.js

@@ -0,0 +1,76 @@
+/*
+ * @Author: https://github.com/WangEn
+ * @Author: https://gitee.com/lovetime/
+ * @Date:   2018-03-27
+ * @lastModify 2018-3-28
+ * +----------------------------------------------------------------------
+ * | WeAdmin 表格table中多个删除等操作公用js
+ * | 有改用时直接复制到对应页面也不影响使用
+ * +----------------------------------------------------------------------
+ */
+layui.extend({
+	admin: '{/}../../static/js/admin'
+});
+layui.use(['laydate', 'jquery', 'admin'], function() {
+	var laydate = layui.laydate,
+		$ = layui.jquery,
+		admin = layui.admin;
+	//执行一个laydate实例
+	laydate.render({
+		elem: '#start' //指定元素
+	});
+	//执行一个laydate实例
+	laydate.render({
+		elem: '#end' //指定元素
+	});
+	/*用户-停用*/
+	window.member_stop = function (obj, id) {
+		layer.confirm('确认要停用吗?', function(index) {
+			if($(obj).attr('title') == '启用') {
+
+				//发异步把用户状态进行更改
+				$(obj).attr('title', '停用')
+				$(obj).find('i').html('&#xe62f;');
+
+				$(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已停用');
+				layer.msg('已停用!', {
+					icon: 5,
+					time: 1000
+				});
+
+			} else {
+				$(obj).attr('title', '启用')
+				$(obj).find('i').html('&#xe601;');
+
+				$(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已启用');
+				layer.msg('已启用!', {
+					icon: 5,
+					time: 1000
+				});
+			}
+		});
+	}
+
+	/*用户-删除*/
+	window.member_del = function (obj, id) {
+		layer.confirm('确认要删除吗?', function(index) {
+			//发异步删除数据
+			$(obj).parents("tr").remove();
+			layer.msg('已删除!', {
+				icon: 1,
+				time: 1000
+			});
+		});
+	}
+
+	window.delAll = function (argument) {
+		var data = tableCheck.getData();
+		layer.confirm('确认要删除吗?' + data, function(index) {
+			//捉到所有被选中的,发异步进行删除
+			layer.msg('删除成功', {
+				icon: 1
+			});
+			$(".layui-form-checked").not('.header').parents('tr').remove();
+		});
+	}
+});

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 571 - 0
public/js/admin/layui/extends/authtree.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1417 - 0
public/js/admin/layui/extends/eleTree.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 0
public/js/admin/layui/extends/formSelects-v4.min.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 288 - 0
public/js/admin/layui/extends/selectM.js


+ 279 - 0
public/js/admin/layui/extends/selectN.js

@@ -0,0 +1,279 @@
+/*
+* @version: 1.2
+* @Author:  tomato
+* @Date:    2018-4-24 22:56:00
+* @Last Modified by:   tomato
+* @Last Modified time: 2018-5-26 18:08:43
+*/
+//无限级下拉框
+layui.define(['jquery', 'form'], function(exports){
+		var MOD_NAME = 'selectN';
+		var $ = layui.jquery;
+		var form = layui.form;
+    var obj = function(config){
+		//当前选中数据值名数据
+		this.selected =[];
+		//当前选中的值
+		this.values = [];
+		//当前选中的名
+		this.names = [];
+		//当前选中最后一个值
+		this.lastValue = '';
+		//当前选中最后一个值
+		this.lastName = '';		
+		//是否已选
+		this.isSelected = false;
+		//初始化配置
+		this.config = {
+			//选择器id或class
+			elem: '',
+			//无限级分类数据
+			data: [],
+			//默认选中值
+			selected: [],
+			//空值项提示,可设置为数组['请选择省','请选择市','请选择县']
+			tips: '请选择',	
+			//是否允许搜索,可设置为数组[true,true,true]
+			search:false,
+			//选择项宽度,可设置为数组['80','90','100']
+			width:null,	
+			//为真只取最后一个值
+			last: false,
+			//值验证,与lay-verify一致
+			verify: '',		
+			//事件过滤器,lay-filter名
+			filter: '',
+			//input的name 不设置与选择器相同(去#.)
+			name: '',
+			//数据分隔符
+			delimiter: ',',		
+			//数据的键名 status=0为禁用状态
+			field:{idName:'id',titleName:'name',statusName:'status',childName:'children'},
+			//多表单区分 form.render(type, filter); 为class="layui-form" 所在元素的 lay-filter="" 的值 
+			formFilter: null
+		}
+		
+		//实例化配置
+		this.config = $.extend(this.config,config);
+
+		//“请选择”文字
+		this.setTips = function(){
+			var o = this,c = o.config;
+			if(Object.prototype.toString.call(c.tips)!='[object Array]'){
+				return c.tips;
+			}
+			else{
+				var i=$(c.elem).find('select').length;
+				return c.tips.hasOwnProperty(i) ? c.tips[i] : '请选择'; 
+			}
+		}
+
+		//设置是否允许搜索
+		this.setSearch = function(){
+			var o = this,c = o.config;
+			if(Object.prototype.toString.call(c.search)!='[object Array]'){
+				return c.search===true ? 'lay-search ' : ' ';
+			}
+			else{
+				var i=$(c.elem).find('select').length;
+				if(c.search.hasOwnProperty(i)){
+					return c.search[i]===true ? 'lay-search ' : ' ';
+				}
+			}
+			return ' ';
+		}
+
+		//设置是否允许搜索
+		this.setWidth = function(){
+			var o = this,c = o.config;
+			if(Object.prototype.toString.call(c.width)!='[object Array]'){
+				return /^\d+$/.test(c.width) ? 'style="width:'+c.width+'px;" ' : ' ';
+			}
+			else{
+				var i=$(c.elem).find('select').length;
+				if(c.width.hasOwnProperty(i)){
+					return /^\d+$/.test(c.width[i]) ? 'style="width:'+c.width[i]+'px;" ' : ' ';
+				}
+			}
+		}		
+			
+		//创建一个Select
+		this.createSelect = function(optionData){
+			var o = this,c = o.config,f=c.field;
+			var html = '';
+			html+= '<div class="layui-input-inline" '+o.setWidth()+'>';
+			html+= ' <select '+o.setSearch()+'lay-filter="'+c.filter+'">';
+			html+= '  <option value="">'+o.setTips()+'</option>';
+			for(var i=0;i<optionData.length;i++){
+				var disabled = optionData[i][f.statusName]==0 ? 'disabled="" ' : '';
+				html+= '  <option '+disabled+'value="'+optionData[i][f.idName]+'">'+optionData[i][f.titleName]+'</option>';
+			}
+			html+= ' </select>';
+			html+= '</div>';
+			return html;
+		};
+
+		//获取当前option的数据
+		this.getOptionData=function(catData,optionIndex){
+			var f = this.config.field;
+			var item = catData;
+			for(var i=0;i<optionIndex.length;i++){
+				if('undefined' == typeof item[optionIndex[i]]){
+					item = null;
+					break;      
+				}
+				else if('undefined' == typeof item[optionIndex[i]][f.childName]){
+					item = null;
+					break;
+				}
+				else{
+					item = item[optionIndex[i]][f.childName];
+				}
+			}
+			return item;
+		};
+
+		//初始化
+		this.set = function(selected){
+			var o = this,c = o.config;
+			$E = $(c.elem);
+			//创建顶级select
+			var verify = c.verify=='' ? '' : 'lay-verify="'+c.verify+'" ';
+			var html = '<div style="height:0px;width:0px;overflow:hidden"><input '+verify+'name="'+c.name+'"></div>';
+			html += o.createSelect(c.data);
+			$E.html(html);
+			selected = typeof selected=='undefined' ? c.selected : selected;
+			var index=[];
+			for(var i=0;i<selected.length;i++){
+				//设置最后一个select的选中值
+				$E.find('select:last').val(selected[i]);
+				//获取该选中值的索引
+				var lastIndex = $E.find('select:last').get(0).selectedIndex-1; 
+				index.push(lastIndex);
+				//取出下级的选项值
+				var childItem = o.getOptionData(c.data,index);
+				//下级选项值存在则创建select
+				if(childItem){
+					var html = o.createSelect(childItem);
+					$E.append(html);
+				}
+			}
+			form.render('select',c.formFilter);
+			o.getSelected();					
+		};
+		
+		//下拉事件
+		this.change = function(elem){
+			var o = this,c = o.config;
+			var $thisItem = elem.parent();
+			//移除后面的select
+			$thisItem.nextAll('div.layui-input-inline').remove();
+			var index=[];
+			//获取所有select,取出选中项的值和索引
+			$thisItem.parent().find('select').each(function(){
+				index.push($(this).get(0).selectedIndex-1);
+			});
+			
+			var childItem = o.getOptionData(c.data,index);
+			if(childItem){
+				var html = o.createSelect(childItem);
+				$thisItem.after(html);
+				form.render('select',c.formFilter);
+			}
+			o.getSelected();			
+		};
+
+		//获取所有值-数组 每次选择后执行
+		this.getSelected=function(){
+			var o = this,c = o.config;
+			var values =[];
+			var names =[];
+			var selected =[];
+			$E = $(c.elem);
+			$E.find('select').each(function(){
+				var item = {};
+				var v = $(this).val()
+				var n = $(this).find('option:selected').text();
+				item.value = v;
+				item.name = n;
+				values.push(v);
+				names.push(n);
+				selected.push(item);
+			});
+			o.selected =selected;			
+			o.values = values;
+			o.names = names;
+			o.lastValue = $E.find('select:last').val();
+			o.lastName = $E.find('option:selected:last').text();
+			
+			o.isSelected = o.lastValue=='' ? false : true;
+			var inputVal = c.last===true ? o.lastValue : o.values.join(c.delimiter);
+			$E.find('input[name='+c.name+']').val(inputVal);
+		};
+		//ajax方式获取候选数据
+		this.getData = function(url){
+			var d;
+			$.ajax({
+				url:url,
+				dataType:'json',
+				async:false,
+				success:function(json){
+					d=json;
+				},
+				error: function(){
+					console.error(MOD_NAME+' hint:候选数据ajax请求错误 ');
+					d = false;
+				}
+			});
+			return d;
+		}		
+		
+		
+	};
+
+	//渲染一个实例
+  obj.prototype.render = function(){
+		var o=this,c=o.config;
+		$E = $(c.elem);
+		if($E.length==0){
+			console.error(MOD_NAME+' hint:找不到容器 '+c.elem);
+			return false;
+		}
+		if(Object.prototype.toString.call(c.data)!='[object Array]'){
+			var data = o.getData(c.data);
+			if(data===false){
+				console.error(MOD_NAME+' hint:缺少分类数据');
+				return false;
+			}
+			o.config.data =  data;
+		}
+		
+		c.filter = c.filter=='' ? c.elem.replace('#','').replace('.','') : c.filter;
+		c.name = c.name=='' ? c.elem.replace('#','').replace('.','') : c.name;
+		o.config = c;
+		
+		//初始化
+		o.set();
+		
+		//监听下拉事件
+		form.on('select('+c.filter+')',function(data){
+			o.change($(data.elem));	
+		});
+		//验证失败样式
+		$E.find('input[name='+c.name+']').focus(function(){
+			var t = $(c.elem).offset().top;
+			$('html,body').scrollTop(t-200);			
+			$(c.elem).find('select:last').addClass('layui-form-danger');
+			setTimeout(function(){
+				$(c.elem).find('select:last').removeClass('layui-form-danger');
+			},3000);
+		});
+	}
+	
+	//输出模块
+	exports(MOD_NAME, function (config) {
+		var _this = new obj(config);
+		_this.render();
+		return _this;
+  });
+});

+ 468 - 0
public/js/admin/layui/extends/tabmenu.js

@@ -0,0 +1,468 @@
+/*
+ * @Author: Paco
+ * @Date:   2017-01-31
+ * @lastModify 2017-05-08
+ * +----------------------------------------------------------------------
+ * | jqadmin [ jq酷打造的一款懒人后台模板 ]
+ * | Copyright (c) 2017 http://jqadmin.jqcool.net All rights reserved.
+ * | Licensed ( http://jqadmin.jqcool.net/licenses/ )
+ * | Author: Paco <admin@jqcool.net>
+ * +----------------------------------------------------------------------
+ */
+
+layui.define(['jquery', 'element'], function(exports) {
+    var $ = layui.jquery,
+        element = layui.element,
+        device = layui.device(),
+        tabMenu = function() {
+            this.config = {
+                item: '#WeTabTip',
+                closed: true
+            };
+        },
+        objTab = {};
+
+    /**
+     * [参数设置 options]
+     */
+    tabMenu.prototype.set = function(options) {
+        if (typeof(options) == 'string' && options != "") {
+            this.config.item = options;
+        } else if (typeof(options) == 'object') {
+            $.extend(true, this.config, options);
+        }
+        return this;
+    };
+
+    /**
+     *@todo 初始化对象
+     *@return 返回对象参数初始化结果
+     */
+    tabMenu.prototype.init = function(options) {
+        var _this = this,
+            config = _this.config,
+            $container = $('' + config.item + ''),
+            filter = $container.attr('lay-filter');
+        if (filter === undefined || filter === '') {
+            console.log('错误:请设置Tab菜单选项卡属性lay-filter过滤器');
+        }
+
+        objTab.titleBox = $container.children('ul.layui-tab-title');
+        objTab.contentBox = $container.children('div.layui-tab-content');
+        objTab.tabFilter = filter;
+        _this.hideRightMenu();
+        _this.drag();
+
+        return _this;
+    }
+
+    /**
+     *@todo 检查页面是否已打开,如果已打开则返回索引值,否则返回-1
+     *@param string title 打开页面的标题
+     *@return int tab的索引值,元则返回-1
+     */
+    tabMenu.prototype.exited = function(title) {
+        var tab_index = -1;
+        if (objTab.titleBox === undefined) {
+            this.init()
+        }
+
+        objTab.titleBox.find('li').each(function(i, e) {
+            var $em = $(this).children('em');
+            if ($em.text() === title) {
+                tab_index = $(this).attr('lay-id');
+            };
+        });
+        return tab_index;
+    }
+
+    /**
+     * 菜单操作的接口
+     */
+    tabMenu.prototype.beforeTabAdd = function(data, _this) {}
+    tabMenu.prototype.changeTab = function(data, _this, tab_index) {}
+    tabMenu.prototype.afterTabClose = function(data, _this) {}
+
+    /**
+     *@todo 添加tab菜单选项卡
+     *@param object data [ title 菜单选项卡标题
+                          ,href 菜单URL地址
+                          ,icon 菜单的ICON图标
+                    ]
+     */
+    tabMenu.prototype.tabAdd = function(data, fresh) {
+
+        var tab_index = this.exited(data.title),
+            _this = this;
+        if (tab_index === -1) {
+            _this.beforeTabAdd(data, _this);
+            var layID = data.layId ? data.layId : new Date().getTime();
+            var content = '<iframe src="' + data.href + '" data-id="' + layID + '" class="jqadmin-iframe"></iframe>';
+            var title = '';
+
+            // 如果icon有定义则添加到标题中
+            if (!_this.config.showIcon) {
+                title += '<i class="iconfont hide-icon">' + data.icon + '</i>';
+            } else {
+                title += '<i class="iconfont">' + data.icon + '</i>';
+            }
+            title += '<em>' + data.title + '</em>';
+            if (this.config.closed) {
+                title += '<i class="layui-icon layui-unselect layui-tab-close" data-id="' + layID + '">&#x1006;</i>';
+            }
+
+            //添加tab
+            element.tabAdd(objTab.tabFilter, {
+                title: title,
+                content: content,
+                id: layID
+            });
+
+            //添加打开的菜单到列表,刷新打开列表时不操作数据
+            if (!data.nodo) {
+                data.layId = layID;
+                _this.storage(data, "add");
+            }
+
+            if (data.old) {
+                objTab.titleBox.find('li[lay-id=' + layID + ']').attr("fresh", 1);
+            }
+
+            //页面淡出效果
+            _this.effect(layID);
+
+
+            if (this.config.closed) {
+                //监听关闭事件
+                objTab.titleBox.find('li').children('i.layui-tab-close[data-id=' + layID + ']').on('click', function() {
+                    element.tabDelete(objTab.tabFilter, $(this).parent('li').attr('lay-id'), data.parent);
+                    _this.tabMove(1, 1);
+                    _this.afterTabClose(data, _this);
+                    //删除数组中的对应元素
+                    element.init();
+                    _this.storage(data, "close");
+                });
+            };
+
+            this.tabMove(tab_index, 0);
+            //切换到当前打开的选项卡
+            element.tabChange(objTab.tabFilter, layID);
+
+            //监听鼠标右键事件
+            objTab.titleBox.find('li:not([bind])').on('contextmenu', function(event) {
+                $(this).attr("bind", 1);
+                var layId = $(this).attr('lay-id');
+                var e = event || window.event;
+
+                $('.right-click-menu').attr('lay-id', layId).css({ "top": e.pageY, "left": e.pageX }).slideDown(100);
+                $('.right-click-menu').find("a:not([bind])").on('click', { _this: _this }, _this.rightMenuEvent);
+                return false;
+            });
+
+        } else {
+            element.tabChange(objTab.tabFilter, tab_index);
+            _this.changeTab(data, _this, tab_index);
+            _this.effect(tab_index, true);
+            data.layId = tab_index;
+            _this.storage(data, "change");
+
+            this.tabMove(tab_index, 0);
+            if (fresh) {
+                _this.fresh(tab_index);
+            }
+        }
+
+
+    }
+
+    tabMenu.prototype.effect = function(layID, ischange) {
+        //页面淡出效果
+        var l = layer.load(1);
+        if (ischange) {
+            objTab.contentBox.find('iframe[data-id=' + layID + ']').css({ "opacity": "0", "margin-top": "50px" }).delay(200).animate({ opacity: '1', marginTop: "0" }, 500);
+            layer.close(l);
+        } else {
+            objTab.contentBox.find('iframe[data-id=' + layID + ']').css({ "opacity": "0", "margin-top": "50px" }).load(function() {
+                $(this).delay(100).animate({ opacity: '1', marginTop: "0" }, 500);
+                layer.close(l);
+            });
+        }
+
+    }
+
+    tabMenu.prototype.rightMenuEvent = function(event) {
+        var _this = event.data._this;
+        var event = $(this).data('event'),
+            parent = $(this).parents('.right-click-menu').attr("parent");
+        $(this).attr("bind", 1);
+        var index = $(this).parents('.right-click-menu').attr('lay-id');
+        $(this).parents('.right-click-menu').hide();
+        $('.menu-list').slideUp();
+        $('.tab-move-btn').find('i').html("&#xe604;");
+        switch (event) {
+            case "close":
+                if (index != 0) {
+                    element.tabDelete(objTab.tabFilter, index);
+
+                }
+                var data = {
+                    layId: index
+                }
+                _this.storage(data, "close");
+                break;
+
+            case "other":
+                objTab.titleBox.find('li').each(function(i, o) {
+                    var layId = $(o).attr('lay-id');
+                    if (layId != index && layId != 0) {
+                        element.tabDelete(objTab.tabFilter, layId);
+                    }
+                })
+                var data = {
+                    layId: index
+                }
+                _this.storage(data, "other");
+                break;
+
+            case "all":
+                objTab.titleBox.find('li').each(function(i, o) {
+                    var layId = $(o).attr('lay-id');
+                    if (layId != 0) {
+                        element.tabDelete(objTab.tabFilter, layId);
+                    }
+                    var data = {
+                        layId: layId
+                    }
+                    _this.storage(data, "all");
+                })
+                break;
+
+            default:
+                _this.fresh(index);
+        }
+
+        _this.tabMove(1, 1);
+        $(this).parents('.right-click-menu').hide();
+        element.init();
+    }
+
+    tabMenu.prototype.storage = function(data, action) {
+        if (data.title == undefined && action != "all") {
+            return false;
+        }
+        var storage = window.sessionStorage;
+        var _data = JSON.stringify(data);
+        if (action == "add") {
+            if (storage.menu) {
+                var menulist = storage.menu;
+                menulist = menulist.split("|");
+                menulist.remove(_data);
+                menulist.push(_data);
+                var menu = menulist.join("|");
+                storage.menu = menu;
+            } else {
+                storage.menu = _data;
+            }
+            storage.curMenu = _data;
+
+        } else if (action == "all") {
+            storage.removeItem("curMenu");
+            storage.removeItem("menu");
+        } else {
+            //取得打开的菜单数组
+            var menulist = storage.menu;
+            if (!menulist) {
+                return;
+            }
+            menulist = menulist.split("|");
+
+            if (action == "close") {
+                for (index in menulist) {
+                    if (index == "remove") {
+                        continue;
+                    }
+
+                    if (typeof menulist[index] === 'string') {
+                        var menu = JSON.parse(menulist[index]);
+                    }
+                    if (menu.layId == data.layId) {
+                        menulist.splice(index, 1);
+                    }
+
+                }
+                storage.menu = menulist.join("|");
+                storage.removeItem("curMenu");
+
+            } else {
+                for (index in menulist) {
+                    if (index == "remove") {
+                        continue;
+                    }
+                    if (typeof menulist[index] === 'string') {
+                        var menu = JSON.parse(menulist[index]);
+                    }
+                    if (menu.layId == data.layId) {
+                        var _data = menulist[index];
+                    }
+                }
+                if (action == "change") { //切换
+                    storage.curMenu = _data;
+                } else if (action == "other") {
+                    storage.curMenu = _data;
+                    storage.menu = _data;
+                }
+            }
+        }
+
+    }
+
+    tabMenu.prototype.fresh = function(index) {
+        element.tabChange(objTab.tabFilter, index);
+        var othis = objTab.titleBox.find('>li[lay-id="' + index + '"]'),
+            index = othis.parent().children('li').index(othis),
+            parents = othis.parents('.layui-tab').eq(0),
+            item = parents.children('.layui-tab-content').children('.layui-tab-item'),
+            src = item.eq(index).find('iframe').attr("src");
+        item.eq(index).find('iframe').attr("src", src);
+    }
+
+    tabMenu.prototype.hideRightMenu = function() {
+        $(document).on('contextmenu', function(event) {
+            $(this).find('.right-click-menu').hide();
+        });
+        $(document).on('click', function(event) {
+            $(this).find('.right-click-menu').hide();
+        })
+    }
+
+    /**
+     *@todo 判断菜单选项卡是否已超出了总宽度,若超出则显示左右移动按钮,否则隐藏按钮
+     *@param int index 大于等于0时表示菜单选项卡已经存在,才有移动的需求
+     *@param int scene 为1时表示删除tab菜单选项卡,为0时表示切换或是添加菜单选项卡
+     */
+    tabMenu.prototype.tabMove = function(index, scene) {
+        //取得屏幕总宽度
+
+        var navWidth = parseInt(objTab.titleBox.parent('div').width());
+
+        //取得菜单选项卡总宽度
+        var $tabNav = objTab.titleBox.find('li'),
+            tab_all_width = 0;
+        $tabNav.each(function(i, n) {
+            tab_all_width += $(n).outerWidth(true);
+        });
+
+        if (!$tabNav[0]) { return }
+        if (tab_all_width > navWidth + 1) {
+
+            var ml = navWidth - tab_all_width - 54;
+
+            if (ml < 0) {
+
+                if (index >= 0) {
+                    var current_tab_left = parseInt(objTab.titleBox.find('.layui-this').position().left),
+                        curent_tab_ml = parseInt(objTab.titleBox.css("marginLeft")),
+                        curent_ml = current_tab_left + parseInt(curent_tab_ml);
+
+                    if (curent_ml <= 0) {
+                        ml = 0 - current_tab_left;
+                    } else {
+                        var is_show = -(curent_tab_ml - navWidth + parseInt(objTab.titleBox.find('.layui-this').outerWidth(true)) + current_tab_left + 54);
+                        if (is_show <= 0) {
+                            ml = navWidth - current_tab_left - parseInt(objTab.titleBox.find('.layui-this').outerWidth(true)) - 54;
+                        } else {
+                            if (scene == 1 && parseInt(curent_tab_ml) < 0) {
+                                ml = navWidth - current_tab_left - parseInt(objTab.titleBox.find('.layui-this').outerWidth(true)) - 54;
+
+                                if (ml > 0) {
+                                    ml = 0;
+                                }
+                            } else {
+                                return;
+                            }
+                        }
+                    }
+                }
+                objTab.titleBox.css({ "marginLeft": ml });
+            }
+
+            if (ml == 0 && tab_all_width < navWidth + 1) {
+                objTab.titleBox.parent('div').find('.tab-move-btn').hide();
+            } else {
+                objTab.titleBox.parent('div').find('.tab-move-btn').show();
+            }
+        } else {
+            objTab.titleBox.parent('div').find('.tab-move-btn').hide();
+            objTab.titleBox.css({ "marginLeft": 0 });
+        }
+    }
+
+
+    tabMenu.prototype.drag = function() {
+        var _this = this;
+
+        objTab.titleBox.on("mousedown", function(e) {
+
+            //取得屏幕总宽度
+            var navWidth = parseInt(objTab.titleBox.parent('div').width());
+
+            //取得菜单选项卡总宽度
+            var $tabNav = objTab.titleBox.find('li'),
+                tab_all_width = 0;
+            $tabNav.each(function(i, n) {
+                tab_all_width += $(n).outerWidth(true);
+            });
+            if (!$tabNav[0]) { return };
+
+            if (tab_all_width > navWidth + 1) {
+                var maxml = tab_all_width - navWidth + 54
+                var _x = e.pageX - parseInt(objTab.titleBox.css("marginLeft")); //取得鼠标到标签左边left的距离
+
+                objTab.titleBox.on("mousemove", function(e) {
+                    x = e.pageX - _x;
+                    if (x > 0) {
+                        x = 0;
+                    } else if (x < -maxml) {
+                        x = -maxml;
+                    }
+                    objTab.titleBox.css({ "marginLeft": x });
+                });
+
+                objTab.titleBox.parents('body').on("mouseup", function(e) {
+                    objTab.titleBox.off("mousemove");
+                })
+
+                return false;
+            }
+
+        });
+    }
+
+
+
+    /**
+     *根据值查找所在位置index值,查不到就返回-1
+     */
+    Array.prototype.indexOf = function(val) {
+        for (var i = 0; i < this.length; i++) {
+            if (this[i] == val) return i;
+        }
+        return -1;
+    };
+
+
+    /**
+     *根椐值删除元素
+     */
+    Array.prototype.remove = function(val) {
+        var index = this.indexOf(val);
+        if (index > -1) {
+            this.splice(index, 1);
+        }
+    };
+
+    exports('tabmenu', function(options) {
+        var navtab = new tabMenu();
+        return navtab.set(options)
+    });
+});

BIN
public/js/admin/layui/font/iconfont.eot


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 485 - 0
public/js/admin/layui/font/iconfont.svg


BIN
public/js/admin/layui/font/iconfont.ttf


BIN
public/js/admin/layui/font/iconfont.woff


BIN
public/js/admin/layui/font/iconfont.woff2


BIN
public/js/admin/layui/images/face/0.gif


BIN
public/js/admin/layui/images/face/1.gif


BIN
public/js/admin/layui/images/face/10.gif


BIN
public/js/admin/layui/images/face/11.gif


BIN
public/js/admin/layui/images/face/12.gif


BIN
public/js/admin/layui/images/face/13.gif


BIN
public/js/admin/layui/images/face/14.gif


BIN
public/js/admin/layui/images/face/15.gif


BIN
public/js/admin/layui/images/face/16.gif


BIN
public/js/admin/layui/images/face/17.gif


BIN
public/js/admin/layui/images/face/18.gif


BIN
public/js/admin/layui/images/face/19.gif


BIN
public/js/admin/layui/images/face/2.gif


BIN
public/js/admin/layui/images/face/20.gif


BIN
public/js/admin/layui/images/face/21.gif


BIN
public/js/admin/layui/images/face/22.gif


BIN
public/js/admin/layui/images/face/23.gif


BIN
public/js/admin/layui/images/face/24.gif


BIN
public/js/admin/layui/images/face/25.gif


BIN
public/js/admin/layui/images/face/26.gif


BIN
public/js/admin/layui/images/face/27.gif


BIN
public/js/admin/layui/images/face/28.gif


BIN
public/js/admin/layui/images/face/29.gif


BIN
public/js/admin/layui/images/face/3.gif


BIN
public/js/admin/layui/images/face/30.gif


BIN
public/js/admin/layui/images/face/31.gif


BIN
public/js/admin/layui/images/face/32.gif


BIN
public/js/admin/layui/images/face/33.gif


BIN
public/js/admin/layui/images/face/34.gif


BIN
public/js/admin/layui/images/face/35.gif


BIN
public/js/admin/layui/images/face/36.gif


BIN
public/js/admin/layui/images/face/37.gif


BIN
public/js/admin/layui/images/face/38.gif


BIN
public/js/admin/layui/images/face/39.gif


BIN
public/js/admin/layui/images/face/4.gif


BIN
public/js/admin/layui/images/face/40.gif


BIN
public/js/admin/layui/images/face/41.gif


BIN
public/js/admin/layui/images/face/42.gif


BIN
public/js/admin/layui/images/face/43.gif


BIN
public/js/admin/layui/images/face/44.gif


BIN
public/js/admin/layui/images/face/45.gif


BIN
public/js/admin/layui/images/face/46.gif


BIN
public/js/admin/layui/images/face/47.gif


BIN
public/js/admin/layui/images/face/48.gif


BIN
public/js/admin/layui/images/face/49.gif


BIN
public/js/admin/layui/images/face/5.gif


BIN
public/js/admin/layui/images/face/50.gif


BIN
public/js/admin/layui/images/face/51.gif


BIN
public/js/admin/layui/images/face/52.gif


BIN
public/js/admin/layui/images/face/53.gif


BIN
public/js/admin/layui/images/face/54.gif


BIN
public/js/admin/layui/images/face/55.gif


BIN
public/js/admin/layui/images/face/56.gif


BIN
public/js/admin/layui/images/face/57.gif


BIN
public/js/admin/layui/images/face/58.gif


BIN
public/js/admin/layui/images/face/59.gif


BIN
public/js/admin/layui/images/face/6.gif


BIN
public/js/admin/layui/images/face/60.gif


BIN
public/js/admin/layui/images/face/61.gif


BIN
public/js/admin/layui/images/face/62.gif


BIN
public/js/admin/layui/images/face/63.gif


BIN
public/js/admin/layui/images/face/64.gif


BIN
public/js/admin/layui/images/face/65.gif


BIN
public/js/admin/layui/images/face/66.gif


BIN
public/js/admin/layui/images/face/67.gif


BIN
public/js/admin/layui/images/face/68.gif


BIN
public/js/admin/layui/images/face/69.gif


+ 0 - 0
public/js/admin/layui/images/face/7.gif


Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott