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: if (res.error != undefined) could be changed to if(res.error) everywhere
todo: what is vm.loading used for?
todo: RECORD HISTORY
- implement in stubbed out separate page

View File

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