const schema = {
"type": "object",
"properties": {
"star": {
"type": "number",
"title": "星级",
"x-decorator": "FormItem",
"x-component": "Rate",
"x-validator": [],
"x-component-props": {},
"x-decorator-props": {},
"x-designable-id": "ns6c0ns0xlg",
"x-index": 0,
"name": "star"
},
"avatar": {
"type": "Array<object>",
"title": "图片",
"x-decorator": "FormItem",
"x-component": "Upload",
"x-component-props": {
"textContent": "Upload",
"method": "GET",
"multiple": true
},
"x-validator": [],
"x-decorator-props": {
"tooltip": "",
"asterisk": false
},
"name": "avatar",
"x-designable-id": "1lw5ssnzv0j",
"x-index": 1,
"required": true,
"description": "请上传酒店星级证明图片"
}
},
"x-designable-id": "q8xn8lsfta7"
}
餐厅
选择无,隐藏后面的表单
const schema = {
"type": "object",
"properties": {
"restaurant": {
"type": "boolean",
"title": "餐厅",
"x-decorator": "FormItem",
"x-component": "Radio.Group",
"enum": [
{
"children": [],
"label": "有",
"value": true
},
{
"children": [],
"label": "无",
"value": false
}
],
"x-validator": [],
"x-component-props": {
"optionType": "button",
"buttonStyle": "solid"
},
"x-decorator-props": {},
"name": "restaurant",
"x-designable-id": "zd6iggh08j7",
"x-index": 0,
"default": true
},
"items": {
"type": "object",
"x-validator": [],
"name": "items",
"title": "TOTAL",
"x-designable-id": "jwkzp4y6rhn",
"x-index": 1,
"x-reactions": {
"dependencies": [
{
"property": "value",
"type": "boolean",
"source": "restaurant",
"name": "restaurant"
}
],
"fulfill": {
"state": {
"visible": "{{$deps.restaurant}}"
}
}
},
"properties": {
"name": {
"type": "string",
"title": "餐厅名称",
"x-decorator": "FormItem",
"x-component": "Input",
"x-validator": [],
"x-component-props": {
"placeholder": "请输入餐厅名称"
},
"x-decorator-props": {},
"name": "name",
"x-designable-id": "7awrtm80f44",
"x-index": 0,
"required": true
},
"times": {
"type": "string[]",
"title": "营业时间",
"x-decorator": "FormItem",
"x-component": "TimePicker.RangePicker",
"x-validator": [],
"x-component-props": {
"format": "HH:mm"
},
"x-decorator-props": {},
"name": "times",
"x-designable-id": "oop8aptuxdt",
"x-index": 1
},
"server": {
"type": "Array<string | number>",
"title": "餐厅提供",
"x-decorator": "FormItem",
"x-component": "Checkbox.Group",
"enum": [
{
"children": [],
"label": "早餐",
"value": 1
},
{
"children": [],
"label": "午餐",
"value": 2
}
],
"x-validator": [],
"x-decorator-props": {},
"name": "server",
"x-designable-id": "hoo8eztr4di",
"x-index": 2
},
"avatar": {
"type": "Array<object>",
"title": "图片",
"x-decorator": "FormItem",
"x-component": "Upload",
"x-component-props": {
"textContent": "Upload"
},
"x-validator": [],
"x-decorator-props": {},
"name": "avatar",
"x-designable-id": "1lw5ssnzv0j",
"x-index": 3
}
}
}
},
"x-designable-id": "q8xn8lsfta7"
}