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 | 46 +++++++++++++++++++++++++++++++++++----------- 1 files changed, 35 insertions(+), 11 deletions(-) diff --git a/src/components/subComponents/FileUpload/index.vue b/src/components/subComponents/FileUpload/index.vue index 97c4562..35d8293 100644 --- a/src/components/subComponents/FileUpload/index.vue +++ b/src/components/subComponents/FileUpload/index.vue @@ -5,12 +5,13 @@ ref="uploader" :options="options" :file-status-text="statusText" + :attrs="attrs" class="uploader-single" @file-added="onFileAdded" @complete="onComplete" > <el-input :placeholder="uploadPlaceholder" size="small" :readonly="true" v-model="fileName"> - <uploader-btn slot="suffix" > + <uploader-btn slot="suffix"> <el-tooltip :content="tipWords" placement="top" v-if="tip"> <i class="el-icon-upload2" style="font-size:18px; color:#0088ff"></i> </el-tooltip> @@ -23,6 +24,7 @@ <uploader v-else ref="uploader" + :attrs="attrs" :options="options" :file-status-text="statusText" class="uploader-example" @@ -31,7 +33,7 @@ @complete="onComplete" @close="closeHandle" > - <uploader-btn ref="button"> + <uploader-btn ref="button" :attrs="attrs"> <i class="el-icon-upload2" style="font-size:18px; color:#0088ff"></i> 涓婁紶 </uploader-btn> @@ -53,6 +55,10 @@ UploaderList }, props: { + acptTypes: { + type: String, + default: '' + }, tip: { type: Boolean, default: false @@ -73,14 +79,22 @@ type: String, default: "/data/api-f/file/upload" //"//192.168.20.10:3000/upload" }, + attrs: { + type: Object, + default () { + return { + + } + } + } }, data() { return { fileName: "", fileMd5: "", - attrs: { - accept: 'image/*' - }, + // attrs: { + // accept: 'image/*' + // }, statusText: { success: '涓婁紶鎴愬姛', error: '涓婁紶澶辫触', @@ -149,7 +163,16 @@ }, computeMD5Success(md5, file) { // 灏嗚嚜瀹氫箟鍙傛暟鐩存帴鍔犺浇uploader瀹炰緥鐨刼pts涓� - if (this.$route.path.indexOf("VideoManage") >= 0) { + // if (this.$route.path.indexOf("VideoManage") >= 0) { + // Object.assign(this.uploader.opts, { + // query: { + // stackId: this.DataStackPool.selectedDir.id + // // ...this.params, + // } + // }) + // } + //灏嗚嚜瀹氫箟鍙傛暟鐩存帴鍔犺浇uploader瀹炰緥鐨刼pts涓� + if (location.href.indexOf("dataStack") >= 0) { Object.assign(this.uploader.opts, { query: { stackId: this.DataStackPool.selectedDir.id @@ -162,7 +185,6 @@ this.statusText.paused = "鏆傚仠涓�"; }, onComplete() { - debugger this.$emit("complete", { filename: this.fileName, identifier: this.fileMd5 }); }, fileComplete() { @@ -174,6 +196,7 @@ }, mounted() { this.$nextTick(() => { + console.log(this.acptTypes) window.uploader = this.$refs.uploader.uploader }) } @@ -182,10 +205,11 @@ <style lang="scss"> .file-uploader { - .el-input__suffix,.el-input__suffix-inner{ - outline: none!important; + .el-input__suffix, + .el-input__suffix-inner { + outline: none !important; } - .el-tooltip.focusing{ + .el-tooltip.focusing { outline: none; } .uploader-example { @@ -214,7 +238,7 @@ display: none; } .uploader-btn { - border: 0px; + border: 0px; } .uploader-file { height: 2px; -- Gitblit v1.8.0