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

a

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