0.0.11 • Published 11 months ago

db_upload_file v0.0.11

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

db_approval_flow

基于iview的文件上传组件,仅适用于本公司内部框架。

1.插件安装

npm install db_upload_file

2.插件卸载

npm uninstall db_upload_file

3.配制流程服务api

VUE_APP_FileURL='http://192.168.1.118:7008'

4.文件上传组件

A.添加引用
import uploadFile from 'db_upload_file'
B.注册组件
components: { uploadFile },
C.添加页面标签
<uploadFile
    v-model="VFormObj.uploadFile"
    :readonly="type == 'read'"
	:father="this"
    placeholder="点击上传文件"
    ref="uploadFile"
    multiple
/>
-------------------------------------------
placeholder:默认显示文字
multiple:是否要多选
accept:文件类型,如:image/png,image/jpeg
readonly:是否只读(bool类型,默认为false,true:查看模式)

C.组件文件回显
this.$nextTick(() => {
    this.$refs.uploadFile.show(this.father.selectInfo.id)
})

E.文件上传事件
this.$refs.uploadFile.uploadFile().then(res => {
	//构件文件业务数据
	if (res.status == false) {
		this.loading = false
		this.$Message.error(res.message)
		return
	}
	let fileList = res.result
	obj.fileList = []
	fileList.forEach(z => {
		obj.fileList.push({
			fileId: z.fileData.id, //文件资源系统的文件ID
			fileName: z.name, //文件名称(xxx.png)
			fileCap: z.fileData.fileCap, //文件尺寸(带单位,如:1.2MB)
			fileSize: z.fileData.fileSize, //文件尺寸(不还单位,数字类型,如:1024,单位B),
			filePath: z.fileData.filePath, //文件保存路径(相对路径)
		})
	})
    //调用业务api
    ...
})
0.0.10

11 months ago

0.0.11

11 months ago

0.0.9

12 months ago

0.0.8

12 months ago

0.0.7

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.6

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago