Skip to content

材料名称文件分组
  1. UI - 示例
  2. 数据格式

描述

  1. 根据 optionsparams 拉取附件列表数据
  2. fileGroupEntity 通过控制文件上传规则 { "required": 1, "max": 2, "min": 1, "fileSize": 10, "fileType": ".pdf" }
  3. fileType 默认支持上传的文件类型 .pdf, .png, .jpg, .jpeg, bmp, .ppt, .pptx, .ofd, .rtf, .txt, .tif, .wps, .gd, .bdc, .edc, .rar, .7z, .zip, .dwg, .dxf, .md, .xls, .xlsx, .wmf, .docx, .mdb, .doc, .json, .xml, .ssp, .sspx

数据格式

{ "joinTable": "", "joinId": "", "serverCode": "", "fileList": [], "fileGroupEntity": {} }

  1. fileList 文件列表
  2. fileGroupEntity 文件上传规则
数据格式
md
数据结构
```json
[
  {
    "joinTable": "关联的业务表名字",
    "joinId": "关联的业务表id: 内网则是GG_CLQD_ID",
    "serverCode": "服务器编码",
    "fileList": [ ],
    "fileGroupEntity": { }
  }
]
```

fileList 文件列表
```json
[
  {
    "id": "71481acf2761448fb740e50be118ef88",
    "fullName": "ASP.NET 代码生成器源码学习.pdf",
    "fileSize": "0",
    "fileType": ".pdf",
    "url": "test/20220721\\0879a49a-b116-416f-9a24-22acc47ef313.pdf",
    "creatorTime": "1658387914000"
  }
]
```
fileGroupEntity 文件上传规则

```json
{
  "id": "0357a439e51b41cfa16162f7ee0a7c62",
  "required": 1,
  "max": 2,
  "min": 1,
  "fileSize": 10,
  "fileType": ".pdf"
}
```

完整版数据
```json
[
  {
    "joinTable": "关联的业务表名字",
    "joinId": "关联的业务表id: 内网则是GG_CLQD_ID",
    "serverCode": "服务器编码",
    "fileList": [
      {
        "id": "71481acf2761448fb740e50be118ef88",
        "fullName": "ASP.NET 代码生成器源码学习.pdf",
        "fileSize": "0",
        "fileType": ".pdf",
        "url": "test/20220721\\0879a49a-b116-416f-9a24-22acc47ef313.pdf",
        "creatorTime": "1658387914000"
      }
    ],
    "fileGroupEntity": {
      "id": "0357a439e51b41cfa16162f7ee0a7c62",
      "required": 1,
      "max": 2,
      "min": 1,
      "fileSize": 10,
      "fileType": ".pdf"
    }
  }
]
```

属性

<i-upload-props> Props

参数名描述类型默认值
prop组件属性名称。string''
has权限 edit read hidestring''
mapper字段映射
分组名称 === 材料名称
{ group: string; time: string }{ group: 'clmc', time: 'wjscsj' }
layout表格的布局。string'top, header, border, selection, index, time, dialog, buttonList'
adaptor适配器 one list button previewstringundefined
data表格数据any[][]
with-manual-data是否允许手动数据,databooleanundefined
with-multiple-data是否允许多个数据源。booleanundefined
columns增加显示的列内容any[][]
file-group同 fileGroupEntityobject{}
options业务相关参数object{}
params涉及业务动态参数object{}
before-upload上传文件之前调用的函数,返回 false 不执行附件上传() => boolean-
with-validate表格的验证规则数组。any[][]
only-preview是否需要页面切换功能booleanfalse
initial-step指定当前文件位置[number, number][0, 0]
filter-action过滤操作按钮的函数。() => void-
filter-file-action过滤文件操作按钮的函数。() => void-

options 服务端配置

  1. 配置一些固定的参数 { host: '', joinTable: '', serverCode: '' }
  2. host 后端接口位置对应的 control
  3. joinTable 业务表
  4. serverCode 服务器编写

params 动态参数

任意参数,例如:{ joinId: '', slh: ''}

withValidate 参数验证

针对传入的 params 验证,参数为空不发起请求

validate 验证上传的文件数据是否满足要求

filterAction 过滤按钮权限

filterFileAction 过滤按钮权限

adaptor 适配器

adaptor:one list button preview

  1. one: 支持上传、批量下载、文件删除

  2. layout: 通过配置可展示不同的样式

    1. index: 索引/序号
    2. selection: 是否显示复选框
    3. border: 是否存在边框
    4. top: 是否显示头部内容(上传/批量下载)
    5. header: 表格头部信息
    6. time: 是否需要时间字典的列
    7. preview: 是否文件展示预览页面
    8. dialog: 是否弹窗显示
    9. buttonList : 是否需要按钮列表
  3. listone 其中:layout: 'dialog'

  4. button 用行的方式操作一个文件

  5. preview 直接预览附件

默认

button 默认

one

list

preview