<template>
  <el-dialog
    :title="title"
    :close-on-click-modal="false"
    v-model="visible"
    append-to-body
    width="90%"
  >
    <el-form :model="dataForm" :rules="dataRule" ref="dataFormRef"
             label-width="130px">
      <!-- 基本信息 -->
      <div class="form-section">
        <div class="section-title">基本信息</div>
        <el-row :gutter="20" class="form-row">
          <el-col :span="24">
            <el-form-item label="招生计划" prop="groupId">
              <el-select v-model="dataForm.groupId" filterable :disabled="!dataForm.id ? false : true"
                         placeholder="请选择招生计划" class="w-full">
                <el-option
                  v-for="item in planList"
                  :key="item.id"
                  :label="item.groupName"
                  :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20" class="form-row">
        <el-col :span="6">
          <el-form-item label="姓名" prop="name" >
            <el-input type="text" v-model="dataForm.name" :disabled="type==1 ? false : true"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="曾用名" prop="oldName">
            <el-input type="text" v-model="dataForm.oldName" :disabled="type==1 ? false : true"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="性别" prop="gender">
            <el-select v-model="dataForm.gender" class="w-full" :disabled="type==2 ? false : true" >
              <el-option
                v-for="item in sexy"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="民族" prop="nationality">
            <el-input type="text" v-model="dataForm.nationality" :disabled="type==1 ? false : true"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20" class="form-row">
        <el-col :span="6">
          <el-form-item label="文化程度" prop="degreeOfEducation">
            <el-select v-model="dataForm.degreeOfEducation" filterable placeholder="请选择文化程度" class="w-full" :disabled="type==1 ? false : true" @change="changeEducation">
              <el-option
                v-for="item in eduList"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="是否团员" prop="isLeagueMember">
            <el-select v-model="dataForm.isLeagueMember" filterable clearable placeholder="请选择是否团员" class="w-full" :disabled="type==1 ? false : true">
              <el-option
                v-for="item in yes_no_type"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="是否住宿" prop="isAccommodation">
            <el-select v-model="dataForm.isAccommodation" filterable clearable placeholder="请选择是否住宿" class="w-full" :disabled="type==1 ? false : true">
              <el-option
                v-for="item in yes_no_type"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="户口性质" prop="residenceType">
            <el-select v-model="dataForm.residenceType" filterable clearable placeholder="请选择户口性质" class="w-full" :disabled="type==1 ? false : true">
              <el-option
                v-for="item in residenceTypeList"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20" class="form-row">
        <el-col :span="12">
          <el-form-item label="毕业学校" prop="schoolOfGraduation">
            <el-input type="text" v-model="dataForm.schoolOfGraduation" :disabled="type==1 ? false : true"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <!-- 证件信息 -->
      <el-row :gutter="20" class="form-row">
        <el-col :span="8">
          <el-form-item label="身份证号" prop="idNumber">
            <el-input type="text" v-model="dataForm.idNumber"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="准考证号" prop="examRegistrationNumbers">
            <el-input type="text" v-model="dataForm.examRegistrationNumbers" :disabled="type==1 ? false : true"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="成绩" prop="score">
            <el-input type="text" v-model="dataForm.score" :disabled="type==1 ? false : true" @change="jsZSF"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row v-if="dataForm.degreeOfEducation=='1'" :gutter="20" class="form-row">
        <el-col :span="6">
          <el-form-item label="成绩折算分" prop="correctedScore">
            <el-input type="text" v-model="dataForm.correctedScore" :disabled="type==2 ? false : true"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="当地总分" prop="fullScore">
            <el-input type="text" v-model="dataForm.fullScore" :disabled="isShow" @change="changePlaceScore"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="学校归属地" prop="schoolArea">
            <el-select v-model="dataForm.schoolArea" filterable placeholder="请选择学校归属地" class="w-full" :disabled="type==1 ? false : true" @change="changeFrom">
              <el-option
                v-for="item in schoolFromList"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row v-if="(dataForm.degreeOfEducation) && (dataForm.schoolArea=='2')" :gutter="20" class="form-row">
        <el-col :span="24">
          <el-form-item label="学校所在省市" prop="jsOtherCity">
            <el-select v-model="dataForm.jsOtherCity" filterable placeholder="请选择学校所在省市" class="w-full"
                       :disabled="type==1 ? false : true" @change="changeSchoolCode">
              <el-option
                v-for="item in schoolCodeList"
                :key="item.regionId"
                :label="item.regionName"
                :value="item.regionId">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row v-if="(dataForm.degreeOfEducation) && (dataForm.schoolArea=='3')" :gutter="20" class="form-row">
        <el-col :span="24">
          <el-form-item label="外省" prop="otherProvince">
            <el-select v-model="dataForm.otherProvince" filterable placeholder="请选择学校所在省市" class="w-full"
                       :disabled="type==1 ? false : true" @change="changeSchoolCode">
              <el-option
                v-for="item in areaHPList"
                :key="item.code"
                :label="item.name"
                :value="item.code">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <!-- 户口所在地 -->
      <el-row :gutter="20" class="form-row">
        <el-col :span="12">
          <el-form-item label="户口所在地" prop="residenceProvince">
            <div class="address-group">
              <el-select v-model="dataForm.residenceProvince" filterable clearable placeholder="省" class="address-select" :disabled="type==1 ? false : true" @change="changeR(1)">
                <el-option
                  v-for="item in areaPList"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code">
                </el-option>
              </el-select>
              <span class="address-separator">-</span>
              <el-select v-model="dataForm.residenceCity" filterable clearable placeholder="市" class="address-select" :disabled="type==1 ? false : true" @change="changeR(2)">
                <el-option
                  v-for="item in areaCList"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code">
                </el-option>
              </el-select>
              <span class="address-separator">-</span>
              <el-select v-model="dataForm.residenceArea" filterable clearable placeholder="区/县" class="address-select" :disabled="type==1 ? false : true">
                <el-option
                  v-for="item in areaAList"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code">
                </el-option>
              </el-select>
            </div>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="详细地址" prop="residenceDetail">
            <el-input type="text" v-model="dataForm.residenceDetail" placeholder="请输入详细地址" :disabled="type==1 ? false : true"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <!-- 家庭地址 -->
      <el-row :gutter="20" class="form-row">
        <el-col :span="12">
          <el-form-item label="家庭地址" prop="homeAddressProvince">
            <div class="address-group">
              <el-select v-model="dataForm.homeAddressProvince" filterable clearable placeholder="省" class="address-select" :disabled="type==1 ? false : true" @change="changeH(1)">
                <el-option
                  v-for="item in areaHPList"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code">
                </el-option>
              </el-select>
              <span class="address-separator">-</span>
              <el-select v-model="dataForm.homeAddressCity" filterable clearable placeholder="市" class="address-select" :disabled="type==1 ? false : true" @change="changeH(2)">
                <el-option
                  v-for="item in areaHCList"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code">
                </el-option>
              </el-select>
              <span class="address-separator">-</span>
              <el-select v-model="dataForm.homeAddressArea" filterable clearable placeholder="区/县" class="address-select" :disabled="type==1 ? false : true">
                <el-option
                  v-for="item in areaHAList"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code">
                </el-option>
              </el-select>
            </div>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="详细地址" prop="homeAddressDetail">
            <el-input type="text" v-model="dataForm.homeAddressDetail" placeholder="请输入详细地址" :disabled="type==1 ? false : true"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20" class="form-row">
        <el-col :span="6">
          <el-form-item label="家长姓名" prop="parentName">
            <el-input type="text" v-model="dataForm.parentName" :disabled="type==1 ? false : true"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="家长手机" prop="parentTelOne">
            <el-input type="text" v-model="dataForm.parentTelOne" :disabled="type==1 ? false : true"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="家长固话" prop="parentTelTwo">
            <el-input type="text" v-model="dataForm.parentTelTwo" :disabled="type==1 ? false : true"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="本人联系电话" prop="selfTel">
            <el-input type="text" v-model="dataForm.selfTel" :disabled="type==1 ? false : true"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      </div>

      <!-- 专业信息 -->
      <div class="form-section">
        <div class="section-title">专业信息</div>
        <el-row :gutter="20" class="form-row">
          <el-col :span="8">
            <el-form-item label="拟报专业1" prop="wishMajorOne">
            <el-select v-model="dataForm.wishMajorOne" filterable clearable placeholder="请选择专业" class="w-full">
              <el-option
                v-for="item in planMajorList"
                :key="item.majorCode"
                :label="item.majorName"
                :value="item.majorCode">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="拟报专业2" prop="wishMajorTwo">
            <el-select v-model="dataForm.wishMajorTwo" filterable clearable placeholder="请选择专业" class="w-full">
              <el-option
                v-for="item in planMajorList"
                :key="item.majorCode"
                :label="item.majorName"
                :value="item.majorCode">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="拟报专业3" prop="wishMajorThree">
            <el-select v-model="dataForm.wishMajorThree" filterable clearable placeholder="请选择专业" class="w-full">
              <el-option
                v-for="item in planMajorList"
                :key="item.majorCode"
                :label="item.majorName"
                :value="item.majorCode">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
        <el-row :gutter="20" class="form-row">
          <el-col :span="24">
            <el-form-item label="录取专业" prop="confirmedMajor">
            <el-select v-model="dataForm.confirmedMajor" filterable clearable placeholder="" class="w-full" :disabled="type==1 ? false : true" @change="changeM(dataForm.confirmedMajor)">
              <el-option
                v-for="item in planMajorList"
                :key="item.majorCode"
                :label="item.majorName+' || '+item.xyNum"
                :value="item.majorCode">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
        <el-row v-if="type==0 ? false : true" :gutter="20" class="form-row">
        <el-col :span="24">
          <el-form-item label="两年制专业" prop="twoMajor" v-if="twoMajorList.length>0">
            <el-select v-model="dataForm.twoMajor" filterable clearable placeholder="" class="w-full" @change="changeM(dataForm.twoMajor)">
              <el-option
                v-for="item in twoMajorList"
                :key="item.majorCode"
                :label="item.majorName+' || '+item.xyNum"
                :value="item.majorCode">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="三年制专业" prop="threeMajor" v-if="threeMajorList.length>0">
            <el-select v-model="dataForm.threeMajor" filterable clearable placeholder="" class="w-full" @change="changeM(dataForm.threeMajor)">
              <el-option
                v-for="item in threeMajorList"
                :key="item.majorCode"
                :label="item.majorName+' || '+item.xyNum"
                :value="item.majorCode">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="四年制专业" prop="fourMajor" v-if="fourMajorList.length>0">
            <el-select v-model="dataForm.fourMajor" filterable clearable placeholder="" class="w-full" @change="changeM(dataForm.fourMajor)">
            <el-option
              v-for="item in fourMajorList"
              :key="item.majorCode"
              :label="item.majorName+' || '+item.xyNum"
              :value="item.majorCode">
            </el-option>
          </el-select>
          </el-form-item>
          <el-form-item label="五年制专业" prop="fiveMajor" v-if="fiveMajorList.length>0">
            <el-select v-model="dataForm.fiveMajor" filterable clearable placeholder="" class="w-full" @change="changeM(dataForm.fiveMajor)">
              <el-option
                v-for="item in fiveMajorList"
                :key="item.majorCode"
                :label="item.majorName+' || '+item.xyNum"
                :value="item.majorCode">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="六年制专业" prop="sixMajor" v-if="sixMajorList.length>0">
            <el-select v-model="dataForm.sixMajor" filterable clearable placeholder="" class="w-full" @change="changeM(dataForm.sixMajor)">
              <el-option
                v-for="item in sixMajorList"
                :key="item.majorCode"
                :label="item.majorName+' || '+item.xyNum"
                :value="item.majorCode">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="七年制专业" prop="sevenMajor" v-if="sevenMajorList.length>0">
            <el-select v-model="dataForm.sevenMajor" filterable clearable placeholder="" class="w-full" @change="changeM(dataForm.sevenMajor)">
              <el-option
                v-for="item in sevenMajorList"
                :key="item.majorCode"
                :label="item.majorName+' || '+item.xyNum"
                :value="item.majorCode">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
        <!-- 费用信息 -->
        <el-row :gutter="20" class="form-row">
          <el-col :span="6">
            <el-form-item label="学费" prop="feeTuition">
              <el-input-number v-model="dataForm.feeTuition" controls-position="right" :min="0" :max="999999" :step-strictly="true" :disabled="type==2?false:true" class="w-full"></el-input-number>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="代办费" prop="feeAgency">
              <el-input-number v-model="dataForm.feeAgency" controls-position="right" :min="0" :max="999999" :step-strictly="true" :disabled="type==2?false:true" class="w-full"></el-input-number>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="总费用" prop="allMoney">
              <span class="total-fee">{{dataForm.feeTuition+dataForm.feeAgency}}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 附件材料 -->
        <el-row :gutter="20" class="form-row">
          <el-col :span="8">
            <el-form-item label="成绩单" prop="scorePhoto">
              <div class="image-preview-container">
                <viewer :images="dataForm.scorePhotoList" v-if="dataForm.scorePhoto && dataForm.scorePhotoList && dataForm.scorePhotoList.length > 0">
                  <div class="image-list">
                    <div v-for="(src, index) in dataForm.scorePhotoList" :key="index" class="image-item">
                      <img :src="src" class="preview-image" :alt="`成绩单-${index + 1}`">
                    </div>
                  </div>
                </viewer>
                <div v-else class="image-placeholder">
                  <el-icon><Picture /></el-icon>
                  <span>暂无图片</span>
                </div>
              </div>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="毕业证" prop="graPic">
              <div class="image-preview-container">
                <viewer :images="dataForm.graPicList" v-if="dataForm.graPic && dataForm.graPicList && dataForm.graPicList.length > 0">
                  <div class="image-list">
                    <div v-for="(src, index) in dataForm.graPicList" :key="index" class="image-item">
                      <img :src="src" class="preview-image" :alt="`毕业证-${index + 1}`">
                    </div>
                  </div>
                </viewer>
                <div v-else class="image-placeholder">
                  <el-icon><Picture /></el-icon>
                  <span>暂无图片</span>
                </div>
              </div>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="在常营业执照" prop="yyPic">
              <div class="image-preview-container">
                <viewer :images="dataForm.yyPicList" v-if="dataForm.yyPic && dataForm.yyPicList && dataForm.yyPicList.length > 0">
                  <div class="image-list">
                    <div v-for="(src, index) in dataForm.yyPicList" :key="index" class="image-item">
                      <img :src="src" class="preview-image" :alt="`在常营业执照-${index + 1}`">
                    </div>
                  </div>
                </viewer>
                <div v-else class="image-placeholder">
                  <el-icon><Picture /></el-icon>
                  <span>暂无图片</span>
                </div>
              </div>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20" class="form-row">
          <el-col :span="8">
            <el-form-item label="在常租赁合同/房产证明" prop="housePic">
              <div class="image-preview-container">
                <viewer :images="dataForm.housePicList" v-if="dataForm.housePic && dataForm.housePicList && dataForm.housePicList.length > 0">
                  <div class="image-list">
                    <div v-for="(src, index) in dataForm.housePicList" :key="index" class="image-item">
                      <img :src="src" class="preview-image" :alt="`在常租赁合同/房产证明-${index + 1}`">
                    </div>
                  </div>
                </viewer>
                <div v-else class="image-placeholder">
                  <el-icon><Picture /></el-icon>
                  <span>暂无图片</span>
                </div>
              </div>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="在常就业社保证明" prop="sbPic">
              <div class="image-preview-container">
                <viewer :images="dataForm.sbPicList" v-if="dataForm.sbPic && dataForm.sbPicList && dataForm.sbPicList.length > 0">
                  <div class="image-list">
                    <div v-for="(src, index) in dataForm.sbPicList" :key="index" class="image-item">
                      <img :src="src" class="preview-image" :alt="`在常就业社保证明-${index + 1}`">
                    </div>
                  </div>
                </viewer>
                <div v-else class="image-placeholder">
                  <el-icon><Picture /></el-icon>
                  <span>暂无图片</span>
                </div>
              </div>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="户口本" prop="householdPic">
              <div class="image-preview-container">
                <viewer :images="dataForm.householdPicList" v-if="dataForm.householdPic && dataForm.householdPicList && dataForm.householdPicList.length > 0">
                  <div class="image-list">
                    <div v-for="(src, index) in dataForm.householdPicList" :key="index" class="image-item">
                      <img :src="src" class="preview-image" :alt="`户口本-${index + 1}`">
                    </div>
                  </div>
                </viewer>
                <div v-else class="image-placeholder">
                  <el-icon><Picture /></el-icon>
                  <span>暂无图片</span>
                </div>
              </div>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 其他信息 -->
        <el-row :gutter="20" class="form-row">
          <el-col :span="8">
            <el-form-item label="联系人" prop="contactName">
              <el-select v-model="dataForm.contactName" filterable clearable placeholder="请选择联系人" class="w-full" :disabled="type==1?false:true">
                <el-option
                  v-for="item in contactNameList"
                  :key="item.teacherNo"
                  :label="item.realName+'-'+item.deptCode"
                  :value="item.teacherNo">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="原序号" prop="oldSerialNumber">
              <el-input type="text" v-model="dataForm.oldSerialNumber" :disabled="type==1?false:true"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="辨色力" prop="colorDiscrimination">
              <el-select v-model="dataForm.colorDiscrimination" filterable clearable placeholder="请选择辨色力" class="w-full" :disabled="type==1?false:true">
                <el-option
                  v-for="item in color_discrimination"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20" class="form-row">
          <el-col :span="24">
            <el-form-item label="既往病史" prop="pastMedicalHistory">
              <el-input type="textarea" v-model="dataForm.pastMedicalHistory" placeholder="请输入既往病史" :rows="2" :disabled="type==1?false:true"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20" class="form-row">
          <el-col :span="24">
            <el-form-item label="备注" prop="remarks">
              <el-input type="textarea" v-model="dataForm.remarks" placeholder="备注" :rows="2" :disabled="type==1?false:true"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20" class="form-row">
          <el-col :span="24">
            <el-form-item label="审核备注" prop="auditRemarks">
              <el-input type="textarea" v-model="dataForm.auditRemarks" placeholder="审核备注" :rows="2" :disabled="type==1?false:true"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </div>
    </el-form>
    <template #footer v-if="type==1">
      <div class="dialog-footer">
        <el-button @click="visible = false">取消</el-button>
        <el-button type="success" @click="dataFormSubmit(20)" v-if="canSubmit">确认录取</el-button>
        <el-button type="danger" plain @click="dataFormSubmit(-20)" v-if="canSubmit">驳回录取</el-button>
      </div>
    </template>

    <!--    图片预览-->
    <el-dialog title="图片预览" v-model="dialogUploadVisible" append-to-body >

    </el-dialog>
  </el-dialog>
