|
@@ -15,9 +15,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<TreeNodeChildren
|
|
|
- :data="nodes.childNodes" :parent-nodes="nodes" @expandClick="expandClick"
|
|
|
- @menuClick="poverMenuClick" @nodeClick="nodeLabelClick"
|
|
|
- @nodeDblClick="nodeLabelDblClick"
|
|
|
+ :data="nodes.childNodes" :parent-nodes="nodes" @expand-click="expandClick"
|
|
|
+ @menu-click="poverMenuClick" @node-click="nodeLabelClick"
|
|
|
+ @node-dbl-click="nodeLabelDblClick"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -39,10 +39,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { nextTick, onMounted, ref, watch } from 'vue'
|
|
|
+import { nextTick, onActivated, onMounted, ref, watch } from 'vue'
|
|
|
import TreeNodeChildren from './children.vue'
|
|
|
import wbsApi from '~api/data-fill/wbs'
|
|
|
import { getArrValue, getObjValue, getRandom, isArrItem } from 'js-fast-way'
|
|
|
+import { useRoute } from 'vue-router'
|
|
|
|
|
|
//参数
|
|
|
const props = defineProps({
|
|
@@ -73,6 +74,7 @@ const props = defineProps({
|
|
|
})
|
|
|
|
|
|
const emit = defineEmits(['expand', 'nodeClick', 'nodeDblClick', 'menuClick'])
|
|
|
+
|
|
|
//初始数据
|
|
|
const uuid = getRandom()
|
|
|
const datas = ref({})
|
|
@@ -84,6 +86,8 @@ const contractId = ref(props.contractId)
|
|
|
const TreeExpandKey = ref(props.autoExpandKeys)
|
|
|
const treeRefNode = ref(null)
|
|
|
const treeRefData = ref(null)
|
|
|
+const tableOwner = ref('')
|
|
|
+const classifyType = ref('')
|
|
|
|
|
|
//监听
|
|
|
watch(() => [
|
|
@@ -102,8 +106,19 @@ watch(() => [
|
|
|
|
|
|
//渲染完成
|
|
|
onMounted(() => {
|
|
|
+ const useRoutes = useRoute()
|
|
|
+ tableOwner.value = useRoutes.query?.tableOwner
|
|
|
+ classifyType.value = useRoutes.query?.classifyType
|
|
|
+ console.log(tableOwner.value, 'tableOwner.value ')
|
|
|
getTreeOneLevel()
|
|
|
})
|
|
|
+onActivated(() => {
|
|
|
+ const useRoutes = useRoute()
|
|
|
+ tableOwner.value = useRoutes.query?.tableOwner
|
|
|
+ classifyType.value = useRoutes.query?.classifyType
|
|
|
+
|
|
|
+})
|
|
|
+
|
|
|
|
|
|
//导图结构树节点查询
|
|
|
const treeNodeLoading = ref(false)
|
|
@@ -114,6 +129,8 @@ const getTreeOneLevel = async () => {
|
|
|
contractIdRelation: '',
|
|
|
primaryKeyId: '',
|
|
|
parentId: '',
|
|
|
+ classifyType:classifyType.value,
|
|
|
+ tableOwner:tableOwner.value,
|
|
|
})
|
|
|
//处理数据
|
|
|
const res = getObjValue(data[0])
|
|
@@ -123,8 +140,11 @@ const getTreeOneLevel = async () => {
|
|
|
const children = await queryMappingStructureTree({
|
|
|
contractId: contractId.value,
|
|
|
contractIdRelation: res?.contractIdRelation || '',
|
|
|
- primaryKeyId: res?.primaryKeyId,
|
|
|
+ // primaryKeyId: res?.primaryKeyId,
|
|
|
+ primaryKeyId: res?.id,
|
|
|
parentId: res?.id,
|
|
|
+ classifyType:classifyType.value,
|
|
|
+ tableOwner:tableOwner.value,
|
|
|
})
|
|
|
if (children.length > 0) {
|
|
|
await setTreeExpandKey(children, res)
|
|
@@ -144,8 +164,11 @@ const setTreeExpandKey = async (arr, res) => {
|
|
|
const children = await queryMappingStructureTree({
|
|
|
contractId: contractId.value,
|
|
|
contractIdRelation: item?.contractIdRelation || '',
|
|
|
- primaryKeyId: item?.primaryKeyId,
|
|
|
+ // primaryKeyId: item?.primaryKeyId,
|
|
|
+ primaryKeyId: item?.id,
|
|
|
parentId: item?.id,
|
|
|
+ classifyType:classifyType.value,
|
|
|
+ tableOwner:tableOwner.value,
|
|
|
})
|
|
|
if (children.length > 0) {
|
|
|
await setTreeExpandKey(children, item)
|
|
@@ -159,7 +182,9 @@ const setTreeExpandKey = async (arr, res) => {
|
|
|
const queryMappingStructureTree = async (form) => {
|
|
|
const { error, code, data } = await wbsApi.queryMappingStructureTree({
|
|
|
...form,
|
|
|
- wbsType: 1,
|
|
|
+ // wbsType: 1,
|
|
|
+ classifyType:classifyType.value,
|
|
|
+ tableOwner:tableOwner.value,
|
|
|
})
|
|
|
//处理数据
|
|
|
if (!error && code === 200) {
|
|
@@ -277,8 +302,11 @@ const nodeLabelClick = async ({ node, data }) => {
|
|
|
const children = await queryMappingStructureTree({
|
|
|
contractId: contractId.value,
|
|
|
contractIdRelation: data?.contractIdRelation || '',
|
|
|
- primaryKeyId: data?.primaryKeyId,
|
|
|
+ // primaryKeyId: data?.primaryKeyId,
|
|
|
+ primaryKeyId: data?.id,
|
|
|
parentId: data?.id,
|
|
|
+ classifyType:classifyType.value,
|
|
|
+ tableOwner:tableOwner.value,
|
|
|
})
|
|
|
node.childNodes = children
|
|
|
await nextTick(async () => {
|