<template>
  <BasicModal
    @register="registerModal"
    width="600px"
    :title="title"
    v-bind="$attrs"
    @ok="handleSubmit"
  >
    <div>
      <BasicForm @register="registerForm" />
    </div>
  </BasicModal>
</template>
<script lang="ts" setup>
  import { BasicModal, useModalInner } from '/@/components/Modal';
  import { BasicForm, useForm } from '/@/components/Form/index';
  import { eventTypeFormSchema } from './eventTypeForm.data';
  import { computed } from 'vue';
  const props = defineProps({
    isEdict: {
      type: Boolean,
      default: false,
    },
  });
  const title = computed(() => (props.isEdict ? '编辑' : '新增') + '事件类型');

  const [registerModal, { closeModal }] = useModalInner();
  const [registerForm] = useForm({
    labelWidth: 80,
    schemas: eventTypeFormSchema,
    showActionButtonGroup: false,
    actionColOptions: {
      span: 18,
    },
  });
  function handleSubmit() {
    closeModal();
  }
</script>
<style lang="less" scoped></style>
