Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
admin-ci-test
Commits
a4db0386
提交
a4db0386
authored
6月 28, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:用户标签
上级
7a7bd083
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
38 行增加
和
29 行删除
+38
-29
customManageType.ts
src/api/interface/customManageType.ts
+16
-0
customManage.ts
src/api/modules/customManage.ts
+4
-1
index.tsx
src/pages/customManage/customList/comp/changeModal/index.tsx
+10
-12
index.tsx
src/pages/customManage/customList/index.tsx
+8
-16
没有找到文件。
src/api/interface/customManageType.ts
浏览文件 @
a4db0386
...
...
@@ -29,6 +29,14 @@ export type listAppUserType = InterListFunction<
cooperationTagId
:
number
;
companyName
:
null
;
tagName
:
null
;
cooperationTagVOS
:
{
createTime
:
string
;
id
:
number
;
tagDescription
:
string
;
tagImg
:
string
;
tagName
:
string
;
tagRequire
:
string
;
}[];
}
>
;
// 加盟标签列表
...
...
@@ -75,6 +83,14 @@ export type changeUserTagType = InterFunction<
},
NonNullable
<
unknown
>
>
;
// 后台设置小程序用户标签
export
type
changeUserTagNew
=
InterFunction
<
{
cooperationTagIds
:
number
[];
userAccountId
:
number
;
},
NonNullable
<
unknown
>
>
;
// 加盟标签列表
export
type
cooperationListTag
=
InterFunction
<
NonNullable
<
unknown
>
,
...
...
src/api/modules/customManage.ts
浏览文件 @
a4db0386
...
...
@@ -2,6 +2,7 @@ import axios from '../request';
import
{
applyTagDetails
,
approvalApplyTag
,
changeUserTagNew
,
changeUserTagType
,
CompanyListTag
,
cooperationListTag
,
...
...
@@ -24,7 +25,9 @@ export class CustomManageAPI {
// 后台设置小程序用户标签
static
changeUserTag
:
changeUserTagType
=
(
params
)
=>
axios
.
get
(
'/userapp/cooperation/changeUserTag'
,
{
params
});
// 后台设置小程序用户标签
static
changeUserTagNew
:
changeUserTagNew
=
(
params
)
=>
axios
.
post
(
'/userapp/cooperation/changeUserTag'
,
params
);
// 加盟标签列表
static
cooperationListTag
:
cooperationListTag
=
(
params
)
=>
axios
.
get
(
'/userapp/cooperation/listTag'
,
{
params
});
...
...
src/pages/customManage/customList/comp/changeModal/index.tsx
浏览文件 @
a4db0386
import
{
FC
,
useEffect
,
useState
}
from
'react'
;
import
{
Form
,
Modal
,
Select
}
from
'antd'
;
import
{
InterListType
}
from
'~/api/interface'
;
import
{
listAppUserType
}
from
'~/api/interface/customManageType'
;
import
{
InterListType
,
InterReqType
}
from
'~/api/interface'
;
import
{
changeUserTagNew
,
listAppUserType
}
from
'~/api/interface/customManageType'
;
import
{
CustomManageAPI
}
from
'~/api'
;
// 表单参数
type
ReqType
=
InterReqType
<
changeUserTagNew
>
;
// 表格数据类型
type
TableType
=
InterListType
<
listAppUserType
>
;
// 数据的类型
...
...
@@ -13,11 +15,6 @@ interface PropsType {
data
?:
TableType
[
0
];
}
// 修改等级标签
interface
tagLevelForm
{
cooperationTagId
:
number
;
}
export
const
ChangeModal
:
FC
<
PropsType
>
=
(
props
)
=>
{
ChangeModal
.
defaultProps
=
{
data
:
undefined
,
...
...
@@ -25,7 +22,7 @@ export const ChangeModal: FC<PropsType> = (props) => {
// 父组件传参
const
{
open
,
closed
,
data
}
=
props
;
// 个人等级标签
const
[
form
]
=
Form
.
useForm
<
tagLevelForm
>
();
const
[
form
]
=
Form
.
useForm
<
ReqType
>
();
// 相关运营列表
const
[
operationList
]
=
useState
<
{
value
:
number
;
label
:
string
}[]
>
([]);
// 等级标签列表
...
...
@@ -40,9 +37,9 @@ export const ChangeModal: FC<PropsType> = (props) => {
// 提交数据
const
handleSubmit
=
()
=>
{
form
.
validateFields
().
then
(
async
(
value
)
=>
{
const
res
=
await
CustomManageAPI
.
changeUserTag
({
const
res
=
await
CustomManageAPI
.
changeUserTag
New
({
userAccountId
:
Number
(
data
?.
id
),
cooperationTagId
:
value
.
cooperationTagId
,
cooperationTagId
s
:
value
?.
cooperationTagIds
||
[]
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
handleClosed
();
...
...
@@ -62,18 +59,19 @@ export const ChangeModal: FC<PropsType> = (props) => {
if
(
!
data
)
return
;
getCompanyListTag
().
then
();
form
.
setFieldsValue
({
cooperationTagId
:
data
.
cooperationTagId
,
cooperationTagId
s
:
data
.
cooperationTagVOS
?.
map
((
i
)
=>
i
.
id
)
,
});
},
[
open
]);
return
(
<
Modal
open=
{
open
}
title=
'变更'
onCancel=
{
handleClosed
}
destroyOnClose
onOk=
{
handleSubmit
}
>
<
Form
form=
{
form
}
labelCol=
{
{
span
:
5
}
}
wrapperCol=
{
{
span
:
16
}
}
>
<
Form
.
Item
label=
'等级标签'
name=
'cooperationTagId'
>
<
Form
.
Item
label=
'等级标签'
name=
'cooperationTagId
s
'
>
<
Select
placeholder=
'请选择等级标签'
disabled=
{
!
data
?.
userName
&&
!
data
?.
companyName
}
allowClear
options=
{
cooperationTagIdList
}
mode=
'multiple'
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'相关运营'
name=
'mallOperator'
>
...
...
src/pages/customManage/customList/index.tsx
浏览文件 @
a4db0386
import
{
useEffect
,
useState
}
from
'react'
;
import
SearchBox
from
'~/components/search-box'
;
import
{
Button
,
message
,
Modal
,
Table
}
from
'antd'
;
import
{
Button
,
message
,
Modal
,
Table
,
Tag
}
from
'antd'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
{
ChangeModal
}
from
'~/pages/customManage/customList/comp/changeModal'
;
import
{
InterListType
,
InterReqType
}
from
'~/api/interface'
;
...
...
@@ -25,10 +25,6 @@ const portTypeList = [
function
CustomListView
()
{
const
{
confirm
}
=
Modal
;
// 等级标签列表
const
[
cooperationTagIdList
,
setCooperationTagIdList
]
=
useState
<
{
value
:
number
;
label
:
string
}[]
>
([]);
// 是否打开变更弹窗
const
[
isChangeVisModal
,
setIsChangeVisModal
]
=
useState
<
boolean
>
(
false
);
// 表格分页配置
...
...
@@ -73,14 +69,6 @@ function CustomListView() {
query
=
data
;
getTableList
(
data
).
then
();
};
// 获取加盟列表
const
getCompanyListTag
=
async
()
=>
{
const
res
=
await
CustomManageAPI
.
CompanyListTag
({});
if
(
res
&&
res
.
code
===
'200'
)
{
setCooperationTagIdList
(
res
.
result
.
map
((
i
)
=>
({
value
:
i
.
id
,
label
:
i
.
tagName
})));
// console.log(res.result);
}
};
// 删除用户
const
handleDelete
=
(
value
:
TableType
[
0
])
=>
{
confirm
({
...
...
@@ -102,7 +90,6 @@ function CustomListView() {
useEffect
(()
=>
{
query
=
{};
(
async
()
=>
{
await
getCompanyListTag
();
await
getTableList
();
})();
},
[]);
...
...
@@ -161,9 +148,14 @@ function CustomListView() {
},
{
title
:
'渠道等级'
,
dataIndex
:
'cooperationTag
Id
'
,
dataIndex
:
'cooperationTag
VOS
'
,
align
:
'center'
,
render
:
(
text
)
=>
cooperationTagIdList
.
find
((
i
)
=>
i
.
value
===
text
)?.
label
||
text
,
render
:
(
_text
,
record
)
=>
record
.
cooperationTagVOS
?.
map
((
i
,
j
)
=>
(
<
Tag
color=
'processing'
key=
{
j
}
style=
{
{
marginBottom
:
'10px'
}
}
>
{
i
.
tagName
}
</
Tag
>
)),
},
{
title
:
'上级推荐人'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论