1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<template>
  <a-tabs style="height: 100%" v-model="activeTabKey" v-if="Object.keys(currentLevelInfo).length>0">
    <a-tab-pane :key="1" tab="产品属性" v-if="currentLevelInfo.type===1">
      <ProductInfo :currentLevelDetails="currentLevelInfo.entity" :size="descriptionsContainerSize"/>
    </a-tab-pane>
 
    <a-tab-pane :key="1" tab="部件属性" v-if="currentLevelInfo.type===2">
      <ComponentInfo :currentLevelDetails="currentLevelInfo.entity" :size="descriptionsContainerSize"/>
    </a-tab-pane>
 
    <a-tab-pane :key="1" tab="零件属性" v-if="currentLevelInfo.type===3">
      <PartInfo :currentLevelDetails="currentLevelInfo.entity" :size="descriptionsContainerSize"/>
    </a-tab-pane>
 
    <a-tab-pane :key="1" tab="工序属性" v-if="currentLevelInfo.type===5">
      <ProcessInfo :currentLevelDetails="currentLevelInfo.entity" :size="descriptionsContainerSize"/>
    </a-tab-pane>
 
    <a-tab-pane :key="1" tab="工步属性" v-if="currentLevelInfo.type===6">
      <ProcessStepInfo :currentLevelDetails="currentLevelInfo.entity" :size="descriptionsContainerSize"/>
    </a-tab-pane>
 
    <template v-if="currentLevelInfo.hasOwnProperty('attributionType')">
      <a-tab-pane :key="1" tab="文档属性">
        <DocumentInfo :currentLevelDetails="currentLevelInfo" :size="descriptionsContainerSize"/>
      </a-tab-pane>
 
      <a-tab-pane :key="2" tab="预览">
 
      </a-tab-pane>
 
      <a-tab-pane :key="3" tab="文档版本">
        <DocumentVersionTableList/>
      </a-tab-pane>
 
      <a-tab-pane :key="4" tab="使用设备" v-if="currentLevelInfo.attributionType===5">
        <UseDocumentEquipmentTableList/>
      </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,
        descriptionsContainerSize: 'small',
        currentLevelInfo: {}
      }
    },
    created() {
      this.$bus.$on('sendCurrentLevelInfo', this.receiveCurrentLevelInfo)
      this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentLevelInfo)
    },
    methods: {
      /**
       * 接收树组件以及表格传来的当前选中或点击的项信息
       * @param levelInfo
       */
      receiveCurrentLevelInfo(levelInfo) {
        this.currentLevelInfo = levelInfo
        if (levelInfo.attributionType) this.activeTabKey = 1
      }
    }
  }
</script>
 
<style scoped>
  /deep/ .ant-tabs-content {
    height: calc(100% - 65px);
  }
 
  /deep/ .ant-tabs-tabpane {
    overflow: auto;
  }
</style>