</template>

<script setup lang="ts">
import { ref, reactive, nextTick } from 'vue'
import { ElNotification } from 'element-plus'
import { Picture } from '@element-plus/icons-vue'
import { useMessageBox } from '/@/hooks/message'
import { getObj, putObj } from '/@/api/recruit/recruitstudentsignup'
import { list as listByGroupId } from '/@/api/recruit/recruitstudentschool'
import { getDeptList } from "/@/api/basic/basicclass"
import { getList } from "/@/api/recruit/recruitstudentplangroup"
import { listByEdu } from "/@/api/recruit/recruitstudentplan"
import { getDictsByTypes } from "/@/api/admin/dict"
import { useDict } from '/@/hooks/dict'
import { areaList, areaSonList } from "/@/api/recruit/recruitstudentschool"
import { list as scoreList } from "/@/api/recruit/recruitstudentplancorrectscoreconfig"
import { queryAllTeacher } from "/@/api/professional/professionaluser/teacherbase"

const messageBox = useMessageBox()

// Emits
const emit = defineEmits<{
  (e: 'refreshDataList'): void
}>()

// 表单引用
const dataFormRef = ref()

// 响应式数据
const visible = ref(false)
const canSubmit = ref(false)
const title = ref("")
// 字典数据 是否 性别 辨色力
const { yes_no_type, sexy, color_discrimination } = useDict('yes_no_type', 'sexy', 'color_discrimination')

