Browse Source

修改文件

ZaiZai 10 months ago
parent
commit
124b035b28
1 changed files with 36 additions and 1 deletions
  1. 36 1
      src/views/system/user.vue

+ 36 - 1
src/views/system/user.vue

@@ -1,7 +1,42 @@
 <template>
-    <div>user</div>
+    <hc-body split>
+        <template #left>
+            <hc-card scrollbar>
+                <template #header>
+                    <el-input v-model="treeKeyFilter" placeholder="请输入关键字进行过滤" />
+                </template>
+                <hc-lazy-tree :h-props="treeProps" @load="treeLoadNode">
+                    <template #default="{ node }">{{ node.label }}</template>
+                </hc-lazy-tree>
+            </hc-card>
+        </template>
+        <hc-card>
+            其它内容
+        </hc-card>
+    </hc-body>
 </template>
 
 <script setup>
+import { getArrValue } from 'js-fast-way'
 import { nextTick, onActivated, ref } from 'vue'
+import deptApi from '~api/system/dept'
+
+onActivated(()=> {
+
+})
+
+//数据格式
+const treeKeyFilter = ref('')
+const treeProps = {
+    label: 'title',
+    children: 'children',
+    isLeaf: (item) => {
+        return !item.hasChildren
+    },
+}
+const treeLoadNode = async ({ item, level }, resolve) => {
+    const parentId = level === 0 ? 0 : item.id
+    const { data } = await deptApi.getDeptLazyTree(parentId)
+    resolve(getArrValue(data))
+}
 </script>