Skip to content

Commit

Permalink
release1.1.0,更新fullcalendar版本到v4
Browse files Browse the repository at this point in the history
  • Loading branch information
inspiration1 committed Aug 3, 2019
1 parent ac57ca8 commit 89488ed
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 99 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"dependencies": {
"@antv/data-set": "^0.10.2",
"@antv/g2": "^3.4.10",
"@fullcalendar/core": "^4.2.0",
"@fullcalendar/daygrid": "^4.2.0",
"@fullcalendar/interaction": "^4.2.0",
"@fullcalendar/timegrid": "^4.2.0",
"@fullcalendar/vue": "^4.2.2",
"@tinymce/tinymce-vue": "^2.0.0",
"axios": "^0.18.0",
"clipboard": "^2.0.0",
Expand Down
81 changes: 0 additions & 81 deletions src/components/fullcalendar/fullcalendar.vue

This file was deleted.

2 changes: 1 addition & 1 deletion src/view/chat/chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ export default {
// 主动发送消息会话列表顺序改变
handleSendMessage (val) {
this.currentConversation.updateTime = val
if (this.currentConversationIndex !== 0) {
this.currentConversation.updateTime = val
this.conversationList.splice(this.currentConversationIndex, 1)
this.conversationList = [this.currentConversation, ...this.conversationList]
this.currentConversationIndex = 0
Expand Down
3 changes: 1 addition & 2 deletions src/view/chat/components/ChatBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
</template>
<script>
import { mapState } from 'vuex'
// import Verbal from './Verbal'
// import SelfUpload from '@/views/mail/mail-home/components/write-mail/self-upload'
export default {
name: 'ChatBox',
props: {
Expand Down
95 changes: 84 additions & 11 deletions src/view/components/fullcalendar/fullcalendar.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,97 @@

<template>
<fullcalendar></fullcalendar>
<div class='demo-app'>
<FullCalendar
class='demo-app-calendar'
ref="fullCalendar"
defaultView="dayGridMonth"
locale="zh-cn"
:header="{
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
}"
:buttonText="buttonText"
:plugins="calendarPlugins"
:weekends="calendarWeekends"
:events="calendarEvents"
:eventLimit="true"
eventLimitText="更多"
@dateClick="handleDateClick"
@eventClick="handleEventClick"
/>
</div>
</template>

<script>
import Fullcalendar from '_c/fullcalendar/fullcalendar'
import FullCalendar from '@fullcalendar/vue'
import dayGridPlugin from '@fullcalendar/daygrid'
import timeGridPlugin from '@fullcalendar/timegrid'
import interactionPlugin from '@fullcalendar/interaction'
export default {
name: 'fullcalendar_page',
components: { Fullcalendar },
components: {
FullCalendar // make the <FullCalendar> tag available
},
data () {
return {
buttonText: {
today: '今天',
month: '',
week: '',
day: '',
list: '列表'
},
calendarPlugins: [ // plugins must be defined in the JS
dayGridPlugin,
timeGridPlugin,
interactionPlugin // needed for dateClick
],
calendarWeekends: true,
calendarEvents: [ // initial event data
{
title: 'Event Now',
start: new Date(),
color: '#A61000'
}
]
}
},
created () {
},
mounted () {
methods: {
toggleWeekends () {
this.calendarWeekends = !this.calendarWeekends // update a property
},
gotoPast () {
let calendarApi = this.$refs.fullCalendar.getApi() // from the ref="..."
calendarApi.gotoDate('2019-08-01') // call a method on the Calendar object
},
handleDateClick (arg) {
if (confirm('Would you like to add an event to ' + arg.dateStr + ' ?')) {
this.calendarEvents.push({ // add new event data
title: 'New Event',
start: arg.date,
allDay: arg.allDay
})
}
},
handleEventClick (info) {
alert('Event: ' + info.event.title)
}
}
}
</script>

<style lang='less'>
// you must include each plugins' css
// paths prefixed with ~ signify node_modules
@import '~@fullcalendar/core/main.css';
@import '~@fullcalendar/daygrid/main.css';
@import '~@fullcalendar/timegrid/main.css';
.demo-app {
font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
font-size: 14px;
}
.demo-app-calendar {
margin: 0 auto;
max-width: 900px;
}
</style>
8 changes: 4 additions & 4 deletions src/view/directive/directive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
</Row>
</Card>
</i-col>
<Modal v-draggable="options" v-model="modalVisible">
<!-- <Modal v-draggable="options" v-model="modalVisible">
拖动这里即可拖动整个弹窗
</Modal> -->
<Modal draggable title="Modal 1" v-model="modalVisible">
可拖动弹窗
</Modal>
</Row>
<Row style="margin-top: 10px;">
Expand Down Expand Up @@ -59,9 +62,6 @@
</Row>
</Card>
</i-col>
<Modal v-draggable="options" v-model="modalVisible">
拖动这里即可拖动整个弹窗
</Modal>
</Row>
</div>
</template>
Expand Down

0 comments on commit 89488ed

Please sign in to comment.