<template>
	<view class="list-body">
		<uni-nav-bar @clickLeft="goBack()" class="nav-bar" height="110rpx" leftWidth="400rpx" leftText="添加作业许可证"
			leftIcon="left" border backgroundColor="#2cade8" color="#fff" fixed statusBar shadow></uni-nav-bar>
		<view class="apply-info">
			<view class="uni-list-cell uni-list-cell-pd" v-for="row in oplCateList" :key="row.id">
				<view>
					<view class="name" @click="addCate(row)">{{row.name}}</view>
				</view>
			</view>
			<!-- <checkbox-group @change="checkboxChange">
				<label class="uni-list-cell uni-list-cell-pd" v-for="row in oplCateList" :key="row.id">
					<view>
						<checkbox :value="row.value" :checked="row.checked" />
					</view>
					<view>
						<view class="name">{{row.name}}</view>
					</view>
				</label>
			</checkbox-group> -->
		</view>
		<!-- <view class="add">
			<view class="btn">
				<button type="primary" class="save-btn" @click="add">添加许可证</button>
			</view>
		</view> -->
	</view>
</template>

<script>
	export default {
		name: "oplCate",
		data() {
			return {
				formData: {
					name: '',
				},
				oplCateList: [],
			}
		},
		onLoad(params) {
			debugger;
			console.log(params)
			this.operationId = params.operationId;
		},
		onShow() {
			this.getOplCate();
		},
		methods: {
			//获取用户
			getOplCate() {
				this.$u.api.oplCate({
					page: 0
				}).then(res => {
					debugger;
					console.log(res)
					this.oplCateList = res;
				})
			},
			addCate(row) {
				const params = `?oplcateId=${row.id}&operationId=${this.operationId}&type='add'`;
				uni.navigateTo({
					url: '../opls/fire' + params
				})
			},
			select(row) {},
			goBack() {
				uni.navigateBack({
					delta: 1
				})
			},

			add() {
				uni.navigateTo({
					url: '../opls/fire'
				})
			},
			edit(row) {},
		}
	}
</script>

<style>
	>>>.uni-navbar__header,
	>>>.uni-status-bar {
		background-image: linear-gradient(90deg, #164cc3 0%, #2c6fd9 100%), linear-gradient(#e60012, #e60012) !important;
	}

	.list-body {
		background-color: #f3fbff;
		padding-bottom: 113px;
	}

	.apply-info {
		min-height: 70vh;
		width: 360px;
		margin: 0 auto;
		background-color: #FFFFFF;
		border-radius: 5px;
		padding: 12px 16px;
		box-sizing: border-box;
		margin-top: 12px;
	}

	.row {
		padding: 10upx;
		margin-bottom: 20upx;
		border-bottom: 1upx solid #eeeeee;
	}

	.uni-list-cell {
		display: flex;
		padding: 10upx;
		margin-bottom: 20upx;
		padding: 30upx 0;

		border-bottom: 1upx solid #eeeeee;
	}

	.add {
		position: fixed;
		bottom: 0;
		width: 100%;
		height: 120upx;
		justify-content: center;
		align-items: center;
	}

	.btn {
		margin: auto;
		box-shadow: 0upx 5upx 10upx rgba(0, 0, 0, 0.4);
		width: 70%;
	}

	.save-btn {
		height: 80rpx;
		color: #fff;
		font-size: 30upx;
		justify-content: center;
		align-items: center;
	}
</style>
