diff --git a/resources/assets/js/pages/manage/calendar.vue b/resources/assets/js/pages/manage/calendar.vue index dd8361a9..fffeef87 100644 --- a/resources/assets/js/pages/manage/calendar.vue +++ b/resources/assets/js/pages/manage/calendar.vue @@ -31,6 +31,7 @@ :calendars="calendarList" :schedules="list" :taskView="false" + :useCreationPopup="false" @beforeCreateSchedule="onBeforeCreateSchedule" @beforeClickSchedule="onBeforeClickSchedule" @beforeUpdateSchedule="onBeforeUpdateSchedule" @@ -47,6 +48,7 @@ import 'tui-calendar-hi/dist/tui-calendar-hi.css' import {mapState, mapGetters} from "vuex"; import Calendar from "./components/Calendar"; import moment from "moment"; +import {Store} from "le5le-store"; export default { components: {Calendar}, @@ -254,16 +256,13 @@ export default { return currentDate.format(format); }, - onBeforeCreateSchedule(res) { - this.$store.dispatch("taskAdd", { - project_id: res.calendarId, - times: [res.start.toDate(), res.end.toDate()], - name: res.title, + onBeforeCreateSchedule({start, end, guide}) { + Store.set('addTask', { + times: [start.toDate(), end.toDate()], owner: this.userId, - }).then(({msg}) => { - $A.messageSuccess(msg); - }).catch(({msg}) => { - $A.modalError(msg); + beforeClose: () => { + guide.clearGuideElement(); + } }); }, diff --git a/resources/assets/js/pages/manage/components/TaskAdd.vue b/resources/assets/js/pages/manage/components/TaskAdd.vue index e8af6a39..156b60d3 100644 --- a/resources/assets/js/pages/manage/components/TaskAdd.vue +++ b/resources/assets/js/pages/manage/components/TaskAdd.vue @@ -216,6 +216,8 @@ export default { }, loadIng: 0, + + beforeClose: [], } }, mounted() { @@ -246,6 +248,10 @@ export default { this.$refs.input.focus() }) } else { + this.beforeClose.some(func => { + typeof func === "function" && func() + }) + this.beforeClose = []; this.taskTimeOpen = false; } }, @@ -479,6 +485,10 @@ export default { }, setData(data) { + if (typeof data.beforeClose !== "undefined") { + this.beforeClose.push(data.beforeClose) + delete data.beforeClose; + } this.addData = Object.assign({}, this.addData, data); },