extended search
This commit is contained in:
parent
70befa7c4d
commit
5a4faca86f
@ -182,11 +182,6 @@
|
||||
<script>
|
||||
var isSearchActive = false;
|
||||
var tagArray = ["lorem"];
|
||||
const dat = [
|
||||
'th',
|
||||
'efi',
|
||||
'wichtig',
|
||||
];
|
||||
|
||||
</script>
|
||||
|
||||
@ -211,7 +206,7 @@
|
||||
searchtext: "",
|
||||
//isSearchActiv: false,
|
||||
selected: [],
|
||||
taglist: dat,
|
||||
taglist: data,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -227,7 +222,7 @@
|
||||
methods: {
|
||||
|
||||
getFilteredTags(text) {
|
||||
this.taglist = dat.filter((option) => {
|
||||
this.taglist = data.filter((option) => {
|
||||
return option
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
@ -240,6 +235,7 @@
|
||||
console.info(tagArray);
|
||||
},
|
||||
search: function() {
|
||||
|
||||
searching(this.searchtext);
|
||||
},
|
||||
list_messages: function() {
|
||||
@ -252,6 +248,7 @@
|
||||
})
|
||||
.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);
|
||||
@ -260,6 +257,7 @@
|
||||
get_insert_tag(jd[e]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).fail(function(e, f, g) {
|
||||
console.log("err: " + e + f + g);
|
||||
});
|
||||
@ -285,7 +283,7 @@
|
||||
url: "api/tag/" + id,
|
||||
method: "GET"
|
||||
}).done(function(tag) {
|
||||
dat.push("#" + tag.name);
|
||||
data.push("#" + tag.name);
|
||||
console.log("it worked!");
|
||||
}).fail(function(e, f, g) {
|
||||
console.log("cannot load " + id + ".json: " + e + f + g);
|
||||
@ -300,6 +298,7 @@
|
||||
method: "GET"
|
||||
}).done(jd => {
|
||||
// NICHT SO wg. Vue: _messagelist = jd;
|
||||
router.push('/home');
|
||||
_messagelist.splice(0, _messagelist.length);
|
||||
_messagelist.push.apply(_messagelist, jd);
|
||||
//console.log("jd: "+jd);
|
||||
|
@ -1,9 +1,5 @@
|
||||
var tagArray = [];
|
||||
const data=[
|
||||
'th',
|
||||
'efi',
|
||||
'wichtig',
|
||||
];
|
||||
const data=[];
|
||||
const CreateMsgRouter = {
|
||||
template: `
|
||||
<div class="content card om-card">
|
||||
@ -90,6 +86,8 @@ const CreateMsgRouter = {
|
||||
$.ajax({url: "api/tag/ids",method: "GET"})
|
||||
.done(jd => {
|
||||
// NICHT SO wg. Vue: _messagelist = jd;
|
||||
console.log("DATA: "+data);
|
||||
if(data == ""){
|
||||
_taglist.splice(0, _taglist.length);
|
||||
_taglist.push.apply(_taglist, jd);
|
||||
console.log("tag: jd: " + jd);
|
||||
@ -98,13 +96,14 @@ const CreateMsgRouter = {
|
||||
get_insert_tag(jd[e]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).fail(function (e, f, g) {
|
||||
console.log("err: " + e + f + g);
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
this.list_tags();
|
||||
//this.list_tags();
|
||||
if ($(this).bootstrapMaterialDesign)
|
||||
$(this).bootstrapMaterialDesign();
|
||||
},
|
||||
|
@ -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();
|
||||
},
|
||||
};
|
||||
|
@ -59,7 +59,7 @@ const dbs = {
|
||||
get: function(req, res) {
|
||||
model.Messages.find(
|
||||
{$text: {$search: req.params.phrase}})
|
||||
.sort({tag:1, user:1, message:1, subject:1})
|
||||
.sort({tag:-1})
|
||||
.exec().then(results => {
|
||||
//selects id from message:
|
||||
var parsed = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user