...
|
...
|
@@ -5,15 +5,16 @@ |
5
|
5
|
<template #iconSelect>
|
6
|
6
|
<Upload
|
7
|
7
|
name="avatar"
|
|
8
|
+ :show-upload-list="false"
|
8
|
9
|
list-type="picture-card"
|
9
|
10
|
class="avatar-uploader"
|
10
|
|
- :show-upload-list="false"
|
11
|
11
|
:customRequest="customUpload"
|
12
|
12
|
:before-upload="beforeUpload"
|
13
|
13
|
>
|
14
|
14
|
<img v-if="devicePic" :src="devicePic" alt="avatar" />
|
15
|
15
|
<div v-else>
|
16
|
|
- <PlusOutlined />
|
|
16
|
+ <loading-outlined v-if="loading"></loading-outlined>
|
|
17
|
+ <PlusOutlined v-else />
|
17
|
18
|
<div class="ant-upload-text">图片上传</div>
|
18
|
19
|
</div>
|
19
|
20
|
</Upload>
|
...
|
...
|
@@ -85,7 +86,7 @@ |
85
|
86
|
import { step1Schemas } from '../../config/data';
|
86
|
87
|
import { useScript } from '/@/hooks/web/useScript';
|
87
|
88
|
import { Input, Upload, message, Modal, Form, Row, Col, AutoComplete } from 'ant-design-vue';
|
88
|
|
- import { EnvironmentTwoTone, PlusOutlined } from '@ant-design/icons-vue';
|
|
89
|
+ import { EnvironmentTwoTone, PlusOutlined, LoadingOutlined } from '@ant-design/icons-vue';
|
89
|
90
|
import { upload } from '/@/api/oss/ossFileUploader';
|
90
|
91
|
import { FileItem } from '/@/components/Upload/src/typing';
|
91
|
92
|
import { BAI_DU_MAP_URL } from '/@/utils/fnUtils';
|
...
|
...
|
@@ -105,6 +106,7 @@ |
105
|
106
|
FormItem: Form.Item,
|
106
|
107
|
Row,
|
107
|
108
|
Col,
|
|
109
|
+ LoadingOutlined,
|
108
|
110
|
},
|
109
|
111
|
props: {
|
110
|
112
|
isUpdate: {
|
...
|
...
|
@@ -114,6 +116,7 @@ |
114
|
116
|
emits: ['next'],
|
115
|
117
|
setup(props, { emit }) {
|
116
|
118
|
const devicePic = ref('');
|
|
119
|
+ const loading = ref(false);
|
117
|
120
|
|
118
|
121
|
const [register, { validate, resetFields, setFieldsValue, getFieldsValue, updateSchema }] =
|
119
|
122
|
useForm({
|
...
|
...
|
@@ -140,11 +143,13 @@ |
140
|
143
|
// 图片上传
|
141
|
144
|
async function customUpload({ file }) {
|
142
|
145
|
if (beforeUpload(file)) {
|
|
146
|
+ loading.value = true;
|
143
|
147
|
const formData = new FormData();
|
144
|
148
|
formData.append('file', file);
|
145
|
149
|
const response = await upload(formData);
|
146
|
150
|
if (response.fileStaticUri) {
|
147
|
151
|
devicePic.value = response.fileStaticUri;
|
|
152
|
+ loading.value = false;
|
148
|
153
|
}
|
149
|
154
|
}
|
150
|
155
|
}
|
...
|
...
|
@@ -371,6 +376,7 @@ |
371
|
376
|
dataSource,
|
372
|
377
|
debounceSearch,
|
373
|
378
|
generateSN,
|
|
379
|
+ loading,
|
374
|
380
|
};
|
375
|
381
|
},
|
376
|
382
|
});
|
...
|
...
|
|