<script name="empMaterials" setup>
import { ref, watch } from 'vue'
import { fileFormatVerification, handleFileError, handleFileSuccess, reviewFileParam, fileTypes, fileDesc, handleFilePreview } from '@/utils/uploadAction'
import store from '@/store'

const props = defineProps({
    detail: {
      type: Object
    },
    data: {
      type: Object
    },
    basicInfoData: {
      type: Object
    },
    approvalInfoData: {
      type: Object
    },
    baseProjSetYear: {
      type: String,
      default: ''
    },
    isSupplemented: {
      type: Boolean,
      default: false
    }
  }),
  uploadUrl = store.dictStore.uploadUrl,
  formRef = ref(),
  formData = ref({
    feasibilityStudyReport: [],
    approvedFile: [],
    purchaseFile: [],
    acceptanceLetter: [],
    purchaseContract: [],
    acceptanceReport: [],
    changeApprovalDoc: []
  }),
  fileRule = [{ required: true, message: '请选择文件' }],
  currentRules = ref(),
  copyData = ref()

defineExpose({ formRef, formData })
watch(() => props.basicInfoData, val => {
  if (val.baseProjIsConfidentiality === '02' || val?.baseProjSetProg === '00') {
    currentRules.value = {}
  } else {
    currentRules.value = {
      baseInitialOpinionFile: fileRule,
      baseInforLevelFile: fileRule,
      basePasswAssessFile: fileRule,
      baseThirdAcceptFile: fileRule,
      baseCheckFile: fileRule,
      baseFinanlAuditFile: fileRule,
      baseUserConsFile: fileRule,
      baseEstaSummFile: fileRule,
      baseSummReportFile: fileRule,
      baseFinalExpertOpinionFile: fileRule,
      baseEngineerPostpoFile: fileRule,
      baseChangeFormFile: fileRule,
      baseChanFile: fileRule
    }
  }
  formRef.value.clearValidate()
}, { deep: true })
watch(() => props.detail, val => {
  if (val) {
    if (props.isSupplemented) {
      copyData.value = val.cimplement || {}
    }
    formData.value = {
      ...val.cimplement,
      baseInitialOpinionFile: val.cimplement?.baseInitialOpinionFile ? reviewFileParam(JSON.parse(val.cimplement.baseInitialOpinionFile)) : [],
      baseInforLevelFile: val.cimplement?.baseInforLevelFile ? reviewFileParam(JSON.parse(val.cimplement.baseInforLevelFile)) : [],
      basePasswAssessFile: val.cimplement?.basePasswAssessFile ? reviewFileParam(JSON.parse(val.cimplement.basePasswAssessFile)) : [],
      baseThirdAcceptFile: val.cimplement?.baseThirdAcceptFile ? reviewFileParam(JSON.parse(val.cimplement.baseThirdAcceptFile)) : [],
      baseCheckFile: val.cimplement?.baseCheckFile ? reviewFileParam(JSON.parse(val.cimplement.baseCheckFile)) : [],
      baseFinanlAuditFile: val.cimplement?.baseFinanlAuditFile ? reviewFileParam(JSON.parse(val.cimplement.baseFinanlAuditFile)) : [],
      baseUserConsFile: val.cimplement?.baseUserConsFile ? reviewFileParam(JSON.parse(val.cimplement.baseUserConsFile)) : [],
      baseEstaSummFile: val.cimplement?.baseEstaSummFile ? reviewFileParam(JSON.parse(val.cimplement.baseEstaSummFile)) : [],
      baseSummReportFile: val.cimplement?.baseSummReportFile ? reviewFileParam(JSON.parse(val.cimplement.baseSummReportFile)) : [],
      baseFinalExpertOpinionFile: val.cimplement?.baseFinalExpertOpinionFile ? reviewFileParam(JSON.parse(val.cimplement.baseFinalExpertOpinionFile)) : [],
      baseEngineerPostpoFile: val.cimplement?.baseEngineerPostpoFile ? reviewFileParam(JSON.parse(val.cimplement.baseEngineerPostpoFile)) : [],
      baseChangeFormFile: val.cimplement?.baseChangeFormFile ? reviewFileParam(JSON.parse(val.cimplement.baseChangeFormFile)) : [],
      baseChanFile: val.cimplement?.baseChanFile ? reviewFileParam(JSON.parse(val.cimplement.baseChanFile)) : []
    }
  }
})
watch(() => props.data, val => {
},
{ immediate: true, deep: true })
</script>

<template>
  <el-form
    ref="formRef"
    :model="formData"
    :rules="currentRules"
    label-position="top"
    label-suffix=":"
    scroll-to-error
    :validate-on-rule-change="false"
  >
    <el-row :gutter="40">
      <el-col :span="8">
        <el-form-item
          label="初验意见"
        >
          <el-upload
            v-model:file-list="formData.baseInitialOpinionFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseInitialOpinionFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseInitialOpinionFile&&!!(JSON.parse(copyData?.baseInitialOpinionFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseInitialOpinionFile&&!!JSON.parse(copyData?.baseInitialOpinionFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
      </el-col>
      <el-col v-if="(['05','06','07','00'].includes(basicInfoData?.baseProjSetProg)&&basicInfoData?.baseConstructionType?.includes('01'))||!basicInfoData?.baseConstructionType?.includes('01')" :span="8">
        <el-form-item
          v-if="basicInfoData?.baseProjSetProg==='07'&&basicInfoData?.baseConstructionType?.includes('01')&&['03','04','05'].includes(approvalInfoData?.equalProtectionLevel)"
          label="信息安全等级保护测评报告"
          prop="baseInforLevelFile"
        >
          <el-upload
            v-model:file-list="formData.baseInforLevelFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseInforLevelFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseInforLevelFile&&!!(JSON.parse(copyData?.baseInforLevelFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseInforLevelFile&&JSON.parse(copyData?.baseInforLevelFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
        <el-form-item
          v-else
          label="信息安全等级保护测评报告"
        >
          <el-upload
            v-model:file-list="formData.baseInforLevelFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseInforLevelFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseInforLevelFile&&!!(JSON.parse(copyData?.baseInforLevelFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseInforLevelFile&&JSON.parse(copyData?.baseInforLevelFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
      </el-col>
      <el-col v-if="!['01','02','03'].includes(basicInfoData?.baseProjSetProg)||baseProjSetYear*1<2023" :span="8">
        <el-form-item
          v-if="['01','02'].includes(approvalInfoData?.equalProtectionLevel)||baseProjSetYear*1<2023"
          label="商业密码应用评估报告"
        >
          <el-upload
            v-model:file-list="formData.basePasswAssessFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.basePasswAssessFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.basePasswAssessFile&&!!(JSON.parse(copyData?.basePasswAssessFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.basePasswAssessFile&&JSON.parse(copyData?.basePasswAssessFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
        <el-form-item
          v-else
          label="商业密码应用评估报告"
          prop="basePasswAssessFile"
        >
          <el-upload
            v-model:file-list="formData.basePasswAssessFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.basePasswAssessFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.basePasswAssessFile&&!!(JSON.parse(copyData?.basePasswAssessFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.basePasswAssessFile&&JSON.parse(copyData?.basePasswAssessFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item
          label="第三方验收测试报告"
        >
          <el-upload
            v-model:file-list="formData.baseThirdAcceptFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseThirdAcceptFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseThirdAcceptFile&&!!(JSON.parse(copyData?.baseThirdAcceptFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseThirdAcceptFile&&JSON.parse(copyData?.baseThirdAcceptFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
      </el-col>
      <el-col v-if="['05','06','07','00'].includes(basicInfoData?.baseProjSetProg)||baseProjSetYear*1<2023" :span="8">
        <el-form-item
          v-if="basicInfoData?.baseProjSetProg==='07'&&baseProjSetYear*1>=2023"
          key="baseCheckFile1"
          label="建设核查表"
          prop="baseCheckFile"
        >
          <el-upload
            v-model:file-list="formData.baseCheckFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseCheckFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseCheckFile&&!!(JSON.parse(copyData?.baseCheckFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseCheckFile&&JSON.parse(copyData?.baseCheckFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
        <el-form-item
          v-else
          key="baseCheckFile2"
          label="建设核查表"
        >
          <el-upload
            v-model:file-list="formData.baseCheckFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseCheckFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseCheckFile&&!!(JSON.parse(copyData?.baseCheckFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseCheckFile&&JSON.parse(copyData?.baseCheckFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
      </el-col>
      <el-col v-if="approvalInfoData?.releaseYearMoney>=2000&&!['01','02','03','04'].includes(basicInfoData?.baseProjSetProg)" :span="8">
        <el-form-item
          label="财务审计报告"
        >
          <el-upload
            v-model:file-list="formData.baseFinanlAuditFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseFinanlAuditFile)"
            :on-error="handleFileError"
            ::before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseFinanlAuditFile&&!!(JSON.parse(copyData?.baseFinanlAuditFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseFinanlAuditFile&&JSON.parse(copyData?.baseFinanlAuditFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
      </el-col>
      <el-col v-if="!['01','02','03','04'].includes(basicInfoData?.baseProjSetProg)||baseProjSetYear*1<2023" :span="8">
        <el-form-item
          v-if="baseProjSetYear*1<2023||['05','06','07'].includes(basicInfoData?.baseProjSetProg)"
          label="用户使用报告"
        >
          <el-upload
            v-model:file-list="formData.baseUserConsFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseUserConsFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseUserConsFile&&!!(JSON.parse(copyData?.baseUserConsFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseUserConsFile&&JSON.parse(copyData?.baseUserConsFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
        <el-form-item
          v-else
          label="用户使用报告"
          prop="baseUserConsFile"
        >
          <el-upload
            v-model:file-list="formData.baseUserConsFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseUserConsFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseUserConsFile&&!!(JSON.parse(copyData?.baseUserConsFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseUserConsFile&&JSON.parse(copyData?.baseUserConsFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item
          label="监理总结报告"
        >
          <el-upload
            v-model:file-list="formData.baseEstaSummFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseEstaSummFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseEstaSummFile&&!!(JSON.parse(copyData?.baseEstaSummFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseEstaSummFile&&JSON.parse(copyData?.baseEstaSummFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
      </el-col>
      <el-col v-if="!['01','02','03','04'].includes(basicInfoData?.baseProjSetProg)||baseProjSetYear*1<2023" :span="8">
        <el-form-item
          v-if="basicInfoData?.baseProjSetProg==='07'&&baseProjSetYear*1>=2023"
          label="项目总结报告"
          prop="baseSummReportFile"
        >
          <el-upload
            v-model:file-list="formData.baseSummReportFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseSummReportFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseSummReportFile&&!!(JSON.parse(copyData?.baseSummReportFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseSummReportFile&&JSON.parse(copyData?.baseSummReportFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
        <el-form-item
          v-else
          label="项目总结报告"
        >
          <el-upload
            v-model:file-list="formData.baseSummReportFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseSummReportFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseSummReportFile&&!!(JSON.parse(copyData?.baseSummReportFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseSummReportFile&&JSON.parse(copyData?.baseSummReportFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
      </el-col>
      <el-col v-if="basicInfoData?.baseProjSetProg==='07'" :span="8">
        <el-form-item
          label="终验意见"
          prop="baseFinalExpertOpinionFile"
        >
          <el-upload
            v-model:file-list="formData.baseFinalExpertOpinionFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseFinalExpertOpinionFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseFinalExpertOpinionFile&&!!(JSON.parse(copyData?.baseFinalExpertOpinionFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseFinalExpertOpinionFile&&JSON.parse(copyData?.baseFinalExpertOpinionFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item
          label="项目延期申请表"
        >
          <el-upload
            v-model:file-list="formData.baseEngineerPostpoFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseEngineerPostpoFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseEngineerPostpoFile&&!!(JSON.parse(copyData?.baseEngineerPostpoFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseEngineerPostpoFile&&!!JSON.parse(copyData?.baseEngineerPostpoFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item
          label="变更申请单"
        >
          <el-upload
            v-model:file-list="formData.baseChangeFormFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseChangeFormFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseChangeFormFile&&!!(JSON.parse(copyData?.baseChangeFormFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseChangeFormFile&&!!JSON.parse(copyData?.baseChangeFormFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item
          label="变更批复文件"
        >
          <el-upload
            v-model:file-list="formData.baseChanFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseChanFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseChanFile&&!!(JSON.parse(copyData?.baseChanFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseChanFile&&JSON.parse(copyData?.baseChanFile)?.length&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>

</template>
