Commit c85cbf59e960f5a5e2185ff135a0142ab5b6fdf8

Authored by fengwotao
1 parent 2482606b

perf: 优化企业信息,当第一次未上传图片时,提示红框消息,选择图片后,更新基本信息成功但是还是显示此提示

... ... @@ -31,7 +31,7 @@
31 31 </template>
32 32
33 33 <script lang="ts">
34   - import { defineComponent, onMounted, ref, computed } from 'vue';
  34 + import { defineComponent, onMounted, ref, computed, watch } from 'vue';
35 35 import { Card } from 'ant-design-vue';
36 36 import { BasicForm, useForm } from '/@/components/Form/index';
37 37 import { schemas, provSchemas } from '../config/enterPriseInfo.config';
... ... @@ -73,7 +73,10 @@
73 73 loading: false,
74 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 80 labelWidth: 80,
78 81 schemas,
79 82 showResetButton: false,
... ... @@ -101,6 +104,13 @@
101 104 const handleSetCodeImgUrl = (d) => {
102 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 115 const handleUpdateInfo = async () => {
106 116 try {
... ...