47 1 өдөр өмнө
parent
commit
fb29346e63

+ 1 - 0
package.json

@@ -69,6 +69,7 @@
     "min-dash": "^4.1.1",
     "mitt": "^3.0.1",
     "nprogress": "^0.2.0",
+    "pdf-lib": "^1.17.1",
     "pinia": "^2.1.7",
     "pinia-plugin-persistedstate": "^3.2.1",
     "pizzip": "^3.1.7",

+ 32 - 0
pnpm-lock.yaml

@@ -140,6 +140,9 @@ importers:
       nprogress:
         specifier: ^0.2.0
         version: 0.2.0
+      pdf-lib:
+        specifier: ^1.17.1
+        version: 1.17.1
       pinia:
         specifier: ^2.1.7
         version: 2.3.0(typescript@5.3.3)(vue@3.4.21(typescript@5.3.3))
@@ -1433,6 +1436,12 @@ packages:
     resolution: {integrity: sha512-i0GV1yJnm2n3Yq1qw6QrUrd/LI9bE8WEBOTtOkpCXHHdyN3TAGgqAK/DAT05z4fq2x04cARXt2pDmjWjL92iTQ==}
     engines: {node: '>= 10.0.0'}
 
+  '@pdf-lib/standard-fonts@1.0.0':
+    resolution: {integrity: sha512-hU30BK9IUN/su0Mn9VdlVKsWBS6GyhVfqjwl1FjZN4TxP6cCw0jP2w7V3Hf5uX7M0AZJ16vey9yE0ny7Sa59ZA==}
+
+  '@pdf-lib/upng@1.0.1':
+    resolution: {integrity: sha512-dQK2FUMQtowVP00mtIksrlZhdFXQZPC+taih1q4CvPZ5vqdxR/LKBaFg0oAfzd1GlHZXXSPdQfzQnt+ViGvEIQ==}
+
   '@pkgjs/parseargs@0.11.0':
     resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
     engines: {node: '>=14'}
@@ -4683,6 +4692,9 @@ packages:
   pathe@1.1.2:
     resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==}
 
+  pdf-lib@1.17.1:
+    resolution: {integrity: sha512-V/mpyJAoTsN4cnP31vc0wfNA1+p20evqqnap0KLoRUN0Yk/p3wN52DOEsL4oBFcLdb76hlpKPtzJIgo67j/XLw==}
+
   perfect-debounce@1.0.0:
     resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==}
 
@@ -5473,6 +5485,9 @@ packages:
     peerDependencies:
       typescript: '>=4.2.0'
 
+  tslib@1.14.1:
+    resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
+
   tslib@2.3.0:
     resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==}
 
@@ -7156,6 +7171,14 @@ snapshots:
       '@parcel/watcher-win32-x64': 2.5.0
     optional: true
 
+  '@pdf-lib/standard-fonts@1.0.0':
+    dependencies:
+      pako: 1.0.11
+
+  '@pdf-lib/upng@1.0.1':
+    dependencies:
+      pako: 1.0.11
+
   '@pkgjs/parseargs@0.11.0':
     optional: true
 
@@ -10831,6 +10854,13 @@ snapshots:
 
   pathe@1.1.2: {}
 
+  pdf-lib@1.17.1:
+    dependencies:
+      '@pdf-lib/standard-fonts': 1.0.0
+      '@pdf-lib/upng': 1.0.1
+      pako: 1.0.11
+      tslib: 1.14.1
+
   perfect-debounce@1.0.0: {}
 
   performance-now@2.1.0:
@@ -11714,6 +11744,8 @@ snapshots:
     dependencies:
       typescript: 5.3.3
 
+  tslib@1.14.1: {}
+
   tslib@2.3.0: {}
 
   tslib@2.8.1: {}

BIN
public/GB2312.ttf


+ 1 - 0
src/api/system/user/profile.ts

@@ -37,6 +37,7 @@ export interface ProfileVO {
   userType: string
   photoUrl: string
   isSelectionInformation:string
+  supervisorId:number
 }
 
 export interface UserProfileUpdateReqVO {

+ 2 - 2
src/router/modules/remaining.ts

@@ -4,7 +4,7 @@ import UserAchievementcopy from '@/views/system/workroomCollege/userAchievement/
 import deptInfo from '@/views/system/workroomCollege/deptInfo/index.vue'
 import * as LoginApi from '@/api/login'
 import supervisorSelectionSetting from "@/views/system/supervisorSelectionSetting/index.vue";
-import studentSelectSupervisorRecord from "@/views/system/studentSelectSupervisorRecord/index.vue";
+import studentSelectSupervisorRecord from "@/views/system/studentSelection/studentSelectSupervisorRecord/index.vue";
 import studentForm from "@/views/system/userDetail/student.vue";
 
 const { t } = useI18n()
@@ -76,7 +76,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
       },
 
       {
-        path: 'studentSelectSupervisorRecord/index',
+        path: 'studentSelection/studentSelectSupervisorRecord/index',
         component: studentSelectSupervisorRecord,
         name: 'studentSelectSupervisorRecord',
         meta: {

+ 41 - 0
src/utils/pdf.js

@@ -0,0 +1,41 @@
+import { saveAs } from "file-saver";
+import { jsPDF } from "jspdf";
+import html2canvas from "html2canvas";
+
+// 你已经实现了生成 Word 文件的功能
+// 增加一个导出 PDF 的方法
+
+async exportToPDF() {
+    // 下载并生成 Word 文件
+    this.downloadFile(); // 首先下载 Word 文件
+
+    // 假设已经有一个 DOM 元素来展示 Word 内容
+    const element = document.getElementById('your-word-content'); // 替换为你展示内容的元素 ID
+
+    // 使用 html2canvas 将该元素转换为 canvas
+    const canvas = await html2canvas(element);
+    const imgData = canvas.toDataURL('image/png');
+
+    const pdf = new jsPDF();
+    const imgWidth = 190; // 设置图片宽度
+    const pageHeight = pdf.internal.pageSize.height;
+    const imgHeight = (canvas.height * imgWidth) / canvas.width;
+    let heightLeft = imgHeight;
+
+    let position = 0;
+
+    // 添加图片到 PDF 中
+    pdf.addImage(imgData, 'PNG', 10, position, imgWidth, imgHeight);
+    heightLeft -= pageHeight;
+
+    // 检查是否需要添加更多页面
+    while (heightLeft >= 0) {
+        position = heightLeft - imgHeight;
+        pdf.addPage();
+        pdf.addImage(imgData, 'PNG', 10, position, imgWidth, imgHeight);
+        heightLeft -= pageHeight;
+    }
+
+    // 保存 PDF 文件
+    pdf.save(this.fileName.replace('.docx', '.pdf'));
+}

+ 0 - 0
src/views/system/studentSelectSupervisorRecord/index.vue → src/views/system/studentSelection/studentSelectSupervisorRecord/index.vue


+ 26 - 7
src/views/system/studentSelectSupervisorRecord/record.vue → src/views/system/studentSelection/studentSelectSupervisorRecord/record.vue

@@ -140,12 +140,12 @@
               <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">
+          <el-table-column label="学生电子签名" align="center" prop="studentSignature" min-width="120px">
             <template #default="scope">
               <img v-if="scope.row.studentSignature" :src="scope.row.studentSignature" style="width: 100px; height: 50px;" />
             </template>
           </el-table-column>
-          <el-table-column label="导师电子签名" align="center" prop="supervisorSignature">
+          <el-table-column label="导师电子签名" align="center" prop="supervisorSignature" min-width="120px">
             <template #default="scope">
               <img v-if="scope.row.supervisorSignature" :src="scope.row.supervisorSignature" style="width: 100px; height: 50px;" />
             </template>
@@ -222,6 +222,9 @@ import ExportWord  from '@/utils/doc.ts';
 import { selectionBookApi } from '@/api/system/studentSelectSupervisorRecord/selectionBook';
 import { saveAs } from "file-saver";
 import JSZip from "jszip"
+import Docxtemplater from "docxtemplater";
+import PizZip from "pizzip";
+import { PDFDocument } from "pdf-lib";
 
 
 /** 导师学硕专硕名额设置 列表 */
@@ -363,15 +366,12 @@ const exportWordTemplate = async () => {
   }));
   console.log("导出的数据对象:", dataList);
   const zip = new JSZip();
