<template>
  <a-form ref="formRef" :model="form" :rules="rules" layout="vertical">
    <a-row :gutter="20">
      <a-col :xs="24" :sm="24" :md="24">
        <a-form-item label="字典类型名称:" name="dictTypeName">
          <a-input v-model:value="form.dictTypeName" allow-clear placeholder="请输入字典类型名称" />
        </a-form-item>
      </a-col>
      <a-col :xs="24" :sm="24" :md="18">
        <a-form-item label="字典类型编码:" name="dictTypeCode">
          <a-input v-model:value="form.dictTypeCode" allow-clear placeholder="请输入字典类型编码" :disabled="props.isUpdate" />
        </a-form-item>
      </a-col>
      <a-col :xs="24" :sm="24" :md="6">
        <a-form-item label="排序:" name="dictTypeSort">
          <a-input-number
            v-model:value="form.dictTypeSort"
            :min="0"
            style="width: 100%"
            placeholder="请输入排序"
            allow-clear
            autocomplete="off"
          />
        </a-form-item>
      </a-col>
    </a-row>
  </a-form>
</template>

<script setup name="UserDictTypeForm">
import { onMounted, reactive } from 'vue';

const props = defineProps({
  // 表单数据
  form: Object,
  isUpdate: Boolean,
  linkWorkItemData: Object,
  type: {
    type: String,
    default: 'app'
  }
});

// 验证规则
const rules = reactive({
  businessId: [{ required: true, message: '请选择所属业务', type: 'string', trigger: 'blur' }],
  dictTypeName: [{ required: true, message: '请输入字典类型名称', type: 'string', trigger: 'blur' }],
  dictTypeCode: [{ required: true, message: '请输入字典类型编码', type: 'string', trigger: 'blur' }],
  dictTypeSort: [{ required: true, message: '请输入排序', type: 'number', trigger: 'blur' }]
});

onMounted(() => {
});

</script>

<style></style>
