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
cc25eb90
Commit
cc25eb90
authored
Aug 18, 2023
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asder
parent
172f4201
Pipeline
#4329
passed with stages
in 3 minutes and 32 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
3 deletions
+90
-3
index.jsx
src/components/AutoTable/index.jsx
+1
-1
index.jsx
src/pages/myrebustrain/index.jsx
+47
-0
index.jsx
src/pages/myrecord/index.jsx
+42
-2
No files found.
src/components/AutoTable/index.jsx
View file @
cc25eb90
...
@@ -78,7 +78,7 @@ const AutoTable = (props) => {
...
@@ -78,7 +78,7 @@ const AutoTable = (props) => {
total
=
result
?.
data
?.
dataList
?.
length
;
total
=
result
?.
data
?.
dataList
?.
length
;
}
}
setparams
(
total
);
setparams
?.
(
total
);
return
{
return
{
data
,
data
,
success
,
success
,
...
...
src/pages/myrebustrain/index.jsx
View file @
cc25eb90
...
@@ -3,12 +3,51 @@ import PremButton from "@/components/PremButton";
...
@@ -3,12 +3,51 @@ import PremButton from "@/components/PremButton";
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
{
useMemo
,
useRef
}
from
"react"
;
import
{
useMemo
,
useRef
}
from
"react"
;
import
{
useRequest
}
from
"ahooks"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
"./index.less"
;
import
"./index.less"
;
function
Record
()
{
function
Record
()
{
const
actionRef
=
useRef
();
const
actionRef
=
useRef
();
const
params
=
useParams
();
const
params
=
useParams
();
const
{
runAsync
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
)
=>
{
if
(
res
?.
code
==
"0000"
)
{
message
.
success
(
"操作成功"
);
}
},
});
const
rollback
=
(
text
,
row
,
action
)
=>
{
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
(()
=>
{
let
res
=
[
let
res
=
[
{
title
:
"课程名称"
,
dataIndex
:
"courseName"
,
key
:
"courseName"
},
{
title
:
"课程名称"
,
dataIndex
:
"courseName"
,
key
:
"courseName"
},
...
@@ -42,6 +81,14 @@ function Record() {
...
@@ -42,6 +81,14 @@ function Record() {
{
label
:
"已批阅"
,
value
:
"2"
},
{
label
:
"已批阅"
,
value
:
"2"
},
],
],
},
},
{
title
:
"操作"
,
valueType
:
"option"
,
width
:
88
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
rollback
(
text
,
row
,
_
,
action
),
],
},
];
];
return
res
;
return
res
;
},
[]);
},
[]);
...
...
src/pages/myrecord/index.jsx
View file @
cc25eb90
...
@@ -8,6 +8,7 @@ import dayjs from "dayjs";
...
@@ -8,6 +8,7 @@ import dayjs from "dayjs";
import
duration
from
"dayjs/plugin/duration"
;
import
duration
from
"dayjs/plugin/duration"
;
import
{
useMemo
,
useRef
,
useState
}
from
"react"
;
import
{
useMemo
,
useRef
,
useState
}
from
"react"
;
import
"./index.less"
;
import
"./index.less"
;
import
{
useRequest
}
from
"ahooks"
;
dayjs
.
extend
(
duration
);
dayjs
.
extend
(
duration
);
...
@@ -22,6 +23,7 @@ function Record() {
...
@@ -22,6 +23,7 @@ function Record() {
open
:
false
,
open
:
false
,
}));
}));
};
};
const
detailcolumns
=
[
const
detailcolumns
=
[
{
{
title
:
"分数"
,
title
:
"分数"
,
...
@@ -65,6 +67,15 @@ function Record() {
...
@@ -65,6 +67,15 @@ function Record() {
},
},
];
];
const
{
runAsync
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
)
=>
{
if
(
res
?.
code
==
"0000"
)
{
message
.
success
(
"操作成功"
);
}
},
});
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
return
(
<
PremButton
<
PremButton
...
@@ -93,6 +104,32 @@ function Record() {
...
@@ -93,6 +104,32 @@ function Record() {
);
);
};
};
const
rollback
=
(
text
,
row
,
action
)
=>
{
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
(()
=>
{
let
res
=
[
let
res
=
[
{
title
:
"课程名称"
,
dataIndex
:
"courseName"
,
key
:
"courseName"
},
{
title
:
"课程名称"
,
dataIndex
:
"courseName"
,
key
:
"courseName"
},
...
@@ -129,8 +166,11 @@ function Record() {
...
@@ -129,8 +166,11 @@ function Record() {
{
{
title
:
"操作"
,
title
:
"操作"
,
valueType
:
"option"
,
valueType
:
"option"
,
width
:
78
,
width
:
128
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
detail
(
text
,
row
,
_
,
action
)],
render
:
(
text
,
row
,
_
,
action
)
=>
[
detail
(
text
,
row
,
_
,
action
),
rollback
(
text
,
row
,
_
,
action
),
],
},
},
];
];
return
res
;
return
res
;
...
...
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