Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
da2a257f
提交
da2a257f
authored
4月 25, 2024
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:消息管理-客服消息切换客服
上级
5ac9498e
流水线
#9045
已通过 于阶段
in 1 分 3 秒
变更
6
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
151 行增加
和
27 行删除
+151
-27
index.tsx
src/components/layout/index.tsx
+4
-2
index.tsx
src/components/layout/menu/index.tsx
+1
-1
index.tsx
.../messageManage/messageChat/comp/MessageChatRole/index.tsx
+41
-0
index.scss
src/pages/messageManage/messageChat/index.scss
+75
-2
index.tsx
src/pages/messageManage/messageChat/index.tsx
+24
-8
router.tsx
src/router/router.tsx
+6
-14
没有找到文件。
src/components/layout/index.tsx
浏览文件 @
da2a257f
...
@@ -5,9 +5,10 @@ import HeaderView from './header';
...
@@ -5,9 +5,10 @@ import HeaderView from './header';
import
{
MenuView
}
from
'./menu'
;
import
{
MenuView
}
from
'./menu'
;
import
'./index.scss'
;
import
'./index.scss'
;
import
{
TitleView
}
from
'./title'
;
import
{
TitleView
}
from
'./title'
;
import
React
from
'react'
;
const
{
Content
}
=
Layout
;
const
{
Content
}
=
Layout
;
function
LayoutView
()
{
const
LayoutView
:
React
.
FC
<
{
children
?:
React
.
ReactNode
}
>
=
({
children
})
=>
{
return
(
return
(
<
Layout
className=
'layout-view'
>
<
Layout
className=
'layout-view'
>
<
TitleView
/>
<
TitleView
/>
...
@@ -17,10 +18,11 @@ function LayoutView() {
...
@@ -17,10 +18,11 @@ function LayoutView() {
<
HeaderView
/>
<
HeaderView
/>
<
Content
className=
'layout-content'
>
<
Content
className=
'layout-content'
>
<
Outlet
/>
<
Outlet
/>
{
children
}
</
Content
>
</
Content
>
</
Layout
>
</
Layout
>
</
Layout
>
</
Layout
>
</
Layout
>
</
Layout
>
);
);
}
}
;
export
default
LayoutView
;
export
default
LayoutView
;
src/components/layout/menu/index.tsx
浏览文件 @
da2a257f
...
@@ -100,7 +100,7 @@ export function MenuView() {
...
@@ -100,7 +100,7 @@ export function MenuView() {
// 设置侧边栏数据
// 设置侧边栏数据
authRouterList
().
then
(
async
(
value
)
=>
{
authRouterList
().
then
(
async
(
value
)
=>
{
// 除了数据看板,其他没有子项的菜单全部过滤掉
// 除了数据看板,其他没有子项的菜单全部过滤掉
const
arr
=
getItem
(
value
)?.
filter
((
i
:
any
)
=>
i
?.
key
===
100
)
||
[];
const
arr
=
getItem
(
value
)?.
filter
((
i
:
any
)
=>
[
100
,
1400
]?.
includes
(
i
?.
key
)
)
||
[];
const
brr
=
getItem
(
value
)?.
filter
((
i
:
any
)
=>
i
?.
children
?.
length
)
||
[];
const
brr
=
getItem
(
value
)?.
filter
((
i
:
any
)
=>
i
?.
children
?.
length
)
||
[];
// 设置要展示的菜单列表
// 设置要展示的菜单列表
setItems
([...
arr
,
...
brr
]);
setItems
([...
arr
,
...
brr
]);
...
...
src/pages/messageManage/messageChat/comp/MessageChatRole/index.tsx
0 → 100644
浏览文件 @
da2a257f
import
React
from
'react'
;
import
{
InterDataType
}
from
'~/api/interface'
;
import
{
listUserAndRoleByCompanyIdType
}
from
'~/api/interface/systemManageType'
;
// 角色列表
type
RoleType
=
InterDataType
<
listUserAndRoleByCompanyIdType
>
;
const
MessageChatRole
:
React
.
FC
<
{
roleList
:
RoleType
;
userAccountId
?:
number
;
onSelect
:
(
data
:
RoleType
[
0
])
=>
void
;
}
>
=
({
roleList
,
userAccountId
,
onSelect
})
=>
{
// 选择事件
const
handleSelect
=
(
data
:
RoleType
[
0
])
=>
{
onSelect
?.(
data
);
};
return
(
<
div
className=
{
'message-chat-role'
}
>
{
roleList
?.
map
((
i
,
j
)
=>
(
<
div
className=
{
`role-item flex-start ${userAccountId === i?.userAccountId && 'item-active'}`
}
key=
{
j
}
onClick=
{
()
=>
handleSelect
(
i
)
}
>
<
img
className=
{
'image'
}
src=
{
i
?.
userAccountVO
?.
userImg
}
alt=
{
i
?.
roleName
}
/>
<
div
className=
'content flex-start'
>
<
div
className=
'title text-ellipsis'
title=
{
i
?.
userAccountVO
?.
nickName
||
i
?.
userAccountVO
?.
userName
}
>
{
i
?.
userAccountVO
?.
nickName
||
i
?.
userAccountVO
?.
userName
}
</
div
>
<
div
className=
'role'
>
{
i
?.
roleName
}
</
div
>
</
div
>
</
div
>
))
}
</
div
>
);
};
export
default
MessageChatRole
;
src/pages/messageManage/messageChat/index.scss
浏览文件 @
da2a257f
...
@@ -4,6 +4,73 @@
...
@@ -4,6 +4,73 @@
box-sizing
:
border-box
;
box-sizing
:
border-box
;
align-items
:
flex-start
!
important
;
align-items
:
flex-start
!
important
;
&
-role
{
position
:
relative
;
width
:
58px
;
box-sizing
:
border-box
;
overflow
:
hidden
;
transform
:
translateX
(
-6px
);
transition
:
all
168ms
ease-in-out
;
min-height
:
84vh
;
background
:
#F6F6F6
;
border-radius
:
8px
;
&
:hover
{
width
:
160px
;
}
.role-item
{
position
:
relative
;
box-sizing
:
border-box
;
padding
:
10px
;
border-radius
:
8px
;
cursor
:
pointer
;
flex-wrap
:
nowrap
;
transition
:
all
100ms
ease-in-out
;
&
:hover
{
background
:
rgba
(
233
,
240
,
254
,
0
.5
);
}
.image
{
width
:
40px
;
height
:
40px
;
border-radius
:
50%
;
object-fit
:
fill
;
margin-right
:
8px
;
}
.content
{
position
:
relative
;
box-sizing
:
border-box
;
width
:
86px
;
flex-direction
:
column
;
align-items
:
flex-start
;
.title
{
max-width
:
86px
;
color
:
#000000
;
font-weight
:
bold
;
margin-bottom
:
8px
;
}
.role
{
position
:
relative
;
box-sizing
:
border-box
;
height
:
16px
;
background
:
linear-gradient
(
270deg
,
#fff1ec
0%
,
#ffffff
54%
,
#ffe5db
100%
);
border-radius
:
4px
;
border
:
1px
solid
#ffb099
;
padding
:
0
4px
;
line-height
:
14px
;
text-align
:
center
;
font-weight
:
500
;
font-size
:
10px
;
color
:
#ff521e
;
}
}
}
.item-active
{
background
:
#E9F0FE
;
&
:hover
{
background
:
#E9F0FE
;
}
}
}
&
-list
{
&
-list
{
position
:
relative
;
position
:
relative
;
width
:
300px
;
width
:
300px
;
...
@@ -21,6 +88,7 @@
...
@@ -21,6 +88,7 @@
padding
:
10px
;
padding
:
10px
;
border-radius
:
8px
;
border-radius
:
8px
;
cursor
:
pointer
;
cursor
:
pointer
;
transition
:
all
100ms
ease-in-out
;
&
:hover
{
&
:hover
{
background
:
rgba
(
233
,
240
,
254
,
0
.35
);
background
:
rgba
(
233
,
240
,
254
,
0
.35
);
...
@@ -193,6 +261,11 @@
...
@@ -193,6 +261,11 @@
font-size
:
14px
;
font-size
:
14px
;
color
:
#333333
;
color
:
#333333
;
line-height
:
16px
;
line-height
:
16px
;
.text
{
img
{
max-width
:
100%
!
important
;
}
}
}
}
}
}
}
}
...
@@ -228,14 +301,14 @@
...
@@ -228,14 +301,14 @@
padding
:
30px
0
0
0
;
padding
:
30px
0
0
0
;
.qrcode-view
{
.qrcode-view
{
position
:
relative
;
position
:
relative
;
width
:
1
40
px
;
width
:
1
28
px
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
margin
:
0
auto
;
margin
:
0
auto
;
}
}
.qrcode-text
{
.qrcode-text
{
width
:
100%
;
width
:
100%
;
font-weight
:
400
;
font-weight
:
400
;
font-size
:
1
4
px
;
font-size
:
1
3
px
;
color
:
#666666
;
color
:
#666666
;
text-align
:
center
;
text-align
:
center
;
margin-top
:
30px
;
margin-top
:
30px
;
...
...
src/pages/messageManage/messageChat/index.tsx
浏览文件 @
da2a257f
...
@@ -5,13 +5,19 @@ import MessageChatListView from '~/pages/messageManage/messageChat/comp/messageC
...
@@ -5,13 +5,19 @@ import MessageChatListView from '~/pages/messageManage/messageChat/comp/messageC
import
{
SystemManageAPI
}
from
'~/api'
;
import
{
SystemManageAPI
}
from
'~/api'
;
import
{
isNull
}
from
'lodash'
;
import
{
isNull
}
from
'lodash'
;
import
{
InterDataType
}
from
'~/api/interface'
;
import
{
InterDataType
}
from
'~/api/interface'
;
import
{
selectUserListType
}
from
'~/api/interface/systemManageType'
;
import
{
listUserAndRoleByCompanyIdType
,
selectUserListType
,
}
from
'~/api/interface/systemManageType'
;
import
MessageChatContentView
from
'src/pages/messageManage/messageChat/comp/messageChatContent'
;
import
MessageChatContentView
from
'src/pages/messageManage/messageChat/comp/messageChatContent'
;
import
QrcodeView
from
'~/components/qrcodeView'
;
import
QrcodeView
from
'~/components/qrcodeView'
;
import
MessageChatSystemView
from
'~/pages/messageManage/messageChat/comp/messageChatSystem'
;
import
MessageChatSystemView
from
'~/pages/messageManage/messageChat/comp/messageChatSystem'
;
import
MessageChatRole
from
'~/pages/messageManage/messageChat/comp/MessageChatRole'
;
// 消息类型
// 消息类型
type
MessageType
=
InterDataType
<
selectUserListType
>
;
type
MessageType
=
InterDataType
<
selectUserListType
>
;
// 角色列表
type
RoleType
=
InterDataType
<
listUserAndRoleByCompanyIdType
>
;
// 定时任务
// 定时任务
let
intervalTimer
:
NodeJS
.
Timer
;
let
intervalTimer
:
NodeJS
.
Timer
;
...
@@ -21,6 +27,8 @@ const MessageChatPage: React.FC = () => {
...
@@ -21,6 +27,8 @@ const MessageChatPage: React.FC = () => {
const
{
userInfo
}
=
useSelector
((
state
:
any
)
=>
state
.
UserInfo
);
const
{
userInfo
}
=
useSelector
((
state
:
any
)
=>
state
.
UserInfo
);
// 用户id
// 用户id
const
[
userAccountId
,
setUserAccountId
]
=
useState
<
number
>
();
const
[
userAccountId
,
setUserAccountId
]
=
useState
<
number
>
();
// 角色列表
const
[
roleList
,
setRoleList
]
=
useState
<
RoleType
>
([]);
// 获取用户id
// 获取用户id
const
getUserAccountId
=
async
()
=>
{
const
getUserAccountId
=
async
()
=>
{
const
res
=
await
SystemManageAPI
.
listUserAndRoleByCompanyId
({
const
res
=
await
SystemManageAPI
.
listUserAndRoleByCompanyId
({
...
@@ -28,6 +36,7 @@ const MessageChatPage: React.FC = () => {
...
@@ -28,6 +36,7 @@ const MessageChatPage: React.FC = () => {
});
});
if
(
res
&&
res
.
code
===
'200'
)
{
if
(
res
&&
res
.
code
===
'200'
)
{
if
(
res
.
result
?.[
0
]?.
userAccountId
)
{
if
(
res
.
result
?.[
0
]?.
userAccountId
)
{
setRoleList
(
res
.
result
||
[]);
setUserAccountId
(
res
.
result
?.[
0
]?.
userAccountId
);
setUserAccountId
(
res
.
result
?.[
0
]?.
userAccountId
);
}
else
{
}
else
{
// message.error('获取用户id失败');
// message.error('获取用户id失败');
...
@@ -104,6 +113,13 @@ const MessageChatPage: React.FC = () => {
...
@@ -104,6 +113,13 @@ const MessageChatPage: React.FC = () => {
}, [userAccountId]);
}, [userAccountId]);
return (
return (
<div className='message-chat flex-start'>
<div className='message-chat flex-start'>
{!!userAccountId && (
<MessageChatRole
roleList={roleList}
userAccountId={userAccountId}
onSelect={(data) => setUserAccountId(data?.userAccountId)}
/>
)}
<MessageChatListView
<MessageChatListView
messageList={messageList}
messageList={messageList}
current={currentIndex}
current={currentIndex}
...
@@ -121,16 +137,16 @@ const MessageChatPage: React.FC = () => {
...
@@ -121,16 +137,16 @@ const MessageChatPage: React.FC = () => {
userAccountId={userAccountId}
userAccountId={userAccountId}
/>
/>
) : null}
) : null}
{isSystem
? <MessageChatSystemView /> : null
}
{isSystem
&& <MessageChatSystemView />
}
</div>
</div>
<div className='message-chat-qrcode'>
{!!getQrcodePathQuery()?.id && (
<div className='
qrcode-view
'>
<div className='
message-chat-qrcode
'>
{getQrcodePathQuery()?.id ? (
<div className='qrcode-view'>
<QrcodeView path={getQrcodePathQuery()?.path} scene={getQrcodePathQuery()?.scene} />
<QrcodeView path={getQrcodePathQuery()?.path} scene={getQrcodePathQuery()?.scene} />
) : null}
</div>
<div className='qrcode-text'>扫码进入小程序店铺</div>
</div>
</div>
<div className='qrcode-text'>扫码进入小程序店铺</div>
)}
</div>
</div>
</div>
);
);
};
};
...
...
src/router/router.tsx
浏览文件 @
da2a257f
...
@@ -1455,25 +1455,17 @@ export const routerList: Array<RouteObjectType> = [
...
@@ -1455,25 +1455,17 @@ export const routerList: Array<RouteObjectType> = [
],
],
},
},
{
{
path
:
'/messageManage'
,
path
:
'/messageManage/messageChat'
,
element
:
<
LayoutView
/>,
element
:
(
<
LayoutView
>
<
MessageChatPage
/>
</
LayoutView
>
),
errorElement
:
<
ErrorPage
/>,
errorElement
:
<
ErrorPage
/>,
meta
:
{
meta
:
{
id
:
1400
,
id
:
1400
,
icon
:
<
CommentOutlined
/>,
icon
:
<
CommentOutlined
/>,
title
:
'消息管理'
,
title
:
'消息管理'
,
},
},
children
:
[
{
path
:
'/messageManage/messageChat'
,
element
:
withLoadingComponent
(<
MessageChatPage
/>),
errorElement
:
<
ErrorPage
/>,
meta
:
{
id
:
1410
,
title
:
'客服消息'
,
icon
:
<
CommentOutlined
/>,
},
},
],
},
},
];
];
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论