提交 e15d4f38 编写于 作者: U unknown

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

上级 74d3ee2c
......@@ -6,7 +6,7 @@
{{if $.valueCountPairList && $.valueCountPairList.length}}
<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-content">
......@@ -41,5 +41,13 @@
{{end each}}
</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>
{{end if}}
\ No newline at end of file
......@@ -377,6 +377,19 @@ ul {
border-radius: 0px 0px 30px 30px;
border: 1px solid #CCCCCC;
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{
background: #ffffff;
......
......@@ -72,10 +72,18 @@ MWF.xApplication.ftsearch.FTSearchView = new Class({
this.search();
}
},
search: function(pageNum, query){
search: function(pageNum, query){
this.selectedConditionList = [];
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 ){
pageNum = o2.typeOf(pageNum) === "number" ? pageNum : null;
......@@ -235,9 +243,15 @@ MWF.xApplication.ftsearch.FTSearchView = new Class({
json = json.filter(function(d){
return d.valueCountPairList && d.valueCountPairList.length;
});
json.each(function(d, i){
d.index = i;
});
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,
"reload": true
},
......@@ -247,6 +261,23 @@ MWF.xApplication.ftsearch.FTSearchView = new Class({
);
// }.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(){
this.conditionSelectedArea.empty();
this.conditionSelectedArea.loadHtml(this.path+this.options.style+"/conditionSelected.html",
......
......@@ -97,5 +97,8 @@ MWF.xApplication.ftsearch.LP = {
"selectModule": "Select Application",
"searching": "You are searching",
"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 = {
"selectModule": "选择应用",
"searching": "您正在查询",
"switch": "切换",
"searchCorePlacholder": "请输入关键字,按“回车”搜索应用或流程"
"searchCorePlacholder": "请输入关键字,按“回车”搜索应用或流程",
"expandCondition":"更多",
"collapseCondition": "收起"
};
......@@ -362,7 +362,7 @@ MWF.xApplication.process.FormDesigner.LP = {
"readLog": "阅读记录",
"writingBoard": "手写板",
"tinymceEditor": "Tinymce编辑器",
"relatedLink": "相关链接"
"relatedLink": "相关推荐"
},
"propertyTemplate": {
"base": "基本",
......
MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
/** @class Relatedlink 相关链接组件,本组件根据其当前流程实例的相关性分数列式其他流程实例(带权限)。
* @o2cn 相关链接组件
/** @class Relatedlink 相关推荐组件,本组件根据其当前流程实例的相关性分数列式其他流程实例(带权限)。
* @o2cn 相关推荐组件
* @example
* //可以在脚本中获取该组件
* //方法1:
......
......@@ -410,7 +410,7 @@ MWF.xApplication.process.Xform.LP = {
"createTime": "创建时间",
"creatorPerson": "创建人",
"creatorUnit": "创建组织",
"score": "匹配",
"score": "关联",
"updateTime": "更新时间"
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册