可以通过 `Service` 返回的结果,清空一个表单项吗?
{"name": "tcode", "type": "text", "label": "条码" },
{
"type": "service",
"api": {
"url": "/xx?tcode=${tcode}&wshid=${wshid}",
"cache": 1000,
"sendOn": "this.tcode"
},
"controls": [ ...
接口返回的数据,希望 service 返回后,清空 tcode 的内容,不晓得哪里出问题了?
{"msg":"操作成功","data":{"tcode":null,"prodinfo":"... }]},"status":0}
这个 service 不加 cache 前,无限循环,也不知道如何解决?加 cache 肯定是治标不治本
参数通过 data 配置如
{
"type": "service",
"api": {
"method": "get",
"url": "/xx",
"data": {
"tcode": "${tcode}",
"wshid": "${wshid}"
},
"cache": 1000,
"sendOn": "this.tcode"
},
"controls": [ ...
接口返回的 {"msg":"操作成功","data":{"tcode":null,"prodinfo":"... }]},"status":0} 没有清空表单项 tcode 是什么原因呢 ?
参数通过 data 配置 这种方式,请求都没发了,我是想通过 tcode 作为参数请求,再通过响应结果清空 tcode 表单项内容
@2betop 请教一下,我这个需求可以实现吗 ?
试试返回 {"tcode": ""}, 而不是 null
你参考一下这个示例,刚试了下 空字符和 null 都是可以的。
https://baidu.github.io/amis/linkpage/form2
你把你所有 form 下面的配置传不贴出来
你的 tcode 要在 service 里面呢
谢谢