liuxinyang hai 1 ano
pai
achega
830736bf6c

+ 0 - 1
lxy

@@ -1 +0,0 @@
-Subproject commit 5aa2f3b462abd10b9ea6dba92f863470b1691eef

+ 1 - 0
src/layouts/common/global-sider/components/vertical-sider/components/vertical-menu.vue

@@ -38,6 +38,7 @@ const expandedKeys = ref<string[]>([]);
 
 function handleUpdateMenu(_key: string, item: MenuOption) {
   const menuItem = item as App.GlobalMenuOption;
+	console.log( _key, item, menuItem.routePath )
   routerPush(menuItem.routePath);
 }
 

+ 6 - 1
src/locales/lang/zh-cn.ts

@@ -71,7 +71,12 @@ const locale: LocaleMessages<I18nType.Schema> = {
         }
       },
       management: {
-        _value: '系统管理',
+				_value: '系统管理',
+				attendance: {
+					_value: '考勤',
+					firstTwo: "考勤2",
+					first: "考勤1"
+				},
         auth: '权限管理',
         role: '角色管理',
         route: '路由管理',

+ 101 - 66
src/router/modules/management.ts

@@ -1,70 +1,105 @@
 const management: AuthRoute.Route = {
-  name: 'management',
-  path: '/management',
-  component: 'basic',
-  children: [
-    {
-      name: 'management_auth',
-      path: '/management/auth',
-      component: 'self',
-      meta: {
-        title: '权限管理',
-        i18nTitle: 'message.routes.management.auth',
-        requiresAuth: true,
-        icon: 'ic:baseline-security'
-      }
-    },
-    {
-      name: 'management_role',
-      path: '/management/role',
-      component: 'self',
-      meta: {
-        title: '角色管理',
-        i18nTitle: 'message.routes.management.role',
-        requiresAuth: true,
-        icon: 'carbon:user-role'
-      }
-    },
-    {
-      name: 'management_user',
-      path: '/management/user',
-      component: 'self',
-      meta: {
-        title: '用户管理',
-        i18nTitle: 'message.routes.management.user',
-        requiresAuth: true,
-        icon: 'ic:round-manage-accounts'
-      }
-    },
-    {
-      name: 'management_route',
-      path: '/management/route',
-      component: 'self',
-      meta: {
-        title: '路由管理',
-        i18nTitle: 'message.routes.management.route',
-        requiresAuth: true,
-        icon: 'material-symbols:route'
-      }
-    },
-    {
-      name: 'management_crouse',
-      path: '/management/crouse',
-      component: 'self',
-      meta: {
-        title: '课程管理',
-        i18nTitle: '课程管理',
-        requiresAuth: true,
-        icon: 'zondicons:align-left'
-      }
-    }
-  ],
-  meta: {
-    title: '系统管理',
-    i18nTitle: 'message.routes.management._value',
-    icon: 'carbon:cloud-service-management',
-    order: 9
-  }
+	name: "management",
+	path: "/management",
+	component: "basic",
+	children: [
+		{
+			name: "management_auth",
+			path: "/management/auth",
+			component: "self",
+			meta: {
+				title: "权限管理",
+				i18nTitle: "message.routes.management.auth",
+				requiresAuth: true,
+				icon: "ic:baseline-security",
+			},
+		},
+		{
+			name: "management_role",
+			path: "/management/role",
+			component: "self",
+			meta: {
+				title: "角色管理",
+				i18nTitle: "message.routes.management.role",
+				requiresAuth: true,
+				icon: "carbon:user-role",
+			},
+		},
+		{
+			name: "management_user",
+			path: "/management/user",
+			component: "self",
+			meta: {
+				title: "用户管理",
+				i18nTitle: "message.routes.management.user",
+				requiresAuth: true,
+				icon: "ic:round-manage-accounts",
+			},
+		},
+		{
+			name: "management_route",
+			path: "/management/route",
+			component: "self",
+			meta: {
+				title: "路由管理",
+				i18nTitle: "message.routes.management.route",
+				requiresAuth: true,
+				icon: "material-symbols:route",
+			},
+		},
+		{
+			name: "management_crouse",
+			path: "/management/crouse",
+			component: "self",
+			meta: {
+				title: "课程管理",
+				i18nTitle: "课程管理",
+				requiresAuth: true,
+				icon: "zondicons:align-left",
+			},
+		},
+		{
+			name: "management_attendance",
+			path: "/management/attendance",
+			component: "multi",
+			children: [
+				{
+					name: 'management_first',
+					path: '/management/attentance/first/index.vue',
+					component: 'self',
+					meta: {
+            title: '排课信息',
+            i18nTitle: '排课信息',
+            requiresAuth: true,
+            icon: 'mdi:menu'
+          }
+				},
+				{
+					name: 'management_firstTwo',
+					path: '/management/attentance/firstTwo/index.vue',
+					component: 'self',
+					meta: {
+            title: '班级签到信息',
+            i18nTitle: '班级签到信息',
+            requiresAuth: true,
+            icon: 'mdi:menu'
+          }
+				},
+			],
+			meta: {
+				title: "考勤管理",
+				i18nTitle: "考勤管理",
+				requiresAuth: true,
+				icon: "zondicons:align-left",
+			},
+		},
+	],
+	meta: {
+		title: "系统管理",
+		i18nTitle: "message.routes.management._value",
+		icon: "carbon:cloud-service-management",
+		order: 12,
+	},
 };
 
 export default management;

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

@@ -54,6 +54,9 @@ declare namespace PageRoute {
     | 'function_tab-multi-detail'
     | 'function_tab'
     | 'management'
+    | 'management_attendance'
+    | 'management_attendance_first'
+    | 'management_attendance_firstTwo'
     | 'management_auth'
     | 'management_crouse'
     | 'management_role'
@@ -113,6 +116,8 @@ declare namespace PageRoute {
     | 'function_tab-detail'
     | 'function_tab-multi-detail'
     | 'function_tab'
+    | 'management_attendance_first'
+    | 'management_attendance_firstTwo'
     | 'management_auth'
     | 'management_crouse'
     | 'management_role'

+ 5 - 0
src/typings/system.d.ts

@@ -375,6 +375,11 @@ declare namespace I18nType {
       };
       management: {
         _value: string;
+				attendance: {
+					_value: string
+					firstTwo: string
+					first: string
+				},
         auth: string;
         role: string;
         route: string;

+ 2 - 0
src/views/index.ts

@@ -33,6 +33,8 @@ export const views: Record<
   'function_tab-detail': () => import('./function/tab-detail/index.vue'),
   'function_tab-multi-detail': () => import('./function/tab-multi-detail/index.vue'),
   function_tab: () => import('./function/tab/index.vue'),
+  management_first: () => import('./management/attendance/first/index.vue'),
+  management_firstTwo: () => import('./management/attendance/firstTwo/index.vue'),
   management_auth: () => import('./management/auth/index.vue'),
   management_crouse: () => import('./management/crouse/index.vue'),
   management_role: () => import('./management/role/index.vue'),

+ 5 - 0
src/views/management/attendance/first/index.vue

@@ -0,0 +1,5 @@
+<template>
+	<div>
+		考勤管理
+	</div>
+</template>

+ 5 - 0
src/views/management/attendance/firstTwo/index.vue

@@ -0,0 +1,5 @@
+<template>
+	<div>
+		考勤管理
+	</div>
+</template>

+ 0 - 3
src/views/management/crouse/component/Pagination.vue

@@ -7,7 +7,6 @@
 import { defineComponent, ref } from 'vue'
 import type { SelectByConditionParams } from '~/src/service/api/crouse'
 import { selectByCondition } from '~/src/service/api/crouse';
-import { inputPageNum1, inputPageNum2 } from '../index.vue'
 const conditionParams: SelectByConditionParams = {};
 // import  selectByCondition  from '../index.vue'
 export default defineComponent({
@@ -15,8 +14,6 @@ export default defineComponent({
 		return {
 			selectByCondition,
 			conditionParams,
-			inputPageNum1,
-			inputPageNum2,
 			page: ref(2),
 			pageSize: ref(20)
     }

+ 12 - 10
src/views/management/crouse/component/table-action-modal.vue

@@ -37,16 +37,14 @@
 </template>
 
 <script setup lang="ts">
-import { ref, computed, reactive, watch } from 'vue';
+import { ref, computed, reactive, watch, inject } from 'vue';
 import type { FormInst, FormItemRule } from 'naive-ui';
 import { addSubject, updateSubjects, SelectByConditionParams } from '~/src/service/api/crouse';
 import { userStatusOptions } from '@/constants';
 import { createRequiredFormRule } from '@/utils';
-// import { defineEmits } from 'vue';
-// const { proxy } = getCurrentInstance()
-// import init from '../index.vue'
 import dayjs from 'dayjs';
-// import pageData from '../index.vue'
+
+const init = inject('init');
 
 export interface Props {
 	/** 弹窗可见性 */
@@ -71,7 +69,7 @@ const props = withDefaults(defineProps<Props>(), {
 });
 
 interface Emits {
-	(e: 'update:visible', visible: boolean ): void;
+	(e: 'update:visible', visible: boolean): void;
 }
 
 const emit = defineEmits<Emits>();
@@ -95,7 +93,6 @@ const title = computed(() => {
 	};
 	return titles[props.type];
 });
-
 const formRef = ref<HTMLElement & FormInst>();
 
 type FormModel = Pick<UserManagement1.User, 'inputValue' | 'id' | 'name' | 'description' | 'categoryId' | 'createTime' | 'modifyTime' | 'createUid' | 'disabled'>;
@@ -148,11 +145,16 @@ function handleUpdateFormModelByModalType() {
 	handlers[props.type]();
 }
 
+function initYe() {
+	init();
+}
+
 async function handleSubmit() {
 	await formRef.value?.validate();
-	window.$message?.success('新增成功!');
+
 	addSubject(formModel).then(() => {
-		emits('init');
+		initYe();
+		window.$message?.success('新增成功!');
 	})
 	closeModal();
 }
@@ -164,7 +166,7 @@ async function handleupdate() {
 	const timer = dayjs().format('YYYY-MM-DD HH:mm:ss')
 	handleUpdateFormModel({ modifyTime: timer });
 	updateSubjects(formModel).then(() => {
-		emits('init');
+		initYe();
 	})
 	closeModal();
 

+ 49 - 35
src/views/management/crouse/index.vue

@@ -12,14 +12,18 @@
 						删除
 					</n-button>
 					<n-input-group>
-
-
-						<n-input :style="{ width: '50%' }" :value="conditionParams.id" @input="event=>conditionParams.id = event" placeholder="输入查询..." />
-						<n-input :style="{ width: '50%' }" :value="conditionParams.name"  @input="event=>conditionParams.name = event" placeholder="输入查询..." />
-						<n-input :style="{ width: '50%' }" :value="conditionParams.description"  @input="event=>conditionParams.description = event" placeholder="输入查询..." />
-						<n-input :style="{ width: '50%' }" :value="conditionParams.disabled"  @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"  @input="event=>conditionParams.categoryId = event" placeholder="输入查询..." />
+						<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 :style="{ width: '50%' }" :value="conditionParams.description"
+							@input="event => conditionParams.description = event" placeholder="输入学科描述查询..." />
+						<n-input :style="{ width: '50%' }" :value="conditionParams.disabled"
+							@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"
+							@input="event => conditionParams.categoryId = event" placeholder="输入学科分类查询..." />
 						<n-button type="primary" ghost @click="serchCondition()">
 							搜索
 						</n-button>
@@ -27,7 +31,10 @@
 				</n-space>
 			</n-space>
 			<n-scrollbar style="max-height: 100vh" trigger="none">
-				<n-data-table :columns="columns" :data="pageDate" :loading="loading" :row-key="rowKey" :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)" />
 				<div style="width: 100%; height: 300px;"></div>
@@ -39,7 +46,7 @@
 </template>
 
 <script setup lang="tsx">
-import { reactive, ref } from 'vue';
+import { reactive, ref, provide } from 'vue';
 import type { Ref } from 'vue';
 import { useBoolean, useLoading } from '@/hooks';
 import TableActionModal from './component/table-action-modal.vue';
@@ -49,8 +56,7 @@ import type { SelectByConditionParams } from '~/src/service/api/crouse'
 import { PaginationProps, DataTableColumns, DataTableRowKey, NButton, NPopconfirm, NSpace } from 'naive-ui';
 
 
-
-const conditionParams:SelectByConditionParams = reactive({
+const conditionParams: SelectByConditionParams = reactive({
 	id: null,
 	name: null,
 	description: null,
@@ -61,37 +67,28 @@ const conditionParams:SelectByConditionParams = reactive({
 });
 
 
-// 输入值
-const form = ref('');
-console.log(form)
-const { loading } = useLoading(false);
+const deletedID = ref([]);
+
+const { loading, startLoading, endLoading } = useLoading(false);
 const { bool: visible, setTrue: openModal } = useBoolean();
 
 const pagination: PaginationProps = reactive({
 	page: 1,
 	pageSize: 10,
 	showSizePicker: true,
-	pageCount: 12,
+	showQuickJumper: true,
 	pageSizes: [10, 15, 20, 25, 30],
 	onUpdatePageSize: (pageSize: number) => {
 		pagination.pageSize = pageSize;
+		serchCondition();
 	},
 	onUpdatePage: (page: number) => {
 		pagination.page = page;
+		serchCondition();
 	}
 });
-console.log(pagination.page, pagination.pageSize)
-type RowData = {
-	key: number
-	id: number
-	name: string
-	description: string
-	createTime: string
-	modifyTime: string
-	createUid: number
-	disabled: string
-}
-const rowKey = (row: RowData) => row.id
+// const page = ref(0)
+// const pageSize = ref(0)
 const checkedRowKeysRef = ref<DataTableRowKey[]>([]);
 const pageDate = ref([]);
 
@@ -169,7 +166,7 @@ function handleAddTable() {
 	init();
 }
 
-
+// selectAll()
 // 编辑
 const editData = ref<SelectByConditionParams | null>(null);
 function setEditData(data: SelectByConditionParams | null) {
@@ -194,17 +191,29 @@ function setModalType(type: ModalType) {
 	modalType.value = type;
 }
 const s = ref([]) as any;
-
+console.log(deletedID)
+// 删除
 function deleteSubjectsList() {
-	const difference = checkedRowKeysRef.value.filter(item => !s.value.includes(item));
-	s.value = checkedRowKeysRef.value
+	const difference = deletedID.value.filter(item => !s.value.includes(item));
+	s.value = deletedID.value
+
 	for (let i = 0; i < difference.length; i++) {
 		deleteSubjects(Number(difference[i]));
 	}
-	init();
+	// init();
+	selectByCondition(pagination.page, pagination.pageSize, conditionParams).then(r => {
+		pageDate.value = r.data as [];
+	}).catch(() => {
+		console.log('jdias')
+	})
 }
+
+const rowKey = (row: SelectByConditionParams) => { return row.id }
+console.log(rowKey)
 function handleCheck(rowKeys: DataTableRowKey[]) {
+	console.log(checkedRowKeysRef.value, rowKeys, 'jdaspo')
 	checkedRowKeysRef.value = rowKeys;
+
 }
 function serchCondition() {
 	selectByCondition(pagination.page, pagination.pageSize, conditionParams).then(r => {
@@ -214,10 +223,15 @@ function serchCondition() {
 	})
 }
 function init() {
-	serchCondition();
+	startLoading();
+	setTimeout(() => {
+		serchCondition();
+	}, 1000)
+	endLoading();
 }
 
 // 初始化
 init();
+provide('init', init);
 </script>
 <style scoped></style>