fix form create + WIP form edit for Accompanying Period Work

This commit is contained in:
2021-06-22 22:59:34 +02:00
parent 1cd376bf86
commit 0754d20622
13 changed files with 449 additions and 20 deletions

View File

@@ -0,0 +1,89 @@
<template>
<h1>Hello</h1>
<div id="workEditor">
<div>
<label>{{ $t('action_title') }}</label>
<p>{{ work.socialAction.text }}</p>
</div>
<div>
<label>{{ $t('startDate') }}</label>
<input type="date" v-model="startDate" />
</div>
<div>
<label>{{ $t('endDate') }}</label>
<input type="date" v-model="endDate" />
</div>
<div>
<ckeditor
:editor="editor"
v-model="note"
tag-name="textarea"
></ckeditor>
</div>
<div class="objectives_list">
<div class="title" aria="hidden">
<div><h3>Objectifs</h3></div>
<div><h3>Résultats</h3></div>
</div>
</div>
</div>
</template>
<style lang="scss">
</style>
<script>
import { mapState } from 'vuex';
import { dateToISO, ISOToDatetime } from 'ChillMainAssets/js/date.js';
import CKEditor from '@ckeditor/ckeditor5-vue';
import ClassicEditor from 'ChillMainAssets/modules/ckeditor5/index.js';
export default {
name: 'App',
components: {
ckeditor: CKEditor.component,
},
data() {
return {
editor: ClassicEditor,
};
},
computed: {
...mapState([
'work'
]),
startDate: {
get() {
console.log('get start date', this.$store.state.startDate);
return dateToISO(this.$store.state.startDate);
},
set(v) {
this.$store.mutate('setStartDate', ISOToDate(v));
}
},
endDate: {
get() {
console.log('get end date', this.$store.state.endDate);
return dateToISO(this.$store.state.endDate);
},
set(v) {
this.$store.mutate('setEndDate', ISOToDate(v));
}
},
note: {
get() {
return this.$store.state.note;
},
set(v) {
this.$store.mutate('setNote', note);
}
},
}
};
</script>