소스 검색

Merge branch 'beta'

lsc 1 년 전
부모
커밋
775a3d374a
11개의 변경된 파일463개의 추가작업 그리고 209개의 파일을 삭제
  1. BIN
      img/icon/chjyjBg.png
  2. BIN
      img/icon/formulaEdi.png
  3. BIN
      img/icon/futureClass.png
  4. BIN
      img/icon/molStr.png
  5. BIN
      img/icon/timeAxis.png
  6. 266 170
      js/Desktop/DeskTop.js
  7. 8 0
      js/Desktop/Onload.js
  8. 17 14
      js/Office/Office.js
  9. 23 0
      js/Office/Poll.js
  10. 6 6
      js/Office/Word/Word.js
  11. 143 19
      node/message.js

BIN
img/icon/chjyjBg.png


BIN
img/icon/formulaEdi.png


BIN
img/icon/futureClass.png


BIN
img/icon/molStr.png


BIN
img/icon/timeAxis.png


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 266 - 170
js/Desktop/DeskTop.js


+ 8 - 0
js/Desktop/Onload.js

@@ -434,6 +434,9 @@ U.MD.D.getuser = function () {
                                     } else if (res.value[0][0].org == '1973f6c7-1561-11ee-91d8-005056b86db5') {
                                         $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/szjkyBg.png")'
                                         US.Config.background = 'url("/img/icon/szjkyBg.png")'
+                                    } else if (res.value[0][0].org == '2fa75e51-189a-11ee-91d8-005056b86db5') {
+                                        $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/chjyjBg.png")'
+                                        US.Config.background = 'url("/img/icon/chjyjBg.png")'
                                     }
                             
                                     
@@ -548,6 +551,8 @@ U.MD.D.getuser = function () {
                 $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/dseiBg.png")'
             } else if (userInfo.org == '1973f6c7-1561-11ee-91d8-005056b86db5') {
                 $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/szjkyBg.png")'
+            } else if (userInfo.org == '2fa75e51-189a-11ee-91d8-005056b86db5') {
+                $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/chjyjBg.png")'
             }
         }
     }
@@ -655,6 +660,9 @@ U.MD.D.getuser2 = function (userid, cid) {
         } else if (res.value[0][0].org == '1973f6c7-1561-11ee-91d8-005056b86db5') {
             $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/szjkyBg.png")'
             US.Config.background = 'url("/img/icon/szjkyBg.png")'
+        } else if (res.value[0][0].org == '2fa75e51-189a-11ee-91d8-005056b86db5') {
+            $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/chjyjBg.png")'
+            US.Config.background = 'url("/img/icon/chjyjBg.png")'
         }
 
         US.userInfo = res.value[0][0];

+ 17 - 14
js/Office/Office.js

