amis icon indicating copy to clipboard operation
amis copied to clipboard

批量删除的问题

Open tanmengfei opened this issue 6 years ago • 6 comments

这是我配置的批量删除,设置了"primaryField":"url",我想在请求这个接口的时候,把这些url拼装成一个list传递给接口,这个可以实现吗 Uploading image.png…

tanmengfei avatar Jun 16 '20 13:06 tanmengfei

配置 primaryField 后,取数据还是通过 ${ids} 取,不过,你这个需求没必要去配置 primaryField, 你直接这样也能取到 ${items|pick:url|join:,}

2betop avatar Jun 17 '20 01:06 2betop

那这个能做成post请求吗

tanmengfei avatar Jun 17 '20 02:06 tanmengfei

可以自定义api,看下api类型文档

RickCole21 avatar Jun 17 '20 02:06 RickCole21

image 这么传的话urls是一个字符串,有办法转数组吗

tanmengfei avatar Jun 17 '20 03:06 tanmengfei

文档不仔细看,把最后的 join 干掉就行了。https://amis.baidu.com/docs/renderers/tpl

2betop avatar Jun 17 '20 03:06 2betop

哈哈,谢谢啦

tanmengfei avatar Jun 17 '20 03:06 tanmengfei