mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-04 19:53:19 +08:00
Fix form moving between steps [SCI-11461]
This commit is contained in:
parent
e4ea3b61e1
commit
7c9b482f58
3 changed files with 9 additions and 5 deletions
|
@ -11,6 +11,7 @@
|
|||
:placeholder="fieldDisabled ? '' : i18n.t('forms.fields.from')"
|
||||
:class="{'error': !validValue}"
|
||||
/>
|
||||
-
|
||||
<DateTimePicker
|
||||
@change="updateToDate"
|
||||
:defaultValue="toValue"
|
||||
|
|
|
@ -86,7 +86,8 @@ export default {
|
|||
form: this.element.attributes.orderable.form,
|
||||
formResponse: this.element.attributes.orderable,
|
||||
formFieldValues: this.element.attributes.orderable.form_field_values,
|
||||
deleteUrl: this.element.attributes.orderable.urls.delete_url
|
||||
deleteUrl: this.element.attributes.orderable.urls.delete_url,
|
||||
moveUrl: this.element.attributes.orderable.urls.move_url
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -159,6 +160,7 @@ export default {
|
|||
const { attributes } = response.data.data;
|
||||
this.formResponse = attributes.orderable;
|
||||
this.deleteUrl = attributes.orderable.urls.delete_url;
|
||||
this.moveUrl = attributes.orderable.urls.move_url;
|
||||
});
|
||||
},
|
||||
resetForm() {
|
||||
|
@ -166,6 +168,7 @@ export default {
|
|||
const { attributes } = response.data.data;
|
||||
this.formResponse = attributes.orderable;
|
||||
this.deleteUrl = attributes.orderable.urls.delete_url;
|
||||
this.moveUrl = attributes.orderable.urls.move_url;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,11 +13,11 @@ export default {
|
|||
closeMoveModal() {
|
||||
this.movingElement = false;
|
||||
},
|
||||
moveElement(target_id) {
|
||||
axios.post(this.element.attributes.orderable.urls.move_url, { target_id: target_id }).
|
||||
then(() => {
|
||||
moveElement(targetId) {
|
||||
axios.post(this.moveUrl || this.element.attributes.orderable.urls.move_url, { target_id: targetId })
|
||||
.then(() => {
|
||||
this.movingElement = false;
|
||||
this.$emit('moved', this.element.attributes.position, target_id);
|
||||
this.$emit('moved', this.element.attributes.position, targetId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue