<template>
    <simple-form
        :items="formItems"
        ref="formRef"
        label-width="120px"
        :footer="true"
        @submit="handleSubmit"
    />
</template>

<script setup name="baseConfig">
    import { ref, shallowRef } from 'vue';
    import SimpleForm from '@/components/CommonPage/SimpleForm.vue';

    const formRef = ref(null);
    const formItems = shallowRef([
        {
            type: 'imageUpload',
            label: '后台LOGO',
            prop: 'logoImage',
            required: true,
            props: { limit: 1, tips: '支持.jpg .png 格式，建议上传50*50尺寸' }
        },
        {
            type: 'imageUpload',
            label: '登录背景',
            prop: 'backgroundImage',
            required: true,
            props: { limit: 1, tips: '支持.jpg .png 格式，建议上传50*50尺寸' }
        },
        {
            type: 'imageUpload',
            label: '浏览器图标',
            prop: 'browserIcon',
            required: true,
            props: { limit: 1, tips: '支持.jpg .png 格式，建议上传50*50尺寸' }
        }
    ]);

    function handleSubmit(data) {
        console.log(data);
    }
</script>
