This commit is contained in:
2020-02-21 16:13:55 +00:00
parent e6e5bf43d7
commit 298e331012

View File

@@ -184,7 +184,25 @@
item.uiFieldDataType === 12 item.uiFieldDataType === 12
" "
> >
STRING BUILDER <v-select
v-model="item.tempFilterOperator"
:items="pickLists.stringFilterOperators"
item-text="name"
item-value="id"
:label="lt('Filter')"
prepend-icon="fa-filter"
></v-select>
<v-text-field
v-model="item.tempFilterValue"
clearable
></v-text-field>
<v-btn
large
block
v-if="item.tempFilterToken != null"
@click="addFilterCondition(item)"
><v-icon large>fa-plus</v-icon></v-btn
>
</div> </div>
<!-- INTEGER BUILDER --> <!-- INTEGER BUILDER -->
@@ -414,9 +432,6 @@ export default {
this.obj.splice(newIndex, 0, this.obj.splice(index, 1)[0]); this.obj.splice(newIndex, 0, this.obj.splice(index, 1)[0]);
}, },
addFilterCondition(item) { addFilterCondition(item) {
//TODO: Need to also set a filter item DISPLAY property
//so that can display localized for user in the list and then
//change the list to use the DISPLAY property instead
var filterItem = { op: null, value: null, display: null }; var filterItem = { op: null, value: null, display: null };
var filterItemSet = false; var filterItemSet = false;
//DATE relative token? //DATE relative token?
@@ -472,6 +487,10 @@ export default {
if (item.tempFilterOperator && item.tempFilterValue) { if (item.tempFilterOperator && item.tempFilterValue) {
filterItem.op = item.tempFilterOperator; filterItem.op = item.tempFilterOperator;
filterItem.value = item.tempFilterValue; filterItem.value = item.tempFilterValue;
//only add if there is both an op and a value
//above here for tokens that isn't a restriction but
//after passing through those conditions were at a point where there MUST be both
if (filterItem.op && filterItem.value) {
//display //display
var valueDisplay = "selected value"; var valueDisplay = "selected value";
switch (item.uiFieldDataType) { switch (item.uiFieldDataType) {
@@ -495,13 +514,17 @@ export default {
break; break;
} }
var opDisplay = window.$gz._.find(this.pickLists.dateFilterOperators, { var opDisplay = window.$gz._.find(
this.pickLists.dateFilterOperators,
{
id: filterItem.op id: filterItem.op
}).name; }
).name;
filterItem.display = opDisplay + " " + valueDisplay; filterItem.display = opDisplay + " " + valueDisplay;
filterItemSet = true; filterItemSet = true;
} }
}
if (filterItemSet) { if (filterItemSet) {
//add only if not already in the collection (accidental double click) //add only if not already in the collection (accidental double click)