This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
>
|
>
|
||||||
<v-icon>fa-search</v-icon>
|
<v-icon>fa-search</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
{{ $vuetify.breakpoint.name }}
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
@@ -57,9 +58,9 @@
|
|||||||
@click="openItem(item)"
|
@click="openItem(item)"
|
||||||
v-text="item.name"
|
v-text="item.name"
|
||||||
></v-list-item-title>
|
></v-list-item-title>
|
||||||
<v-list-item-subtitle>{{
|
<v-list-item-subtitle
|
||||||
item.info
|
v-html="item.info"
|
||||||
}}</v-list-item-subtitle>
|
></v-list-item-subtitle>
|
||||||
</v-list-item-content>
|
</v-list-item-content>
|
||||||
<v-list-item-action>
|
<v-list-item-action>
|
||||||
<v-btn icon @click="getExcerpt(item)">
|
<v-btn icon @click="getExcerpt(item)">
|
||||||
@@ -173,6 +174,28 @@ export default {
|
|||||||
if (item.info || item.id == 0) {
|
if (item.info || item.id == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let max = 40;
|
||||||
|
switch (vm.$vuetify.breakpoint.name) {
|
||||||
|
case "xs":
|
||||||
|
max = 30;
|
||||||
|
break;
|
||||||
|
case "sm":
|
||||||
|
max = 67;
|
||||||
|
break;
|
||||||
|
case "md":
|
||||||
|
max = 78;
|
||||||
|
break;
|
||||||
|
case "lg":
|
||||||
|
max = 120;
|
||||||
|
break;
|
||||||
|
case "xl":
|
||||||
|
max = 120;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
max = 40;
|
||||||
|
}
|
||||||
|
|
||||||
window.$gz.api
|
window.$gz.api
|
||||||
.get(
|
.get(
|
||||||
API_BASE_URL +
|
API_BASE_URL +
|
||||||
@@ -181,7 +204,9 @@ export default {
|
|||||||
"/" +
|
"/" +
|
||||||
item.id +
|
item.id +
|
||||||
"?phrase=" +
|
"?phrase=" +
|
||||||
vm.searchPhrase
|
vm.searchPhrase +
|
||||||
|
"&max=" +
|
||||||
|
max
|
||||||
)
|
)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.error != undefined) {
|
if (res.error != undefined) {
|
||||||
@@ -191,12 +216,19 @@ export default {
|
|||||||
//Aya<span class="v-list-item__mask">Nov</span>
|
//Aya<span class="v-list-item__mask">Nov</span>
|
||||||
// <v-list-item-subtitle v-html="item.subtitle"></v-list-item-subtitle>
|
// <v-list-item-subtitle v-html="item.subtitle"></v-list-item-subtitle>
|
||||||
//subtitle: "<span class='text--primary'>to Alex, Scott, Jennifer</span> — Wish I could come, but I'm out of town this weekend.",
|
//subtitle: "<span class='text--primary'>to Alex, Scott, Jennifer</span> — Wish I could come, but I'm out of town this weekend.",
|
||||||
|
let showInfo = res.data;
|
||||||
let searchTerms = vm.searchPhrase
|
let searchTerms = vm.searchPhrase
|
||||||
.toLocaleLowerCase()
|
.toLocaleLowerCase()
|
||||||
.replace(/[*]/gi, "")
|
.replace(/[*]/gi, "")
|
||||||
.split(" ");
|
.split(" ");
|
||||||
console.log("SearchTerms", searchTerms);
|
for (let i = 0; i < searchTerms.length; i++) {
|
||||||
item.info = res.data;
|
showInfo = showInfo.replace(
|
||||||
|
searchTerms[i],
|
||||||
|
"<span class='v-list-item__mask'>" + searchTerms[i] + "</span>"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
item.info = showInfo;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(function handleGetDataFromAPIError(error) {
|
.catch(function handleGetDataFromAPIError(error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user