liuxinyang před 1 rokem
rodič
revize
003e78beec

+ 1 - 1
.vscode/settings.json

@@ -43,7 +43,7 @@
   "terminal.integrated.fontWeight": 500,
   "terminal.integrated.tabs.enabled": true,
   "workbench.iconTheme": "material-icon-theme",
-  "workbench.colorTheme": "Default Light Modern",
+  "workbench.colorTheme": "Default Dark+",
   "[html]": {
     "editor.defaultFormatter": "esbenp.prettier-vscode"
   },

+ 17 - 3
mock/api/crud/modules/demo.ts

@@ -1,13 +1,27 @@
+
 import type { MethodType, MockMethod } from 'vite-plugin-mock';
 import type { BaseMockOptions } from '../base';
 import mockBase from '../base';
 import MockOption = Service.MockOption;
 
 const options: BaseMockOptions = {
-  name: 'crud/demo',
+ name: 'crud/demo',
   idGenerator: 0,
   list: [
-
+    {
+      select: '1',
+      text: '文本测试',
+      copyable: '文本可复制',
+      avatar: 'http://greper.handsfree.work/extends/avatar.jpg',
+      richtext: '富文本',
+      datetime: '2023-01-30 11:11:11'
+    },
+    {
+      select: '2'
+    },
+    {
+      select: '0'
+    }
   ]
 };
 const mockedApis = mockBase.buildMock(options);
