entity.vue 1.2 KB
<template>
  <div class="tenant-class">
    <BasicForm @register="registerForm" />
  </div>
</template>
<script lang="ts">
  import { defineComponent, ref } from 'vue';
  import { BasicForm, useForm } from '/@/components/Form';
  import { entityFormSchema } from './config';

  export default defineComponent({
    name: 'Index',
    components: { BasicForm },
    emits: ['success', 'register', 'funcResetFields'],
    setup() {
      const getValueData: any = ref({});
      const [registerForm, { getFieldsValue, resetFields, setFieldsValue }] = useForm({
        schemas: entityFormSchema,
        showActionButtonGroup: false,
      });
      const setFieldsValueFunc = (v) => {
        setFieldsValue(v);
      };
      function getAllFields(getV) {
        const values = getFieldsValue();
        getValueData.value = values;
        getV = getValueData.value;
        return getV;
      }
      function funcResetFields() {
        resetFields();
      }
      return {
        setFieldsValueFunc,
        funcResetFields,
        getAllFields,
        registerForm,
      };
    },
  });
</script>
<style lang="less" scoped>
  .tenant-class {
    :deep(.ant-input-number) {
      width: 95% !important;
    }
  }
</style>