Commit 10337167 authored by wuhao's avatar wuhao 🎯

daer

parent adbe0ad2
......@@ -104,6 +104,11 @@ export default [
path: "/work/dolessons/:id",
component: "./dolessons",
},
{
name: "备课",
path: "/work/dobustrain/:id",
component: "./dobustrain",
},
],
},
{
......
......@@ -8,7 +8,7 @@ function ImportExcel() {
return (
<>
<Stack direction={"row"} gap={1}>
<Stack direction={"row"}>
<Button
variant="outlined"
onClick={() => {
......
......@@ -155,6 +155,7 @@ const EditTable = (props) => {
}}
search={{
filterType: 'light', //轻量模式
placement:"bottomLeft"
}}
/>
);
......
......@@ -19,10 +19,10 @@ import AccessTimeFilledIcon from "@mui/icons-material/AccessTimeFilled";
import CheckIcon from "@mui/icons-material/Check";
import DeleteIcon from "@mui/icons-material/Delete";
import EditIcon from "@mui/icons-material/Edit";
import GroupIcon from "@mui/icons-material/Group";
import { history } from "@umijs/max";
import { Progress } from "antd";
import dayjs from "dayjs";
import GroupIcon from '@mui/icons-material/Group';
import { useState } from "react";
// ----------------------------------------------------------------------
......@@ -60,7 +60,6 @@ export default function ShopProductCard({
studentNum,
totalSubmitExperimentNum,
totalExperimentNum,
} = product;
const [confirm, setconfirm] = useState(false);
......@@ -174,7 +173,7 @@ export default function ShopProductCard({
></GroupIcon>
</IconButton>
</Tooltip>
<Tooltip title={"成绩管理"}>
<IconButton
onClick={() => {
......@@ -276,7 +275,7 @@ export default function ShopProductCard({
direction={"row"}
alignItems={"center"}
onClick={() => {
history.push("/work/dolessons/" + product.id);
history.push("/work/dobustrain/" + product.id);
}}
sx={{ cursor: "pointer" }}
>
......@@ -306,10 +305,10 @@ export default function ShopProductCard({
<Stack
direction={"row"}
alignItems={"center"}
sx={{ cursor: "pointer" }}
onClick={() => {
history.push("/work/dolessons/" + product.id);
authorized(product);
}}
sx={{ cursor: "pointer" }}
>
<IconFont
type="icon-shouquanguanli"
......
......@@ -178,7 +178,7 @@ function TreeRender({
}}
>
<span style={{ marginRight: 6 }}>{title}</span>
<div className="center" style={{gap:8}}>
<div className="center" style={{ gap: 8 }}>
{item.key && item.key != "00000000" && (
<Tooltip
title="编辑"
......@@ -239,7 +239,6 @@ function TreeRender({
okText="删除"
cancelText="取消"
onConfirm={() => {
console.log(111);
doFetch({ url: deleteurl, params: { id: item.key } }).then(
(res) => {
if (res.code == "0000") {
......@@ -250,12 +249,9 @@ function TreeRender({
);
}}
>
<Tooltip title="删除">
<Tooltip title="删除" placement="bottom">
<div className="bgs">
<HorizontalRuleIcon
onClick={(e) => {
e.stopPropagation();
}}
style={{ color: "red", fontSize: 16 }}
/>
</div>
......
This diff is collapsed.
......@@ -59,25 +59,17 @@ function Lessons() {
});
};
const copy = (row) => {
setdialogprops({
open: true,
defaultFormValue: { ...row },
title: "复制创建",
});
};
const authorized = (row) => {
doFetch({
url: "/busTrainTeacher/queryRelationTeacher",
params: { courseId: row?.id },
url: "/trainStudent/queryRelationStudent",
params: { trainId: row?.id },
}).then((res) => {
if (res.code === "0000") {
setdialogprops({
open: true,
maxWidth: "xl",
defaultFormValue: { ...row },
teacherIdList: res?.data?.dataList,
studentIdList: res?.data?.dataList,
title: "授权",
});
}
......@@ -146,9 +138,7 @@ function Lessons() {
dialogprops={dialogprops}
maxWidth={dialogprops?.maxWidth ?? "xs"}
>
{dialogprops?.title === "编辑" ||
dialogprops?.title === "新增实训" ||
dialogprops?.title === "复制创建" ? (
{dialogprops?.title === "编辑" || dialogprops?.title === "新增实训" ? (
<InitForm
fields={columns}
defaultFormValue={dialogprops?.defaultFormValue}
......@@ -183,13 +173,6 @@ function Lessons() {
id: dialogprops?.defaultFormValue?.id,
};
break;
case "复制创建":
url = "/busTrain/copy";
postdata = {
...val,
id: dialogprops?.defaultFormValue?.id,
};
break;
default:
break;
}
......@@ -202,14 +185,14 @@ function Lessons() {
) : (
<InitForm
defaultFormValue={{
teacherIdList: dialogprops?.teacherIdList,
studentIdList: dialogprops?.studentIdList,
}}
fields={[
{
rowKey: "id",
rowName: "id",
valueType: "FormSelectList",
dataIndex: "teacherIdList",
dataIndex: "studentIdList",
colProps: {
span: 24,
},
......@@ -218,40 +201,48 @@ function Lessons() {
title: "账号",
key: "userAccount",
dataIndex: "userAccount",
readonly: true,
editable: false,
},
{
title: "教师姓名",
title: "学生姓名",
key: "name",
dataIndex: "name",
readonly: true,
editable: false,
},
{
title: "学校名称",
key: "schoolName",
key: "schoolId",
dataIndex: "schoolName",
readonly: true,
valueType: "select",
search: false,
editable: false,
},
{
title: "院系名称",
key: "departmentName",
dataIndex: "departmentName",
readonly: true,
editable: false,
},
{
title: "班级名称",
key: "className",
dataIndex: "className",
editable: false,
},
],
path: "/user/page",
path: "/user/getAllStudentByCurrentTeacherSchool",
params: {
type: "2",
type: "3",
},
},
]}
onFinish={(val) => {
const teacherIdList = val?.teacherIdList?.map((it) => it?.id);
const studentIdList = val?.studentIdList?.map((it) => it?.id);
runAsync({
url: "/busTrainTeacher/relationCourseTeacher",
url: "/trainStudent/relationTrainStudent",
params: {
teacherIdList,
courseId: dialogprops?.defaultFormValue?.id,
studentIdList,
trainId: dialogprops?.defaultFormValue?.id,
},
});
}}
......@@ -291,7 +282,15 @@ function Lessons() {
{datalist?.loading && !datalist?.data ? (
PRODUCTS?.map((product, i) => {
return (
<Grid key={product.id} item xs={12} sm={6} md={4} lg={3} xl={2.4}>
<Grid
key={product.id}
item
xs={12}
sm={6}
md={4}
lg={3}
xl={2.4}
>
<ShopProductLoadingCard product={product} />
</Grid>
);
......@@ -307,7 +306,6 @@ function Lessons() {
product={product}
loading={datalist?.loading}
edit={edit}
copy={copy}
remove={remove}
publish={publish}
authorized={authorized}
......
This diff is collapsed.
.white {
.ant-pro-card {
background-color: #f6f6f6 !important;
}
.ant-table-tbody,td {
background-color: #f9f9f9 !important;
}
}
.ant-tree{
background-color: transparent !important;
}
\ No newline at end of file
......@@ -7,8 +7,11 @@ import ShopProductLoadingCard from "@/components/ProductCard/loading";
import { doFetch } from "@/utils/doFetch";
import PRODUCTS from "@/_mock/products";
import { Box, Container, Grid, Stack, Typography } from "@mui/material";
import Checkbox from "@mui/material/Checkbox";
import FormControlLabel from "@mui/material/FormControlLabel";
import FormGroup from "@mui/material/FormGroup";
import { useRequest } from "ahooks";
import { Empty, message } from "antd";
import { Empty, Input, message } from "antd";
import { useMemo, useState } from "react";
import "./index.less";
......@@ -19,7 +22,7 @@ function Lessons() {
const [params, setparams] = useState({
courseName: "",
status: null,
type: null,
typeList: ["1", "2", "3"],
});
const handleClose = () => {
......@@ -47,6 +50,7 @@ function Lessons() {
},
{
debounceWait: 400,
refreshDeps:[params]
}
);
......@@ -184,25 +188,25 @@ function Lessons() {
title: "账号",
key: "userAccount",
dataIndex: "userAccount",
readonly: true,
editable: false,
},
{
title: "教师姓名",
key: "name",
dataIndex: "name",
readonly: true,
editable: false,
},
{
title: "学校名称",
key: "schoolName",
dataIndex: "schoolName",
readonly: true,
editable: false,
},
{
title: "院系名称",
key: "departmentName",
dataIndex: "departmentName",
readonly: true,
editable: false,
},
],
path: "/user/page",
......@@ -232,8 +236,91 @@ function Lessons() {
mt={0}
>
<Typography variant="h5">课程管理</Typography>
<Stack spacing={2} direction="row">
<Stack spacing={2} direction="row" flex={1} justifyContent={"flex-end"}>
<FormControlLabel
control={
<Checkbox
checked={params?.typeList?.length === 3}
indeterminate={
params?.typeList?.length > 0 && params?.typeList?.length < 3
}
/>
}
label="全部"
onChange={(e) => {
setparams((s) => {
let news = [];
if (e.target.checked) {
news = ["1", "2", "3"];
}
return {
...s,
typeList: news,
};
});
}}
/>
<FormGroup
row
value={params?.typeList ?? []}
onChange={(e) => {
let val = e.target.value;
setparams((s) => {
let news = [...s?.typeList];
if (news.includes(val)) {
news = news.filter((it) => it !== val);
} else {
news = [...news, val];
}
console.log(news);
return {
...s,
typeList: news,
};
});
}}
>
<FormControlLabel
control={
<Checkbox
checked={params?.typeList?.includes("1")}
color={"warning"}
/>
}
label="待发布"
value={1}
/>
<FormControlLabel
control={
<Checkbox
checked={params?.typeList?.includes("2")}
color={"info"}
/>
}
label="已发布"
value={2}
/>
<FormControlLabel
control={
<Checkbox
checked={params?.typeList?.includes("3")}
color={"default"}
/>
}
label="已关闭"
value={3}
/>
</FormGroup>
<Input placeholder="请输入课程名称" style={{ width: 200 }} value={params?.courseName} onChange={(e)=>{
setparams(s=>({
...s,
courseName:e.target.value
}))
}}></Input>
<ImportExcel></ImportExcel>
<PremButton
btn={{
variant: "contained",
......@@ -257,7 +344,15 @@ function Lessons() {
{datalist?.loading && !datalist?.data ? (
PRODUCTS?.map((product, i) => {
return (
<Grid key={product.id} item xs={12} sm={6} md={4} lg={3} xl={2.4}>
<Grid
key={product.id}
item
xs={12}
sm={6}
md={4}
lg={3}
xl={2.4}
>
<ShopProductLoadingCard product={product} />
</Grid>
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment