Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-admin-consultation
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
pica-admin-consultation-new
pica-admin-consultation
提交
57982d24
提交
57982d24
编写于
9月 07, 2021
作者:
lyf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改vuex
上级
274bd541
变更
10
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
81 行增加
和
75 行删除
+81
-75
chat.vue
src/components/IM/chat.vue
+6
-3
diagnosis-live.vue
src/components/IM/diagnosis-live.vue
+4
-4
main.js
src/main.js
+1
-2
index.js
src/store/index.js
+6
-5
common.js
src/store/modules/common.js
+1
-1
socket.js
src/store/modules/socket.js
+39
-40
index.js
src/store/mutations/index.js
+12
-11
state.js
src/store/state.js
+3
-1
workbench.vue
src/views/IM/diagnosis-admin/workbench.vue
+8
-8
slidebar.vue
src/views/layout/components/slidebar.vue
+1
-0
未找到文件。
src/components/IM/chat.vue
浏览文件 @
57982d24
...
...
@@ -13,10 +13,14 @@
v-loadmore=
"getOldMSGHistory"
class=
"center BSListWraper"
>
<section
class=
"c-header"
>
<section
v-if=
"JSON.stringify(currentChat) == '
{}'"
class="c-header"
>
<div
class=
"header-line"
>
<div
class=
"c-header-l"
>
<span
class=
"num"
>
{{
currentChat
.
diagnoseLogId
}}
</span>
<span
class=
"num"
>
{{
currentChat
.
diagnoseLogId
}}
</span>
<span
class=
"dep"
>
{{
currentChat
.
department
}}
</span>
</div>
<div
class=
"c-header-edit"
>
...
...
@@ -832,7 +836,6 @@
content
=
{};
signature
=
''
;
msgIndex
=
-
1
;
if
(
item
.
type
.
toLowerCase
()
==
'custom'
)
{
content
=
JSON
.
parse
(
item
.
content
);
if
(
content
.
bizType
==
-
1
||
content
.
bizType
==
27
)
{
...
...
src/components/IM/diagnosis-live.vue
浏览文件 @
57982d24
<
template
>
<div
class=
"livebox"
>
<div
class=
"top"
>
<div
class=
"top-left"
>
<div
v-if=
"JSON.stringify(currentChat) == '
{}'"
class="top-left"
>
<div
class=
"time-message"
>
<p
class=
"msg-img"
>
<img
:src=
"currentChat.diagnoseType == 2 ? im_text : im_video"
>
...
...
@@ -288,8 +291,6 @@
}
if
(
memberList
&&
memberList
.
length
)
{
memberList
.
forEach
((
item
)
=>
{
if
(
item
.
role
==
4
)
{
}
// 在当前群组中的角色 1: 问诊医生 2: 接诊医生 3: 居民 4: 其他
if
(
item
.
role
==
1
)
{
this
.
memberList
[
0
]
=
item
;
...
...
@@ -350,7 +351,6 @@
// 创建trtcClient
clientLogin
()
{
if
(
Number
(
this
.
currentChat
.
diagnoseType
)
===
3
)
{
console
.
log
(
'问诊类型'
,
this
.
currentChat
.
diagnoseType
);
return
false
;
}
const
obj
=
{
...
...
src/main.js
浏览文件 @
57982d24
import
{
router
,
store
}
from
'@pica-cli/vue-cli-plugin-pica-cli-plugin/auto'
;
import
'@/router'
;
console
.
log
(
'router, store, vueApp: '
,
router
,
store
);
\ No newline at end of file
console
.
log
(
'router, store '
,
router
,
store
);
\ No newline at end of file
src/store/index.js
浏览文件 @
57982d24
...
...
@@ -6,16 +6,17 @@ import getters from './getters';
import
state
from
'./state'
;
import
mutations
from
'./mutations/index'
;
import
actions
from
'./actions/index'
;
console
.
log
(
'socket---'
,
socket
);
console
.
log
(
'--init---'
,
state
,
mutations
,
getters
,
actions
);
Vue
.
use
(
Vuex
);
export
default
new
Vuex
.
Store
({
state
,
getters
,
mutations
,
actions
,
modules
:
{
common
,
socket
}
,
modules
:{
socket
,
common
}
});
src/store/modules/common.js
浏览文件 @
57982d24
...
...
@@ -20,7 +20,7 @@ const common = {
changeToken
({
commit
},
tokenData
)
{
commit
(
'CHANGE_TOKEN'
,
tokenData
);
},
changeTime
({
commit
})
{
changeTime
({
commit
}
,
tokenData
)
{
commit
(
'SET_TIME'
,
tokenData
);
},
...
...
src/store/modules/socket.js
浏览文件 @
57982d24
// ES6 import
import
store
from
'../'
;
console
.
log
(
'store---'
,
store
);
import
io
from
'socket.io-client'
;
const
_VM
=
this
;
const
socketTimer
=
null
;
export
default
{
const
socket
=
{
namespaced
:
true
,
state
:
{
socketClient
:
null
,
},
actions
:
{
initSocket
({
commit
}
,
payload
)
{
initSocket
(
context
,
payload
)
{
console
.
log
(
'payload--'
,
payload
);
const
socketClient
=
io
.
connect
(
payload
.
url
,
{
query
:
{
...
...
@@ -19,7 +14,7 @@ export default {
// reconnection: false,
});
console
.
log
(
'-=-=-initSocket次数'
,
socketClient
);
commit
(
'SET_SOCKET'
,
socketClient
);
co
ntext
.
co
mmit
(
'SET_SOCKET'
,
socketClient
);
socketClient
.
on
(
'connect'
,
(
socket
)
=>
{
console
.
log
(
'socket 链接成功'
,
socket
,
socketClient
);
});
...
...
@@ -33,34 +28,35 @@ export default {
});
socketClient
.
on
(
'diagnose_push_event'
,
(
socket
)
=>
{
console
.
log
(
'diagnose_push_event---'
,
socket
);
const
{
list
,
allSize
,
countRespList
}
=
socket
;
console
.
log
(
'--_VM'
,
_VM
.
$route
);
store
.
commit
(
'updateCurrentDiagList'
,
list
);
store
.
commit
(
'updateAllSize'
,
allSize
);
store
.
commit
(
'updateCurrentCalList'
,
countRespList
);
const
{
list
,
allSize
,
countRespList
}
=
socket
;
context
.
commit
(
'updateCurrentDiagList'
,
list
);
context
.
commit
(
'updateAllSize'
,
allSize
);
context
.
commit
(
'updateCurrentCalList'
,
countRespList
);
});
socketClient
.
on
(
'diagnose_call_push_event'
,
(
socket
)
=>
{
console
.
log
(
'diagnose_call_push_event---'
,
socket
);
const
l
=
store
.
state
.
noticeList
;
if
(
l
.
length
>=
5
)
{
const
l
=
context
.
state
.
noticeList
;
if
(
l
.
length
>=
5
)
{
l
.
shift
();
}
l
.
push
(
socket
);
const
n
=
{
notifyIndex
:
l
.
length
,
...
socket
};
store
.
commit
(
'updateNoticeList'
,
l
);
console
.
log
(
'--_VM'
,
_VM
);
const
{
path
}
=
_VM
.
$route
;
const
n
=
{
notifyIndex
:
l
.
length
,
...
socket
};
context
.
commit
(
'updateNoticeList'
,
l
);
console
.
log
(
'n--------'
,
n
);
const
operateUserId
=
store
.
state
.
soketQuest
.
operateUserId
?
store
.
state
.
soketQuest
.
operateUserId
:
''
;
if
(
path
&&
String
(
path
).
indexOf
(
'workbench'
)
>
-
1
&&
n
.
operateUserId
==
operateUserId
)
{
store
.
commit
(
'socket/SET_NOTIFY'
,
n
);
const
{
path
}
=
window
.
_VM
.
$route
;
const
operateUserId
=
context
.
state
.
soketQuest
.
operateUserId
?
context
.
state
.
soketQuest
.
operateUserId
:
''
;
if
(
path
&&
String
(
path
).
indexOf
(
'workbench'
)
>
-
1
&&
n
.
operateUserId
==
operateUserId
)
{
context
.
commit
(
'socket/SET_NOTIFY'
,
context
,
n
);
}
});
socketClient
.
on
(
'ping'
,
function
()
{
console
.
log
(
'[E] 心跳请求已发出 →'
,
socketClient
);
if
(
socketTimer
)
{
clearInterval
(
socketTimer
);
}
});
// 收到
socketClient
.
on
(
'pong'
,
function
(
socket
)
{
...
...
@@ -85,22 +81,24 @@ export default {
SET_SOCKET
:
(
state
,
payload
)
=>
{
window
.
socketClient
=
payload
;
state
.
socketClient
=
payload
;
console
.
log
(
state
);
},
SET_NOTIFY
:
(
state
,
payload
)
=>
{
SET_NOTIFY
:
(
state
,
context
,
payload
)
=>
{
console
.
log
(
'--payload'
,
payload
);
const
doms
=
document
.
getElementsByClassName
(
'el-notification'
);
if
(
doms
.
length
>=
5
)
return
;
const
h
=
_VM
.
$createElement
;
const
h
=
window
.
_VM
.
$createElement
;
const
t
=
payload
.
department
?
`问诊单
${
payload
.
diagnoseLogId
}
(
${
payload
.
department
}
)`
:
`问诊单
${
payload
.
diagnoseLogId
}
`
;
const
t
=
payload
.
department
?
`问诊单
${
payload
.
diagnoseLogId
}
(
${
payload
.
department
}
)`
:
`问诊单
${
payload
.
diagnoseLogId
}
`
;
// userCallKfStatus 医助呼叫
// doctorCallKfStatus 医生呼叫
const
name
=
payload
.
userCallKfStatus
==
1
?
payload
.
userName
:
payload
.
doctorName
;
const
cn
=
_VM
.
$notify
({
const
name
=
payload
.
userCallKfStatus
==
1
?
payload
.
userName
:
payload
.
doctorName
;
const
cn
=
window
.
_VM
.
$notify
({
title
:
t
,
message
:
h
(
'p'
,
[
h
(
'i'
,
{
style
:
'color: teal;'
},
`
${
name
}
正在呼叫你`
),
h
(
'i'
,
{
style
:
'color: teal;'
},
`
${
name
}
正在呼叫你`
),
h
(
'el-button'
,
...
...
@@ -109,15 +107,16 @@ export default {
on
:
{
click
:
function
()
{
console
.
log
(
'----state'
,
state
);
if
(
state
.
showChat
)
{
_VM
.
$message
({
message
:
'不可同时进入多个诊室,请先退出已进入的诊室,再试。'
,
if
(
state
.
showChat
)
{
window
.
_VM
.
$message
({
message
:
'不可同时进入多个诊室,请先退出已进入的诊室,再试。'
,
type
:
'warning'
,
duration
:
1000
duration
:
1000
,
});
return
false
;
}
store
.
dispatch
(
'gotoInquiry'
,
payload
);
context
.
dispatch
(
'gotoInquiry'
,
payload
);
cn
.
close
();
},
},
...
...
@@ -126,12 +125,12 @@ export default {
),
]),
onClose
:
function
()
{
console
.
log
(
'--onClose'
,
payload
);
console
.
log
(
'--onClose'
,
payload
);
},
duration
:
5000
,
position
:
'top-right'
,
});
}
}
,
},
};
export
default
socket
;
src/store/mutations/index.js
浏览文件 @
57982d24
...
...
@@ -10,10 +10,10 @@ export default {
changeRawCurrentCalList
(
state
,
obj
)
{
// console.log("obj",obj)
const
index
=
state
.
RawCurrentCalList
.
findIndex
(
val
=>
{
const
index
=
state
.
RawCurrentCalList
.
findIndex
(
(
val
)
=>
{
return
val
.
status
==
obj
.
status
;
});
if
(
index
>
-
1
)
{
if
(
index
>
-
1
)
{
state
.
RawCurrentCalList
[
index
]
=
obj
;
state
.
currentCalList
[
index
].
is_dot
=
false
;
}
...
...
@@ -23,19 +23,19 @@ export default {
},
updateCurrentCalList
(
state
,
obj
)
{
const
NewData
=
obj
;
if
(
state
.
RawCurrentCalList
.
length
==
0
)
{
if
(
state
.
RawCurrentCalList
.
length
==
0
)
{
state
.
RawCurrentCalList
=
obj
;
}
const
RawData
=
state
.
RawCurrentCalList
;
for
(
let
i
=
0
;
i
<
NewData
.
length
;
i
++
)
{
let
is_dot
=
false
;
if
(
RawData
.
length
>
0
)
{
is_dot
=
NewData
[
i
].
count
>
RawData
[
i
].
count
?
true
:
false
;
}
NewData
[
i
]
=
{
...
NewData
[
i
],
is_dot
:
is_dot
,
};
let
is_dot
=
false
;
if
(
RawData
.
length
>
0
)
{
is_dot
=
NewData
[
i
].
count
>
RawData
[
i
].
count
?
true
:
false
;
}
NewData
[
i
]
=
{
...
NewData
[
i
],
is_dot
:
is_dot
,
};
}
state
.
currentCalList
=
NewData
;
},
...
...
@@ -59,6 +59,7 @@ export default {
state
.
noticeList
=
obj
;
},
updateIsSuperAdmin
(
state
,
obj
)
{
console
.
log
(
'obj------'
,
obj
);
state
.
isSuperAdmin
=
obj
;
},
};
src/store/state.js
浏览文件 @
57982d24
...
...
@@ -5,7 +5,9 @@ const state = {
allSize
:
0
,
currentCalList
:
{},
RawCurrentCalList
:
[],
currentChat
:
{},
currentChat
:
{
diagnoseType
:
1
},
currentAdvice
:
{},
soketQuest
:
{},
noticeList
:
[],
...
...
src/views/IM/diagnosis-admin/workbench.vue
浏览文件 @
57982d24
...
...
@@ -148,7 +148,7 @@
},
watch
:
{
isSuperAdmin
(
newdata
,
olddata
)
{
console
.
log
(
'newdata---'
,
newdata
);
console
.
log
(
'newdata---'
,
newdata
,
this
.
isSuperAdmin
);
if
(
newdata
!==
olddata
&&
newdata
.
userID
)
{
console
.
log
(
'-isSuperAdminisSuperAdmin'
,
newdata
);
const
s
=
storejs
.
get
(
'soketQuest'
);
...
...
@@ -169,18 +169,18 @@
},
},
created
()
{
},
mounted
()
{
console
.
log
(
'this.isSuperAdmin.userID----------'
,
this
.
isSuperAdmin
);
const
s
=
storejs
.
get
(
'soketQuest'
);
const
t
=
s
?
s
.
returnStatus
:
1
;
this
.
tabPosition
=
t
;
const
d
=
s
?
s
.
dateTime
:
new
Date
().
format
(
'yyyy-MM-dd'
);
this
.
searchParam
.
dateTime
=
d
;
const
id
=
s
&&
s
.
operateUserId
?
s
.
operateUserId
:
this
.
isSuperAdmin
.
userID
;
this
.
operateUserId
=
id
;
},
mounted
()
{
console
.
log
(
'this.isSuperAdmin'
,
this
.
isSuperAdmin
);
const
id
=
s
&&
s
.
operateUserId
?
s
.
operateUserId
:
this
.
isSuperAdmin
.
userID
;
this
.
operateUserId
=
id
;
},
methods
:
{
tabChange
(
val
)
{
...
...
src/views/layout/components/slidebar.vue
浏览文件 @
57982d24
...
...
@@ -94,6 +94,7 @@
i
.
isSuper
=
false
;
}
});
console
.
log
(
'i------------'
,
this
.
$store
);
this
.
$store
.
commit
(
'updateIsSuperAdmin'
,
i
);
this
.
items
=
vueMenuDtos
;
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录