|
@@ -3,14 +3,24 @@
|
|
|
|
|
|
|
|
@section('content')
|
|
@section('content')
|
|
|
<div class="container-fluid" id="container">
|
|
<div class="container-fluid" id="container">
|
|
|
|
|
+ @include('maintenance.authority._add')
|
|
|
|
|
+ {{--@include('maintenance.authority._edit')--}}
|
|
|
<div class="card">
|
|
<div class="card">
|
|
|
<div class="card-body">
|
|
<div class="card-body">
|
|
|
- <button class="btn btn-outline-info mb-1 mr-3" @click="openModal()"><span class="fa fa-plus"></span> 新 增</button>
|
|
|
|
|
- <div class="btn-group pull-right">
|
|
|
|
|
- <button class="btn border btn-primary" @click="expand(true)">展开全部</button>
|
|
|
|
|
- <button class="btn border btn-primary" @click="expand(false)">收起全部</button>
|
|
|
|
|
|
|
+ <div class="w-100 mb-5">
|
|
|
|
|
+ <div class="btn-group pull-left">
|
|
|
|
|
+ <button class="btn btn-outline-primary" @click="openModal()"><span class="fa fa-plus"></span> 新 增</button>
|
|
|
|
|
+ <button class="btn btn-outline-info" @click="openModal()"><span class="fa fa-edit"></span> 修 改</button>
|
|
|
|
|
+ <button class="btn btn-outline-danger" @click="openModal()"><span class="fa fa-close"></span> 删 除</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="btn-group pull-right">
|
|
|
|
|
+ <button class="btn border btn-primary" @click="expand(true)">展开全部</button>
|
|
|
|
|
+ <button class="btn border btn-primary" @click="expand(false)">收起全部</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="w-100">
|
|
|
|
|
+ <tree class="offset-2 h5 font-weight-bold" :list="list" :column="'name'"></tree>
|
|
|
</div>
|
|
</div>
|
|
|
- <tree class="offset-2 h5 font-weight-bold" :list="list" :column="'name'"></tree>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -22,15 +32,28 @@
|
|
|
el:"#container",
|
|
el:"#container",
|
|
|
data:{
|
|
data:{
|
|
|
list:[@foreach($authorities as $authority)@json($authority),@endforeach],
|
|
list:[@foreach($authorities as $authority)@json($authority),@endforeach],
|
|
|
|
|
+ parentList:[],
|
|
|
|
|
+ authority:{},
|
|
|
},
|
|
},
|
|
|
components:{
|
|
components:{
|
|
|
'tree':"url:{{asset("js/vue/tree.vue")}}"
|
|
'tree':"url:{{asset("js/vue/tree.vue")}}"
|
|
|
},
|
|
},
|
|
|
|
|
+ mounted(){
|
|
|
|
|
+ this.parentList = this._mergeArray(this.list);
|
|
|
|
|
+ },
|
|
|
methods:{
|
|
methods:{
|
|
|
expand(isExpand){
|
|
expand(isExpand){
|
|
|
if (isExpand) $(".up").slideDown();
|
|
if (isExpand) $(".up").slideDown();
|
|
|
else $(".up").slideUp();
|
|
else $(".up").slideUp();
|
|
|
},
|
|
},
|
|
|
|
|
+ _mergeArray(arr,result = [],before = ' '){
|
|
|
|
|
+ if (!arr)return result;
|
|
|
|
|
+ for (let i=0;i<arr.length;i++){
|
|
|
|
|
+ result.push({id:arr[i].id,name:before+'└─'+arr[i].name});
|
|
|
|
|
+ if (arr[i].child && arr[i].child.length>0)this._mergeArray(arr[i].child,result,before+=' ')
|
|
|
|
|
+ }
|
|
|
|
|
+ return result;
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|