Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
admin-ci-test
Commits
10cebae0
提交
10cebae0
authored
6月 10, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:课程管理联调完成
上级
22137be3
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
84 行增加
和
16 行删除
+84
-16
mallManageType.ts
src/api/interface/mallManageType.ts
+43
-10
mallManage.ts
src/api/modules/mallManage.ts
+16
-1
index.tsx
src/components/richText/index.tsx
+3
-2
index.tsx
src/components/uploader/index.tsx
+1
-1
index.tsx
...pages/mallManage/courseManage/comp/addEditModal/index.tsx
+0
-0
index.tsx
src/pages/mallManage/courseManage/index.tsx
+21
-2
没有找到文件。
src/api/interface/mallManageType.ts
浏览文件 @
10cebae0
...
@@ -26,17 +26,50 @@ export type queryCurriculumInfoListType = InterListFunction<
...
@@ -26,17 +26,50 @@ export type queryCurriculumInfoListType = InterListFunction<
export
type
addCurriculumType
=
InterFunction
<
export
type
addCurriculumType
=
InterFunction
<
{
{
curriculumDesc
?:
string
;
curriculumDesc
?:
string
;
curriculumName
:
string
;
curriculumName
?
:
string
;
detailContent
?:
string
;
detailContent
?:
string
;
flightSkills
:
number
;
flightSkills
?
:
number
;
flightSkillsName1
:
string
;
flightSkillsName1
?
:
string
;
flightSkillsName2
:
string
;
flightSkillsName2
?
:
string
;
free
:
number
;
free
?
:
number
;
id
:
number
;
id
?:
number
|
null
;
price
:
number
;
price
?
:
number
;
supplierName
:
string
;
supplierName
?
:
string
;
surfaceUrl
:
string
;
surfaceUrl
?
:
string
;
videoUrl
:
string
;
videoUrl
?
:
string
;
},
},
NonNullable
<
unknown
>
NonNullable
<
unknown
>
>
;
>
;
// V1.0.1修改课程
export
type
updateCurriculumType
=
InterFunction
<
{
curriculumDesc
?:
string
;
curriculumName
?:
string
;
detailContent
?:
string
;
flightSkills
?:
number
;
flightSkillsName1
?:
string
;
flightSkillsName2
?:
string
;
free
?:
number
;
id
:
number
|
null
;
price
?:
number
;
supplierName
?:
string
;
surfaceUrl
?:
string
;
videoUrl
?:
string
;
},
NonNullable
<
unknown
>
>
;
// V1.0.1课程技能列表
export
type
treeCurriculumSkillType
=
InterFunction
<
NonNullable
<
unknown
>
,
{
id
:
number
;
skillsName
:
string
;
flightSkills
:
Array
<
{
id
:
number
;
skillsName
:
string
;
flightSkills
:
null
;
}
>
;
}[]
>
;
// V1.0.1删除课程
export
type
removeCurriculumType
=
InterFunction
<
{
id
:
number
},
NonNullable
<
unknown
>>
;
src/api/modules/mallManage.ts
浏览文件 @
10cebae0
import
axios
from
'~/api/request'
;
import
axios
from
'~/api/request'
;
import
{
addCurriculumType
,
queryCurriculumInfoListType
}
from
'~/api/interface/mallManageType'
;
import
{
addCurriculumType
,
queryCurriculumInfoListType
,
removeCurriculumType
,
treeCurriculumSkillType
,
updateCurriculumType
,
}
from
'~/api/interface/mallManageType'
;
export
class
MallManageAPI
{
export
class
MallManageAPI
{
// V1.0.1课程视频列表
// V1.0.1课程视频列表
...
@@ -8,4 +14,13 @@ export class MallManageAPI {
...
@@ -8,4 +14,13 @@ export class MallManageAPI {
// V1.0.1新增课程
// V1.0.1新增课程
static
addCurriculum
:
addCurriculumType
=
(
params
)
=>
static
addCurriculum
:
addCurriculumType
=
(
params
)
=>
axios
.
post
(
'/release/curriculum/addCurriculum'
,
params
);
axios
.
post
(
'/release/curriculum/addCurriculum'
,
params
);
// V1.0.1修改课程
static
updateCurriculum
:
updateCurriculumType
=
(
params
)
=>
axios
.
post
(
'/release/curriculum/updateCurriculum'
,
params
);
// V1.0.1课程技能列表
static
treeCurriculumSkill
:
treeCurriculumSkillType
=
(
params
)
=>
axios
.
get
(
'/release/curriculum/treeCurriculumSkill'
,
{
params
});
// V1.0.1删除课程
static
removeCurriculum
:
removeCurriculumType
=
(
params
)
=>
axios
.
get
(
'/release/curriculum/removeCurriculum'
,
{
params
});
}
}
src/components/richText/index.tsx
浏览文件 @
10cebae0
...
@@ -11,15 +11,16 @@ interface PropsType {
...
@@ -11,15 +11,16 @@ interface PropsType {
value
:
string
;
value
:
string
;
// eslint-disable-next-line react/require-default-props
// eslint-disable-next-line react/require-default-props
isDetail
?:
boolean
;
isDetail
?:
boolean
;
height
?:
number
;
}
}
const
RichText
:
React
.
FC
<
PropsType
>
=
({
onChange
,
value
,
isDetail
})
=>
{
const
RichText
:
React
.
FC
<
PropsType
>
=
({
onChange
,
value
,
isDetail
,
height
})
=>
{
useEffect
(()
=>
{
useEffect
(()
=>
{
// 注:class写法需要在componentDidMount 创建编辑器
// 注:class写法需要在componentDidMount 创建编辑器
editor
=
new
E
(
'.edit'
);
editor
=
new
E
(
'.edit'
);
editor
.
config
.
uploadImgShowBase64
=
false
;
editor
.
config
.
uploadImgShowBase64
=
false
;
editor
.
config
.
zIndex
=
1
;
editor
.
config
.
zIndex
=
1
;
editor
.
config
.
height
=
550
;
editor
.
config
.
height
=
height
?
height
:
550
;
editor
.
config
.
uploadImgMaxLength
=
5
;
editor
.
config
.
uploadImgMaxLength
=
5
;
editor
.
config
.
uploadImgMaxSize
=
1024
*
1024
*
3
;
// 2M
editor
.
config
.
uploadImgMaxSize
=
1024
*
1024
*
3
;
// 2M
editor
.
config
.
customUploadImg
=
async
(
resultFiles
:
any
,
insertImgFn
:
any
)
=>
{
editor
.
config
.
customUploadImg
=
async
(
resultFiles
:
any
,
insertImgFn
:
any
)
=>
{
...
...
src/components/uploader/index.tsx
浏览文件 @
10cebae0
...
@@ -22,7 +22,7 @@ interface PropsType {
...
@@ -22,7 +22,7 @@ interface PropsType {
}
}
export
const
Uploader
:
React
.
FC
<
PropsType
>
=
(
props
)
=>
{
export
const
Uploader
:
React
.
FC
<
PropsType
>
=
(
props
)
=>
{
Uploader
.
defaultProps
=
{
Uploader
.
defaultProps
=
{
listType
:
'
text
'
,
listType
:
'
picture-card
'
,
fileSize
:
2
,
fileSize
:
2
,
fileLength
:
1
,
fileLength
:
1
,
fileType
:
[
fileType
:
[
...
...
src/pages/mallManage/courseManage/comp/addEditModal/index.tsx
浏览文件 @
10cebae0
差异被折叠。
点击展开。
src/pages/mallManage/courseManage/index.tsx
浏览文件 @
10cebae0
import
{
useEffect
,
useState
}
from
'react'
;
import
{
useEffect
,
useState
}
from
'react'
;
import
SearchBox
from
'~/components/search-box'
;
import
SearchBox
from
'~/components/search-box'
;
import
{
Button
,
Table
,
Image
}
from
'antd'
;
import
{
Button
,
Table
,
Image
,
message
,
Modal
}
from
'antd'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
queryCurriculumInfoListType
}
from
'~/api/interface/mallManageType'
;
import
{
queryCurriculumInfoListType
}
from
'~/api/interface/mallManageType'
;
import
{
InterListType
,
InterReqType
}
from
'~/api/interface'
;
import
{
InterListType
,
InterReqType
}
from
'~/api/interface'
;
...
@@ -16,6 +16,7 @@ type ReqType = InterReqType<queryCurriculumInfoListType>;
...
@@ -16,6 +16,7 @@ type ReqType = InterReqType<queryCurriculumInfoListType>;
let
query
:
ReqType
=
{};
let
query
:
ReqType
=
{};
const
CourseManageView
=
()
=>
{
const
CourseManageView
=
()
=>
{
const
{
confirm
}
=
Modal
;
// 是否打开变更弹窗
// 是否打开变更弹窗
const
[
isAddEditVisModal
,
setIsAddEditVisModal
]
=
useState
<
boolean
>
(
false
);
const
[
isAddEditVisModal
,
setIsAddEditVisModal
]
=
useState
<
boolean
>
(
false
);
// 表格分页配置
// 表格分页配置
...
@@ -60,6 +61,23 @@ const CourseManageView = () => {
...
@@ -60,6 +61,23 @@ const CourseManageView = () => {
query
=
data
;
query
=
data
;
getTableList
(
data
).
then
();
getTableList
(
data
).
then
();
};
};
// 删除数据
const
handleDelete
=
(
value
:
TableType
[
0
])
=>
{
confirm
({
title
:
'提示'
,
content
:
'是否删除该课程?'
,
onOk
:
async
()
=>
{
const
res
=
await
MallManageAPI
.
removeCurriculum
({
id
:
value
.
id
});
if
(
res
&&
res
.
code
===
'200'
)
{
message
.
success
(
'删除成功'
);
paginationChange
(
tableData
.
length
===
1
?
pagination
.
current
-
1
:
pagination
.
current
,
pagination
.
pageSize
,
);
}
},
});
};
// 表格结构
// 表格结构
const
columns
:
ColumnsType
<
TableType
[
0
]
>
=
[
const
columns
:
ColumnsType
<
TableType
[
0
]
>
=
[
{
{
...
@@ -114,7 +132,7 @@ const CourseManageView = () => {
...
@@ -114,7 +132,7 @@ const CourseManageView = () => {
>
>
编辑
编辑
</
Button
>
</
Button
>
<
Button
type=
{
'link'
}
danger
>
<
Button
type=
{
'link'
}
danger
onClick=
{
()
=>
handleDelete
(
record
)
}
>
删除
删除
</
Button
>
</
Button
>
</>
</>
...
@@ -184,6 +202,7 @@ const CourseManageView = () => {
...
@@ -184,6 +202,7 @@ const CourseManageView = () => {
<
AddEditModal
<
AddEditModal
open=
{
isAddEditVisModal
}
open=
{
isAddEditVisModal
}
closed=
{
()
=>
{
closed=
{
()
=>
{
setEditData
(
undefined
);
setIsAddEditVisModal
(
false
);
setIsAddEditVisModal
(
false
);
paginationChange
(
pagination
.
current
,
pagination
.
pageSize
);
paginationChange
(
pagination
.
current
,
pagination
.
pageSize
);
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论