Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

ydmyzx 2 hete
szülő
commit
a4be3abcef

+ 12 - 3
src/views/system/studentSelectSupervisorRecord/index.vue

@@ -141,7 +141,7 @@
             type="text"
             @click="handleDownload(scope.row)"
           >
-            下载简历
+            预览简历
           </el-button>
         </template>
       </el-table-column>
@@ -151,8 +151,16 @@
           <dict-tag :type="DICT_TYPE.SYSTEM_STUDENT_SELECT_RECORD_SELECT_TYPE" :value="scope.row.selectType" />
         </template>
       </el-table-column>
-      <el-table-column label="学生电子签名" align="center" prop="studentSignature" v-if ="userInfo.userType==='4'" />
-      <el-table-column label="导师电子签名" align="center" prop="supervisorSignature" v-if ="userInfo.userType==='4'" />
+      <el-table-column label="学生电子签名" align="center" prop="studentSignature" v-if ="userInfo.userType==='4'">
+        <template #default="scope">
+          <img :src="scope.row.studentSignature" style="width: 100px; height: 50px;"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="导师电子签名" align="center" prop="supervisorSignature" v-if ="userInfo.userType==='4'">
+        <template #default="scope">
+          <img :src="scope.row.supervisorSignature" style="width: 100px; height: 50px;"/>
+        </template>
+      </el-table-column>
       <el-table-column
         label="提交时间"
         align="center"
