Commit 0363dcad authored by 李静's avatar 李静

a

parent e5c9c3db
......@@ -28,8 +28,8 @@
</div>
</div>
<div v-if="show" class="incident">
<!--<p>{{currentDate}}</p>-->
<!--<span>{{event}}</span>-->
<p>{{currentDate}}</p>
<span>{{event}}</span>
<span class="close" @click="closeEvent">X</span>
</div>
</el-dialog>
......@@ -246,10 +246,13 @@
componentW: '', // 组件宽度
showTimeData: '', // 展示时间,时间戳格式
dateItems: '', // 当前月份所有日期的数据
dialogTableVisible: false
dialogTableVisible: false,
show: false,
currentDate: '',
event: ''
}
},
props: ['width', 'schedules', 'initTime', 'showActive', 'show'],
props: ['width', 'schedules', 'initTime', 'showActive'],
computed: {
showTimeStr() {
var result = ''
......@@ -365,6 +368,7 @@
this.dateItems = arr
},
dateChange(dateItem) {
this.show = true
// console.log(dateItem)
var dateObj = new Date(this.showTimeData)
var year = dateObj.getFullYear()
......@@ -378,6 +382,12 @@
}
if (!dateItem.schedule) { // 点击没有行程的,不作反应
console.log(result)
if (result.schedule) {
const currentTime = this.timestampToTime(result.schedule.date)
console.log(currentTime)
this.currentDate = currentTime
this.event = result.schedule.title
}
// this.$emit('dateChange', result)
return
} else {
......@@ -409,6 +419,12 @@
}
// 向上发送本次点击的行程数据
console.log(result)
if (result.schedule) {
const currentTime = this.timestampToTime(result.schedule.date)
console.log(currentTime)
this.currentDate = currentTime
this.event = result.schedule.title
}
// this.$emit('dateChange', result)
} else { // 已激活行程提示的,不作反应
return
......@@ -430,6 +446,13 @@
},
closeEvent() {
this.show = false
},
timestampToTime(timestamp) {
var date = new Date(timestamp) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
const Y = date.getFullYear() + '年'
const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '月'
const D = date.getDate() + '日'
return Y + M + D
}
},
mounted() {
......
......@@ -5,7 +5,6 @@
:schedules="schedules"
@dateChange="datechange"
@monthChange="monthchange"
:show="show"
></hm-full-calendar>
<!--<div v-if="show" class="incident">-->
<!--<p>{{currentDate}}</p>-->
......@@ -29,8 +28,6 @@
return {
show: false,
width: '300px',
currentDate: '',
event: '',
schedules: [{ date: 1524043625000, title: '个梵蒂是的舞蹈服可接受的看似简单计算的话束带结发会计师对海口市记得回复是框架的看就好山东矿机会计师发送的甲方是看得见看见的说法开始冈地方' }, { date: 1523955299000, title: '个梵蒂冈地方' }]
}
},
......@@ -41,26 +38,6 @@
},
methods: {
datechange(data) {
this.show = true
console.log(data)
if (data.schedule) {
const currentTime = this.timestampToTime(data.schedule.date)
console.log(currentTime)
this.currentDate = currentTime
this.event = data.schedule.title
}
},
monthchange(data) {
console.log(data, '--------')
},
timestampToTime(timestamp) {
var date = new Date(timestamp) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
const Y = date.getFullYear() + '年'
const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '月'
const D = date.getDate() + '日'
return Y + M + D
}
}
}
</script>
......
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