{
  "type": "form",
  "title": "上传素材",
  "body": [
    {
      "label": "渠道类型",
      "type": "radios",
      "name": "sendChannel",
      "required": true,
      "options": [
        {
          "label": "钉钉（工作消息）",
          "value": "90"
        }
      ]
    },
    {
      "type": "select",
      "label": "微信服务号账号",
      "name": "sendAccount",
      "source": "${ls:backend_url}/account/queryByChannelType?channelType=50&creator=${ls:openId}",
      "visibleOn": "this.sendChannel == 50",
      "clearValueOnHidden": false,
      "required": true,
      "size": "lg"
    },
    {
      "type": "select",
      "label": "微信小程序账号",
      "name": "sendAccount",
      "source": "${ls:backend_url}/account/queryByChannelType?channelType=60&creator=${ls:openId}",
      "visibleOn": "this.sendChannel == 60",
      "clearValueOnHidden": false,
      "required": true,
      "size": "lg"
    },
    {
      "type": "select",
      "label": "企业微信（工作消息）",
      "name": "sendAccount",
      "source": "${ls:backend_url}/account/queryByChannelType?channelType=70&creator=${ls:openId}",
      "visibleOn": "this.sendChannel == 70",
      "clearValueOnHidden": false,
      "required": true,
      "size": "lg"
    },
    {
      "type": "select",
      "label": "钉钉（工作消息）账号",
      "name": "sendAccount",
      "source": "${ls:backend_url}/account/queryByChannelType?channelType=90&creator=${ls:openId}",
      "visibleOn": "this.sendChannel == 90",
      "clearValueOnHidden": false,
      "required": true,
      "size": "lg"
    },
    {
      "type": "radios",
      "label": "文件类型",
      "name": "fileType",
      "required": true,
      "options": [
        {
          "label": "图片",
          "value": "10"
        },
        {
          "label": "语音",
          "value": "20"
        },
        {
          "label": "普通文件",
          "value": "30"
        },
        {
          "label": "视频",
          "value": "40"
        }
      ]
    },
    {
      "type": "input-file",
      "label": "上传素材",
      "name": "file",
      "required": true,
      "asBlob": true
    },
    {
      "type": "static",
      "name": "id",
      "visibleOn": "typeof data.id !== 'undefined'",
      "label": "返回 ID"
    }
  ],
  "api": {
    "url": "${ls:backend_url}/material/upload",
    "method": "post",
    "data": {
      "sendChannel": "${sendChannel}",
      "sendAccount": "${sendAccount}",
      "fileType": "${fileType}",
      "file": "${file}"
    }
  }
}