{
  "type": "page",
  "title": "海外云平台",
  "initApi": "/get_user_info",
  "toolbar": "<i class=\"fa fa-user-circle-o\" aria-hidden=\"true\"></i> 你好，${user.name_cn}",
  "body": [
    {
      "type": "crud",
      "api": "get:/list?page_type=0&cloud_provider=${cloud_provider}&month=${month}&page=${page}&page_size=${perPage}",
      "headerToolbar": [
        {
          "type": "reload",
          "align": "right"
        },
        {
          "type": "button",
          "actionType": "ajax",
          "align": "right",
          "confirmText": "是否下载？",
          "label": "全量导出 Excel",
          "api": "get:/download?page_type=0&cloud_provider=${cloud_provider}&month=${month}"
        },
        {
          "type": "columns-toggler",
          "align": "right",
          "draggable": true,
          "label": "自定义显示列"
        }
      ],
      "footerToolbar": [
        "switch-per-page",
        "pagination",
        "statistics"
      ],
      "syncLocation": true,
      "hideQuickSaveBtn": true,
      "keepItemSelectionOnPageChange": true,
      "alwaysShowPagination": true,
      "submitOnChange": true,
      "filter": {
        "actions": [
          {
            "type": "reset",
            "label": "重置"
          },
          {
            "type": "submit",
            "label": "搜索",
            "level": "primary"
          }
        ],
        "mode": "inline",
        "body": [
          {
            "type": "select",
            "name": "cloud_provider",
            "label": "海外云类型",
            "size": "sm",
            "clearable": true,
            "submitOnChange": true,
            "options": [
              {
                "label": "AWS",
                "value": "aws"
              },
              {
                "label": "AWS CN",
                "value": "awscn"
              },
              {
                "label": "GCP",
                "value": "gcp"
              }
            ]
          },
          {
            "type": "input-month",
            "name": "month",
            "label": "月份",
            "valueFormat": "YYYY-MM",
            "submitOnChange": true,
            "clearable": true,
            "required": true
          }
        ]
      },
      "columns": [
        {
          "name": "account_id",
          "label": "Account ID"
        },
        {
          "name": "account_name",
          "label": "Account Name"
        },
        {
          "type": "tpl",
          "name": "cloud_provider",
          "label": "云厂商",
          "tpl": "<% if (this.cloud_provider == 'aws') { %> <span class='label label-success'><%= 'AWS' %></span> <% }else if (this.cloud_provider == 'gcp') { %> <span class='label label-warning'><%= 'GCP' %></span> <% } else { %> <span class='label label-info'><%= this.cloud_provider %></span> <% } %>"
        },
        {
          "label": "Invoice Amount",
          "name": "invoice_amount"
        },
        {
          "label": "Year Month",
          "name": "billing_month"
        },
        {
          "label": "DTAZ Discount",
          "name": "dtaz_discount"
        },
        {
          "label": "AWS Invoice Excluding DTAZ",
          "name": "aws_invoice_excluding_dtaz"
        }
        ]
    }
  ]
}