Browse Source

修正首页面展现一些BUG

huqi 5 years ago
parent
commit
03cadbbb02

+ 1 - 0
o2web/source/o2_core/o2/lp/zh-cn.js

@@ -123,6 +123,7 @@ o2.LP.process = {
     }
 };
 o2.LP.desktop = {
+    "homepage": "首页",
     "loadding": "正在为您加载系统资源,请稍候......",
     "lowBrowser": "您的浏览器版本过低啦!~系统已经不支持IE8及以下版本了!",
     "upgradeBrowser": "请升级您的浏览器:",

+ 7 - 0
o2web/source/o2_core/o2/o2.more.js

@@ -517,6 +517,13 @@
             h += (this.getStyle("padding-top").toFloat() || 0)+ (this.getStyle("padding-bottom").toFloat() || 0);
             if (!notMargin) h += (this.getStyle("margin-top").toFloat() || 0)+ (this.getStyle("margin-bottom").toFloat() || 0);
             return h;
+        },
+        "getEdgeWidth": function(notMargin){
+            var h = 0;
+            h += (this.getStyle("border-left-width").toFloat() || 0)+ (this.getStyle("border-right-width").toFloat() || 0);
+            h += (this.getStyle("padding-left").toFloat() || 0)+ (this.getStyle("padding-right").toFloat() || 0);
+            if (!notMargin) h += (this.getStyle("margin-left").toFloat() || 0)+ (this.getStyle("margin-right").toFloat() || 0);
+            return h;
         }
     });
     Object.copy = function(from, to){

+ 1 - 1
o2web/source/o2_core/o2/widget/$Menu/flatStyle/css.wcss

@@ -22,7 +22,7 @@
 		"border-radius": "2px",
 		"background-color": "#FFF",
 		"padding": "0px",
-		"overflow": "hidden",
+		"overflow": "auto",
 		"cursor": "default"
 	},
 	"menuItem": {

+ 4 - 2
o2web/source/o2_core/o2/xDesktop/$Default/blue/style-pc.css

@@ -159,7 +159,9 @@
     background-size: cover;
     border-radius: 20px;
 }
-.layout_content_taskbar_area_user_text {}
+.layout_content_taskbar_area_user_text {
+    display: inline-block;
+}
 
 .layout_content_taskbar_area_action {
     height: 70px;
@@ -179,7 +181,7 @@
     cursor: pointer;
 }
 .layout_content_taskbar_area_action_msg {
- }
+}
 .layout_content_taskbar_area_action_skin {
 }
 .layout_content_taskbar_area_action_skin_focus {

+ 3 - 1
o2web/source/o2_core/o2/xDesktop/$Default/cyan/style-pc.css

@@ -159,7 +159,9 @@
     background-size: cover;
     border-radius: 20px;
 }
-.layout_content_taskbar_area_user_text {}
+.layout_content_taskbar_area_user_text {
+    display: inline-block;
+}
 
 .layout_content_taskbar_area_action {
     height: 70px;

+ 3 - 1
o2web/source/o2_core/o2/xDesktop/$Default/darkgreen/style-pc.css

@@ -159,7 +159,9 @@
     background-size: cover;
     border-radius: 20px;
 }
-.layout_content_taskbar_area_user_text {}
+.layout_content_taskbar_area_user_text {
+    display: inline-block;
+}
 
 .layout_content_taskbar_area_action {
     height: 70px;

+ 3 - 1
o2web/source/o2_core/o2/xDesktop/$Default/gray/style-pc.css

@@ -159,7 +159,9 @@
     background-size: cover;
     border-radius: 20px;
 }
-.layout_content_taskbar_area_user_text {}
+.layout_content_taskbar_area_user_text {
+    display: inline-block;
+}
 
 .layout_content_taskbar_area_action {
     height: 70px;

+ 3 - 1
o2web/source/o2_core/o2/xDesktop/$Default/green/style-pc.css

@@ -159,7 +159,9 @@
     background-size: cover;
     border-radius: 20px;
 }
-.layout_content_taskbar_area_user_text {}
+.layout_content_taskbar_area_user_text {
+    display: inline-block;
+}
 
 .layout_content_taskbar_area_action {
     height: 70px;

+ 3 - 1
o2web/source/o2_core/o2/xDesktop/$Default/navy/style-pc.css

@@ -159,7 +159,9 @@
     background-size: cover;
     border-radius: 20px;
 }
-.layout_content_taskbar_area_user_text {}
+.layout_content_taskbar_area_user_text {
+    display: inline-block;
+}
 
 .layout_content_taskbar_area_action {
     height: 70px;

+ 3 - 1
o2web/source/o2_core/o2/xDesktop/$Default/orange/style-pc.css

@@ -159,7 +159,9 @@
     background-size: cover;
     border-radius: 20px;
 }
