fix: 首页日历功能bug修复。

This commit is contained in:
tianyongbao
2024-08-01 19:46:35 +08:00
parent fa651a32f5
commit ac40437db3
2 changed files with 27 additions and 29 deletions

View File

@@ -65,7 +65,7 @@ export const constantRoutes = [
{ {
path: '', path: '',
component: Layout, component: Layout,
redirect: '/newindex' redirect: '/accountCalendar'
// children: [ // children: [
// { // {
// path: '/index', // path: '/index',

View File

@@ -1,35 +1,37 @@
<template> <template>
<!-- 这里是自定义头部切换视图类型和切换日期 --> <div class="app-container">
<div class="calendarHeader"> <!-- 这里是自定义头部切换视图类型和切换日期 -->
<div class="header_left"> <div class="calendarHeader">
<h1>{{ type === '3' ? '列表' : calendarTitle }}</h1> <div class="header_left">
</div> <h1>{{ type === '3' ? '列表' : calendarTitle }}</h1>
<div class="header_right"> </div>
<!-- <span v-if="type!=='3'&&isShowBack" class="blue-color backToday" @click="getToday()">{{ type==='1'?'返回本月':'返回本周' }}</span> <div class="header_right">
<!-- <span v-if="type!=='3'&&isShowBack" class="blue-color backToday" @click="getToday()">{{ type==='1'?'返回本月':'返回本周' }}</span>
<el-select v-model="type" placeholder="视图类型" style="width: 80px" size="small" class="header_select" @change="handleChangeType"> <el-select v-model="type" placeholder="视图类型" style="width: 80px" size="small" class="header_select" @change="handleChangeType">
<el-option label="月" value="1" /> <el-option label="月" value="1" />
<el-option label="周" value="2" /> <el-option label="周" value="2" />
<el-option label="列" value="3" /> <el-option label="列" value="3" />
</el-select> --> </el-select> -->
<!-- 选择月份的日期框 --> <!-- 选择月份的日期框 -->
<el-date-picker <el-date-picker
v-if="type === '1'" v-if="type === '1'"
v-model="showMonth" v-model="showMonth"
type="month" type="month"
size="small" size="small"
:clearable="false" :clearable="false"
placeholder="请选择日期" placeholder="请选择日期"
style="margin-left: 10px; vertical-align: middle" style="margin-left: 10px; vertical-align: middle"
@change="changeDate" @change="changeDate"
/> />
<el-button-group v-if="type === '2'" style="margin-left: 10px"> <el-button-group v-if="type === '2'" style="margin-left: 10px">
<el-button size="small" class="el-icon-arrow-left" @click="getPrev()">上一周</el-button> <el-button size="small" class="el-icon-arrow-left" @click="getPrev()">上一周</el-button>
<el-button size="small" @click="getNext()">下一周<i class="el-icon-arrow-right" /></el-button> <el-button size="small" @click="getNext()">下一周<i class="el-icon-arrow-right" /></el-button>
</el-button-group> </el-button-group>
</div>
</div> </div>
<!-- 月视图和周视图显示列视图显示表格形式 -->
<div v-show="type !== '3'" ref="fullcalendar" class="card" />
</div> </div>
<!-- 月视图和周视图显示列视图显示表格形式 -->
<div v-show="type !== '3'" ref="fullcalendar" class="card" />
</template> </template>
<script> <script>
@@ -71,10 +73,6 @@ export default {
magenta: { title: '#EB2F96', class: 'magenta' } magenta: { title: '#EB2F96', class: 'magenta' }
}, },
fullcalendar: ref(), fullcalendar: ref(),
queryParams: {
type: null,
time: ''
},
nowDate: new Date(), nowDate: new Date(),
infoList: [], // 日历显示的列信息 infoList: [], // 日历显示的列信息
categoryJSON: {} // 计划分类json categoryJSON: {} // 计划分类json