Commit c85cbf59e960f5a5e2185ff135a0142ab5b6fdf8
1 parent
2482606b
perf: 优化企业信息,当第一次未上传图片时,提示红框消息,选择图片后,更新基本信息成功但是还是显示此提示
Showing
1 changed file
with
12 additions
and
2 deletions
| @@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
| 31 | </template> | 31 | </template> |
| 32 | 32 | ||
| 33 | <script lang="ts"> | 33 | <script lang="ts"> |
| 34 | - import { defineComponent, onMounted, ref, computed } from 'vue'; | 34 | + import { defineComponent, onMounted, ref, computed, watch } from 'vue'; |
| 35 | import { Card } from 'ant-design-vue'; | 35 | import { Card } from 'ant-design-vue'; |
| 36 | import { BasicForm, useForm } from '/@/components/Form/index'; | 36 | import { BasicForm, useForm } from '/@/components/Form/index'; |
| 37 | import { schemas, provSchemas } from '../config/enterPriseInfo.config'; | 37 | import { schemas, provSchemas } from '../config/enterPriseInfo.config'; |
| @@ -73,7 +73,10 @@ | @@ -73,7 +73,10 @@ | ||
| 73 | loading: false, | 73 | loading: false, |
| 74 | tip: '拼命加载中...', | 74 | tip: '拼命加载中...', |
| 75 | }); | 75 | }); |
| 76 | - const [registerForm, { getFieldsValue, setFieldsValue, validate, clearValidate }] = useForm({ | 76 | + const [ |
| 77 | + registerForm, | ||
| 78 | + { getFieldsValue, setFieldsValue, validate, clearValidate, validateFields }, | ||
| 79 | + ] = useForm({ | ||
| 77 | labelWidth: 80, | 80 | labelWidth: 80, |
| 78 | schemas, | 81 | schemas, |
| 79 | showResetButton: false, | 82 | showResetButton: false, |
| @@ -101,6 +104,13 @@ | @@ -101,6 +104,13 @@ | ||
| 101 | const handleSetCodeImgUrl = (d) => { | 104 | const handleSetCodeImgUrl = (d) => { |
| 102 | qrcodePic.value = d; | 105 | qrcodePic.value = d; |
| 103 | }; | 106 | }; |
| 107 | + watch( | ||
| 108 | + () => qrcodePic.value, | ||
| 109 | + (newValue) => { | ||
| 110 | + if (!newValue) validateFields(['qrcode']); | ||
| 111 | + else clearValidate('qrcode'); | ||
| 112 | + } | ||
| 113 | + ); | ||
| 104 | // 更新 | 114 | // 更新 |
| 105 | const handleUpdateInfo = async () => { | 115 | const handleUpdateInfo = async () => { |
| 106 | try { | 116 | try { |