From 7d97ab11a2714c7fee03e20e238d2bb5754e8f77 Mon Sep 17 00:00:00 2001
From: Rao <1227431568@qq.com>
Date: Wed, 12 Mar 2025 16:34:43 +0800
Subject: [PATCH] rht
---
apps/server/src/tasks/init/gendev.service.ts | 6 +-
.../src/app/main/layout/NavigationMenu.tsx | 7 +-
.../components/models/daily/DailyLayout.tsx | 2 +-
.../dailyMsgDisplay/DailyMsgDisplayLayout.tsx | 79 ++++++++++++++++---
.../daily/dailyMsgForm/DailyPersonMsg.tsx | 13 ---
.../daily/dailyMsgForm/DailyTrainMsg.tsx | 7 --
apps/web/src/routes/index.tsx | 4 +-
packages/common/prisma/schema.prisma | 19 +++++
8 files changed, 98 insertions(+), 39 deletions(-)
delete mode 100644 apps/web/src/components/models/daily/dailyMsgForm/DailyPersonMsg.tsx
delete mode 100644 apps/web/src/components/models/daily/dailyMsgForm/DailyTrainMsg.tsx
diff --git a/apps/server/src/tasks/init/gendev.service.ts b/apps/server/src/tasks/init/gendev.service.ts
index 2e8111e..3700965 100755
--- a/apps/server/src/tasks/init/gendev.service.ts
+++ b/apps/server/src/tasks/init/gendev.service.ts
@@ -49,11 +49,11 @@ export class GenDevService {
try {
await this.calculateCounts();
await this.generateDepartments(3, 6);
- //await this.generateTerms(2, 6);
await this.generateStaffs(4);
+ //await this.generateTerms(2, 6);
//await this.generateCourses(8);
- await this.generateTrainContent(2,6)
- await this.generateTrainSituations()
+ //await this.generateTrainContent(2,6)
+ //await this.generateTrainSituations()
} catch (err) {
this.logger.error(err);
}
diff --git a/apps/web/src/app/main/layout/NavigationMenu.tsx b/apps/web/src/app/main/layout/NavigationMenu.tsx
index b836594..1cd78c5 100644
--- a/apps/web/src/app/main/layout/NavigationMenu.tsx
+++ b/apps/web/src/app/main/layout/NavigationMenu.tsx
@@ -7,11 +7,10 @@ export default function NavigationMenu() {
console.log(location.pathname);
// 导航菜单项配置
const menuItems = [
- { key: 'home', label: '首页', path: '/' },
{ key: 'staff', label: '人员总览', path: '/staff' },
- { key: 'day', label: '日统计', path: '/daily' },
- { key: 'month', label: '月统计', path: '/month' },
- { key: 'year', label: '年度统计', path: '/year' }
+ { key: 'plan', label: '培训计划', path: '/plan' },
+ { key: 'day', label: '每日填报', path: '/daily' },
+ { key: 'exam', label: '考核成绩', path: '/exam' },
];
return (
<>
diff --git a/apps/web/src/components/models/daily/DailyLayout.tsx b/apps/web/src/components/models/daily/DailyLayout.tsx
index 6d7ab8e..38d88e6 100644
--- a/apps/web/src/components/models/daily/DailyLayout.tsx
+++ b/apps/web/src/components/models/daily/DailyLayout.tsx
@@ -3,7 +3,7 @@ import { DailyMsgFormLayout } from "./dailyMsgForm/DailyMsgFormLayout";
export default function DailyLayout(){
return (
-
+
diff --git a/apps/web/src/components/models/daily/dailyMsgDisplay/DailyMsgDisplayLayout.tsx b/apps/web/src/components/models/daily/dailyMsgDisplay/DailyMsgDisplayLayout.tsx
index 7357e23..3439a11 100644
--- a/apps/web/src/components/models/daily/dailyMsgDisplay/DailyMsgDisplayLayout.tsx
+++ b/apps/web/src/components/models/daily/dailyMsgDisplay/DailyMsgDisplayLayout.tsx
@@ -1,12 +1,73 @@
-import DailyPersonMsg from "../dailyMsgForm/DailyPersonMsg";
-import DailyTrainMsg from "../dailyMsgForm/DailyTrainMsg";
-import { useDaily } from "../DailyContext";
-export default function DailyMsgDisplayLayout(){
- const {selectedUserMsg} = useDaily()
+import { Button, DatePicker, Form, Modal, TimePicker, TreeSelect } from "antd";
+import TextArea from "antd/es/input/TextArea";
+import dayjs from "dayjs";
+import { useState } from "react";
+export default function DailyMsgDisplayLayout() {
+ const [form] = Form.useForm()
+ const [open, setOpen] = useState(true)
+ const treeData = [
+ {
+ title: 'Node1',
+ value: '0-0',
+ children: [
+ {
+ title: 'Child Node1',
+ value: '0-0-1',
+ },
+ {
+ title: 'Child Node2',
+ value: '0-0-2',
+ },
+ ],
+ },
+ {
+ title: 'Node2',
+ value: '0-1',
+ },
+ ];
+ const handleSave = () => {
+ //console.log(form.getFieldsValue())
+ const { trainDate, trainTime, trainType, trainContent } = form.getFieldsValue()
+ const trainDateStr = dayjs(trainDate).format('YYYY-MM-DD')
+ const trainTimeBegin = dayjs(trainTime[0]).format('HH:mm')
+ const trainTimeEnd = dayjs(trainTime[1]).format('HH:mm')
+ }
return (
-
-
-
-
+ <>
+
+
{ setOpen(false) }}
+ footer={null}
+ centered={true}
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
)
}
\ No newline at end of file
diff --git a/apps/web/src/components/models/daily/dailyMsgForm/DailyPersonMsg.tsx b/apps/web/src/components/models/daily/dailyMsgForm/DailyPersonMsg.tsx
deleted file mode 100644
index 961ecc7..0000000
--- a/apps/web/src/components/models/daily/dailyMsgForm/DailyPersonMsg.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-export default function DailyPersonMsg({selectedUserMsg}) {
- return (
-
- {selectedUserMsg?.showname ? selectedUserMsg?.showname : "暂无数据"}
- {selectedUserMsg?.age ? selectedUserMsg?.age : "暂无数据"}
- {selectedUserMsg?.sex ? selectedUserMsg?.sex : "暂无数据"}
- {selectedUserMsg?.absent ? selectedUserMsg?.absent : "暂无数据"}
- {selectedUserMsg?.department?.name ? selectedUserMsg?.department?.name : "暂无数据"}
- {selectedUserMsg?.position?.type ? selectedUserMsg?.position?.type : "暂无数据"}
- {selectedUserMsg?.avatar ? selectedUserMsg?.avatar : "暂无数据"}
-
- )
-}
\ No newline at end of file
diff --git a/apps/web/src/components/models/daily/dailyMsgForm/DailyTrainMsg.tsx b/apps/web/src/components/models/daily/dailyMsgForm/DailyTrainMsg.tsx
deleted file mode 100644
index 927d727..0000000
--- a/apps/web/src/components/models/daily/dailyMsgForm/DailyTrainMsg.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-export default function DailyTrainMsg({selectedUserMsg}) {
- return (
-
- 每日培训消息
-
- )
-}
\ No newline at end of file
diff --git a/apps/web/src/routes/index.tsx b/apps/web/src/routes/index.tsx
index 326bc27..625e052 100755
--- a/apps/web/src/routes/index.tsx
+++ b/apps/web/src/routes/index.tsx
@@ -46,14 +46,14 @@ export const routes: CustomRouteObject[] = [
children: [
{
index: true,
- element:
,
+ element:
,
},
{
path: "/staff",
element:
,
},
{
- path:"/daily",
+ path:"/plan",
element:
}
],
diff --git a/packages/common/prisma/schema.prisma b/packages/common/prisma/schema.prisma
index 8d8a97e..d924dae 100755
--- a/packages/common/prisma/schema.prisma
+++ b/packages/common/prisma/schema.prisma
@@ -340,6 +340,8 @@ model TrainContent {
id String @id @default(cuid())
title String @map("title")
trainSituations TrainSituation[]
+ trainPlans TrainPlan[] @relation("TrainPlanContent")
+
type String @map("type")
parentId String? @map("parent_id")
parent TrainContent? @relation("ContentParent", fields: [parentId], references: [id]) // 指向自身
@@ -463,3 +465,20 @@ model Staff {
@@index([order])
@@map("staff")
}
+
+model TrainPlan {
+ id String @id @default(cuid())
+
+ trainDate DateTime @map("train_date")
+ trainTime DateTime @map("train_time")
+ trainType String @map("train_type")
+ trainContext String @map("train_context")
+
+ trainContents TrainContent[] @relation("TrainPlanContent")
+
+ createdAt DateTime @default(now()) @map("created_at")
+ updatedAt DateTime @updatedAt @map("updated_at")
+ deletedAt DateTime? @map("deleted_at")
+
+ @@map("train_plan")
+}