<template>
  <a-form ref="formRef" :model="form" :rules="rules" layout="vertical">
    <a-row :gutter="20">
      <a-col :span="24">
        <a-form-item label="表单名称:" name="formModelName">
          <a-input v-model:value="form.formModelName" allow-clear placeholder="请输入表单名称" />
        </a-form-item>
      </a-col>
      <a-col :span="12">
        <a-form-item label="表单编码:" name="formModelCode">
          <a-input v-model:value="form.formModelCode" allow-clear placeholder="请输入表单编码" />
        </a-form-item>
      </a-col>
      <a-col :span="12">
        <a-form-item label="系统编码:" name="systemCodeShow">
          <a-input v-model:value="form.systemCodeShow" allow-clear placeholder="请输入系统编码" disabled />
        </a-form-item>
      </a-col>
      <a-col :span="12">
        <a-form-item label="排序:" name="fldSort">
          <a-input-number
            v-model:value="form.fldSort"
            :min="0"
            style="width: 100%"
            placeholder="请输入排序"
            allow-clear
            autocomplete="off"
          />
        </a-form-item>
      </a-col>
      <a-col :span="12">
        <a-form-item label="是否是流程表单" name="flowFlag">
          <a-radio-group v-model:value="form.flowFlag">
            <a-radio value="Y">是</a-radio>
            <a-radio value="N">否</a-radio>
          </a-radio-group>
        </a-form-item>
      </a-col>
      <a-col :span="24">
        <a-form-item label="备注">
          <a-textarea v-model:value="form.description" placeholder="请输入备注" :rows="4" />
        </a-form-item>
      </a-col>
    </a-row>
  </a-form>
</template>

<script setup name="FormSheetForm">
import { reactive } from 'vue';

const props = defineProps({
  // 表单数据
  form: Object,
  isUpdate: Boolean
});

// 验证规则
const rules = reactive({
  formModelName: [{ required: true, message: '请输入表单名称', type: 'string', trigger: 'blur' }],
  formModelCode: [{ required: true, message: '请输入表单编码', type: 'string', trigger: 'blur' }],
  systemCodeShow: [{ required: true, message: '请输入系统编码', type: 'string', trigger: 'blur' }],
  fldSort: [{ required: true, message: '请输入排序', type: 'number', trigger: 'blur' }],
  flowFlag: [{ required: true, message: '请选中是否是流程表单', type: 'string', trigger: 'blur' }]
});
</script>

<style></style>
