| | |
| | | let amis = amisRequire('amis/embed'); |
| | | // 通过替换下面这个配置来生成不同页面 |
| | | let amisJSON = { |
| | | "type": "form", |
| | | "title": "测试页面2", |
| | | "regions": [ |
| | | "body", |
| | | "toolbar", |
| | | "header" |
| | | ], |
| | | "type": "page", |
| | | "id": "u:8c028a595aa6", |
| | | "body": [ |
| | | { |
| | | "type": "select", |
| | | "label": "所属运营商:", |
| | | "name": "operator", |
| | | "id": "u:970f68a2c4ee", |
| | | "mode": "horizontal", |
| | | "size": "lg", |
| | | "multiple": false, |
| | | "source": { |
| | | "url": "/api/v1/rep/cus/", |
| | | "method": "get", |
| | | "messages": { |
| | | } |
| | | }, |
| | | "labelField": "customerName", |
| | | "valueField": "id", |
| | | "required": true, |
| | | "showInvalidMatch": false, |
| | | "searchable": true, |
| | | "clearable": true, |
| | | "horizontal": { |
| | | "leftFixed": "lg" |
| | | } |
| | | }, |
| | | { |
| | | "type": "input-city", |
| | | "label": "所在省:", |
| | | "name": "province", |
| | | "id": "u:091b190331f6", |
| | | "mode": "horizontal", |
| | | "allowCity": false, |
| | | "allowDistrict": false, |
| | | "onEvent": { |
| | | "change": { |
| | | "weight": 0, |
| | | "actions": [ |
| | | { |
| | | "componentId": "u:63c85c19f3aa", |
| | | "actionType": "reload", |
| | | "dataMergeMode": "merge" |
| | | "type": "form", |
| | | "id": "u:24af29be25d2", |
| | | "title": "表单", |
| | | "body": [ |
| | | { |
| | | "label": "所属运营商:", |
| | | "type": "select", |
| | | "name": "operator", |
| | | "id": "u:970f68a2c4ee", |
| | | "mode": "horizontal", |
| | | "size": "lg", |
| | | "multiple": false, |
| | | "source": { |
| | | "url": "/api/v1/rep/cus/", |
| | | "method": "get", |
| | | "messages": { |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | "type": "select", |
| | | "label": "所在市:", |
| | | "name": "city", |
| | | "id": "u:63c85c19f3aa", |
| | | "multiple": false, |
| | | "mode": "horizontal", |
| | | "size": "md", |
| | | "horizontal": { |
| | | "leftFixed": "lg" |
| | | }, |
| | | "source": { |
| | | "url": "/coursePackage/queryCity1/$province", |
| | | "method": "post", |
| | | "messages": { |
| | | }, |
| | | "labelField": "customerName", |
| | | "valueField": "id", |
| | | "showInvalidMatch": false, |
| | | "searchable": true, |
| | | "clearable": true, |
| | | "horizontal": { |
| | | "leftFixed": "lg" |
| | | } |
| | | }, |
| | | "sendOn": "this.province != null &&this.province != ' '" |
| | | }, |
| | | "onEvent": { |
| | | "change": { |
| | | "weight": 0, |
| | | "actions": [ |
| | | { |
| | | "componentId": "u:576899b1b531", |
| | | "actionType": "reload", |
| | | "dataMergeMode": "merge" |
| | | { |
| | | "type": "input-city", |
| | | "label": "所在省:", |
| | | "name": "province", |
| | | "id": "u:091b190331f6", |
| | | "mode": "horizontal", |
| | | "allowCity": false, |
| | | "allowDistrict": false, |
| | | "onEvent": { |
| | | "change": { |
| | | "weight": 0, |
| | | "actions": [ |
| | | { |
| | | "componentId": "u:63c85c19f3aa", |
| | | "actionType": "reload", |
| | | "dataMergeMode": "merge" |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | "labelField": "name", |
| | | "valueField": "code" |
| | | }, |
| | | { |
| | | "type": "select", |
| | | "label": "所属门店:", |
| | | "name": "store", |
| | | "id": "u:576899b1b531", |
| | | "multiple": false, |
| | | "mode": "horizontal", |
| | | "size": "md", |
| | | "horizontal": { |
| | | "leftFixed": "lg" |
| | | }, |
| | | "source": { |
| | | "method": "post", |
| | | "url": "/coursePackage/queryStore1/$city", |
| | | "messages": { |
| | | } |
| | | }, |
| | | "sendOn": "this.city != null &&this.city != ' '" |
| | | }, |
| | | "labelField": "name", |
| | | "valueField": "id", |
| | | "onEvent": { |
| | | "change": { |
| | | "weight": 0, |
| | | "actions": [ |
| | | { |
| | | "componentId": "u:0d288f4bdd8e", |
| | | "actionType": "reload", |
| | | "dataMergeMode": "merge" |
| | | { |
| | | "type": "select", |
| | | "label": "所在市:", |
| | | "name": "city", |
| | | "id": "u:63c85c19f3aa", |
| | | "multiple": false, |
| | | "mode": "horizontal", |
| | | "size": "md", |
| | | "horizontal": { |
| | | "leftFixed": "lg" |
| | | }, |
| | | "source": { |
| | | "url": "/coursePackage/queryCity1/$province", |
| | | "method": "post", |
| | | "messages": { |
| | | }, |
| | | { |
| | | "componentId": "u:0d288f4bdd8e", |
| | | "args": { |
| | | "value": " " |
| | | }, |
| | | "actionType": "setValue" |
| | | "sendOn": "this.province != null &&this.province != ' '" |
| | | }, |
| | | "onEvent": { |
| | | "change": { |
| | | "weight": 0, |
| | | "actions": [ |
| | | { |
| | | "componentId": "u:576899b1b531", |
| | | "actionType": "reload", |
| | | "dataMergeMode": "merge" |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | }, |
| | | "labelField": "name", |
| | | "valueField": "code" |
| | | }, |
| | | { |
| | | "type": "select", |
| | | "label": "所属门店:", |
| | | "name": "store", |
| | | "id": "u:576899b1b531", |
| | | "multiple": false, |
| | | "mode": "horizontal", |
| | | "size": "md", |
| | | "horizontal": { |
| | | "leftFixed": "lg" |
| | | }, |
| | | "source": { |
| | | "method": "post", |
| | | "url": "/coursePackage/queryStore1/$city", |
| | | "messages": { |
| | | }, |
| | | "sendOn": "this.city != null &&this.city != ' '" |
| | | }, |
| | | "labelField": "name", |
| | | "valueField": "id", |
| | | "onEvent": { |
| | | "change": { |
| | | "weight": 0, |
| | | "actions": [ |
| | | { |
| | | "componentId": "u:0d288f4bdd8e", |
| | | "actionType": "reload", |
| | | "dataMergeMode": "merge" |
| | | }, |
| | | { |
| | | "componentId": "u:0d288f4bdd8e", |
| | | "args": { |
| | | "value": " " |
| | | }, |
| | | "actionType": "setValue" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | "type": "select", |
| | | "label": "所属场地:", |
| | | "name": "site", |
| | | "id": "u:0d288f4bdd8e", |
| | | "multiple": false, |
| | | "mode": "horizontal", |
| | | "size": "md", |
| | | "horizontal": { |
| | | "leftFixed": "lg" |
| | | }, |
| | | "source": { |
| | | "url": "/coursePackage/querySite", |
| | | "method": "post", |
| | | "messages": { |
| | | }, |
| | | "data": { |
| | | "storeId": "$store" |
| | | }, |
| | | "dataType": "form" |
| | | }, |
| | | "labelField": "name", |
| | | "valueField": "id" |
| | | }, |
| | | { |
| | | "type": "tpl", |
| | | "tpl": "设备ID:", |
| | | "inline": true, |
| | | "wrapperComponent": "", |
| | | "id": "u:587781d5d181", |
| | | "style": { |
| | | "marginLeft": "0" |
| | | } |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | | "label": "蓝色方", |
| | | "name": "blue", |
| | | "id": "u:a4dbdeb9165e", |
| | | "mode": "inline" |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | | "label": "红色方", |
| | | "name": "red", |
| | | "id": "u:b0544634a698", |
| | | "mode": "inline" |
| | | }, |
| | | { |
| | | "type": "button", |
| | | "label": "按钮", |
| | | "onEvent": { |
| | | "click": { |
| | | "actions": [ |
| | | { |
| | | "componentId": "u:24af29be25d2", |
| | | "actionType": "submit" |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | "id": "u:b96a47957f17" |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | "type": "select", |
| | | "label": "所属场地:", |
| | | "name": "site", |
| | | "id": "u:0d288f4bdd8e", |
| | | "multiple": false, |
| | | "mode": "horizontal", |
| | | "size": "md", |
| | | "horizontal": { |
| | | "leftFixed": "lg" |
| | | }, |
| | | "source": { |
| | | "url": "/coursePackage/querySite", |
| | | ], |
| | | "api": { |
| | | "url": "/ball/save", |
| | | "method": "post", |
| | | "messages": { |
| | | }, |
| | | "data": { |
| | | "storeId": "$store" |
| | | }, |
| | | "dataType": "form" |
| | | }, |
| | | "labelField": "name", |
| | | "valueField": "id" |
| | | }, |
| | | { |
| | | "type": "tpl", |
| | | "tpl": "设备ID:", |
| | | "inline": true, |
| | | "wrapperComponent": "", |
| | | "id": "u:587781d5d181", |
| | | "style": { |
| | | "marginLeft": "0" |
| | | } |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | | "label": "蓝色方", |
| | | "name": "blue", |
| | | "id": "u:a4dbdeb9165e", |
| | | "mode": "inline" |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | | "label": "红色方", |
| | | "name": "red", |
| | | "id": "u:b0544634a698", |
| | | "mode": "inline" |
| | | } |
| | | ], |
| | | "id": "u:44bc9a4182ef", |
| | | "toolbar": [ |
| | | { |
| | | "type": "button", |
| | | "label": "按钮", |
| | | "onEvent": { |
| | | "click": { |
| | | "actions": [ |
| | | ] |
| | | } |
| | | }, |
| | | "id": "u:e54b81466b5e" |
| | | } |
| | | ] |
| | | }; |