- add Duplicate Event in Calendar
This commit is contained in:
@@ -492,6 +492,17 @@ export default class CEventsCalendar extends Vue {
|
|||||||
tools.CancelEvent(this, eventparam)
|
tools.CancelEvent(this, eventparam)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public duplicateEvent(eventparam) {
|
||||||
|
GlobalStore.actions.DuplicateRec({ table: tools.TABEVENTS, id: eventparam._id }).then((rec) => {
|
||||||
|
rec.dateTimeStart = new Date()
|
||||||
|
rec.dateTimeEnd = new Date()
|
||||||
|
CalendarStore.state.eventlist.push(rec)
|
||||||
|
this.editEvent(rec)
|
||||||
|
|
||||||
|
})
|
||||||
|
// tools.ActionRecTable(this, lists.MenuAction.DUPLICATE_RECTABLE, tools.TABEVENTS, eventparam._id, eventparam, 'db.duplicatedrecord')
|
||||||
|
}
|
||||||
|
|
||||||
public findEventIndex(eventparam) {
|
public findEventIndex(eventparam) {
|
||||||
for (let i = 0; i < CalendarStore.state.eventlist.length; ++i) {
|
for (let i = 0; i < CalendarStore.state.eventlist.length; ++i) {
|
||||||
if (eventparam) {
|
if (eventparam) {
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
<q-toolbar-title>
|
<q-toolbar-title>
|
||||||
{{ $t('cal.event') }}
|
{{ $t('cal.event') }}
|
||||||
</q-toolbar-title>
|
</q-toolbar-title>
|
||||||
|
<q-btn v-if="editable" flat round color="white" icon="fas fa-copy" v-close-popup
|
||||||
|
@click="duplicateEvent(myevent)"></q-btn>
|
||||||
<q-btn v-if="editable" flat round color="white" icon="delete" v-close-popup
|
<q-btn v-if="editable" flat round color="white" icon="delete" v-close-popup
|
||||||
@click="deleteEvent(myevent)"></q-btn>
|
@click="deleteEvent(myevent)"></q-btn>
|
||||||
<q-btn v-if="editable" flat round color="white" icon="edit" v-close-popup
|
<q-btn v-if="editable" flat round color="white" icon="edit" v-close-popup
|
||||||
|
|||||||
@@ -338,7 +338,6 @@ export default class CGridTableRec extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ActionAfterYes(action, item, data) {
|
public ActionAfterYes(action, item, data) {
|
||||||
if (action === lists.MenuAction.DELETE_RECTABLE) {
|
if (action === lists.MenuAction.DELETE_RECTABLE) {
|
||||||
if (this.serverData.length > 0)
|
if (this.serverData.length > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user