|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<ElTree class="hc-tree-node tree-line el-radio-group" :class="[ui,submitCounts?'tree-line1':'']" ref="ElTreeRef" :props="ElTreeProps" :load="ElTreeLoadNode" lazy highlight-current accordion node-key="primaryKeyId"
|
|
|
- :default-expanded-keys="defaultExpandedCids" @node-click="ElTreeClick" @node-contextmenu="ElTreeLabelContextMenu" :indent="0" >
|
|
|
- <template #default="{ node, data }">
|
|
|
+ :default-expanded-keys="defaultExpandedCids" @node-click="ElTreeClick" @node-contextmenu="ElTreeLabelContextMenu" :indent="0" :key="treeKey" >
|
|
|
+ <template #default="{ node, data }" >
|
|
|
<div class="data-custom-tree-node" :id="`${idPrefix}${data['primaryKeyId']}`">
|
|
|
<!--树组件,节点名称-->
|
|
|
<div class="label" :class="node.level === 1?'level-name':''" style="width: 100%;display: flex;justify-content: space-between;"
|
|
@@ -89,6 +89,9 @@ const props = defineProps({
|
|
|
type: String,
|
|
|
|
|
|
},
|
|
|
+ treeKey:{
|
|
|
+ type: String,
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
//变量
|
|
@@ -108,7 +111,8 @@ const projectId = ref(props.projectId);
|
|
|
const contractId = ref(props.contractId);
|
|
|
const idPrefix = ref(props.idPrefix);
|
|
|
const isSubmitCounts = ref(props.submitCounts);
|
|
|
-const classifyTypedata=ref(props.classifyType)
|
|
|
+const classifyTypedata=ref(props.classifyType);
|
|
|
+const treeKeyData=ref(props.treeKey)
|
|
|
|
|
|
//监听
|
|
|
watch(() => [
|
|
@@ -120,8 +124,9 @@ watch(() => [
|
|
|
props.contractId,
|
|
|
props.idPrefix,
|
|
|
props.submitCounts,
|
|
|
- props.classifyType
|
|
|
-], ([menus, isMark, AutoKeys, expandKeys, UserProjectId, UserContractId, UserIdPrefix, submitCounts,ClassifyType]) => {
|
|
|
+ props.classifyType,
|
|
|
+ props.treeKey,
|
|
|
+], ([menus, isMark, AutoKeys, expandKeys, UserProjectId, UserContractId, UserIdPrefix, submitCounts,ClassifyType,TreeKey]) => {
|
|
|
menusData.value = menus
|
|
|
menuMark.value = isMark
|
|
|
isAutoKeys.value = AutoKeys
|
|
@@ -131,6 +136,7 @@ watch(() => [
|
|
|
idPrefix.value = UserIdPrefix
|
|
|
isSubmitCounts.value = submitCounts
|
|
|
classifyTypedata.value=ClassifyType
|
|
|
+ treeKeyData.value=TreeKey
|
|
|
})
|
|
|
|
|
|
//事件
|
|
@@ -198,13 +204,17 @@ const ElTreeLoadNode = async (node, resolve) => {
|
|
|
}
|
|
|
}
|
|
|
// 刷新tree
|
|
|
- const resetNode=async()=>{
|
|
|
- const theChildren = rootNode?.value.childNodes
|
|
|
- theChildren?.splice(0, theChildren.length)
|
|
|
- nextTick(()=>{
|
|
|
- ElTreeLoadNode(rootNode.value, rootResolve.value)
|
|
|
- })
|
|
|
- }
|
|
|
+// const resetNode=async()=>{
|
|
|
+// const theChildren = rootNode?.value.childNodes
|
|
|
+// theChildren?.splice(0, theChildren.length)
|
|
|
+// nextTick(()=>{
|
|
|
+// // ElTreeRef?.value. ElTreeLoadNode(rootNode.value, rootResolve.value)
|
|
|
+// ElTreeLoadNode(rootNode.value, rootResolve.value)
|
|
|
+
|
|
|
+// })
|
|
|
+// return 11111111
|
|
|
+
|
|
|
+// }
|
|
|
|
|
|
watch(classifyTypedata, (val) => {
|
|
|
if(val){
|
|
@@ -303,7 +313,7 @@ const removeElTreeNode = (key) => {
|
|
|
defineExpose({
|
|
|
setElTreeMenuMark,
|
|
|
removeElTreeNode,
|
|
|
- resetNode
|
|
|
+ // resetNode
|
|
|
})
|
|
|
</script>
|
|
|
|