Explorar o código

修改上传优化

lex-xin %!s(int64=4) %!d(string=hai) anos
pai
achega
4bf29caf45
Modificáronse 2 ficheiros con 10 adicións e 3 borrados
  1. 8 1
      src/components/singe-file-upload/index.vue
  2. 2 2
      vue.config.js

+ 8 - 1
src/components/singe-file-upload/index.vue

@@ -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,

+ 2 - 2
vue.config.js

@@ -20,8 +20,8 @@ const name = defaultSettings.title || '管乐迷后台管理系统' // page titl
 // let target = 'http://192.168.3.139:8000' // 箭河
 // let target = 'http://192.168.3.148:8000' //邹璇
 // let target = 'http://192.168.3.57:8000' //勇哥
-let target = 'http://dev.dayaedu.com' // 开发环境
-// let target = 'https://test.dayaedu.com' //测试环境
+// let target = 'http://dev.dayaedu.com' // 开发环境
+let target = 'https://test.dayaedu.com' //测试环境
 // let target = 'http://192.168.3.134' // 乔
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {