Commit 35254b3f authored by 李静's avatar 李静

a

parent 471e1c8a
...@@ -274,6 +274,9 @@ ...@@ -274,6 +274,9 @@
title: { title: {
required: false required: false
}, },
events: {
required: false
},
date: { date: {
required: false required: false
} }
...@@ -443,12 +446,12 @@ ...@@ -443,12 +446,12 @@
dateItem.active = !dateItem.active dateItem.active = !dateItem.active
} }
// 向上发送本次点击的行程数据 // 向上发送本次点击的行程数据
console.log(result) console.log(result, '--------------------')
if (result.schedule) { if (result.schedule) {
const currentTime = this.timestampToTime(result.schedule.date) const currentTime = this.timestampToTime(result.schedule.date)
console.log(currentTime) console.log(currentTime)
this.currentDate = currentTime this.currentDate = currentTime
this.event = result.schedule.title this.event = result.schedule.event
} }
// this.$emit('dateChange', result) // this.$emit('dateChange', result)
} else { // 已激活行程提示的,不作反应 } else { // 已激活行程提示的,不作反应
...@@ -490,18 +493,20 @@ ...@@ -490,18 +493,20 @@
item.time = moment(item[self.date]).format('YYYY-MM-DD') item.time = moment(item[self.date]).format('YYYY-MM-DD')
item.date = moment(item[self.date]).format('X') * 1000 item.date = moment(item[self.date]).format('X') * 1000
item.title = item[self.title] item.title = item[self.title]
item.allEvents = item[self.events]
if (saveTime === item.time) { if (saveTime === item.time) {
self.schedules[self.schedules.length - 1].event.push(item) self.schedules[self.schedules.length - 1].allEvents.push(item.allEvents)
} else { } else {
saveTime = item.time saveTime = item.time
self.schedules.push({ self.schedules.push({
date: item.date, date: item.date,
title: item.title, title: item.title,
event: [item] allEvents: [item.allEvents]
}) })
} }
}) })
}) })
console.log(self.schedules, '+++++最终+++++++++')
} }
}, },
created() { created() {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
:width="width" :width="width"
:schema="schema['HmUser']" :schema="schema['HmUser']"
:title="title" :title="title"
:events="events"
:date="date" :date="date"
@dateChange="datechange" @dateChange="datechange"
@monthChange="monthchange" @monthChange="monthchange"
...@@ -26,9 +27,10 @@ ...@@ -26,9 +27,10 @@
return { return {
show: false, show: false,
width: '300px', width: '300px',
// title为需要传入的事件所对应的的字段名,date为时间所对应的字段 // title为需要传入的事件名所对应的的字段名,date为时间所对应的字段,events为事件所对应的字段,都不是必传
title: 'username', title: '',
date: 'createTime' date: 'createTime',
events: 'email'
} }
}, },
filters: { filters: {
......
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