正在显示
5 个修改的文件
包含
181 行增加
和
103 行删除
| @@ -58,16 +58,21 @@ export default class MessageEntrance extends Emiter { | @@ -58,16 +58,21 @@ export default class MessageEntrance extends Emiter { | ||
| 58 | constructor() { | 58 | constructor() { |
| 59 | super(); | 59 | super(); |
| 60 | //sdk 信息 | 60 | //sdk 信息 |
| 61 | - GlobalConfig.sdkVersion = "v1.68.2.20170812"; | 61 | + GlobalConfig.sdkVersion = "v1.70.5.20170812"; |
| 62 | loger.warn("sdkVersion:" + GlobalConfig.sdkVersion); | 62 | loger.warn("sdkVersion:" + GlobalConfig.sdkVersion); |
| 63 | 63 | ||
| 64 | //设置 | 64 | //设置 |
| 65 | let locationProtocol= location.protocol; | 65 | let locationProtocol= location.protocol; |
| 66 | - if(locationProtocol!="https:"){ | ||
| 67 | - GlobalConfig.locationProtocol="http://"; | ||
| 68 | - }else { | 66 | + if(locationProtocol=="https:"){ |
| 67 | + GlobalConfig.isHttps=true; | ||
| 69 | GlobalConfig.locationProtocol="https://"; | 68 | GlobalConfig.locationProtocol="https://"; |
| 69 | + GlobalConfig.websocketProtocol="wss://"; | ||
| 70 | + }else { | ||
| 71 | + GlobalConfig.isHttps=false; | ||
| 72 | + GlobalConfig.locationProtocol="http://"; | ||
| 73 | + GlobalConfig.websocketProtocol="ws://"; | ||
| 70 | } | 74 | } |
| 75 | + | ||
| 71 | loger.warn("protocol:" + GlobalConfig.locationProtocol); | 76 | loger.warn("protocol:" + GlobalConfig.locationProtocol); |
| 72 | //获取设备和系统信息 | 77 | //获取设备和系统信息 |
| 73 | SystemConfig.getSystemInfo(); | 78 | SystemConfig.getSystemInfo(); |
| @@ -496,7 +501,12 @@ export default class MessageEntrance extends Emiter { | @@ -496,7 +501,12 @@ export default class MessageEntrance extends Emiter { | ||
| 496 | //保存参数 | 501 | //保存参数 |
| 497 | GlobalConfig.isRecordPlayBack = false; //设置为非录制回放状态 | 502 | GlobalConfig.isRecordPlayBack = false; //设置为非录制回放状态 |
| 498 | GlobalConfig.classId = parseInt(_param.classId); | 503 | GlobalConfig.classId = parseInt(_param.classId); |
| 499 | - GlobalConfig.portal = _param.portal; | 504 | + GlobalConfig.portal = _param.portal||""; |
| 505 | + if(GlobalConfig.isHttps==true){ | ||
| 506 | + //https的时候替换所有80端口 | ||
| 507 | + GlobalConfig.portal= GlobalConfig.portal.replace(":80",""); | ||
| 508 | + } | ||
| 509 | + | ||
| 500 | GlobalConfig.userId = _param.userId || "0"; | 510 | GlobalConfig.userId = _param.userId || "0"; |
| 501 | //H5处理 | 511 | //H5处理 |
| 502 | GlobalConfig.isH5 = _param.isH5 || false;//外部传入的参数,是否是H5 | 512 | GlobalConfig.isH5 = _param.isH5 || false;//外部传入的参数,是否是H5 |
| @@ -2279,7 +2289,12 @@ export default class MessageEntrance extends Emiter { | @@ -2279,7 +2289,12 @@ export default class MessageEntrance extends Emiter { | ||
| 2279 | //保存参数 | 2289 | //保存参数 |
| 2280 | GlobalConfig.isRecordPlayBack = true; //设置为录制回放状态 | 2290 | GlobalConfig.isRecordPlayBack = true; //设置为录制回放状态 |
| 2281 | GlobalConfig.classId = parseInt(_param.classId); | 2291 | GlobalConfig.classId = parseInt(_param.classId); |
| 2282 | - GlobalConfig.portal = _param.portal; | 2292 | + GlobalConfig.portal = _param.portal||""; |
| 2293 | + if(GlobalConfig.isHttps==true){ | ||
| 2294 | + //https的时候替换所有80端口 | ||
| 2295 | + GlobalConfig.portal= GlobalConfig.portal.replace(":80",""); | ||
| 2296 | + } | ||
| 2297 | + | ||
| 2283 | GlobalConfig.userRole = ApeConsts.normal; //*************很重要,录制回放的时候,身份模式是普通人******** | 2298 | GlobalConfig.userRole = ApeConsts.normal; //*************很重要,录制回放的时候,身份模式是普通人******** |
| 2284 | GlobalConfig.userId = _param.userId || "0"; | 2299 | GlobalConfig.userId = _param.userId || "0"; |
| 2285 | GlobalConfig.userName = _param.userName || ""; | 2300 | GlobalConfig.userName = _param.userName || ""; |
| @@ -2330,6 +2345,12 @@ export default class MessageEntrance extends Emiter { | @@ -2330,6 +2345,12 @@ export default class MessageEntrance extends Emiter { | ||
| 2330 | if (_video_ape) { | 2345 | if (_video_ape) { |
| 2331 | _video_ape.clearData(); | 2346 | _video_ape.clearData(); |
| 2332 | } | 2347 | } |
| 2348 | + if (_mediaShareApe) { | ||
| 2349 | + _mediaShareApe.clearData(); | ||
| 2350 | + } | ||
| 2351 | + if (_musicShareApe) { | ||
| 2352 | + _musicShareApe.clearData(); | ||
| 2353 | + } | ||
| 2333 | } | 2354 | } |
| 2334 | 2355 | ||
| 2335 | //录制回放加入 课堂成功 | 2356 | //录制回放加入 课堂成功 |
| @@ -14,6 +14,8 @@ | @@ -14,6 +14,8 @@ | ||
| 14 | 14 | ||
| 15 | import Emiter from 'Emiter'; | 15 | import Emiter from 'Emiter'; |
| 16 | import Loger from 'Loger'; | 16 | import Loger from 'Loger'; |
| 17 | +import GlobalConfig from 'GlobalConfig'; | ||
| 18 | + | ||
| 17 | let loger = Loger.getLoger('EverSocket'); | 19 | let loger = Loger.getLoger('EverSocket'); |
| 18 | const MCU_MAX_RECONNECTION = 4;//最多重连次数 | 20 | const MCU_MAX_RECONNECTION = 4;//最多重连次数 |
| 19 | class EverSocket extends Emiter { | 21 | class EverSocket extends Emiter { |
| @@ -33,7 +35,8 @@ class EverSocket extends Emiter { | @@ -33,7 +35,8 @@ class EverSocket extends Emiter { | ||
| 33 | loger.error('开始MCU连接->MCU连接地址无效'); | 35 | loger.error('开始MCU连接->MCU连接地址无效'); |
| 34 | } | 36 | } |
| 35 | this._enableEverSocket = true; | 37 | this._enableEverSocket = true; |
| 36 | - this.wsURL = 'ws://' + ip + ':' + port; | 38 | + //this.wsURL = 'ws://' + ip + ':' + port; |
| 39 | + this.wsURL = GlobalConfig.websocketProtocol + ip + ':' + port; | ||
| 37 | this._newConnection(); | 40 | this._newConnection(); |
| 38 | } | 41 | } |
| 39 | 42 | ||
| @@ -42,10 +45,15 @@ class EverSocket extends Emiter { | @@ -42,10 +45,15 @@ class EverSocket extends Emiter { | ||
| 42 | this._clear(); | 45 | this._clear(); |
| 43 | } | 46 | } |
| 44 | switchSocketIp(ip,port) { | 47 | switchSocketIp(ip,port) { |
| 45 | - if(port){ | 48 | + /* if(port){ |
| 46 | this.wsURL = 'ws://' + ip + ':' + port; | 49 | this.wsURL = 'ws://' + ip + ':' + port; |
| 47 | }else { | 50 | }else { |
| 48 | this.wsURL = 'ws://' + ip; | 51 | this.wsURL = 'ws://' + ip; |
| 52 | + }*/ | ||
| 53 | + if(port){ | ||
| 54 | + this.wsURL = GlobalConfig.websocketProtocol + ip + ':' + port; | ||
| 55 | + }else { | ||
| 56 | + this.wsURL = GlobalConfig.websocketProtocol + ip; | ||
| 49 | } | 57 | } |
| 50 | } | 58 | } |
| 51 | get connected() { | 59 | get connected() { |
| @@ -352,7 +352,7 @@ GlobalConfig.messageDelay = false; //是否启用消息延迟 | @@ -352,7 +352,7 @@ GlobalConfig.messageDelay = false; //是否启用消息延迟 | ||
| 352 | GlobalConfig.mcuDelay = 0; //默认的延迟时间(单位-秒) | 352 | GlobalConfig.mcuDelay = 0; //默认的延迟时间(单位-秒) |
| 353 | 353 | ||
| 354 | GlobalConfig.docDelay = 1600; //文档模块加入成功之后延迟发送送成功的消息给主模块(sdk内部使用) | 354 | GlobalConfig.docDelay = 1600; //文档模块加入成功之后延迟发送送成功的消息给主模块(sdk内部使用) |
| 355 | -GlobalConfig.portal = "112.126.80.182:80"; //Sass IP | 355 | +GlobalConfig.portal = ""; //Sass IP |
| 356 | 356 | ||
| 357 | //从Sass获取的 | 357 | //从Sass获取的 |
| 358 | GlobalConfig.country = ""; //国家 | 358 | GlobalConfig.country = ""; //国家 |
| @@ -535,5 +535,7 @@ GlobalConfig.explorerVersion="未知";//浏览器版本 | @@ -535,5 +535,7 @@ GlobalConfig.explorerVersion="未知";//浏览器版本 | ||
| 535 | GlobalConfig.os="未知";//系统 | 535 | GlobalConfig.os="未知";//系统 |
| 536 | 536 | ||
| 537 | GlobalConfig.locationProtocol="http://";//https;或http: | 537 | GlobalConfig.locationProtocol="http://";//https;或http: |
| 538 | +GlobalConfig.websocketProtocol="ws://";//wss或ws | ||
| 539 | +GlobalConfig.isHttps=false;//是否是https | ||
| 538 | export default GlobalConfig; | 540 | export default GlobalConfig; |
| 539 | 541 |
| @@ -41,6 +41,7 @@ class RecordPlayBackParse extends Emiter { | @@ -41,6 +41,7 @@ class RecordPlayBackParse extends Emiter { | ||
| 41 | this._docApeMssages = {};//文档数据 | 41 | this._docApeMssages = {};//文档数据 |
| 42 | this._whiteApeMssages = {};//白板数据 | 42 | this._whiteApeMssages = {};//白板数据 |
| 43 | this._mediaShareApeMssages={};//媒体共享 | 43 | this._mediaShareApeMssages={};//媒体共享 |
| 44 | + this._musicShareApeMssages={};//伴音媒体共享 | ||
| 44 | this._timerCounter = new TimerCounter();//计时器 | 45 | this._timerCounter = new TimerCounter();//计时器 |
| 45 | this._timerCounter.addTimerCallBack(this._timerCounterUptate.bind(this), 1); | 46 | this._timerCounter.addTimerCallBack(this._timerCounterUptate.bind(this), 1); |
| 46 | } | 47 | } |
| @@ -171,6 +172,9 @@ class RecordPlayBackParse extends Emiter { | @@ -171,6 +172,9 @@ class RecordPlayBackParse extends Emiter { | ||
| 171 | case ApeConsts.MEDIA_SESSION_ID: | 172 | case ApeConsts.MEDIA_SESSION_ID: |
| 172 | this.saveParseData(data, timestamp, this._mediaShareApeMssages); | 173 | this.saveParseData(data, timestamp, this._mediaShareApeMssages); |
| 173 | break; | 174 | break; |
| 175 | + case ApeConsts.MUSIC_SESSION_ID: | ||
| 176 | + this.saveParseData(data, timestamp, this._musicShareApeMssages); | ||
| 177 | + break; | ||
| 174 | case ApeConsts.WHITEBOARD_SESSION_ID: | 178 | case ApeConsts.WHITEBOARD_SESSION_ID: |
| 175 | this.saveParseData(data, timestamp, this._whiteApeMssages); | 179 | this.saveParseData(data, timestamp, this._whiteApeMssages); |
| 176 | break; | 180 | break; |
| @@ -235,7 +239,8 @@ class RecordPlayBackParse extends Emiter { | @@ -235,7 +239,8 @@ class RecordPlayBackParse extends Emiter { | ||
| 235 | this._searchMessageFromTime(this._recordPlaybackTimestamp, this._conferApeMssages,"conferApe"); | 239 | this._searchMessageFromTime(this._recordPlaybackTimestamp, this._conferApeMssages,"conferApe"); |
| 236 | this._searchMessageFromTime(this._recordPlaybackTimestamp, this._chatApeMssages,"chatApe"); | 240 | this._searchMessageFromTime(this._recordPlaybackTimestamp, this._chatApeMssages,"chatApe"); |
| 237 | this._searchMessageFromTime(this._recordPlaybackTimestamp, this._docApeMssages,"docApe"); | 241 | this._searchMessageFromTime(this._recordPlaybackTimestamp, this._docApeMssages,"docApe"); |
| 238 | - this._searchMessageFromTime(this._recordPlaybackTimestamp, this._mediaShareApeMssages,"mediaShareApe") | 242 | + this._searchMessageFromTime(this._recordPlaybackTimestamp, this._mediaShareApeMssages,"mediaShareApe"); |
| 243 | + this._searchMessageFromTime(this._recordPlaybackTimestamp, this._musicShareApeMssages,"musicShareApe"); | ||
| 239 | this._searchMessageFromTime(this._recordPlaybackTimestamp, this._whiteApeMssages,"whiteApe"); | 244 | this._searchMessageFromTime(this._recordPlaybackTimestamp, this._whiteApeMssages,"whiteApe"); |
| 240 | this._searchMessageFromTime(this._recordPlaybackTimestamp, this._videoApeMssages,"videoAp"); | 245 | this._searchMessageFromTime(this._recordPlaybackTimestamp, this._videoApeMssages,"videoAp"); |
| 241 | this._searchMessageFromTime(this._recordPlaybackTimestamp, this._audioApeMssages,"audioApe"); | 246 | this._searchMessageFromTime(this._recordPlaybackTimestamp, this._audioApeMssages,"audioApe"); |
| @@ -319,7 +324,9 @@ class RecordPlayBackParse extends Emiter { | @@ -319,7 +324,9 @@ class RecordPlayBackParse extends Emiter { | ||
| 319 | } | 324 | } |
| 320 | 325 | ||
| 321 | GlobalConfig.recordPlaybackMaxTime = this._recordPlaybackMaxTime; | 326 | GlobalConfig.recordPlaybackMaxTime = this._recordPlaybackMaxTime; |
| 322 | - console.log('MediaChannleList',this.mediaChannleList); | 327 | + console.log('音视频通话模块数据',this.mediaChannleList); |
| 328 | + console.log('媒体共享模块数据',this._mediaShareApeMssages); | ||
| 329 | + console.log('伴音模块数据',this._musicShareApeMssages); | ||
| 323 | loger.log("录制回放数据解析完成,录制回放的总时间长为->", this._recordPlaybackMaxTime); | 330 | loger.log("录制回放数据解析完成,录制回放的总时间长为->", this._recordPlaybackMaxTime); |
| 324 | this._emit(RecordPlayBackParse.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS, {"recordPlaybackMaxTime": this._recordPlaybackMaxTime}); | 331 | this._emit(RecordPlayBackParse.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS, {"recordPlaybackMaxTime": this._recordPlaybackMaxTime}); |
| 325 | } | 332 | } |
| @@ -403,6 +410,9 @@ class RecordPlayBackParse extends Emiter { | @@ -403,6 +410,9 @@ class RecordPlayBackParse extends Emiter { | ||
| 403 | //媒体共享模块 | 410 | //媒体共享模块 |
| 404 | this.searchMediaShareApeMessageKeyfram(this._mediaShareApeMssages); | 411 | this.searchMediaShareApeMessageKeyfram(this._mediaShareApeMssages); |
| 405 | 412 | ||
| 413 | + //伴音共享模块 | ||
| 414 | + this.searchMusicShareApeMessageKeyfram(this._musicShareApeMssages); | ||
| 415 | + | ||
| 406 | //聊天模块、白板标注模块的比较特殊,消息是累计的,默认最多30条 | 416 | //聊天模块、白板标注模块的比较特殊,消息是累计的,默认最多30条 |
| 407 | this._searchChatHistoryMessageKeyfram(this._chatApeMssages, ApeConsts.CHAT_SESSION_ID); | 417 | this._searchChatHistoryMessageKeyfram(this._chatApeMssages, ApeConsts.CHAT_SESSION_ID); |
| 408 | this._searchWhiteboradHistoryMessageKeyfram(this._whiteApeMssages, ApeConsts.WHITEBOARD_SESSION_ID); | 418 | this._searchWhiteboradHistoryMessageKeyfram(this._whiteApeMssages, ApeConsts.WHITEBOARD_SESSION_ID); |
| @@ -486,6 +496,28 @@ class RecordPlayBackParse extends Emiter { | @@ -486,6 +496,28 @@ class RecordPlayBackParse extends Emiter { | ||
| 486 | loger.log("SEEK->APE->媒体共享", this._recordPlaybackTimestamp, "没有查找到相连的数据"); | 496 | loger.log("SEEK->APE->媒体共享", this._recordPlaybackTimestamp, "没有查找到相连的数据"); |
| 487 | } | 497 | } |
| 488 | 498 | ||
| 499 | + //伴音共享模块查找关键帧时间戳的消息 | ||
| 500 | + searchMusicShareApeMessageKeyfram(_apeMessages){ | ||
| 501 | + if(!_apeMessages){ | ||
| 502 | + return; | ||
| 503 | + } | ||
| 504 | + let messageItem; | ||
| 505 | + let keyFrameSeekTime = 0; | ||
| 506 | + for (let i = this._recordPlaybackTimestamp; i > 0; i--) { | ||
| 507 | + messageItem = _apeMessages[i]; | ||
| 508 | + if (messageItem) { | ||
| 509 | + keyFrameSeekTime = (this._recordPlaybackTimestamp - i) | ||
| 510 | + loger.log("SEEK->APE",'伴音共享',this._recordPlaybackTimestamp, "查找到相连的timestamp->", i, '需要seek->', keyFrameSeekTime, "秒"); | ||
| 511 | + //把时间点对应的数据发送,同一秒内有存在多个数据的情况 | ||
| 512 | + for (let k = 0; k < messageItem.length; k++) { | ||
| 513 | + this._everSocketMsgReceivedHandler(messageItem[k].byteData, keyFrameSeekTime); | ||
| 514 | + } | ||
| 515 | + return; | ||
| 516 | + } | ||
| 517 | + } | ||
| 518 | + loger.log("SEEK->APE->伴音共享", this._recordPlaybackTimestamp, "没有查找到相连的数据"); | ||
| 519 | + } | ||
| 520 | + | ||
| 489 | //查找聊天模块ape关键帧数据,聊天模块比较特殊,消息是累积的,当前时间戳之前的都需要显示 | 521 | //查找聊天模块ape关键帧数据,聊天模块比较特殊,消息是累积的,当前时间戳之前的都需要显示 |
| 490 | _searchChatHistoryMessageKeyfram(_apeMessages) { | 522 | _searchChatHistoryMessageKeyfram(_apeMessages) { |
| 491 | if(!_apeMessages){ | 523 | if(!_apeMessages){ |
| @@ -42,7 +42,7 @@ class DocApe extends Ape { | @@ -42,7 +42,7 @@ class DocApe extends Ape { | ||
| 42 | //上传文档 | 42 | //上传文档 |
| 43 | documentUpload(paramInfo) { | 43 | documentUpload(paramInfo) { |
| 44 | if (paramInfo == null || EngineUtils.isEmptyObject(paramInfo)) { | 44 | if (paramInfo == null || EngineUtils.isEmptyObject(paramInfo)) { |
| 45 | - loger.warn('上传文档->失败->参数错误->',paramInfo); | 45 | + loger.warn('上传文档->失败->参数错误->', paramInfo); |
| 46 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 46 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 47 | return; | 47 | return; |
| 48 | } | 48 | } |
| @@ -133,84 +133,91 @@ class DocApe extends Ape { | @@ -133,84 +133,91 @@ class DocApe extends Ape { | ||
| 133 | //loger.log("发送更新文档.itemIdx=" + tableItemPdu.itemIdx); | 133 | //loger.log("发送更新文档.itemIdx=" + tableItemPdu.itemIdx); |
| 134 | this.sendUniform(adapterPdu, true); | 134 | this.sendUniform(adapterPdu, true); |
| 135 | } | 135 | } |
| 136 | + | ||
| 136 | //获取文档的完整地址和所有图片 | 137 | //获取文档的完整地址和所有图片 |
| 137 | - getDocFullAddress(_param){ | ||
| 138 | - if (_param == null || _param.url == null || _param.itemIdx ==null) { | 138 | + getDocFullAddress(_param) { |
| 139 | + if (_param == null || _param.url == null || _param.itemIdx == null) { | ||
| 139 | loger.warn('获取文档完整地址->传递的参数不正确->', _param); | 140 | loger.warn('获取文档完整地址->传递的参数不正确->', _param); |
| 140 | - return {"code":ApeConsts.RETURN_FAILED, "data": "获取文档时传递的参数不对"}; | ||
| 141 | - } | ||
| 142 | - let fullPath='';//文档路径地址 | ||
| 143 | - let pageNum=1;//总页数 | ||
| 144 | - let docType="";//文档地址的后缀类型 | ||
| 145 | - let fileType="";//文档的原始类型 | ||
| 146 | - let docItem=this.docList[_param.itemIdx]; | ||
| 147 | - if(docItem){ | ||
| 148 | - fullPath=docItem.url||""; | ||
| 149 | - pageNum=docItem.pageNum||1; | ||
| 150 | - fileType=docItem.fileType||"" | ||
| 151 | - }else { | ||
| 152 | - fullPath =_param.url; | 141 | + return {"code": ApeConsts.RETURN_FAILED, "data": "获取文档时传递的参数不对"}; |
| 142 | + } | ||
| 143 | + let fullPath = '';//文档路径地址 | ||
| 144 | + let pageNum = 1;//总页数 | ||
| 145 | + let docType = "";//文档地址的后缀类型 | ||
| 146 | + let fileType = "";//文档的原始类型 | ||
| 147 | + let docItem = this.docList[_param.itemIdx]; | ||
| 148 | + if (docItem) { | ||
| 149 | + fullPath = docItem.url || ""; | ||
| 150 | + pageNum = docItem.pageNum || 1; | ||
| 151 | + fileType = docItem.fileType || "" | ||
| 152 | + } else { | ||
| 153 | + fullPath = _param.url; | ||
| 153 | } | 154 | } |
| 154 | 155 | ||
| 156 | + //替换地址的协议头,如果地址栏是https开头就换成https | ||
| 157 | + fullPath = fullPath.replace("http://", GlobalConfig.locationProtocol); | ||
| 158 | + | ||
| 155 | //获取当前文档的后缀名 | 159 | //获取当前文档的后缀名 |
| 156 | - docType=this._getDocType(fullPath); | ||
| 157 | - let substrFullPath=this._getDocPath(fullPath);//获取去掉后缀和文件名的地址,需要获取同目录下其他文件 | ||
| 158 | - let imagesArr=[]; | ||
| 159 | - let htmlPath=""; | ||
| 160 | - let pdfPath=""; | 160 | + docType = this._getDocType(fullPath); |
| 161 | + let substrFullPath = this._getDocPath(fullPath);//获取去掉后缀和文件名的地址,需要获取同目录下其他文件 | ||
| 162 | + let imagesArr = []; | ||
| 163 | + let htmlPath = ""; | ||
| 164 | + let pdfPath = ""; | ||
| 161 | 165 | ||
| 162 | //根据文件后缀名,生成对应的访问地址 | 166 | //根据文件后缀名,生成对应的访问地址 |
| 163 | - if(docType=="jpg"||docType=="png"||docType=="swf"||docType=="pdf"||docType=="doc"||docType=="pptx"){ | 167 | + if (docType == "jpg" || docType == "png" || docType == "swf" || docType == "pdf" || docType == "doc" || docType == "pptx") { |
| 164 | //页数从1开始 | 168 | //页数从1开始 |
| 165 | - for (let i = 1; i <=pageNum; i++) { | 169 | + for (let i = 1; i <= pageNum; i++) { |
| 166 | imagesArr.push(substrFullPath + "/" + i + ".jpg"); | 170 | imagesArr.push(substrFullPath + "/" + i + ".jpg"); |
| 167 | } | 171 | } |
| 168 | } | 172 | } |
| 169 | - if(docType=="swf"||docType=="pdf"||docType=="doc"||docType=="pptx"){ | ||
| 170 | - pdfPath=fullPath.replace(/\.swf/g, ".pdf")||""; | 173 | + if (docType == "swf" || docType == "pdf" || docType == "doc" || docType == "pptx") { |
| 174 | + pdfPath = fullPath.replace(/\.swf/g, ".pdf") || ""; | ||
| 171 | } | 175 | } |
| 172 | //动态PPT | 176 | //动态PPT |
| 173 | - if(docType=="html"){ | ||
| 174 | - htmlPath=fullPath; | 177 | + if (docType == "html") { |
| 178 | + htmlPath = fullPath; | ||
| 175 | } | 179 | } |
| 176 | //返回文档第所有地址 | 180 | //返回文档第所有地址 |
| 177 | - return {'code':ApeConsts.RETURN_SUCCESS, 'data': '','docFullAddress':{ | ||
| 178 | - 'images':imagesArr, | ||
| 179 | - 'pdf':pdfPath, | ||
| 180 | - 'html':htmlPath | ||
| 181 | - }}; | 181 | + return { |
| 182 | + 'code': ApeConsts.RETURN_SUCCESS, 'data': '', 'docFullAddress': { | ||
| 183 | + 'images': imagesArr, | ||
| 184 | + 'pdf': pdfPath, | ||
| 185 | + 'html': htmlPath | ||
| 186 | + } | ||
| 187 | + }; | ||
| 182 | } | 188 | } |
| 183 | 189 | ||
| 184 | - _getDocType(_fullPath){ | ||
| 185 | - if(!_fullPath){ | 190 | + _getDocType(_fullPath) { |
| 191 | + if (!_fullPath) { | ||
| 186 | return ""; | 192 | return ""; |
| 187 | } | 193 | } |
| 188 | - if(_fullPath.lastIndexOf(".jpg")>=0){ | 194 | + if (_fullPath.lastIndexOf(".jpg") >= 0) { |
| 189 | return "jpg"; | 195 | return "jpg"; |
| 190 | } | 196 | } |
| 191 | - if(_fullPath.lastIndexOf(".png")>=0){ | 197 | + if (_fullPath.lastIndexOf(".png") >= 0) { |
| 192 | return "png"; | 198 | return "png"; |
| 193 | } | 199 | } |
| 194 | - if(_fullPath.lastIndexOf(".swf")>=0){ | 200 | + if (_fullPath.lastIndexOf(".swf") >= 0) { |
| 195 | return "swf"; | 201 | return "swf"; |
| 196 | } | 202 | } |
| 197 | - if(_fullPath.lastIndexOf(".pdf")>=0){ | 203 | + if (_fullPath.lastIndexOf(".pdf") >= 0) { |
| 198 | return "pdf"; | 204 | return "pdf"; |
| 199 | } | 205 | } |
| 200 | - if(_fullPath.lastIndexOf(".doc")>=0){ | 206 | + if (_fullPath.lastIndexOf(".doc") >= 0) { |
| 201 | return "doc"; | 207 | return "doc"; |
| 202 | } | 208 | } |
| 203 | - if(_fullPath.lastIndexOf(".html")>=0){ | 209 | + if (_fullPath.lastIndexOf(".html") >= 0) { |
| 204 | return "html"; | 210 | return "html"; |
| 205 | } | 211 | } |
| 206 | - if(_fullPath.lastIndexOf(".pptx")>=0){ | 212 | + if (_fullPath.lastIndexOf(".pptx") >= 0) { |
| 207 | return "pptx"; | 213 | return "pptx"; |
| 208 | } | 214 | } |
| 209 | return ""; | 215 | return ""; |
| 210 | } | 216 | } |
| 217 | + | ||
| 211 | //获取去掉文件名和后缀名的地址 http://www.xxx.xxx/image/aa.jpg -->http://www.xxx.xxx/image/ | 218 | //获取去掉文件名和后缀名的地址 http://www.xxx.xxx/image/aa.jpg -->http://www.xxx.xxx/image/ |
| 212 | - _getDocPath(_fullPath){ | ||
| 213 | - if(!_fullPath){ | 219 | + _getDocPath(_fullPath) { |
| 220 | + if (!_fullPath) { | ||
| 214 | return ""; | 221 | return ""; |
| 215 | } | 222 | } |
| 216 | var lastIndex = _fullPath.lastIndexOf("/"); | 223 | var lastIndex = _fullPath.lastIndexOf("/"); |
| @@ -222,7 +229,8 @@ class DocApe extends Ape { | @@ -222,7 +229,8 @@ class DocApe extends Ape { | ||
| 222 | 229 | ||
| 223 | //获取文档的图片完整地址 | 230 | //获取文档的图片完整地址 |
| 224 | getDocImageFullPath(_param) { | 231 | getDocImageFullPath(_param) { |
| 225 | - if (_param == null || _param.relativeUrl == null || _param.relativeUrl == "") { | 232 | + return []; |
| 233 | + /*if (_param == null || _param.relativeUrl == null || _param.relativeUrl == "") { | ||
| 226 | loger.warn('获取文档完整地址,传递的参数不对.', _param); | 234 | loger.warn('获取文档完整地址,传递的参数不对.', _param); |
| 227 | return []; | 235 | return []; |
| 228 | } | 236 | } |
| @@ -264,11 +272,13 @@ class DocApe extends Ape { | @@ -264,11 +272,13 @@ class DocApe extends Ape { | ||
| 264 | } | 272 | } |
| 265 | } else { | 273 | } else { |
| 266 | return [fullPath]; | 274 | return [fullPath]; |
| 267 | - } | 275 | + }*/ |
| 268 | } | 276 | } |
| 269 | 277 | ||
| 270 | //获取文档的pdf完整地址 | 278 | //获取文档的pdf完整地址 |
| 271 | getDocPDFFullPath(_param) { | 279 | getDocPDFFullPath(_param) { |
| 280 | + return []; | ||
| 281 | + /* | ||
| 272 | if (_param == null || _param.relativeUrl == null || _param.relativeUrl == "") { | 282 | if (_param == null || _param.relativeUrl == null || _param.relativeUrl == "") { |
| 273 | loger.warn('获取文档完整地址,传递的参数不对.', _param); | 283 | loger.warn('获取文档完整地址,传递的参数不对.', _param); |
| 274 | return []; | 284 | return []; |
| @@ -279,7 +289,7 @@ class DocApe extends Ape { | @@ -279,7 +289,7 @@ class DocApe extends Ape { | ||
| 279 | fullPath = "http://" + fullPath; | 289 | fullPath = "http://" + fullPath; |
| 280 | } | 290 | } |
| 281 | fullPath = this.replacePathType(fullPath) + ".pdf"; | 291 | fullPath = this.replacePathType(fullPath) + ".pdf"; |
| 282 | - return [fullPath]; | 292 | + return [fullPath];*/ |
| 283 | } | 293 | } |
| 284 | 294 | ||
| 285 | // 去除文件的后缀格式名称 | 295 | // 去除文件的后缀格式名称 |
| @@ -293,24 +303,25 @@ class DocApe extends Ape { | @@ -293,24 +303,25 @@ class DocApe extends Ape { | ||
| 293 | } | 303 | } |
| 294 | 304 | ||
| 295 | //组织完整的文档信息,包含上传时的信息和转换后的完整地址信息 | 305 | //组织完整的文档信息,包含上传时的信息和转换后的完整地址信息 |
| 296 | - _docPackFullInfo(_itemDataInfo){ | ||
| 297 | - let itemDataInfo=_itemDataInfo; | ||
| 298 | - let getDocAddress=this.getDocFullAddress(_itemDataInfo); | 306 | + _docPackFullInfo(_itemDataInfo) { |
| 307 | + let itemDataInfo = _itemDataInfo; | ||
| 308 | + let getDocAddress = this.getDocFullAddress(_itemDataInfo); | ||
| 299 | //loger.log('docPackFullInfo->', itemDataInfo); | 309 | //loger.log('docPackFullInfo->', itemDataInfo); |
| 300 | - if(getDocAddress.code==ApeConsts.RETURN_SUCCESS){ | ||
| 301 | - itemDataInfo.images=getDocAddress.docFullAddress.images||[]; | ||
| 302 | - itemDataInfo.pdf=getDocAddress.docFullAddress.pdf||""; | ||
| 303 | - itemDataInfo.html=getDocAddress.docFullAddress.html||""; | ||
| 304 | - }else { | ||
| 305 | - itemDataInfo.images=[]; | ||
| 306 | - itemDataInfo.pdf=''; | ||
| 307 | - itemDataInfo.html=''; | 310 | + if (getDocAddress.code == ApeConsts.RETURN_SUCCESS) { |
| 311 | + itemDataInfo.images = getDocAddress.docFullAddress.images || []; | ||
| 312 | + itemDataInfo.pdf = getDocAddress.docFullAddress.pdf || ""; | ||
| 313 | + itemDataInfo.html = getDocAddress.docFullAddress.html || ""; | ||
| 314 | + } else { | ||
| 315 | + itemDataInfo.images = []; | ||
| 316 | + itemDataInfo.pdf = ''; | ||
| 317 | + itemDataInfo.html = ''; | ||
| 308 | } | 318 | } |
| 309 | 319 | ||
| 310 | return itemDataInfo; | 320 | return itemDataInfo; |
| 311 | } | 321 | } |
| 322 | + | ||
| 312 | //更新文档模块的录制信息,每次开启录制的时候需要把当前文档的信息更新一次 | 323 | //更新文档模块的录制信息,每次开启录制的时候需要把当前文档的信息更新一次 |
| 313 | - updaterRecordApeStatus(_param){ | 324 | + updaterRecordApeStatus(_param) { |
| 314 | /* if(GlobalConfig.isHost&&!GlobalConfig.isRecordPlayBack&&GlobalConfig.activeDocId>0){ | 325 | /* if(GlobalConfig.isHost&&!GlobalConfig.isRecordPlayBack&&GlobalConfig.activeDocId>0){ |
| 315 | loger.log("录制状态发送改变->更新当前的文档数据->docId:", GlobalConfig.activeDocId, 'page:',GlobalConfig.activeDocCurPage); | 326 | loger.log("录制状态发送改变->更新当前的文档数据->docId:", GlobalConfig.activeDocId, 'page:',GlobalConfig.activeDocCurPage); |
| 316 | this.documentSwitchPage({ | 327 | this.documentSwitchPage({ |
| @@ -318,20 +329,22 @@ class DocApe extends Ape { | @@ -318,20 +329,22 @@ class DocApe extends Ape { | ||
| 318 | "curPageNo":GlobalConfig.activeDocCurPage | 329 | "curPageNo":GlobalConfig.activeDocCurPage |
| 319 | }); | 330 | }); |
| 320 | }*/ | 331 | }*/ |
| 321 | - loger.warn("录制状态发送改变->更新当前的文档数据->docId:", GlobalConfig.activeDocId, 'page:',GlobalConfig.activeDocCurPage); | 332 | + loger.warn("录制状态发送改变->更新当前的文档数据->docId:", GlobalConfig.activeDocId, 'page:', GlobalConfig.activeDocCurPage); |
| 322 | this.documentSwitchPage({ | 333 | this.documentSwitchPage({ |
| 323 | "itemIdx": GlobalConfig.activeDocId, | 334 | "itemIdx": GlobalConfig.activeDocId, |
| 324 | - "curPageNo":GlobalConfig.activeDocCurPage | 335 | + "curPageNo": GlobalConfig.activeDocCurPage |
| 325 | }); | 336 | }); |
| 326 | } | 337 | } |
| 338 | + | ||
| 327 | //清除当前文档模块的数据 | 339 | //清除当前文档模块的数据 |
| 328 | - clearData(){ | 340 | + clearData() { |
| 329 | loger.log("clearData->") | 341 | loger.log("clearData->") |
| 330 | - this.docList={}; | ||
| 331 | - GlobalConfig.activeDocId=0; | ||
| 332 | - GlobalConfig.activeDocCurPage=1; | 342 | + this.docList = {}; |
| 343 | + GlobalConfig.activeDocId = 0; | ||
| 344 | + GlobalConfig.activeDocCurPage = 1; | ||
| 333 | 345 | ||
| 334 | } | 346 | } |
| 347 | + | ||
| 335 | //切换文档 | 348 | //切换文档 |
| 336 | documentSwitchDoc(paramInfo) { | 349 | documentSwitchDoc(paramInfo) { |
| 337 | loger.log('切换文档->', paramInfo); | 350 | loger.log('切换文档->', paramInfo); |
| @@ -358,7 +371,7 @@ class DocApe extends Ape { | @@ -358,7 +371,7 @@ class DocApe extends Ape { | ||
| 358 | if (oldDocModel) { | 371 | if (oldDocModel) { |
| 359 | oldDocModel.action = ApeConsts.DOC_ACTION_NORMAL; | 372 | oldDocModel.action = ApeConsts.DOC_ACTION_NORMAL; |
| 360 | oldDocModel.visible = false;//设置为不可见 | 373 | oldDocModel.visible = false;//设置为不可见 |
| 361 | - oldDocModel.animationStep=1;//切换文档之后动画步数还原 | 374 | + oldDocModel.animationStep = 1;//切换文档之后动画步数还原 |
| 362 | } | 375 | } |
| 363 | } | 376 | } |
| 364 | 377 | ||
| @@ -373,7 +386,7 @@ class DocApe extends Ape { | @@ -373,7 +386,7 @@ class DocApe extends Ape { | ||
| 373 | //更新当前选择的文档数据的字段 | 386 | //更新当前选择的文档数据的字段 |
| 374 | docDataModel.action = ApeConsts.DOC_ACTION_SWITCH_DOC; | 387 | docDataModel.action = ApeConsts.DOC_ACTION_SWITCH_DOC; |
| 375 | docDataModel.visible = paramInfo.visible || false;//默认是false | 388 | docDataModel.visible = paramInfo.visible || false;//默认是false |
| 376 | - docDataModel.animationStep=1;//切换文档之后动画步数还原 | 389 | + docDataModel.animationStep = 1;//切换文档之后动画步数还原 |
| 377 | 390 | ||
| 378 | //loger.log('切换文档,当前文档和上一个显示的文档都需要更新状态'); | 391 | //loger.log('切换文档,当前文档和上一个显示的文档都需要更新状态'); |
| 379 | loger.log({"oldDoc": oldDocModel, "nowDoc": docDataModel}); | 392 | loger.log({"oldDoc": oldDocModel, "nowDoc": docDataModel}); |
| @@ -389,7 +402,7 @@ class DocApe extends Ape { | @@ -389,7 +402,7 @@ class DocApe extends Ape { | ||
| 389 | 402 | ||
| 390 | //文档翻页 | 403 | //文档翻页 |
| 391 | documentSwitchPage(paramInfo) { | 404 | documentSwitchPage(paramInfo) { |
| 392 | - loger.log('文档翻页->',paramInfo); | 405 | + loger.log('文档翻页->', paramInfo); |
| 393 | //获取已经存在的数据 | 406 | //获取已经存在的数据 |
| 394 | let docDataModel = this.docList[paramInfo.itemIdx]; | 407 | let docDataModel = this.docList[paramInfo.itemIdx]; |
| 395 | //console.log(docDataModelPdu); | 408 | //console.log(docDataModelPdu); |
| @@ -402,7 +415,7 @@ class DocApe extends Ape { | @@ -402,7 +415,7 @@ class DocApe extends Ape { | ||
| 402 | //更新数据的字段 | 415 | //更新数据的字段 |
| 403 | docDataModel.action = ApeConsts.DOC_ACTION_SWITCH_PAGE; | 416 | docDataModel.action = ApeConsts.DOC_ACTION_SWITCH_PAGE; |
| 404 | docDataModel.curPageNo = parseInt(paramInfo.curPageNo) || 1; | 417 | docDataModel.curPageNo = parseInt(paramInfo.curPageNo) || 1; |
| 405 | - docDataModel.animationStep=1;//切换文档之后动画步数还原 | 418 | + docDataModel.animationStep = 1;//切换文档之后动画步数还原 |
| 406 | if (docDataModel.curPageNo < 1) { | 419 | if (docDataModel.curPageNo < 1) { |
| 407 | docDataModel.curPageNo = 1;//默认值最小是1 | 420 | docDataModel.curPageNo = 1;//默认值最小是1 |
| 408 | } | 421 | } |
| @@ -411,25 +424,25 @@ class DocApe extends Ape { | @@ -411,25 +424,25 @@ class DocApe extends Ape { | ||
| 411 | 424 | ||
| 412 | //文档动画切换 | 425 | //文档动画切换 |
| 413 | documentSwitchAnimation(paramInfo) { | 426 | documentSwitchAnimation(paramInfo) { |
| 414 | - loger.log('文档页面动画切换->',paramInfo); | 427 | + loger.log('文档页面动画切换->', paramInfo); |
| 415 | //获取已经存在的数据 | 428 | //获取已经存在的数据 |
| 416 | let docDataModel = this.docList[GlobalConfig.activeDocId]; | 429 | let docDataModel = this.docList[GlobalConfig.activeDocId]; |
| 417 | if (docDataModel == null) { | 430 | if (docDataModel == null) { |
| 418 | - loger.log('文档页面动画切换->文档不存在',GlobalConfig.activeDocId, paramInfo); | 431 | + loger.log('文档页面动画切换->文档不存在', GlobalConfig.activeDocId, paramInfo); |
| 419 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 432 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 420 | return; | 433 | return; |
| 421 | } | 434 | } |
| 422 | //更新数据的字段 | 435 | //更新数据的字段 |
| 423 | docDataModel.action = ApeConsts.DOC_ACTION_SWITCH_ANIMATION; | 436 | docDataModel.action = ApeConsts.DOC_ACTION_SWITCH_ANIMATION; |
| 424 | - docDataModel.animationStep=docDataModel.animationStep||1;//最少步骤是1 | ||
| 425 | - if(paramInfo&¶mInfo.step==-1){ | 437 | + docDataModel.animationStep = docDataModel.animationStep || 1;//最少步骤是1 |
| 438 | + if (paramInfo && paramInfo.step == -1) { | ||
| 426 | //上一个 | 439 | //上一个 |
| 427 | docDataModel.animationStep--; | 440 | docDataModel.animationStep--; |
| 428 | - }else{ | 441 | + } else { |
| 429 | //下一个 | 442 | //下一个 |
| 430 | docDataModel.animationStep++; | 443 | docDataModel.animationStep++; |
| 431 | } | 444 | } |
| 432 | - if (!docDataModel.animationStep||docDataModel.animationStep < 1) { | 445 | + if (!docDataModel.animationStep || docDataModel.animationStep < 1) { |
| 433 | docDataModel.animationStep = 1;//默认值最小是1 | 446 | docDataModel.animationStep = 1;//默认值最小是1 |
| 434 | } | 447 | } |
| 435 | this.updaterDoc(docDataModel, docDataModel.itemIdx); | 448 | this.updaterDoc(docDataModel, docDataModel.itemIdx); |
| @@ -466,9 +479,9 @@ class DocApe extends Ape { | @@ -466,9 +479,9 @@ class DocApe extends Ape { | ||
| 466 | //更新数据的字段 | 479 | //更新数据的字段 |
| 467 | docDataModel.action = ApeConsts.DOC_ACTION_COMMAND; | 480 | docDataModel.action = ApeConsts.DOC_ACTION_COMMAND; |
| 468 | docDataModel.showType = parseInt(paramInfo.showType) || 0;//0;//完整显示;1;//按宽度显示;2;//按高度显示 | 481 | docDataModel.showType = parseInt(paramInfo.showType) || 0;//0;//完整显示;1;//按宽度显示;2;//按高度显示 |
| 469 | - docDataModel.curV= parseInt(paramInfo.curV) || 0;//垂直方向的滚动条进度百分比 0-100 | ||
| 470 | - docDataModel.curH= parseInt(paramInfo.curH) || 0;//水平方向的滚动条进度百分比 0-100 | ||
| 471 | - docDataModel.scale= parseInt(paramInfo.scale) || 100;//文档缩放百分比 0-100 | 482 | + docDataModel.curV = parseInt(paramInfo.curV) || 0;//垂直方向的滚动条进度百分比 0-100 |
| 483 | + docDataModel.curH = parseInt(paramInfo.curH) || 0;//水平方向的滚动条进度百分比 0-100 | ||
| 484 | + docDataModel.scale = parseInt(paramInfo.scale) || 100;//文档缩放百分比 0-100 | ||
| 472 | this.updaterDoc(docDataModel, docDataModel.itemIdx); | 485 | this.updaterDoc(docDataModel, docDataModel.itemIdx); |
| 473 | } | 486 | } |
| 474 | 487 | ||
| @@ -530,28 +543,29 @@ class DocApe extends Ape { | @@ -530,28 +543,29 @@ class DocApe extends Ape { | ||
| 530 | this.documentSwitchDoc(paramInfo); | 543 | this.documentSwitchDoc(paramInfo); |
| 531 | }*/ | 544 | }*/ |
| 532 | } | 545 | } |
| 546 | + | ||
| 533 | //添加文档 | 547 | //添加文档 |
| 534 | tableInsertApeHandler(_tableUpdateItems, _seekTime) { | 548 | tableInsertApeHandler(_tableUpdateItems, _seekTime) { |
| 535 | - let tableInsertItems =_tableUpdateItems; | 549 | + let tableInsertItems = _tableUpdateItems; |
| 536 | let tableInsertItemsLen = tableInsertItems.length; | 550 | let tableInsertItemsLen = tableInsertItems.length; |
| 537 | loger.log('添加文档->', "activeDocId->", GlobalConfig.activeDocId, "tableUpdateItemsLen->", tableInsertItemsLen); | 551 | loger.log('添加文档->', "activeDocId->", GlobalConfig.activeDocId, "tableUpdateItemsLen->", tableInsertItemsLen); |
| 538 | for (let i = 0; i < tableInsertItemsLen; ++i) { | 552 | for (let i = 0; i < tableInsertItemsLen; ++i) { |
| 539 | let insertItem = tableInsertItems[i]; | 553 | let insertItem = tableInsertItems[i]; |
| 540 | - if(insertItem){ | 554 | + if (insertItem) { |
| 541 | //this.tableInsertHandler(insertItem.owner, insertItem.itemIdx, insertItem.itemData); | 555 | //this.tableInsertHandler(insertItem.owner, insertItem.itemIdx, insertItem.itemData); |
| 542 | let itemDataInfo = this.unPackPdu(insertItem.owner, insertItem.itemIdx, insertItem.itemData); | 556 | let itemDataInfo = this.unPackPdu(insertItem.owner, insertItem.itemIdx, insertItem.itemData); |
| 543 | - if(itemDataInfo){ | 557 | + if (itemDataInfo) { |
| 544 | this.docList[insertItem.itemIdx] = itemDataInfo; | 558 | this.docList[insertItem.itemIdx] = itemDataInfo; |
| 545 | if (itemDataInfo.visible == "true" || itemDataInfo.visible == true) { | 559 | if (itemDataInfo.visible == "true" || itemDataInfo.visible == true) { |
| 546 | GlobalConfig.activeDocId = itemDataInfo.itemIdx;//当前激活的文档ID | 560 | GlobalConfig.activeDocId = itemDataInfo.itemIdx;//当前激活的文档ID |
| 547 | GlobalConfig.activeDocCurPage = itemDataInfo.curPageNo;//当前激活的文档的当前页 | 561 | GlobalConfig.activeDocCurPage = itemDataInfo.curPageNo;//当前激活的文档的当前页 |
| 548 | //loger.log('添加文档->设置当前激活的文档id'); | 562 | //loger.log('添加文档->设置当前激活的文档id'); |
| 549 | } | 563 | } |
| 550 | - let getdocPackFullInfo= this._docPackFullInfo(itemDataInfo); | ||
| 551 | - loger.log('添加文档->',getdocPackFullInfo); | 564 | + let getdocPackFullInfo = this._docPackFullInfo(itemDataInfo); |
| 565 | + loger.log('添加文档->', getdocPackFullInfo); | ||
| 552 | this._emit(MessageTypes.DOC_UPDATE, getdocPackFullInfo);//用添加和更新都统一DOC_UPDATE | 566 | this._emit(MessageTypes.DOC_UPDATE, getdocPackFullInfo);//用添加和更新都统一DOC_UPDATE |
| 553 | - }else{ | ||
| 554 | - loger.warn('文档数据解析失败->删除->itemIdx:'+insertItem.itemIdx); | 567 | + } else { |
| 568 | + loger.warn('文档数据解析失败->删除->itemIdx:' + insertItem.itemIdx); | ||
| 555 | this.documentDelete({"itemIdx": insertItem.itemIdx}); | 569 | this.documentDelete({"itemIdx": insertItem.itemIdx}); |
| 556 | } | 570 | } |
| 557 | } | 571 | } |
| @@ -559,6 +573,7 @@ class DocApe extends Ape { | @@ -559,6 +573,7 @@ class DocApe extends Ape { | ||
| 559 | //文档数据更新完毕,如果当前没有显示的文档,默认选择一个显示 | 573 | //文档数据更新完毕,如果当前没有显示的文档,默认选择一个显示 |
| 560 | this._showDefaultDoc(); | 574 | this._showDefaultDoc(); |
| 561 | } | 575 | } |
| 576 | + | ||
| 562 | tableDeleteHandler(object_id, tableDeleteData) { | 577 | tableDeleteHandler(object_id, tableDeleteData) { |
| 563 | loger.log('删除文档数据->', object_id, tableDeleteData);//["tableDeleteHandler",1179649,{"type":231,"itemIdx":[1486301768]}] | 578 | loger.log('删除文档数据->', object_id, tableDeleteData);//["tableDeleteHandler",1179649,{"type":231,"itemIdx":[1486301768]}] |
| 564 | if (tableDeleteData && tableDeleteData.itemIdx) { | 579 | if (tableDeleteData && tableDeleteData.itemIdx) { |
| @@ -605,7 +620,7 @@ class DocApe extends Ape { | @@ -605,7 +620,7 @@ class DocApe extends Ape { | ||
| 605 | //loger.log('更新文档->', "activeDocId->", GlobalConfig.activeDocId, "更新的数量->", tableUpdateItemsLen); | 620 | //loger.log('更新文档->', "activeDocId->", GlobalConfig.activeDocId, "更新的数量->", tableUpdateItemsLen); |
| 606 | for (let i = 0; i < tableUpdateItemsLen; ++i) { | 621 | for (let i = 0; i < tableUpdateItemsLen; ++i) { |
| 607 | let tableItem = _tableUpdateItems[i]; | 622 | let tableItem = _tableUpdateItems[i]; |
| 608 | - if(tableItem) { | 623 | + if (tableItem) { |
| 609 | let itemDataInfo = this.unPackPdu(tableItem.owner, tableItem.itemIdx, tableItem.itemData); | 624 | let itemDataInfo = this.unPackPdu(tableItem.owner, tableItem.itemIdx, tableItem.itemData); |
| 610 | if (itemDataInfo) { | 625 | if (itemDataInfo) { |
| 611 | this.docList[tableItem.itemIdx] = itemDataInfo; | 626 | this.docList[tableItem.itemIdx] = itemDataInfo; |
| @@ -614,10 +629,10 @@ class DocApe extends Ape { | @@ -614,10 +629,10 @@ class DocApe extends Ape { | ||
| 614 | GlobalConfig.activeDocCurPage = itemDataInfo.curPageNo;//当前激活的文档的当前页 | 629 | GlobalConfig.activeDocCurPage = itemDataInfo.curPageNo;//当前激活的文档的当前页 |
| 615 | loger.log('更新文档->设置当前激活的文档id->', GlobalConfig.activeDocId, "curPageNum->", GlobalConfig.activeDocCurPage); | 630 | loger.log('更新文档->设置当前激活的文档id->', GlobalConfig.activeDocId, "curPageNum->", GlobalConfig.activeDocCurPage); |
| 616 | } | 631 | } |
| 617 | - let getdocPackFullInfo= this._docPackFullInfo(itemDataInfo); | 632 | + let getdocPackFullInfo = this._docPackFullInfo(itemDataInfo); |
| 618 | this._emit(MessageTypes.DOC_UPDATE, getdocPackFullInfo); | 633 | this._emit(MessageTypes.DOC_UPDATE, getdocPackFullInfo); |
| 619 | } else { | 634 | } else { |
| 620 | - loger.warn('文档数据解析失败->删除->itemIdx:'+tableItem.itemIdx); | 635 | + loger.warn('文档数据解析失败->删除->itemIdx:' + tableItem.itemIdx); |
| 621 | this.documentDelete({"itemIdx": tableItem.itemIdx}); | 636 | this.documentDelete({"itemIdx": tableItem.itemIdx}); |
| 622 | } | 637 | } |
| 623 | } | 638 | } |
| @@ -637,13 +652,13 @@ class DocApe extends Ape { | @@ -637,13 +652,13 @@ class DocApe extends Ape { | ||
| 637 | return; | 652 | return; |
| 638 | } | 653 | } |
| 639 | //如果自己不是老师,并且当前课堂内人数大于1,不能操作 | 654 | //如果自己不是老师,并且当前课堂内人数大于1,不能操作 |
| 640 | - if(!GlobalConfig.isHost&&GlobalConfig.rosterNumber>1){ | 655 | + if (!GlobalConfig.isHost && GlobalConfig.rosterNumber > 1) { |
| 641 | return; | 656 | return; |
| 642 | } | 657 | } |
| 643 | 658 | ||
| 644 | let tempDocItemIdx;//临时记录文档数据,用于显示默认文档 | 659 | let tempDocItemIdx;//临时记录文档数据,用于显示默认文档 |
| 645 | for (let key in this.docList) { | 660 | for (let key in this.docList) { |
| 646 | - tempDocItemIdx= this.docList[key]; | 661 | + tempDocItemIdx = this.docList[key]; |
| 647 | if (tempDocItemIdx) { | 662 | if (tempDocItemIdx) { |
| 648 | loger.log("选择一个文档作为默认文档显示->", tempDocItemIdx); | 663 | loger.log("选择一个文档作为默认文档显示->", tempDocItemIdx); |
| 649 | let paramInfo = { | 664 | let paramInfo = { |
| @@ -686,7 +701,7 @@ class DocApe extends Ape { | @@ -686,7 +701,7 @@ class DocApe extends Ape { | ||
| 686 | return true; | 701 | return true; |
| 687 | } | 702 | } |
| 688 | } | 703 | } |
| 689 | - loger.log('查找文档->没有查找到文档->',_docId); | 704 | + loger.log('查找文档->没有查找到文档->', _docId); |
| 690 | //储存的数据中没有查找到 | 705 | //储存的数据中没有查找到 |
| 691 | return false; | 706 | return false; |
| 692 | } | 707 | } |
| @@ -708,7 +723,7 @@ class DocApe extends Ape { | @@ -708,7 +723,7 @@ class DocApe extends Ape { | ||
| 708 | docModelPdu.pageNum = _param.pageNum || 1; | 723 | docModelPdu.pageNum = _param.pageNum || 1; |
| 709 | docModelPdu.fileType = _param.fileType || ""; | 724 | docModelPdu.fileType = _param.fileType || ""; |
| 710 | docModelPdu.creatUserId = _param.creatUserId || "0"; | 725 | docModelPdu.creatUserId = _param.creatUserId || "0"; |
| 711 | - docModelPdu.url = _param.url||"";//这个地址没用到,数据太长占用资源 暂停使用//"http://101.200.150.192/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg"; | 726 | + docModelPdu.url = _param.url || "";//这个地址没用到,数据太长占用资源 暂停使用//"http://101.200.150.192/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg"; |
| 712 | docModelPdu.relativeUrl = _param.relativeUrl || "";//"/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg"; | 727 | docModelPdu.relativeUrl = _param.relativeUrl || "";//"/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg"; |
| 713 | docModelPdu.curV = parseInt(_param.curV) || 0; | 728 | docModelPdu.curV = parseInt(_param.curV) || 0; |
| 714 | docModelPdu.curH = parseInt(_param.curH) || 0; | 729 | docModelPdu.curH = parseInt(_param.curH) || 0; |
| @@ -720,7 +735,7 @@ class DocApe extends Ape { | @@ -720,7 +735,7 @@ class DocApe extends Ape { | ||
| 720 | docModelPdu.fileName = _param.fileName || "doc_" + _itemIdx;//文档的名字 | 735 | docModelPdu.fileName = _param.fileName || "doc_" + _itemIdx;//文档的名字 |
| 721 | docModelPdu.dynamicTS = _param.dynamicTS || "0";//文档上传后返回值中的字段dynamicTransferStatic | 736 | docModelPdu.dynamicTS = _param.dynamicTS || "0";//文档上传后返回值中的字段dynamicTransferStatic |
| 722 | docModelPdu.showType = _param.showType || 0;//文档显示模式 | 737 | docModelPdu.showType = _param.showType || 0;//文档显示模式 |
| 723 | - docModelPdu.animationStep=_param.animationStep || 1;//当前页面上的动画步数(动态ppt时有这个字段) | 738 | + docModelPdu.animationStep = _param.animationStep || 1;//当前页面上的动画步数(动态ppt时有这个字段) |
| 724 | //loger.log(docModelPdu); | 739 | //loger.log(docModelPdu); |
| 725 | return docModelPdu; | 740 | return docModelPdu; |
| 726 | } | 741 | } |
-
请 注册 或 登录 后发表评论