<template>
	<fs-page>

		<fs-crud ref="crudRef" v-bind="crudBinding">
			</fs-crud>
			<RefuseNotification/>

		<!-- <BorrowApprovalDialog ref="approvalDialogRef" @approved="crudExpose.doRefresh()" /> -->
	</fs-page>
</template>

<script lang="ts" setup name="approval">
import { onMounted,ref ,provide} from 'vue';
import { useFs } from '@fast-crud/fast-crud';
import { createCrudOptions } from './curd';
import { ElMessage } from 'element-plus';
import { BorrowingReview } from './api';
// import BorrowApprovalDialog from './BorrowApprovalDialog/index.vue';
import RefuseNotification from './RefuseNotification/index.vue';


// const { crudBinding, crudRef, crudExpose, crudOptions, resetCrudOptions } = useFs({ createCrudOptions });
const showRejectDialog = ref(false);
const rejectReason = ref('');
const currentFormId = ref(null);

const { crudBinding, crudRef, crudExpose } = useFs({
  createCrudOptions: (props) =>
    createCrudOptions({
      ...props,
      showRejectDialog,
      rejectReason,
      currentFormId
    })
});




provide('showRejectDialog', showRejectDialog);
provide('rejectReason', rejectReason);
provide('currentFormId', currentFormId);
provide('crudExpose', crudExpose);




onMounted(() => {
	crudExpose.doRefresh();
});
</script>

<style scoped lang="scss"></style>
