47 7 months ago
parent
commit
1b7bccf7c6

+ 2 - 2
src/api/system/studentAttendance/index.ts

@@ -46,8 +46,8 @@ export const StudentAttendanceApi = {
   },
 
   // 查询学生个人考勤信息
-  getStudentAttendanceSelfPage: async (id: number) => {
-    return await request.get({ url: `/system/student-attendance /selfPage`, id })
+  getStudentAttendanceSelfPage: async (params) => {
+    return await request.get({ url: `/system/student-attendance/selfPage`, params })
   },
   
 

+ 2 - 0
src/utils/dict.ts

@@ -129,6 +129,8 @@ export enum DICT_TYPE {
   SYSTEM_MAIL_SEND_STATUS = 'system_mail_send_status',
   SYSTEM_NOTIFY_TEMPLATE_TYPE = 'system_notify_template_type',
   SYSTEM_SOCIAL_TYPE = 'system_social_type',
+  SYSTEM_STUDENT_ATTENDANCE_TYPE = 'system_student_attendance_type',// 学生考勤类型
+  SYSTEM_STUDENT_FACE_TYPE = 'system_student_face_type',// 学生人脸导入类型
 
   // ========== INFRA 模块 ==========
   INFRA_BOOLEAN_STRING = 'infra_boolean_string',

+ 11 - 7
src/views/system/studentAttendanceManage/studentAttendance/index.vue

@@ -83,25 +83,28 @@
         :formatter="dateFormatter"
         width="180px"
       />
-      <el-table-column label="打卡状态 " align="center" prop="clockInStatus" >
+      <el-table-column label="打卡类型" align="center" prop="clockInStatus">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.SYSTEM_STUDENT_ATTENDANCE_TYPE" :value="scope.row.clockInStatus" />  
+        </template>
+      </el-table-column>
+      <!-- <el-table-column label="打卡状态 " align="center" prop="clockInStatus" >
         <template #default="rowData">
           <span :class="getStatusClass(rowData.row.clockInStatus)">
             {{
               rowData.row.clockInStatus == 0
                ? '正常'
                 : rowData.row.clockInStatus ==1
-               ? '迟到'
+               ? '未打卡'
                 : rowData.row.clockInStatus == 2
-               ? '早退'
+               ? '警告'
                 : rowData.row.clockInStatus == 3
-               ? '缺勤'
-                : rowData.row.clockInStatus == 4
-               ? '请假'
+               ? '恢复正常'
                 : '未知类型'
             }}
           </span>
         </template>
-      </el-table-column>
+      </el-table-column> -->
       <!-- <el-table-column
         label="创建时间"
         align="center"
@@ -149,6 +152,7 @@ import { dateFormatter } from '@/utils/formatTime'
 import download from '@/utils/download'
 import { StudentAttendanceApi, StudentAttendanceVO } from '@/api/system/studentAttendance'
 import StudentAttendanceForm from './StudentAttendanceForm.vue'
+import { DICT_TYPE } from '@/utils/dict'
 
 /** 学生考勤记录 列表 */
 defineOptions({ name: 'StudentAttendance' })

+ 8 - 2
src/views/system/studentAttendanceManage/studentAttendanceError/index.vue

@@ -81,7 +81,12 @@
         :formatter="dateFormatter"
         width="180px"
       />
-      <el-table-column label="打卡状态 " align="center" prop="clockInStatus" >
+      <el-table-column label="打卡类型" align="center" prop="clockInStatus">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.SYSTEM_STUDENT_ATTENDANCE_TYPE" :value="scope.row.clockInStatus" />  
+        </template>
+      </el-table-column>
+      <!-- <el-table-column label="打卡状态 " align="center" prop="clockInStatus" >
         <template #default="rowData">
           <span :class="getStatusClass(rowData.row.clockInStatus)">
             {{
@@ -99,7 +104,7 @@
             }}
           </span>
         </template>
-      </el-table-column>
+      </el-table-column> -->
      
       <el-table-column label="备注原因" align="center" prop="remark" />
       <el-table-column label="操作" align="center" min-width="120px">
@@ -141,6 +146,7 @@ import { dateFormatter } from '@/utils/formatTime'
 import download from '@/utils/download'
 import { StudentAttendanceApi, StudentAttendanceVO } from '@/api/system/studentAttendance'
 import StudentAttendanceForm from './StudentAttendanceForm.vue'
+import { DICT_TYPE } from '@/utils/dict'
 
 /** 学生考勤记录 列表 */
 defineOptions({ name: 'StudentAttendance' })

+ 69 - 36
src/views/system/studentAttendanceManage/studentFaceManage/StudentFaceImport.vue

@@ -11,6 +11,7 @@
       :on-success="submitFormSuccess"
       accept=".xlsx, .xls"
       drag
+      name	= "excelFile"
     >
       <Icon icon="ep:upload" />
       <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
@@ -36,7 +37,7 @@
       ref="uploadZipRef"
       v-model:file-list="zipList"
       drag
-      :action="importZipUrl + '?updateSupport=' + updateSupport"
+      :action="importUrl + '?updateSupport=' + updateSupport"
       :on-success="submitZipSuccess"
       :auto-upload="false"
       :disabled="formLoading"
@@ -44,16 +45,17 @@
       :on-error="submitFormError"
       :http-request="httpRequest"
       accept=".zip,.rar"
+      name	= "imageFile"
     >
       <Icon icon="ep:upload" />
       <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
       <template #tip>
         <div class="el-upload__tip text-center">
           <span>仅允许导入 zip、rar 格式压缩包。</span>
-          <div class="el-upload__tip">
+          <!-- <div class="el-upload__tip">
             <el-checkbox v-model="updateSupport" />
             是否更新已经存在的用户数据
-          </div>
+          </div> -->
         </div>
       </template>
     </el-upload>
@@ -64,13 +66,13 @@
   </Dialog>
 </template>
 <script lang="ts" setup>
-// import * as faceApi from '@/api/system/face'
 import * as UserApi from '@/api/system/user'
 import { getAccessToken, getTenantId } from '@/utils/auth'
 import download from '@/utils/download'
 import {useUpload} from "@/components/UploadFile/src/useUpload";
-defineOptions({ name: 'StudentFaceImport' })
+defineOptions({ name: 'SystemUserImportForm' })
 
+import axios from 'axios';
 const message = useMessage() // 消息弹窗
 const {  httpRequest } = useUpload()
 const dialogVisible = ref(false) // 弹窗的是否展示
@@ -79,12 +81,9 @@ const uploadRef = ref()
 const uploadZipRef = ref()
 const importUrl =
   import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/md/acs/import-data'
-const importZipUrl =
-  import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/md/acs/import-data'
 const uploadHeaders = ref() // 上传 Header 头
 const fileList = ref([]) // 文件列表
 const updateSupport = ref(0) // 是否更新已经存在的用户数据
-
 const zipList = ref([]) // 压缩文件列表
 
 
@@ -104,54 +103,88 @@ const submitForm = async () => {
   //   message.error('请上传文件')
   //   return
   // }
-
   // if (zipList.value.length === 0) {
   //   message.error('请上传压缩包')
   //   return
   // }
-  if (fileList.value.length == 0 && zipList.value.length === 0) {
-    message.error('请上传文件或压缩包')
-    return
+  // if (fileList.value.length == 0 && zipList.value.length === 0) {
+  //   message.error('请上传文件或压缩包')
+  //   return
+  // }
+  const formData = new FormData();
+
+  if (fileList.value.length > 0) {
+    formData.append('excelFile', fileList.value[0].raw); // 确保是 .raw
   }
 
-  // 提交请求
-  uploadHeaders.value = {
-    Authorization: 'Bearer ' + getAccessToken(),
-    'tenant-id': getTenantId()
+  if (zipList.value.length > 0) {
+    formData.append('imageFile', zipList.value[0].raw); // 确保是 .raw
   }
-  formLoading.value = true
-  uploadRef.value!.submit()
-  uploadZipRef.value!.submit()
+
+  formData.append('updateSupport',updateSupport.value.toString());
+
+  let response = await axios.post(importUrl, formData, {
+    headers: {
+      'Content-Type': 'multipart/form-data',
+      Authorization: 'Bearer ' + getAccessToken(),
+      'tenant-id': getTenantId()
+    }
+  });
+  console.log(response,'response');
+  submitFormSuccess(response)
+  // // 提交请求
+  // uploadHeaders.value = {
+  //   Authorization: 'Bearer ' + getAccessToken(),
+  //   'tenant-id': getTenantId()
+  // }
+  // formLoading.value = true
+  // uploadRef.value!.submit()
+  // uploadZipRef.value!.submit()
 }
-console.log(fileList,'fileList');
+
 
 
 /** 文件上传成功 */
 const emits = defineEmits(['success'])
 const submitFormSuccess = (response: any) => {
   if (response.data.code !== 0) {
-    console.log(response.data.code,'code');
-    
+    console.log(response.data.code,'code');   
     message.error(response.msg)
     formLoading.value = false
     return
   }
   // 拼接提示语
   const data = response.data.data;
-  console.log(data,'123');
-  let text = data.msg;
-  // let text = '上传成功数量:' + data.createUsernames.length + ';'
-  // for (let username of data.createUsernames) {
-  //   text += '< ' + username + ' >'
-  // }
-  // text += '更新成功数量:' + data.updateUsernames.length + ';'
-  // for (const username of data.updateUsernames) {
-  //   text += '< ' + username + ' >'
-  // }
-  // text += '更新失败数量:' + Object.keys(data.failureUsernames).length + ';'
-  // for (const username in data.failureUsernames) {
-  //   text += '< ' + username + ': ' + data.failureUsernames[username] + ' >'
-  // }
+  console.log(data,'data');
+  // let text = data;
+  let text = '图片上传成功数量:' + data.imageImportResult.createImages.length + ';'
+  for (let username of data.imageImportResult.createImages) {
+    text += '< ' + username + ' >'
+  }
+  text += '图片错误数量:' + data.imageImportResult.errorImages.length + ';'
+  for (const username of data.imageImportResult.errorImages) {
+    text += '< ' + username + ' >'
+  }
+  text += '图片上传失败数量:' + data.imageImportResult.failureImages.length + ';'
+  for (const username of data.imageImportResult.failureImages) {
+    text += '< ' + username + ' >'
+  }
+  text += '找不到用户数量:' + data.imageImportResult.nullUsers.length + ';'
+  for (const username of data.imageImportResult.nullUsers) {
+    text += '< ' + username + ' >'
+  }
+  text += '文件上传成功数量:' + data.userImportResult.createUsernames.length + ';'
+  for (let username of data.userImportResult.createUsernames) {
+    text += '< ' + username + ' >'
+  }
+  text += '文件更新数量:' + data.userImportResult.updateUsernames.length + ';'
+  for (const username of data.userImportResult.updateUsernames) {
+    text += '< ' + username + ' >'
+  }
+  text += '文件上传失败数量:' + Object.keys(data.userImportResult.failureUsernames).length + ';'
+  for (const username in data.userImportResult.failureUsernames) {
+    text += '< ' + username + ': ' + data.userImportResult.failureUsernames[username] + ' >'
+  }
   message.alert(text)
   formLoading.value = false
   dialogVisible.value = false

+ 18 - 15
src/views/system/studentAttendanceManage/studentFaceManage/index.vue

@@ -27,9 +27,9 @@
             />
       </el-form-item>
 
-      <el-form-item label="导入状态" prop="importStatus">
+      <el-form-item label="导入状态" prop="status">
         <el-select
-          v-model="queryParams.importStatus"
+          v-model="queryParams.status"
           placeholder="请选择导入状态"
           clearable
           class="!w-240px"
@@ -63,7 +63,7 @@
           type="primary"
           plain
           @click="handleImportzip"
-          v-hasPermi="['system:student-attendance:query']"
+          v-hasPermi="['md:acs:users-info-with-image:import']"
         >
           <Icon icon="ep:upload" class="mr-5px" /> 批量导入
         </el-button>
@@ -75,7 +75,7 @@
   <ContentWrap>
     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
       <el-table-column label="Id" align="center" prop="id" />
-      <el-table-column label="学生名称" align="center" prop="nickName" />
+      <el-table-column label="学生名称" align="center" prop="nickname" />
       <el-table-column
         label="导入时间"
         align="center"
@@ -83,22 +83,24 @@
         :formatter="dateFormatter"
         width="180px"
       />
-      
-      <el-table-column label="导入状态" align="center" prop="importStatus" width="180px">
+      <el-table-column label="导入状态" align="center" prop="status">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.SYSTEM_STUDENT_FACE_TYPE" :value="scope.row.status" />  
+        </template>
+      </el-table-column>
+      <!-- <el-table-column label="导入状态" align="center" prop="status" width="180px">
         <template #default="rowData">
-          <!-- <span v-if="rowData.row.importStatus === 0">未导入</span>
-          <span v-else>已导入</span> -->
-          <span :class="getStatusClass(rowData.row.importStatus)">
+          <span :class="getStatusClass(rowData.row.status)">
             {{
-              rowData.row.importStatus === 0
+              rowData.row.status === 0
                ? '未导入'
-               :rowData.row.importStatus === 1
+               :rowData.row.status === 1
                ? '已导入'
                 : '未知类型'
             }}
           </span>
         </template>
-      </el-table-column> 
+      </el-table-column>  -->
       <el-table-column label="备注原因" align="center" prop="remark" />
       <el-table-column label="详情" align="center" prop="photoUrl">
         <template #default="scope">
@@ -123,7 +125,7 @@
             link
             type="primary"
             @click="openForm('update', scope.row.id)"
-            v-hasPermi="['system:teacher-user-image:update']"
+            v-hasPermi="['md:acs:teacher-user-image:update']"
           >
             编辑
           </el-button>
@@ -163,6 +165,7 @@ import StudentFaceForm from './StudentFaceForm.vue'
 import StudentFaceImport from './StudentFaceImport.vue'
 import { useI18n } from 'vue-i18n'
 import { ref, reactive, onMounted } from 'vue'
+import { DICT_TYPE } from '@/utils/dict'
 
 
 /** 学生考勤记录 列表 */
@@ -178,9 +181,9 @@ const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
   id: undefined,
-  nickName: undefined,
+  nickname: undefined,
   createTime: [],
-  importStatus: undefined,
+  status: undefined,
   remark: undefined,
 })
 const queryFormRef = ref() // 搜索的表单

+ 11 - 9
src/views/system/studentSelfAttendance/index.vue

@@ -83,7 +83,12 @@
         :formatter="dateFormatter"
         width="180px"
       />
-      <el-table-column label="打卡状态 " align="center" prop="clockInStatus" >
+      <el-table-column label="打卡类型" align="center" prop="clockInStatus">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.SYSTEM_STUDENT_ATTENDANCE_TYPE" :value="scope.row.clockInStatus" />  
+        </template>
+      </el-table-column>
+      <!-- <el-table-column label="打卡状态 " align="center" prop="clockInStatus" >
         <template #default="rowData">
           <span :class="getStatusClass(rowData.row.clockInStatus)">
             {{
@@ -101,7 +106,7 @@
             }}
           </span>
         </template>
-      </el-table-column>
+      </el-table-column> -->
       <!-- <el-table-column
         label="创建时间"
         align="center"
@@ -140,18 +145,16 @@
     />
   </ContentWrap>
 
-  <!-- 表单弹窗:添加/修改 -->
-  <StudentAttendanceForm ref="formRef" @success="getList" />
 </template>
 
 <script setup lang="ts">
 import { dateFormatter } from '@/utils/formatTime'
 import download from '@/utils/download'
-import { StudentAttendanceApi, StudentAttendanceVO } from '@/api/system/studentAttendance'
-import StudentAttendanceForm from './StudentAttendanceForm.vue'
+import { StudentAttendanceApi, StudentAttendanceVO,  } from '@/api/system/studentAttendance'
+import { DICT_TYPE } from '@/utils/dict'
 
 /** 学生考勤记录 列表 */
-defineOptions({ name: 'StudentAttendance' })
+defineOptions({ name: 'StudentSelfAttendance' })
 
 const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
@@ -167,7 +170,6 @@ const queryParams = reactive({
   deptId: undefined,
   date: [],
   clockInTime: [],
-  clockInTimeRange: [],
   clockInStatus: undefined,
   createTime: [],
   remark: undefined,
@@ -179,7 +181,7 @@ const exportLoading = ref(false) // 导出的加载中
 const getList = async () => {
   loading.value = true
   try {
-    const data = await StudentAttendanceApi.getStudentAttendancePage(queryParams)
+    const data = await StudentAttendanceApi.getStudentAttendanceSelfPage(queryParams)
     list.value = data.list
     total.value = data.total
   } finally {

+ 28 - 1
src/views/system/workroomCollege/dept/index.vue

@@ -17,6 +17,22 @@
           class="!w-240px"
         />
       </el-form-item>
+      <el-form-item label="负责人" prop="leaderUserId">
+        <el-select
+          v-model="queryParams.leaderUserId"
+          @change="handleQuery"
+          placeholder="请选择负责人"
+          clearable
+          class="!w-240px"
+        >
+          <el-option
+            v-for="user in userList"
+            :key="user.id"
+            :label="user.nickname"
+            :value="user.id"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="状态" prop="status">
         <el-select
           v-model="queryParams.status"
@@ -52,13 +68,18 @@
       :default-expand-all="isExpandAll"
       v-if="refreshTable"
     >
+    <el-table-column label="序号" align="center">
+        <template #default="scope">
+          {{ (queryParams.pageNo - 1) * queryParams.pageSize + scope.$index + 1 }}
+        </template>
+      </el-table-column>
       <el-table-column prop="name" label="工作间名称" />
       <el-table-column prop="leader" label="负责人">
         <template #default="scope">
           {{ userList.find((user) => user.id === scope.row.leaderUserId)?.nickname }}
         </template>
       </el-table-column>
-      <el-table-column prop="sort" label="排序" />
+      <!-- <el-table-column prop="sort" label="排序" /> -->
       <el-table-column prop="status" label="状态">
         <template #default="scope">
           <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
@@ -109,6 +130,7 @@ const queryParams = reactive({
   pageNo: 1,
   pageSize: 100,
   name: undefined,
+  leaderUserId: undefined,
   status: undefined
 })
 const queryFormRef = ref() // 搜索的表单
@@ -121,6 +143,7 @@ const getList = async () => {
   loading.value = true
   try {
     const data = await DeptApi.getDeptPage(queryParams)
+    console.log(data,'111');
     list.value = handleTree(data)
   } finally {
     loading.value = false
@@ -138,7 +161,9 @@ const toggleExpandAll = () => {
 
 /** 搜索按钮操作 */
 const handleQuery = () => {
+  console.log("当前查询参数:", queryParams);
   getList()
+  
 }
 
 /** 重置按钮操作 */
@@ -160,5 +185,7 @@ onMounted(async () => {
   await getList()
   // 获取用户列表
   userList.value = await UserApi.getSimpleUserList()
+  console.log(userList.value,'000');
+  
 })
 </script>

+ 16 - 16
src/views/system/workroomCollege/user/UserImportFormzip.vue

@@ -52,10 +52,10 @@
       <template #tip>
         <div class="el-upload__tip text-center">
           <span>仅允许导入 zip、rar 格式压缩包。</span>
-          <div class="el-upload__tip">
+          <!-- <div class="el-upload__tip">
             <el-checkbox v-model="updateSupport" />
-            是否更新已经存在的用户数据
-          </div>
+           是否更新已经存在的用户数据 
+          </div> -->
         </div>
       </template>
     </el-upload>
@@ -156,19 +156,19 @@ const submitFormSuccess = (response: any) => {
   // 拼接提示语
   const data = response.data.data;
   console.log(data,'data');
-  let text = data;
-  // let text = '上传成功数量:' + data.createUsernames.length + ';'
-  // for (let username of data.createUsernames) {
-  //   text += '< ' + username + ' >'
-  // }
-  // text += '更新成功数量:' + data.updateUsernames.length + ';'
-  // for (const username of data.updateUsernames) {
-  //   text += '< ' + username + ' >'
-  // }
-  // text += '更新失败数量:' + Object.keys(data.failureUsernames).length + ';'
-  // for (const username in data.failureUsernames) {
-  //   text += '< ' + username + ': ' + data.failureUsernames[username] + ' >'
-  // }
+  // let text = data;
+  let text = '图片上传成功数量:' + data.imageImportResult.createImages.length + ';'
+  for (let username of data.userImportResult.createUsernames) {
+    text += '< ' + username + ' >'
+  }
+  text += '图片错误数量:' + data.imageImportResult.errorImages.length + ';'
+  for (const username of data.userImportResult.updateUsernames) {
+    text += '< ' + username + ' >'
+  }
+  text += '图片上传失败数量:' + data.imageImportResult.failureImages.length + ';'
+  for (const username in data.userImportResult.failureUsernames) {
+    text += '< ' + username + ': ' + data.userImportResult.failureUsernames + ' >'
+  }
   message.alert(text)
   formLoading.value = false
   dialogVisible.value = false

+ 3 - 0
src/views/system/workroomTeacher/userAchievement/index.vue

@@ -183,6 +183,8 @@ const users = ref()
 const getDeptUser = async () => {
   try {
     const response = await UserApi.getDeptUser()
+    console.log(response,'567');
+    
     users.value = response
   } catch (error) {
     console.error('Error fetching user data:', error)
@@ -193,6 +195,7 @@ const getList = async () => {
   loading.value = true
   try {
     const data = await UserAchievementApi.getUserAchievementPage(queryParams)
+    console.log(data,'890');
     list.value = data.list
     total.value = data.total
   } finally {