Browse Source

Merge branch 'beta' into HK

lsc 1 year ago
parent
commit
99636b9b1c
2 changed files with 115 additions and 17 deletions
  1. 22 17
      js/Desktop/DeskTop.js
  2. 93 0
      touchevent.js

+ 22 - 17
js/Desktop/DeskTop.js

@@ -186,12 +186,13 @@ U.MD.D.I.schoolDeskIcon = [
 ];
 ];
 
 
 U.MD.D.I.orgDeskIcon = [
 U.MD.D.I.orgDeskIcon = [
-    { "Name": "課程管理", "Url": "project", "style": { "cssText": "background-image:url(/img/icon/orgIcon/orgProject.png)" } },
-    { "Name": "課程中心", "Url": "study", "style": { "cssText": "background-image:url(/img/icon/orgIcon/orgStudy.png)" } },
-    { "Name": "學生評價", "Url": "evaluate", "style": { "cssText": "background-image:url(/img/icon/orgIcon/orgEva.png)" } },
-    { "Name": "課程進展", "Url": "case", "style": { "cssText": "background-image:url(/img/icon/orgIcon/orgCase.png)" } },
-    { "Name": "教學資源", "Url": "source", "style": { "cssText": "background-image:url(/img/icon/source.png)" } },
-    { "Name": "AI協同", "Url": "ainew", "style": { "cssText": "background-image:url(/img/icon/AIChat.png)" } },
+    { "Name": "课程管理", "Url": "project", "style": { "cssText": "background-image:url(/img/icon/orgIcon/orgProject.png)" } },
+    { "Name": "课程中心", "Url": "study", "style": { "cssText": "background-image:url(/img/icon/orgIcon/orgStudy.png)" } },
+    { "Name": "学生评价", "Url": "evaluate", "style": { "cssText": "background-image:url(/img/icon/orgIcon/orgEva.png)" } },
+    { "Name": "课程进展", "Url": "case", "style": { "cssText": "background-image:url(/img/icon/orgIcon/orgCase.png)" } },
+    { "Name": "教学资源", "Url": "source", "style": { "cssText": "background-image:url(/img/icon/source.png)" } },
+    { "Name": "AI协同", "Url": "ainew", "style": { "cssText": "background-image:url(/img/icon/AIChat.png)" } },
+    { "Name": "AI共创", "Url": "AIChat", "style": { "cssText": "background-image:url(/img/icon/AIChat.png)" } },
     // { "Name": "jupyter", "Url": "jupyter", "style": { "cssText": "background-image:url(/img/icon/jupyter.png)" } },
     // { "Name": "jupyter", "Url": "jupyter", "style": { "cssText": "background-image:url(/img/icon/jupyter.png)" } },
     { "Name": "協同建構", "Url": "futureClass", "style": { "cssText": "background-image:url(/img/icon/futureClass.png)" } },
     { "Name": "協同建構", "Url": "futureClass", "style": { "cssText": "background-image:url(/img/icon/futureClass.png)" } },
     { "Name": "綜合看板", "Url": "dataBoardNew", "style": { "cssText": "background-image:url(/img/icon/dataBoardNew.png)" } },
     { "Name": "綜合看板", "Url": "dataBoardNew", "style": { "cssText": "background-image:url(/img/icon/dataBoardNew.png)" } },
@@ -676,12 +677,14 @@ U.MD.D.I.gdjgTeacherDeskIcon = [
     { "Name": "項目中心", "Url": "studentIndex", "style": { "cssText": "background-image:url(/img/icon/studentIndex.png)" } },
     { "Name": "項目中心", "Url": "studentIndex", "style": { "cssText": "background-image:url(/img/icon/studentIndex.png)" } },
     { "Name": "工作管理", "Url": "studioCourse", "style": { "cssText": "background-image:url(/img/icon/studioCourse.png)" } },
     { "Name": "工作管理", "Url": "studioCourse", "style": { "cssText": "background-image:url(/img/icon/studioCourse.png)" } },
     { "Name": "工作中心", "Url": "studioIndex", "style": { "cssText": "background-image:url(/img/icon/studioIndex.png)" } },
     { "Name": "工作中心", "Url": "studioIndex", "style": { "cssText": "background-image:url(/img/icon/studioIndex.png)" } },
-    { "Name": "教學資源", "Url": "source", "style": { "cssText": "background-image:url(/img/icon/source.png)" } },
-    // { "Name": "學生管理", "Url": "student", "style": { "cssText": "background-image:url(/img/icon/student.png)" } },
-    // { "Name": "學習分析", "Url": "learnAna", "style": { "cssText": "background-image:url(/img/icon/learnAna.png)" } },
-    { "Name": "AI共創", "Url": "AIChat", "style": { "cssText": "background-image:url(/img/icon/AIChat.png)" } },
-    { "Name": "協同建構", "Url": "futureClass", "style": { "cssText": "background-image:url(/img/icon/futureClass.png)" } },
-    { "Name": "綜合看板", "Url": "dataBoardNew", "style": { "cssText": "background-image:url(/img/icon/dataBoardNew.png)" } },
+    { "Name": "教学资源", "Url": "source", "style": { "cssText": "background-image:url(/img/icon/source.png)" } },
+    // { "Name": "学生管理", "Url": "student", "style": { "cssText": "background-image:url(/img/icon/student.png)" } },
+    // { "Name": "学习分析", "Url": "learnAna", "style": { "cssText": "background-image:url(/img/icon/learnAna.png)" } },
+    { "Name": "AI共创", "Url": "AIChat", "style": { "cssText": "background-image:url(/img/icon/AIChat.png)" } },
+    { "Name": "AI协同", "Url": "ainew", "style": { "cssText": "background-image:url(/img/icon/AIChat.png)" } },
+    { "Name": "AI Agent", "Url": "aiagent", "style": { "cssText": "background-image:url(/img/icon/AIprogram2.png)" } },
+    { "Name": "协同建构", "Url": "futureClass", "style": { "cssText": "background-image:url(/img/icon/futureClass.png)" } },
+    { "Name": "综合看板", "Url": "dataBoardNew", "style": { "cssText": "background-image:url(/img/icon/dataBoardNew.png)" } },
 ];
 ];
 
 
 //gdjg
 //gdjg
@@ -692,11 +695,13 @@ U.MD.D.I.gdjgAdminDeskIcon = [
     { "Name": "項目中心", "Url": "studentIndex", "style": { "cssText": "background-image:url(/img/icon/studentIndex.png)" } },
     { "Name": "項目中心", "Url": "studentIndex", "style": { "cssText": "background-image:url(/img/icon/studentIndex.png)" } },
     { "Name": "工作管理", "Url": "studioCourse", "style": { "cssText": "background-image:url(/img/icon/studioCourse.png)" } },
     { "Name": "工作管理", "Url": "studioCourse", "style": { "cssText": "background-image:url(/img/icon/studioCourse.png)" } },
     { "Name": "工作中心", "Url": "studioIndex", "style": { "cssText": "background-image:url(/img/icon/studioIndex.png)" } },
     { "Name": "工作中心", "Url": "studioIndex", "style": { "cssText": "background-image:url(/img/icon/studioIndex.png)" } },
-    { "Name": "教學資源", "Url": "source", "style": { "cssText": "background-image:url(/img/icon/source.png)" } },
-    { "Name": "課程進展", "Url": "case", "style": { "cssText": "background-image:url(/img/icon/case.png)" } },
-    { "Name": "AI共創", "Url": "AIChat", "style": { "cssText": "background-image:url(/img/icon/AIChat.png)" } },
-    { "Name": "協同建構", "Url": "futureClass", "style": { "cssText": "background-image:url(/img/icon/futureClass.png)" } },
-    { "Name": "綜合看板", "Url": "dataBoardNew", "style": { "cssText": "background-image:url(/img/icon/dataBoardNew.png)" } },
+    { "Name": "教学资源", "Url": "source", "style": { "cssText": "background-image:url(/img/icon/source.png)" } },
+    { "Name": "课程进展", "Url": "case", "style": { "cssText": "background-image:url(/img/icon/case.png)" } },
+    { "Name": "AI共创", "Url": "AIChat", "style": { "cssText": "background-image:url(/img/icon/AIChat.png)" } },
+    { "Name": "AI协同", "Url": "ainew", "style": { "cssText": "background-image:url(/img/icon/AIChat.png)" } },
+    { "Name": "AI Agent", "Url": "aiagent", "style": { "cssText": "background-image:url(/img/icon/AIprogram2.png)" } },
+    { "Name": "协同建构", "Url": "futureClass", "style": { "cssText": "background-image:url(/img/icon/futureClass.png)" } },
+    { "Name": "综合看板", "Url": "dataBoardNew", "style": { "cssText": "background-image:url(/img/icon/dataBoardNew.png)" } },
 ];
 ];
 
 
 //hk
 //hk

