This commit is contained in:
2019-06-19 21:55:19 +00:00
parent c25df1264b
commit ae0999647c
2 changed files with 44 additions and 23 deletions

View File

@@ -148,7 +148,8 @@
@change="onChange('tags')"
:items="pickLists.tags"
:loading="tagSearchUnderway"
:search-input.sync="searchTags"
:search-input.sync="tagSearchEntry"
no-data-text="ENTER A TAG"
hide-selected
multiple
chips
@@ -156,16 +157,14 @@
deletable-chips
cache-items
>
<template slot="no-data" v-if="searchTags">
<template slot="no-data" v-if="tagSearchEntry">
<v-container>
<v-layout row>
<v-layout justify-start fill-height align-content-center>
Create new tag
</v-layout>
<v-layout justify-end>
<v-icon color="success" @click="addTag()"
>add {{ searchTags }} tag</v-icon
>
<v-btn icon @click="addTag()">
<v-icon>fa-plus-circle</v-icon>
</v-btn>
<v-layout justify-start>
"{{ this.$gzutil.normalizeTag(tagSearchEntry) }}"
</v-layout>
</v-layout>
</v-container>
@@ -298,7 +297,7 @@ export default {
roles: [],
tags: []
},
searchTags: null,
tagSearchEntry: null,
tagSearchUnderway: false,
obj: {
id: 0,
@@ -355,7 +354,7 @@ export default {
},
deep: true
},
searchTags(val) {
tagSearchEntry(val) {
var vm = this;
if (vm.tagSearchUnderway) {
return;
@@ -556,8 +555,13 @@ export default {
});
}
},
addTag(a, b, c) {
debugger;
addTag() {
//todo: clean the tag to server standards first so it's de-duped in the record
var theTag = this.tagSearchEntry;
theTag = this.$gzutil.normalizeTag(theTag);
//make sure there are no existing of the same tag
this.pickLists.tags.push(theTag);
this.obj.tags.push(theTag);
//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)
@@ -565,16 +569,6 @@ export default {
}
};
// //////////////////////
// //
// //
// function addTag(a,b,c) {
// debugger;
// //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)
// }
/////////////////////////////
//
//