├── .gitattributes ├── .gitignore ├── README.md ├── assets ├── css │ └── admin.css ├── images │ └── 30.jpeg ├── js │ ├── admin.js │ ├── jquery.min.js │ ├── particles.min.js │ └── treeTable.js └── lib │ └── layui │ ├── css │ ├── layui.css │ ├── layui.mobile.css │ └── modules │ │ ├── code.css │ │ ├── laydate │ │ └── default │ │ │ └── laydate.css │ │ └── layer │ │ └── default │ │ ├── icon-ext.png │ │ ├── icon.png │ │ ├── layer.css │ │ ├── loading-0.gif │ │ ├── loading-1.gif │ │ └── loading-2.gif │ ├── font │ ├── iconfont.eot │ ├── iconfont.svg │ ├── iconfont.ttf │ ├── iconfont.woff │ └── iconfont.woff2 │ ├── images │ └── face │ │ ├── 0.gif │ │ ├── 1.gif │ │ ├── 10.gif │ │ ├── 11.gif │ │ ├── 12.gif │ │ ├── 13.gif │ │ ├── 14.gif │ │ ├── 15.gif │ │ ├── 16.gif │ │ ├── 17.gif │ │ ├── 18.gif │ │ ├── 19.gif │ │ ├── 2.gif │ │ ├── 20.gif │ │ ├── 21.gif │ │ ├── 22.gif │ │ ├── 23.gif │ │ ├── 24.gif │ │ ├── 25.gif │ │ ├── 26.gif │ │ ├── 27.gif │ │ ├── 28.gif │ │ ├── 29.gif │ │ ├── 3.gif │ │ ├── 30.gif │ │ ├── 31.gif │ │ ├── 32.gif │ │ ├── 33.gif │ │ ├── 34.gif │ │ ├── 35.gif │ │ ├── 36.gif │ │ ├── 37.gif │ │ ├── 38.gif │ │ ├── 39.gif │ │ ├── 4.gif │ │ ├── 40.gif │ │ ├── 41.gif │ │ ├── 42.gif │ │ ├── 43.gif │ │ ├── 44.gif │ │ ├── 45.gif │ │ ├── 46.gif │ │ ├── 47.gif │ │ ├── 48.gif │ │ ├── 49.gif │ │ ├── 5.gif │ │ ├── 50.gif │ │ ├── 51.gif │ │ ├── 52.gif │ │ ├── 53.gif │ │ ├── 54.gif │ │ ├── 55.gif │ │ ├── 56.gif │ │ ├── 57.gif │ │ ├── 58.gif │ │ ├── 59.gif │ │ ├── 6.gif │ │ ├── 60.gif │ │ ├── 61.gif │ │ ├── 62.gif │ │ ├── 63.gif │ │ ├── 64.gif │ │ ├── 65.gif │ │ ├── 66.gif │ │ ├── 67.gif │ │ ├── 68.gif │ │ ├── 69.gif │ │ ├── 7.gif │ │ ├── 70.gif │ │ ├── 71.gif │ │ ├── 8.gif │ │ └── 9.gif │ ├── lay │ └── modules │ │ ├── carousel.js │ │ ├── code.js │ │ ├── colorpicker.js │ │ ├── element.js │ │ ├── flow.js │ │ ├── form.js │ │ ├── jquery.js │ │ ├── laydate.js │ │ ├── layedit.js │ │ ├── layer.js │ │ ├── laypage.js │ │ ├── laytpl.js │ │ ├── mobile.js │ │ ├── rate.js │ │ ├── slider.js │ │ ├── table.js │ │ ├── transfer.js │ │ ├── tree.js │ │ ├── upload.js │ │ └── util.js │ ├── layui.all.js │ └── layui.js ├── composer.json ├── config └── admin.php ├── database └── migrations │ ├── add_custom_field_permission_tables.php │ ├── create_admin_table.php │ ├── create_navigation_table.php │ └── create_permission_group_table.php ├── src ├── Console │ └── InstallCommand.php ├── Database │ └── LayuiAdminTableSeeder.php ├── Http │ ├── Controllers │ │ ├── AdminUserController.php │ │ ├── ChangePasswordController.php │ │ ├── Controller.php │ │ ├── IndexController.php │ │ ├── LoginController.php │ │ ├── NavigationController.php │ │ ├── PermissionController.php │ │ ├── PermissionGroupController.php │ │ └── RoleController.php │ ├── LayuiAdminResponse.php │ ├── Middleware │ │ ├── AdminPermission.php │ │ └── Authenticate.php │ └── Requests │ │ ├── AdminUser │ │ └── CreateOrUpdateRequest.php │ │ ├── ChangePasswordRequest.php │ │ ├── Navigation │ │ └── CreateOrUpdateRequest.php │ │ ├── Permission │ │ └── CreateOrUpdateRequest.php │ │ ├── PermissionGroup │ │ └── CreateOrUpdateRequest.php │ │ └── Role │ │ └── CreateOrUpdateRequest.php ├── Models │ ├── AdminUser.php │ ├── Navigation.php │ ├── Permission.php │ └── PermissionGroup.php ├── Presenters │ └── PermissionGroupPresenter.php ├── Providers │ └── LayuiAdminServiceProvider.php ├── Traits │ └── NavigationTree.php ├── ViewComposers │ └── AdminComposer.php ├── helpers.php └── routes.php └── views ├── admin_user ├── assign_role.blade.php ├── create.blade.php ├── edit.blade.php └── index.blade.php ├── change_password.blade.php ├── layouts └── admin.blade.php ├── login.blade.php ├── message.blade.php ├── navigation ├── create.blade.php ├── edit.blade.php └── index.blade.php ├── permission ├── create.blade.php ├── edit.blade.php └── index.blade.php ├── permission_group ├── create.blade.php ├── edit.blade.php └── index.blade.php └── role ├── assign_permission.blade.php ├── create.blade.php ├── edit.blade.php └── index.blade.php /.gitattributes: -------------------------------------------------------------------------------- 1 | /tests export-ignore 2 | phpunit.xml export-ignore -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /vendor 3 | composer.lock -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Laravel-layui-admin 2 | 3 | 基于 Laravel, Layui 构建的 RBAC 基础后台管理系统。 4 | 5 | > 如果你想要 vue 版本的后台系统, 移步 [moell/mojito ](https://github.com/moell-peng/mojito) 6 | 7 | ## 截图 8 | 9 | ![laravel-layui-admin.png](http://blog-image.moell.cn/laravel-layui-admin.png) 10 | 11 | ## 要求 12 | 13 | - 最低支持 laravel5.8 , 支持 6.0 14 | 15 | 16 | 17 | ## 安装 18 | 19 | 首先安装laravel, 并且确保你配置了正确的数据库连接。 20 | 21 | ``` 22 | composer require moell/laravel-layui-admin 23 | ``` 24 | 25 | 然后运行下面的命令来发布资源和配置: 26 | 27 | ``` 28 | php artisan laravel-layui-admin:install 29 | ``` 30 | 31 | 32 | 33 | 在`config/auth.php`中添加相应的 guards 和 providers,如下: 34 | 35 | ``` 36 | 'guards' => [ 37 | ... 38 | 'admin' => [ 39 | 'driver' => 'session', 40 | 'provider' => 'admin' 41 | ] 42 | ], 43 | 44 | 'providers' => [ 45 | ... 46 | 'admin' => [ 47 | 'driver' => 'eloquent', 48 | 'model' => \Moell\LayuiAdmin\Models\AdminUser::class, 49 | ] 50 | ], 51 | ``` 52 | 53 | 在 `app/Http/Kernel.php` 中 $routeMiddleware 属性添加路由中间`admin.permission` 和替换 auth 中间件: 54 | 55 | ``` 56 | class Kernel extends HttpKernel 57 | { 58 | protected $routeMiddleware = [ 59 | //'auth' => \App\Http\Middleware\Authenticate::class, 60 | 'auth' => \Moell\LayuiAdmin\Http\Middleware\Authenticate::class, 61 | ... 62 | 'admin.permission' => \Moell\LayuiAdmin\Http\Middleware\Authenticate::class, 63 | ]; 64 | } 65 | ``` 66 | 67 | 执行数据迁移,数据填充 68 | 69 | ``` 70 | php artisan migrate 71 | 72 | php artisan db:seed --class="Moell\LayuiAdmin\Database\LayuiAdminTableSeeder" 73 | ``` 74 | 75 | 76 | 77 | 登录 78 | 79 | 80 | url: http://localhost/admin/login 81 | 82 | email: admin@gmail.com 83 | 84 | password: secret 85 | 86 | ## 依赖开源软件 87 | 88 | * Laravel 89 | * Layui 90 | * spatie/laravel-permission 91 | 92 | 93 | 94 | ## 打赏 95 | 96 |

97 | 98 | 99 |

100 | 101 | ## 交流 102 | QQ群:339803849 103 | 104 | 微信:扫码后拉入群 105 |

106 | 107 |

108 | 109 | ## License 110 | 111 | Apache License Version 2.0 see http://www.apache.org/licenses/LICENSE-2.0.html 112 | -------------------------------------------------------------------------------- /assets/css/admin.css: -------------------------------------------------------------------------------- 1 | #admin, body { 2 | width: 100%; 3 | min-height: 100%; 4 | background: #f1f1f1; 5 | } 6 | 7 | .admin-breadcrumb { 8 | padding: 0 20px; 9 | position: relative; 10 | z-index: 99; 11 | border-bottom: 1px solid #e5e5e5; 12 | line-height: 39px; 13 | height: 39px; 14 | overflow: hidden; 15 | background: #fff; 16 | } 17 | 18 | #admin-login { 19 | width: 350px; 20 | padding: 20px; 21 | background: #fff; 22 | position: absolute; 23 | top: 50%; 24 | left: 50%; 25 | margin-top: -200px; 26 | margin-left: -195px; 27 | border: 1px solid #eaeaea; 28 | border-radius: 5px; 29 | } 30 | 31 | #admin-login h2 { 32 | text-align: center; 33 | padding-bottom: 25px; 34 | } -------------------------------------------------------------------------------- /assets/images/30.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/images/30.jpeg -------------------------------------------------------------------------------- /assets/js/admin.js: -------------------------------------------------------------------------------- 1 | ;!function (win) { 2 | 3 | var Admin = function () { 4 | 5 | }; 6 | 7 | Admin.prototype.paginate = function (count, curr, limit, limits) { 8 | layui.laypage.render({ 9 | elem: 'page', 10 | count: count, 11 | curr: curr, 12 | limit: limit, 13 | limits: limits ? limits : [15, 30, 40, 50], 14 | layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip'], 15 | jump: function(obj, first){ 16 | if(!first){ 17 | location.href= window.location.pathname + '?' + $("#search-form").serialize() + '&page='+obj.curr+'&limit='+obj.limit; 18 | } 19 | } 20 | }); 21 | }; 22 | 23 | Admin.prototype.tableDataDelete = function (url, th, isRefresh) { 24 | layui.layer.confirm('你确认删除吗?', { 25 | btn: ['删除', '取消'] 26 | }, function () { 27 | $.ajax({ 28 | type: "DELETE", 29 | url: url, 30 | success: function() { 31 | if (isRefresh) { 32 | window.location = window.location.href 33 | return false; 34 | } 35 | $(th).parent().parent().parent().remove(); 36 | layui.layer.close(); 37 | layui.layer.msg("删除成功", {time: 2000, icon: 6}) 38 | }, 39 | }); 40 | }, function () { 41 | layui.layer.close(); 42 | }); 43 | }; 44 | 45 | Admin.prototype.openLayerForm = function (url, title, method, width, height, noRefresh, formId) { 46 | var formId = formId ? formId : "#layer-form"; 47 | $.get(url, function(view) { 48 | layui.layer.open({ 49 | type: 1, 50 | title: title, 51 | anim: 2, 52 | shadeClose: true, 53 | content: view, 54 | success: function() { 55 | layui.form.render(); 56 | }, 57 | area:[ 58 | width ? width : '50%', 59 | height ? height : '500px' 60 | ], 61 | btn: ['确认', '重置'], 62 | yes: function (index, layero) { 63 | var formObj = $(formId); 64 | $.ajax({ 65 | type: method ? method : 'POST', 66 | url: formObj.attr("action"), 67 | dataType: "json", 68 | data: formObj.serialize(), 69 | success: function(response) { 70 | if (response.status === 'success') { 71 | layui.layer.close(index); 72 | layui.layer.msg(response.message, {time: 2000, icon: 6}) 73 | if (!noRefresh) { 74 | window.location = window.location.href 75 | } 76 | } else { 77 | layui.layer.msg(response.message, {time: 3000, icon: 5}) 78 | } 79 | }, 80 | }); 81 | }, 82 | btn2: function (index, layero) { 83 | $(formId)[0].reset(); 84 | return false; 85 | } 86 | }); 87 | }); 88 | }; 89 | 90 | win.admin = new Admin(); 91 | }(window); 92 | 93 | layui.config({ 94 | base: "/vendor/laravel-layui-admin/js/" 95 | }); 96 | 97 | layui.use("jquery", function() { 98 | $ = layui.jquery; 99 | 100 | $.ajaxSetup({ 101 | headers: { 102 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 103 | }, 104 | error: function(XMLHttpRequest, textStatus, errorThrown) { 105 | var status = XMLHttpRequest.status; 106 | var responseText = XMLHttpRequest.responseText; 107 | var msg = '不好,有错误'; 108 | switch (status) { 109 | case 400: 110 | msg = responseText != '' ? responseText : '失败了'; 111 | break; 112 | case 401: 113 | msg = responseText != '' ? responseText : '你没有权限'; 114 | break; 115 | case 403: 116 | msg = '你没有权限执行此操作!'; 117 | break; 118 | case 404: 119 | msg = '你访问的操作不存在'; 120 | break; 121 | case 406: 122 | msg = '请求格式不正确'; 123 | break; 124 | case 410: 125 | msg = '你访问的资源已被删除'; 126 | break; 127 | case 422: 128 | var errors = $.parseJSON(XMLHttpRequest.responseText); 129 | 130 | if (errors instanceof Object) { 131 | var m = ''; 132 | $.each(errors, function(index, item) { 133 | if (item instanceof Object) { 134 | $.each(item, function(index, i) { 135 | m = m + i + '
'; 136 | }); 137 | } else { 138 | m = m + item + '
'; 139 | } 140 | }); 141 | msg = m; 142 | } 143 | break; 144 | case 429: 145 | msg = '超出访问频率限制'; 146 | break; 147 | case 500: 148 | msg = '500 INTERNAL SERVER ERROR'; 149 | break; 150 | default: 151 | return true; 152 | } 153 | 154 | layer.msg(msg, {time: 3000, icon: 5}); 155 | } 156 | }); 157 | }); -------------------------------------------------------------------------------- /assets/js/particles.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * A lightweight, dependency-free and responsive javascript plugin for particle backgrounds. 3 | * 4 | * @author Marc Bruederlin 5 | * @version 2.2.3 6 | * @license MIT 7 | * @see https://github.com/marcbruederlin/particles.js 8 | */ 9 | var Particles=function(e,t){"use strict";var n,i={};function o(e,t){return e.xt.x?1:e.yt.y?1:0}return(n=function(){return function(){var e=this;e.defaults={responsive:null,selector:null,maxParticles:100,sizeVariations:3,showParticles:!0,speed:.5,color:"#000000",minDistance:120,connectParticles:!1},e.element=null,e.context=null,e.ratio=null,e.breakpoints=[],e.activeBreakpoint=null,e.breakpointSettings=[],e.originalSettings=null,e.storage=[],e.usingPolyfill=!1}}()).prototype.init=function(e){var t=this;return t.options=t._extend(t.defaults,e),t.originalSettings=JSON.parse(JSON.stringify(t.options)),t._animate=t._animate.bind(t),t._initializeCanvas(),t._initializeEvents(),t._registerBreakpoints(),t._checkResponsive(),t._initializeStorage(),t._animate(),t},n.prototype.destroy=function(){var t=this;t.storage=[],t.element.remove(),e.removeEventListener("resize",t.listener,!1),e.clearTimeout(t._animation),cancelAnimationFrame(t._animation)},n.prototype._initializeCanvas=function(){var n,i,o=this;if(!o.options.selector)return console.warn("particles.js: No selector specified! Check https://github.com/marcbruederlin/particles.js#options"),!1;o.element=t.querySelector(o.options.selector),o.context=o.element.getContext("2d"),n=e.devicePixelRatio||1,i=o.context.webkitBackingStorePixelRatio||o.context.mozBackingStorePixelRatio||o.context.msBackingStorePixelRatio||o.context.oBackingStorePixelRatio||o.context.backingStorePixelRatio||1,o.ratio=n/i,o.element.width=o.element.offsetParent?o.element.offsetParent.clientWidth*o.ratio:o.element.clientWidth*o.ratio,o.element.offsetParent&&"BODY"===o.element.offsetParent.nodeName?o.element.height=e.innerHeight*o.ratio:o.element.height=o.element.offsetParent?o.element.offsetParent.clientHeight*o.ratio:o.element.clientHeight*o.ratio,o.element.style.width="100%",o.element.style.height="100%",o.context.scale(o.ratio,o.ratio)},n.prototype._initializeEvents=function(){var t=this;t.listener=function(){t._resize()}.bind(this),e.addEventListener("resize",t.listener,!1)},n.prototype._initializeStorage=function(){var e=this;e.storage=[];for(var t=e.options.maxParticles;t--;)e.storage.push(new i(e.context,e.options))},n.prototype._registerBreakpoints=function(){var e,t,n,i=this,o=i.options.responsive||null;if("object"==typeof o&&null!==o&&o.length){for(e in o)if(n=i.breakpoints.length-1,t=o[e].breakpoint,o.hasOwnProperty(e)){for(;n>=0;)i.breakpoints[n]&&i.breakpoints[n]===t&&i.breakpoints.splice(n,1),n--;i.breakpoints.push(t),i.breakpointSettings[t]=o[e].options}i.breakpoints.sort(function(e,t){return t-e})}},n.prototype._checkResponsive=function(){var t,n=this,i=!1,o=e.innerWidth;if(n.options.responsive&&n.options.responsive.length&&null!==n.options.responsive){for(t in i=null,n.breakpoints)n.breakpoints.hasOwnProperty(t)&&o<=n.breakpoints[t]&&(i=n.breakpoints[t]);null!==i?(n.activeBreakpoint=i,n.options=n._extend(n.options,n.breakpointSettings[i])):null!==n.activeBreakpoint&&(n.activeBreakpoint=null,i=null,n.options=n._extend(n.options,n.originalSettings))}},n.prototype._refresh=function(){this._initializeStorage(),this._draw()},n.prototype._resize=function(){var t=this;t.element.width=t.element.offsetParent?t.element.offsetParent.clientWidth*t.ratio:t.element.clientWidth*t.ratio,t.element.offsetParent&&"BODY"===t.element.offsetParent.nodeName?t.element.height=e.innerHeight*t.ratio:t.element.height=t.element.offsetParent?t.element.offsetParent.clientHeight*t.ratio:t.element.clientHeight*t.ratio,t.context.scale(t.ratio,t.ratio),clearTimeout(t.windowDelay),t.windowDelay=e.setTimeout(function(){t._checkResponsive(),t._refresh()},50)},n.prototype._animate=function(){var t=this;t._draw(),t._animation=e.requestAnimFrame(t._animate)},n.prototype.resumeAnimation=function(){this._animation||this._animate()},n.prototype.pauseAnimation=function(){var t=this;if(t._animation){if(t.usingPolyfill)e.clearTimeout(t._animation);else(e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.mozCancelAnimationFrame)(t._animation);t._animation=null}},n.prototype._draw=function(){var t=this,n=t.element,i=n.offsetParent?n.offsetParent.clientWidth:n.clientWidth,r=n.offsetParent?n.offsetParent.clientHeight:n.clientHeight,a=t.options.showParticles,s=t.storage;n.offsetParent&&"BODY"===n.offsetParent.nodeName&&(r=e.innerHeight),t.context.clearRect(0,0,n.width,n.height),t.context.beginPath();for(var l=s.length;l--;){var c=s[l];a&&c._draw(),c._updateCoordinates(i,r)}t.options.connectParticles&&(s.sort(o),t._updateEdges())},n.prototype._updateEdges=function(){for(var e=this,t=e.options.minDistance,n=Math.sqrt,i=Math.abs,o=e.storage,r=o.length,a=0;at)break;c<=t&&e._drawEdge(s,f,1.2-c/t)}},n.prototype._drawEdge=function(e,t,n){var i=this,o=i.context.createLinearGradient(e.x,e.y,t.x,t.y),r=this._hex2rgb(e.color),a=this._hex2rgb(t.color);o.addColorStop(0,"rgba("+r.r+","+r.g+","+r.b+","+n+")"),o.addColorStop(1,"rgba("+a.r+","+a.g+","+a.b+","+n+")"),i.context.beginPath(),i.context.strokeStyle=o,i.context.moveTo(e.x,e.y),i.context.lineTo(t.x,t.y),i.context.stroke(),i.context.fill(),i.context.closePath()},n.prototype._extend=function(e,t){return Object.keys(t).forEach(function(n){e[n]=t[n]}),e},n.prototype._hex2rgb=function(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},(i=function(n,i){var o=this,r=Math.random,a=i.speed,s=i.color instanceof Array?i.color[Math.floor(Math.random()*i.color.length)]:i.color;o.context=n,o.options=i;var l=t.querySelector(i.selector);o.x=l.offsetParent?r()*l.offsetParent.clientWidth:r()*l.clientWidth,l.offsetParent&&"BODY"===l.offsetParent.nodeName?o.y=r()*e.innerHeight:o.y=l.offsetParent?r()*l.offsetParent.clientHeight:r()*l.clientHeight,o.vx=r()*a*2-a,o.vy=r()*a*2-a,o.radius=r()*r()*i.sizeVariations,o.color=s,o._draw()}).prototype._draw=function(){var e=this;e.context.save(),e.context.translate(e.x,e.y),e.context.moveTo(0,0),e.context.beginPath(),e.context.arc(0,0,e.radius,0,2*Math.PI,!1),e.context.fillStyle=e.color,e.context.fill(),e.context.restore()},i.prototype._updateCoordinates=function(e,t){var n=this,i=n.x+this.vx,o=n.y+this.vy,r=n.radius;i+r>e?i=r:i-r<0&&(i=e-r),o+r>t?o=r:o-r<0&&(o=t-r),n.x=i,n.y=o},e.requestAnimFrame=function(){var t=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame;return t||(this._usingPolyfill=!0,function(t){return e.setTimeout(t,1e3/60)})}(),new n}(window,document);!function(){"use strict";"function"==typeof define&&define.amd?define("Particles",function(){return Particles}):"undefined"!=typeof module&&module.exports?module.exports=Particles:window.Particles=Particles}(); -------------------------------------------------------------------------------- /assets/js/treeTable.js: -------------------------------------------------------------------------------- 1 | layui.define(['jquery'], function(exports) { 2 | var MOD_NAME = 'treeTable', 3 | o = layui.jquery, 4 | tree = function() {}; 5 | tree.prototype.config = function() { 6 | return { 7 | top_value: 0, 8 | primary_key: 'id', 9 | parent_key: 'pid', 10 | hide_class: 'layui-hide', 11 | icon: { 12 | open: 'layui-icon layui-icon-triangle-d', 13 | close: 'layui-icon layui-icon-triangle-r', 14 | left: 16, 15 | }, 16 | cols: [], 17 | checked: {}, 18 | is_click_icon: false, 19 | is_checkbox: false, 20 | is_cache: true, 21 | }; 22 | } 23 | tree.prototype.template = function(e) { 24 | var t = this, 25 | level = [], 26 | tbody = '', 27 | is_table = o('table' + e.elem).length || !(e.is_click_icon = true), 28 | checkbox = e.is_checkbox ? '
' : '', 29 | checked = checkbox ? checkbox.replace('cbx', 'cbx layui-form-checked') : '', 30 | thead = checkbox && '' + (o.inArray(e.top_value, e.checked.data) > -1 ? checked : checkbox) + ''; 31 | o.each(t.data(e, e.data), function(idx, item) { 32 | var tr = '', 33 | is_checked = false, 34 | hide_class = (item[e.parent_key] == e.top_value) || (item[e.parent_key] == t.cache(e, item[e.parent_key])) ? '' : e.hide_class; 35 | // 设置每行数据层级 36 | item.level = level[item[e.primary_key]] = item[e.parent_key] != e.top_value ? (level[item[e.parent_key]] + 1) : 0; 37 | // 设置是否为最后一级 38 | item.is_end = !e.childs[item[e.primary_key]]; 39 | o.each(e.cols, function(index, obj) { 40 | var style = ''; 41 | obj.width && (style += 'width:' + obj.width + ';'), obj.align && (style += 'text-align:' + obj.align + ';'), style && (style = 'style="' + style + '"'); 42 | // 标记设置行checkbox选中 43 | if(e.is_checkbox && e.checked && o.inArray(item[e.checked.key], e.checked.data) > -1) { 44 | is_checked = true; 45 | } 46 | // 第一次遍历头部的时候拼接表格头部 47 | idx || (thead += '' + obj.title + ''); 48 | // 指定列加入开启、关闭小图标 49 | var icon = (obj.key == e.icon_key && !item.is_end) ? '' : ''; 50 | // 指定列小图标按照层级向后位移 51 | var left = (obj.key == e.icon_key ? level[item[e.primary_key]] * e.icon.left + 'px' : ''); 52 | icon = icon.replace('>', ' style="margin-left:' + left + ';">'); 53 | // 拼接行 54 | tr += '' + icon + (is_table ? '' : (is_checked ? checked : checkbox)) + (obj.template ? obj.template(item) : item[obj.key]) + ''; 55 | }); 56 | var box = is_table ? o(is_checked ? checked : checkbox).wrap('').parent().prop('outerHTML') : ''; 57 | tbody += '' + box + tr + ''; 58 | }); 59 | // 处理表树和树的赋值模板 60 | var table = is_table ? '' + thead + '' + tbody + '' : tbody.replace(//g, 'ul>').replace(//g, 'li>'); 61 | // 确认点击图标或点击列触发展开关闭 62 | var click_btn = e.is_click_icon ? '[data-down] i:not(.layui-icon-ok)' : '[data-down]'; 63 | // 模板渲染并处理点击展开收起等功能 64 | o(e.elem).html(table).off('click', click_btn).on('click', click_btn, function() { 65 | var tr = o(this).parents('[data-id]'), 66 | td = tr.find('[data-down]'), 67 | id = tr.data('id'), 68 | pid = tr.data('pid'), 69 | is_open = (td.find('i:not(.layui-icon-ok)').attr('class') == e.icon.close); 70 | if(is_open) { 71 | // 展开子级(子级出现、更改图标) 72 | td.find('i:not(.layui-icon-ok)').attr('class', e.icon.open); 73 | td.parents(e.elem).find('[data-pid=' + id + ']').removeClass(e.hide_class); 74 | t.cache(e, id, true); 75 | } else { 76 | // 关闭子级(更改图标、隐藏所有子孙级) 77 | td.find('i:not(.layui-icon-ok)').attr('class', e.icon.close); 78 | t.childs_hide(e, id); 79 | } 80 | // 设置监听展开关闭 81 | layui.event.call(this, MOD_NAME, 'tree(flex)', { 82 | elem: this, 83 | item: e.childs[pid][id], 84 | table: e.elem, 85 | is_open: is_open, 86 | }) 87 | }).off('click', '.cbx').on('click', '.cbx', function() { 88 | var is_checked = o(this).toggleClass('layui-form-checked').hasClass('layui-form-checked'), 89 | tr = o(this).parents('[data-id]'), 90 | id = tr.data('id'), 91 | pid = tr.data('pid'); 92 | t.childs_checkbox(e, id, is_checked); 93 | t.parents_checkbox(e, pid); 94 | // 设置监听checkbox选择 95 | layui.event.call(this, MOD_NAME, 'tree(box)', { 96 | elem: this, 97 | item: pid === undefined ? {} : e.childs[pid][id], 98 | table: e.elem, 99 | is_checked: is_checked, 100 | }) 101 | }).off('click', '[lay-filter]').on('click', '[lay-filter]', function() { 102 | var tr = o(this).parents('[data-id]'), 103 | id = tr.data('id'), 104 | pid = tr.data('pid'), 105 | filter = o(this).attr("lay-filter"); 106 | return layui.event.call(this, MOD_NAME, 'tree(' + filter + ')', { 107 | elem: this, 108 | item: e.childs[pid][id], 109 | }) 110 | }); 111 | e.end && e.end(e); 112 | }; 113 | // 同级全部选中父级选中/同级全部取消取消父级 114 | tree.prototype.parents_checkbox = function(e, pid) { 115 | var po = o(e.elem).find('[data-pid=' + pid + ']'), 116 | co = o(e.elem).find('[data-id=' + pid + ']'), 117 | len = o(e.elem).find('[data-pid=' + pid + '] .cbx.layui-form-checked').length; 118 | if(po.length == len || len == 0) { 119 | var pid = co.data('pid'); 120 | len ? co.find('.cbx').addClass('layui-form-checked') : co.find('.cbx').removeClass('layui-form-checked'); 121 | pid === undefined || this.parents_checkbox(e, pid); 122 | } 123 | }; 124 | // 子级反选 125 | tree.prototype.childs_checkbox = function(e, id, is_checked) { 126 | var t = this; 127 | o(e.elem).find('[data-pid=' + id + ']').each(function() { 128 | var checkbox = o(this).find('.cbx'); 129 | is_checked ? checkbox.addClass('layui-form-checked') : checkbox.removeClass('layui-form-checked'); 130 | t.childs_checkbox(e, o(this).data('id'), is_checked); 131 | }) 132 | }; 133 | // 点击收起循环隐藏子级元素 134 | tree.prototype.childs_hide = function(e, id) { 135 | var t = this; 136 | t.cache(e, id, false); 137 | o(e.elem).find('[data-pid=' + id + ']:not(.' + e.hide_class + ')').each(function() { 138 | var td = o(this).find('[data-down]'), 139 | i = td.find('i:not(.layui-icon-ok)'); 140 | // 关闭更换小图标 141 | i.length && i.attr('class', e.icon.close); 142 | // 隐藏子级 143 | td.parents(e.elem).find('[data-pid=' + id + ']').addClass(e.hide_class); 144 | t.childs_hide(e, o(this).data('id')) 145 | }); 146 | }; 147 | // 重新组合数据,父子级关系跟随 148 | tree.prototype.data = function(e) { 149 | var lists = [], 150 | childs = []; 151 | o.each(e.data, function(idx, item) { 152 | lists[item[e.primary_key]] = item; 153 | if(!childs[item[e.parent_key]]) { 154 | childs[item[e.parent_key]] = []; 155 | } 156 | childs[item[e.parent_key]][item[e.primary_key]] = item; 157 | }); 158 | e.childs = childs; 159 | return this.tree_data(e, lists, e.top_value, []); 160 | }; 161 | tree.prototype.tree_data = function(e, lists, pid, data) { 162 | var t = this; 163 | if(lists[pid]) { 164 | data.push(lists[pid]); 165 | delete lists[pid] 166 | } 167 | o.each(e.data, function(index, item) { 168 | if(item[e.parent_key] == pid) { 169 | data.concat(t.tree_data(e, lists, item[e.primary_key], data)) 170 | } 171 | }); 172 | return data; 173 | }; 174 | tree.prototype.render = function(e) { 175 | var t = this; 176 | e = o.extend(t.config(), e); 177 | if(e.url) { 178 | o.get(e.url, function(res) { 179 | e.data = res; 180 | t.template(e); 181 | }) 182 | } else { 183 | t.template(e); 184 | } 185 | return e; 186 | }; 187 | // 获取已选值集合 188 | tree.prototype.checked = function(e) { 189 | var ids = []; 190 | o(e.elem).find('.cbx.layui-form-checked').each(function() { 191 | var id = o(this).parents('[data-id]').data('id'); 192 | ids.push(id); 193 | }) 194 | return ids; 195 | }; 196 | // 全部展开 197 | tree.prototype.openAll = function(e) { 198 | var t = this; 199 | o.each(e.data, function(idx, item) { 200 | item[e.primary_key] && t.cache(e, item[e.primary_key], true); 201 | }) 202 | t.render(e); 203 | } 204 | // 全部关闭 205 | tree.prototype.closeAll = function(e) { 206 | localStorage.setItem(e.elem.substr(1), ''); 207 | this.render(e); 208 | } 209 | tree.prototype.on = function(events, callback) { 210 | return layui.onevent.call(this, MOD_NAME, events, callback) 211 | }; 212 | // 存储折叠状态 213 | tree.prototype.cache = function(e, val, option) { 214 | if(!e.is_cache) { 215 | return false; 216 | } 217 | var t = this, 218 | name = e.elem.substr(1), 219 | val = val.toString(), 220 | cache = localStorage.getItem(name) ? localStorage.getItem(name).split(',') : [], 221 | index = o.inArray(val, cache); 222 | if(option === undefined) { 223 | return index == -1 ? false : val 224 | } 225 | if(option && index == -1) { 226 | cache.push(val) 227 | } 228 | if(!option && index > -1) { 229 | cache.splice(index, 1) 230 | } 231 | localStorage.setItem(name, cache.join(',')); 232 | }; 233 | var tree = new tree(); 234 | exports(MOD_NAME, tree) 235 | }); -------------------------------------------------------------------------------- /assets/lib/layui/css/modules/code.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | 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 #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.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 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.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} -------------------------------------------------------------------------------- /assets/lib/layui/css/modules/laydate/default/laydate.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | .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:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-name:laydate-upbit;animation-name:laydate-upbit}.layui-laydate-main{width:272px}.layui-laydate-content td,.layui-laydate-header *,.layui-laydate-list li{transition-duration:.3s;-webkit-transition-duration:.3s}@-webkit-keyframes laydate-upbit{from{-webkit-transform:translate3d(0,20px,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes laydate-upbit{from{transform:translate3d(0,20px,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.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}.laydate-set-ym span,.layui-laydate-header i{padding:0 5px;cursor:pointer}.layui-laydate-header *{display:inline-block;vertical-align:bottom}.layui-laydate-header i{position:absolute;top:10px;color:#999;font-size:18px}.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-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{position:relative;cursor:pointer}.laydate-day-mark{position:absolute;left:0;top:0;width:100%;height: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 20px}.layui-laydate-footer span{margin-right:15px;display:inline-block;cursor:pointer;font-size:12px}.layui-laydate-footer span:hover{color:#5FB878}.laydate-footer-btns{position:absolute;right:10px;top:10px}.laydate-footer-btns span{height:26px;line-height:26px;margin:0 0 0 -1px;padding:0 10px;border:1px solid #C9C9C9;background-color:#fff;white-space:nowrap;vertical-align:top;border-radius:2px}.layui-laydate-list>li,.layui-laydate-range .layui-laydate-main{display:inline-block;vertical-align:middle}.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;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{color:#666}.layui-laydate-content td.laydate-selected{background-color:#00F7DE}.laydate-selected:hover{background-color:#00F7DE!important}.layui-laydate-content td:hover,.layui-laydate-list li:hover{background-color:#eaeaea;color:#333}.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-color:#f8f8f8!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:#009688!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} -------------------------------------------------------------------------------- /assets/lib/layui/css/modules/layer/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/css/modules/layer/default/icon-ext.png -------------------------------------------------------------------------------- /assets/lib/layui/css/modules/layer/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/css/modules/layer/default/icon.png -------------------------------------------------------------------------------- /assets/lib/layui/css/modules/layer/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/css/modules/layer/default/loading-0.gif -------------------------------------------------------------------------------- /assets/lib/layui/css/modules/layer/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/css/modules/layer/default/loading-1.gif -------------------------------------------------------------------------------- /assets/lib/layui/css/modules/layer/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/css/modules/layer/default/loading-2.gif -------------------------------------------------------------------------------- /assets/lib/layui/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/font/iconfont.eot -------------------------------------------------------------------------------- /assets/lib/layui/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/font/iconfont.ttf -------------------------------------------------------------------------------- /assets/lib/layui/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/font/iconfont.woff -------------------------------------------------------------------------------- /assets/lib/layui/font/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/font/iconfont.woff2 -------------------------------------------------------------------------------- /assets/lib/layui/images/face/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/0.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/1.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/10.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/11.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/12.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/13.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/14.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/15.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/16.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/17.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/17.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/18.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/18.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/19.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/19.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/2.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/20.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/21.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/22.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/23.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/24.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/25.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/26.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/26.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/27.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/28.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/28.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/29.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/29.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/3.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/30.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/31.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/31.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/32.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/33.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/34.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/34.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/35.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/36.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/36.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/37.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/37.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/38.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/39.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/39.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/4.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/40.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/40.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/41.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/41.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/42.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/42.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/43.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/43.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/44.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/45.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/45.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/46.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/46.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/47.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/48.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/48.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/49.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/49.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/5.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/50.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/51.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/51.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/52.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/53.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/53.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/54.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/54.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/55.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/55.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/56.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/56.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/57.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/57.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/58.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/58.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/59.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/59.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/6.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/60.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/60.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/61.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/62.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/62.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/63.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/63.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/64.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/65.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/65.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/66.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/66.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/67.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/67.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/68.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/68.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/69.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/69.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/7.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/70.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/70.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/71.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/71.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/8.gif -------------------------------------------------------------------------------- /assets/lib/layui/images/face/9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moell-peng/laravel-layui-admin/0fc39af73685feaf895e1238aab4480b7d16375e/assets/lib/layui/images/face/9.gif -------------------------------------------------------------------------------- /assets/lib/layui/lay/modules/carousel.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;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&&(clearInterval(e.timer),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/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"); -------------------------------------------------------------------------------- /assets/lib/layui/lay/modules/element.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(t){"use strict";var a=layui.$,i=(layui.hint(),layui.device()),e="element",l="layui-this",n="layui-show",s=function(){this.config={}};s.prototype.set=function(t){var i=this;return a.extend(!0,i.config,t),i},s.prototype.on=function(t,a){return layui.onevent.call(this,e,t,a)},s.prototype.tabAdd=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.children(".layui-tab-bar"),o=l.children(".layui-tab-content"),r='
  • "+(i.title||"unnaming")+"
  • ";return s[0]?s.before(r):n.append(r),o.append('
    '+(i.content||"")+"
    "),f.hideTabMore(!0),f.tabAuto(),this},s.prototype.tabDelete=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.find('>li[lay-id="'+i+'"]');return f.tabDelete(null,s),this},s.prototype.tabChange=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.find('>li[lay-id="'+i+'"]');return f.tabClick.call(s[0],null,null,s),this},s.prototype.tab=function(t){t=t||{},b.on("click",t.headerElem,function(i){var e=a(this).index();f.tabClick.call(this,i,e,null,t)})},s.prototype.progress=function(t,i){var e="layui-progress",l=a("."+e+"[lay-filter="+t+"]"),n=l.find("."+e+"-bar"),s=n.find("."+e+"-text");return n.css("width",i),s.text(i),this};var o=".layui-nav",r="layui-nav-item",c="layui-nav-bar",u="layui-nav-tree",d="layui-nav-child",y="layui-nav-more",h="layui-anim layui-anim-upbit",f={tabClick:function(t,i,s,o){o=o||{};var r=s||a(this),i=i||r.parent().children("li").index(r),c=o.headerElem?r.parent():r.parents(".layui-tab").eq(0),u=o.bodyElem?a(o.bodyElem):c.children(".layui-tab-content").children(".layui-tab-item"),d=r.find("a"),y=c.attr("lay-filter");"javascript:;"!==d.attr("href")&&"_blank"===d.attr("target")||(r.addClass(l).siblings().removeClass(l),u.eq(i).addClass(n).siblings().removeClass(n)),layui.event.call(this,e,"tab("+y+")",{elem:c,index:i})},tabDelete:function(t,i){var n=i||a(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]?f.tabClick.call(n.next()[0],null,s+1):n.prev()[0]&&f.tabClick.call(n.prev()[0],null,s-1)),n.remove(),r.eq(s).remove(),setTimeout(function(){f.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;a(".layui-tab").each(function(){var s=a(this),o=s.children(".layui-tab-title"),r=(s.children(".layui-tab-content").children(".layui-tab-item"),'lay-stope="tabmore"'),c=a('');if(n===window&&8!=i.ie&&f.hideTabMore(!0),s.attr("lay-allowClose")&&o.find("li").each(function(){var t=a(this);if(!t.find("."+l)[0]){var i=a('');i.on("click",f.tabDelete),t.append(i)}}),"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(a){o[this.title?"removeClass":"addClass"](t),this.title=this.title?"":"收缩"})}else o.find("."+e).remove(),s.removeAttr("overflow")})},hideTabMore:function(t){var i=a(".layui-tab-title");t!==!0&&"tabmore"===a(t.target).attr("lay-stope")||(i.removeClass("layui-tab-more"),i.find(".layui-tab-bar").attr("title",""))},clickThis:function(){var t=a(this),i=t.parents(o),n=i.attr("lay-filter"),s=t.parent(),c=t.siblings("."+d),y="string"==typeof s.attr("lay-unselect");"javascript:;"!==t.attr("href")&&"_blank"===t.attr("target")||y||c[0]||(i.find("."+l).removeClass(l),s.addClass(l)),i.hasClass(u)&&(c.removeClass(h),c[0]&&(s["none"===c.css("display")?"addClass":"removeClass"](r+"ed"),"all"===i.attr("lay-shrink")&&s.siblings().removeClass(r+"ed"))),layui.event.call(this,e,"nav("+n+")",t)},collapse:function(){var t=a(this),i=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),i.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(){f.tabAuto.call({})},nav:function(){var t=200,e={},s={},p={},b=function(l,o,r){var c=a(this),f=c.find("."+d);o.hasClass(u)?l.css({top:c.position().top,height:c.children("a").outerHeight(),opacity:1}):(f.addClass(h),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:c.width(),opacity:1})},i.ie&&i.ie<10?0:t),clearTimeout(p[r]),"block"===f.css("display")&&clearTimeout(s[r]),s[r]=setTimeout(function(){f.addClass(n),c.find("."+y).addClass(y+"d")},300))};a(o+l).each(function(i){var l=a(this),o=a(''),h=l.find("."+r);l.find("."+c)[0]||(l.append(o),h.on("mouseenter",function(){b.call(this,o,l,i)}).on("mouseleave",function(){l.hasClass(u)||(clearTimeout(s[i]),s[i]=setTimeout(function(){l.find("."+d).removeClass(n),l.find("."+y).removeClass(y+"d")},300))}),l.on("mouseleave",function(){clearTimeout(e[i]),p[i]=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})},t)})),h.find("a").each(function(){var t=a(this),i=(t.parent(),t.siblings("."+d));i[0]&&!t.children("."+y)[0]&&t.append(''),t.off("click",f.clickThis).on("click",f.clickThis)})})},breadcrumb:function(){var t=".layui-breadcrumb";a(t+l).each(function(){var t=a(this),i="lay-separator",e=t.attr(i)||"/",l=t.find("a");l.next("span["+i+"]")[0]||(l.each(function(t){t!==l.length-1&&a(this).after(""+e+"")}),t.css("visibility","visible"))})},progress:function(){var t="layui-progress";a("."+t+l).each(function(){var i=a(this),e=i.find(".layui-progress-bar"),l=e.attr("lay-percent");e.css("width",function(){return/^.+\/.+$/.test(l)?100*new Function("return "+l)()+"%":l}()),i.attr("lay-showPercent")&&setTimeout(function(){e.html(''+l+"")},350)})},collapse:function(){var t="layui-collapse";a("."+t+l).each(function(){var t=a(this).find(".layui-colla-item");t.each(function(){var t=a(this),i=t.find(".layui-colla-title"),e=t.find(".layui-colla-content"),l="none"===e.css("display");i.find(".layui-colla-icon").remove(),i.append(''+(l?"":"")+""),i.off("click",f.collapse).on("click",f.collapse)})})}};return s[t]?s[t]():layui.each(s,function(t,a){a()})},s.prototype.render=s.prototype.init;var p=new s,b=a(document);p.render();var v=".layui-tab-title li";b.on("click",v,f.tabClick),b.on("click",f.hideTabMore),a(window).on("resize",f.tabAuto),t(e,p)}); -------------------------------------------------------------------------------- /assets/lib/layui/lay/modules/flow.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;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 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)}); -------------------------------------------------------------------------------- /assets/lib/layui/lay/modules/form.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;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",c="layui-disabled",u=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)$)/,"请输入正确的身份证号"]}}};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.on=function(e,t){return layui.onevent.call(this,l,e,t)},u.prototype.val=function(e,i){var a=t(r+'[lay-filter="'+e+'"]');a.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)},u.prototype.render=function(e,i){var n=this,u=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=u.find("select"),v=function(i,l){t(i.target).parent().hasClass(n)&&!l||(t("."+a).removeClass(a+"ed "+a+"up"),e&&d&&e.val(d)),e=null},y=function(i,u,f){var y,p=t(this),m=i.find("."+n),k=m.find("input"),x=i.find("dl"),g=x.children("dd"),b=this.selectedIndex;if(!u){var C=function(){var e=i.offset().top+i.outerHeight()+5-h.scrollTop(),t=x.outerHeight();b=p[0].selectedIndex,i.addClass(a+"ed"),g.removeClass(o),y=null,g.eq(b).addClass(s).siblings().removeClass(s),e+t>h.height()&&e>=t&&i.addClass(a+"up"),T()},w=function(e){i.removeClass(a+"ed "+a+"up"),k.blur(),y=null,e||$(k.val(),function(e){var i=p[0].selectedIndex;e&&(d=t(p[0].options[i]).html(),0===i&&d===k.attr("placeholder")&&(d=""),k.val(d||""))})},T=function(){var e=x.children("dd."+s);if(e[0]){var t=e.position().top,i=x.height(),a=e.height();t>i&&x.scrollTop(t+x.scrollTop()-i+a-5),t<0&&x.scrollTop(t+x.scrollTop()-5)}};m.on("click",function(e){i.hasClass(a+"ed")?w():(v(e,!0),C()),x.find("."+r).remove()}),m.find(".layui-edge").on("click",function(){k.focus()}),k.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=x.children("dd."+s);if(x.children("dd."+o)[0]&&"next"===t){var i=x.children("dd:not(."+o+",."+c+")"),n=i.eq(0).index();if(n>=0&&n无匹配项

    '):x.find("."+r).remove()},"keyup"),""===t&&x.find("."+r).remove(),void T())};f&&k.on("keyup",q).on("blur",function(i){var a=p[0].selectedIndex;e=k,d=t(p[0].options[a]).html(),0===a&&d===k.attr("placeholder")&&(d=""),setTimeout(function(){$(k.val(),function(e){d||k.val("")},"blur")},200)}),g.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")?k.val(""):(k.val(e.text()),e.addClass(s)),e.siblings().removeClass(s),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),o=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 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),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=u.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 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?s[0]:s[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=u.find("input[type=radio]"),n=function(a){var n=t(this),s="layui-anim-scaleSpring";a.on("click",function(){var o=n[0].name,c=n.parents(r),u=n.attr("lay-filter"),d=c.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("+u+")",{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 u=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(u),n.call(this,u)})}};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",c={},u=e.parents(r),d=u.find("*[lay-verify]"),v=e.parents("form")[0],h=u.find("input,select,textarea"),y=e.attr("lay-filter");if(layui.each(d,function(e,l){var r=t(this),c=r.attr("lay-verify").split("|"),u=r.attr("lay-verType"),d=r.val();if(r.removeClass(o),layui.each(c,function(e,t){var c,f="",v="function"==typeof a[t];if(a[t]){var c=v?f=a[t](d,l):!a[t][0].test(d);if(f=f||a[t][1],"required"===t&&(f=r.attr("lay-reqText")||f),c)return"tips"===u?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"===u?i.alert(f,{title:"提示",shadeClose:!0}):i.msg(f,{icon:5,shift:6}),n.android||n.ios||setTimeout(function(){l.focus()},7),r.addClass(o),s=!0}}),s)return s}),s)return!1;var p={};return layui.each(h,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||(c[t.name]=t.value)}}),layui.event.call(this,l,"submit("+y+")",{elem:this,form:v,field:c})},f=new u,v=t(document),h=t(window);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)}); -------------------------------------------------------------------------------- /assets/lib/layui/lay/modules/laypage.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;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=['"}(),refresh:['','',""].join(""),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)}); -------------------------------------------------------------------------------- /assets/lib/layui/lay/modules/laytpl.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;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)}); -------------------------------------------------------------------------------- /assets/lib/layui/lay/modules/rate.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var a=layui.jquery,i={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,a){return layui.onevent.call(this,n,e,a)}},l=function(){var e=this,a=e.config;return{setvalue:function(a){e.setvalue.call(e,a)},config:a}},n="rate",t="layui-rate",o="layui-icon-rate",s="layui-icon-rate-solid",u="layui-icon-rate-half",r="layui-icon-rate-solid layui-icon-rate-half",c="layui-icon-rate-solid layui-icon-rate",f="layui-icon-rate layui-icon-rate-half",v=function(e){var l=this;l.index=++i.index,l.config=a.extend({},l.config,i.config,e),l.render()};v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},v.prototype.render=function(){var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':"";i.elem=a(i.elem),parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value)));for(var n='
      ",u=1;u<=i.length;u++){var r='
    • ";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'
    • ":n+=r}n+="
    "+(i.text?''+i.value+"星":"")+"";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)}); -------------------------------------------------------------------------------- /assets/lib/layui/lay/modules/slider.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;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(i,t){return e.slide("set",i,t||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",m="layui-slider-input-btn",p="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),m=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 m=Math.floor((t.value-t.min)/(t.max-t.min)*100)+"%"}var p=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),u=l.setTips?l.setTips(u):u,s.find("."+d).html(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(p),s.find("."+d).show(),i.preventDefault()},o=function(){t.removeClass(p),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.hover(function(){var e=i(this);e.children("."+m).fadeIn("fast")},function(){var e=i(this);e.children("."+m).fadeOut("fast")}),y.children("."+m).children("i").each(function(e){i(this).on("click",function(){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)}); -------------------------------------------------------------------------------- /assets/lib/layui/lay/modules/transfer.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;layui.define(["laytpl","form"],function(e){"use strict";var a=layui.$,t=layui.laytpl,n=layui.form,i="transfer",l={config:{},index:layui[i]?layui[i].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,i,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:["列表一","列表二"],width:200,height:360,data:[],value:[],showSearch:!1,id:"",text:{none:"无数据",searchNone:"无匹配数据"}},x.prototype.reload=function(e){var t=this;layui.each(e,function(e,a){a.constructor===Array&&delete t.config[e]}),t.config=a.extend(!0,{},t.config,e),t.render()},x.prototype.render=function(){var e=this,n=e.config,i=e.elem=a(t(v).render({data:n,index:e.index})),l=n.elem=a(n.elem);l[0]&&(n.data=n.data||[],n.value=n.value||[],e.key=n.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=i.find("."+y),e.layBtn=i.find("."+f+" .layui-btn"),e.layBox.css({width:n.width,height:n.height}),e.layData.css({height:function(){return n.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,n=["
    • ",'',"
    • "].join("");a[t].views.push(n),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){n.render(e,"LAY-transfer-"+this.index)},x.prototype.renderCheckBtn=function(e){var t=this,n=t.config;e=e||{},t.layBox.each(function(i){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(i)[f?"removeClass":"addClass"](o),!e.stopNone){var p=r.children("li:not(."+c+")").length;t.noneView(r,p?"":n.text.none)}}),t.renderForm("checkbox")},x.prototype.noneView=function(e,t){var n=a('

      '+(t||"")+"

      ");e.find("."+d)[0]&&e.find("."+d).remove(),t.replace(/\s/g,"")&&e.append(n)},x.prototype.setValue=function(){var e=this,t=e.config,n=[];return e.layBox.eq(1).find("."+y+' input[type="checkbox"]').each(function(){var e=a(this).data("hide");e||n.push(this.value)}),t.value=n,e},x.prototype.parseData=function(e){var t=this,n=t.config,i=[];return layui.each(n.data,function(t,l){l=("function"==typeof n.parseData?n.parseData(l):l)||l,i.push(l=a.extend({},l)),layui.each(n.value,function(e,a){a==l.value&&(l.selected=!0)}),e&&e(l)}),n.data=i,t},x.prototype.getData=function(e){var a=this,t=a.config,n=[];return layui.each(e||t.value,function(e,a){layui.each(t.data,function(e,t){delete t.selected,a==t.value&&n.push(t)})}),n},x.prototype.events=function(){var e=this,t=e.config;e.elem.on("click",'input[lay-filter="layTransferCheckbox"]+',function(){var t=a(this).prev(),n=t[0].checked,i=t.parents("."+s).eq(0).find("."+y);t[0].disabled||("all"===t.attr("lay-type")&&i.find('input[type="checkbox"]').each(function(){this.disabled||(this.checked=n)}),e.renderCheckBtn({stopNone:!0}))}),e.layBtn.on("click",function(){var n=a(this),i=n.data("index"),l=e.layBox.eq(i),r=[];if(!n.hasClass(o)){e.layBox.eq(i).each(function(t){var n=a(this),i=n.find("."+y);i.children("li").each(function(){var t=a(this),n=t.find('input[type="checkbox"]'),i=n.data("hide");n[0].checked&&!i&&(n[0].checked=!1,l.siblings("."+s).find("."+y).append(t.clone()),t.remove(),r.push(n[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),i)}}),e.laySearch.find("input").on("keyup",function(){var n=this.value,i=a(this).parents("."+h).eq(0).siblings("."+y),l=i.children("li");l.each(function(){var e=a(this),t=e.find('input[type="checkbox"]'),i=t[0].title.indexOf(n)!==-1;e[i?"removeClass":"addClass"](c),t.data("hide",!i)}),e.renderCheckBtn();var r=l.length===i.children("li."+c).length;e.noneView(i,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(i,l)}); -------------------------------------------------------------------------------- /assets/lib/layui/lay/modules/upload.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;layui.define("layer",function(e){"use strict";var t=layui.$,i=layui.layer,n=layui.hint(),a=layui.device(),o={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,r,e,t)}},l=function(){var e=this;return{upload:function(t){e.upload.call(e,t)},reload:function(t){e.reload.call(e,t)},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 i=this;i.config=t.extend({},i.config,o.config,e),i.render()};p.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",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("")),o=i.elem.next();(o.hasClass(u)||o.hasClass(c))&&o.remove(),a.ie&&a.ie<10&&i.elem.wrap('
      '),e.isFile()?(e.elemFile=i.elem,i.field=i.elem[0].name):i.elem.after(n),a.ie&&a.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,i=e.config,n=t(''),a=t(['
      ',"
      "].join(""));t("#"+f)[0]||t("body").append(n),i.elem.next().hasClass(c)||(e.elemFile.wrap(a),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,o=this,l=o.config,r=o.elemFile[0],u=function(){var i=0,n=0,a=e||o.files||o.chooseFiles||r.files,u=function(){l.multiple&&i+n===o.fileLength&&"function"==typeof l.allDone&&l.allDone({total:o.fileLength,successful:i,aborted:n})};layui.each(a,function(e,a){var r=new FormData;r.append(l.field,a),layui.each(l.data,function(e,t){t="function"==typeof t?t():t,r.append(e,t)}),t.ajax({url:l.url,type:"post",data:r,contentType:!1,processData:!1,dataType:"json",headers:l.headers||{},success:function(t){i++,d(e,t),u()},error:function(){n++,o.msg("请求上传接口出现异常"),m(e),u()}})})},c=function(){var e=t("#"+f);o.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var t,i=e.contents().find("body");try{t=i.text()}catch(n){o.msg("获取上传后的响应信息出现异常"),clearInterval(p.timer),m()}t&&(clearInterval(p.timer),i.html(""),d(0,t))},30)},d=function(e,t){if(o.elemFile.next("."+s).remove(),r.value="","object"!=typeof t)try{t=JSON.parse(t)}catch(i){return t={},o.msg("请对上传接口返回有效JSON")}"function"==typeof l.done&&l.done(t,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 t=[];return layui.each(e||o.chooseFiles,function(e,i){t.push(i.name)}),t}(),g={preview:function(e){o.preview(e)},upload:function(e,t){var i={};i[e]=t,o.upload(i)},pushFile:function(){return o.files=o.files||{},layui.each(o.chooseFiles,function(e,t){o.files[e]=t}),o.files},resetFile:function(e,t,i){var n=new File([t],i);o.files=o.files||{},o.files[e]=n}},y=function(){if("choose"!==i&&!l.auto||(l.choose&&l.choose(g),"choose"!==i))return 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,t){RegExp("\\w\\.("+(h||"jpg|png|gif|bmp|jpeg$")+")","i").test(escape(t))||(n=!0)}),n)return o.msg("选择的图片中包含不支持的格式"),r.value=""}if(o.fileLength=function(){var t=0,i=e||o.files||o.chooseFiles||r.files;return layui.each(i,function(){t++}),t}(),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,t){if(t.size>1024*l.size){var i=l.size/1024;i=i>=1?i.toFixed(2)+"MB":l.size+"KB",r.value="",F=i}}),F)return o.msg("文件不能超过"+F)}y()}},p.prototype.reload=function(e){e=e||{},delete e.elem,delete e.bindAction;var i=this,e=i.config=t.extend({},i.config,o.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,o=function(t){e.chooseFiles={},layui.each(t,function(t,i){var n=(new Date).getTime();e.chooseFiles[n+"-"+t]=i})},l=function(t,n){var a=e.elemFile,o=t.length>1?t.length+"个文件":(t[0]||{}).name||a[0].value.match(/[^\/\\]+\..+/g)||[]||"";a.next().hasClass(s)&&a.next().remove(),e.upload(null,"choose"),e.isFile()||i.choose||a.after(''+o+"")};i.elem.off("upload.start").on("upload.start",function(){var a=t(this),o=a.attr("lay-data");if(o)try{o=new Function("return "+o)(),e.config=t.extend({},i,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||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,a){var r=t(this),u=a.originalEvent.dataTransfer.files||[];r.removeAttr("lay-over"),o(u),i.auto?e.upload(u):l(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var t=this.files||[];o(t),i.auto?e.upload():l(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))},o.render=function(e){var t=new p(e);return l.call(t)},e(r,o)}); -------------------------------------------------------------------------------- /assets/lib/layui/lay/modules/util.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(t){"use strict";var e=layui.$,i={fixbar:function(t){var i,n,a="layui-fixbar",o="layui-fixbar-top",r=e(document),l=e("body");t=e.extend({showHeight:200},t),t.bar1=t.bar1===!0?"":t.bar1,t.bar2=t.bar2===!0?"":t.bar2,t.bgcolor=t.bgcolor?"background-color:"+t.bgcolor:"";var c=[t.bar1,t.bar2,""],g=e(['
        ',t.bar1?'
      • '+c[0]+"
      • ":"",t.bar2?'
      • '+c[1]+"
      • ":"",'
      • '+c[2]+"
      • ","
      "].join("")),s=g.find("."+o),u=function(){var e=r.scrollTop();e>=t.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};e("."+a)[0]||("object"==typeof t.css&&g.css(t.css),l.append(g),u(),g.find("li").on("click",function(){var i=e(this),n=i.attr("lay-type");"top"===n&&e("html,body").animate({scrollTop:0},200),t.click&&t.click.call(this,n)}),r.on("scroll",function(){clearTimeout(n),n=setTimeout(function(){u()},100)}))},countdown:function(t,e,i){var n=this,a="function"==typeof e,o=new Date(t).getTime(),r=new Date(!e||a?(new Date).getTime():e).getTime(),l=o-r,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=e);var g=setTimeout(function(){n.countdown(t,r+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],e,g),l<=0&&clearTimeout(g),g},timeAgo:function(t,e){var i=this,n=[[],[]],a=(new Date).getTime()-new Date(t).getTime();return a>6912e5?(a=new Date(t),n[0][0]=i.digit(a.getFullYear(),4),n[0][1]=i.digit(a.getMonth()+1),n[0][2]=i.digit(a.getDate()),e||(n[1][0]=i.digit(a.getHours()),n[1][1]=i.digit(a.getMinutes()),n[1][2]=i.digit(a.getSeconds())),n[0].join("-")+" "+n[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(t,e){var i="";t=String(t),e=e||2;for(var n=t.length;n/g,">").replace(/'/g,"'").replace(/"/g,""")},event:function(t,n,a){n=i.event[t]=e.extend(!0,i.event[t],n)||{},e("body").on(a||"click","*["+t+"]",function(){var i=e(this),a=i.attr(t);n[a]&&n[a].call(this,i)})}};!function(t,e,i){"$:nomunge";function n(){a=e[l](function(){o.each(function(){var e=t(this),i=e.width(),n=e.height(),a=t.data(this,g);(i!==a.w||n!==a.h)&&e.trigger(c,[a.w=i,a.h=n])}),n()},r[s])}var a,o=t([]),r=t.resize=t.extend(t.resize,{}),l="setTimeout",c="resize",g=c+"-special-event",s="delay",u="throttleWindow";r[s]=250,r[u]=!0,t.event.special[c]={setup:function(){if(!r[u]&&this[l])return!1;var e=t(this);o=o.add(e),t.data(this,g,{w:e.width(),h:e.height()}),1===o.length&&n()},teardown:function(){if(!r[u]&&this[l])return!1;var e=t(this);o=o.not(e),e.removeData(g),o.length||clearTimeout(a)},add:function(e){function n(e,n,o){var r=t(this),l=t.data(this,g)||{};l.w=n!==i?n:r.width(),l.h=o!==i?o:r.height(),a.apply(this,arguments)}if(!r[u]&&this[l])return!1;var a;return t.isFunction(e)?(a=e,n):(a=e.handler,void(e.handler=n))}}}(e,window),t("util",i)}); -------------------------------------------------------------------------------- /assets/lib/layui/layui.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;!function(e){"use strict";var t=document,o={modules:{},status:{},timeout:10,event:{}},n=function(){this.v="2.5.4"},r=function(){var e=t.currentScript?t.currentScript.src:function(){for(var e,o=t.scripts,n=o.length-1,r=n;r>0;r--)if("interactive"===o[r].readyState){e=o[r].src;break}return e||o[n].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),i=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},a="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",transfer:"modules/transfer",tree:"modules/tree",table:"modules/table",element:"modules/element",rate:"modules/rate",colorpicker:"modules/colorpicker",slider:"modules/slider",carousel:"modules/carousel",flow:"modules/flow",util:"modules/util",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};n.prototype.cache=o,n.prototype.define=function(e,t){var n=this,r="function"==typeof e,i=function(){var e=function(e,t){layui[e]=t,o.status[e]=!0};return"function"==typeof t&&t(function(n,r){e(n,r),o.callback[n]=function(){t(e)}}),this};return r&&(t=e,e=[]),!layui["layui.all"]&&layui["layui.mobile"]?i.call(n):(n.use(e,i),n)},n.prototype.use=function(e,n,l){function s(e,t){var n="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||n.test((e.currentTarget||e.srcElement).readyState))&&(o.modules[f]=t,d.removeChild(v),function r(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void(o.status[f]?c():setTimeout(r,4))}())}function c(){l.push(layui[f]),e.length>1?y.use(e.slice(1),n,l):"function"==typeof n&&n.apply(layui,l)}var y=this,p=o.dir=o.dir?o.dir:r,d=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,o){"jquery"===o&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],o.host=o.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(o.modules[f])!function g(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void("string"==typeof o.modules[f]&&o.status[f]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[f]?p+"lay/":/^\{\/\}/.test(y.modules[f])?"":o.base||"")+(y.modules[f]||f)+".js";h=h.replace(/^\{\/\}/,""),v.async=!0,v.charset="utf-8",v.src=h+function(){var e=o.version===!0?o.v||(new Date).getTime():o.version||"";return e?"?v="+e:""}(),d.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||a?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),o.modules[f]=h}return y},n.prototype.getStyle=function(t,o){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](o)},n.prototype.link=function(e,n,r){var a=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof n&&(r=n);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(o.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof n?a:(function p(){return++y>1e3*o.timeout/100?i(e+" timeout"):void(1989===parseInt(a.getStyle(t.getElementById(c),"width"))?function(){n()}():setTimeout(p,100))}(),a)},o.callback={},n.prototype.factory=function(e){if(layui[e])return"function"==typeof o.callback[e]?o.callback[e]:null},n.prototype.addcss=function(e,t,n){return layui.link(o.dir+"css/"+e,t,n)},n.prototype.img=function(e,t,o){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,"function"==typeof t&&t(n)},void(n.onerror=function(e){n.onerror=null,"function"==typeof o&&o(e)}))},n.prototype.config=function(e){e=e||{};for(var t in e)o[t]=e[t];return this},n.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),n.prototype.extend=function(e){var t=this;e=e||{};for(var o in e)t[o]||t.modules[o]?i("模块名 "+o+" 已被占用"):t.modules[o]=e[o];return t},n.prototype.router=function(e){var t=this,e=e||location.hash,o={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,""),o.href="/"+e,e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),o.search[t[0]]=t[1]}():o.path.push(t)}),o):o},n.prototype.data=function(t,o,n){if(t=t||"layui",n=n||localStorage,e.JSON&&e.JSON.parse){if(null===o)return delete n[t];o="object"==typeof o?o:{key:o};try{var r=JSON.parse(n[t])}catch(i){var r={}}return"value"in o&&(r[o.key]=o.value),o.remove&&delete r[o.key],n[t]=JSON.stringify(r),o.key?r[o.key]:r}},n.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},n.prototype.device=function(t){var o=navigator.userAgent.toLowerCase(),n=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(o.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(o)?"windows":/linux/.test(o)?"linux":/iphone|ipod|ipad|ios/.test(o)?"ios":/mac/.test(o)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((o.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:n("micromessenger")};return t&&!r[t]&&(r[t]=n(t)),r.android=/android/.test(o),r.ios="ios"===r.os,r},n.prototype.hint=function(){return{error:i}},n.prototype.each=function(e,t){var o,n=this;if("function"!=typeof t)return n;if(e=e||[],e.constructor===Object){for(o in e)if(t.call(e[o],o,e[o]))break}else for(o=0;oi?1:r [ 6 | 'admin' => '后台系统' 7 | ], 8 | 9 | 'guard_names' => [ 10 | 'admin' => '后台守卫', 11 | ], 12 | 13 | 'system_name' => env("ADMIN_SYSTEM_NAME", "后台管理系统"), 14 | ]; -------------------------------------------------------------------------------- /database/migrations/add_custom_field_permission_tables.php: -------------------------------------------------------------------------------- 1 | integer('pg_id')->default(0); 20 | $table->string('display_name', 50)->nullable(); 21 | $table->string('icon', 30)->nullable(); 22 | $table->smallInteger('sequence')->nullable(); 23 | $table->string('description')->nullable(); 24 | }); 25 | 26 | Schema::table($tableNames['roles'], function (Blueprint $table) { 27 | $table->string('description')->nullable(); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | * 34 | * @return void 35 | */ 36 | public function down() 37 | { 38 | $tableNames = config('permission.table_names'); 39 | 40 | Schema::table($tableNames['permissions'], function (Blueprint $table) { 41 | $table->dropColumn('display_name'); 42 | $table->dropColumn('icon'); 43 | $table->dropColumn('sequence'); 44 | $table->dropColumn('description'); 45 | }); 46 | 47 | Schema::table($tableNames['roles'], function (Blueprint $table) { 48 | $table->dropColumn('description'); 49 | }); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /database/migrations/create_admin_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->string('password'); 21 | $table->tinyInteger("status")->default(0); 22 | $table->rememberToken(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('admin_users'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/create_navigation_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->integer('parent_id')->default(0); 19 | $table->string('icon', 50)->nullable(); 20 | $table->string('uri'); 21 | $table->tinyInteger('is_link')->default(0)->comment('0-no;1-yes'); 22 | $table->string('permission_name', 50)->nullable(); 23 | $table->string('name'); 24 | $table->string("type")->default("admin")->comment('导航类型'); 25 | $table->string('guard_name', 30); 26 | $table->smallInteger('sequence')->default(0); 27 | $table->timestamps(); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | * 34 | * @return void 35 | */ 36 | public function down() 37 | { 38 | Schema::dropIfExists('navigation'); 39 | } 40 | } -------------------------------------------------------------------------------- /database/migrations/create_permission_group_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('permission_groups'); 31 | } 32 | } -------------------------------------------------------------------------------- /src/Console/InstallCommand.php: -------------------------------------------------------------------------------- 1 | 26 | * @return mixed 27 | */ 28 | public function handle() 29 | { 30 | $this->call('vendor:publish', ['--provider' => 'Spatie\Permission\PermissionServiceProvider']); 31 | $this->call('vendor:publish', [ 32 | '--provider' => 'Moell\LayuiAdmin\Providers\LayuiAdminServiceProvider', 33 | '--tag' => 'config' 34 | ]); 35 | $this->call('vendor:publish', [ 36 | '--provider' => 'Moell\LayuiAdmin\Providers\LayuiAdminServiceProvider', 37 | '--tag' => 'public' 38 | ]); 39 | 40 | $this->call('vendor:publish', [ 41 | '--provider' => 'Moell\LayuiAdmin\Providers\LayuiAdminServiceProvider', 42 | '--tag' => 'migrations' 43 | ]); 44 | } 45 | } -------------------------------------------------------------------------------- /src/Http/Controllers/AdminUserController.php: -------------------------------------------------------------------------------- 1 | 15 | * 16 | * @param Request $request 17 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View 18 | */ 19 | public function index(Request $request) 20 | { 21 | $adminUsers = AdminUser::query()->where(request_intersect(['name', 'email']))->paginate($request->get("limit")); 22 | 23 | return view("admin::admin_user.index", compact('adminUsers')); 24 | } 25 | 26 | /** 27 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View 28 | */ 29 | public function create() 30 | { 31 | return view("admin::admin_user.create"); 32 | } 33 | 34 | /** 35 | * @param CreateOrUpdateRequest $request 36 | * @return \Illuminate\Http\JsonResponse 37 | */ 38 | public function store(CreateOrUpdateRequest $request) 39 | { 40 | $data = $request->only([ 41 | 'name', 'email', 'password' 42 | ]); 43 | $data['password'] = bcrypt($data['password']); 44 | 45 | AdminUser::create($data); 46 | 47 | return $this->success(); 48 | } 49 | 50 | /** 51 | * @param AdminUser $adminUser 52 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View 53 | */ 54 | public function edit(AdminUser $adminUser) 55 | { 56 | return view("admin::admin_user.edit", compact('adminUser')); 57 | } 58 | 59 | /** 60 | * @author moell 61 | * @param CreateOrUpdateRequest $request 62 | * @param AdminUser $adminUser 63 | * @return \Illuminate\Http\JsonResponse 64 | */ 65 | public function update(CreateOrUpdateRequest $request, AdminUser $adminUser) 66 | { 67 | $data = $request->only([ 68 | 'name', 'status' 69 | ]); 70 | 71 | if ($request->filled('password')) { 72 | $data['password'] = bcrypt($request->password); 73 | } 74 | 75 | $adminUser->fill($data); 76 | $adminUser->save(); 77 | 78 | return $this->success(); 79 | } 80 | 81 | /** 82 | * @author moell 83 | * @param $id 84 | * @return \Illuminate\Http\JsonResponse 85 | */ 86 | public function destroy($id) 87 | { 88 | $adminUser = AdminUser::query()->findOrFail($id); 89 | 90 | $adminUser->delete(); 91 | 92 | return $this->success(); 93 | } 94 | 95 | /** 96 | * @param $id 97 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View 98 | */ 99 | public function assignRolesForm($id) 100 | { 101 | $adminUser = AdminUser::query()->findOrFail($id); 102 | $roles = Role::query()->where("guard_name", "admin")->get(); 103 | $userRoles = $adminUser->getRoleNames(); 104 | 105 | return view("admin::admin_user.assign_role", compact("roles", "adminUser", "userRoles")); 106 | } 107 | 108 | /** 109 | * @param Request $request 110 | * @param $id 111 | * @return \Illuminate\Http\JsonResponse 112 | */ 113 | public function assignRoles(Request $request, $id) 114 | { 115 | AdminUser::query()->findOrFail($id)->syncRoles($request->input('roles', [])); 116 | 117 | return $this->success(); 118 | } 119 | } -------------------------------------------------------------------------------- /src/Http/Controllers/ChangePasswordController.php: -------------------------------------------------------------------------------- 1 | user(); 24 | 25 | if (! Hash::check($request->old_password, $user->password)) { 26 | return $this->unprocesableEtity([ 27 | 'password' => 'Incorrect password' 28 | ]); 29 | } 30 | 31 | $user->password = bcrypt($request->password); 32 | $user->save(); 33 | 34 | return $this->success(); 35 | } 36 | } -------------------------------------------------------------------------------- /src/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | only('email', 'password'); 19 | $credentials['status'] = 0; 20 | 21 | if (Auth::guard("admin")->attempt($credentials)) { 22 | return $this->success("登录成功"); 23 | } 24 | 25 | return $this->fail('账号或密码有误'); 26 | } 27 | 28 | public function logout() 29 | { 30 | Auth::guard("admin")->logout(); 31 | 32 | return redirect()->route("admin.login-show-form"); 33 | } 34 | } -------------------------------------------------------------------------------- /src/Http/Controllers/NavigationController.php: -------------------------------------------------------------------------------- 1 | 14 | * @param Request $request 15 | * @return \Illuminate\Http\JsonResponse 16 | */ 17 | public function index(Request $request) 18 | { 19 | $where = request_intersect(['type', 'guard_name']); 20 | if (!isset($where['guard_name']) || !$where['guard_name']) { 21 | $where['guard_name'] = 'admin'; 22 | } 23 | 24 | $navigation = Navigation::query() 25 | ->where($where) 26 | ->orderBy('sequence', 'desc') 27 | ->get() 28 | ->toJson(); 29 | 30 | return view("admin::navigation.index", compact("navigation")); 31 | } 32 | 33 | public function create() 34 | { 35 | return view("admin::navigation.create"); 36 | } 37 | 38 | public function store(CreateOrUpdateRequest $request) 39 | { 40 | Navigation::create($request->all()); 41 | 42 | return $this->success(); 43 | } 44 | 45 | public function edit(Navigation $navigation) 46 | { 47 | return view("admin::navigation.edit", compact("navigation")); 48 | } 49 | 50 | /** 51 | * @param CreateOrUpdateRequest $request 52 | * @param $id 53 | * @return \Illuminate\Http\JsonResponse 54 | */ 55 | public function update(CreateOrUpdateRequest $request, $id) 56 | { 57 | $navigation = Navigation::query()->findOrFail($id); 58 | 59 | $navigation->update($request->toArray()); 60 | 61 | return $this->success(); 62 | } 63 | 64 | public function show($id) 65 | { 66 | 67 | } 68 | 69 | /** 70 | * @param $id 71 | * @return \Illuminate\Http\JsonResponse 72 | */ 73 | public function destroy($id) 74 | { 75 | $navigation = Navigation::query()->findOrFail($id); 76 | 77 | if (Navigation::query()->where('parent_id', $navigation->id)->count()) { 78 | return $this->unprocesableEtity([ 79 | 'parent_id' => 'Please delete the subnavigation first.' 80 | ]); 81 | } 82 | 83 | $navigation->delete(); 84 | 85 | return $this->success(); 86 | } 87 | } -------------------------------------------------------------------------------- /src/Http/Controllers/PermissionController.php: -------------------------------------------------------------------------------- 1 | 16 | * 17 | * @param Request $request 18 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View 19 | */ 20 | public function index(Request $request) 21 | { 22 | $permissions =tap(Permission::latest(), function ($query) { 23 | $query->where(request_intersect([ 24 | 'name', 'guard_name', 'pg_id' 25 | ])); 26 | })->with('group')->paginate($request->get('limit')); 27 | 28 | return view("admin::permission.index",compact("permissions")); 29 | } 30 | 31 | /** 32 | * @author moell 33 | * @param $id 34 | * @return PermissionResource 35 | */ 36 | public function show($id) 37 | { 38 | return new PermissionResource(Permission::query()->findOrFail($id)); 39 | } 40 | 41 | public function create() 42 | { 43 | return view("admin::permission.create"); 44 | } 45 | 46 | /** 47 | * @author moell 48 | * @param CreateOrUpdateRequest $request 49 | * @return \Illuminate\Http\JsonResponse 50 | */ 51 | public function store(CreateOrUpdateRequest $request) 52 | { 53 | $attributes = $request->only([ 54 | 'pg_id', 'name', 'guard_name', 'display_name', 'sequence', 'description' 55 | ]); 56 | 57 | Permission::create($attributes); 58 | 59 | return $this->success(); 60 | } 61 | 62 | /** 63 | * @param Permission $permission 64 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View 65 | */ 66 | public function edit(Permission $permission) 67 | { 68 | return view("admin::permission.edit", compact("permission")); 69 | } 70 | 71 | /** 72 | * @author moell 73 | * @param CreateOrUpdateRequest $request 74 | * @param $id 75 | * @return \Illuminate\Http\JsonResponse 76 | */ 77 | public function update(CreateOrUpdateRequest $request, $id) 78 | { 79 | $permission = Permission::query()->findOrFail($id); 80 | 81 | $attributes = $request->only([ 82 | 'pg_id', 'name', 'guard_name', 'display_name', 'sequence', 'description' 83 | ]); 84 | 85 | $isset = Permission::query() 86 | ->where(['name' => $attributes['name'], 'guard_name' => $attributes['guard_name']]) 87 | ->where('id', '!=', $id) 88 | ->count(); 89 | 90 | if ($isset) { 91 | throw PermissionAlreadyExists::create($attributes['name'], $attributes['guard_name']); 92 | } 93 | 94 | $permission->update($attributes); 95 | 96 | return $this->success(); 97 | } 98 | 99 | /** 100 | * @author moell 101 | * @param $id 102 | * @return \Illuminate\Http\JsonResponse 103 | */ 104 | public function destroy($id) 105 | { 106 | permission::query()->findOrFail($id)->delete(); 107 | 108 | return $this->success(); 109 | } 110 | } -------------------------------------------------------------------------------- /src/Http/Controllers/PermissionGroupController.php: -------------------------------------------------------------------------------- 1 | 16 | * @param Request $request 17 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View 18 | */ 19 | public function index(Request $request) 20 | { 21 | $permissionGroups = tap(PermissionGroup::latest(), function ($query) { 22 | $query->where(request_intersect(['name'])); 23 | })->paginate($request->get("limit")); 24 | 25 | return view("admin::permission_group.index", compact("permissionGroups")); 26 | } 27 | 28 | public function create() 29 | { 30 | return view("admin::permission_group.create"); 31 | } 32 | 33 | /** 34 | * @author moell 35 | * @param CreateOrUpdateRequest $request 36 | * @return \Illuminate\Http\JsonResponse 37 | */ 38 | public function store(CreateOrUpdateRequest $request) 39 | { 40 | PermissionGroup::create(request_intersect(['name'])); 41 | 42 | return $this->success(); 43 | } 44 | 45 | public function edit(PermissionGroup $permissionGroup) 46 | { 47 | return view("admin::permission_group.edit", compact("permissionGroup")); 48 | } 49 | 50 | /** 51 | * @author moell 52 | * @param CreateOrUpdateRequest $request 53 | * @param $id 54 | * @return \Illuminate\Http\JsonResponse 55 | */ 56 | public function update(CreateOrUpdateRequest $request, $id) 57 | { 58 | PermissionGroup::findOrFail($id)->update(request_intersect([ 59 | 'name' 60 | ])); 61 | 62 | return $this->success(); 63 | } 64 | 65 | /** 66 | * @param $id 67 | * @return \Illuminate\Http\JsonResponse 68 | */ 69 | public function destroy($id) 70 | { 71 | $permissionGroup = PermissionGroup::findOrFail($id); 72 | 73 | if (Permission::query()->where('pg_id', $permissionGroup->id)->count()) { 74 | return $this->unprocesableEtity([ 75 | 'pg_id' => 'Please move or delete the vesting permission.' 76 | ]); 77 | } 78 | 79 | $permissionGroup->delete(); 80 | 81 | return $this->success(); 82 | } 83 | } -------------------------------------------------------------------------------- /src/Http/Controllers/RoleController.php: -------------------------------------------------------------------------------- 1 | 15 | * 16 | * @param Request $request 17 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View 18 | */ 19 | public function index(Request $request) 20 | { 21 | $roles = Role::query()->where(request_intersect(['name']))->paginate($request->get("limit")); 22 | 23 | return view("admin::role.index", compact("roles")); 24 | } 25 | 26 | public function show($id) 27 | { 28 | return new RoleResource(Role::query()->findOrFail($id)); 29 | } 30 | 31 | public function create() 32 | { 33 | return view('admin::role.create'); 34 | } 35 | 36 | /** 37 | * @author moell 38 | * @param CreateOrUpdateRequest $request 39 | * @return \Illuminate\Http\JsonResponse 40 | */ 41 | public function store(CreateOrUpdateRequest $request) 42 | { 43 | Role::create(request_intersect([ 44 | 'name', 'guard_name', 'description' 45 | ])); 46 | 47 | return $this->success(); 48 | } 49 | 50 | public function edit(Role $role) 51 | { 52 | return view("admin::role.edit", compact("role")); 53 | } 54 | 55 | /** 56 | * @author moell 57 | * @param CreateOrUpdateRequest $request 58 | * @param $id 59 | * @return \Illuminate\Http\JsonResponse 60 | */ 61 | public function update(CreateOrUpdateRequest $request, $id) 62 | { 63 | if (Role::where(request_intersect(['name', 'guard_name']))->where('id', '!=', $id)->count()) { 64 | throw RoleAlreadyExists::create($request->name, $request->guard_name); 65 | } 66 | 67 | $role = Role::query()->findOrFail($id); 68 | 69 | $role->update(request_intersect([ 70 | 'name', 'guard_name', 'description' 71 | ])); 72 | 73 | return $this->success(); 74 | } 75 | 76 | /** 77 | * @author moell 78 | * @param $id 79 | * @return \Illuminate\Http\JsonResponse 80 | */ 81 | public function destroy($id) 82 | { 83 | Role::destroy($id); 84 | 85 | return $this->success(); 86 | } 87 | 88 | public function assignPermissionsForm(Request $request, $id) 89 | { 90 | $role = Role::query()->findOrFail($id); 91 | 92 | $permissionGroups = PermissionGroup::query() 93 | ->with(['permission' => function ($query) use ($role) { 94 | $query->where('guard_name', $role->guard_name); 95 | }]) 96 | ->get()->filter(function($item) { 97 | return count($item->permission) > 0; 98 | }); 99 | 100 | $rolePermissions = $role->getPermissionNames(); 101 | 102 | return view("admin::role.assign_permission", compact("role", "permissionGroups", 'rolePermissions')); 103 | } 104 | 105 | /** 106 | * Assign permission 107 | * 108 | * @author moell 109 | * @param $id 110 | * @param Request $request 111 | * @return $this 112 | */ 113 | public function assignPermissions($id, Request $request) 114 | { 115 | $role = Role::query()->findOrFail($id); 116 | 117 | $role->syncPermissions($request->input('permissions', [])); 118 | 119 | return redirect()->back()->with("success", "分配权限成功"); 120 | } 121 | } -------------------------------------------------------------------------------- /src/Http/LayuiAdminResponse.php: -------------------------------------------------------------------------------- 1 | 13 | * @param string $content 14 | * @return Response 15 | */ 16 | protected function created($content = '') 17 | { 18 | return new Response($content, Response::HTTP_CREATED); 19 | } 20 | 21 | /** 22 | * 202 23 | * 24 | * @author moell 25 | * @return Response 26 | */ 27 | protected function accepted() 28 | { 29 | return new Response('', Response::HTTP_ACCEPTED); 30 | } 31 | 32 | /** 33 | * 204 34 | * 35 | * @author moell 36 | * @return Response 37 | */ 38 | protected function noContent() 39 | { 40 | return new Response('', Response::HTTP_NO_CONTENT); 41 | } 42 | 43 | /** 44 | * 400 45 | * 46 | * @author moell 47 | * @param $message 48 | * @param array $headers 49 | * @param int $options 50 | * @return \Illuminate\Http\JsonResponse 51 | */ 52 | protected function badRequest($message, array $headers = [], $options = 0) 53 | { 54 | return response()->json([ 55 | 'message' => $message 56 | ], Response::HTTP_BAD_REQUEST, $headers, $options); 57 | } 58 | 59 | /** 60 | * 401 61 | * 62 | * @author moell 63 | * @param string $message 64 | * @param array $headers 65 | * @param int $options 66 | * @return \Illuminate\Http\JsonResponse 67 | */ 68 | protected function unauthorized($message = '', array $headers = [], $options = 0) 69 | { 70 | return response()->json([ 71 | 'message' => $message ? $message : 'Token Signature could not be verified.' 72 | ], Response::HTTP_UNAUTHORIZED, $headers, $options); 73 | } 74 | 75 | /** 76 | * 403 77 | * 78 | * @author moell 79 | * @param string $message 80 | * @param array $headers 81 | * @param int $options 82 | * @return \Illuminate\Http\JsonResponse 83 | */ 84 | protected function forbidden($message = '', array $headers = [], $options = 0) 85 | { 86 | return response()->json([ 87 | 'message' => $message ? $message : 'Insufficient permissions.' 88 | ], Response::HTTP_FORBIDDEN, $headers, $options); 89 | } 90 | 91 | /** 92 | * 422 93 | * 94 | * @author moell 95 | * @param array $errors 96 | * @param array $headers 97 | * @param string $message 98 | * @param int $options 99 | * @return \Illuminate\Http\JsonResponse 100 | */ 101 | protected function unprocesableEtity(array $errors = [], array $headers = [], $message = '', $options = 0) 102 | { 103 | return response()->json([ 104 | 'message' => $message ? $message : '422 Unprocessable Entity', 105 | 'errors' => $errors 106 | ], Response::HTTP_UNPROCESSABLE_ENTITY, $headers, $options); 107 | } 108 | 109 | /** 110 | * @param string $message 111 | * @param array $data 112 | * @return \Illuminate\Http\JsonResponse 113 | */ 114 | protected function success($message = '成功', array $data = []) 115 | { 116 | return response()->json([ 117 | 'status' => 'success', 118 | 'message' => $message, 119 | 'data' => $data 120 | ]); 121 | } 122 | 123 | /** 124 | * @param string $message 125 | * @param array $data 126 | * @return \Illuminate\Http\JsonResponse 127 | */ 128 | protected function fail($message = '失败', array $data = []) 129 | { 130 | return response()->json([ 131 | 'status' => 'fail', 132 | 'message' => $message, 133 | 'data' => $data 134 | ]); 135 | } 136 | } -------------------------------------------------------------------------------- /src/Http/Middleware/AdminPermission.php: -------------------------------------------------------------------------------- 1 | 13 | * @param $request 14 | * @param \Closure $next 15 | * @return mixed 16 | */ 17 | public function handle($request, \Closure $next) 18 | { 19 | $permission = Route::currentRouteName(); 20 | 21 | if (Auth::guard("admin")->user()->can($permission)) { 22 | return $next($request); 23 | } 24 | 25 | throw UnauthorizedException::forPermissions([$permission]); 26 | } 27 | } -------------------------------------------------------------------------------- /src/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | guards) { 19 | return route('login'); 20 | } 21 | 22 | if (in_array('admin', $this->guards)) { 23 | return route("admin.login-show-form"); 24 | } 25 | } 26 | 27 | public function authenticate($request, array $guards) 28 | { 29 | $this->guards = $guards; 30 | 31 | parent::authenticate($request, $guards); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Http/Requests/AdminUser/CreateOrUpdateRequest.php: -------------------------------------------------------------------------------- 1 | 25 | * @return array 26 | */ 27 | public function rules() 28 | { 29 | $rules = [ 30 | 'name' => 'required|max:255' 31 | ]; 32 | 33 | switch ($this->method()) { 34 | case 'POST': 35 | $rules['password'] = 'required|min:8|max:32'; 36 | $rules['email'] = 'required|email|unique:admin_users'; 37 | break; 38 | case 'PATCH': 39 | $rules['password'] = 'nullable|min:8|max:32'; 40 | $rules['status'] = 'in:0,1'; 41 | break; 42 | } 43 | 44 | return $rules; 45 | } 46 | } -------------------------------------------------------------------------------- /src/Http/Requests/ChangePasswordRequest.php: -------------------------------------------------------------------------------- 1 | 24 | * @return array 25 | */ 26 | public function rules() 27 | { 28 | return [ 29 | 'old_password' => 'required|min:6|max:32', 30 | 'password' => 'required|min:8|max:32|confirmed', 31 | 'password_confirmation' => 'required|min:8|max:32' 32 | ]; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Http/Requests/Navigation/CreateOrUpdateRequest.php: -------------------------------------------------------------------------------- 1 | 24 | * @return array 25 | */ 26 | public function rules() 27 | { 28 | return [ 29 | 'parent_id' => 'required|numeric', 30 | 'name' => 'required', 31 | 'guard_name' => 'required', 32 | 'is_link' => 'in:0,1', 33 | 'uri' => 'required' 34 | ]; 35 | } 36 | } -------------------------------------------------------------------------------- /src/Http/Requests/Permission/CreateOrUpdateRequest.php: -------------------------------------------------------------------------------- 1 | 25 | * @return array 26 | */ 27 | public function rules() 28 | { 29 | $rules = [ 30 | 'name' => 'required|max:255', 31 | 'guard_name' => 'required|max:255', 32 | 'display_name' => 'required:max:50', 33 | 'pg_id' => 'required|numeric', 34 | 'sequence' => 'numeric' 35 | ]; 36 | 37 | return $rules; 38 | } 39 | } -------------------------------------------------------------------------------- /src/Http/Requests/PermissionGroup/CreateOrUpdateRequest.php: -------------------------------------------------------------------------------- 1 | 24 | * @return array 25 | */ 26 | public function rules() 27 | { 28 | $rules = [ 29 | 'name' => 'required|max:255' 30 | ]; 31 | 32 | return $rules; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Http/Requests/Role/CreateOrUpdateRequest.php: -------------------------------------------------------------------------------- 1 | 24 | * @return array 25 | */ 26 | public function rules() 27 | { 28 | $rules = [ 29 | 'name' => 'required|max:255', 30 | 'guard_name' => 'required|max:255' 31 | ]; 32 | 33 | return $rules; 34 | } 35 | } -------------------------------------------------------------------------------- /src/Models/AdminUser.php: -------------------------------------------------------------------------------- 1 | belongsTo(PermissionGroup::class, 'pg_id'); 11 | } 12 | } -------------------------------------------------------------------------------- /src/Models/PermissionGroup.php: -------------------------------------------------------------------------------- 1 | hasMany('Moell\LayuiAdmin\Models\Permission', 'pg_id'); 15 | } 16 | } -------------------------------------------------------------------------------- /src/Presenters/PermissionGroupPresenter.php: -------------------------------------------------------------------------------- 1 | %s'; 13 | $options = null; 14 | 15 | $groups = PermissionGroup::query()->get(); 16 | 17 | foreach ($groups as $group) { 18 | $selected = $group->id == $default ? 'selected' : ''; 19 | $options .= sprintf('', $group->id, $selected, $group->name); 20 | } 21 | 22 | return sprintf($select, 'pg_id', '请选择权限组别', $options); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Providers/LayuiAdminServiceProvider.php: -------------------------------------------------------------------------------- 1 | registerRouter(); 15 | $this->viewComposer(); 16 | 17 | if ($this->app->runningInConsole()) { 18 | $this->registerMigrations(); 19 | 20 | $this->commands([ 21 | InstallCommand::class 22 | ]); 23 | } 24 | 25 | $this->loadViewsFrom(__DIR__.'/../../views', 'admin'); 26 | 27 | $this->publishes([ 28 | __DIR__.'/../../assets' => public_path('vendor/laravel-layui-admin'), 29 | ], 'public'); 30 | 31 | $this->publishes([ 32 | __DIR__.'/../../views' => resource_path('views/vendor/admin'), 33 | ], 'views'); 34 | 35 | $this->publishes([ 36 | __DIR__.'/../../config/admin.php' => config_path('admin.php'), 37 | ], 'config'); 38 | } 39 | 40 | public function register() 41 | { 42 | 43 | } 44 | 45 | private function viewComposer() 46 | { 47 | View::composer( 48 | 'admin::layouts.admin', 'Moell\LayuiAdmin\ViewComposers\AdminComposer' 49 | ); 50 | } 51 | 52 | private function registerMigrations() 53 | { 54 | $migrationsPath = __DIR__ . '/../../database/migrations/'; 55 | $items = [ 56 | 'create_admin_table.php', 57 | 'add_custom_field_permission_tables.php', 58 | 'create_navigation_table.php', 59 | 'create_permission_group_table.php' 60 | ]; 61 | $paths = []; 62 | foreach ($items as $key => $name) { 63 | $paths[$migrationsPath . $name] = database_path('migrations') . "/". $this->formatTimestamp($key+1) . '_' . $name; 64 | } 65 | $this->publishes($paths, 'migrations'); 66 | } 67 | /** 68 | * @param $addition 69 | * @return false|string 70 | */ 71 | private function formatTimestamp($addition) 72 | { 73 | return date('Y_m_d_His', time() + $addition); 74 | } 75 | 76 | 77 | /** 78 | * 注册路由 79 | * 80 | * @author moell 81 | */ 82 | private function registerRouter() 83 | { 84 | require __DIR__.'/../routes.php'; 85 | } 86 | } -------------------------------------------------------------------------------- /src/Traits/NavigationTree.php: -------------------------------------------------------------------------------- 1 | user()->getAllPermissions()->pluck('name'); 19 | $items = Navigation::query() 20 | ->where('guard_name', $guardName) 21 | ->where("type", $type) 22 | ->orderBy('sequence', 'desc') 23 | ->get() 24 | ->filter(function ($item) use ($userPermissions) { 25 | return !$item->permission_name || $userPermissions->contains($item->permission_name); 26 | }); 27 | 28 | return make_tree($items->toArray()); 29 | } 30 | 31 | /** 32 | * @param string $type 33 | * @return array 34 | */ 35 | protected function navigationTree($type = 'admin') 36 | { 37 | $items = Navigation::query() 38 | ->where("type", $type) 39 | ->orderBy('sequence', 'desc') 40 | ->get(); 41 | 42 | return make_tree($items->toArray()); 43 | } 44 | } -------------------------------------------------------------------------------- /src/ViewComposers/AdminComposer.php: -------------------------------------------------------------------------------- 1 | with("navigation", $this->permissionNavigationTree()); 16 | } 17 | } -------------------------------------------------------------------------------- /src/helpers.php: -------------------------------------------------------------------------------- 1 | only(is_array($keys) ? $keys : func_get_args())); 12 | } 13 | } 14 | 15 | if (!function_exists('make_tree')) { 16 | /** 17 | * @param array $list 18 | * @param int $parentId 19 | * @return array 20 | */ 21 | function make_tree(array $list, $parentId = 0) { 22 | $tree = []; 23 | if (empty($list)) { 24 | return $tree; 25 | } 26 | 27 | $newList = []; 28 | foreach ($list as $k => $v) { 29 | $newList[$v['id']] = $v; 30 | } 31 | 32 | foreach ($newList as $value) { 33 | if ($parentId == $value['parent_id']) { 34 | $tree[] = &$newList[$value['id']]; 35 | } elseif (isset($newList[$value['parent_id']])) { 36 | $newList[$value['parent_id']]['children'][] = &$newList[$value['id']]; 37 | } 38 | } 39 | 40 | return $tree; 41 | } 42 | } 43 | 44 | if (!function_exists('admin_enum_index_value')) { 45 | /** 46 | * 47 | * @param $field 48 | * @param $index 49 | * @return mixed|null 50 | */ 51 | function admin_enum_index_value($field, $index) { 52 | $config = config("admin." . $field); 53 | 54 | return isset($config[$index]) ? $config[$index] : null; 55 | } 56 | } 57 | 58 | if (!function_exists("admin_enum_option_string")) { 59 | /** 60 | * @param $field 61 | * @param null $default 62 | * @return null|string 63 | */ 64 | function admin_enum_option_string($field, $default = null) { 65 | $options = null; 66 | 67 | $items = config("admin." . $field); 68 | if (!$items) { 69 | return $options; 70 | } 71 | 72 | foreach ($items as $index => $value) { 73 | $checked = $index == $default ? 'selected' : ''; 74 | $options .= sprintf('', $index, $checked, $value); 75 | } 76 | 77 | return $options; 78 | } 79 | } 80 | 81 | if (!function_exists("admin_user_can")) { 82 | function admin_user_can($permissionName) { 83 | return auth()->guard("admin")->user()->can($permissionName); 84 | } 85 | } -------------------------------------------------------------------------------- /src/routes.php: -------------------------------------------------------------------------------- 1 | namespace('\Moell\LayuiAdmin\Http\Controllers') 6 | ->prefix('admin') 7 | ->middleware(['web']) 8 | ->group(function ($router) { 9 | $router->get("login", "LoginController@loginShowForm")->name("admin.login-show-form"); 10 | $router->post("login", "LoginController@login")->name("admin.login")->middleware('throttle:20,1'); 11 | 12 | $router->middleware(['auth:admin'])->group(function($router) { 13 | $router->get("/", "IndexController@index")->name("admin.index"); 14 | $router->get("logout", "LoginController@logout")->name("admin.logout"); 15 | $router->get("change-password", "ChangePasswordController@changePasswordForm")->name("admin.change-password-form"); 16 | $router->patch("change-password", "ChangePasswordController@changePassword")->name("admin.change-password"); 17 | 18 | $router->middleware(['admin.permission'])->group(function($router) { 19 | $router->resource('role', 'RoleController'); 20 | $router->resource('permission', 'PermissionController'); 21 | $router->resource('admin-user', 'AdminUserController'); 22 | $router->resource('permission-group', 'PermissionGroupController'); 23 | $router->resource('navigation', 'NavigationController'); 24 | $router->get('admin-user/{id}/assign-roles', 'AdminUserController@assignRolesForm')->name('admin-user.assign-roles-form'); 25 | $router->put('admin-user/{id}/assign-roles', 'AdminUserController@assignRoles')->name('admin-user.assign-roles'); 26 | $router->get('role/{id}/assign-permissions', 'RoleController@assignPermissionsForm')->name('role.assign-permissions-form'); 27 | $router->put('role/{id}/assign-permissions', 'RoleController@assignPermissions')->name('role.assign-permissions'); 28 | }); 29 | }); 30 | }); -------------------------------------------------------------------------------- /views/admin_user/assign_role.blade.php: -------------------------------------------------------------------------------- 1 |
      2 |
      $adminUser->id]) }}" id="layer-form"> 3 | @csrf 4 | @foreach($roles as $role) 5 |
      6 | contains($role->name) ? "checked" : "" }} 10 | value="{{ $role->name }}" 11 | title="{{ $role->name }}"> 12 |
      13 | @endforeach 14 |
      15 |
      -------------------------------------------------------------------------------- /views/admin_user/create.blade.php: -------------------------------------------------------------------------------- 1 |
      2 |
      3 | @csrf 4 |
      5 | 6 |
      7 | 8 |
      9 |
      10 |
      11 | 12 |
      13 | 14 |
      15 |
      16 |
      17 | 18 |
      19 | 20 |
      21 |
      不少于八位
      22 |
      23 |
      24 |
      -------------------------------------------------------------------------------- /views/admin_user/edit.blade.php: -------------------------------------------------------------------------------- 1 |
      2 |
      $adminUser->id]) }}" id="layer-form"> 3 | @csrf 4 |
      5 | 6 |
      7 | 8 |
      9 |
      10 |
      11 | 12 |
      13 | 17 |
      18 |
      19 |
      20 | 21 |
      22 | 23 |
      24 |
      不少于八位
      25 |
      26 |
      27 |
      -------------------------------------------------------------------------------- /views/admin_user/index.blade.php: -------------------------------------------------------------------------------- 1 | @section("title", "管理员管理") 2 | 3 | @extends("admin::layouts.admin") 4 | 5 | @section("breadcrumb") 6 |
      7 | 8 | 管理员列表 9 | 10 |
      11 | @endsection 12 | @section("content") 13 |
      14 |
      15 |
      16 | 17 |
      18 |
      19 | 20 |
      21 |
      22 | 23 |
      24 |
      25 |
      26 |
      27 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | @foreach ($adminUsers as $adminUser) 53 | 54 | 55 | 56 | 57 | 58 | 59 | 73 | 74 | @endforeach 75 | 76 |
      名称邮箱状态创建时间更新时间操作
      {{ $adminUser->name }}{{ $adminUser->email }}{{ $adminUser->status == 0 ? '启用' : '禁用' }}{{ $adminUser->created_at }}{{ $adminUser->updated_at }} 60 | @if(admin_user_can("admin-user.edit")) 61 | $adminUser->id]) }}', '编辑', 'PATCH', '500px', '350px')">编辑 63 | @endif 64 | @if(admin_user_can("admin-user.assign-roles-form")) 65 | $adminUser->id]) }}', '分配角色', 'PUT', '600px', '350px', true)">分配角色 67 | @endif 68 | @if(admin_user_can("admin-user.destroy")) 69 | $adminUser->id]) }}', this)">删除 71 | @endif 72 |
      77 |
      78 |
      79 | @endsection 80 | 81 | @section("script") 82 | 103 | @endsection -------------------------------------------------------------------------------- /views/change_password.blade.php: -------------------------------------------------------------------------------- 1 |
      2 |
      3 |
      4 | 5 |
      6 | 7 |
      8 |
      9 |
      10 | 11 |
      12 | 13 |
      14 |
      15 |
      16 | 17 |
      18 | 19 |
      20 |
      21 |
      22 |
      -------------------------------------------------------------------------------- /views/layouts/admin.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | @yield('title') 8 | 9 | 10 | 11 | 12 |
      13 | 31 | 32 |
      33 |
      34 | 35 | 51 |
      52 |
      53 | 54 |
      55 | @yield("breadcrumb") 56 |
      57 |
      58 |
      59 | @include('admin::message') 60 |
      61 | @yield("content") 62 |
      63 |
      64 |
      65 |
      66 |
      67 | 68 | 74 |
      75 | 76 | 77 | @yield("script") 78 | 84 | 85 | -------------------------------------------------------------------------------- /views/login.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 登录 8 | 9 | 10 | 11 | 12 | 13 |
      14 |
      15 |

      {{ config("admin.system_name") }}

      16 |
      17 | 18 |
      19 | 20 |
      21 |
      22 |
      23 | 24 |
      25 | 26 |
      27 |
      28 |
      29 |
      30 | 31 | 32 |
      33 |
      34 |
      35 |
      36 | 37 | 38 | 39 | 79 | 80 | -------------------------------------------------------------------------------- /views/message.blade.php: -------------------------------------------------------------------------------- 1 | @if($errors->any()) 2 |
      3 | @foreach($errors->all() as $error) 4 |

      {{ $error }}

      5 | @endforeach 6 |
      7 | @endif 8 | 9 | @if(session('success')) 10 |
      11 |

      {{ session('success') }}

      12 |
      13 | @endif -------------------------------------------------------------------------------- /views/navigation/create.blade.php: -------------------------------------------------------------------------------- 1 |
      2 |
      3 | @csrf 4 |
      5 | 6 |
      7 | 8 |
      9 |
      10 |
      11 | 12 |
      13 | 14 |
      15 |
      16 |
      17 | 18 |
      19 | 20 |
      21 |
      22 |
      23 | 24 |
      25 | 29 |
      30 |
      31 |
      32 | 33 |
      34 | 35 |
      36 |
      37 |
      38 | 39 |
      40 | 41 |
      42 |
      43 |
      44 | 45 |
      46 | 47 |
      48 |
      49 |
      50 | 51 |
      52 | 53 |
      54 |
      55 |
      56 |
      -------------------------------------------------------------------------------- /views/navigation/edit.blade.php: -------------------------------------------------------------------------------- 1 |
      2 |
      $navigation->id]) }}" id="layer-form"> 3 | @csrf 4 |
      5 | 6 |
      7 | 8 |
      9 |
      10 |
      11 | 12 |
      13 | 14 |
      15 |
      16 |
      17 | 18 |
      19 | 20 |
      21 |
      22 |
      23 | 24 |
      25 | 29 |
      30 |
      31 |
      32 | 33 |
      34 | 35 |
      36 |
      37 |
      38 | 39 |
      40 | 41 |
      42 |
      43 |
      44 | 45 |
      46 | 47 |
      48 |
      49 |
      50 | 51 |
      52 | 53 |
      54 |
      55 |
      56 |
      -------------------------------------------------------------------------------- /views/navigation/index.blade.php: -------------------------------------------------------------------------------- 1 | @section("title", "导航菜单") 2 | 3 | @extends("admin::layouts.admin") 4 | 5 | @section("breadcrumb") 6 |
      7 | 8 | 导航菜单 9 | 10 |
      11 | @endsection 12 | @section("content") 13 |
      14 |
      15 |
      16 | 17 |
      18 |
      19 | 23 |
      24 |
      25 | 26 |
      27 |
      28 | @if(admin_user_can("navigation.create")) 29 | 添加 30 | @endif 31 |
      32 |
      33 |
      34 |
      35 |
      36 |
      37 | @endsection 38 | 39 | @section("script") 40 | 123 | @endsection -------------------------------------------------------------------------------- /views/permission/create.blade.php: -------------------------------------------------------------------------------- 1 |
      2 |
      3 | @csrf 4 |
      5 | 6 |
      7 | 8 |
      9 |
      10 |
      11 | 12 |
      13 | 14 |
      15 |
      16 |
      17 | 18 |
      19 | @inject("permissionGroupPresenter", "Moell\LayuiAdmin\Presenters\PermissionGroupPresenter") 20 | {!! $permissionGroupPresenter->makeSelect() !!} 21 |
      22 |
      23 |
      24 | 25 |
      26 | 30 |
      31 |
      32 |
      33 | 34 |
      35 | 36 |
      37 |
      38 |
      39 | 40 |
      41 | 42 |
      43 |
      44 |
      45 |
      -------------------------------------------------------------------------------- /views/permission/edit.blade.php: -------------------------------------------------------------------------------- 1 |
      2 |
      $permission->id]) }}" id="layer-form"> 3 | @csrf 4 |
      5 | 6 |
      7 | 8 |
      9 |
      10 |
      11 | 12 |
      13 | 14 |
      15 |
      16 |
      17 | 18 |
      19 | @inject("permissionGroupPresenter", "Moell\LayuiAdmin\Presenters\PermissionGroupPresenter") 20 | {!! $permissionGroupPresenter->makeSelect($permission->pg_id) !!} 21 |
      22 |
      23 |
      24 | 25 |
      26 | 30 |
      31 |
      32 |
      33 | 34 |
      35 | 36 |
      37 |
      38 |
      39 | 40 |
      41 | 42 |
      43 |
      44 |
      45 |
      -------------------------------------------------------------------------------- /views/permission/index.blade.php: -------------------------------------------------------------------------------- 1 | @section("title", "角色") 2 | 3 | @extends("admin::layouts.admin") 4 | 5 | @section("breadcrumb") 6 |
      7 | 8 | 角色 9 | 10 |
      11 | @endsection 12 | @section("content") 13 |
      14 |
      15 |
      16 | 17 |
      18 |
      19 | @inject("permissionGroupPresenter", "Moell\LayuiAdmin\Presenters\PermissionGroupPresenter") 20 | {!! $permissionGroupPresenter->makeSelect(request("pg_id")) !!} 21 |
      22 |
      23 | 27 |
      28 |
      29 | 30 |
      31 |
      32 |
      33 |
      34 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | @foreach ($permissions as $permission) 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 76 | 77 | @endforeach 78 | 79 |
      权限名权限名称权限组Guard Name排序描述创建时间更新时间操作
      {{ $permission->name }}{{ $permission->display_name }}{{ optional($permission->group)->name }}{{ $permission->guard_name }}{{ $permission->sequence }}{{ $permission->description }}{{ $permission->created_at }}{{ $permission->updated_at }} 67 | @if(admin_user_can("permission.edit")) 68 | $permission->id]) }}', '编辑', 'PATCH', '600px', '500px')">编辑 70 | @endif 71 | @if(admin_user_can('permission.destroy')) 72 | $permission->id]) }}', this)">删除 74 | @endif 75 |
      80 |
      81 |
      82 | @endsection 83 | 84 | @section("script") 85 | 94 | @endsection -------------------------------------------------------------------------------- /views/permission_group/create.blade.php: -------------------------------------------------------------------------------- 1 |
      2 |
      3 | @csrf 4 |
      5 | 6 |
      7 | 8 |
      9 |
      10 |
      11 |
      -------------------------------------------------------------------------------- /views/permission_group/edit.blade.php: -------------------------------------------------------------------------------- 1 |
      2 |
      $permissionGroup->id]) }}" id="layer-form"> 3 | @csrf 4 |
      5 | 6 |
      7 | 8 |
      9 |
      10 |
      11 |
      -------------------------------------------------------------------------------- /views/permission_group/index.blade.php: -------------------------------------------------------------------------------- 1 | @section("title", "权限组") 2 | 3 | @extends("admin::layouts.admin") 4 | 5 | @section("breadcrumb") 6 |
      7 | 8 | 权限组 9 | 10 |
      11 | @endsection 12 | @section("content") 13 |
      14 |
      15 |
      16 | 17 |
      18 |
      19 | 20 |
      21 |
      22 |
      23 |
      24 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | @foreach ($permissionGroups as $group) 42 | 43 | 44 | 45 | 46 | 56 | 57 | @endforeach 58 | 59 |
      名称创建时间更新时间操作
      {{ $group->name }}{{ $group->created_at }}{{ $group->updated_at }} 47 | @if(admin_user_can("permission-group.edit")) 48 | $group->id]) }}', '编辑', 'PATCH', '500px', '200px')">编辑 50 | @endif 51 | @if(admin_user_can("permission-group.destroy")) 52 | $group->id]) }}', this)">删除 54 | @endif 55 |
      60 |
      61 |
      62 | @endsection 63 | 64 | @section("script") 65 | 74 | @endsection -------------------------------------------------------------------------------- /views/role/assign_permission.blade.php: -------------------------------------------------------------------------------- 1 | @section("title", "分配权限") 2 | 3 | @extends("admin::layouts.admin") 4 | 5 | @section("breadcrumb") 6 |
      7 | 8 | 角色 9 | 分配权限 10 | 11 |
      12 | @endsection 13 | @section("content") 14 |
      15 |
      $role->id]) }}" id="layer-form"> 16 | @csrf 17 | @method("PUT") 18 | @foreach($permissionGroups as $group) 19 |
      20 |
      21 | 22 | {{ $group->name }} 23 |
      24 |
      25 |
      26 | @foreach($group->permission as $permission) 27 |
      28 | contains($permission->name) ? "checked" : "" }} 33 | value="{{ $permission->name }}" 34 | title="{{ $permission->display_name }}"> 35 |
      36 | @endforeach 37 |
      38 |
      39 |
      40 | @endforeach 41 |
      42 |
      43 | 44 | 45 |
      46 |
      47 |
      48 |
      49 | @endsection 50 | 51 | @section("script") 52 | 66 | @endsection 67 | -------------------------------------------------------------------------------- /views/role/create.blade.php: -------------------------------------------------------------------------------- 1 |
      2 |
      3 | @csrf 4 |
      5 | 6 |
      7 | 8 |
      9 |
      10 |
      11 | 12 |
      13 | 17 |
      18 |
      19 |
      20 | 21 |
      22 | 23 |
      24 |
      25 |
      26 |
      -------------------------------------------------------------------------------- /views/role/edit.blade.php: -------------------------------------------------------------------------------- 1 |
      2 |
      $role->id]) }}" id="layer-form"> 3 | @csrf 4 |
      5 | 6 |
      7 | 8 |
      9 |
      10 |
      11 | 12 |
      13 | 17 |
      18 |
      19 |
      20 | 21 |
      22 | 23 |
      24 |
      25 |
      26 |
      -------------------------------------------------------------------------------- /views/role/index.blade.php: -------------------------------------------------------------------------------- 1 | @section("title", "角色") 2 | 3 | @extends("admin::layouts.admin") 4 | 5 | @section("breadcrumb") 6 |
      7 | 8 | 角色 9 | 10 |
      11 | @endsection 12 | @section("content") 13 |
      14 |
      15 |
      16 | 17 |
      18 |
      19 | 20 |
      21 |
      22 |
      23 |
      24 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | @foreach ($roles as $role) 43 | 44 | 45 | 46 | 47 | 48 | 62 | 63 | @endforeach 64 | 65 |
      名称Guard Name创建时间更新时间操作
      {{ $role->name }}{{ $role->guard_name }}{{ $role->created_at }}{{ $role->updated_at }} 49 | @if(admin_user_can("role.edit")) 50 | $role->id]) }}', '编辑', 'PATCH', '500px', '350px')">编辑 52 | @endif 53 | @if(admin_user_can("role.assign-permissions-form")) 54 | $role->id]) }}">分配权限 56 | @endif 57 | @if(admin_user_can("role.destroy")) 58 | $role->id]) }}', this)">删除 60 | @endif 61 |
      66 |
      67 |
      68 | @endsection 69 | 70 | @section("script") 71 | 80 | @endsection --------------------------------------------------------------------------------