-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhtml - 副本.html
244 lines (234 loc) · 6.73 KB
/
html - 副本.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<template>
<a-config-provider :locale="zh_CN">
<div id="app">
<div class="leri-box">
<a-row :gutter="16" type="flex">
<a-col :sm="24" :md="5">
<a-card class="jm-leri-left-card-box" :bordered="false">
<div class="leri-left-btn"><a-button type="primary">确认</a-button></div>
<a-checkbox-group
v-model="userList"
name="checkboxgroup"
:options="userNameList"
/>
</a-card>
</a-col>
<a-col :sm="24" :md="19">
<a-card class="jm-leri-right-card-box" :bordered="false">
<div class='demo-app'>
<FullCalendar
class='demo-app-calendar'
ref="fullCalendar"
defaultView="dayGridMonth"
:locale="esLocale"
:header="{
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
}"
:height="660"
:buttonText="{
today: '今天',
month: '月',
week: '周',
day: '日',
prev:'上月',
next:'下月'
}"
:plugins="calendarPlugins"
:weekends="calendarWeekends"
:eventLimit="true"
:events="calendarEvents"
@dateClick="handleDateClick"
@eventClick="handleEventClick"
/>
</div>
</a-card>
</a-col>
</a-row>
</div>
</div>
</a-config-provider>
</template>
<script>
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN'
// import HelloWorld from './components/HelloWorld.vue' :events="calendarEvents" :eventSources="eventSources"
import {setStates, eventTypes, frameFormats, isDataIds,dataIdLengths,dataIdBegins, pgnIds,
paramLengths,startStations,highBytes,beginCounts,scopes,values,distributes} from '@/constp.js';
import FullCalendar from '@fullcalendar/vue'
import dayGridPlugin from '@fullcalendar/daygrid'
import timeGridPlugin from '@fullcalendar/timegrid'
import interactionPlugin from '@fullcalendar/interaction'
import esLocale from '@fullcalendar/core/locales/zh-cn';
export default {
components: {
FullCalendar // make the <FullCalendar> tag available
},
data() {
return {
zh_CN,
other:'',
userNameList: [],
userList:[],
esLocale,
calendarPlugins: [ // plugins must be defined in the JS
dayGridPlugin,
timeGridPlugin,
interactionPlugin // needed for dateClick
],
calendarWeekends: true,
calendarEvents: [ // put the array in the `events` property
{
title : 'event1',
start : '2020-11-21',
color: 'blue', // an option!
textColor: 'yellow' // an option!
},
{
title : 'event2',
start : '2020-11-05',
end : '2020-11-27',
color: 'red', // an option!
textColor: 'yellow' // an option!
},
{
title : 'event3',
start : '2020-11-24T12:30:00',
},
{
title : 'event2',
start : '2020-12-05',
end : '2020-12-27',
color: '#ccc', // an option!
textColor: 'yellow' // an option!
},
],
eventSources:[
// your event source
{
events: [ // put the array in the `events` property
{
title : 'event1',
start : '2020-11-21',
color: 'blue', // an option!
textColor: 'yellow' // an option!
},
{
title : 'event2',
start : '2020-11-05',
end : '2020-11-27',
color: 'red', // an option!
textColor: 'yellow' // an option!
},
{
title : 'event3',
start : '2020-11-24T12:30:00',
},
{
title : 'event2',
start : '2020-12-05',
end : '2020-12-27',
color: '#ccc', // an option!
textColor: 'yellow' // an option!
},
],
color: 'black', // an option!
textColor: 'yellow' // an option!
}
// any other event sources...
]
};
},
created(){
setTimeout(()=>{
this.userNameList = [
{value:1,label:"用户1"},
{value:2,label:"用户2"},
{value:3,label:"用户3"},
{value:4,label:"用户4"},
{value:5,label:"用户5"},
{value:6,label:"用户6"},
{value:7,label:"用户7"},
{value:8,label:"用户8"},
{value:9,label:"用户9"},
{value:10,label:"用户10"},
{value:11,label:"用户11"},
{value:12,label:"用户12"},
{value:13,label:"用户13"},
{value:14,label:"用户14"},
]
},3000)
},
methods: {
toggleWeekends() {
this.calendarWeekends = !this.calendarWeekends // update a property
},
gotoPast() {
let calendarApi = this.$refs.fullCalendar.getApi() // from the ref="..."
calendarApi.gotoDate('2000-01-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){
console.log(info,'info')
},
onChange(){
console.log(this.value)
}
},
};
</script>
<style lang="less">
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
background: #ccc;
padding: 20px;
}
@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-top {
margin: 0 0 3em;
}
.demo-app-calendar {
margin: 0 auto;
}
.leri-box{
.jm-leri-left-card-box{
height: 660px;
margin-right: 20px;
background: #fff;
.leri-left-btn{
margin: 0 0 10px;
overflow: hidden;
button{
float: right;
}
}
.ant-checkbox-group{
text-align: left;
display:block;
}
.ant-checkbox-group-item{
display: block;
margin-bottom: 16px;
}
}
.jm-leri-right-card-box{
height: 660px;
border: 1px solid #ccc;
background: #fff;
}
}
</style>