提交 087ce24e 编写于 作者: U unknown

查询里增加了视图

上级 29f3e48c
......@@ -83,7 +83,7 @@
<div style="background-color: #eeeeee; border-top:1px solid #999999; height: 24px; line-height: 24px; text-align: center; cursor:pointer">过滤</div>
<div class="MWFStatementFilter">
<div class="inputAreaNode_vf">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable restrictViewFilterTable_vf">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable restrictViewFilterTable_vf" style="table-layout: fixed;">
<tr id="text{$.id}pathInputSelectTr">
<td class="editTableTitle">选择:</td>
<td class="editTableValue">
......
......@@ -110,23 +110,33 @@
<div class="MWFScriptArea" name="defaultSelectedScript" title="默认选中行脚本"></div>
</div>
<div title="过滤" class="MWFTab">
<div class="MWFViewFilter">
<div class="MWFStatementFilter">
<div class="inputAreaNode_vf">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable restrictViewFilterTable_vf">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable restrictViewFilterTable_vf" style="table-layout: fixed;">
<tr id="text{$.id}pathInputSelectTr">
<td class="editTableTitle">选择:</td>
<td class="editTableValue">
<select class="pathInputSelect_vf"></select>
<!-- <div style="line-height: 20px;color:#999;">注:选择路径后,需在选择的值前面加上"表别名.",如:o.</div>-->
</td>
</tr>
<tr style="display:none">
<td class="editTableTitle">标题:</td>
<td class="editTableValue"><input type="text" class="editTableInput titleInput_vf"/></td>
</tr>
<tr>
<td class="editTableTitle">路径:</td>
<td class="editTableValue"><input type="text" class="editTableInput pathInput_vf"/></td>
<td class="editTableValue">
<input type="text" class="editTableInput pathInput_vf"/>
<div style="color: #999">注:路径的写法是"表别名.字段名",如:o.title</div>
</td>
</tr>
<tr>
<td class="editTableTitle">数据类型:</td>
<td class="editTableValue"><select class="datatypeInput_vf">
<option value="textValue" selected>文本</option>
<option value="numberValue">数字</option>
<option value="dateTimeValue">日期</option>
<option value="dateTimeValue">日期时间</option>
<option value="booleanValue">布尔</option>
</select></td>
</tr>
......@@ -139,7 +149,7 @@
</tr>
</table>
<table id="text{$.pid}viewFilterRestrict" width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<tr style="display:none;">
<td class="editTableTitle">逻辑:</td>
<td class="editTableValue"><select class="logicInput_vf">
<option selected value="and">并且(and)</option>
......@@ -184,6 +194,7 @@
<div style="display:none; height: 20px; line-height: 20px; text-align:center; background-color: #eeeeee">自定义过滤数据</div>
<div class="fieldListAreaNode_vf" style="display:none; min-height: 56px; border-bottom:1px solid #CCCCCC; overflow: hidden;"></div>
</div>
<div class="MWFScriptArea" name="defaultSelectedScript" title="默认选中行脚本"></div>
</div>
<div title="事件" class="MWFTab">
......
......@@ -519,12 +519,15 @@ MWF.xApplication.process.FormDesigner.Property = MWF.FCProperty = new Class({
}
},
loadStatementFilter: function(){
debugger;
var nodes = this.propertyContent.getElements(".MWFStatementFilter");
var filtrData = this.data.filterList;
nodes.each(function(node){
MWF.xDesktop.requireApp("query.StatementDesigner", "widget.ViewFilter", function(){
var _slef = this;
new MWF.xApplication.query.StatementDesigner.widget.ViewFilter(node, this.form.designer, {"filtrData": filtrData, "customData": null}, {
"statementId" : this.data.queryStatement ? this.data.queryStatement.id : "",
"withForm" : true,
"onChange": function(ids){
var data = this.getData();
_slef.changeJsonDate(["filterList"], data.data);
......
......@@ -109,7 +109,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
debugger;
this.loadParameter();
this.loadFilter( data );
this.loadFilter( d );
this.currentPage = this.options.defaultPage || 1;
this.options.defaultPage = null;
......@@ -149,13 +149,17 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
// }.bind(this));
},
loadFilter : function( data ){
debugger;
this.filterList = [];
( 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.comparison === "like" || d.comparison === "notLike" ){
this.parameter[ parameterName ] = "%"+d.value+"%";
this.parameter[ parameterName ] = "%"+value+"%";
}else{
var value = d.value;
if( d.formatType === "dateTimeValue" || d.formatType === "datetimeValue"){
value = "{ts '"+value+"'}"
}else if( d.formatType === "dateValue" ){
......
......@@ -807,10 +807,11 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
});
},
searchView: function(){
debugger;
if (this.viewJson.customFilterList) {
var key = this.viewSearchInputNode.get("value");
if (key && key !== this.lp.searchKeywork) {
var filterData = this.json.filter ? this.json.filter : [];
var filterData = this.json.filter ? this.json.filter.clone() : [];
this.filterItems = [];
this.viewJson.customFilterList.each(function (entry) {
if (entry.formatType === "textValue") {
......@@ -843,7 +844,8 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
this.createViewNode({"filterList": filterData});
}else{
this.filterItems = [];
this.createViewNode();
var filterData = this.json.filter ? this.json.filter.clone() : [];
this.createViewNode( {"filterList": filterData} );
}
}
},
......
......@@ -32,7 +32,7 @@
<div style="border-top: 1px solid #999; margin-top:10px">
<div style="background-color: #EEE; height:24px; line-height: 24px; text-align: center; font-weight: bold">数据</div>
<div class="MWFDataData" id="text{$.pid}dataDataEditor">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable" style="table-layout: fixed;">
<tr>
<td class="editTableTitle">选择路径:</td>
<td class="editTableValue">
......
......@@ -99,7 +99,7 @@
<div title="过滤" class="MWFTab">
<div class="MWFViewFilter">
<div class="inputAreaNode_vf">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable restrictViewFilterTable_vf">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable restrictViewFilterTable_vf" style="table-layout: fixed;">
<tr id="text{$.id}pathInputSelectTr">
<td class="editTableTitle">选择:</td>
<td class="editTableValue">
......
......@@ -665,17 +665,18 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
var type = option.retrieve("type");
var field = option.retrieve("field");
if( !field )return;
var text = " " + field.name;
if( this.countJpqlPage && this.countJpqlPage.isShow && !this.countJpqlPage.disabled ){
if( this.data.format === "script" && this.countScriptEditor.jsEditor ){
this.countScriptEditor.jsEditor.insertValue( field.name );
this.countScriptEditor.jsEditor.insertValue( text );
}else{
this.countEditor.insertValue( field.name );
this.countEditor.insertValue( text );
}
}else{
if( this.data.format === "script" && this.scriptEditor.jsEditor ){
this.scriptEditor.jsEditor.insertValue( field.name );
this.scriptEditor.jsEditor.insertValue( text );
}else{
this.editor.insertValue( field.name );
this.editor.insertValue( text );
}
}
}.bind(this))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册