case 4227

This commit is contained in:
2022-11-03 23:08:04 +00:00
parent 4a0dbb6895
commit 991a34a13d

View File

@@ -111,15 +111,15 @@
> >
<v-edit-dialog <v-edit-dialog
large large
:return-value.sync="props.item.display"
:cancel-text="$ay.t('Cancel')" :cancel-text="$ay.t('Cancel')"
:save-text="$ay.t('OK')" :save-text="$ay.t('OK')"
@save="saveItem()" @save="saveItem()"
@open="openEditDialog(props.item)"
> >
{{ props.item.display }} {{ props.item.display }}
<template v-slot:input> <template v-slot:input>
<v-text-field <v-text-field
v-model="props.item.display" v-model="editText"
dense dense
single-line single-line
></v-text-field> ></v-text-field>
@@ -167,7 +167,9 @@ export default {
serverError: {} serverError: {}
}, },
rights: window.$gz.role.defaultRightsObject(), rights: window.$gz.role.defaultRightsObject(),
ayaType: window.$gz.type.Translation ayaType: window.$gz.type.Translation,
editItem: {},
editText: ""
}; };
}, },
computed: { computed: {
@@ -283,11 +285,19 @@ export default {
this.replaceDialog = false; this.replaceDialog = false;
}, },
saveItem() { saveItem() {
if (this.editText == null || this.editText == "") {
return;
}
this.editItem.display = this.editText;
window.$gz.form.setFormState({ window.$gz.form.setFormState({
vm: this, vm: this,
dirty: true dirty: true
}); });
}, },
openEditDialog(item) {
this.editItem = item;
this.editText = item.display;
},
canDuplicate: function() { canDuplicate: function() {
return ( return (
this.formState.valid && !this.formState.dirty && this.rights.change this.formState.valid && !this.formState.dirty && this.rights.change