@@ -407,6 +415,7 @@ const handleDownload = (row) => {
       const link = document.createElement('a');
       link.href = url;
       link.download = '学生简历'; // 提示浏览器下载文件
+      link.target = '_blank'; // 在新标签页打开链接
       document.body.appendChild(link);
       link.click();
       document.body.removeChild(link);

+ 3 - 1
src/views/system/studentSelectSupervisorRecord/record.vue

@@ -344,6 +344,8 @@ const exportWordTemplate = async () => {
   const dataList = await Promise.all(selectedRows.value.map(async (row) => {
     // 获取每一行的详细信息
     const selectionBook = await selectionBookApi.getSelectionBook(row.id);
+    const result =await UserApi.getUser(row.id)
+    console.log("result", result);
     console.log(selectionBook);
     return {
       studentName: selectionBook.studentName || '无',
@@ -351,7 +353,7 @@ const exportWordTemplate = async () => {
       major: selectionBook.major || '无',
       mobile: selectionBook.studentMobile || '无',
       nickname: selectionBook.supervisor || '无',
-      title: selectionBook.supervisor || '无',
+      title: result.workSupervisor || '无',
       studentAchievementRequirement: selectionBook.studentAchievementRequirement || '无',
       studentSignDate: formatDate(selectionBook.studentSignDate) || '无',
       supervisorSignDate: formatDate(selectionBook.supervisorSignDate) || '无',

+ 18 - 3
src/views/system/studentSelectSupervisorRecord/studentSelectSupervisorRecordForm.vue

@@ -51,7 +51,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="校内导师">
-              <el-input v-model="supervisorData.title" placeholder="自动链接" disabled />
+              <el-input v-model="supervisorData.workSupervisor" placeholder="自动链接" disabled />
             </el-form-item>
           </el-col>
         </el-row>
@@ -268,6 +268,7 @@ const open = async (type: string, projectId?: number, supervisorId?:number, id?:
         supervisorData.value.title =supervisor.title;
         supervisorData.value.studentAchievementRequirement = supervisor.studentAchievementRequirement;
         supervisorData.value.major = supervisor.major;
+        supervisorData.value.workSupervisor = supervisor.workSupervisor;
       } finally {
         formLoading.value = false
       }
@@ -293,6 +294,8 @@ const open = async (type: string, projectId?: number, supervisorId?:number, id?:
         supervisorData.value.title =supervisor.title;
         supervisorData.value.studentAchievementRequirement = supervisor.studentAchievementRequirement;
         supervisorData.value.major = supervisor.major;
+        supervisorData.value.workSupervisor = supervisor.workSupervisor;
+        
         formData.value = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecord(id)
       } finally {
         formLoading.value = false
@@ -347,6 +350,7 @@ const open = async (type: string, projectId?: number, supervisorId?:number, id?:
         supervisorData.value.title =supervisor.title;
         supervisorData.value.studentAchievementRequirement = supervisor.studentAchievementRequirement;
         supervisorData.value.major = supervisor.major;
+        supervisorData.value.workSupervisor = supervisor.workSupervisor;
         formData.value = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecord(id)
       } finally {
         formLoading.value = false
@@ -377,13 +381,13 @@ const open = async (type: string, projectId?: number, supervisorId?:number, id?:
         studentData.value.userNumber=result.userNumber
         studentData.value.major=result.major
         studentData.value.mobile=result.mobile
-
         const supervisor = await supervisorSelectionSettingApi.getSupervisorInfo(supervisorId,projectId);
         //显示的
         supervisorData.value.nickname = supervisor.supervisorName;
         supervisorData.value.title =supervisor.title;
         supervisorData.value.studentAchievementRequirement = supervisor.studentAchievementRequirement;
         supervisorData.value.major = supervisor.major;
+        supervisorData.value.workSupervisor = supervisor.workSupervisor;
         formData.value = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecord(id)
       } finally {
         formLoading.value = false
@@ -435,7 +439,18 @@ const handleMouseDown = (event: MouseEvent) => {
 
 const handleMouseMove = (event: MouseEvent) => {
   if (!isDrawing.value || !canvas.value || !context.value) return;
-  const { offsetX, offsetY } = event;
+
+  const rect = canvas.value.getBoundingClientRect();
+  const offsetX = event.clientX - rect.left; // 计算鼠标相对于画布左上角的坐标
+  const offsetY = event.clientY - rect.top;  // 计算鼠标相对于画布左上角的坐标
+
+  // 检查鼠标位置是否超出画布边界
+  if (offsetX < 0 || offsetX > 400 || offsetY < 0 || offsetY > 100) {
+    isDrawing.value = false;
+    return;
+  }
+
+  // 如果未超出边界,继续进行绘制
   context.value.lineTo(offsetX, offsetY);
   context.value.stroke();
 }

+ 28 - 28
src/views/system/studentSelf/index.vue

@@ -54,7 +54,7 @@
               <Icon class="mr-5px" icon="ep:user" />
               <span class="info-label">个人简历:</span>
               <!-- <span class="pull-right"> {{ userInfo.introduction }}</span> -->
-              <el-button class="pull-right" type="text" @click="downloadPDF">预览PDF</el-button>
+              <el-button class="pull-right" type="text" @click="downloadPDF">下载PDF</el-button>
             </li>
           </div>
         </ul>
@@ -131,34 +131,34 @@ const downloadPDF = () => {
     return;
   }
   // 先预览
-  const link = document.createElement('a'); // 创建一个链接元素
-  link.href = url; // 设置链接地址
-  link.download = '下载文件.pdf'; // 设置下载文件的名称
-  document.body.appendChild(link); // 将链接添加到文档中
-  link.click(); // 触发下载
-  document.body.removeChild(link); // 下载后移除链接
+  // const link = document.createElement('a'); // 创建一个链接元素
+  // link.href = url; // 设置链接地址
+  // link.download = '下载文件.pdf'; // 设置下载文件的名称
+  // document.body.appendChild(link); // 将链接添加到文档中
+  // link.click(); // 触发下载
+  // document.body.removeChild(link); // 下载后移除链接
   // 直接下载
-  // // 创建一个下载链接
-  // fetch(url)
-  //   .then(response => {
-  //     if (!response.ok) {
-  //       throw new Error('网络错误');
-  //     }
-  //     return response.blob(); // 将响应转换为 Blob 对象
-  //   })
-  //   .then(blob => {
-  //     const link = document.createElement('a');
-  //     const blobUrl = URL.createObjectURL(blob); // 创建 Blob URL
-  //     link.href = blobUrl;
-  //     link.download = '下载文件.pdf'; // 设置下载文件的名称
-  //     document.body.appendChild(link);
-  //     link.click(); // 触发下载
-  //     document.body.removeChild(link); // 下载后移除链接
-  //     URL.revokeObjectURL(blobUrl); // 释放 Blob URL
-  //   })
-  //   .catch(error => {
-  //     console.error('下载失败:', error);
-  //   });
+  // 创建一个下载链接
+  fetch(url)
+    .then(response => {
+      if (!response.ok) {
+        throw new Error('网络错误');
+      }
+      return response.blob(); // 将响应转换为 Blob 对象
+    })
+    .then(blob => {
+      const link = document.createElement('a');
+      const blobUrl = URL.createObjectURL(blob); // 创建 Blob URL
+      link.href = blobUrl;
+      link.download = '下载文件.pdf'; // 设置下载文件的名称
+      document.body.appendChild(link);
+      link.click(); // 触发下载
+      document.body.removeChild(link); // 下载后移除链接
+      URL.revokeObjectURL(blobUrl); // 释放 Blob URL
+    })
+    .catch(error => {
+      console.error('下载失败:', error);
+    });
 }
 
 const openDialog = () => {

+ 2 - 1
src/views/system/supervisorSelectionSetting/index.vue

@@ -115,7 +115,7 @@
       </el-table-column>
       <el-table-column label="剩余名额" align="center" min-width="100px">
         <template #default="scope">
-          学硕/{{ scope.row.academicSlots -scope.row.occupiedAcademicSlots }} 专硕/{{ scope.row.professionalSlots-scope.row.occupiedProfessionalSlots }}
+          学硕/{{ scope.row.academicSlots - scope.row.occupiedAcademicSlots }} 专硕/{{ scope.row.professionalSlots - scope.row.occupiedProfessionalSlots }}
         </template>
       </el-table-column>
       <el-table-column
@@ -336,6 +336,7 @@ const getList = async () => {
   try {
     const data = await supervisorSelectionSettingApi.getSupervisorSelectionSettingPage(queryParams)
     list.value = data.list
+    // console.log("list",list.value);
     total.value = data.total
   } finally {
     loading.value = false

+ 4 - 3
src/views/system/userDetail/teacher.vue

@@ -35,8 +35,8 @@
     </el-row>
     <el-row v-if="TUsertype ==='5' || userInfo.userType==='5'">
       <el-col :span="24">
-        <el-form-item label="合作的校内导师" prop="supervisor">
-          <el-input v-model="formData.supervisor" placeholder="自动链接" :disabled="!isSupervisor"/>
+        <el-form-item label="合作的校内导师" prop="workSupervisor">
+          <el-input v-model="formData.workSupervisor" placeholder="自动链接" :disabled="!isSupervisor"/>
         </el-form-item>
       </el-col>
     </el-row>
@@ -121,7 +121,8 @@ const formData = ref({
   major:'',//研究方向
   studentAchievementRequirement:"",
   introduction:"",//简介
-  externalSupervisorWorkPlace:""
+  externalSupervisorWorkPlace:"",
+  workSupervisor:"",//合作校内导师
 })
 const formRules = reactive<FormRules>({
 })

+ 27 - 27
src/views/system/workroomTeacher/TeacherSelf/index.vue

@@ -140,34 +140,34 @@ const downloadPDF = () => {
     return;
   }
   // 先预览
-  const link = document.createElement('a'); // 创建一个链接元素
-  link.href = url; // 设置链接地址
-  link.download = '下载文件.pdf'; // 设置下载文件的名称
-  document.body.appendChild(link); // 将链接添加到文档中
-  link.click(); // 触发下载
-  document.body.removeChild(link); // 下载后移除链接
+  // const link = document.createElement('a'); // 创建一个链接元素
+  // link.href = url; // 设置链接地址
+  // link.download = '下载文件.pdf'; // 设置下载文件的名称
+  // document.body.appendChild(link); // 将链接添加到文档中
+  // link.click(); // 触发下载
+  // document.body.removeChild(link); // 下载后移除链接
   // 直接下载
-  // // 创建一个下载链接
-  // fetch(url)
-  //   .then(response => {
-  //     if (!response.ok) {
-  //       throw new Error('网络错误');
-  //     }
-  //     return response.blob(); // 将响应转换为 Blob 对象
-  //   })
-  //   .then(blob => {
-  //     const link = document.createElement('a');
-  //     const blobUrl = URL.createObjectURL(blob); // 创建 Blob URL
-  //     link.href = blobUrl;
-  //     link.download = '下载文件.pdf'; // 设置下载文件的名称
-  //     document.body.appendChild(link);
-  //     link.click(); // 触发下载
-  //     document.body.removeChild(link); // 下载后移除链接
-  //     URL.revokeObjectURL(blobUrl); // 释放 Blob URL
-  //   })
-  //   .catch(error => {
-  //     console.error('下载失败:', error);
-  //   });
+  // 创建一个下载链接
+  fetch(url)
+    .then(response => {
+      if (!response.ok) {
+        throw new Error('网络错误');
+      }
+      return response.blob(); // 将响应转换为 Blob 对象
+    })
+    .then(blob => {
+      const link = document.createElement('a');
+      const blobUrl = URL.createObjectURL(blob); // 创建 Blob URL
+      link.href = blobUrl;
+      link.download = '下载文件.pdf'; // 设置下载文件的名称
+      document.body.appendChild(link);
+      link.click(); // 触发下载
+      document.body.removeChild(link); // 下载后移除链接
+      URL.revokeObjectURL(blobUrl); // 释放 Blob URL
+    })
+    .catch(error => {
+      console.error('下载失败:', error);
+    });
 }
 
 const openDialog = () => {