Commit 10337167 authored by wuhao's avatar wuhao 🎯

daer

parent adbe0ad2
...@@ -104,6 +104,11 @@ export default [ ...@@ -104,6 +104,11 @@ export default [
path: "/work/dolessons/:id", path: "/work/dolessons/:id",
component: "./dolessons", component: "./dolessons",
}, },
{
name: "备课",
path: "/work/dobustrain/:id",
component: "./dobustrain",
},
], ],
}, },
{ {
......
...@@ -8,7 +8,7 @@ function ImportExcel() { ...@@ -8,7 +8,7 @@ function ImportExcel() {
return ( return (
<> <>
<Stack direction={"row"} gap={1}> <Stack direction={"row"}>
<Button <Button
variant="outlined" variant="outlined"
onClick={() => { onClick={() => {
......
...@@ -155,6 +155,7 @@ const EditTable = (props) => { ...@@ -155,6 +155,7 @@ const EditTable = (props) => {
}} }}
search={{ search={{
filterType: 'light', //轻量模式 filterType: 'light', //轻量模式
placement:"bottomLeft"
}} }}
/> />
); );
......
...@@ -19,10 +19,10 @@ import AccessTimeFilledIcon from "@mui/icons-material/AccessTimeFilled"; ...@@ -19,10 +19,10 @@ import AccessTimeFilledIcon from "@mui/icons-material/AccessTimeFilled";
import CheckIcon from "@mui/icons-material/Check"; import CheckIcon from "@mui/icons-material/Check";
import DeleteIcon from "@mui/icons-material/Delete"; import DeleteIcon from "@mui/icons-material/Delete";
import EditIcon from "@mui/icons-material/Edit"; import EditIcon from "@mui/icons-material/Edit";
import GroupIcon from "@mui/icons-material/Group";
import { history } from "@umijs/max"; import { history } from "@umijs/max";
import { Progress } from "antd"; import { Progress } from "antd";
import dayjs from "dayjs"; import dayjs from "dayjs";
import GroupIcon from '@mui/icons-material/Group';
import { useState } from "react"; import { useState } from "react";
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
...@@ -60,7 +60,6 @@ export default function ShopProductCard({ ...@@ -60,7 +60,6 @@ export default function ShopProductCard({
studentNum, studentNum,
totalSubmitExperimentNum, totalSubmitExperimentNum,
totalExperimentNum, totalExperimentNum,
} = product; } = product;
const [confirm, setconfirm] = useState(false); const [confirm, setconfirm] = useState(false);
...@@ -174,7 +173,7 @@ export default function ShopProductCard({ ...@@ -174,7 +173,7 @@ export default function ShopProductCard({
></GroupIcon> ></GroupIcon>
</IconButton> </IconButton>
</Tooltip> </Tooltip>
<Tooltip title={"成绩管理"}> <Tooltip title={"成绩管理"}>
<IconButton <IconButton
onClick={() => { onClick={() => {
...@@ -276,7 +275,7 @@ export default function ShopProductCard({ ...@@ -276,7 +275,7 @@ export default function ShopProductCard({
direction={"row"} direction={"row"}
alignItems={"center"} alignItems={"center"}
onClick={() => { onClick={() => {
history.push("/work/dolessons/" + product.id); history.push("/work/dobustrain/" + product.id);
}} }}
sx={{ cursor: "pointer" }} sx={{ cursor: "pointer" }}
> >
...@@ -306,10 +305,10 @@ export default function ShopProductCard({ ...@@ -306,10 +305,10 @@ export default function ShopProductCard({
<Stack <Stack
direction={"row"} direction={"row"}
alignItems={"center"} alignItems={"center"}
sx={{ cursor: "pointer" }}
onClick={() => { onClick={() => {
history.push("/work/dolessons/" + product.id); authorized(product);
}} }}
sx={{ cursor: "pointer" }}
> >
<IconFont <IconFont
type="icon-shouquanguanli" type="icon-shouquanguanli"
......
...@@ -178,7 +178,7 @@ function TreeRender({ ...@@ -178,7 +178,7 @@ function TreeRender({
}} }}
> >
<span style={{ marginRight: 6 }}>{title}</span> <span style={{ marginRight: 6 }}>{title}</span>
<div className="center" style={{gap:8}}> <div className="center" style={{ gap: 8 }}>
{item.key && item.key != "00000000" && ( {item.key && item.key != "00000000" && (
<Tooltip <Tooltip
title="编辑" title="编辑"
...@@ -239,7 +239,6 @@ function TreeRender({ ...@@ -239,7 +239,6 @@ function TreeRender({
okText="删除" okText="删除"
cancelText="取消" cancelText="取消"
onConfirm={() => { onConfirm={() => {
console.log(111);
doFetch({ url: deleteurl, params: { id: item.key } }).then( doFetch({ url: deleteurl, params: { id: item.key } }).then(
(res) => { (res) => {
if (res.code == "0000") { if (res.code == "0000") {
...@@ -250,12 +249,9 @@ function TreeRender({ ...@@ -250,12 +249,9 @@ function TreeRender({
); );
}} }}
> >
<Tooltip title="删除"> <Tooltip title="删除" placement="bottom">
<div className="bgs"> <div className="bgs">
<HorizontalRuleIcon <HorizontalRuleIcon
onClick={(e) => {
e.stopPropagation();
}}
style={{ color: "red", fontSize: 16 }} style={{ color: "red", fontSize: 16 }}
/> />
</div> </div>
......
This diff is collapsed.
...@@ -59,25 +59,17 @@ function Lessons() { ...@@ -59,25 +59,17 @@ function Lessons() {
}); });
}; };
const copy = (row) => {
setdialogprops({
open: true,
defaultFormValue: { ...row },
title: "复制创建",
});
};
const authorized = (row) => { const authorized = (row) => {
doFetch({ doFetch({
url: "/busTrainTeacher/queryRelationTeacher", url: "/trainStudent/queryRelationStudent",
params: { courseId: row?.id }, params: { trainId: row?.id },
}).then((res) => { }).then((res) => {
if (res.code === "0000") { if (res.code === "0000") {
setdialogprops({ setdialogprops({
open: true, open: true,
maxWidth: "xl", maxWidth: "xl",
defaultFormValue: { ...row }, defaultFormValue: { ...row },
teacherIdList: res?.data?.dataList, studentIdList: res?.data?.dataList,
title: "授权", title: "授权",
}); });
} }
...@@ -146,9 +138,7 @@ function Lessons() { ...@@ -146,9 +138,7 @@ function Lessons() {
dialogprops={dialogprops} dialogprops={dialogprops}
maxWidth={dialogprops?.maxWidth ?? "xs"} maxWidth={dialogprops?.maxWidth ?? "xs"}
> >
{dialogprops?.title === "编辑" || {dialogprops?.title === "编辑" || dialogprops?.title === "新增实训" ? (
dialogprops?.title === "新增实训" ||
dialogprops?.title === "复制创建" ? (
<InitForm <InitForm
fields={columns} fields={columns}
defaultFormValue={dialogprops?.defaultFormValue} defaultFormValue={dialogprops?.defaultFormValue}
...@@ -183,13 +173,6 @@ function Lessons() { ...@@ -183,13 +173,6 @@ function Lessons() {
id: dialogprops?.defaultFormValue?.id, id: dialogprops?.defaultFormValue?.id,
}; };
break; break;
case "复制创建":
url = "/busTrain/copy";
postdata = {
...val,
id: dialogprops?.defaultFormValue?.id,
};
break;
default: default:
break; break;
} }
...@@ -202,14 +185,14 @@ function Lessons() { ...@@ -202,14 +185,14 @@ function Lessons() {
) : ( ) : (
<InitForm <InitForm
defaultFormValue={{ defaultFormValue={{
teacherIdList: dialogprops?.teacherIdList, studentIdList: dialogprops?.studentIdList,
}} }}
fields={[ fields={[
{ {
rowKey: "id", rowKey: "id",
rowName: "id", rowName: "id",
valueType: "FormSelectList", valueType: "FormSelectList",
dataIndex: "teacherIdList", dataIndex: "studentIdList",
colProps: { colProps: {
span: 24, span: 24,
}, },
...@@ -218,40 +201,48 @@ function Lessons() { ...@@ -218,40 +201,48 @@ function Lessons() {
title: "账号", title: "账号",
key: "userAccount", key: "userAccount",
dataIndex: "userAccount", dataIndex: "userAccount",
readonly: true, editable: false,
}, },
{ {
title: "教师姓名", title: "学生姓名",
key: "name", key: "name",
dataIndex: "name", dataIndex: "name",
readonly: true, editable: false,
}, },
{ {
title: "学校名称", title: "学校名称",
key: "schoolName", key: "schoolId",
dataIndex: "schoolName", dataIndex: "schoolName",
readonly: true, valueType: "select",
search: false,
editable: false,
}, },
{ {
title: "院系名称", title: "院系名称",
key: "departmentName", key: "departmentName",
dataIndex: "departmentName", dataIndex: "departmentName",
readonly: true, editable: false,
},
{
title: "班级名称",
key: "className",
dataIndex: "className",
editable: false,
}, },
], ],
path: "/user/page", path: "/user/getAllStudentByCurrentTeacherSchool",
params: { params: {
type: "2", type: "3",
}, },
}, },
]} ]}
onFinish={(val) => { onFinish={(val) => {
const teacherIdList = val?.teacherIdList?.map((it) => it?.id); const studentIdList = val?.studentIdList?.map((it) => it?.id);
runAsync({ runAsync({
url: "/busTrainTeacher/relationCourseTeacher", url: "/trainStudent/relationTrainStudent",
params: { params: {
teacherIdList, studentIdList,
courseId: dialogprops?.defaultFormValue?.id, trainId: dialogprops?.defaultFormValue?.id,
}, },
}); });
}} }}
...@@ -291,7 +282,15 @@ function Lessons() { ...@@ -291,7 +282,15 @@ function Lessons() {
{datalist?.loading && !datalist?.data ? ( {datalist?.loading && !datalist?.data ? (
PRODUCTS?.map((product, i) => { PRODUCTS?.map((product, i) => {
return ( 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} /> <ShopProductLoadingCard product={product} />
</Grid> </Grid>
); );
...@@ -307,7 +306,6 @@ function Lessons() { ...@@ -307,7 +306,6 @@ function Lessons() {
product={product} product={product}
loading={datalist?.loading} loading={datalist?.loading}
edit={edit} edit={edit}
copy={copy}
remove={remove} remove={remove}
publish={publish} publish={publish}
authorized={authorized} 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"; ...@@ -7,8 +7,11 @@ import ShopProductLoadingCard from "@/components/ProductCard/loading";
import { doFetch } from "@/utils/doFetch"; import { doFetch } from "@/utils/doFetch";
import PRODUCTS from "@/_mock/products"; import PRODUCTS from "@/_mock/products";
import { Box, Container, Grid, Stack, Typography } from "@mui/material"; 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 { useRequest } from "ahooks";
import { Empty, message } from "antd"; import { Empty, Input, message } from "antd";
import { useMemo, useState } from "react"; import { useMemo, useState } from "react";
import "./index.less"; import "./index.less";
...@@ -19,7 +22,7 @@ function Lessons() { ...@@ -19,7 +22,7 @@ function Lessons() {
const [params, setparams] = useState({ const [params, setparams] = useState({
courseName: "", courseName: "",
status: null, status: null,
type: null, typeList: ["1", "2", "3"],
}); });
const handleClose = () => { const handleClose = () => {
...@@ -47,6 +50,7 @@ function Lessons() { ...@@ -47,6 +50,7 @@ function Lessons() {
}, },
{ {
debounceWait: 400, debounceWait: 400,
refreshDeps:[params]
} }
); );
...@@ -184,25 +188,25 @@ function Lessons() { ...@@ -184,25 +188,25 @@ function Lessons() {
title: "账号", title: "账号",
key: "userAccount", key: "userAccount",
dataIndex: "userAccount", dataIndex: "userAccount",
readonly: true, editable: false,
}, },
{ {
title: "教师姓名", title: "教师姓名",
key: "name", key: "name",
dataIndex: "name", dataIndex: "name",
readonly: true, editable: false,
}, },
{ {
title: "学校名称", title: "学校名称",
key: "schoolName", key: "schoolName",
dataIndex: "schoolName", dataIndex: "schoolName",
readonly: true, editable: false,
}, },
{ {
title: "院系名称", title: "院系名称",
key: "departmentName", key: "departmentName",
dataIndex: "departmentName", dataIndex: "departmentName",
readonly: true, editable: false,
}, },
], ],
path: "/user/page", path: "/user/page",
...@@ -232,8 +236,91 @@ function Lessons() { ...@@ -232,8 +236,91 @@ function Lessons() {
mt={0} mt={0}
> >
<Typography variant="h5">课程管理</Typography> <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> <ImportExcel></ImportExcel>
<PremButton <PremButton
btn={{ btn={{
variant: "contained", variant: "contained",
...@@ -257,7 +344,15 @@ function Lessons() { ...@@ -257,7 +344,15 @@ function Lessons() {
{datalist?.loading && !datalist?.data ? ( {datalist?.loading && !datalist?.data ? (
PRODUCTS?.map((product, i) => { PRODUCTS?.map((product, i) => {
return ( 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} /> <ShopProductLoadingCard product={product} />
</Grid> </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