{
  "metadata": {
    "type": "image_upload",
    "label": "图片上传",
    "icon": "fa-upload",
    "color": "#06b6d4",
    "description": "上传图片文件",
    "group": "输入",
    "component_type": "GenericNode"
  },
  "properties": {
    "save_location": {
      "type": "string",
      "title": "保存位置",
      "enum": [
        "auto",
        "file",
        "record"
      ],
      "enumNames": [
        "自动（推荐）",
        "保存到文件库",
        "保存到指定记录"
      ],
      "default": "auto",
      "description": "选择图片保存的位置"
    },
    "target_pagetype": {
      "type": "string",
      "title": "页面类型",
      "description": "指定要关联的页面类型，如：Jsite Product、Jsite Article",
      "condition": {
        "save_location": "record"
      }
    },
    "target_name": {
      "type": "string",
      "title": "页面ID",
      "description": "指定要关联的页面ID",
      "condition": {
        "save_location": "record"
      }
    },
    "save_field": {
      "type": "string",
      "title": "保存字段",
      "description": "指定要保存图片的字段名称"
    },
    "filename_prefix": {
      "type": "string",
      "title": "文件名前缀",
      "description": "图片文件名将包含此前缀，如：product_"
    },
    "show_output_handle": {
      "type": "boolean",
      "title": "显示输出接口",
      "default": false,
      "description": ""
    }
  },
  "required": [],
  "dependencies": {
    "save_location": {
      "oneOf": [
        {
          "properties": {
            "save_location": {
              "enum": [
                "auto",
                "file"
              ]
            }
          }
        },
        {
          "properties": {
            "save_location": {
              "enum": [
                "record"
              ]
            },
            "target_pagetype": {
              "type": "string",
              "minLength": 1
            },
            "target_name": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "target_pagetype",
            "target_name"
          ]
        }
      ]
    }
  },
  "_layout": {
    "tabs": [
      {
        "id": "tab_1",
        "label": "基础配置",
        "sections": [
          {
            "id": "section_1",
            "label": "保存设置",
            "columns": [
              {
                "id": "column_1",
                "label": "主要配置",
                "fields": [
                  "save_location",
                  "show_output_handle"
                ]
              },
              {
                "id": "column_2",
                "label": "文件设置",
                "fields": [
                  "save_field",
                  "filename_prefix"
                ]
              }
            ]
          }
        ]
      },
      {
        "id": "tab_2",
        "label": "记录关联",
        "sections": [
          {
            "id": "section_2",
            "label": "关联配置",
            "columns": [
              {
                "id": "column_3",
                "label": "记录设置",
                "fields": [
                  "target_pagetype",
                  "target_name"
                ]
              }
            ]
          }
        ]
      }
    ],
    "activeTab": "tab_1"
  }
}