提交 e15d4f38 编写于 作者: U unknown

搜索过滤条件增加收起和展开

上级 74d3ee2c
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
{{if $.valueCountPairList && $.valueCountPairList.length}} {{if $.valueCountPairList && $.valueCountPairList.length}}
<div class="item-multiselect mainColor_border mainColor_bg_opacity"></div> <div class="item-multiselect mainColor_border mainColor_bg_opacity"></div>
<div class="item"> <div class="item" style="display: {{($._.status.collapseCondition && $.index) ? 'none': ''}};">
<div class="item-title">{{$.label}}</div> <div class="item-title">{{$.label}}</div>
<div class="item-content"> <div class="item-content">
...@@ -41,5 +41,13 @@ ...@@ -41,5 +41,13 @@
{{end each}} {{end each}}
</div> </div>
{{if $.status.showSwitch}}
<div class="switch" data-o2-element="switchNode" data-o2-events="click:switchCondition;mouseover:mainColorOver:switch;mouseout:mainColorOut:switch">
<i style="margin-right: 3px;" class="{{$.status.collapseCondition ? 'o2icon-chevron-thin-down' : 'o2icon-chevron-thin-up'}}"></i>
<span>{{$.status.collapseCondition ? $.lp.expandCondition : $.lp.collapseCondition}}</span>
</div>
{{end if}}
</div> </div>
{{end if}} {{end if}}
\ No newline at end of file
...@@ -377,6 +377,19 @@ ul { ...@@ -377,6 +377,19 @@ ul {
border-radius: 0px 0px 30px 30px; border-radius: 0px 0px 30px 30px;
border: 1px solid #CCCCCC; border: 1px solid #CCCCCC;
padding-bottom: 10px; padding-bottom: 10px;
position: relative;
}
.condition .switch{
cursor: pointer;
padding-left: 5px;
position: absolute;
width: 60px;
height: 30px;
left: calc( 50% - 30px );
bottom: -20px;
background: #fff;
text-align: center;
color: #999;
} }
.condition .switch-button{ .condition .switch-button{
background: #ffffff; background: #ffffff;
......
...@@ -72,10 +72,18 @@ MWF.xApplication.ftsearch.FTSearchView = new Class({ ...@@ -72,10 +72,18 @@ MWF.xApplication.ftsearch.FTSearchView = new Class({
this.search(); this.search();
} }
}, },
search: function(pageNum, query){ search: function(pageNum, query){
this.selectedConditionList = []; this.selectedConditionList = [];
this.loadSelectedCondition(); this.loadSelectedCondition();
this._search(pageNum, query);
if( typeOf(this.collapseCondition) === "boolean" ){
this._search(pageNum, query);
}else{
MWF.UD.getDataJson("ftsearchCollapseCondition", function (json) {
this.collapseCondition = json === "true";
this._search(pageNum, query);
}.bind(this), true);
}
}, },
_search: function( pageNum, query ){ _search: function( pageNum, query ){
pageNum = o2.typeOf(pageNum) === "number" ? pageNum : null; pageNum = o2.typeOf(pageNum) === "number" ? pageNum : null;
...@@ -235,9 +243,15 @@ MWF.xApplication.ftsearch.FTSearchView = new Class({ ...@@ -235,9 +243,15 @@ MWF.xApplication.ftsearch.FTSearchView = new Class({
json = json.filter(function(d){ json = json.filter(function(d){
return d.valueCountPairList && d.valueCountPairList.length; return d.valueCountPairList && d.valueCountPairList.length;
}); });
json.each(function(d, i){
d.index = i;
});
this.conditionArea.loadHtml(this.path+this.options.style+"/condition.html", this.conditionArea.loadHtml(this.path+this.options.style+"/condition.html",
{ {
"bind": {"lp": this.app.lp, "data": json}, "bind": {"lp": this.app.lp, "data": json, status: {
collapseCondition: this.collapseCondition,
showSwitch: json.length > 1
}},
"module": this, "module": this,
"reload": true "reload": true
}, },
...@@ -247,6 +261,23 @@ MWF.xApplication.ftsearch.FTSearchView = new Class({ ...@@ -247,6 +261,23 @@ MWF.xApplication.ftsearch.FTSearchView = new Class({
); );
// }.bind(this)); // }.bind(this));
}, },
switchCondition: function(){
this.collapseCondition = !this.collapseCondition;
if( this.collapseCondition ){
this.switchNode.getElement("i").addClass( 'o2icon-chevron-thin-down' ).removeClass('o2icon-chevron-thin-up');
this.switchNode.getElement("span").set("text", this.app.lp.expandCondition);
this.conditionNode.getElements(".item").each(function (item, index) {
item.setStyle("display", index ? "none": "")
})
}else{
this.switchNode.getElement("i").removeClass( 'o2icon-chevron-thin-down' ).addClass('o2icon-chevron-thin-up');
this.switchNode.getElement("span").set("text", this.app.lp.collapseCondition);
this.conditionNode.getElements(".item").each(function (item, index) {
item.setStyle("display", "");
})
}
MWF.UD.putData("ftsearchCollapseCondition", this.collapseCondition.toString(), null,);
},
loadSelectedCondition: function(){ loadSelectedCondition: function(){
this.conditionSelectedArea.empty(); this.conditionSelectedArea.empty();
this.conditionSelectedArea.loadHtml(this.path+this.options.style+"/conditionSelected.html", this.conditionSelectedArea.loadHtml(this.path+this.options.style+"/conditionSelected.html",
......
...@@ -97,5 +97,8 @@ MWF.xApplication.ftsearch.LP = { ...@@ -97,5 +97,8 @@ MWF.xApplication.ftsearch.LP = {
"selectModule": "Select Application", "selectModule": "Select Application",
"searching": "You are searching", "searching": "You are searching",
"switch": "Switch", "switch": "Switch",
"searchCorePlacholder": "Please enter a keyword and press \"Enter\" to search for an application or process" "searchCorePlacholder": "Please enter a keyword and press \"Enter\" to search for an application or process",
"expandCondition":"Expand",
"collapseCondition": "Collapse"
}; };
\ No newline at end of file
...@@ -95,5 +95,8 @@ MWF.xApplication.ftsearch.LP = { ...@@ -95,5 +95,8 @@ MWF.xApplication.ftsearch.LP = {
"selectModule": "选择应用", "selectModule": "选择应用",
"searching": "您正在查询", "searching": "您正在查询",
"switch": "切换", "switch": "切换",
"searchCorePlacholder": "请输入关键字,按“回车”搜索应用或流程" "searchCorePlacholder": "请输入关键字,按“回车”搜索应用或流程",
"expandCondition":"更多",
"collapseCondition": "收起"
}; };
...@@ -362,7 +362,7 @@ MWF.xApplication.process.FormDesigner.LP = { ...@@ -362,7 +362,7 @@ MWF.xApplication.process.FormDesigner.LP = {
"readLog": "阅读记录", "readLog": "阅读记录",
"writingBoard": "手写板", "writingBoard": "手写板",
"tinymceEditor": "Tinymce编辑器", "tinymceEditor": "Tinymce编辑器",
"relatedLink": "相关链接" "relatedLink": "相关推荐"
}, },
"propertyTemplate": { "propertyTemplate": {
"base": "基本", "base": "基本",
......
MWF.xDesktop.requireApp("process.Xform", "$Module", null, false); MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
/** @class Relatedlink 相关链接组件,本组件根据其当前流程实例的相关性分数列式其他流程实例(带权限)。 /** @class Relatedlink 相关推荐组件,本组件根据其当前流程实例的相关性分数列式其他流程实例(带权限)。
* @o2cn 相关链接组件 * @o2cn 相关推荐组件
* @example * @example
* //可以在脚本中获取该组件 * //可以在脚本中获取该组件
* //方法1: * //方法1:
......
...@@ -410,7 +410,7 @@ MWF.xApplication.process.Xform.LP = { ...@@ -410,7 +410,7 @@ MWF.xApplication.process.Xform.LP = {
"createTime": "创建时间", "createTime": "创建时间",
"creatorPerson": "创建人", "creatorPerson": "创建人",
"creatorUnit": "创建组织", "creatorUnit": "创建组织",
"score": "匹配", "score": "关联",
"updateTime": "更新时间" "updateTime": "更新时间"
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册