DeviceProfileStep4.vue
1.52 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
<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: {
BasicForm,
},
emits: ['prev'],
setup(_, { emit }) {
const getValueData: any = ref({});
const [register, { setProps, validate, setFieldsValue, resetFields }] = useForm({
schemas: alertContactsSchemas,
actionColOptions: {
span: 24,
},
resetButtonOptions: {
text: '上一步',
},
resetFunc: customResetFunc,
});
const resetFieldsFunc = (v) => {
setFieldsValue(v);
};
const customResetAndFunc = async () => {
await resetFields();
};
async function customResetFunc() {
emit('prev');
}
const getAllFields = async (getV) => {
const values = await validate();
getValueData.value = values;
getV = getValueData.value;
return getV;
};
return {
customResetAndFunc,
resetFieldsFunc,
customResetFunc,
getAllFields,
register,
setProps,
};
},
});
</script>