﻿<template>
  <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose title="密炼机动作状态" :width="1200">
    <BasicForm @register="registerForm" />
  </BasicModal>
</template>

<script lang="ts" setup>
  import { BasicModal, useModalInner } from '/@/components/Modal';
  import { BasicForm, useForm } from '/@/components/Form/index';
  import { formSchema } from '../McsToMesMixAct.data';

  defineEmits(['register']);

  const [registerForm, { resetFields, setFieldsValue, setProps }] = useForm({
    labelWidth: 120,
    schemas: formSchema,
    showActionButtonGroup: false,
    baseColProps: { span: 12 },
    disabled: true,
  });

  const [registerModal, { setModalProps }] = useModalInner(async (data) => {
    await resetFields();
    setModalProps({ confirmLoading: false, showOkBtn: false, showCancelBtn: true, cancelText: '关闭' });
    if (data?.record) {
      await setFieldsValue({ ...data.record });
    }
    setProps({ disabled: true });
  });
</script>
