Commit 46137ca0 by 王志慧

commit

1 parent 9a63ee89
......@@ -147,6 +147,7 @@ export default {
},
//设置活动详情
setActivity(item) {
this.$parent.handleShowCalendar(0)
this.setActivityInfo(item)
},
getThemeData(data) {
......
......@@ -31,7 +31,7 @@
<script>
import Calendar from '@toast-ui/calendar'
import * as dayjs from 'dayjs'
import { mapState,mapActions } from 'vuex'
import { mapState, mapActions } from 'vuex'
export default {
data() {
return {
......@@ -39,7 +39,20 @@ export default {
currentDate: '',
options: {
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: []
}
......@@ -53,20 +66,20 @@ export default {
let container = this.$refs.calendar
this.calendar = new Calendar(container, this.options)
this.calendar.on('clickEvent', e => {
this.setActivityInfo({
id:e.event.calendarId,
type: 'calendar'
})
this.setActivityInfo({
id: e.event.calendarId,
type: 'calendar'
})
})
this.getCalendarData()
},
methods: {
...mapActions('marketing', ['setActivityInfo']),
close(){
this.$parent.handleShowCalendar(0)
...mapActions('marketing', ['setActivityInfo']),
close() {
this.$parent.handleShowCalendar(0)
},
getCalendarData() {
let colors=['#BFEFD5','#FEE9CC','#FEDCCF','','#CAF2F1','#ECD0FF']
let colors = ['#BFEFD5', '#FEE9CC', '#FEDCCF', '', '#CAF2F1', '#ECD0FF']
let { eventList, calendarData, calendar, currentDate } = this
eventList = calendarData.map(item => {
return {
......@@ -74,13 +87,14 @@ export default {
calendarId: item.id,
title: item.title,
start: item.startTime.replace('/', '-'),
end: item.endTime,
color: '#333333',
backgroundColor: colors[item.marketingType-1],
// dragBackgroundColor: '#3c056d',
customStyle: {
fontSize: '12px;',
},
end: item.endTime.replace('/', '-'),
color: '#333333',
backgroundColor: colors[item.marketingType - 1],
borderColor: colors[item.marketingType - 1],
dragBackgroundColor: colors[item.marketingType - 1],
customStyle: {
fontSize: '12px;'
}
}
})
calendar.createEvents(eventList)
......@@ -88,6 +102,7 @@ export default {
},
handlePrev(type) {
this.calendar[type]()
this.currentDate = dayjs(this.calendar.getDate()).format('YYYY年MM')
}
}
}
......@@ -125,7 +140,7 @@ export default {
align-items: center;
position: absolute;
cursor: pointer;
right:16px;
right: 16px;
img {
width: 12px;
height: 12px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!