Commit afae7f5c authored by wuhao's avatar wuhao 🎯

asder

parent 5b2b8918
Pipeline #3582 passed with stages
in 2 minutes and 47 seconds
...@@ -23,7 +23,7 @@ import EditIcon from "@mui/icons-material/Edit"; ...@@ -23,7 +23,7 @@ import EditIcon from "@mui/icons-material/Edit";
import GroupIcon from "@mui/icons-material/Group"; import GroupIcon from "@mui/icons-material/Group";
import PauseIcon from "@mui/icons-material/Pause"; import PauseIcon from "@mui/icons-material/Pause";
import { history, useModel } from "@umijs/max"; import { history, useModel } from "@umijs/max";
import { Badge, Progress } from "antd"; import { Progress } from "antd";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
...@@ -88,357 +88,370 @@ export default function ShopProductCard({ ...@@ -88,357 +88,370 @@ export default function ShopProductCard({
})); }));
}, [TEACH_TRAIN_MANAGE_LIST]); }, [TEACH_TRAIN_MANAGE_LIST]);
return ( let num = Numcount?.[id] ?? unReadMsgCount;
<Badge count={Numcount?.[id] ?? unReadMsgCount} offset={[-10, 10]}>
<Card sx={{ borderRadius: 3 }} className="hovered" id="jikl">
<Box sx={{ pt: "66%", position: "relative" }} className="center">
{typeName && (
<Label
variant="filled"
color={
(type === 1 && "warning") ||
(type === 2 && "info") ||
(type === 3 && "default") ||
"error"
}
sx={{
zIndex: 9,
top: 20,
left: 20,
position: "absolute", return (
textTransform: "uppercase", <Card sx={{ borderRadius: 3 }} className="hovered" id="jikl">
}} <div
> style={{
{typeName} width: 24,
</Label> height: 24,
)} backgroundColor: "#ff4800",
<StyledProductImg position: "absolute",
alt={trainName} right: 6,
src={picUrl ?? DEFAULT_404_IMG} top: 6,
sx={{ borderRadius: 2 }} zIndex: 999,
/> borderRadius: 30,
color: "#fff",
fontSize: 12,
display: !num ? "none" : "flex",
}}
className="center"
>
{num > 100 ? "99+" : num}
</div>
<Box sx={{ pt: "66%", position: "relative" }} className="center">
{typeName && (
<Label
variant="filled"
color={
(type === 1 && "warning") ||
(type === 2 && "info") ||
(type === 3 && "default") ||
"error"
}
sx={{
zIndex: 9,
top: 20,
left: 20,
<Box position: "absolute",
className="actionhover" textTransform: "uppercase",
sx={{ borderRadius: 2, overflow: "hidden" }} }}
> >
<Box className="masker"></Box> {typeName}
{ifs && ( </Label>
<Box className="edit"> )}
<Tooltip placement="bottom-start" title="编辑"> <StyledProductImg
<IconButton alt={trainName}
onClick={() => { src={picUrl ?? DEFAULT_404_IMG}
edit(product); sx={{ borderRadius: 2 }}
}} />
> <Box
<EditIcon className="actionhover"
style={{ fontSize: 20, color: colors.blue[200] }} sx={{ borderRadius: 2, overflow: "hidden" }}
></EditIcon> >
</IconButton> <Box className="masker"></Box>
</Tooltip> {ifs && (
<Box className="edit">
<Tooltip <Tooltip placement="bottom-start" title="编辑">
placement="bottom-start"
title={confirm ? "确认删除" : "删除"}
>
{confirm ? (
<IconButton
disabled={confirm === "1"}
onClick={() => {
remove(product);
}}
sx={{ marginLeft: 2 }}
>
<CheckIcon
style={{
fontSize: 20,
color:
confirm === "1"
? colors.grey[500]
: colors.green[500],
}}
></CheckIcon>
</IconButton>
) : (
<IconButton
onClick={() => {
setconfirm("1");
setTimeout(() => {
setconfirm(true);
}, 200);
setTimeout(() => {
setconfirm(false);
}, 3000);
}}
>
<DeleteIcon
style={{ fontSize: 20, color: colors.red[500] }}
></DeleteIcon>
</IconButton>
)}
</Tooltip>
</Box>
)}
<Stack
direction="row"
alignItems="center"
justifyContent="space-between"
width={"100%"}
className="stackani"
padding={"0px 12px"}
>
<Tooltip placement="bottom-start" title={"协作教师"}>
<IconButton <IconButton
onClick={() => { onClick={() => {
tauthorized(product, ifs); edit(product);
}} }}
> >
<GroupIcon <EditIcon
style={{ style={{ fontSize: 20, color: colors.blue[200] }}
fontSize: 24, ></EditIcon>
color: "#fff",
}}
></GroupIcon>
</IconButton> </IconButton>
</Tooltip> </Tooltip>
<Tooltip placement="bottom-start" title={"成绩管理"}> <Tooltip
<IconButton placement="bottom-start"
onClick={() => { title={confirm ? "确认删除" : "删除"}
history.push("/work/rebustrain/" + product.id); >
}} {confirm ? (
> <IconButton
<IconFont disabled={confirm === "1"}
type="icon-chengjidan" onClick={() => {
style={{ remove(product);
fontSize: 20,
color: "#fff",
}} }}
></IconFont> sx={{ marginLeft: 2 }}
</IconButton> >
<CheckIcon
style={{
fontSize: 20,
color:
confirm === "1"
? colors.grey[500]
: colors.green[500],
}}
></CheckIcon>
</IconButton>
) : (
<IconButton
onClick={() => {
setconfirm("1");
setTimeout(() => {
setconfirm(true);
}, 200);
setTimeout(() => {
setconfirm(false);
}, 3000);
}}
>
<DeleteIcon
style={{ fontSize: 20, color: colors.red[500] }}
></DeleteIcon>
</IconButton>
)}
</Tooltip> </Tooltip>
</Stack> </Box>
</Box> )}
</Box>
<Stack spacing={1} sx={{ p: 2 }}>
<Stack <Stack
direction={"row"} direction="row"
justifyContent={"space-between"} alignItems="center"
justifyContent="space-between"
width={"100%"} width={"100%"}
overflow={"hidden"} className="stackani"
alignItems={"center"} padding={"0px 12px"}
> >
<div className="center"> <Tooltip placement="bottom-start" title={"协作教师"}>
<Progress <IconButton
type="circle" onClick={() => {
size={20} tauthorized(product, ifs);
percent={
(totalSubmitExperimentNum * 100) / (totalExperimentNum ?? 1)
}
strokeColor={{
"0%": "#00c6fb",
"100%": "#005bea",
}} }}
/> >
<Tooltip placement="bottom-start" title={trainName}> <GroupIcon
<Typography style={{
variant="subtitle2" fontSize: 24,
noWrap color: "#fff",
sx={{
paddingLeft: 1,
}} }}
> ></GroupIcon>
{trainName} </IconButton>
</Typography> </Tooltip>
</Tooltip>
</div>
<Box width={60} textAlign={"right"} flexShrink={0}> <Tooltip placement="bottom-start" title={"成绩管理"}>
<Tooltip placement="bottom-start" title={createTime}> <IconButton
<Typography onClick={() => {
component="span" history.push("/work/rebustrain/" + product.id);
variant="body2" }}
sx={{ >
color: "text.disabled", <IconFont
type="icon-chengjidan"
style={{
fontSize: 20,
color: "#fff",
}} }}
> ></IconFont>
{difftime(dayjs(), dayjs(createTime))} </IconButton>
</Typography> </Tooltip>
</Tooltip>
</Box>
</Stack> </Stack>
</Box>
</Box>
<Stack spacing={1} sx={{ p: 2 }}>
<Stack
direction={"row"}
justifyContent={"space-between"}
width={"100%"}
overflow={"hidden"}
alignItems={"center"}
>
<div className="center">
<Progress
type="circle"
size={20}
percent={
(totalSubmitExperimentNum * 100) / (totalExperimentNum ?? 1)
}
strokeColor={{
"0%": "#00c6fb",
"100%": "#005bea",
}}
/>
<Tooltip placement="bottom-start" title={trainName}>
<Typography
variant="subtitle2"
noWrap
sx={{
paddingLeft: 1,
}}
>
{trainName}
</Typography>
</Tooltip>
</div>
<Stack <Box width={60} textAlign={"right"} flexShrink={0}>
direction={"row"} <Tooltip placement="bottom-start" title={createTime}>
justifyContent={"space-between"}
width={"100%"}
overflow={"hidden"}
alignItems={"center"}
>
<Stack direction={"row"} alignItems={"center"}>
<AccessTimeFilledIcon
sx={{ color: colors.grey[800], fontSize: 20 }}
/>
<Typography <Typography
component="span" component="span"
variant="body2" variant="body2"
sx={{ sx={{
paddingLeft: 1, color: "text.disabled",
}} }}
> >
{startTime ?? "-"}~{deadline} {difftime(dayjs(), dayjs(createTime))}
</Typography> </Typography>
</Stack> </Tooltip>
</Box>
</Stack>
<Stack
direction={"row"}
justifyContent={"space-between"}
width={"100%"}
overflow={"hidden"}
alignItems={"center"}
>
<Stack direction={"row"} alignItems={"center"}>
<AccessTimeFilledIcon
sx={{ color: colors.grey[800], fontSize: 20 }}
/>
<Typography
component="span"
variant="body2"
sx={{
paddingLeft: 1,
}}
>
{startTime ?? "-"}~{deadline}
</Typography>
</Stack> </Stack>
</Stack>
<Stack <Stack
direction={"row"} direction={"row"}
justifyContent={"space-between"} justifyContent={"space-between"}
alignItems={"center"} alignItems={"center"}
padding={"0 2px"} padding={"0 2px"}
> >
<Stack direction={"row"} spacing={2} alignItems={"center"}> <Stack direction={"row"} spacing={2} alignItems={"center"}>
<Tooltip placement="bottom-start" title="备课"> <Tooltip placement="bottom-start" title="备课">
<Stack <Stack
direction={"row"} direction={"row"}
alignItems={"center"} alignItems={"center"}
onClick={() => { onClick={() => {
history.push("/work/dobustrain/" + product.id); history.push("/work/dobustrain/" + product.id);
}}
sx={{ cursor: "pointer" }}
>
<IconFont
type="icon-beike"
style={{ fontSize: 16, opacity: 0.6 }}
></IconFont>
<Typography
component="span"
variant="body2"
sx={{
color: "text.disabled",
paddingLeft: 1.2,
fontSize: 12,
margin: 0,
}} }}
sx={{ cursor: "pointer" }}
> >
<IconFont {sectionNum}课时/{experimentNum}实验
type="icon-beike" </Typography>
style={{ fontSize: 16, opacity: 0.6 }} </Stack>
></IconFont> </Tooltip>
<Typography
component="span"
variant="body2"
sx={{
color: "text.disabled",
paddingLeft: 1.2,
fontSize: 12,
margin: 0,
}}
>
{sectionNum}课时/{experimentNum}实验
</Typography>
</Stack>
</Tooltip>
<Tooltip placement="bottom-start" title="授权"> <Tooltip placement="bottom-start" title="授权">
<Stack <Stack
direction={"row"} direction={"row"}
alignItems={"center"} alignItems={"center"}
sx={{ cursor: "pointer" }} sx={{ cursor: "pointer" }}
onClick={() => { onClick={() => {
authorized(product, ifs); authorized(product, ifs);
}}
>
<IconFont
type="icon-shouquanguanli"
style={{ fontSize: 16, color: "#999" }}
></IconFont>
<Typography
component="a"
variant="body2"
sx={{
color: "text.disabled",
paddingLeft: 1.2,
fontSize: 12,
margin: 0,
}} }}
> >
{studentNum}学生
</Typography>
</Stack>
</Tooltip>
</Stack>
<Stack direction={"row"} spacing={0}>
<Tooltip placement="bottom-start" title={ifs ? "发布" : "暂停发布"}>
<IconButton
style={{
opacity: type !== 5 && type !== 4 ? 1 : 0,
pointerEvents: type === 5 || type === 4 ? "none" : "auto",
}}
onClick={() => {
if (type === 5 || type === 4) return;
if (ifs) {
publish(product, { type: 2 });
} else {
publish(product, { type: 3 });
}
}}
>
{ifs ? (
<IconFont <IconFont
type="icon-shouquanguanli" type="icon-fabu"
style={{ fontSize: 16, color: "#999" }} style={{ fontSize: 20, color: colors.blue[600] }}
></IconFont> ></IconFont>
<Typography ) : (
component="a" <PauseIcon
variant="body2" style={{ fontSize: 20, color: colors.grey[900] }}
sx={{ ></PauseIcon>
color: "text.disabled", )}
paddingLeft: 1.2, </IconButton>
fontSize: 12, </Tooltip>
margin: 0,
}}
>
{studentNum}学生
</Typography>
</Stack>
</Tooltip>
</Stack>
<Stack direction={"row"} spacing={0}> {type === 3 && (
<Tooltip <Tooltip
placement="bottom-start" placement="bottom-start"
title={ifs ? "发布" : "暂停发布"} title={shut ? "确认关闭" : "关闭"}
> >
<IconButton {shut ? (
style={{ <IconButton
opacity: type !== 5 && type !== 4 ? 1 : 0, disabled={shut === "1"}
pointerEvents: type === 5 || type === 4 ? "none" : "auto", onClick={() => {
}} publish(product, { type: 5 });
onClick={() => { }}
if (type === 5 || type === 4) return; >
if (ifs) { <CheckIcon
publish(product, { type: 2 }); style={{
} else { fontSize: 20,
publish(product, { type: 3 }); color:
} shut === "1" ? colors.grey[500] : colors.green[500],
}}
>
{ifs ? (
<IconFont
type="icon-fabu"
style={{ fontSize: 20, color: colors.blue[600] }}
></IconFont>
) : (
<PauseIcon
style={{ fontSize: 20, color: colors.grey[900] }}
></PauseIcon>
)}
</IconButton>
</Tooltip>
{type === 3 && (
<Tooltip
placement="bottom-start"
title={shut ? "确认关闭" : "关闭"}
>
{shut ? (
<IconButton
disabled={shut === "1"}
onClick={() => {
publish(product, { type: 5 });
}} }}
> ></CheckIcon>
<CheckIcon </IconButton>
style={{ ) : (
fontSize: 20, <IconButton
color: onClick={() => {
shut === "1" ? colors.grey[500] : colors.green[500], setshut("1");
}}
></CheckIcon>
</IconButton>
) : (
<IconButton
onClick={() => {
setshut("1");
setTimeout(() => { setTimeout(() => {
setshut(true); setshut(true);
}, 200); }, 200);
setTimeout(() => { setTimeout(() => {
setshut(false); setshut(false);
}, 3000); }, 3000);
}} }}
> >
<CloseIcon <CloseIcon
type="icon-guanbi" type="icon-guanbi"
style={{ fontSize: 20, color: "#ff4800" }} style={{ fontSize: 20, color: "#ff4800" }}
></CloseIcon> ></CloseIcon>
</IconButton> </IconButton>
)} )}
</Tooltip> </Tooltip>
)} )}
</Stack>
</Stack> </Stack>
</Stack> </Stack>
</Card> </Stack>
</Badge> </Card>
); );
} }
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