mirror of
https://git.meshkee.com/cssd/cssd-front.git
synced 2026-10-12 12:23:17 +03:30
fix : duplicate in package & cycle- show items details
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
</v-flex>
|
||||
<v-flex xs12 sm6 md4 class="WM-FlexCenter">
|
||||
<v-icon class="far fa-calendar-alt mr-2"/>
|
||||
<v-menu
|
||||
<v-menu class="WM-Width-Full"
|
||||
lazy
|
||||
:close-on-content-click="true"
|
||||
transition="v-scale-transition"
|
||||
@@ -48,6 +48,9 @@
|
||||
<div class="Inner">
|
||||
<v-icon class="fa fa-check mr-2 WM-Margin-B-8"></v-icon>
|
||||
<v-autocomplete
|
||||
@keydown.enter.native.prevent="duplicateForm(key)"
|
||||
@change="duplicateForm(key)"
|
||||
:ref="`selectItem-${key}`"
|
||||
color="black"
|
||||
:items="labels"
|
||||
item-text="id"
|
||||
@@ -132,6 +135,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.loadLabels();
|
||||
console.log()
|
||||
if (this.$route.params.cycle) {
|
||||
this.load(this.$route.params.cycle);
|
||||
}
|
||||
@@ -159,6 +163,7 @@ export default {
|
||||
}
|
||||
},
|
||||
async submitForm() {
|
||||
this.formData.labels = this.formData.labels.filter(label => label.id);
|
||||
let result;
|
||||
if (this.$route.params.cycle) {
|
||||
result = await ApiService.put(urls.updateCycle(this.$route.params.cycle), this.formData);
|
||||
@@ -170,8 +175,15 @@ export default {
|
||||
this.$router.push({name: "AllCycle"});
|
||||
}
|
||||
},
|
||||
duplicateForm(infoIndex) {
|
||||
duplicateForm() {
|
||||
this.formData.labels.push({name: "",});
|
||||
this.$nextTick( () => {
|
||||
const newIndex = this.formData.labels.length - 1;
|
||||
const ref = this.$refs[`selectItem-${newIndex}`];
|
||||
if (ref && ref[0]) {
|
||||
ref[0].focus();
|
||||
}
|
||||
});
|
||||
},
|
||||
removeForm(infoIndex) {
|
||||
this.formData.labels.splice(infoIndex, 1);
|
||||
|
||||
@@ -199,9 +199,15 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
duplicateForm(infoIndex) {
|
||||
duplicateForm() {
|
||||
this.formData.items.push({name: "",});
|
||||
this.$refs[`selectItem-${infoIndex}`][0].focus();
|
||||
this.$nextTick( () => {
|
||||
const newIndex = this.formData.items.length - 1;
|
||||
const ref = this.$refs[`selectItem-${newIndex}`];
|
||||
if (ref && ref[0]) {
|
||||
ref[0].focus();
|
||||
}
|
||||
});
|
||||
},
|
||||
removeForm(infoIndex) {
|
||||
this.formData.items.splice(infoIndex, 1);
|
||||
|
||||
Reference in New Issue
Block a user