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-14 10:32:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
81a928110a7037f7c7d1d4424d4087b770f44f7f
81a92811
1 parent
c5134e34
1.修改文档模块的接口
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
63 行增加
和
43 行删除
src/EngineEntrance.js
src/apes/ApeConsts.js
src/apes/DocApe.js
src/apes/WhiteBoardApe.js
src/pdus/pro.js
src/EngineEntrance.js
查看文件 @
81a9281
...
...
@@ -119,7 +119,8 @@ export default class MessageEntrance extends Emiter {
//DocApe
this
.
sendDocumentUpload
=
this
.
_sendDocumentUpload
;
//上传文档
this
.
sendDocumentSwitch
=
this
.
_sendDocumentSwitch
;
//切换文档
this
.
sendDocumentSwitchDoc
=
this
.
_sendDocumentSwitchDoc
;
//切换文档
this
.
sendDocumentSwitchPage
=
this
.
_sendDocumentSwitchPage
;
//翻页
this
.
sendDocumentDelete
=
this
.
_sendDocumentDelete
;
//删除文档
this
.
sendDocumentDeleteAll
=
this
.
_documentDeleteAll
;
//删除所有文档
this
.
sendDocumentCommand
=
this
.
_sendDocumentCommand
;
//操作文档(翻页、缩放、滚动...)
...
...
@@ -492,9 +493,21 @@ export default class MessageEntrance extends Emiter {
}
}
//切换文档
_sendDocumentSwitch
(
_param
){
_sendDocumentSwitch
Doc
(
_param
){
if
(
_doc_ape
){
_doc_ape
.
documentSwitch
(
_param
);
_doc_ape
.
documentSwitchDoc
(
_param
);
}
}
//操作文档(翻页)
_sendDocumentSwitchPage
(
_param
){
if
(
_doc_ape
){
_doc_ape
.
documentSwitchPage
(
_param
);
}
}
//操作文档(缩放、滚动...)
_sendDocumentCommand
(
_param
){
if
(
_doc_ape
){
_doc_ape
.
documentCommand
(
_param
);
}
}
//删除文档
...
...
@@ -509,14 +522,6 @@ export default class MessageEntrance extends Emiter {
_doc_ape
.
documentDeleteAll
(
_param
);
}
}
//操作文档(翻页、缩放、滚动...)
_sendDocumentCommand
(
_param
){
if
(
_doc_ape
){
_doc_ape
.
documentCommand
(
_param
);
}
}
/* // 白板笔记更新(svg)
annoUpdateHandler(annoInfo) {
const activeDocId = _confer_ape.activeDocId;
...
...
src/apes/ApeConsts.js
查看文件 @
81a9281
...
...
@@ -45,8 +45,11 @@ ApeConsts.INVALIDATE_CHANNEL_ID = -1;
ApeConsts
.
INVALIDATE_NODE_ID
=
-
1
;
// doc update status
ApeConsts
.
DOCUMENT_LOAD
=
0
;
ApeConsts
.
DOCUMENT_DEL
=
1
;
ApeConsts
.
DOC_ACTION_NORMAL
=
0
;
//无操作
ApeConsts
.
DOC_ACTION_SWITCH_DOC
=
1
;
//切换文档
ApeConsts
.
DOC_ACTION_SWITCH_PAGE
=
2
;
//文档翻页
ApeConsts
.
DOC_ACTION_COMMAND
=
3
;
//文档操作:滚动、缩放
// RCChannelGrabStatus
ApeConsts
.
CGS_RELEASED
=
0
;
///< 无人占用状态
...
...
src/apes/DocApe.js
查看文件 @
81a9281
...
...
@@ -23,9 +23,6 @@ import EngineUtils from 'EngineUtils';
let
loger
=
Loger
.
getLoger
(
'DocApe'
);
let
itemIdx
=
0
;
//table插入新数据的计数id,目前用时间戳
const
DOC_ACTION_NORMAL
=
0
;
//无操作
const
DOC_ACTION_SWITCH
=
1
;
//切换文档
const
DOC_ACTION_COMMAND
=
2
;
//文档操作:翻页、滚动、缩放
class
DocApe
extends
Ape
{
constructor
()
{
...
...
@@ -35,8 +32,8 @@ class DocApe extends Ape {
ApeConsts
.
DOCSHARING_SESSION_TAG
);
this
.
docList
=
{};
//记录文档的数组this.docList[itemIdx]=itemIdx的数据
this
.
activeDocItemIdx
=
0
;
//当前激活的文档itemIdx
this
.
activeDocCurPage
=
1
;
//当前激活的文档的当前页
//this.activeDocItemIdx =0;//当前激活的文档itemIdx
//this.activeDocCurPage=1;//当前激活的文档的当前页
// 延迟
this
.
_apeDelayed
=
true
;
...
...
@@ -141,7 +138,7 @@ class DocApe extends Ape {
this
.
sendUniform
(
adapterPdu
,
true
);
}
//切换文档
documentSwitch
(
paramInfo
){
documentSwitch
Doc
(
paramInfo
){
//console.log(this.docList);
//获取已经存在的数据
let
docDataModel
=
this
.
docList
[
paramInfo
.
itemIdx
];
...
...
@@ -151,14 +148,35 @@ class DocApe extends Ape {
return
;
}
//更新数据的字段
docDataModel
.
action
=
DOC_ACTION_SWITCH
;
docDataModel
.
visible
=!
docDataModel
.
visible
;
docDataModel
.
action
=
ApeConsts
.
DOC_ACTION_SWITCH_DOC
;
docDataModel
.
visible
=
paramInfo
.
visible
||
false
;
//默认是false
this
.
updaterDoc
(
docDataModel
,
docDataModel
.
itemIdx
);
}
//操作文档(翻页、缩放、滚动...)//0,无操作, 1翻页、缩放/滚动,2.显示/隐藏
//文档翻页
documentSwitchPage
(
paramInfo
){
//console.log(this.docList);
//获取已经存在的数据
let
docDataModel
=
this
.
docList
[
paramInfo
.
itemIdx
];
//console.log(docDataModelPdu);
//console.log(docDataModel);
if
(
docDataModel
==
null
){
loger
.
log
(
'documentCommand失败,文档不存在'
,
paramInfo
);
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_APE_INTERFACE_PARAM_WRONG
);
return
;
}
//更新数据的字段
docDataModel
.
action
=
ApeConsts
.
DOC_ACTION_SWITCH_PAGE
;
docDataModel
.
curPageNo
=
parseInt
(
paramInfo
.
curPageNo
)
||
1
;
if
(
docDataModel
.
curPageNo
<
1
){
docDataModel
.
curPageNo
=
1
;
//默认值最小是1
}
this
.
updaterDoc
(
docDataModel
,
docDataModel
.
itemIdx
);
}
//缩放/滚动
documentCommand
(
paramInfo
){
console
.
log
(
this
.
docList
);
//
console.log(this.docList);
//获取已经存在的数据
let
docDataModel
=
this
.
docList
[
paramInfo
.
itemIdx
];
//console.log(docDataModelPdu);
...
...
@@ -169,8 +187,8 @@ class DocApe extends Ape {
return
;
}
//更新数据的字段
docDataModel
.
action
=
DOC_ACTION_COMMAND
;
docDataModel
.
curPageNo
=
docDataModel
.
curPageNo
+
1
;
docDataModel
.
action
=
ApeConsts
.
DOC_ACTION_COMMAND
;
docDataModel
.
scale
=
parseInt
(
paramInfo
.
scale
)
||
100
;
//默认是100(百分比)
this
.
updaterDoc
(
docDataModel
,
docDataModel
.
itemIdx
);
}
...
...
@@ -253,9 +271,9 @@ class DocApe extends Ape {
docModelPdu
.
relativeUrl
=
_param
.
relativeUrl
||
""
;
//"/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg";
docModelPdu
.
curV
=
_param
.
curV
||
0
;
docModelPdu
.
curH
=
_param
.
curH
||
0
;
docModelPdu
.
scale
=
_param
.
scale
||
1
;
docModelPdu
.
scale
=
_param
.
scale
||
1
00
;
//按百分比
docModelPdu
.
visible
=
_param
.
visible
||
false
;
docModelPdu
.
action
=
_param
.
action
||
DOC_ACTION_NORMAL
;
//0,无操作, 1翻页、2.显示/隐藏, 3缩放/滚动
docModelPdu
.
action
=
_param
.
action
||
ApeConsts
.
DOC_ACTION_NORMAL
;
//0,无操作, 1翻页、2.显示/隐藏, 3缩放/滚动
docModelPdu
.
docId
=
_param
.
docId
||
""
;
//文档在服务器数据库中的唯一id,必须有
docModelPdu
.
md5
=
_param
.
md5
||
""
;
//MD5
docModelPdu
.
fileName
=
_param
.
fileName
||
"doc_"
+
_itemIdx
;
//文档的名字
...
...
@@ -317,7 +335,7 @@ class DocApe extends Ape {
this
.
docList
[
itemIdx
]
=
itemDataInfo
;
loger
.
log
(
'tableUpdateHandler'
,
itemDataInfo
);
/* switch (itemDataInfo.action){
case DOC_ACTION_SWITCH:
case DOC_ACTION_SWITCH
_DOC
:
break;
case DOC_ACTION_COMMAND:
break;
...
...
src/apes/WhiteBoardApe.js
查看文件 @
81a9281
...
...
@@ -76,7 +76,7 @@ class WhiteBoardApe extends Ape {
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_APE_INTERFACE_PARAM_WRONG
);
return
;
}
console
.
log
(
whiteBoardModelPdu
);
//
console.log(whiteBoardModelPdu);
//储存记录,用于返回上一步操作
this
.
insertHistory
.
push
(
whiteBoardModelPdu
);
...
...
@@ -237,7 +237,9 @@ class WhiteBoardApe extends Ape {
tableUpdateHandler
(
owner
,
itemIdx
,
itemData
)
{
let
whiteBoardModel
=
this
.
unPackPdu
(
owner
,
itemIdx
,
itemData
);
loger
.
log
(
'tableUpdateHandler'
,
whiteBoardModel
);
this
.
updateAandShowAnnotaion
();
if
(
whiteBoardModel
&&
whiteBoardModel
.
parentId
==
GlobalConfig
.
activeDocId
&&
whiteBoardModel
.
curPageNo
==
GlobalConfig
.
activeDocCurPage
){
this
.
updateAandShowAnnotaion
();
}
}
tableDeleteHandler
(
object_id
,
tableDeleteData
){
// console.log("白板收到数据,tableDeleteHandler object_id="+object_id);//((18<< 16) + 1)=1179649
...
...
@@ -258,6 +260,11 @@ class WhiteBoardApe extends Ape {
//文档更新,白板也要更新
docUpdateHandler
(
_data
){
loger
.
log
(
"白板收到文档更新的消息docUpdateHandler"
,
_data
);
//如果切换了文档或翻页,清除之前的添加步骤记录
if
(
_data
.
action
==
ApeConsts
.
DOC_ACTION_SWITCH_DOC
){
this
.
insertHistory
=
[];
}
this
.
updateAandShowAnnotaion
();
}
//删除白板数据
...
...
src/pdus/pro.js
查看文件 @
81a9281
...
...
@@ -699,19 +699,6 @@ message RCChatSendDataRequestPdu {
required
bytes
from_name
=
6
;
}
message
RCDocSendDataRequestPdu
{
required
uint32
id
=
1
;
required
string
doc_type
=
2
;
required
string
uri
=
3
;
optional
uint32
owner
=
4
;
optional
uint32
from
=
5
;
optional
string
name
=
6
;
optional
uint32
cur_page_no
=
7
;
optional
uint32
cur_H
=
8
;
optional
uint32
cur_V
=
9
;
optional
uint32
scale
=
10
;
optional
uint32
page_num
=
11
;
}
message
RCDocSendDataModelPdu
{
required
uint32
item_idx
=
1
;
//唯一标识
required
uint32
owner
=
2
;
...
...
请
注册
或
登录
后发表评论