@@ -17,7 +31,7 @@ const apis: MockMethod[] = [
     url: `/mock/${options.name}/dict`,
     method: 'get',
     response: () => {
-      return {
+     return {
         code: 200,
         message: '',
         data: [

+ 6 - 2
src/constants/business.ts

@@ -34,12 +34,16 @@ export const userStatusLabels: Record<UserManagement.UserStatusKey, string> = {
   1: '启用',
   2: '禁用',
   3: '冻结',
-  4: '软删除'
+  4: '软删除',
+	N: 'N',
+	Y: 'Y'
 };
 
 export const userStatusOptions: Common.OptionWithKey<UserManagement.UserStatusKey>[] = [
   { value: '1', label: userStatusLabels['1'] },
   { value: '2', label: userStatusLabels['2'] },
   { value: '3', label: userStatusLabels['3'] },
-  { value: '4', label: userStatusLabels['4'] }
+  { value: '4', label: userStatusLabels['4'] },
+  { value: 'N', label: userStatusLabels['2'] },
+  { value: 'Y', label: userStatusLabels['1'] }
 ];

+ 13 - 2
src/router/modules/management.ts

@@ -55,7 +55,7 @@ const management: AuthRoute.Route = {
 				title: "课程管理",
 				i18nTitle: "课程管理",
 				requiresAuth: true,
-				icon: "zondicons:align-left",
+				icon: "majesticons:book-open",
 			},
 		},
 		{
@@ -80,7 +80,18 @@ const management: AuthRoute.Route = {
 					component: 'self',
 					meta: {
             title: '班级签到信息',
-            i18nTitle: '班级详细信息',
+            i18nTitle: '班级信息',
+            requiresAuth: true,
+            icon: 'cryptocurrency-color:block'
+          }
+				},
+				{
+					name: 'management_attendance_firstThree',
+					path: '/management/attentance/firstThree',
+					component: 'self',
+					meta: {
+            title: '班级信息',
+            i18nTitle: '学生信息',
             requiresAuth: true,
             icon: 'cryptocurrency-color:block'
           }

+ 1 - 0
src/service/api/crouse.ts

@@ -1,6 +1,7 @@
 import { request } from '../request';
 // 参数接口 根据相关条件进行查询课程
 export interface SelectByConditionParams {
+[x: string]: any;
   id?: number | null;
   name?: string| null;
   description?: string| null;

+ 191 - 0
src/service/api/student.ts

@@ -0,0 +1,191 @@
+import { request } from '../request';
+// 参数接口
+export interface Query_5Params {
+  id?: number | null | any;
+  checkinDate?: string | null | any;
+  scheduleId?: number | null | any;
+  month?: number | null | any;
+  morning?: string | null | any;
+  afternoon?: string | null | any;
+  studentName?: string | null | any;
+  studentNumber?: string | null | any;
+  createUid?: number | null | any;
+  createTime?: string | null | any;
+  modifyTime?: string	 | null | any;
+}
+
+// 响应接口
+export interface Query_5Res {
+  status: boolean;
+  msg: string;
+  data: Record<string, unknown>;
+  total: number;
+}
+
+/**
+ * 查询签到记录
+ * @param {string} pageNum
+  * @param {string} pageSize
+  * @param {object} params EasArcTlsAttendance
+ * @param {number} params.id
+ * @param {object} params.checkinDate 签到日期
+ * @param {number} params.scheduleId 排课ID
+ * @param {number} params.month 月份
+ * @param {string} params.morning a  表示正常出勤,   b  表示迟到、早退, c  表示旷课, d  表示请假, e表示无效
+ * @param {string} params.afternoon a  表示正常出勤,   b  表示迟到、早退, c  表示旷课, d  表示请假, e表示无效
+ * @param {string} params.studentName 学员姓名
+ * @param {string} params.studentNumber 学生档案号
+ * @param {number} params.createUid 创建用户
+ * @param {object} params.createTime 创建时间
+ * @param {object} params.modifyTime 修改时间
+ * @returns
+ */
+export function query_5(pageNum: number, pageSize: number, params: Query_5Params) {
+  return request.post(`/attendance/query?pageNum=${pageNum}&pageSize=${pageSize}`, params);
+}
+
+// 参数接口
+export interface Add_5Params {
+  id?: number;
+  checkinDate?: Record<string, unknown>;
+  scheduleId?: number;
+  month?: number;
+  morning?: string;
+  afternoon?: string;
+  studentName?: string;
+  studentNumber?: string;
+  createUid?: number;
+  createTime?: Record<string, unknown>;
+  modifyTime?: Record<string, unknown>;
+}
+
+// 响应接口
+export interface Add_5Res {
+  status: boolean;
+  msg: string;
+  data: Record<string, unknown>;
+  code: number;
+}
+
+/**
+ * 添加签到记录
+ * @param {object} params EasArcTlsAttendance
+ * @param {number} params.id
+ * @param {object} params.checkinDate 签到日期
+ * @param {number} params.scheduleId 排课ID
+ * @param {number} params.month 月份
+ * @param {string} params.morning a  表示正常出勤,   b  表示迟到、早退, c  表示旷课, d  表示请假, e表示无效
+ * @param {string} params.afternoon a  表示正常出勤,   b  表示迟到、早退, c  表示旷课, d  表示请假, e表示无效
+ * @param {string} params.studentName 学员姓名
+ * @param {string} params.studentNumber 学生档案号
+ * @param {number} params.createUid 创建用户
+ * @param {object} params.createTime 创建时间
+ * @param {object} params.modifyTime 修改时间
+ * @returns
+ */
+export function add_5(params: Add_5Params) {
+  return request.post(`/attendance/add`, params);
+}
+
+// 参数接口
+export interface Update_5Params {
+  id?: number;
+  checkinDate?: Record<string, unknown>;
+  scheduleId?: number;
+  month?: number;
+  morning?: string;
+  afternoon?: string;
+  studentName?: string;
+  studentNumber?: string;
+  createUid?: number;
+  createTime?: Record<string, unknown>;
+  modifyTime?: Record<string, unknown>;
+}
+
+// 响应接口
+export interface Update_5Res {
+  status: boolean;
+  msg: string;
+  data: Record<string, unknown>;
+  code: number;
+}
+
+/**
+ * 更新签到记录
+ * @param {object} params EasArcTlsAttendance
+ * @param {number} params.id
+ * @param {object} params.checkinDate 签到日期
+ * @param {number} params.scheduleId 排课ID
+ * @param {number} params.month 月份
+ * @param {string} params.morning a  表示正常出勤,   b  表示迟到、早退, c  表示旷课, d  表示请假, e表示无效
+ * @param {string} params.afternoon a  表示正常出勤,   b  表示迟到、早退, c  表示旷课, d  表示请假, e表示无效
+ * @param {string} params.studentName 学员姓名
+ * @param {string} params.studentNumber 学生档案号
+ * @param {number} params.createUid 创建用户
+ * @param {object} params.createTime 创建时间
+ * @param {object} params.modifyTime 修改时间
+ * @returns
+ */
+export function update_5(params: Update_5Params) {
+  return request.put(`/attendance/update`, params);
+}
+
+// 响应接口
+export interface GetStudentListRes {
+  status: boolean;
+  msg: string;
+  data: Record<string, unknown>;
+  code: number;
+}
+
+/**
+ * 获取学生列表
+ * @param {string} scheduleId
+  * @returns
+ */
+export function getStudentList(scheduleId: number) {
+  return request.get(`/attendance/getStudentList?scheduleId=${scheduleId}`);
+}
+
+// 参数接口
+export interface Delete_5Params {
+  id?: number;
+  checkinDate?: string;
+  scheduleId?: number;
+  month?: number;
+  morning?: string;
+  afternoon?: string;
+  studentName?: string;
+  studentNumber?: string;
+  createUid?: number;
+  createTime?: Record<string, unknown>;
+  modifyTime?: Record<string, unknown>;
+}
+
+// 响应接口
+export interface Delete_5Res {
+  status: boolean;
+  msg: string;
+  data: Record<string, unknown>;
+  code: number;
+}
+
+/**
+ * 删除签到记录
+ * @param {object} params EasArcTlsAttendance
+ * @param {number} params.id
+ * @param {object} params.checkinDate 签到日期
+ * @param {number} params.scheduleId 排课ID
+ * @param {number} params.month 月份
+ * @param {string} params.morning a  表示正常出勤,   b  表示迟到、早退, c  表示旷课, d  表示请假, e表示无效
+ * @param {string} params.afternoon a  表示正常出勤,   b  表示迟到、早退, c  表示旷课, d  表示请假, e表示无效
+ * @param {string} params.studentName 学员姓名
+ * @param {string} params.studentNumber 学生档案号
+ * @param {number} params.createUid 创建用户
+ * @param {object} params.createTime 创建时间
+ * @param {object} params.modifyTime 修改时间
+ * @returns
+ */
+export function delete_5(params: Delete_5Params) {
+  return request.post(`/attendance/delete`, params);
+}

+ 9 - 8
src/service/request/instance.ts

@@ -33,7 +33,8 @@ export default class CustomAxiosInstance {
       codeKey: 'status',
       dataKey: 'data',
       msgKey: 'msg',
-      successCode: true
+      successCode: true,
+			total:'total'
     }
   ) {
     this.backendConfig = backendConfig;
@@ -49,7 +50,7 @@ export default class CustomAxiosInstance {
         if (handleConfig.headers) {
           // 数据转换
           const contentType = handleConfig.headers['Content-Type'] as UnionKey.ContentType;
-          handleConfig.data = await transformRequestData(handleConfig.data, contentType);
+          handleConfig.data = await transformRequestData(handleConfig.data, contentType,);
           // 设置token
           //handleConfig.headers.Authorization = localStg.get('token') || '';
         }
@@ -57,7 +58,7 @@ export default class CustomAxiosInstance {
       },
       (axiosError: AxiosError) => {
         const error = handleAxiosError(axiosError);
-        return handleServiceResult(error, null);
+        return handleServiceResult(error, null,null);
       }
     );
     this.instance.interceptors.response.use(
@@ -65,10 +66,10 @@ export default class CustomAxiosInstance {
         const { status } = response;
         if (status === 200 || status < 300 || status === 304 ) {
           const backend = response.data;
-          const { codeKey, dataKey, successCode } = this.backendConfig;
+          const { codeKey, dataKey, successCode,total } = this.backendConfig;
           // 请求成功
           if (backend[codeKey] === successCode || backend.code === 200  ) {
-            return handleServiceResult(null, backend[dataKey]);
+            return handleServiceResult(null, backend[dataKey],backend[total]);
           }
 
           // token失效, 刷新token
@@ -80,14 +81,14 @@ export default class CustomAxiosInstance {
           }
 
           const error = handleBackendError(backend, this.backendConfig);
-          return handleServiceResult(error, null);
+          return handleServiceResult(error, null,null);
         }
         const error = handleResponseError(response);
-        return handleServiceResult(error, null);
+        return handleServiceResult(error, null,null);
       }) as (response: AxiosResponse<any, any>) => Promise<AxiosResponse<any, any>>,
       (axiosError: AxiosError) => {
         const error = handleAxiosError(axiosError);
-        return handleServiceResult(error, null);
+        return handleServiceResult(error, null,null);
       }
     );
   }

+ 1 - 1
src/typings/api.d.ts

@@ -47,6 +47,6 @@ declare namespace ApiUserManagement {
      * - 3: 冻结
      * - 4: 软删除
      */
-    userStatus: '1' | '2' | '3' | '4' | null;
+    userStatus:  '1' | '2' | '3' | '4' | 'N' | 'Y' | null | any;
   }
 }

+ 8 - 1
src/typings/api1.d.ts

@@ -33,6 +33,13 @@ declare namespace ApiUserManagement1 {
 		createUid: number;
 		disabled: string;
 		inputValue: string;
+		checkinDate?: string;
+		scheduleId?: number;
+		month?: number;
+		morning?: string;
+		afternoon?: string;
+		studentName?: string;
+		studentNumber?: string;
 		/**
 		 * 用户性别
 		 * - 0: 女
@@ -46,6 +53,6 @@ declare namespace ApiUserManagement1 {
 		 * - 3: 冻结
 		 * - 4: 软删除
 		 */
-		userStatus: "1" | "2" | "3" | "4" | null;
+		userStatus: "1" | "2" | "3" | "4" | "N" | "Y" | null;
 	}
 }

+ 2 - 0
src/typings/page-route.d.ts

@@ -56,6 +56,7 @@ declare namespace PageRoute {
     | 'management'
     | 'management_attendance'
     | 'management_attendance_first'
+    | 'management_attendance_firstThree'
     | 'management_attendance_firstTwo'
     | 'management_auth'
     | 'management_crouse'
@@ -117,6 +118,7 @@ declare namespace PageRoute {
     | 'function_tab-multi-detail'
     | 'function_tab'
     | 'management_attendance_first'
+    | 'management_attendance_firstThree'
     | 'management_attendance_firstTwo'
     | 'management_auth'
     | 'management_crouse'

+ 4 - 1
src/typings/system.d.ts

@@ -28,6 +28,7 @@ declare namespace Service {
     msgKey: string;
     /** 后端业务上定义的成功请求的状态 */
     successCode: boolean;
+		total:string
   }
 
   /** 自定义的请求成功结果 */
@@ -36,6 +37,7 @@ declare namespace Service {
     error: null;
     /** 请求数据 */
     data: T;
+		total:T;
   }
 
   /** 自定义的请求失败结果 */
@@ -44,7 +46,8 @@ declare namespace Service {
     error: RequestError;
     /** 请求数据 */
     data: null;
-  }
+		total:null;
+	 }
 
   /** 自定义的请求结果 */
   type RequestResult<T = any> = SuccessResult<T> | FailedResult;

+ 10 - 5
src/utils/service/handler.ts

@@ -1,15 +1,17 @@
 /** 统一失败和成功的请求结果的数据类型 */
-export async function handleServiceResult<T = any>(error: Service.RequestError | null, data: any) {
+export async function handleServiceResult<T = any>(error: Service.RequestError | null, data: any,total:any) {
   if (error) {
     const fail: Service.FailedResult = {
       error,
-      data: null
+      data: null,
+			total:null
     };
     return fail;
   }
   const success: Service.SuccessResult<T> = {
     error: null,
-    data
+    data,
+		total,
   };
   return success;
 }
@@ -26,7 +28,8 @@ export function adapter<T extends Service.ServiceAdapter>(
     if (flag) {
       result = {
         error: item.error,
-        data: null
+        data: null,
+				total:null
       };
     }
     return flag;
@@ -34,9 +37,11 @@ export function adapter<T extends Service.ServiceAdapter>(
 
   if (!hasError) {
     const adapterFunArgs = args.map(item => item.data);
+		const adapterFunArgst = args.map(item => item.total);
     result = {
       error: null,
-      data: adapterFun(...adapterFunArgs)
+      data: adapterFun(...adapterFunArgs),
+			total:adapterFun(...adapterFunArgst),
     };
   }
 

+ 1 - 1
src/views/crud/demo/api.ts

@@ -12,7 +12,7 @@ function resHandle(res: any) {
   return res.data;
 }
 export async function GetList(query: UserPageQuery) {
-  const res = await request.post(`${apiPrefix}/get`, query);
+  const res = await request.get(`${apiPrefix}/get`, query);
   return resHandle(res);
 }
 

+ 2 - 2
src/views/crud/header_group/crud.tsx

@@ -3,8 +3,8 @@ import type { HeaderGroupRecord } from './api';
 import * as api from './api';
 
 export default function createCrudOptions(): CreateCrudOptionsRet {
-  const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
-    return api.GetList(query);
+  const pageRequest = async (): Promise<UserPageRes> => {
+    return api.GetList();
   };
   const editRequest = async (ctx: { form: HeaderGroupRecord; row: HeaderGroupRecord }) => {
     const { form, row } = ctx;

+ 1 - 0
src/views/index.ts

@@ -34,6 +34,7 @@ export const views: Record<
   'function_tab-multi-detail': () => import('./function/tab-multi-detail/index.vue'),
   function_tab: () => import('./function/tab/index.vue'),
   management_attendance_first: () => import('./management/attendance/first/index.vue'),
+  management_attendance_firstThree: () => import('./management/attendance/firstThree/index.vue'),
   management_attendance_firstTwo: () => import('./management/attendance/firstTwo/index.vue'),
   management_auth: () => import('./management/auth/index.vue'),
   management_crouse: () => import('./management/crouse/index.vue'),

+ 196 - 0
src/views/management/attendance/first/components/table-action-modal.vue

@@ -0,0 +1,196 @@
+<template>
+	<n-modal v-model:show="modalVisible" preset="card" :title="title" class="w-700px">
+		<n-form ref="formRef" label-placement="left" :label-width="80" :model="formModel" :rules="rules">
+			<n-grid :cols="24" :x-gap="18">
+				<!-- <n-form-item-grid-item :span="12" label="id" path="createUid">
+          <n-input-number v-model:value="formModel.createUid"  />
+        </n-form-item-grid-item> -->
+				<n-form-item-grid-item :span="12" label="学生姓名" path="studentName" >
+					<n-input v-model:value="formModel.studentName" :disabled="true"/>
+				</n-form-item-grid-item>
+				<n-form-item-grid-item :span="12" label="学生档案号" path="studentNumber">
+					<n-input v-model:value="formModel.studentNumber" clearable :disabled="true" />
+				</n-form-item-grid-item>
+				<n-form-item-grid-item :span="12" label="签到日期" path="checkinDate">
+					<n-input v-model:value="formModel.checkinDate"  />
+				</n-form-item-grid-item>
+				<n-form-item-grid-item :span="12" label="排课id" path="scheduleId">
+					<n-input-number v-model:value="formModel.scheduleId" :disabled="true" />
+				</n-form-item-grid-item>
+				<n-form-item-grid-item :span="12" label="月份" path="month">
+					<n-input-number v-model:value="formModel.month" />
+				</n-form-item-grid-item>
+				<n-form-item-grid-item :span="12" label="上午签到否" path="morning">
+					<n-input v-model:value="formModel.morning" />
+				</n-form-item-grid-item>
+				<n-form-item-grid-item :span="12" label="下午签到否" path="afternoon">
+					<n-input v-model:value="formModel.afternoon" />
+				</n-form-item-grid-item>
+				<n-form-item-grid-item :span="12" label="创建用户id"  path="createUid">
+					<n-input-number v-model:value="formModel.createUid" :disabled="true" />
+				</n-form-item-grid-item>
+			</n-grid>
+			<n-space class="w-full pt-16px" :size="24" justify="end">
+				<n-button class="w-72px" @click="closeModal">取消</n-button>
+				<n-button class="w-72px" type="primary" v-if="props.type === 'add'" @click="handleSubmit">添加</n-button>
+				<n-button class="w-72px" type="primary" v-if="props.type === 'edit'" @click="handleupdate">修改</n-button>
+			</n-space>
+		</n-form>
+	</n-modal>
+</template>
+
+<script setup lang="ts">
+import { ref, computed, reactive, watch, inject } from 'vue';
+import type { FormInst, FormItemRule } from 'naive-ui';
+import { add_5, update_5 } from '~/src/service/api/student';
+import type { Query_5Params } from '~/src/service/api/student';
+
+
+import { createRequiredFormRule } from '@/utils';
+import dayjs from 'dayjs';
+
+const init = inject('init');
+
+export interface Props {
+	/** 弹窗可见性 */
+	visible: boolean;
+	/**
+	 * 弹窗类型
+	 * add: 新增
+	 * edit: 编辑
+	 */
+	type?: 'add' | 'edit';
+	/** 编辑的表格行数据 */
+	editData?: Query_5Params | null;
+}
+
+export type ModalType = NonNullable<Props['type']>;
+
+defineOptions({ name: 'TableActionModal' });
+
+const props = withDefaults(defineProps<Props>(), {
+	type: 'add' || 'edit',
+	editData: null
+});
+
+interface Emits {
+	(e: 'update:visible', visible: boolean): void;
+}
+
+const emit = defineEmits<Emits>();
+// const emits = defineEmits()
+const modalVisible = computed({
+	get() {
+		return props.visible;
+	},
+	set(visible) {
+		emit('update:visible', visible);
+	}
+});
+const closeModal = () => {
+	modalVisible.value = false;
+};
+
+const title = computed(() => {
+	const titles: Record<ModalType, string> = {
+		add: '添加用户',
+		edit: '编辑用户'
+	};
+	return titles[props.type];
+});
+const formRef = ref<HTMLElement & FormInst>();
+
+type FormModel = Pick<UserManagement1.User, 'inputValue' | 'createUid' | 'afternoon' | 'morning' | 'month' | 'id' | 'studentName' | 'studentNumber' | 'checkinDate' | 'createTime' | 'modifyTime' | 'scheduleId' | 'disabled'>;
+
+const formModel = reactive<FormModel>(createDefaultFormModel());
+
+const rules: Record<keyof FormModel, FormItemRule | FormItemRule[]> = {
+	id: createRequiredFormRule('请输入id'),
+	studentName: createRequiredFormRule('请输入用户名'),
+	studentNumber: createRequiredFormRule('请输入档案号'),
+	checkinDate: createRequiredFormRule('请选择签到日期'),
+	createTime: createRequiredFormRule('请选择创建时间'),
+	modifyTime: createRequiredFormRule('请选择修改时间'),
+	scheduleId: createRequiredFormRule('请选择用户状态'),
+	disabled: createRequiredFormRule('请选择用户状态'),
+	inputValue: createRequiredFormRule('请选择用户状态'),
+	morning: createRequiredFormRule('请选择上午签到否'),
+	afternoon: createRequiredFormRule('请选择下午签到否'),
+	createUid: createRequiredFormRule('请选择创建用户id'),
+	month: createRequiredFormRule('请选择月份')
+};
+
+function createDefaultFormModel(): FormModel {
+	return {
+		id: 0,
+		studentName: '',
+		studentNumber: '',
+		checkinDate: '',
+		createTime: '',
+		modifyTime: '',
+		scheduleId: 0,
+		disabled: '',
+		inputValue: '',
+		month: 0,
+		morning: '',
+		afternoon: '',
+		createUid: 0
+	};
+}
+
+function handleUpdateFormModel(model: Partial<FormModel>) {
+	Object.assign(formModel, model);
+}
+
+function handleUpdateFormModelByModalType() {
+	const handlers: Record<ModalType, () => void> = {
+		add: () => {
+			const defaultFormModel = createDefaultFormModel();
+			handleUpdateFormModel(defaultFormModel);
+		},
+		edit: () => {
+			if (props.editData) {
+				handleUpdateFormModel(props.editData);
+			}
+		}
+	};
+
+	handlers[props.type]();
+}
+function initYe() {
+	init();
+}
+
+async function handleSubmit() {
+	await formRef.value?.validate();
+
+	add_5(formModel).then(() => {
+		initYe();
+		window.$message?.success('新增成功!');
+	})
+	closeModal();
+}
+
+async function handleupdate() {
+	await formRef.value?.validate();
+	window.$message?.success('修改成功!');
+	// formModel.modifyTime = Date()
+	const timer = dayjs().format('YYYY-MM-DD HH:mm:ss')
+	handleUpdateFormModel({ modifyTime: timer });
+	update_5(formModel).then(() => {
+		initYe();
+	})
+	closeModal();
+
+}
+watch(
+	() => props.visible,
+	newValue => {
+		if (newValue) {
+			handleUpdateFormModelByModalType();
+		}
+	}
+);
+</script>
+
+<style scoped></style>

+ 131 - 33
src/views/management/attendance/first/index.vue

@@ -7,12 +7,13 @@
 						<icon-ic-round-plus class="mr-4px text-20px" />
 						新增
 					</n-button>
-					<n-button type="error" @click="deleteSubjectsList">
+					<!-- <n-button type="error" @click="deleteSubjectsList">
 						<icon-ic-round-delete class="mr-4px text-20px" />
 						删除
-					</n-button>
+					</n-button> -->
 					<n-input-group>
-						<n-input :style="{ width: '50%' }" placeholder="输入序号查询..." />
+						<n-input :style="{ width: '50%' }" :value="conditionParams.id" @input="event => conditionParams.id = event"
+							placeholder="输入序号查询..." />
 						<n-input :style="{ width: '50%' }" placeholder="输入姓名查询..." />
 						<n-cascader v-model:value="value" placeholder="是否签到" :options="options" :filterable="true"
 							:render-label="renderLabel" @update:value="handleUpdateValue" />
@@ -23,12 +24,13 @@
 				</n-space>
 			</n-space>
 			<n-scrollbar style="max-height: 100vh" trigger="none">
-				<n-data-table :row-key="row => row.id" :columns="columns" :data="pageDate" :loading="loading"
-					:pagination="pagination" />
+				<n-data-table :row-key="row => row.id" v-model:checked-row-keys="deletedID" :columns="columns" :data="pageDate"
+					:loading="loading" :pagination="pagination" />
+
 				<!-- <n-pagination v-model:page="page"  :page-count="100" simple /> -->
 
-				<!-- <table-action-modal @init="init" v-model:visible="visible" @update:checked-row-keys="handleCheck"
-					:type="modalType" :pagination="pagination" :edit-data="(editData as SelectByConditionParams)" /> -->
+				<table-action-modal @init="init" v-model:visible="visible" @update:checked-row-keys="handleCheck"
+					:type="modalType" :pagination="pagination" :edit-data="(editData as Query_5Params)" />
 				<div style="width: 100%; height: 300px;"></div>
 			</n-scrollbar>
 
@@ -40,10 +42,14 @@
 <script setup lang="tsx">
 import { useBoolean, useLoading } from '@/hooks';
 import type { Ref } from 'vue';
-import { reactive, ref } from 'vue';
-import type { SelectByConditionParams } from '~/src/service/api/crouse'
-import { PaginationProps, DataTableColumns, DataTableRowKey, NButton, NPopconfirm, NSpace } from 'naive-ui';
+import { reactive, ref, provide } from 'vue';
+import type { Query_5Params } from '~/src/service/api/student';
+import { query_5, getStudentList, delete_5 } from '~/src/service/api/student'
+
+import { PaginationProps, DataTableColumns, DataTableRowKey, NButton, NPopconfirm, NSpace, c } from 'naive-ui';
 import { CascaderOption } from 'naive-ui'
+import TableActionModal from './components/table-action-modal.vue';
+import type { ModalType } from './components/table-action-modal.vue';
 
 function getOptions(depth = 3, iterator = 1, prefix = '') {
 	const length = 2;
@@ -105,6 +111,19 @@ function getOptions(depth = 3, iterator = 1, prefix = '') {
 	}
 	return options
 }
+const conditionParams: Query_5Params = reactive({
+	id: null,
+	checkinDate: null,
+	scheduleId: null,
+	month: null,
+	morning: null,
+	afternoon: null,
+	studentName: null,
+	studentNumber: null,
+	createUid: null,
+	createTime: null,
+	modifyTime: null,
+});
 const value = ref(null);
 const options = getOptions();
 function handleUpdateValue(...args: unknown[]) {
@@ -114,14 +133,15 @@ function renderLabel(option: { value?: string | number; label?: string }) {
 	return `${option.label}`
 };
 
-const { loading } = useLoading(false);
-// const { bool: visible, setTrue: openModal } = useBoolean();
-
+const { loading, startLoading, endLoading } = useLoading(false);
+const { bool: visible, setTrue: openModal } = useBoolean();
+const checkedRowKeysRef = ref<DataTableRowKey[]>([]);
 const pagination: PaginationProps = reactive({
 	page: 1,
 	pageSize: 10,
 	showSizePicker: true,
 	showQuickJumper: true,
+	itemCount: 1,
 	pageSizes: [10, 15, 20, 25, 30],
 	onUpdatePageSize: (pageSize: number) => {
 		pagination.pageSize = pageSize;
@@ -132,49 +152,61 @@ const pagination: PaginationProps = reactive({
 		// serchCondition();
 	}
 });
-const columns: Ref<DataTableColumns<SelectByConditionParams>> = ref([
-	{
-		type: 'selection',
-		align: 'center'
-	},
+const pageDate = ref([]);
+
+const columns: Ref<DataTableColumns<Query_5Params>> = ref([
+	// {
+	// 	type: 'selection',
+	// 	align: 'center'
+	// },
 	{
 		key: 'id',
 		title: '序号',
 		align: 'center'
 	},
 	{
-		key: 'name',
+		key: 'studentName',
 		title: '姓名',
 		align: 'center'
 	},
 	{
-		key: 'description',
-		title: '是否签到',
+		key: 'studentNumber',
+		title: '学生档案号',
 		align: 'center'
 	},
 	{
-		key: 'categoryId',
-		title: '正常',
+		key: 'checkinDate',
+		title: '签到日期',
 		align: 'center'
 	},
 	{
-		key: 'createTime',
-		title: '迟到',
+		key: 'scheduleId',
+		title: '排课id',
 		align: 'center'
 	},
 	{
-		key: 'modifyTime',
-		title: '早退',
+		key: 'month',
+		title: '月份',
+		align: 'center'
+	},
+	{
+		key: 'morning',
+		title: '上午出勤',
 		align: 'center'
 	},
 	{
-		key: 'createUid',
-		title: '请假',
+		key: 'afternoon',
+		title: '下午出勤',
 		align: 'center'
 	},
 	{
-		key: 'disabled',
-		title: '无效',
+		key: 'createTime',
+		title: '创建时间',
+		align: 'center'
+	},
+	{
+		key: 'modifyTime',
+		title: '修改时间',
 		align: 'center'
 	},
 	{
@@ -187,7 +219,7 @@ const columns: Ref<DataTableColumns<SelectByConditionParams>> = ref([
 					<NButton size={'small'} onClick={() => handleEditTable(row)}>
 						编辑
 					</NButton>
-					<NPopconfirm onPositiveClick={() => handleDeleteTable(row.id.toString())}>
+					<NPopconfirm onPositiveClick={() => handleDeleteTable(row.checkinDate, row.studentNumber)}>
 						{{
 							default: () => '确认删除',
 							trigger: () => <NButton size={'small'}>删除</NButton>
@@ -197,6 +229,72 @@ const columns: Ref<DataTableColumns<SelectByConditionParams>> = ref([
 			);
 		}
 	}
-]) as Ref<DataTableColumns<SelectByConditionParams>>;
+]) as Ref<DataTableColumns<Query_5Params>>;
+
+function handleCheck(rowKeys: DataTableRowKey[]) {
+	checkedRowKeysRef.value = rowKeys;
+
+}
+// const s = ref([]);
+// const deletedID = ref([]);
+// function deleteSubjectsList() {
+// 	const difference = deletedID.value.filter(item => !s.value.includes(item));
+// 	s.value = deletedID.value
+// 	console.log(difference)
+// 	for (let i = 0; i < difference.length; i++) {
+// 		// delete_5({});
+// 	}
+// 	init();
+// }
+
+const editData = ref<Query_5Params | null>(null);
+function setEditData(data: Query_5Params | null) {
+	editData.value = data;
+}
+function handleEditTable(findItem: Query_5Params) {
+	if (findItem) {
+		setEditData(findItem);
+	}
+	setModalType('edit');
+	openModal();
+}
+function handleAddTable() {
+	openModal();
+	setModalType('add');
+	init();
+}
+const modalType = ref<ModalType>('add' || 'edit');
+function setModalType(type: ModalType) {
+	modalType.value = type;
+}
+function serchCondition() {
+	startLoading();
+	query_5(pagination.page, pagination.pageSize, conditionParams).then(r => {
+		pageDate.value = r.data as [];
+		endLoading();
+	}).catch(() => {
+		console.log('jdias')
+	})
+}
+function init() {
+	startLoading();
+	setTimeout(() => {
+		serchCondition();
+	}, 1000)
+	endLoading();
+}
+
+// 初始化
+init();
+// 删除
+function handleDeleteTable(rowData: string, rowNumber: string) {
+	startLoading();
+	delete_5({ "checkinDate": rowData, "studentNumber": rowNumber }).then(() => {
+		endLoading()
+	})
+	init();
+}
+
+provide('init', init);
 </script>
 <style></style>

+ 316 - 0
src/views/management/attendance/firstThree/index.vue

@@ -0,0 +1,316 @@
+<template>
+	<div class="h-full overflow-hidden">
+		<n-card title="学生管理" :bordered="false" class="rounded-16px shadow-sm">
+			<n-space class="pb-12px" justify="space-between">
+				<n-space>
+					<n-button type="primary" @click="handleAddTable">
+						<icon-ic-round-plus class="mr-4px text-20px" />
+						新增
+					</n-button>
+					<!-- <n-button type="error" @click="deleteSubjectsList">
+						<icon-ic-round-delete class="mr-4px text-20px" />
+						删除
+					</n-button> -->
+					<n-input-group>
+						<n-input :style="{ width: '50%' }" :value="conditionParams.id" @input="event => conditionParams.id = event"
+							placeholder="输入序号查询..." />
+						<n-input :style="{ width: '50%' }" placeholder="输入姓名查询..." />
+						<n-cascader v-model:value="value" placeholder="是否签到" :options="options" :filterable="true"
+							:render-label="renderLabel" @update:value="handleUpdateValue" />
+						<n-button type="primary" ghost @click="serchCondition()">
+							搜索
+						</n-button>
+					</n-input-group>
+				</n-space>
+			</n-space>
+			<n-scrollbar style="max-height: 100vh" trigger="none">
+				<n-data-table :row-key="row => row.id" v-model:checked-row-keys="deletedID" :columns="columns" :data="pageDate"
+					:loading="loading" :pagination="pagination" />
+				<!-- <n-pagination v-model:page="page"  :page-count="100" simple /> -->
+
+				<table-action-modal @init="init" v-model:visible="visible" @update:checked-row-keys="handleCheck"
+					:type="modalType" :pagination="pagination" :edit-data="(editData as Query_5Params)" />
+				<div style="width: 100%; height: 300px;"></div>
+			</n-scrollbar>
+
+		</n-card>
+
+	</div>
+</template>
+
+<script setup lang="tsx">
+import { useBoolean, useLoading } from '@/hooks';
+import type { Ref } from 'vue';
+import { reactive, ref, provide } from 'vue';
+import type { Query_5Params } from '~/src/service/api/student';
+import { query_5, getStudentList, delete_5 } from '~/src/service/api/student'
+
+import { PaginationProps, DataTableColumns, DataTableRowKey, NButton, NPopconfirm, NSpace, c } from 'naive-ui';
+import { CascaderOption } from 'naive-ui'
+// import TableActionModal from './components/table-action-modal.vue';
+// import type { ModalType } from './components/table-action-modal.vue';
+
+function getOptions(depth = 3, iterator = 1, prefix = '') {
+	const length = 2;
+	const options: CascaderOption[] = []
+	for (let i = 1; i <= length; ++i) {
+		if (iterator === 1) {
+			options.push({
+				value: `v-${i}`,
+				label: '未签到',
+				disabled: i % 5 === 0,
+				children: getOptions(depth, iterator + 1, '' + String(i))
+			});
+			if (options[0].value === 'v-1') {
+				options[0].label = '已签到'
+			}
+			console.log(options, 'd11111')
+
+		}
+		else {
+			// if()
+			if (prefix === '1') {
+				options.splice(0)
+				// options[i].disabled = true;
+			} else {
+				options.splice(0)
+
+			}
+
+			console.log(options, 'hduasi')
+			options.push({
+				value: `v-${prefix}-1`,
+				label: `早退`,
+				disabled: i % 5 === 0
+			},
+				{
+					value: `v-${prefix}-2`,
+					label: `迟到`,
+					disabled: i % 5 === 0
+				},
+				{
+					value: `v-${prefix}-3`,
+					label: `请假`,
+					disabled: i % 5 === 0
+				},
+				{
+					value: `v-${prefix}-4`,
+					label: `无效`,
+					disabled: i % 5 === 0
+				})
+			console.log(options, '8888888')
+			if (prefix === '1') {
+				for (let i = 0; i < options.length; i++) {
+					options[i].disabled = true;
+				}
+				// options[i].disabled = true;
+			}
+
+		}
+	}
+	return options
+}
+const conditionParams: Query_5Params = reactive({
+	id: null,
+	checkinDate: null,
+	scheduleId: null,
+	month: null,
+	morning: null,
+	afternoon: null,
+	studentName: null,
+	studentNumber: null,
+	createUid: null,
+	createTime: null,
+	modifyTime: null,
+});
+const value = ref(null);
+
+
+// 获取当前页面的完整 URL
+const url = window.location.href;
+
+// 创建一个 URL 对象
+const urlObj = new URL(url);
+
+// 获取指定参数名(例如 "id")对应的值
+const scheduleId = urlObj.searchParams.get('scheduleId');
+
+
+const options = getOptions();
+function handleUpdateValue(...args: unknown[]) {
+	console.log(...args)
+};
+function renderLabel(option: { value?: string | number; label?: string }) {
+	return `${option.label}`
+};
+
+const { loading, startLoading, endLoading } = useLoading(false);
+const { bool: visible, setTrue: openModal } = useBoolean();
+const checkedRowKeysRef = ref<DataTableRowKey[]>([]);
+const pagination: PaginationProps = reactive({
+	page: 1,
+	pageSize: 10,
+	showSizePicker: true,
+	showQuickJumper: true,
+	itemCount: 1,
+	pageSizes: [10, 15, 20, 25, 30],
+	onUpdatePageSize: (pageSize: number) => {
+		pagination.pageSize = pageSize;
+		// serchCondition();
+	},
+	onUpdatePage: (page: number) => {
+		pagination.page = page;
+		// serchCondition();
+	}
+});
+const pageDate = ref([]);
+
+const columns: Ref<DataTableColumns<Query_5Params>> = ref([
+	// {
+	// 	type: 'selection',
+	// 	align: 'center'
+	// },
+	{
+		key: 'id',
+		title: '序号',
+		align: 'center'
+	},
+	{
+		key: 'studentName',
+		title: '姓名',
+		align: 'center'
+	},
+	{
+		key: 'studentNumber',
+		title: '学生档案号',
+		align: 'center'
+	},
+	{
+		key: 'checkinDate',
+		title: '签到日期',
+		align: 'center'
+	},
+	{
+		key: 'scheduleId',
+		title: '排课id',
+		align: 'center'
+	},
+	{
+		key: 'month',
+		title: '月份',
+		align: 'center'
+	},
+	{
+		key: 'morning',
+		title: '上午出勤',
+		align: 'center'
+	},
+	{
+		key: 'afternoon',
+		title: '下午出勤',
+		align: 'center'
+	},
+	{
+		key: 'createTime',
+		title: '创建时间',
+		align: 'center'
+	},
+	{
+		key: 'modifyTime',
+		title: '修改时间',
+		align: 'center'
+	},
+	{
+		key: 'actions',
+		title: '操作',
+		align: 'center',
+		render: row => {
+			return (
+				<NSpace justify={'center'}>
+					<NButton size={'small'} onClick={() => handleEditTable(row)}>
+						编辑
+					</NButton>
+					<NPopconfirm onPositiveClick={() => handleDeleteTable(row.checkinDate, row.studentNumber)}>
+						{{
+							default: () => '确认删除',
+							trigger: () => <NButton size={'small'}>删除</NButton>
+						}}
+					</NPopconfirm>
+				</NSpace>
+			);
+		}
+	}
+]) as Ref<DataTableColumns<Query_5Params>>;
+
+function handleCheck(rowKeys: DataTableRowKey[]) {
+	checkedRowKeysRef.value = rowKeys;
+
+}
+// const s = ref([]);
+// const deletedID = ref([]);
+// function deleteSubjectsList() {
+// 	const difference = deletedID.value.filter(item => !s.value.includes(item));
+// 	s.value = deletedID.value
+// 	console.log(difference)
+// 	for (let i = 0; i < difference.length; i++) {
+// 		// delete_5({});
+// 	}
+// 	init();
+// }
+
+const editData = ref<Query_5Params | null>(null);
+function setEditData(data: Query_5Params | null) {
+	editData.value = data;
+}
+function handleEditTable(findItem: Query_5Params) {
+	if (findItem) {
+		setEditData(findItem);
+	}
+	setModalType('edit');
+	openModal();
+
+}
+function handleAddTable() {
+	openModal();
+	setModalType('add');
+	init();
+}
+const modalType = ref<ModalType>('add' || 'edit');
+function setModalType(type: ModalType) {
+	modalType.value = type;
+}
+function serchCondition() {
+	startLoading();
+
+	getStudentList(scheduleId).then(r => {
+		pageDate.value = r.data as [];
+		endLoading();
+	}).catch(() => {
+		console.log('jdias')
+	})
+
+}
+
+
+function init() {
+	startLoading();
+	setTimeout(() => {
+		serchCondition();
+	}, 1000)
+	endLoading();
+}
+
+// 初始化
+init();
+// 删除
+function handleDeleteTable(rowData: string, rowNumber: string) {
+	startLoading();
+	delete_5({ "checkinDate": rowData, "studentNumber": rowNumber }).then(() => {
+		endLoading()
+	})
+	init();
+}
+
+provide('init', init);
+</script>
+<style></style>

+ 35 - 11
src/views/management/attendance/firstTwo/index.vue

@@ -12,17 +12,17 @@
 						删除
 					</n-button>
 					<n-input-group>
-						<n-input-number :style="{ width: '50%' }" :value="conditionParams.id" @input="event => conditionParams.id = event"
-							placeholder="输入id查询..." />
+						<n-input :style="{ width: '50%' }" :value="conditionParams.id"
+							@input="event => conditionParams.id = event" placeholder="输入id查询..." />
 						<n-input :style="{ width: '50%' }" :value="conditionParams.name"
 							@input="event => conditionParams.name = event" placeholder="输入名字查询..." />
-						<n-input-number :style="{ width: '50%' }" :value="conditionParams.manageId"
+						<n-input :style="{ width: '50%' }" :value="conditionParams.manageId"
 							@input="event => conditionParams.manageId = event" placeholder="输入班级负责人查询..." />
-						<n-input-number :style="{ width: '50%' }" :value="conditionParams.assistantId"
-							@input="event => conditionParams.disabled = event" placeholder="输入助教老师查询..." />
+						<n-input :style="{ width: '50%' }" :value="conditionParams.assistantId"
+							@input="event => conditionParams.assistantId = event" placeholder="输入助教老师查询..." />
 						<n-input :style="{ width: '50%' }" :value="conditionParams.createTime"
 							@input="event => conditionParams.createTime = event" placeholder="输入创建时间查询..." />
-						<n-input-number :style="{ width: '50%' }" :value="conditionParams.createUid"
+						<n-input :style="{ width: '50%' }" :value="conditionParams.createUid"
 							@input="event => conditionParams.createUid = event" placeholder="输入创建用户id查询..." />
 						<n-button type="primary" ghost @click="serchCondition()">
 							搜索
@@ -34,7 +34,7 @@
 				<n-data-table :row-key="row => row.id" v-model:checked-row-keys="deletedID" :columns="columns" :data="pageDate"
 					:loading="loading" />
 				<n-pagination class="n-pagination" @next="(info) => { console.log(info) }" v-model:page="pagination.page"
-					v-model:page-size="pagination.pageSize" :page-count="30" show-size-picker :page-sizes="[10, 20, 30, 40]"
+					v-model:page-size="pagination.pageSize" :item-count="pagination.itemCount" show-size-picker :page-sizes="[10, 20, 30, 40]"
 					:on-update:page="(page: number) => { pagination.page = page; serchCondition(); }"
 					:on-update-page-size="(pageSize: number) => { pagination.pageSize = pageSize; serchCondition(); }" />
 				<table-action-modal @init="init" v-model:visible="visible" @update:checked-row-keys="handleCheck"
@@ -56,7 +56,9 @@ import { deleteClass, selectCondition } from '~/src/service/api/class'
 import type { SelectConditionParams } from '~/src/service/api/class'
 import TableActionModal from './components/table-action-modal.vue';
 import type { ModalType } from './components/table-action-modal.vue';
-import { PaginationProps, DataTableColumns, NButton, NSpace, DataTableRowKey } from 'naive-ui';
+import { userStatusLabels } from '@/constants';
+import { PaginationProps, DataTableColumns, NButton, NTag, NSpace, DataTableRowKey } from 'naive-ui';
+import { Router } from 'vue-router';
 
 
 const conditionParams: SelectConditionParams = reactive({
@@ -80,6 +82,7 @@ const pagination: PaginationProps = reactive({
 	page: 1,
 	pageSize: 10,
 	pageCount: 3,
+	itemCount: 1,
 	showSizePicker: true,
 	showQuickJumper: true,
 	pageSizes: [10, 15, 20, 25, 30]
@@ -124,7 +127,22 @@ const columns: Ref<DataTableColumns<SelectConditionParams>> = ref([
 	{
 		key: 'disabled',
 		title: '状态',
-		align: 'center'
+		align: 'center',
+		render: row => {
+			if (row.disabled) {
+				const tagTypes: Record<UserManagement.UserStatusKey, NaiveUI.ThemeColor> = {
+					'1': 'success',
+					'2': 'error',
+					'3': 'warning',
+					'4': 'default',
+					'N': 'error',
+					'Y': 'success'
+				};
+				console.log(row.disabled)
+				return <NTag type={tagTypes[row.disabled]}>{userStatusLabels[row.disabled]}</NTag>;
+			}
+			return <span></span>;
+		}
 	},
 	{
 		key: 'actions',
@@ -136,7 +154,7 @@ const columns: Ref<DataTableColumns<SelectConditionParams>> = ref([
 					<NButton size={'small'} onClick={() => handleEditTable(row)}>
 						编辑
 					</NButton>
-					<NButton size={'small'} onClick={() => handleEditTable(row)}>
+					<NButton size={'small'} onClick={() => push(row)}>
 						班级详情
 					</NButton>
 				</NSpace>
@@ -172,7 +190,7 @@ function setModalType(type: ModalType) {
 }
 const s = ref([]);
 // 删除
-function deleteSubjectsList(){
+function deleteSubjectsList() {
 	const difference = deletedID.value.filter(item => !s.value.includes(item));
 	s.value = deletedID.value
 
@@ -182,8 +200,11 @@ function deleteSubjectsList(){
 	init();
 }
 function serchCondition() {
+	startLoading();
 	selectCondition(pagination.page, pagination.pageSize, conditionParams).then(r => {
 		pageDate.value = r.data as [];
+		pagination.itemCount = Number(r.total);
+		endLoading();
 	}).catch(() => {
 		console.log('jdias')
 	})
@@ -195,6 +216,9 @@ function init() {
 	}, 1000)
 	endLoading();
 }
+function push(){
+	window.location.href = 'http://localhost:3200/management/attentance/first';
+}
 
 // 初始化
 init();

+ 23 - 5
src/views/management/crouse/index.vue

@@ -22,7 +22,7 @@
 							@input="event => conditionParams.disabled = event" placeholder="输入是否禁用查询..." />
 						<n-input :style="{ width: '50%' }" :value="conditionParams.createTime"
 							@input="event => conditionParams.createTime = event" placeholder="输入创建时间查询..." />
-						<n-input :style="{ width: '50%' }" :value="conditionParams.categoryId"
+						<n-input-number :style="{ width: '50%' }" :value="conditionParams.categoryId"
 							@input="event => conditionParams.categoryId = event" placeholder="输入学科分类查询..." />
 						<n-button type="primary" ghost @click="serchCondition()">
 							搜索
@@ -34,8 +34,8 @@
 				<n-data-table :row-key="row => row.id" v-model:checked-row-keys="deletedID" :columns="columns" :data="pageDate"
 					:loading="loading" />
 				<n-pagination class="n-pagination" @next="(info) => { console.log(info) }" v-model:page="pagination.page"
-					v-model:page-size="pagination.pageSize" :page-count="30" show-size-picker :page-sizes="[10, 20, 30, 40]"
-					:on-update:page="(page: number) => { pagination.page = page; serchCondition(); }"
+					v-model:page-size="pagination.pageSize" :item-count="pagination.itemCount" show-size-picker
+					:page-sizes="[10, 20, 30, 40]" :on-update:page="(page: number) => { pagination.page = page; serchCondition(); }"
 					:on-update-page-size="(pageSize: number) => { pagination.pageSize = pageSize; serchCondition(); }" />
 
 				<table-action-modal @init="init" v-model:visible="visible" @update:checked-row-keys="handleCheck"
@@ -55,8 +55,9 @@ import { useBoolean, useLoading } from '@/hooks';
 import TableActionModal from './component/table-action-modal.vue';
 import type { ModalType } from './component/table-action-modal.vue';
 import { deleteSubjects, selectByCondition } from '~/src/service/api/crouse';
+import { userStatusLabels } from '@/constants';
 import type { SelectByConditionParams } from '~/src/service/api/crouse'
-import { PaginationProps, DataTableColumns, DataTableRowKey, NButton, NPopconfirm, NSpace } from 'naive-ui';
+import { PaginationProps, DataTableColumns, DataTableRowKey, NButton, NTag, NPopconfirm, NSpace } from 'naive-ui';
 
 
 const conditionParams: SelectByConditionParams = reactive({
@@ -79,6 +80,7 @@ const pagination: PaginationProps = reactive({
 	page: 1,
 	pageSize: 10,
 	pageCount: 3,
+	itemCount: 1,
 	showSizePicker: true,
 	showQuickJumper: true,
 	pageSizes: [10, 15, 20, 25, 30]
@@ -129,7 +131,22 @@ const columns: Ref<DataTableColumns<SelectByConditionParams>> = ref([
 	{
 		key: 'disabled',
 		title: '状态',
-		align: 'center'
+		align: 'center',
+		render: row => {
+			if (row.disabled) {
+				const tagTypes: Record<UserManagement.UserStatusKey, NaiveUI.ThemeColor> = {
+					'1': 'success',
+					'2': 'error',
+					'3': 'warning',
+					'4': 'default',
+					'N': 'error',
+					'Y': 'success'
+				};
+				console.log(row.disabled)
+				return <NTag type={tagTypes[row.disabled]}>{userStatusLabels[row.disabled]}</NTag>;
+			}
+			return <span></span>;
+		}
 	},
 	{
 		key: 'actions',
@@ -212,6 +229,7 @@ function handleCheck(rowKeys: DataTableRowKey[]) {
 function serchCondition() {
 	selectByCondition(pagination.page, pagination.pageSize, conditionParams).then(r => {
 		pageDate.value = r.data as [];
+		pagination.itemCount = Number(r.total);
 	}).catch(() => {
 		console.log('jdias')
 	})