const eduList = ref<any[]>([])
const imgList = ref<string[]>([])
const type = ref<number | null>(null)
const isShow = ref(false)
const residenceTypeList = [{ label: "农村", value: "1" }, { label: "城市", value: "2" }]
const nutritionList = [{ label: "优", value: "1" }, { label: "良", value: "2" }, { label: "一般", value: "3" }, { label: "差", value: "4" }]
const schoolCodeList = ref<any[]>([])
const contactNameList = ref<any[]>([])
const planList = ref<any[]>([])
const planMajorList = ref<any[]>([])
const areaListData = ref<any[]>([])
const areaPList = ref<any[]>([])
const areaCList = ref<any[]>([])
const areaAList = ref<any[]>([])
const areaHPList = ref<any[]>([])
const areaHCList = ref<any[]>([])
const areaHAList = ref<any[]>([])
const deptList = ref<any[]>([])
const dialogImageUrl = ref("")
const dialogUploadVisible = ref(false)
const sevenMajorList = ref<any[]>([])
const sixMajorList = ref<any[]>([])
const fiveMajorList = ref<any[]>([])
const fourMajorList = ref<any[]>([])
const threeMajorList = ref<any[]>([])
const twoMajorList = ref<any[]>([])
const agencyFeeList = ref<any[]>([])
const tuitionFeeList = ref<any[]>([])
const schoolFromList = [{ label: "本省外市", value: "2" }, { label: "外省外市", value: "3" }]

