<template>
    <fs-page>
        <fs-crud ref="crudRef" v-bind="crudBinding">
             <!-- 自定义查看对话框底部 -->
                <template #view-dialog-footer="{ dialog }">
                <div v-if="dialog.type !== 'view'">
                    <!-- 仅非查看模式显示默认按钮 -->
                    <el-button @click="dialog.close">取消</el-button>
                    <el-button type="primary" @click="dialog.submit">确定</el-button>
                </div>
                <!-- 查看模式不显示任何按钮 -->
                </template>
        </fs-crud>
    </fs-page>
</template>

<script lang="ts" setup name="whiteList">
import {ref, onMounted} from 'vue';
import {useFs} from '@fast-crud/fast-crud';
import {createCrudOptions} from './crud';

const {crudBinding, crudRef, crudExpose} = useFs({createCrudOptions});

// 页面打开后获取列表数据
onMounted(() => {
    crudExpose.doRefresh();
});
</script>
