extended search

This commit is contained in:
2019-07-21 14:12:16 +02:00
parent 70befa7c4d
commit 5a4faca86f
4 changed files with 38 additions and 39 deletions
+11 -12
View File
@@ -1,9 +1,5 @@
var tagArray = [];
const data=[
'th',
'efi',
'wichtig',
];
const data=[];
const CreateMsgRouter = {
template: `
<div class="content card om-card">
@@ -90,12 +86,15 @@ const CreateMsgRouter = {
$.ajax({url: "api/tag/ids",method: "GET"})
.done(jd => {
// NICHT SO wg. Vue: _messagelist = jd;
_taglist.splice(0, _taglist.length);
_taglist.push.apply(_taglist, jd);
console.log("tag: jd: " + jd);
for (var e in jd) {
if (!_tags[jd[e]]) {
get_insert_tag(jd[e]);
console.log("DATA: "+data);
if(data == ""){
_taglist.splice(0, _taglist.length);
_taglist.push.apply(_taglist, jd);
console.log("tag: jd: " + jd);
for (var e in jd) {
if (!_tags[jd[e]]) {
get_insert_tag(jd[e]);
}
}
}
}).fail(function (e, f, g) {
@@ -104,7 +103,7 @@ const CreateMsgRouter = {
}
},
mounted: function () {
this.list_tags();
//this.list_tags();
if ($(this).bootstrapMaterialDesign)
$(this).bootstrapMaterialDesign();
},
+12 -11
View File
@@ -2,8 +2,10 @@ var tagArray = [];
const FileRouter = {
template: `
<div class="content">
<h4>Erweiterte Suche</h4>
<div>
<div class="content">
<h4 >Erweiterte Suche</h4>
</div>
<b-field label="Suche nach">
<b-select
placeholder="Wähle eine Suchform"
@@ -21,16 +23,16 @@ const FileRouter = {
</b-field>
<b-field v-if="selectedOptions=='tags'">
<b-autocomplete rounded v-model="searchtext"
<b-autocomplete v-model="searchtext"
:data="filteredDataArray"
placeholder="suche..." icon="magnify"
placeholder="#" icon="label"
@select="option => selected = option">
</b-autocomplete>
</b-field>
<b-button type="is-primary" @click="search">SUCHE</b-button>
<div id="om-msg-cards">
<div id="om-msg-cards" v-if="isExtendedSearch==true">
<MsgCard
v-for="id in messagelist.slice().reverse()"
:key="id"
@@ -47,6 +49,7 @@ const FileRouter = {
taglist: data,
messagelist: _messagelist,
messages: _messages,
isExtendedSearch: false,
}
},
computed: {
@@ -63,10 +66,6 @@ const FileRouter = {
list_messages: function () {
messages();
},
saveTagsToArray: function () {
tagArray = this.selected;
console.info(tagArray);
},
getFilteredTags(text) {
this.taglist = data.filter((option) => {
return option
@@ -74,7 +73,6 @@ const FileRouter = {
.toLowerCase()
.indexOf(text.toLowerCase()) >= 0
})
this.search();
},
list_tags: function () {
$.ajax({
@@ -83,6 +81,7 @@ const FileRouter = {
})
.done(jd => {
// NICHT SO wg. Vue: _messagelist = jd;
if(data == ""){
_taglist.splice(0, _taglist.length);
_taglist.push.apply(_taglist, jd);
console.log("tag: jd: " + jd);
@@ -91,6 +90,7 @@ const FileRouter = {
get_insert_tag(jd[e]);
}
}
}
}).fail(function (e, f, g) {
console.log("err: " + e + f + g);
});
@@ -101,6 +101,7 @@ const FileRouter = {
},
search: function () {
searching(this.searchtext);
this.isExtendedSearch=true;
},
list_messages: function () {
messages();
@@ -108,7 +109,7 @@ const FileRouter = {
},
mounted: function () {
//this.search();
this.list_tags();
//this.list_tags();
//this.list_messages();
},
};