Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
admin-ci-test
Commits
07573887
提交
07573887
authored
6月 14, 2023
作者:
龚洪江
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:服务管理
上级
2b74ce98
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
73 行增加
和
14 行删除
+73
-14
mallManageType.ts
src/api/interface/mallManageType.ts
+14
-0
mallManage.ts
src/api/modules/mallManage.ts
+4
-0
index.tsx
...ge/serviceList/components/addOrEditServiceModal/index.tsx
+30
-13
index.tsx
src/pages/mallManage/serviceManage/serviceList/index.tsx
+25
-1
没有找到文件。
src/api/interface/mallManageType.ts
浏览文件 @
07573887
...
...
@@ -97,3 +97,17 @@ export type queryCategoryInfoByType = InterFunction<
}
>
;
}[]
>
;
//服务-新增
export
type
addServiceType
=
InterFunction
<
{
applicationId
:
number
;
coverPlan
:
string
;
displayState
:
number
;
industryId
:
number
;
serviceIntroduction
?:
string
;
serviceName
:
string
;
shareCard
:
string
;
video
:
string
;
},
any
>
;
src/api/modules/mallManage.ts
浏览文件 @
07573887
import
axios
from
'~/api/request'
;
import
{
addCurriculumType
,
addServiceType
,
queryCategoryInfoByType
,
queryCurriculumInfoListType
,
removeCurriculumType
,
...
...
@@ -28,4 +29,7 @@ export class MallManageAPI {
// 根据类型获取各个目录及分类信息
static
queryCategoryInfoByType
:
queryCategoryInfoByType
=
(
params
)
=>
axios
.
get
(
'/pms/classify/queryCategoryInfoByType'
,
{
params
});
// 服务-新增
static
addService
:
addServiceType
=
(
data
)
=>
axios
.
post
(
'/pms/backstage/work/addWorkService'
,
data
);
}
src/pages/mallManage/serviceManage/serviceList/components/addOrEditServiceModal/index.tsx
浏览文件 @
07573887
...
...
@@ -2,47 +2,64 @@ import { FC } from 'react';
import
{
Button
,
Col
,
Form
,
Input
,
Modal
,
Row
,
Select
,
Upload
}
from
'antd'
;
import
{
ModalProps
}
from
'antd'
;
import
{
UploadOutlined
}
from
'@ant-design/icons'
;
import
{
Uploader
}
from
'~/components/uploader'
;
const
AddOrEditServiceModal
:
FC
<
ModalProps
>
=
({
open
,
title
,
onCancel
})
=>
{
return
(
<
Modal
open=
{
open
}
title=
{
title
}
onCancel=
{
onCancel
}
>
<
Form
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
16
}
}
>
<
Form
.
Item
label=
'服务名称'
>
<
Form
.
Item
label=
'服务名称'
name=
'serviceName'
rules=
{
[{
required
:
true
,
message
:
'请输入服务名称'
}]
}
>
<
Input
placeholder=
'请输入服务名称'
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'应用'
>
<
Form
.
Item
label=
'应用'
name=
'applicationId'
rules=
{
[{
required
:
true
,
message
:
'请选择应用'
}]
}
>
<
Select
placeholder=
'请选择应用'
>
<
Select
.
Option
>
111
</
Select
.
Option
>
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
label=
'对应行业'
>
<
Form
.
Item
label=
'对应行业'
name=
'industryId'
rules=
{
[{
required
:
true
,
message
:
'请选择对应行业'
}]
}
>
<
Select
placeholder=
'请选择对应行业'
>
<
Select
.
Option
>
111
</
Select
.
Option
>
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
label=
'封面图'
>
<
Upload
listType=
'picture-card'
>
<
Form
.
Item
label=
'封面图'
name=
'coverPlan'
rules=
{
[{
required
:
true
,
message
:
'请上传封面图'
}]
}
>
<
Uploader
listType=
'picture-card'
fileUpload
>
<
UploadOutlined
/>
</
Upload
>
</
Upload
er
>
</
Form
.
Item
>
<
Form
.
Item
label=
'分享卡片'
>
<
Upload
listType=
'picture-card'
>
<
Form
.
Item
label=
'分享卡片'
name=
'shareCard'
>
<
Upload
er
listType=
'picture-card'
fileUpload
>
<
UploadOutlined
/>
</
Upload
>
</
Upload
er
>
</
Form
.
Item
>
<
Form
.
Item
label=
'视频'
>
<
Form
.
Item
label=
'视频'
name=
'video'
>
<
Row
>
<
Col
></
Col
>
<
Col
>
<
Upload
>
<
Upload
er
listType=
'text'
fileUpload
>
<
Button
icon=
{
<
UploadOutlined
/>
}
size=
'small'
type=
'primary'
>
上传
</
Button
>
</
Upload
>
</
Upload
er
>
</
Col
>
</
Row
>
</
Form
.
Item
>
<
Form
.
Item
label=
'展示状态'
>
<
Form
.
Item
label=
'展示状态'
name=
'displayState'
>
<
Select
placeholder=
'请选择展示状态'
>
<
Select
.
Option
>
上架
</
Select
.
Option
>
<
Select
.
Option
>
下架
</
Select
.
Option
>
...
...
src/pages/mallManage/serviceManage/serviceList/index.tsx
浏览文件 @
07573887
import
{
FC
,
useState
}
from
'react'
;
import
{
FC
,
use
Effect
,
use
State
}
from
'react'
;
import
{
useNavigate
}
from
'react-router-dom'
;
import
{
searchColumns
}
from
'~/components/search-box'
;
import
SearchBox
from
'~/components/search-box'
;
...
...
@@ -11,6 +11,12 @@ import {
DeleteOutlined
,
}
from
'@ant-design/icons'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
{
CategoryManageAPI
}
from
'~/api'
;
import
{
InterDataType
}
from
'~/api/interface'
;
import
{
categoryListType
}
from
'~/api/interface/categoryManage'
;
//分类返回类型
type
categoryType
=
InterDataType
<
categoryListType
>
[
'list'
];
const
ServiceList
:
FC
<
any
>
=
()
=>
{
const
navigate
=
useNavigate
();
...
...
@@ -82,6 +88,8 @@ const ServiceList: FC<any> = () => {
},
];
const
[
tableData
]
=
useState
<
{
id
:
number
}[]
>
([{
id
:
1
}]);
//行业分类列表
const
[
industryCategoryList
,
setIndustryCategoryList
]
=
useState
<
categoryType
>
([]);
//新增、编辑服务弹窗
const
[
addOrEditServiceModalOpen
,
setAddOrEditServiceModalOpen
]
=
useState
<
boolean
>
(
false
);
const
[
addOrEditServiceModalTitle
,
setAddOrEditServiceModalTitle
]
=
useState
<
string
>
(
'新增服务'
);
...
...
@@ -98,6 +106,18 @@ const ServiceList: FC<any> = () => {
const
addOrEditServiceModalCancel
=
()
=>
{
setAddOrEditServiceModalOpen
(
false
);
};
//行业分类列表
const
getIndustryCategoryList
=
()
=>
{
CategoryManageAPI
.
getCategoryList
({
directoryId
:
2
,
pageSize
:
99999
,
pageNo
:
1
}).
then
(
()
=>
{},
);
};
//应用分类列表
const
getApplicationCategoryList
=
()
=>
{
CategoryManageAPI
.
getCategoryList
({
directoryId
:
3
,
pageSize
:
99999
,
pageNo
:
1
}).
then
(
()
=>
{},
);
};
//服务详情
const
toServiceDetail
=
()
=>
{
navigate
({
pathname
:
'/mallManage/serviceDetail'
});
...
...
@@ -106,6 +126,10 @@ const ServiceList: FC<any> = () => {
const
toServiceIntroduce
=
()
=>
{
navigate
({
pathname
:
'/mallManage/serviceIntroduce'
});
};
useEffect
(()
=>
{
getIndustryCategoryList
();
getApplicationCategoryList
();
},
[]);
return
(
<
div
className=
'service-list'
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论