mirror of https://gitee.com/bigwinds/arangodb
front-end: added IN filter, issue: #1657
This commit is contained in:
parent
ae68725a5f
commit
82fa26c79e
|
@ -57,16 +57,33 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
setFiltersForQuery: function(bindVars) {
|
setFiltersForQuery: function(bindVars) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
if (this.filters.length === 0) {
|
if (this.filters.length === 0) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
var query = " FILTER",
|
var query = " FILTER", res = '',
|
||||||
parts = _.map(this.filters, function(f, i) {
|
parts = _.map(this.filters, function(f, i) {
|
||||||
var res = " x.`";
|
if (f.op === 'IN') {
|
||||||
|
res = ' ';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
res = " x.`";
|
||||||
|
}
|
||||||
res += f.attr;
|
res += f.attr;
|
||||||
res += "` ";
|
if (f.op !== 'IN') {
|
||||||
|
res += "` ";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
res += " ";
|
||||||
|
}
|
||||||
res += f.op;
|
res += f.op;
|
||||||
res += " @param";
|
if (f.op === 'IN') {
|
||||||
|
res += " x.@param";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
res += " @param";
|
||||||
|
}
|
||||||
res += i;
|
res += i;
|
||||||
bindVars["param" + i] = f.val;
|
bindVars["param" + i] = f.val;
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -70,6 +70,7 @@
|
||||||
<option value="<="><=</option>
|
<option value="<="><=</option>
|
||||||
<option value=">">></option>
|
<option value=">">></option>
|
||||||
<option value=">=">>=</option>
|
<option value=">=">>=</option>
|
||||||
|
<option value="IN">IN</option>
|
||||||
</select><input id="attribute_value0" type="text" placeholder="Attribute value" class="filterValue">
|
</select><input id="attribute_value0" type="text" placeholder="Attribute value" class="filterValue">
|
||||||
<a id="addFilterItem" class="add-filter-item"><i class="icon-plus arangoicon"></i></a>
|
<a id="addFilterItem" class="add-filter-item"><i class="icon-plus arangoicon"></i></a>
|
||||||
<button id="resetView" class="button-warning btn-old-padding">Reset</button>
|
<button id="resetView" class="button-warning btn-old-padding">Reset</button>
|
||||||
|
|
Loading…
Reference in New Issue