This commit is contained in:
2020-04-08 17:42:24 +00:00
parent 96af03958b
commit a87b9dff72
2 changed files with 24 additions and 14 deletions

View File

@@ -51,7 +51,8 @@ CURRENT TODOs
todo: search - center the whole thing, looks silly to the left when everything else is centered
todo: session cache search results and scroll position if possible to support "back and forthing"
todo: SEARCH UI todo: SEARCH UI
- case insensitive by default unless server overriden like picklist - case insensitive by default unless server overriden like picklist
@@ -60,6 +61,8 @@ todo: SEARCH UI
todo: search controller at server needs an excerpt route so client can request an excerpt for a record todo: search controller at server needs an excerpt route so client can request an excerpt for a record
todo: HUGE layout - go through all forms set browser to 4k ultra hd and see where things line up
todo: widgets list form needs search link todo: widgets list form needs search link
todo: if (res.error != undefined) could be changed to if(res.error) everywhere todo: if (res.error != undefined) could be changed to if(res.error) everywhere

View File

@@ -3,10 +3,10 @@
<v-row v-if="formState.ready"> <v-row v-if="formState.ready">
<v-col> <v-col>
<v-form ref="form"> <v-form ref="form">
<v-row> <v-row justify="start">
<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-col cols="12" sm="4" lg="4" xl="3">
<v-text-field <v-text-field
v-model="searchPhrase" v-model="searchPhrase"
clearable clearable
@@ -16,7 +16,7 @@
hint="text, *xt, te*" hint="text, *xt, te*"
></v-text-field> ></v-text-field>
</v-col> </v-col>
<v-col cols="12" sm="6" lg="4" xl="3"> <v-col cols="12" sm="4" lg="4" xl="3">
<v-select <v-select
v-model="searchObjectType" v-model="searchObjectType"
:items="selectLists.objectTypes" :items="selectLists.objectTypes"
@@ -25,7 +25,7 @@
:label="$ay.t('Object')" :label="$ay.t('Object')"
></v-select> ></v-select>
</v-col> </v-col>
<v-col cols="12" sm="6" lg="4" xl="3"> <v-col cols="12" sm="4" lg="4" xl="3">
<v-btn <v-btn
color="primary" color="primary"
v-on:click="getDataFromApi()" v-on:click="getDataFromApi()"
@@ -34,35 +34,36 @@
<v-icon>fa-search</v-icon> <v-icon>fa-search</v-icon>
</v-btn> </v-btn>
</v-col> </v-col>
<v-col cols="12"> <v-col cols="12" sm="12" offset-sm="0" >
<p v-if="!results.length">{{ $ay.t("NoResults") }}</p> <p v-if="!results.length">{{ $ay.t("NoResults") }}</p>
<v-card v-if="results.length" max-width="900px"> <v-card v-if="results.length" max-width="800">
<v-list> <v-list>
<v-subheader v-if="maxResultsReturned"> <v-subheader v-if="maxResultsReturned">
<span>({{ $ay.t("TooManyResults") }})</span> <span>({{ $ay.t("TooManyResults") }})</span>
</v-subheader> </v-subheader>
<template v-for="(item, i) in results" > <template v-for="(item, i) in results">
<v-list-item :key="i"> <v-list-item :key="i">
<v-list-item-avatar> <v-list-item-avatar>
<v-icon>{{ item.icon }}</v-icon> <v-icon>{{ item.icon }}</v-icon>
</v-list-item-avatar> </v-list-item-avatar>
<v-list-item-content> <v-list-item-content>
<v-list-item-title <v-btn text @click="openItem">
v-text="item.name" <v-list-item-title
></v-list-item-title> v-text="item.name"
></v-list-item-title>
</v-btn>
</v-list-item-content> </v-list-item-content>
<v-list-item-action> <v-list-item-action>
<v-btn icon> <v-btn icon @click="getExcerpt">
<v-icon>fa-info-circle</v-icon> <v-icon>fa-info-circle</v-icon>
</v-btn> </v-btn>
</v-list-item-action> </v-list-item-action>
</v-list-item> </v-list-item>
</template> </template>
</v-list> </v-list>
</v-card> </v-card>
</v-col> </v-col>
@@ -154,6 +155,12 @@ export default {
}, },
methods: { methods: {
openItem(item) {
console.log("open item", item);
},
getExcerpt(item) {
console.log("get excerpt", item);
},
getDataFromApi() { getDataFromApi() {
let vm = this; let vm = this;
if (!vm.searchPhrase) { if (!vm.searchPhrase) {