lsc 2 years ago
parent
commit
02d42e595b
5 changed files with 132 additions and 2 deletions
  1. 50 0
      css/gm/Desktop.css
  2. 14 0
      gm.html
  3. BIN
      img/icon/gm/examine.png
  4. 30 1
      js/Desktop/Onload.js
  5. 38 1
      js/gm/DeskTop.js

+ 50 - 0
css/gm/Desktop.css

@@ -391,6 +391,56 @@ body div ::-webkit-scrollbar-resizer:vertical {
     display: block;
 }
 
+.U_MD_D_BD_notice {
+    display: none;
+    padding: 5px 10px;
+    background-color: #00000085;
+    position: absolute;
+    right: 0;
+    top: 50px;
+    border-radius: 3px;
+    width: 300px;
+}
+
+.U_MD_D_BD_noticeBox {
+    padding: 5px 0;
+    width: 100%;
+    box-sizing: border-box;
+    font-size: 15px;
+    cursor: pointer;
+}
+
+.U_MD_D_BD_noticeBox_title {
+    width: 100%;
+    display: flex;
+}
+
+.U_MD_D_BD_noticeBox_title>span:nth-child(1) {
+    color: #979797;
+}
+
+.U_MD_D_BD_noticeBox_title>span:nth-child(2) {
+    margin-left: 8px;
+    width: calc(100% - 68px);
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    word-break: break-word;
+}
+
+.U_MD_D_BD_noticeBox_content {
+    margin-top: 5px;
+    width: 100%;
+    display: flex;
+}
+.U_MD_D_BD_noticeBox_content span{
+    width: calc(100%);
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    word-break: break-word;
+}
+
 .U_MD_D_BZMD {
     position: relative;
 }

+ 14 - 0
gm.html

@@ -114,6 +114,20 @@
                     <div class="U_MD_D_BD_QRcodeShare">
                         <img class="U_MD_D_BD_QRcodeShareImg" src="./img/QRcodeShare.png" alt="Alternate Text" />
                     </div>
+                    <div class="U_MD_D_BD_notice">
+                        <!-- <div class="U_MD_D_BD_noticeBox">
+                            <div class="U_MD_D_BD_noticeBox_title"><span>消息通知</span><span>相向而行,幸福光明</span></div>
+                            <div class="U_MD_D_BD_noticeBox_content"><span>相向而行,幸福光明</span></div>
+                        </div>
+                        <div class="U_MD_D_BD_noticeBox">
+                            <div class="U_MD_D_BD_noticeBox_title"><span>消息通知</span><span>新项目:巧“焊”天工</span></div>
+                            <div class="U_MD_D_BD_noticeBox_content"><span>成功发布了,快去学习中心看看吧。</span></div>
+                        </div>
+                        <div class="U_MD_D_BD_noticeBox">
+                            <div class="U_MD_D_BD_noticeBox_title"><span>消息通知</span><span>新项目:巧“焊”天工</span></div>
+                            <div class="U_MD_D_BD_noticeBox_content"><span>成功发布了,快去学习中心看看吧。</span></div>
+                        </div> -->
+                    </div>
                 </div>
                 <div class="U_MD_D_B" __top__="false" id="U_MD_D_B">
                     <div class="U_MD_D_BZ" onclick="U.MD.D.A.aboutUs();">

BIN
img/icon/gm/examine.png


+ 30 - 1
js/Desktop/Onload.js

