<template>
|
<view class="page-calendar-schedule-item" @click="triggerItem(scheduleData)">
|
<view class="uni-panel-state">
|
<text class="uni-panel-radius" :style="{'background-color':state_color}"></text>
|
</view>
|
<view class="uni-panel-w">
|
<view class="uni-panel-text">
|
<text class="uni-panel-title">{{scheduleData.Name}}</text>
|
</view>
|
<view class="uni-panel-text2">
|
<rich-text preview="true" :nodes="noteHtml"></rich-text>
|
</view>
|
</view>
|
<view class="uni-panel-schedule-right">
|
<text class="fs-ArrowRight"></text>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import parseHtml from "@/common/htmlParse.js"
|
export default {
|
name: "pageCalendarScheduleItem",
|
props: {
|
scheduleData: {
|
type: Object,
|
default () {
|
return {};
|
}
|
},
|
calendarId: {
|
type: String,
|
default () {
|
return "";
|
}
|
},
|
isMy: {
|
type: Boolean,
|
default () {
|
return true;
|
}
|
},
|
},
|
data() {
|
return {}
|
},
|
computed: {
|
state_color() {
|
//console.log("state_color",this.scheduleData)
|
if (this.scheduleData.TagName == "待办")
|
return '#3a87ad'
|
else if (this.scheduleData.TagName == "重要")
|
return '#FF3030'
|
else if (this.scheduleData.TagName == "会议")
|
return '#FFFF00'
|
else if (this.scheduleData.TagName == "约会")
|
return '#CD661D'
|
else if (this.scheduleData.TagName == "纪念日")
|
return '#228B22'
|
else if (this.scheduleData.TagName == "不公开")
|
return '#8E388E'
|
else if (this.scheduleData.TagName == "标记完成")
|
return '#858585'
|
else
|
return '#000'
|
},
|
noteHtml() {
|
if (this.scheduleData.Note)
|
return parseHtml(this.scheduleData.Note)
|
else
|
return []
|
},
|
},
|
methods: {
|
triggerItem(item) {
|
uni.navigateTo({
|
url: `/pages/calendar/schedule?calendarId=${this.calendarId}&eventId=${item.ID}&canEdit=${this.isMy ? "1": ""}`
|
})
|
},
|
},
|
}
|
</script>
|
|
<style lang="scss">
|
.page-calendar-schedule-item {
|
background-color: transparent;
|
flex-direction: row !important;
|
padding: 12px 2px;
|
min-height: 24px;
|
overflow: auto;
|
|
//height: 64px;
|
.uni-panel-w {
|
flex-direction: column !important;
|
float: left;
|
width: calc(750rpx - 90px);
|
|
}
|
|
.uni-panel-radius {
|
display: flex;
|
margin: 4px;
|
width: 16px;
|
height: 16px;
|
border-radius: 5px;
|
background-color: #000;
|
}
|
|
.uni-panel-title {
|
word-wrap: break-word;
|
color: black;
|
font-size: 16px;
|
white-space: normal;
|
}
|
|
.uni-panel-text {
|
flex: 1;
|
margin-left: 4px;
|
}
|
|
.uni-panel-text2 {
|
flex: 1;
|
margin-left: 4px;
|
color: #787878;
|
font-size: 12px;
|
}
|
|
.uni-panel-state {
|
font-size: 20px;
|
width: 24px;
|
position: relative;
|
float: left;
|
padding-left: 5px;
|
text-align: center;
|
}
|
|
.uni-panel-schedule-right {
|
font-size: 15px;
|
padding: 2px;
|
width: 24px;
|
position: relative;
|
float: right;
|
text-align: center;
|
color: #808080;
|
}
|
}
|
</style>
|