47 4 months ago
parent
commit
7a64552712

+ 15 - 0
src/router/modules/remaining.ts

@@ -90,6 +90,21 @@ const remainingRouter: AppRouteRecordRaw[] = [
         }
         }
       },
       },
 
 
+      {
+        path: 'studentSelection/studentSelectSupervisorRecord/index',
+        component: studentSelectSupervisorRecord,
+        name: 'studentSelectSupervisorRecord',
+        meta: {
+          title: '师生互选记录',
+          icon: 'ep:user-filled',
+          noCache: false,
+          affix: false,
+          breadcrumb: false,
+          noTagsView: false,
+          hidden: true
+        }
+      },
+
 
 
       {
       {
         path: 'supervisorSelectionSetting/index',
         path: 'supervisorSelectionSetting/index',

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

@@ -364,6 +364,7 @@ const open = async (type: string, projectId?: number, supervisorId?:number, id?:
     if (id) {
     if (id) {
       formLoading.value = true
       formLoading.value = true
       try {
       try {
+        formData.value.id = id
         formData.value = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecord(id)
         formData.value = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecord(id)
         formData.value.selectType = selectType
         formData.value.selectType = selectType
         console.log(formData.value,'formData.value');
         console.log(formData.value,'formData.value');
@@ -417,6 +418,7 @@ const open = async (type: string, projectId?: number, supervisorId?:number, id?:
     submitFormText.value = '编辑'
     submitFormText.value = '编辑'
     formType.value = type
     formType.value = type
     resetForm()
     resetForm()
+    console.log(id);
     if (studentId) {
     if (studentId) {
       formLoading.value = true
       formLoading.value = true
       try {
       try {
@@ -434,9 +436,8 @@ const open = async (type: string, projectId?: number, supervisorId?:number, id?:
     if(id) {
     if(id) {
       formLoading.value = true
       formLoading.value = true
       try {
       try {
-        formData.value = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecord(id)
         formData.value.id = id
         formData.value.id = id
-        // formData.value.selectType = selectType
+        formData.value = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecord(id)
         console.log(formData.value,'formData.value');
         console.log(formData.value,'formData.value');
       } finally {
       } finally {
         formLoading.value = false
         formLoading.value = false
@@ -466,7 +467,6 @@ const open = async (type: string, projectId?: number, supervisorId?:number, id?:
     if(id) {
     if(id) {
       formLoading.value = true
       formLoading.value = true
       try {
       try {
-        // formData.value.selectType = selectType
         formData.value = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecord(id)
         formData.value = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecord(id)
         console.log(formData.value,'formData.value');
         console.log(formData.value,'formData.value');
       } finally {
       } finally {

+ 23 - 3
src/views/system/studentSelection/studentSelectionNo/index.vue

@@ -91,9 +91,15 @@
           <dict-tag :type="DICT_TYPE.SYSTEM_STUDENT_SELECT_RECORD_SELECT_STATUS" :value="scope.row.selectStatus" />
           <dict-tag :type="DICT_TYPE.SYSTEM_STUDENT_SELECT_RECORD_SELECT_STATUS" :value="scope.row.selectStatus" />
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column label="照片" align="center" prop="photoUrl">
+      <el-table-column label="学生简历" align="center" prop="introduction">
         <template #default="scope">
         <template #default="scope">
-          <img :src="scope.row.photoUrl" class="w-100px h-100px" />
+          <el-button
+            v-if="scope.row.introduction"
+            type="text"
+            @click="handleDownload(scope.row)"
+          >
+            预览简历
+          </el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <el-table-column label="操作" align="center">
       <el-table-column label="操作" align="center">
@@ -219,11 +225,25 @@ const resetQuery = () => {
   handleQuery()
   handleQuery()
 }
 }
 
 
-const formRef = ref(); // 确保初始化为 null
+const formRef = ref();
 const openForm = (type: string, projectId?: number, supervisorId?:number, id?:number, studentId?:number, selectType?:number) => {
 const openForm = (type: string, projectId?: number, supervisorId?:number, id?:number, studentId?:number, selectType?:number) => {
   formRef.value.open(type, projectId, supervisorId, id, studentId, selectType)
   formRef.value.open(type, projectId, supervisorId, id, studentId, selectType)
 }
 }
 
 
+const handleDownload = (row) => {
+  const url = row.introduction;
+    if (url) {
+      const link = document.createElement('a');
+      link.href = url;
+      link.download = '学生简历';
+      link.target = '_blank';
+      document.body.appendChild(link);
+      link.click();
+      document.body.removeChild(link);
+    } else {
+      console.error('下载地址无效');
+    }
+};
 
 
 onMounted(() => {
 onMounted(() => {
   getUnPassList()
   getUnPassList()

+ 27 - 4
src/views/system/studentSelection/studentSelectionYes/index.vue

@@ -95,9 +95,15 @@
           <dict-tag :type="DICT_TYPE.SYSTEM_STUDENT_SELECT_RECORD_SELECT_STATUS" :value="scope.row.selectStatus" />
           <dict-tag :type="DICT_TYPE.SYSTEM_STUDENT_SELECT_RECORD_SELECT_STATUS" :value="scope.row.selectStatus" />
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column label="照片" align="center" prop="photoUrl">
+      <el-table-column label="学生简历" align="center" prop="introduction">
         <template #default="scope">
         <template #default="scope">
-          <img :src="scope.row.photoUrl" class="w-100px h-100px" />
+          <el-button
+            v-if="scope.row.introduction"
+            type="text"
+            @click="handleDownload(scope.row)"
+          >
+            预览简历
+          </el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <el-table-column label="操作" align="center">
       <el-table-column label="操作" align="center">
@@ -212,10 +218,27 @@ const resetQuery = () => {
 }
 }
 
 
 const formRef = ref(); // 确保初始化为 null
 const formRef = ref(); // 确保初始化为 null
-const openForm = (type: string, projectId?: number, supervisorId?:number, recordId?:number, studentId?:number, selectType?:number) => {
-  formRef.value.open(type, projectId, supervisorId, recordId, studentId, selectType)
+const openForm = (type: string, projectId?: number, supervisorId?:number, id?:number, studentId?:number, selectType?:number) => {
+  formRef.value.open(type, projectId, supervisorId, id, studentId, selectType)
 }
 }
 
 
+const handleDownload = (row) => {
+  // window.open(url, '_blank');
+  const url = row.introduction;
+    if (url) {
+      // 创建一个 a 标签并模拟点击,实现下载
+      const link = document.createElement('a');
+      link.href = url;
+      link.download = '学生简历'; // 提示浏览器下载文件
+      link.target = '_blank'; // 在新标签页打开链接
+      document.body.appendChild(link);
+      link.click();
+      document.body.removeChild(link);
+    } else {
+      console.error('下载地址无效');
+    }
+};
+
 onMounted(() => {
 onMounted(() => {
   getPassList()
   getPassList()
   getSupervisor()
   getSupervisor()

+ 30 - 9
src/views/system/workroomTeacher/dept/index.vue

@@ -1,12 +1,5 @@
 <template>
 <template>
-  <!-- <el-card class="workspace-info card-border mb-2">
-    <div class="workspace-name">
-      <div class="card-header">
-        <span>{{ form.name }}</span>
-      </div>
-    </div>
-  </el-card> -->
-  <div class="flex" v-loading="loading">
+  <div class="flex" v-loading="loading"   v-show="user.value.dept">
     <el-card class="workspace-info w-full" shadow="always" style="padding-bottom: 40px;">
     <el-card class="workspace-info w-full" shadow="always" style="padding-bottom: 40px;">
         <template #header>
         <template #header>
           <div class="card-header" style="display: flex; align-items: center; justify-content: space-between;">
           <div class="card-header" style="display: flex; align-items: center; justify-content: space-between;">
@@ -88,7 +81,7 @@
         @success="handleSuccess"
         @success="handleSuccess"
       />
       />
   </div>
   </div>
-  <div>
+  <div v-show="user.value.dept">
     <div style="margin-top: 15px;">
     <div style="margin-top: 15px;">
       <teacher :id="form.id" />
       <teacher :id="form.id" />
     </div>
     </div>
@@ -96,6 +89,9 @@
       <student :id="form.id" />
       <student :id="form.id" />
     </div>
     </div>
   </div>
   </div>
+  <div v-show="!user.value.dept">
+    <el-empty description="暂无工作间" />
+  </div>
  
  
 </template>
 </template>
 
 
@@ -107,6 +103,7 @@ import { useI18n } from 'vue-i18n';
 import { useMessage } from '@/hooks/web/useMessage';
 import { useMessage } from '@/hooks/web/useMessage';
 import { updateDept, DeptVO, getUserDept } from '@/api/system/dept/index';
 import { updateDept, DeptVO, getUserDept } from '@/api/system/dept/index';
 import * as UserApi from '@/api/system/user'
 import * as UserApi from '@/api/system/user'
+import { getUserProfile, ProfileVO } from '@/api/system/user/profile';
 import DeptForm from './DeptForm.vue';
 import DeptForm from './DeptForm.vue';
 import student from './student.vue';
 import student from './student.vue';
 import teacher from './teacher.vue';
 import teacher from './teacher.vue';
@@ -118,6 +115,20 @@ export default defineComponent({
     teacher,
     teacher,
   },
   },
   setup() {
   setup() {
+    const user = ref({ dept: null });
+    // 获取登陆人员的信息
+    const getUser = async () => {
+      try {
+        loading.value = true;
+        const res = await getUserProfile();
+        user.value = res;
+        console.log('获取用户信息成功:', user.value);
+      } catch (error) {
+        console.error('获取用户信息失败:', error);
+      } finally {
+        loading.value = false;
+      }
+    };
     const { t } = useI18n();
     const { t } = useI18n();
     const message = useMessage();
     const message = useMessage();
     const loading = ref(true) // 列表的加载中
     const loading = ref(true) // 列表的加载中
@@ -284,6 +295,7 @@ const fetchImageUrls = async () => {
     };
     };
 
 
     onMounted(async () => {
     onMounted(async () => {
+      await getUser();
       await init();
       await init();
       await fetchUserInfo();
       await fetchUserInfo();
       // getSupervisor();
       // getSupervisor();
@@ -311,6 +323,15 @@ const fetchImageUrls = async () => {
       extractedImageUrls,
       extractedImageUrls,
       
       
     };
     };
+  },
+  data(){
+    return {
+      user: {
+        value: {
+          dept: null // 或任何你想要初始化的值
+        }
+      },
+    };
   }
   }
 });
 });