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
89a3da6b
Commit
89a3da6b
authored
Aug 15, 2023
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asder
parent
2067db83
Pipeline
#4232
failed with stages
in 3 minutes and 27 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
307 additions
and
238 deletions
+307
-238
index.jsx
src/pages/checkhomework/index.jsx
+84
-44
index.jsx
src/pages/lessons/index.jsx
+0
-3
index.jsx
src/pages/mybustrain/index.jsx
+0
-3
index.jsx
src/pages/rebustrain/index.jsx
+223
-188
No files found.
src/pages/checkhomework/index.jsx
View file @
89a3da6b
...
@@ -83,6 +83,32 @@ function Checkhomework() {
...
@@ -83,6 +83,32 @@ function Checkhomework() {
);
);
};
};
const
remove
=
(
text
,
row
,
_
)
=>
{
return
(
<
PremButton
pop=
{
{
disabled
:
row
?.
reviewType
!==
1
,
title
:
"是否退回该实训?"
,
okText
:
"确认"
,
cancelText
:
"取消"
,
onConfirm
:
async
()
=>
{
await
runAsync
({
url
:
"/studentExperiment/remake"
,
params
:
{
id
:
row
?.
id
},
});
},
}
}
btn=
{
{
disabled
:
row
?.
reviewType
!==
1
,
size
:
"small"
,
color
:
"error"
,
}
}
>
退回
</
PremButton
>
);
};
const
columns
=
useMemo
(
const
columns
=
useMemo
(
()
=>
[
()
=>
[
{
title
:
"学生姓名"
,
dataIndex
:
"studentName"
,
key
:
"studentName"
},
{
title
:
"学生姓名"
,
dataIndex
:
"studentName"
,
key
:
"studentName"
},
...
@@ -223,50 +249,64 @@ function Checkhomework() {
...
@@ -223,50 +249,64 @@ function Checkhomework() {
}
}
);
);
const
items
=
[
//全部数量
{
let
totaldata
=
useRequest
(
async
()
=>
{
key
:
"2"
,
let
res
=
await
doFetch
({
label
:
`已提交`
,
url
:
"/studentExperiment/queryCountByLoginTeacher"
,
children
:
(
params
:
{},
<
Box
boxShadow=
{
"0 0 18px #f0f0f0"
}
borderRadius=
{
2
}
>
});
<
AutoTable
return
res
?.
data
?.
data
;
actionRef=
{
actionRefs
}
},
{});
formRef=
{
formRefs
}
scroll=
{
{
x
:
1366
}
}
const
items
=
useMemo
(()
=>
{
columns=
{
[
return
[
...
columes
,
{
{
key
:
"2"
,
title
:
"操作"
,
label
:
`已提交
${
totaldata
?.
data
?.
submitNum
??
0
}
`,
valueType
:
"option"
,
children: (
width
:
88
,
<Box boxShadow={"0 0 18px #f0f0f0"} borderRadius={2}>
render
:
(
text
,
row
,
_
,
action
)
=>
[
audit
(
text
,
row
,
_
,
action
)],
<AutoTable
},
actionRef={actionRefs}
]
}
formRef={formRefs}
path=
"/studentExperiment/queryPageByLoginTeacher"
scroll={{ x: 1366 }}
rerendered=
{
false
}
columns={[
extraparams=
{
{
type
:
"2"
}
}
...columes,
></
AutoTable
>
{
</
Box
>
title: "操作",
),
valueType: "option",
},
width: 136,
{
render: (text, row, _, action) => [
key
:
"1"
,
audit(text, row, _, action),
label
:
`待提交`
,
remove(text, row, _, action)
children
:
(
],
<
Box
boxShadow=
{
"0 0 18px #f0f0f0"
}
borderRadius=
{
2
}
>
},
<
AutoTable
]}
actionRef=
{
actionRef
}
path="/studentExperiment/queryPageByLoginTeacher"
formRef=
{
formRef
}
rerendered={false}
scroll=
{
{
x
:
1366
}
}
extraparams={{ type: "2" }}
columns=
{
[...
columns
]
}
></AutoTable>
extraparams=
{
{
type
:
"1"
}
}
</Box>
path=
"/studentExperiment/queryPageByLoginTeacher"
),
rerendered=
{
false
}
},
></
AutoTable
>
{
</
Box
>
key: "1",
),
label: `
待提交
$
{
totaldata
?.
data
?.
notSubmitNum
??
0
}
`,
},
children: (
];
<Box boxShadow={"0 0 18px #f0f0f0"} borderRadius={2}>
<AutoTable
actionRef={actionRef}
formRef={formRef}
scroll={{ x: 1366 }}
columns={[...columns]}
extraparams={{ type: "1" }}
path="/studentExperiment/queryPageByLoginTeacher"
rerendered={false}
></AutoTable>
</Box>
),
},
];
}, [totaldata]);
return (
return (
<Container maxWidth={false}>
<Container maxWidth={false}>
...
...
src/pages/lessons/index.jsx
View file @
89a3da6b
...
@@ -6,9 +6,6 @@ import ShopProductLoadingCard from "@/components/ProductCard/loading";
...
@@ -6,9 +6,6 @@ import ShopProductLoadingCard from "@/components/ProductCard/loading";
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"
;
import
Checkbox
from
"@mui/material/Checkbox"
;
import
FormControlLabel
from
"@mui/material/FormControlLabel"
;
import
FormGroup
from
"@mui/material/FormGroup"
;
import
{
useRequest
}
from
"ahooks"
;
import
{
useRequest
}
from
"ahooks"
;
import
{
Empty
,
Input
,
message
,
Tabs
}
from
"antd"
;
import
{
Empty
,
Input
,
message
,
Tabs
}
from
"antd"
;
import
{
useMemo
,
useState
}
from
"react"
;
import
{
useMemo
,
useState
}
from
"react"
;
...
...
src/pages/mybustrain/index.jsx
View file @
89a3da6b
...
@@ -5,9 +5,6 @@ import ShopProductCard from "@/components/ProductCard/stucard";
...
@@ -5,9 +5,6 @@ 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"
;
import
Checkbox
from
"@mui/material/Checkbox"
;
import
FormControlLabel
from
"@mui/material/FormControlLabel"
;
import
FormGroup
from
"@mui/material/FormGroup"
;
import
{
useRequest
}
from
"ahooks"
;
import
{
useRequest
}
from
"ahooks"
;
import
{
Empty
,
Input
,
message
,
Tabs
}
from
"antd"
;
import
{
Empty
,
Input
,
message
,
Tabs
}
from
"antd"
;
import
{
useMemo
,
useState
}
from
"react"
;
import
{
useMemo
,
useState
}
from
"react"
;
...
...
src/pages/rebustrain/index.jsx
View file @
89a3da6b
...
@@ -2,27 +2,65 @@ import AutoTable from "@/components/AutoTable";
...
@@ -2,27 +2,65 @@ import AutoTable from "@/components/AutoTable";
import
DraggableDialog
from
"@/components/DraggableDialog"
;
import
DraggableDialog
from
"@/components/DraggableDialog"
;
import
InitForm
from
"@/components/InitForm"
;
import
InitForm
from
"@/components/InitForm"
;
import
PremButton
from
"@/components/PremButton"
;
import
PremButton
from
"@/components/PremButton"
;
import
SplitDesc
from
"@/components/SplitDesc"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
{
ProDescriptions
}
from
"@ant-design/pro-components"
;
import
{
Box
,
Container
,
Stack
,
Typography
}
from
"@mui/material"
;
import
{
Box
,
Container
,
Stack
,
Typography
}
from
"@mui/material"
;
import
{
useParams
}
from
"@umijs/max"
;
import
{
useParams
}
from
"@umijs/max"
;
import
{
useAsyncEffect
,
useRequest
}
from
"ahooks"
;
import
{
useAsyncEffect
,
useRequest
}
from
"ahooks"
;
import
{
message
,
Segmented
,
Tabs
}
from
"antd"
;
import
{
Divider
,
message
,
Segmented
,
Tabs
}
from
"antd"
;
import
{
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
{
useEffect
,
useMemo
,
use
Ref
,
use
State
}
from
"react"
;
import
{
history
}
from
"umi"
;
import
{
history
}
from
"umi"
;
import
"./index.less"
;
import
"./index.less"
;
function
Dolessons
()
{
function
Dolessons
()
{
const
params
=
useParams
();
const
params
=
useParams
();
const
formRefc
=
useRef
();
const
[
lessonDetail
,
setlessonDetail
]
=
useState
(
null
),
const
[
lessonDetail
,
setlessonDetail
]
=
useState
(
null
),
[
d
rawer
,
setDrawer
]
=
useState
({
[
d
ialogprops
,
setdialogprops
]
=
useState
({
open
:
false
,
open
:
false
,
}),
}),
[
type
,
settype
]
=
useState
(
"
1
"
),
[
type
,
settype
]
=
useState
(
"
2
"
),
[
active
,
setactive
]
=
useState
();
[
active
,
setactive
]
=
useState
();
const
[
datas
,
setdatas
]
=
useState
({
tabs
:
[],
});
let
blid
=
useRequest
(
async
()
=>
{
let
res
=
await
doFetch
({
url
:
"/studentExperiment/queryAllByLoginTeacher"
,
params
:
{
experimentId
:
active
},
});
return
res
?.
data
?.
dataList
;
},
{
refreshDeps
:
[
active
],
onSuccess
:
(
data
,
params
)
=>
{
setdatas
((
s
)
=>
({
...
s
,
tabs
:
data
?.
map
((
it
)
=>
({
...
it
,
label
:
it
?.
studentName
,
key
:
it
?.
id
,
})),
}));
if
(
dialogprops
?.
open
)
{
setdialogprops
({
open
:
true
,
defaultFormValue
:
{
...
data
[
0
]
},
title
:
"批阅"
,
});
}
formRefc
?.
current
?.
resetFields
();
},
}
);
const
{
runAsync
,
loading
}
=
useRequest
(
doFetch
,
{
const
{
runAsync
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
manual
:
true
,
onSuccess
:
(
res
,
parames
)
=>
{
onSuccess
:
(
res
)
=>
{
if
(
res
?.
code
==
"0000"
)
{
if
(
res
?.
code
==
"0000"
)
{
handleClose
();
handleClose
();
message
.
success
(
"操作成功"
);
message
.
success
(
"操作成功"
);
...
@@ -40,8 +78,6 @@ function Dolessons() {
...
@@ -40,8 +78,6 @@ function Dolessons() {
);
);
},
[]);
},
[]);
const
list
=
useRequest
(
const
list
=
useRequest
(
async
()
=>
{
async
()
=>
{
let
res
=
await
doFetch
({
let
res
=
await
doFetch
({
...
@@ -57,54 +93,67 @@ function Dolessons() {
...
@@ -57,54 +93,67 @@ function Dolessons() {
}
}
);
);
const
ifs
=
useMemo
(()
=>
{
const
audit
=
(
text
,
row
,
_
,
action
)
=>
{
let
{
type
}
=
lessonDetail
??
{};
return
row
.
reviewType
==
1
?
(
return
!
(
type
===
1
||
type
===
3
);
},
[
lessonDetail
]);
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
<
PremButton
btn=
{
{
btn=
{
{
size
:
"small"
,
size
:
"small"
,
disabled
:
ifs
,
variant
:
"text"
,
variant
:
"text"
,
onClick
:
()
=>
{
onClick
:
()
=>
{
set
Drawer
((
v
)
=>
({
set
dialogprops
({
open
:
true
,
open
:
true
,
defaultFormValue
:
{
...
row
},
defaultFormValue
:
{
...
row
},
title
:
"
编辑
"
,
title
:
"
批阅
"
,
})
)
;
});
},
},
}
}
}
}
>
>
编辑
批阅
</
PremButton
>
)
:
(
<
PremButton
btn=
{
{
size
:
"small"
,
variant
:
"text"
,
color
:
"inherit"
,
onClick
:
()
=>
{
setdialogprops
({
open
:
true
,
defaultFormValue
:
{
...
row
},
title
:
"详情"
,
maxWidth
:
"md"
,
footer
:
false
,
});
},
}
}
>
详情
</
PremButton
>
</
PremButton
>
);
);
};
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
const
remove
=
(
text
,
row
,
_
)
=>
{
return
(
return
(
<
PremButton
<
PremButton
pop=
{
{
pop=
{
{
disabled
:
ifs
,
disabled
:
row
?.
reviewType
!==
1
,
title
:
"是否
删除该实验
?"
,
title
:
"是否
退回该实训
?"
,
okText
:
"确认"
,
okText
:
"确认"
,
cancelText
:
"取消"
,
cancelText
:
"取消"
,
onConfirm
:
async
()
=>
{
onConfirm
:
async
()
=>
{
await
runAsync
({
await
runAsync
({
url
:
"/
busTrainExperiment/remov
e"
,
url
:
"/
studentExperiment/remak
e"
,
params
:
{
id
:
row
?.
id
},
params
:
{
id
:
row
?.
id
},
});
});
},
},
}
}
}
}
btn=
{
{
btn=
{
{
disabled
:
ifs
,
disabled
:
row
?.
reviewType
!==
1
,
size
:
"small"
,
size
:
"small"
,
color
:
"error"
,
color
:
"error"
,
}
}
}
}
>
>
删除
退回
</
PremButton
>
</
PremButton
>
);
);
};
};
...
@@ -147,7 +196,7 @@ function Dolessons() {
...
@@ -147,7 +196,7 @@ function Dolessons() {
},
[]);
},
[]);
const
items
=
useMemo
(()
=>
{
const
items
=
useMemo
(()
=>
{
return
list
?.
data
?.
map
((
it
,
i
)
=>
({
return
list
?.
data
?.
map
((
it
)
=>
({
key
:
it
?.
id
,
key
:
it
?.
id
,
label
:
it
?.
experimentName
,
label
:
it
?.
experimentName
,
children
:
(
children
:
(
...
@@ -161,7 +210,7 @@ function Dolessons() {
...
@@ -161,7 +210,7 @@ function Dolessons() {
valueType
:
"option"
,
valueType
:
"option"
,
width
:
180
,
width
:
180
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
render
:
(
text
,
row
,
_
,
action
)
=>
[
e
dit
(
text
,
row
,
_
,
action
),
au
dit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
],
],
},
},
...
@@ -177,20 +226,8 @@ function Dolessons() {
...
@@ -177,20 +226,8 @@ function Dolessons() {
}));
}));
},
[
list
]);
},
[
list
]);
const
addHandel
=
(
val
)
=>
{
if
(
active
===
"1"
)
{
// 预览
}
else
if
(
active
===
"2"
)
{
// 添加实验
setDrawer
({
open
:
true
,
title
:
"添加实验"
});
}
else
{
// 添加问题
setDrawer
({
open
:
true
,
title
:
"添加问题"
});
}
};
const
handleClose
=
()
=>
{
const
handleClose
=
()
=>
{
set
Drawer
((
s
)
=>
({
set
dialogprops
((
s
)
=>
({
...
s
,
...
s
,
open
:
false
,
open
:
false
,
}));
}));
...
@@ -205,170 +242,168 @@ function Dolessons() {
...
@@ -205,170 +242,168 @@ function Dolessons() {
});
});
let
resdata
=
res
?.
data
?.
data
;
let
resdata
=
res
?.
data
?.
data
;
setsemlist
([
setsemlist
([
{
value
:
"1"
,
label
:
`待提交(
${
resdata
?.
submitNum
})
`,
},
{
{
value
:
"2"
,
value
:
"2"
,
label
:
`已提交(
${
resdata
?.
notSubmitNum
})
`,
label
:
`已提交(
${
resdata
?.
notSubmitNum
})
`,
},
},
{
value: "1",
label: `
待提交
(
$
{
resdata
?.
submitNum
})
`,
},
]);
]);
}, [active]);
}, [active]);
const detailcolumns = [
{ title: "学生姓名", dataIndex: "studentName", key: "studentName" },
{ title: "学生账号", dataIndex: "studentAccount", key: "studentAccount" },
{ title: "课程名称", dataIndex: "courseName", key: "courseName" },
{ title: "实训名称", dataIndex: "trainName", key: "trainName" },
{ title: "实验名称", dataIndex: "experimentName", key: "experimentName" },
{ title: "分数", dataIndex: "score", key: "score", hideInSearch: true },
{ title: "权重", dataIndex: "weight", key: "weight", hideInSearch: true },
{ title: "分数", dataIndex: "scoreWeight", key: "scoreWeight" },
{
title: "提交时间",
dataIndex: "finishTime",
key: "finishTimeRange",
},
{
title: "批阅时间",
dataIndex: "reviewTime",
key: "reviewTimeRange",
},
];
return (
return (
<Container maxWidth={false}>
<Container maxWidth={false}>
<DraggableDialog
<DraggableDialog
handleClose={handleClose}
handleClose={() => {
dialogprops={drawer}
handleClose();
}}
loading={loading}
loading={loading}
maxWidth={drawer?.maxWidth ?? "sm"}
formRef={formRefc}
>
dialogprops={dialogprops}
{active === "2" ? (
maxWidth={dialogprops?.maxWidth ?? "sm"}
<InitForm
formdom={
defaultFormValue={drawer?.defaultFormValue ?? null}
dialogprops?.title === "批阅" && (
fields={[
<InitForm
{
fields={[
title: "实验",
{
dataIndex: "id",
title: "批阅信息",
key: "id",
dataIndex: "sort",
valueType: "select",
key: "sort",
options: {
valueType: "split",
path: "/busTrainExperiment/selection",
params: { trainId: params?.id },
},
},
formItemProps: {
{
rules: [
title: "打分",
{
dataIndex: "score",
required: true,
key: "score",
message: "此项为必填项",
colProps: { span: 24 },
},
valueType: "digit",
],
},
},
},
{
{
title: "评语",
title: "权重(%)",
dataIndex: "comment",
dataIndex: "weight",
key: "comment",
key: "weight",
valueType: "textarea",
valueType: "digit",
colProps: {
formItemProps: {
span: 24,
rules: [
},
{
required: true,
message: "此项为必填项",
},
],
},
},
{
title: "考试时间(分钟)",
dataIndex: "testTime",
key: "testTime",
valueType: "digit",
formItemProps: {
rules: [
{
required: true,
message: "此项为必填项",
},
],
},
},
{
title: "截止时间",
dataIndex: "deadline",
key: "deadline",
valueType: "date",
formItemProps: {
rules: [
{
required: true,
message: "此项为必填项",
},
],
},
},
},
]}
]}
defaultFormValue={{ examineResult: "1" }}
onFinish={(val, extra) => {
onFinish={async (val, extra) => {
let postdata;
let postdata = {
switch (drawer?.title) {
...val,
case "添加实验":
id: dialogprops?.defaultFormValue?.id,
postdata = {
};
...val,
await runAsync({
trainId: params?.id,
url: "/studentExperiment/giveScore",
};
params: postdata,
break;
case "编辑":
postdata = {
...val,
id: drawer?.defaultFormValue?.id,
trainId: params?.id,
};
default:
break;
}
runAsync({
url: "/busTrainExperiment/update",
params: postdata,
});
}}
onValuesChange={(curval, vals, formRef) => {
if (Object.keys(curval)[0] === "id") {
doFetch({
url: "/busTrainExperiment/detail",
params: { id: Object.values(curval)[0] },
}).then((res) => {
formRef?.current?.setFieldsValue({
weight: res?.data?.data?.weight,
});
});
});
}
await blid?.runAsync();
}}
}}
></InitForm>
></InitForm>
) : (
)
<InitForm
}
defaultFormValue={drawer?.defaultFormValue ?? null}
>
fields={[
{dialogprops?.title === "批阅" ? (
{
<>
title: "问题内容",
<Tabs
dataIndex: "question",
items={datas?.tabs}
key: "question",
activeKey={dialogprops?.defaultFormValue?.id}
valueType: "textarea",
onChange={(key) => {
},
let currow = datas?.tabs?.filter((it) => it?.id == key)[0];
{
setdialogprops({
title: "参考答案",
open: true,
dataIndex: "answer",
defaultFormValue: { ...currow },
key: "answer",
title: "批阅",
valueType: "textarea",
});
},
}}
]}
></Tabs>
onFinish={(val, extra) => {
<Divider style={{ marginTop: 0 }}></Divider>
let postdata;
<ProDescriptions
switch (drawer?.title) {
columns={detailcolumns}
case "添加问题":
column={2}
postdata = {
style={{ marginBottom: 12 }}
...val,
dataSource={dialogprops?.defaultFormValue}
trainId: params?.id,
></ProDescriptions>
};
</>
break;
) : dialogprops?.title === "详情" ? (
case "编辑":
<Stack
postdata = {
direction={"column"}
...val,
alignItems={"center"}
id: drawer?.defaultFormValue?.id,
justifyContent={"center"}
trainId: params?.id,
gap={1}
};
>
default:
<SplitDesc
break;
columns={[
}
detailcolumns,
runAsync({
{
url: "/busTrainQuestion/saveOrUpdate",
title: "批阅信息",
params: postdata,
dataIndex: "sort",
});
key: "sort",
}}
valueType: "split",
></InitForm>
},
)}
[
{
title: "实验时长",
dataIndex: "useTime",
key: "useTime",
},
{
title: "批阅状态",
dataIndex: "reviewTypeName",
key: "reviewTypeName",
},
{
title: "批阅时间",
dataIndex: "reviewTime",
key: "reviewTime",
},
{
title: "批阅人",
dataIndex: "reviewUserName",
key: "reviewUserName",
},
{
title: "分数",
dataIndex: "score",
key: "score",
span: 2,
},
{
title: "评语",
dataIndex: "comment",
key: "comment",
span: 3,
},
],
]}
dataSource={dialogprops?.defaultFormValue}
></SplitDesc>
</Stack>
) : null}
</DraggableDialog>
</DraggableDialog>
<Box
<Box
...
...
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