<template>
  <div class="dialog" v-if="dialogForm">
    <div class="head_box">
      <span class="title">重点人员深度发掘</span>
      <div>
        <el-button size="small" @click="close">关闭</el-button>
      </div>
    </div>
    <div class="cntinfo">
      <el-form :model="listQuery" :label-width="120" label-position="right">
        <div class="section-title">管理信息</div>
        <div class="form-row">
          <el-form-item label="管理单位">
            <el-input v-model="listQuery.glDw" placeholder="请输入"/>
          </el-form-item>
          <el-form-item label="管辖区域">
            <el-input v-model="listQuery.gxqy" placeholder="请输入"/>
          </el-form-item>
          <el-form-item label="联系人">
            <el-input v-model="listQuery.lxr" placeholder="请输入"/>
          </el-form-item>
          <el-form-item label="联系方式">
            <el-input v-model="listQuery.lxfs" placeholder="请输入"/>
          </el-form-item>
        </div>
        <div class="form-row">
          <el-form-item label="管理事由" class="full-width">
            <el-input type="textarea" v-model="listQuery.glSy" placeholder="请输入"/>
          </el-form-item>
        </div>

        <div class="section-title">申请信息</div>
        <div class="form-row">
          <el-form-item label="申请单位">
            <el-input v-model="listQuery.sqDw" placeholder="请输入"/>
          </el-form-item>
          <el-form-item label="申请人">
            <el-input v-model="listQuery.sqr" placeholder="请输入"/>
          </el-form-item>
          <el-form-item label="审核单位">
            <el-input v-model="listQuery.shdw" placeholder="请输入"/>
          </el-form-item>
          <el-form-item label="审核人">
            <el-input v-model="listQuery.shr" placeholder="请输入"/>
          </el-form-item>
        </div>
   
        <div class="form-row">
          <el-form-item label="审批单位">
            <el-input v-model="listQuery.sqDwDz" placeholder="请输入"/>
          </el-form-item>
          <el-form-item label="接受单位类型" class="full-width">
            <el-select v-model="listQuery.jsdwlx">
              <el-options :label="1">是</el-options>
              <el-options :label="0">否</el-options>
            </el-select>
          </el-form-item>
          <el-form-item label="是否同意" class="full-width">
            <el-select v-model="listQuery.sfty">
              <el-options :label="1">是</el-options>
              <el-options :label="0">否</el-options>
            </el-select>
          </el-form-item>
          <el-form-item label="反馈时间" class="full-width">
            <el-date-picker
              v-model="listQuery.fksj"
              type="datetime"
              placeholder="选择日期时间"
              style="width: 100%"
            />
          </el-form-item>
        </div>
      </el-form>
    </div>
  </div>
</template>

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

const dialogForm = ref(false);
const listQuery = ref({
  glDw: '',
  glQy: '',
  lxr: '',
  lxfs: '',
  glSy: '',
  sqDw: '',
  sqr: '',
  lxdz: '',
  shr: '',
  sqDwDz: '',
  shr2: '',
  sfty: 1,
  fksj: '',
  files: []
});

// 初始化数据
const init = (type, row) => {
  dialogForm.value = true;
  if (row) {
    Object.assign(listQuery.value, row);
  }
};

const close = () => {
  dialogForm.value = false;
  listQuery.value = {
    glDw: '',
    glQy: '',
    lxr: '',
    lxfs: '',
    glSy: '',
    sqDw: '',
    sqr: '',
    lxdz: '',
    shr: '',
    sqDwDz: '',
    shr2: '',
    sfty: 1,
    fksj: '',
    files: []
  };
};

const handleFileChange = (file) => {
  listQuery.value.files.push(file);
};

defineExpose({init});
</script>

<style lang="scss" scoped>
.dialog {
  padding: 20px;

  .head_box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }

  .cntinfo {
    height: calc(100% - 70px);
    overflow: hidden;
    overflow-y: auto;
    padding: 20px;
  }

  .section-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 20px 0 15px;
    padding-left: 10px;
    border-left: 4px solid #409EFF;
  }

  .form-row {
    display: flex;
    margin-bottom: 20px;
    .el-form-item {
      flex: 1 0 0;
      margin-right: 20px;
    }
    .full-width {
      flex: 2;
    }
  }


  .upload-demo {
    width: 100%;
    padding: 20px;
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    text-align: center;

    .el-upload__tip {
      margin-top: 10px;
      color: #909399;
    }
  }
}

</style>
