This commit is contained in:
@@ -36,9 +36,13 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-card max-width="900px">
|
<p v-if="!results.length">No results</p>
|
||||||
|
<v-card v-if="results.length" max-width="900px">
|
||||||
<v-list>
|
<v-list>
|
||||||
<v-subheader>Results</v-subheader>
|
<v-subheader v-if="maxResultsReturned">
|
||||||
|
<span>({{ $ay.t("TooManyResults") }})</span>
|
||||||
|
</v-subheader>
|
||||||
|
_.groupBy(collection, [iteratee=_.identity])
|
||||||
<v-list-item-group v-model="item" color="primary">
|
<v-list-item-group v-model="item" color="primary">
|
||||||
<v-list-item v-for="(item, i) in results" :key="i">
|
<v-list-item v-for="(item, i) in results" :key="i">
|
||||||
<v-list-item-icon>
|
<v-list-item-icon>
|
||||||
@@ -53,10 +57,6 @@
|
|||||||
</v-list-item-group>
|
</v-list-item-group>
|
||||||
</v-list>
|
</v-list>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
totalresults:{{ totalResults }}
|
|
||||||
|
|
||||||
<div>results:{{ results }}</div>
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-form>
|
</v-form>
|
||||||
@@ -98,6 +98,7 @@
|
|||||||
const FORM_KEY = "home-search";
|
const FORM_KEY = "home-search";
|
||||||
const API_BASE_URL = "Search/";
|
const API_BASE_URL = "Search/";
|
||||||
const FORM_CUSTOM_TEMPLATE_KEY = "home-search";
|
const FORM_CUSTOM_TEMPLATE_KEY = "home-search";
|
||||||
|
const MAX_RESULTS = 200;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
created() {
|
created() {
|
||||||
@@ -129,7 +130,7 @@ export default {
|
|||||||
searchPhrase: null,
|
searchPhrase: null,
|
||||||
searchObjectType: 0,
|
searchObjectType: 0,
|
||||||
results: [],
|
results: [],
|
||||||
totalResults: null,
|
maxResultsReturned: false,
|
||||||
formState: {
|
formState: {
|
||||||
ready: false,
|
ready: false,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
@@ -167,7 +168,7 @@ export default {
|
|||||||
phrase: vm.searchPhrase,
|
phrase: vm.searchPhrase,
|
||||||
nameOnly: false,
|
nameOnly: false,
|
||||||
typeOnly: !!vm.searchObjectType ? vm.searchObjectType : 0,
|
typeOnly: !!vm.searchObjectType ? vm.searchObjectType : 0,
|
||||||
maxResults: 200
|
maxResults: MAX_RESULTS
|
||||||
})
|
})
|
||||||
|
|
||||||
.then(res => {
|
.then(res => {
|
||||||
@@ -176,7 +177,9 @@ export default {
|
|||||||
window.$gz.form.setErrorBoxErrors(vm);
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
} else {
|
} else {
|
||||||
vm.results = res.data.searchResults;
|
vm.results = res.data.searchResults;
|
||||||
vm.totalResults = res.data.totalResultsFound;
|
vm.maxResultsReturned =
|
||||||
|
res.data.searchResults.length == MAX_RESULTS;
|
||||||
|
|
||||||
//Update the form status
|
//Update the form status
|
||||||
window.$gz.form.setFormState({
|
window.$gz.form.setFormState({
|
||||||
vm: vm,
|
vm: vm,
|
||||||
@@ -260,7 +263,8 @@ 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
|
||||||
"Object"
|
"Object",
|
||||||
|
"TooManyResults"
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user