This commit is contained in:
@@ -149,7 +149,11 @@
|
||||
:items="pickLists.tags"
|
||||
:loading="tagSearchUnderway"
|
||||
:search-input.sync="searchTags"
|
||||
multiple
|
||||
chips
|
||||
clearable
|
||||
deletable-chips
|
||||
cache-items
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 px-2>
|
||||
@@ -164,7 +168,13 @@
|
||||
></v-textarea>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout align-left justify-center row wrap mt-5>
|
||||
<v-flex xs6 sm4>
|
||||
tags: {{ obj.tags }}
|
||||
<br />
|
||||
TagPickList: {{ pickLists.tags }}
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<!-- <v-layout align-left justify-center row wrap mt-5>
|
||||
<v-flex xs6 sm4>
|
||||
READY: {{ formState.ready }}
|
||||
@@ -287,7 +297,7 @@ export default {
|
||||
notes: null,
|
||||
count: null,
|
||||
customFields: null,
|
||||
tags: null
|
||||
tags: []
|
||||
},
|
||||
formState: {
|
||||
ready: false,
|
||||
@@ -331,18 +341,19 @@ export default {
|
||||
},
|
||||
searchTags(val) {
|
||||
var vm = this;
|
||||
|
||||
if (vm.tagSearchUnderway) {
|
||||
return;
|
||||
}
|
||||
vm.tagSearchUnderway = true;
|
||||
|
||||
vm.$gzapi
|
||||
.get("TagList/picklist?query=" + val) //roles
|
||||
.then(res => {
|
||||
if (res.error) {
|
||||
throw res.error;
|
||||
}
|
||||
//adding this to the property will automatically have it cached by the autocomplete component
|
||||
//as cache-items has been set so this just needs to be set here once and all is well in future
|
||||
//Any search will be kept for later so this is very efficient
|
||||
vm.pickLists.tags = res.data;
|
||||
vm.tagSearchUnderway = false;
|
||||
})
|
||||
@@ -392,6 +403,9 @@ export default {
|
||||
vm.$gzform.setErrorBoxErrors(vm);
|
||||
} else {
|
||||
vm.obj = res.data;
|
||||
//Populate tags pick list, this is required to cache it at least once and display it when form opens
|
||||
vm.pickLists.tags=res.data.tags;
|
||||
|
||||
//Update the form status
|
||||
vm.$gzform.setFormState({
|
||||
vm: vm,
|
||||
@@ -529,6 +543,15 @@ export default {
|
||||
}
|
||||
};
|
||||
|
||||
//////////////////////
|
||||
//
|
||||
//
|
||||
function addTagsToPickList(vm, tags) {
|
||||
//add tags to existing picklist so that it contains all the unique tags ever searched for or present in the object
|
||||
//vm.pickLists.tags+=tags
|
||||
//vm.pickLists.tags=uniqueonly(vm.pickLists.tags)
|
||||
}
|
||||
|
||||
/////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user