<template>
  <ant-modal
    modalWidth="576"
    modalHeight="500"
    :visible="open"
    :modal-title="formTitle"
    :adjust-size="true"
    @cancel="cancel"
  >
    <a-form-model ref="form" :model="form" :rules="rules" slot="content" layout="vertical">
      <a-row :gutter="32">
        <a-col :span="12">
          <a-form-model-item label="设备ID" prop="objectId">
            <a-input v-model="form.objectId" placeholder="请输入设备ID"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="设备号" prop="macId">
            <a-input v-model="form.macId" placeholder="请输入设备号"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="设备名称" prop="fullName">
            <a-input v-model="form.fullName" placeholder="请输入设备名称"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="设备型号" prop="macName">
            <a-input v-model="form.macName" placeholder="请输入设备型号"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="发生时间" prop="alarmime">
            <a-date-picker
              v-model="form.alarmime"
              valueFormat="YYYY-MM-DD"
              :show-today="true"
              placeholder="选择日期"
              style="width: 100%"
            />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="服务器处理时间" prop="addtime">
            <a-date-picker
              v-model="form.addtime"
              valueFormat="YYYY-MM-DD"
              :show-today="true"
              placeholder="选择日期"
              style="width: 100%"
            />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="速度" prop="speed">
            <a-input v-model="form.speed" placeholder="请输入速度"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="纬度" prop="lat">
            <a-input v-model="form.lat" placeholder="请输入纬度"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="经度" prop="lon">
            <a-input v-model="form.lon" placeholder="请输入经度"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="方向" prop="dir">
            <a-input v-model="form.dir" placeholder="请输入方向"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="描述" prop="describe">
            <a-textarea v-model="form.describe" placeholder="请输入描述" :rows="4"/>
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row :gutter="32">
        <a-col :span="12">
          <a-form-model-item label="二级分类" prop="classify">
            <a-input v-model="form.classify" placeholder="请输入二级分类"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12" >
          <a-form-model-item label="状态" prop="status">
            <a-radio-group v-model="form.status">
              <a-radio
                v-for="(dict, index) in statusOptions"
                :key="index"
                :value="dict.dictValue"
              >
                {{ dict.dictLabel }}
              </a-radio>
            </a-radio-group>
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>
    <template slot="footer">
      <a-button :disabled="disabled" @click="cancel">
        取消
      </a-button>
      <a-button type="primary" :disabled="disabled" @click="submitForm(true)">
        保存
      </a-button>
    </template>
  </ant-modal>
</template>
<script>
import SysAlarmAddForm from './SysAlarmForm'
export default {
  ...SysAlarmAddForm
}
</script>
