DeviceProfileStep4.vue 1.27 KB
<template>
  <div>
    <span>请选择告警通知联系人:</span>
    <Tag v-for="(item, index) in 15" closable :key="index"> 冯涛+{{ item }}</Tag>
    <BasicForm :showSubmitButton="false" @register="register" />
  </div>
</template>
<script lang="ts">
  import { defineComponent, ref } from 'vue';
  import { Tag } from 'ant-design-vue';
  import { BasicForm, useForm } from '/@/components/Form/index';
  import { alertContactsSchemas } from '../cpns/config';

  export default defineComponent({
    components: {
      Tag,
      BasicForm,
    },
    emits: ['prev'],
    setup(_, { emit }) {
      const getValueData: any = ref({});
      const [register, { setProps, validate }] = useForm({
        schemas: alertContactsSchemas,
        actionColOptions: {
          span: 24,
        },
        resetButtonOptions: {
          text: '上一步',
        },
        resetFunc: customResetFunc,
      });
      async function customResetFunc() {
        emit('prev');
      }
      async function getAllFields(getV) {
        const values = await validate();
        getValueData.value = values;
        getV = getValueData.value;
        return getV;
      }
      return {
        customResetFunc,
        getAllFields,
        register,
        setProps,
      };
    },
  });
</script>