baidu / amis

前端低代码框架,通过 JSON 配置就能生成各种页面。
https://baidu.github.io/amis/
Apache License 2.0
16.49k stars 2.41k forks source link

文件上传组件支持预览吗 #10563

Open dianbing opened 3 days ago

dianbing commented 3 days ago

实现场景:

文件上传支持上传后预览吗? 查看的时候如何回显呢?

存在的问题:

请简单描述你现在遇到的不符合预期的问题...

当前方案:

请粘贴你当前方案的完整 amis schema 代码...

{
  "type": "form",
  "id": "u:115d4e92742e",
  "title": "表单",
  "mode": "horizontal",
  "dsType": "api",
  "feat": "Insert",
  "body": [
    {
      "type": "input-file",
      "label": "文件上传",
      "autoUpload": true,
      "proxy": true,
      "uploadType": "fileReceptor",
      "name": "file",
      "id": "u:683ef849ea9c",
      "btnLabel": "文件上传",
      "multiple": true,
      "useChunk": false,
      "accept": "",
      "drag": true,
      "maxLength": 2,
      "maxSize": 1048576,
      "asBlob": false,
      "formType": "asBlob",
      "asBase64": false,
      "bos": "default",
      "receiver": {
        "url": "http://192.168.2.39:8844/upload",
        "method": "post",
        "requestAdaptor": "",
        "adaptor": "",
        "messages": {}
      },
      "templateUrl": "",
      "remark": {
        "icon": "fa fa-question-circle",
        "trigger": [
          "hover"
        ],
        "className": "Remark--warning",
        "placement": "top"
      },
      "description": ""
    }
  ],
  "actions": [
    {
      "type": "button",
      "label": "提交",
      "onEvent": {
        "click": {
          "actions": [
            {
              "actionType": "submit",
              "componentId": "u:115d4e92742e"
            }
          ]
        }
      },
      "level": "primary",
      "id": "u:6bf7d5b21601"
    }
  ],
  "resetAfterSubmit": true,
  "api": {
    "url": "/ddd",
    "method": "post",
    "requestAdaptor": "",
    "adaptor": "",
    "messages": {}
  }
}
github-actions[bot] commented 3 days ago

👍 Thanks for this! 🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.