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
a31a3320
Commit
a31a3320
authored
May 15, 2023
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jkasd
parent
3e200d52
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
246 additions
and
105 deletions
+246
-105
index.jsx
src/components/ProductCard/index.jsx
+9
-9
sxcard.jsx
src/components/ProductCard/sxcard.jsx
+141
-84
index.jsx
src/components/TreeRender/index.jsx
+7
-2
sxtree.jsx
src/components/TreeRender/sxtree.jsx
+8
-2
index.jsx
src/pages/bustrain/index.jsx
+78
-4
index.jsx
src/pages/dobustrain/index.jsx
+3
-3
index.jsx
src/pages/mybustrain/index.jsx
+0
-1
No files found.
src/components/ProductCard/index.jsx
View file @
a31a3320
...
@@ -85,7 +85,7 @@ export default function ShopProductCard({
...
@@ -85,7 +85,7 @@ export default function ShopProductCard({
<
Box
className=
"masker"
></
Box
>
<
Box
className=
"masker"
></
Box
>
{
type
==
1
&&
(
{
type
==
1
&&
(
<
Box
className=
"edit"
>
<
Box
className=
"edit"
>
<
Tooltip
title=
"编辑"
>
<
Tooltip
placement=
"bottom-start"
title=
"编辑"
>
<
IconButton
<
IconButton
onClick=
{
()
=>
{
onClick=
{
()
=>
{
edit
(
product
);
edit
(
product
);
...
@@ -97,7 +97,7 @@ export default function ShopProductCard({
...
@@ -97,7 +97,7 @@ export default function ShopProductCard({
</
IconButton
>
</
IconButton
>
</
Tooltip
>
</
Tooltip
>
<
Tooltip
title=
{
confirm
?
"确认删除"
:
"删除"
}
>
<
Tooltip
placement=
"bottom-start"
title=
{
confirm
?
"确认删除"
:
"删除"
}
>
{
confirm
?
(
{
confirm
?
(
<
IconButton
<
IconButton
disabled=
{
confirm
===
"1"
}
disabled=
{
confirm
===
"1"
}
...
@@ -150,7 +150,7 @@ export default function ShopProductCard({
...
@@ -150,7 +150,7 @@ export default function ShopProductCard({
<
div
></
div
>
<
div
></
div
>
{
type
!==
3
&&
(
{
type
!==
3
&&
(
<
Tooltip
title=
{
shut
?
"确认关闭"
:
"关闭"
}
>
<
Tooltip
placement=
"bottom-start"
title=
{
shut
?
"确认关闭"
:
"关闭"
}
>
{
shut
?
(
{
shut
?
(
<
IconButton
<
IconButton
disabled=
{
shut
===
"1"
}
disabled=
{
shut
===
"1"
}
...
@@ -200,14 +200,14 @@ export default function ShopProductCard({
...
@@ -200,14 +200,14 @@ export default function ShopProductCard({
overflow=
{
"hidden"
}
overflow=
{
"hidden"
}
alignItems=
{
"center"
}
alignItems=
{
"center"
}
>
>
<
Tooltip
title=
{
courseName
}
>
<
Tooltip
placement=
"bottom-start"
title=
{
courseName
}
>
<
Typography
variant=
"subtitle2"
noWrap
>
<
Typography
variant=
"subtitle2"
noWrap
>
{
courseName
}
{
courseName
}
</
Typography
>
</
Typography
>
</
Tooltip
>
</
Tooltip
>
<
Box
width=
{
60
}
textAlign=
{
"right"
}
flexShrink=
{
0
}
>
<
Box
width=
{
60
}
textAlign=
{
"right"
}
flexShrink=
{
0
}
>
<
Tooltip
title=
{
createTime
}
>
<
Tooltip
placement=
"bottom-start"
title=
{
createTime
}
>
<
Typography
<
Typography
component=
"span"
component=
"span"
variant=
"body2"
variant=
"body2"
...
@@ -229,7 +229,7 @@ export default function ShopProductCard({
...
@@ -229,7 +229,7 @@ export default function ShopProductCard({
{
type
==
3
?
(
{
type
==
3
?
(
<
div
></
div
>
<
div
></
div
>
)
:
(
)
:
(
<
Tooltip
title=
{
type
==
1
?
"发布"
:
type
==
2
?
"取消发布"
:
""
}
>
<
Tooltip
placement=
"bottom-start"
title=
{
type
==
1
?
"发布"
:
type
==
2
?
"取消发布"
:
""
}
>
<
IconButton
<
IconButton
onClick=
{
()
=>
{
onClick=
{
()
=>
{
publish
(
product
);
publish
(
product
);
...
@@ -250,7 +250,7 @@ export default function ShopProductCard({
...
@@ -250,7 +250,7 @@ export default function ShopProductCard({
</
Tooltip
>
</
Tooltip
>
)
}
)
}
{
type
===
1
?
(
{
type
===
1
?
(
<
Tooltip
title=
"授权"
>
<
Tooltip
placement=
"bottom-start"
title=
"授权"
>
<
IconButton
<
IconButton
onClick=
{
()
=>
{
onClick=
{
()
=>
{
authorized
(
product
);
authorized
(
product
);
...
@@ -269,7 +269,7 @@ export default function ShopProductCard({
...
@@ -269,7 +269,7 @@ export default function ShopProductCard({
<
Stack
direction=
{
"row"
}
spacing=
{
1
}
>
<
Stack
direction=
{
"row"
}
spacing=
{
1
}
>
{
type
===
1
&&
(
{
type
===
1
&&
(
<
Tooltip
title=
"备课"
>
<
Tooltip
placement=
"bottom-start"
title=
"备课"
>
<
IconButton
<
IconButton
onClick=
{
()
=>
{
onClick=
{
()
=>
{
history
.
push
(
"/work/dolessons/"
+
product
.
id
);
history
.
push
(
"/work/dolessons/"
+
product
.
id
);
...
@@ -283,7 +283,7 @@ export default function ShopProductCard({
...
@@ -283,7 +283,7 @@ export default function ShopProductCard({
</
Tooltip
>
</
Tooltip
>
)
}
)
}
<
Tooltip
title=
"复制创建"
>
<
Tooltip
placement=
"bottom-start"
title=
"复制创建"
>
<
IconButton
<
IconButton
onClick=
{
()
=>
{
onClick=
{
()
=>
{
copy
(
product
);
copy
(
product
);
...
...
src/components/ProductCard/sxcard.jsx
View file @
a31a3320
...
@@ -17,9 +17,11 @@ import Label from "@/components/label";
...
@@ -17,9 +17,11 @@ import Label from "@/components/label";
import
difftime
from
"@/utils/difftime"
;
import
difftime
from
"@/utils/difftime"
;
import
AccessTimeFilledIcon
from
"@mui/icons-material/AccessTimeFilled"
;
import
AccessTimeFilledIcon
from
"@mui/icons-material/AccessTimeFilled"
;
import
CheckIcon
from
"@mui/icons-material/Check"
;
import
CheckIcon
from
"@mui/icons-material/Check"
;
import
CloseIcon
from
"@mui/icons-material/Close"
;
import
DeleteIcon
from
"@mui/icons-material/Delete"
;
import
DeleteIcon
from
"@mui/icons-material/Delete"
;
import
EditIcon
from
"@mui/icons-material/Edit"
;
import
EditIcon
from
"@mui/icons-material/Edit"
;
import
GroupIcon
from
"@mui/icons-material/Group"
;
import
GroupIcon
from
"@mui/icons-material/Group"
;
import
PauseIcon
from
"@mui/icons-material/Pause"
;
import
{
history
}
from
"@umijs/max"
;
import
{
history
}
from
"@umijs/max"
;
import
{
Progress
}
from
"antd"
;
import
{
Progress
}
from
"antd"
;
import
dayjs
from
"dayjs"
;
import
dayjs
from
"dayjs"
;
...
@@ -47,6 +49,7 @@ export default function ShopProductCard({
...
@@ -47,6 +49,7 @@ export default function ShopProductCard({
copy
,
copy
,
publish
,
publish
,
authorized
,
authorized
,
tauthorized
})
{
})
{
const
{
const
{
trainName
,
trainName
,
...
@@ -62,6 +65,9 @@ export default function ShopProductCard({
...
@@ -62,6 +65,9 @@ export default function ShopProductCard({
totalExperimentNum
,
totalExperimentNum
,
}
=
product
;
}
=
product
;
const
[
confirm
,
setconfirm
]
=
useState
(
false
);
const
[
confirm
,
setconfirm
]
=
useState
(
false
);
const
[
shut
,
setshut
]
=
useState
(
false
);
const
ifs
=
type
===
1
||
type
===
3
;
return
(
return
(
<
Card
sx=
{
{
borderRadius
:
3
}
}
className=
"hovered"
id=
"jikl"
>
<
Card
sx=
{
{
borderRadius
:
3
}
}
className=
"hovered"
id=
"jikl"
>
...
@@ -70,7 +76,10 @@ export default function ShopProductCard({
...
@@ -70,7 +76,10 @@ export default function ShopProductCard({
<
Label
<
Label
variant=
"filled"
variant=
"filled"
color=
{
color=
{
(
type
===
1
&&
"warning"
)
||
(
type
===
2
&&
"info"
)
||
(
type
===
3
&&
"default"
)
||
(
type
===
4
&&
"error"
)
||
"danger"
(
type
===
1
&&
"warning"
)
||
(
type
===
2
&&
"info"
)
||
(
type
===
3
&&
"default"
)
||
"error"
}
}
sx=
{
{
sx=
{
{
zIndex
:
9
,
zIndex
:
9
,
...
@@ -95,9 +104,9 @@ export default function ShopProductCard({
...
@@ -95,9 +104,9 @@ export default function ShopProductCard({
sx=
{
{
borderRadius
:
2
,
overflow
:
"hidden"
}
}
sx=
{
{
borderRadius
:
2
,
overflow
:
"hidden"
}
}
>
>
<
Box
className=
"masker"
></
Box
>
<
Box
className=
"masker"
></
Box
>
{
type
==
1
&&
(
{
ifs
&&
(
<
Box
className=
"edit"
>
<
Box
className=
"edit"
>
<
Tooltip
title=
"编辑"
>
<
Tooltip
placement=
"bottom-start"
title=
"编辑"
>
<
IconButton
<
IconButton
onClick=
{
()
=>
{
onClick=
{
()
=>
{
edit
(
product
);
edit
(
product
);
...
@@ -109,7 +118,10 @@ export default function ShopProductCard({
...
@@ -109,7 +118,10 @@ export default function ShopProductCard({
</
IconButton
>
</
IconButton
>
</
Tooltip
>
</
Tooltip
>
<
Tooltip
title=
{
confirm
?
"确认删除"
:
"删除"
}
>
<
Tooltip
placement=
"bottom-start"
title=
{
confirm
?
"确认删除"
:
"删除"
}
>
{
confirm
?
(
{
confirm
?
(
<
IconButton
<
IconButton
disabled=
{
confirm
===
"1"
}
disabled=
{
confirm
===
"1"
}
...
@@ -159,10 +171,12 @@ export default function ShopProductCard({
...
@@ -159,10 +171,12 @@ export default function ShopProductCard({
className=
"stackani"
className=
"stackani"
padding=
{
"0px 12px"
}
padding=
{
"0px 12px"
}
>
>
<
Tooltip
title=
{
"协作教师"
}
>
<
Tooltip
placement=
"bottom-start"
title=
{
"协作教师"
}
>
<
IconButton
<
IconButton
onClick=
{
()
=>
{
onClick=
{
()
=>
{
publish
(
product
,
{
type
:
3
});
if
(
ifs
)
{
tauthorized
(
product
);
}
}
}
}
}
>
>
<
GroupIcon
<
GroupIcon
...
@@ -174,7 +188,7 @@ export default function ShopProductCard({
...
@@ -174,7 +188,7 @@ export default function ShopProductCard({
</
IconButton
>
</
IconButton
>
</
Tooltip
>
</
Tooltip
>
<
Tooltip
title=
{
"成绩管理"
}
>
<
Tooltip
placement=
"bottom-start"
title=
{
"成绩管理"
}
>
<
IconButton
<
IconButton
onClick=
{
()
=>
{
onClick=
{
()
=>
{
publish
(
product
,
{
type
:
3
});
publish
(
product
,
{
type
:
3
});
...
@@ -211,7 +225,7 @@ export default function ShopProductCard({
...
@@ -211,7 +225,7 @@ export default function ShopProductCard({
"100%"
:
"#005bea"
,
"100%"
:
"#005bea"
,
}
}
}
}
/>
/>
<
Tooltip
title=
{
trainName
}
>
<
Tooltip
placement=
"bottom-start"
title=
{
trainName
}
>
<
Typography
<
Typography
variant=
"subtitle2"
variant=
"subtitle2"
noWrap
noWrap
...
@@ -225,7 +239,7 @@ export default function ShopProductCard({
...
@@ -225,7 +239,7 @@ export default function ShopProductCard({
</
div
>
</
div
>
<
Box
width=
{
60
}
textAlign=
{
"right"
}
flexShrink=
{
0
}
>
<
Box
width=
{
60
}
textAlign=
{
"right"
}
flexShrink=
{
0
}
>
<
Tooltip
title=
{
createTime
}
>
<
Tooltip
placement=
"bottom-start"
title=
{
createTime
}
>
<
Typography
<
Typography
component=
"span"
component=
"span"
variant=
"body2"
variant=
"body2"
...
@@ -269,8 +283,7 @@ export default function ShopProductCard({
...
@@ -269,8 +283,7 @@ export default function ShopProductCard({
padding=
{
"0 2px"
}
padding=
{
"0 2px"
}
>
>
<
Stack
direction=
{
"row"
}
spacing=
{
2
}
alignItems=
{
"center"
}
>
<
Stack
direction=
{
"row"
}
spacing=
{
2
}
alignItems=
{
"center"
}
>
{
type
===
1
&&
(
<
Tooltip
placement=
"bottom-start"
title=
"备课"
>
<
Tooltip
title=
"备课"
>
<
Stack
<
Stack
direction=
{
"row"
}
direction=
{
"row"
}
alignItems=
{
"center"
}
alignItems=
{
"center"
}
...
@@ -298,16 +311,16 @@ export default function ShopProductCard({
...
@@ -298,16 +311,16 @@ export default function ShopProductCard({
</
Typography
>
</
Typography
>
</
Stack
>
</
Stack
>
</
Tooltip
>
</
Tooltip
>
)
}
{
type
===
1
?
(
<
Tooltip
placement=
"bottom-start"
title=
"授权"
>
<
Tooltip
title=
"授权"
>
<
Stack
<
Stack
direction=
{
"row"
}
direction=
{
"row"
}
alignItems=
{
"center"
}
alignItems=
{
"center"
}
sx=
{
{
cursor
:
"pointer"
}
}
sx=
{
{
cursor
:
"pointer"
}
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
if
(
ifs
)
{
authorized
(
product
);
authorized
(
product
);
}
}
}
}
}
>
>
<
IconFont
<
IconFont
...
@@ -328,34 +341,78 @@ export default function ShopProductCard({
...
@@ -328,34 +341,78 @@ export default function ShopProductCard({
</
Typography
>
</
Typography
>
</
Stack
>
</
Stack
>
</
Tooltip
>
</
Tooltip
>
)
:
(
<
div
></
div
>
)
}
</
Stack
>
</
Stack
>
<
Stack
direction=
{
"row"
}
spacing=
{
1
}
>
<
Stack
direction=
{
"row"
}
spacing=
{
0
}
>
{
type
==
3
?
(
<
Tooltip
placement=
"bottom-start"
title=
{
ifs
?
"发布"
:
"暂停发布"
}
>
<
div
></
div
>
)
:
(
<
Tooltip
title=
{
type
==
1
?
"发布"
:
type
==
2
?
"取消发布"
:
""
}
>
<
IconButton
<
IconButton
style=
{
{
opacity
:
type
!==
5
&&
type
!==
4
?
1
:
0
,
pointerEvents
:
type
===
5
||
type
===
4
?
"none"
:
"auto"
,
}
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
publish
(
product
);
if
(
type
===
5
||
type
===
4
)
return
;
if
(
ifs
)
{
publish
(
product
,
{
type
:
2
});
}
else
{
publish
(
product
,
{
type
:
3
});
}
}
}
}
}
>
>
{
type
==
1
?
(
{
ifs
?
(
<
IconFont
<
IconFont
type=
"icon-fabu"
type=
"icon-fabu"
style=
{
{
fontSize
:
20
,
color
:
colors
.
blue
[
600
]
}
}
style=
{
{
fontSize
:
20
,
color
:
colors
.
blue
[
600
]
}
}
></
IconFont
>
></
IconFont
>
)
:
(
)
:
(
<
IconFont
<
PauseIcon
type=
"icon-undo"
style=
{
{
fontSize
:
20
,
color
:
colors
.
grey
[
900
]
}
}
style=
{
{
fontSize
:
20
,
color
:
colors
.
red
[
600
]
}
}
></
PauseIcon
>
></
IconFont
>
)
}
)
}
</
IconButton
>
</
IconButton
>
</
Tooltip
>
</
Tooltip
>
{
type
===
3
&&
(
<
Tooltip
placement=
"bottom-start"
title=
{
shut
?
"确认关闭"
:
"关闭"
}
>
{
shut
?
(
<
IconButton
disabled=
{
shut
===
"1"
}
onClick=
{
()
=>
{
publish
(
product
,
{
type
:
3
});
}
}
>
<
CheckIcon
style=
{
{
fontSize
:
20
,
color
:
shut
===
"1"
?
colors
.
grey
[
500
]
:
colors
.
green
[
500
],
}
}
></
CheckIcon
>
</
IconButton
>
)
:
(
<
IconButton
onClick=
{
()
=>
{
setshut
(
"1"
);
setTimeout
(()
=>
{
setshut
(
true
);
},
200
);
setTimeout
(()
=>
{
setshut
(
false
);
},
3000
);
}
}
>
<
CloseIcon
type=
"icon-guanbi"
style=
{
{
fontSize
:
20
,
color
:
"#ff4800"
}
}
></
CloseIcon
>
</
IconButton
>
)
}
</
Tooltip
>
)
}
)
}
</
Stack
>
</
Stack
>
</
Stack
>
</
Stack
>
...
...
src/components/TreeRender/index.jsx
View file @
a31a3320
...
@@ -64,10 +64,9 @@ function TreeRender({
...
@@ -64,10 +64,9 @@ function TreeRender({
});
});
const
[
expandall
,
setexpandall
]
=
useState
(
false
);
const
[
expandall
,
setexpandall
]
=
useState
(
false
);
const
[
expandedKeys
,
onExpand
]
=
useState
();
const
[
expandedKeys
,
onExpand
]
=
useState
();
const
{
data
,
refresh
}
=
useRequest
(()
=>
{
const
{
data
,
refresh
,
loading
}
=
useRequest
(()
=>
{
return
doFetch
({
url
,
params
:
params
??
{}
});
return
doFetch
({
url
,
params
:
params
??
{}
});
});
});
console
.
log
(
data
);
const
[
autoExpandParent
,
setAutoExpandParent
]
=
useState
(
true
);
const
[
autoExpandParent
,
setAutoExpandParent
]
=
useState
(
true
);
const
allkeys
=
useMemo
(()
=>
{
const
allkeys
=
useMemo
(()
=>
{
...
@@ -367,6 +366,9 @@ function TreeRender({
...
@@ -367,6 +366,9 @@ function TreeRender({
open
:
false
,
open
:
false
,
}));
}));
}
}
}
}
okButtonProps=
{
{
loading
,
}
}
onOk=
{
()
=>
{
onOk=
{
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
drawer
?.
item
)
{
if
(
drawer
?.
item
)
{
...
@@ -419,6 +421,9 @@ function TreeRender({
...
@@ -419,6 +421,9 @@ function TreeRender({
visible
:
false
,
visible
:
false
,
}));
}));
}
}
}
}
okButtonProps=
{
{
loading
,
}
}
onOk=
{
()
=>
{
onOk=
{
()
=>
{
if
(
modal
.
okText
==
"修改"
)
{
if
(
modal
.
okText
==
"修改"
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
src/components/TreeRender/sxtree.jsx
View file @
a31a3320
...
@@ -63,10 +63,9 @@ function TreeRender({
...
@@ -63,10 +63,9 @@ function TreeRender({
});
});
const
[
expandall
,
setexpandall
]
=
useState
(
false
);
const
[
expandall
,
setexpandall
]
=
useState
(
false
);
const
[
expandedKeys
,
onExpand
]
=
useState
();
const
[
expandedKeys
,
onExpand
]
=
useState
();
const
{
data
,
refresh
}
=
useRequest
(()
=>
{
const
{
data
,
refresh
,
loading
}
=
useRequest
(()
=>
{
return
doFetch
({
url
,
params
:
params
??
{}
});
return
doFetch
({
url
,
params
:
params
??
{}
});
});
});
console
.
log
(
data
);
const
[
autoExpandParent
,
setAutoExpandParent
]
=
useState
(
true
);
const
[
autoExpandParent
,
setAutoExpandParent
]
=
useState
(
true
);
const
allkeys
=
useMemo
(()
=>
{
const
allkeys
=
useMemo
(()
=>
{
...
@@ -341,6 +340,7 @@ function TreeRender({
...
@@ -341,6 +340,7 @@ function TreeRender({
>
>
<
AddIcon
style=
{
{
fontSize
:
20
,
color
:
colors
.
blue
[
600
]
}
}
></
AddIcon
>
<
AddIcon
style=
{
{
fontSize
:
20
,
color
:
colors
.
blue
[
600
]
}
}
></
AddIcon
>
</
IconButton
>
</
IconButton
>
<
Modal
<
Modal
{
...
drawer
}
{
...
drawer
}
closable=
{
false
}
closable=
{
false
}
...
@@ -354,6 +354,9 @@ function TreeRender({
...
@@ -354,6 +354,9 @@ function TreeRender({
open
:
false
,
open
:
false
,
}));
}));
}
}
}
}
okButtonProps=
{
{
loading
,
}
}
onOk=
{
()
=>
{
onOk=
{
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
drawer
?.
item
)
{
if
(
drawer
?.
item
)
{
...
@@ -406,6 +409,9 @@ function TreeRender({
...
@@ -406,6 +409,9 @@ function TreeRender({
visible
:
false
,
visible
:
false
,
}));
}));
}
}
}
}
okButtonProps=
{
{
loading
,
}
}
onOk=
{
()
=>
{
onOk=
{
()
=>
{
if
(
modal
.
okText
==
"修改"
)
{
if
(
modal
.
okText
==
"修改"
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
src/pages/bustrain/index.jsx
View file @
a31a3320
...
@@ -15,7 +15,6 @@ import { Empty, Input, message } from "antd";
...
@@ -15,7 +15,6 @@ import { Empty, Input, message } from "antd";
import
{
useMemo
,
useState
}
from
"react"
;
import
{
useMemo
,
useState
}
from
"react"
;
import
"./index.less"
;
import
"./index.less"
;
function
Lessons
()
{
function
Lessons
()
{
const
[
dialogprops
,
setdialogprops
]
=
useState
({
const
[
dialogprops
,
setdialogprops
]
=
useState
({
open
:
false
,
open
:
false
,
...
@@ -46,7 +45,6 @@ function Lessons() {
...
@@ -46,7 +45,6 @@ function Lessons() {
const
datalist
=
useRequest
(
const
datalist
=
useRequest
(
async
()
=>
{
async
()
=>
{
let
res
=
await
doFetch
({
url
:
"/busTrain/list"
,
params
});
let
res
=
await
doFetch
({
url
:
"/busTrain/list"
,
params
});
return
res
?.
data
?.
dataList
;
return
res
?.
data
?.
dataList
;
},
},
...
@@ -57,7 +55,6 @@ function Lessons() {
...
@@ -57,7 +55,6 @@ function Lessons() {
);
);
const
edit
=
(
row
)
=>
{
const
edit
=
(
row
)
=>
{
setdialogprops
({
setdialogprops
({
open
:
true
,
open
:
true
,
defaultFormValue
:
{
...
row
},
defaultFormValue
:
{
...
row
},
...
@@ -82,6 +79,23 @@ function Lessons() {
...
@@ -82,6 +79,23 @@ function Lessons() {
});
});
};
};
const
tauthorized
=
(
row
)
=>
{
doFetch
({
url
:
"/busTrainTeacher/queryRelationTeacher"
,
params
:
{
trainId
:
row
?.
id
},
}).
then
((
res
)
=>
{
if
(
res
.
code
===
"0000"
)
{
setdialogprops
({
open
:
true
,
maxWidth
:
"xl"
,
defaultFormValue
:
{
...
row
},
teacherIdList
:
res
?.
data
?.
dataList
,
title
:
"协作教师"
,
});
}
});
};
const
remove
=
(
row
)
=>
{
const
remove
=
(
row
)
=>
{
runAsync
({
runAsync
({
url
:
"/busTrain/delete"
,
url
:
"/busTrain/delete"
,
...
@@ -93,7 +107,7 @@ function Lessons() {
...
@@ -93,7 +107,7 @@ function Lessons() {
const
type
=
row
?.
type
===
1
?
2
:
row
?.
type
===
2
?
1
:
null
;
const
type
=
row
?.
type
===
1
?
2
:
row
?.
type
===
2
?
1
:
null
;
const
extra
=
params
??
{
type
};
const
extra
=
params
??
{
type
};
runAsync
({
runAsync
({
url
:
"/busTrain/
pubOrNotPub
"
,
url
:
"/busTrain/
updateType
"
,
params
:
{
id
:
row
.
id
,
...
extra
},
params
:
{
id
:
row
.
id
,
...
extra
},
});
});
};
};
...
@@ -188,6 +202,65 @@ function Lessons() {
...
@@ -188,6 +202,65 @@ function Lessons() {
});
});
}
}
}
}
></
InitForm
>
></
InitForm
>
)
:
dialogprops
?.
title
===
"协作教师"
?
(
<
InitForm
defaultFormValue=
{
{
teacherIdList
:
dialogprops
?.
teacherIdList
,
}
}
fields=
{
[
{
rowKey
:
"id"
,
rowName
:
"id"
,
valueType
:
"FormSelectList"
,
dataIndex
:
"teacherIdList"
,
colProps
:
{
span
:
24
,
},
columns
:
[
{
title
:
"账号"
,
key
:
"userAccount"
,
dataIndex
:
"userAccount"
,
editable
:
false
,
},
{
title
:
"教师姓名"
,
key
:
"name"
,
dataIndex
:
"name"
,
editable
:
false
,
},
{
title
:
"学校名称"
,
key
:
"schoolId"
,
dataIndex
:
"schoolName"
,
valueType
:
"select"
,
search
:
false
,
editable
:
false
,
},
{
title
:
"院系名称"
,
key
:
"departmentName"
,
dataIndex
:
"departmentName"
,
editable
:
false
,
},
],
path
:
"/user/getAllTeacherByCurrentTeacherSchool"
,
params
:
{
type
:
""
,
},
},
]
}
onFinish=
{
(
val
)
=>
{
const
teacherIdList
=
val
?.
teacherIdList
?.
map
((
it
)
=>
it
?.
id
);
runAsync
({
url
:
"/busTrainTeacher/relationTrainTeacher"
,
params
:
{
teacherIdList
,
trainId
:
dialogprops
?.
defaultFormValue
?.
id
,
},
});
}
}
/>
)
:
(
)
:
(
<
InitForm
<
InitForm
defaultFormValue=
{
{
defaultFormValue=
{
{
...
@@ -420,6 +493,7 @@ function Lessons() {
...
@@ -420,6 +493,7 @@ function Lessons() {
remove=
{
remove
}
remove=
{
remove
}
publish=
{
publish
}
publish=
{
publish
}
authorized=
{
authorized
}
authorized=
{
authorized
}
tauthorized=
{
tauthorized
}
/>
/>
</
Grid
>
</
Grid
>
))
))
...
...
src/pages/dobustrain/index.jsx
View file @
a31a3320
...
@@ -117,7 +117,7 @@ function Dolessons() {
...
@@ -117,7 +117,7 @@ function Dolessons() {
cancelText
:
"取消"
,
cancelText
:
"取消"
,
onConfirm
:
async
()
=>
{
onConfirm
:
async
()
=>
{
await
runAsync
({
await
runAsync
({
url
:
"/
course
Question/delete"
,
url
:
"/
busTrain
Question/delete"
,
params
:
{
id
:
row
?.
id
},
params
:
{
id
:
row
?.
id
},
});
});
},
},
...
@@ -328,7 +328,7 @@ function Dolessons() {
...
@@ -328,7 +328,7 @@ function Dolessons() {
],
],
},
},
]
}
]
}
path=
"/
course
Question/page"
path=
"/
busTrain
Question/page"
extraparams=
{
{
extraparams=
{
{
trainId
:
params
?.
id
,
trainId
:
params
?.
id
,
}
}
}
}
...
@@ -502,7 +502,7 @@ function Dolessons() {
...
@@ -502,7 +502,7 @@ function Dolessons() {
break
;
break
;
}
}
runAsync
({
runAsync
({
url
:
"/
course
Question/saveOrUpdate"
,
url
:
"/
busTrain
Question/saveOrUpdate"
,
params
:
postdata
,
params
:
postdata
,
});
});
}
}
}
}
...
...
src/pages/mybustrain/index.jsx
View file @
a31a3320
...
@@ -299,7 +299,6 @@ function Lessons() {
...
@@ -299,7 +299,6 @@ function Lessons() {
}
else
{
}
else
{
news
=
[...
news
,
val
];
news
=
[...
news
,
val
];
}
}
console
.
log
(
news
);
return
{
return
{
...
s
,
...
s
,
typeList
:
news
,
typeList
:
news
,
...
...
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