const dataForm = reactive({
        id: "",
        groupId: "",
        name: "",
        oldName: "",
        gender: "",
        nationality: "",
        degreeOfEducation: "",
        isLeagueMember: "",
        schoolOfGraduation: "",
        isAccommodation: "",
        examRegistrationNumbers: "",
        isMinimumLivingSecurity: "",
        score: "",
        postcode: "",
        residenceType: "",
        correctedScore: 0,
        fullScore: "",
        schoolArea: "",
        idNumber: "",
        residenceProvince: "",
        residenceCity: "",
        residenceArea: "",
        residenceDetail: "",
        homeAddressProvince: "",
        homeAddressCity: "",
        homeAddressArea: "",
        homeAddressDetail: "",
        parentName: "",
        parentTelOne: "",
        parentTelTwo: "",
        selfTel: "",
        wishMajorOne: "",
        wishMajorTwo: "",
        wishMajorThree: "",
        confirmedMajor: "",
        sevenMajor:"",
        sixMajor:"",
        fiveMajor:"",
        fourMajor: "",
        threeMajor: "",
        twoMajor: "",
        feeTuition: 0,
        feeAgency: 0,
        feeContribute: 0,
        scorePhoto: "",
        graPic: "",
        yyPic: "",
        housePic: "",
        sbPic: "",
        contactName: "",
        oldSerialNumber: "",
        colorDiscrimination: "",
        nutrition: "",
        height: "",
        weight: "",
        pastMedicalHistory: "",
        eyesightLeft: "",
        eyesightRight: "",
        correctEyesightLeft: "",
        correctEyesightRight: "",
        remarks: "",
        auditRemarks: "",
        serialNumber: "",
        auditStatus:"",
        jsOtherCity:"",
        householdPic:"",
        otherProvince:"",
        scorePhotoList: [] as string[],
        graPicList: [] as string[],
        yyPicList: [] as string[],
        housePicList: [] as string[],
        sbPicList: [] as string[],
        householdPicList: [] as string[]
})

