| | |
| | | @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>
|
| | |
| | | @complete="onComplete"
|
| | | @close="closeHandle"
|
| | | >
|
| | | <uploader-btn ref="button"> |
| | | <uploader-btn ref="button" :sourceType="sourceType">
|
| | | <i class="el-icon-upload2" style="font-size:18px; color:#0088ff"></i>
|
| | | 上传
|
| | | </uploader-btn>
|
| | |
| | | UploaderList
|
| | | },
|
| | | props: {
|
| | | sourceType: {
|
| | | type: Number,
|
| | | },
|
| | | tip: {
|
| | | type: Boolean,
|
| | | default: false
|
| | |
| | | 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: '上传失败',
|
| | |
| | | }
|
| | | },
|
| | | computeMD5Success(md5, file) {
|
| | | // 将自定义参数直接加载uploader实例的opts上
|
| | | if (this.$route.path.indexOf("VideoManage") >= 0) {
|
| | | //将自定义参数直接加载uploader实例的opts上
|
| | | if (location.href.indexOf("dataStack") >= 0) {
|
| | | Object.assign(this.uploader.opts, {
|
| | | query: {
|
| | | stackId: this.DataStackPool.selectedDir.id
|
| | |
| | | this.statusText.paused = "暂停中";
|
| | | },
|
| | | onComplete() {
|
| | | debugger
|
| | | this.$emit("complete", { filename: this.fileName, identifier: this.fileMd5 });
|
| | | },
|
| | | fileComplete() {
|
| | |
| | | },
|
| | | mounted() {
|
| | | this.$nextTick(() => {
|
| | | console.log(this.sourceType)
|
| | | window.uploader = this.$refs.uploader.uploader
|
| | | })
|
| | | }
|
| | |
| | |
|
| | | <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 {
|
| | |
| | | display: none;
|
| | | }
|
| | | .uploader-btn {
|
| | | border: 0px; |
| | | border: 0px;
|
| | | }
|
| | | .uploader-file {
|
| | | height: 2px;
|