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