DeviceProfileStep4.vue
2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<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.6vh">
<Button type="primary" style="border-radius: 2px" class="mt-5" @click="prevStep4"
>上一步</Button
>
</div>
<div style="width: 5vw; height: 4vh; margin-top: -3.6vh">
<Button type="default" style="border-radius: 2px" class="mt-5" @click="addStep4">
打开告警通知</Button
>
</div>
<div style="width: 5vw; height: 4vh; margin-top: -3.6vh; 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, nextTick } 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 = () => {
try {
nextTick(() => {
// resetFields();
});
} catch {}
};
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;
};
const step3LinkStep4DefalutClose = () => {
isShow.value = false;
};
return {
clearAlaramContactAndNoticeMethodFunc,
setAlaramContactAndNoticeMethodFunc,
getAllFields,
register,
setProps,
addStep4,
prevStep4,
isShow,
closeStep4,
step3LinkStep4DefalutClose,
};
},
});
</script>
<style lang="less" scoped>
.step-4 {
// :deep .ant-btn {
// position: relative;
// right: 375px;
// top: 18px;
// }
}
</style>