Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-admin-IM
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-admin-IM
提交
fe202ab6
提交
fe202ab6
编写于
1月 18, 2021
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
对接接口
上级
5ec5ba6f
变更
6
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
562 行增加
和
381 行删除
+562
-381
user-info.vue
src/components/IM/user-info.vue
+2
-1
common.scss
src/style/common.scss
+16
-1
env-config.js
src/utils/env-config.js
+10
-5
index.js
src/utils/index.js
+5
-0
index.scss
src/views/IM/current-session/index.scss
+303
-0
index.vue
src/views/IM/current-session/index.vue
+226
-374
未找到文件。
src/components/IM/user-info.vue
浏览文件 @
fe202ab6
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
multiple
multiple
v-model=
"stickerIdList"
v-model=
"stickerIdList"
size=
"mini"
size=
"mini"
placeholder=
"请选择问题
分
类"
placeholder=
"请选择问题
归
类"
@
visible-change=
"stickerSave"
@
visible-change=
"stickerSave"
>
>
<el-option
<el-option
...
@@ -109,6 +109,7 @@ export default {
...
@@ -109,6 +109,7 @@ export default {
// 保存用户问题分类
// 保存用户问题分类
stickerSave
(
status
)
{
stickerSave
(
status
)
{
// 下拉框出现或者选项为空时,直接退出
if
(
status
||
!
this
.
stickerIdList
.
length
)
return
;
if
(
status
||
!
this
.
stickerIdList
.
length
)
return
;
let
params
=
{
let
params
=
{
stickerIdList
:
this
.
stickerIdList
,
stickerIdList
:
this
.
stickerIdList
,
...
...
src/style/common.scss
浏览文件 @
fe202ab6
...
@@ -231,4 +231,19 @@ html,body{
...
@@ -231,4 +231,19 @@ html,body{
}
}
.el-breadcrumb__inner.is-link
:hover
{
.el-breadcrumb__inner.is-link
:hover
{
color
:
#449284
!
important
;
color
:
#449284
!
important
;
}
}
\ No newline at end of file
.current-session-wrap
{
.c-bottom
.el-input__inner
{
height
:
44px
;
line-height
:
44px
;
padding-right
:
100px
;
}
.el-input.is-active
.el-input__inner
,
.el-input__inner
:focus
{
border-color
:
#eff5f7
;
}
.link-form
.el-form-item
{
margin-bottom
:
10px
;
}
}
\ No newline at end of file
src/utils/env-config.js
浏览文件 @
fe202ab6
...
@@ -16,7 +16,8 @@ export const envConfig = {
...
@@ -16,7 +16,8 @@ export const envConfig = {
loginUrl
:
'https://dev-saas.yunqueyi.com/pica-login/work_station.html'
,
loginUrl
:
'https://dev-saas.yunqueyi.com/pica-login/work_station.html'
,
//innerLoginUrl: 'http://localhost:8090/PICA_SSO_FE/html/pica_index.html',
//innerLoginUrl: 'http://localhost:8090/PICA_SSO_FE/html/pica_index.html',
innerLoginUrl
:
'https://dev-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html'
,
innerLoginUrl
:
'https://dev-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html'
,
yuequeyiIndexUrl
:
'https://dev-saas.yunqueyi.com/pica_index.html'
yuequeyiIndexUrl
:
'https://dev-saas.yunqueyi.com/pica_index.html'
,
picakfAccId
:
'picakf_dev'
,
},
},
dev
:
{
dev
:
{
baseUrl
:
'https://dev-sc.yunqueyi.com'
,
baseUrl
:
'https://dev-sc.yunqueyi.com'
,
...
@@ -25,7 +26,8 @@ export const envConfig = {
...
@@ -25,7 +26,8 @@ export const envConfig = {
qiniuImgUrl
:
"https://test1-file.yunqueyi.com"
,
qiniuImgUrl
:
"https://test1-file.yunqueyi.com"
,
loginUrl
:
'https://dev-saas.yunqueyi.com/pica-login/work_station.html'
,
loginUrl
:
'https://dev-saas.yunqueyi.com/pica-login/work_station.html'
,
innerLoginUrl
:
'https://dev-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html'
,
innerLoginUrl
:
'https://dev-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html'
,
yuequeyiIndexUrl
:
'https://dev-saas.yunqueyi.com/pica_index.html'
yuequeyiIndexUrl
:
'https://dev-saas.yunqueyi.com/pica_index.html'
,
picakfAccId
:
'picakf_dev'
,
},
},
test
:
{
test
:
{
baseUrl
:
'https://test1-sc.yunqueyi.com'
,
baseUrl
:
'https://test1-sc.yunqueyi.com'
,
...
@@ -34,7 +36,8 @@ export const envConfig = {
...
@@ -34,7 +36,8 @@ export const envConfig = {
qiniuImgUrl
:
"https://test1-file.yunqueyi.com"
,
qiniuImgUrl
:
"https://test1-file.yunqueyi.com"
,
loginUrl
:
'https://test1.yunqueyi.com/pica-login/work_station.html'
,
loginUrl
:
'https://test1.yunqueyi.com/pica-login/work_station.html'
,
innerLoginUrl
:
'https://test1-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html'
,
innerLoginUrl
:
'https://test1-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html'
,
yuequeyiIndexUrl
:
'https://test1.yunqueyi.com/pica_index.html'
yuequeyiIndexUrl
:
'https://test1.yunqueyi.com/pica_index.html'
,
picakfAccId
:
'picakf_test'
,
},
},
uat
:
{
uat
:
{
baseUrl
:
'https://uat-sc.yunqueyi.com'
,
baseUrl
:
'https://uat-sc.yunqueyi.com'
,
...
@@ -45,7 +48,8 @@ export const envConfig = {
...
@@ -45,7 +48,8 @@ export const envConfig = {
qiniuResourceUrl
:
"https://test1-videos.yunqueyi.com"
,
qiniuResourceUrl
:
"https://test1-videos.yunqueyi.com"
,
loginUrl
:
'https://uat.yunqueyi.com/pica-login/work_station.html'
,
loginUrl
:
'https://uat.yunqueyi.com/pica-login/work_station.html'
,
innerLoginUrl
:
'https://uat-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html'
,
innerLoginUrl
:
'https://uat-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html'
,
yuequeyiIndexUrl
:
'https://uat.yunqueyi.com/pica_index.html'
yuequeyiIndexUrl
:
'https://uat.yunqueyi.com/pica_index.html'
,
picakfAccId
:
'picakf_uat'
,
},
},
pro
:
{
pro
:
{
baseUrl
:
'https://sc.yunqueyi.com'
,
baseUrl
:
'https://sc.yunqueyi.com'
,
...
@@ -54,6 +58,7 @@ export const envConfig = {
...
@@ -54,6 +58,7 @@ export const envConfig = {
qiniuImgUrl
:
"https://files.yunqueyi.com"
,
qiniuImgUrl
:
"https://files.yunqueyi.com"
,
loginUrl
:
'https://yunqueyi.com/pica-login/work_station.html'
,
loginUrl
:
'https://yunqueyi.com/pica-login/work_station.html'
,
innerLoginUrl
:
'https://sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html'
,
innerLoginUrl
:
'https://sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html'
,
yuequeyiIndexUrl
:
'https://www.yunqueyi.com/pica_index.html'
yuequeyiIndexUrl
:
'https://www.yunqueyi.com/pica_index.html'
,
picakfAccId
:
'picakf'
,
}
}
}
}
src/utils/index.js
浏览文件 @
fe202ab6
...
@@ -168,6 +168,7 @@ export function getYunQueYiUrl() {
...
@@ -168,6 +168,7 @@ export function getYunQueYiUrl() {
export
function
uploadVideo
()
{
export
function
uploadVideo
()
{
return
getConfigByEnvType
(
'qiniuResourceUrl'
)
return
getConfigByEnvType
(
'qiniuResourceUrl'
)
}
}
export
function
uploadImg
()
{
export
function
uploadImg
()
{
return
getConfigByEnvType
(
'qiniuImgUrl'
)
return
getConfigByEnvType
(
'qiniuImgUrl'
)
}
}
...
@@ -177,3 +178,7 @@ function getConfigByEnvType(urlType) {
...
@@ -177,3 +178,7 @@ function getConfigByEnvType(urlType) {
return
envConfig
[
process
.
env
.
BUILD_ENV
][
urlType
]
return
envConfig
[
process
.
env
.
BUILD_ENV
][
urlType
]
}
}
// 获取客服的云信ID
export
function
getPicaKFAccid
()
{
return
getConfigByEnvType
(
'picakfAccId'
)
}
src/views/IM/current-session/index.scss
0 → 100644
浏览文件 @
fe202ab6
.current-session-wrap
{
.component-content
{
display
:
flex
;
flex-direction
:
row
;
min-height
:
600px
;
min-width
:
1200px
;
font-size
:
14px
;
.left
{
width
:
270px
;
// padding: 0 25px 15px;
border-right
:
2px
solid
#f5f5f5
;
.l-header
{
display
:
flex
;
flex-direction
:
row
;
height
:
52px
;
justify-content
:
space-between
;
align-items
:
center
;
padding
:
0
25px
;
&
>
span
:first-child
{
font-size
:
16px
;
}
&
>
span
:last-child
{
color
:
#0d9078
;
cursor
:
pointer
;
}
}
.c-num
{
padding
:
0
25px
;
height
:
40px
;
line-height
:
40px
;
background
:
#fffbe6
;
}
.session-list
{
width
:
100%
;
height
:
100%
;
overflow
:
scroll
;
&
>
.item
{
width
:
100%
;
display
:
flex
;
height
:
72px
;
flex-direction
:
row
;
align-items
:
center
;
padding
:
0
25px
;
cursor
:
pointer
;
.img-wrapper
{
// position: relative;
// top: 0;
// left: 0;
width
:
40px
;
height
:
40px
;
margin-right
:
10px
;
img
{
width
:
100%
;
height
:
100%
;
border-radius
:
20px
;
}
}
&
>
.desc
{
flex
:
1
;
.top
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
space-between
;
.name
{
}
}
.bottom
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
space-between
;
align-items
:
center
;
font-size
:
12px
;
color
:
#999999
;
.num
{
display
:
inline-block
;
min-width
:
16px
;
padding
:
2px
4px
;
border-radius
:
8px
;
text-align
:
center
;
color
:
#ffffff
;
background
:
#ff4d4f
;
}
&
>
img
{
display
:
block
;
width
:
15px
;
height
:
15px
;
padding
:
2px
0
2px
4px
;
}
}
}
&
.current
{
background
:
#f8f9fa
;
}
}
}
}
.center
{
flex
:
1
;
.c-header
{
padding
:
0
25px
;
height
:
56px
;
display
:
flex
;
flex-direction
:
row
;
justify-content
:
space-between
;
align-items
:
center
;
border-bottom
:
2px
solid
#f5f5f5
;
&
>
.c-header-l
{
flex
:
1
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
&
>
img
{
display
:
inline-block
;
width
:
24px
;
height
:
24px
;
border-radius
:
12px
;
margin-right
:
8px
;
}
&
>
.name
{
margin-right
:
25px
;
color
:
#333333
;
}
&
>
.time-tip
{
font-size
:
12px
;
color
:
#999999
;
}
}
.close-btn
{
width
:
100px
;
color
:
#c7c8c9
;
cursor
:
pointer
;
}
}
.msg-content
{
// width: 100%;
// height: 650px;
overflow
:
scroll
;
display
:
flex
;
flex-direction
:
column
;
margin
:
10px
20px
;
.msg-item
{
display
:
flex
;
flex-direction
:
row
;
margin
:
12px
0
;
.msg-item-img
{
width
:
44px
;
height
:
44px
;
margin-right
:
8px
;
&
>
img
{
width
:
100%
;
height
:
100%
;
border-radius
:
22px
;
}
}
.msg-item-detail
{
display
:
flex
;
flex-direction
:
column
;
text-align
:
left
;
font-size
:
13px
;
&
>
:first-child
{
color
:
#999999
;
margin-bottom
:
8px
;
}
.mid-text-wrapper
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
&
>
img
{
width
:
18px
;
height
:
18px
;
margin-right
:
8px
;
cursor
:
pointer
;
}
}
.mid-text
{
padding
:
12px
24px
;
display
:
inline-block
;
max-width
:
520px
;
border-radius
:
8px
;
background
:
#ebf5fc
;
text-align
:
justify
;
color
:
#333333
;
&
.no-support
{
display
:
flex
;
align-items
:
center
;
&
>
img
{
width
:
14px
;
height
:
14px
;
margin-right
:
3px
;
}
}
}
.link
{
color
:
#2f86f6
;
}
&
>
.mid-pdf
{
max-width
:
260px
;
display
:
flex
;
flex-direction
:
row
;
text-align
:
left
;
padding
:
10px
15px
;
background
:
#f0f1f2
;
border-radius
:
8px
;
min-height
:
80px
;
cursor
:
pointer
;
.midp-left
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
space-around
;
.name
{
font-size
:
13px
;
color
:
#333333
;
}
.size
{
font-size
:
12px
;
color
:
#999999
;
}
}
.midp-icon
{
width
:
36px
;
height
:
44px
;
&
>
img
{
width
:
36px
;
height
:
100%
;
border-radius
:
3px
;
}
}
}
&
>
.mid-img
{
width
:
170px
;
height
:
108px
;
cursor
:
pointer
;
&
>
img
{
width
:
100%
;
height
:
100%
;
border-radius
:
8px
;
}
}
}
&
.cr
{
flex-direction
:
row-reverse
;
.msg-item-img
{
margin-right
:
0
;
margin-left
:
8px
;
}
.msg-item-detail
{
text-align
:
right
;
&
>
.mid-text
{
background
:
#f0f1f2
;
}
}
}
}
}
.c-bottom
{
display
:
flex
;
flex-direction
:
row
;
margin
:
16px
12px
16px
25px
;
.cb-icon-wrapper
{
display
:
flex
;
align-items
:
center
;
height
:
44px
;
img
{
width
:
20px
;
height
:
20px
;
margin-right
:
16px
;
cursor
:
pointer
;
}
}
.send-btn
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
center
;
align-items
:
center
;
width
:
60px
;
height
:
44px
;
background
:
#f3f6f7
;
margin-left
:
12px
;
border-radius
:
8px
;
cursor
:
pointer
;
&
>
img
{
width
:
24px
;
height
:
24px
;
}
&
.active
{
background
:
#0d9078
;
}
}
}
}
.right
{
width
:
240px
;
border-left
:
2px
solid
#f5f5f5
;
}
background
:
#fff
;
.time
{
color
:
#999999
;
}
.small
{
font-size
:
12px
;
}
}
}
\ No newline at end of file
src/views/IM/current-session/index.vue
浏览文件 @
fe202ab6
...
@@ -5,15 +5,16 @@
...
@@ -5,15 +5,16 @@
<article
class=
"left"
>
<article
class=
"left"
>
<div
class=
"l-header"
>
<div
class=
"l-header"
>
<span>
我的任务(3)
</span>
<span>
我的任务(3)
</span>
<span
@
click=
"
getNextSession
"
>
再来一个
</span>
<span
@
click=
"
fetchOneTask
"
>
再来一个
</span>
</div>
</div>
<p
class=
"c-num"
>
当前等待会话:4个
</p>
<p
class=
"c-num"
>
当前等待会话:4个
</p>
<ul
class=
"session-list"
:style=
"
{'height': containerHeight + 'px'}">
<ul
class=
"session-list"
:style=
"
{'height': containerHeight + 'px'}">
<li
<li
class=
"item"
:class=
"
{'current': currentTaskLogId == session.id}"
class=
"item"
:class=
"
{'current': currentTaskLogId == session.id}"
v-for="(session, index) in sessionListData.sessionList"
v-for="(session, index) in sessionListData.sessionList"
:key="index"
:key="index"
@click="selectSession(session)"
@click="selectSession(session
, index
)"
>
>
<div
class=
"img-wrapper"
>
<div
class=
"img-wrapper"
>
<img
:src=
"session.avatarImageUrl"
alt
/>
<img
:src=
"session.avatarImageUrl"
alt
/>
...
@@ -24,12 +25,16 @@
...
@@ -24,12 +25,16 @@
<span
class=
"time small"
>
{{
session
.
lastMsgTime
}}
</span>
<span
class=
"time small"
>
{{
session
.
lastMsgTime
}}
</span>
</div>
</div>
<div
class=
"bottom"
>
<div
class=
"bottom"
>
<span>
{{
session
.
lastMsgContent
}}
</span>
<span>
{{
session
.
text
}}
</span>
<span
v-show=
"session.status !=3 && currentTaskLogId != session.id && session.unreadCount"
class=
"num"
>
{{
session
.
unreadCount
}}
</span>
<!--
<span>
{{
session
.
lastMsgContent
}}
</span>
-->
<span
v-show=
"session.status !=3 && currentTaskLogId != session.id && session.unreadCount"
class=
"num"
>
{{
session
.
unreadCount
}}
</span>
<img
<img
v-show=
"session.status == 3"
v-show=
"session.status == 3"
src=
"../../../assets/image/IM/icon-exit.png"
src=
"../../../assets/image/IM/icon-exit.png"
@
click
.
stop=
"
exitSession
(session)"
@
click
.
stop=
"
closeOneTask
(session)"
/>
/>
</div>
</div>
</div>
</div>
...
@@ -59,7 +64,7 @@
...
@@ -59,7 +64,7 @@
<span
class=
"mid-time"
>
1:16 pm
</span>
<span
class=
"mid-time"
>
1:16 pm
</span>
<div
v-if=
"item.bizType == 1"
class=
"mid-text-wrapper"
style=
"max-width: 520px;"
>
<div
v-if=
"item.bizType == 1"
class=
"mid-text-wrapper"
style=
"max-width: 520px;"
>
<img
v-show=
"item.sendFlag"
src=
"../../../assets/image/IM/icon-no-send.png"
alt
/>
<img
v-show=
"item.sendFlag"
src=
"../../../assets/image/IM/icon-no-send.png"
alt
/>
<div
class=
"mid-text"
>
不理解人,就无法理解什么是设计不理解人,就无法理解什么是设计不理解人,就无法理解什么是设计
</div>
<div
class=
"mid-text"
>
{{
item
.
text
}}
</div>
</div>
</div>
<div
v-if=
"item.bizType == 2"
class=
"mid-img"
v-viewer
>
<div
v-if=
"item.bizType == 2"
class=
"mid-img"
v-viewer
>
...
@@ -68,16 +73,16 @@
...
@@ -68,16 +73,16 @@
</div>
</div>
<div
v-if=
"item.bizType == 3"
class=
"mid-pdf"
@
click=
"openPDF(item)"
>
<div
v-if=
"item.bizType == 3"
class=
"mid-pdf"
@
click=
"openPDF(item)"
>
<div
class=
"midp-left"
>
<div
class=
"midp-left"
>
<span
class=
"name"
>
神奇宝贝图鉴皮卡丘杰尼龟小火龙胖丁超梦双蛋瓦斯…
</span>
<span
class=
"name"
>
{{
item
.
text
}}
</span>
<span
class=
"size"
>
23.0
MB
</span>
<span
class=
"size"
>
{{
item
.
fileSize
}}
MB
</span>
</div>
</div>
<div
class=
"midp-icon"
>
<div
class=
"midp-icon"
>
<img
src=
"../../../assets/image/IM/icon-pdf.png"
alt
/>
<img
src=
"../../../assets/image/IM/icon-pdf.png"
alt
/>
</div>
</div>
</div>
</div>
<div
v-if=
"item.bizType == 4"
class=
"mid-text"
>
<div
v-if=
"item.bizType == 4"
class=
"mid-text"
>
请点击链接
{{
item
.
remark
}}
<span
class=
"link"
>
五分钟首页
</span>
<span
class=
"link"
>
{{
item
.
text
}}
</span>
</div>
</div>
<div
v-if=
"item.bizType == 5"
class=
"mid-text no-support"
>
<div
v-if=
"item.bizType == 5"
class=
"mid-text no-support"
>
<img
src=
"../../../assets/image/IM/icon-warning-circle.png"
alt
/>
<img
src=
"../../../assets/image/IM/icon-warning-circle.png"
alt
/>
...
@@ -104,7 +109,7 @@
...
@@ -104,7 +109,7 @@
/>
/>
</div>
</div>
</el-input>
</el-input>
<div
class=
"send-btn"
:class=
"
{'active': canSend}">
<div
class=
"send-btn"
:class=
"
{'active': canSend}"
@click="sendCommonMsg"
>
<img
v-show=
"canSend"
src=
"../../../assets/image/IM/send-yes.png"
alt
/>
<img
v-show=
"canSend"
src=
"../../../assets/image/IM/send-yes.png"
alt
/>
<img
v-show=
"!canSend"
src=
"../../../assets/image/IM/send-no.png"
alt
/>
<img
v-show=
"!canSend"
src=
"../../../assets/image/IM/send-no.png"
alt
/>
</div>
</div>
...
@@ -168,6 +173,7 @@ import { doUpload, getFilePath } from "@/utils/qiniu-util";
...
@@ -168,6 +173,7 @@ import { doUpload, getFilePath } from "@/utils/qiniu-util";
import
{
validateWord
}
from
"@/utils/validate.js"
;
import
{
validateWord
}
from
"@/utils/validate.js"
;
import
{
openLoading
,
closeLoading
}
from
"@/utils/utils"
;
import
{
openLoading
,
closeLoading
}
from
"@/utils/utils"
;
import
*
as
commonUtil
from
"@/utils/utils"
;
import
*
as
commonUtil
from
"@/utils/utils"
;
import
{
getPicaKFAccid
}
from
"@/utils"
;
import
UserInfo
from
"@/components/IM/user-info.vue"
;
import
UserInfo
from
"@/components/IM/user-info.vue"
;
const
CONTAINER_HEIGHT
=
700
;
const
CONTAINER_HEIGHT
=
700
;
...
@@ -186,9 +192,11 @@ export default {
...
@@ -186,9 +192,11 @@ export default {
sessionList
:
[],
sessionList
:
[],
waitingTaskCount
:
0
waitingTaskCount
:
0
},
},
// currentSessionIndex: 0, // 当前会话序号
currentSessionIndex
:
0
,
// 当前会话序号
currentTaskLogId
:
0
,
// 当前会话ID
currentSession
:
{},
currentToAccId
:
0
,
currentTaskLogId
:
0
,
// 当前会话ID
currentToAccId
:
""
,
picakfAccId
:
""
,
doctorInfo
:
{
doctorInfo
:
{
name
:
"杨Song"
,
name
:
"杨Song"
,
mobilePhone
:
"138****7261"
,
mobilePhone
:
"138****7261"
,
...
@@ -369,12 +377,87 @@ export default {
...
@@ -369,12 +377,87 @@ export default {
},
},
created
()
{
created
()
{
this
.
picakfAccId
=
getPicaKFAccid
();
this
.
getSessionList
();
this
.
getSessionList
();
},
},
mounted
:
function
()
{},
mounted
:
function
()
{},
methods
:
{
methods
:
{
// 查询医生和居民的消息历史
getMSGHistory
(
session
)
{
let
params
=
{
doctorAccId
:
this
.
currentToAccId
,
includeFlag
:
1
,
// 带本条消息
lastClientIdServer
:
session
.
lastMsgIdClient
,
lastMsgIdServer
:
session
.
lastMsgIdServer
,
lastMsgTimestamp
:
session
.
lastMsgTime
,
limit
:
20
,
patientAccId
:
this
.
picakfAccId
,
unionId
:
""
};
this
.
POST
(
"/im/msg/history"
,
params
).
then
(
res
=>
{
if
(
res
.
code
===
"000000"
)
{
// this.convertMessageList(res.data);
this
.
messageList
=
res
.
data
;
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"warning"
});
}
});
},
// 查询医生和居民的消息 - 向前查找
// 将获取消息列表插入到当前消息列表的最后
getMSGForward
(
session
)
{
let
params
=
{
doctorAccId
:
this
.
currentToAccId
,
includeFlag
:
0
,
lastClientIdServer
:
session
.
lastMsgIdClient
,
lastMsgIdServer
:
session
.
lastMsgIdServer
,
lastMsgTimestamp
:
session
.
lastMsgTime
,
limit
:
20
,
patientAccId
:
this
.
picakfAccId
,
unionId
:
""
};
this
.
POST
(
"/im/msg/forward"
,
params
).
then
(
res
=>
{
if
(
res
.
code
===
"000000"
)
{
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"warning"
});
}
});
},
// 转换消息格式
convertMessageList
(
messageList
)
{
// bizType: 1,
// time: 1000,
// showType: 1,
// title: "测试title",
// content: "测试content",
// imgUrl: "https://file.yunqueyi.com/File/doctor_default.png",
// sendOrReceive: "send", // send receive
// displayTimeHeader: "4分20秒",
// url: "https://file.yunqueyi.com/File/doctor_default.png",
// file: "https://file.yunqueyi.com/File/doctor_default.png",
// type: 1,
// extData: "/pages/im/advisory/evalution",
// sourceId: 1,
// displayFlag: 1,
// sendFlag: true
let
msg
=
null
,
cMessageList
=
[];
messageList
.
forEach
((
rawMsg
,
index
)
=>
{
msg
=
Object
.
assign
({},
rawMsg
);
msg
.
sendOrReceive
=
rawMsg
.
fromAccId
==
this
.
currentToAccId
;
cMessageList
.
push
(
msg
);
});
},
// 发送带链接消息
// 发送带链接消息
sendLinkMsg
()
{
sendLinkMsg
()
{
this
.
sendCommonMsg
();
this
.
sendCommonMsg
();
...
@@ -386,19 +469,49 @@ export default {
...
@@ -386,19 +469,49 @@ export default {
},
},
// 发送通用消息
// 发送通用消息
sendCommonMsg
()
{},
sendCommonMsg
()
{
if
(
!
this
.
canSend
)
return
;
let
params
=
{
fileExt
:
""
,
fileSize
:
0
,
fromAccount
:
this
.
picakfAccId
,
height
:
0
,
info
:
"wefwef"
,
md5
:
""
,
remark
:
""
,
toAccount
:
this
.
currentToAccId
,
type
:
0
,
url
:
""
,
width
:
0
};
this
.
POST
(
"/im/msg/sendMessage"
,
params
).
then
(
res
=>
{
if
(
res
.
code
===
"000000"
)
{
// 校验结果:1校验通过 2校验不通过
console
.
log
(
res
.
data
.
checkFlag
);
this
.
getSessionList
();
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"warning"
});
}
});
},
// 打开一个会话
// 打开一个会话
selectSession
(
session
)
{
selectSession
(
session
,
index
)
{
console
.
log
(
"selectSession"
);
console
.
log
(
"selectSession"
);
this
.
currentTaskLogId
=
session
.
id
;
this
.
currentTaskLogId
=
session
.
id
;
this
.
currentToAccId
=
session
.
toAccId
;
this
.
currentToAccId
=
session
.
toAccId
;
this
.
getDoctorinfo
(
this
.
currentToAccId
);
this
.
currentSessionIndex
=
index
;
},
// 获取当前消息列表(最新的历史消息)
// TODO
// 关闭一个会话
// 获取医生信息
exitSession
(
session
)
{
this
.
getDoctorInfo
(
this
.
currentToAccId
);
console
.
log
(
"exitSession"
);
// 调用全部已读
if
(
session
.
unreadCount
)
{
this
.
readAllMsg
(
this
.
currentToAccId
,
this
.
picakfAccId
);
}
},
},
// 打开PDF
// 打开PDF
...
@@ -443,7 +556,7 @@ export default {
...
@@ -443,7 +556,7 @@ export default {
},
},
// 给我一个任务吧,如果当前没有任务,则要提示
// 给我一个任务吧,如果当前没有任务,则要提示
getNextSession
()
{
fetchOneTask
()
{
this
.
GET
(
"/im/session/kf/fetchOneTask"
).
then
(
res
=>
{
this
.
GET
(
"/im/session/kf/fetchOneTask"
).
then
(
res
=>
{
if
(
res
.
code
===
"000000"
)
{
if
(
res
.
code
===
"000000"
)
{
this
.
getSessionList
();
this
.
getSessionList
();
...
@@ -456,20 +569,6 @@ export default {
...
@@ -456,20 +569,6 @@ export default {
});
});
},
},
// 获取消息(准实时消息,历史消息等)
getMessageList
()
{
this
.
GET
(
"/im/session/kf/msgList"
).
then
(
res
=>
{
if
(
res
.
code
===
"000000"
)
{
console
.
log
(
"in getMessageList"
,
res
);
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"warning"
});
}
});
},
// 获取会话列表
// 获取会话列表
getSessionList
()
{
getSessionList
()
{
this
.
GET
(
"/im/session/kf/list"
).
then
(
res
=>
{
this
.
GET
(
"/im/session/kf/list"
).
then
(
res
=>
{
...
@@ -480,10 +579,18 @@ export default {
...
@@ -480,10 +579,18 @@ export default {
sessionList
:
[],
sessionList
:
[],
waitingTaskCount
:
0
waitingTaskCount
:
0
};
};
if
(
!
this
.
currentTaskLogId
&&
this
.
sessionListData
.
sessionList
.
length
)
{
if
(
this
.
currentTaskLogId
=
this
.
sessionListData
.
sessionList
[
0
].
id
;
// !this.currentTaskLogId &&
this
.
currentToAccId
=
this
.
sessionListData
.
sessionList
[
0
].
toAccId
;
this
.
sessionListData
.
sessionList
.
length
this
.
getDoctorinfo
(
this
.
currentToAccId
);
)
{
this
.
convertSessions
(
this
.
sessionListData
.
sessionList
);
this
.
currentSession
=
this
.
sessionListData
.
sessionList
[
0
];
this
.
currentSessionIndex
=
0
;
this
.
currentTaskLogId
=
this
.
currentSession
.
id
;
this
.
currentToAccId
=
this
.
currentSession
.
toAccId
;
console
.
log
(
"this.currentSession"
,
this
.
currentSession
);
this
.
getMSGHistory
(
this
.
currentSession
);
this
.
getDoctorInfo
(
this
.
currentToAccId
);
}
}
}
else
{
}
else
{
this
.
$message
({
this
.
$message
({
...
@@ -494,11 +601,44 @@ export default {
...
@@ -494,11 +601,44 @@ export default {
});
});
},
},
// 将会话列表的数据进行处理,主要是显示文本(text)字段
convertSessions
(
sessions
)
{
let
convertSessionList
=
[];
let
text
=
""
,
cc
;
sessions
.
forEach
((
session
,
index
)
=>
{
if
(
session
.
lastMsgType
.
toLowerCase
()
==
"custom"
)
{
text
=
""
;
cc
=
JSON
.
parse
(
session
.
lastMsgContent
);
if
(
cc
.
bizType
==
1
)
{
text
=
cc
.
title
;
// } else if (cc.bizType == 18) {
}
else
{
text
=
cc
.
content
||
""
;
}
// if (cc.bizType != 8) {
// text = `${text}`;
// }
}
else
if
(
session
.
lastMsgType
.
toLowerCase
()
==
"image"
||
session
.
lastMsgType
.
toLowerCase
()
==
"picture"
)
{
text
=
"[图片]"
;
// text = this.imagePlaceholder;
}
else
{
text
=
session
.
lastMsgContent
;
}
session
.
text
=
text
;
// s.unreadCount = sessions[0].unread;
convertSessionList
.
push
(
session
);
});
this
.
sessionListData
.
sessionList
=
convertSessionList
;
},
// 根据云信id获取医生信息
// 根据云信id获取医生信息
getDoctor
i
nfo
(
accId
)
{
getDoctor
I
nfo
(
accId
)
{
this
.
GET
(
`/im/account/accid/doctorinfo?accId=
${
accId
}
`
).
then
(
res
=>
{
this
.
GET
(
`/im/account/accid/doctorinfo?accId=
${
accId
}
`
).
then
(
res
=>
{
if
(
res
.
code
===
"000000"
)
{
if
(
res
.
code
===
"000000"
)
{
console
.
log
(
"in getDoctorinfo"
,
res
.
data
);
this
.
doctorInfo
=
res
.
data
||
{};
this
.
doctorInfo
=
res
.
data
||
{};
}
else
{
}
else
{
this
.
$message
({
this
.
$message
({
...
@@ -510,10 +650,10 @@ export default {
...
@@ -510,10 +650,10 @@ export default {
},
},
// 关闭一个任务
// 关闭一个任务
closeOneTask
(
taskLogId
)
{
closeOneTask
(
session
)
{
let
params
=
{
let
params
=
{
taskLogId
taskLogId
:
session
.
id
}
}
;
this
.
POST
(
`/im/session/kf/closeOneTask`
,
params
).
then
(
res
=>
{
this
.
POST
(
`/im/session/kf/closeOneTask`
,
params
).
then
(
res
=>
{
if
(
res
.
code
===
"000000"
)
{
if
(
res
.
code
===
"000000"
)
{
console
.
log
(
"in closeOneTask"
,
res
);
console
.
log
(
"in closeOneTask"
,
res
);
...
@@ -525,335 +665,47 @@ export default {
...
@@ -525,335 +665,47 @@ export default {
}
}
});
});
},
},
// 设置全部消息已读
}
readAllMsg
(
fromAccount
,
toAccount
)
{
};
let
params
=
{
</
script
>
fromAccount
,
<
style
lang=
"scss"
>
toAccount
.current-session-wrap
{
};
.c-bottom
.el-input__inner
{
this
.
POST
(
`/im/msg/read/all`
,
params
).
then
(
res
=>
{
height
:
44px
;
if
(
res
.
code
===
"000000"
)
{
line-height
:
44px
;
let
session
=
this
.
findItemByKeyAndVal
(
padding-right
:
100px
;
this
.
sessionListData
.
sessionList
,
}
"id"
,
.el-input.is-active
.el-input__inner
,
this
.
currentTaskLogId
.el-input__inner
:focus
{
);
border-color
:
#eff5f7
;
if
(
session
)
{
}
session
.
unreadCount
=
0
;
.link-form
.el-form-item
{
margin-bottom
:
10px
;
}
// textarea {
// border: 0px !important;
// resize: none;
// height: 100px;
// padding: 5px 25px;
// }
}
</
style
>
<
style
lang=
"scss"
scoped
>
.current-session-wrap
{
.component-content
{
display
:
flex
;
flex-direction
:
row
;
min-height
:
600px
;
min-width
:
1200px
;
font-size
:
14px
;
.left
{
width
:
270px
;
// padding: 0 25px 15px;
border-right
:
2px
solid
#f5f5f5
;
.l-header
{
display
:
flex
;
flex-direction
:
row
;
height
:
52px
;
justify-content
:
space-between
;
align-items
:
center
;
padding
:
0
25px
;
&
>
span
:first-child
{
font-size
:
16px
;
}
&
>
span
:last-child
{
color
:
#0d9078
;
cursor
:
pointer
;
}
}
.c-num
{
padding
:
0
25px
;
height
:
40px
;
line-height
:
40px
;
background
:
#fffbe6
;
}
.session-list
{
width
:
100%
;
height
:
100%
;
overflow
:
scroll
;
&
>
.item
{
width
:
100%
;
display
:
flex
;
height
:
72px
;
flex-direction
:
row
;
align-items
:
center
;
padding
:
0
25px
;
cursor
:
pointer
;
.img-wrapper
{
// position: relative;
// top: 0;
// left: 0;
width
:
40px
;
height
:
40px
;
margin-right
:
10px
;
img
{
width
:
100%
;
height
:
100%
;
border-radius
:
20px
;
}
}
&
>
.desc
{
flex
:
1
;
.top
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
space-between
;
.name
{
}
}
.bottom
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
space-between
;
align-items
:
center
;
font-size
:
12px
;
color
:
#999999
;
.num
{
display
:
inline-block
;
min-width
:
16px
;
padding
:
2px
4px
;
border-radius
:
8px
;
text-align
:
center
;
color
:
#ffffff
;
background
:
#ff4d4f
;
}
&
>
img
{
display
:
block
;
width
:
15px
;
height
:
15px
;
padding
:
2px
0
2px
4px
;
}
}
}
&
.current
{
background
:
#f8f9fa
;
}
}
}
}
.center
{
flex
:
1
;
.c-header
{
padding
:
0
25px
;
height
:
56px
;
display
:
flex
;
flex-direction
:
row
;
justify-content
:
space-between
;
align-items
:
center
;
border-bottom
:
2px
solid
#f5f5f5
;
&
>
.c-header-l
{
flex
:
1
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
&
>
img
{
display
:
inline-block
;
width
:
24px
;
height
:
24px
;
border-radius
:
12px
;
margin-right
:
8px
;
}
&
>
.name
{
margin-right
:
25px
;
color
:
#333333
;
}
&
>
.time-tip
{
font-size
:
12px
;
color
:
#999999
;
}
}
.close-btn
{
width
:
100px
;
color
:
#c7c8c9
;
cursor
:
pointer
;
}
}
.msg-content
{
// width: 100%;
// height: 650px;
overflow
:
scroll
;
display
:
flex
;
flex-direction
:
column
;
margin
:
10px
20px
;
.msg-item
{
display
:
flex
;
flex-direction
:
row
;
margin
:
12px
0
;
.msg-item-img
{
width
:
44px
;
height
:
44px
;
margin-right
:
8px
;
&
>
img
{
width
:
100%
;
height
:
100%
;
border-radius
:
22px
;
}
}
.msg-item-detail
{
display
:
flex
;
flex-direction
:
column
;
text-align
:
left
;
font-size
:
13px
;
&
>
:first-child
{
color
:
#999999
;
margin-bottom
:
8px
;
}
.mid-text-wrapper
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
&
>
img
{
width
:
18px
;
height
:
18px
;
margin-right
:
8px
;
cursor
:
pointer
;
}
}
.mid-text
{
padding
:
12px
24px
;
display
:
inline-block
;
max-width
:
520px
;
border-radius
:
8px
;
background
:
#ebf5fc
;
text-align
:
justify
;
color
:
#333333
;
&
.no-support
{
display
:
flex
;
align-items
:
center
;
&
>
img
{
width
:
14px
;
height
:
14px
;
margin-right
:
3px
;
}
}
}
.link
{
color
:
#2f86f6
;
}
&
>
.mid-pdf
{
max-width
:
260px
;
display
:
flex
;
flex-direction
:
row
;
text-align
:
left
;
padding
:
10px
15px
;
background
:
#f0f1f2
;
border-radius
:
8px
;
min-height
:
80px
;
cursor
:
pointer
;
.midp-left
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
space-around
;
.name
{
font-size
:
13px
;
color
:
#333333
;
}
.size
{
font-size
:
12px
;
color
:
#999999
;
}
}
.midp-icon
{
width
:
36px
;
height
:
44px
;
&
>
img
{
width
:
36px
;
height
:
100%
;
border-radius
:
3px
;
}
}
}
&
>
.mid-img
{
width
:
170px
;
height
:
108px
;
cursor
:
pointer
;
&
>
img
{
width
:
100%
;
height
:
100%
;
border-radius
:
8px
;
}
}
}
&
.cr
{
flex-direction
:
row-reverse
;
.msg-item-img
{
margin-right
:
0
;
margin-left
:
8px
;
}
.msg-item-detail
{
text-align
:
right
;
&
>
.mid-text
{
background
:
#f0f1f2
;
}
}
}
}
}
.c-bottom
{
display
:
flex
;
flex-direction
:
row
;
margin
:
16px
12px
16px
25px
;
.cb-icon-wrapper
{
display
:
flex
;
align-items
:
center
;
height
:
44px
;
img
{
width
:
20px
;
height
:
20px
;
margin-right
:
16px
;
cursor
:
pointer
;
}
}
.send-btn
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
center
;
align-items
:
center
;
width
:
60px
;
height
:
44px
;
background
:
#f3f6f7
;
margin-left
:
12px
;
border-radius
:
8px
;
cursor
:
pointer
;
&
>
img
{
width
:
24px
;
height
:
24px
;
}
&
.active
{
background
:
#0d9078
;
}
}
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"warning"
});
}
}
});
},
// 根据字段名及其值,从数组中查找对象
findItemByKeyAndVal
(
arr
,
key
,
value
,
flag
=
0
)
{
if
(
flag
==
0
)
{
return
arr
.
find
(
item
=>
{
return
item
[
key
]
==
value
;
});
}
else
if
(
flag
==
1
)
{
return
arr
.
findIndex
(
item
=>
{
return
item
[
key
]
==
value
;
});
}
}
}
}
.right
{
width
:
240px
;
border-left
:
2px
solid
#f5f5f5
;
}
background
:
#fff
;
.time
{
color
:
#999999
;
}
.small
{
font-size
:
12px
;
}
}
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
@import
"./index.scss"
;
</
style
>
</
style
>
\ No newline at end of file
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录