Explorar o código

Merge branch 'beta'

lsc hai 1 ano
pai
achega
4f4e8e4511
Modificáronse 5 ficheiros con 111 adicións e 1 borrados
  1. BIN=BIN
      img/icon/gpt4.png
  2. 4 1
      js/Controls/Basic.js
  3. 0 0
      js/Controls/Basic.min.js
  4. 14 0
      js/Desktop/DeskTop.js
  5. 93 0
      touchevent.js

BIN=BIN
img/icon/gpt4.png


+ 4 - 1
js/Controls/Basic.js

@@ -2039,6 +2039,7 @@ U.UF.UI.form.prototype = {
                     "title": "点击关闭",
                     "onmousedown": U.UF.EV.stopBubble,
                     "onclick": U.UF.C.apply(this, function () {
+                        this.windowstate = "close";
                         U.UF.F.closeWindow(this.form); //调用窗体关闭函数
                         try {
                             //关闭任务栏处理
@@ -2066,6 +2067,7 @@ U.UF.UI.form.prototype = {
                     "onmousedown": U.UF.EV.stopBubble,
                     //最大化点击事件处理
                     "onclick": function () {
+                        this.windowstate = "max";
                         U.UF.F.windowZooming(_formel); //调用窗体最大化函数
                     }
                 }, _headbottom);
@@ -2093,6 +2095,7 @@ U.UF.UI.form.prototype = {
                     "title": "最小化",
                     "onmousedown": U.UF.EV.stopBubble,
                     "onclick": U.UF.C.apply(this, function () {
+                        this.windowstate = "min";
                         U.UF.F.windowMinimize(_formel); //窗体最小化处理
                         //回调处理
                         if (U.UF.C.isFunction(this.narrowcallback)) {
@@ -2114,7 +2117,7 @@ U.UF.UI.form.prototype = {
         }
         else {
             //有特殊关闭处理的,需要重新加载
-            if (this.closecallback) {
+            if (this.closecallback && this.windowstate == "close") {
                 try {
                     if (this.content.tagName == "IFRAME") {
                         this.content.src += '';

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
js/Controls/Basic.min.js


+ 14 - 0
js/Desktop/DeskTop.js

@@ -1352,6 +1352,7 @@ U.MD.D.I.initDesktopIcons = function (el, type) {
             { "Name": "数据看板", "Url": "dataBoard", "style": { "cssText": "background-image:url(/img/icon/dataBoard.png)" } },
             { "Name": "评测管理", "Url": "testTeacher", "style": { "cssText": "background-image:url(/img/icon/testTeacher.png)" } },
             { "Name": "评测中心", "Url": "testStudent", "style": { "cssText": "background-image:url(/img/icon/testStudent.png)" } },
+            { "Name": "gpt4 turbo", "Url": "gpt4", "style": { "cssText": "background-image:url(/img/icon/gpt4.png)" } },
             // { "Name": "综合看板", "Url": "dataBoardNew", "style": { "cssText": "background-image:url(/img/icon/dataBoardNew.png)" } },
         )
     }
@@ -4729,6 +4730,19 @@ U.MD.D.I.openApplication = function (str, obj, info) {
             }, { "style": { "height": "36px" } }).form; //创建窗体
             _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/AIChat.png)" }, "name": "AI协同", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj, info); } }
 
+            break;
+        case "gpt4": //gpt4
+            _formdiv = new U.UF.UI.form(
+                "gpt4 turbo",
+                $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://cloud.cocorobo.cn/gpt4/" }), {
+                "id": "ainew",
+                "style": { "width": "100%", "height": "100%", "overflow": 'hidden' },
+                "onresize": function () { }
+            }, {
+                closecallback: function () { }
+            }, { "style": { "height": "36px" } }).form; //创建窗体
+            _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/gpt4.png)" }, "name": "gpt4 turbo", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj, info); } }
+
             break;
         case "futureClass": //AI共创
             _formdiv = new U.UF.UI.form(

+ 93 - 0
touchevent.js

@@ -27,4 +27,97 @@ function init() {
     document.addEventListener("touchmove", touchHandler, true);
     document.addEventListener("touchend", 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);
+    //     }
+    // };
 }

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio