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
import win.ui;
/*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(
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}
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;};
)
/*}}*/
@ -110,7 +111,7 @@ schema = function(v){
}
udpSend = function(d){
console.log(d)
console.dumpJson(d)
}

View File

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