Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-admin-consultation
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-admin-consultation
提交
d1701c83
提交
d1701c83
编写于
9月 18, 2021
作者:
张磊
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
root state
上级
e02fe50f
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
16 行增加
和
23 行删除
+16
-23
socket.js
src/store/modules/socket.js
+15
-22
vue.config.js
vue.config.js
+1
-1
未找到文件。
src/store/modules/socket.js
浏览文件 @
d1701c83
...
@@ -6,14 +6,14 @@ const socket = {
...
@@ -6,14 +6,14 @@ const socket = {
},
},
actions
:
{
actions
:
{
initSocket
(
context
,
payload
)
{
initSocket
(
context
,
payload
)
{
const
{
rootState
}
=
context
;
const
socketClient
=
io
.
connect
(
payload
.
url
,
{
const
socketClient
=
io
.
connect
(
payload
.
url
,
{
query
:
{
query
:
{
loginUserNum
:
`diagnose_list_socket_
${
payload
.
userId
}
`
,
loginUserNum
:
`diagnose_list_socket_
${
payload
.
userId
}
`
,
},
},
// reconnection: false,
// reconnection: false,
});
});
console
.
log
(
'-=-=-initSocket次数'
,
socketClient
);
context
.
commit
(
'SET_SOCKET'
,
socketClient
,
rootState
);
context
.
commit
(
'SET_SOCKET'
,
socketClient
);
socketClient
.
on
(
'connect'
,
(
socket
)
=>
{
socketClient
.
on
(
'connect'
,
(
socket
)
=>
{
console
.
log
(
'socket 链接成功'
,
socket
,
socketClient
);
console
.
log
(
'socket 链接成功'
,
socket
,
socketClient
);
});
});
...
@@ -26,9 +26,7 @@ const socket = {
...
@@ -26,9 +26,7 @@ const socket = {
// state.socketClient.connect();
// state.socketClient.connect();
});
});
socketClient
.
on
(
'diagnose_push_event'
,
(
socket
)
=>
{
socketClient
.
on
(
'diagnose_push_event'
,
(
socket
)
=>
{
console
.
log
(
'sdjfhsdjkfhsajkdfhasjkdfhasjk------------'
,
socket
);
const
{
list
,
allSize
,
countRespList
}
=
socket
;
const
{
list
,
allSize
,
countRespList
}
=
socket
;
console
.
log
(
'sdjfhsdjkfhsajkdfhasjkdfhasjk------------'
);
context
.
commit
(
'main/updateCurrentCalList'
,
countRespList
,
{
context
.
commit
(
'main/updateCurrentCalList'
,
countRespList
,
{
root
:
true
,
root
:
true
,
});
});
...
@@ -36,9 +34,6 @@ const socket = {
...
@@ -36,9 +34,6 @@ const socket = {
context
.
commit
(
'main/updateAllSize'
,
allSize
,
{
root
:
true
});
context
.
commit
(
'main/updateAllSize'
,
allSize
,
{
root
:
true
});
});
});
socketClient
.
on
(
'diagnose_call_push_event'
,
(
socket
)
=>
{
socketClient
.
on
(
'diagnose_call_push_event'
,
(
socket
)
=>
{
console
.
log
(
'diagnose_call_push_event---'
,
socket
);
console
.
log
(
'context.state.noticeList'
,
window
.
_VM
.
$store
);
const
l
=
window
.
_VM
.
$store
.
state
.
main
.
noticeList
;
const
l
=
window
.
_VM
.
$store
.
state
.
main
.
noticeList
;
if
(
l
.
length
>=
5
)
{
if
(
l
.
length
>=
5
)
{
l
.
shift
();
l
.
shift
();
...
@@ -46,21 +41,18 @@ const socket = {
...
@@ -46,21 +41,18 @@ const socket = {
l
.
push
(
socket
);
l
.
push
(
socket
);
const
n
=
{
notifyIndex
:
l
.
length
,
...
socket
};
const
n
=
{
notifyIndex
:
l
.
length
,
...
socket
};
context
.
commit
(
'main/updateNoticeList'
,
l
,
{
root
:
true
});
context
.
commit
(
'main/updateNoticeList'
,
l
,
{
root
:
true
});
console
.
log
(
'n--------'
,
n
);
const
{
path
}
=
window
.
_VM
.
$route
;
const
{
path
}
=
window
.
_VM
.
$route
;
const
operateUserId
=
window
.
_VM
.
$store
.
state
.
main
.
soketQuest
const
operateUserId
=
window
.
_VM
.
$store
.
state
.
main
.
soketQuest
.
operateUserId
.
operateUserId
?
window
.
_VM
.
$store
.
state
.
main
.
soketQuest
.
operateUserId
?
window
.
_VM
.
$store
.
state
.
main
.
soketQuest
.
operateUserId
:
''
;
:
''
;
console
.
log
(
'operateUserId---'
,
operateUserId
);
console
.
log
(
'n.operateUserId---'
,
n
.
operateUserId
);
if
(
if
(
path
&&
path
&&
String
(
path
).
indexOf
(
'workbench'
)
>
-
1
&&
String
(
path
).
indexOf
(
'workbench'
)
>
-
1
&&
n
.
operateUserId
==
operateUserId
n
.
operateUserId
==
operateUserId
)
{
)
{
cons
ole
.
log
(
11111111111111111111
)
;
cons
t
ni
=
{
notifyInfo
:
n
,
rootState
:
rootState
}
;
context
.
commit
(
'SET_NOTIFY'
,
n
);
context
.
commit
(
'SET_NOTIFY'
,
n
i
);
}
}
});
});
socketClient
.
on
(
'ping'
,
function
()
{
socketClient
.
on
(
'ping'
,
function
()
{
...
@@ -91,18 +83,19 @@ const socket = {
...
@@ -91,18 +83,19 @@ const socket = {
state
.
socketClient
=
payload
;
state
.
socketClient
=
payload
;
},
},
SET_NOTIFY
:
(
state
,
payload
)
=>
{
SET_NOTIFY
:
(
state
,
payload
)
=>
{
console
.
log
(
'--payload'
,
payload
);
const
doms
=
document
.
getElementsByClassName
(
'el-notification'
);
const
doms
=
document
.
getElementsByClassName
(
'el-notification'
);
if
(
doms
.
length
>=
5
)
return
;
if
(
doms
.
length
>=
5
)
return
;
const
h
=
window
.
_VM
.
$createElement
;
const
h
=
window
.
_VM
.
$createElement
;
const
{
notifyInfo
,
rootState
}
=
payload
;
const
t
=
payload
.
department
const
t
=
notifyInfo
.
department
?
`问诊单
${
payload
.
diagnoseLogId
}
(
${
payload
.
department
}
)`
?
`问诊单
${
notifyInfo
.
diagnoseLogId
}
(
${
notifyInfo
.
department
}
)`
:
`问诊单
${
payload
.
diagnoseLogId
}
`
;
:
`问诊单
${
notifyInfo
.
diagnoseLogId
}
`
;
// userCallKfStatus 医助呼叫
// userCallKfStatus 医助呼叫
// doctorCallKfStatus 医生呼叫
// doctorCallKfStatus 医生呼叫
const
name
=
const
name
=
payload
.
userCallKfStatus
==
1
?
payload
.
userName
:
payload
.
doctorName
;
notifyInfo
.
userCallKfStatus
==
1
?
notifyInfo
.
userName
:
notifyInfo
.
doctorName
;
const
cn
=
window
.
_VM
.
$notify
({
const
cn
=
window
.
_VM
.
$notify
({
title
:
t
,
title
:
t
,
message
:
h
(
'p'
,
[
message
:
h
(
'p'
,
[
...
@@ -114,8 +107,8 @@ const socket = {
...
@@ -114,8 +107,8 @@ const socket = {
style
:
`float:right;margin-top:
${
30
}
px;`
,
style
:
`float:right;margin-top:
${
30
}
px;`
,
on
:
{
on
:
{
click
:
function
()
{
click
:
function
()
{
console
.
log
(
'----state'
,
s
tate
);
console
.
log
(
'----state'
,
rootS
tate
);
if
(
s
tate
.
showChat
)
{
if
(
rootS
tate
.
showChat
)
{
window
.
_VM
.
$message
({
window
.
_VM
.
$message
({
message
:
message
:
'不可同时进入多个诊室,请先退出已进入的诊室,再试。'
,
'不可同时进入多个诊室,请先退出已进入的诊室,再试。'
,
...
@@ -124,7 +117,7 @@ const socket = {
...
@@ -124,7 +117,7 @@ const socket = {
});
});
cn
.
close
();
cn
.
close
();
}
else
{
}
else
{
window
.
_VM
.
$store
.
dispatch
(
'main/gotoInquiry'
,
payload
);
window
.
_VM
.
$store
.
dispatch
(
'main/gotoInquiry'
,
notifyInfo
);
}
}
cn
.
close
();
cn
.
close
();
},
},
...
@@ -134,7 +127,7 @@ const socket = {
...
@@ -134,7 +127,7 @@ const socket = {
),
),
]),
]),
onClose
:
function
()
{
onClose
:
function
()
{
console
.
log
(
'--onClose'
,
payload
);
console
.
log
(
'--onClose'
,
notifyInfo
);
},
},
duration
:
5000
,
duration
:
5000
,
position
:
'top-right'
,
position
:
'top-right'
,
...
...
vue.config.js
浏览文件 @
d1701c83
...
@@ -71,7 +71,7 @@ module.exports = {
...
@@ -71,7 +71,7 @@ module.exports = {
port
:
8080
,
port
:
8080
,
proxy
:
{
proxy
:
{
'/proxy'
:
{
'/proxy'
:
{
target
:
'https://
dev
-sc.yunqueyi.com/'
,
target
:
'https://
test1
-sc.yunqueyi.com/'
,
ws
:
false
,
ws
:
false
,
changeOrigin
:
true
,
changeOrigin
:
true
,
secure
:
true
,
secure
:
true
,
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录