This commit is contained in:
2022-02-24 19:51:12 +00:00
parent 0abe75fe48
commit da29037a01
2 changed files with 31 additions and 35 deletions

View File

@@ -134,7 +134,7 @@
</slot>
<slot name="settings">
<div>
settings
default slot for settings
</div>
</slot>
<div v-if="hasError" class="mx-2 mt-4 d-flex align-center">

View File

@@ -40,6 +40,7 @@
></gz-chart-bar-horizontal>
</template>
<template slot="settings">
<div></div>
<v-col v-if="context" cols="12">
<v-dialog
v-model="context"
@@ -55,16 +56,27 @@
<v-card-text style="height: 500px;">
<v-select
v-model="localSettings.dateRange"
v-model="settings.dateRange"
:items="selectLists.dateFilterTokens"
item-text="name"
item-value="id"
:label="$ay.t('TimeSpanDateRange')"
prepend-icon="$ayiFilter"
></v-select>
settings: {{ settings }}<br />
localsettings: {{ localSettings }}
<v-select
v-model="settings.unit"
:items="selectLists.units"
item-text="name"
item-value="id"
:label="$ay.t('Unit')"
></v-select>
<v-text-field
v-model="settings.customTitle"
:label="$ay.t('Name')"
></v-text-field>
{{ settings }}
</v-card-text>
<v-divider></v-divider>
@@ -101,18 +113,10 @@ export default {
return {
obj: {},
context: false,
localSettings: {},
selectLists: {
dateFilterOperators: [],
dateFilterTokens: [],
stringFilterOperators: [],
integerFilterOperators: [],
boolFilterOperators: [],
decimalFilterOperators: [],
tagFilterOperators: [],
roleFilterOperators: [],
enumFilterOperators: [],
intervalFilterOperators: []
units: []
}
};
},
@@ -176,7 +180,7 @@ export default {
//
//
async function initWidget(vm) {
console.log("INitializing widget dash-labotr-hours-personal");
//console.log("INitializing widget dash-labotr-hours-personal");
await fetchTranslatedText();
populateSelectionLists(vm);
}
@@ -188,24 +192,14 @@ async function initWidget(vm) {
async function fetchTranslatedText() {
await window.$gz.translation.cacheTranslations([
"Filter",
"GridFilterDialogAndRadioText",
"GridFilterDialogOrRadioText",
"GridRowFilterDropDownBlanksItem",
"GridRowFilterDropDownNonBlanksItem",
"GridRowFilterDropDownEquals",
"GridRowFilterDropDownGreaterThan",
"GridRowFilterDropDownGreaterThanOrEqualTo",
"GridRowFilterDropDownLessThan",
"GridRowFilterDropDownLessThanOrEqualTo",
"GridRowFilterDropDownNotEquals",
"GridRowFilterDropDownDoesNotContain",
"GridRowFilterDropDownContains",
"GridRowFilterDropDownStartsWith",
"GridRowFilterDropDownEndsWith",
"SelectItem",
"DateRangeYesterday",
"DateRangeToday",
"DateRangeTomorrow",
"DateRangeLastWeek",
"DateRangeThisWeek",
"DateRangeNextWeek",
@@ -214,7 +208,6 @@ async function fetchTranslatedText() {
"DateRangeNextMonth",
"DateRange14DayWindow",
"DateRangePast",
"DateRangeFuture",
"DateRangeLastYear",
"DateRangeThisYear",
"DateRangeInTheLastThreeMonths",
@@ -240,18 +233,11 @@ async function fetchTranslatedText() {
"DateRangePreviousYearThisMonth",
"DateRangePreviousYearLastMonth",
"DateRangePreviousYearNextMonth",
"True",
"False"
"TimeSpanDays",
"TimeSpanMonths"
]);
}
/*
"TimeSpanDays": "days",
"TimeSpanHours": "hours",
"TimeSpanMinutes": "minutes",
"TimeSpanMonths": "months",
*/
/////////////////////////////////
//
//
@@ -324,5 +310,15 @@ function populateSelectionLists(vm) {
{ name: vm.$ay.t("GridRowFilterDropDownContains"), id: "-%-" }
]
);
vm.selectLists.units.push(
...[
{ name: vm.$ay.t("TimeSpanDays"), id: "day" },
{
name: vm.$ay.t("TimeSpanMonths"),
id: "month"
}
]
);
}
</script>