<template>
	<c-scroll-paging
		refresherBackground="#f8f8f8"
		:queryList="queryList"
		v-model="rows"
		class="list-content"
	>
		<itemCell
			:item="item"
			:type="type"
			v-for="item in rows"
			:key="item.id"
			@approval="$emit('approval', $event)"
			@click="openDetail"
		></itemCell>
	</c-scroll-paging>
</template>

<script>
import itemCell from './itemCell.vue';
import { processList } from '@/api/approval/index.js';

export default {
	name: 'listContent',
	components: {
		itemCell,
	},
	props: {
		type: Number, // 0我发起,1我审批,2抄送人
	},
	data() {
		return {
			rows: [],
		};
	},
	methods: {
		openDetail(id) {
			uni.$u.route('/pages/waitHandle/approvalDetail/index', {
				id,
				type: this.type, // 0我发起,1我审批,2抄送人
			});
		},
		async queryList(e) {
			const params = {
				...e,
				type: this.type,
			};
			const res = await processList(params);
			return res;
		},
	},
};
</script>

<style scoped lang="scss">
.list-content {
}
</style>
