<template>
|
<div class="grid-content">
|
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
|
<el-tab-pane label="NC文档" name="ncTab">
|
<el-row :gutter="20">
|
<el-col :span="7" :class="'grid-table-height'">
|
<process-table
|
v-if="tabRefresh.ncTab"
|
ref="ProcessTable"
|
@showProcessAddDialog="showProcessAddDialog"
|
@showProcessEditDialog="showProcessEditDialog"
|
@showUploadDialog="showUploadDialog"
|
v-on:indexChange="setIndex($event)"
|
:nodeList="nodeList"></process-table>
|
</el-col>
|
<el-col :span="17">
|
<file-table
|
v-if="tabRefresh.ncTab"
|
ref="FileTable"
|
@showDocEditDialog="showDocEditDialog"
|
@showUploadDialog="showUploadDialog"
|
v-on:indexChange="setInd($event)"
|
:nodeList="nodeData"></file-table>
|
</el-col>
|
</el-row>
|
</el-tab-pane>
|
<el-tab-pane label="其他文档" name="othTab">
|
<el-row>
|
<el-col :span="24">
|
<others-table
|
v-if="tabRefresh.othTab"
|
ref="OthersTable"
|
@showDocEditDialog="showDocEditDialog"
|
@showUploadDialog="showUploadDialog"
|
v-on:indexChange="setInds($event)"
|
:nodeList="nodeList"></others-table>
|
</el-col>
|
</el-row>
|
</el-tab-pane>
|
</el-tabs>
|
</div>
|
</template>
|
|
<script>
|
import * as productApi from '../api/product'
|
import utilApi from '@/common/utils'
|
import ProcessTable from '@/module/productManager/components/process_table_info.vue';
|
import FileTable from '@/module/productManager/components/nc_file_table_info.vue';
|
import OthersTable from '@/module/productManager/components/other_file_table_info.vue';
|
export default {
|
name: "file_tab_info",
|
props:['nodeList'],
|
components:{
|
ProcessTable,
|
FileTable,
|
OthersTable,
|
},
|
data(){
|
return{
|
activeName: 'ncTab',
|
nodeData:{
|
index:'',
|
list:[]
|
},
|
nodeDataC:{
|
index:'',
|
list:[]
|
},
|
nodeDataO:{
|
index:'',
|
list:[]
|
},
|
tabRefresh: {
|
ncTab: true,
|
othTab: false,
|
}
|
}
|
},
|
methods:{
|
handleClick(tab){
|
this.activeName = tab.name;
|
switch (this.activeName) {
|
case 'ncTab':
|
this.switchTab('ncTab');
|
break;
|
case 'othTab':
|
this.switchTab('othTab');
|
break;
|
}
|
},
|
switchTab (tab) {
|
for (let key in this.tabRefresh) {
|
if (key === tab) {
|
this.tabRefresh[key] = true
|
} else {
|
this.tabRefresh[key] = false
|
}
|
}
|
},
|
showDocEditDialog(params){
|
this.$emit('showDocEditDialog',params)
|
},
|
showProcessAddDialog(){
|
this.$emit('showProcessAddDialog')
|
},
|
showProcessEditDialog(params){
|
this.$emit('showProcessEditDialog',params)
|
},
|
showUploadDialog(params){
|
this.$emit('showUploadDialog',params)
|
},
|
setIndex(msg){
|
this.nodeData = msg;
|
this.$emit('indexChange', this.nodeData); // 调用父组件传递过来的方法,同时把数据传递出去
|
},
|
setInd(msg){
|
this.nodeDataC = msg;
|
this.$emit('indexChange', this.nodeDataC); // 调用父组件传递过来的方法,同时把数据传递出去
|
},
|
setInds(msg){
|
this.nodeDataO = msg;
|
this.$emit('indexChange', this.nodeDataO); // 调用父组件传递过来的方法,同时把数据传递出去
|
}
|
},
|
//监听
|
watch:{
|
nodeData:{
|
deep: true, // 深度监听
|
handler(newValue, oldValue) {
|
this.nodeData = newValue;
|
}
|
},
|
nodeDataO:{
|
deep: true, // 深度监听
|
handler(newValue, oldValue) {
|
this.nodeDataO = newValue;
|
}
|
},
|
nodeDataC:{
|
deep: true, // 深度监听
|
handler(newValue, oldValue) {
|
this.nodeDataC = newValue;
|
}
|
},
|
},
|
deactivated(){
|
this.$destroy('FileTab');
|
},
|
mounted(){
|
|
}
|
}
|
</script>
|
|
<style scoped>
|
|
</style>
|