diff --git a/template/admin/src/components/uploadImg/index.vue b/template/admin/src/components/uploadImg/index.vue index d9ca527d6..663e941ea 100644 --- a/template/admin/src/components/uploadImg/index.vue +++ b/template/admin/src/components/uploadImg/index.vue @@ -123,7 +123,7 @@ - 取 消 + 取 消 确 定 @@ -193,17 +193,6 @@ export default { this.time = undefined; }, methods: { - closed() { - console.log('1'); - this.ruleForm.type = 0; - this.ruleForm.region = 0; - this.scanToken = ''; - this.webImgUrl = ''; - this.ruleForm.imgList = []; - clearInterval(this.time); - this.time = undefined; - scanUploadCode().then((res) => {}); - }, radioChange(type) { this.ruleForm.type = type; this.ruleForm.imgList = []; @@ -255,6 +244,7 @@ export default { this.$emit('uploadSuccess'); this.uploadModal = false; this.loading = false; + this.initData(); } } } @@ -271,6 +261,7 @@ export default { this.$emit('uploadSuccess'); this.uploadModal = false; this.loading = false; + this.initData(); }) .catch((err) => { this.loading = false; @@ -285,6 +276,7 @@ export default { this.$Message.success('上传成功'); this.$emit('uploadSuccess'); this.uploadModal = false; + this.initData(); }); } }, @@ -397,6 +389,23 @@ export default { newItems.splice(dst, 0, ...newItems.splice(src, 1)); this.ruleForm.imgList = newItems; }, + closed() { + this.initData(); + scanUploadCode().then((res) => {}); + }, + clear() { + this.uploadModal = false; + this.initData(); + }, + initData() { + this.ruleForm.type = 0; + this.ruleForm.region = 0; + this.scanToken = ''; + this.webImgUrl = ''; + this.ruleForm.imgList = []; + clearInterval(this.time); + this.time = undefined; + }, }, };