From 5fb74f8c1d57d5a7af9ff5e05a2459d557c4b4ab Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Mar 2022 15:12:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E5=9B=BE=E3=80=81=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E6=95=B0=E6=8D=AE=E4=B8=AD=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=BA=8F=E5=8F=B7=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E6=90=9C=E7=B4=A2=E6=9D=A1=E4=BB=B6=E4=B8=BA?= =?UTF-8?q?=E6=95=B0=E5=AD=97=E6=97=B6=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../x_component_query_Query/Statement.js | 56 +++++++++++++++++-- .../source/x_component_query_Query/Viewer.js | 5 +- 2 files changed, 55 insertions(+), 6 deletions(-) diff --git a/o2web/source/x_component_query_Query/Statement.js b/o2web/source/x_component_query_Query/Statement.js index 0bab682973..3c0d807040 100644 --- a/o2web/source/x_component_query_Query/Statement.js +++ b/o2web/source/x_component_query_Query/Statement.js @@ -512,6 +512,55 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({ this.searchCustomView(); } }, + searchView: function(){ + debugger; + if (this.viewJson.customFilterList) { + var key = this.viewSearchInputNode.get("value"); + if (key && key !== this.lp.searchKeywork) { + var filterData = []; + this.filterItems = []; + this.viewJson.customFilterList.each(function (entry) { + if (entry.formatType === "textValue") { + var d = { + "path": entry.path, + "value": key, + "formatType": entry.formatType, + "logic": "or", + "comparison": "like" + }; + filterData.push(d); + this.filterItems.push({"data":d}); + } + if (entry.formatType === "numberValue") { + var v = key.toFloat(); + if (!isNaN(v)) { + var d = { + "path": entry.path, + "value": v, + "formatType": entry.formatType, + "logic": "or", + "comparison": "equals" + }; + filterData.push(d); + this.filterItems.push({"data":d}); + } + } + }.bind(this)); + + if( this.json.filter ){ + this.json.filter.clone().each(function(f){ + filterData.push(f); + }) + } + + this.createViewNode({"filterList": filterData}); + }else{ + this.filterItems = []; + var filterData = this.json.filter ? this.json.filter.clone() : []; + this.createViewNode( {"filterList": filterData} ); + } + } + }, //搜索相关结束 getStatementInfor: function () { debugger; @@ -737,15 +786,14 @@ MWF.xApplication.query.Query.Statement.Item = new Class({ //} //序号 + var sequence = 1 + this.view.json.pageSize * (this.view.currentPage - 1) + this.idx; + this.data["$sequence"] = sequence; if (this.view.viewJson.isSequence === "yes") { this.sequenceTd = new Element("td", {"styles": viewContentTdNode}).inject(this.node); this.sequenceTd.setStyle("width", "10px"); - var s = 1 + this.view.json.pageSize * (this.view.currentPage - 1) + this.idx; - this.sequenceTd.set("text", s); + this.sequenceTd.set("text", sequence); } - debugger; - Object.each(this.view.entries, function (c, k) { //if (cell){ if (this.view.hideColumns.indexOf(k) === -1) { diff --git a/o2web/source/x_component_query_Query/Viewer.js b/o2web/source/x_component_query_Query/Viewer.js index 914289fb0a..6d62e3f2bd 100644 --- a/o2web/source/x_component_query_Query/Viewer.js +++ b/o2web/source/x_component_query_Query/Viewer.js @@ -1814,11 +1814,12 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({ //} //序号 + var sequence = 1+this.view.json.pageSize*(this.view.currentPage-1)+this.idx; + this.data["$sequence"] = sequence; if (this.view.viewJson.isSequence==="yes"){ this.sequenceTd = new Element("td", {"styles": viewContentTdNode}).inject(this.node); this.sequenceTd.setStyle("width", "10px"); - var s= 1+this.view.json.pageSize*(this.view.currentPage-1)+this.idx; - this.sequenceTd.set("text", s); + this.sequenceTd.set("text", sequence); } Object.each(this.view.entries, function(c, k){ -- GitLab