-.layout_content_taskbar_area_user_text {}
+.layout_content_taskbar_area_user_text {
+    display: inline-block;
+}
 
 .layout_content_taskbar_area_action {
     height: 70px;

+ 3 - 1
o2web/source/o2_core/o2/xDesktop/$Default/purple/style-pc.css

@@ -159,7 +159,9 @@
     background-size: cover;
     border-radius: 20px;
 }
-.layout_content_taskbar_area_user_text {}
+.layout_content_taskbar_area_user_text {
+    display: inline-block;
+}
 
 .layout_content_taskbar_area_action {
     height: 70px;

+ 3 - 1
o2web/source/o2_core/o2/xDesktop/$Default/red/style-pc.css

@@ -159,7 +159,9 @@
     background-size: cover;
     border-radius: 20px;
 }
-.layout_content_taskbar_area_user_text {}
+.layout_content_taskbar_area_user_text {
+    display: inline-block;
+}
 
 .layout_content_taskbar_area_action {
     height: 70px;

+ 3 - 1
o2web/source/o2_core/o2/xDesktop/$Default/tan/style-pc.css

@@ -159,7 +159,9 @@
     background-size: cover;
     border-radius: 20px;
 }
-.layout_content_taskbar_area_user_text {}
+.layout_content_taskbar_area_user_text {
+    display: inline-block;
+}
 
 .layout_content_taskbar_area_action {
     height: 70px;

+ 32 - 4
o2web/source/o2_core/o2/xDesktop/Default.js

@@ -200,14 +200,39 @@ o2.xDesktop.Default = new Class({
 
     loadDefaultPage: function(){
         //默认载入首页
+        var app;
         if (layout.config.indexPage && layout.config.indexPage.enable && layout.config.indexPage.portal){
             appId = "portal.Portal"+layout.config.indexPage.portal;
             this.options.index = appId;
-            var options = {"portalId": layout.config.indexPage.portal, "pageId": layout.config.indexPage.page, "appId": appId};
-            layout.openApplication(null, "portal.Portal", options);
+            //var options = {"portalId": layout.config.indexPage.portal, "pageId": layout.config.indexPage.page, "appId": appId};
+
+            app = {
+                "options": {"name": "portal.Portal", "portalId": layout.config.indexPage.portal, "pageId": layout.config.indexPage.page, "appId": appId},
+                "close": function(){
+                    this.taskitem.destroy();
+                },
+                "setCurrent": function(){
+                    this.taskitem.textNode.click();
+                }
+            };
+            //layout.openApplication(null, "portal.Portal", options);
         }else{
-            layout.openApplication(null, "Homepage");
+            app = {
+                "options": {"name": "Homepage", "appId": "Homepage", "title": o2.LP.desktop.homepage},
+                "close": function(){
+                    this.taskitem.destroy();
+                },
+                "setCurrent": function(){
+                    this.taskitem.textNode.click();
+                }
+            };
+            //layout.openApplication(null, "Homepage");
         }
+
+        taskitem = layout.desktop.createTaskItem(app);
+        app.taskitem = taskitem;
+        this.apps[app.options.appId] = app;
+        taskitem.textNode.click();
     },
     loadDefaultLnk: function(){
         if (this.status && this.status.flatLnks && this.status.flatLnks.length){
@@ -1652,7 +1677,7 @@ o2.xDesktop.Default.TaskItem = new Class({
     load: function(){
         this.node = new Element("div.layout_content_taskbar_item").inject(this.container);
         this.iconNode = new Element("div");
-        this.closeNode = new Element("div.layout_content_taskbar_item_icon", {"title": o2.LP.widget.close}).inject(this.node);;
+        this.closeNode = new Element("div.layout_content_taskbar_item_icon", {"title": o2.LP.widget.close}).inject(this.node);
         this.closeNode.addClass("icon_close");
         if (this.app.options.appId==this.desktop.options.index){
             this.closeNode.hide();
@@ -1718,6 +1743,8 @@ o2.xDesktop.Default.TaskItem = new Class({
                 this.app.refresh();
             }.bind(this)
         });
+
+        if (this.desktop && this.desktop.checkTaskBarSize) this.desktop.checkTaskBarSize();
     },
     setText: function(str){
         this.textNode.set("text", str || this.app.options.title);
@@ -1744,6 +1771,7 @@ o2.xDesktop.Default.TaskItem = new Class({
     destroy: function(){
         this.iconNode.destroy();
         this.node.destroy();
+        if (this.desktop && this.desktop.checkTaskBarSize) this.desktop.checkTaskBarSize();
         o2.release(this);
     },
     setTaskitemSize: function(){

+ 11 - 0
o2web/source/o2_core/o2/xDesktop/Menu.js

@@ -25,6 +25,7 @@ MWF.xDesktop.Menu = new Class({
 			}).inject(this.options.container || $(document.body));
 			
 			this.node.inject(this.borderNode);
+
 			this.hide = this.hideMenu.bind(this);
 			this.fireEvent("postLoad");
 		}
@@ -55,6 +56,16 @@ MWF.xDesktop.Menu = new Class({
 				}else{
 					this.pauseCount--;
 				}
+
+				var p = this.node.getPosition(document.body);
+				var size = this.node.getSize();
+				var bodySize = document.body.getSize();
+				if (p.y+size.y+10>bodySize.y){
+					var y = bodySize.y-p.y-10;
+					this.node.setStyle("height", ""+y+"px");
+					this.node.addEvent("mousedown", function(e){ e.stopPropagation(); })
+				}
+
 				this.fireEvent("postShow");
 			}
 		}

+ 5 - 6
o2web/source/x_component_Homepage/$Main/default/style.css

@@ -257,7 +257,7 @@
     text-align: center;
     line-height: 24px;
     float: left;
-    margin-left: 10px;
+    margin-left: 5px;
     cursor: pointer;
     user-select: none;
     -ms-user-select: none;
@@ -280,7 +280,7 @@
     background-color: #ffffff;
     line-height: 20px;
     text-align: center;
-    margin-left: 10px;
+    margin-left: 8px;
     color: #666666;
     cursor: pointer;
     border: 1px solid #E6E6E6;
@@ -293,7 +293,7 @@
     border-radius: 10px;
     background-color: #ffffff;
     text-align: center;
-    margin-left: 10px;
+    margin-left: 8px;
     color: #666666;
     cursor: pointer;
     float: left;
@@ -308,7 +308,7 @@
     border-radius: 10px;
     background-color: #ffffff;
     text-align: center;
-    margin-left: 10px;
+    margin-left: 8px;
     color: #666666;
     cursor: pointer;
     float: left;
@@ -374,7 +374,7 @@
 
 .o2_homepage_infor_hotpicArea {
     height: 100%;
-    width: 42%;
+    width: 36%;
     float: left;
     background: #F7FBFF;
     border-radius: 8px;
@@ -392,7 +392,6 @@
 }
 
 .o2_homepage_infor_itemsArea {
-    margin-left: 42%;
     height: 100%;
 }
 .o2_homepage_infor_itemsArea_content {

+ 1 - 0
o2web/source/x_component_Homepage/$Main/default/taskContent.html

@@ -13,6 +13,7 @@
 
     </div>
 
+</div>
 </div>
 <div class="o2_homepage_task_area">
     <div class="o2_homepage_task_area_content" data-o2-element="itemContentNode"></div>

+ 4 - 0
o2web/source/x_component_Homepage/InforContent.js

@@ -289,6 +289,8 @@ MWF.xApplication.Homepage.InforContent.AllInfor = new Class({
     },
     loadItemsRes_item:function(){
         o2.Actions.load("x_cms_assemble_control").DocumentAction.query_listWithFilterPaging(this.page, this.pageSize, {
+            "orderField": "publishTime",
+            "orderType": "DESC",
             "readFlag": "UNREAD"
         }, function(json){
             this.itemCount = json.count;
@@ -519,6 +521,8 @@ MWF.xApplication.Homepage.InforContent.Infor  = new Class({
     },
     loadItemsRes: function(){
         o2.Actions.load("x_cms_assemble_control").DocumentAction.query_listWithFilterPaging(this.page, this.pageSize, {
+            "orderField": "publishTime",
+            "orderType": "DESC",
             "readFlag": "UNREAD",
             "appIdList": [this.id]
         }, function(json){

+ 10 - 0
o2web/source/x_component_Homepage/TaskContent.js

@@ -397,6 +397,16 @@ MWF.xApplication.Homepage.TaskContent.Task = new Class({
                 "click": function () { this.nextPage(); }.bind(this),
             });
 
+            debugger;
+            var size = this.pageNode.getSize();
+            var w1 = this.prevPageNode.getEdgeWidth();
+            var w2 = this.nextPageNode.getEdgeWidth();
+            var x1 = this.prevPageNode.getSize().x;
+            var x2 = this.nextPageNode.getSize().x;
+            var x = size.x - w1 - w2 - x1 - x2;
+            var count = (x/30).toInt()-2;
+            if (count<3) count = 3;
+            this.options.showPages = count;
             this.loadPageNumber();
         }else{
 

+ 21 - 20
o2web/source/x_component_process_Xform/Log.js

@@ -1647,16 +1647,17 @@ MWF.xApplication.process.Xform.Log = MWF.APPLog =  new Class({
 
                 var imgAreaNode = new Element("div", {"styles": this.form.css.logMediaOpinionContentArea}).inject(imgNode);
 
-                //var height = 260;
-                //var width = 390;
+                // var height = 260;
+                // var width = 390;
                 var width;
+                //var height;
                 if (layout.mobile){
                     width = node.getParent().getParent().getSize().x-2;
                     //height = width*2/3;
                 }else{
                     var pNode = node.getParent().getParent();
                     var offset = imgNode.getPosition( pNode );
-                    width = Math.min( pNode.getSize().x - offset.x - 42, 800 );
+                    width = Math.min( pNode.getSize().x - offset.x - 42, 800 );x
                 }
 
                 var img = new Element("img", {
@@ -1692,23 +1693,23 @@ MWF.xApplication.process.Xform.Log = MWF.APPLog =  new Class({
 
                 //}
 
-                var p = iconNode.getPosition(this.form.app.content);
-                var s = iconNode.getSize();
-                var size = (layout.mobile) ? {"x": width, "y": height}: imgNode.getSize();
-                var contentSize = this.form.app.content.getSize();
-                var contentScroll = (layout.mobile) ? document.body.getFirst().getScroll() : {"x": 0, "y": 0};
-                var y = p.y-size.y;
-                var x = p.x+s.x/2-size.x/2;
-
-                if (x<10) x = 10;
-                if (x+size.x>contentSize.x-10) x = contentSize.x-size.x-20;
-                if (y+size.y>contentSize.y-10) y = contentSize.y-size.y-20;
-                if (y<10) y = 10;
-                y=y+contentScroll.y;
-
-                if (layout.mobile){
-                    x = 0;
-                }
+                // var p = iconNode.getPosition(this.form.app.content);
+                // var s = iconNode.getSize();
+                // var size = (layout.mobile) ? {"x": width, "y": height}: imgNode.getSize();
+                // var contentSize = this.form.app.content.getSize();
+                // var contentScroll = (layout.mobile) ? document.body.getFirst().getScroll() : {"x": 0, "y": 0};
+                // var y = p.y-size.y;
+                // var x = p.x+s.x/2-size.x/2;
+                //
+                // if (x<10) x = 10;
+                // if (x+size.x>contentSize.x-10) x = contentSize.x-size.x-20;
+                // if (y+size.y>contentSize.y-10) y = contentSize.y-size.y-20;
+                // if (y<10) y = 10;
+                // y=y+contentScroll.y;
+                //
+                // if (layout.mobile){
+                //     x = 0;
+                // }
                 // imgNode.setStyles({
                 //     "top": ""+y+"px",
                 //     "left": ""+x+"px"

+ 0 - 27
o2web/source/x_desktop/js/base.js

@@ -60,15 +60,6 @@ o2.xDesktop.requireApp = function (module, clazz, callback, async) {
             app.taskitem = taskitem;
             app.taskitem.app = app;
 
-            // if (layout.viewMode=="Default"){
-            //     if (!notCurrent){
-            //         app.load(!notCurrent);
-            //     }else{
-            //         app.isLoadApplication = false;
-            //     }
-            // }else{
-            //     app.load(!notCurrent);
-            // }
             app.isLoadApplication = true;
             app.load(!notCurrent);
 
@@ -266,24 +257,6 @@ o2.xDesktop.requireApp = function (module, clazz, callback, async) {
                     if (options) options.appId = appId;
                     _createNewApplication(e, appNamespace, appName, (options || {"appId": appId}), statusObj, inBrowser, taskitem, notCurrent);
                 }
-                // if (appNamespace.options.multitask){
-                //     if (options && options.appId){
-                //         if (layout.desktop.apps[options.appId]){
-                //             layout.desktop.apps[options.appId].setCurrent();
-                //         }else {
-                //             _createNewApplication(e, appNamespace, appName, options, obj, inBrowser);
-                //         }
-                //     }else{
-                //         _createNewApplication(e, appNamespace, appName, options, obj, inBrowser);
-                //     }
-                // }else{
-                //     if (layout.desktop.apps[appName]){
-                //         layout.desktop.apps[appName].setCurrent();
-                //     }else{
-                //         _createNewApplication(e, appNamespace, appName, options, obj, inBrowser);
-                //     }
-                // }
-                // _createNewApplication(e, appNamespace, appName, (options || {}), statusObj, inBrowser);
             }.bind(this));
         }
     };