Showing
1 changed file
with
6 additions
and
4 deletions
| ... | ... | @@ -10,7 +10,7 @@ |
| 10 | 10 | </div> |
| 11 | 11 | </template> |
| 12 | 12 | <script lang="ts"> |
| 13 | - import { defineComponent, ref } from 'vue'; | |
| 13 | + import { defineComponent, nextTick, ref } from 'vue'; | |
| 14 | 14 | import { BasicForm, useForm } from '/@/components/Form'; |
| 15 | 15 | import { CommandFieldsEnum, CommandSchemas, CommandType, ValueType } from '../../config/data'; |
| 16 | 16 | import { commandIssuanceApi } from '/@/api/device/deviceManager'; |
| ... | ... | @@ -35,7 +35,7 @@ |
| 35 | 35 | const { createMessage } = useMessage(); |
| 36 | 36 | const loading = ref(false); |
| 37 | 37 | |
| 38 | - const [registerForm, { getFieldsValue, validate, resetFields }] = useForm({ | |
| 38 | + const [registerForm, { getFieldsValue, validate, resetFields, clearValidate }] = useForm({ | |
| 39 | 39 | labelWidth: 120, |
| 40 | 40 | schemas: CommandSchemas( |
| 41 | 41 | props.deviceDetail.deviceProfile.transportType as TransportTypeEnum, |
| ... | ... | @@ -47,8 +47,10 @@ |
| 47 | 47 | showResetButton: false, |
| 48 | 48 | }); |
| 49 | 49 | |
| 50 | - const handleCancel = () => { | |
| 51 | - resetFields(); | |
| 50 | + const handleCancel = async () => { | |
| 51 | + await resetFields(); | |
| 52 | + await nextTick(); | |
| 53 | + await clearValidate(); | |
| 52 | 54 | }; |
| 53 | 55 | |
| 54 | 56 | const handleOk = async () => { | ... | ... |