瀏覽代碼

Merge branch 'master' of http://gogs.gisvg.com/YDM/graduate-ui

蒋佳琪 1 月之前
父節點
當前提交
5fbf3eb707

File diff suppressed because it is too large
+ 255 - 336
pnpm-lock.yaml


+ 49 - 103
src/views/Home/Index.vue

@@ -1,115 +1,66 @@
-
-  <!-- <div>
-                                                                  <el-card shadow="never">
-                                                                    <el-skeleton :loading="loading" animated>
-                                                                      <el-row :gutter="16" justify="space-between">
-                                                                        <el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
-                                                                          <div class="flex items-center">
-                                                                            <el-avatar :src="avatar" :size="70" class="mr-16px">
-                                                                              <img src="@/assets/imgs/avatar.gif" alt="" />
-                                                                            </el-avatar>
-                                                                            <div>
-                                                                              <div class="text-20px">
-                                                                                {{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }}
-                                                                              </div>
-                                                                              <div class="mt-10px text-14px text-gray-500">
-                                                                                {{ t('workplace.toady') }},20℃ - 32℃!
-                                                                              </div>
-                                                                            </div>
-                                                                          </div>
-                                                                        </el-col>
-                                                                        <el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
-                                                                          <div class="h-70px flex items-center justify-end lt-sm:mt-10px">
-                                                                            <div class="px-8px text-right">
-                                                                              <div class="mb-16px text-14px text-gray-400">{{ t('workplace.project') }}</div>
-                                                                              <CountTo class="text-20px" :start-val="0" :end-val="totalSate.project" :duration="2600" />
-                                                                            </div>
-                                                                            <el-divider direction="vertical" />
-                                                                            <div class="px-8px text-right">
-                                                                              <div class="mb-16px text-14px text-gray-400">{{ t('workplace.toDo') }}</div>
-                                                                              <CountTo class="text-20px" :start-val="0" :end-val="totalSate.todo" :duration="2600" />
-                                                                            </div>
-                                                                            <el-divider direction="vertical" border-style="dashed" />
-                                                                            <div class="px-8px text-right">
-                                                                              <div class="mb-16px text-14px text-gray-400">{{ t('workplace.access') }}</div>
-                                                                              <CountTo class="text-20px" :start-val="0" :end-val="totalSate.access" :duration="2600" />
-                                                                            </div>
-                                                                          </div>
-                                                                        </el-col>
-                                                                      </el-row>
-                                                                    </el-skeleton>
-                                                                  </el-card>
-                                                                </div> -->
-  <!-- 日期
-                                                                                                  <div class="mt-16px text-12px text-gray-400">
-                                                                                                    {{ formatTime(item.date, 'yyyy-MM-dd') }}
-                                                                                                  </div> -->
-  <!-- 更多<el-link type="primary" :underline="false" href="https://github.com/yudaocode" target="_blank"> {{
-                                                    t('action.more') }}
-                                                  </el-link> -->
-
 <template>
   <el-skeleton :loading="loading" animated>
     <el-row :gutter="8">
       <!-- 第一部分 -->
-      <el-col :xs="24" :sm="24" :md="24" :lg="10" :xl="10">
-        <el-card style="height: 99%;">
+      <el-col :xs="24" :sm="24" :md="24" :lg="14" :xl="10">
+        <el-card>
           <el-card shadow="never" class="h-100%  ">
-  
+
             <template #header>
               <div class="h-7 flex justify-between fw-800 text-20px">
                 <span>基本信息</span>
               </div>
             </template>
-  
+
             <el-row style="flex-wrap: wrap; ">
               <el-col v-for="(item, index) in projects" :key="`card-${index}`" :xs="24" :sm="24" :md="24" :lg="8" :xl="8">
                 <el-card shadow="hover" class="mr-5px mt-5px " style="background-color:#2585a6 ">
-                  <div class="flex items-center h-90px ">
+                  <div class="flex items-center h-75px ">
                     <!-- <Icon :icon="item.icon" :size="25" class="mr-8px" /> -->
                     <Icon :icon="item.icon" :size="38" class="mr-8px " />
-  
+
                     <span class="text-17px c-white">{{ item.name }}</span>
                   </div>
                   <div class="mb-18px text-32px c-white ml-20px text-center">{{ t(item.message) }}</div>
                   <!-- <div class="mt-12px flex justify-between text-12px text-gray-400">
-                                                                                   
+
                                                                                     <span>{{ formatTime(item.time, 'yyyy-MM-dd') }}</span>
                                                                                   </div> -->
                 </el-card>
               </el-col>
             </el-row>
           </el-card>
-  
-          <el-card shadow="never" class=" h-100% mt-20px ">
+
+          <el-card shadow="never" class=" h-100% mt-10px ">
             <template #header>
               <div class="h-5 flex justify-between fw-800 text-20px">
