rht
This commit is contained in:
parent
e5317e15b1
commit
7d97ab11a2
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 (
|
||||
<>
|
||||
|
|
|
@ -3,7 +3,7 @@ import { DailyMsgFormLayout } from "./dailyMsgForm/DailyMsgFormLayout";
|
|||
|
||||
export default function DailyLayout(){
|
||||
return (
|
||||
<div className="w-full h-full bg-slate-400">
|
||||
<div className="w-full h-[calc(100vh-100px)]">
|
||||
<DailyMsgFormLayout></DailyMsgFormLayout>
|
||||
<DailyMsgDisplayLayout></DailyMsgDisplayLayout>
|
||||
</div>
|
||||
|
|
|
@ -1,12 +1,73 @@
|
|||
import DailyPersonMsg from "../dailyMsgForm/DailyPersonMsg";
|
||||
import DailyTrainMsg from "../dailyMsgForm/DailyTrainMsg";
|
||||
import { useDaily } from "../DailyContext";
|
||||
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 {selectedUserMsg} = useDaily()
|
||||
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 (
|
||||
<div>
|
||||
<DailyPersonMsg selectedUserMsg={selectedUserMsg} />
|
||||
<DailyTrainMsg selectedUserMsg={selectedUserMsg} />
|
||||
<>
|
||||
<Button onClick={() => { setOpen(true) }}>创建计划</Button>
|
||||
<Modal
|
||||
open={open}
|
||||
onCancel={() => { setOpen(false) }}
|
||||
footer={null}
|
||||
centered={true}
|
||||
>
|
||||
<div className="p-6">
|
||||
<Form
|
||||
form={form}
|
||||
>
|
||||
<Form.Item name="trainDate" label="选择日期">
|
||||
<DatePicker picker="date" style={{ width: '100%' }} showNow={true} />
|
||||
</Form.Item>
|
||||
<Form.Item name="trainTime" label="选择时间">
|
||||
<TimePicker.RangePicker format="HH:mm" style={{ width: '100%' }} />
|
||||
</Form.Item>
|
||||
<Form.Item name="trainType" label="选择学科">
|
||||
<TreeSelect
|
||||
style={{ width: '100%' }}
|
||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||
treeData={treeData}
|
||||
placeholder="请选择学科或课程"
|
||||
treeDefaultExpandAll={false}
|
||||
//onChange={onChange}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item name="trainContent" label="填写内容">
|
||||
<TextArea rows={4} />
|
||||
</Form.Item>
|
||||
<Button type="primary" onClick={handleSave} style={{ width: '100%' }}>创建计划</Button>
|
||||
</Form>
|
||||
</div>
|
||||
</Modal>
|
||||
</>
|
||||
)
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
export default function DailyPersonMsg({selectedUserMsg}) {
|
||||
return (
|
||||
<div className="">
|
||||
<span>{selectedUserMsg?.showname ? selectedUserMsg?.showname : "暂无数据"}</span>
|
||||
<span>{selectedUserMsg?.age ? selectedUserMsg?.age : "暂无数据"}</span>
|
||||
<span>{selectedUserMsg?.sex ? selectedUserMsg?.sex : "暂无数据"}</span>
|
||||
<span>{selectedUserMsg?.absent ? selectedUserMsg?.absent : "暂无数据"}</span>
|
||||
<span>{selectedUserMsg?.department?.name ? selectedUserMsg?.department?.name : "暂无数据"}</span>
|
||||
<span>{selectedUserMsg?.position?.type ? selectedUserMsg?.position?.type : "暂无数据"}</span>
|
||||
<span>{selectedUserMsg?.avatar ? selectedUserMsg?.avatar : "暂无数据"}</span>
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
export default function DailyTrainMsg({selectedUserMsg}) {
|
||||
return (
|
||||
<div>
|
||||
<span>每日培训消息</span>
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -46,14 +46,14 @@ export const routes: CustomRouteObject[] = [
|
|||
children: [
|
||||
{
|
||||
index: true,
|
||||
element: <HomePage></HomePage>,
|
||||
element:<StaffMessage></StaffMessage>,
|
||||
},
|
||||
{
|
||||
path: "/staff",
|
||||
element: <StaffMessage></StaffMessage>,
|
||||
},
|
||||
{
|
||||
path:"/daily",
|
||||
path:"/plan",
|
||||
element:<DailyPage></DailyPage>
|
||||
}
|
||||
],
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue