This commit is contained in:
2021-02-03 15:14:08 +00:00
parent 14d9d5190b
commit b3f65724db
2 changed files with 257 additions and 4 deletions

View File

@@ -5,6 +5,7 @@
data-cy="dataTableFilterControl"
>
{{ columnKey }}
{{ selectLists }}
</v-dialog>
</template>
<script>
@@ -17,7 +18,18 @@ export default {
isVisible: false,
resolve: null,
reject: null,
columnKey: null
columnKey: null,
fieldDefinitions: [],
selectLists: {
dateFilterOperators: [],
dateFilterTokens: [],
stringFilterOperators: [],
integerFilterOperators: [],
boolFilterOperators: [],
decimalFilterOperators: [],
tagFilterOperators: [],
enumFilterOperators: []
}
}),
methods: {
open(columnKey) {
@@ -39,7 +51,13 @@ export default {
//
//
async function initForm(vm) {
//await fetchTranslatedText(vm);
await fetchTranslatedText(vm);
populateSelectionLists(vm);
// await populateFieldDefinitions(vm);
// await fetchTranslatedFieldNames(vm);
// await setEffectiveListView(vm);
// await initDataObject(vm);
// await fetchEnums(vm);
}
//////////////////////////////////////////////////////////
@@ -47,6 +65,242 @@ async function initForm(vm) {
// Ensures UI translated text is available
//
async function fetchTranslatedText(vm) {
await window.$gz.translation.cacheTranslations(["TimeStamp", "ID", "Status"]);
await window.$gz.translation.cacheTranslations([
"GridFilterName",
"Include",
"AnyUser",
"Sort",
"Filter",
"GridFilterDialogAndRadioText",
"GridFilterDialogOrRadioText",
"GridRowFilterDropDownBlanksItem",
"GridRowFilterDropDownNonBlanksItem",
"GridRowFilterDropDownEquals",
"GridRowFilterDropDownGreaterThan",
"GridRowFilterDropDownGreaterThanOrEqualTo",
"GridRowFilterDropDownLessThan",
"GridRowFilterDropDownLessThanOrEqualTo",
"GridRowFilterDropDownNotEquals",
"GridRowFilterDropDownDoesNotContain",
"GridRowFilterDropDownContains",
"GridRowFilterDropDownStartsWith",
"GridRowFilterDropDownEndsWith",
"SelectItem",
"DateRangeYesterday",
"DateRangeToday",
"DateRangeTomorrow",
"DateRangeLastWeek",
"DateRangeThisWeek",
"DateRangeNextWeek",
"DateRangeLastMonth",
"DateRangeThisMonth",
"DateRangeNextMonth",
"DateRange14DayWindow",
"DateRangePast",
"DateRangeFuture",
"DateRangeLastYear",
"DateRangeThisYear",
"DateRangeInTheLastThreeMonths",
"DateRangeInTheLastSixMonths",
"DateRangePastYear",
"DateRangePast90Days",
"DateRangePast30Days",
"DateRangePast24Hours",
"DateRangeJanuary",
"DateRangeFebruary",
"DateRangeMarch",
"DateRangeApril",
"DateRangeMay",
"DateRangeJune",
"DateRangeJuly",
"DateRangeAugust",
"DateRangeSeptember",
"DateRangeOctober",
"DateRangeNovember",
"DateRangeDecember",
"DateRangePreviousYearThisMonth",
"DateRangePreviousYearLastMonth",
"DateRangePreviousYearNextMonth",
"True",
"False",
"Name"
]);
}
/////////////////////////////////
//
//
function populateSelectionLists(vm) {
vm.selectLists.dateFilterOperators.push(
...[
{ name: vm.$ay.t("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{
name: vm.$ay.t("GridRowFilterDropDownNonBlanksItem"),
id: "*HASVALUE*"
},
{ name: vm.$ay.t("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.$ay.t("GridRowFilterDropDownGreaterThan"), id: ">" },
{
name: vm.$ay.t("GridRowFilterDropDownGreaterThanOrEqualTo"),
id: ">="
},
{ name: vm.$ay.t("GridRowFilterDropDownLessThan"), id: "<" },
{ name: vm.$ay.t("GridRowFilterDropDownLessThanOrEqualTo"), id: "<=" },
{ name: vm.$ay.t("GridRowFilterDropDownNotEquals"), id: "!=" }
]
);
vm.selectLists.dateFilterTokens.push(
...[
{ name: "(" + vm.$ay.t("SelectItem") + ")", id: "*select*" }, //If select then use entry in date /time picker
{ name: vm.$ay.t("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{
name: vm.$ay.t("GridRowFilterDropDownNonBlanksItem"),
id: "*HASVALUE*"
},
{ name: vm.$ay.t("DateRangeYesterday"), id: "*yesterday*" },
{ name: vm.$ay.t("DateRangeToday"), id: "*today*" },
{ name: vm.$ay.t("DateRangeTomorrow"), id: "*tomorrow*" },
{ name: vm.$ay.t("DateRangeLastWeek"), id: "*lastweek*" },
{ name: vm.$ay.t("DateRangeThisWeek"), id: "*thisweek*" },
{ name: vm.$ay.t("DateRangeNextWeek"), id: "*nextweek*" },
{ name: vm.$ay.t("DateRangeLastMonth"), id: "*lastmonth*" },
{ name: vm.$ay.t("DateRangeThisMonth"), id: "*thismonth*" },
{ name: vm.$ay.t("DateRangeNextMonth"), id: "*nextmonth*" },
{ name: vm.$ay.t("DateRange14DayWindow"), id: "*14daywindow*" },
{ name: vm.$ay.t("DateRangePast"), id: "*past*" },
{ name: vm.$ay.t("DateRangeFuture"), id: "*future*" },
{ name: vm.$ay.t("DateRangeLastYear"), id: "*lastyear*" }, //prior year from jan to dec
{ name: vm.$ay.t("DateRangeThisYear"), id: "*thisyear*" },
{
name: vm.$ay.t("DateRangeInTheLastThreeMonths"),
id: "*last3months*"
},
{
name: vm.$ay.t("DateRangeInTheLastSixMonths"),
id: "*last6months*"
},
{ name: vm.$ay.t("DateRangePastYear"), id: "*pastyear*" }, //last 365 days
{ name: vm.$ay.t("DateRangePast90Days"), id: "*past90days*" },
{ name: vm.$ay.t("DateRangePast30Days"), id: "*past30days*" },
{ name: vm.$ay.t("DateRangePast24Hours"), id: "*past24hours*" },
{ name: vm.$ay.t("DateRangeJanuary"), id: "*january*" },
{ name: vm.$ay.t("DateRangeFebruary"), id: "*february*" },
{ name: vm.$ay.t("DateRangeMarch"), id: "*march*" },
{ name: vm.$ay.t("DateRangeApril"), id: "*april*" },
{ name: vm.$ay.t("DateRangeMay"), id: "*may*" },
{ name: vm.$ay.t("DateRangeJune"), id: "*june*" },
{ name: vm.$ay.t("DateRangeJuly"), id: "*july*" },
{ name: vm.$ay.t("DateRangeAugust"), id: "*august*" },
{ name: vm.$ay.t("DateRangeSeptember"), id: "*september*" },
{ name: vm.$ay.t("DateRangeOctober"), id: "*october*" },
{ name: vm.$ay.t("DateRangeNovember"), id: "*november*" },
{ name: vm.$ay.t("DateRangeDecember"), id: "*december*" },
{
name: vm.$ay.t("DateRangePreviousYearThisMonth"),
id: "*lastyearthismonth*"
},
{
name: vm.$ay.t("DateRangePreviousYearLastMonth"),
id: "*lastyearlastmonth*"
},
{
name: vm.$ay.t("DateRangePreviousYearNextMonth"),
id: "*lastyearnextmonth*"
}
]
);
vm.selectLists.stringFilterOperators.push(
...[
{ name: vm.$ay.t("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{
name: vm.$ay.t("GridRowFilterDropDownNonBlanksItem"),
id: "*HASVALUE*"
},
{ name: vm.$ay.t("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.$ay.t("GridRowFilterDropDownGreaterThan"), id: ">" },
{
name: vm.$ay.t("GridRowFilterDropDownGreaterThanOrEqualTo"),
id: ">="
},
{ name: vm.$ay.t("GridRowFilterDropDownLessThan"), id: "<" },
{ name: vm.$ay.t("GridRowFilterDropDownLessThanOrEqualTo"), id: "<=" },
{ name: vm.$ay.t("GridRowFilterDropDownNotEquals"), id: "!=" },
{ name: vm.$ay.t("GridRowFilterDropDownDoesNotContain"), id: "!-%-" },
{ name: vm.$ay.t("GridRowFilterDropDownContains"), id: "-%-" },
{ name: vm.$ay.t("GridRowFilterDropDownStartsWith"), id: "%-" },
{ name: vm.$ay.t("GridRowFilterDropDownEndsWith"), id: "-%" }
]
);
vm.selectLists.integerFilterOperators.push(
...[
{ name: vm.$ay.t("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{
name: vm.$ay.t("GridRowFilterDropDownNonBlanksItem"),
id: "*HASVALUE*"
},
{ name: vm.$ay.t("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.$ay.t("GridRowFilterDropDownGreaterThan"), id: ">" },
{
name: vm.$ay.t("GridRowFilterDropDownGreaterThanOrEqualTo"),
id: ">="
},
{ name: vm.$ay.t("GridRowFilterDropDownLessThan"), id: "<" },
{ name: vm.$ay.t("GridRowFilterDropDownLessThanOrEqualTo"), id: "<=" },
{ name: vm.$ay.t("GridRowFilterDropDownNotEquals"), id: "!=" }
]
);
vm.selectLists.boolFilterOperators.push(
...[
{ name: vm.$ay.t("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{
name: vm.$ay.t("GridRowFilterDropDownNonBlanksItem"),
id: "*HASVALUE*"
},
{ name: vm.$ay.t("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.$ay.t("GridRowFilterDropDownNotEquals"), id: "!=" }
]
);
vm.selectLists.decimalFilterOperators.push(
...[
{ name: vm.$ay.t("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{
name: vm.$ay.t("GridRowFilterDropDownNonBlanksItem"),
id: "*HASVALUE*"
},
{ name: vm.$ay.t("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.$ay.t("GridRowFilterDropDownGreaterThan"), id: ">" },
{
name: vm.$ay.t("GridRowFilterDropDownGreaterThanOrEqualTo"),
id: ">="
},
{ name: vm.$ay.t("GridRowFilterDropDownLessThan"), id: "<" },
{ name: vm.$ay.t("GridRowFilterDropDownLessThanOrEqualTo"), id: "<=" },
{ name: vm.$ay.t("GridRowFilterDropDownNotEquals"), id: "!=" }
]
);
//tags filter only by equals in initial release, see DataListSqlFilterCriteriaBuilder.cs line 523 for deets
vm.selectLists.tagFilterOperators.push({
name: vm.$ay.t("GridRowFilterDropDownEquals"),
id: "="
});
vm.selectLists.enumFilterOperators.push(
...[
{ name: vm.$ay.t("GridRowFilterDropDownBlanksItem"), id: "*NOVALUE*" },
{
name: vm.$ay.t("GridRowFilterDropDownNonBlanksItem"),
id: "*HASVALUE*"
},
{ name: vm.$ay.t("GridRowFilterDropDownEquals"), id: "=" },
{ name: vm.$ay.t("GridRowFilterDropDownNotEquals"), id: "!=" }
]
);
}
</script>

View File

@@ -514,7 +514,6 @@ export default {
return "";
},
async filter(item) {
// console.log("filter:", item);
let res = await this.$refs.dataTableFilter.open(item.fk);
if (res && res.refresh == true) {
this.getDataFromApi();