+ 93 - 0
touchevent.js

@@ -27,4 +27,97 @@ function init() {
     document.addEventListener("touchmove", touchHandler, true);
     document.addEventListener("touchmove", touchHandler, true);
     document.addEventListener("touchend", touchHandler, true);
     document.addEventListener("touchend", touchHandler, true);
     document.addEventListener("touchcancel", touchHandler, true);
     document.addEventListener("touchcancel", touchHandler, true);
+
+
+    HTMLElement.prototype.__defineGetter__("ondblclick", function () {
+        return this.doubleTap;
+    });
+
+    HTMLElement.prototype.__defineSetter__("ondblclick", function (fun) {
+        this.doubleTap = fun;
+        $(this).on("doubleTap", fun)
+    });
+    var eventlstener = HTMLElement.prototype.addEventListener;
+
+    HTMLElement.prototype.addEventListener = function (type, fun, op) {
+        if (type == "click") {
+            eventlstener.call(this, type, function (e) {
+                if (!this.startTime) {
+                    this.startTime = new Date().getTime();
+                    fun.call(this);
+                }
+                else {
+                    const time = new Date().getTime() - this.startTime;
+                    this.startTime = new Date().getTime();
+                    if (time > 200) {
+                        fun.call(this);
+                    }
+                    else {
+                        e.detail = 2;
+                        fun.call(this);
+                    }
+                }
+
+            }, op);
+        }
+        else {
+            eventlstener.apply(this, arguments);
+        }
+    }
+
+
+    // handleClick = (e: MouseEvent) => {
+    //     // 节点拖拽进画布之后,不触发click事件相关emit
+    //     // 点拖拽进画布没有触发mousedown事件,没有startTime,用这个值做区分
+    //     if (!this.startTime) return;
+    //     const time = new Date().getTime() - this.startTime;
+    //     if (time > 200) return; // 事件大于200ms,认为是拖拽, 不触发click事件。
+    //     const { model, graphModel } = this.props;
+    //     // 节点数据,多为事件对象数据抛出
+    //     const nodeData = model.getData();
+    //     const position = graphModel.getPointByClient({
+    //         x: e.clientX,
+    //         y: e.clientY,
+    //     });
+
+    //     const eventOptions: EventArgs = {
+    //         data: nodeData,
+    //         e,
+    //         position,
+    //         isSelected: false,
+    //         isMultiple: false,
+    //     };
+
+    //     const isRightClick = e.button === 2;
+    //     // 这里 IE 11不能正确显示
+    //     const isDoubleClick = e.detail === 2;
+
+    //     // 判断是否有右击,如果有右击则取消点击事件触发
+    //     if (isRightClick) return;
+
+    //     const { editConfigModel } = graphModel;
+    //     // 在multipleSelect tool禁用的情况下,允许取消选中节点
+    //     const isMultiple = isMultipleSelect(e, editConfigModel);
+    //     eventOptions.isMultiple = isMultiple;
+    //     if (model.isSelected && !isDoubleClick && isMultiple) {
+    //         eventOptions.isSelected = false;
+    //         model.setSelected(false);
+    //     } else {
+    //         graphModel.selectNodeById(model.id, isMultiple);
+    //         eventOptions.isSelected = true;
+    //         this.toFront();
+    //     }
+
+    //     // 不是双击的,默认都是单击
+    //     if (isDoubleClick) {
+    //         if (editConfigModel.nodeTextEdit && model.text.editable) {
+    //             model.setSelected(false);
+    //             graphModel.setElementStateById(model.id, ElementState.TEXT_EDIT);
+    //         }
+    //         graphModel.eventCenter.emit(EventType.NODE_DBCLICK, eventOptions);
+    //     } else {
+    //         graphModel.eventCenter.emit(EventType.ELEMENT_CLICK, eventOptions);
+    //         graphModel.eventCenter.emit(EventType.NODE_CLICK, eventOptions);
+    //     }
+    // };
 }
 }