This commit is contained in:
2022-02-27 17:20:47 +00:00
parent 088e822a23
commit 83eb019196
2 changed files with 30 additions and 5 deletions

View File

@@ -62,6 +62,8 @@ export default {
customTitle: null,
timeSpan: "*thismonth*",
interval: "day",
wotags: [],
woitemtags: [],
color: "#00205B"
}
},
@@ -74,6 +76,8 @@ export default {
settings: {
customTitle: null,
timeSpan: "*thismonth*",
wotags: [],
woitemtags: [],
interval: "day",
color: "#00205B"
}

View File

@@ -25,7 +25,7 @@
<v-dialog
v-model="context"
scrollable
max-width="600px"
max-width="400px"
data-cy="dashSettings"
@keydown.esc="cancel"
>
@@ -34,7 +34,7 @@
<span> {{ $ay.t("Settings") }} </span>
</v-card-title>
<v-card-text style="height: 500px;">
<v-card-text >
<v-select
v-model="localSettings.timeSpan"
:items="selectLists.dateFilterTokens"
@@ -51,6 +51,16 @@
:label="$ay.t('Interval')"
></v-select>
<gz-tag-picker
v-model="localSettings.wotags"
:label="$ay.t('Tags') + ' - ' + $ay.t('WorkOrder')"
></gz-tag-picker>
<gz-tag-picker
v-model="localSettings.woitemtags"
:label="$ay.t('Tags') + ' - ' + $ay.t('WorkOrderItem')"
></gz-tag-picker>
<v-text-field
v-model="localSettings.customTitle"
:label="$ay.t('Name')"
@@ -157,14 +167,18 @@ export default {
methods: {
showContext: function() {
this.localSettings = window.$gz.util.deepCopySkip(this.settings);
console.log(JSON.stringify(this.localSettings));
this.context = true;
},
updateSettings: function() {
//copy settings from local to
//copy settings from local to parent settings, need to do it this way or get error about mutating prop directly which is vexing and has no easy solution seemingly
this.settings.customTitle = this.localSettings.customTitle;
this.settings.timeSpan = this.localSettings.timeSpan;
this.settings.interval = this.localSettings.interval;
this.settings.color = this.localSettings.color;
this.settings.wotags = this.localSettings.wotags;
this.settings.woitemtags = this.localSettings.woitemtags;
this.$emit("dash-change"); //trigger save to server
this.context = false;
this.getDataFromApi();
@@ -177,7 +191,9 @@ export default {
KPIName: "WorkOrderItemLaborQuantitySummary",
criteria: {
timeSpan: this.settings.timeSpan,
interval: this.settings.interval
interval: this.settings.interval,
wotags: this.settings.wotags,
woitemtags: this.settings.woitemtags
},
clientTimeStamp: window.$gz.locale.clientLocalZoneTimeStamp()
});
@@ -258,7 +274,9 @@ async function fetchTranslatedText() {
"WorkOrderItemLaborServiceRateQuantity",
"Name",
"TimeSpan",
"Interval"
"Interval",
"WorkOrder",
"WorkOrderItem"
]);
}
@@ -347,6 +365,9 @@ function populateSelectionLists(vm) {
/*
todo: tag filtering hasn't been added yet
todo: from client click on view of total billable hours by period
add to v.next case
todo: clean up line version of dash-labor-hours-personal with lessons learned from bar one
todo: add icons to dashregistry with title so can include some indication of type of chart when names are duped
or subtitle if icons too fucky