transferConfigMode.vue
2.34 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
109
110
111
<template>
<div class="step1">
<div class="step1-form">
<div>
<BasicForm @register="register" />
</div>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { BasicForm, useForm } from '/@/components/Form';
import { modeForm } from './config';
import { Select, Input, Divider } from 'ant-design-vue';
export default defineComponent({
components: {
BasicForm,
[Select.name]: Select,
[Input.name]: Input,
[Input.Group.name]: Input.Group,
[Divider.name]: Divider,
},
emits: ['next', 'resetFunc', 'register'],
setup(_, { emit }) {
const [register, { validate, setFieldsValue, resetFields }] = useForm({
labelWidth: 100,
schemas: modeForm,
actionColOptions: {
span: 14,
},
showResetButton: false,
submitButtonOptions: {
text: '下一步',
},
submitFunc: customSubmitFunc,
});
//提交数据
async function customSubmitFunc() {
try {
const values = await validate();
emit('next', values);
} catch (error) {}
}
//回显数据
const setStepOneFieldsValueFunc = (v) => {
setFieldsValue(v);
};
//清空数据
const customResetStepOneFunc = () => {
resetFields();
};
return {
register,
setStepOneFieldsValueFunc,
customResetStepOneFunc,
};
},
});
</script>
<style lang="less" scoped>
.step1 {
&-form {
width: 800px;
height: 300px;
margin: 15px auto;
}
h3 {
margin: 0 0 12px;
font-size: 16px;
line-height: 32px;
color: @text-color;
}
h4 {
margin: 0 0 4px;
font-size: 14px;
line-height: 22px;
color: @text-color;
}
p {
color: @text-color;
}
.device-icon-style {
:deep .ant-upload-select-picture-card {
display: inherit;
float: none;
width: 8.6vw;
height: 17vh;
margin-right: 8px;
text-align: center;
vertical-align: top;
background-color: #fafafa;
border: 1px dashed #d9d9d9;
cursor: pointer;
transition: border-color 0.3s ease;
}
}
}
.pay-select {
width: 20%;
}
.pay-input {
width: 70%;
}
</style>