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