<script lang="ts" setup>
    import { ref } from 'vue';
    import { FormInstance } from 'element-plus';
    import { rules } from '${columnsPath}';
    import { FormProps } from '${typesPath}';
    import { frameSureOptions } from '@/enums';
    import { $t } from '@/plugins/i18n';

    const props = withDefaults(defineProps<FormProps>(), {
        formInline: () => ({
#foreach($item in $baseFieldList)
    #if(${item.name})
        // $!{item.annotation}
        ${item.name}: undefined,
    #end
#end
        }),
    });

    const formRef = ref<FormInstance>();
    const form = ref(props.formInline);

    defineExpose({ formRef });
</script>

<template>
    <el-form ref="formRef" :model="form" :rules="rules" label-width="auto">
#foreach($item in $baseFieldList)

        <!-- $item.annotation -->
        <el-form-item :label="$t('${lowercaseName}_${item.name}')" prop="$item.name">
            <el-input v-model="form.$item.name" autocomplete="off" type="text" :placeholder="$t('input') + $t('${lowercaseName}_${item.name}')" />
        </el-form-item>
#end
    </el-form>
</template>
