Browse Source

查询、新增、回显日程完成

liangyan0105 3 years ago
parent
commit
037d3da006
3 changed files with 534 additions and 355 deletions
  1. 75 43
      src/views/dashboard/MyToDo.vue
  2. 225 124
      src/views/oa/my-plan/add/savePlan.vue
  3. 234 188
      src/views/oa/my-plan/schedulePlan.vue

+ 75 - 43
src/views/dashboard/MyToDo.vue

@@ -4,7 +4,7 @@
     <a-row :gutter="24" class="topCard">
       <a-col :xs="24" :sm="24" :md="24" :lg="24" :style="{ marginBottom: '10px' }">
         <a-row :gutter="20">
-          <!-- 用户信息 -->
+          <!-- 我的 -->
           <a-col :xs="24" :sm="12" :md="12" :lg="7" :style="{ marginBottom: '10px' }">
             <a-card title="我的" :bordered="false" class="clearfix topColItem">
               <div class="userImg fl" style="marginLeft:50px;">
@@ -33,10 +33,12 @@
 
           <!-- 日历 -->
           <a-col :xs="24" :sm="24" :md="24" :lg="10">
-            <a-card title="日历" :bordered="false">
+            <a-card title="日历" :bordered="false" class="fullCard">
               <div>
-                <!-- <a-calendar :fullscreen="false" /> -->
-                <FullCalendar :options="calendarOptions" class="eventDeal-wrap" />
+                <!-- <a-calendar :fullscreen="false" /> by ly-->
+                <div class="ccfullCalendar">
+                  <FullCalendar :options="calendarOptions" class="eventDeal-wrap" style="height:300px;" />
+                </div>
               </div>
             </a-card>
           </a-col>
@@ -133,23 +135,21 @@
               <div class="total clearfix">
                 <div class="left fl">
                   <span>上月我的计划:<strong>0</strong>份</span>
-                  <span>我的计划:<strong>1</strong>份</span>
-                  <span>已阅计划:<strong>1</strong>份</span>
+                  <span>本月我的计划<strong>1</strong>份</span>
                 </div>
                 <div class="right fr">
                   <span>上月他人计划:<strong>0</strong>份</span>
-                  <span>他人计划:<strong>2</strong>份</span>
-                  <span>已回计划:<strong>0</strong>份</span>
+                  <span>本月他人计划<strong>2</strong>份</span>
                 </div>
               </div>
               <!-- 小链接跳转 -->
-              <div class="tabsLinks">
+              <!-- <div class="tabsLinks">
                 <a href="">我的计划</a>
                 <a-divider type="vertical" />
                 <a href="">计划管理</a>
                 <a-divider type="vertical" />
                 <a href="">计划模块</a>
-              </div>
+              </div> -->
             </a-card>
           </a-col>
           <!-- 友情链接 -->
