This commit is contained in:
2021-03-15 22:29:39 +00:00
parent c9a3c19710
commit 2be0ae5850
2 changed files with 23 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<gz-error :error-box-message="formState.errorBoxMessage"></gz-error> <gz-error :error-box-message="formState.errorBoxMessage"></gz-error>
<!-- cols:{{ serverColumns }} filt:{{ serverFilter }} srt:{{ serverSort }} -->
<gz-data-table-filter <gz-data-table-filter
:data-list-key="dataListKey" :data-list-key="dataListKey"
:active-filter-id="activeFilterId" :active-filter-id="activeFilterId"
@@ -49,8 +49,16 @@
> >
<v-icon data-cy="refresh">$ayiFilter</v-icon> <v-icon data-cy="refresh">$ayiFilter</v-icon>
</v-btn> </v-btn>
<v-btn class="ml-12" @click="editColumnView"> <v-btn
<v-icon data-cy="filter">$ayiColumns</v-icon> :outlined="hiddenAffectiveColumns.length > 0"
class="ml-12"
@click="editColumnView"
>
<v-icon
:color="hiddenAffectiveColumns.length ? 'accent' : 'primary'"
data-cy="filter"
>$ayiColumns</v-icon
>
</v-btn> </v-btn>
</div> </div>
</v-card-title> </v-card-title>
@@ -422,6 +430,7 @@ export default {
headers: [], headers: [],
serverColumns: [], serverColumns: [],
serverFilter: [], serverFilter: [],
hiddenAffectiveColumns: [],
totalRecords: 0, totalRecords: 0,
records: [], records: [],
rowsPerPageItems: [5, 10, 25, 50, 100], rowsPerPageItems: [5, 10, 25, 50, 100],
@@ -454,7 +463,6 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
reload: { reload: {
type: Boolean, type: Boolean,
default: false default: false
@@ -679,8 +687,10 @@ export default {
name: "ay-data-list-column-view", name: "ay-data-list-column-view",
params: { params: {
dataListKey: this.dataListKey, dataListKey: this.dataListKey,
formKey: this.formKey, hiddenAffectiveColumns: this.hiddenAffectiveColumns
activeFilterId: this.activeFilterId // ,
// formKey: this.formKey,
// activeFilterId: this.activeFilterId
} }
}); });
}, },
@@ -775,6 +785,10 @@ export default {
//save a copy of the filter to show the filter symbol icons beside column headers //save a copy of the filter to show the filter symbol icons beside column headers
//and know that the return list *is* filtered //and know that the return list *is* filtered
vm.serverFilter = res.filter; vm.serverFilter = res.filter;
//Hidden columns that affect the query and data displayed
vm.hiddenAffectiveColumns = res.hiddenAffectiveColumns;
//Make sure the translation keys are fetched //Make sure the translation keys are fetched
await fetchTranslatedHeaderNames(res.columns); //Note can use await here because it's wrapped inside an async function call, it will wait then resume next stuff below await fetchTranslatedHeaderNames(res.columns); //Note can use await here because it's wrapped inside an async function call, it will wait then resume next stuff below
@@ -783,7 +797,7 @@ export default {
//build vm.headers here //build vm.headers here
vm.headers = buildHeaders(res.columns); vm.headers = buildHeaders(res.columns);
//SET TABLE SORT HERE FROM RESPONSE //SET TABLE SORT HERE FROM RESPONSE
vm.setSortIndicatorsFromDataListResponse(res.sortBy); vm.setSortIndicatorsFromDataListResponse(res.sortBy);
//Post process data here and then set vm.records //Post process data here and then set vm.records

View File

@@ -78,6 +78,7 @@ export default {
let vm = this; let vm = this;
try { try {
vm.dataListKey = this.$route.params.dataListKey; vm.dataListKey = this.$route.params.dataListKey;
vm.hiddenAffectiveColumns=this.$route.params.hiddenAffectiveColumns;
await initForm(vm); await initForm(vm);
vm.formState.ready = true; vm.formState.ready = true;
window.$gz.eventBus.$on("menu-click", clickHandler); window.$gz.eventBus.$on("menu-click", clickHandler);
@@ -101,6 +102,7 @@ export default {
sort: null sort: null
}, },
dataListKey: undefined, dataListKey: undefined,
hiddenAffectiveColumns: [],
fieldDefinitions: [], fieldDefinitions: [],
editView: [], editView: [],
formState: { formState: {