Commit 92de224c authored by wuhao's avatar wuhao 🎯

config +pages

parent d5318684
Pipeline #3304 failed with stages
in 2 minutes and 31 seconds
...@@ -8,7 +8,9 @@ export default { ...@@ -8,7 +8,9 @@ export default {
"DEFAULT_404_IMG":"./assets/illustrations/illustration_404.svg" "DEFAULT_404_IMG":"./assets/illustrations/illustration_404.svg"
}, },
test:{ test:{
"REACT_APP_URL":"http://118.25.178.150:7001" "REACT_APP_URL":"/vstp",
"DEFAULT_HEAD_IMG":"./assets/images/avatars/avatar_21.jpg",
"DEFAULT_404_IMG":"./assets/illustrations/illustration_404.svg"
}, },
prod:{ prod:{
"REACT_APP_URL":"http://tasks.nangaoyun.com" "REACT_APP_URL":"http://tasks.nangaoyun.com"
......
...@@ -23,10 +23,10 @@ export default { ...@@ -23,10 +23,10 @@ export default {
*/ */
test: { test: {
// localhost:8000/api/** -> https://preview.pro.ant.design/api/** // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
"/api/": { "/vstp/": {
target: "https://proapi.azurewebsites.net", target: "http://192.168.40.117:8044/vstp",
changeOrigin: true, changeOrigin: true,
pathRewrite: { "^": "" }, pathRewrite: { "^/vstp": "" },
}, },
}, },
pre: { pre: {
......
...@@ -109,6 +109,11 @@ export default [ ...@@ -109,6 +109,11 @@ export default [
path: "/work/dobustrain/:id", path: "/work/dobustrain/:id",
component: "./dobustrain", component: "./dobustrain",
}, },
{
name: "课程详情",
path: "/work/domybustrain/:id",
component: "./domybustrain",
},
{ {
name: "成绩管理", name: "成绩管理",
path: "/work/rebustrain/:id", path: "/work/rebustrain/:id",
...@@ -129,6 +134,11 @@ export default [ ...@@ -129,6 +134,11 @@ export default [
path: "/work/checkhomework", path: "/work/checkhomework",
component: "./checkhomework", component: "./checkhomework",
}, },
{
name: "成绩单",
path: "/work/myrecord",
component: "./myrecord",
},
], ],
}, },
{ {
......
import PropTypes from "prop-types";
// @mui
import {
Box,
Card,
colors,
IconButton,
Stack,
Tooltip,
Typography,
} from "@mui/material";
import { styled } from "@mui/material/styles";
// utils
// components
import IconFont from "@/components/IconFont";
import Label from "@/components/label";
import difftime from "@/utils/difftime";
import AccessTimeFilledIcon from "@mui/icons-material/AccessTimeFilled";
import CheckIcon from "@mui/icons-material/Check";
import dayjs from "dayjs";
import { useState } from "react";
import { history } from "@umijs/max";
// ----------------------------------------------------------------------
const StyledProductImg = styled("img")({
top: 0,
width: "92%",
height: "92%",
marginTop: "4%",
objectFit: "cover",
position: "absolute",
});
ShopProductCard.propTypes = {
product: PropTypes.object,
};
export default function ShopProductCard({
product,
remove,
edit,
copy,
publish,
authorized,
tauthorized,
}) {
const {
trainName,
picUrl,
createTime,
typeName,
type,
deadline,
sectionNum,
experimentNum,
studentNum,
startTime,
totalSubmitExperimentNum,
totalExperimentNum,
} = product;
const [confirm, setconfirm] = useState(false);
const [shut, setshut] = useState(false);
const ifs = type === 1 || type === 3;
return (
<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",
textTransform: "uppercase",
}}
>
{typeName}
</Label>
)}
<StyledProductImg
alt={trainName}
src={picUrl ?? DEFAULT_404_IMG}
sx={{ borderRadius: 2 }}
/>
</Box>
<Stack spacing={1} sx={{ p: 2 }}>
<Stack
direction={"row"}
justifyContent={"space-between"}
width={"100%"}
overflow={"hidden"}
alignItems={"center"}
>
<div className="center">
<Tooltip placement="bottom-start" title={trainName}>
<Typography
variant="subtitle2"
noWrap
sx={{
paddingLeft: 0,
}}
>
{trainName}
</Typography>
</Tooltip>
</div>
<Box width={60} textAlign={"right"} flexShrink={0}>
<Tooltip placement="bottom-start" title={createTime}>
<Typography
component="span"
variant="body2"
sx={{
color: "text.disabled",
}}
>
{difftime(dayjs(), dayjs(createTime))}
</Typography>
</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
direction={"row"}
justifyContent={"space-between"}
alignItems={"center"}
padding={"0 2px"}
>
<Stack direction={"row"} spacing={2} alignItems={"center"}>
<Stack
direction={"row"}
alignItems={"center"}
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,
}}
>
{sectionNum}课时/{experimentNum}实验
</Typography>
</Stack>
</Stack>
<Stack direction={"row"} spacing={0}>
<Tooltip placement="bottom-start" title={"发布"}>
<IconButton
onClick={() => {
history.push("/work/domybustrain/" + product.id);
}}
>
<IconFont
type="icon-fabu"
style={{ fontSize: 20, color: colors.blue[600] }}
></IconFont>
</IconButton>
</Tooltip>
<Tooltip
placement="bottom-start"
title={"成绩"}
>
<IconButton
disabled={shut === "1"}
onClick={() => {
}}
>
<CheckIcon
style={{
fontSize: 20,
color: shut === "1" ? colors.grey[500] : colors.green[500],
}}
></CheckIcon>
</IconButton>
</Tooltip>
</Stack>
</Stack>
</Stack>
</Card>
);
}
...@@ -61,6 +61,7 @@ export default function ShopProductCard({ ...@@ -61,6 +61,7 @@ export default function ShopProductCard({
sectionNum, sectionNum,
experimentNum, experimentNum,
studentNum, studentNum,
startTime,
totalSubmitExperimentNum, totalSubmitExperimentNum,
totalExperimentNum, totalExperimentNum,
} = product; } = product;
...@@ -269,7 +270,7 @@ export default function ShopProductCard({ ...@@ -269,7 +270,7 @@ export default function ShopProductCard({
paddingLeft: 1, paddingLeft: 1,
}} }}
> >
截止日期: {deadline} 日期: {startTime ?? "-"} {deadline}
</Typography> </Typography>
</Stack> </Stack>
</Stack> </Stack>
......
...@@ -46,7 +46,7 @@ const navConfig = [ ...@@ -46,7 +46,7 @@ const navConfig = [
}, },
{ {
title: "我的成绩", title: "我的成绩",
path: "/work/home", path: "/work/myrecord",
icon: icon("ic_grades"), icon: icon("ic_grades"),
info: ( info: (
<div <div
......
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
...@@ -3,7 +3,7 @@ import ImportExcel from "@/components/ImportExcel"; ...@@ -3,7 +3,7 @@ import ImportExcel from "@/components/ImportExcel";
import InitForm from "@/components/InitForm"; import InitForm from "@/components/InitForm";
import PremButton from "@/components/PremButton"; import PremButton from "@/components/PremButton";
import ShopProductLoadingCard from "@/components/ProductCard/loading"; import ShopProductLoadingCard from "@/components/ProductCard/loading";
import ShopProductCard from "@/components/ProductCard/sxcard"; import ShopProductCard from "@/components/ProductCard/stucard";
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";
...@@ -47,7 +47,7 @@ function Lessons() { ...@@ -47,7 +47,7 @@ function Lessons() {
const datalist = useRequest( const datalist = useRequest(
async () => { async () => {
let res = await doFetch({ url: "/busTrain/list", params }); let res = await doFetch({ url: "/studentTrain/queryTrainList", params });
return res?.data?.dataList; return res?.data?.dataList;
}, },
{ {
......
import AutoTable from "@/components/AutoTable";
import { Box, Container, Stack, Typography } from "@mui/material";
import { useMemo, useRef } from "react";
import "./index.less";
function Record() {
const actionRef = useRef();
const columns = useMemo(() => {
let res = [
{ title: "课程名称", dataIndex: "courseName", key: "courseName" },
{ title: "实训名称", dataIndex: "trainName", key: "trainName" },
{ title: "实验名称", dataIndex: "experimentName", key: "experimentName" },
{
title: "分数",
dataIndex: "scoreWeight",
key: "scoreWeight",
hideInSearch: true,
},
{
title: "提交时间",
dataIndex: "finishTime",
key: "finishTimeRange",
valueType: "dateTimeRange",
},
{
title: "批阅时间",
dataIndex: "reviewTime",
key: "reviewTimeRange",
valueType: "dateTimeRange",
},
{
title: "批阅状态",
dataIndex: "reviewTypeName",
key: "reviewType",
valueType: "select",
options: [
{ label: "待批阅", value: "1" },
{ label: "已批阅", value: "2" },
],
},
];
return res;
}, []);
return (
<Container maxWidth={false}>
<Stack direction={"row"} mb={2}>
<Typography variant="h5">成绩单</Typography>
</Stack>
<Box boxShadow={"0 0 18px #f0f0f0"} borderRadius={2}>
<AutoTable
actionRef={actionRef}
scroll={{ x: 1366 }}
columns={[...columns]}
path={"/studentExperiment/queryPageByLoginStudent"}
></AutoTable>
</Box>
</Container>
);
}
export default Record;
.white {
.ant-pro-card {
background-color: #f6f6f6 !important;
}
.ant-table-tbody,td {
background-color: #f9f9f9 !important;
}
}
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