Jelajahi Sumber

Merge branch 'fix/Process.calendar_mobile_position' into 'wrdp'

Merge of fix/Process.calendar_mobile_position 修复移动端选择日期位置可能不正确的问题 to wrdp

See merge request o2oa/o2oa!2145
蔡祥熠 5 tahun lalu
induk
melakukan
0ba0673826

+ 12 - 0
o2web/source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js

@@ -175,17 +175,23 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit = new Class({
                 unitList.sort(function (a, b) {
                     var idxA = this.getIndexFromUnitOption(a);
                     var idxB = this.getIndexFromUnitOption(b);
+                    if( a.orderNumber === 0 )a.orderNumber = -1;
+                    if( b.orderNumber === 0 )b.orderNumber = -1;
                     idxA = idxA === -1 ? 9999999 + (a.orderNumber || 9999999) : idxA;
                     idxB = idxB === -1 ? 9999999 + (b.orderNumber || 9999999) : idxB;
                     return idxA - idxB;
                 }.bind(this))
             } else {
                 unitList.sort(function (a, b) {
+                    if( a.orderNumber === 0 )a.orderNumber = -1;
+                    if( b.orderNumber === 0 )b.orderNumber = -1;
                     return (a.orderNumber || 9999999) - (b.orderNumber || 9999999);
                 }.bind(this))
             }
         } else {
             unitList.sort(function (a, b) {
+                if( a.orderNumber === 0 )a.orderNumber = -1;
+                if( b.orderNumber === 0 )b.orderNumber = -1;
                 return (a.orderNumber || 9999999) - (b.orderNumber || 9999999);
             }.bind(this))
         }
@@ -545,6 +551,8 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit.ItemCategory = new Cla
                 if (this.data.identityList && this.data.identityList.length > 0) {
                     this.data.identityList.sort(function (a, b) {
                         //this.selector.getUnitOrderNumber( a.unitLevelName )
+                        if( a.orderNumber === 0 )a.orderNumber = -1;
+                        if( b.orderNumber === 0 )b.orderNumber = -1;
                         return (a.orderNumber || 9999999) - (b.orderNumber || 9999999);
                     });
                     this.data.identityList.each(function (identity) {
@@ -562,6 +570,8 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit.ItemCategory = new Cla
 
             if (this.data.unitList && this.data.unitList.length) {
                 this.data.unitList.sort(function (a, b) {
+                    if( a.orderNumber === 0 )a.orderNumber = -1;
+                    if( b.orderNumber === 0 )b.orderNumber = -1;
                     return (a.orderNumber || 9999999) - (b.orderNumber || 9999999);
                 });
                 this.data.unitList.each(function (subData) {
@@ -596,6 +606,8 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit.ItemCategory = new Cla
             if (this.data.identityList && this.data.identityList.length > 0) {
                 this.data.identityList.sort(function (a, b) {
                     //this.selector.getUnitOrderNumber( a.unitLevelName )
+                    if( a.orderNumber === 0 )a.orderNumber = -1;
+                    if( b.orderNumber === 0 )b.orderNumber = -1;
                     return (a.orderNumber || 9999999) - (b.orderNumber || 9999999);
                 });
                 this.data.identityList.each(function (identity) {

+ 1 - 1
o2web/source/x_component_process_Xform/Calendar.js

@@ -52,7 +52,7 @@ MWF.xApplication.process.Xform.Calendar = MWF.APPCalendar =  new Class({
                     "isTime": (this.json.selectType==="datetime" || this.json.selectType==="time"),
                     "timeOnly": (this.json.selectType === "time"),
                     //"target": this.form.node,
-                    "target": this.form.app.content,
+                    "target": layout.mobile ? $(document.body) : this.form.app.content,
                     "format": this.json.format,
                     "onComplate": function(formateDate, date){
                         this.validationMode();