diff --git a/o2web/source/x_component_process_FormDesigner/Module/Statement/statement.html b/o2web/source/x_component_process_FormDesigner/Module/Statement/statement.html
index e12abe07e788ba0b67dcfce22dba68fc006b9440..727824165386c2f96a4d5f56b639e48b817221c5 100644
--- a/o2web/source/x_component_process_FormDesigner/Module/Statement/statement.html
+++ b/o2web/source/x_component_process_FormDesigner/Module/Statement/statement.html
@@ -161,9 +161,7 @@
默认过滤条件
-
- 自定义过滤数据
-
+
默认过滤条件
-
-
自定义过滤数据
-
+
+
+
diff --git a/o2web/source/x_component_process_FormDesigner/Property.js b/o2web/source/x_component_process_FormDesigner/Property.js
index c1d0bd07303025d0d185ebe4e16d992b3869b16d..6e21b04d76543793193b7615086e201e86329b45 100644
--- a/o2web/source/x_component_process_FormDesigner/Property.js
+++ b/o2web/source/x_component_process_FormDesigner/Property.js
@@ -525,12 +525,12 @@ MWF.xApplication.process.FormDesigner.Property = MWF.FCProperty = new Class({
nodes.each(function(node){
MWF.xDesktop.requireApp("query.StatementDesigner", "widget.ViewFilter", function(){
var _slef = this;
- this.viewFilter = new MWF.xApplication.query.StatementDesigner.widget.ViewFilter(node, this.form.designer, {"filtrData": filtrData, "customData": null}, {
+ this.viewFilter = new MWF.xApplication.query.StatementDesigner.widget.ViewFilter(node, this.form.designer, {"filtrData": filtrData, "customData": null, "parameterData": null}, {
"statementId" : this.data.queryStatement ? this.data.queryStatement.id : "",
"withForm" : true,
"onChange": function(ids){
var data = this.getData();
- _slef.changeJsonDate(["filterList"], data.data);
+ _slef.changeJsonDate(["filterList"], data.filterData);
//_slef.changeJsonDate(["data", "customFilterEntryList"], data.customData);
}
});
diff --git a/o2web/source/x_component_query_Query/Statement.js b/o2web/source/x_component_query_Query/Statement.js
index 3438ea1276ac630b0f8afe3d1a7241688343470c..afab88ef5706b6418071068633b27afdf3b72e34 100644
--- a/o2web/source/x_component_query_Query/Statement.js
+++ b/o2web/source/x_component_query_Query/Statement.js
@@ -157,11 +157,13 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
( data.filterList || [] ).each( function (d) {
var parameterName = d.path.replace(/\./g, "_");
var value = d.value;
- if( d.code && d.code.code ){
- value = this.Macro.exec( d.code.code, this);
- }
+ // if( d.code && d.code.code ){
+ // value = this.Macro.exec( d.code.code, this);
+ // }
if( d.comparison === "like" || d.comparison === "notLike" ){
- this.parameter[ parameterName ] = "%"+value+"%";
+ if( value.substr(0, 1) !== "%" )value = "%"+value;
+ if( value.substr(value.length-1,1) !== "%" )value = value+"%";
+ this.parameter[ parameterName ] = value; //"%"+value+"%";
}else{
if( d.formatType === "dateTimeValue" || d.formatType === "datetimeValue"){
value = "{ts '"+value+"'}"
diff --git a/o2web/source/x_component_query_StatementDesigner/$Statement/view.html b/o2web/source/x_component_query_StatementDesigner/$Statement/view.html
index 3af2a2cde263ba7ee81a4c1d9aebaa45a1b7399e..708145373b91dc654047c80d6a1fce562eb8cfb8 100644
--- a/o2web/source/x_component_query_StatementDesigner/$Statement/view.html
+++ b/o2web/source/x_component_query_StatementDesigner/$Statement/view.html
@@ -343,9 +343,9 @@
默认过滤条件
-
+
自定义过滤数据
-
+
diff --git a/o2web/source/x_component_query_StatementDesigner/Property.js b/o2web/source/x_component_query_StatementDesigner/Property.js
index 434b4237c1b0fc67594948e540c16b3019467eb0..7b2d0204232639d8d012005e2c431c3a62842e0d 100644
--- a/o2web/source/x_component_query_StatementDesigner/Property.js
+++ b/o2web/source/x_component_query_StatementDesigner/Property.js
@@ -58,18 +58,18 @@ MWF.xApplication.query.StatementDesigner.Property = MWF.SDProperty = new Class({
},
loadViewFilter: function () {
var nodes = this.propertyContent.getElements(".MWFViewFilter");
- var filtrData = this.view.data.data.filterList;
+ var parameterData = this.view.data.data.parameterList;
var customData = this.view.data.data.customFilterList;
nodes.each(function (node) {
MWF.xDesktop.requireApp("query.StatementDesigner", "widget.ViewFilter", function () {
var _slef = this;
this.viewFilter = new MWF.xApplication.query.StatementDesigner.widget.ViewFilter(node, this.view.designer, {
- "filtrData": filtrData,
+ "parameterData": parameterData,
"customData": customData
}, {
"onChange": function (ids) {
var data = this.getData();
- _slef.changeJsonDate(["data", "filterList"], data.data);
+ _slef.changeJsonDate(["data", "parameterList"], data.parameterData);
_slef.changeJsonDate(["data", "customFilterList"], data.customData);
}
});
diff --git a/o2web/source/x_component_query_StatementDesigner/widget/ViewFilter.js b/o2web/source/x_component_query_StatementDesigner/widget/ViewFilter.js
index 8f1704439f088b5ce6ef65e2b2943285a91b8b0f..5527be9ec85d517f1c566c239bcf2ab4088d8d0c 100644
--- a/o2web/source/x_component_query_StatementDesigner/widget/ViewFilter.js
+++ b/o2web/source/x_component_query_StatementDesigner/widget/ViewFilter.js
@@ -50,21 +50,21 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
}
},
loadData: function () {
- if (this.filtrData.parameterData && this.filtrData.parameterData.length) {
+ if (this.filtrData.parameterData && this.filtrData.parameterData.length && this.parameterListAreaNode) {
this.filtrData.parameterData.each(function (data) {
data.type = "parameter";
this.items.push(new MWF.xApplication.query.StatementDesigner.widget.ViewFilter.ItemParameter(this, data));
}.bind(this));
}
- if (this.filtrData.filtrData && this.filtrData.filtrData.length) {
+ if (this.filtrData.filtrData && this.filtrData.filtrData.length && this.filterListAreaNode ) {
this.filtrData.filtrData.each(function (data) {
data.type = "filter";
this.items.push(new MWF.xApplication.query.StatementDesigner.widget.ViewFilter.ItemFilter(this, data));
}.bind(this));
}
- if (this.filtrData.customData && this.filtrData.customData.length) {
+ if (this.filtrData.customData && this.filtrData.customData.length && this.customFilterListAreaNode ) {
this.filtrData.customData.each(function (data) {
data.type = "custom";
this.items.push(new MWF.xApplication.query.StatementDesigner.widget.ViewFilter.ItemCustom(this, data));
@@ -138,8 +138,10 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
this.inputAreaNode = this.node.getElement(".inputAreaNode_vf");
this.actionAreaNode = this.node.getElement(".actionAreaNode_vf");
this.actionAreaNode.setStyles(this.css.actionAreaNode);
- this.listAreaNode = this.node.getElement(".listAreaNode_vf");
- this.fieldListAreaNode = this.node.getElement(".fieldListAreaNode_vf");
+
+ this.filterListAreaNode = this.node.getElement(".filterListAreaNode_vf");
+ this.parameterListAreaNode = this.node.getElement(".parameterListAreaNode_vf");
+ this.customFilterListAreaNode = this.node.getElement(".customFilterListAreaNode_vf");
this.restrictViewFilterTable = this.node.getElement(".restrictViewFilterTable_vf");
@@ -156,6 +158,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
this.datatypeInput = this.inputAreaNode.getElement(".datatypeInput_vf");
this.restrictParameterInput = this.inputAreaNode.getElement(".restrictParameterInput_vf");
+ this.restrictFilterInput = this.inputAreaNode.getElement(".restrictFilterInput_vf");
this.customFilterInput = this.inputAreaNode.getElement(".customFilterInput_vf");
// this.logicInput = this.inputAreaNode.getElement(".logicInput_vf");
@@ -272,8 +275,8 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
case "date":
t = "dateTimeValue";
break;
- // t = "dateValue";
- // break;
+ // t = "dateValue";
+ // break;
case "time":
t = "timeValue";
break;
@@ -520,15 +523,19 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
},
modifyOrAddFilterItem: function () {
var flag;
+ var type;
if (this.currentItem) {
flag = this.modifyFilterItem();
} else {
- if( this.options.withForm ){
- flag = this.addFilterItemWithForm();
- }else if (this.restrictParameterInput.checked) {
+ if( this.restrictFilterInput && this.restrictFilterInput.checked ){ //this.options.withForm this.restrictParameterInput
+ flag = this.addFilterItem();
+ type = "filter"
+ }else if ( this.restrictParameterInput && this.restrictParameterInput.checked) {
flag = this.addParameterItem();
+ type = "parameter"
} else {
flag = this.addCustomFilterItem();
+ type = "custom"
}
}
if( flag ){
@@ -537,7 +544,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
"path": "",
"parameter" : "",
"title": "",
- "type": this.restrictParameterInput.checked ? "parameter" : "custom",
+ "type": type,
"comparison": "equals",
"formatType": "textValue",
"value": "",
@@ -548,14 +555,14 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
},
modifyFilterItem: function () {
var data = this.getInputData();
- if( this.options.withForm ){
+ if( this.restrictFilterInput && this.restrictFilterInput.checked ){ //this.options.withForm
if (this.verificationDataWithForm(data)) {
this.currentItem.reload(data);
this.currentItem.unSelected();
this.fireEvent("change");
return true;
}
- }else if( this.restrictParameterInput.checked ){
+ }else if( this.restrictParameterInput && this.restrictParameterInput.checked ){
if (this.verificationData(data)) {
this.currentItem.reload(data);
this.currentItem.unSelected();
@@ -750,8 +757,11 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
var parameter = this.parameterInput ? this.parameterInput.get("value") : "";
var title = this.titleInput.get("value");
- if (this.restrictParameterInput.checked) var type = "parameter";
- if (this.customFilterInput.checked) var type = "custom";
+
+ var type = "custom";
+ if ( this.restrictFilterInput && this.restrictFilterInput.checked) type = "filter";
+ if ( this.restrictParameterInput && this.restrictParameterInput.checked) type = "parameter";
+ if (this.customFilterInput.checked) type = "custom";
// var comparison = this.comparisonInput.options[this.comparisonInput.selectedIndex].value;
var comparison = "";
@@ -800,7 +810,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
//}
break;
}
- if (this.options.withForm ) {
+ if ( type === "filter" ) { //this.options.withForm
return {
// "logic": "and",
"path": path,
@@ -898,9 +908,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
} catch (e) {
}
- if( this.options.withForm ){
- this.switchInputDisplay();
- }else{
+ if (data.type === "parameter"){
switch (data.formatType) {
case "textValue":
this.valueTextInput.set("value", data.value);
@@ -937,66 +945,52 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
break;
}
}
- //if (this.valueBooleanInput2){
- // for (var i=0; i