const dataRule = {
        groupId: [
          {required: true, message: '招生计划不能为空', trigger: 'change'}
        ],
        name: [
          {required: true, message: '姓名不能为空', trigger: 'change'}
        ],
        gender: [
          {required: true, message: '性别不能为空', trigger: 'change'}
        ],
        nationality: [
          {required: true, message: '民族不能为空', trigger: 'change'}
        ],
        degreeOfEducation: [
          {required: true, message: '文化程度不能为空', trigger: 'change'}
        ],
        isLeagueMember: [
          {required: true, message: '是否团员不能为空', trigger: 'change'}
        ],
        schoolOfGraduation: [
          {required: true, message: '毕业学校不能为空', trigger: 'change'}
        ],
        isAccommodation: [
          {required: true, message: '是否住宿不能为空', trigger: 'change'}
        ],
        residenceType: [
          {required: true, message: '户口性质不能为空', trigger: 'change'}
        ],
        idNumber: [
          {required: true, message: '身份证不能为空', trigger: 'change'}
        ],
        otherProvince: [
          {required: true, message: '外省不能为空', trigger: 'change'}
        ],
        residenceProvince: [
          {required: true, message: '户口所在地不能为空', trigger: 'change'}
        ],
        residenceCity: [
          {required: true, message: '户口所在地不能为空', trigger: 'change'}
        ],
        residenceArea: [
          {required: true, message: '户口所在地不能为空', trigger: 'change'}
        ],
        residenceDetail: [
          {required: true, message: '户口所在地不能为空', trigger: 'change'}
        ],
        homeAddressProvince: [
          {required: true, message: '家庭地址不能为空', trigger: 'change'}
        ],
        homeAddressCity: [
          {required: true, message: '家庭地址不能为空', trigger: 'change'}
        ],
        homeAddressArea: [
          {required: true, message: '家庭地址不能为空', trigger: 'change'}
        ],
        homeAddressDetail: [
          {required: true, message: '家庭地址不能为空', trigger: 'change'}
        ],
        parentName: [
          {required: true, message: '家长姓名不能为空', trigger: 'change'}
        ],
        parentTel_1: [
          {required: true, message: '家长手机不能为空', trigger: 'change'}
        ],
        wishMajor_1: [
          {required: true, message: '拟报专业不能为空', trigger: 'change'}
        ],
        nutrition: [
          {required: true, message: '辨色力不能为空', trigger: 'change'}
        ],
        height: [
          {required: true, message: '身高cm不能为空', trigger: 'change'}
        ],
        weight: [
          {required: true, message: '体重kg不能为空', trigger: 'change'}
        ],
        correctedScore:[
          {required: true, message: '折算分不能为空', trigger: 'change'}
  ]
}

