Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
李勇
/
McuClient
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
李勇
2017-02-16 19:06:48 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
02c1dbb4c87ddd98892bf4692d1ae81f8f898333
02c1dbb4
1 parent
c41e34b0
1.文档模块增加获取文档完整路径的接口
2.会议模块增加会议关闭消息的监听处理
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
64 行增加
和
24 行删除
src/EngineEntrance.js
src/GlobalConfig.js
src/MessageTypes.js
src/apes/ConferApe.js
src/apes/DocApe.js
src/EngineEntrance.js
查看文件 @
02c1dbb
...
...
@@ -76,7 +76,6 @@ export default class MessageEntrance extends Emiter {
// 注册所有应用Ape
_confer_ape
=
new
ConferApe
();
_confer_ape
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
_confer_ape
.
on
(
MessageTypes
.
CLASS_CLOSE
,
this
.
_doClassClose
.
bind
(
this
));
//会议关闭,所有人都退出
_confer_ape
.
on
(
MessageTypes
.
CLASS_EXIT
,
this
.
_doClassExit
.
bind
(
this
));
//监听自己的关闭事件
_confer_ape
.
on
(
MessageTypes
.
CLASS_STATUS_INFO_CHANGE
,
this
.
_onClassStatusInfoChange
.
bind
(
this
));
//当前会议状态信息发生改变
...
...
@@ -132,7 +131,7 @@ export default class MessageEntrance extends Emiter {
this
.
sendDocumentDelete
=
this
.
_sassDeleteDocument
;
//删除文档,先通过Sass删除,sass删除成功之后再同步mcu
//this.sendDocumentDeleteAll= this._documentDeleteAll;//删除所有文档
this
.
sendDocumentCommand
=
this
.
_sendDocumentCommand
;
//操作文档(翻页、缩放、滚动...)
this
.
getDocFullPath
=
this
.
_getDocFullPath
;
//获取文档的完整路径
}
...
...
@@ -260,7 +259,7 @@ export default class MessageEntrance extends Emiter {
initSuccessCallBackData
.
classType
=
GlobalConfig
.
classType
;
//host默认需要密码,Sass服务器只判断学生是否需要密码,没有判断老师的
if
(
GlobalConfig
.
userRole
==
ApeConsts
.
host
)
{
if
(
GlobalConfig
.
userRole
==
ApeConsts
.
host
)
{
initSuccessCallBackData
.
passwordRequired
=
true
;
}
else
{
initSuccessCallBackData
.
passwordRequired
=
GlobalConfig
.
passwordRequired
;
...
...
@@ -304,7 +303,7 @@ export default class MessageEntrance extends Emiter {
GlobalConfig
.
MCUServerPort
=
server
.
split
(
":"
)[
1
];
}
GlobalConfig
.
doc
=
_data
.
doc
;
GlobalConfig
.
doc
Server
=
_data
.
doc
;
GlobalConfig
.
h5_mcu_list
=
_data
.
h5_mcu_list
;
GlobalConfig
.
h5Module
=
_data
.
h5Module
;
GlobalConfig
.
mcu
=
_data
.
mcu
;
...
...
@@ -443,7 +442,7 @@ export default class MessageEntrance extends Emiter {
//GlobalConfig.MCUServerIP=_data.MCUServerIP;
// GlobalConfig.MCUServerPort=_data.MCUServerPort;
initSuccessCallBackData
.
doc
=
GlobalConfig
.
doc
;
//文档服务器地址
initSuccessCallBackData
.
doc
Server
=
GlobalConfig
.
docServer
;
//文档服务器地址
initSuccessCallBackData
.
classId
=
GlobalConfig
.
classId
;
initSuccessCallBackData
.
className
=
GlobalConfig
.
className
;
initSuccessCallBackData
.
h5Module
=
GlobalConfig
.
h5Module
;
...
...
@@ -516,7 +515,7 @@ export default class MessageEntrance extends Emiter {
// //GlobalConfig.MCUServerIP=_data.MCUServerIP;
// // GlobalConfig.MCUServerPort=_data.MCUServerPort;
//
// initSuccessCallBackData.doc
=GlobalConfig.doc
;//文档服务器地址
// initSuccessCallBackData.doc
Server=GlobalConfig.docServer
;//文档服务器地址
// initSuccessCallBackData.classId=GlobalConfig.classId;
// initSuccessCallBackData.className=GlobalConfig.className;
// initSuccessCallBackData.h5Module=GlobalConfig.h5Module;
...
...
@@ -680,6 +679,16 @@ export default class MessageEntrance extends Emiter {
//DocApe
//获取文档完整路径
_getDocFullPath
(
_param
){
if
(
_doc_ape
){
return
_doc_ape
.
getDocFullPath
(
_param
);
}
else
{
loger
.
error
(
"文档模块还没有创建,无法获取"
);
return
""
;
}
}
//上传文档
_sendDocumentUpload
(
_param
){
if
(
_doc_ape
){
...
...
src/GlobalConfig.js
查看文件 @
02c1dbb
...
...
@@ -251,7 +251,7 @@ GlobalConfig.portal="112.126.80.182:80";
GlobalConfig
.
ip
=
"112.126.80.182"
;
GlobalConfig
.
port
=
"80"
;
GlobalConfig
.
MCUServerIP
=
"114.215.195.70"
;
GlobalConfig
.
doc
=
""
;
GlobalConfig
.
doc
Server
=
""
;
//当前的文档地址加载的服务器地址
GlobalConfig
.
MCUServerPort
=
9003
;
GlobalConfig
.
maxVideoChannels
=
1
;
GlobalConfig
.
maxAudioChannels
=
1
;
...
...
src/MessageTypes.js
查看文件 @
02c1dbb
...
...
@@ -18,8 +18,8 @@ MessageTypes.CLASS_JOIN_SUCCESS = 'join.class.success';
MessageTypes
.
CLASS_SHOW_ROSTER_NUM
=
'roster_num.message'
;
MessageTypes
.
CLASS_INSERT_ROSTER
=
'roster_insert.message'
;
MessageTypes
.
CLASS_DELETE_ROSTER
=
'roster_delete.message'
;
MessageTypes
.
CLASS_EXIT
=
'class.exit'
;
//退出
MessageTypes
.
CLASS_CLOSE
=
'class.close'
;
//关闭会议,所有人都要退出(host操作)
MessageTypes
.
CLASS_EXIT
=
'class.exit'
;
//退出 关闭会议
MessageTypes
.
CLASS_UPTATE_STATUS
=
'class.update.status'
;
//更新会议状态信息
MessageTypes
.
CLASS_STATUS_INFO_CHANGE
=
'class.status.info.change'
;
//会议状态信息发生改变,需要保存数据到sass和同步MCU
//聊天模块事件定义
...
...
src/apes/ConferApe.js
查看文件 @
02c1dbb
...
...
@@ -355,20 +355,9 @@ class ConferApe extends Ape {
if
(
model
&&
model
.
classStatusInfo
){
GlobalConfig
.
setClassStatusInfo
(
model
.
classStatusInfo
);
}
//通知应用层更新会议状态
this
.
_emit
(
MessageTypes
.
CLASS_UPTATE_STATUS
,
GlobalConfig
.
classStatusInfo
);
switch
(
GlobalConfig
.
classStatus
){
case
ApeConsts
.
CLASS_STATUS_WAIT
:
break
;
case
ApeConsts
.
CLASS_STATUS_STARTED
:
break
;
case
ApeConsts
.
CLASS_STATUS_PAUSE
:
break
;
case
ApeConsts
.
CLASS_STATUS_CLOSE
:
break
;
default
:
break
;
}
//_confer_ape.on(MessageTypes.CLASS_CLOSE, this._doClassClose.bind(this));//会议关闭,所有人都退出
/*{
"itemIdx": 720899,
...
...
@@ -423,7 +412,7 @@ class ConferApe extends Ape {
case
ApeConsts
.
CLASS_ACTION_CLOSE_ALL
:
loger
.
log
(
chatMsg
.
message
);
//会议关闭,所有人都退出
this
.
_emit
(
MessageTypes
.
CLASS_
CLOSE
);
this
.
_emit
(
MessageTypes
.
CLASS_
EXIT
);
break
;
default
:
break
;
...
...
src/apes/DocApe.js
查看文件 @
02c1dbb
...
...
@@ -137,6 +137,48 @@ class DocApe extends Ape {
loger
.
log
(
"发送更新文档.itemIdx="
+
tableItemPdu
.
itemIdx
);
this
.
sendUniform
(
adapterPdu
,
true
);
}
//获取文档的完整地址
getDocFullPath
(
_param
){
if
(
_param
==
null
||
_param
.
relativeUrl
==
null
){
loger
.
warn
(
'获取文档完整地址,传递的参数不对.'
,
_param
);
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_CLASS_JOIN_PARAM
);
return
""
;
}
let
fullPath
=
GlobalConfig
.
docServer
+
_param
.
relativeUrl
;
var
index
;
switch
(
_param
.
type
){
case
"jpg"
:
fullPath
=
this
.
replacePathType
(
fullPath
)
+
".jpg"
;
break
;
case
"png"
:
fullPath
=
this
.
replacePathType
(
fullPath
)
+
".png"
;
break
;
case
"pdf"
:
fullPath
=
this
.
replacePathType
(
fullPath
)
+
".pdf"
;
break
;
default
:
//不做处理,直接返回拼接的地址
break
;
}
if
(
fullPath
&&
fullPath
.
indexOf
(
"http://"
)
<
0
){
fullPath
=
"http;//"
+
fullPath
;
}
loger
.
warn
(
'getDocFullPath ->'
,
fullPath
);
return
[
fullPath
];
}
// 去除文件的后缀格式名称
replacePathType
(
_path
){
let
path
=
_path
;
path
=
path
.
replace
(
/.jpg/g
,
""
);
path
=
path
.
replace
(
/.png/g
,
""
);
path
=
path
.
replace
(
/.swf/g
,
""
);
path
=
path
.
replace
(
/.pdf/g
,
""
);
return
path
;
}
//切换文档
documentSwitchDoc
(
paramInfo
){
//console.log(this.docList);
...
...
@@ -420,6 +462,6 @@ class DocApe extends Ape {
}
DocApe
.
prototype
.
DOC_JOIN_CHANNEL_SUCCESS
=
DocApe
.
DOC_JOIN_CHANNEL_SUCCESS
=
'doc.join.channel.success'
;
DocApe
.
prototype
.
DOC_JOIN_CHANNEL_SUCCESS
=
DocApe
.
DOC_JOIN_CHANNEL_SUCCESS
=
'doc
Server
.join.channel.success'
;
export
default
DocApe
;
...
...
请
注册
或
登录
后发表评论