-                <span>出勤统计</span>
+                <span>实时出勤统计</span>
               </div>
             </template>
             <el-card shadow="never" class="ml-2px  pr-10px  mt-10px" style="background-color:#33a3dc ;opacity: 0.8; ">
               <div class="h-70px flex items-center justify-center flex-wrap mt-10px c-white">
-                <div class="px-8px text-right">
-                  <div class="mb-10px text-20px text-white ">当日出勤情况</div>
+                <div class="px-25px text-center" style="margin: auto;">
+                  <div class="mb-16px text-18px text-white ">打卡人数</div>
+                  <CountTo class="text-28px" :start-val="0" :end-val="totalSate.normal" :duration="2600" />
                 </div>
-                <el-divider direction="vertical" style="border-left-black" />
-                <div class="px-25px text-center">
-                  <div class="mb-16px text-18px text-white ">正常人数</div>
-                  <CountTo class="text-20px" :start-val="0" :end-val="totalSate.normal" :duration="2600" />
+                <el-divider direction="vertical" border-style="dashed" />
+                <div class="px-8px text-center" style="margin: auto;">
+                  <div class="mb-16px text-18px text-white ">未打卡人数</div>
+                  <CountTo class="text-28px" :start-val="0" :end-val="totalSate.unusual" :duration="2600" />
                 </div>
                 <el-divider direction="vertical" border-style="dashed" />
-                <div class="px-8px text-center">
-                  <div class="mb-16px text-18px text-white ">异常人数</div>
-                  <CountTo class="text-20px" :start-val="0" :end-val="totalSate.unusual" :duration="2600" />
+                <div class="px-8px text-center" style="margin: auto;">
+                  <div class="mb-16px text-18px text-white ">请假人数</div>
+                  <CountTo class="text-28px" :start-val="0" :end-val="totalSate.unusual" :duration="2600" />
                 </div>
               </div>
             </el-card>
           </el-card>
-  
-          <el-card shadow="hover" class="mb-8px   mt-30px">
+
+          <el-card shadow="hover" class=" mt-10px">
             <template #header>
               <div class="h-5 flex justify-between fw-800 text-20px">
-                <span>实时人数统计</span>
+                <span>毕业条件达成统计</span>
               </div>
             </template>
             <el-skeleton :loading="loading" animated>
@@ -119,11 +70,11 @@
         </el-card>
       </el-col>
       <!-- 第二部分 -->
-      <el-col :xs="24" :sm="24" :md="24" :lg="14" :xl="10">
+      <el-col :xs="24" :sm="24" :md="24" :lg="10" :xl="7">
         <!-- 第一个el-row -->
         <el-row :gutter="15">
-          <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
-            <el-card shadow="never" class="ml-10px h-480px ">
+          <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+            <el-card shadow="never" class=" mb-10px h-480px ">
               <template #header>
                 <div class="h-5 flex justify-between fw-800 text-20px">
                   <span>周出勤情况</span>
@@ -136,9 +87,9 @@
               </el-card>
             </el-card>
           </el-col>
-  
-          <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="10">
-            <el-card shadow="never">
+
+          <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+            <el-card shadow="never" class="mb-10px ">
               <template #header>
                 <div class="h-5 flex justify-between fw-800 text-20px">
                   <span>实时打卡状态</span>
@@ -174,25 +125,26 @@
                 </vue3ScrollSeamless>
               </div>
             </el-card>
-  
+
           </el-col>
         </el-row>
-  
-        <!-- 第二个el-row -->
-        <el-row class="mt-12px" :gutter="15" align="center">
-          <el-col :xs="24" :sm="24" :md="24" :lg="13" :xl="7">
-            <el-card shadow="never" class="mt-1px h-480px ml-10px" style="border: none;"> <!-- 移除 el-card 的边框 -->
+      </el-col>
+              <!-- 第二个el-row -->
+      <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="7">
+        <el-row :gutter="15" align="center">
+          <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="24">
+            <el-card shadow="never" class=" h-480px mb-10px "> <!-- 移除 el-card 的边框 -->
               <template #header>
                 <div class="h-7 flex justify-between fw-800 text-20px">
                   <span>缺勤预警</span>
                 </div>
               </template>
-  
+
               <div class="demos">
                 <!-- <div class="table-header">
                           <div class="header">
-                            <el-row class="shouye" style="border: none;"> 
-                              <el-col :span="8" class="center text-18px" style="border: none;"> 
+                            <el-row class="shouye" style="border: none;">
+                              <el-col :span="8" class="center text-18px" style="border: none;">
                                 <div>学生学号</div>
                               </el-col>
                               <el-col :span="10" class="center text-18px" style="border: none;">
@@ -207,7 +159,7 @@
                             </el-row>
                           </div>
                         </div> -->
-  
+
                 <vue3ScrollSeamless class="scroll-wraps text-color" :classOptions="class2Options" :dataList="list2">
                   <div v-if="list2.length > 0">
                     <el-row v-for="(item, i) of list2" :key="i" class="shouye">
@@ -232,11 +184,10 @@
                 </vue3ScrollSeamless>
               </div>
             </el-card>
