|
@@ -25,7 +25,7 @@
|
|
|
</template>
|
|
|
</hc-search-input>
|
|
|
</template>
|
|
|
- <hc-lazy-tree :h-props="treeProps" tree-key="id" @load="treeLoadNode" />
|
|
|
+ <hc-lazy-tree :h-props="treeProps" tree-key="id" :menus="treeMenus" @load="treeLoadNode" @menu-tap="treeMenuClick" @node-tap="treeNodeClick" />
|
|
|
</hc-new-card>
|
|
|
</template>
|
|
|
<div class="body-top">
|
|
@@ -51,12 +51,11 @@
|
|
|
<script setup>
|
|
|
import { ref, watch } from 'vue'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
+import { getArrValue, getObjValue, isNullES } from 'js-fast-way'
|
|
|
import { delMessage } from 'hc-vue3-ui'
|
|
|
-import { deepClone, getArrValue, getObjValue, isNullES } from 'js-fast-way'
|
|
|
import mainApi from '~api/project/project'
|
|
|
import wbsPrivateApi from '~api/wbs/private'
|
|
|
|
|
|
-
|
|
|
const props = defineProps({
|
|
|
type: {
|
|
|
type: [String, Number],
|
|
@@ -147,6 +146,20 @@ const treeProps = {
|
|
|
},
|
|
|
}
|
|
|
|
|
|
+//树的右键菜单
|
|
|
+const treeMenus = [
|
|
|
+ { icon: 'draft', label: '编辑节点', key: 'edit' },
|
|
|
+ { icon: 'refresh', label: '同步新增元素表单', key: 'sync1' },
|
|
|
+ { icon: 'loop-left', label: '同步元素表单排序到合同段', key: 'sync3' },
|
|
|
+ { icon: 'loop-right', label: '同步节点基础信息及表单URL', key: 'sync2' },
|
|
|
+ { icon: 'sort-asc', label: '调整排序', key: 'sort' },
|
|
|
+ { icon: 'delete-bin', label: '删除节点', key: 'del' },
|
|
|
+]
|
|
|
+//菜单被点击
|
|
|
+const treeMenuClick = ({ key, node, data, keys }) => {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
//懒加载树
|
|
|
const treeLoadNode = async ({ item, level }, resolve) => {
|
|
|
let pid = level !== 0 ? item.id : 0
|
|
@@ -159,6 +172,11 @@ const treeLoadNode = async ({ item, level }, resolve) => {
|
|
|
})
|
|
|
resolve(getArrValue(data))
|
|
|
}
|
|
|
+
|
|
|
+//节点被点击
|
|
|
+const treeNodeClick = ({ node, data, keys }) => {
|
|
|
+
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|