// 初始化
const init = (id: string | null, typeParam: number) => {
  dataForm.id = id || null
  type.value = typeParam
  visible.value = true
  canSubmit.value = true
  initData()
  isShow.value = true
  nextTick(() => {
    dataFormRef.value?.resetFields()
    if (dataForm.id) {
      areaPList.value = []
      areaCList.value = []
      areaAList.value = []
      areaHPList.value = []
      areaHCList.value = []
      areaHAList.value = []
      // 批量获取数据字典（并行获取，提高性能）
      getDictsByTypes(['finance_student_source', 'agency_fee', 'tuition_fee']).then((res: any) => {
        eduList.value = res.data.finance_student_source || []
        agencyFeeList.value = res.data.agency_fee || []
        tuitionFeeList.value = res.data.tuition_fee || []
        // 获取表单数据
            getObj(dataForm.id).then((response: any) => {
              Object.assign(dataForm, response.data)
              dataForm.scorePhotoList = []
              dataForm.graPicList = []
              dataForm.yyPicList = []
              dataForm.housePicList = []
              dataForm.sbPicList = []
              dataForm.householdPicList = []

              if (dataForm.scorePhoto) {
                dataForm.scorePhotoList = dataForm.scorePhoto.split(",")
              }
              if (dataForm.graPic) {
                dataForm.graPicList = dataForm.graPic.split(",")
              }
              if (dataForm.yyPic) {
                dataForm.yyPicList = dataForm.yyPic.split(",")
              }
              if (dataForm.housePic) {
                dataForm.housePicList = dataForm.housePic.split(",")
              }
              if (dataForm.householdPic) {
                dataForm.householdPicList = dataForm.householdPic.split(",")
              }
              if (dataForm.sbPic) {
                dataForm.sbPicList = dataForm.sbPic.split(",")
              }

              title.value = dataForm.serialNumber
              // 获取文化程度对应的专业
              planMajorList.value = []
              twoMajorList.value = []
              threeMajorList.value = []
              fiveMajorList.value = []
              sixMajorList.value = []
              sevenMajorList.value = []
              fourMajorList.value = []
              agencyFeeList.value.forEach((e: any) => {
                if (dataForm.degreeOfEducation == e.label) {
                  dataForm.feeAgency = e.value
                }
              })
              tuitionFeeList.value.forEach((e: any) => {
                if (dataForm.degreeOfEducation == e.label && (dataForm.degreeOfEducation != 1)) {
                  dataForm.feeTuition = e.value
                }
              })
              listByEdu({ groupId: dataForm.groupId, degreeOfEducation: dataForm.degreeOfEducation }).then((e: any) => {
                planMajorList.value = e.data
                if (1 != Number(dataForm.degreeOfEducation)) {
                  gzAuditChange()
                }
                // 根据年制分组
                planMajorList.value.forEach((item: any) => {
                  if (item.learnYear == '2') {
                    twoMajorList.value.push(item)
                  } else if (item.learnYear == '3') {
                    threeMajorList.value.push(item)
                  } else if (item.learnYear == '4') {
                    fourMajorList.value.push(item)
                  } else if (item.learnYear == '5') {
                    fiveMajorList.value.push(item)
                  } else if (item.learnYear == '6') {
                    sixMajorList.value.push(item)
                  } else if (item.learnYear == '7') {
                    sevenMajorList.value.push(item)
                  }
                })
              })
              // 获取招生计划下的学校和分数线
              scoreList({ groupId: dataForm.groupId }).then((data: any) => {
                schoolCodeList.value = data.data
              })
              let areas: any[] = []
              // 获取户口所在 省市区
              areaList({ type: 0 }).then((data: any) => {
                areas = data.data
                // 省
                let pid = ""
                areas.forEach((e: any) => {
                  if (e.parentId == '1') {
                    areaPList.value.push(e)
                    if (e.code == dataForm.residenceProvince) {
                      pid = e.id
                    }
                  }
                })
                // 市
                let cid = ""
                areas.forEach((e: any) => {
                  if (e.parentId == pid) {
                    areaCList.value.push(e)
                    if (e.code == dataForm.residenceCity) {
                      cid = e.id
                    }
                  }
                })
                // 区
                areas.forEach((e: any) => {
                  if (e.parentId == cid) {
                    areaAList.value.push(e)
                  }
                })

                // 省
                let hpid = ""
                areas.forEach((e: any) => {
                  if (e.parentId == '1') {
                    areaHPList.value.push(e)
                    if (e.code == dataForm.homeAddressProvince) {
                      hpid = e.id
                    }
                  }
                })
                // 市
                let hcid = ""
                areas.forEach((e: any) => {
                  if (e.parentId == hpid) {
                    areaHCList.value.push(e)
                    if (e.code == dataForm.homeAddressCity) {
                      hcid = e.id
                    }
                  }
                })
                // 区
                areas.forEach((e: any) => {
                  if (e.parentId == hcid) {
                    areaHAList.value.push(e)
                  }
                })
              })
              if ("1" == String(dataForm.degreeOfEducation)) {
                title.value = "C" + title.value
              } else if ("2" == String(dataForm.degreeOfEducation)) {
                title.value = "G" + title.value
              } else if ("3" == String(dataForm.degreeOfEducation)) {
                title.value = "J" + title.value
              }

              if ("-20" == String(dataForm.auditStatus)) {
                title.value = "未录取 " + title.value
              } else if ("0" == String(dataForm.auditStatus)) {
                title.value = "待审核 " + title.value
              } else if ("20" == String(dataForm.auditStatus)) {
                title.value = "已录取 " + title.value
              }
        })
      })
    }
  })
}

const changeEducation = () => {
  // 清空拟报专业 录取专业 学费和代办费
  dataForm.wishMajorOne = ""
  dataForm.wishMajorTwo = ""
  dataForm.wishMajorThree = ""
  dataForm.confirmedMajor = ""
  dataForm.twoMajor = ""
  dataForm.threeMajor = ""
  dataForm.fourMajor = ""
  dataForm.fiveMajor = ""
  dataForm.sixMajor = ""
  dataForm.sevenMajor = ""

  dataForm.feeTuition = 0
  dataForm.feeAgency = 0

  // 重新根据学历 获取学费和代办费
  agencyFeeList.value.forEach((e: any) => {
    if (dataForm.degreeOfEducation == e.label) {
      dataForm.feeAgency = e.value
    }
  })
  tuitionFeeList.value.forEach((e: any) => {
    if (dataForm.degreeOfEducation == e.label && (dataForm.degreeOfEducation != 1)) {
      dataForm.feeTuition = e.value
    }
  })
  // 根据学历获取快捷专业选择
  planMajorList.value = []
  twoMajorList.value = []
  threeMajorList.value = []
  fiveMajorList.value = []
  sixMajorList.value = []
  sevenMajorList.value = []
  fourMajorList.value = []
  listByEdu({ groupId: dataForm.groupId, degreeOfEducation: dataForm.degreeOfEducation }).then((e: any) => {
    planMajorList.value = e.data
    if (1 != Number(dataForm.degreeOfEducation)) {
      gzAuditChange()
    }
    // 根据年制分组
    planMajorList.value.forEach((item: any) => {
      if (item.learnYear == '2') {
        twoMajorList.value.push(item)
      } else if (item.learnYear == '3') {
        threeMajorList.value.push(item)
      } else if (item.learnYear == '4') {
        fourMajorList.value.push(item)
      } else if (item.learnYear == '5') {
        fiveMajorList.value.push(item)
      } else if (item.learnYear == '6') {
        sixMajorList.value.push(item)
      } else if (item.learnYear == '7') {
        sevenMajorList.value.push(item)
      }
    })
  })
}

