yanghao 2 недель назад
Родитель
Сommit
6c5b5b7559
2 измененных файлов с 28 добавлено и 2 удалено
  1. 1 1
      src/views/expert/list/index.vue
  2. 27 1
      src/views/researchProject/list/index.vue

+ 1 - 1
src/views/expert/list/index.vue

@@ -1379,7 +1379,7 @@ onMounted(async () => {
 }
 
 .echelon-option.is-active {
-  box-shadow: 0 0 0 1px #234395 inset;
+  // box-shadow: 0 0 0 1px #234395 inset;
 }
 
 .cloud-heading {

+ 27 - 1
src/views/researchProject/list/index.vue

@@ -371,10 +371,36 @@ const resetQuery = () => {
   queryFormRef.value?.resetFields()
   handleQuery()
 }
+const cloneAttachments = (attachments: Project['attachments']) => ({
+  application:
+    attachments?.application?.map((file) =>
+      file && typeof file === 'object' ? { ...file } : file
+    ) || [],
+  report:
+    attachments?.report?.map((file) => (file && typeof file === 'object' ? { ...file } : file)) ||
+    [],
+  others:
+    attachments?.others?.map((file) => (file && typeof file === 'object' ? { ...file } : file)) ||
+    []
+})
+const cloneProjectForm = (project: Project) => ({
+  projectLevel: project.projectLevel,
+  executingUnit: project.executingUnit,
+  projectName: project.projectName,
+  projectLeader: project.projectLeader,
+  projectMembers: project.projectMembers,
+  projectType: project.projectType,
+  purpose: project.purpose,
+  researchContent: project.researchContent,
+  innovation: project.innovation,
+  schedule: project.schedule.map((item) => ({ ...item })),
+  budget: { ...project.budget },
+  attachments: cloneAttachments(project.attachments)
+})
 const openForm = (project?: Project) => {
   editingId.value = project?.id
   dialogTitle.value = project ? '编辑科研项目' : '新增科研项目'
-  formData.value = project ? structuredClone(project) : createForm()
+  formData.value = project ? cloneProjectForm(project) : createForm()
   dialogVisible.value = true
 }
 const addSchedule = () => formData.value.schedule.push(createSchedule())