litian
2025-03-18 e741b70fc22dc65e4a40595c50bb9057bed15667
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<template>
  <div class="user-manage">
    <div>
      <ul class="flex tabs">
        <li
          v-for="item in tabList"
          :key="item.value"
          @click="handleClick(item)"
          :class="item.value == tabActive ? 'activeItem' : 'item'"
        >
          {{ item.lable }}
        </li>
      </ul>
    </div>
    <div class="list">
      <div>
        <el-tree
          :data="dataList"
          show-checkbox
          node-key="id"
          default-expand-all
          :props="defaultProps"
        />
 
      </div>
 
    </div>
  </div>
</template>
 
<script setup lang="ts">
import { ref, onMounted } from "vue";
 
const tabList = ref([
  {
    lable:'菜单/功能访问权限',
    value:'menu'
 
  },
  {
    lable:'模型访问权限',
    value:'model'
  }
])
const tabActive = ref('menu')
const dataList = ref([])
 
onMounted(() => {
  getData();
});
 
const defaultProps = {
  children: 'children',
  label: 'name',
}
 
const getData = () =>{
  let list = [
    {
      name:'模型管理',
      sysType:'cmsFolder',
      productLinkPath:'111',
      children:[
        {
          name:'新增型号',
          sysType:'cmsItem',
          productLinkPath:'211',
        },
        {
          name:'编辑型号',
          sysType:'cmsItem',
          productLinkPath:'212',
        },
        {
          name:'删除型号',
          sysType:'cmsItem',
          productLinkPath:'213',
        },
        {
          name:'新增模型',
          sysType:'cmsItem',
          productLinkPath:'214',
        },{
          name:'删除模型',
          sysType:'cmsItem',
          productLinkPath:'215',
        },{
          name:'删除模型',
          sysType:'cmsItem',
          productLinkPath:'216',
        }
      ]
 
    },
    {
      name:'可视化仿真',
      sysType:'cmsFolder',
      productLinkPath:'112',
      children:[
        {
          name:'测试仿真',
          sysType:'cmsFolder',
          productLinkPath:'221',
          children:[
            {
              name:'检索模型',
              sysType:'cmsItem',
              productLinkPath:'231',
              
            },
            {
              name:'模型预览',
              sysType:'cmsItem',
              productLinkPath:'232',
            },
            {
              name:'模型属性查看',
              sysType:'cmsItem',
              productLinkPath:'233',
            },
            {
              name:'模型仿真',
              sysType:'cmsItem',
              productLinkPath:'234',
            },
            {
              name:'测试报告',
              sysType:'cmsItem',
              productLinkPath:'235',
            },
          ]
        },
        {
          name:'测试报告',
          sysType:'cmsFolder',
          productLinkPath:'221',
        },
      ]
 
    }
  ]
  dataList.value = list
 
}
const handleClick = (item) => {
  tabActive.value = item.value
};
</script>
 
<style lang="less" scoped>
.user-manage {
  padding: 20px;
}
.tabs{
  li{
    width:140px;
    text-align: center;
    padding: 5px 0;
    margin:0 15px;
    cursor: pointer;
  }
  .activeItem{
    border-bottom:2px solid #1890ff;
  }
}
</style>