3b41ed97d0f72cfd58de069da283f2f7ee3f09a5..9e290efc330e70d931b7108ee70afc77cf3252a0
2025-06-27 jiangping
Merge remote-tracking branch 'origin/2.0.1' into 2.0.1
9e290e 对比 | 目录
2025-06-27 jiangping
提交一把订单
95d6ad 对比 | 目录
已修改1个文件
13 ■■■■ 文件已修改
company/src/components/common/uploadProgress.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/common/uploadProgress.vue
@@ -50,6 +50,7 @@
    return {
      loading:null,
      uuid: null,
      timer: null,
      message:'开始上传',
      uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/public/upload',
      uploadProgressUrl: process.env.VUE_APP_API_PREFIX + '/public'
@@ -101,9 +102,15 @@
            }
          })
          .catch(e => {
            if(this.timer){
              clearInterval(this.timer)
            }
            this.$message.error(e)
          })
          .finally(() => {
            if(this.timer){
              clearInterval(this.timer)
            }
            that.loading.close()
            this.$refs.file.value = null
          })
@@ -112,7 +119,7 @@
    },
    startProgress () {
      var that = this
      var timer = setInterval(function () {
      this.timer = setInterval(function () {
        axios.get(that.uploadProgressUrl + '/' + that.uuid)
          .then(res => {
            if (res != null && res.data && res.data.data) {
@@ -125,13 +132,13 @@
                // document.getElementById('progressBar').value = 100
                // document.getElementById('status').textContent = '已完成' + 100 + '%'
                that.loading.setText( '已完成 【 ' + 100 + ' 】%')
                clearInterval(timer)
                clearInterval(that.timer)
              } else if (res.data.data.status === 3){
                const percentCompleted = Math.round(res.data.data.rate || 0)
                // document.getElementById('progressBar').value = percentCompleted
                // document.getElementById('status').textContent = '上传失败' + percentCompleted + '%'
                that.loading.setText('上传失败 【 ' + percentCompleted + ' 】%')
                clearInterval(timer)
                clearInterval(that.timer)
              }
            }
          })