Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cs_vsofpm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wuhao
cs_vsofpm
Commits
7d873eb2
Commit
7d873eb2
authored
May 17, 2023
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prefix
parent
a73c1b4f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
108 additions
and
2 deletions
+108
-2
routes.ts
config/routes.ts
+5
-1
index.jsx
src/components/AutoTable/index.jsx
+2
-0
config.jsx
src/layouts/dashboard/nav/config.jsx
+1
-1
index.jsx
src/pages/record/index.jsx
+92
-0
index.less
src/pages/record/index.less
+8
-0
No files found.
config/routes.ts
View file @
7d873eb2
...
@@ -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"
,
},
],
],
},
},
...
...
src/components/AutoTable/index.jsx
View file @
7d873eb2
...
@@ -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
)
=>
{
...
...
src/layouts/dashboard/nav/config.jsx
View file @
7d873eb2
...
@@ -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"
),
},
},
{
{
...
...
src/pages/record/index.jsx
0 → 100644
View file @
7d873eb2
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;
src/pages/record/index.less
0 → 100644
View file @
7d873eb2
.white {
.ant-pro-card {
background-color: #f6f6f6 !important;
}
.ant-table-tbody,td {
background-color: #f9f9f9 !important;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment