Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
admin-ci-test
Commits
fc671864
提交
fc671864
authored
6月 09, 2023
作者:
翁进城
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into develop
上级
173ac483
dd4cfc9f
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
209 行增加
和
250 行删除
+209
-250
index.ts
src/api/index.ts
+2
-0
customManageType.ts
src/api/interface/customManageType.ts
+33
-0
customManage.ts
src/api/modules/customManage.ts
+8
-0
index.tsx
...categoryManage/category/components/addCgyDailog/index.tsx
+1
-1
index.tsx
...oryManage/category/components/addOrEditDec copy/index.tsx
+0
-146
index.tsx
src/pages/customManage/customList/index.tsx
+80
-38
router.tsx
src/router/router.tsx
+85
-65
没有找到文件。
src/api/index.ts
浏览文件 @
fc671864
...
...
@@ -8,6 +8,7 @@ import { CouponManageAPI } from './modules/couponManage';
import
{
MakeManageAPI
}
from
'./modules/makeManage'
;
import
{
CategoryManageAPI
}
from
'./modules/categoryManage'
;
import
{
SystemManageAPI
}
from
'./modules/systemManage'
;
import
{
CustomManageAPI
}
from
'./modules/customManage'
;
export
{
CommonAPI
,
...
...
@@ -20,4 +21,5 @@ export {
MakeManageAPI
,
CategoryManageAPI
,
SystemManageAPI
,
CustomManageAPI
,
};
src/api/interface/customManageType.ts
0 → 100644
浏览文件 @
fc671864
import
{
InterListFunction
}
from
'~/api/interface'
;
// 客户列表
export
type
listAppUserType
=
InterListFunction
<
{
companyAuthStatus
?:
number
;
endTime
?:
string
;
keyword
?:
string
;
phoneNum
?:
string
;
startTime
?:
string
;
},
{
id
:
number
;
accountType
:
number
;
uid
:
string
;
accountNo
:
null
;
phoneNum
:
string
;
userName
:
null
;
nickName
:
string
;
userImg
:
string
;
userSex
:
number
;
email
:
null
;
source
:
null
;
accountStatus
:
number
;
remark
:
null
;
portType
:
number
;
createTime
:
string
;
companyAuthStatus
:
number
;
cooperationTagId
:
null
;
companyName
:
null
;
tagName
:
null
;
}
>
;
src/api/modules/customManage.ts
0 → 100644
浏览文件 @
fc671864
import
axios
from
'../request'
;
import
{
listAppUserType
}
from
'~/api/interface/customManageType'
;
export
class
CustomManageAPI
{
// 客户列表
static
listAppUser
:
listAppUserType
=
(
params
)
=>
axios
.
post
(
'/userapp/user-account/listAppUser'
,
params
);
}
src/pages/categoryManage/category/components/addCgyDailog/index.tsx
浏览文件 @
fc671864
...
...
@@ -9,7 +9,7 @@ import './index.scss';
function
Index
(
props
:
any
)
{
const
headers
:
any
=
{
token
:
Cookies
.
get
(
'S
XTB
-TOKEN'
),
token
:
Cookies
.
get
(
'S
HAREFLY
-TOKEN'
),
};
const
[
form
]
=
Form
.
useForm
();
const
[
imageUrl
,
setImageUrl
]
=
useState
(
''
);
...
...
src/pages/categoryManage/category/components/addOrEditDec copy/index.tsx
deleted
100644 → 0
浏览文件 @
173ac483
import
{
Modal
,
Form
,
Input
,
Button
,
Row
,
Col
,
message
}
from
'antd'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
PlusOutlined
,
MinusOutlined
}
from
'@ant-design/icons'
;
import
{
PropsType
}
from
'~/common/interface/modal'
;
import
{
categoryDec
}
from
'~/api/modules/goods'
;
import
{
CategoryManageAPI
}
from
'~/api'
;
interface
selfPropsType
{
directoryList
:
categoryDec
[];
refreshDec
:
Function
;
}
const
AddOrEditDec
:
React
.
FC
<
PropsType
&
selfPropsType
>
=
({
isModalVisible
,
handleOk
,
handleCancel
,
directoryList
,
refreshDec
,
})
=>
{
const
[
form
]
=
Form
.
useForm
<
any
>
();
// 表单目录标题列表
const
[
addOrEditDirectoryList
,
setAddOrEditDirectoryList
]
=
useState
<
categoryDec
[]
>
([]);
// 是否点击删除按钮
const
[
isClickDle
,
setIsClickDle
]
=
useState
<
boolean
>
(
false
);
useEffect
(()
=>
{
if
(
directoryList
.
length
!=
0
&&
!
isClickDle
)
{
setAddOrEditDirectoryList
(
directoryList
);
const
defaultFormValue
=
directoryList
.
reduce
((
pre
:
any
,
cur
:
categoryDec
)
=>
{
Object
.
keys
(
cur
).
map
((
item
:
string
)
=>
{
if
(
item
===
'id'
)
{
pre
[
cur
[
item
]]
=
cur
.
sortName
;
}
});
return
pre
;
},
{});
form
.
setFieldsValue
(
defaultFormValue
);
}
},
[
directoryList
]);
// 新增或修改目录
const
addDirectoryTitle
=
()
=>
{
const
decList
:
categoryDec
[]
=
[...
addOrEditDirectoryList
].
sort
(
(
a
:
categoryDec
,
b
:
categoryDec
)
=>
a
.
id
-
b
.
id
,
);
setAddOrEditDirectoryList
([
...
addOrEditDirectoryList
,
{
id
:
decList
[
decList
.
length
-
1
].
id
+
1
,
defaultType
:
1
,
sortName
:
''
,
},
]);
};
// 删除目录
const
deleteDirectory
=
async
(
id
:
number
)
=>
{
const
bol
:
boolean
=
directoryList
.
some
((
item
:
categoryDec
)
=>
item
.
id
===
id
);
const
index
=
addOrEditDirectoryList
.
findIndex
((
item
:
categoryDec
)
=>
item
.
id
===
id
);
if
(
bol
)
{
const
res
:
any
=
await
CategoryManageAPI
.
removeDirectory
(
id
);
if
(
res
.
code
===
'200'
)
{
message
.
success
(
'删除成功'
);
setIsClickDle
(
true
);
refreshDec
(
id
);
}
else
{
return
message
.
warning
(
res
.
message
);
}
}
const
obj
:
any
=
{};
obj
[
id
]
=
undefined
;
form
.
setFieldsValue
(
obj
);
addOrEditDirectoryList
.
splice
(
index
,
1
);
setAddOrEditDirectoryList
([...
addOrEditDirectoryList
]);
};
const
directorySureEvent
=
()
=>
{
form
.
validateFields
().
then
(
async
(
value
:
any
)
=>
{
const
requestList
=
Object
.
keys
(
value
).
reduce
((
pre
:
any
,
cur
:
string
)
=>
{
const
bol
:
boolean
=
directoryList
.
some
((
item
:
any
)
=>
item
.
id
===
Number
(
cur
));
if
(
bol
)
{
pre
.
push
({
id
:
Number
(
cur
),
directoryName
:
value
[
cur
],
});
}
else
{
pre
.
push
({
directoryName
:
value
[
cur
],
});
}
return
pre
;
},
[]);
const
res
:
any
=
await
CategoryManageAPI
.
addOrEditDirectory
(
requestList
);
if
(
res
.
code
===
'200'
)
{
message
.
success
(
'操作成功'
);
form
.
resetFields
();
setIsClickDle
(
false
);
handleOk
();
}
else
{
message
.
warning
(
res
.
message
);
}
});
};
const
directoryCancel
=
()
=>
{
form
.
resetFields
();
setIsClickDle
(
false
);
handleCancel
();
};
return
(
<
Modal
title=
'目录管理'
open=
{
isModalVisible
}
onOk=
{
directorySureEvent
}
onCancel=
{
directoryCancel
}
>
<
Form
form=
{
form
}
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
16
}
}
>
<
Form
.
Item
label=
'添加目录'
labelCol=
{
{
span
:
4
}
}
wrapperCol=
{
{
span
:
16
}
}
>
<
Button
icon=
{
<
PlusOutlined
/>
}
onClick=
{
addDirectoryTitle
}
/>
</
Form
.
Item
>
{
addOrEditDirectoryList
.
map
((
item
:
categoryDec
)
=>
(
<
Row
key=
{
item
.
id
}
gutter=
{
{
xs
:
8
,
sm
:
16
,
md
:
24
}
}
>
<
Col
span=
{
16
}
>
<
Form
.
Item
label=
'目录名称'
name=
{
item
.
id
}
rules=
{
[{
required
:
true
,
message
:
'请输入目录名称'
}]
}
>
<
Input
placeholder=
'请输入目录名称'
maxLength=
{
30
}
/>
</
Form
.
Item
>
</
Col
>
<
Col
>
{
item
.
defaultType
?
(
<
Button
icon=
{
<
MinusOutlined
/>
}
type=
'primary'
onClick=
{
()
=>
deleteDirectory
(
item
.
id
)
}
/>
)
:
(
''
)
}
</
Col
>
</
Row
>
))
}
</
Form
>
</
Modal
>
);
};
export
default
AddOrEditDec
;
src/pages/customManage/customList/index.tsx
浏览文件 @
fc671864
import
{
useState
}
from
'react'
;
import
{
use
Effect
,
use
State
}
from
'react'
;
import
SearchBox
from
'~/components/search-box'
;
import
{
Button
,
Table
}
from
'antd'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
{
ChangeModal
}
from
'~/pages/customManage/customList/comp/changeModal'
;
import
{
InterListType
,
InterReqType
}
from
'~/api/interface'
;
import
{
listAppUserType
}
from
'~/api/interface/customManageType'
;
import
{
CustomManageAPI
}
from
'~/api'
;
// 表格数据类型
type
TableType
=
any
;
type
TableType
=
InterListType
<
listAppUserType
>
;
// 请求数据的类型
type
ReqType
=
InterReqType
<
listAppUserType
>
;
// 搜索表单的数据
let
query
:
ReqType
=
{};
//来源列表
const
portTypeList
=
[
{
value
:
100
,
label
:
'自然流'
},
{
value
:
200
,
label
:
'海报'
},
{
value
:
300
,
label
:
'抖音'
},
{
value
:
400
,
label
:
'公众号'
},
{
value
:
500
,
label
:
'社群'
},
{
value
:
600
,
label
:
'招投标'
},
];
function
CustomListView
()
{
// 是否打开变更弹窗
const
[
isChangeVisModal
,
setIsChangeVisModal
]
=
useState
<
boolean
>
(
false
);
// 表格分页配置
const
[
pagination
]
=
useState
({
const
[
pagination
,
setPagination
]
=
useState
({
total
:
0
,
pageSize
:
10
,
current
:
1
,
totalPage
:
0
,
});
// 表格数据
const
[
tableData
]
=
useState
<
TableType
>
([{
id
:
1
}
]);
const
[
tableData
,
setTableData
]
=
useState
<
TableType
>
([
]);
// 需要编辑的数据
const
[
editData
]
=
useState
<
TableType
[
0
]
>
();
// 加载列表
const
getTableList
=
async
(
value
=
{})
=>
{
// 只需要修改这个地方的接口即可
const
res
=
await
CustomManageAPI
.
listAppUser
({
pageNo
:
pagination
.
current
,
pageSize
:
pagination
.
pageSize
,
...
value
,
...
query
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
const
{
list
,
pageNo
,
totalCount
,
pageSize
,
totalPage
}
=
res
.
result
;
// 解构
setPagination
({
total
:
totalCount
,
current
:
pageNo
,
pageSize
,
totalPage
,
});
setTableData
(
list
);
// console.log('加载列表 --->', list);
}
};
// 翻页
const
paginationChange
=
(
pageNo
:
number
,
pageSize
:
number
)
=>
{
getTableList
({
pageNo
,
pageSize
}).
then
();
};
// 表单提交
const
onFinish
=
(
data
:
ReqType
)
=>
{
pagination
.
current
=
1
;
query
=
data
;
getTableList
(
data
).
then
();
};
// componentDidMount
useEffect
(()
=>
{
query
=
{};
getTableList
().
then
();
},
[]);
// 表格结构
const
columns
:
ColumnsType
<
TableType
[
0
]
>
=
[
{
title
:
'用户UID'
,
dataIndex
:
'u
serName
'
,
dataIndex
:
'u
id
'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
width
:
'100px'
,
render
:
(
text
)
=>
`UID
${
text
}
`
,
},
{
title
:
'用户名称'
,
dataIndex
:
'userName'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
render
:
(
text
,
record
)
=>
text
||
record
.
nickName
,
},
{
title
:
'手机号'
,
dataIndex
:
'
userName
'
,
dataIndex
:
'
phoneNum
'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
},
{
title
:
'认证企业'
,
dataIndex
:
'
user
Name'
,
dataIndex
:
'
company
Name'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
},
{
title
:
'企业认证'
,
dataIndex
:
'
userName
'
,
dataIndex
:
'
companyAuthStatus
'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
render
:
(
text
)
=>
(
text
===
0
?
'未认证'
:
'已认证'
)
,
},
{
title
:
'电子签约认证'
,
dataIndex
:
'userName'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--
`
,
render
:
(
_text
)
=>
`未认证
`
,
},
{
title
:
'用户来源'
,
dataIndex
:
'
userNam
e'
,
dataIndex
:
'
portTyp
e'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
render
:
(
text
)
=>
portTypeList
.
find
((
i
)
=>
i
.
value
===
text
)?.
label
||
text
,
},
{
title
:
'创建时间'
,
dataIndex
:
'
userNa
me'
,
dataIndex
:
'
createTi
me'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
},
{
title
:
'账号类型'
,
dataIndex
:
'
userName
'
,
dataIndex
:
'
phoneNum
'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
render
:
(
text
)
=>
(
text
?
'普通用户'
:
'游客用户'
)
,
},
{
title
:
'渠道等级'
,
dataIndex
:
'
remark
'
,
dataIndex
:
'
cooperationTagId
'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
render
:
(
text
)
=>
text
,
},
{
title
:
'上级推荐人'
,
dataIndex
:
'remark'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
render
:
(
_text
)
=>
`--`
,
},
{
title
:
'推荐伙伴'
,
dataIndex
:
'remark'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
render
:
(
_text
)
=>
`--`
,
},
{
title
:
'相关运营'
,
dataIndex
:
'remark'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
render
:
(
_text
)
=>
`--`
,
},
{
title
:
'相关销售'
,
dataIndex
:
'remark'
,
align
:
'center'
,
render
:
(
_text
,
_record
)
=>
`--`
,
render
:
(
_text
)
=>
`--`
,
},
{
title
:
'操作'
,
...
...
@@ -113,7 +163,7 @@ function CustomListView() {
align
:
'center'
,
fixed
:
'right'
,
width
:
'150px'
,
render
:
(
_text
,
_record
)
=>
(
render
:
(
_text
)
=>
(
<>
<
Button
type=
{
'link'
}
...
...
@@ -151,14 +201,7 @@ function CustomListView() {
name
:
'form'
,
type
:
'Select'
,
placeholder
:
'请选择相关来源'
,
options
:
[
{
value
:
1
,
label
:
'自然流'
},
{
value
:
2
,
label
:
'海报'
},
{
value
:
3
,
label
:
'抖音'
},
{
value
:
4
,
label
:
'公众号'
},
{
value
:
5
,
label
:
'社群'
},
{
value
:
6
,
label
:
'招投标'
},
],
options
:
portTypeList
,
},
{
label
:
'创建时间'
,
...
...
@@ -187,7 +230,7 @@ function CustomListView() {
],
},
]
}
searchData=
{
(
e
:
any
)
=>
console
.
log
(
'提交数据 --->'
,
e
)
}
searchData=
{
onFinish
}
/>
<
Table
size=
'small'
...
...
@@ -201,8 +244,7 @@ function CustomListView() {
current
:
pagination
.
current
,
showSizeChanger
:
true
,
showQuickJumper
:
true
,
// onChange: (page: number, pageSize: number) =>
// paginationChange(page, pageSize),
onChange
:
(
page
:
number
,
pageSize
:
number
)
=>
paginationChange
(
page
,
pageSize
),
showTotal
:
(
total
,
range
)
=>
`当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`
,
}
}
// rowSelection={{ selectedRowKeys, onChange: onSelectChange }}
...
...
src/router/router.tsx
浏览文件 @
fc671864
...
...
@@ -18,7 +18,6 @@ import {
RedEnvelopeOutlined
,
SettingOutlined
,
UserOutlined
,
SisternodeOutlined
,
SendOutlined
,
RocketOutlined
,
AppstoreAddOutlined
,
...
...
@@ -343,6 +342,82 @@ export const routerList: Array<RouteObjectType> = [
],
},
{
path
:
'/categoryManage'
,
element
:
<
LayoutView
/>,
errorElement
:
<
ErrorPage
/>,
meta
:
{
id
:
18000
,
icon
:
<
ReconciliationOutlined
/>,
title
:
'分类管理'
,
},
children
:
[
{
path
:
'/categoryManage/jobServicesCategory/1'
,
element
:
withLoadingComponent
(<
CategoryManage
/>),
meta
:
{
id
:
18100
,
title
:
'作业服务分类'
,
icon
:
<
SendOutlined
/>,
},
},
{
path
:
'/categoryManage/jobServicesCategory/2'
,
element
:
withLoadingComponent
(<
CategoryManage
/>),
meta
:
{
id
:
18200
,
title
:
'设备租赁分类'
,
icon
:
<
RocketOutlined
/>,
},
},
{
path
:
'/categoryManage/jobServicesCategory/3'
,
element
:
withLoadingComponent
(<
CategoryManage
/>),
meta
:
{
id
:
18300
,
title
:
'飞手培训分类'
,
icon
:
<
AppstoreAddOutlined
/>,
},
},
{
path
:
'/categoryManage/jobServicesCategory/4'
,
element
:
withLoadingComponent
(<
CategoryManage
/>),
meta
:
{
id
:
18400
,
title
:
'产品商城分类'
,
icon
:
<
AppstoreOutlined
/>,
},
},
{
path
:
'/categoryManage/jobServicesCategory/0'
,
element
:
withLoadingComponent
(<
CategoryManage
/>),
meta
:
{
id
:
18500
,
title
:
'通用分类'
,
icon
:
<
CoffeeOutlined
/>,
},
},
{
path
:
'/categoryManage/detail/:id'
,
element
:
withLoadingComponent
(<
CategoryDetail
/>),
meta
:
{
id
:
18600
,
title
:
'分类详情'
,
icon
:
''
,
hidden
:
true
,
},
},
{
path
:
'/categoryManage/DirectoryManage'
,
element
:
withLoadingComponent
(<
DirectoryManage
/>),
meta
:
{
id
:
18700
,
title
:
'目录管理'
,
icon
:
<
UnorderedListOutlined
/>,
},
},
],
},
{
path
:
'/customManage'
,
element
:
<
LayoutView
/>,
errorElement
:
<
ErrorPage
/>,
...
...
@@ -550,77 +625,22 @@ export const routerList: Array<RouteObjectType> = [
],
},
{
path
:
'/
category
Manage'
,
path
:
'/
system
Manage'
,
element
:
<
LayoutView
/>,
errorElement
:
<
ErrorPage
/>,
meta
:
{
id
:
1
8000
,
icon
:
<
Reconciliation
Outlined
/>,
title
:
'
分类
管理'
,
id
:
2
8000
,
icon
:
<
Setting
Outlined
/>,
title
:
'
系统
管理'
,
},
children
:
[
{
path
:
'/categoryManage/jobServicesCategory/1'
,
element
:
withLoadingComponent
(<
CategoryManage
/>),
meta
:
{
id
:
18100
,
title
:
'作业服务分类'
,
icon
:
<
SendOutlined
/>,
},
},
{
path
:
'/categoryManage/jobServicesCategory/2'
,
element
:
withLoadingComponent
(<
CategoryManage
/>),
meta
:
{
id
:
18200
,
title
:
'设备租赁分类'
,
icon
:
<
RocketOutlined
/>,
},
},
{
path
:
'/categoryManage/jobServicesCategory/3'
,
element
:
withLoadingComponent
(<
CategoryManage
/>),
meta
:
{
id
:
18300
,
title
:
'飞手培训分类'
,
icon
:
<
AppstoreAddOutlined
/>,
},
},
{
path
:
'/categoryManage/jobServicesCategory/4'
,
element
:
withLoadingComponent
(<
CategoryManage
/>),
meta
:
{
id
:
18400
,
title
:
'产品商城分类'
,
icon
:
<
AppstoreOutlined
/>,
},
},
{
path
:
'/categoryManage/jobServicesCategory/0'
,
element
:
withLoadingComponent
(<
CategoryManage
/>),
path
:
'/systemManage/accountManage'
,
element
:
withLoadingComponent
(<
AccountManageView
/>),
meta
:
{
id
:
18500
,
title
:
'通用分类'
,
icon
:
<
CoffeeOutlined
/>,
},
},
{
path
:
'/categoryManage/detail/:id'
,
element
:
withLoadingComponent
(<
CategoryDetail
/>),
meta
:
{
id
:
18600
,
title
:
'分类详情'
,
icon
:
''
,
hidden
:
true
,
},
},
{
path
:
'/categoryManage/DirectoryManage'
,
element
:
withLoadingComponent
(<
DirectoryManage
/>),
meta
:
{
id
:
18700
,
title
:
'目录管理'
,
icon
:
<
UnorderedListOutlined
/>,
id
:
28100
,
title
:
'账号管理'
,
icon
:
<
UserOutlined
/>,
},
},
],
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论