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
751277d6
Commit
751277d6
authored
Jun 14, 2023
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sader
parent
58be7eb0
Pipeline
#3814
passed with stages
in 3 minutes and 17 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
29 deletions
+83
-29
index.jsx
src/components/DraggableDialog/index.jsx
+12
-5
index.jsx
src/pages/bustrain/index.jsx
+0
-10
index.jsx
src/pages/checkhomework/index.jsx
+71
-14
No files found.
src/components/DraggableDialog/index.jsx
View file @
751277d6
...
...
@@ -32,8 +32,9 @@ export default function DraggableDialog({
loading
,
formdom
,
maxWidth
,
formRef
,
})
{
const
formRef
=
React
.
useRef
();
const
formRef
s
=
formRef
??
React
.
useRef
();
return
(
<
div
>
...
...
@@ -52,9 +53,15 @@ export default function DraggableDialog({
</
DialogTitle
>
<
DialogContent
>
{
children
&&
React
.
cloneElement
(
children
,
{
submitter
:
false
,
formRef
})
}
React
.
cloneElement
(
children
,
{
submitter
:
false
,
formRef
:
formRefs
,
})
}
{
formdom
&&
React
.
cloneElement
(
formdom
,
{
submitter
:
false
,
formRef
})
}
React
.
cloneElement
(
formdom
,
{
submitter
:
false
,
formRef
:
formRefs
,
})
}
</
DialogContent
>
{
dialogprops
?.
footer
===
false
?
null
:
(
<
DialogActions
>
...
...
@@ -62,7 +69,7 @@ export default function DraggableDialog({
type=
"reset"
key=
"rest"
onClick=
{
()
=>
{
formRef
?.
current
?.
resetFields
();
formRef
s
?.
current
?.
resetFields
();
}
}
>
重置
...
...
@@ -76,7 +83,7 @@ export default function DraggableDialog({
startIcon=
{
<
SendOutlined
/>
}
disabled=
{
dialogprops
?.
disabled
}
onClick=
{
()
=>
{
formRef
?.
current
?.
submit
();
formRef
s
?.
current
?.
submit
();
}
}
>
提交
...
...
src/pages/bustrain/index.jsx
View file @
751277d6
...
...
@@ -412,16 +412,6 @@ function Lessons() {
label=
"已结束"
value=
{
4
}
/>
<
FormControlLabel
control=
{
<
Checkbox
checked=
{
params
?.
typeList
?.
includes
(
"5"
)
}
color=
{
"default"
}
/>
}
label=
"已结束"
value=
{
5
}
/>
</
FormGroup
>
<
Input
placeholder=
"请输入课程名称"
...
...
src/pages/checkhomework/index.jsx
View file @
751277d6
...
...
@@ -7,7 +7,7 @@ import { doFetch } from "@/utils/doFetch";
import
{
ProDescriptions
}
from
"@ant-design/pro-components"
;
import
{
Box
,
Container
,
Stack
,
Typography
}
from
"@mui/material"
;
import
{
useRequest
}
from
"ahooks"
;
import
{
message
,
Tabs
}
from
"antd"
;
import
{
Divider
,
message
,
Tabs
}
from
"antd"
;
import
{
useMemo
,
useRef
,
useState
}
from
"react"
;
import
"./index.less"
;
...
...
@@ -15,7 +15,8 @@ function Checkhomework() {
const
actionRef
=
useRef
(),
formRef
=
useRef
(),
actionRefs
=
useRef
(),
formRefs
=
useRef
();
formRefs
=
useRef
(),
formRefc
=
useRef
();
const
[
dialogprops
,
setdialogprops
]
=
useState
({
open
:
false
,
});
...
...
@@ -31,8 +32,8 @@ function Checkhomework() {
const
{
runAsync
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
parames
)
=>
{
if
(
parames
?.
url
===
"/studentExperiment/giveScore"
)
return
;
if
(
res
?.
code
==
"0000"
)
{
handleClose
();
message
.
success
(
"操作成功"
);
if
(
active
===
"1"
)
{
actionRef
?.
current
?.
reload
();
...
...
@@ -186,6 +187,42 @@ function Checkhomework() {
];
},
[]);
const
[
datas
,
setdatas
]
=
useState
({
tabs
:
[],
});
let
blid
=
useRequest
(
async
()
=>
{
let
res
=
await
doFetch
({
url
:
"/studentExperiment/queryAllByLoginTeacher"
,
params
:
{},
});
return
res
?.
data
?.
dataList
;
},
{
refreshDeps
:
[],
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
items
=
[
{
key
:
"2"
,
...
...
@@ -234,8 +271,12 @@ function Checkhomework() {
return
(
<
Container
maxWidth=
{
false
}
>
<
DraggableDialog
handleClose=
{
handleClose
}
handleClose=
{
()
=>
{
handleClose
();
actionRef
?.
current
?.
reload
();
}
}
loading=
{
loading
}
formRef=
{
formRefc
}
dialogprops=
{
dialogprops
}
maxWidth=
{
dialogprops
?.
maxWidth
??
"sm"
}
formdom=
{
...
...
@@ -266,27 +307,43 @@ function Checkhomework() {
},
]
}
defaultFormValue=
{
{
examineResult
:
"1"
}
}
onFinish=
{
(
val
,
extra
)
=>
{
onFinish=
{
async
(
val
,
extra
)
=>
{
let
postdata
=
{
...
val
,
id
:
dialogprops
?.
defaultFormValue
?.
id
,
};
runAsync
({
await
runAsync
({
url
:
"/studentExperiment/giveScore"
,
params
:
postdata
,
});
await
blid
?.
runAsync
();
}
}
></
InitForm
>
)
}
>
{
dialogprops
?.
title
===
"批阅"
?
(
<
ProDescriptions
columns=
{
detailcolumns
}
column=
{
2
}
style=
{
{
marginBottom
:
12
}
}
dataSource=
{
dialogprops
?.
defaultFormValue
}
></
ProDescriptions
>
<>
<
Tabs
items=
{
datas
?.
tabs
}
activeKey=
{
dialogprops
?.
defaultFormValue
?.
id
}
onChange=
{
(
key
)
=>
{
let
currow
=
datas
?.
tabs
?.
filter
((
it
)
=>
it
?.
id
==
key
)[
0
];
setdialogprops
({
open
:
true
,
defaultFormValue
:
{
...
currow
},
title
:
"批阅"
,
});
}
}
></
Tabs
>
<
Divider
style=
{
{
marginTop
:
0
}
}
></
Divider
>
<
ProDescriptions
columns=
{
detailcolumns
}
column=
{
2
}
style=
{
{
marginBottom
:
12
}
}
dataSource=
{
dialogprops
?.
defaultFormValue
}
></
ProDescriptions
>
</>
)
:
dialogprops
?.
title
===
"详情"
?
(
<
Stack
direction=
{
"column"
}
...
...
@@ -328,13 +385,13 @@ function Checkhomework() {
title
:
"分数"
,
dataIndex
:
"score"
,
key
:
"score"
,
span
:
2
span
:
2
,
},
{
title
:
"评语"
,
dataIndex
:
"comment"
,
key
:
"comment"
,
span
:
3
span
:
3
,
},
],
]
}
...
...
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