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
d26c98f3
Commit
d26c98f3
authored
Dec 13, 2023
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asder
parent
b6e682fa
Pipeline
#6396
passed with stages
in 7 minutes and 36 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
441 additions
and
36 deletions
+441
-36
index.jsx
src/pages/checkhomework/index.jsx
+2
-2
index.jsx
src/pages/dolessons/index.jsx
+1
-10
index.jsx
src/pages/domybustrain/index.jsx
+45
-12
index.jsx
src/pages/myrecord/index.jsx
+195
-8
index.jsx
src/pages/rebustrain/index.jsx
+198
-4
No files found.
src/pages/checkhomework/index.jsx
View file @
d26c98f3
...
...
@@ -54,7 +54,7 @@ function Checkhomework() {
variant
:
"text"
,
onClick
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
"/studentExperiment/queryResult"
,
url
:
"/studentExperiment/queryResult
ForPc
"
,
params
:
{
id
:
row
.
id
,
},
...
...
@@ -403,7 +403,7 @@ function Checkhomework() {
onChange={async (key) => {
let currow = datas?.tabs?.filter((it) => it?.id == key)[0];
let res = await doFetch({
url: "/studentExperiment/queryResult",
url: "/studentExperiment/queryResult
ForPc
",
params: {
id: currow.id,
},
...
...
src/pages/dolessons/index.jsx
View file @
d26c98f3
...
...
@@ -161,16 +161,7 @@ function Dolessons() {
key
:
"experimentName"
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}]
},
render
:
(
_
,
row
)
=>
{
return
(
<
Link
underline=
"hover"
href=
{
row
?.
url
}
target=
"_blank"
rel=
"noopener"
>
{
row
?.
experimentName
}
</
Link
>
);
return
row
?.
experimentName
;
},
search
:
false
,
},
...
...
src/pages/domybustrain/index.jsx
View file @
d26c98f3
...
...
@@ -6,7 +6,7 @@ import OnlineChat from "@/components/OnlineChat";
import
PremButton
from
"@/components/PremButton"
;
import
TreeRender
from
"@/components/TreeRender/sxtree"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
{
Box
,
Container
,
Grid
,
Link
,
Stack
,
Typography
}
from
"@mui/material"
;
import
{
Box
,
Container
,
Grid
,
Stack
,
Typography
}
from
"@mui/material"
;
import
{
useParams
}
from
"@umijs/max"
;
import
{
useRequest
}
from
"ahooks"
;
import
{
message
,
Tabs
}
from
"antd"
;
...
...
@@ -113,6 +113,38 @@ function Dolessons() {
);
};
const
openActive
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
"确认开始该实验?"
,
okText
:
"确认"
,
cancelText
:
"取消"
,
onConfirm
:
async
()
=>
{
await
runAsync
({
url
:
"/studentExperiment/startExperiment"
,
params
:
{
id
:
row
?.
id
},
});
// add Jump
},
}
}
btn=
{
{
size
:
"small"
,
color
:
"error"
,
}
}
>
开始实验
</
PremButton
>
);
};
const
questionColumns
=
useMemo
(()
=>
{
let
col
=
[
{
...
...
@@ -140,16 +172,7 @@ function Dolessons() {
key
:
"experimentName"
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
"此项为必填项"
}]
},
render
:
(
_
,
row
)
=>
{
return
(
<
Link
underline=
"hover"
href=
{
row
?.
url
}
target=
"_blank"
rel=
"noopener"
>
{
row
?.
experimentName
}
</
Link
>
);
return
row
?.
experimentName
;
},
search
:
false
,
},
...
...
@@ -241,7 +264,17 @@ function Dolessons() {
<
AutoTable
rerendered=
{
false
}
actionRef=
{
cksyactionRef
}
columns=
{
[...
experimentColumns
]
}
columns=
{
[
...
experimentColumns
,
{
title
:
"操作"
,
valueType
:
"option"
,
width
:
180
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
openActive
(
text
,
row
,
_
,
action
),
],
},
]
}
path=
"/studentTrain/experimentPage"
extraparams=
{
{
id
:
params
?.
id
,
...
...
src/pages/myrecord/index.jsx
View file @
d26c98f3
import
AutoTable
from
"@/components/AutoTable"
;
import
DraggableDialog
from
"@/components/DraggableDialog"
;
import
PointViewer
from
"@/components/PointViewer"
;
import
PremButton
from
"@/components/PremButton"
;
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
{
Divider
,
Drawer
,
message
,
Table
,
Tag
,
Tooltip
}
from
"antd"
;
import
dayjs
from
"dayjs"
;
import
duration
from
"dayjs/plugin/duration"
;
import
{
useMemo
,
useRef
,
useState
}
from
"react"
;
import
"./index.less"
;
import
{
useRequest
}
from
"ahooks"
;
dayjs
.
extend
(
duration
);
...
...
@@ -23,7 +26,7 @@ function Record() {
open
:
false
,
}));
};
const
detailcolumns
=
[
{
title
:
"分数"
,
...
...
@@ -89,12 +92,20 @@ function Record() {
params
:
{
id
:
row
?.
id
},
});
let
result
=
await
doFetch
({
url
:
"/studentExperiment/queryResultForPc"
,
params
:
{
id
:
row
.
id
,
},
});
setdialogprops
({
open
:
true
,
defaultFormValue
:
{
...
res
?.
data
?.
data
},
title
:
"详情"
,
maxWidth
:
"md"
,
footer
:
false
,
tabdata
:
result
?.
data
?.
data
,
});
},
}
}
...
...
@@ -176,6 +187,16 @@ function Record() {
return
res
;
},
[]);
const
[
drawer
,
setDrawer
]
=
useState
({
open
:
false
,
onClose
:
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
},
});
return
(
<
Container
maxWidth=
{
false
}
>
<
DraggableDialog
...
...
@@ -184,12 +205,178 @@ function Record() {
maxWidth=
{
dialogprops
?.
maxWidth
??
"sm"
}
footer=
{
false
}
>
<
ProDescriptions
columns=
{
detailcolumns
}
column=
{
2
}
style=
{
{
marginBottom
:
12
}
}
dataSource=
{
dialogprops
?.
defaultFormValue
}
></
ProDescriptions
>
<
div
>
<
ProDescriptions
columns=
{
detailcolumns
}
column=
{
2
}
style=
{
{
marginBottom
:
12
}
}
dataSource=
{
dialogprops
?.
defaultFormValue
}
></
ProDescriptions
>
<
Divider
></
Divider
>
<
b
style=
{
{
fontSize
:
14
,
paddingBottom
:
10
,
display
:
"block"
}
}
>
实验素养
</
b
>
<
Table
size=
"small"
pagination=
{
{
pageSize
:
6
,
}
}
columns=
{
[
{
title
:
"操作名称"
,
dataIndex
:
"config"
,
key
:
"config"
,
render
:
(
text
,
row
)
=>
{
return
row
?.
config
?.
name
;
},
},
{
title
:
"是否操作"
,
dataIndex
:
"isComplete"
,
key
:
"isComplete"
,
width
:
200
,
render
:
(
text
,
row
)
=>
{
return
row
?.
isComplete
?
(
"完成"
)
:
(
<
span
style=
{
{
color
:
"red"
}
}
>
未完成
</
span
>
);
},
},
]
}
dataSource=
{
dialogprops
?.
tabdata
?.
recordDataDic
?
Object
.
values
(
dialogprops
?.
tabdata
?.
recordDataDic
)
:
[]
}
></
Table
>
<
Divider
></
Divider
>
<
div
style=
{
{
position
:
"relative"
,
minHeight
:
360
}
}
>
<
Drawer
{
...
drawer
}
getContainer=
{
false
}
title=
{
false
}
closable=
{
false
}
destroyOnClose
>
<
PointViewer
position=
{
drawer
?.
position
}
CoordinatePoint=
{
dialogprops
?.
tabdata
?.
CoordinatePoint
}
CurGongjianPoint=
{
dialogprops
?.
tabdata
?.
CurGongjianPoint
}
></
PointViewer
>
</
Drawer
>
<
b
style=
{
{
fontSize
:
14
,
paddingBottom
:
10
,
display
:
"block"
}
}
>
实验报告
</
b
>
<
Table
size=
"small"
pagination=
{
{
pageSize
:
6
,
}
}
columns=
{
[
{
title
:
"名称"
,
dataIndex
:
"Name"
,
key
:
"Name"
,
},
{
title
:
"测量值"
,
dataIndex
:
"actualValue"
,
key
:
"actualValue"
,
render
:
(
text
,
row
)
=>
{
return
row
?.
actualValue
?.
toFixed
(
4
)
??
""
;
},
},
{
title
:
"名义值"
,
dataIndex
:
"normal"
,
key
:
"normal"
,
render
:
(
text
,
row
)
=>
{
return
row
?.
normal
?.
toFixed
(
4
)
??
""
;
},
},
{
title
:
"上公差"
,
dataIndex
:
"Upper"
,
key
:
"Upper"
,
},
{
title
:
"下公差"
,
dataIndex
:
"Down"
,
key
:
"Down"
,
},
]
}
rowKey=
{
"id"
}
dataSource=
{
dialogprops
?.
tabdata
?.
PeculiarityInfosDict
?
Object
.
values
(
dialogprops
?.
tabdata
?.
PeculiarityInfosDict
)?.
map
((
it
,
i
)
=>
it
?.[
0
]
?
{
...
it
?.[
0
],
id
:
i
+
1
,
}
:
{}
)
:
[]
}
expandable=
{
{
expandedRowRender
:
({
ElementInfoList
})
=>
{
return
(
<
div
style=
{
{
display
:
"flex"
,
gap
:
6
}
}
>
{
ElementInfoList
?.
map
((
it
)
=>
{
function
removeFirstAndLastChar
(
str
)
{
return
str
.
substring
(
1
,
str
.
length
-
1
);
}
return
(
<
div
style=
{
{
padding
:
12
,
backgroundColor
:
"#f0f0f0"
,
display
:
"inline-block"
,
borderRadius
:
4
,
marginBottom
:
6
,
}
}
>
<
span
style=
{
{
paddingRight
:
12
}
}
>
{
it
?.
Name
}
</
span
>
{
it
?.
PointList
?.
map
((
its
)
=>
(
<
Tooltip
key=
{
its
?.
id
}
title=
{
<
div
dangerouslySetInnerHTML=
{
{
__html
:
removeFirstAndLastChar
(
JSON
.
stringify
(
its
.
Position
)
).
replace
(
/,/g
,
"<br/>"
),
}
}
></
div
>
}
>
<
Tag
onClick=
{
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
position
:
its
.
Position
,
open
:
true
,
}));
}
}
style=
{
{
cursor
:
"pointer"
}
}
>
{
its
.
Name
}
</
Tag
>
</
Tooltip
>
))
}
</
div
>
);
})
}
</
div
>
);
},
}
}
></
Table
>
</
div
>
</
div
>
</
DraggableDialog
>
<
Stack
direction=
{
"row"
}
mb=
{
2
}
>
...
...
src/pages/rebustrain/index.jsx
View file @
d26c98f3
...
...
@@ -8,8 +8,9 @@ import { ProDescriptions } from "@ant-design/pro-components";
import
{
Box
,
Container
,
Stack
,
Typography
}
from
"@mui/material"
;
import
{
useParams
}
from
"@umijs/max"
;
import
{
useAsyncEffect
,
useRequest
}
from
"ahooks"
;
import
{
Divider
,
message
,
Segmented
,
Tab
s
}
from
"antd"
;
import
{
Divider
,
message
,
Segmented
,
Tab
le
,
Tabs
,
Drawer
}
from
"antd"
;
import
{
useEffect
,
useMemo
,
useRef
,
useState
}
from
"react"
;
import
PointViewer
from
"@/components/PointViewer"
;
import
{
history
}
from
"umi"
;
import
"./index.less"
;
...
...
@@ -99,11 +100,18 @@ function Dolessons() {
btn=
{
{
size
:
"small"
,
variant
:
"text"
,
onClick
:
()
=>
{
onClick
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
"/studentExperiment/queryResultForPc"
,
params
:
{
id
:
row
.
id
,
},
});
setdialogprops
({
open
:
true
,
defaultFormValue
:
{
...
row
},
title
:
"批阅"
,
tabdata
:
res
?.
data
?.
data
,
});
},
}
}
...
...
@@ -274,6 +282,16 @@ function Dolessons() {
},
];
const [drawer, setDrawer] = useState({
open: false,
onClose: () => {
setDrawer((s) => ({
...s,
open: false,
}));
},
});
return (
<Container maxWidth={false}>
<DraggableDialog
...
...
@@ -283,7 +301,7 @@ function Dolessons() {
loading={loading}
formRef={formRefc}
dialogprops={dialogprops}
maxWidth={dialogprops?.maxWidth ?? "
sm
"}
maxWidth={dialogprops?.maxWidth ?? "
md
"}
formdom={
dialogprops?.title === "批阅" && (
<InitForm
...
...
@@ -332,12 +350,19 @@ function Dolessons() {
<Tabs
items={datas?.tabs}
activeKey={dialogprops?.defaultFormValue?.id}
onChange={(key) => {
onChange={
async
(key) => {
let currow = datas?.tabs?.filter((it) => it?.id == key)[0];
let res = await doFetch({
url: "/studentExperiment/queryResultForPc",
params: {
id: currow.id,
},
});
setdialogprops({
open: true,
defaultFormValue: { ...currow },
title: "批阅",
tabdata: res?.data?.data,
});
}}
></Tabs>
...
...
@@ -348,6 +373,175 @@ function Dolessons() {
style={{ marginBottom: 12 }}
dataSource={dialogprops?.defaultFormValue}
></ProDescriptions>
<Divider></Divider>
<b style={{ fontSize: 14, paddingBottom: 10, display: "block" }}>
实验素养
</b>
<Table
size="small"
pagination={{
pageSize: 6,
}}
columns={[
{
title: "操作名称",
dataIndex: "config",
key: "config",
render: (text, row) => {
return row?.config?.name;
},
},
{
title: "是否操作",
dataIndex: "isComplete",
key: "isComplete",
width: 200,
render: (text, row) => {
return row?.isComplete ? (
"完成"
) : (
<span style={{ color: "red" }}>未完成</span>
);
},
},
]}
dataSource={
dialogprops?.tabdata?.recordDataDic
? Object.values(dialogprops?.tabdata?.recordDataDic)
: []
}
></Table>
<Divider></Divider>
<div style={{ position: "relative", minHeight: 360 }}>
<Drawer
{...drawer}
getContainer={false}
title={false}
closable={false}
destroyOnClose
>
<PointViewer
position={drawer?.position}
CoordinatePoint={dialogprops?.tabdata?.CoordinatePoint}
CurGongjianPoint={dialogprops?.tabdata?.CurGongjianPoint}
></PointViewer>
</Drawer>
<b style={{ fontSize: 14, paddingBottom: 10, display: "block" }}>
实验报告
</b>
<Table
size="small"
pagination={{
pageSize: 6,
}}
columns={[
{
title: "名称",
dataIndex: "Name",
key: "Name",
},
{
title: "测量值",
dataIndex: "actualValue",
key: "actualValue",
render: (text, row) => {
return row?.actualValue?.toFixed(4) ?? "";
},
},
{
title: "名义值",
dataIndex: "normal",
key: "normal",
render: (text, row) => {
return row?.normal?.toFixed(4) ?? "";
},
},
{
title: "上公差",
dataIndex: "Upper",
key: "Upper",
},
{
title: "下公差",
dataIndex: "Down",
key: "Down",
},
]}
rowKey={"id"}
dataSource={
dialogprops?.tabdata?.PeculiarityInfosDict
? Object.values(
dialogprops?.tabdata?.PeculiarityInfosDict
)?.map((it, i) =>
it?.[0]
? {
...it?.[0],
id: i + 1,
}
: {}
)
: []
}
expandable={{
expandedRowRender: ({ ElementInfoList }) => {
return (
<div style={{ display: "flex", gap: 6 }}>
{ElementInfoList?.map((it) => {
function removeFirstAndLastChar(str) {
return str.substring(1, str.length - 1);
}
return (
<div
style={{
padding: 12,
backgroundColor: "#f0f0f0",
display: "inline-block",
borderRadius: 4,
marginBottom: 6,
}}
>
<span style={{ paddingRight: 12 }}>
{it?.Name}
</span>
{it?.PointList?.map((its) => (
<Tooltip
key={its?.id}
title={
<div
dangerouslySetInnerHTML={{
__html: removeFirstAndLastChar(
JSON.stringify(its.Position)
).replace(/,/g, "<br/>"),
}}
></div>
}
>
<Tag
onClick={() => {
setDrawer((s) => ({
...s,
position: its.Position,
open: true,
}));
}}
style={{ cursor: "pointer" }}
>
{its.Name}
</Tag>
</Tooltip>
))}
</div>
);
})}
</div>
);
},
}}
></Table>
</div>
</>
) : dialogprops?.title === "详情" ? (
<Stack
...
...
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