This commit is contained in:
2020-03-24 15:37:46 +00:00
parent 30760c0d4c
commit 08edbf8ace

View File

@@ -107,17 +107,11 @@ export default {
vm.getList(urlParams);
}
// else if (vm.preFill) {
// //no non-empty initial value to select but list specified to pre-fill
// vm.searchUnderway = true;
// vm.getList();
// }
},
data() {
return {
searchResults: [],
errors: [],
selected: { name: "-", id: 0 },
errors: [],
searchEntry: null,
searchUnderway: false,
isTagFilter: false,
@@ -148,21 +142,14 @@ export default {
searchEntry(val, oldVal) {
var vm = this;
//clear any local errors
vm.errors = [];
// console.log("WATCH::SEARCHENTRY TRIGGERED: initialized=", vm.initialized);
vm.errors = [];
//if the selected search entry is in the results list then it's just a selection made manually
//console.log("watch:searchentry search results=", vm.searchResults);
//if the selected search entry is in the results list then it's just a selection made manually not a typed search so bail
for (var i = 0; i < vm.searchResults.length; i++) {
if (vm.searchResults[i].name == val) {
// console.log(
// "Search entry is in the search results so it was a seletion, bailing"
// );
if (vm.searchResults[i].name == val) {
return;
}
}
// console.log("val:", val);
// console.log("oldVal", oldVal);
if (!val || vm.searchUnderway || !vm.initialized) {
if (!vm.initialized) {
@@ -171,30 +158,10 @@ export default {
});
}
return;
}
if (vm.selected != null) {
if (val == vm.selected.name) {
return;
}
}
// debugger;
}
this.doSearch();
},
// value(val) {
// //this ensures the parent form gets the onchange event
// //not actually sure why there are two here but it worked with the datetime picker so I replicated it here
// //To answer above it appears both are necessary for proper operation
// this.$emit("input", val);
// this.$emit("change", val);
// console.log("Watch:Value triggered:", val);
// },
// selected(val) {
// if (val && val.id) {
// console.log("Watch:Selected triggered:", val);
// this.$emit("input", val.id);
// this.$emit("change", val.id);
// }
// },
errors(val) {
if (this.hasError()) {
this.errorIcon = "fa-question-circle";
@@ -227,7 +194,7 @@ export default {
}
},
dropdown(e) {
console.log("DROPDOWN FIRED", e);
//console.log("DROPDOWN FIRED", e);
},
customFilter(item, queryText, itemText) {
//NOTE: I wanted this to work with tags but all it does is highlight all of each row if tag query is present