<template>
	<view class="content">
		<view v-if="list.data.length<=0" style="text-align: center;width: 100%;">暂无更多数据</view>
		<view v-if="list.data.length>0" class="page-list-box">
			<view class="list-item" v-for="(item,index) in list.data">
				<view class="list-row flex-par">
					<view class="list-field">被检查单位：</view>
					<view class="list-field-value slh">{{item.orgName}}</view>
				</view>
				<view class="list-row flex-par">
					<view class="list-field">违章级别：</view>
					<view class="list-field-value">{{item.level}}</view>
				</view>
				<view class="list-row flex-par">
					<view class="list-field">具体问题：</view>
					<view class="list-field-value slh">{{item.description}}</view>
				</view>
				<view class="list-row flex-par">
					<view class="list-field">检查时间：</view>
					<view class="list-field-value">{{item.createTime}}</view>
					<button type="primary" style="width:100px;height:20px;font-size:12px;margin-top: 7px;margin-left: 5px;line-height: 20px;" @click="toDetail(item.id)">详情</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
    import { onMounted, reactive, ref ,toRaw} from 'vue';
    import { onLoad,onBackPress } from "@dcloudio/uni-app";
    import REQUEST from "/common/request.js";
	onLoad((option)=>{
		initDatas();
	})
	let index = ref(0);
	const list = reactive({
		data:[]
	})

	const initDatas = async ()=>{
		let res = await REQUEST.get("/bigScreen/peccancy/list");
		console.log(res);
		list.data = res;
	}
	 const toDetail = (businessId)=>{
		 console.log("businessId："+businessId);
		 uni.navigateTo({
		 	url:("/pages/baoguang/weizhangxiangqing?businessId="+businessId)
		 })
	 }
</script>

<style>
	.content {
		
	}

	.search-box {
		border-bottom: 1rpx solid #eee;
		width: 750rpx;
	}

	.search-input-black {
		width: 660rpx;
		height: 80rpx;
		line-height: 80rpx;
		background-color: rgba(242, 242, 242, 1);
		padding: 0 20rpx;
		margin: 20rpx auto;
		border-radius: 40rpx;
	}

	.search-picker {
		display: inline-block;
		text-align: center;
		height: 80rpx;
		line-height: 80rpx;
	}
    
	.search-item{
		display: inline-block;
		width: 120px;
	}
	.sanjiao {
		display: inline-block;
		color: gray;
	}
</style>