This commit is contained in:
@@ -149,7 +149,11 @@
|
|||||||
:items="pickLists.tags"
|
:items="pickLists.tags"
|
||||||
:loading="tagSearchUnderway"
|
:loading="tagSearchUnderway"
|
||||||
:search-input.sync="searchTags"
|
:search-input.sync="searchTags"
|
||||||
|
multiple
|
||||||
chips
|
chips
|
||||||
|
clearable
|
||||||
|
deletable-chips
|
||||||
|
cache-items
|
||||||
></v-autocomplete>
|
></v-autocomplete>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs12 px-2>
|
<v-flex xs12 px-2>
|
||||||
@@ -164,7 +168,13 @@
|
|||||||
></v-textarea>
|
></v-textarea>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
</v-layout>
|
</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-layout align-left justify-center row wrap mt-5>
|
||||||
<v-flex xs6 sm4>
|
<v-flex xs6 sm4>
|
||||||
READY: {{ formState.ready }}
|
READY: {{ formState.ready }}
|
||||||
@@ -287,7 +297,7 @@ export default {
|
|||||||
notes: null,
|
notes: null,
|
||||||
count: null,
|
count: null,
|
||||||
customFields: null,
|
customFields: null,
|
||||||
tags: null
|
tags: []
|
||||||
},
|
},
|
||||||
formState: {
|
formState: {
|
||||||
ready: false,
|
ready: false,
|
||||||
@@ -331,18 +341,19 @@ export default {
|
|||||||
},
|
},
|
||||||
searchTags(val) {
|
searchTags(val) {
|
||||||
var vm = this;
|
var vm = this;
|
||||||
|
|
||||||
if (vm.tagSearchUnderway) {
|
if (vm.tagSearchUnderway) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
vm.tagSearchUnderway = true;
|
vm.tagSearchUnderway = true;
|
||||||
|
|
||||||
vm.$gzapi
|
vm.$gzapi
|
||||||
.get("TagList/picklist?query=" + val) //roles
|
.get("TagList/picklist?query=" + val) //roles
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
throw 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.pickLists.tags = res.data;
|
||||||
vm.tagSearchUnderway = false;
|
vm.tagSearchUnderway = false;
|
||||||
})
|
})
|
||||||
@@ -392,6 +403,9 @@ export default {
|
|||||||
vm.$gzform.setErrorBoxErrors(vm);
|
vm.$gzform.setErrorBoxErrors(vm);
|
||||||
} else {
|
} else {
|
||||||
vm.obj = res.data;
|
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
|
//Update the form status
|
||||||
vm.$gzform.setFormState({
|
vm.$gzform.setFormState({
|
||||||
vm: vm,
|
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