<template>
	<view class="concent-footer">
		<view class="content-box">
			<view class="content-box-title" v-for="item in datatitleList">
				<span class="title">{{item}}</span>
			</view>
		</view>
		<!-- //  一级循环 -->
		<view class="content-sam-box">
			<view class="" v-for="(pointItem,index) in dataList" :key="index">
				<view class="" style="display: flex;">
					<view class="content-box-title" v-if="pointItem.title" @click="subordinate(index)">
						<span>{{pointItem.title}}</span>
					</view>
					<view class="content-box-title" v-if="pointItem.rank">
						<span>{{pointItem.rank}}</span>
					</view>
					<view class="content-box-title" v-if="pointItem.name">
						<span>{{pointItem.name}}</span>
					</view>
					<view class="content-box-title" v-if="pointItem.name">
						<span>{{pointItem.name}}</span>
					</view>
				</view>

				<!-- 二级循环 -->
				<view class="" v-if="table_index == index && this.tableone == true">
					<view class="" v-for="(itq, index) in dtList">
						<view  style="display: flex;">
							<view class="content-box-title-a" @click="cktable(itq)">
								<span style="color: #FFFFFF;font-weight: 400;">{{itq.name}}</span>
							</view>
							<view class="content-box-title">
								<span>{{itq.name}}</span>
							</view>
							<view class="content-box-title">
								<span>{{itq.name}}</span>
							</view>
						
						</view>
						<!-- 三级循环 -->
						<view class="" v-if="tablesubordinate == itq.id">
							<view class="" v-for="(itq, index) in dtList">
								<span>{{itq.name}}</span>
							</view>
						</view>
					</view>
		
				
				</view>
		
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		props: {
			dataList: {
				type: Array
			},
			datatitleList: {
				type: Array
			},
			tabletype: {
				type: String
			}
		},
		name: "myteam-table",
		data() {
			return {
				table_index: '', // 第一级
				tableone: false,
				tablesubordinate:'', // 第二级
				dtList: [{
						name: '测试二级服务中心',
						id: 1,
					},
					{
						name: '第二',
						id: 2,
					}
				]
			};
		},
		mounted() {
			console.log(this.dataList, 741741)
		},
		methods: {
			cktable(e) {
				this.tablesubordinate = e.id
			},
			subordinate(index) {
				if(this.tabletype == 1) {
					return true
				}
				this.tableone = this.table_index == index ? !this.tableone : true
				this.table_index = index
			}
		}
	}
</script>

<style scoped>
	.content-box {
		background-color: #fff;
		display: flex;
		font-weight: 600;
		align-items: center;
		justify-content: space-between;
	}

	.content-box-title {
		padding: 5px 0;
		flex: 1;
		justify-content: space-between;
		align-items: center;
	}

	.content-sam-box {
		/* 		background-color: #fff;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 10px 0;
		color: #333333;
		border-bottom: 1px solid #F2F2F2;; */
		font-size: 13px;
	}

	.concent-footer {
		margin: 0 5px;
	}
	.content-box-title-a{
		padding: 5px 0;
		flex: 1;
		background: #3F52B7;
		border-radius: 5px;
		border: 1px solid #fff;
	}
</style>
