|
|
@@ -17,6 +17,9 @@
|
|
|
</p>
|
|
|
</div>
|
|
|
<p style="text-align: center">{{ imgText }}</p>
|
|
|
+ <div class="mask" v-if="progressFlag">
|
|
|
+ <el-progress type="circle" :percentage="percentage"></el-progress>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -59,6 +62,10 @@ export default {
|
|
|
type: Number,
|
|
|
default: 1,
|
|
|
},
|
|
|
+ photoIdentifyType: {
|
|
|
+ type: String,
|
|
|
+ default: '',
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -68,6 +75,9 @@ export default {
|
|
|
num: 0,
|
|
|
serverIdArr: [],
|
|
|
imgUrlArr: [],
|
|
|
+ progressFlag: false,
|
|
|
+ percentage: 0,
|
|
|
+ timeFlag: null,
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -140,6 +150,8 @@ export default {
|
|
|
message: '上传中...',
|
|
|
forbidClick: true,
|
|
|
});
|
|
|
+ // loading
|
|
|
+ this.progress();
|
|
|
uploadImagev(form).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
// that.imgArr = res.data.url;
|
|
|
@@ -148,6 +160,10 @@ export default {
|
|
|
imgArr.push(item.url);
|
|
|
});
|
|
|
loind1.clear();
|
|
|
+ this.percentage = 100;
|
|
|
+ clearInterval(this.timeFlag);
|
|
|
+ this.progressFlag = false;
|
|
|
+ this.percentage = 0;
|
|
|
that.$toast('上传成功!');
|
|
|
that.$emit('newimgarr', { fileUrl: imgArr.join(','), type: that.type });
|
|
|
} else {
|
|
|
@@ -155,6 +171,14 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ progress() {
|
|
|
+ this.progressFlag = true;
|
|
|
+ this.percentage = 10;
|
|
|
+ this.timeFlag = setInterval(() => {
|
|
|
+ if (this.percentage == 90) clearInterval(this.timeFlag);
|
|
|
+ this.percentage = this.percentage + 10;
|
|
|
+ }, 1000);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -212,4 +236,14 @@ export default {
|
|
|
.coverImg .ico {
|
|
|
top: 42%;
|
|
|
}
|
|
|
+.mask {
|
|
|
+ position: absolute;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ top: 0;
|
|
|
+ background: rgba(255, 255, 255, 0.8);
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
</style>
|