@@ -21,7 +21,7 @@ U.MD.O.word = function (userinfo, fileinfo, cb) {
         _fileid,
         _formel,
         _child
-    ;
+        ;
     //获取文档的id
     if (fileinfo && fileinfo.UserDirectoryID) {
         _fileid = fileinfo.UserDirectoryID; //获取文件id
@@ -45,18 +45,20 @@ U.MD.O.word = function (userinfo, fileinfo, cb) {
         _contentel = $("#UD_Word").clone(true); //克隆word编辑器 包含头部菜单和功能及word编辑区域
         _child = $(_contentel[0]).Child(); //头部的区域
         _formel = new U.UF.UI.form(
-              _child[0],
+            _child[0],
             _child[1],
-            { "id": "UD_Word" + _fileid, "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
+            {
+                "id": "UD_Word" + _fileid, "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
                 "onresize": function () { }
             },
-            { closecallback: function () {
-                U.A.Request(US.SCOKET, ["quitOffice", JSON.stringify({ docId: fileinfo.UserDirectoryID, pageId: US.pageId, userId: top.US.userInfo.userid, type: fileinfo.UserDirectoryExtendType == 'un' ? 'nav' : 'word' })], function (r) {
-                    //                    console.log('退出文档');
-                });
-            }
+            {
+                closecallback: function () {
+                    U.A.Request(US.SCOKET, ["quitOffice", JSON.stringify({ docId: fileinfo.UserDirectoryID, pageId: US.pageId, userId: top.US.userInfo.userid, type: fileinfo.UserDirectoryExtendType == 'un' ? 'nav' : 'word' })], function (r) {
+                        //                    console.log('退出文档');
+                    });
+                }
             },
-            { "style": { "height": "36px"} }).form; //创建窗体
+            { "style": { "height": "36px" } }).form; //创建窗体
         U.MD.O.header(userinfo, _child[0], fileinfo); //创建header头部
         U.UF.DL.loading(_child[1]); //添加loading处理
         //添加编辑区域,异步加载iframe并执行回调
@@ -107,7 +109,7 @@ U.MD.O.excel = function (userinfo, fileinfo) {
         _fileid,
         _formel,
         _child
-    ;
+        ;
     //获取文档的id
     if (fileinfo && fileinfo.UserDirectoryID) {
         _fileid = fileinfo.UserDirectoryID; //获取文件id
@@ -126,7 +128,7 @@ U.MD.O.excel = function (userinfo, fileinfo) {
         _contentel = $("#UD_Excel").clone(true); //克隆word编辑器 包含头部菜单和功能及word编辑区域
         _contentel[0].id = ""; //清除id
         _child = $(_contentel[0]).Child(); //头部的区域
-        _formel = new U.UF.UI.form(_child[0], _child[1], { "id": "UD_Excel" + _fileid, "style": { "width": "90%", "height": "90%", "overflow": 'hidden'} }, {}, { "style": { "height": "36px"} }).form; //创建窗体
+        _formel = new U.UF.UI.form(_child[0], _child[1], { "id": "UD_Excel" + _fileid, "style": { "width": "90%", "height": "90%", "overflow": 'hidden' } }, {}, { "style": { "height": "36px" } }).form; //创建窗体
         U.UF.DL.loading(_child[1]); //添加loading处理
         U.MD.O.header(userinfo, _child[0], fileinfo); //创建header头部
         //添加编辑区域,异步加载iframe并执行回调
@@ -158,7 +160,7 @@ U.MD.O.excel = function (userinfo, fileinfo) {
 U.MD.O.officeLoad = function (el, type, cb) {
     var _file, //文件的路径
         _iframe //iframe的名字
-    ;
+        ;
     //初始化应用的路径。
     switch (type) {
         case "Word": //word的处理
@@ -166,7 +168,7 @@ U.MD.O.officeLoad = function (el, type, cb) {
             break;
         case "Excel": //excel的处理
             _file = "ExcelEditArea.htm";
-//            type = 'ExcelCanvas';
+            //            type = 'ExcelCanvas';
             break;
         case "PPT": //ppt的处理
             _file = "PPT.htm";
@@ -215,7 +217,8 @@ U.MD.O.header = function (userinfo, el, fileinfo) {
     $("input", el)[0].value = _filename; //文件名
     //头部处理
     _hreadel = $$("div", { "className": "U_MD_O_H_Editor" }, el.children[2].children[4]);
-    $$("img", { "onerror": U.MD.C.imgError,
+    $$("img", {
+        "onerror": U.MD.C.imgError,
         "onerror": U.MD.C.imgError,
         "src": U.MD.C.getHeadImage(userinfo.UserThumbnailImageHead)
     }, _hreadel);

+ 23 - 0
js/Office/Poll.js

@@ -213,6 +213,29 @@ U.MD.O.P.pollingAsyn = function (r) {
                         // }
                     }
                     break;
+                case 'us.cscl':
+                    // U.MD.O.W.wordInfo = function (type, content, navid, userid, roomid) {
+                    //     var _data = {
+                    //         "us.cscl": [{
+                    //             sendId: userid, //发送人id
+                    //             receiveId: classId, //文件id
+                    //             type: navid, //消息类型
+                    //             messageInfo: {
+                    //"nodes":[{"id":"9f6d7459-d376-4c0c-944b-a6b140085903","type":"icon-start","x":625,"y":145,"properties":{},"zIndex":1002,"text":{"x":625,"y":145,"value":"起始"}},{"id":"16e18308-7517-4162-8b32-a877b7cf42a0","type":"icon-card","x":325,"y":445,"properties":{},"zIndex":1002},{"id":"5c492b0d-092d-4d84-bd70-4d5734de9266","type":"icon-select","x":970,"y":510,"properties":{},"zIndex":1002}],
+                    //"edges":[],
+                    //"backgroundUrl":"img/bg.ccee1c62.png"
+                    //             },
+                    //         },],
+                    //     };
+                    //     return _data;
+                    // }
+
+                    _iframe = $('#cscl iframe')[0];
+                    if (_iframe) {
+                        _contentWindow = _iframe.contentWindow;
+                        _contentWindow.postMessage({ info: _message.messageInfo }, "*");
+                    }
+                    break;
             }
         }
     }

+ 6 - 6
js/Office/Word/Word.js

@@ -32,18 +32,18 @@ US = parent.US;
  * @return  {object}    返回当前窗体 
  */
 // U.MD.O.W.load = async function (fileid, userinfo) {
-U.MD.O.W.load = async function (cid, stage, task, tool,type) {
+U.MD.O.W.load = async function (cid, stage, task, tool, type) {
     //U.MD.O.W.openRoomConfirm();
     // var fileinfo = U.MD.O.W.getfile(),
     var fileinfo, userinfo;
     userinfo = await U.MD.O.W.getuser();
-    if(type == '2'){
+    if (type == '2') {
         if (cid && (stage || stage == 0) && (task || task == 0) && (tool || tool == 0)) {
             fileinfo = await U.MD.O.W.getWorkS(cid, stage, task, tool, userinfo.userid);
         } else {
             fileinfo = U.MD.O.W.getfile()
         }
-    }else{
+    } else {
         if (cid && (stage || stage == 0) && (task || task == 0) && (tool || tool == 0)) {
             fileinfo = await U.MD.O.W.getWork(cid, stage, task, tool, userinfo.userid);
         } else {
@@ -652,11 +652,11 @@ U.MD.O.W.getWork = async function (cid, s, task, t, uid) {
                     newfile: true
                 }
                 resolve(a);
-                
+
                 // setTimeout(() => {
                 //     U.MD.O.W.wordDirectory();
                 // }, 100)
-            }else{
+            } else {
                 resolve(U.MD.O.W.getfile())
             }
         }, [], { "type": "GET", "withCredentials": true });
@@ -675,7 +675,7 @@ U.MD.O.W.getWorkS = async function (cid, s, task, t, uid) {
                     newfile: true
                 }
                 resolve(a);
-            }else{
+            } else {
                 resolve(U.MD.O.W.getfile())
             }
         }, [], { "type": "GET", "withCredentials": true });

+ 143 - 19
node/message.js

@@ -20,18 +20,35 @@ us.user = {
 }
 
 /**
-* 用户的消息集合,以用户的页面id(登录唯一识别ID)作为搜索键
+* 未来课堂数据结构
+**/
+us.cscl = {
+    //"nodes":[{"id":"9f6d7459-d376-4c0c-944b-a6b140085903","type":"icon-start","x":625,"y":145,"properties":{},"zIndex":1002,"text":{"x":625,"y":145,"value":"起始"}},{"id":"16e18308-7517-4162-8b32-a877b7cf42a0","type":"icon-card","x":325,"y":445,"properties":{},"zIndex":1002},{"id":"5c492b0d-092d-4d84-bd70-4d5734de9266","type":"icon-select","x":970,"y":510,"properties":{},"zIndex":1002}],
+    //"edges":[],
+    //"backgroundUrl":"img/bg.ccee1c62.png"
+}
+
+
+/**
+* 离线数据
 **/
 us.offLineMessage = {
     //pageId : us.userOffLineMessage
 }
 
 
+/**
+* 思维网格
+**/
 us.mindNetwork = {
     // mindid: {
     // }
 }
 
+
+/**
+* 同步课堂
+**/
 us.realTimeClass = {
     // mindid: {
     // }
@@ -96,7 +113,7 @@ us.userInfo = function (userid, username) {
 }
 
 /**
-* 用户连接信息类
+* 用户离线数据
 * @param {string} type 用户登录类型
 */
 us.userOffLineMessage = function (type) {
@@ -107,6 +124,7 @@ us.userOffLineMessage = function (type) {
         "excel": [], //excel数据
         "mindNetwork": [], //思维网格数据
         "realTimeClass": [], //实施课堂数据
+        "cscl": [], //未来课堂数据
         "nav": [] //导航模式数据
     }
 }
@@ -121,11 +139,11 @@ us.userOffLineMessage = function (type) {
 **/
 us.message = function (sendid, type, messageinfo) {
     return {
-        id: us.createGuid(), //新生成的guid
-        sendId: sendid, //发送消息人的id.
-        time: new Date(), //发送时间
-        type: type, //类型 俱乐部使用时用us开头,后面带用途。例如us.disk或者us.friend us.word
-        messageInfo: messageinfo //{消息结构} 此处为object  如类型为'us.word' 则消息结构为us.word
+        "id": us.createGuid(), //新生成的guid
+        "sendId": sendid, //发送消息人的id.
+        "time": new Date(), //发送时间
+        "type": type, //类型 俱乐部使用时用us开头,后面带用途。例如us.disk或者us.friend us.word
+        "messageInfo": messageinfo //{消息结构} 此处为object  如类型为'us.word' 则消息结构为us.word
     }
 }
 
@@ -195,10 +213,14 @@ us.server = us.http.createServer(function (requset, response) {
                 case 'getNav':
                     us.getNav(response, _param[0], _param[1], _param[2]);
                     break;
-                //获取文档信息                                                                                                               
+                //获取思维网格信息                                                                                                               
                 case 'getMindNetwork':
                     us.getMindNetwork(response, _param[0], _param[1], _param[2]);
                     break;
+                //获取未来课堂信息                                                                                                               
+                case 'getcscl':
+                    us.getcscl(response, _param[0], _param[1], _param[2]);
+                    break;
                 //获取文档信息                                                                                                               
                 case 'getRealTimeClass':
                     us.getRealTimeClass(response, _param[0], _param[1], _param[2]);
@@ -558,7 +580,7 @@ us.send = function (response, messageinfo) {
     for (i in _messageobj) {
         //console.log(i);
         switch (i) {
-            //word信息交互                                                                                      
+            //思维网格交互                                                                                      
             case "us.mindNetwork":
                 _messagearr = _messageobj[i]; //获取word消息
                 //得到word所有的用户
@@ -577,7 +599,27 @@ us.send = function (response, messageinfo) {
                 //调用群发函数
                 _messagearr[0] && us.broadcast(_messagelist, _messagearr[0].messageInfo.pageId, 'mindNetwork');
                 break;
-            //word信息交互                                                                                      
+            //未来课堂交互                                                                                      
+            case "us.cscl":
+                _messagearr = _messageobj[i]; //获取word消息
+                //得到word所有的用户
+                for (j = 0; j < _messagearr.length; j++) {
+                    //生成发送的消息结构体
+                    _message = us.message(_messagearr[j].sendId, "us.cscl", _messagearr[j].messageInfo);
+                    //添加消息列表
+                    if (_messagelist[_messagearr[j].receiveId]) {
+                        _messagelist[_messagearr[j].receiveId].push(_message);
+                    }
+                    else {
+                        _messagelist[_messagearr[j].receiveId] = [_message];
+                    }
+                    us.cscl[_messagearr[j].receiveId] && us.cscl[_messagearr[j].receiveId].history.push(_message);
+                    us.updatecscl(_message.messageInfo);
+                }
+                //调用群发函数
+                _messagearr[0] && us.broadcast(_messagelist, _messagearr[0].messageInfo.pageId, 'cscl');
+                break;
+            //同步课堂                                                                                      
             case "us.realTimeClass":
                 //console.log("us.realTimeClass");
                 _messagearr = _messageobj[i]; //获取word消息
@@ -671,7 +713,7 @@ us.send = function (response, messageinfo) {
 
 
 /**
-* 更新后台Word内容
+* 更新后台思维网格的内容
 * @param {object} message 消息信息
 */
 us.updatemindNetwork = function (messageInfo) {
@@ -689,6 +731,38 @@ us.updatemindNetwork = function (messageInfo) {
     }
 }
 
+/**
+* 更新后台未来课堂内容
+* @param {object} message 消息信息
+*/
+us.updatecscl = function (messageInfo, classId) {
+    if (us.cscl[classId]) {
+        var i, j, _is;
+        var _obj = us.cscl[classId].content;
+        _obj.backgroundUrl = messageInfo.backgroundUrl;
+        _obj.edges = messageInfo.edges;
+        _obj.nodes = messageInfo.nodes;
+        // for (j = 0; j < messageInfo.edges.length; j++) {
+        //     _is = true;
+        //     for (i = 0; i < _obj.edges.length; i++) {
+        //         if (_obj.edges[i].id == messageInfo.edges[i].id) {
+        //             _obj.edges[i] = messageInfo.edges[i];
+        //             break;
+        //         }
+        //     }
+        // }
+
+        //"nodes":[{"id":"9f6d7459-d376-4c0c-944b-a6b140085903","type":"icon-start","x":625,"y":145,"properties":{},"zIndex":1002,"text":{"x":625,"y":145,"value":"起始"}},{"id":"16e18308-7517-4162-8b32-a877b7cf42a0","type":"icon-card","x":325,"y":445,"properties":{},"zIndex":1002},{"id":"5c492b0d-092d-4d84-bd70-4d5734de9266","type":"icon-select","x":970,"y":510,"properties":{},"zIndex":1002}],
+        //"edges":[],
+        //"backgroundUrl":"img/bg.ccee1c62.png"
+
+
+        // if (_obj) {
+        //     _obj[messageInfo.id] = messageInfo.content;
+        // }
+    }
+}
+
 /**
 * 更新后台实施课堂内容
 * @param {object} message 消息信息
@@ -1326,31 +1400,23 @@ us.broadcast = function (messageinfo, pageid, type) {
         _recievedpageid, //接收用户的页面唯一识别ID
         _issend, // 是否发送
         _userconnect = us.connect; //用户连接池
-    // console.log("1")
-    // console.log(messageinfo)
     for (i in messageinfo) {
         _messageinfo = messageinfo[i]; //记录消息消息
         _users = us[type][i] ? us[type][i].user : {}; //记录用户集合
-        //console.log(_users)
         for (j in _users) { //循环处理每个用户处理 给每个用户集合下的用户发送消息
             _pageids = _users[j]; //记录当前用户在每个端登录的页面唯一识别ID
             for (o = 0; o < _pageids.length; o++) { //循环发送给当前用户在每个端登录的用户
                 _recievedpageid = _pageids[o]; //记录接受者页面唯一识别ID  用于区分是否是发送用户
                 if (_recievedpageid != pageid) { //如果接受用户不等于发送用户则发送消息
-                    // console.log("2")
-                    // console.log(_users[j])
-                    //console.log(_messageinfo);
                     try {
                         _issend = _userconnect[j][_recievedpageid].response.end(JSON.stringify(_messageinfo)); //发送消息
                         if (!_issend) { //如果用户下线了,那么发送消息就会失败
-                            //console.log("3")
                             us.offLineMessage[_recievedpageid].message.push(_messageinfo); //将消息加入用户离线消息中
                         }
                     }
                     catch (e) {
                         console.error(e.message)
                     }
-
                 }
             }
         }
@@ -1881,6 +1947,64 @@ us.addExcel = function (response, excelinfo) {
     response.end('OK'); //返回到前台
 }
 
+
+
+/**
+* 初始化获取未来课堂数据
+* 
+*/
+us.getcscl = function (response, calssid, pageid, userid) {
+    //判断文档是否已在内层中存在
+    if (us.cscl[calssid]) {
+        //如果存在则直接返回内层的文档
+        if (!us.cscl[calssid].user[userid]) {
+            us.cscl[calssid].user[userid] = [pageid];
+        }
+        else {
+            us.cscl[calssid].user[userid].push(pageid);
+        }
+        try {
+            us.offLineMessage[pageid].cscl.indexOf(calssid) == -1 && us.offLineMessage[pageid].cscl.push(calssid); //添加到用户离线消息的连接wrod记录中
+        }
+        catch (e) {
+
+        }
+        //如果不存在则去数据库查找
+        us.mysql.usselect(['172.16.12.5', 'pbl', 'select_room', calssid],
+            function (ret) {
+                if (ret) {
+                    ret[0][0].data = us.cscl[calssid].content; //把思维网格的内容转化成数组
+                    response.end(JSON.stringify(ret)); //返回文档内容
+                }
+                else {
+                    response.end(''); //返回文档内容 
+                }
+            });
+    }
+    else {
+        us.cscl[calssid] = {
+            user: {},
+            history: []
+        };
+        us.cscl[calssid].user[userid] = [pageid];
+        if (us.offLineMessage[pageid]) {
+            us.offLineMessage[pageid].cscl.indexOf(calssid) == -1 && us.offLineMessage[pageid].cscl.push(calssid); //添加到用户离线消息的连接wrod记录中
+        }
+        //如果不存在则去数据库查找
+        us.mysql.usselect(['172.16.12.5', 'pbl', 'select_room', calssid],
+            function (ret) {
+                if (ret) {
+                    us.cscl[calssid].content = JSON.parse(ret[0][0].data); //把思维网格的内容转化成数组
+                    response.end(JSON.stringify(ret)); //返回文档内容
+                }
+                else {
+                    us.cscl[calssid].content = []; //创建一个空数组
+                    response.end(''); //返回文档内容 
+                }
+            });
+    }
+}
+
 /**
 * 获取思维网格数据,转成成数组
 * 

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.