<template>
  <div style="margin-left: -5vw">
    <BasicForm :showResetButton="false" :showSubmitButton="false" @register="registerServer" />
  </div>
</template>
<script setup lang="ts">
  import { BasicForm, useForm } from '/@/components/Form';
  import { serverSchemas } from '../index';

  const [registerServer, { getFieldsValue, setFieldsValue, resetFields }] = useForm({
    labelWidth: 180,
    schemas: serverSchemas,
    actionColOptions: {
      span: 14,
    },
  });
  //回显表单值
  const editBootStrapFormFunc = (v) => {
    setFieldsValue(v);
  };

  const getBootStrapFormFunc = () => {
    const value = getFieldsValue();
    if (!value) return;
    return value;
  };
  const resetFormData = () => resetFields();
  defineExpose({
    getBootStrapFormFunc,
    editBootStrapFormFunc,
    resetFormData,
  });
</script>
<style lang="less" scoped></style>
