<template>
  <ProForm ref="formRef" :items-options="items" :model="model" :form-options="_formOptions"> </ProForm>
</template>
<script lang="ts" name="GenBasicInfo" setup>
import { defineProps, ref } from 'vue'
import ProForm from '@/components/ProForm/index.vue'
const formRef = ref<InstanceType<typeof ProForm> | null>(null)
defineProps({
  model: {
    type: Object,
    default: null
  }
})
const _formOptions = {
  hasFooter: false
}
let items: ProForm.ItemsOptions[] = [
  {
    label: '表名称',
    prop: 'tableName',
    span: 12,
    rules: [{ required: true, message: '表名称不能为空', trigger: 'blur' }],
    compOptions: {
      elTagName: 'input',
      clearable: true,
      placeholder: '请输入表名称'
    }
  },
  {
    label: '表描述',
    prop: 'tableComment',
    span: 12,
    rules: [{ required: true, message: '表描述不能为空', trigger: 'blur' }],
    compOptions: {
      elTagName: 'input',
      clearable: true,
      placeholder: '请输入表描述'
    }
  },
  {
    label: '实体类名称',
    prop: 'className',
    span: 12,
    rules: [{ required: true, message: '实体类名称不能为空', trigger: 'blur' }],
    compOptions: {
      elTagName: 'input',
      clearable: true,
      placeholder: '请输入实体类名称'
    }
  },
  {
    label: '作者',
    prop: 'functionAuthor',
    span: 12,
    rules: [{ required: true, message: '作者不能为空', trigger: 'blur' }],
    compOptions: {
      elTagName: 'input',
      clearable: true,
      placeholder: '请输入作者'
    }
  },
  {
    label: '备注',
    prop: 'remark',
    compOptions: {
      elTagName: 'input',
      type: 'textarea',
      rows: 4,
      clearable: true,
      placeholder: '请输入备注'
    }
  }
]
defineExpose({
  formRef
})
</script>
