<template>
	<div class="inner-container">
		<el-col :span="24" style="padding:20px">
			<div style="height: 100%">
				<router-view />
			</div>
		</el-col>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				activeName: "",
				showList: [],
				routerList: [
					{
						label: "在线文档管理",
						path: "/fileList",
						name: "fileList",
						sts:0,
						num:0
					},
				],
			};
		},
		computed: {
			menuList: function() {
				let arr = [];
				this.routerList.map((item) => {
					// arr.push(item);
					this.showList.map((row) => {
						if (item.path == row.jspUrl && row.systemflag == '1') {
							arr.push(item);
						}
					});
				});
				return arr;
			},
		},
		methods: {
			handleClick(val) {
				this.activeName = val.path;
				for (let i = 0; i < this.routerList.length; i++) {
					this.routerList[i].sts = 0;
				}
				val.sts = 1;
				if (this.$route.path != this.activeName) {
					this.$router.push(this.activeName);
				}
				this.getnunm();
			},
			getnunm(){
				this.$http({
					url: "/market/filepreTask/queryTaskToDoNumByFunc",
					method: "post",
					headers: {
						"Content-Type": "application/json",
					},
					data: {},
				}).then((res) => {
					for (let i = 0; i < res.data.length; i++) {
						if(res.data[i].funcCode == '1000'){
							this.routerList[2].num = res.data[i].taskNum;
						}
						if(res.data[i].funcCode == '1001'){
							this.routerList[0].num = res.data[i].taskNum;
						}
						if(res.data[i].funcCode == '1003'){
							this.routerList[3].num = res.data[i].taskNum;
						}
						if(res.data[i].funcCode == '1004'){
							this.routerList[1].num = res.data[i].taskNum;
						}
					}
				});
			}
		},
		mounted() {
			this.activeName = this.$route.path;
		},
		created() {
			JSON.parse(sessionStorage.childrenMenus).map((item) => {
				this.showList.push(item);
			});
			this.getnunm();
		},
		watch: {
			$route(to, from) {
				this.activeName = this.$route.path;
			},
		},
	};
</script>
<style>
	.el-tabs__content {
		display: none;
	}
	.spanbox {
    display: inline-block;
    text-align: center;
    width: 166px;
    height: 36px;
    margin: 10px;
    line-height: 36px;
    background: #d8eaf6;
    color: #000;
  }
  .bg {
    color: white;
    background: #0583cd;
  }
</style>
