This commit is contained in:
2020-04-07 20:04:49 +00:00
parent e9556b1777
commit 8355937544
2 changed files with 28 additions and 16 deletions

View File

@@ -54,6 +54,8 @@ CURRENT TODOs
todo: SEARCH UI todo: SEARCH UI
todo: if (res.error != undefined) could be changed to if(res.error) everywhere
todo: what is vm.loading used for?
todo: RECORD HISTORY todo: RECORD HISTORY
- implement in stubbed out separate page - implement in stubbed out separate page

View File

@@ -5,25 +5,34 @@
<v-form ref="form"> <v-form ref="form">
<v-row> <v-row>
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error> <gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-select
v-model="obj.searchObjectType"
:items="selectLists.objectTypes"
item-text="name"
item-value="id"
:label="$ay.t('Translation')"
></v-select>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3"> <v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field <v-text-field
v-model="obj.searchPhrase" v-model="searchPhrase"
clearable clearable
:label="$ay.t('UserEmailAddress')" :label="$ay.t('Search')"
ref="searchPhrase" ref="searchPhrase"
append-icon="fa-search" hint="text, *xt, *ex*, te*"
></v-text-field> ></v-text-field>
</v-col> </v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-select
v-model="searchObjectType"
:items="selectLists.objectTypes"
item-text="name"
item-value="id"
:label="$ay.t('Object')"
></v-select>
</v-col>
<v-col cols="12">
<v-btn
color="primary"
v-on:click="getDataFromApi()"
value="SEARCH"
>
<v-icon>fa-search</v-icon>
</v-btn>
</v-col>
<v-col cols="12"> <v-col cols="12">
totalresults:{{ totalResults }} totalresults:{{ totalResults }}
@@ -78,7 +87,7 @@ export default {
.then(() => { .then(() => {
vm.formState.ready = true; vm.formState.ready = true;
window.$gz.eventBus.$on("menu-click", clickHandler); window.$gz.eventBus.$on("menu-click", clickHandler);
generateMenu(vm);
// vm.getDataFromApi(); // vm.getDataFromApi();
}) })
.catch(err => { .catch(err => {
@@ -97,7 +106,7 @@ export default {
objectTypes: [] objectTypes: []
}, },
searchPhrase: null, searchPhrase: null,
searchObjectType: null, searchObjectType: 0,
results: [], results: [],
totalResults: null, totalResults: null,
formState: { formState: {
@@ -226,7 +235,7 @@ function initForm(vm) {
function fetchTranslatedText(vm) { function fetchTranslatedText(vm) {
return window.$gz.translation.fetch([ return window.$gz.translation.fetch([
//todo: needs all object types //todo: needs all object types
"Search" "Object"
]); ]);
} }
@@ -235,10 +244,11 @@ function fetchTranslatedText(vm) {
// //
function populateSelectionLists(vm) { function populateSelectionLists(vm) {
return window.$gz.api.get("EnumList/List/Core").then(res => { return window.$gz.api.get("EnumList/List/Core").then(res => {
if (res.error != undefined) { if (res.error) {
window.$gz.errorHandler.handleFormError(res.error, vm); window.$gz.errorHandler.handleFormError(res.error, vm);
} else { } else {
vm.selectLists.objectTypes = res.data; vm.selectLists.objectTypes = res.data;
window.$gz.form.addNoSelectionItem(vm.selectLists.objectTypes);
} }
}); });
} }