|
@@ -11,8 +11,7 @@
|
|
<el-tag
|
|
<el-tag
|
|
@click.stop="handleEventClick(event)"
|
|
@click.stop="handleEventClick(event)"
|
|
v-if="
|
|
v-if="
|
|
- moment(data.day).format('YYYY-MM-DD HH:mm:ss') ===
|
|
|
|
- event.startDate
|
|
|
|
|
|
+ data.day === event.startDate.substring(0, 10)
|
|
"
|
|
"
|
|
>
|
|
>
|
|
{{ event.title }}
|
|
{{ event.title }}
|
|
@@ -27,47 +26,48 @@
|
|
></MyCalendarForm>
|
|
></MyCalendarForm>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
-import MyCalendarForm from "./MyCalendarForm";
|
|
|
|
-import myCalendarService from "@/api/calendar/myCalendarService";
|
|
|
|
-export default {
|
|
|
|
- data() {
|
|
|
|
- return {
|
|
|
|
- startDate: new Date(),
|
|
|
|
- endDate: new Date(),
|
|
|
|
- calendarEvents: [],
|
|
|
|
- };
|
|
|
|
- },
|
|
|
|
- components: {
|
|
|
|
- MyCalendarForm,
|
|
|
|
- },
|
|
|
|
- activated() {
|
|
|
|
- this.refreshList();
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- // 选择月份
|
|
|
|
- selectHandler(data) {
|
|
|
|
- this.startDate = data.day;
|
|
|
|
- this.endDate = data.day;
|
|
|
|
- this.$refs.myCalendarForm.init(
|
|
|
|
- "add",
|
|
|
|
- "",
|
|
|
|
- this.startDate,
|
|
|
|
- this.endDate
|
|
|
|
- );
|
|
|
|
|
|
+ import MyCalendarForm from "./MyCalendarForm";
|
|
|
|
+ import myCalendarService from "@/api/calendar/myCalendarService";
|
|
|
|
+ export default {
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ startDate: new Date(),
|
|
|
|
+ endDate: new Date(),
|
|
|
|
+ calendarEvents: [],
|
|
|
|
+ };
|
|
},
|
|
},
|
|
- handleEventClick(info) {
|
|
|
|
- this.$refs.myCalendarForm.init("edit", info.id);
|
|
|
|
|
|
+ components: {
|
|
|
|
+ MyCalendarForm,
|
|
},
|
|
},
|
|
- refreshList() {
|
|
|
|
- myCalendarService.list().then((data) => {
|
|
|
|
- this.calendarEvents = data;
|
|
|
|
- });
|
|
|
|
|
|
+ activated() {
|
|
|
|
+ this.refreshList();
|
|
},
|
|
},
|
|
- },
|
|
|
|
-};
|
|
|
|
|
|
+ methods: {
|
|
|
|
+ // 选择月份
|
|
|
|
+ selectHandler(data) {
|
|
|
|
+ this.startDate = data.day;
|
|
|
|
+ this.endDate = data.day;
|
|
|
|
+ this.$refs.myCalendarForm.init(
|
|
|
|
+ "add",
|
|
|
|
+ "",
|
|
|
|
+ this.startDate,
|
|
|
|
+ this.endDate
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ handleEventClick(info) {
|
|
|
|
+ this.$refs.myCalendarForm.init("edit", info.id);
|
|
|
|
+ },
|
|
|
|
+ refreshList() {
|
|
|
|
+ myCalendarService.list().then((data) => {
|
|
|
|
+ console.log('data', data)
|
|
|
|
+ this.calendarEvents = data;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ };
|
|
</script>
|
|
</script>
|
|
<style>
|
|
<style>
|
|
-.is-selected {
|
|
|
|
- color: #1989fa;
|
|
|
|
-}
|
|
|
|
|
|
+ .is-selected {
|
|
|
|
+ color: #1989fa;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|