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
d146a050
Commit
d146a050
authored
May 06, 2023
by
krysent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ccc
parent
480ef123
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1729 additions
and
36 deletions
+1729
-36
index.jsx
src/components/InitForm/EditTable/index.jsx
+1
-1
index.jsx
src/components/InitForm/index.jsx
+7
-3
index.jsx
src/components/ProductCard/index.jsx
+6
-2
index.css
src/components/TreeRender/index.css
+0
-0
index.jsx
src/components/TreeRender/index.jsx
+548
-0
index.less
src/components/TreeRender/index.less
+0
-0
global.css
src/global.css
+535
-0
global.less
src/global.less
+12
-0
index.jsx
src/pages/dolessons/index.jsx
+510
-6
index.jsx
src/pages/lessons/index.jsx
+101
-24
editorIsNull.js
src/utils/editorIsNull.js
+9
-0
No files found.
src/components/InitForm/EditTable/index.jsx
View file @
d146a050
...
@@ -41,7 +41,7 @@ const EditTable = (props) => {
...
@@ -41,7 +41,7 @@ const EditTable = (props) => {
}
}
const
result
=
await
doFetch
({
url
:
path
,
params
:
newparams
});
const
result
=
await
doFetch
({
url
:
path
,
params
:
newparams
});
//分页结果
//分页结果
let
data
=
result
?.
data
?.
page
?.
list
,
let
data
=
result
?.
data
?.
page
?.
records
,
success
=
true
,
success
=
true
,
total
=
result
?.
data
?.
page
?.
total
;
total
=
result
?.
data
?.
page
?.
total
;
//不带分页获取结果
//不带分页获取结果
...
...
src/components/InitForm/index.jsx
View file @
d146a050
...
@@ -85,8 +85,8 @@ let FormRender = memo(({ fields = [], colProps, proformRef }) => {
...
@@ -85,8 +85,8 @@ let FormRender = memo(({ fields = [], colProps, proformRef }) => {
function
InitForm
({
function
InitForm
({
formRef
,
formRef
,
onFinish
=
(
vals
,
extra
)
=>
{
onFinish
=
(
vals
,
extra
)
=>
{
console
.
log
(
vals
,
extra
);
console
.
log
(
vals
,
extra
);
},
},
formKey
,
formKey
,
params
=
{},
params
=
{},
...
@@ -115,6 +115,7 @@ function InitForm({
...
@@ -115,6 +115,7 @@ function InitForm({
?
submitter
?
submitter
:
{
:
{
render
:
(
props
,
doms
)
=>
{
render
:
(
props
,
doms
)
=>
{
console
.
log
(
"submitterProps"
,
props
);
return
[
return
[
<
Button
<
Button
type=
"reset"
type=
"reset"
...
@@ -127,7 +128,10 @@ function InitForm({
...
@@ -127,7 +128,10 @@ function InitForm({
type=
"submit"
type=
"submit"
key=
"submit"
key=
"submit"
variant=
"contained"
variant=
"contained"
onClick=
{
()
=>
props
.
form
?.
submit
?.()
}
onClick=
{
(
e
)
=>
{
e
.
preventDefault
();
return
props
.
form
?.
submit
?.()
}
}
>
>
提交
提交
</
Button
>,
</
Button
>,
...
...
src/components/ProductCard/index.jsx
View file @
d146a050
...
@@ -39,7 +39,7 @@ ShopProductCard.propTypes = {
...
@@ -39,7 +39,7 @@ ShopProductCard.propTypes = {
product
:
PropTypes
.
object
,
product
:
PropTypes
.
object
,
};
};
export
default
function
ShopProductCard
({
product
,
remove
,
edit
,
publish
})
{
export
default
function
ShopProductCard
({
product
,
remove
,
edit
,
publish
,
authorized
})
{
const
{
courseName
,
picUrl
,
createTime
,
statusName
,
type
}
=
product
;
const
{
courseName
,
picUrl
,
createTime
,
statusName
,
type
}
=
product
;
const
[
confirm
,
setconfirm
]
=
useState
(
false
);
const
[
confirm
,
setconfirm
]
=
useState
(
false
);
const
[
shut
,
setshut
]
=
useState
(
false
);
const
[
shut
,
setshut
]
=
useState
(
false
);
...
@@ -143,7 +143,11 @@ export default function ShopProductCard({ product, remove, edit, publish }) {
...
@@ -143,7 +143,11 @@ export default function ShopProductCard({ product, remove, edit, publish }) {
</
IconButton
>
</
IconButton
>
</
Tooltip
>
</
Tooltip
>
<
Tooltip
title=
"授权"
>
<
Tooltip
title=
"授权"
>
<
IconButton
>
<
IconButton
onClick=
{
()
=>
{
authorized
(
product
)
}
}
>
<
IconFont
<
IconFont
type=
"icon-shouquanguanli"
type=
"icon-shouquanguanli"
style=
{
{
fontSize
:
20
,
color
:
"#ffffff"
}
}
style=
{
{
fontSize
:
20
,
color
:
"#ffffff"
}
}
...
...
src/components/TreeRender/index.css
0 → 100644
View file @
d146a050
src/components/TreeRender/index.jsx
0 → 100644
View file @
d146a050
This diff is collapsed.
Click to expand it.
src/components/TreeRender/index.less
0 → 100644
View file @
d146a050
src/global.css
0 → 100644
View file @
d146a050
This diff is collapsed.
Click to expand it.
src/global.less
View file @
d146a050
...
@@ -608,3 +608,15 @@ h4 {
...
@@ -608,3 +608,15 @@ h4 {
}
}
}
}
}
}
.selecttable {
.ant-pro-table-list-toolbar-container{
margin-bottom: 24px!important;
}
.ant-pagination-options {
>div{
width: auto!important;
}
}
}
\ No newline at end of file
src/pages/dolessons/index.jsx
View file @
d146a050
This diff is collapsed.
Click to expand it.
src/pages/lessons/index.jsx
View file @
d146a050
...
@@ -9,11 +9,10 @@ import PRODUCTS from "@/_mock/products";
...
@@ -9,11 +9,10 @@ import PRODUCTS from "@/_mock/products";
import
{
Box
,
Container
,
Grid
,
Stack
,
Typography
}
from
"@mui/material"
;
import
{
Box
,
Container
,
Grid
,
Stack
,
Typography
}
from
"@mui/material"
;
import
{
useRequest
}
from
"ahooks"
;
import
{
useRequest
}
from
"ahooks"
;
import
{
Empty
,
message
}
from
"antd"
;
import
{
Empty
,
message
}
from
"antd"
;
import
{
useMemo
,
use
Ref
,
use
State
}
from
"react"
;
import
{
useMemo
,
useState
}
from
"react"
;
import
"./index.less"
;
import
"./index.less"
;
function
Lessons
()
{
function
Lessons
()
{
const
actionRef
=
useRef
();
const
[
dialogprops
,
setdialogprops
]
=
useState
({
const
[
dialogprops
,
setdialogprops
]
=
useState
({
open
:
false
,
open
:
false
,
});
});
...
@@ -59,6 +58,24 @@ function Lessons() {
...
@@ -59,6 +58,24 @@ function Lessons() {
});
});
};
};
const
authorized
=
(
row
)
=>
{
doFetch
({
url
:
"/sysCourseTeacher/queryRelationTeacher"
,
params
:
{
courseId
:
row
?.
id
},
}).
then
((
res
)
=>
{
if
(
res
.
code
===
"0000"
)
{
console
.
log
(
res
?.
data
?.
dataList
);
setdialogprops
({
open
:
true
,
maxWidth
:
"xl"
,
defaultFormValue
:
{
...
row
},
teacherIdList
:
res
?.
data
?.
dataList
,
title
:
"授权"
,
});
}
});
};
const
remove
=
(
row
)
=>
{
const
remove
=
(
row
)
=>
{
runAsync
({
runAsync
({
url
:
"/sysCourse/delete"
,
url
:
"/sysCourse/delete"
,
...
@@ -109,29 +126,88 @@ function Lessons() {
...
@@ -109,29 +126,88 @@ function Lessons() {
dialogprops=
{
dialogprops
}
dialogprops=
{
dialogprops
}
maxWidth=
{
dialogprops
?.
maxWidth
??
"xs"
}
maxWidth=
{
dialogprops
?.
maxWidth
??
"xs"
}
>
>
<
InitForm
{
dialogprops
?.
title
===
"编辑"
?
(
fields=
{
columns
}
<
InitForm
defaultFormValue=
{
dialogprops
?.
defaultFormValue
}
fields=
{
columns
}
onFinish=
{
(
val
,
extra
)
=>
{
defaultFormValue=
{
dialogprops
?.
defaultFormValue
}
let
postdata
=
{
...
val
};
onFinish=
{
(
val
,
extra
)
=>
{
switch
(
dialogprops
?.
title
)
{
let
postdata
=
{
...
val
};
case
"编辑"
:
switch
(
dialogprops
?.
title
)
{
postdata
=
{
case
"编辑"
:
...
val
,
postdata
=
{
id
:
dialogprops
?.
defaultFormValue
?.
id
,
...
val
,
};
id
:
dialogprops
?.
defaultFormValue
?.
id
,
break
;
};
default
:
break
;
break
;
default
:
}
break
;
runAsync
({
}
url
:
"/sysCourse/saveOrUpdate"
,
runAsync
({
params
:
postdata
,
url
:
"/sysCourse/saveOrUpdate"
,
});
params
:
postdata
,
}
}
});
></
InitForm
>
}
}
></
InitForm
>
)
:
(
<
InitForm
// defaultFormValue=
{{
// teacherIdList: dialogprops?.teacherIdList,
//
}}
fields=
{
[
{
rowKey
:
"id"
,
rowName
:
"id"
,
valueType
:
"FormSelectList"
,
dataIndex
:
"teacherIdList"
,
colProps
:
{
span
:
24
,
},
columns
:
[
{
title
:
"账号"
,
key
:
"userAccount"
,
dataIndex
:
"userAccount"
,
readonly
:
true
,
},
{
title
:
"教师姓名"
,
key
:
"name"
,
dataIndex
:
"name"
,
readonly
:
true
,
},
{
title
:
"学校名称"
,
key
:
"schoolName"
,
dataIndex
:
"schoolName"
,
readonly
:
true
,
},
{
title
:
"院系名称"
,
key
:
"departmentName"
,
dataIndex
:
"departmentName"
,
readonly
:
true
,
},
],
path
:
"/user/page"
,
params
:
{
type
:
"2"
,
},
},
]
}
onFinish=
{
(
val
)
=>
{
console
.
log
(
val
);
const
teacherIdList
=
val
?.
teacherIdList
?.
map
((
it
)
=>
it
?.
id
);
runAsync
({
url
:
"/sysCourseTeacher/relationCourseTeacher"
,
params
:
{
teacherIdList
,
courseId
:
dialogprops
?.
defaultFormValue
?.
id
,
},
});
}
}
/>
)
}
</
DraggableDialog
>
</
DraggableDialog
>
<
Box
<
Box
display=
{
"flex"
}
display=
{
"flex"
}
justifyContent=
{
"space-between"
}
justifyContent=
{
"space-between"
}
...
@@ -183,6 +259,7 @@ function Lessons() {
...
@@ -183,6 +259,7 @@ function Lessons() {
edit=
{
edit
}
edit=
{
edit
}
remove=
{
remove
}
remove=
{
remove
}
publish=
{
publish
}
publish=
{
publish
}
authorized=
{
authorized
}
/>
/>
</
Grid
>
</
Grid
>
))
))
...
...
src/utils/editorIsNull.js
0 → 100644
View file @
d146a050
// 传入富文本内容 string , 判断当前富文本是否有输入内容
export
default
(
content
)
=>
{
let
filterContent
=
content
.
replace
(
/<
[^
<>
]
+>/g
,
""
).
replace
(
/ /gi
,
""
);
if
(
filterContent
==
""
)
return
true
;
let
regu
=
"^[ ]+$"
;
let
re
=
new
RegExp
(
regu
);
return
re
.
test
(
filterContent
);
};
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