1.0.41 • Published 1 year ago

iteach-upload v1.0.41

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

#iteach-upload

Props

modeType 1素材上传、2、校本库、个人上传 3、作业包 4、课程产品课件上传,6教研云(个人,校本云盘) 9默认展示上传按钮

@Prop({ required: false, default: 1 })
    public modeType!: number; //

limit 最大允许上传个数

@Prop({ required: false, default: 3 })
public limit!: number;

acceptType 限定上传文件类型,例如:'.ppts,.mp4'

@Prop({ required: false, default: '.jpg' })
public acceptType!: string; 

sourceType 素材库上传时限定素材类型

@Prop({ required: false, default: '6' })
public sourceType!: string; // 

addParams{} 直接上传文件的附加参数

@Prop({
    required: false,
    default: () => {
        return {
            param: {} // 参数
            url:'' //上传路径
        }
    }
})
public addParams!: any;

jyy2 兼容教研云的悬浮窗,值为1时生效

public jyy2: any = false;

type 素材库上传时特殊类型

public type: string = ''; 

sliceType 素材库上传时特殊切片类型

public sliceType: string = ''; 

sourceItem 素材库替换素材

@Prop({
    required: false,
    default: () => {
        return {
        modifyType: '',
        resourceId: '',
        }
    }
})
public sourceItem!: any;

Emit func

1、@changeFile 文件上传完成之后,返回文件上传结果

public changeFile(list: Array<{ previewUrl: any; fileId: any; sliceType: any; downloadUrl: any; size: any; structJson: any; coverImgUrl: any; fileMd5: any; fileName: any; }>,fileId?:string | undefined) {
    this.$emit('changeFile',list,fileId);
}

2、@changeFilePercent 进度条更新事件

public changeFilePercent(filePercent: number, id: any) {
    this.fileList.forEach((v: any) => {
    if (v.sourceId === id) {
        v.filePercent = filePercent;
    }
    });
    this.$forceUpdate();
    this.$emit('changeFilePercent',filePercent,id)
}

3、@startUploadEvent 开始上传

public startUploadEvent(): void {
    this.$emit('startUploadEvent')
}

4、@singleChangeFile 单文件上传完成

public singleChangeFile(file: any, fileId: any) {
    this.$emit('singleChangeFile', file, fileId);
}

5,changeError 上传数量超出限制 #Event func 1、addFileFunc() 自定义按钮唤起文件上传

<iteach-upload ref="upload1"></iteach-upload>
this.$refs.upload1.addFileFunc();

2、按钮自定义样式,插槽处可填写自定义element,点击后自动唤起文件上传

<iteach-upload>
    <slot/>
</iteach-upload>

3、stopDownload() 删除文件列表的某一个文件

public stopDownload(file: any, fileId: string): void {
    this.$refs.upload1.stopDownload(file, fileId);
}

4、clearFiles()//清空文件选择器中的文件

public clearFiles(){
    this.$refs.upload1.clearFiles();
}

5、setSourceItem() //编辑素材时数据传入

6、getFilemd5(file) // 直接传入文件

7、setOthers() // 增加文件额外参数 public setOthers(item:any): void { this.$refs.iteachUpns.setOthers(item) }

##callBack 1、singleFinishCallback 单文件上传完成回调

2、

1.0.41

1 year ago

1.0.40

1 year ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago