|
@@ -4,6 +4,7 @@
|
|
|
:headers="headers"
|
|
|
:on-success="success"
|
|
|
:on-remove="remove"
|
|
|
+ :on-progress="progress"
|
|
|
:on-error="error"
|
|
|
:limit="1"
|
|
|
:file-list="filelist"
|
|
@@ -16,7 +17,7 @@
|
|
|
<i v-if="!!file.url" @click.stop="copyText(file.url)" title="复制" style="padding-right: 5px" class="el-icon-document-copy"></i>
|
|
|
<span class="upload-text" :title="file.url">{{ file.url }}</span>
|
|
|
</div>
|
|
|
- <i class="el-icon-delete" @click="remove"></i>
|
|
|
+ <i v-if="!!file.url" class="el-icon-delete" @click="remove"></i>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-upload>
|
|
@@ -25,6 +26,7 @@
|
|
|
<script>
|
|
|
import copy from 'copy-to-clipboard'
|
|
|
import { getToken } from '@/utils/auth'
|
|
|
+import { showFullScreenLoading, tryHideFullScreenLoading } from '../../utils/request-loading'
|
|
|
export default {
|
|
|
name: 'singe-file-upload',
|
|
|
props: {
|
|
@@ -72,8 +74,13 @@ export default {
|
|
|
},
|
|
|
error() {
|
|
|
this.remove()
|
|
|
+ tryHideFullScreenLoading()
|
|
|
+ },
|
|
|
+ progress() {
|
|
|
+ showFullScreenLoading()
|
|
|
},
|
|
|
success(res) {
|
|
|
+ tryHideFullScreenLoading()
|
|
|
if (res.code == 200) {
|
|
|
this.filelist = [{
|
|
|
name: res.data.url,
|