Commit a975ca5a authored by gaochao's avatar gaochao

a

parent 4ac6a7b5
<template> <template>
<div class="calender"> <div class="calender">
<i class="el-icon-date" @click="dialogTableVisible = true"></i> <i class="el-icon-date" @click="dialogTableVisible = true"></i>
<el-dialog :visible.sync="dialogTableVisible"> <el-dialog :visible.sync="dialogTableVisible" style="line-hight:16px;">
<full-calendar <full-calendar
:events="fcEvents" :events="fcEvents"
lang="zh" lang="zh"
...@@ -57,11 +57,10 @@ ...@@ -57,11 +57,10 @@
methods: { methods: {
getList() { getList() {
const self = this const self = this
console.log(self.schema)
request(self.schema.modelUnderscorePlural).then(resp => { request(self.schema.modelUnderscorePlural).then(resp => {
console.log(resp.data) console.log(resp.data)
_.each(resp.data, function(item, index) { _.each(resp.data, function(item, index) {
const test = _.cloneDeep(self.demoEvents) const test = {}
test.title = item[self.demoEvents.title] test.title = item[self.demoEvents.title]
if (item[self.demoEvents.end] == null) { if (item[self.demoEvents.end] == null) {
item[self.demoEvents.end] = item[self.demoEvents.start] item[self.demoEvents.end] = item[self.demoEvents.start]
...@@ -73,13 +72,13 @@ ...@@ -73,13 +72,13 @@
console.log(self.fcEvents) console.log(self.fcEvents)
}) })
}, },
changeMonth(start, end, current) { 'changeMonth'(start, end, current) {
console.log('changeMonth', start.format(), end.format(), current.format()) console.log('changeMonth', start.format(), end.format(), current.format())
}, },
eventClick(event, jsEvent, pos) { 'eventClick'(event, jsEvent, pos) {
console.log('eventClick', event, jsEvent, pos) console.log('eventClick', event, jsEvent, pos)
}, },
dayClick(day, jsEvent) { 'dayClick'(day, jsEvent) {
console.log('dayClick', day, jsEvent) console.log('dayClick', day, jsEvent)
} }
} }
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
}, },
created() { created() {
this.schema = schema this.schema = schema
// 传入对应的字段
this.demoEvents = { this.demoEvents = {
title: 'username', title: 'username',
start: 'createTime', start: 'createTime',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment