JSON Schema 实现分享弹窗表单
    分享.jpg

    1. {
    2. "form": {
    3. "labelCol": 6,
    4. "wrapperCol": 12
    5. },
    6. "schema": {
    7. "type": "object",
    8. "properties": {
    9. "k1gqvrhtx0o": {
    10. "type": "string | number",
    11. "title": "有效期",
    12. "x-decorator": "FormItem",
    13. "x-component": "Radio.Group",
    14. "enum": [
    15. {
    16. "children": [],
    17. "label": "一天",
    18. "value": "1"
    19. },
    20. {
    21. "children": [],
    22. "label": "7天",
    23. "value": "7"
    24. },
    25. {
    26. "children": [],
    27. "label": "30天",
    28. "value": "30"
    29. },
    30. {
    31. "children": [],
    32. "label": "永久有效",
    33. "value": "all"
    34. }
    35. ],
    36. "x-validator": [],
    37. "x-component-props": {},
    38. "x-decorator-props": {},
    39. "default": "1",
    40. "x-designable-id": "k1gqvrhtx0o",
    41. "x-index": 0
    42. },
    43. "code": {
    44. "type": "Array<string | number>",
    45. "title": "安全验证",
    46. "x-decorator": "FormItem",
    47. "x-component": "Checkbox.Group",
    48. "enum": [
    49. {
    50. "children": [],
    51. "label": "无提取码",
    52. "value": 0
    53. },
    54. {
    55. "children": [],
    56. "label": "有提取码",
    57. "value": 1
    58. }
    59. ],
    60. "x-validator": [],
    61. "x-decorator-props": {},
    62. "name": "code",
    63. "default": "0",
    64. "x-designable-id": "ge26n4ri7kg",
    65. "x-index": 1
    66. },
    67. "codeValue": {
    68. "type": "string",
    69. "title": "提取码",
    70. "x-decorator": "FormItem",
    71. "x-component": "Input",
    72. "x-validator": [],
    73. "x-component-props": {
    74. "placeholder": "请输入6位提取码"
    75. },
    76. "x-decorator-props": {},
    77. "name": "codeValue",
    78. "x-designable-id": "51v07c8810i",
    79. "x-index": 2,
    80. "x-reactions": {
    81. "dependencies": [
    82. {
    83. "property": "value",
    84. "type": "Array<string | number>",
    85. "source": "code",
    86. "name": "code"
    87. }
    88. ],
    89. "fulfill": {
    90. "state": {
    91. "visible": "{{code !== 0}}"
    92. }
    93. }
    94. },
    95. "x-display": "hidden"
    96. }
    97. },
    98. "x-designable-id": "q85iq2nif65"
    99. }
    100. }