From 5643419fc8d80cea2c66163e1fb998654cb01ff2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Apr 2020 18:18:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E8=A7=86=E5=9B=BE=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E8=BF=87=E6=BB=A4=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../$View/view.html | 147 +++--- .../widget/ViewFilter.js | 486 ++++++++++++++---- 2 files changed, 470 insertions(+), 163 deletions(-) diff --git a/o2web/source/x_component_query_ViewDesigner/$View/view.html b/o2web/source/x_component_query_ViewDesigner/$View/view.html index 5aeb070593..fd7a649cd4 100644 --- a/o2web/source/x_component_query_ViewDesigner/$View/view.html +++ b/o2web/source/x_component_query_ViewDesigner/$View/view.html @@ -426,40 +426,40 @@ + // if (this.selectedIndex==8){ + // $('text{$.id}viewFilterValue2Area').setStyle('display', 'block'); + // $('text{$.id}viewFilterValueTitleArea').set('text', '从'); + // }else{ + // $('text{$.id}viewFilterValue2Area').setStyle('display', 'none'); + // $('text{$.id}viewFilterValueTitleArea').set('text', '值'); + // }" + > @@ -589,7 +590,8 @@ 到: - + + @@ -602,58 +604,59 @@ - - - -
- - - - - -
- 当前人 - 当前身份
- 当前人所在直接组织
- 当前人所在所有组织 -
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/o2web/source/x_component_query_ViewDesigner/widget/ViewFilter.js b/o2web/source/x_component_query_ViewDesigner/widget/ViewFilter.js index 30955da177..5f2978023c 100644 --- a/o2web/source/x_component_query_ViewDesigner/widget/ViewFilter.js +++ b/o2web/source/x_component_query_ViewDesigner/widget/ViewFilter.js @@ -109,7 +109,12 @@ MWF.xApplication.query.ViewDesigner.widget.ViewFilter = new Class({ this.customFilterInput = this.inputAreaNode.getElement(".customFilterInput_vf"); this.logicInput = this.inputAreaNode.getElement(".logicInput_vf"); + this.comparisonInput = this.inputAreaNode.getElement(".comparisonInput_vf"); + this.comparisonInput.addEvent("change", function(){ + this.switchInputDisplay(); + }.bind(this)) + this.valueTextInput = this.inputAreaNode.getElement(".valueTextInput_vf"); this.valueNumberInput = this.inputAreaNode.getElement(".valueNumberInput_vf"); this.valueDatetimeInput = this.inputAreaNode.getElement(".valueDatetimeInput_vf"); @@ -157,7 +162,8 @@ MWF.xApplication.query.ViewDesigner.widget.ViewFilter = new Class({ }.bind(this)); this.datatypeInput.addEvent("change", function(){ - this.changeValueInput(); + // this.changeValueInput(); + this.switchInputDisplay(); }.bind(this)); this.valueTextInput.addEvent("keydown", function(e){ @@ -214,6 +220,304 @@ MWF.xApplication.query.ViewDesigner.widget.ViewFilter = new Class({ } } }, + switchInputDisplay : function(){ + var id = ""; + if( this.app.view ){ + id = this.app.view.data.id; + } + + var config = { + "textValue": { + "equals": { + "selectorArea" : ["#"+id+"viewFilterTextFormulaSelector"] //["input", "@person", "@unitList", "@unitAllList", "@identityList" ], + }, + "notEquals": { + "selectorArea" : ["#"+id+"viewFilterTextFormulaSelector"] //["input", "@person", "@unitList", "@unitAllList", "@identityList" ], + }, + "greaterThan": { + "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ] + }, + "greaterThanOrEqualTo": { + "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ] + }, + "lessThan": { + "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ] + }, + "lessThanOrEqualTo": { + "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ] + }, + "like": { + "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ] + }, + "notLike": { + "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ] + }, + "range": { + "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ] + } + }, + "numberValue": { + "equals": {}, //["input"] + "notEquals": {}, + "greaterThan": {}, + "greaterThanOrEqualTo": {}, + "lessThan": {}, + "lessThanOrEqualTo": {}, + "range": {} + }, + "dateTimeValue": { + "equals": { + "invalidValue" : ["@year","@season","@month","@time","@date"] + }, + "notEquals": { + "selectorArea" : ["#"+id+"viewFilterDateFormulaSelector"] + }, + "greaterThan": { + "selectorArea" : ["#"+id+"viewFilterDateFormulaSelector"] + }, + "greaterThanOrEqualTo": { + "selectorArea" : ["#"+id+"viewFilterDateFormulaSelector"] + }, + "lessThan": { + "selectorArea" : ["#"+id+"viewFilterDateFormulaSelector"] + }, + "lessThanOrEqualTo": { + "selectorArea" : ["#"+id+"viewFilterDateFormulaSelector"] + }, + "range": { + "invalidValue" : ["@year","@season","@month","@time","@date"] + } + }, + "dateValue": { + "equals": { + "invalidValue" : ["@year","@season","@month","@date"] + }, + "notEquals": { + "selectorArea" : ["#"+id+"viewFilterDateOnlyFormulaSelector"] + }, + "greaterThan":{ + "selectorArea" : ["#"+id+"viewFilterDateOnlyFormulaSelector"] + }, + "greaterThanOrEqualTo": { + "selectorArea" : ["#"+id+"viewFilterDateOnlyFormulaSelector"] + }, + "lessThan": { + "selectorArea" : ["#"+id+"viewFilterDateOnlyFormulaSelector"] + }, + "lessThanOrEqualTo": { + "selectorArea" : ["#"+id+"viewFilterDateOnlyFormulaSelector"] + }, + "range": { + "invalidValue" : ["@year","@season","@month","@date"] + } + }, + "timeValue": { + "equals": { + "invalidValue" : ["@time"] + }, + "notEquals": { + "selectorArea" : ["#"+id+"viewFilterTimeOnlyFormulaSelector"] + }, + "greaterThan": { + "selectorArea" : ["#"+id+"viewFilterTimeOnlyFormulaSelector"] + }, + "greaterThanOrEqualTo": { + "selectorArea" : ["#"+id+"viewFilterTimeOnlyFormulaSelector"] + }, + "lessThan": { + "selectorArea" : ["#"+id+"viewFilterTimeOnlyFormulaSelector"] + }, + "lessThanOrEqualTo": { + "selectorArea" : ["#"+id+"viewFilterTimeOnlyFormulaSelector"] + }, + "range": { + "invalidValue" : ["@time"] + } + }, + "booleanValue": { + "equals": {}, + "notEquals": {} + } + }; + + debugger; + + var formulaSelectorIdList = [ + "#"+id+"viewFilterTextFormulaSelector", + "#"+id+"viewFilterDateFormulaSelector", + "#"+id+"viewFilterDateOnlyFormulaSelector", + "#"+id+"viewFilterTimeOnlyFormulaSelector" + ]; + + var formatType = this.datatypeInput.options[this.datatypeInput.selectedIndex].value; + var object = config[formatType]; + + var availableComparisonList = Object.keys( object ); + var options = this.comparisonInput.options; + + var comparison = options[this.comparisonInput.selectedIndex].value; + + if( !this.originalComparisonOptions ){ + this.originalComparisonOptions = []; + for( var i=0; i< options.length; i++ ){ + this.originalComparisonOptions.push({ + "text" : options[i].text, + "value" : options[i].value + }); + } + } + + while( this.comparisonInput.options && this.comparisonInput.options.length ){ + this.comparisonInput.options[0].destroy(); + } + + for( var i=0; i