@@ -290,7 +290,7 @@ export default {
   },
   data() {
     return {
-      //日历组件参数-----------------------
+      //日历组件 参数
       calendarOptions: {
         // 引入的插件
         plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
@@ -307,10 +307,10 @@ export default {
         initialView: 'dayGridMonth', // 指定默认显示视图
         locale: 'zh-ch', // 切换语言,当前为中文
         firstDay: '1', // 设置一周中显示的第一天是周几,周日是0,周一是1,以此类推
-        weekNumberCalculation: 'ISO', // 与firstDay配套使用
-        eventCOlor: '#3d8eec', // 全部日历日程背景色
+        weekNumberCalculation: 'ISO', // 与 firstDay 配套使用
+        eventCOlor: 'red', // 全部日历日程背景色
         timeGridEventMinHeight: '20', // 设置事件的最小高度
-        aspectRatio: '1.5', // 设置日历单元格宽高比
+        // aspectRatio: '2.5', // 设置日历单元格宽高比
         displayEventTime: false, // 是否显示事件时间
         allDaySlot: false, // 周、日视图时,all-day不显示
         eventLimit: true, // 设置月日程,与all-day slot 的最大显示数量,超过的通过弹窗展示
@@ -325,21 +325,19 @@ export default {
           meridiem: false,
           hour12: false // 设置时间为24小时制
         },
+        // 日程数组
         events: [
           {
             title: 'Meeting',
             start: '2021-10-13T14:30:00',
+            end: '2021-10-13T14:30:00',
             extendedProps: {
               status: 'done'
-            }
-          },
-          {
-          title: 'Birthday Party',
-          start: '2021-10-14T07:00:00',
-          backgroundColor: 'green',
-          borderColor: 'green'
-        }
-        ], // 日程数组
+            },
+            backgroundColor: '#ccd5ae',
+            borderColor: 'red'
+          }
+        ],
         // 事件
         editable: true, // 是否可以进行(拖动、缩放)修改
         eventStartEditable: true, // Event日程开始时间可以改变,默认为true,若为false,则表示开始结束时间范围不能拉伸,只能拖拽
@@ -422,7 +420,8 @@ export default {
   mounted() {
     this.loadData()
   },
-  methods: {// 日程保存
+  methods: {
+    // 日程保存
     // 日期点击
     handleDateClick(selectInfo) {
       // if (confirm('您是否要在【' + selectInfo.dateStr + '】添加一个新的事件?')) {
@@ -433,6 +432,8 @@ export default {
       // }
       this.$router.push('/oa/my-plan/schedulePlan')
     },
+
+    //
     loadData() {
       try {
         // 获取系统消息
@@ -487,9 +488,7 @@ export default {
 
     //OA图标点击事件
     aClick(v) {
-      //点击的该项按钮
       console.log(v)
-      // this.$refs.modal.add("1")
       if (!v.routeName) {
         this.$message.warning('该流程信息未配置表单,请联系开发人员!')
         return
@@ -515,6 +514,7 @@ export default {
       console.log('发起', v)
       // this.getDataList()
     },
+
     //提交后
     afterSub(formData) {
       this.lcModal.visible = false
@@ -584,11 +584,43 @@ a {
   color: #1890ff;
 }
 
+//包着card
+.fullCard {
+  // background-color: #e5989b;
+  height: 380px;
+  /deep/ .ant-card-body {
+    padding: 0 4px;
+  }
+}
+// cc 日历 样式修改 包着日历
+.ccfullCalendar {
+  height: 274px !important;
+  // background-color: #1d3557;
+  /deep/ .fc .fc-toolbar.fc-header-toolbar {
+    margin-bottom: 6px;
+  }
+  /deep/ .fc .fc-scrollgrid-liquid {
+    height: 274px !important;
+    // background-color: #fca311;
+  }
+  /deep/ .fc .fc-toolbar-title {
+    font-size: 14px;
+    letter-spacing: 1px;
+  }
+  /deep/ .fc-scrollgrid-sync-table {
+    height: 274px !important;
+    // background-color: blue;
+  }
+  /deep/ .fc-daygrid-day-bottom {
+    margin-top: -10px !important;
+  }
+}
 #home {
   // 第一行
   .topCard {
+    // 等高设置
     .topColItem {
-      height: 360px;
+      height: 380px;
     }
     .userImg {
       width: 80px;
@@ -699,7 +731,7 @@ a {
     // 我的计划
     .plan {
       .total {
-        border-bottom: 1px dashed #ccc;
+        // border-bottom: 1px dashed #ccc;
         span {
           display: block;
           line-height: 40px;
@@ -710,21 +742,21 @@ a {
           }
         }
       }
-      .tabsLinks {
-        margin-top: 20px;
-        a {
-          color: rgb(23, 119, 184);
-          margin: 0 6px;
-        }
-        a:hover {
-          color: #fa6b5c;
-        }
-        /deep/ .ant-divider,
-        .ant-divider-vertical {
-          width: 2px;
-          background-color: rgb(200, 200, 200);
-        }
-      }
+      // .tabsLinks {
+      //   margin-top: 20px;
+      //   a {
+      //     color: rgb(23, 119, 184);
+      //     margin: 0 6px;
+      //   }
+      //   a:hover {
+      //     color: #fa6b5c;
+      //   }
+      //   /deep/ .ant-divider,
+      //   .ant-divider-vertical {
+      //     width: 2px;
+      //     background-color: rgb(200, 200, 200);
+      //   }
+      // }
     }
     // 友情链接
     .link {

+ 225 - 124
src/views/oa/my-plan/add/savePlan.vue

@@ -1,134 +1,235 @@
 <template>
   <div>
-    <a-form :form="form" @submit="handleSubmit">
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="日程标题">
-            <a-input
-                v-model="note"
-              v-decorator="['note', { rules: [{ required: true, message: '请输入日程标题!' }] },]"
-              placeholder="请输入日程标题"
-            />
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="日程类型">
-            <a-select
-              v-decorator="[
-          'gender1',
-          { rules: [{ required: false, message: 'Please select your gender!' }] }
-        ]"
-              placeholder="请选择日程类型"
-            >
-              <a-select-option value="日常记录">日常记录</a-select-option>
-              <a-select-option value="本周工作">本周工作</a-select-option>
-              <a-select-option value="下周计划">下周计划</a-select-option>
-            </a-select>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="提醒类型">
-            <a-select
-              v-decorator="[
-          'gender2',
-          { rules: [{ required: true, message: 'Please select your gender!' }] }
-        ]"
-              placeholder="请选择提醒类型"
-            >
-              <a-select-option value="邮件">邮件</a-select-option>
-              <a-select-option value="短信">短信</a-select-option>
-              <a-select-option value="系统消息">系统消息</a-select-option>
-            </a-select>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="紧急程度">
-            <a-select
-              v-decorator="[
-          'gender3',
-          { rules: [{ required: false, message: 'Please select your gender!' }] }
-        ]"
-              placeholder="请选择紧急程度"
-            >
-              <a-select-option value="一般">一般</a-select-option>
-              <a-select-option value="重要">重要</a-select-option>
-              <a-select-option value="紧机">紧机</a-select-option>
-            </a-select>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="提醒时间">
-            <a-select
-              v-decorator="[
-          'gender4',
-          { rules: [{ required: true, message: 'Please select your gender!' }] }
-        ]"
-              placeholder="请选择提醒时间"
-            >
-              <a-select-option value="不提醒">不提醒</a-select-option>
-              <a-select-option value="开始时">开始时</a-select-option>
-              <a-select-option value="提前5分钟">提前5分钟</a-select-option>
-              <a-select-option value="提前10分钟">提前10分钟</a-select-option>
-              <a-select-option value="提前15分钟">提前15分钟</a-select-option>
-            </a-select>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="重复提醒">
-            <a-select
-              v-decorator="[
-          'gender5',
-          { rules: [{ required: true, message: 'Please select your gender!' }] },
-        ]"
-              placeholder="请选择重复提醒"
-            >
-              <a-select-option value="一般">不重复</a-select-option>
-              <a-select-option value="每天">每天</a-select-option>
-              <a-select-option value="每周">每周</a-select-option>
-              <a-select-option value="每月">每月</a-select-option>
-              <a-select-option value="每年">每年</a-select-option>
-            </a-select>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="24">
-          <a-form-item label="备注">
-            <a-textarea
-              v-model="value"
-              placeholder="备注"
-              :auto-size="{ minRows: 3, maxRows: 5 }"
-            />
-          </a-form-item>
-        </a-col>
-      </a-row>
-    </a-form>
+    <a-modal v-model="savePlanModalVisible" title="新增日程计划" @ok="handleOk" @cancel="handleCancel" width="52%">
+      <div>
+        <a-divider orientation="left">基本信息</a-divider>
+        <a-form :form="addForm" :label-col="{ span: 5 }" :wrapper-col="{ span: 17 }">
+          <a-row :gutter="24">
+            <!-- 日程标题 -->
+            <a-col :span="12">
+              <a-form-item label="日程标题">
+                <a-input
+                  v-decorator="['title', { rules: [{ required: true, message: '请输入日程标题' }] }]"
+                  placeholder="请输入日程标题"
+                />
+              </a-form-item>
+            </a-col>
+            <!-- 日程类型 -->
+            <a-col :span="12">
+              <a-form-item label="日程类型">
+                <a-select
+                  v-decorator="['type', { rules: [{ required: false, message: '请选择日程类型' }] }]"
+                  placeholder="请选择日程类型"
+                >
+                  <a-select-option value="日常记录">日常记录</a-select-option>
+                  <a-select-option value="本周工作">本周工作</a-select-option>
+                  <a-select-option value="下周计划">下周计划</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+          </a-row>
+
+          <a-row :gutter="24">
+            <!-- 提醒类型 -->
+            <a-col :span="12">
+              <a-form-item label="提醒类型">
+                <a-select
+                  v-decorator="['how', { rules: [{ required: false, message: '请选择提醒类型' }] }]"
+                  placeholder="请选择提醒类型"
+                >
+                  <a-select-option value="邮件">邮件</a-select-option>
+                  <a-select-option value="短信">短信</a-select-option>
+                  <a-select-option value="系统消息">系统消息</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+
+            <!-- 紧急程度 degree-->
+            <a-col :span="12">
+              <a-form-item label="紧急程度">
+                <a-select
+                  v-decorator="['degreeOfUrgency', { rules: [{ required: false, message: '请选择紧急程度' }] }]"
+                  placeholder="请选择紧急程度"
+                >
+                  <a-select-option value="一般">一般</a-select-option>
+                  <a-select-option value="重要">重要</a-select-option>
+                  <a-select-option value="紧机">紧机</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+          </a-row>
+
+          <a-row :gutter="24">
+            <!-- 提醒时间 -->
+            <a-col :span="12">
+              <a-form-item label="提醒时间">
+                <a-select
+                  v-decorator="['when', { rules: [{ required: false, message: '请选择提醒时间' }] }]"
+                  placeholder="请选择提醒时间"
+                >
+                  <a-select-option value="不提醒">不提醒</a-select-option>
+                  <a-select-option value="开始时">开始时</a-select-option>
+                  <a-select-option value="提前5分钟">提前5分钟</a-select-option>
+                  <a-select-option value="提前10分钟">提前10分钟</a-select-option>
+                  <a-select-option value="提前15分钟">提前15分钟</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+
+            <!-- 重复提醒 -->
+            <a-col :span="12">
+              <a-form-item label="重复提醒">
+                <a-select
+                  v-decorator="['repeat', { rules: [{ required: false, message: '请选择重复提醒' }] }]"
+                  placeholder="请选择重复提醒"
+                >
+                  <a-select-option value="一般">不重复</a-select-option>
+                  <a-select-option value="每天">每天</a-select-option>
+                  <a-select-option value="每周">每周</a-select-option>
+                  <a-select-option value="每月">每月(当日)</a-select-option>
+                  <a-select-option value="每年">每年(当日)</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+          </a-row>
+
+          <!-- 日程时间、是否全天 -->
+          <a-row :gutter="24">
+            <!-- 日程时间 -->
+            <a-col :span="12">
+              <a-form-item label="日程时间">
+                <a-range-picker
+                  showTime
+                  format="YYYY-MM-DD HH:mm:ss"
+                  @change="continueTimeChange"
+                  :showToday="true"
+                  v-decorator="['continue', { rules: [{ required: true, message: '请选择日程时间' }] }]"
+                >
+                </a-range-picker>
+              </a-form-item>
+            </a-col>
+            <!-- 是否全天 -->
+            <a-col :span="12">
+              <a-form-item label="是否全天">
+                <a-checkbox v-model="checked" checked="checked"></a-checkbox>
+              </a-form-item>
+            </a-col>
+          </a-row>
+
+          <a-divider orientation="left">其他信息</a-divider>
+          <!-- 文字编辑器 -->
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="备注">
+                <a-textarea v-model="memo" placeholder="备注" />
+              </a-form-item>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </a-modal>
   </div>
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
-import { getAction } from '@/api/manage'
+// import { mapGetters } from 'vuex'
+// import { defineComponent, ref } from 'vue'
+import moment from 'moment'
+import 'moment/locale/zh-cn'
+// import api from '@/api'
+// import { getAction, deleteAction, putAction, postAction } from '@/api/manage'
+import { scheduleAdd } from '@api/oa/cd-schedule'
+
 export default {
-  name: 'SavePlan',
-  data() {
-    return {
-      formLayout: 'horizontal',
-      form: this.$form.createForm(this, { name: 'coordinated' }),
-      note:""
+    name: 'SavePlan',
+    data () {
+        return {
+            savePlanModalVisible: false,
+            formLayout: 'horizontal',
+            addForm: this.$form.createForm(this, { name: 'coordinated' }),
+            checked: true,
+            memo: '',
+            formData: {} // 表单数据 (做回显)
+        }
+    },
+    props: {
+    // 接收父组件方法 (查询日程)
+        fatherMethod: {
+            type: Function,
+            default: null
+        }
+    },
+    created () {
+    },
+    computed: {},
+    mounted () {},
+    methods: {
+        getById () {
+            this.addForm.setFieldsValue({
+                title: this.formData.title,
+                type: this.formData.type, // 日程类型
+                // how: this.formData.how, // 提醒类型
+                degreeOfUrgency: this.formData.degreeOfUrgency, // 紧急程度
+                // when: this.formData.when, // 提醒时间
+                // repeat: this.formData.repeat, // 重复提醒
+                continue: [moment(this.formData.startTime, 'YYYY/MM/DD HH:mm:ss'), moment(this.formData.endTime, 'YYYY/MM/DD HH:mm:ss')], // 日程时间
+                // startTime: this.formData.startTime,
+                // endTime: this.formData.endTime,
+                // checked: true, // 是否全天
+                memo: this.formData.memo // 备注
+            })
+        },
+        // 弹框 保存
+        handleOk (e) {
+            this.addForm.validateFields((err, values) => {
+                if (!err) {
+                    // 一条数据对象
+                    console.log(values, '看看里面的日程时间')
+                    var scheduleObject = {}
+                    scheduleObject.title = values.title
+                    scheduleObject.type = values.type
+                    // scheduleObject.how = values.how
+                    scheduleObject.degreeOfUrgency = values.degreeOfUrgency
+                    // scheduleObject.when = values.when
+                    // scheduleObject.repeat = values.repeat
+                    scheduleObject.startTime = values.continue[0].format('YYYY-MM-DD HH:mm:ss')
+                    scheduleObject.endTime = values.continue[1].format('YYYY-MM-DD HH:mm:ss')
+                    scheduleObject.memo = values.memo
+                    console.log('新增的一条日程', scheduleObject)
+
+                    // 新增请求
+                    scheduleAdd(scheduleObject).then(res => {
+                        console.log('11')
+                        if (res.success) {
+                            this.savePlanModalVisible = false
+                            this.$message.success('日程添加成功')
+                            console.log('222')
+                            // this.addForm.resetFields() // 清空
+                            // 调用父组件的方法  查询数据
+                            console.log('33')
+                            this.fatherMethod()
+                        }
+                    })
+                } else {
+                    console.log('没有填写相关信息')
+                }
+            })
+        },
+        // 日程时间
+        continueTimeChange (date, dateString) {
+            console.log('date>>>>>>>>>>>>>>>', date)
+            console.log('dateString>>>>>>>>>>>>>>>', dateString)
+            let startTime = date[0].format('YYYY-MM-DD') // 也可以不要具体时间
+            let endTime = date[1].format('YYYY-MM-DD')
+            console.log('startTime', startTime)
+            console.log('endTime', endTime)
+        },
+        handleCancel (e) {
+            console.log('取消按钮')
+            this.addForm.resetFields() // 清空
+            this.savePlanModalVisible = false
+        }
     }
-  },
-  created() {},
-  computed: {},
-  mounted() {},
-  methods: {
-    handleSubmit() {}
-  }
 }
 </script>
-<style lang="less" scoped>
-</style>
+<style lang="less" scoped></style>

+ 234 - 188
src/views/oa/my-plan/schedulePlan.vue

@@ -1,213 +1,259 @@
 <template>
   <div id="home">
-    <FullCalendar :options="calendarOptions" class="eventDeal-wrap" />
-    <a-modal
-      v-model="savePlanModalVisible"
-      title="新增日程计划"
-      @ok="handleOk"
-      @cancel="handleCancel"
-      width="80%"
-    >
-      <save-plan ref="savePlan"></save-plan>
-    </a-modal>
+    <a-card title="我的计划" style="width: 100%">
+      <p>
+        <FullCalendar :options="calendarOptions" class="eventDeal-wrap" />
+        <save-plan ref="savePlan" :fatherMethod="search"></save-plan>
+      </p>
+    </a-card>
   </div>
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
-import { getAction } from '@/api/manage'
+// import { mapGetters } from 'vuex'
+// import { getAction } from '@/api/manage'
+// import '@fullcalendar/core/main.css'
 import FullCalendar from '@fullcalendar/vue'
 import dayGridPlugin from '@fullcalendar/daygrid'
 import interactionPlugin from '@fullcalendar/interaction'
 import timeGridPlugin from '@fullcalendar/timegrid'
-// import '@fullcalendar/core/main.css'
 import '@fullcalendar/daygrid/main.css'
-import SavePlan from './add/savePlan'
+import SavePlan from './add/savePlan' // 子组件
+import { scheduleGetListByTime, scheduleQueryById } from '@api/oa/cd-schedule'
+// import moment from 'moment'
+// import 'moment/locale/zh-cn'
 export default {
-  name: 'SchedulePlan',
-  components: {
-    FullCalendar,
-    SavePlan
-  },
-  data() {
-    return {
-        savePlanModalVisible:false,
-        ///////////////////日历参数
-      calendarOptions: {
-        // 引入的插件
-        plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
-        // 日历头部按钮位置
-        headerToolbar: {
-          left: 'prev,next today',
-          center: 'title',
-          right: 'dayGridMonth, timeGridWeek, timeGridDay'
+    name: 'SchedulePlan',
+    components: {
+        FullCalendar,
+        SavePlan // 新增日程表单组件
+    },
+    data () {
+        return {
+            // dateStr: '', // 开始日期为点击的日期
+            // 日历参数
+            calendarOptions: {
+                // 日程数组
+                events: [
+                    {
+                        title: 'Meeting',
+                        start: '2021-10-13T14:30:00',
+                        end: '2021-10-13T14:30:00',
+                        extendedProps: {
+                            status: 'done'
+                        },
+                        backgroundColor: '#ccd5ae',
+                        borderColor: 'red'
+                    }
+                ],
+                // 引入的插件
+                plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
+                // 日历头部按钮位置
+                headerToolbar: {
+                    left: 'prev,next today',
+                    center: 'title',
+                    right: 'dayGridMonth, timeGridWeek, timeGridDay'
+                },
+                // 日历头部按钮中文转换
+                buttonText: {
+                    today: '今天',
+                    month: '月',
+                    week: '周',
+                    day: '天'
+                },
+                initialView: 'dayGridMonth', // 指定默认显示视图
+                locale: 'zh-ch', // 切换语言,当前为中文
+                firstDay: '1', // 设置一周中显示的第一天是周几,周日是0,周一是1,以此类推
+                weekNumberCalculation: 'ISO', // 与firstDay配套使用
+                eventCOlor: '#3d8eec', // 全部日历日程背景色
+                timeGridEventMinHeight: '20', // 设置事件的最小高度
+                aspectRatio: '1.5', // 设置日历单元格宽高比
+                displayEventTime: false, // 是否显示事件时间
+                allDaySlot: false, // 周、日视图时,all-day不显示
+                eventLimit: true, // 设置月日程,与all-day slot 的最大显示数量,超过的通过弹窗展示
+                eventTimeFormat: {
+                    hour: 'numeric',
+                    minute: '2-digit',
+                    hour12: false
+                },
+                slotLabelFormat: {
+                    hour: '2-digit',
+                    minute: '2-digit',
+                    meridiem: false,
+                    hour12: false // 设置时间为24小时制
+                },
+
+                // 事件
+                editable: true, // 是否可以进行(拖动、缩放)修改
+                eventStartEditable: true, // Event日程开始时间可以改变,默认为true,若为false,则表示开始结束时间范围不能拉伸,只能拖拽
+                eventDurationEditable: true, // Event日程的开始结束时间距离是否可以改变,默认为true,若为false,则表示开始结束时间范围不能拉伸,只能拖拽
+                selectable: true, // 是否可以选中日历格
+                selectMirror: true,
+                selectMinDistance: 0, // 选中日历格的最小距离
+                weekends: true,
+                navLinks: true, // 天链接
+                selectHelper: false,
+                selectEventOverlap: false, // 相同时间段的多个日程视觉上是否允许重叠,默认为true,允许
+                dayMaxEvents: true,
+                dateClick: this.handleDateClick, // 日期点击
+                eventsSet: this.handleEvents, // 事件点击
+                eventClick: this.handleEventClick, // 日程点击信息展示
+                eventDrop: this.handleEventDrop, // 日程拖动事件
+                eventResize: this.eventResize // 日程缩放事件
+            },
+
+            selectDate: {}, // 选择的日期信息集合
+            data: {}, // 表单回显数据
+            addForm: this.$form.createForm(this, { name: 'coordinated' })
+        }
+    },
+    created () {
+        this.search()
+    },
+    computed: {},
+    mounted () {},
+    methods: {
+        prev () {
+            this.calendarApi.prev()
+            console.log(this.calendarApi.prev)
         },
-        // 日历头部按钮中文转换
-        buttonText: {
-          today: '今天',
-          month: '月',
-          week: '周',
-          day: '天'
+        // 查询数据库日程数据
+        search () {
+            scheduleGetListByTime(null).then(res => {
+                if (res.success) {
+                    console.log('查询到的总日程结果', res)
+                    let list = res.result // 查询结果
+                    var eventList = [] // 日程事件集合
+                    // 循环日程
+                    list.forEach(e => {
+                        let Object = {
+                            title: e.title,
+                            start: e.startTime,
+                            end: e.endTime,
+                            id: e.id,
+                            extendedProps: {
+                                status: 'done'
+                            },
+                            backgroundColor: 'orange',
+                            borderColor: 'orange'
+                        }
+                        eventList.push(Object) // 把日程推到日程列表
+                        // console.log('打印出的事件id', Object.id)
+                    })
+                    console.log('日程', eventList)
+                    // 刷新 日程列表
+                    this.calendarOptions.events = eventList
+                }
+            })
         },
-        initialView: 'dayGridMonth', // 指定默认显示视图
-        locale: 'zh-ch', // 切换语言,当前为中文
-        firstDay: '1', // 设置一周中显示的第一天是周几,周日是0,周一是1,以此类推
-        weekNumberCalculation: 'ISO', // 与firstDay配套使用
-        eventCOlor: '#3d8eec', // 全部日历日程背景色
-        timeGridEventMinHeight: '20', // 设置事件的最小高度
-        aspectRatio: '1.5', // 设置日历单元格宽高比
-        displayEventTime: false, // 是否显示事件时间
-        allDaySlot: false, // 周、日视图时,all-day不显示
-        eventLimit: true, // 设置月日程,与all-day slot 的最大显示数量,超过的通过弹窗展示
-        eventTimeFormat: {
-          hour: 'numeric',
-          minute: '2-digit',
-          hour12: false
+
+        // 日程总集合
+        handleEvents (info) {
+            // console.log('总事件集合handleEvents.info:', info)
+            // 打印了事件(完成、位置)
+            // this.currentEvents = events
         },
-        slotLabelFormat: {
-          hour: '2-digit',
-          minute: '2-digit',
-          meridiem: false,
-          hour12: false // 设置时间为24小时制
+
+        // 日期点击
+        handleDateClick (selectDate) {
+            //   if (confirm('您是否要在【' + selectDate.dateStr + '】添加一个新的事件?')) {
+            //     // 父组件直接调用子组件方法
+            //     this.$refs['eventDialogue'].openDialog('add')
+            //     // 父组件直接修改子组件变量
+            //     // this.$refs['eventDialogue'].dialogVisible = true
+            //   }
+            console.log('点击的时间是', selectDate.dateStr)
+            this.theDate = selectDate.dateStr
+            console.log(this.theDate)
+            this.$refs.savePlan.savePlanModalVisible = true
         },
-        events: [
-          {
-            title: 'Meeting',
-            start: '2021-10-13T14:30:00',
-            extendedProps: {
-              status: 'done'
+
+        // 点击日程,回显信息,并可修改,修改请求
+        handleEventClick (e, id) {
+            // 使用子组件的 弹框中的 addForm表单
+            this.$refs.savePlan.savePlanModalVisible = true
+            console.log('点击了一条日程:回显该日程信息、可编辑、发送修改请求', e)
+            // 发送根据id查询日程的请求 (注意传参格式要求)
+            if (e.event.id) {
+                scheduleQueryById({ id: e.event.id }).then(res => {
+                    if (res.success) {
+                        console.log('该ID的日程', res)
+                        let formData = res.result // 查询结果赋值
+                        this.data = formData
+                        console.log('表单回显数据555', this.data)
+                        // this.data = JSON.parse(JSON.stringify(this.data))
+                        this.$refs.savePlan.formData = this.data
+                        this.$refs.savePlan.getById()
+                        console.log('走到这')
+                    } else {
+                    }
+                })
             }
-          },
-          {
-          title: 'Birthday Party',
-          start: '2021-10-14T07:00:00',
-          backgroundColor: 'green',
-          borderColor: 'green'
-        }
-        ], // 日程数组
-        // 事件
-        editable: true, // 是否可以进行(拖动、缩放)修改
-        eventStartEditable: true, // Event日程开始时间可以改变,默认为true,若为false,则表示开始结束时间范围不能拉伸,只能拖拽
-        eventDurationEditable: true, // Event日程的开始结束时间距离是否可以改变,默认为true,若为false,则表示开始结束时间范围不能拉伸,只能拖拽
-        selectable: true, // 是否可以选中日历格
-        selectMirror: true,
-        selectMinDistance: 0, // 选中日历格的最小距离
-        weekends: true,
-        navLinks: true, // 天链接
-        selectHelper: false,
-        selectEventOverlap: false, // 相同时间段的多个日程视觉上是否允许重叠,默认为true,允许
-        dayMaxEvents: true,
-        dateClick: this.handleDateClick, // 日期点击
-        eventsSet: this.handleEvents, // 事件点击
-        eventClick: this.handleEventClick, // 日程点击信息展示
-        eventDrop: this.handleEventDrop, // 日程拖动事件
-        eventResize: this.eventResize // 日程缩放事件
-      }
-      ,selectInfo:{}//选择的日期
-      /////////////////////////////////日历参数结尾
-    }
-  },
-  created() {
-  },
-  computed: {
-  },
-  mounted() {
-  },
-  methods: {
-    // 日程保存
-    saveEvent(val) {
-      let eventsArr = this.calendarOptions.events
-      try {
-        if (eventsArr.length === 0) {
-          eventsArr.push(val)
-        } else {
-          eventsArr.forEach((item, index, eventsArr) => {
-            // 若为修改日程
-            if (item.eventID === val.eventID) {
-              throw new Error(index)
+        },
+
+        // 日程保存
+        saveEvent (val) {
+            let eventsArr = this.calendarOptions.events
+            try {
+                if (eventsArr.length === 0) {
+                    eventsArr.push(val)
+                } else {
+                    eventsArr.forEach((item, index, eventsArr) => {
+                        // 若为修改日程
+                        if (item.eventID === val.eventID) {
+                            throw new Error(index)
+                        }
+                    })
+                    // 若为新增日程
+                    eventsArr.push(val)
+                }
+            } catch (e) {
+                // 若为修改日程
+                eventsArr.splice(e.message, 1, val)
             }
-          })
-          // 若为新增日程
-          eventsArr.push(val)
-        }
-      } catch (e) {
-        // 若为修改日程
-        eventsArr.splice(e.message, 1, val)
-      }
-    },
-    // 日程删除
-    deleteEvent(val) {
-      let eventsArr = this.calendarOptions.events
-      try {
-        eventsArr.forEach((item, index, eventsArr) => {
-          if (item.eventID === val) {
-            throw new Error(index)
-          }
-        })
-      } catch (e) {
-        // 删除指定日程
-        eventsArr.splice(parseInt(e.message), 1)
-      }
-    },
-    // 日程事件点击
-    handleEvents(info) {
-      console.log('handleEvents.info:', info)
-      // this.currentEvents = events
-      
-    },
-    handleWeekendsToggle() {
-      console.log('handleWeekendsToggle')
-      this.calendarOptions.weekends = !this.calendarOptions.weekends
-    },
-    // 日期点击
-    handleDateClick(selectInfo) {
-    //   if (confirm('您是否要在【' + selectInfo.dateStr + '】添加一个新的事件?')) {
-    //     // 父组件直接调用子组件方法
-    //     this.$refs['eventDialogue'].openDialog('add')
-    //     // 父组件直接修改子组件变量
-    //     // this.$refs['eventDialogue'].dialogVisible = true
-    //   }
-    console.log(selectInfo)
-    this.selectInfo=selectInfo;
-    this.savePlanModalVisible=true;
-    },
-    // 日程点击信息展示
-    handleEventClick(info) {
-      console.log('handleEventClick.info:', info)
-      info.el.style.borderColor = 'red'
-      this.$refs['eventDialogue'].openDialog('view', info)
-    },
-    // 日程事件触发
-    eventClick(info) {
-      console.log('eventClick.info:', info)
-      info.el.style.borderColor = 'red'
-    },
-    // 日程拖动事件
-    handleEventDrop(info) {
-      this.$refs['eventDialogue'].eventFormModel.start = info.event.start
-      this.$refs['eventDialogue'].eventFormModel.end = info.event.end
-    },
-    // 日程缩放事件
-    eventResize(info) {
-      this.$refs['eventDialogue'].eventFormModel.start = info.event.start
-      this.$refs['eventDialogue'].eventFormModel.end = info.event.end
-    },
-    handleOk(){
-        var selectObject={
-            title: this.$refs.savePlan.note,
-            start: this.selectInfo.dateStr,
-            extendedProps: {
-              status: 'done'
+        },
+
+        // 日程删除
+        deleteEvent (val) {
+            let eventsArr = this.calendarOptions.events
+            try {
+                eventsArr.forEach((item, index, eventsArr) => {
+                    if (item.eventID === val) {
+                        throw new Error(index)
+                    }
+                })
+            } catch (e) {
+                // 删除指定日程
+                eventsArr.splice(parseInt(e.message), 1)
             }
-        }
-        this.calendarOptions.events.push(selectObject)
-        this.savePlanModalVisible=false;
-    },
-    handleCancel(){
+        },
+
+        handleWeekendsToggle () {
+            console.log('handleWeekendsToggle')
+            this.calendarOptions.weekends = !this.calendarOptions.weekends
+        },
 
+        // 日程事件触发
+        eventClick (info) {
+            console.log('eventClick.info:', info)
+            info.el.style.borderColor = 'red'
+        },
+        // 日程拖动事件
+        handleEventDrop (info) {
+            this.$refs['eventDialogue'].eventFormModel.start = info.event.start
+            this.$refs['eventDialogue'].eventFormModel.end = info.event.end
+        },
+        // 日程缩放事件
+        eventResize (info) {
+            this.$refs['eventDialogue'].eventFormModel.start = info.event.start
+            this.$refs['eventDialogue'].eventFormModel.end = info.event.end
+        }
     }
-  }
 }
 </script>
 <style lang="less" scoped>
+/deep/ .ant-card-head-title {
+  text-shadow: 1px 1px 2px rgb(170, 169, 169);
+  color: #1890ff;
+}
 </style>