const handlePicCardPreview = (file: string) => {
  const array = file.split(",")
  imgList.value = array
  dialogUploadVisible.value = true
}

const initData = () => {
  // 联系人(教职工)
  queryAllTeacher().then((res: any) => {
    contactNameList.value = res.data
  })
  // 查询二级学院信息
  getDeptList().then((data: any) => {
    deptList.value = data.data
  })
  getList().then((data: any) => {
    planList.value = data.data
  })
}

const changeFrom = () => {
  dataForm.fullScore = ""
  dataForm.correctedScore = 0
  if (dataForm.schoolArea == "2") {
    isShow.value = true
  } else {
    isShow.value = false
  }
}

const changeSchoolCode = () => {
  dataForm.fullScore = ""
  schoolCodeList.value.forEach((e: any) => {
    if (e.regionId == dataForm.jsOtherCity) {
      dataForm.fullScore = e.fullScore
    }
  })
  if (dataForm.fullScore == "" && dataForm.schoolArea != "3") {
    ElNotification.error({
      title: '错误',
      message: '当前省市未匹配到分数线,请检查'
    })
    return
  }

  dataForm.correctedScore = 0
  jsZSF()
}

const changePlaceScore = () => {
  jsZSF()
}

const gzAuditChange = () => {
  if (type.value != 0 && (dataForm.confirmedMajor == undefined || dataForm.confirmedMajor == "")) {
    // 根据折算分匹配录取专业
    planMajorList.value.forEach((e: any) => {
      if (e.majorCode == dataForm.wishMajorOne && (parseFloat(e.xyNum) > 0)) {
        dataForm.confirmedMajor = dataForm.wishMajorOne
      }
    })
    if (dataForm.confirmedMajor) {
      planMajorList.value.forEach((e: any) => {
        if (e.majorCode == dataForm.wishMajorTwo && (parseFloat(e.xyNum) > 0)) {
          dataForm.confirmedMajor = dataForm.wishMajorOne
        }
      })
    }

    if (dataForm.confirmedMajor) {
      planMajorList.value.forEach((e: any) => {
        if (e.majorCode == dataForm.wishMajorThree && (parseFloat(e.xyNum) > 0)) {
          dataForm.confirmedMajor = dataForm.wishMajorOne
        }
      })
    }
  }
}

const jsZSF = () => {
  if (dataForm.score != undefined && dataForm.fullScore != undefined && dataForm.correctedScore != undefined && !isNaN(Number(dataForm.correctedScore))) {
    dataForm.confirmedMajor = ""
    let fjf = 20

    if (dataForm.schoolArea == "3") {
      fjf = 30
    }
    const score = (parseFloat(String(dataForm.score)) * parseFloat("700"))
    dataForm.correctedScore = String(Math.floor(score / parseFloat(String(dataForm.fullScore)) + fjf))
    // 根据折算分匹配录取专业
    planMajorList.value.forEach((e: any) => {
      if (dataForm.correctedScore >= e.scoreLine && e.majorCode == dataForm.wishMajorOne && (parseFloat(e.xyNum) > 0)) {
        dataForm.confirmedMajor = dataForm.wishMajorOne
      }
    })
    if (dataForm.confirmedMajor == "") {
      planMajorList.value.forEach((e: any) => {
        if (dataForm.correctedScore >= e.scoreLine && e.majorCode == dataForm.wishMajorTwo && (parseFloat(e.xyNum) > 0)) {
          dataForm.confirmedMajor = dataForm.wishMajorTwo
        }
      })
    }

    if (dataForm.confirmedMajor == "") {
      planMajorList.value.forEach((e: any) => {
        if (dataForm.correctedScore >= e.scoreLine && e.majorCode == dataForm.wishMajorThree && (parseFloat(e.xyNum) > 0)) {
          dataForm.confirmedMajor = dataForm.wishMajorThree
        }
      })
    }
    if (dataForm.confirmedMajor) {
      changeM(dataForm.confirmedMajor)
    }
  }
}

const changeR = (changeType: number) => {
  let code = ""
  areaAList.value = []
  dataForm.residenceArea = ""
  if (changeType == 1) {
    code = dataForm.residenceProvince
    areaCList.value = []
    dataForm.residenceCity = ""
  } else {
    code = dataForm.residenceCity
  }
  areaSonList({ code: code }).then((data: any) => {
    if (changeType == 1) {
      areaCList.value = data.data
    } else {
      areaAList.value = data.data
    }
  })
}

const changeH = (changeType: number) => {
  let code = ""
  areaHAList.value = []
  dataForm.homeAddressArea = ""
  if (changeType == 1) {
    code = dataForm.homeAddressProvince
    areaHCList.value = []
    dataForm.homeAddressCity = ""
  } else {
    code = dataForm.homeAddressCity
  }
  areaSonList({ code: code }).then((data: any) => {
    if (changeType == 1) {
      areaHCList.value = data.data
    } else {
      areaHAList.value = data.data
    }
  })
}

