<template>
  <div class="control-area">
    <div class="map"></div>
    <el-form :model="formData" label-width="auto" label-position="left">
      <!-- 布控类型 -->
      <el-form-item label="布控类型">
        <el-radio-group v-model="formData.controlType">
          <el-radio-button label="人员布控">人员布控</el-radio-button>
          <el-radio-button label="车辆布控">车辆布控</el-radio-button>
          <el-radio-button label="电话布控信息">电话布控信息</el-radio-button>
          <el-radio-button label="网络信息">网络信息</el-radio-button>
          <el-radio-button label="人像布控">人像布控</el-radio-button>
        </el-radio-group>
      </el-form-item>

      <!-- 时间选择 -->
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="布控开始时间">
            <el-date-picker
              v-model="formData.startTime"
              type="datetime"
              placeholder="选择开始时间"
              format="YYYY-MM-DD HH:mm"
              value-format="YYYY-MM-DD HH:mm"
              style="width: 100%"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="布控结束时间">
            <el-date-picker
              v-model="formData.endTime"
              type="datetime"
              placeholder="选择结束时间"
              format="YYYY-MM-DD HH:mm"
              value-format="YYYY-MM-DD HH:mm"
              style="width: 100%"
            />
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 布控要求和级别 -->
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="处置要求">
            <el-select v-model="formData.requirement" placeholder="请选择">
              <el-option label="实时跟踪" value="track" />
              <!-- 添加更多选项 -->
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="布控等级">
            <el-select v-model="formData.level" placeholder="请选择">
              <el-option label="请选择" value="" />
              <!-- 添加更多选项 -->
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="布控要旨">
            <el-select v-model="formData.purpose" placeholder="请选择">
              <el-option label="请选择" value="" />
              <!-- 添加更多选项 -->
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="布控地址">
            <el-select v-model="formData.location" placeholder="请选择">
              <el-option label="请选择" value="" />
              <!-- 添加更多选项 -->
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 布控事由 -->
      <el-form-item label="布控事由">
        <el-input v-model="formData.reason" type="textarea" :rows="4" placeholder="请输入布控事由" />
      </el-form-item>

      <!-- 上传附件 -->
      <el-form-item label="上传附件">
        <el-upload action="#" :auto-upload="false" :on-change="handleFileChange" :file-list="fileList">
          <el-button type="primary">
            <el-icon><Plus /></el-icon>
            支持jpg、png、pdf等上传
          </el-button>
        </el-upload>
      </el-form-item>
    </el-form>
  </div>
</template>

<script setup>
  import { ref } from "vue";

  const formData = ref({
    controlType: "人员布控",
    startTime: "",
    endTime: "",
    requirement: "",
    level: "",
    purpose: "",
    location: "",
    reason: ""
  });

  const fileList = ref([]);

  const handleFileChange = (file, fileList) => {
    console.log(file, fileList);
  };
</script>

<style lang="scss" scoped>
  .control-area {
    .map {
      height: 200px;
      border: 1px solid #ccc;
      border-radius: 5px;
      box-sizing: border-box;
      margin: 10px 0;
    }
    .el-form {
      /* max-width: 1200px;
    margin: 20px auto; */
    }

    :deep(.el-textarea__inner) {
      font-family: inherit;
    }
  }
</style>
