File size: 3,472 Bytes
c9d0005
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{
  "schema": {
    "type": "object",
    "properties": {
      "case1": {
        "title": "整体隐藏",
        "type": "object",
        "properties": {
          "showMore": {
            "title": "显示更多",
            "type": "boolean"
          },
          "x1": {
            "title": "输入框1",
            "type": "string",
            "hidden": "{{!formData.case1.showMore}}"
          },
          "x2": {
            "title": "输入框2",
            "type": "string",
            "hidden": "{{!formData.case1.showMore}}"
          }
        }
      },
      "case2": {
        "title": "选项联动",
        "type": "object",
        "properties": {
          "bi": {
            "title": "汇款币种",
            "type": "string",
            "enum": [
              "rmb",
              "dollar"
            ],
            "enumNames": [
              "人民币",
              "美元"
            ]
          },
          "inputName": {
            "title": "金额",
            "tooltip": "{{formData.case2.bi === 'dollar' ? '一次汇款不超过150美元':'一次汇款不超过1000元'}}",
            "type": "string",
            "props": {
              "addonBefore": "{{formData.case2.bi === 'dollar'? '$':'¥'}}",
              "addonAfter": "{{formData.case2.bi === 'dollar'? '美元':'元'}}"
            }
          }
        }
      },
      "case3": {
        "title": "列表/显示不同组件",
        "type": "object",
        "properties": {
          "ruleList": {
            "title": "球员筛选",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "attr": {
                  "title": "标准",
                  "type": "string",
                  "widget": "select",
                  "enum": [
                    "goal",
                    "league"
                  ],
                  "enumNames": [
                    "入球数",
                    "所在联盟"
                  ],
                  "width": "40%"
                },
                "relation": {
                  "title": "关系",
                  "type": "string",
                  "enum": [
                    ">",
                    "<",
                    "="
                  ],
                  "widget": "select",
                  "hidden": "{{rootValue.attr === 'league'}}",
                  "width": "20%"
                },
                "goal": {
                  "title": "入球数",
                  "type": "string",
                  "rules": [
                    {
                      "pattern": "^[0-9]+$",
                      "message": "输入正确得分"
                    }
                  ],
                  "hidden": "{{rootValue.attr === 'league'}}",
                  "width": "40%"
                },
                "league": {
                  "title": "名称",
                  "type": "string",
                  "enum": [
                    "a",
                    "b",
                    "c"
                  ],
                  "enumNames": [
                    "西甲",
                    "英超",
                    "中超"
                  ],
                  "widget": "select",
                  "hidden": "{{rootValue.attr !== 'league'}}",
                  "width": "40%"
                }
              }
            }
          }
        }
      }
    }
  }
}