const changeM = (id: string) => {
  if (id) {
    let flag = false
    dataForm.confirmedMajor = id
    // 是初中生并且是中德班
    planMajorList.value.forEach((e: any) => {
      if (dataForm.confirmedMajor == e.majorCode && e.isZd == "1" && dataForm.degreeOfEducation == "1") {
        flag = true
      }
    })
    if (dataForm.degreeOfEducation == "1") {
      dataForm.feeTuition = 0
      tuitionFeeList.value.forEach((e: any) => {
        if (e.label == "0" && flag) {
          dataForm.feeTuition = e.value
        }
      })
    }
  }
}

// 表单提交
const dataFormSubmit = (state: number) => {
  dataForm.auditStatus = String(state)
  let submitTitle = "确认通过该学生的报名申请么?"
  if (state == -20) {
    submitTitle = "确认驳回该学生的报名申请么？"
  } else {
    if (!dataForm.confirmedMajor) {
      ElNotification.error({
        title: '错误',
        message: '请选择录取专业'
      })
      return
    }
  }
  if (dataForm.degreeOfEducation == '1' && (dataForm.score == undefined || dataForm.score == '')) {
    ElNotification.error({
      title: '错误',
      message: '初中生报名请填写成绩'
    })
    return
  }
  if (dataForm.degreeOfEducation == '1' && dataForm.schoolArea == '3' && (dataForm.fullScore == undefined || dataForm.fullScore == '')) {
    ElNotification.error({
      title: '错误',
      message: '外地初中生报名请填写当地总分'
    })
    return
  }
  if (dataForm.degreeOfEducation == '1' && dataForm.schoolArea == '2' && (dataForm.schoolArea == undefined || dataForm.jsOtherCity == undefined) && state == 20) {
    ElNotification.error({
      title: '错误',
      message: '初中生审核请选择学校归属地和所在省市'
    })
    return
  }
  if (dataForm.degreeOfEducation == '1' && dataForm.schoolArea == '3' && (dataForm.schoolArea == undefined || dataForm.otherProvince == undefined) && state == 20) {
    ElNotification.error({
      title: '错误',
      message: '初中生审核请选择学校归属地和所在省市'
    })
    return
  }

  messageBox.confirm(submitTitle, '提示').then(() => {
    dataFormRef.value?.validate((valid: boolean) => {
      if (valid) {
        canSubmit.value = false
        if (dataForm.id) {
          putObj(dataForm).then(() => {
            ElNotification.success({
              title: '成功',
              message: '操作成功'
            })
            visible.value = false
            emit('refreshDataList')
          }).catch((e: any) => {
            ElNotification.error({
              title: '错误',
              message: e || '操作失败'
            })
          }).finally(() => {
            canSubmit.value = true
          })
        } else {
          canSubmit.value = true
        }
      }
    })
  }).catch(() => {
    // 用户取消
  })
}

// 暴露方法给父组件
defineExpose({
  init
})
</script>
<style lang="scss" scoped>
.viewer-container{
  z-index: 9999;
}

// 统一宽度样式
.w-full {
  width: 100%;
}

// 图片预览容器样式
.image-preview-container {
  min-height: 120px;
  width: 100%;
}

// 图片列表样式
.image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

// 图片项样式
.image-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  
  &:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
  }
}

// 图片预览样式
.preview-image {
  width: 120px;
  height: 120px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease;
  
  &:hover {
    transform: scale(1.1);
  }
}

// 图片占位符样式
.image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  width: 100%;
  background: #f5f7fa;
  border: 1px dashed #dcdfe6;
  border-radius: 6px;
  color: #909399;
  font-size: 14px;
  
  .el-icon {
    font-size: 32px;
    margin-bottom: 8px;
    color: #c0c4cc;
  }
  
  span {
    color: #909399;
  }
}

// 总费用样式
.total-fee {
  color: #f56c6c;
  font-weight: 600;
  font-size: 16px;
}

// 表单布局优化
.el-form {
  // 所有表单项保持默认间距
  .el-form-item {
    margin-bottom: 18px;
  }
  
  // 覆盖全局样式：每行的最后一个表单项也需要间距
  .form-row .el-form-item:last-child {
    margin-bottom: 18px !important;
  }
  
  // 只有整个表单的最后一个表单项才不需要底部间距
  .form-row:last-of-type .el-form-item:last-child {
    margin-bottom: 0 !important;
  }
  
  // 统一输入框宽度
  .el-select,
  .el-input,
  .el-date-editor,
  .el-input-number {
    width: 100%;
  }
}

// 行布局优化
.form-row {
  margin-bottom: 0;
}

// 表单模块样式
.form-section {
  margin-bottom: 24px;
  padding: 20px;
  background: #fafbfc;
  border-radius: 8px;
  border: 1px solid #ebeef5;
  
  &:last-child {
    margin-bottom: 0;
  }
  
  .section-title {
    font-size: 15px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e4e7ed;
  }
  
  .form-row {
    margin-bottom: 0;
  }
}

// 地址组样式 - 省市区紧凑排列，用分隔符连接
.address-group {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  
  :deep(.address-select) {
    flex: 1 1 0;
    min-width: 0px;
    width: 0; // 让 flex: 1 生效
  }
  
  .address-separator {
    color: #909399;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
    padding: 0 4px;
  }
}

// 弹窗内容区域优化
:deep(.el-dialog__body) {
  max-height: 75vh;
  overflow-y: auto;
  padding: 24px;
}


</style>
