This commit is contained in:
2020-04-05 14:36:46 +00:00
parent be813ef4fb
commit 0a315b4d57
2 changed files with 21 additions and 4 deletions

View File

@@ -83,11 +83,17 @@ export default {
//clear any local errors
vm.clearErrors();
//if the search entry is in the results list then it's a drop down selection not a typed search so bail
console.log(
"watch searchentry checking if search or selection for entry:",
val
);
for (let i = 0; i < vm.searchResults.length; i++) {
if (vm.searchResults[i].name == val) {
console.log("Yes, match, bail no search");
return;
}
}
console.log("past entry check, maybe search?");
if (!val || vm.fetching || !vm.initialized) {
if (!vm.initialized) {
vm.$nextTick(() => {
@@ -96,7 +102,8 @@ export default {
}
return;
}
//console.log("watch::searchentry - calling do search:");
console.log("watch::searchentry - calling do search on :", val);
this.doSearch();
},
errors(val) {
@@ -267,6 +274,7 @@ export default {
//NOTE debounce with a watcher is a bit different, currently it has to be done exactly this way, nothing else will work properly
//https://vuejs.org/v2/guide/migration.html#debounce-Param-Attribute-for-v-model-removed
//-----------------
console.log("doSearch top, search for:", vm.searchEntry);
let vm = this;
let isATwoTermQuery = false;
let queryTerms = [];
@@ -282,6 +290,7 @@ export default {
if (val.includes(" ")) {
queryTerms = val.split(" ");
if (queryTerms.length > 2) {
console.log("Query invalid 1");
vm.errors.push(vm.$ay.t("ErrorPickListQueryInvalid"));
return;
}
@@ -317,6 +326,7 @@ export default {
window.$gz._.startsWith(queryTerms[0], "..") &&
window.$gz._.startsWith(queryTerms[1], "..")
) {
console.log("Query invalid 2");
vm.errors.push(vm.$ay.t("ErrorPickListQueryInvalid"));
return;
}
@@ -326,6 +336,7 @@ export default {
!window.$gz._.startsWith(queryTerms[0], "..") &&
!window.$gz._.startsWith(queryTerms[1], "..")
) {
console.log("Query invalid 3");
vm.errors.push(vm.$ay.t("ErrorPickListQueryInvalid"));
return;
}