|
@@ -12,7 +12,7 @@
|
|
|
<div class="relative h-full flex">
|
|
|
<div id="hc_tree_card">
|
|
|
<hc-card-item scrollbar>
|
|
|
- <hc-data-tree :h-props="treeProps" :datas="treeLoadNode" :menus="treeMenus" default-expand-all />
|
|
|
+ <hc-data-tree :h-props="treeProps" :datas="treeLoadNode" :menus="treeMenus" :root-menu="treeRootMenu" default-expand-all @menuTap="treeMenuTap" />
|
|
|
</hc-card-item>
|
|
|
</div>
|
|
|
<div id="hc_table_card" class="flex-1">
|
|
@@ -57,6 +57,18 @@ const setSplitRef = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+//类型tab数据和相关处理
|
|
|
+const tabKey = ref('key1')
|
|
|
+const tabTab = ref([
|
|
|
+ { key: 'key1', name: '普通变更' },
|
|
|
+ { key: 'key2', name: '工区变更' },
|
|
|
+])
|
|
|
+
|
|
|
+const tabChange = (item) => {
|
|
|
+ tabKey.value = item?.key
|
|
|
+ console.log(item)
|
|
|
+}
|
|
|
+
|
|
|
//数据格式
|
|
|
const treeProps = {
|
|
|
label: 'label',
|
|
@@ -77,22 +89,22 @@ const treeLoadNode = ref([
|
|
|
},
|
|
|
])
|
|
|
|
|
|
-const treeMenus = [
|
|
|
- { icon: 'add', label: '新增归档', key: 'add' },
|
|
|
- { icon: 'pencil', label: '修改归档', key: 'edit' },
|
|
|
- { icon: 'close', label: '删除归档', key: 'del' },
|
|
|
+//根节点菜单
|
|
|
+const treeRootMenu = [
|
|
|
+ { icon: 'add', label: '新增', key: 'add' },
|
|
|
+ { icon: 'arrow-up-down-line', label: '排序', key: 'sort' },
|
|
|
]
|
|
|
|
|
|
-//类型tab数据和相关处理
|
|
|
-const tabKey = ref('key1')
|
|
|
-const tabTab = ref([
|
|
|
- { key: 'key1', name: '普通变更' },
|
|
|
- { key: 'key2', name: '工区变更' },
|
|
|
-])
|
|
|
+//节点菜单
|
|
|
+const treeMenus = [
|
|
|
+ { icon: 'add', label: '新增', key: 'add' },
|
|
|
+ { icon: 'pencil', label: '修改', key: 'edit' },
|
|
|
+ { icon: 'arrow-up-down-line', label: '排序', key: 'sort' },
|
|
|
+ { icon: 'close', label: '删除', key: 'del' },
|
|
|
+]
|
|
|
|
|
|
-const tabChange = (item) => {
|
|
|
- tabKey.value = item?.key
|
|
|
- console.log(item)
|
|
|
+const treeMenuTap = ({ key, node, data }) => {
|
|
|
+ console.log(key, node, data)
|
|
|
}
|
|
|
|
|
|
//搜索表单
|