var tagArray = [];
const FileRouter = {
template: `
Erweiterte Suche
selected = option">
SUCHE
`,
data: function () {
return {
searchtext: "",
selectedOptions: [],
selected: [],
taglist: data,
messagelist: _messagelist,
messages: _messages,
}
},
computed: {
filteredDataArray() {
return this.taglist.filter((option) => {
return option
.toString()
.toLowerCase()
.indexOf(this.searchtext.toLowerCase()) >= 0
})
}
},
methods: {
list_messages: function () {
messages();
},
saveTagsToArray: function () {
tagArray = this.selected;
console.info(tagArray);
},
getFilteredTags(text) {
this.taglist = data.filter((option) => {
return option
.toString()
.toLowerCase()
.indexOf(text.toLowerCase()) >= 0
})
this.search();
},
list_tags: function () {
$.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]);
}
}
}).fail(function (e, f, g) {
console.log("err: " + e + f + g);
});
},
saveTagsToArray: function () {
tagArray = this.selected;
console.info(tagArray);
},
search: function () {
searching(this.searchtext);
},
list_messages: function () {
messages();
},
},
mounted: function () {
//this.search();
this.list_tags();
//this.list_messages();
},
};