Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
4ba9c70d
提交
4ba9c70d
authored
8月 16, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:上架服务
上级
ef1f3cf4
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
23 个修改的文件
包含
768 行增加
和
130 行删除
+768
-130
categoryManage.ts
src/api/interface/categoryManage.ts
+89
-0
mallManageType.ts
src/api/interface/mallManageType.ts
+193
-0
categoryManage.ts
src/api/modules/categoryManage.ts
+20
-0
mallManage.ts
src/api/modules/mallManage.ts
+24
-0
index.tsx
src/components/layout/title/index.tsx
+1
-1
index.tsx
src/components/search-box/index.tsx
+1
-0
index.scss
src/components/video/index.scss
+38
-0
index.tsx
src/components/video/index.tsx
+9
-1
index.tsx
...Manage/serviceCategoryList/comp/addEditTagModal/index.tsx
+80
-0
index.tsx
...e/serviceCategoryList/components/addOrEditModal/index.tsx
+0
-29
index.tsx
...pages/categoryManage/serviceCategoryList/detail/index.tsx
+187
-0
index.tsx
src/pages/categoryManage/serviceCategoryList/index.tsx
+12
-1
index_old.tsx
src/pages/categoryManage/serviceCategoryList/index_old.tsx
+0
-83
index.tsx
src/pages/mallManage/serviceManage/serviceDetail/index.tsx
+0
-0
index.tsx
src/pages/mallManage/serviceManage/serviceList/index.tsx
+0
-0
index.scss
...ages/mallManage/serviceManageOld/serviceDetail/index.scss
+0
-0
index.tsx
...pages/mallManage/serviceManageOld/serviceDetail/index.tsx
+71
-0
index.scss
...s/mallManage/serviceManageOld/serviceIntroduce/index.scss
+0
-0
index.tsx
...es/mallManage/serviceManageOld/serviceIntroduce/index.tsx
+0
-0
index.tsx
...ld/serviceList/components/addOrEditServiceModal/index.tsx
+0
-0
index.tsx
src/pages/mallManage/serviceManageOld/serviceList/index.tsx
+0
-0
router.tsx
src/router/router.tsx
+28
-15
validateUtils.ts
src/utils/validateUtils.ts
+15
-0
没有找到文件。
src/api/interface/categoryManage.ts
浏览文件 @
4ba9c70d
...
@@ -217,3 +217,92 @@ export type inspectionUpdateType = InterFunction<
...
@@ -217,3 +217,92 @@ export type inspectionUpdateType = InterFunction<
export
type
industryRemoveType
=
InterFunction
<
{
id
:
number
},
NonNullable
<
unknown
>>
;
export
type
industryRemoveType
=
InterFunction
<
{
id
:
number
},
NonNullable
<
unknown
>>
;
// 删除服务
// 删除服务
export
type
inspectionRemoveType
=
InterFunction
<
{
id
:
number
},
NonNullable
<
unknown
>>
;
export
type
inspectionRemoveType
=
InterFunction
<
{
id
:
number
},
NonNullable
<
unknown
>>
;
// 根据服务id查询标签列表
export
type
listByInspectionIdType
=
InterFunction
<
{
id
:
number
},
{
id
:
number
;
inspectionId
:
number
;
tagName
:
string
;
}[]
>
;
// 新增服务标签
export
type
inspectionTagInsertType
=
InterFunction
<
{
id
?:
number
;
inspectionId
?:
number
;
tagName
?:
string
;
},
NonNullable
<
unknown
>
>
;
// 修改服务标签
export
type
inspectionTagUpdateType
=
InterFunction
<
{
id
?:
number
;
inspectionId
?:
number
;
tagName
?:
string
;
},
NonNullable
<
unknown
>
>
;
// 删除服务标签
export
type
inspectionTagDeleteType
=
InterFunction
<
{
id
:
number
;
},
NonNullable
<
unknown
>
>
;
// 服务详情
export
type
inspectionDetailType
=
InterFunction
<
{
id
:
number
;
},
{
caseImg
:
string
;
caseVideo
:
string
;
companyInspectionDTOS
:
Array
<
{
companyInfoId
:
number
;
companyName
:
string
;
detailPage
:
string
;
id
:
number
;
industryTypeDTO
:
{
createTime
:
string
;
description
:
string
;
id
:
number
;
inspectionDTOS
:
null
;
saleState
:
number
;
typeImg
:
string
;
typeName
:
string
;
};
inspectionDTO
:
null
;
inspectionFileDTOS
:
Array
<
{
companyInspectionId
:
number
;
fileType
:
number
;
fileUrl
:
string
;
first
:
number
;
id
:
number
;
}
>
;
inspectionFirstImg
:
string
;
inspectionId
:
number
;
inspectionPriceUnitId
:
number
;
inspectionTagDTO
:
{
id
:
number
;
inspectionId
:
number
;
tagName
:
string
;
};
inspectionTagId
:
number
;
price
:
number
;
priceRemark
:
string
;
remark
:
string
;
saleState
:
number
;
serviceArea
:
string
;
}
>
;
createTime
:
string
;
id
:
number
;
industryTypeId
:
number
;
inspectionDescription
:
string
;
inspectionImg
:
string
;
inspectionName
:
string
;
inspectionNo
:
string
;
saleState
:
number
;
}
>
;
src/api/interface/mallManageType.ts
浏览文件 @
4ba9c70d
...
@@ -174,3 +174,196 @@ export type serviceDetailType = InterFunction<
...
@@ -174,3 +174,196 @@ export type serviceDetailType = InterFunction<
>
;
>
;
//服务-上下移动
//服务-上下移动
export
type
exChangeServiceType
=
InterFunction
<
{
id
:
number
;
sort
:
number
}[],
any
>
;
export
type
exChangeServiceType
=
InterFunction
<
{
id
:
number
;
sort
:
number
}[],
any
>
;
// pc-单位服务列表
export
type
listCompanyInspectionPageType
=
InterListFunction
<
{
companyInfoId
?:
number
;
industryTypeId
?:
number
;
inspectionId
?:
number
;
keyword
?:
string
;
},
{
companyInfoId
:
number
;
companyName
:
string
;
detailPage
:
string
;
id
:
number
;
industryTypeDTO
:
{
createTime
:
string
;
description
:
string
;
id
:
number
;
inspectionDTOS
:
Array
<
{
caseImg
:
string
;
caseVideo
:
string
;
companyInspectionDTOS
:
null
;
id
:
number
;
industryTypeId
:
number
;
inspectionDescription
:
string
;
inspectionImg
:
string
;
inspectionName
:
string
;
inspectionNo
:
string
;
saleState
:
number
;
}
>
;
saleState
:
number
;
typeImg
:
string
;
typeName
:
string
;
};
inspectionDTO
:
{
caseImg
:
string
;
caseVideo
:
string
;
companyInspectionDTOS
:
null
;
id
:
number
;
industryTypeId
:
number
;
inspectionDescription
:
string
;
inspectionImg
:
string
;
inspectionName
:
string
;
inspectionNo
:
string
;
saleState
:
number
;
};
inspectionFileDTOS
:
Array
<
{
companyInspectionId
:
number
;
fileType
:
number
;
fileUrl
:
string
;
first
:
number
;
id
:
number
;
}
>
;
inspectionFirstImg
:
string
;
inspectionId
:
number
;
inspectionPriceUnitId
:
number
;
inspectionTagDTO
:
{
id
:
number
;
inspectionId
:
number
;
tagName
:
string
;
};
inspectionTagId
:
number
;
price
:
number
;
priceRemark
:
string
;
remark
:
string
;
saleState
:
number
;
serviceArea
:
string
;
}
>
;
// 新增服务
export
type
companyInspectionInsertType
=
InterFunction
<
{
companyInfoId
?:
number
;
companyInspectionFiles
?:
Array
<
{
companyInspectionId
?:
number
;
fileType
?:
number
;
fileUrl
?:
string
;
first
?:
number
;
id
?:
number
;
}
>
;
detailPage
?:
string
;
id
?:
number
;
inspectionId
?:
number
;
inspectionPriceUnitId
?:
number
;
inspectionTagId
?:
number
;
price
?:
number
;
priceRemark
?:
string
;
remark
?:
string
;
saleState
?:
number
;
serviceArea
?:
string
;
},
NonNullable
<
unknown
>
>
;
// 修改服务
export
type
companyInspectionUpdateType
=
InterFunction
<
{
companyInfoId
?:
number
;
companyInspectionFiles
?:
Array
<
{
companyInspectionId
?:
number
;
fileType
?:
number
;
fileUrl
?:
string
;
first
?:
number
;
id
?:
number
;
}
>
;
detailPage
?:
string
;
id
?:
number
;
inspectionId
?:
number
;
inspectionPriceUnitId
?:
number
;
inspectionTagId
?:
number
;
price
?:
number
;
priceRemark
?:
string
;
remark
?:
string
;
saleState
?:
number
;
serviceArea
?:
string
;
},
NonNullable
<
unknown
>
>
;
// 单位服务详情
export
type
getCompanyInspectionByIdType
=
InterFunction
<
{
id
:
number
;
},
{
companyInfoId
:
number
;
companyName
:
string
;
detailPage
:
string
;
id
:
number
;
industryTypeDTO
:
{
createTime
:
string
;
description
:
string
;
id
:
number
;
inspectionDTOS
:
Array
<
{
caseImg
:
string
;
caseVideo
:
string
;
companyInspectionDTOS
:
null
;
createTime
:
string
;
id
:
number
;
industryTypeId
:
number
;
inspectionDescription
:
string
;
inspectionImg
:
string
;
inspectionName
:
string
;
inspectionNo
:
string
;
saleState
:
number
;
}
>
;
saleState
:
number
;
typeImg
:
string
;
typeName
:
string
;
};
inspectionDTO
:
{
caseImg
:
string
;
caseVideo
:
string
;
companyInspectionDTOS
:
null
;
createTime
:
string
;
id
:
number
;
industryTypeId
:
number
;
inspectionDescription
:
string
;
inspectionImg
:
string
;
inspectionName
:
string
;
inspectionNo
:
string
;
saleState
:
number
;
};
inspectionFileDTOS
:
Array
<
{
companyInspectionId
:
number
;
fileType
:
number
;
fileUrl
:
string
;
first
:
number
;
id
:
number
;
}
>
;
inspectionFirstImg
:
string
;
inspectionId
:
number
;
inspectionPriceUnitId
:
number
;
inspectionTagDTO
:
{
id
:
number
;
inspectionId
:
number
;
tagName
:
string
;
};
inspectionTagId
:
number
;
price
:
number
;
priceRemark
:
string
;
remark
:
string
;
saleState
:
number
;
serviceArea
:
string
;
}
>
;
// 价格单位列表
export
type
listInspectionPriceUnitType
=
InterFunction
<
NonNullable
<
unknown
>
,
{
id
:
number
;
unitName
:
string
;
}[]
>
;
// 删除单位服务
export
type
companyInspectionRemoveType
=
InterFunction
<
{
id
:
number
},
NonNullable
<
unknown
>>
;
src/api/modules/categoryManage.ts
浏览文件 @
4ba9c70d
...
@@ -15,9 +15,14 @@ import {
...
@@ -15,9 +15,14 @@ import {
industryListPagesType
,
industryListPagesType
,
industryRemoveType
,
industryRemoveType
,
industryUpdateType
,
industryUpdateType
,
inspectionDetailType
,
inspectionInsertType
,
inspectionInsertType
,
inspectionRemoveType
,
inspectionRemoveType
,
inspectionTagDeleteType
,
inspectionTagInsertType
,
inspectionTagUpdateType
,
inspectionUpdateType
,
inspectionUpdateType
,
listByInspectionIdType
,
updatePrimaryCategoryType
,
updatePrimaryCategoryType
,
updateSubCategoryType
,
updateSubCategoryType
,
}
from
'~/api/interface/categoryManage'
;
}
from
'~/api/interface/categoryManage'
;
...
@@ -157,4 +162,19 @@ export class CategoryManageAPI {
...
@@ -157,4 +162,19 @@ export class CategoryManageAPI {
// 删除服务
// 删除服务
static
inspectionRemove
:
inspectionRemoveType
=
(
params
)
=>
static
inspectionRemove
:
inspectionRemoveType
=
(
params
)
=>
axios
.
get
(
'/pms/inspection/remove'
,
{
params
});
axios
.
get
(
'/pms/inspection/remove'
,
{
params
});
// 根据服务id查询标签列表
static
listByInspectionId
:
listByInspectionIdType
=
(
params
)
=>
axios
.
get
(
'/pms/inspection-tag/listByInspectionId'
,
{
params
});
// 新增服务标签
static
inspectionTagInsert
:
inspectionTagInsertType
=
(
params
)
=>
axios
.
post
(
'/pms/inspection-tag/insert'
,
params
);
// 修改服务标签
static
inspectionTagUpdate
:
inspectionTagUpdateType
=
(
params
)
=>
axios
.
post
(
'/pms/inspection-tag/update'
,
params
);
// 删除服务标签
static
inspectionTagDelete
:
inspectionTagDeleteType
=
(
params
)
=>
axios
.
get
(
'/pms/inspection-tag/delete'
,
{
params
});
// 服务详情
static
inspectionDetail
:
inspectionDetailType
=
(
params
)
=>
axios
.
get
(
'/pms/inspection/detail'
,
{
params
});
}
}
src/api/modules/mallManage.ts
浏览文件 @
4ba9c70d
...
@@ -13,6 +13,12 @@ import {
...
@@ -13,6 +13,12 @@ import {
deleteServiceType
,
deleteServiceType
,
serviceDetailType
,
serviceDetailType
,
exChangeServiceType
,
exChangeServiceType
,
listCompanyInspectionPageType
,
companyInspectionInsertType
,
companyInspectionUpdateType
,
getCompanyInspectionByIdType
,
listInspectionPriceUnitType
,
companyInspectionRemoveType
,
}
from
'~/api/interface/mallManageType'
;
}
from
'~/api/interface/mallManageType'
;
export
class
MallManageAPI
{
export
class
MallManageAPI
{
...
@@ -56,4 +62,22 @@ export class MallManageAPI {
...
@@ -56,4 +62,22 @@ export class MallManageAPI {
// 服务-上下移
// 服务-上下移
static
exChangeService
:
exChangeServiceType
=
(
data
)
=>
static
exChangeService
:
exChangeServiceType
=
(
data
)
=>
axios
.
post
(
'/pms/backstage/work/exchange'
,
data
);
axios
.
post
(
'/pms/backstage/work/exchange'
,
data
);
// pc-单位服务列表
static
listCompanyInspectionPage
:
listCompanyInspectionPageType
=
(
data
)
=>
axios
.
post
(
'/pms/company-inspection/listCompanyInspectionPage'
,
data
);
// 新增服务
static
companyInspectionInsert
:
companyInspectionInsertType
=
(
data
)
=>
axios
.
post
(
'/pms/company-inspection/insert'
,
data
);
// 修改服务
static
companyInspectionUpdate
:
companyInspectionUpdateType
=
(
data
)
=>
axios
.
post
(
'/pms/company-inspection/update'
,
data
);
// 单位服务详情
static
getCompanyInspectionById
:
getCompanyInspectionByIdType
=
(
params
)
=>
axios
.
get
(
'/pms/company-inspection/getCompanyInspectionById'
,
{
params
});
// 价格单位列表
static
listInspectionPriceUnit
:
listInspectionPriceUnitType
=
(
params
)
=>
axios
.
get
(
'/pms/company-inspection/listInspectionPriceUnit'
,
{
params
});
// 删除单位服务
static
companyInspectionRemove
:
companyInspectionRemoveType
=
(
params
)
=>
axios
.
get
(
'/pms/company-inspection/remove'
,
{
params
});
}
}
src/components/layout/title/index.tsx
浏览文件 @
4ba9c70d
import
React
,
{
useState
}
from
'react'
;
import
{
useState
}
from
'react'
;
import
{
Header
}
from
'antd/es/layout/layout'
;
import
{
Header
}
from
'antd/es/layout/layout'
;
import
{
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
;
import
{
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
;
import
{
Button
,
Dropdown
,
Image
,
MenuProps
,
Modal
}
from
'antd'
;
import
{
Button
,
Dropdown
,
Image
,
MenuProps
,
Modal
}
from
'antd'
;
...
...
src/components/search-box/index.tsx
浏览文件 @
4ba9c70d
...
@@ -19,6 +19,7 @@ export interface searchColumns {
...
@@ -19,6 +19,7 @@ export interface searchColumns {
name
?:
string
;
name
?:
string
;
value
?:
string
|
number
|
boolean
|
null
;
value
?:
string
|
number
|
boolean
|
null
;
label
?:
string
;
label
?:
string
;
children
?:
any
;
}[];
}[];
onSelect
?:
(
value
:
any
)
=>
void
;
onSelect
?:
(
value
:
any
)
=>
void
;
disable
?:
boolean
;
disable
?:
boolean
;
...
...
src/components/video/index.scss
0 → 100644
浏览文件 @
4ba9c70d
.video-preview
{
position
:
fixed
;
top
:
0
;
left
:
0
;
width
:
100vw
;
height
:
100vh
;
z-index
:
100
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
.preview-mask
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
background
:
rgba
(
0
,
0
,
0
,
0
.35
);
}
.button
{
position
:
absolute
;
top
:
0
;
right
:
0
;
width
:
40px
;
height
:
40px
;
background
:
rgba
(
0
,
0
,
0
,
0
.35
);
border-radius
:
50%
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
color
:
#fff
;
font-size
:
20px
;
cursor
:
pointer
;
}
.video
{
height
:
80%
;
z-index
:
200
;
}
}
src/components/video/index.tsx
浏览文件 @
4ba9c70d
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Image
}
from
'antd'
;
import
{
Image
}
from
'antd'
;
import
'./index.scss'
;
// 参数类型
// 参数类型
interface
propsType
{
interface
propsType
{
...
@@ -31,7 +32,14 @@ const Video: React.FC<propsType> = (props) => {
...
@@ -31,7 +32,14 @@ const Video: React.FC<propsType> = (props) => {
setIsPreview
(
true
);
setIsPreview
(
true
);
}
}
}
}
/>
/>
{
isPreview
&&
<
div
className=
'video-preview'
>
12312
</
div
>
}
{
isPreview
&&
(
<
div
className=
'video-preview'
>
<
view
className=
'preview-mask'
onClick=
{
()
=>
setIsPreview
(
false
)
}
></
view
>
{
/*<Button className='button' shape='circle' icon={<CloseOutlined />} />*/
}
{
/* eslint-disable-next-line jsx-a11y/media-has-caption */
}
<
video
className=
'video'
src=
{
props
?.
src
}
autoPlay
controls
></
video
>
</
div
>
)
}
</>
</>
);
);
};
};
...
...
src/pages/categoryManage/serviceCategoryList/comp/addEditTagModal/index.tsx
0 → 100644
浏览文件 @
4ba9c70d
import
React
,
{
useEffect
}
from
'react'
;
import
{
Form
,
Input
,
message
,
Modal
,
ModalProps
}
from
'antd'
;
import
{
InterItemType
,
InterReqType
}
from
'~/api/interface'
;
import
{
listByInspectionIdType
,
industryUpdateType
}
from
'~/api/interface/categoryManage'
;
import
{
CategoryManageAPI
}
from
'~/api'
;
// 表格类型
type
TableType
=
InterItemType
<
listByInspectionIdType
>
;
// 表单参数
type
ReqType
=
InterReqType
<
industryUpdateType
>
;
// 参数类型
interface
selfProps
{
id
:
number
;
data
?:
TableType
[
0
];
onCancel
:
()
=>
void
;
}
const
AddEditTagModalView
:
React
.
FC
<
ModalProps
&
selfProps
>
=
({
id
,
open
,
title
,
onCancel
,
data
,
})
=>
{
// 表格数据类型
const
[
form
]
=
Form
.
useForm
<
ReqType
>
();
// 关闭事件
const
handleCancel
=
()
=>
{
form
.
resetFields
();
onCancel
();
};
// 确定事件
const
handleOk
=
()
=>
{
form
.
validateFields
()
.
then
(
async
(
values
)
=>
{
await
handleSubmit
(
values
);
})
.
catch
((
err
)
=>
{
message
.
warning
({
content
:
err
.
errorFields
[
0
].
errors
[
0
],
})
.
then
();
});
};
// 提交数据
const
handleSubmit
=
async
(
values
:
ReqType
)
=>
{
const
res
=
await
CategoryManageAPI
[
data
?.
id
?
'inspectionTagUpdate'
:
'inspectionTagInsert'
]({
...
values
,
inspectionId
:
id
,
id
:
data
?.
id
||
undefined
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
handleCancel
();
}
};
// componentDidMount
useEffect
(()
=>
{
if
(
!
open
)
return
;
if
(
!
data
)
return
;
form
.
setFieldsValue
(
data
);
// console.log('data --->', data);
},
[
open
]);
return
(
<
Modal
title=
{
title
}
open=
{
open
}
onCancel=
{
handleCancel
}
onOk=
{
handleOk
}
destroyOnClose
>
<
Form
form=
{
form
}
labelAlign=
'right'
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
10
}
}
>
<
Form
.
Item
label=
'标签名称'
name=
'tagName'
rules=
{
[{
required
:
true
,
message
:
'请输入标签名称'
}]
}
>
<
Input
placeholder=
'请输入标签名称'
maxLength=
{
15
}
allowClear
/>
</
Form
.
Item
>
</
Form
>
</
Modal
>
);
};
export
default
AddEditTagModalView
;
src/pages/categoryManage/serviceCategoryList/components/addOrEditModal/index.tsx
deleted
100644 → 0
浏览文件 @
ef1f3cf4
import
{
FC
}
from
'react'
;
import
{
Form
,
Input
,
Modal
,
ModalProps
}
from
'antd'
;
interface
selfProps
{
onCancel
:
()
=>
void
;
onOk
:
()
=>
void
;
}
const
AddOrEditModal
:
FC
<
ModalProps
&
selfProps
>
=
({
open
,
onCancel
,
onOk
})
=>
{
const
handleCancel
=
()
=>
{
onCancel
();
};
const
handleOk
=
()
=>
{
onOk
();
};
return
(
<
Modal
title=
'新增分类'
open=
{
open
}
onCancel=
{
handleCancel
}
onOk=
{
handleOk
}
>
<
Form
>
<
Form
.
Item
label=
'分类名称'
>
<
Input
placeholder=
'请输入分类名称'
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'分类图标'
></
Form
.
Item
>
<
Form
.
Item
label=
'分类描述'
></
Form
.
Item
>
</
Form
>
</
Modal
>
);
};
export
default
AddOrEditModal
;
src/pages/categoryManage/serviceCategoryList/detail/index.tsx
0 → 100644
浏览文件 @
4ba9c70d
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
useLocation
,
useNavigate
}
from
'react-router-dom'
;
import
{
Button
,
Descriptions
,
Image
,
message
,
Modal
,
Table
}
from
'antd'
;
import
{
ArrowLeftOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
SearchBox
from
'~/components/search-box'
;
import
qs
from
'query-string'
;
import
{
inspectionDetailType
,
listByInspectionIdType
}
from
'~/api/interface/categoryManage'
;
import
{
InterDataType
,
InterItemType
}
from
'~/api/interface'
;
import
{
CategoryManageAPI
}
from
'~/api'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
AddEditTagModalView
from
'~/pages/categoryManage/serviceCategoryList/comp/addEditTagModal'
;
import
Video
from
'~/components/video'
;
// 表格类型
type
TableType
=
InterItemType
<
listByInspectionIdType
>
;
const
ServiceCategoryDetail
:
React
.
FC
=
()
=>
{
// 路由钩子
const
location
=
useLocation
();
// 导航钩子
const
navigate
=
useNavigate
();
// 返回上一页
const
handleBack
=
()
=>
{
navigate
(
-
1
);
};
// 新增编辑标签是否显示
const
[
addEditVisible
,
setAddEditVisible
]
=
useState
(
false
);
// 编辑的数据
const
[
recordData
,
setRecordData
]
=
useState
<
TableType
[
0
]
>
();
// 表格数据
const
[
tableData
,
setTableData
]
=
useState
<
TableType
>
([]);
// 加载列表
const
getTableList
=
async
()
=>
{
// 只需要修改这个地方的接口即可
const
res
=
await
CategoryManageAPI
.
listByInspectionId
({
id
:
Number
(
qs
.
parse
(
location
.
search
).
id
),
});
if
(
res
&&
res
.
code
===
'200'
)
{
const
{
result
}
=
res
;
// 解构
setTableData
(
result
||
[]);
}
};
// 删除数据
const
handleDelete
=
(
record
:
TableType
[
0
])
=>
{
Modal
.
confirm
({
title
:
'提示'
,
content
:
'是否删除该场景标签?'
,
onOk
:
async
()
=>
{
const
res
=
await
CategoryManageAPI
.
inspectionTagDelete
({
id
:
record
.
id
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
message
.
success
(
'删除成功'
);
await
getTableList
();
}
},
});
};
// 服务详情
const
[
inspectionDetail
,
setInspectionDetail
]
=
useState
<
InterDataType
<
inspectionDetailType
>>
();
// 获取服务详情
const
getInspectionDetail
=
async
()
=>
{
const
res
=
await
CategoryManageAPI
.
inspectionDetail
({
id
:
Number
(
qs
.
parse
(
location
.
search
).
id
),
});
if
(
res
&&
res
.
code
===
'200'
)
{
setInspectionDetail
(
res
.
result
);
}
};
// 组件挂载
useEffect
(()
=>
{
getInspectionDetail
().
then
();
getTableList
().
then
();
},
[]);
// 表格结构
const
columns
:
ColumnsType
<
TableType
[
0
]
>
=
[
{
title
:
'序号'
,
dataIndex
:
'tagName'
,
align
:
'center'
,
render
:
(
_text
,
_record
,
index
)
=>
`
${
index
+
1
}
`
,
},
{
title
:
'场景标签'
,
dataIndex
:
'tagName'
,
align
:
'center'
,
},
{
title
:
'操作'
,
dataIndex
:
'id'
,
align
:
'center'
,
width
:
200
,
render
:
(
_text
,
record
)
=>
(
<>
<
Button
type=
'link'
size=
'small'
onClick=
{
()
=>
{
setRecordData
(
record
);
setAddEditVisible
(
true
);
}
}
>
编辑
</
Button
>
<
Button
type=
'link'
size=
'small'
onClick=
{
()
=>
handleDelete
(
record
)
}
danger
>
删除
</
Button
>
</>
),
},
];
return
(
<>
<
SearchBox
child=
{
<
Button
type=
{
'primary'
}
icon=
{
<
ArrowLeftOutlined
/>
}
onClick=
{
()
=>
handleBack
()
}
>
返回
</
Button
>
}
/>
<
Descriptions
title=
'子分类详情'
bordered
style=
{
{
marginBottom
:
'20px'
,
width
:
'60%'
}
}
column=
{
2
}
labelStyle=
{
{
width
:
'15%'
}
}
contentStyle=
{
{
width
:
'30%'
}
}
>
<
Descriptions
.
Item
label=
'分类名称'
>
{
inspectionDetail
?.
inspectionName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'分类图标'
>
<
Image
src=
{
inspectionDetail
?.
inspectionImg
}
width=
{
40
}
height=
{
40
}
/>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'分类描述'
>
{
inspectionDetail
?.
inspectionDescription
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'服务编号'
>
{
inspectionDetail
?.
inspectionNo
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'业务案例图片'
>
<
Image
src=
{
inspectionDetail
?.
caseImg
}
width=
{
40
}
height=
{
40
}
/>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'业务案例视频'
>
{
inspectionDetail
?.
caseVideo
&&
(
<
Video
src=
{
inspectionDetail
?.
caseVideo
}
width=
{
40
}
height=
{
40
}
/>
)
}
</
Descriptions
.
Item
>
</
Descriptions
>
<
SearchBox
sufFixBtn=
{
<
Button
type=
{
'primary'
}
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
{
setRecordData
(
undefined
);
setAddEditVisible
(
true
);
}
}
>
新增场景标签
</
Button
>
}
/>
<
Table
style=
{
{
width
:
'60%'
}
}
size=
'small'
dataSource=
{
tableData
}
columns=
{
columns
}
rowKey=
'id'
// scroll={{ x: 1500 }}
bordered
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`
,
}
}
/>
<
AddEditTagModalView
title=
{
recordData
?
'编辑场景标签'
:
'新增场景标签'
}
open=
{
addEditVisible
}
data=
{
recordData
}
id=
{
Number
(
qs
.
parse
(
location
.
search
).
id
)
}
onCancel=
{
()
=>
{
setAddEditVisible
(
false
);
setRecordData
(
undefined
);
getTableList
().
then
();
}
}
/>
</>
);
};
export
default
ServiceCategoryDetail
;
src/pages/categoryManage/serviceCategoryList/index.tsx
浏览文件 @
4ba9c70d
...
@@ -9,11 +9,15 @@ import { CategoryManageAPI } from '~/api';
...
@@ -9,11 +9,15 @@ import { CategoryManageAPI } from '~/api';
import
Video
from
'~/components/video'
;
import
Video
from
'~/components/video'
;
import
AddEditModalView
from
'~/pages/categoryManage/serviceCategoryList/comp/addEditModal'
;
import
AddEditModalView
from
'~/pages/categoryManage/serviceCategoryList/comp/addEditModal'
;
import
AddEditChildrenView
from
'~/pages/categoryManage/serviceCategoryList/comp/addEditChildren'
;
import
AddEditChildrenView
from
'~/pages/categoryManage/serviceCategoryList/comp/addEditChildren'
;
import
{
useNavigate
}
from
'react-router-dom'
;
import
qs
from
'query-string'
;
// 列表的类型
// 列表的类型
type
TableType
=
InterListType
<
industryListPagesType
>
;
type
TableType
=
InterListType
<
industryListPagesType
>
;
function
ServiceCategoryList
()
{
function
ServiceCategoryList
()
{
// 路由钩子
const
navigate
=
useNavigate
();
// 新增编辑弹窗是否显示
// 新增编辑弹窗是否显示
const
[
addEditVisible
,
setAddEditVisible
]
=
useState
(
false
);
const
[
addEditVisible
,
setAddEditVisible
]
=
useState
(
false
);
// 新增编辑子分类弹窗是否显示
// 新增编辑子分类弹窗是否显示
...
@@ -82,6 +86,13 @@ function ServiceCategoryList() {
...
@@ -82,6 +86,13 @@ function ServiceCategoryList() {
},
},
});
});
};
};
// 跳转详情
const
handleNavigation
=
(
record
:
TableType
[
0
])
=>
{
const
search
=
{
id
:
record
.
id
,
};
navigate
(
`/categoryManage/mallCategoryList/detail?
${
qs
.
stringify
(
search
)}
`
);
};
// 表格列
// 表格列
const
columns
:
ColumnsType
<
TableType
[
0
]
>
=
[
const
columns
:
ColumnsType
<
TableType
[
0
]
>
=
[
{
{
...
@@ -147,7 +158,7 @@ function ServiceCategoryList() {
...
@@ -147,7 +158,7 @@ function ServiceCategoryList() {
<
Button
<
Button
type=
'link'
type=
'link'
onClick=
{
()
=>
{
onClick=
{
()
=>
{
console
.
log
(
'click --->'
,
record
);
handleNavigation
(
record
);
}
}
}
}
>
>
详情
详情
...
...
src/pages/categoryManage/serviceCategoryList/index_old.tsx
deleted
100644 → 0
浏览文件 @
ef1f3cf4
import
{
Button
,
Table
}
from
'antd'
;
import
{
ArrowDownOutlined
,
ArrowUpOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
AddOrEditModal
from
'./components/addOrEditModal'
;
import
{
useState
}
from
'react'
;
const
ServiceCategoryList
=
()
=>
{
const
tableColumns
:
ColumnsType
<
any
>
=
[
{
title
:
'分类名称'
,
align
:
'center'
,
},
{
title
:
'图片'
,
align
:
'center'
,
},
{
title
:
'描述'
,
align
:
'center'
,
},
{
title
:
'业务案例图片'
,
align
:
'center'
,
},
{
title
:
'业务案例视频'
,
align
:
'center'
,
},
{
title
:
'创建时间'
,
align
:
'center'
,
},
{
title
:
'操作'
,
align
:
'center'
,
render
:
()
=>
(
<>
<
Button
type=
'link'
>
新增子分类
</
Button
>
<
Button
type=
'link'
>
编辑
</
Button
>
<
Button
type=
'link'
>
删除
</
Button
>
</>
),
},
];
// const [tableData, setTableData] = useState<any>([{ id: 1 }]);
const
[
addOrEditModalShow
,
setAddOrEditModalShow
]
=
useState
<
boolean
>
(
false
);
//新增分类弹窗
const
addOrEditModalClick
=
()
=>
{
setAddOrEditModalShow
(
true
);
};
const
addOrEditModalOk
=
()
=>
{
setAddOrEditModalShow
(
false
);
};
const
addOrEditModalCancel
=
()
=>
{
setAddOrEditModalShow
(
false
);
};
return
(
<
div
className=
'service-category-list'
>
<
div
className=
'list-operate'
style=
{
{
marginBottom
:
'10px'
}
}
>
<
Button
type=
'primary'
icon=
{
<
PlusOutlined
/>
}
style=
{
{
marginRight
:
'10px'
}
}
onClick=
{
addOrEditModalClick
}
>
新增分类
</
Button
>
<
Button
icon=
{
<
ArrowUpOutlined
/>
}
style=
{
{
marginRight
:
'10px'
}
}
type=
'primary'
></
Button
>
<
Button
icon=
{
<
ArrowDownOutlined
/>
}
type=
'primary'
></
Button
>
</
div
>
<
Table
columns=
{
tableColumns
}
bordered
rowKey=
'id'
/>
<
AddOrEditModal
open=
{
addOrEditModalShow
}
onOk=
{
addOrEditModalOk
}
onCancel=
{
addOrEditModalCancel
}
/>
</
div
>
);
};
export
default
ServiceCategoryList
;
src/pages/mallManage/serviceManage/serviceDetail/index.tsx
浏览文件 @
4ba9c70d
差异被折叠。
点击展开。
src/pages/mallManage/serviceManage/serviceList/index.tsx
浏览文件 @
4ba9c70d
差异被折叠。
点击展开。
src/pages/mallManage/serviceManage/serviceDetail/index.scss
→
src/pages/mallManage/serviceManage
Old
/serviceDetail/index.scss
浏览文件 @
4ba9c70d
File moved
src/pages/mallManage/serviceManageOld/serviceDetail/index.tsx
0 → 100644
浏览文件 @
4ba9c70d
import
{
Button
,
Form
,
Image
}
from
'antd'
;
import
{
useNavigate
,
useSearchParams
}
from
'react-router-dom'
;
import
'./index.scss'
;
import
{
MallManageAPI
}
from
'~/api'
;
import
{
useEffect
,
useState
}
from
'react'
;
import
{
InterDataType
}
from
'~/api/interface'
;
import
{
serviceDetailType
}
from
'~/api/interface/mallManageType'
;
//服务详情-返回类型
type
detailType
=
InterDataType
<
serviceDetailType
>
;
const
ServiceDetail
=
()
=>
{
const
navigate
=
useNavigate
();
const
[
searchParams
]
=
useSearchParams
();
const
[
serviceDetail
,
setServiceDetail
]
=
useState
<
detailType
>
();
//服务详情
const
getServiceDetail
=
(
id
:
number
)
=>
{
MallManageAPI
.
getServiceDetail
({
id
}).
then
(({
result
})
=>
{
setServiceDetail
(
result
);
});
};
//返回
const
backRoute
=
()
=>
{
navigate
(
-
1
);
};
useEffect
(()
=>
{
getServiceDetail
(
Number
(
searchParams
.
get
(
'id'
)));
},
[]);
return
(
<
div
className=
'service-detail'
>
<
div
className=
'service-detail-operate'
>
<
Button
type=
'primary'
onClick=
{
backRoute
}
>
返回
</
Button
>
</
div
>
<
div
className=
'service-detail-form'
>
<
Form
labelCol=
{
{
span
:
2
}
}
wrapperCol=
{
{
span
:
16
}
}
>
<
Form
.
Item
label=
'服务名称'
>
{
serviceDetail
?.
serviceName
}
</
Form
.
Item
>
<
Form
.
Item
label=
'应用类型'
>
{
serviceDetail
?.
applicationName
}
</
Form
.
Item
>
<
Form
.
Item
label=
'对应行业'
>
{
serviceDetail
?.
industryName
}
</
Form
.
Item
>
<
Form
.
Item
label=
'展示状态'
>
{
serviceDetail
?.
displayState
===
0
?
'上架'
:
'下架'
}
</
Form
.
Item
>
<
Form
.
Item
label=
'所属单位'
>
{
serviceDetail
?.
companyName
}
</
Form
.
Item
>
<
Form
.
Item
label=
'封面图'
>
<
Image
src=
{
serviceDetail
?.
coverPlan
}
width=
{
100
}
height=
{
100
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'分享卡片'
>
{
serviceDetail
?.
shareCard
?
(
<
Image
src=
{
serviceDetail
.
shareCard
}
width=
{
100
}
height=
{
100
}
/>
)
:
(
'暂无'
)
}
</
Form
.
Item
>
<
Form
.
Item
label=
'视频'
>
{
serviceDetail
?.
video
?
(
<
video
src=
{
serviceDetail
?.
video
}
controls
style=
{
{
width
:
'200px'
,
height
:
'200px'
}
}
/>
)
:
(
'暂无'
)
}
</
Form
.
Item
>
</
Form
>
</
div
>
</
div
>
);
};
export
default
ServiceDetail
;
src/pages/mallManage/serviceManage/serviceIntroduce/index.scss
→
src/pages/mallManage/serviceManage
Old
/serviceIntroduce/index.scss
浏览文件 @
4ba9c70d
File moved
src/pages/mallManage/serviceManage/serviceIntroduce/index.tsx
→
src/pages/mallManage/serviceManage
Old
/serviceIntroduce/index.tsx
浏览文件 @
4ba9c70d
File moved
src/pages/mallManage/serviceManage/serviceList/components/addOrEditServiceModal/index.tsx
→
src/pages/mallManage/serviceManage
Old
/serviceList/components/addOrEditServiceModal/index.tsx
浏览文件 @
4ba9c70d
File moved
src/pages/mallManage/serviceManageOld/serviceList/index.tsx
0 → 100644
浏览文件 @
4ba9c70d
差异被折叠。
点击展开。
src/router/router.tsx
浏览文件 @
4ba9c70d
...
@@ -93,9 +93,9 @@ const ServiceListView = React.lazy(() => import('~/pages/mallManage/serviceManag
...
@@ -93,9 +93,9 @@ const ServiceListView = React.lazy(() => import('~/pages/mallManage/serviceManag
const
ServiceDetailView
=
React
.
lazy
(
const
ServiceDetailView
=
React
.
lazy
(
()
=>
import
(
'~/pages/mallManage/serviceManage/serviceDetail'
),
()
=>
import
(
'~/pages/mallManage/serviceManage/serviceDetail'
),
);
//服务详情
);
//服务详情
const
ServiceIntroduceView
=
React
.
lazy
(
//
const ServiceIntroduceView = React.lazy(
()
=>
import
(
'~/pages/mallManage/serviceManage
/serviceIntroduce'
),
// () => import('~/pages/mallManage/serviceManageOld
/serviceIntroduce'),
);
//服务介绍
//
); //服务介绍
const
RentListView
=
React
.
lazy
(()
=>
import
(
'~/pages/rentManage/rentGoods/rentList'
));
//租赁列表
const
RentListView
=
React
.
lazy
(()
=>
import
(
'~/pages/rentManage/rentGoods/rentList'
));
//租赁列表
const
RentAddOrEditView
=
React
.
lazy
(()
=>
import
(
'~/pages/rentManage/rentGoods/rentAddOrEdit'
));
//租赁新增、编辑、详情
const
RentAddOrEditView
=
React
.
lazy
(()
=>
import
(
'~/pages/rentManage/rentGoods/rentAddOrEdit'
));
//租赁新增、编辑、详情
...
@@ -153,6 +153,7 @@ const CompanyDetailView = React.lazy(
...
@@ -153,6 +153,7 @@ const CompanyDetailView = React.lazy(
import
AccountLimit
from
'~/pages/systemManage/limitManage/roleList'
;
//账号权限
import
AccountLimit
from
'~/pages/systemManage/limitManage/roleList'
;
//账号权限
import
LimitInfo
from
'~/pages/systemManage/limitManage/limitInfo'
;
import
LimitInfo
from
'~/pages/systemManage/limitManage/limitInfo'
;
import
CustomListDetail
from
'~/pages/customManage/customList/detail'
;
import
CustomListDetail
from
'~/pages/customManage/customList/detail'
;
import
ServiceCategoryDetail
from
'~/pages/categoryManage/serviceCategoryList/detail'
;
// const IndustryListView = React.lazy(() => import('~/pages/mallManage/industryManage/industryList')); //行业列表
// const IndustryListView = React.lazy(() => import('~/pages/mallManage/industryManage/industryList')); //行业列表
// const IndustryDetailView = React.lazy(
// const IndustryDetailView = React.lazy(
...
@@ -592,6 +593,7 @@ export const routerList: Array<RouteObjectType> = [
...
@@ -592,6 +593,7 @@ export const routerList: Array<RouteObjectType> = [
id
:
1020
,
id
:
1020
,
icon
:
<
SmileOutlined
/>,
icon
:
<
SmileOutlined
/>,
title
:
'服务管理'
,
title
:
'服务管理'
,
develop
:
true
,
},
},
},
},
{
{
...
@@ -599,23 +601,23 @@ export const routerList: Array<RouteObjectType> = [
...
@@ -599,23 +601,23 @@ export const routerList: Array<RouteObjectType> = [
element
:
withLoadingComponent
(<
ServiceDetailView
/>),
element
:
withLoadingComponent
(<
ServiceDetailView
/>),
errorElement
:
<
ErrorPage
/>,
errorElement
:
<
ErrorPage
/>,
meta
:
{
meta
:
{
id
:
10
1
20
,
id
:
1020
,
icon
:
<
SmileOutlined
/>,
icon
:
<
SmileOutlined
/>,
title
:
'服务详情'
,
title
:
'服务详情'
,
hidden
:
true
,
hidden
:
true
,
},
},
},
},
{
//
{
path
:
'/mallManage/serviceIntroduce'
,
//
path: '/mallManage/serviceIntroduce',
element
:
withLoadingComponent
(<
ServiceIntroduceView
/>),
//
element: withLoadingComponent(<ServiceIntroduceView />),
errorElement
:
<
ErrorPage
/>,
//
errorElement: <ErrorPage />,
meta
:
{
//
meta: {
id
:
10120
,
//
id: 10120,
icon
:
<
SmileOutlined
/>,
//
icon: <SmileOutlined />,
title
:
'服务介绍'
,
//
title: '服务介绍',
hidden
:
true
,
//
hidden: true,
},
//
},
},
//
},
{
{
path
:
'/mallManage/mallGoods'
,
path
:
'/mallManage/mallGoods'
,
element
:
withLoadingComponent
(<
MallGoodsView
/>),
element
:
withLoadingComponent
(<
MallGoodsView
/>),
...
@@ -843,6 +845,17 @@ export const routerList: Array<RouteObjectType> = [
...
@@ -843,6 +845,17 @@ export const routerList: Array<RouteObjectType> = [
icon
:
<
AppstoreOutlined
/>,
icon
:
<
AppstoreOutlined
/>,
},
},
},
},
{
path
:
'/categoryManage/mallCategoryList/detail'
,
element
:
withLoadingComponent
(<
ServiceCategoryDetail
/>),
errorElement
:
<
ErrorPage
/>,
meta
:
{
id
:
18600
,
title
:
'分类详情'
,
icon
:
''
,
hidden
:
true
,
},
},
// {
// {
// path: '/categoryManage/jobServicesCategory/4',
// path: '/categoryManage/jobServicesCategory/4',
// element: withLoadingComponent(<CategoryManage />),
// element: withLoadingComponent(<CategoryManage />),
...
...
src/utils/validateUtils.ts
浏览文件 @
4ba9c70d
...
@@ -117,3 +117,18 @@ export const regPriceNumber = (value: string): boolean => {
...
@@ -117,3 +117,18 @@ export const regPriceNumber = (value: string): boolean => {
export
const
isEmptyBol
=
(
value
:
any
):
boolean
=>
{
export
const
isEmptyBol
=
(
value
:
any
):
boolean
=>
{
return
_
.
isNull
(
value
)
||
_
.
isNaN
(
value
)
||
_
.
isNull
(
value
)
||
_
.
isUndefined
(
value
);
return
_
.
isNull
(
value
)
||
_
.
isNaN
(
value
)
||
_
.
isNull
(
value
)
||
_
.
isUndefined
(
value
);
};
};
// 通用价格判断
export
const
commonPriceValidator
=
(
_rules
:
any
,
value
:
number
)
=>
{
if
(
!
isEmptyBol
(
value
))
{
if
(
regPriceNumber
(
value
.
toString
()))
{
if
(
value
>
99999999
||
value
<
0
)
{
return
Promise
.
reject
(
new
Error
(
'价格最大为99999999且大于0'
));
}
return
Promise
.
resolve
();
}
else
{
return
Promise
.
reject
(
new
Error
(
'为整数且最多保留两位小数'
));
}
}
else
{
return
Promise
.
reject
(
new
Error
(
'请输入价格'
));
}
};
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论