Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
ef1aece3
提交
ef1aece3
authored
6月 14, 2023
作者:
龚洪江
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:服务管理
上级
ed945fa9
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
166 行增加
和
48 行删除
+166
-48
index.tsx
...ponents/goods/commonAddOrEdit/addOrEditSkuModal/index.tsx
+22
-22
index.tsx
src/components/goods/commonAddOrEdit/baseInfo/index.tsx
+1
-0
index.tsx
src/components/uploader/index.tsx
+1
-11
index.tsx
...ges/mallManage/mallGoods/goodsAddOrEditOrDetail/index.tsx
+1
-1
index.tsx
...ages/mallManage/rentGoods/rentAddOrEditOrDetail/index.tsx
+1
-1
index.tsx
...ge/serviceList/components/addOrEditServiceModal/index.tsx
+117
-10
index.tsx
src/pages/mallManage/serviceManage/serviceList/index.tsx
+23
-3
没有找到文件。
src/components/goods/commonAddOrEdit/addOrEditSkuModal/index.tsx
浏览文件 @
ef1aece3
...
...
@@ -190,27 +190,27 @@ const AddOrEditSkuModal: React.FC<ModalProps & selfProps> = ({
setIsCustomProd
(
e
.
target
.
value
===
1
);
};
// // 清除表单
//
const onCancel = () => {
//
// 关闭前恢复初始值
//
skuForm.resetFields();
//
selfProduct.resetFields();
//
setSelfProductData([
//
{
//
id: 1,
//
specName: '',
//
partNo: '',
//
specImage: '',
//
fileList: [],
//
productSpecCPQVO: {},
//
},
//
]);
//
setCustomRowData({
//
id: -1,
//
productSpecCPQVO: {},
//
});
//
setIsCustomProd(false);
//
handleCancel();
//
};
const
onCancel
=
()
=>
{
// 关闭前恢复初始值
skuForm
.
resetFields
();
selfProduct
.
resetFields
();
setSelfProductData
([
{
id
:
1
,
specName
:
''
,
partNo
:
''
,
specImage
:
''
,
fileList
:
[],
productSpecCPQVO
:
{},
},
]);
setCustomRowData
({
id
:
-
1
,
productSpecCPQVO
:
{},
});
setIsCustomProd
(
false
);
handleCancel
();
};
//获取产品列表
const
getProductList
=
(
categoryId
:
number
)
=>
{
ProduceManageAPI
.
listPageProductSku
({
pageNo
:
1
,
pageSize
:
9999
,
categoryId
}).
then
(
...
...
@@ -433,7 +433,7 @@ const AddOrEditSkuModal: React.FC<ModalProps & selfProps> = ({
open=
{
open
}
title=
{
`${dialogTitle}规格`
}
onOk=
{
()
=>
submitSku
()
}
onCancel=
{
()
=>
handleCancel
()
}
onCancel=
{
onCancel
}
width=
{
820
}
destroyOnClose
>
...
...
src/components/goods/commonAddOrEdit/baseInfo/index.tsx
浏览文件 @
ef1aece3
...
...
@@ -244,6 +244,7 @@ const BaseInfo: React.FC<selfProps> = forwardRef(
fileUpload
onChange=
{
videoUploadSuccess
}
defaultFileList=
{
videoList
}
fileType=
{
[
'video/mp4'
,
'video/avi'
,
'video/wmv'
,
'video/rmvb'
]
}
fileSize=
{
50
}
>
{
isDetail
?
(
...
...
src/components/uploader/index.tsx
浏览文件 @
ef1aece3
...
...
@@ -25,17 +25,7 @@ export const Uploader: React.FC<PropsType> = (props) => {
listType
:
'picture-card'
,
fileSize
:
2
,
fileLength
:
1
,
fileType
:
[
'image/png'
,
'image/jpeg'
,
'image/jpg'
,
'image/gif'
,
'image/bmp'
,
'video/mp4'
,
'video/avi'
,
'video/mov'
,
'video/mkv'
,
],
fileType
:
[
'image/png'
,
'image/jpeg'
,
'image/jpg'
,
'image/gif'
],
// eslint-disable-next-line @typescript-eslint/no-empty-function
onChange
:
()
=>
{},
defaultFileList
:
[],
...
...
src/pages/mallManage/mallGoods/goodsAddOrEditOrDetail/index.tsx
浏览文件 @
ef1aece3
...
...
@@ -192,7 +192,7 @@ const GoodsAddOrEditOrDetail = () => {
}
//分类
values
.
categoryByOne
=
values
.
masterTypeId
[
0
];
values
.
categoryByT
ne
=
values
.
masterTypeId
[
1
]
||
undefined
;
values
.
categoryByT
wo
=
values
.
masterTypeId
[
1
]
||
undefined
;
// 过滤对象属性
const
goodsSpecVO
:
specEntity
[]
=
specData
.
reduce
((
pre
:
any
,
cur
:
specEntity
)
=>
{
cur
.
customizeInfo
=
cur
.
customizeInfo
?.
reduce
((
cusPre
:
any
,
cusCur
:
customizeEntity
)
=>
{
...
...
src/pages/mallManage/rentGoods/rentAddOrEditOrDetail/index.tsx
浏览文件 @
ef1aece3
...
...
@@ -192,7 +192,7 @@ const GoodsAddOrEditOrDetail = () => {
}
//分类
values
.
categoryByOne
=
values
.
masterTypeId
[
0
];
values
.
categoryByT
ne
=
values
.
masterTypeId
[
1
]
||
undefined
;
values
.
categoryByT
wo
=
values
.
masterTypeId
[
1
]
||
undefined
;
// 过滤对象属性
const
goodsSpecVO
:
specEntity
[]
=
specData
.
reduce
((
pre
:
any
,
cur
:
specEntity
)
=>
{
cur
.
customizeInfo
=
cur
.
customizeInfo
?.
reduce
((
cusPre
:
any
,
cusCur
:
customizeEntity
)
=>
{
...
...
src/pages/mallManage/serviceManage/serviceList/components/addOrEditServiceModal/index.tsx
浏览文件 @
ef1aece3
import
{
FC
}
from
'react'
;
import
{
FC
,
useState
}
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'
;
import
{
InterDataType
,
InterReqType
}
from
'~/api/interface'
;
import
{
categoryListType
}
from
'~/api/interface/categoryManage'
;
import
{
addServiceType
}
from
'~/api/interface/mallManageType'
;
const
AddOrEditServiceModal
:
FC
<
ModalProps
>
=
({
open
,
title
,
onCancel
})
=>
{
//分类返回类型
type
categoryType
=
InterDataType
<
categoryListType
>
[
'list'
];
interface
selfProps
{
industryCategoryList
:
categoryType
;
applicationCategoryList
:
categoryType
;
}
//新增服务参数类型
type
addServiceParametersType
=
InterReqType
<
addServiceType
>
;
const
AddOrEditServiceModal
:
FC
<
ModalProps
&
selfProps
>
=
({
open
,
title
,
onCancel
,
industryCategoryList
,
applicationCategoryList
,
})
=>
{
const
[
form
]
=
Form
.
useForm
<
addServiceParametersType
>
();
//封面图文件
const
[
coverPlanFileList
,
setCoverPlanFileList
]
=
useState
<
{
id
:
number
;
name
:
string
;
uid
:
number
;
url
:
string
;
}[]
>
([]);
//分享卡片文件
const
[
shareCardFileList
,
setShareCardFileList
]
=
useState
<
{
id
:
number
;
name
:
string
;
uid
:
number
;
url
:
string
;
}[]
>
([]);
//视频上传文件
const
[
videoFileList
,
setVideoFileList
]
=
useState
<
{
id
:
number
;
name
:
string
;
uid
:
number
;
url
:
string
;
}[]
>
([]);
//封面图上传成功
const
coverPlanUploadSuccess
=
(
fileList
:
{
id
:
number
;
name
:
string
;
uid
:
number
;
url
:
string
;
}[],
)
=>
{
form
.
setFieldsValue
({
coverPlan
:
fileList
[
0
].
url
,
});
setCoverPlanFileList
(
fileList
);
};
//分享卡片上传成功
const
shareCardUploadSuccess
=
(
fileList
:
{
id
:
number
;
name
:
string
;
uid
:
number
;
url
:
string
;
}[],
)
=>
{
form
.
setFieldsValue
({
shareCard
:
fileList
[
0
].
url
,
});
setShareCardFileList
(
fileList
);
};
//视频上传成功
const
videoUploadSuccess
=
(
fileList
:
{
id
:
number
;
name
:
string
;
uid
:
number
;
url
:
string
;
}[],
)
=>
{
form
.
setFieldsValue
({
video
:
fileList
[
0
].
url
,
});
setVideoFileList
(
fileList
);
};
return
(
<
Modal
open=
{
open
}
title=
{
title
}
onCancel=
{
onCancel
}
>
<
Form
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
16
}
}
>
<
Form
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
16
}
}
form=
{
form
}
initialValues=
{
{
displayState
:
0
}
}
>
<
Form
.
Item
label=
'服务名称'
name=
'serviceName'
...
...
@@ -21,7 +115,11 @@ const AddOrEditServiceModal: FC<ModalProps> = ({ open, title, onCancel }) => {
rules=
{
[{
required
:
true
,
message
:
'请选择应用'
}]
}
>
<
Select
placeholder=
'请选择应用'
>
<
Select
.
Option
>
111
</
Select
.
Option
>
{
applicationCategoryList
.
map
((
v
)
=>
(
<
Select
.
Option
key=
{
v
.
id
}
value=
{
v
.
id
}
>
{
v
.
classifyName
}
</
Select
.
Option
>
))
}
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
...
...
@@ -30,7 +128,11 @@ const AddOrEditServiceModal: FC<ModalProps> = ({ open, title, onCancel }) => {
rules=
{
[{
required
:
true
,
message
:
'请选择对应行业'
}]
}
>
<
Select
placeholder=
'请选择对应行业'
>
<
Select
.
Option
>
111
</
Select
.
Option
>
{
industryCategoryList
.
map
((
v
)
=>
(
<
Select
.
Option
value=
{
v
.
id
}
key=
{
v
.
id
}
>
{
v
.
classifyName
}
</
Select
.
Option
>
))
}
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
...
...
@@ -38,12 +140,12 @@ const AddOrEditServiceModal: FC<ModalProps> = ({ open, title, onCancel }) => {
name=
'coverPlan'
rules=
{
[{
required
:
true
,
message
:
'请上传封面图'
}]
}
>
<
Uploader
listType=
'picture-card'
fileUpload
>
<
Uploader
listType=
'picture-card'
fileUpload
onChange=
{
coverPlanUploadSuccess
}
>
<
UploadOutlined
/>
</
Uploader
>
</
Form
.
Item
>
<
Form
.
Item
label=
'分享卡片'
name=
'shareCard'
>
<
Uploader
listType=
'picture-card'
fileUpload
>
<
Uploader
listType=
'picture-card'
fileUpload
onChange=
{
shareCardUploadSuccess
}
>
<
UploadOutlined
/>
</
Uploader
>
</
Form
.
Item
>
...
...
@@ -51,7 +153,12 @@ const AddOrEditServiceModal: FC<ModalProps> = ({ open, title, onCancel }) => {
<
Row
>
<
Col
></
Col
>
<
Col
>
<
Uploader
listType=
'text'
fileUpload
>
<
Uploader
listType=
'text'
fileUpload
onChange=
{
videoUploadSuccess
}
fileType=
{
[
'video/mp4'
,
'video/avi'
,
'video/wmv'
,
'video/rmvb'
]
}
>
<
Button
icon=
{
<
UploadOutlined
/>
}
size=
'small'
type=
'primary'
>
上传
</
Button
>
...
...
@@ -61,8 +168,8 @@ const AddOrEditServiceModal: FC<ModalProps> = ({ open, title, onCancel }) => {
</
Form
.
Item
>
<
Form
.
Item
label=
'展示状态'
name=
'displayState'
>
<
Select
placeholder=
'请选择展示状态'
>
<
Select
.
Option
>
上架
</
Select
.
Option
>
<
Select
.
Option
>
下架
</
Select
.
Option
>
<
Select
.
Option
value=
{
0
}
>
上架
</
Select
.
Option
>
<
Select
.
Option
value=
{
1
}
>
下架
</
Select
.
Option
>
</
Select
>
</
Form
.
Item
>
</
Form
>
...
...
src/pages/mallManage/serviceManage/serviceList/index.tsx
浏览文件 @
ef1aece3
...
...
@@ -35,7 +35,7 @@ const ServiceList: FC<any> = () => {
},
];
const
[
activeTabKey
,
setActiveTabKey
]
=
useState
<
string
>
(
'1'
);
const
[
searchColumnsData
]
=
useState
<
searchColumns
[]
>
([
const
[
searchColumnsData
,
setSearchColumnsData
]
=
useState
<
searchColumns
[]
>
([
{
type
:
'input'
,
placeholder
:
'请输入服务名称'
,
...
...
@@ -90,6 +90,8 @@ const ServiceList: FC<any> = () => {
const
[
tableData
]
=
useState
<
{
id
:
number
}[]
>
([{
id
:
1
}]);
//行业分类列表
const
[
industryCategoryList
,
setIndustryCategoryList
]
=
useState
<
categoryType
>
([]);
//应用分类列表
const
[
applicationCategoryList
,
setApplicationCategoryList
]
=
useState
<
categoryType
>
([]);
//新增、编辑服务弹窗
const
[
addOrEditServiceModalOpen
,
setAddOrEditServiceModalOpen
]
=
useState
<
boolean
>
(
false
);
const
[
addOrEditServiceModalTitle
,
setAddOrEditServiceModalTitle
]
=
useState
<
string
>
(
'新增服务'
);
...
...
@@ -109,13 +111,29 @@ const ServiceList: FC<any> = () => {
//行业分类列表
const
getIndustryCategoryList
=
()
=>
{
CategoryManageAPI
.
getCategoryList
({
directoryId
:
2
,
pageSize
:
99999
,
pageNo
:
1
}).
then
(
()
=>
{},
({
result
})
=>
{
setIndustryCategoryList
(
result
.
list
||
[]);
searchColumnsData
[
2
].
options
=
result
.
list
?.
map
((
v
)
=>
({
id
:
v
.
id
,
name
:
v
.
classifyName
,
}))
||
[];
setSearchColumnsData
(
searchColumnsData
);
},
);
};
//应用分类列表
const
getApplicationCategoryList
=
()
=>
{
CategoryManageAPI
.
getCategoryList
({
directoryId
:
3
,
pageSize
:
99999
,
pageNo
:
1
}).
then
(
()
=>
{},
({
result
})
=>
{
setApplicationCategoryList
(
result
.
list
||
[]);
searchColumnsData
[
1
].
options
=
result
.
list
?.
map
((
v
)
=>
({
id
:
v
.
id
,
name
:
v
.
classifyName
,
}))
||
[];
setSearchColumnsData
(
searchColumnsData
);
},
);
};
//服务详情
...
...
@@ -160,6 +178,8 @@ const ServiceList: FC<any> = () => {
open=
{
addOrEditServiceModalOpen
}
title=
{
addOrEditServiceModalTitle
}
onCancel=
{
addOrEditServiceModalCancel
}
industryCategoryList=
{
industryCategoryList
}
applicationCategoryList=
{
applicationCategoryList
}
/>
</
div
>
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论