Commit 46137ca0 by 王志慧

commit

1 parent 9a63ee89
...@@ -147,6 +147,7 @@ export default { ...@@ -147,6 +147,7 @@ export default {
}, },
//设置活动详情 //设置活动详情
setActivity(item) { setActivity(item) {
this.$parent.handleShowCalendar(0)
this.setActivityInfo(item) this.setActivityInfo(item)
}, },
getThemeData(data) { getThemeData(data) {
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<script> <script>
import Calendar from '@toast-ui/calendar' import Calendar from '@toast-ui/calendar'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import { mapState,mapActions } from 'vuex' import { mapState, mapActions } from 'vuex'
export default { export default {
data() { data() {
return { return {
...@@ -39,7 +39,20 @@ export default { ...@@ -39,7 +39,20 @@ export default {
currentDate: '', currentDate: '',
options: { options: {
defaultView: 'month', defaultView: 'month',
calendars: [] month: {
dayNames: ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
},
usageStatistics: false,
template: {
// monthDayName(model) {
// console.log(model, 11111111111111)
// return model.label
// },
// weekDayName(model) {
// console.log(model,2222222222222)
// return `<span>${model.date}</span>&nbsp;&nbsp;<span>${model.dayName}</span>`
// }
}
}, },
eventList: [] eventList: []
} }
...@@ -54,7 +67,7 @@ export default { ...@@ -54,7 +67,7 @@ export default {
this.calendar = new Calendar(container, this.options) this.calendar = new Calendar(container, this.options)
this.calendar.on('clickEvent', e => { this.calendar.on('clickEvent', e => {
this.setActivityInfo({ this.setActivityInfo({
id:e.event.calendarId, id: e.event.calendarId,
type: 'calendar' type: 'calendar'
}) })
}) })
...@@ -62,11 +75,11 @@ export default { ...@@ -62,11 +75,11 @@ export default {
}, },
methods: { methods: {
...mapActions('marketing', ['setActivityInfo']), ...mapActions('marketing', ['setActivityInfo']),
close(){ close() {
this.$parent.handleShowCalendar(0) this.$parent.handleShowCalendar(0)
}, },
getCalendarData() { getCalendarData() {
let colors=['#BFEFD5','#FEE9CC','#FEDCCF','','#CAF2F1','#ECD0FF'] let colors = ['#BFEFD5', '#FEE9CC', '#FEDCCF', '', '#CAF2F1', '#ECD0FF']
let { eventList, calendarData, calendar, currentDate } = this let { eventList, calendarData, calendar, currentDate } = this
eventList = calendarData.map(item => { eventList = calendarData.map(item => {
return { return {
...@@ -74,13 +87,14 @@ export default { ...@@ -74,13 +87,14 @@ export default {
calendarId: item.id, calendarId: item.id,
title: item.title, title: item.title,
start: item.startTime.replace('/', '-'), start: item.startTime.replace('/', '-'),
end: item.endTime, end: item.endTime.replace('/', '-'),
color: '#333333', color: '#333333',
backgroundColor: colors[item.marketingType-1], backgroundColor: colors[item.marketingType - 1],
// dragBackgroundColor: '#3c056d', borderColor: colors[item.marketingType - 1],
dragBackgroundColor: colors[item.marketingType - 1],
customStyle: { customStyle: {
fontSize: '12px;', fontSize: '12px;'
}, }
} }
}) })
calendar.createEvents(eventList) calendar.createEvents(eventList)
...@@ -88,6 +102,7 @@ export default { ...@@ -88,6 +102,7 @@ export default {
}, },
handlePrev(type) { handlePrev(type) {
this.calendar[type]() this.calendar[type]()
this.currentDate = dayjs(this.calendar.getDate()).format('YYYY年MM')
} }
} }
} }
...@@ -125,7 +140,7 @@ export default { ...@@ -125,7 +140,7 @@ export default {
align-items: center; align-items: center;
position: absolute; position: absolute;
cursor: pointer; cursor: pointer;
right:16px; right: 16px;
img { img {
width: 12px; width: 12px;
height: 12px; height: 12px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!