-  
+
           </el-col>
-  
-          <el-col :xs="24" :sm="24" :md="24" :lg="11" :xl="7">
-            <el-card shadow="never" class="mr-8px mt-1px h-480px ">
+          <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="24">
+            <el-card shadow="never" class=" mt-1px h-480px ">
               <template #header>
                 <div class="h-7 flex justify-between fw-800 text-20px">
                   <span>学生毕业条件达成率</span>
@@ -255,7 +206,7 @@
                             </el-row>
                           </div>
                         </div> -->
-  
+
                 <vue3ScrollSeamless class="scroll-wrapss  text-color" :classOptions="list1Options" :dataList="list1">
                   <div v-if="list1.length > 0">
                     <el-row v-for="(item, i) of list1" :key="i" class="shouye" :style="{ marginBottom: '10px' }">
@@ -273,20 +224,15 @@
                     暂无预测记录
                   </div>
                 </vue3ScrollSeamless>
-  
+
               </div>
-  
+
             </el-card>
           </el-col>
-  
         </el-row>
       </el-col>
     </el-row>
   </el-skeleton>
-  
-  
-  
-  
 </template>
 
 <script lang="ts" setup>
@@ -485,8 +431,8 @@ const getShortcut = async () => {
 // 用户来源
 const getUserAccessSource = async () => {
   const data = [
-    { value: 1048, name: '在线人数' },
-    { value: 735, name: '离线人数' },
+    { value: 1048, name: '达成人数' },
+    { value: 735, name: '未达成人数' },
   ];
 
   const options = {
@@ -820,7 +766,7 @@ getAllApi()
 }
 
 /* .text-color {
- color: rgb(15, 131, 233); 
+ color: rgb(15, 131, 233);
 } */
 
 

+ 5 - 5
src/views/system/studentAttendanceManage/studentAttendance/index.vue

@@ -8,7 +8,7 @@
       :inline="true"
       label-width="100px"
     >
-      <el-form-item label="姓名" prop="studentName">
+      <el-form-item label="姓名" prop="studentName" v-if="userInfo.userType !== '1'">
         <el-input
           placeholder="请输入姓名 "
           v-model="queryParams.studentName"
@@ -17,7 +17,7 @@
           class="!w-240px"
         />
       </el-form-item>
-      <el-form-item label="学号" prop="userNumber">
+      <el-form-item label="学号" prop="userNumber" v-if="userInfo.userType !== '1'">
         <el-input
           placeholder="请输入学号 "
           v-model="queryParams.userNumber"
@@ -26,7 +26,7 @@
           class="!w-240px"
         />
       </el-form-item> 
-      <el-form-item label="导师姓名" prop="supervisor" v-if="userInfo.userType !== '3'">
+      <el-form-item label="导师姓名" prop="supervisor" v-if="userInfo.userType !== '3' && userInfo.userType !== '1'">
         <el-select
               v-model="queryParams.supervisor"
               @change="handleSupervisorChange"
@@ -66,8 +66,8 @@
       </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-button @click="handleQuery" v-if="userInfo.userType !== '1'"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
+        <el-button @click="resetQuery" v-if="userInfo.userType !== '1'"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
         <!-- <el-button
           type="primary"
           plain

+ 3 - 3
src/views/system/studentAttendanceManage/studentAttendanceError/index.vue

@@ -17,7 +17,7 @@
           placeholder="请选择日期"
         />
       </el-form-item>
-        <el-form-item label="姓名" prop="studentName">
+        <el-form-item label="姓名" prop="studentName" v-if="userInfo.userType !== '1'">
           <el-input
             placeholder="请输入姓名 "
             v-model="queryParams.studentName"
@@ -26,7 +26,7 @@
             class="!w-240px"
           />
         </el-form-item>
-        <el-form-item label="学号" prop="userNumber">
+        <el-form-item label="学号" prop="userNumber" v-if="userInfo.userType !== '1'">
           <el-input
             placeholder="请输入学号 "
             v-model="queryParams.userNumber"
@@ -35,7 +35,7 @@
             class="!w-240px"
           />
         </el-form-item>
-        <el-form-item label="导师姓名" prop="supervisor" v-if="userInfo.userType !== '3'">
+        <el-form-item label="导师姓名" prop="supervisor" v-if="userInfo.userType !== '3' && userInfo.userType !== '1'">
           <el-select
               v-model="queryParams.supervisor"
               @change="handleSupervisorChange"

+ 3 - 3
src/views/system/studentAttendanceManage/studentAttendanceExcused/index.vue

@@ -17,7 +17,7 @@
             placeholder="请选择日期"
           />
         </el-form-item>
-        <el-form-item label="姓名" prop="studentName">
+        <el-form-item label="姓名" prop="studentName" v-if="userInfo.userType !== '1'">
           <el-input
             placeholder="请输入姓名 "
             v-model="queryParams.studentName"
@@ -26,7 +26,7 @@
             class="!w-240px"
           />
         </el-form-item>
-        <el-form-item label="学号" prop="userNumber">
+        <el-form-item label="学号" prop="userNumber" v-if="userInfo.userType !== '1'">
           <el-input
             placeholder="请输入学号 "
             v-model="queryParams.userNumber"
@@ -35,7 +35,7 @@
             class="!w-240px"
           />
         </el-form-item>
-        <el-form-item label="导师姓名" prop="supervisor" v-if="userInfo.userType !== '3'">
+        <el-form-item label="导师姓名" prop="supervisor" v-if="userInfo.userType !== '3' && userInfo.userType !== '1'">
           <el-select
               v-model="queryParams.supervisor"
               @change="handleSupervisorChange"

+ 214 - 0
src/views/system/workroomTeacher/TeacherSelf/TForm.vue

@@ -0,0 +1,214 @@
+<template>
+  <Dialog v-model="dialogVisible" :title="dialogTitle">
+    <el-form
+      ref="formRef"
+      v-loading="formLoading"
+      :model="formData"
+      :rules="formRules"
+      label-width="85px"
+    >
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="姓名" prop="nickname">
+            <el-input  disabled v-model="formData.nickname" placeholder="请输入姓名" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="工作间" prop="dept">
+            <el-input disabled v-model="formData.dept"/>
+            <!-- <el-tree-select
+              v-model="formData.deptId"
+              :data="deptList"
+              :props="defaultProps"
+              check-strictly
+              node-key="id"
+              placeholder="请选择归属工作间"
+            /> -->
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="手机号码" prop="mobile">
+            <el-input v-model="formData.mobile" maxlength="11" placeholder="请输入手机号码" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="邮箱" prop="email">
+            <el-input v-model="formData.email" maxlength="50" placeholder="请输入邮箱" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="用户类型" prop="userType">
+            <el-select v-model="formData.userType" placeholder="请选择用户类型">
+             <el-option
+                v-for="option in userTypes"
+                :key="option.value"
+                :label="option.label"
+                :value="option.value"
+                />
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="工号" prop="userNumber">
+            <el-input disabled v-model="formData.userNumber" placeholder="请输入工号" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-row>
+        <el-col :span="24">
+          <el-form-item label="简介" prop="remark">
+            <Editor v-model="formData.remark" ref="editorRef"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <template #footer>
+      <el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
+      <el-button @click="dialogVisible = false">取 消</el-button>
+    </template>
+  </Dialog>
+</template>
+<script lang="ts" setup>
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
+import { CommonStatusEnum } from '@/utils/constants'
+import { defaultProps, handleTree } from '@/utils/tree'
+import * as DeptApi from '@/api/system/dept'
+import * as PostApi from '@/api/system/post'
+import { FormRules } from 'element-plus'
+import {
+  getUserProfile,
+  updateUserProfile,
+  UserProfileUpdateReqVO
+} from '@/api/system/user/profile'
+
+defineOptions({ name: 'SystemUserForm' })
+
+const props = defineProps({
+  form: Object,
+});
+
+const { t } = useI18n() // 国际化
+const message = useMessage() // 消息弹窗
+const userTypeSt = ref('1')
+
+const dialogVisible = ref(false) // 弹窗的是否展示
+const dialogTitle = ref('') // 弹窗的标题
+const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
+const formData = ref({
+  mobile: '',
+  email: '',
+  nickname: '',
+  password: '',
+  sex: undefined,
+  // remark: '',
+  userType: undefined,
+  userNumber: '',
+  dept: undefined,
+  deptId: undefined,
+})
+const formRules = reactive<FormRules>({
+  username: [{ required: true, message: '账号不能为空', trigger: 'blur' }],
+  nickname: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
+  email: [
+    { required: true, message: '邮箱不能为空', trigger: 'blur' }, // 确保这是必填
+    {
+      type: 'email',
+      message: '请输入正确的邮箱地址',
+      trigger: ['blur', 'change']
+    }
+  ],
+  mobile: [
+    { required: true, message: '手机号码不能为空', trigger: 'blur' },
+    {
+      pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
+      message: '请输入正确的手机号码',
+      trigger: 'blur'
+    }
+  ],
+  userNumber: [{ required: true, message: '学号不能为空', trigger: 'blur' }],
+  userType: [{ required: true, message: '用户类型不能为空', trigger: 'blur' }],
+})
+
+const formRef = ref() // 表单 Ref
+const deptList = ref<Tree[]>([]) // 树形结构
+const postList = ref([] as PostApi.PostVO[]) // 岗位列表
+
+//用户类型
+const userTypes = [
+  { value: '3', label: '导师' },
+]
+
+/** 打开弹窗 */
+const open = async (id?: number) => {
+  dialogVisible.value = true
+  resetForm()
+  // 修改时,设置数据
+  if (id) {
+    formLoading.value = true
+    try {
+      const data = await getUserProfile()
+      console.log(data,'打开弹窗数据');
+      formData.value = {
+        ...data,
+        deptId: data.dept.id, 
+        dept: data.dept.name
+      }
+    } 
+    catch (error) {
+      console.error('获取用户资料失败:', error); // 添加错误日志
+    }finally {
+      formLoading.value = false
+    }
+  }
+  formData.value = {
+      ...props.form,
+      deptId: props.form.dept ? props.form.dept.id : undefined,
+      dept: props.form.dept ? props.form.dept.name : ''
+    }; 
+}
+defineExpose({ open }) // 提供 open 方法,用于打开弹窗
+
+/** 提交表单 */
+const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
+const submitForm = async () => {
+  // 校验表单
+  console.log(formData.value,'提交的表单');
+  if (!formRef) return
+  const valid = await formRef.value.validate()
+  if (!valid) return
+  // 提交请求
+  formLoading.value = true
+  try {
+    const data = formData.value as unknown as UserProfileUpdateReqVO
+      await updateUserProfile(data)
+    dialogVisible.value = false
+    // 发送操作成功的事件
+    emit('success')
+  } finally {
+    formLoading.value = false
+  }
+}
+
+/** 重置表单 */
+const resetForm = () => {
+  formData.value = {
+    mobile: '',
+    email: '',
+    nickname: '',
+    password: '',
+    sex: undefined,
+    // remark: '',
+    userType: undefined,
+    userNumber: '',
+    dept: undefined,
+    deptId: undefined,
+    }
+    formRef.value?.resetFields()
+}
+
+</script>

+ 288 - 0
src/views/system/workroomTeacher/TeacherSelf/index.vue

@@ -0,0 +1,288 @@
+<template>
+  <div class="flex">
+    <el-card class="workspace-info w-full" shadow="always" style="padding-bottom: 40px;">
+        <template #header>
+          <div class="card-header" style="display: flex; align-items: center; justify-content: space-between;">
+            <span style="flex-grow: 1; text-align: center;font-weight: bold;">个人信息</span>
+            <div class="pull-right">
+              <el-button type="primary" @click="openDialog">修改</el-button>
+            </div>
+          </div>
+        </template>
+        <ul class="user-info">
+          <div class="info-row">
+            <li class="info-item">
+              <Icon class="mr-5px" icon="ep:user" />
+              <span class="info-label">姓名:</span>
+              <span class="pull-right">{{ userInfo.nickname }}</span>
+            </li>
+            <li class="info-item">
+              <Icon class="mr-5px" icon="ep:phone" />
+              <span class="info-label">工作间:</span>
+              <span class="pull-right">{{ userInfo.dept ? userInfo.dept.name : '未知部门' }}</span>
+            </li>
+          </div>
+
+          <div class="info-row">
+            <li class="info-item">
+              <Icon class="mr-5px" icon="fontisto:email" />
+              <span class="info-label">手机号码:</span>
+              <span class="pull-right">{{ userInfo.mobile }}</span>
+            </li>
+            <li class="info-item">
+              <Icon class="mr-5px" icon="ep:location" />
+              <span class="info-label">邮箱:</span>
+              <span class="pull-right">{{ userInfo.email }}</span>
+            </li>
+          </div>
+
+          <div class="info-row">
+            <li class="info-item">
+              <Icon class="mr-5px" icon="ep:user" />
+              <span class="info-label">用户类型:</span>
+              <span class="pull-right"> {{ userTypeMapping[userInfo.userType] || '未知用户类型' }}</span>
+            </li>
+            <li class="info-item">
+              <Icon class="mr-5px" icon="ep:location" />
+              <span class="info-label">工号:</span>
+              <span class="pull-right">{{ userInfo.userNumber }}</span>
+            </li>
+          </div>
+
+        </ul>
+        <!-- <div class="info-description">
+          <Icon class="mr-5px" icon="ep:location" /> -->
+          <!-- <div class="div-label" style="margin-left: 20px;">简介:</div>
+          <div class="description-content">{{ cleanedDescription }}</div>
+          <div class="image-container">
+            <div v-for="(url, index) in extractedImageUrls" :key="index" class="image-item">
+              <img :src="url" />
+            </div>
+          </div>
+        </div> -->
+        
+      </el-card>
+      <TForm
+        ref="formRef"
+        :visible="dialogVisible"
+        :form="userInfo"
+        @update:visible="dialogVisible = $event"
+        @success="handleSuccess"
+      />
+  </div>
+ 
+</template>
+
+<script lang="ts">
+import { defineComponent, reactive, ref, onMounted } from 'vue';
+import { useI18n } from 'vue-i18n';
+import { useMessage } from '@/hooks/web/useMessage';
+import TForm from './TForm.vue';
+import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
+
+
+export default defineComponent({
+  components: {
+    TForm,
+  },
+  setup() {
+    const { t } = useI18n();
+    const message = useMessage();
+    const dialogVisible = ref(false);
+    const formRef = ref();
+
+    // 将 userInfo 定义放入 setup 中
+    const userInfo = ref({} as ProfileVO)
+    const getUserInfo = async () => {
+  try {
+    const users = await getUserProfile();
+    console.log(users, 'users');
+    userInfo.value = users;
+  } catch (error) {
+    console.error('获取用户信息失败:', error);
+  }
+}
+
+const userTypeMapping = {
+  '3': '导师',
+};
+
+const openDialog = () => {
+  dialogVisible.value = true;
+  formRef.value.open(); // 打开弹窗
+};
+
+const extractedImageUrls = ref<string[]>([]);
+const handleSuccess = (urls) => {
+  extractedImageUrls.value = urls;
+  console.log('提取到的图片URL:', extractedImageUrls);
+  dialogVisible.value = false;
+};
+const fetchImageUrls = async () => {
+  // 你的获取图片 URL 的 API 调用
+  const res = await getUserProfile();
+  const urls = res.description.match(/<img.*?src="(.*?)"/g); // 使用更合理的正则表达式
+    // 如果找到的 URL 数组不为空,则进行处理
+    if (urls) {
+      // 从匹配的字符串中提取出 URL
+      extractedImageUrls.value = urls.map(url => {
+        // 取出匹配到的 src 属性部分
+        const match = url.match(/src="(.*?)"/);
+        return match ? match[1] : '';
+      });
+    } else {
+      extractedImageUrls.value = []; // 没有找到图片则设为空数组
+    }  // 将获取到的 URL 赋值
+};
+
+// 创建一个 computed 属性来处理并去掉 <p> 标签
+//   const cleanedDescription = computed(() => {
+//   return userInfo.value.description ? userInfo.value.description.replace(/<\/?[^>]+(>|$)/g, '') : '';
+// });
+
+
+    // 表单提交
+    // const submit = async () => {
+    //   try {
+    //     await formRef.value?.validate();
+    //     console.log('提交的数据:', form);
+    //     await updateDept(form).then((res) => {
+    //       console.log('更新成功:', res);
+    //     });
+    //     message.success('成功');
+    //   } catch (error) {
+    //     console.error('提交错误:', error);
+    //     message.error('错误');
+    //   }
+    // };
+
+
+    // 表单重置
+    // const init = async () => {
+    //   const res = await getUserProfile();
+    //   console.log('获取的数据:', res);
+    //   form.id = res.id;
+    //   form.address = res.address;
+    //   form.supervisor = res.user.nickname;
+    //   form.phone = res.phone;
+    //   form.email = res.email;
+    //   form.name = res.name;
+    //   form.leaderUserId = res.user.id;
+    //   form.description = res.description;
+    //   userInfo.value = res.user; 
+    // };
+
+    onMounted(async () => {
+      // await init();
+      await getUserInfo();
+      await fetchImageUrls(); // 这里 add 一個方法来加载图片
+    });
+
+    return {
+      t,
+      // form,
+      userInfo,   
+      // init,
+      getUserInfo,
+      fetchImageUrls,
+      formRef,
+      dialogVisible,
+      openDialog,
+      handleSuccess,
+      extractedImageUrls,
+      // cleanedDescription
+      userTypeMapping,
+    };
+  }
+});
+
+
+</script>
+
+<style scoped>
+.user-info {
+  margin-top: 10px;
+  margin-left: 5%;
+  margin-right: 5%;
+  padding-right: 0;
+  padding-left: 0;
+  border-right: 0;
+  border-left: 0;
+  border-radius: 0;
+  list-style: none;
+}
+
+.info-row {
+  display: flex;
+  justify-content: space-between; /* 保持并排显示 */
+  align-items: center; /* 垂直居中对齐 */
+  margin-bottom: 20px; /* 增加行之间的间距 */
+}
+
+.info-item {
+  flex: 1; /* 每个信息项占据相同的空间 */
+  padding: 11px 0; /* 内部上下填充 */
+  margin-right: 50px; /* 每个信息项之间的右边距 */
+}
+
+/* 仅为每个信息项添加底部边框 */
+.info-item:first-child {
+  border-bottom: 1px solid #e7eaec;
+}
+
+.info-item:last-child {
+  border-bottom: 1px solid #e7eaec; 
+}
+
+.info-description {
+  margin-top: 30px; /* 与上面的信息分隔 */
+  margin-left: 5%; /* 左侧与上面列表保持一致 */
+  margin-right: 5%; /* 右侧与上面列表保持一致 */
+  /* display: flex;  */
+  align-items: center; /* 确保标题与描述对齐 */
+  align-items: flex-start;
+}
+
+.info-label {
+  font-weight: bold; /* 加粗标题 */
+  margin-right: 10px; /* 标题与内容之间的间距 */
+}
+
+.div-label {
+  font-weight: bold; /* 加粗标题 */
+  display: block;
+  
+}
+
+.description-content {
+  white-space: pre-wrap; /* 保持换行 */
+  overflow-wrap: break-word; /* 自动断行 */
+  margin-right: 5%;
+  font-size: 13px; /* 根据需要设置字体大小 */
+  margin-top: 20px; /* 内容与标题之间不需要额外间距 */
+  letter-spacing: 3px;
+  text-indent: 2em; 
+  line-height: 2;
+}
+
+.pull-right {
+  float: right !important;
+}
+
+.info-label {
+  font-weight: bold;
+}
+
+.image-container {
+  display: flex; /* 使图片横向排列 */
+  flex-wrap: wrap; /* 如果空间不足则换行 */
+  gap: 10px; /* 图片之间的间距 */
+  margin-left: 20px; /* 左边距,根据需要设置 */
+}
+
+.image-item img {
+  width: 150px; /* 设置更大的宽度 */
+  height: auto; /* 保持高度自动 */
+}
+
+</style>

+ 15 - 37
src/views/system/workroomTeacher/dept/index.vue

@@ -7,10 +7,10 @@
     </div>
   </el-card> -->
   <div class="flex">
-    <el-card class="workspace-info w-full" style="padding-bottom: 40px;">
+    <el-card class="workspace-info w-full" shadow="always" style="padding-bottom: 40px;">
         <template #header>
           <div class="card-header" style="display: flex; align-items: center; justify-content: space-between;">
-            <span style="flex-grow: 1; text-align: center;">工作间信息</span>
+            <span style="flex-grow: 1; text-align: center;font-weight: bold;">工作间信息</span>
             <div class="pull-right">
               <el-button type="primary" @click="openDialog">修改</el-button>
             </div>
@@ -85,24 +85,14 @@
         @success="handleSuccess"
       />
   </div>
-  <div class="flex flex-col">
-       <el-card class="teacher-info w-full" style="margin-top: 15px; margin-bottom: 15px;">
-        <template #header>
-          <div class="card-header1">
-            <span>导师信息</span>
-          </div>
-        </template>
-        <teacher :id="form.id" />
-      </el-card>
-      <el-card class="student-info w-full mb-3">
-        <template #header>
-          <div class="card-header1">
-            <span>学生信息</span>
-          </div>
-        </template>
-        <student :id="form.id" />
-      </el-card>
+  <div>
+    <div style="margin-top: 15px;">
+      <teacher :id="form.id" />
+    </div>
+    <div>
+      <student :id="form.id" />
     </div>
+  </div>
  
 </template>
 
@@ -310,29 +300,17 @@ const fetchImageUrls = async () => {
 
 <style scoped>
 
-.label-bold {
-  font-weight: bold; /* 设置字体加粗 */
-}
+/* .label-bold {
+  font-weight: bold;
+} */
 
-.workspace-name {
+/* .workspace-name {
   height: 20px;
-}
-
-/* .card-header {
-  display: flex;
-  justify-content: center;
-  align-items: center;
 } */
 
-.card-header1 {
-  display: flex;
-  justify-content: center;
-  align-items: center;
-}
 
 .user-info {
   margin-top: 10px;
-  
   margin-left: 5%;
   margin-right: 5%;
   padding-right: 0;
@@ -404,9 +382,9 @@ const fetchImageUrls = async () => {
   font-weight: bold;
 }
 
-.personal-info {
+/* .personal-info {
   margin-top: 20px;
-}
+} */
 
 /* .button-container {
   display: flex;

+ 138 - 0
src/views/system/workroomTeacher/dept/student.vue

@@ -0,0 +1,138 @@
+<template>
+      <ContentWrap shadow="always">
+        <div style="text-align: center; margin-bottom: 20px; font-weight: bold;">学生信息</div>
+        <hr style="border: 1px solid #e7eaec; margin: 0;"/>
+        <div class="table-container">
+          <el-table v-loading="loading" :data="list">
+          <el-table-column type="index" width="50" />
+          <!-- <el-table-column label="用户编号" align="center" key="id" prop="id" />
+          <el-table-column
+            label="账号"
+            align="center"
+            prop="username"
+            :show-overflow-tooltip="true"
+          /> -->
+          <el-table-column
+            label="姓名"
+            align="center"
+            prop="nickname"
+            :show-overflow-tooltip="true"
+          />
+          <el-table-column
+            label="工作间"
+            align="center"
+            key="deptName"
+            prop="deptName"
+            :show-overflow-tooltip="true"
+          />
+          <el-table-column label="手机号码" align="center" prop="mobile" width="120" />
+          <el-table-column label="是否达成毕业条件" align="center" prop="isGraduate">
+            <template #default="scope">
+              <dict-tag :type="DICT_TYPE.SYSTEM_STUDENT_GRADUATE_STATUS" :value="scope.row.isGraduate" />  
+            </template>
+          </el-table-column>
+          <el-table-column label="人脸详情" align="center" prop="photoUrl">
+            <template #default="scope">
+              <el-image
+                lazy
+                class="h-80px w-80px"
+                style="width: 40px; height:40px;margin-right: 5px"
+                :src="scope.row.photoUrl"
+                :preview-src-list="[scope.row.photoUrl]"
+                preview-teleported
+                :zoom-rate="1.2"
+                :max-scale="7"
+                :min-scale="0.2"
+                :initial-index="4"
+                fit="cover"
+              />
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="创建时间"
+            align="center"
+            prop="createTime"
+            :formatter="dateFormatter"
+            width="180"
+          />
+          <el-table-column label="操作" align="center" width="190">
+            <template #default="scope">
+              <div class="flex items-center justify-center">
+                <el-button type="text" @click="openUserAchievement(scope.row.id)">
+                  成果详情
+                </el-button>
+              </div>
+            </template>
+          </el-table-column>
+        
+        </el-table>
+        </div>
+      
+        <Pagination
+          :total="total"
+          v-model:page="queryParams.pageNo"
+          v-model:limit="queryParams.pageSize"
+          @pagination="getList"
+        />
+      </ContentWrap>
+
+</template>
+<script lang="ts" setup>
+import { DICT_TYPE } from '@/utils/dict'
+import { dateFormatter } from '@/utils/formatTime'
+import * as UserApi from '@/api/system/user'
+import { defineProps } from 'vue';
+import { useRouter } from 'vue-router';
+
+defineOptions({ name: 'SystemUser' })
+
+const props = defineProps<{
+  id: string; // 根据需要修改类型
+}>();
+
+const loading = ref(true) // 列表的加载中
+const total = ref(0) // 列表的总页数
+const list = ref([]) // 列表的数
+const queryParams = reactive({
+  pageNo: 1,
+  pageSize: 10,
+  username: undefined,
+  mobile: undefined,
+  status: undefined,
+  deptId: props.id,
+  createTime: [],
+})
+
+const router = useRouter()
+const openUserAchievement = (id) => {
+  router.push({ name: 'UserAchievement', query: { id: id} });
+}
+
+/** 查询列表 */
+const getList = async () => {
+  loading.value = true
+  try {
+    queryParams.deptId = props.id
+    const data = await UserApi.getStudentPage(queryParams)
+    list.value = data.list
+    total.value = data.total
+  } finally {
+    loading.value = false
+  }
+}
+/** 初始化 */
+onMounted(() => {
+  getList()
+})
+</script>
+
+<style scoped>
+.table-container .el-table {
+  border: none !important; /* 移除表格的外边框 */
+}
+
+.table-container .el-table th, 
+.table-container .el-table td {
+  border: none !important; /* 移除表头和单元格的边框 */
+}
+</style>

+ 88 - 0
src/views/system/workroomTeacher/dept/teacher.vue

@@ -0,0 +1,88 @@
+<template>
+      <ContentWrap shadow="always">
+        <div style="text-align: center; margin-bottom: 20px; font-weight: bold;">教师信息</div>
+        <hr style="border: 1px solid #e7eaec; margin: 0;"/>
+        <el-table v-loading="loading" :data="list">
+          <el-table-column type="index"/>
+          <!-- <el-table-column label="用户编号" align="center" key="id" prop="id" />
+          <el-table-column
+            label="账号"
+            align="center"
+            prop="username"
+            :show-overflow-tooltip="true"
+          /> -->
+          <el-table-column
+            label="姓名"
+            align="center"
+            prop="nickname"
+            :show-overflow-tooltip="true"
+          />
+          <el-table-column
+            label="工作间"
+            align="center"
+            key="deptName"
+            prop="deptName"
+            :show-overflow-tooltip="true"
+          />
+          <el-table-column label="手机号码" align="center" prop="mobile"/>
+          <el-table-column
+            label="创建时间"
+            align="center"
+            prop="createTime"
+            :formatter="dateFormatter"
+            width="180"
+          />
+        <Pagination
+          :total="total"
+          v-model:page="queryParams.pageNo"
+          v-model:limit="queryParams.pageSize"
+          @pagination="getList"
+        />
+      </el-table>
+    </ContentWrap>
+</template>
+<script lang="ts" setup>
+import { dateFormatter } from '@/utils/formatTime'
+import * as UserApi from '@/api/system/user'
+
+defineOptions({ name: 'SystemUser' })
+
+const props = defineProps<{
+  id: string; // 根据需要修改类型
+}>();
+
+const loading = ref(true) // 列表的加载中
+const total = ref(0) // 列表的总页数
+const list = ref([]) // 列表的数
+const queryParams = reactive({
+  pageNo: 1,
+  pageSize: 10,
+  username: undefined,
+  mobile: undefined,
+  status: undefined,
+  deptId: props.id,
+  createTime: []
+})
+
+const showIsGraduate = ref(false);
+
+/** 查询列表 */
+const getList = async () => {
+  loading.value = true
+  try {
+    queryParams.deptId = props.id
+    const data = await UserApi.getTeacherPage(queryParams)
+    console.log(data, 'data');
+    list.value = data.list
+    total.value = data.total
+    showIsGraduate.value = data.list.some(user => user.hasOwnProperty('isGraduate'));
+  } finally {
+    loading.value = false
+  }
+}
+
+/** 初始化 */
+onMounted(() => {
+  getList()
+})
+</script>

Some files were not shown because too many files changed in this diff