<template>
|
<a-tabs style="height: 100%" v-model="activeTabKey" v-if="Object.keys(currentLevelInfo).length>0"
|
@change="handleTabChange">
|
<a-tab-pane :key="1" tab="产品属性" v-if="currentLevelInfo.type===1">
|
<ProductInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/>
|
</a-tab-pane>
|
|
<a-tab-pane :key="1" tab="部件属性" v-if="currentLevelInfo.type===2">
|
<ComponentInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/>
|
</a-tab-pane>
|
|
<a-tab-pane :key="1" tab="零件属性" v-if="currentLevelInfo.type===3">
|
<PartInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/>
|
</a-tab-pane>
|
|
<a-tab-pane :key="1" tab="工序属性" v-if="currentLevelInfo.type===5">
|
<ProcessInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/>
|
</a-tab-pane>
|
|
<a-tab-pane :key="1" tab="工步属性" v-if="currentLevelInfo.type===6">
|
<ProcessStepInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/>
|
</a-tab-pane>
|
|
<template v-if="currentLevelInfo.hasOwnProperty('attributionType')">
|
<a-tab-pane :key="1" tab="文档属性">
|
<DocumentInfo :currentLevelDetails="currentLevelInfo" :size="containerSize"/>
|
</a-tab-pane>
|
|
<a-tab-pane :key="2" tab="预览">
|
|
</a-tab-pane>
|
|
<a-tab-pane :key="3" tab="文档版本">
|
<DocumentVersionTableList ref="documentVersionTableRef" :currentDocumentInfo="currentLevelInfo"
|
:size="containerSize"/>
|
</a-tab-pane>
|
|
<a-tab-pane :key="4" tab="使用设备" v-if="currentLevelInfo.attributionType===5">
|
<UseDocumentEquipmentTableList ref="useDocumentEquipmentTableRef" :currentDocumentInfo="currentLevelInfo"
|
:size="containerSize"/>
|
</a-tab-pane>
|
</template>
|
</a-tabs>
|
</template>
|
|
<script>
|
import ProductInfo from './Product/ProductInfo'
|
import ComponentInfo from './Component/ComponentInfo'
|
import PartInfo from './Part/PartInfo'
|
import ProcessInfo from './Process/ProcessInfo'
|
import DocumentInfo from './Document/DocumentInfo'
|
import DocumentVersionTableList from './Document/DocumentVersionTableList'
|
import UseDocumentEquipmentTableList from './Document/UseNcDocumentEquipmentTableList'
|
import ProcessStepInfo from './ProcessStep/ProcessStepInfo'
|
|
export default {
|
name: 'ProductStructureMainBottom',
|
components: {
|
ProcessStepInfo,
|
UseDocumentEquipmentTableList,
|
DocumentVersionTableList,
|
DocumentInfo,
|
ProcessInfo,
|
PartInfo,
|
ProductInfo,
|
ComponentInfo
|
},
|
data() {
|
return {
|
activeTabKey: 1,
|
containerSize: 'small',
|
currentLevelInfo: {},
|
hasLoadedDataTabKeyArray: []
|
}
|
},
|
created() {
|
this.$bus.$on('sendCurrentClickedDocumentInfo', this.receiveCurrentLevelInfo)
|
this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentLevelInfo)
|
this.$bus.$on('reloadMainBottomTableData', this.reloadMainBottomTableData)
|
},
|
methods: {
|
/**
|
* 接收树组件以及表格传来的当前选中或点击的项信息
|
* @param levelInfo
|
*/
|
receiveCurrentLevelInfo(levelInfo) {
|
this.currentLevelInfo = levelInfo
|
this.activeTabKey = 1
|
this.hasLoadedDataTabKeyArray = []
|
},
|
|
handleTabChange(activeTabKey) {
|
if (!this.hasLoadedDataTabKeyArray.includes(activeTabKey)) {
|
if (activeTabKey === 3) {
|
this.$nextTick(() => this.$refs.documentVersionTableRef.loadData())
|
} else if (activeTabKey === 4) {
|
this.$nextTick(() => this.$refs.useDocumentEquipmentTableRef.loadData())
|
}
|
this.hasLoadedDataTabKeyArray.push(activeTabKey)
|
}
|
},
|
|
reloadMainBottomTableData(tableName) {
|
if (this.$refs[tableName + 'TableRef']) this.$refs[tableName + 'TableRef'].loadData()
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
/deep/ .ant-tabs-content {
|
height: calc(100% - 65px);
|
}
|
|
/deep/ .ant-tabs-tabpane {
|
overflow: auto;
|
}
|
</style>
|