From e73310b6438cd5d1b13f63b38c9900f1baa3b3bd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 31 Mar 2020 01:58:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BAwidget.Paging=EF=BC=8C?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E7=BB=84=E4=BB=B6=EF=BC=8C=E5=B9=B6=E5=9C=A8?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E4=B8=AD=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../o2/widget/$Paging/default/css.wcss | 119 ++++++ .../o2/widget/$Paging/default/icon/left.png | Bin 0 -> 1224 bytes .../o2/widget/$Paging/default/icon/right.png | Bin 0 -> 1222 bytes .../o2_core/o2/widget/$Paging/forum/css.wcss | 120 ++++++ .../o2/widget/$Paging/forum/icon/left.png | Bin 0 -> 220 bytes .../o2/widget/$Paging/forum/icon/right.png | Bin 0 -> 217 bytes o2web/source/o2_core/o2/widget/Paging.js | 239 ++++++++++++ o2web/source/o2_core/o2/xScript/CMSMacro.js | 47 +++ o2web/source/o2_core/o2/xScript/Macro.js | 84 +++-- .../widget/ViewFilter.js | 3 + .../Module/View/view.html | 2 +- .../Module/View/view.html | 2 +- .../Module/ViewSelector/ViewSelector.html | 2 +- .../$View/view.html | 2 +- .../widget/ViewFilter.js | 3 + .../source/x_component_query_Query/Viewer.js | 350 ++++++++++-------- .../$View/skin/styles_blue-flat.json | 3 + 17 files changed, 771 insertions(+), 205 deletions(-) create mode 100644 o2web/source/o2_core/o2/widget/$Paging/default/css.wcss create mode 100644 o2web/source/o2_core/o2/widget/$Paging/default/icon/left.png create mode 100644 o2web/source/o2_core/o2/widget/$Paging/default/icon/right.png create mode 100644 o2web/source/o2_core/o2/widget/$Paging/forum/css.wcss create mode 100644 o2web/source/o2_core/o2/widget/$Paging/forum/icon/left.png create mode 100644 o2web/source/o2_core/o2/widget/$Paging/forum/icon/right.png create mode 100644 o2web/source/o2_core/o2/widget/Paging.js diff --git a/o2web/source/o2_core/o2/widget/$Paging/default/css.wcss b/o2web/source/o2_core/o2/widget/$Paging/default/css.wcss new file mode 100644 index 0000000000..d2883fc6bb --- /dev/null +++ b/o2web/source/o2_core/o2/widget/$Paging/default/css.wcss @@ -0,0 +1,119 @@ +{ + "pagingBar" : { + "float": "left", + "margin-left": "10px", + "height": "24px", + "color": "#777777" + }, + "firstPage" : { + "height": "24px", + "width": "80px", + "border": "1px solid #e6e6e6", + "color": "#777777", + "text-align": "center", + "line-height": "24px", + "cursor": "pointer", + "margin-right": "10px", + "background-color": "#ffffff", + "float": "left" + }, + "firstPage_over" : { + "background-color": "#f1f1f1" + }, + "lastPage" : { + "height": "24px", + "width": "80px", + "border": "1px solid #e6e6e6", + "color": "#777777", + "text-align": "center", + "line-height": "24px", + "cursor": "pointer", + "background-color": "#ffffff", + "float": "left" + }, + "lastPage_over" : { + "background-color": "#f1f1f1" + }, + "prePage" : { + "width": "24px", + "height": "24px", + "border": "1px solid #e6e6e6", + "color": "#777777", + "text-align": "center", + "line-height": "24px", + "cursor": "pointer", + "background-color": "#ffffff", + "float": "left", + "margin-right": "10px", + "background": "url(/o2_core/o2/widget/$Paging/default/icon/left.png) no-repeat center center" + }, + "prePage_over" : { + "background-color": "#f1f1f1" + }, + "pageTurnContainer" : { + "float" : "left" + }, + "pageItem" : { + "width": "24px", + "height": "24px", + "border": "1px solid #e6e6e6", + "text-align": "center", + "line-height": "24px", + "cursor": "pointer", + "float": "left", + "margin-right": "10px", + "background-color": "#ffffff", + "color": "#777777" + }, + "pageItem_over" : { + "background-color": "#f1f1f1" + }, + "currentPage" : { + "width": "24px", + "height": "24px", + "border": "1px solid #e6e6e6", + "text-align": "center", + "line-height": "24px", + "cursor": "pointer", + "float": "left", + "margin-right": "10px", + "background-color": "#4a90e2", + "color": "#ffffff" + }, + "pageJumper" : { + "float" : "left", + "height" : "20px", + "line-height" : "20px", + "text-align" : "center", + "width" : "20px", + "margin-left" : "5px", + "border" : "1px solid #ddd" + }, + "pageJumper_over" : { + "border" : "1px solid #43AAFA" + }, + "pageJumperText" : { + "float" : "left", + "height" : "20px", + "padding" : "2px 5px", + "text-align" : "center", + "line-height" : "20px", + "margin-right" : "5px" + }, + "nextPage" : { + "width": "24px", + "height": "24px", + "border": "1px solid #e6e6e6", + "color": "#777777", + "text-align": "center", + "line-height": "24px", + "cursor": "pointer", + "background-color": "#ffffff", + "float": "left", + "margin-right": "10px", + "background": "url(/o2_core/o2/widget/$Paging/default/icon/right.png) no-repeat center center" + }, + "nextPage_over" : { + "background-color": "#f1f1f1" + } +} \ No newline at end of file diff --git a/o2web/source/o2_core/o2/widget/$Paging/default/icon/left.png b/o2web/source/o2_core/o2/widget/$Paging/default/icon/left.png new file mode 100644 index 0000000000000000000000000000000000000000..91b6bbc35cb495aa14b629e232a456e508a09621 GIT binary patch literal 1224 zcmah|&ui0A9FI}R1EjVEZ-;&ohw8@LftL+A& z$PgwBHWcv>n73`7WQPe}yod({PYU93C(*+|*~yn~trJ!ZN!|}W-_Q5+{WUi}cBQ-P zbQi~Q-I=R;maT`_ceryu`&Wh+N7-_UrYC5Q6le|km`hq@3iBBU6>%0LYx>SRJj8Jw z8+LwzP8g%mB#wwej97O(X3cR!!*vgtWlZ@gT(sSU@MHarz}r?rxEVKO!_#odzB=RM z+{{?soGF{CB@AEUhw6|KIG7^7?o`|W))PX57qWeLEeU)BLdywZThxRx&TGWSd|Zr0 zOc?-PQAE%mR}^rOkIEn_$?R1kpdZE+7#-ku9)WrDtpd#IBRjs>DIt_7^`IoxYBjMI z6Nz7xfU2q?M>HB?h)6K)QdEz)L2r{m$ARhF9<_WWEd^@p0tkBLI*U9|Hif_I>=9Z zSjysnRDF{bxzHQR@}TBpM2Vj#q|(gzc!^LFl!(V`Ifd`LX}cDw1?P9+v5qKC2rT<* zL>`F9N*)YCS%ES2g3LDZHq;=NU6|ezIsk$E50sVOLKOWMY?-h?d}=nQ2g^^ho%{MrE9%DOm*5dNxO}U8{>6I7x6cPoa%lDX+PldGHPnzvkLjza+YkQ$ DV0wj^ literal 0 HcmV?d00001 diff --git a/o2web/source/o2_core/o2/widget/$Paging/default/icon/right.png b/o2web/source/o2_core/o2/widget/$Paging/default/icon/right.png new file mode 100644 index 0000000000000000000000000000000000000000..36b4c152471e624c6ed75f1eea1f08a5437a113c GIT binary patch literal 1222 zcmah}O-$2J9IqIZpcsx|VyxwY==!m-j=nI-Xg8Um1jiC42eq_sqhaltcm|K4EG}v;q+$jdhjh}?axeuoqkQ2d?4_vP z-^_FdXVgKUBa7913|q1s!ltO+zLKNqlMvJ6FlX9PX7%9{hBl2TGa6QT)sf+ZIWXnI zk*T4yJ~gRJ2Ge(f?kxc#U_q?WB`a@xpcG{)x`6EcV~(LK5Ih-WHk`_+!?cWCNQc=_ zK<5R47DZO*4vV62oDT9rkmJcM283=97C|sVZ(a3N06_%2vW>M;!1g+-3JUae*L1LnY}!}U#!&%B8RF?i2$oZmwY|+W zk%Vz2&EW)=_d}`x4ZVhQ3U0n)+|W6ghZeN4N3cQ-OR}V@HTaIQmQ_Q0I0d(2+Y#-h z%MRpH&_e}RCq>S7_-;8scAr|V-G+yXhGCQ; z*_Q%*B*2Slp$G6H2ua6yvf($NDl*J$c}HjjgoFP;N$Cv@YySlsI>;i|(n$VIzgs!S z&Q+|bDoENM)@&Unl_*0(V@=Zl@t7jSWFamkl(0aSo=`|m@S%QLh=mj3P^8LLkY4bs zP~{q1+(ccj-_L%XfC63fA~X^%vgk@JfLY%cxvt(O*QoD{QkTmSXE?t*w{>gvh>U>0 zt<4_!s7)`l$;i57HqY%cyU1J@l1eOH`k24*eoy>JYy8%q#`W0sna=p{^;u|2MqRs^Jd~UbzViPp$@q}6(0~5Y EUyv+^O#lD@ literal 0 HcmV?d00001 diff --git a/o2web/source/o2_core/o2/widget/$Paging/forum/css.wcss b/o2web/source/o2_core/o2/widget/$Paging/forum/css.wcss new file mode 100644 index 0000000000..0afbf30d4c --- /dev/null +++ b/o2web/source/o2_core/o2/widget/$Paging/forum/css.wcss @@ -0,0 +1,120 @@ +{ + "pagingBar" : { + "float" : "right", + "margin-right" : "10px", + "padding-left" : "10px", + "overflow" : "hidden", + "height" : "36px", + "line-height" : "36px", + "margin-bottom" : "10px", + "background" : "#fff", + "color" : "#333" + }, + "firstPage" : { + "float" : "left" + }, + "firstPage_over" : { + + }, + "lastPage" : { + "float" : "left" + }, + "lastPage_over" : { + + }, + "prePage" : { + "float" : "left", + "width" : "16px", + "height" : "20px", + "line-height" : "20px", + "text-align" : "center", + "padding" : "2px 5px", + "border" : "1px solid #f3f3f3", + "margin" : "5px", + "cursor" : "pointer", + "background": "url(/o2_core/o2/widget/$Paging/forum/icon/left.png) no-repeat center center", + "background-color" : "#f3f3f3" + }, + "prePage_over" : { + "border" : "1px solid #43AAFA", + "background-color" : "#fff", + "color" : "#43AAFA" + }, + "pageTurnContainer" : { + "float" : "left" + }, + "pageItem" : { + "float" : "left", + "height" : "20px", + "min-width" : "16px", + "line-height" : "20px", + "text-align" : "center", + "padding" : "2px 5px", + "border" : "1px solid #f3f3f3", + "background-color" : "#f3f3f3", + "cursor" : "pointer", + "color" : "#333", + "margin" : "5px" + }, + "pageItem_over" : { + "border" : "1px solid #43AAFA", + "background-color" : "#fff", + "color" : "#43AAFA" + }, + "currentPage" : { + "float" : "left", + "height" : "20px", + "width" : "16px", + "line-height" : "20px", + "text-align" : "center", + "padding" : "2px 5px", + "border" : "1px solid #43AAFA", + "color" : "#fff", + "margin" : "5px", + "font-weight" : "bold", + "background-color" : "#43aafa" + }, + "pageJumper" : { + "float" : "left", + "height" : "20px", + "line-height" : "20px", + "text-align" : "center", + "width" : "20px", + "margin-top" : "5px", + "margin-bottom" : "5px", + "margin-left" : "5px", + "border" : "1px solid #ddd" + }, + "pageJumper_over" : { + "border" : "1px solid #43AAFA" + }, + "pageJumperText" : { + "float" : "left", + "height" : "20px", + "padding" : "2px 5px", + "text-align" : "center", + "line-height" : "20px", + "margin-top" : "5px", + "margin-bottom" : "5px", + "margin-right" : "5px" + }, + "nextPage" : { + "float" : "left", + "width" : "16px", + "height" : "20px", + "line-height" : "20px", + "text-align" : "center", + "padding" : "2px 5px", + "border" : "1px solid #f3f3f3", + "margin" : "5px", + "cursor" : "pointer", + "color" : "#333", + "background": "url(/o2_core/o2/widget/$Paging/forum/icon/right.png) no-repeat center center", + "background-color" : "#f3f3f3" + }, + "nextPage_over" : { + "border" : "1px solid #43AAFA", + "background-color" : "#fff", + "color" : "#43AAFA" + } +} \ No newline at end of file diff --git a/o2web/source/o2_core/o2/widget/$Paging/forum/icon/left.png b/o2web/source/o2_core/o2/widget/$Paging/forum/icon/left.png new file mode 100644 index 0000000000000000000000000000000000000000..43babd6331f5b87e4f8f147914c4641cca04bdc8 GIT binary patch literal 220 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCiluJY5_^Ec}xt3J!2AEo{25Mn~@3{QB85|NmJLv!mc4{|W;c1INrY3`=Id zeZK##f|=P_g@((l24{PC{-4*GX}wuMtA}xel*5`dfdd8&B0$L`hLy7%8S)i`m{+`J zl~|x5kk}C6Tp-23bVQ=bTp-+k_P3|v){~#tv$-|?_))>Q;==+a9v+7EYGE2DzBn`h PUBuw&>gTe~DWM4f;oD3_ literal 0 HcmV?d00001 diff --git a/o2web/source/o2_core/o2/widget/$Paging/forum/icon/right.png b/o2web/source/o2_core/o2/widget/$Paging/forum/icon/right.png new file mode 100644 index 0000000000000000000000000000000000000000..c629b31a4c71a0bcac84404f8130e7a5e1e687b1 GIT binary patch literal 217 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCik@JzX3_Ec}xt3J!2A4Rolfu{j_PsFV!tLsgFV9LP4A?b91LEu0-M<81R zgP!vSHYLr5Z*dDW1UNI<80WAFES6*eiWz8fGnjG pageSize) { + min = pageSize - visiblePages; + max = pageSize; + } else if (currentPage - halfCount < 1) { + min = 1; + max = visiblePages; + } else { + min = currentPage - halfCount; + max = currentPage + halfCount; + } + + if (min > 1 || !this.options.hiddenWithDisable )this.createFirst(); + + if (this.options.hasPrevPage && ( currentPage != 1 || showWithDisable ) ){ + this.createPrev(); + } + + if( this.options.hasTruningBar ){ + this.pageTurnContainer = new Element("div", { + styles : this.css.pageTurnContainer + }).inject( this.node ); + this.pageTurnNodes = []; + for (i = min; i <= max; i++) { + if (currentPage == i) { + this.currentPage = new Element("div.currentPage", { + "styles": this.css.currentPage, + "text" : i + }).inject(this.pageTurnContainer); + } else { + this.pageTurnNodes.push( this.createPageTurnNode(i) ); + } + } + } + + if (this.options.hasJumper) { + this.createPageJumper(); + } + + if (this.options.hasNextPage && ( currentPage != pageSize || showWithDisable )){ + this.createNext(); + } + + if( max < pageSize || showWithDisable )this.createLast(); + }, + createFirst : function(){ + var firstPage = this.firstPage = new Element("div.firstPage", { + styles: this.css.firstPage + }).inject(this.node); + if (this.options.text.firstPage) firstPage.set("text", this.options.text.firstPage); + firstPage.addEvents({ + "mouseover": function (ev) { + ev.target.setStyles(this.css.firstPage_over) + }.bind(this), + "mouseout": function (ev) { + ev.target.setStyles(this.css.firstPage) + }.bind(this), + "click": function () { + this.gotoPage(1) + }.bind(this) + }) + }, + createLast : function(){ + var lastPage = this.lastPage = new Element("div.lastPage", { + styles: this.css.lastPage + }).inject(this.node); + if (this.options.text.lastPage) lastPage.set("text", this.options.text.lastPage); + lastPage.addEvents({ + "mouseover": function (ev) { + ev.target.setStyles(this.css.lastPage_over) + }.bind(this), + "mouseout": function (ev) { + ev.target.setStyles(this.css.lastPage) + }.bind(this), + "click": function () { + this.gotoPage( this.options.pageSize ) + }.bind(this) + }) + }, + createPrev : function(){ + var prePage = this.prePage = new Element("div.prePage", { + styles: this.css.prePage + }).inject(this.node); + if (this.options.text.prePage) prePage.set("text", this.options.text.prePage); + prePage.addEvents({ + "mouseover": function (ev) { + ev.target.setStyles(this.css.prePage_over) + }.bind(this), + "mouseout": function (ev) { + ev.target.setStyles(this.css.prePage) + }.bind(this), + "click": function () { + this.gotoPage(this.options.currentPage - 1) + }.bind(this) + }); + }, + createNext : function(){ + var nextPage = this.nextPage = new Element("div.nextPage", { + styles: this.css.nextPage + }).inject(this.node); + if (this.options.text.nextPage) nextPage.set("text", this.options.text.nextPage); + nextPage.addEvents({ + "mouseover": function (ev) { + ev.target.setStyles(this.css.nextPage_over) + }.bind(this), + "mouseout": function (ev) { + ev.target.setStyles(this.css.nextPage) + }.bind(this), + "click": function () { + this.gotoPage(this.options.currentPage + 1) + }.bind(this) + }); + }, + createPageTurnNode: function(i){ + var pageTurnNode = new Element("div.pageItem", { + "styles": this.css.pageItem, + "text": i + }).inject(this.pageTurnContainer); + pageTurnNode.addEvents({ + "mouseover": function (ev) { + ev.target.setStyles(this.css.pageItem_over) + }.bind(this), + "mouseout": function (ev) { + ev.target.setStyles(this.css.pageItem) + }.bind(this), + "click": function () { + this.obj.gotoPage(this.num) + }.bind({obj: this, num: i}) + }); + return pageTurnNode; + }, + createPageJumper : function(){ + var _self = this; + var pageJumper = this.pageJumper = new Element("input.pageJumper", { + "styles": this.css.pageJumper, + "title": "输入页码,按回车跳转" + }).inject(this.node); + this.pageJumperText = new Element("div.pageText", { + "styles": this.css.pageJumperText, + "text": "/" + this.options.pageSize + }).inject(this.node); + pageJumper.addEvents({ + "focus": function (ev) { + ev.target.setStyles(this.css.pageJumper_over) + }.bind(this), + "blur": function (ev) { + ev.target.setStyles(this.css.pageJumper) + }.bind(this), + "keyup": function (e) { + this.value = this.value.replace(/[^0-9_]/g, '') + }, + "keydown": function (e) { + if (e.code == 13 && this.value != "") { + _self.gotoPage(this.value); + e.stopPropagation(); + //e.preventDefault(); + } + } + }); + }, + gotoPage: function (num) { + if (num < 1 || num > this.options.pageSize) return; + this.fireEvent("jumpingPage", [num]); + this.options.currentPage = num; + this.load(); + }, + gotoItem: function (itemNum) { + var pageNum = Math.ceil(itemNum / this.options.countPerPage); + var index = itemNum % this.options.countPerPage; + this.fireEvent("jumpingPage", [pageNum, itemNum, index]); + this.options.currentPage = pageNum; + this.load(); + } +}); \ No newline at end of file diff --git a/o2web/source/o2_core/o2/xScript/CMSMacro.js b/o2web/source/o2_core/o2/xScript/CMSMacro.js index 72f5f5d08c..bbcabbe2f8 100644 --- a/o2web/source/o2_core/o2/xScript/CMSMacro.js +++ b/o2web/source/o2_core/o2/xScript/CMSMacro.js @@ -81,6 +81,53 @@ MWF.CMSMacro.CMSFormContext = new Class({ }); +if( !MWF.Macro.ViewContext ){ + MWF.Macro.ViewContext = new Class({ + macroFunction: null, + environment: {}, + initialize: function(view){ + this.form = view; + var environment = { + "view": view, + "viewInfor": view.viewInfor, + "target": null, + "event": null + }; + MWF.require("MWF.xScript.ViewEnvironment", null, false); + this.environment = new MWF.xScript.ViewEnvironment(environment); + }, + setTarget: function(target){ + if (target){ + this.environment.target = target; + }else{ + this.environment.target = null; + } + }, + setEvent: function(event){ + if (event){ + this.environment.event = event; + }else{ + this.environment.event = null; + } + }, + exec: function(code, target){ + this.setTarget(target); + var returnValue = MWF.Macro.exec(code, this.environment); + //this.form.businessData.data = Object.merge(this.form.businessData.data, this.environment.data); + + return returnValue; + //this.environment.data + + }, + fire: function(code, target, event){ + this.setTarget(target); + this.setEvent(event); + return MWF.Macro.exec(code, this.environment); + } + }); +} + + JSONObject = function(o){ }; \ No newline at end of file diff --git a/o2web/source/o2_core/o2/xScript/Macro.js b/o2web/source/o2_core/o2/xScript/Macro.js index fbee8950fe..80d9964f18 100644 --- a/o2web/source/o2_core/o2/xScript/Macro.js +++ b/o2web/source/o2_core/o2/xScript/Macro.js @@ -165,49 +165,51 @@ MWF.Macro.PageContext = new Class({ } }); -MWF.Macro.ViewContext = new Class({ - macroFunction: null, - environment: {}, - initialize: function(view){ - this.form = view; - var environment = { - "view": view, - "viewInfor": view.viewInfor, - "target": null, - "event": null - }; - MWF.require("MWF.xScript.ViewEnvironment", null, false); - this.environment = new MWF.xScript.ViewEnvironment(environment); - }, - setTarget: function(target){ - if (target){ - this.environment.target = target; - }else{ - this.environment.target = null; - } - }, - setEvent: function(event){ - if (event){ - this.environment.event = event; - }else{ - this.environment.event = null; - } - }, - exec: function(code, target){ - this.setTarget(target); - var returnValue = MWF.Macro.exec(code, this.environment); - //this.form.businessData.data = Object.merge(this.form.businessData.data, this.environment.data); +if( !MWF.Macro.ViewContext ) { + MWF.Macro.ViewContext = new Class({ + macroFunction: null, + environment: {}, + initialize: function (view) { + this.form = view; + var environment = { + "view": view, + "viewInfor": view.viewInfor, + "target": null, + "event": null + }; + MWF.require("MWF.xScript.ViewEnvironment", null, false); + this.environment = new MWF.xScript.ViewEnvironment(environment); + }, + setTarget: function (target) { + if (target) { + this.environment.target = target; + } else { + this.environment.target = null; + } + }, + setEvent: function (event) { + if (event) { + this.environment.event = event; + } else { + this.environment.event = null; + } + }, + exec: function (code, target) { + this.setTarget(target); + var returnValue = MWF.Macro.exec(code, this.environment); + //this.form.businessData.data = Object.merge(this.form.businessData.data, this.environment.data); - return returnValue; - //this.environment.data + return returnValue; + //this.environment.data - }, - fire: function(code, target, event){ - this.setTarget(target); - this.setEvent(event); - return MWF.Macro.exec(code, this.environment); - } -}); + }, + fire: function (code, target, event) { + this.setTarget(target); + this.setEvent(event); + return MWF.Macro.exec(code, this.environment); + } + }); +} JSONObject = function(o){ }; diff --git a/o2web/source/x_component_cms_QueryViewDesigner/widget/ViewFilter.js b/o2web/source/x_component_cms_QueryViewDesigner/widget/ViewFilter.js index 363c8cdcfe..c8f648f101 100644 --- a/o2web/source/x_component_cms_QueryViewDesigner/widget/ViewFilter.js +++ b/o2web/source/x_component_cms_QueryViewDesigner/widget/ViewFilter.js @@ -88,6 +88,7 @@ MWF.xApplication.cms.QueryViewDesigner.widget.ViewFilter = new Class({ this.valueBooleanInput.setStyle("display", "none"); break; case "datetimeValue": + case "dateTimeValue": this.valueTextInput.setStyle("display", "none"); this.valueNumberInput.setStyle("display", "none"); this.valueDatetimeInput.setStyle("display", "block"); @@ -169,6 +170,7 @@ MWF.xApplication.cms.QueryViewDesigner.widget.ViewFilter = new Class({ value = this.valueNumberInput.get("value").toFloat(); break; case "datetimeValue": + case "dateTimeValue": value = this.valueDatetimeInput.get("value"); break; case "booleanValue": @@ -221,6 +223,7 @@ MWF.xApplication.cms.QueryViewDesigner.widget.ViewFilter = new Class({ this.valueNumberInput.set("value", data.value); break; case "datetimeValue": + case "dateTimeValue": this.valueDatetimeInput.set("value", data.value); break; case "booleanValue": diff --git a/o2web/source/x_component_portal_PageDesigner/Module/View/view.html b/o2web/source/x_component_portal_PageDesigner/Module/View/view.html index 22163b9c02..47bd9c1bef 100644 --- a/o2web/source/x_component_portal_PageDesigner/Module/View/view.html +++ b/o2web/source/x_component_portal_PageDesigner/Module/View/view.html @@ -131,7 +131,7 @@ diff --git a/o2web/source/x_component_process_FormDesigner/Module/View/view.html b/o2web/source/x_component_process_FormDesigner/Module/View/view.html index a688c0b052..551590ca62 100644 --- a/o2web/source/x_component_process_FormDesigner/Module/View/view.html +++ b/o2web/source/x_component_process_FormDesigner/Module/View/view.html @@ -199,7 +199,7 @@ diff --git a/o2web/source/x_component_process_FormDesigner/Module/ViewSelector/ViewSelector.html b/o2web/source/x_component_process_FormDesigner/Module/ViewSelector/ViewSelector.html index 0fb5f99839..03d04dfe4f 100644 --- a/o2web/source/x_component_process_FormDesigner/Module/ViewSelector/ViewSelector.html +++ b/o2web/source/x_component_process_FormDesigner/Module/ViewSelector/ViewSelector.html @@ -118,7 +118,7 @@ diff --git a/o2web/source/x_component_process_ViewDesigner/$View/view.html b/o2web/source/x_component_process_ViewDesigner/$View/view.html index 2b2478f8cc..4f2ea68e86 100644 --- a/o2web/source/x_component_process_ViewDesigner/$View/view.html +++ b/o2web/source/x_component_process_ViewDesigner/$View/view.html @@ -269,7 +269,7 @@ diff --git a/o2web/source/x_component_process_ViewDesigner/widget/ViewFilter.js b/o2web/source/x_component_process_ViewDesigner/widget/ViewFilter.js index 8b56941350..5a19c3c873 100644 --- a/o2web/source/x_component_process_ViewDesigner/widget/ViewFilter.js +++ b/o2web/source/x_component_process_ViewDesigner/widget/ViewFilter.js @@ -132,6 +132,7 @@ MWF.xApplication.process.ViewDesigner.widget.ViewFilter = new Class({ this.valueBooleanInput.setStyle("display", "none"); break; case "datetimeValue": + case "dateTimeValue": this.valueTextInput.setStyle("display", "none"); this.valueNumberInput.setStyle("display", "none"); this.valueDatetimeInput.setStyle("display", "block"); @@ -277,6 +278,7 @@ MWF.xApplication.process.ViewDesigner.widget.ViewFilter = new Class({ value = this.valueNumberInput.get("value").toFloat(); break; case "datetimeValue": + case "dateTimeValue": value = this.valueDatetimeInput.get("value"); break; case "booleanValue": @@ -332,6 +334,7 @@ MWF.xApplication.process.ViewDesigner.widget.ViewFilter = new Class({ this.valueNumberInput.set("value", data.value); break; case "datetimeValue": + case "dateTimeValue": this.valueDatetimeInput.set("value", data.value); break; case "booleanValue": diff --git a/o2web/source/x_component_query_Query/Viewer.js b/o2web/source/x_component_query_Query/Viewer.js index 37b500401a..c1829fcbe6 100644 --- a/o2web/source/x_component_query_Query/Viewer.js +++ b/o2web/source/x_component_query_Query/Viewer.js @@ -1,6 +1,7 @@ MWF.xApplication.query = MWF.xApplication.query || {}; MWF.xApplication.query.Query = MWF.xApplication.query.Query || {}; MWF.require("MWF.widget.Common", null, false); +MWF.require("o2.widget.Paging", null, false); MWF.require("MWF.xScript.Macro", null, false); MWF.xDesktop.requireApp("query.Query", "lp.zh-cn", null, false); MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({ @@ -634,75 +635,103 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({ this.lookup(data); } }, - _loadPageCountNode: function(){ - this.viewPageContentNode.empty(); - - var size = this.viewPageAreaNode.getSize(); - var w1 = this.viewPageFirstNode.getSize().x*2; - var w2 = this.viewPageContentNode.getStyle("margin-left").toInt(); - var w = size.x-w1-w2; - - var bw = this.css.viewPageButtonNode.width.toInt()+this.css.viewPageButtonNode["margin-right"].toInt(); - var count = (w/bw).toInt()-2; - if (count>10) count = 10; - this.showPageCount = Math.min(count, this.pages); - - var tmp = this.showPageCount/2; - var n = tmp.toInt(); - var left = this.currentPage-n; - if (left<=0) left = 1; - var right = this.showPageCount + left-1; - if (right>this.pages) right = this.pages; - left = right-this.showPageCount+1; - if (left<=1) left = 1; - - this.viewPagePrevNode = new Element("div", {"styles": this.css.viewPagePrevButtonNode}).inject(this.viewPageContentNode); - this.loadPageButtonEvent(this.viewPagePrevNode, "viewPagePrevButtonNode_over", "viewPagePrevButtonNode_up", "viewPagePrevButtonNode_down", function(){ - if (this.currentPage>1) this.currentPage--; - this.loadCurrentPageData(); - }.bind(this)); - - for (i=left; i<=right; i++){ - var node = new Element("div", {"styles": this.css.viewPageButtonNode, "text": i}).inject(this.viewPageContentNode); - if (i==this.currentPage){ - node.setStyles(this.css.viewPageButtonNode_current); - }else{ - this.loadPageButtonEvent(node, "viewPageButtonNode_over", "viewPageButtonNode_up", "viewPageButtonNode_down", function(e){ - this.currentPage = e.target.get("text").toInt(); - this.loadCurrentPageData(); - }.bind(this)); - } - } - this.viewPageNextNode = new Element("div", {"styles": this.css.viewPageNextButtonNode}).inject(this.viewPageContentNode); - this.loadPageButtonEvent(this.viewPageNextNode, "viewPageNextButtonNode_over", "viewPageNextButtonNode_up", "viewPageNextButtonNode_down", function(){ - if (this.currentPage<=this.pages-1) this.currentPage++; - this.loadCurrentPageData(); - }.bind(this)); - }, - loadPageButtonEvent: function(node, over, out, down, click){ - node.addEvents({ - "mouseover": function(){node.setStyles(this.css[over])}.bind(this), - "mouseout": function(){node.setStyles(this.css[out])}.bind(this), - "mousedown": function(){node.setStyles(this.css[down])}.bind(this), - "mouseup": function(){node.setStyles(this.css[out])}.bind(this), - "click": click - }); - }, - _loadPageNode: function(){ + // _loadPageCountNode: function(){ + // this.viewPageContentNode.empty(); + // + // var size = this.viewPageAreaNode.getSize(); + // var w1 = this.viewPageFirstNode.getSize().x*2; + // var w2 = this.viewPageContentNode.getStyle("margin-left").toInt(); + // var w = size.x-w1-w2; + // + // var bw = this.css.viewPageButtonNode.width.toInt()+this.css.viewPageButtonNode["margin-right"].toInt(); + // var count = (w/bw).toInt()-2; + // if (count>10) count = 10; + // this.showPageCount = Math.min(count, this.pages); + // + // var tmp = this.showPageCount/2; + // var n = tmp.toInt(); + // var left = this.currentPage-n; + // if (left<=0) left = 1; + // var right = this.showPageCount + left-1; + // if (right>this.pages) right = this.pages; + // left = right-this.showPageCount+1; + // if (left<=1) left = 1; + // + // this.viewPagePrevNode = new Element("div", {"styles": this.css.viewPagePrevButtonNode}).inject(this.viewPageContentNode); + // this.loadPageButtonEvent(this.viewPagePrevNode, "viewPagePrevButtonNode_over", "viewPagePrevButtonNode_up", "viewPagePrevButtonNode_down", function(){ + // if (this.currentPage>1) this.currentPage--; + // this.loadCurrentPageData(); + // }.bind(this)); + // + // for (i=left; i<=right; i++){ + // var node = new Element("div", {"styles": this.css.viewPageButtonNode, "text": i}).inject(this.viewPageContentNode); + // if (i==this.currentPage){ + // node.setStyles(this.css.viewPageButtonNode_current); + // }else{ + // this.loadPageButtonEvent(node, "viewPageButtonNode_over", "viewPageButtonNode_up", "viewPageButtonNode_down", function(e){ + // this.currentPage = e.target.get("text").toInt(); + // this.loadCurrentPageData(); + // }.bind(this)); + // } + // } + // this.viewPageNextNode = new Element("div", {"styles": this.css.viewPageNextButtonNode}).inject(this.viewPageContentNode); + // this.loadPageButtonEvent(this.viewPageNextNode, "viewPageNextButtonNode_over", "viewPageNextButtonNode_up", "viewPageNextButtonNode_down", function(){ + // if (this.currentPage<=this.pages-1) this.currentPage++; + // this.loadCurrentPageData(); + // }.bind(this)); + // }, + // loadPageButtonEvent: function(node, over, out, down, click){ + // node.addEvents({ + // "mouseover": function(){node.setStyles(this.css[over])}.bind(this), + // "mouseout": function(){node.setStyles(this.css[out])}.bind(this), + // "mousedown": function(){node.setStyles(this.css[down])}.bind(this), + // "mouseup": function(){node.setStyles(this.css[out])}.bind(this), + // "click": click + // }); + // }, + // _loadPageNode: function(){ + // this.viewPageAreaNode.empty(); + // this.viewPageFirstNode = new Element("div", {"styles": this.css.viewPageFirstLastNode, "text": this.lp.firstPage}).inject(this.viewPageAreaNode); + // this.viewPageContentNode = new Element("div", {"styles": this.css.viewPageContentNode}).inject(this.viewPageAreaNode); + // this.viewPageLastNode = new Element("div", {"styles": this.css.viewPageFirstLastNode, "text": this.lp.lastPage}).inject(this.viewPageAreaNode); + // this._loadPageCountNode(); + // + // this.loadPageButtonEvent(this.viewPageFirstNode, "viewPageFirstLastNode_over", "viewPageFirstLastNode_up", "viewPageFirstLastNode_down", function(){ + // this.currentPage = 1; + // this.loadCurrentPageData(); + // }.bind(this)); + // this.loadPageButtonEvent(this.viewPageLastNode, "viewPageFirstLastNode_over", "viewPageFirstLastNode_up", "viewPageFirstLastNode_down", function(){ + // this.currentPage = this.pages; + // this.loadCurrentPageData(); + // }.bind(this)); + // }, + _loadPageNode : function(){ + debugger; this.viewPageAreaNode.empty(); - this.viewPageFirstNode = new Element("div", {"styles": this.css.viewPageFirstLastNode, "text": this.lp.firstPage}).inject(this.viewPageAreaNode); - this.viewPageContentNode = new Element("div", {"styles": this.css.viewPageContentNode}).inject(this.viewPageAreaNode); - this.viewPageLastNode = new Element("div", {"styles": this.css.viewPageFirstLastNode, "text": this.lp.lastPage}).inject(this.viewPageAreaNode); - this._loadPageCountNode(); - - this.loadPageButtonEvent(this.viewPageFirstNode, "viewPageFirstLastNode_over", "viewPageFirstLastNode_up", "viewPageFirstLastNode_down", function(){ - this.currentPage = 1; - this.loadCurrentPageData(); - }.bind(this)); - this.loadPageButtonEvent(this.viewPageLastNode, "viewPageFirstLastNode_over", "viewPageFirstLastNode_up", "viewPageFirstLastNode_down", function(){ - this.currentPage = this.pages; - this.loadCurrentPageData(); - }.bind(this)); + this.paging = new o2.widget.Paging(this.viewPageAreaNode, { + countPerPage: this.json.pageSize || this.options.perPageCount, + visiblePages: 10, + currentPage: this.currentPage, + itemSize: this.count, + pageSize: this.pages, + hasNextPage: true, + hasPrevPage: true, + hasTruningBar: true, + hasJumper: true, + hiddenWithDisable: false, + hiddenWithNoItem: true, + text: { + prePage: "", + nextPage: "", + firstPage: this.lp.firstPage, + lastPage: this.lp.lastPage + }, + onJumpingPage : function( pageNum, itemNum ){ + this.currentPage = pageNum; + this.loadCurrentPageData(); + }.bind(this) + }); + this.paging.load(); }, _initPage: function(){ this.count = this.bundleItems.length; @@ -737,98 +766,6 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({ } }.bind(this)); }, - //api 使用 开始 - getParentEnvironment : function(){ - return this.parentMacro ? this.parentMacro.environment : null; - }, - getViewInfor : function(){ - return this.json; - }, - getPageInfor : function(){ - return { - pages : this.pages, - perPageCount : this.options.perPageCount, - currentPageNumber : this.currentPage - }; - }, - getPageData : function () { - return this.gridJson; - }, - toPage : function( pageNumber, callback ){ - this.currentPage = pageNumber; - this.loadCurrentPageData( callback ); - }, - selectAll : function(){ - var flag = this.json.select || this.viewJson.select || "none"; - if ( flag==="multi"){ - this.items.each( function (item) { - if( item.clazzType === "item" ){ - item.selected(); - }else{ - item.expand(); - if( item.items ){ - item.items.each( function (it) { - it.selected(); - }) - } - } - }) - } - }, - unSelectAll : function(){ - var flag = this.json.select || this.viewJson.select || "none"; - if ( flag==="multi"){ - this.items.each( function (item) { - if( item.clazzType === "item" ){ - item.unSelected(); - }else{ - if(item.items){ - item.items.each( function (it) { - it.unSelected(); - }) - } - } - }) - } - }, - setFilter : function( filter ){ - if( !filter )filter = []; - if( typeOf( filter ) === "object" )filter = [ filter ]; - this.json.filter = filter; - this.createViewNode({"filterList": this.json.filter ? this.json.filter.clone() : null}); - }, - switchView : function( json ){ - debugger; - // json = { - // "application": application, - // "viewName": viewName, - // "isTitle": "yes", - // "select": "none", - // "titleStyles": titleStyles, - // "itemStyles": itemStyles, - // "isExpand": "no", - // "filter": filter - // } - this.node.setStyle("display", "block"); - if (this.loadingAreaNode) this.loadingAreaNode.setStyle("display", "block"); - - this.searchMorph = null; - this.viewSearchCustomContentNode = null; - - var newJson = Object.merge( Object.clone(this.originalJson), json ); - this.container.empty(); - this.initialize( this.container, newJson, Object.clone(this.options), this.app, this.parentMacro); - }, - confirm: function (type, e, title, text, width, height, ok, cancel, callback, mask, style) { - this.app.confirm(type, e, title, text, width, height, ok, cancel, callback, mask, style) - }, - alert: function (type, title, text, width, height) { - this.app.alert(type, "center", title, text, width, height); - }, - notice: function (content, type, target, where, offset, option) { - this.app.notice(content, type, target, where, offset, option) - }, - //api 使用 结束 loadCurrentPageData: function( callback ){ debugger; //是否需要在翻页的时候清空之前的items ? @@ -1096,7 +1033,100 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({ } } }.bind(this)); + }, + + //api 使用 开始 + getParentEnvironment : function(){ + return this.parentMacro ? this.parentMacro.environment : null; + }, + getViewInfor : function(){ + return this.json; + }, + getPageInfor : function(){ + return { + pages : this.pages, + perPageCount : this.options.perPageCount, + currentPageNumber : this.currentPage + }; + }, + getPageData : function () { + return this.gridJson; + }, + toPage : function( pageNumber, callback ){ + this.currentPage = pageNumber; + this.loadCurrentPageData( callback ); + }, + selectAll : function(){ + var flag = this.json.select || this.viewJson.select || "none"; + if ( flag==="multi"){ + this.items.each( function (item) { + if( item.clazzType === "item" ){ + item.selected(); + }else{ + item.expand(); + if( item.items ){ + item.items.each( function (it) { + it.selected(); + }) + } + } + }) + } + }, + unSelectAll : function(){ + var flag = this.json.select || this.viewJson.select || "none"; + if ( flag==="multi"){ + this.items.each( function (item) { + if( item.clazzType === "item" ){ + item.unSelected(); + }else{ + if(item.items){ + item.items.each( function (it) { + it.unSelected(); + }) + } + } + }) + } + }, + setFilter : function( filter ){ + if( !filter )filter = []; + if( typeOf( filter ) === "object" )filter = [ filter ]; + this.json.filter = filter; + this.createViewNode({"filterList": this.json.filter ? this.json.filter.clone() : null}); + }, + switchView : function( json ){ + debugger; + // json = { + // "application": application, + // "viewName": viewName, + // "isTitle": "yes", + // "select": "none", + // "titleStyles": titleStyles, + // "itemStyles": itemStyles, + // "isExpand": "no", + // "filter": filter + // } + this.node.setStyle("display", "block"); + if (this.loadingAreaNode) this.loadingAreaNode.setStyle("display", "block"); + + this.searchMorph = null; + this.viewSearchCustomContentNode = null; + + var newJson = Object.merge( Object.clone(this.originalJson), json ); + this.container.empty(); + this.initialize( this.container, newJson, Object.clone(this.options), this.app, this.parentMacro); + }, + confirm: function (type, e, title, text, width, height, ok, cancel, callback, mask, style) { + this.app.confirm(type, e, title, text, width, height, ok, cancel, callback, mask, style) + }, + alert: function (type, title, text, width, height) { + this.app.alert(type, "center", title, text, width, height); + }, + notice: function (content, type, target, where, offset, option) { + this.app.notice(content, type, target, where, offset, option) } + //api 使用 结束 }); MWF.xApplication.query.Query.Viewer.Item = new Class({ diff --git a/o2web/source/x_component_query_ViewDesigner/$View/skin/styles_blue-flat.json b/o2web/source/x_component_query_ViewDesigner/$View/skin/styles_blue-flat.json index 6c7176e1f4..5dedac372b 100644 --- a/o2web/source/x_component_query_ViewDesigner/$View/skin/styles_blue-flat.json +++ b/o2web/source/x_component_query_ViewDesigner/$View/skin/styles_blue-flat.json @@ -43,5 +43,8 @@ "iconOverStyle": "xform_blue_flat_over", "customIconStyle" : "blue", "customIconOverStyle" : "white" + }, + "paging" : { + } } \ No newline at end of file -- GitLab