name: newimport
amis_schema: |-
  {
      "type": "service",
      "body": [
          {
              "type": "button",
              "label": "${'flows.newimport.import_process' | t}",
              "id": "u:newimport",
              "onEvent": {
                  "click": {
                      "weight": 0,
                      "actions": [
                          {
                              "actionType": "dialog",
                              "dialog": {
                                  "type": "dialog",
                                  "title": "${'flows.newimport.import_process' | t}",
                                  "body": [
                                      {
                                          "type": "form",
                                          "id": "u:c3939955b0ca",
                                          "title": "表单",
                                          "body": [
                                              {
                                                  "type": "input-file",
                                                  "label": "${'flows.newimport.file_select' | t}",
                                                  "name": "file",
                                                  "receiver": {
                                                      "url": "${context.rootUrl}/api/workflow/import/form",
                                                      "method": "post",
                                                      "requestAdaptor": "",
                                                      "messages": {},
                                                      "adaptor": ""
                                                  },
                                                  "id": "u:35c4a3d2311a",
                                                  "btnLabel": "文件上传",
                                                  "multiple": false,
                                                  "accept": "*",
                                                  "asBlob": true,
                                                  "proxy": true,
                                                  "autoUpload": true,
                                                  "useChunk": false,
                                                  "drag": false,
                                                  "uploadType": "fileReceptor",
                                                  "formType": "asBlob"
                                              },
                                              {
                                                  "type": "steedos-field",
                                                  "config": {
                                                      "type": "lookup",
                                                      "label": "${'flows.newimport.division' | t}",
                                                      "id": "u:30ec6c98cb3d",
                                                      "reference_to": "company",
                                                      "name": "company_id"
                                                  },
                                                  "id": "u:645cc3044eed"
                                              }
                                          ],
                                          "api": {
                                              "method": "post",
                                              "url": "${context.rootUrl}/api/workflow/import/form?space=",
                                              "messages": {},
                                              "requestAdaptor": "api.url += api.body.global.spaceId\n\nif (api.body.company_id) {\n  api.url += \"&company_id=\" + api.body.company_id\n}\n\nreturn api;",
                                              "dataType": "json"
                                          }
                                      }
                                  ],
                                  "showCloseButton": true,
                                  "showErrorMsg": true,
                                  "showLoading": true,
                                  "id": "u:0bc7c635285e",
                                  "closeOnEsc": false,
                                  "dataMapSwitch": false
                              }
                          }
                      ]
                  }
              }
          }
      ],
      "regions": [
          "body"
      ],
      "data": {
          "context": {
              "rootUrl": "http://127.0.0.1:5000"
          },
          "app_id": "",
          "tab_id": "",
          "object_name": "",
          "dataComponentId": "",
          "record_id": "",
          "record": {},
          "permissions": {}
      },
      "bodyClassName": "p-0",
      "id": "u:221e2887a757"
  }
is_enable: true
label: 新导入
'on': list
type: amis_button
visible: true