@@ -37,7 +37,6 @@ window.onload = function () {
     //U.MD.D.isLogin();
     // U.MD.D.fullscreen();
     U.MD.D.stopSafari();
-
     // window.addEventListener('resize', () => {
     //     var realHeight = window.innerHeight
     //     var realWidth = window.innerWidth
@@ -363,6 +362,7 @@ U.MD.D.getuser = function () {
                                         $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/csteamBg.png")'
                                     } else if (res.value[0][0].org == 'eb2af5e9-ac3d-46b6-9fe3-3c1c364f0217') {
                                         $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gm/bg.png")'
+                                        U.MD.D.getNotice();
                                     } else if (res.value[0][0].org == '97c4ee8b-d010-4042-986d-e9d3c217264f') {
                                         $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/zhoujia.jpg")'
                                     }
@@ -417,6 +417,7 @@ U.MD.D.getuser = function () {
             $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/csteamBg.png")'
         } else if (userInfo.org == 'eb2af5e9-ac3d-46b6-9fe3-3c1c364f0217') {
             $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gm/bg.png")'
+            U.MD.D.getNotice();
         } else if (userInfo.org == '97c4ee8b-d010-4042-986d-e9d3c217264f') {
             $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/zhoujia.jpg")'
         }
@@ -480,4 +481,32 @@ U.MD.D.stopSafari = function () {
     document.documentElement.addEventListener("gesturestart", function (event) {
         event.preventDefault();
     });
+}
+
+U.MD.D.getNotice = function () {
+    // a77e9404-efec-11e9-96f9-028edca3b798&oid=45facc0a-1211-11ec-80ad-005056b86db5&org=undefined&role=1
+    var uid = 'a77e9404-efec-11e9-96f9-028edca3b798',
+        oid = '45facc0a-1211-11ec-80ad-005056b86db5',
+        org = 'undefined';
+    U.A.Request(US.Config.pbl + "selectNotice?uid=" + uid + "&oid=" + oid + "&org=" + org + "&page=1", [], function (res) {
+        if (res.value && res.value[0].length > 0) {
+            let box = $('U_MD_D_BD_notice')[0]
+            let _res = res.value[0]
+            box.style.display = 'block'
+            box.innerHTML = ''
+            for (var i = 0; i < _res.length; i++) {
+                var _box = $$('div', { className: 'U_MD_D_BD_noticeBox' }, box)
+                var _title = $$('div', { className: 'U_MD_D_BD_noticeBox_title' }, _box)
+                $$('span', { innerHTML: '消息通知' }, _title)
+                $$('span', { innerHTML: _res[i].title }, _title)
+                var _content = $$('div', { className: '_content' }, _box)
+                $$('span', { innerHTML:  _res[i].content.replace(/<[^>]*>/g, "") }, _title)
+            }
+        } else {
+            $('U_MD_D_BD_notice')[0].style.display = 'none'
+        }
+        setTimeout(() => {
+            U.MD.D.getNotice();
+        }, 5000);
+    }, [], { "type": "GET", "withCredentials": true });
 }

+ 38 - 1
js/gm/DeskTop.js

@@ -137,6 +137,7 @@ U.MD.D.I.GMteacherDeskIcon = [
     { "Name": "班级管理", "Url": "classGM", "style": { "cssText": "background-image:url(/img/icon/gm/class.png)" } },
     { "Name": "我的资料", "Url": "dataGM", "style": { "cssText": "background-image:url(/img/icon/gm/data.png)" } },
     { "Name": "素材库", "Url": "meterialGM", "style": { "cssText": "background-image:url(/img/icon/gm/material.png)" } },
+    { "Name": "消息通知", "Url": "messageGM", "style": { "cssText": "background-image:url(/img/icon/gm/message.png)" } },
 ];
 
 U.MD.D.I.GMorganizerDeskIcon = [
@@ -150,6 +151,8 @@ U.MD.D.I.GMorganizerDeskIcon = [
     { "Name": "教师管理", "Url": "teacherGM", "style": { "cssText": "background-image:url(/img/icon/gm/teacher.png)" } },
     { "Name": "我的资料", "Url": "dataGM", "style": { "cssText": "background-image:url(/img/icon/gm/data.png)" } },
     { "Name": "素材库", "Url": "meterialGM", "style": { "cssText": "background-image:url(/img/icon/gm/material.png)" } },
+    { "Name": "项目审核", "Url": "examineGM", "style": { "cssText": "background-image:url(/img/icon/gm/examine.png)" } },
+    { "Name": "消息通知", "Url": "messageGM", "style": { "cssText": "background-image:url(/img/icon/gm/message.png)" } },
 ];
 
 U.MD.D.I.GMstudentDeskIcon = [
@@ -157,6 +160,7 @@ U.MD.D.I.GMstudentDeskIcon = [
     { "Name": "我的评价", "Url": "evaluateSGM", "style": { "cssText": "background-image:url(/img/icon/gm/evaluate.png)" } },
     { "Name": "我的资料", "Url": "dataGM", "style": { "cssText": "background-image:url(/img/icon/gm/data.png)" } },
     { "Name": "素材库", "Url": "meterialGM", "style": { "cssText": "background-image:url(/img/icon/gm/material.png)" } },
+    { "Name": "消息通知", "Url": "messageGM", "style": { "cssText": "background-image:url(/img/icon/gm/message.png)" } },
 ];
 
 U.MD.D.I.teacherDeskIcon = [
@@ -622,7 +626,7 @@ window.addEventListener('message', function (e) { // 监听 message 事件
         //3是展示全部阶段  2学生 1老师 4专家
     } else if (e.data.screenType && e.data.screenType == "3") { //项目管理传入
         U.MD.D.I.openInApplication("studyDetail", e.data.cid, 2, 1)
-    } if (e.data.screenType && e.data.screenType == "2gm") { //项目管理传入
+    } else if (e.data.screenType && e.data.screenType == "2gm") { //项目管理传入
         U.MD.D.I.openInApplication("studyDetailGM", e.data.cid, e.data.screenType, 4)
         //3是展示全部阶段  2学生 1老师 4专家
     } else if (e.data.screenType && e.data.screenType == "3gm") { //项目管理传入
@@ -813,6 +817,7 @@ U.MD.D.I.openApplication = function (str, obj, info) {
         _oid = obj.organizeid || _userinfo.organizeid,
         _type = US.userInfo.type,
         _org = US.userInfo.org,
+        _role = US.userInfo.role,
         _classId = US.userInfo.classid,
         _TscreenType = 1
     _screenType = 2,
@@ -2092,7 +2097,39 @@ U.MD.D.I.openApplication = function (str, obj, info) {
             window.open("https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/teacherGM?userid=" + _userid + "&oid=" + _oid + "&org=" + _org, "教师管理", "height=" + US.height + ", width=" + US.width + ", top=100, left=100, toolbar=no, menubar=0,  resizable=0, location=0, status=no");
 
             break;
+        case "examineGM": //教师管理
+            // _formdiv = new U.UF.UI.form(
+            //     "项目审核",
+            //     $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/examineGM?userid=" + _userid + "&oid=" + _oid + "&org=" + _org }), {
+            //     "id": "examineGM",
+            //     "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
+            //     "onresize": function () { }
+            // }, {
+            //     closecallback: function () { }
+            // }, { "style": { "height": "36px" } }).form; //创建窗体
+            // _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/gm/examine.png)" }, "name": "项目审核", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj, info); } }
+
+
+            window.open("https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/examineGM?userid=" + _userid + "&oid=" + _oid + "&org=" + _org, "项目审核", "height=" + US.height + ", width=" + US.width + ", top=100, left=100, toolbar=no, menubar=0,  resizable=0, location=0, status=no");
+
+            break;
+        case "messageGM": //消息通知
+            // _formdiv = new U.UF.UI.form(
+            //     "消息通知",
+            //     $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/noticeGM?userid=" + _userid + "&oid=" + _oid + "&org=" + _org + "&role=" + _role }), {
+            //     "id": "messageGM",
+            //     "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
+            //     "onresize": function () { }
+            // }, {
+            //     closecallback: function () { }
+            // }, { "style": { "height": "36px" } }).form; //创建窗体
+            // _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/gm/examine.png)" }, "name": "消息通知", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj, info); } }
+
 
+            window.open("https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/noticeGM?userid=" + _userid + "&oid=" + _oid + "&org=" + _org + "&role=" + _role, "消息通知", "height=" + US.height + ", width=" + US.width + ", top=100, left=100, toolbar=no, menubar=0,  resizable=0, location=0, status=no");
+
+            break;
+            
     }