<!--检查记录-->
<template>
    <view id="safetyInspect">
		<view class="tabTitle" v-if="userType==1">
			<view class="tabTitle_li" @tap="tabClick(index)"  :key="index" v-for="(item,index) in tabText">
				<view :class="{on:curTab==index}" class="tabTitle_text">{{item}}</view>
			    <view :class="{on:curTab==index}" class="tabTitle_across"></view>
			</view>
		</view>
		<inspection-records ref="child" v-if="pageType==0" style="display: flex;flex: 1;overflow-y: auto;"></inspection-records>
		<rectify-list ref="child" v-if="pageType==1" style="display: flex;flex: 1;overflow-y: auto;"></rectify-list>
	</view>
</template>

<script>
	import { inspectionRecords } from '@/pages_manage/workbench/securityCheck/inspectionRecords.vue'
	import { rectifyList } from '@/pages_manage/workbench/problemRectification/rectifyList.vue'
    export default {
		components: {
			inspectionRecords,
		    rectifyList,
		},
        name: "safetyInspect",
        data() {
            return {
				userType:uni.getStorageSync('userType'),
				pageType:0,
				curTab:0,
				tabText:['检查记录','问题整改',],

            }
        },
        onLoad() {

			//判断如果是学生端进入只显示问题整改
			if(this.userType==2){
				this.pageType=1
			}
        },
        onShow() {
			this.dataList=[];
		    uni.removeStorageSync('First')
			this.$refs.child.getList()

        },
		mounted(){

			
		},
        methods: {
			//顶部tab点击
			tabClick(index) {
				this.curTab = index;

				this.pageType=index;

			},

        }
    }
</script>

<style lang="stylus" scoped>
    #safetyInspect {
        height: 100%;
        width: 100%;
		flex :1;
        display flex;
        flex-direction column
        overflow hidden
		.tabTitle{
			display flex;
			width:100%;
			height: 100rpx;
			background: #fff;
			margin-bottom 16rpx;

			.tabTitle_li{
				width:146rpx;
				text-align center;
				.tabTitle_text{
					display: inline-block;
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
					line-height: 70rpx;
					&.on{
						color:#0183FA;
					}
				}
				.tabTitle_across{
					width: 80rpx;
					height: 5rpx;
					background: #0183FA;
					border-radius: 3rpx;
					margin-left 34rpx;
					display none;
					&.on{
						display block;
					}
				}

			}


		}

	}
</style>
