DeviceProfileStep4.vue 2.69 KB
<template>
  <div class="step-4">
    <div v-if="isShow">
      <BasicForm :showResetButton="false" :showSubmitButton="false" @register="register" />
    </div>
    <div
      style="
        display: flex;
        width: 17vw;
        height: 4vh;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-left: 14vw;
        margin-top: -1.2vh;
      "
    >
      <div style="width: 5vw; height: 4vh; margin-top: -3.5vh">
        <Button type="primary" style="border-radius: 2px" class="mt-5" @click="prevStep4"
          >上一步</Button
        >
      </div>
      <div style="width: 5vw; height: 4vh; margin-top: -3.5vh">
        <Button type="default" style="border-radius: 2px" class="mt-5" @click="addStep4">
          打开告警通知</Button
        >
      </div>
      <div style="width: 5vw; height: 4vh; margin-top: -3.5vh; margin-left: 2.2vw">
        <Button type="default" style="border-radius: 2px" class="mt-5" @click="closeStep4">
          关闭</Button
        >
      </div>
    </div>
  </div>
</template>
<script lang="ts">
  import { defineComponent, ref } from 'vue';
  import { BasicForm, useForm } from '/@/components/Form/index';
  import { alertContactsSchemas } from './data';
  import { Button } from '/@/components/Button';

  export default defineComponent({
    components: {
      BasicForm,
      Button,
    },
    emits: ['prev', 'register'],
    setup(_, { emit }) {
      const getValueData: any = ref({});
      const isShow = ref(false);
      const [register, { setProps, validate, setFieldsValue, resetFields }] = useForm({
        schemas: alertContactsSchemas,
        actionColOptions: {
          span: 24,
        },
      });
      const setAlaramContactAndNoticeMethodFunc = (v) => {
        setFieldsValue(v);
      };
      const clearAlaramContactAndNoticeMethodFunc = async () => {
        await resetFields();
      };
      const getAllFields = async (getV) => {
        const values = await validate();
        getValueData.value = values;
        getV = getValueData.value;
        return getV;
      };
      const prevStep4 = () => {
        emit('prev');
      };
      const addStep4 = () => {
        isShow.value = true;
      };
      const closeStep4 = () => {
        isShow.value = false;
      };
      return {
        clearAlaramContactAndNoticeMethodFunc,
        setAlaramContactAndNoticeMethodFunc,
        getAllFields,
        register,
        setProps,
        addStep4,
        prevStep4,
        isShow,
        closeStep4,
      };
    },
  });
</script>
<style lang="less" scoped>
  .step-4 {
    // :deep .ant-btn {
    //   position: relative;
    //   right: 375px;
    //   top: 18px;
    // }
  }
</style>