<template>
	<div class="box boxMinHeight">
		<el-tabs v-model="name">
			<el-tab-pane :label="item.label" :name="item.name" v-for="(item, index) in tabs" :key="index">
				<Framework v-if="item.name == 'framework'" ref="framework" :boxName="item.name"></Framework>
				<JurisdictionSet v-if="item.name == 'jurisdictionSet'" ref="jurisdictionSet" :boxName="item.name"></JurisdictionSet>
			</el-tab-pane>
		</el-tabs>
	</div>
</template>

<script>
import Framework from '@/views/userSet/framework';
import JurisdictionSet from '@/components/set/JurisdictionSet';
export default {
	name: 'userSet',
	components: { JurisdictionSet, Framework },
	data() {
		return {
			name: 'framework',
			tabs: []
		};
	},
	activated() {
		console.log("123")
	},
	created() {
		this.setMenu();
		console.log(this.$route.query);
	},
	methods: {
		setMenu() {
			let tabs = [];
			tabs.push({ label: '可用人员', name: 'framework' });
			if (this.$getUserData().permission_info.main == 1) {
				tabs.push({ label: '权限设置', name: 'jurisdictionSet' });
			}
			this.name =this.$route.query.name? this.$route.query.name:tabs[0].name;
			this.tabs = tabs;
		}
	},
};
</script>

<style scoped="scoped">
.box {
	padding: 20px;
	font-size: 14px;
	background-color: #fff;
}
</style>
