From 1acb2169d78d74e347bdfc2e962a88e6cb585bb7 Mon Sep 17 00:00:00 2001 From: hanbaoshan <hanbaoshan@aiotlink.com> Date: 星期五, 30 十月 2020 14:22:34 +0800 Subject: [PATCH] 修复数据栈文件删除列表仍有遗留的bug --- src/components/subComponents/FileUpload/index.vue | 31 +++++++++++++++---------------- 1 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/components/subComponents/FileUpload/index.vue b/src/components/subComponents/FileUpload/index.vue index 779bebb..35d8293 100644 --- a/src/components/subComponents/FileUpload/index.vue +++ b/src/components/subComponents/FileUpload/index.vue @@ -81,14 +81,14 @@ }, attrs: { type: Object, - // default () { - // return { + default () { + return { - // } - // } + } + } } }, - data () { + data() { return { fileName: "", fileMd5: "", @@ -105,10 +105,10 @@ } }, computed: { - uploader () { + uploader() { return this.$refs.uploader.uploader; }, - options () { + options() { return { target: this.url, testChunks: true, @@ -119,14 +119,14 @@ } }, methods: { - onFileAdded (file) { + onFileAdded(file) { if (this.single) { this.uploader.fileList = this.uploader.fileList.slice([-1]); this.$emit("file-added") } this.computeMD5(file); }, - computeMD5 (file) { + computeMD5(file) { let fileReader = new FileReader(); let time = new Date().getTime(); let blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice; @@ -155,13 +155,13 @@ this.error(`鏂囦欢${file.name}璇诲彇鍑洪敊锛岃妫�鏌ヨ鏂囦欢`) file.cancel(); }; - function loadNext () { + function loadNext() { let start = currentChunk * chunkSize; let end = ((start + chunkSize) >= file.size) ? file.size : start + chunkSize; fileReader.readAsArrayBuffer(blobSlice.call(file.file, start, end)); } }, - computeMD5Success (md5, file) { + computeMD5Success(md5, file) { // 灏嗚嚜瀹氫箟鍙傛暟鐩存帴鍔犺浇uploader瀹炰緥鐨刼pts涓� // if (this.$route.path.indexOf("VideoManage") >= 0) { // Object.assign(this.uploader.opts, { @@ -184,18 +184,17 @@ file.resume(); this.statusText.paused = "鏆傚仠涓�"; }, - onComplete () { - debugger + onComplete() { this.$emit("complete", { filename: this.fileName, identifier: this.fileMd5 }); }, - fileComplete () { + fileComplete() { // console.log('file complete', arguments) }, - closeHandle () { + closeHandle() { this.$emit("close") } }, - mounted () { + mounted() { this.$nextTick(() => { console.log(this.acptTypes) window.uploader = this.$refs.uploader.uploader -- Gitblit v1.8.0