提交 108e6831 编写于 作者: U unknown

查询中增加视图功能

上级 f4f79182
{
"id": "",
"name": "",
"type": "statementSelector",
"type": "StatementSelector",
"description": "",
"titleStyles": {},
"itemStyles": {},
......
......@@ -252,11 +252,12 @@ MWF.xApplication.query.Query.StatementItem = new Class({
loadView: function(){
MWF.xDesktop.requireApp("query.Query", "Statement",function(){
this.viewContent.empty();
this.viewer = new MWF.QStatement(this.app, this.viewContent, {
debugger;
this.viewer = new MWF.QStatement( this.viewContent, {
"application": this.view.query,
"statementName": this.view.name,
"statementId" : this.view.id
});
},{}, this.app);
}.bind(this));
}
});
\ No newline at end of file
......@@ -155,7 +155,15 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
if( d.comparison === "like" || d.comparison === "notLike" ){
this.parameter[ parameterName ] = "%"+d.value+"%";
}else{
this.parameter[ parameterName ] = d.value;
var value = d.value;
if( d.formatType === "dateTimeValue" || d.formatType === "datetimeValue"){
value = "{ts '"+value+"'}"
}else if( d.formatType === "dateValue" ){
value = "{d '"+value+"'}"
}else if( d.formatType === "timeValue" ){
value = "{t '"+value+"'}"
}
this.parameter[ parameterName ] = value;
}
d.value = parameterName;
......@@ -163,6 +171,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
}.bind(this))
},
loadParameter : function(){
this.parameter = {};
( this.viewJson.filterList || [] ).each( function (f) {
var value = f.value;
debugger;
......@@ -177,17 +186,17 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
case "@identityList":
value = user.identityList.map( function (d) {
return d.distinguishedName;
})
});
break;
case "@unitList":
o2.Actions.load("x_organization_assemble_express").UnitAction.listWithPerson({ "personList" : [user.distinguishedName] }, function (json) {
value = json.unitList;
}, null, false)
}, null, false);
break;
case "@unitAllList":
o2.Actions.load("x_organization_assemble_express").UnitAction.listWithIdentitySupNested({ "personList" : [user.distinguishedName] }, function (json) {
value = json.unitList;
}, null, false)
}, null, false);
break;
case "@year":
value = (new Date().getFullYear()).toString();
......@@ -216,6 +225,13 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
default:
}
}
if( f.formatType === "dateTimeValue" || f.formatType === "datetimeValue"){
value = "{ts '"+value+"'}"
}else if( f.formatType === "dateValue" ){
value = "{d '"+value+"'}"
}else if( f.formatType === "timeValue" ){
value = "{t '"+value+"'}"
}
this.parameter[ f.parameter ] = value;
}.bind(this))
},
......@@ -241,7 +257,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
//this.createLoadding();
this.loadViewRes = o2.Actions.load("x_query_assemble_surface").StatementAction.executeV2(
this.json.statementId || this.json.statementName,
this.options.statementId || this.options.statementName || this.json.statementId || this.json.statementName,
type || "data", p, this.json.pageSize, d, function(json){
if( type === "all" || type === "count" ){
......
......@@ -39,6 +39,7 @@
<div style="margin-left: 30px;" class="o2_statement_statementDesignerTitle">{{$.lp.statementTable}}: </div>
<div class="o2_statement_statementDesignerOfficialTable">
<select>
<option value=""></option>
<option value="com.x.processplatform.core.entity.content.Task" {{if $.data.entityClassName =='com.x.processplatform.core.entity.content.Task'}} selected {{end if}}>待办(Task)</option>
<option value="com.x.processplatform.core.entity.content.TaskCompleted" {{if $.data.entityClassName =='com.x.processplatform.core.entity.content.TaskCompleted'}} selected {{end if}}>已办(TaskCompleted)</option>
<option value="com.x.processplatform.core.entity.content.Read" {{if $.data.entityClassName =='com.x.processplatform.core.entity.content.Read'}} selected {{end if}}>待阅(Read)</option>
......
......@@ -111,12 +111,12 @@
<td class="editTableTitle">标题:</td>
<td class="editTableValue"><input type="text" class="editTableInput titleInput_vf"/></td>
</tr>
<tr id="text{$.id}parameterInputSelectTr" style="display: none">
<td class="editTableTitle">选择参数:</td>
<td class="editTableValue">
<select class="parameterInputSelect_vf"></select>
</td>
</tr>
<!-- <tr id="text{$.id}parameterInputSelectTr" style="display: none">-->
<!-- <td class="editTableTitle">选择参数:</td>-->
<!-- <td class="editTableValue">-->
<!-- <select class="parameterInputSelect_vf"></select>-->
<!-- </td>-->
<!-- </tr>-->
<tr id="text{$.id}parameterInputTr" style="display: none">
<td class="editTableTitle">参数:</td>
<td class="editTableValue">
......@@ -174,7 +174,7 @@
debugger;
$('text{$.id}viewFilterRestrict').setStyle('display', 'block');
$('text{$.id}parameterInputTr').setStyle('display', 'table-row');
$('text{$.id}parameterInputSelectTr').setStyle('display', 'table-row');
// $('text{$.id}parameterInputSelectTr').setStyle('display', 'table-row');
$('text{$.id}viewCustomFilterRestrict').setStyle('display', 'none');
$('text{$.id}pathInputTr').setStyle('display', 'none');
$('text{$.id}pathInputSelectTr').setStyle('display', 'none');
......@@ -182,7 +182,7 @@
<input type="radio" class="customFilterInput_vf" value="custom" name="text{$.id}viewFilterType" onclick="if (this.checked){
$('text{$.id}viewFilterRestrict').setStyle('display', 'none');
$('text{$.id}parameterInputTr').setStyle('display', 'none');
$('text{$.id}parameterInputSelectTr').setStyle('display', 'none');
// $('text{$.id}parameterInputSelectTr').setStyle('display', 'none');
$('text{$.id}viewCustomFilterRestrict').setStyle('display', 'block');
$('text{$.id}pathInputTr').setStyle('display', 'table-row');
$('text{$.id}pathInputSelectTr').setStyle('display', 'table-row');
......
......@@ -576,7 +576,9 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
debugger;
var entityClassName = e.target.options[e.target.selectedIndex].value;
this.json.entityClassName = entityClassName;
this.changeEditorEntityClassName( entityClassName.split(".").getLast() );
if( entityClassName ){
this.changeEditorEntityClassName( entityClassName.split(".").getLast() );
}
// var className = e.target.options[e.target.selectedIndex].value;
......
......@@ -126,7 +126,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
this.pathInput = this.inputAreaNode.getElement(".pathInput_vf");
this.pathInputSelect = this.inputAreaNode.getElement(".pathInputSelect_vf");
this.parameterInput = this.inputAreaNode.getElement(".parameterInput_vf");
this.parameterInputSelect = this.inputAreaNode.getElement(".parameterInputSelect_vf");
// this.parameterInputSelect = this.inputAreaNode.getElement(".parameterInputSelect_vf");
this.datatypeInput = this.inputAreaNode.getElement(".datatypeInput_vf");
this.restrictFilterInput = this.inputAreaNode.getElement(".restrictFilterInput_vf");
......@@ -275,6 +275,8 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
this.switchInputDisplay();
if (this.datatypeInput.onchange)this.datatypeInput.onchange();
}
}else if( type === "official" ){
}
}.bind(this))
this.setPathInputSelectOptions()
......@@ -355,7 +357,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
}
}.bind(this))
}else if( d.entityCategory ==='official' ){
this.pathInputSelect.empty();
}
},
switchInputDisplay: function () {
......@@ -713,7 +715,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
break;
}
}
if(flag)this.pathInputSelect.options[0].set("selected", true);
if(flag && this.pathInputSelect.options.length)this.pathInputSelect.options[0].set("selected", true);
switch (data.formatType) {
case "textValue":
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册