<template>
	<div style="overflow-y: auto">
		<a-layout>
			<myResources ref="myResourcesRef" pageType="economize" @handlerAudit="handlerAudit" />
		</a-layout>
		<a-modal v-model:visible="modalVisible" :title="'资源审核'" width="1210px" :footer="null" :destroyOnClose="true">
			<resourceDetails ref="resourceDetailsRef" :isState="1" :isAudit="1" @auditComplete="closeModal" />
		</a-modal>
	</div>
</template>

<script setup>
	import myResources from '../myResources/myResources.vue'
	import resourceDetails from '@/views/resourceDetails/index.vue'
	import { ref } from 'vue'
	import { resourceAuditStore } from '@/store/resourceAudit'

	const modalVisible = ref(false)
	const resourceDetailsRef = ref(null)
	const currentAuditData = ref(null)
	const auditStore = resourceAuditStore()
	const myResourcesRef = ref(null)

	const handlerAudit = (data) => {
		currentAuditData.value = data
		modalVisible.value = true
		// 使用store存储审核参数，而不是路由传参
		auditStore.setAuditParams(data)
	}

	const closeModal = () => {
		myResourcesRef.value.getListData()
		modalVisible.value = false
	}
</script>

<style scoped>
	.content {
		border: 1px solid #00000011; /* 灰色细边框 */
	}
	.scroll-container {
		height: 100vh;
		overflow-y: auto;
	}
</style>
