123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- @extends('admin/layout')
- @section('header')
- <link rel="stylesheet" href="{{asset('js/plugins/zTree_v3-master/css/zTreeStyle/zTreeStyle.css')}}">
- @endsection
- @section('content')
- <body class="gray-bg">
- <div class="wrapper wrapper-content animated fadeInRight">
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-title">
- 菜单配置
- </div>
- <div class="ibox-content">
- <ul id="treeDemo" class="ztree"></ul>
- <div style="margin: 20px 0 0 50px">
- <button class="btn btn-info" onclick="units.save()">保存</button>
- <button class="btn btn-default closeLayer">取消</button>
- </div>
- </div>
- </div>
- </div>
- {{--<div class="col-sm-9">--}}
- {{--<div class="ibox float-e-margins">--}}
- {{--<div class="ibox-title">权限配置</div>--}}
- {{--<div class="ibox-content">--}}
- {{--<table id="table" class="table table-condensed" data-mobile-responsive="true"></table>--}}
- {{--</div>--}}
- {{--</div>--}}
- {{--</div>--}}
- </div>
- </div>
- </body>
- @endsection
- @section('footer')
- <script src="{{asset('js/plugins/zTree_v3-master/js/jquery.ztree.core.min.js')}}"></script>
- <script src="{{asset('js/plugins/zTree_v3-master/js/jquery.ztree.excheck.min.js')}}"></script>
- <script>
- var zTreeObj;
- var setting = {
- check: {
- enable: true
- },
- data: {
- simpleData: {
- enable: true
- }
- }
- };
- var trees = JSON.parse('{!! json_encode($trees) !!}');
- $(document).ready(function () {
- zTreeObj = $.fn.zTree.init($("#treeDemo"), setting, trees);
- });
- var units = {
- save: function () {
- var userIds = JSON.parse('{!! json_encode($userIds) !!}');
- var checkedNodes = zTreeObj.getCheckedNodes();
- var permissionIds = [];
- $.each(checkedNodes, function (inx, val) {
- permissionIds.push(val.id);
- });
- var config = {
- url: '/admin/system/user-permissions',
- type: 'put',
- data: {userIds: userIds, permissionIds: permissionIds}
- };
- config.success = function (result) {
- layer.msg(result.message, {icon: 6, time: 1500}, function () {
- tips.closeParentLayer();
- });
- };
- tips.ajax(config);
- }
- };
- </script>
- @endsection
|