<template>
	<view class="content-wrap">
		<view class="title-wrap">
			<text>{{item.name?item.name:item.departmentName}}</text>
			<view>
				<image src="../../static/icon-map.png"></image>
				<text>{{item.deptClassName}}</text>
			</view>
		</view>
		<view class="content">
			<text>包含{{pointCount}}个查核要点，{{itemCount}}个查核项目</text>
			<text>
				要点概览：
				<text v-for="(point, c) in item.pointList" :key="c">
					{{point.name}}；
				</text>
			</text>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['item'],
		computed: {
			pointCount: function() {
				let num = 0;
				(this.item.pointList || []).map(({selectFlag})=>{
					if(selectFlag || selectFlag === 'true') {
						num++;
					}
				})
				return num;
			},
			itemCount: function() {
				let num = 0;
				(this.item.pointList || []).map(({itemList})=>{
					itemList.map(({selectFlag})=>{
						if(selectFlag || selectFlag === 'true') {
							num++;
						}
					});
				});
				return num;
			}
		}
	}
</script>
