This commit is contained in:
@@ -26,88 +26,25 @@
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<template slot="append-outer">
|
||||
<v-flex xs6 sm4>
|
||||
PICKER VALUE: {{ value }}
|
||||
<br />
|
||||
PICKER SOURCE TAGS: {{ sourcetags }}
|
||||
</v-flex>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
|
||||
<!--
|
||||
v-on:input="$emit('input', $event.target.value)"
|
||||
<v-autocomplete
|
||||
v-model="obj.tags"
|
||||
:readonly="this.formState.readOnly"
|
||||
:label="this.$gzlocale.get('Tags')"
|
||||
:error-messages="this.$gzform.serverErrors(this, 'tags')"
|
||||
ref="tags"
|
||||
@change="onChange('tags')"
|
||||
:items="pickLists.tags"
|
||||
:loading="tagSearchUnderway"
|
||||
:search-input.sync="tagSearchEntry"
|
||||
hide-selected
|
||||
multiple
|
||||
chips
|
||||
clearable
|
||||
deletable-chips
|
||||
cache-items
|
||||
>
|
||||
<template slot="no-data" v-if="tagSearchEntry">
|
||||
<v-container>
|
||||
<v-layout row>
|
||||
<v-layout justify-center>
|
||||
<v-chip
|
||||
color="primary"
|
||||
text-color="white"
|
||||
class="display-1"
|
||||
>
|
||||
{{ this.$gzutil.normalizeTag(tagSearchEntry) }}</v-chip
|
||||
>
|
||||
<v-btn large icon @click="addTag()">
|
||||
<v-icon large color="success">fa-plus-circle</v-icon>
|
||||
</v-btn>
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</template>
|
||||
</v-autocomplete> -->
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* eslint-disable */
|
||||
/* Xeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// import _ from "../libs/lodash.min.js";
|
||||
|
||||
export default {
|
||||
created() {
|
||||
//debugger;
|
||||
},
|
||||
mounted() {
|
||||
//Populate tags pick list, this is required to cache it at least once and display it when form opens
|
||||
// this.sourcetags = this.value;
|
||||
//debugger;
|
||||
},
|
||||
beforeUpdate() {
|
||||
//Set the initial picklist items based on the record items, this only needs to be called once at init
|
||||
if (!this.initialized && this.value.length > 0) {
|
||||
this.sourcetags = this.value;
|
||||
this.initialized = true;
|
||||
}
|
||||
//debugger;
|
||||
},
|
||||
updated() {
|
||||
//debugger;
|
||||
},
|
||||
beforeMount() {
|
||||
//debugger;
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
sourcetags: [""],
|
||||
testvalue: ["me", "you"],
|
||||
// localValue: [],
|
||||
tagSearchEntry: null,
|
||||
tagSearchUnderway: false,
|
||||
initialized: false
|
||||
@@ -119,7 +56,7 @@ export default {
|
||||
watch: {
|
||||
tagSearchEntry(val) {
|
||||
var vm = this;
|
||||
if (vm.tagSearchUnderway) {
|
||||
if (!val || vm.tagSearchUnderway) {
|
||||
return;
|
||||
}
|
||||
vm.tagSearchUnderway = true;
|
||||
@@ -145,9 +82,6 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
test(ev) {
|
||||
debugger;
|
||||
},
|
||||
addTag() {
|
||||
var theTag = this.tagSearchEntry;
|
||||
theTag = this.normalizeTag(theTag);
|
||||
@@ -158,28 +92,13 @@ export default {
|
||||
},
|
||||
normalizeTag(tagName) {
|
||||
//kebab case takes care of all the things we need for tags in one go
|
||||
tagName = _.kebabCase(tagName);
|
||||
|
||||
tagName = this.$_.kebabCase(tagName);
|
||||
//No longer than 255 characters
|
||||
tagName = tagName.length > 255 ? tagName.substr(0, 255 - 1) : tagName;
|
||||
|
||||
return tagName;
|
||||
//
|
||||
// //This may be naive when we get international customers but for now supporting utf-8 and it appears it's safe to do this with unicode
|
||||
// inObj = inObj.ToLowerInvariant();
|
||||
// //No spaces in tags, replace with dashes
|
||||
// inObj = inObj.Replace(" ", "-");
|
||||
// //Remove multiple dash sequences
|
||||
// inObj = System.Text.RegularExpressions.Regex.Replace(inObj, "-+", "-");
|
||||
// //Ensure doesn't start or end with a dash
|
||||
// inObj = inObj.Trim('-');
|
||||
// //No longer than 255 characters
|
||||
// inObj = StringUtil.MaxLength(inObj, 255);
|
||||
// return inObj;
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
//debugger;
|
||||
//check pre-requisites exist just in case
|
||||
if (this.$gzdevmode()) {
|
||||
if (!this.$_) {
|
||||
|
||||
Reference in New Issue
Block a user