0.0.16 • Published 4 months ago

db_upload_file v0.0.16

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

db_approval_flow

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

1.插件安装

npm镜像库
npm install db_upload_file
淘宝镜像库
npm install db_upload_file --registry=https://registry.npm.taobao.org

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
	:father="this"
	lodingName="loading"
    v-model="VFormObj.uploadFile"
    :readonly="type == 'read'"
	:father="this"
    placeholder="点击上传文件"
    ref="uploadFile"
    multiple
/>
-------------------------------------------
father:父节点对象(需要调用父级loading时必填)
lodingName:添加文件时调用父组件loading框的属性名
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.16

4 months ago

0.0.15

6 months ago

0.0.14

7 months ago

0.0.12

8 months ago

0.0.13

8 months ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.6

2 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago