<script name="projectCollectionEnterBasicInfo" setup>
import { reactive, ref, watch } from 'vue'
import RelatedProjectDialog from '@/pages/projectCollection/projectCollectionEnter/components/relatedProjectDialog.vue'
import ProjectContentDialog from '@/pages/projectCollection/projectCollectionEnter/components/projectContentDialog.vue'
import { reviewFileParam, fileFormatVerification, handleFileSuccess, handleFilePreview, handleFileError, fileTypes, fileDesc } from '@/utils/uploadAction'
import store from '@/store'

const props = defineProps({
    detail: {
      type: Object
    },
    basicInfoData: {
      type: Object
    },
    dictionaryList: {
      type: Array,
      default: () => []
    },
    isSupplemented: {
      type: Boolean,
      default: false
    }
  }),
  uploadUrl = store.dictStore.uploadUrl,
  // { budgetSourceOptions } = store.dictStore.globalDicts || {},
  formRef = ref(),
  formData = ref({
    beseExpectedResults: []
  }),
  currentRules = ref({}),
  column = [
    {
      label: '序号',
      type: 'index',
      width: 60
    },
    {
      label: '项目名称',
      prop: 'baseProjName',
      key: 'baseProjName'
    },
    {
      label: '预算年度',
      prop: 'baseProjSetYear',
      key: 'baseProjSetYear'
    },
    {
      label: '操作',
      slot: 'action',
      key: 'action'
    }
  ],
  // 立项依据
  buildBasisColumn = [
    {
      type: 'selection'
    },
    {
      label: '依据项',
      key: 'title',
      prop: 'title'
    },
    {
      label: '依据文件名',
      slot: 'fileName'
    },
    {
      label: '文件（支持word、pdf格式）',
      slot: 'action',
      width: 300
    }
  ],
  buildBasisColumn1 = [
    {
      label: '依据项',
      key: 'title',
      prop: 'title'
    },
    {
      label: '依据文件名',
      slot: 'fileName'
    },
    {
      label: '文件（支持word、pdf格式）',
      slot: 'action',
      width: 300
    }
  ],
  buildBasisTableData = ref([
    {
      id: 1,
      title: '政策、法规',
      fileName: '',
      fileList: []
    },
    {
      id: 2,
      title: '规划或决策部署',
      fileName: '',
      fileList: []
    },
    {
      id: 3,
      title: '上级下达任务',
      fileName: '',
      fileList: []
    },
    {
      id: 4,
      title: '领导批示',
      fileName: '',
      fileList: []
    },
    {
      id: 5,
      title: '单位核心业务或单位职能',
      fileName: '',
      fileList: []
    },
    {
      id: 6,
      title: '其他',
      fileName: '',
      fileList: []
    }
  ]),
  selectionChange = (val) => {
    formData.value.baseProjBasis = val.map(i => i)
  },
  column1 = [
    {
      label: '项目主要内容',
      prop: 'mainContent',
      key: 'mainContent'
    },
    {
      label: '业务对象',
      prop: 'businessObject',
      key: 'businessObject'
    },
    {
      label: '操作',
      slot: 'action',
      key: 'action'
    }
  ],
  // 关联项目
  relatedProjectDialogData = reactive({
    visible: false
  }),
  showRelatedProjectDialog = () => {
    relatedProjectDialogData.visible = true
    relatedProjectDialogData.data = formData.value.baseHistorProjs
  },
  getProjectList = (data) => {
    formData.value.baseHistorProjs = data.map(i => {
      return {
        baseProjName: i.projectName,
        baseProjSetYear: i.projectYear,
        baseProjId: i.id
      }
    })
  },
  delPro = (index) => {
    formData.value.baseHistorProjs.splice(index, 1)
  },
  // 项目内容与预期成效
  projectContentDialogData = reactive({
    visible: false,
    data: undefined
  }),
  projectContentIndex = ref(),
  showProjectContentDialog = (data, index) => {
    projectContentDialogData.data = data
    projectContentDialogData.visible = true
    projectContentIndex.value = index
  },
  setContent = (data) => {
    if (projectContentIndex.value === undefined) {
      formData.value.beseExpectedResults.push(data)
    } else {
      formData.value.beseExpectedResults[projectContentIndex.value] = data
    }
  },
  delProjectContent = (index) => {
    formData.value.beseExpectedResults.splice(index, 1)
  },
  emits = defineEmits(['getProYear']),
  tableListRef = ref(),
  copyData = ref()
defineExpose({ formRef, formData })
watch(() => props.dictionaryList, val => {
  if (val) {
    buildBasisTableData.value = []
    props.dictionaryList?.filter(i => i.type === 'PROJECT_BASIS').forEach(i => {
      buildBasisTableData.value.push({
        title: i.label,
        fileName: '',
        fileList: [],
        value: i.value
      })
    })
  }
})
watch(() => props.detail, val => {
  if (val) {
    if (props.isSupplemented) {
      copyData.value = val.apply
    }
    formData.value = {
      ...val.apply,
      baseProjTime: val.apply?.baseProjStartTime ? [val.apply?.baseProjStartTime.slice(0, 10), val.apply?.baseProjEndTime.slice(0, 10)] : [],
      baseHistorProjs: val.apply?.baseHistorProjId?.split('；').map((i, k) => {
        return {
          baseProjId: i,
          baseProjName: val.apply?.baseHistorProjName.split('；')[k],
          baseProjSetYear: val.apply?.baseHistorProjYear.split('；')[k]
        }
      }) || [],
      baseProjAmountOri: val.apply?.baseProjAmountOri && val.apply?.baseProjAmountOri?.split('；'),
      baseProjBasis: val.apply?.baseProjBasis?.split('；')?.map((i, index) => {
        const file = `[${val.apply?.baseProjBasisFile.replace(/}]；/g, '}],')}]`
        return {
          title: buildBasisTableData.value?.find(j => j.value === i)?.title,
          fileList: val.apply?.baseProjBasisFile ? reviewFileParam(JSON.parse(file)[index]) : [],
          value: i
        }
      }),
      beseExpectedResults: val.apply?.beseExpectedResults && JSON.parse(val.apply?.beseExpectedResults) || [],
      baseProjApplyFile: val.apply?.baseProjApplyFile ? reviewFileParam(JSON.parse(val.apply.baseProjApplyFile)) : [],
      baseResearchReportFile: val.apply?.baseResearchReportFile ? reviewFileParam(JSON.parse(val.apply.baseResearchReportFile)) : [],
      baseProjOtherFile: val.apply?.baseProjOtherFile ? reviewFileParam(JSON.parse(val.apply.baseProjOtherFile)) : []
    }
    const baseProjBasis = formData.value.baseProjBasis ? JSON.parse(JSON.stringify(formData.value.baseProjBasis)) : []
    if (val.apply?.baseProjBasis?.split('；')?.length) {
      const dataIds = val.apply?.baseProjBasis?.split('；')
      buildBasisTableData.value && buildBasisTableData.value.forEach(item => {
        if (dataIds.includes(item.value)) {
          item.fileList = baseProjBasis.find(i => i.value === item.value)?.fileList
          item.fileName = baseProjBasis.find(i => i.value === item.value)?.fileName
          tableListRef.value.toggleRowSelect(item, true)
        }
      })
    }
    console.log(buildBasisTableData.value)
  }
})
watch(() => props.basicInfoData, val => {
  if (val.baseProjIsConfidentiality === '02') {
    currentRules.value = {}
  } else {
    currentRules.value = {
      baseProjTime: [{ required: true, message: '请选择项目起止时间' }],
      baseProjSetYear: [{ required: true, message: '请选择预算年度' }],
      baseProjDeclAmount: [{ required: true, message: '请填写申报年度预算' }],
      baseProjTotalAmount: [{ required: true, message: '请填写项目总投资' }],
      baseProjConsClass: [{ required: true, message: '请选择建设层级' }],
      baseLowestLevel: [{ required: true, message: '请选择贯通层级' }],
      baseProjAmountOri: [{ required: true, message: '请选择预算来源' }],
      baseBasisAmountOri: [{ required: true, message: '请填写预算来源说明' }],
      baseProjBasis: [{ required: true, message: '请选择立项依据' }],
      baseBasisEstablish: [{ required: true, message: '请填写立项依据说明' }],
      baseProjIntro: [{ required: true, message: '请填写项目概述' }],
      beseExpectedResults: [{ required: true, message: '请至少添加一个项目内容与预期成效' }],
      baseProjApplyFile: [{ required: true, message: '请上传' }],
      baseResearchReportFile: [{ required: true, message: '请上传' }],
      baseHistorProjs: [{ required: true, message: '请关联项目', type: 'array' }]
    }
  }
  formRef.value?.clearValidate()
}, { deep: true })
watch(() => formData.value.baseProjSetYear, val => {
  emits('getProYear', val)
})
</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="发改编码" prop="baseDevelopCode">
          <el-input v-model="formData.baseDevelopCode" placeholder="请填写" :disabled="copyData?.baseDevelopCode&&isSupplemented" />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="财政编码" prop="setProjCodeFinan">
          <el-input v-model="formData.setProjCodeFinan" placeholder="请填写" :disabled="copyData?.setProjCodeFinan&&isSupplemented" />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="项目起止时间" prop="baseProjTime">
          <el-date-picker
            v-model="formData.baseProjTime"
            type="daterange"
            range-separator="-"
            start-placeholder="开始时间"
            end-placeholder="结束时间"
            format="YYYY-MM-DD"
            value-format="YYYY-MM-DD"
            :disabled="copyData?.baseProjStartTime&&isSupplemented"
          />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="预算年度" prop="baseProjSetYear">
          <el-date-picker
            v-model="formData.baseProjSetYear"
            type="year"
            placeholder="请选择"
            format="YYYY"
            value-format="YYYY"
            :disabled="copyData?.baseProjSetYear&&isSupplemented"
          />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="项目总投资" prop="baseProjTotalAmount">
          <el-input-number
            v-model="formData.baseProjTotalAmount"
            placeholder="请填写"
            :min="0.000001"
            :controls="false"
            class="input-amount"
            :disabled="copyData?.baseProjTotalAmount&&isSupplemented"
            @mousewheel.prevent
          />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item
          v-if="formData.baseProjSetYear*1>=2023"
          key="baseProjDeclAmount1"
          label="申报年度预算"
          prop="baseProjDeclAmount"
        >
          <el-input-number
            v-model="formData.baseProjDeclAmount"
            placeholder="请填写"
            :min="0.000001"
            :controls="false"
            class="input-amount"
            :disabled="copyData?.baseProjDeclAmount&&isSupplemented"
            @mousewheel.prevent
          />
        </el-form-item>
        <el-form-item v-else key="baseProjDeclAmount2" label="申报年度预算">
          <el-input-number
            v-model="formData.baseProjDeclAmount"
            placeholder="请填写"
            :min="0.000001"
            :controls="false"
            class="input-amount"
            :disabled="copyData?.baseProjDeclAmount&&isSupplemented"
            @mousewheel.prevent
          />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="建设层级" prop="baseProjConsClass">
          <el-select
            v-model="formData.baseProjConsClass"
            placeholder="请选择"
            class="w-full"
            :disabled="copyData?.baseProjConsClass&&isSupplemented"
          >
            <el-option
              v-for="(item,index) in dictionaryList?.filter(i => i.type === 'BUILD_LEVEL')"
              :key="index"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col v-if="!(basicInfoData?.baseConstructionType?.includes('03')&&!basicInfoData?.baseConstructionType?.includes('01'))" :span="8">
        <el-form-item v-if="basicInfoData?.baseConstructionType?.includes('01')" label="贯通层级" prop="baseLowestLevel">
          <el-select
            v-model="formData.baseLowestLevel"
            placeholder="请选择"
            class="w-full"
            :disabled="copyData?.baseLowestLevel&&isSupplemented"
          >
            <el-option
              v-for="(item,index) in dictionaryList?.filter(i => i.type === 'LINK_UP_LEVEL')"
              :key="index"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item v-else label="贯通层级">
          <el-select
            v-model="formData.baseLowestLevel"
            placeholder="请选择"
            class="w-full"
            :disabled="copyData?.baseLowestLevel&&isSupplemented"
          >
            <el-option
              v-for="(item,index) in dictionaryList?.filter(i => i.type === 'LINK_UP_LEVEL')"
              :key="index"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col v-if="basicInfoData?.baseProjType!=='01'" :span="24">
        <el-form-item
          v-if="!formData.missing"
          key="baseHistorProjs1"
          label="历年项目名称"
          prop="baseHistorProjs"
        >
          <span class="text-[#666666]">是否缺失：</span>
          <el-switch v-model="formData.missing" :disabled="isSupplemented" />
          <template v-if="!formData.missing">
            <p class="text-right w-full mb-8">
              <el-button type="primary" :disabled="copyData?.baseHistorProjId&&isSupplemented" @click="showRelatedProjectDialog">关联历年项目</el-button>
            </p>
            <table-list
              :pagination="false"
              style="width: 100%"
              :column="column"
              :data="formData.baseHistorProjs"
              :empty-temp="false"
            >
              <template #action="{scope}">
                <a v-if="!(copyData?.baseHistorProjId&&isSupplemented)" class="text-danger" @click="delPro(scope.$index)">删除</a>
                <span v-else>-</span>
              </template>
            </table-list>
          </template>
        </el-form-item>
        <el-form-item v-else key="baseHistorProjs2" label="历年项目名称">
          <span class="text-[#666666]">是否缺失：</span>
          <el-switch v-model="formData.missing" :disabled="isSupplemented" />
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="预算来源" prop="baseProjAmountOri">
          <el-checkbox-group v-model="formData.baseProjAmountOri" :disabled="copyData?.baseProjAmountOri&&isSupplemented">
            <el-checkbox
              v-for="(item,index) in dictionaryList?.filter(i => i.type === 'BUDGET_SOURCE')"
              :key="index"
              :label="item.value"
            >
              {{ item.label }}
            </el-checkbox>
          </el-checkbox-group>
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item v-if="formData.baseProjAmountOri?.includes('00')" label="预算来源说明" prop="baseBasisAmountOri">
          <el-input
            v-model="formData.baseBasisAmountOri"
            type="textarea"
            show-word-limit
            placeholder="请填写"
            :maxlength="150"
            :disabled="copyData?.baseBasisAmountOri&&isSupplemented"
          />
        </el-form-item>
        <el-form-item v-else label="预算来源说明">
          <el-input
            v-model="formData.baseBasisAmountOri"
            type="textarea"
            show-word-limit
            placeholder="请填写"
            :maxlength="150"
            :disabled="copyData?.baseBasisAmountOri&&isSupplemented"
          />
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="立项依据" prop="baseProjBasis">
          <table-list
            ref="tableListRef"
            :pagination="false"
            style="width: 100%"
            :column="copyData?.baseProjBasis&&isSupplemented?buildBasisColumn1:buildBasisColumn"
            :data="buildBasisTableData"
            @selection-change="selectionChange"
          >
            <template #fileName="{scope}">
              <el-form-item v-if="(formData.baseProjBasis&&formData.baseProjBasis.map(i=>i.value).includes(scope.row.value))">
                <el-input
                  :value="formData.baseProjBasis[formData.baseProjBasis.findIndex(i=>i.value===scope.row.value)]?.fileList?.[0]?.name"
                  placeholder="请输入"
                  :maxlength="50"
                  :disabled="true"
                />
              </el-form-item>
              <el-input v-else :disabled="true" />
            </template>
            <template #action="{scope}">
              <el-form-item
                v-if="(formData.baseProjBasis&&formData.baseProjBasis.map(i=>i.value).includes(scope.row.value))"
                class="basicUploadItem"
                :rules="{required: true,message:'请上传'}"
                :prop="`baseProjBasis[${formData.baseProjBasis.findIndex(i=>i.value===scope.row.value)}].fileList`"
              >
                <el-upload
                  ref="materialUploadRef"
                  v-model:file-list="formData.baseProjBasis[formData.baseProjBasis.findIndex(i=>i.value===scope.row.value)].fileList"
                  class="flex items-center flex-col w-full"
                  :action="uploadUrl"
                  :on-success="res => handleFileSuccess(res, formData.baseProjBasis[formData.baseProjBasis.findIndex(i=>i.value===scope.row.value)].fileList, true)"
                  :on-error="handleFileError"
                  :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
                  :accept="fileTypes.map(i=>`.${i}`).join(',')"
                  :limit="1"
                  :on-preview="handleFilePreview"
                  :before-remove="()=>!(copyData?.baseProjBasis&&isSupplemented)"
                >
                  <template #trigger>
                    <div>
                      <el-button link :disabled="copyData?.baseProjBasis&&isSupplemented" type="primary">上传</el-button>
                    </div>
                  </template>
                </el-upload>
              </el-form-item>
              <span v-else class="text-info cursor-not-allowed">上传</span>
            </template>
          </table-list>
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="立项依据说明" prop="baseBasisEstablish">
          <el-input
            v-model="formData.baseBasisEstablish"
            type="textarea"
            show-word-limit
            placeholder="请填写"
            :maxlength="150"
            :disabled="copyData?.baseBasisEstablish&&isSupplemented"
          />
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="项目概述" prop="baseProjIntro">
          <el-input
            v-model="formData.baseProjIntro"
            type="textarea"
            show-word-limit
            placeholder="请填写"
            :maxlength="2000"
            :disabled="copyData?.baseProjIntro&&isSupplemented"
          />
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item v-if="formData.baseProjSetYear*1>=2023" label="项目内容与预期成效" prop="beseExpectedResults">
          <table-list
            :pagination="false"
            style="width: 100%"
            :column="column1"
            :data="formData.beseExpectedResults"
            :empty-temp="false"
          >
            <template #action="{scope}">
              <template v-if="copyData?.beseExpectedResults&&isSupplemented">-</template>
              <template v-else>
                <a @click="showProjectContentDialog(scope.row,scope.$index)">编辑</a>
                <a class="text-danger" @click="delProjectContent(scope.$index)">删除</a>
              </template>
            </template>
          </table-list>
          <p class="text-right w-full mt-8">
            <el-button
              type="primary"
              class="w-full"
              plain
              icon="Plus"
              :disabled="copyData?.beseExpectedResults&&isSupplemented"
              @click="()=>showProjectContentDialog()"
            >添加</el-button>
          </p>
        </el-form-item>
        <el-form-item v-else label="项目内容与预期成效">
          <table-list
            :pagination="false"
            style="width: 100%"
            :column="column1"
            :data="formData.beseExpectedResults"
            :empty-temp="false"
          >
            <template #action="{scope}">
              <template v-if="copyData?.beseExpectedResults&&isSupplemented">-</template>
              <template v-else>
                <a @click="showProjectContentDialog(scope.row,scope.$index)">编辑</a>
                <a class="text-danger" @click="delProjectContent(scope.$index)">删除</a>
              </template>
            </template>
          </table-list>
          <p class="text-right w-full mt-8">
            <el-button
              type="primary"
              class="w-full"
              plain
              icon="Plus"
              :disabled="copyData?.beseExpectedResults&&isSupplemented"
              @click="()=>showProjectContentDialog()"
            >添加</el-button>
          </p>
        </el-form-item>
      </el-col>

      <el-col :span="8">
        <el-form-item
          v-if="formData.baseProjSetYear*1<2023"
          label="项目申报书"
        >
          <el-upload
            v-model:file-list="formData.baseProjApplyFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseProjApplyFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            :limit="1"
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseProjApplyFile&&!!(JSON.parse(copyData?.baseProjApplyFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseProjApplyFile&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
        <el-form-item
          v-else-if="formData.baseProjSetYear*1>=2023&&['01','02','04','05'].includes(basicInfoData?.baseProjType)"
          label="项目申报书"
          prop="baseProjApplyFile"
        >
          <el-upload
            v-model:file-list="formData.baseProjApplyFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseProjApplyFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            :limit="1"
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseProjApplyFile&&!!(JSON.parse(copyData?.baseProjApplyFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseProjApplyFile&&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?.baseProjType==='01'||basicInfoData?.baseProjType==='02'" :span="8">
        <el-form-item
          label="可行性研究报告"
          prop="baseResearchReportFile"
        >
          <el-upload
            v-model:file-list="formData.baseResearchReportFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseResearchReportFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            :limit="1"
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseResearchReportFile&&!!(JSON.parse(copyData?.baseResearchReportFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseResearchReportFile&&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.baseProjOtherFile"
            class="w-full"
            :action="uploadUrl"
            :on-success="res => handleFileSuccess(res, formData.baseProjOtherFile)"
            :on-error="handleFileError"
            :before-upload="file=>fileFormatVerification(file, {types: fileTypes})"
            :accept="fileTypes.map(i=>`.${i}`).join(',')"
            multiple
            :on-preview="handleFilePreview"
            :before-remove="()=>!(copyData?.baseProjOtherFile&&!!(JSON.parse(copyData?.baseProjOtherFile)?.length)&&isSupplemented)"
          >
            <el-button
              type="primary"
              class="mr-4"
              plain
              :disabled="copyData?.baseProjOtherFile&&isSupplemented"
            >上传文件</el-button>
            <template #tip>
              <div class="el-upload__tip">支持{{ fileDesc }}文件</div>
            </template>
          </el-upload>
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item
          label="备注"
        >
          <el-input
            v-model="formData.baseProjRemark"
            type="textarea"
            placeholder="请输入"
            :disabled="copyData?.baseProjRemark&&isSupplemented"
          />
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
  <related-project-dialog
    :visible="relatedProjectDialogData.visible"
    :data="relatedProjectDialogData.data"
    @get-project-list="getProjectList"
    @close="relatedProjectDialogData.visible=false"
  />
  <project-content-dialog
    :visible="projectContentDialogData.visible"
    :data="projectContentDialogData.data"
    @set-content="setContent"
    @close="projectContentDialogData.visible=false"
  />
</template>
