Skip to content

Data Presentation

API Design

For the Disaster Prevention Reporting page, the JSON field definitions are as follows. Development only requires adherence to these specifications. Disaster prevention report types can be defined via JSON, with customized content for incident descriptions in sub-form items.

/disaster-report

JSON
{
  "data": [
    {
      "id": "D-1",
      "name": "民生、基礎設施災情",
      "icon": "/images/disaster/icon-general-damage.svg",
      "options": [
        {
          "id": "D-1-1",
          "name": "電線(桿)或纜線受損",
          "form_format": [
            {
              "type": "checkbox_group",
              "label": "人員傷亡",
              "field": "casualties",
              "options": [
                {
                  "label": "傷亡",
                  "value": "傷亡"
                },
                {
                  "label": "受困",
                  "value": "受困"
                },
                {
                  "label": "失蹤",
                  "value": "失蹤"
                }
              ]
            },
            {
              "type": "checkbox_group",
              "label": "影響交通",
              "field": "traffic",
              "options": [
                {
                  "label": "道路",
                  "value": "道路"
                },
                {
                  "label": "巷弄",
                  "value": "巷弄"
                },
                {
                  "label": "人行道",
                  "value": "人行道"
                }
              ]
            },
            {
              "type": "checkbox_group",
              "label": "電纜線掉落",
              "field": "cable_wire",
              "options": [
                {
                  "label": "電纜掉落,恐有安全之虞",
                  "value": "電纜掉落,恐有安全之虞"
                },
                {
                  "label": "電力線掉落,恐有安全之虞",
                  "value": "電力線掉落,恐有安全之虞"
                },
                {
                  "label": "第四台電纜線掉落,恐有安全之虞",
                  "value": "第四台電纜線掉落,恐有安全之虞"
                },
                {
                  "label": "cctv電纜線掉落,恐有安全之虞",
                  "value": "cctv電纜線掉落,恐有安全之虞"
                },
                {
                  "label": "壓倒民宅",
                  "value": "壓倒民宅"
                }
              ]
            }
          ]
        },
        {
          "id": "D-1-2",
          "name": "變電所、電廠受災",
          "form_format": [
            {
              "type": "checkbox_group",
              "label": "人員傷亡",
              "field": "casualties",
              "options": [
                {
                  "label": "傷亡",
                  "value": "傷亡"
                },
                {
                  "label": "受困",
                  "value": "受困"
                },
                {
                  "label": "失蹤",
                  "value": "失蹤"
                }
              ]
            },
            {
              "type": "checkbox_group",
              "label": "影響交通",
              "field": "traffic",
              "options": [
                {
                  "label": "道路",
                  "value": "道路"
                },
                {
                  "label": "巷弄",
                  "value": "巷弄"
                },
                {
                  "label": "人行道",
                  "value": "人行道"
                }
              ]
            },
            {
              "type": "checkbox_group",
              "label": "附近全面停電",
              "field": "power_failure",
              "options": [
                {
                  "label": "變電箱",
                  "value": "變電箱"
                },
                {
                  "label": "變電所",
                  "value": "變電所"
                },
                {
                  "label": "電廠受災",
                  "value": "電廠受災"
                }
              ]
            }
          ]
        },
        {
          "id": "D-1-3",
          "name": "路燈故障",
          "form_format": [
            {
              "type": "checkbox_group",
              "label": "人員傷亡",
              "field": "casualties",
              "options": [
                {
                  "label": "傷亡",
                  "value": "傷亡"
                },
                {
                  "label": "受困",
                  "value": "受困"
                },
                {
                  "label": "失蹤",
                  "value": "失蹤"
                }
              ]
            },
            {
              "type": "checkbox_group",
              "label": "影響交通",
              "field": "traffic",
              "options": [
                {
                  "label": "道路",
                  "value": "道路"
                },
                {
                  "label": "巷弄",
                  "value": "巷弄"
                },
                {
                  "label": "人行道",
                  "value": "人行道"
                }
              ]
            },
            {
              "type": "input",
              "label": "路燈傾倒(傾倒盞)",
              "field": "street_lamp_fall"
            },
            {
              "type": "input",
              "label": "路燈傾倒(失明盞)",
              "field": "street_lamp_lost"
            }
          ]
        },
        {
          "id": "D-1-4",
          "name": "電力停電",
          "form_format": [
            {
              "type": "checkbox_group",
              "label": "人員傷亡",
              "field": "casualties",
              "options": [
                {
                  "label": "傷亡",
                  "value": "傷亡"
                },
                {
                  "label": "受困",
                  "value": "受困"
                },
                {
                  "label": "失蹤",
                  "value": "失蹤"
                }
              ]
            },
            {
              "type": "checkbox_group",
              "label": "影響交通",
              "field": "traffic",
              "options": [
                {
                  "label": "道路",
                  "value": "道路"
                },
                {
                  "label": "巷弄",
                  "value": "巷弄"
                },
                {
                  "label": "人行道",
                  "value": "人行道"
                }
              ]
            },
            {
              "type": "checkbox_group",
              "label": "停電範圍",
              "field": "power_failure_range",
              "options": [
                {
                  "label": "整棟大樓不亮",
                  "value": "整棟大樓不亮"
                },
                {
                  "label": "整排巷弄不亮",
                  "value": "整排巷弄不亮"
                },
                {
                  "label": "整區不亮",
                  "value": "整區不亮"
                },
                {
                  "label": "請提供發電機供維生系統運作",
                  "value": "請提供發電機供維生系統運作"
                }
              ]
            }
          ]
        }
      ]
    },
  ]
}

Data Field Description

FieldPurposeExample
idDisaster type IDD-1
nameDisaster type name民生、基礎設施災情
iconDisaster type icon URL (icons stored locally can be placed in the public folder)/images/disaster/icon-general-damage.svg
optionsReporting categories under this disaster typeRefer to options
options
FieldPurposeExample
idReport item IDD-1-3
nameReport item name路燈故障
form_formatCustomized information for the incident description form fieldsRefer to form_format
form_format
FieldPurposeExample
typeForm field type(checkbox_group, input)checkbox_group
labelField label路燈傾倒(失明盞)
fieldField name for form data (determined based on the receiving API's design)street_lamp_lost
optionsOnly applicable to checkbox_group, providing options for checkboxesRefer to checkbox_group-options
checkbox_group-options
FieldPurposeExample
labelCheckbox option name整棟大樓不亮
valueCheckbox option value (defined based on the receiving API's data requirements)整棟大樓不亮