Commit 7d873eb2 authored by wuhao's avatar wuhao 🎯

prefix

parent a73c1b4f
...@@ -119,7 +119,11 @@ export default [ ...@@ -119,7 +119,11 @@ export default [
path: "/work/mybustrain", path: "/work/mybustrain",
component: "./mybustrain", component: "./mybustrain",
}, },
{
name: "成绩单",
path: "/work/record",
component: "./record",
},
], ],
}, },
......
...@@ -37,6 +37,7 @@ const AutoTable = (props) => { ...@@ -37,6 +37,7 @@ const AutoTable = (props) => {
x, //横向滚动 x, //横向滚动
resizeable = false, resizeable = false,
rerendered = true, rerendered = true,
onValuesChange = ()=>{}
} = props; } = props;
const actionRefs = actionRef ?? useRef(), const actionRefs = actionRef ?? useRef(),
...@@ -273,6 +274,7 @@ const AutoTable = (props) => { ...@@ -273,6 +274,7 @@ const AutoTable = (props) => {
[resetkey]: newparams, [resetkey]: newparams,
})); }));
} }
onValuesChange?.(changedValues, values)
}, },
}} }}
onSubmit={(params) => { onSubmit={(params) => {
......
...@@ -26,7 +26,7 @@ const navConfig = [ ...@@ -26,7 +26,7 @@ const navConfig = [
}, },
{ {
title: "成绩单", title: "成绩单",
path: "/work/blog", path: "/work/record",
icon: icon("ic_grade"), icon: icon("ic_grade"),
}, },
{ {
......
import AutoTable from "@/components/AutoTable";
import ImportExcel from "@/components/ImportExcel";
import { doFetch } from "@/utils/doFetch";
import { Box, Container, Stack, Typography } from "@mui/material";
import { useRequest } from "ahooks";
import { useMemo, useRef, useState } from "react";
import "./index.less";
function Record() {
const actionRef = useRef();
const [params, setparams] = useState({});
const { runAsync, data, loading } = useRequest(
async () => {
let res = await doFetch({
url: "/studentExperiment/scoreReport",
params,
});
return res?.data?.data;
},
{
debounceWait: 400,
}
);
const columns = useMemo(() => {
let arr = [];
if (data?.listDynamicField) {
arr = data?.listDynamicField?.map((it, i) => {
return {
title: `${it?.experimentName}(${it?.weight}%)`,
dataIndex: it?.key,
key: it?.key,
};
});
}
console.log(arr);
return [
{
title: "实训",
dataIndex: "trainId",
key: "trainId",
valueType: "select",
hideInTable: true,
options: {
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" },
];
}, [data]);
return (
<Container maxWidth={false}>
<Box
display={"flex"}
justifyContent={"space-between"}
alignItems={"center"}
sx={{ mb: 2.5 }}
mt={0}
>
<Typography variant="h5">成绩单</Typography>
<Stack spacing={2} direction="row">
<ImportExcel></ImportExcel>
</Stack>
</Box>
<Box boxShadow={"0 0 18px #f0f0f0"} borderRadius={2}>
<AutoTable
actionRef={actionRef}
scroll={{ x: 1366 }}
columns={[...columns]}
dataSource={data?.list}
onValuesChange={(changedValues, values) => {
setparams(changedValues);
}}
rerendered={false}
></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