index.vue 2.19 KB
<template>
		<el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
			<el-tab-pane label="分割" name="fg"><fg ref="fg" v-if="fgLoad"></fg></el-tab-pane>
			<el-tab-pane label="合并" name="hb"><hb ref="hb" v-if="hbLoad"></hb></el-tab-pane>
			<el-tab-pane label="范围属性变更" name="fwsxbg"><fwsxbg v-if="fwsxbgLoad"></fwsxbg></el-tab-pane>
			<el-tab-pane label="重新落宗" name="cxlz"><cxlz v-if="cxlzLoad"></cxlz></el-tab-pane>
		</el-tabs>
</template>

<script>
import fg from "./fg";
import hb from "./hb";
import fwsxbg from "./fwsxbg";
import cxlz from "./cxlz";
export default {
	name: "",
	components: {
        fg,hb,fwsxbg,cxlz
    },
	props: {},
	data() {
		return {
			activeName: "fg",
			fgLoad:true,
			hbLoad:false, //默认不加载合并tab
			fwsxbgLoad:false, //默认不加载范围属性变更tab
			cxlzLoad:false, //默认不加载重新落宗tab
		};
	},
	methods: {
		handleClick(tab) {
			// this.$refs.fg.$refs.isSearch = true;
			if (tab.name != 'fg') {
				this.fgLoad = false;
			}
			if (tab.name != 'hb') {
				this.hbLoad = false;
			}
			if(!this.hbLoad){
				this.hbLoad = tab.name == 'hb' ? true : false
			}
			if(!this.fgLoad){
				this.fgLoad = tab.name == 'fg' ? true : false
			}
			if(!this.fwsxbgLoad){
				this.fwsxbgLoad = tab.name == 'fwsxbg' ? true : false
			}
			if(!this.cxlzLoad){
				this.cxlzLoad = tab.name == 'cxlz' ? true : false
			}
		},
	},
	created() {},
	mounted() {
		if (this.$route.query.oLevel) {
			this.activeName = this.$route.query.oLevel;
			this.handleClick({name:this.$route.query.oLevel});
			this.$nextTick(()=>{
				if (this.$route.query.oLevel == 'hb') {
					this.$refs.hb.tabName = this.$route.query.tLevel;
				}else{
					this.$refs.fg.tabName = this.$route.query.tLevel;
				}
			})
		}
	},
	computed: {},
	watch: {},
};
</script>
<style scoped lang="less">
	.el-tabs{
		height: calc(100% - 50px);
		/deep/.el-tabs__content{
			height: 100%;
			position: unset;
			/deep/.el-tab-pane{
				height: calc(100% - 40px);
			}
			//background: #eaedf5;
			background-color: rgb(245, 250, 254);
			padding: 0;
		}
		/deep/ .el-tabs__item {
			height: 48px;
		}
		/deep/ .el-tabs__header{
			background-color: #ffffff;
		}
	}
</style>