11<template >
22 <a-card :bordered =" false" >
33 <a-row :gutter =" 8" >
4- <a-col :span =" 6" >
5- <a-menu
6- class =" custom-tree"
7- @click =" handleClick"
8- style =" width : 200px "
9- :defaultSelectedKeys =" ['1']"
10- :openKeys.sync =" openKeys"
11- mode =" inline"
12- >
13- <a-sub-menu key =" sub1" @titleClick =" titleClick" >
14- <span slot =" title" ><a-icon type =" mail" /><span >研发中心</span ></span >
15- <a-menu-item-group key =" g1" >
16- <template slot="title">
17- <span >后端组</span >
18- <a-dropdown >
19- <a class =" btn" ><a-icon type =" ellipsis" /></a >
20- <a-menu slot =" overlay" >
21- <a-menu-item key =" 1" >新增</a-menu-item >
22- <a-menu-item key =" 2" >合并</a-menu-item >
23- <a-menu-item key =" 3" >移除</a-menu-item >
24- </a-menu >
25- </a-dropdown >
26- </template >
27- <a-menu-item key =" 1" >
28- 爪哇组
29- <a class =" btn" ><a-icon type =" plus" /></a >
30- </a-menu-item >
31- <a-menu-item key =" 2" >
32- 拍黄片组
33- <a class =" btn" ><a-icon type =" plus" /></a >
34- </a-menu-item >
35- </a-menu-item-group >
36- <a-menu-item-group key =" g2" >
37- <template slot="title">
38- <span >前端组</span >
39- <a class =" btn" ><a-icon type =" ellipsis" /></a >
40- </template >
41- <a-menu-item key =" 2-1" >
42- React
43- <a class =" btn" ><a-icon type =" plus" /></a >
44- </a-menu-item >
45- <a-menu-item key =" 2-2" >
46- Vue
47- <a class =" btn" ><a-icon type =" plus" /></a >
48- </a-menu-item >
49- <a-menu-item key =" 2-3" >
50- Angular
51- <a class =" btn" ><a-icon type =" plus" /></a >
52- </a-menu-item >
53- </a-menu-item-group >
54- </a-sub-menu >
55- <a-sub-menu key =" sub2" @titleClick =" titleClick" >
56- <span slot =" title" ><a-icon type =" appstore" /><span >财务部</span ></span >
57- <a-menu-item key =" 3-1" >会计核算</a-menu-item >
58- <a-menu-item key =" 3-2" >成本控制</a-menu-item >
59- <a-sub-menu key =" sub3" title =" 内部控制" >
60- <a-menu-item key =" 3-3-1" >财务制度建设</a-menu-item >
61- <a-menu-item key =" 3-3-2" >会计核算</a-menu-item >
62- </a-sub-menu >
63- </a-sub-menu >
64- <a-sub-menu key =" sub4" >
65- <span slot =" title" ><a-icon type =" setting" /><span >Navigation Three</span ></span >
66- <a-menu-item key =" 9" >Option 9</a-menu-item >
67- <a-menu-item key =" 10" >Option 10</a-menu-item >
68- <a-menu-item key =" 11" >Option 11</a-menu-item >
69- <a-menu-item key =" 12" >Option 12</a-menu-item >
70- </a-sub-menu >
71- </a-menu >
4+ <a-col :span =" 5" >
5+ <s-tree :dataSource =" orgTree" :search =" true" @click =" handleClick" ></s-tree >
726 </a-col >
73- <a-col :span =" 18 " >
7+ <a-col :span =" 19 " >
748 <s-table
759 ref =" table"
7610 size =" default"
10842</template >
10943
11044<script >
45+ import STree from ' @/components/Tree/Tree'
11146import STable from ' @/components/table/'
112- import { getServiceList } from ' @/api/manage'
47+ import { getOrgTree , getServiceList } from ' @/api/manage'
11348
11449export default {
11550 name: ' TreeList' ,
11651 components: {
117- STable
52+ STable,
53+ STree
11854 },
11955 data () {
12056 return {
@@ -125,15 +61,15 @@ export default {
12561 // 表头
12662 columns: [
12763 {
128- title: ' 规则编号 ' ,
64+ title: ' # ' ,
12965 dataIndex: ' no'
13066 },
13167 {
132- title: ' 描述 ' ,
68+ title: ' 成员名称 ' ,
13369 dataIndex: ' description'
13470 },
13571 {
136- title: ' 服务调用次数 ' ,
72+ title: ' 登陆次数 ' ,
13773 dataIndex: ' callNo' ,
13874 sorter: true ,
13975 needTotal: true ,
@@ -162,15 +98,25 @@ export default {
16298 .then (res => {
16399 return res .result
164100 })
101+
165102 },
166-
103+ orgTree : [],
167104 selectedRowKeys: [],
168105 selectedRows: []
169106 }
170107 },
108+ created () {
109+ getOrgTree ().then (res => {
110+ this .orgTree = res .result
111+ })
112+ },
171113 methods: {
172114 handleClick (e ) {
173- console .log (' click' , e)
115+ console .log (' handleClick' , e)
116+ this .queryParam = {
117+ key: e .key
118+ }
119+ this .$refs .table .refresh (true )
174120 },
175121 titleClick (e ) {
176122 console .log (' titleClick' , e)
@@ -184,7 +130,7 @@ export default {
184130}
185131 </script >
186132
187- <style lang="less" scoped >
133+ <style lang="less">
188134 .custom-tree {
189135
190136 / deep/ .ant-menu-item-group-title {
@@ -212,6 +158,7 @@ export default {
212158 width : 20px ;
213159 height : 40px ;
214160 line-height : 40px ;
161+ z-index : 1050 ;
215162
216163 & :hover {
217164 transform : scale (1.2 );
0 commit comments