Commit 20b3b2d6 authored by wuhao's avatar wuhao 🎯

asd

parent 5f960191
Pipeline #3269 failed with stages
in 2 minutes and 12 seconds
...@@ -124,7 +124,11 @@ export default [ ...@@ -124,7 +124,11 @@ export default [
path: "/work/record", path: "/work/record",
component: "./record", component: "./record",
}, },
{
name: "成绩单",
path: "/work/checkhomework",
component: "./checkhomework",
},
], ],
}, },
{ {
......
...@@ -37,7 +37,8 @@ const AutoTable = (props) => { ...@@ -37,7 +37,8 @@ const AutoTable = (props) => {
x, //横向滚动 x, //横向滚动
resizeable = false, resizeable = false,
rerendered = true, rerendered = true,
onValuesChange = ()=>{} onValuesChange = () => {},
dataSource = null,
} = props; } = props;
const actionRefs = actionRef ?? useRef(), const actionRefs = actionRef ?? useRef(),
...@@ -84,7 +85,7 @@ const AutoTable = (props) => { ...@@ -84,7 +85,7 @@ const AutoTable = (props) => {
useEffect(() => { useEffect(() => {
setcolumnes((s) => { setcolumnes((s) => {
return s return columns
.filter((it) => it.valueType != "split") .filter((it) => it.valueType != "split")
.map((item, index) => { .map((item, index) => {
let it = { ...item }, let it = { ...item },
...@@ -177,7 +178,7 @@ const AutoTable = (props) => { ...@@ -177,7 +178,7 @@ const AutoTable = (props) => {
}; };
}); });
}); });
}, [paramconfig]); }, [paramconfig, columns]);
//调用重新渲染表格 //调用重新渲染表格
useAsyncEffect(async () => { useAsyncEffect(async () => {
rerendered && actionRefs?.current?.reload(); rerendered && actionRefs?.current?.reload();
...@@ -236,10 +237,20 @@ const AutoTable = (props) => { ...@@ -236,10 +237,20 @@ const AutoTable = (props) => {
} }
: {}; : {};
const dataparams = dataSource
? {
dataSource,
}
: {
request,
};
return ( return (
<ProTable <ProTable
{...props} {...props}
{...components} {...components}
{...dataparams}
size={size} size={size}
form={{ form={{
onValuesChange: (changedValues, values) => { onValuesChange: (changedValues, values) => {
...@@ -274,10 +285,11 @@ const AutoTable = (props) => { ...@@ -274,10 +285,11 @@ const AutoTable = (props) => {
[resetkey]: newparams, [resetkey]: newparams,
})); }));
} }
onValuesChange?.(changedValues, values) onValuesChange?.(changedValues, values);
}, },
}} }}
onSubmit={(params) => { onSubmit={(params) => {
console.log(params);
// formRef?.current? // formRef?.current?
}} }}
onSizeChange={(size) => { onSizeChange={(size) => {
...@@ -290,7 +302,6 @@ const AutoTable = (props) => { ...@@ -290,7 +302,6 @@ const AutoTable = (props) => {
formRef={formRefs} formRef={formRefs}
rowKey={rowKey ?? "id"} //表格每行数据的key rowKey={rowKey ?? "id"} //表格每行数据的key
dateFormatter="string" dateFormatter="string"
request={request}
pagination={{ pagination={{
size: !ifspagination ? "default" : "small", size: !ifspagination ? "default" : "small",
showTotal: (total, range) => <span>{total}</span>, showTotal: (total, range) => <span>{total}</span>,
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
position: relative; position: relative;
width: 100%; width: 100%;
margin-bottom: 20px; margin-bottom: 20px;
padding-left: 4px; padding-left: 16px;
color: #000000; color: #000000;
font-weight: bolder; font-weight: bolder;
font-size: 16px; font-size: 16px;
&::before { &::before {
position: absolute; position: absolute;
top: 4px; top: 4px;
left: -6px; left: 7px;
width: 3px; width: 3px;
height: 16px; height: 16px;
background-color: #13c2c2; background-color: #13c2c2;
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
position: absolute; position: absolute;
top: 14px; top: 14px;
right: 0px; right: 0px;
width: calc(100% - 100px); width: calc(100% - 160px);
height: 1px; height: 1px;
border-bottom: 1px dotted rgba(0, 0, 0, 0.1); border-bottom: 1px dotted rgba(0, 0, 0, 0.1);
border-radius: 4px; border-radius: 4px;
......
...@@ -555,12 +555,12 @@ h4 { ...@@ -555,12 +555,12 @@ h4 {
border-radius: 50%; border-radius: 50%;
} }
.diysearch{ .diysearch {
.ant-list{ .ant-list {
border-radius: 8px;
overflow: hidden; overflow: hidden;
border-radius: 8px;
} }
.ant-image-mask{ .ant-image-mask {
border-radius: 6px; border-radius: 6px;
} }
} }
...@@ -592,8 +592,8 @@ h4 { ...@@ -592,8 +592,8 @@ h4 {
opacity: 0; opacity: 0;
} }
.stackani { .stackani {
transform: translateY(80px);
margin-bottom: 8px; margin-bottom: 8px;
transform: translateY(80px);
} }
} }
...@@ -621,13 +621,13 @@ h4 { ...@@ -621,13 +621,13 @@ h4 {
} }
.selecttable { .selecttable {
.ant-pro-table-list-toolbar-container{ .ant-pro-table-list-toolbar-container {
margin-bottom: 24px!important; margin-bottom: 24px !important;
} }
.ant-pagination-options { .ant-pagination-options {
>div{ > div {
width: auto!important; width: auto !important;
} }
} }
} }
...@@ -645,7 +645,14 @@ h4 { ...@@ -645,7 +645,14 @@ h4 {
margin: auto; margin: auto;
background-color: #ff4800; background-color: #ff4800;
border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0;
content: ''; content: "";
} }
} }
} }
.ant-pro-core-dropdown-footer {
display: flex;
justify-content: flex-end;
> button:first-child {
display: none;
}
}
...@@ -21,7 +21,7 @@ const navConfig = [ ...@@ -21,7 +21,7 @@ const navConfig = [
}, },
{ {
title: "作业批阅", title: "作业批阅",
path: "/work/products", path: "/work/checkhomework",
icon: icon("ic_book"), icon: icon("ic_book"),
}, },
{ {
......
This diff is collapsed.
.white {
.ant-pro-card {
background-color: #f6f6f6 !important;
}
.ant-table-tbody,td {
background-color: #f9f9f9 !important;
}
}
...@@ -3,9 +3,13 @@ import ImportExcel from "@/components/ImportExcel"; ...@@ -3,9 +3,13 @@ import ImportExcel from "@/components/ImportExcel";
import { doFetch } from "@/utils/doFetch"; import { doFetch } from "@/utils/doFetch";
import { Box, Container, Stack, Typography } from "@mui/material"; import { Box, Container, Stack, Typography } from "@mui/material";
import { useRequest } from "ahooks"; import { useRequest } from "ahooks";
import { Select, Statistic } from "antd";
import { useMemo, useRef, useState } from "react"; import { useMemo, useRef, useState } from "react";
import CountUp from "react-countup";
import "./index.less"; import "./index.less";
const formatter = (value) => <CountUp end={value} separator="," decimals={2} />;
function Record() { function Record() {
const actionRef = useRef(); const actionRef = useRef();
const [params, setparams] = useState({}); const [params, setparams] = useState({});
...@@ -20,54 +24,105 @@ function Record() { ...@@ -20,54 +24,105 @@ function Record() {
}, },
{ {
debounceWait: 400, debounceWait: 400,
refreshDeps: [params],
} }
); );
const columns = useMemo(() => { const columns = useMemo(() => {
let arr = []; let arr = [];
if (data?.listDynamicField) { if (data?.listDynamicField) {
arr = data?.listDynamicField?.map((it, i) => { arr = data?.listDynamicField?.map((it, i) => {
return { return {
title: `${it?.experimentName}(${it?.weight}%)`, title: `${it?.experimentName}(${it?.weight}%)`,
dataIndex: it?.key, dataIndex: it?.key,
key: it?.key, key: it?.key,
search: false,
}; };
}); });
} }
let res = [
console.log(arr); { title: "姓名", dataIndex: "name", key: "studentName" },
{ title: "账号", dataIndex: "userAccount", key: "studentAccount" },
return [ { title: "班级名称", dataIndex: "className", key: "className" },
...arr,
{ title: "实训总分", dataIndex: "score", key: "score", search: false },
{ {
title: "实训", title: "排名",
dataIndex: "trainId", dataIndex: "sort",
key: "trainId", key: "sort",
valueType: "select", search: false,
hideInTable: true, sorter: {
options: { compare: (a, b) => a.sort - b.sort,
path: "/busTrain/loginTeacher/selection",
params: {},
}, },
}, },
{ title: "姓名", dataIndex: "name", key: "name" },
{ title: "账号", dataIndex: "userAccount", key: "userAccount" },
{ title: "班级名称", dataIndex: "className", key: "className" },
{ title: "实训总分", dataIndex: "score", key: "score" },
{ title: "排名", dataIndex: "sort", key: "sort" },
]; ];
return res;
}, [data]); }, [data]);
const options = useRequest(
async () => {
let res = await doFetch({
url: "/busTrain/loginTeacher/selection",
params: {},
});
return res?.data?.dataList;
},
{
debounceWait: 200,
}
);
return ( return (
<Container maxWidth={false}> <Container maxWidth={false}>
<Stack direction={"row"}>
<Typography variant="h5">成绩单</Typography>
<Select
options={options.data}
value={params?.trainId}
onChange={(val) => {
setparams((s) => ({
...s,
trainId: val,
}));
}}
style={{
width: 200,
marginLeft: 20,
}}
placeholder="请选择实训"
></Select>
</Stack>
<Box <Box
display={"flex"} display={"flex"}
justifyContent={"space-between"} justifyContent={"space-between"}
alignItems={"center"} alignItems={"center"}
sx={{ mb: 2.5 }} sx={{ mb: 2.5, mt: 2 }}
mt={0} mt={0}
> >
<Typography variant="h5">成绩单</Typography> <Box display={"flex"} alignItems={"flex-end"} gap={2}>
<Box sx={{ display: "flex", gap: 4 }}>
<Statistic
title="实训平均分"
value={data?.statistics?.average}
formatter={formatter}
/>
<Statistic
title="实训完成率"
value={data?.statistics?.finishPer}
formatter={formatter}
suffix="%"
/>
<Statistic
title="实训通过率"
value={data?.statistics?.passPer}
formatter={formatter}
suffix="%"
/>
</Box>
</Box>
<Stack spacing={2} direction="row"> <Stack spacing={2} direction="row">
<ImportExcel></ImportExcel> <ImportExcel></ImportExcel>
</Stack> </Stack>
...@@ -78,11 +133,13 @@ function Record() { ...@@ -78,11 +133,13 @@ function Record() {
actionRef={actionRef} actionRef={actionRef}
scroll={{ x: 1366 }} scroll={{ x: 1366 }}
columns={[...columns]} columns={[...columns]}
dataSource={data?.list} dataSource={data?.list ?? []}
onValuesChange={(changedValues, values) => { onValuesChange={(changedValues, values) => {
setparams(changedValues); setparams(s=>({
...values,
trainId:s.trainId
}));
}} }}
rerendered={false}
></AutoTable> ></AutoTable>
</Box> </Box>
</Container> </Container>
......
This diff is collapsed.
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