<template>
|
<div style="height: 100%;max-height: 748px">
|
<template v-if="+currentTreeNodeInfo.type===2">
|
<div style="height: 100%;max-height: 748px">
|
<!--产品结构树右侧顶部区域-->
|
<div style="height: 45%;overflow: hidden">
|
<DeviceStructureMainTop :size="containerSize" ref="mainTopRef" :currentTreeNodeInfo="currentTreeNodeInfo"/>
|
</div>
|
|
<!--产品结构树右侧底部区域-->
|
<div style="height: 55%;overflow: hidden">
|
<DeviceStructureMainBottom :size="containerSize" :currentTreeNodeInfo="currentTreeNodeInfo"/>
|
</div>
|
</div>
|
</template>
|
|
<template v-else>
|
<a-tabs>
|
<a-tab-pane :key="1" tab="车间属性">
|
<WorkshopInfo :currentLevelDetails="currentTreeNodeInfo" :size="containerSize"/>
|
</a-tab-pane>
|
</a-tabs>
|
</template>
|
</div>
|
</template>
|
|
<script>
|
import DeviceStructureMainTop from './DeviceStructureMainTop'
|
import DeviceStructureMainBottom from './DeviceStructureMainBottom'
|
import WorkshopInfo from './Workshop/WorkshopInfo'
|
|
export default {
|
name: 'DeviceStructureMain',
|
components: {
|
WorkshopInfo,
|
DeviceStructureMainTop,
|
DeviceStructureMainBottom
|
},
|
created() {
|
this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo)
|
},
|
data() {
|
return {
|
containerSize: 'small',
|
currentTreeNodeInfo: {}
|
}
|
},
|
methods: {
|
/**
|
* 接收树组件传来的当前选中的树节点信息
|
* @param treeNodeInfo 树节点信息
|
*/
|
receiveCurrentTreeNodeInfo(treeNodeInfo) {
|
// 从树组件接受树节点信息后从父组件流入子组件
|
this.currentTreeNodeInfo = treeNodeInfo
|
if (treeNodeInfo.equipmentId) {
|
this.$nextTick(() => {
|
if (this.$refs.mainTopRef) this.$refs.mainTopRef.loadHasSentDocumentListData()
|
})
|
}
|
console.log('currentTreeNodeInfo------------------', this.currentTreeNodeInfo)
|
}
|
}
|
}
|
</script>
|