baidu / amis

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

如果在弹窗关闭的时候关闭定时器,该如何书写这个表达式? #10503

Open is-vino opened 1 week ago

is-vino commented 1 week ago

实现场景:

请简单描述你想要实现的原始场景,例如:我想要实现xxx的功能... 打开弹窗的时候定时请求接口获取内容,关闭弹窗的时候关闭这个定时请求,

存在的问题:

请简单描述你现在遇到的不符合预期的问题... 无法关闭,或显示变量不存在,或出现一些其他问题,麻烦给出方案,因为这个没有书写例子 555

当前方案:

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

code here...
allenve commented 1 week ago

通过事件动作赋值变量 在crud中 : {"stopAutoRefreshWhen": "stop === true"} 事件动作: { "componentId": "xxx", "ignoreError": false, "actionType": "setValue", "args": { "value": { "stop": true } } }

is-vino commented 3 days ago

{ "type": "crud", "api": { "method": "get", "url": "http://service-dev.xx.com/apis/faas/DEVOPS/xx/BuildJob", "messages": {}, "requestAdaptor": "", "adaptor": "var res = response.data.Data\r\nreturn {\r\n msg: response.data.Meaasge,\r\n status: response.data.Code,\r\n data: {\r\n count: 1,\r\n rows: [\r\n {\r\n status: response.data.Data\r\n }\r\n ]\r\n }\r\n}\r\n", "data": { "Fhi": "${Id}", "Type": 1 }, "interval": 10000 }, "id": "u:2cf7d731f3a7", "syncLocation": false, "bulkActions": [], "itemActions": [], "messages": {}, "perPageAvailable": [ 10 ], "columns": [ { "name": "status", "label": "状态", "type": "text", "id": "u:7bf58f8e804c", "placeholder": "-", "vendor": "tinymce", "className": "word-break ", "inline": true, "innerClassName": "whiteSpace" } ], "initFetch": true, "interval": 3000, "silentPolling": false, "stopAutoRefreshWhenModalIsOpen": false, "stopAutoRefreshWhen": "stop == true", "loadingConfig": { "show": false } } 可以给个例子吗,赋值变量没搞懂

allenve commented 3 days ago

参考这部分文档:https://aisuda.bce.baidu.com/amis/zh-CN/docs/concepts/event-action#%E6%9B%B4%E6%96%B0%E7%BB%84%E4%BB%B6%E6%95%B0%E6%8D%AE