<script lang="ts" setup>
import {ref} from 'vue';
import {FormInstance} from 'element-plus';
import { ${classUppercaseName}Info } from '@/types${webBasePath}/${classLowercaseName}/${classLowercaseName}DataType';
import { rules } from '../utils/${classLowercaseName}-columns';
import {FormInline} from '../utils/hook';

  const props = withDefaults(defineProps<FormInline>(), {
    formInline: () => ({
        #foreach($item in $columnInfoList)
    #if(${item.lowercaseName})
          // $!{item.comment}
        ${item.lowercaseName}: 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 $columnInfoList)

        <!-- $item.comment -->
        <el-form-item label="${comment}" prop="$item.lowercaseName">
          <el-input v-model="form.$item.lowercaseName" autocomplete="off" type="text"
                    placeholder="输入${item.comment}"/>
        </el-form-item>
      #end
  </el-form>
</template>
