name: download
amis_schema: |-
  {
      "type": "service",
      "body": [
          {
              "id": "u:download",
              "type": "button",
              "label": "${'CustomAction.cms_files.download' | t}",
              "onEvent": {
                  "click": {
                      "actions": [
                          {
                            "actionType": "custom",
                            "script": "const versions = event.data.versions; window.open((versions[0] && versions[0].url) ? versions[0].url+'' : context.rootUrl+'/api/files/files/'+record.versions[0].value+'')"
                          }
                      ],
                      "weight": 0
                  }
              }
          }
      ],
      "regions": [
          "body"
      ],
      "bodyClassName": "p-0",
      "id": "u:be6e9cd18e15"
  }
is_enable: true
label: 下载
'on': record
type: amis_button
visible: true