-
-  const newFileName = '我就不信了.docx';
   try {
     // 使用 for 循环遍历 dataList 并生成多个 .docx 文件
     for (let i = 0; i < dataList.length; i++) {
       const data = dataList[i];
       const _word = new ExportWord({
         url: '/templates/newceshi.docx',
-        filename: newFileName,
         obj: data
       });
 
@@ -379,12 +379,31 @@ const exportWordTemplate = async () => {
       await _word.initWord((_this) => {
         const out = _this.addDownloadFile(); // 获取文件的 Blob
         console.log(`${data.studentName}_.docx 文件已生成`);
-
         // 将生成的 .docx 文件添加到 zip 压缩包中
         zip.file(`${data.studentName}_.docx`, out);
       });
-    }
+      const pdfDoc = await PDFDocument.create();
+      const page = pdfDoc.addPage();
+      const { width, height } = page.getSize();
+      // 将 Word 文件内容写入 PDF
+      const text = `学生姓名: ${data.studentName}\n学号: ${data.userNumber}\n专业: ${data.major}\n电话: ${data.mobile}\n导师: ${data.nickname}\n工作职称: ${data.title}\n签名日期: ${data.studentSignDate}\n导师签名日期: ${data.supervisorSignDate}`;
+      page.drawText(text, { x: 50, y: height - 50, size: 12 });
+      const fontBytes = await fetch('/GB2312.ttf').then(res => res.arrayBuffer());
+      const customFont = await pdfDoc.embedFont(fontBytes);
+      // 在页面上绘制文本时使用指定的字体
+      page.drawText(text, {
+        x: 50,
+        y: height - 50,
+        size: 12,
+        font: customFont, // 使用自定义字体
+      });
+      // 生成 PDF 文件的 Blob
+      const pdfBytes = await pdfDoc.save();
+      const pdfBlob = new Blob([pdfBytes], { type: 'application/pdf' });
+      zip.file(`${data.studentName}_.pdf`, pdfBlob);
 
+    }
+    
     // 生成 zip 文件并保存
     const zipBlob = await zip.generateAsync({ type: 'blob' });
     saveAs(zipBlob, "师生互选表.zip");

+ 0 - 0
src/views/system/studentSelectSupervisorRecord/studentSelectSupervisorRecordForm.vue → src/views/system/studentSelection/studentSelectSupervisorRecord/studentSelectSupervisorRecordForm.vue


+ 231 - 0
src/views/system/studentSelection/studentSelectionDone/inedx.vue

@@ -0,0 +1,231 @@
+<template>
+  <ContentWrap>
+    <el-form
+      ref="queryFormRef"
+      :inline="true"
+      :model="queryForm"
+      label-width="100px"
+    >
+    <el-form-item label="参与导师" prop="supervisorIds">
+      <el-select
+        v-model="queryForm.supervisorId"
+        @change="getPassList"
+        placeholder="请选择参与导师"
+        clearable
+        filterable
+        class="!w-240px"
+      >
+        <el-option
+          v-for="supervisor in supervisors"
+          :key="supervisor.id"
+          :label="supervisor.nickname"
+          :value="supervisor.id"
+        />
+      </el-select>
+    </el-form-item>
+  
+    <el-form-item label="请选择项目" prop="projectId">
+      <el-select
+        v-model="queryForm.projectId"
+        @change="getPassList"
+        placeholder="请选择项目"
+        clearable
+        filterable
+        class="!w-240px"
+      >
+        <el-option
+          v-for="project in projects"
+          :key="project.id"
+          :label="project.projectName"
+          :value="project.id"
+        />
+      </el-select>
+    </el-form-item>
+  
+    <el-form-item label="参与学生年级" prop="studentGrade">
+      <el-select
+        v-model="queryForm.studentGrade"
+        placeholder="请选择参与学生年级"
+        clearable
+        @change="handleQuery"
+        class="!w-240px"
+      >
+        <el-option
+          v-for="year in gradeOptions"
+          :key="year"
+          :label="year"
+          :value="year"
+        />
+      </el-select>
+    </el-form-item>
+  
+    <el-form-item label="学生姓名">
+      <el-input
+        v-model="queryForm.studentName"
+        placeholder="请输入学生名称"
+        clearable
+        @keyup.enter="handleQuery"
+        class="!w-240px"
+      />
+    </el-form-item>
+    <el-form-item label="选择状态" prop="selectType">
+      <el-select
+        v-model="queryForm.selectType"
+        @change="getPassList"
+        placeholder="请选择选择状态"
+        clearable
+        class="!w-240px"
+      >
+        <el-option label="撤回" value="0" />
+        <el-option label="待处理" value="1" />
+        <el-option label="同意" value="2" />
+        <el-option label="退回" value="3" />
+        <el-option label="志愿编辑" value="4" />
+      </el-select>
+    </el-form-item>
+    <el-form-item>
+      <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
+      <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
+    </el-form-item>
+    </el-form>
+  </ContentWrap>
+
+  <ContentWrap>
+    <el-table :data="passList" :loading="loading" :show-overflow-tooltip="true">
+      <el-table-column type="index" />
+      <el-table-column label="项目名称" align="center" prop="projectName" />
+      <el-table-column label="学生姓名" align="center" prop="studentName" />
+      <el-table-column label="硕士类型" align="center" prop="masterType" >
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.SYSTEM_STUDENT_MASTER_TYPE" :value="scope.row.masterType" />
+        </template>
+      </el-table-column>
+      <el-table-column label="导师姓名" align="center" prop="supervisor" />
+      <el-table-column label="导师类型" align="center" prop="supervisorType" />
+      <el-table-column label="申请状态" align="center" prop="selectType" >
+        <template #default="scope">
+          <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" min-width="100px">
+        <template #default="scope">
+          <img v-if="scope.row.studentSignature" :src="scope.row.studentSignature" style="width: 100px; height: 50px;" />
+        </template>
+      </el-table-column>
+      <el-table-column label="导师电子签名" align="center" prop="supervisorSignature" min-width="100px">
+        <template #default="scope">
+          <img v-if="scope.row.supervisorSignature" :src="scope.row.supervisorSignature" style="width: 100px; height: 50px;" />
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="提交时间"
+        align="center"
+        prop="createTime"
+        :formatter="dateFormatter"
+        width="180px"
+      />
+      <el-table-column
+        label="导师审批时间"
+        align="center"
+        prop="supervisorApproveTime"
+        :formatter="dateFormatter"
+        width="180px"
+      />
+    </el-table>
+  </ContentWrap>
+</template>
+
+<script setup lang="ts">
+import { ref } from 'vue'
+import {DICT_TYPE} from "@/utils/dict";
+import { dateFormatter } from '@/utils/formatTime'
+import {studentSelectSupervisorRecordApi, studentSelectSupervisorRecordVO} from "@/api/system/studentSelectSupervisorRecord";
+import {studentSelectionProjectApi, studentSelectionProjectVO} from "@/api/system/studentSelectionProject"
+import * as UserApi from '@/api/system/user'
+
+defineOptions({ name: 'StudentSelectionWait' })
+
+const message = useMessage() // 消息弹窗
+const loading = ref(true) // 列表的加载中
+const isLoading = ref(false)
+const total = ref(0) // 列表的总页数
+
+const queryForm = ref({
+  pageNo: 1,
+  pageSize: 10,
+  id: undefined,
+  projectId: undefined,
+  supervisorId: undefined,
+  externalSupervisorId:undefined,
+  supervisor:undefined,
+  userType:undefined,
+  studentName:"",
+  createTime: [],
+  projectName:"",
+  studentGrade:"",
+  selectType:undefined,
+})
+
+const passList = ref<studentSelectSupervisorRecordVO[]>([]) //下面的选择记录列表
+const getPassList = async () => {
+  loading.value = true
+  try {
+    const data = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecordPage(queryForm)
+    passList.value = data
+    // console.log("passList", passList.value);
+    passList.value = data.list
+    total.value = data.total
+  } finally {
+    loading.value = false
+  }
+}
+
+const supervisors = ref()
+const getSupervisor= async () => {
+  try {
+    const result = await UserApi.getSupervisor()
+    supervisors.value = result
+  } catch (error) {
+    console.error('未获取到导师', error)
+  }
+}
+
+const projects = ref()
+const getAllProject= async () => {
+  try {
+    projects.value = await studentSelectionProjectApi.getAllProject()
+  } catch (error) {
+    console.error('未获取到项目', error)
+  }
+}
+
+const currentYear = new Date().getFullYear(); // 获取当前年份
+const gradeOptions = computed(() => {
+  return [
+    currentYear + '级',         // 今年
+    currentYear - 1 + '级',     // 去年
+    currentYear - 2 + '级',     // 前年
+    currentYear - 3 + '级',     // 大前年
+    currentYear - 4 + '级',     // 大大前年
+  ];
+});
+
+const handleQuery = () => {
+  queryForm.value.pageNo = 1
+  getPassList()
+}
+
+const queryFormRef = ref()
+const resetQuery = () => {
+  queryFormRef.value.resetFields()
+  handleQuery()
+}
+
+
+onMounted(() => {
+  getPassList()
+  getSupervisor()
+  getAllProject()
+})
+
+</script>

+ 224 - 0
src/views/system/studentSelection/studentSelectionNo/index.vue

@@ -0,0 +1,224 @@
+<template>
+  <ContentWrap>
+    <el-form
+      ref="queryFormRef"
+      :inline="true"
+      :model="queryForm"
+      label-width="100px"
+    >
+    <el-form-item label="参与导师" prop="supervisorIds">
+      <el-select
+        v-model="queryForm.supervisorId"
+        @change="getPassList"
+        placeholder="请选择参与导师"
+        clearable
+        filterable
+        class="!w-240px"
+      >
+        <el-option
+          v-for="supervisor in supervisors"
+          :key="supervisor.id"
+          :label="supervisor.nickname"
+          :value="supervisor.id"
+        />
+      </el-select>
+    </el-form-item>
+  
+    <el-form-item label="请选择项目" prop="projectId">
+      <el-select
+        v-model="queryForm.projectId"
+        @change="getPassList"
+        placeholder="请选择项目"
+        clearable
+        filterable
+        class="!w-240px"
+      >
+        <el-option
+          v-for="project in projects"
+          :key="project.id"
+          :label="project.projectName"
+          :value="project.id"
+        />
+      </el-select>
+    </el-form-item>
+  
+    <el-form-item label="参与学生年级" prop="studentGrade">
+      <el-select
+        v-model="queryForm.studentGrade"
+        placeholder="请选择参与学生年级"
+        clearable
+        @change="handleQuery"
+        class="!w-240px"
+      >
+        <el-option
+          v-for="year in gradeOptions"
+          :key="year"
+          :label="year"
+          :value="year"
+        />
+      </el-select>
+    </el-form-item>
+  
+    <el-form-item label="学生姓名">
+      <el-input
+        v-model="queryForm.studentName"
+        placeholder="请输入学生名称"
+        clearable
+        @keyup.enter="handleQuery"
+        class="!w-240px"
+      />
+    </el-form-item>
+    <el-form-item label="选择状态" prop="selectType">
+      <el-select
+        v-model="queryForm.selectType"
+        @change="getPassList"
+        placeholder="请选择选择状态"
+        clearable
+        class="!w-240px"
+      >
+        <el-option label="撤回" value="0" />
+        <el-option label="待处理" value="1" />
+        <el-option label="同意" value="2" />
+        <el-option label="退回" value="3" />
+        <el-option label="志愿编辑" value="4" />
+      </el-select>
+    </el-form-item>
+    <el-form-item>
+      <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
+      <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
+    </el-form-item>
+    </el-form>
+  </ContentWrap>
+
+  <ContentWrap>
+    <el-table :data="passList" :loading="loading" :show-overflow-tooltip="true">
+      <el-table-column type="index" />
+      <el-table-column label="项目名称" align="center" prop="projectName" />
+      <el-table-column label="学生姓名" align="center" prop="studentName" />
+      <el-table-column label="硕士类型" align="center" prop="masterType" >
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.SYSTEM_STUDENT_MASTER_TYPE" :value="scope.row.masterType" />
+        </template>
+      </el-table-column>
+      <el-table-column label="导师姓名" align="center" prop="supervisor" />
+      <el-table-column label="导师类型" align="center" prop="supervisorType" />
+      <el-table-column label="申请状态" align="center" prop="selectType" >
+        <template #default="scope">
+          <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" min-width="100px">
+        <template #default="scope">
+          <img v-if="scope.row.studentSignature" :src="scope.row.studentSignature" style="width: 100px; height: 50px;" />
+        </template>
+      </el-table-column>
+      <el-table-column label="导师电子签名" align="center" prop="supervisorSignature" min-width="100px">
+        <template #default="scope">
+          <img v-if="scope.row.supervisorSignature" :src="scope.row.supervisorSignature" style="width: 100px; height: 50px;" />
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="提交时间"
+        align="center"
+        prop="createTime"
+        :formatter="dateFormatter"
+        width="180px"
+      />
+    </el-table>
+  </ContentWrap>
+</template>
+
+<script setup lang="ts">
+import { ref } from 'vue'
+import {DICT_TYPE} from "@/utils/dict";
+import { dateFormatter } from '@/utils/formatTime'
+import {studentSelectSupervisorRecordApi, studentSelectSupervisorRecordVO} from "@/api/system/studentSelectSupervisorRecord";
+import {studentSelectionProjectApi, studentSelectionProjectVO} from "@/api/system/studentSelectionProject"
+import * as UserApi from '@/api/system/user'
+
+defineOptions({ name: 'StudentSelectionWait' })
+
+const message = useMessage() // 消息弹窗
+const loading = ref(true) // 列表的加载中
+const isLoading = ref(false)
+const total = ref(0) // 列表的总页数
+
+const queryForm = ref({
+  pageNo: 1,
+  pageSize: 10,
+  id: undefined,
+  projectId: undefined,
+  supervisorId: undefined,
+  externalSupervisorId:undefined,
+  supervisor:undefined,
+  userType:undefined,
+  studentName:"",
+  createTime: [],
+  projectName:"",
+  studentGrade:"",
+  selectType:undefined,
+})
+
+const passList = ref<studentSelectSupervisorRecordVO[]>([]) //下面的选择记录列表
+const getPassList = async () => {
+  loading.value = true
+  try {
+    const data = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecordPage(queryForm)
+    passList.value = data
+    // console.log("passList", passList.value);
+    passList.value = data.list
+    total.value = data.total
+  } finally {
+    loading.value = false
+  }
+}
+
+const supervisors = ref()
+const getSupervisor= async () => {
+  try {
+    const result = await UserApi.getSupervisor()
+    supervisors.value = result
+  } catch (error) {
+    console.error('未获取到导师', error)
+  }
+}
+
+const projects = ref()
+const getAllProject= async () => {
+  try {
+    projects.value = await studentSelectionProjectApi.getAllProject()
+  } catch (error) {
+    console.error('未获取到项目', error)
+  }
+}
+
+const currentYear = new Date().getFullYear(); // 获取当前年份
+const gradeOptions = computed(() => {
+  return [
+    currentYear + '级',         // 今年
+    currentYear - 1 + '级',     // 去年
+    currentYear - 2 + '级',     // 前年
+    currentYear - 3 + '级',     // 大前年
+    currentYear - 4 + '级',     // 大大前年
+  ];
+});
+
+const handleQuery = () => {
+  queryForm.value.pageNo = 1
+  getPassList()
+}
+
+const queryFormRef = ref()
+const resetQuery = () => {
+  queryFormRef.value.resetFields()
+  handleQuery()
+}
+
+
+onMounted(() => {
+  getPassList()
+  getSupervisor()
+  getAllProject()
+})
+
+</script>

+ 0 - 0
src/views/system/studentSelectionProject/index.vue → src/views/system/studentSelection/studentSelectionProject/index.vue


+ 4 - 4
src/views/system/studentSelectionProject/studentSelectionProjectForm.vue → src/views/system/studentSelection/studentSelectionProject/studentSelectionProjectForm.vue

@@ -10,21 +10,21 @@
       <el-form-item label="项目名称" prop="projectName">
         <el-input v-model="formData.projectName" placeholder="请输入项目名称" />
       </el-form-item>
-      <el-form-item label="学生开始时间" prop="studentStartTime">
+      <el-form-item label="开始时间" prop="studentStartTime">
         <el-date-picker
             v-model="formData.studentStartTime"
             type="datetime"
             value-format="x"
-            placeholder="选择学生开始时间"
+            placeholder="选择开始时间"
             class="!w-full"
         />
       </el-form-item>
-      <el-form-item label="导师截止时间" prop="supervisorConfirmDeadline">
+      <el-form-item label="截止时间" prop="supervisorConfirmDeadline">
         <el-date-picker
             v-model="formData.supervisorConfirmDeadline"
             type="datetime"
             value-format="x"
-            placeholder="选择导师截止时间"
+            placeholder="选择截止时间"
             class="!w-full"
         />
       </el-form-item>

+ 217 - 0
src/views/system/studentSelection/studentSelectionWait/index.vue

@@ -0,0 +1,217 @@
+<template>
+  <ContentWrap>
+    <el-form
+      ref="queryFormRef"
+      :inline="true"
+      :model="queryForm"
+      label-width="100px"
+    >
+    <el-form-item label="参与导师" prop="supervisorIds">
+      <el-select
+        v-model="queryForm.supervisorId"
+        @change="getPassList"
+        placeholder="请选择参与导师"
+        clearable
+        filterable
+        class="!w-240px"
+      >
+        <el-option
+          v-for="supervisor in supervisors"
+          :key="supervisor.id"
+          :label="supervisor.nickname"
+          :value="supervisor.id"
+        />
+      </el-select>
+    </el-form-item>
+  
+    <el-form-item label="请选择项目" prop="projectId">
+      <el-select
+        v-model="queryForm.projectId"
+        @change="getPassList"
+        placeholder="请选择项目"
+        clearable
+        filterable
+        class="!w-240px"
+      >
+        <el-option
+          v-for="project in projects"
+          :key="project.id"
+          :label="project.projectName"
+          :value="project.id"
+        />
+      </el-select>
+    </el-form-item>
+  
+    <el-form-item label="参与学生年级" prop="studentGrade">
+      <el-select
+        v-model="queryForm.studentGrade"
+        placeholder="请选择参与学生年级"
+        clearable
+        @change="handleQuery"
+        class="!w-240px"
+      >
+        <el-option
+          v-for="year in gradeOptions"
+          :key="year"
+          :label="year"
+          :value="year"
+        />
+      </el-select>
+    </el-form-item>
+  
+    <el-form-item label="学生姓名">
+      <el-input
+        v-model="queryForm.studentName"
+        placeholder="请输入学生名称"
+        clearable
+        @keyup.enter="handleQuery"
+        class="!w-240px"
+      />
+    </el-form-item>
+    <el-form-item label="选择状态" prop="selectType">
+      <el-select
+        v-model="queryForm.selectType"
+        @change="getPassList"
+        placeholder="请选择选择状态"
+        clearable
+        class="!w-240px"
+      >
+        <el-option label="撤回" value="0" />
+        <el-option label="待处理" value="1" />
+        <el-option label="同意" value="2" />
+        <el-option label="退回" value="3" />
+        <el-option label="志愿编辑" value="4" />
+      </el-select>
+    </el-form-item>
+    <el-form-item>
+      <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
+      <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
+    </el-form-item>
+    </el-form>
+  </ContentWrap>
+
+  <ContentWrap>
+    <el-table :data="passList" :loading="loading" :show-overflow-tooltip="true">
+      <el-table-column type="index" />
+      <el-table-column label="项目名称" align="center" prop="projectName" />
+      <el-table-column label="学生姓名" align="center" prop="studentName" />
+      <el-table-column label="硕士类型" align="center" prop="masterType" >
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.SYSTEM_STUDENT_MASTER_TYPE" :value="scope.row.masterType" />
+        </template>
+      </el-table-column>
+      <el-table-column label="申请状态" align="center" prop="selectType" >
+        <template #default="scope">
+          <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" min-width="100px">
+        <template #default="scope">
+          <img v-if="scope.row.studentSignature" :src="scope.row.studentSignature" style="width: 100px; height: 50px;" />
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="提交时间"
+        align="center"
+        prop="createTime"
+        :formatter="dateFormatter"
+        width="180px"
+      />
+    </el-table>
+  </ContentWrap>
+</template>
+
+<script setup lang="ts">
+import { ref } from 'vue'
+import {DICT_TYPE} from "@/utils/dict";
+import { dateFormatter } from '@/utils/formatTime'
+import {studentSelectSupervisorRecordApi, studentSelectSupervisorRecordVO} from "@/api/system/studentSelectSupervisorRecord";
+import {studentSelectionProjectApi, studentSelectionProjectVO} from "@/api/system/studentSelectionProject"
+import * as UserApi from '@/api/system/user'
+
+defineOptions({ name: 'StudentSelectionWait' })
+
+const message = useMessage() // 消息弹窗
+const loading = ref(true) // 列表的加载中
+const isLoading = ref(false)
+const total = ref(0) // 列表的总页数
+
+const queryForm = ref({
+  pageNo: 1,
+  pageSize: 10,
+  id: undefined,
+  projectId: undefined,
+  supervisorId: undefined,
+  externalSupervisorId:undefined,
+  supervisor:undefined,
+  userType:undefined,
+  studentName:"",
+  createTime: [],
+  projectName:"",
+  studentGrade:"",
+  selectType:undefined,
+})
+
+const passList = ref<studentSelectSupervisorRecordVO[]>([]) //下面的选择记录列表
+const getPassList = async () => {
+  loading.value = true
+  try {
+    const data = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecordPage(queryForm)
+    passList.value = data
+    // console.log("passList", passList.value);
+    passList.value = data.list
+    total.value = data.total
+  } finally {
+    loading.value = false
+  }
+}
+
+const supervisors = ref()
+const getSupervisor= async () => {
+  try {
+    const result = await UserApi.getSupervisor()
+    supervisors.value = result
+  } catch (error) {
+    console.error('未获取到导师', error)
+  }
+}
+
+const projects = ref()
+const getAllProject= async () => {
+  try {
+    projects.value = await studentSelectionProjectApi.getAllProject()
+  } catch (error) {
+    console.error('未获取到项目', error)
+  }
+}
+
+const currentYear = new Date().getFullYear(); // 获取当前年份
+const gradeOptions = computed(() => {
+  return [
+    currentYear + '级',         // 今年
+    currentYear - 1 + '级',     // 去年
+    currentYear - 2 + '级',     // 前年
+    currentYear - 3 + '级',     // 大前年
+    currentYear - 4 + '级',     // 大大前年
+  ];
+});
+
+const handleQuery = () => {
+  queryForm.value.pageNo = 1
+  getPassList()
+}
+
+const queryFormRef = ref()
+const resetQuery = () => {
+  queryFormRef.value.resetFields()
+  handleQuery()
+}
+
+
+onMounted(() => {
+  getPassList()
+  getSupervisor()
+  getAllProject()
+})
+
+</script>

+ 231 - 0
src/views/system/studentSelection/studentSelectionYes/index.vue

@@ -0,0 +1,231 @@
+<template>
+  <ContentWrap>
+    <el-form
+      ref="queryFormRef"
+      :inline="true"
+      :model="queryForm"
+      label-width="100px"
+    >
+    <el-form-item label="参与导师" prop="supervisorIds">
+      <el-select
+        v-model="queryForm.supervisorId"
+        @change="getPassList"
+        placeholder="请选择参与导师"
+        clearable
+        filterable
+        class="!w-240px"
+      >
+        <el-option
+          v-for="supervisor in supervisors"
+          :key="supervisor.id"
+          :label="supervisor.nickname"
+          :value="supervisor.id"
+        />
+      </el-select>
+    </el-form-item>
+  
+    <el-form-item label="请选择项目" prop="projectId">
+      <el-select
+        v-model="queryForm.projectId"
+        @change="getPassList"
+        placeholder="请选择项目"
+        clearable
+        filterable
+        class="!w-240px"
+      >
+        <el-option
+          v-for="project in projects"
+          :key="project.id"
+          :label="project.projectName"
+          :value="project.id"
+        />
+      </el-select>
+    </el-form-item>
+  
+    <el-form-item label="参与学生年级" prop="studentGrade">
+      <el-select
+        v-model="queryForm.studentGrade"
+        placeholder="请选择参与学生年级"
+        clearable
+        @change="handleQuery"
+        class="!w-240px"
+      >
+        <el-option
+          v-for="year in gradeOptions"
+          :key="year"
+          :label="year"
+          :value="year"
+        />
+      </el-select>
+    </el-form-item>
+  
+    <el-form-item label="学生姓名">
+      <el-input
+        v-model="queryForm.studentName"
+        placeholder="请输入学生名称"
+        clearable
+        @keyup.enter="handleQuery"
+        class="!w-240px"
+      />
+    </el-form-item>
+    <el-form-item label="选择状态" prop="selectType">
+      <el-select
+        v-model="queryForm.selectType"
+        @change="getPassList"
+        placeholder="请选择选择状态"
+        clearable
+        class="!w-240px"
+      >
+        <el-option label="撤回" value="0" />
+        <el-option label="待处理" value="1" />
+        <el-option label="同意" value="2" />
+        <el-option label="退回" value="3" />
+        <el-option label="志愿编辑" value="4" />
+      </el-select>
+    </el-form-item>
+    <el-form-item>
+      <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
+      <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
+    </el-form-item>
+    </el-form>
+  </ContentWrap>
+
+  <ContentWrap>
+    <el-table :data="passList" :loading="loading" :show-overflow-tooltip="true">
+      <el-table-column type="index" />
+      <el-table-column label="项目名称" align="center" prop="projectName" />
+      <el-table-column label="学生姓名" align="center" prop="studentName" />
+      <el-table-column label="硕士类型" align="center" prop="masterType" >
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.SYSTEM_STUDENT_MASTER_TYPE" :value="scope.row.masterType" />
+        </template>
+      </el-table-column>
+      <el-table-column label="导师姓名" align="center" prop="supervisor" />
+      <el-table-column label="导师类型" align="center" prop="supervisorType" />
+      <el-table-column label="申请状态" align="center" prop="selectType" >
+        <template #default="scope">
+          <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" min-width="100px">
+        <template #default="scope">
+          <img v-if="scope.row.studentSignature" :src="scope.row.studentSignature" style="width: 100px; height: 50px;" />
+        </template>
+      </el-table-column>
+      <el-table-column label="导师电子签名" align="center" prop="supervisorSignature" min-width="100px">
+        <template #default="scope">
+          <img v-if="scope.row.supervisorSignature" :src="scope.row.supervisorSignature" style="width: 100px; height: 50px;" />
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="提交时间"
+        align="center"
+        prop="createTime"
+        :formatter="dateFormatter"
+        width="180px"
+      />
+      <el-table-column
+        label="导师审批时间"
+        align="center"
+        prop="supervisorApproveTime"
+        :formatter="dateFormatter"
+        width="180px"
+      />
+    </el-table>
+  </ContentWrap>
+</template>
+
+<script setup lang="ts">
+import { ref } from 'vue'
+import {DICT_TYPE} from "@/utils/dict";
+import { dateFormatter } from '@/utils/formatTime'
+import {studentSelectSupervisorRecordApi, studentSelectSupervisorRecordVO} from "@/api/system/studentSelectSupervisorRecord";
+import {studentSelectionProjectApi, studentSelectionProjectVO} from "@/api/system/studentSelectionProject"
+import * as UserApi from '@/api/system/user'
+
+defineOptions({ name: 'StudentSelectionWait' })
+
+const message = useMessage() // 消息弹窗
+const loading = ref(true) // 列表的加载中
+const isLoading = ref(false)
+const total = ref(0) // 列表的总页数
+
+const queryForm = ref({
+  pageNo: 1,
+  pageSize: 10,
+  id: undefined,
+  projectId: undefined,
+  supervisorId: undefined,
+  externalSupervisorId:undefined,
+  supervisor:undefined,
+  userType:undefined,
+  studentName:"",
+  createTime: [],
+  projectName:"",
+  studentGrade:"",
+  selectType:undefined,
+})
+
+const passList = ref<studentSelectSupervisorRecordVO[]>([]) //下面的选择记录列表
+const getPassList = async () => {
+  loading.value = true
+  try {
+    const data = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecordPage(queryForm)
+    passList.value = data
+    // console.log("passList", passList.value);
+    passList.value = data.list
+    total.value = data.total
+  } finally {
+    loading.value = false
+  }
+}
+
+const supervisors = ref()
+const getSupervisor= async () => {
+  try {
+    const result = await UserApi.getSupervisor()
+    supervisors.value = result
+  } catch (error) {
+    console.error('未获取到导师', error)
+  }
+}
+
+const projects = ref()
+const getAllProject= async () => {
+  try {
+    projects.value = await studentSelectionProjectApi.getAllProject()
+  } catch (error) {
+    console.error('未获取到项目', error)
+  }
+}
+
+const currentYear = new Date().getFullYear(); // 获取当前年份
+const gradeOptions = computed(() => {
+  return [
+    currentYear + '级',         // 今年
+    currentYear - 1 + '级',     // 去年
+    currentYear - 2 + '级',     // 前年
+    currentYear - 3 + '级',     // 大前年
+    currentYear - 4 + '级',     // 大大前年
+  ];
+});
+
+const handleQuery = () => {
+  queryForm.value.pageNo = 1
+  getPassList()
+}
+
+const queryFormRef = ref()
+const resetQuery = () => {
+  queryFormRef.value.resetFields()
+  handleQuery()
+}
+
+
+onMounted(() => {
+  getPassList()
+  getSupervisor()
+  getAllProject()
+})
+
+</script>

+ 7 - 7
src/views/system/supervisorSelectionSetting/index.vue

@@ -146,7 +146,7 @@
           <el-button
             type="primary"
             link
-            @click="openStudentSelectSupervisorPop('create', scope.row.projectId,scope.row.supervisorId,null,null)"
+            @click="openStudentSelectSupervisorPop('create', scope.row.projectId,scope.row.supervisorId)"
             v-hasPermi="['system:student-select-supervisor-record:create']"
             v-if="userInfo?.userType === '1'"
           >
@@ -184,7 +184,7 @@
           <el-button
             link
             type="primary"
-            @click="openForm('update', scope.row.id)"
+            @click="openForm('update', scope.row.supervisorId,scope.row.userType)"
             v-hasPermi="['system:supervisor-selection-setting:update']"
             v-if="userInfo?.userType === '4'"
           >
@@ -276,7 +276,7 @@ import download from '@/utils/download'
 import { supervisorSelectionSettingApi, supervisorSelectionSettingVO } from '@/api/system/supervisorSelectionSetting'
 import supervisorSelectionSettingForm from './supervisorSelectionSettingForm.vue'
 import teacherRequireForm from '../userDetail/teacher.vue'
-import studentSelectSupervisorRecordForm from '../studentSelectSupervisorRecord/studentSelectSupervisorRecordForm.vue'
+import studentSelectSupervisorRecordForm from '../studentSelection/studentSelectSupervisorRecord/studentSelectSupervisorRecordForm.vue'
 import * as UserApi from '@/api/system/user'
 import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
 import {
@@ -336,7 +336,7 @@ const getList = async () => {
   try {
     const data = await supervisorSelectionSettingApi.getSupervisorSelectionSettingPage(queryParams)
     list.value = data.list
-    // console.log("list",list.value);
+    console.log("list",list.value);
     total.value = data.total
   } finally {
     loading.value = false
@@ -364,8 +364,8 @@ const resetQuery = () => {
 
 /** 添加/修改操作 */
 const formRef = ref()
-const openForm = (type: string, id?: number) => {
-  formRef.value.open(type, id)
+const openForm = (type: string, id?: number, userType?: string) => {
+  formRef.value.open(type, id, userType)
 }
 
 /** 删除按钮操作 */
@@ -416,10 +416,10 @@ const openTeacherRequireForm = (supervisorId?: number, userType?: string) => {
 //志愿填报弹窗
 const studentSelectSupervisorPop= ref()
 const openStudentSelectSupervisorPop =  (type: string, projectId?: number,supervisorId? :number,id:number,studentId:number) => {
+
   studentSelectSupervisorPop.value.open(type, projectId ,supervisorId,id,studentId)
 }
 
-//没处理好
 
 const recordData = ref({
   id: undefined,

+ 166 - 56
src/views/system/supervisorSelectionSetting/supervisorSelectionSettingForm.vue

@@ -1,36 +1,85 @@
+
 <template>
-  <Dialog :title="dialogTitle" v-model="dialogVisible">
+  <Dialog v-model="dialogVisible" :title="dialogTitle">
     <el-form
       ref="formRef"
+      v-loading="formLoading"
       :model="formData"
       :rules="formRules"
-      label-width="100px"
-      v-loading="formLoading"
+      label-width="120px"
+      class="custom-form"
     >
-<!--      <el-form-item label="项目id" prop="projectId">-->
-<!--        <el-input v-model="formData.projectId" placeholder="请输入项目id" />-->
-<!--      </el-form-item>-->
-<!--      <el-form-item label="导师id" prop="supervisorId">-->
-<!--        <el-input v-model="formData.supervisorId" placeholder="请输入导师id" />-->
-<!--      </el-form-item>-->
-      <el-form-item label="学硕名额" prop="academicSlots">
-        <el-input v-model="formData.academicSlots" placeholder="请输入学硕名额" />
-      </el-form-item>
-      <el-form-item label="专硕名额" prop="professionalSlots">
-        <el-input v-model="formData.professionalSlots" placeholder="请输入专硕名额" />
-      </el-form-item>
+    <el-row>
+      <el-col :span="12">
+        <el-form-item label="姓名" prop="nickname" >
+          <el-input v-model="formData.nickname" placeholder="自动链接"  />
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="职称" prop="title">
+          <el-input v-model="formData.title" placeholder="" />
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row v-if="TUsertype === '5'">
+      <el-col :span="24" >
+        <el-form-item label="外聘导师" style="font-weight: 550;">
+          <p></p>
+        </el-form-item>
+      </el-col>
+      <el-col :span="24" >
+        <el-form-item label="工作单位" prop="externalSupervisorWorkPlace">
+          <el-input v-model="formData.externalSupervisorWorkPlace" placeholder="请输入工作单位"/>
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row v-if="TUsertype ==='5'">
+      <el-col :span="24">
+        <el-form-item label="合作的校内导师" prop="workSupervisor">
+          <el-input v-model="formData.workSupervisor" placeholder="自动链接"/>
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row>
+      <el-col :span="24">
+        <el-form-item label="研究方向" prop="major">
+          <el-input v-model="formData.major" placeholder="请输入研究方向" />
+        </el-form-item>
+      </el-col>
+    </el-row>
+      <el-row >
+        <el-col :span="24">
+          <el-form-item label="导师简历上传" prop="introduction">
+            <el-input type="textarea" v-model="formData.introduction" placeholder="暂无简介" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-col :span="24">
+        <el-form-item label="对研究生毕业时学术成果的要求" prop="studentAchievementRequirement">
+          <el-input type="textarea" v-model="formData.studentAchievementRequirement" placeholder="未填写时,默认为按学校及学院发表学术成果的要求执行" />
+        </el-form-item>
+      </el-col>
     </el-form>
     <template #footer>
-      <el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
-      <el-button @click="dialogVisible = false">取 消</el-button>
+      <div style="display: flex; justify-content: center;">
+        <el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="dialogVisible = false">取 消</el-button>
+      </div>
     </template>
   </Dialog>
 </template>
-<script setup lang="ts">
-import { supervisorSelectionSettingApi, supervisorSelectionSettingVO } from '@/api/system/supervisorSelectionSetting'
 
-/** 导师学硕专硕名额设置 表单 */
-defineOptions({ name: 'SupervisorSelectionSettingForm' })
+<script lang="ts" setup>
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
+import { CommonStatusEnum } from '@/utils/constants'
+import * as UserApi from '@/api/system/user'
+import { FormRules } from 'element-plus'
+import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
+import {selectionBookVO,selectionBookApi} from '@/api/system/studentSelectSupervisorRecord/selectionBook'
+import download from '@/utils/download'
+// import { supervisorSelectionSettingApi, supervisorSelectionSettingVO } from '@/api/system/supervisorSelectionSetting'
+
+defineOptions({ name: 'TeacherRequireForm' })
 
 const { t } = useI18n() // 国际化
 const message = useMessage() // 消息弹窗
@@ -40,50 +89,67 @@ const dialogTitle = ref('') // 弹窗的标题
 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
 const formType = ref('') // 表单的类型:create - 新增;update - 修改
 const formData = ref({
-  id: undefined,
-  projectId: undefined,
-  supervisorId: undefined,
-  academicSlots: undefined,
-  professionalSlots: undefined,
+  id: null,
+  sex: null,
+  supervisorId: null,
+  nickname: '',
+  title: '',//职称
+  status: CommonStatusEnum.ENABLE,
+  userNumber: '',//工号
+  major:'',//研究方向
+  studentAchievementRequirement:"",
+  introduction:"",//简介
+  externalSupervisorWorkPlace:"",
+  workSupervisor:"",//合作校内导师
 })
-const formRules = reactive({
-  // projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
-  // supervisorId: [{ required: true, message: '导师id不能为空', trigger: 'blur' }],
+const formRules = reactive<FormRules>({
 })
 const formRef = ref() // 表单 Ref
 
-/** 打开弹窗 */
-const open = async (type: string, id?: number) => {
+
+//获取登录人员信息
+const userInfo = ref({} as ProfileVO)
+const getUserInfo = async () => {
+  const users = await getUserProfile()
+  userInfo.value = users  
+  console.log(userInfo.value);
+}
+const TUsertype = ref<string | undefined>(undefined);
+const open = async (type: string, supervisorId: number, userType?: string) => {
   dialogVisible.value = true
-  dialogTitle.value = t('action.' + type)
-  formType.value = type
-  resetForm()
-  // 修改时,设置数据
-  if (id) {
-    formLoading.value = true
-    try {
-      formData.value = await supervisorSelectionSettingApi.getSupervisorSelectionSetting(id)
-    } finally {
-      formLoading.value = false
-    }
-  }
+  formType.value=type
+  TUsertype.value = userType; 
+  if (formType.value == 'update'){
+      dialogTitle.value = '编辑'
+      resetForm()
+      // 获取导师信息
+        formLoading.value = true
+        try {
+          const user = await UserApi.getUser(supervisorId)
+          // console.log(user,'11');
+          formData.value = user
+        } catch (error) {
+          console.error('请求失败:', error); // 捕获并打印错误信息
+        } finally {
+          formLoading.value = false;
+        }
+      }
 }
-defineExpose({ open }) // 提供 open 方法,用于打开弹窗
+  defineExpose({ open }) // 提供 open 方法,用于打开弹窗
 
 /** 提交表单 */
 const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
 const submitForm = async () => {
-  // 校验表单
-  await formRef.value.validate()
   // 提交请求
   formLoading.value = true
   try {
-    const data = formData.value as unknown as supervisorSelectionSettingVO
-    if (formType.value === 'create') {
-      await supervisorSelectionSettingApi.createSupervisorSelectionSetting(data)
-      message.success(t('common.createSuccess'))
-    } else {
-      await supervisorSelectionSettingApi.updateSupervisorSelectionSetting(data)
+    const data = formData.value as unknown as selectionBookVO
+    if (Array.isArray(data.introduction) && data.introduction.length > 0) {
+      data.introduction = data.introduction[0]; // 只取数组的第一个元素
+    }
+    if (formType.value === 'update') {
+      await selectionBookApi.updateSelectionBook(data)
+      console.log(data)
       message.success(t('common.updateSuccess'))
     }
     dialogVisible.value = false
@@ -97,12 +163,56 @@ const submitForm = async () => {
 /** 重置表单 */
 const resetForm = () => {
   formData.value = {
+    supervisorId:undefined,
+    nickname: '',
     id: undefined,
-    projectId: undefined,
-    supervisorId: undefined,
-    academicSlots: undefined,
-    professionalSlots: undefined,
+    sex: undefined,
+    title: '',//职称
+    status: CommonStatusEnum.ENABLE,
+    userNumber: '',//工号
+    major:'',//研究方向
+    studentAchievementRequirement:"",
+    introduction:"",//简介
+    externalSupervisorWorkPlace:"",
   }
   formRef.value?.resetFields()
 }
+onMounted(() => {
+   getUserInfo()
+})
+
 </script>
+
+<style scoped>
+.custom-form {
+  background-color: #f0f4f8; /* 浅灰色背景 */
+  padding: 20px;
+  border-radius: 8px;
+  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 轻微阴影 */
+}
+.custom-form .custom-download-button {
+  color: #4b7bec; /* 灰蓝色字体颜色 */
+  border: 1px solid #4b7bec; /* 灰蓝色边框 */
+  background-color: transparent; /* 透明背景 */
+  padding: 10px 20px; /* 按钮内边距 */
+  border-radius: 4px; /* 圆角边框 */
+  font-size: 16px; /* 字体大小 */
+  transition: all 0.3s ease; /* 平滑过渡效果 */
+  outline: none; /* 去除点击时的轮廓 */
+}
+.custom-form .custom-download-button:hover,
+.custom-form .custom-download-button:focus {
+  color: #fff; /* 悬浮时字体颜色 */
+  background-color: #4b7bec; /* 悬浮时背景颜色 */
+  border-color: #4b7bec; /* 悬浮时边框颜色 */
+}
+.custom-form .custom-download-button:active {
+  background-color: skyblue; /* 点击时背景颜色 */
+  border-color: #3a66b1; /* 点击时边框颜色 */
+}
+.full-width-editor {
+  width: 100%;
+  border: #e5e7ec;
+  border-radius: 4px;
+}
+</style>

+ 27 - 5
src/views/system/userDetail/teacher.vue

@@ -77,13 +77,23 @@
           </el-form-item>
         </el-col>
       </el-row>
-    <el-row  >
       <el-col :span="24">
         <el-form-item label="对研究生毕业时学术成果的要求" prop="studentAchievementRequirement">
           <el-input type="textarea" v-model="formData.studentAchievementRequirement" placeholder="未填写时,默认为按学校及学院发表学术成果的要求执行" :disabled="!isSupervisor" />
         </el-form-item>
       </el-col>
-    </el-row>
+      <!-- <el-row>
+        <el-col :span="12">
+          <el-form-item label="学硕名额" prop="academicSlots">
+            <el-input v-model="formData.academicSlots" placeholder="请输入学硕名额" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="专硕名额" prop="professionalSlots">
+            <el-input v-model="formData.professionalSlots" placeholder="请输入专硕名额" />
+          </el-form-item>
+        </el-col>
+    </el-row> -->
     </el-form>
     <template #footer>
       <el-button :disabled="formLoading" type="primary" @click="submitForm" v-if="userInfo.userType==='3' || userInfo.userType==='5'">确 定</el-button>
@@ -100,6 +110,7 @@ import { FormRules } from 'element-plus'
 import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
 import {selectionBookVO,selectionBookApi} from '@/api/system/studentSelectSupervisorRecord/selectionBook'
 import download from '@/utils/download'
+// import { supervisorSelectionSettingApi, supervisorSelectionSettingVO } from '@/api/system/supervisorSelectionSetting'
 
 defineOptions({ name: 'TeacherRequireForm' })
 
@@ -123,6 +134,8 @@ const formData = ref({
   introduction:"",//简介
   externalSupervisorWorkPlace:"",
   workSupervisor:"",//合作校内导师
+  // academicSlots: '',
+  // professionalSlots: '',
 })
 const formRules = reactive<FormRules>({
 })
@@ -134,6 +147,7 @@ const userInfo = ref({} as ProfileVO)
 const getUserInfo = async () => {
   const users = await getUserProfile()
   userInfo.value = users  
+  console.log(userInfo.value);
 }
 // const isStudent = computed(() => userInfo.value.userType === "1");
 const TUsertype = ref<string | undefined>(undefined);
@@ -164,9 +178,16 @@ const open = async (type: string, supervisorId: number, userType?: string) => {
         formLoading.value = true
         try {
           const user = await UserApi.getUser(userInfo.value.id)
-          formData.value =user
+          // console.log(user,'11');
+          formData.value = user
+          // const res = await supervisorSelectionSettingApi.getSupervisorSelectionSetting(userInfo.value.supervisorId)
+          // console.log(res,'22');
+          // formData.value.academicSlots = res.academicSlots
+          // formData.value.professionalSlots = res.professionalSlots
+        } catch (error) {
+          console.error('请求失败:', error); // 捕获并打印错误信息
         } finally {
-          formLoading.value = false
+          formLoading.value = false;
         }
       }
 }
@@ -184,6 +205,7 @@ const submitForm = async () => {
     }
     if (formType.value === 'update') {
       await selectionBookApi.updateSelectionBook(data)
+      console.log(data)
       message.success(t('common.updateSuccess'))
     }
     dialogVisible.value = false
@@ -219,7 +241,7 @@ const resetForm = () => {
     major:'',//研究方向
     studentAchievementRequirement:"",
     introduction:"",//简介
-    externalSupervisorWorkPlace:""
+    externalSupervisorWorkPlace:"",
   }
   formRef.value?.resetFields()
 }

+ 14 - 1
src/views/system/workroomTeacher/TeacherSelf/TForm.vue

@@ -71,7 +71,14 @@
       <el-row>
         <el-col :span="24">
           <el-form-item label="简介" prop="remark">
-            <Editor v-model="formData.remark" ref="editorRef"/>
+            <!-- <Editor v-model="formData.remark" ref="editorRef"/> -->
+            <Editor
+              v-model="formData.remark"
+              :editorId="TeditorId"
+              :style="editorStyle"
+              @on-change="handleChange"
+              @on-created="handleCreated"
+            />
           </el-form-item>
         </el-col>
       </el-row>
@@ -104,6 +111,7 @@ const props = defineProps({
 const { t } = useI18n() // 国际化
 const message = useMessage() // 消息弹窗
 const userTypeSt = ref('1')
+const TeditorId = ref('')
 
 const dialogVisible = ref(false) // 弹窗的是否展示
 // const dialogTitle = ref('') // 弹窗的标题
@@ -222,6 +230,11 @@ const extractImages = (htmlContent: string): string[] => {
   return images;
 };
 
+const editorStyle = {
+  border : '1.5px solid #dcdfe6',
+  borderRadius: '6px',
+}
+
 /** 重置表单 */
 const resetForm = () => {
   formData.value = {