update cfg, disable button when input-number is empty

This commit is contained in:
murmur 2024-06-28 19:09:00 +08:00
parent 12539b6b2f
commit b16213f109
2 changed files with 60 additions and 59 deletions

View File

@ -1,10 +1,11 @@
//低代码框架 amis //低代码框架 amis
import win.ui; import win.ui;
/*DSG{{*/ /*DSG{{*/
var winform = win.form(text="WebView2 - 调用百度低代码前端框架 amis";right=966;bottom=622;border="none";maximize=1) var winform = win.form(text="WebView2 - 调用百度低代码前端框架 amis";right=966;bottom=622;border="none";)
winform.add( winform.add(
bk={cls="bk";left=0;top=-1;right=967;bottom=30;bgcolor=10789024;dl=1;dr=1;dt=1;z=1}; bk={cls="bk";left=0;top=-1;right=967;bottom=30;bgcolor=10789024;dl=1;dr=1;dt=1;z=1;};
custom={cls="custom";text="自定义控件";left=-1;top=32;right=966;bottom=623;db=1;dl=1;dr=1;dt=1;z=2} custom={cls="custom";text="自定义控件";left=-1;top=32;right=966;bottom=623;db=1;dl=1;dr=1;dt=1;z=2;};
) )
/*}}*/ /*}}*/
@ -110,7 +111,7 @@ schema = function(v){
} }
udpSend = function(d){ udpSend = function(d){
console.log(d) console.dumpJson(d)
} }

View File

@ -105,61 +105,61 @@
], ],
"id": "u:b6649c1b1585" "id": "u:b6649c1b1585"
}, },
{
"type": "input-number", {
"label": "数字输入", "type": "input-number",
"name": "number", "label": "数字输入",
"keyboard": true, "name": "freq",
"id": "u:d10a773ce8ee", "keyboard": true,
"step": 12, "id": "numberInput",
"displayMode": "base", "step": 12,
"size": "full", "displayMode": "base",
"mode": "inline", "size": "full",
"hint": "比如输入 a-xxxx-xxx", "mode": "inline",
"required": true, "hint": "请输入一个225000到500000之间的数字",
"min": 225000, "required": true,
"max": 500000, "min": 225000,
"value": 225000, "max": 500000,
"kilobitSeparator": true, "value":"225000",
"suffix": "", "kilobitSeparator": true,
"unitOptions": [ "unitOptions": [
{ {
"label": "kHz", "label": "kHz"
"value": "k" }
} ]
] },
}, {
{ "type": "button",
"type": "button", "label": "提交",
"label": "按钮10", "id": "submitButton",
"onEvent": { "size": "md",
"click": { "block": false,
"actions": [ "disabledOn": "freq === undefined || freq === ''",
{ "onEvent": {
"ignoreError": false, "click": {
"actionType": "ajax", "actions": [
"outputVar": "responseResult", {
"options": {}, "ignoreError": false,
"api": { "actionType": "ajax",
"url": "/sendData", "outputVar": "responseResult",
"method": "post", "api": {
"requestAdaptor": "", "url": "/sendData",
"adaptor": "", "method": "post",
"messages": {}, "data": {
"data": { "frequency": "${freq}"
"aa": "${number}" }
} },
}, "messages": {
"expression": "${number!=\"\"}" "success": "数据已成功发送",
} "failed": "发送数据失败,请重试"
] }
} }
}, ]
"id": "u:c72878bb1458", }
"size": "md", }
"block": false, },
"disabledOn": "${number!=\"\"}"
},
{ {
"type": "button-group-select", "type": "button-group-select",
"name": "buttonGroupSelect", "name": "buttonGroupSelect",