206 lines
7.4 KiB
JSON
206 lines
7.4 KiB
JSON
{
|
|
"type": "page",
|
|
"title": "Hello world",
|
|
"regions": [
|
|
"body"
|
|
],
|
|
"body": [
|
|
{
|
|
"type": "tpl",
|
|
"id": "u:f439a8330e02",
|
|
"tpl": "初始页面",
|
|
"wrapperComponent": "",
|
|
"inline": false
|
|
},
|
|
{
|
|
"type": "grid",
|
|
"columns": [
|
|
{
|
|
"body": [],
|
|
"id": "u:39c97acec8cc"
|
|
},
|
|
{
|
|
"body": [
|
|
{
|
|
"type": "collapse-group",
|
|
"activeKey": [
|
|
"1"
|
|
],
|
|
"body": [
|
|
{
|
|
"type": "collapse",
|
|
"key": "1",
|
|
"active": true,
|
|
"header": "通用",
|
|
"body": [
|
|
{
|
|
"type": "button-toolbar",
|
|
"label": "按钮工具栏",
|
|
"data": {
|
|
"x": "yy"
|
|
},
|
|
"buttons": [
|
|
{
|
|
"type": "button",
|
|
"label": "按钮1",
|
|
"onEvent": {
|
|
"click": {
|
|
"actions": [
|
|
{
|
|
"ignoreError": false,
|
|
"script": "const buttonText = context.props.label;\ndoAction({\n actionType: 'ajax',\n args: {\n api: {\n url: '/sendData',\n method: 'post',\n data: {\n buttonLabel: buttonText\n }\n }\n }\n});\n",
|
|
"actionType": "custom"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"id": "u:sendButtonText"
|
|
},
|
|
{
|
|
"type": "button",
|
|
"label": "按钮2",
|
|
"onEvent": {
|
|
"click": {
|
|
"actions": [
|
|
{
|
|
"ignoreError": false,
|
|
"actionType": "custom",
|
|
"script": "const buttonText = context.props.label;\ndoAction({\n actionType: 'ajax',\n args: {\n api: {\n url: '/sendData',\n method: 'post',\n data: {\n buttonLabel: buttonText\n },\n successMessage: '请求成功',\n errorMessage: '请求失败'\n }\n }\n});\n"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"id": "u:8eae2c306cc5"
|
|
}
|
|
],
|
|
"id": "u:b6649c1b1585"
|
|
},
|
|
{
|
|
"type": "input-number",
|
|
"label": "数字输入",
|
|
"name": "freq",
|
|
"keyboard": true,
|
|
"id": "numberInput",
|
|
"step": 12,
|
|
"displayMode": "base",
|
|
"size": "full",
|
|
"mode": "inline",
|
|
"required": true,
|
|
"min": 225000,
|
|
"max": 500000,
|
|
"value": 225000,
|
|
"kilobitSeparator": true,
|
|
"unitOptions": [
|
|
{
|
|
"label": "kHz"
|
|
}
|
|
],
|
|
"placeholder": "225,000到500,000之间"
|
|
},
|
|
{
|
|
"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",
|
|
"label": "单选",
|
|
"inline": false,
|
|
"options": [
|
|
{
|
|
"label": "选项1",
|
|
"value": "a"
|
|
},
|
|
{
|
|
"label": "选项2",
|
|
"value": "b"
|
|
}
|
|
],
|
|
"id": "u:5112d83e3943",
|
|
"multiple": false,
|
|
"value": "a"
|
|
},
|
|
{
|
|
"type": "switch",
|
|
"label": "天通",
|
|
"option": "说明",
|
|
"name": "switch",
|
|
"falseValue": false,
|
|
"trueValue": true,
|
|
"id": "u:bd2f8c0b2176",
|
|
"onEvent": {
|
|
"change": {
|
|
"weight": 0,
|
|
"actions": [
|
|
{
|
|
"ignoreError": false,
|
|
"actionType": "custom",
|
|
"script": "const buttonText = context.props.label + (!context.props.value?'开':'关');\ndoAction({\n actionType: 'ajax',\n args: {\n api: {\n url: '/sendData',\n method: 'post',\n data: {\n buttonLabel: buttonText\n },\n successMessage: '请求成功',\n errorMessage: '请求失败'\n }\n }\n});\n"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"id": "u:53511e674086"
|
|
},
|
|
{
|
|
"type": "collapse",
|
|
"header": "调试",
|
|
"body": [
|
|
{
|
|
"type": "tpl",
|
|
"tpl": "内容",
|
|
"wrapperComponent": "",
|
|
"inline": false,
|
|
"id": "u:6f92531bd161"
|
|
}
|
|
],
|
|
"key": "6",
|
|
"id": "u:4ad528b09137"
|
|
}
|
|
],
|
|
"id": "u:8035637b2ce6"
|
|
}
|
|
],
|
|
"id": "u:63b382ec7d2f"
|
|
}
|
|
],
|
|
"id": "u:a9f37a6134a4"
|
|
}
|
|
],
|
|
"id": "u:ddf6e6d384e7",
|
|
"pullRefresh": {
|
|
"disabled": true
|
|
},
|
|
"data": {
|
|
"x": "xx"
|
|
},
|
|
"asideResizor": false
|
|
} |