amis icon indicating copy to clipboard operation
amis copied to clipboard

Form 表单 - File 文件上传回显有问题,文件链接被折行展示了

Open xdlove opened this issue 6 years ago • 10 comments

实现场景:

实现简单的文件回显

存在的问题:

service 端返回文件链接,在展示的时候,折行了,看起来像两个文件

文件链接类似 hdfs://xxx:8020,xxx1:8020,展示的时候,变为 hdfs://xxx:8020、xxx1:8020

当前方案:

{
    "type": "file",
    "name": "xxxx",
    "accept": ".json",
    "required": true,
    "labelRemark": {
        "type": "remark",
        "content": "仅支持.json结尾的文件",
        "icon": "fa fa-info-circle"
    },
    "reciever": "xxx"
}

xdlove avatar Nov 19 '20 09:11 xdlove

加个"delimiter": "xxxx-what-ever"

2betop avatar Nov 19 '20 09:11 2betop

加个"delimiter": "xxxx-what-ever"

这是表示什么意思呀

xdlove avatar Nov 19 '20 09:11 xdlove

Uploading WX20201119-172254.png…

xdlove avatar Nov 19 '20 09:11 xdlove

默认值格式是字符串,所以默认会对原始数据做个拆分,拆分的字符目前的默认值就是 , 所以,正好把那个分成两个文件了。你换个拆分符号就不会了。

2betop avatar Nov 19 '20 09:11 2betop

默认值格式是字符串,所以默认会对原始数据做个拆分,拆分的字符目前的默认值就是 , 所以,正好把那个分成两个文件了。你换个拆分符号就不会了。

加了,但是不生效

{ "delimeter": "/", "reciever": "xxx-脱敏", "name": "xxxx脱敏", "type": "file", "labelRemark": { "icon": "fa fa-info-circle", "type": "remark", "content": "仅支持.json结尾的文件" }, "required": true, "accept": ".json" }

返回数据是 xxxx脱敏 = hdfs://xxx:8020,xxx1:8020

xdlove avatar Nov 19 '20 09:11 xdlove

单词抄错了 delimiter

2betop avatar Nov 19 '20 09:11 2betop

啊 哈哈哈哈,文档写错了哦 https://baidu.gitee.io/amis/docs/components/form/file#%E5%B1%9E%E6%80%A7%E8%A1%A8

xdlove avatar Nov 19 '20 09:11 xdlove

单词抄错了 delimiter

有办法控制文件回显的名字吗?现在默认是链接后面几个字符

xdlove avatar Nov 19 '20 09:11 xdlove

文档改了,需要修改值格式,配置 joinValues: false, 然后提交一下,就知道回显是啥格式了。

2betop avatar Nov 19 '20 09:11 2betop

感谢大佬,折行的问题解决了

xdlove avatar Nov 19 '20 09:11 xdlove