Преглед на файлове

日程背景色、【mytodo】页面日程回显、点击(月、日)日期自动给endTime 加半小时

liangyan0105 преди 3 години
родител
ревизия
e9e47d1f98
променени са 4 файла, в които са добавени 317 реда и са изтрити 161 реда
  1. 16 15
      src/api/oa/cd-schedule.js
  2. 94 48
      src/views/dashboard/MyToDo.vue
  3. 162 46
      src/views/oa/my-plan/add/savePlan.vue
  4. 45 52
      src/views/oa/my-plan/schedulePlan.vue

+ 16 - 15
src/api/oa/cd-schedule.js

@@ -1,25 +1,26 @@
-import { getAction,deleteAction,putAction,postAction} from '@/api/manage'
+import { getAction, deleteAction, putAction, postAction } from '@/api/manage'
 
-//查询近两年和未来两年的数据
-const scheduleGetListByTime = (params)=>getAction("/oa/cdSchedule/getListByTime",params);
-//根据id查询
-//params:{id:''}
-const scheduleQueryById = (params)=>getAction("/oa/cdSchedule/queryById",params);
-//新增
-const scheduleAdd= (params)=>postAction("/oa/cdSchedule/add",params);
-//修改
-const scheduleUpdate= (params)=>postAction("/oa/cdSchedule/edit",params);
-//查询上月我的计划数量 
-//params:
-//{
+// 查询近两年和未来两年的数据
+const scheduleGetListByTime = (params) => getAction('/oa/cdSchedule/getListByTime', params)
+// 根据id查询
+// params:{id:''}
+const scheduleQueryById = (params) => getAction('/oa/cdSchedule/queryById', params)
+// 新增
+const scheduleAdd = (params) => postAction('/oa/cdSchedule/add', params)
+// 修改
+const scheduleUpdate = (params) => putAction('/oa/cdSchedule/edit', params)
+// 查询上月我的计划数量
+// params:
+// {
 //    createBy:'' ,人员账号(不传则查询全部人员)
 //    whereTimeType:'',时间类型(0无时间筛选1查询上月的2本月)
-//}
-const scheduleGetLastMonth = (params)=>getAction("/oa/cdSchedule/getLastMonth",params);
+// }
+const scheduleGetLastMonth = (params) => getAction('/oa/cdSchedule/getLastMonth', params)
 
 export {
     scheduleGetListByTime,
     scheduleQueryById,
     scheduleAdd,
+    scheduleUpdate,
     scheduleGetLastMonth
 }

+ 94 - 48
src/views/dashboard/MyToDo.vue

@@ -35,9 +35,8 @@
           <a-col :xs="24" :sm="24" :md="24" :lg="10">
             <a-card title="日历" :bordered="false" class="fullCard">
               <div>
-                <!-- <a-calendar :fullscreen="false" /> by ly-->
                 <div class="ccfullCalendar">
-                  <FullCalendar :options="calendarOptions" class="eventDeal-wrap" style="height:300px;" />
+                  <FullCalendar :options="calendarOptions" style="height:300px;" class="eventDeal-wrap" />
                 </div>
               </div>
             </a-card>
@@ -281,7 +280,9 @@ import FullCalendar from '@fullcalendar/vue'
 import dayGridPlugin from '@fullcalendar/daygrid'
 import interactionPlugin from '@fullcalendar/interaction'
 import timeGridPlugin from '@fullcalendar/timegrid'
+import SchedulePlan from '@views/oa/my-plan/schedulePlan' // 子组件
 // import '@fullcalendar/core/main.css'
+import { scheduleGetListByTime, scheduleQueryById } from '@api/oa/cd-schedule'
 import '@fullcalendar/daygrid/main.css'
 export default {
   name: 'Home',
@@ -292,6 +293,36 @@ export default {
     return {
       //日历组件 参数
       calendarOptions: {
+        // 日程数组
+        events: [
+          {
+            title: '啦啦啦啦',
+            start: '2021-10-13T14:30:00',
+            end: '2021-10-13T14:30:00',
+            extendedProps: {
+              status: 'done'
+            },
+            backgroundColor: '#ccd5ae',
+            borderColor: 'red'
+          }
+        ],
+        // 事件---------------------------------
+        editable: true, // 是否可以进行(拖动、缩放)修改
+        eventStartEditable: true, // Event日程开始时间可以改变,默认为true,若为false,则表示开始结束时间范围不能拉伸,只能拖拽
+        eventDurationEditable: true, // Event日程的开始结束时间距离是否可以改变,默认为true,若为false,则表示开始结束时间范围不能拉伸,只能拖拽
+        selectable: true, // 是否可以选中日历格
+        selectMirror: true,
+        selectMinDistance: 0, // 选中日历格的最小距离
+        weekends: true,
+        navLinks: false, // 天链接
+        selectHelper: false,
+        selectEventOverlap: false, // 相同时间段的多个日程视觉上是否允许重叠,默认为true,允许
+        dayMaxEvents: true,
+        dateClick: this.handleDateClick, // 日期点击
+        eventsSet: this.handleEvents, // 事件点击
+        eventClick: this.handleEventClick, // 日程点击信息展示
+        eventDrop: this.handleEventDrop, // 日程拖动事件
+        eventResize: this.eventResize, // 日程缩放事件
         // 引入的插件
         plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
         // 日历头部按钮位置
@@ -324,37 +355,7 @@ export default {
           minute: '2-digit',
           meridiem: false,
           hour12: false // 设置时间为24小时制
-        },
-        // 日程数组
-        events: [
-          {
-            title: 'Meeting',
-            start: '2021-10-13T14:30:00',
-            end: '2021-10-13T14:30:00',
-            extendedProps: {
-              status: 'done'
-            },
-            backgroundColor: '#ccd5ae',
-            borderColor: 'red'
-          }
-        ],
-        // 事件
-        editable: true, // 是否可以进行(拖动、缩放)修改
-        eventStartEditable: true, // Event日程开始时间可以改变,默认为true,若为false,则表示开始结束时间范围不能拉伸,只能拖拽
-        eventDurationEditable: true, // Event日程的开始结束时间距离是否可以改变,默认为true,若为false,则表示开始结束时间范围不能拉伸,只能拖拽
-        selectable: true, // 是否可以选中日历格
-        selectMirror: true,
-        selectMinDistance: 0, // 选中日历格的最小距离
-        weekends: true,
-        navLinks: false, // 天链接
-        selectHelper: false,
-        selectEventOverlap: false, // 相同时间段的多个日程视觉上是否允许重叠,默认为true,允许
-        dayMaxEvents: true,
-        dateClick: this.handleDateClick, // 日期点击
-        eventsSet: this.handleEvents, // 事件点击
-        eventClick: this.handleEventClick, // 日程点击信息展示
-        eventDrop: this.handleEventDrop, // 日程拖动事件
-        eventResize: this.eventResize // 日程缩放事件
+        }
       },
       ////日历组件参数结尾----------------------
       userInfo: this.$store.getters.userInfo,
@@ -389,9 +390,11 @@ export default {
       }
     }
   },
+
   created() {
-    this.getDataList()
-    this.getActiveKeyAll()
+    this.getDataList() //待办数据
+    this.getActiveKeyAll() //OA按钮
+    this.getScheduleData() //查询日程数据
   },
   computed: {
     // 系统消息计算
@@ -405,7 +408,7 @@ export default {
       if ($antTable[0]) {
         width = $antTable[0].clientWidth
       }
-      console.log('$antTable', $antTable)
+      // console.log('$antTable', $antTable)
       return {
         // x:'max-content',
         x: 1160,
@@ -421,7 +424,48 @@ export default {
     this.loadData()
   },
   methods: {
-    // 日程保存
+    prev() {
+      this.calendarApi.prev()
+      console.log(this.calendarApi.prev)
+    },
+
+    //查询日程数据
+    getScheduleData() {
+      this.$nextTick(() => {
+        //发送查询请求
+        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,
+                backgroundColor: e.backgroundColor,
+                extendedProps: {
+                  status: 'done'
+                },
+                borderColor: 'none'
+              }
+              eventList.push(Object) // 把日程推到日程列表
+            })
+            console.log('日程', eventList)
+            // 刷新 日程列表
+            this.calendarOptions.events = eventList
+          }
+        })
+      })
+    },
+
+    handleEvents(info) {
+      // console.log('what', info)
+      // 打印了事件(完成、位置)
+      // this.currentEvents = events
+    },
     // 日期点击
     handleDateClick(selectInfo) {
       // if (confirm('您是否要在【' + selectInfo.dateStr + '】添加一个新的事件?')) {
@@ -433,7 +477,7 @@ export default {
       this.$router.push('/oa/my-plan/schedulePlan')
     },
 
-    //
+    // 系统消息
     loadData() {
       try {
         // 获取系统消息
@@ -512,7 +556,6 @@ export default {
         this.lcModal.visible = true
       }
       console.log('发起', v)
-      // this.getDataList()
     },
 
     //提交后
@@ -550,7 +593,7 @@ a {
 .fr {
   float: right;
 }
-/*清除浮动*/
+
 .clearfix:before,
 .clearfix:after {
   content: '';
@@ -570,7 +613,7 @@ a {
 /deep/ .ant-fullcalendar-header {
   display: none;
 }
-// 线消息huode
+// 线消息
 /deep/ .ant-fullcalendar {
   border-top: none;
 }
@@ -586,22 +629,19 @@ a {
 
 //包着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;
@@ -609,11 +649,19 @@ a {
   }
   /deep/ .fc-scrollgrid-sync-table {
     height: 274px !important;
-    // background-color: blue;
   }
   /deep/ .fc-daygrid-day-bottom {
     margin-top: -10px !important;
   }
+  /deep/ .fc .fc-button-primary {
+    background-color: #1890ff;
+    margin-top: 4px;
+    border: none;
+  }
+  /deep/ .fc .fc-toolbar-title {
+    color: #333;
+    font-size:16px;
+  }
 }
 #home {
   // 第一行
@@ -653,7 +701,6 @@ a {
       }
     }
   }
-
   // OA工作台
   .oaBtn {
     background-color: white;
@@ -696,7 +743,6 @@ a {
       }
     }
   }
-
   // 公告
   .news {
     .newsColItem {

+ 162 - 46
src/views/oa/my-plan/add/savePlan.vue

@@ -44,7 +44,7 @@
               </a-form-item>
             </a-col>
 
-            <!-- 紧急程度 degree-->
+            <!-- 紧急程度 -->
             <a-col :span="12">
               <a-form-item label="紧急程度">
                 <a-select
@@ -93,19 +93,27 @@
             </a-col>
           </a-row>
 
-          <!-- 日程时间、是否全天 -->
+          <!-- 日程时间、全天 -->
           <a-row :gutter="24">
-            <!-- 日程时间 -->
             <a-col :span="12">
               <a-form-item label="日程时间">
+                <!-- 有时分秒 -->
                 <a-range-picker
+                  v-if="isDate == true"
                   showTime
-                  format="YYYY-MM-DD HH:mm:ss"
+                  format="YYYY-MM-DD HH:mm"
                   @change="continueTimeChange"
-                  :showToday="true"
                   v-decorator="['continue', { rules: [{ required: true, message: '请选择日程时间' }] }]"
                 >
                 </a-range-picker>
+                <!-- 无时分秒 -->
+                <a-range-picker
+                  v-if="isDate == false"
+                  format="YYYY-MM-DD"
+                  @change="continueTimeChange"
+                  v-decorator="['continue', { rules: [{ required: true, message: '请选择日程日期' }] }]"
+                >
+                </a-range-picker>
               </a-form-item>
             </a-col>
             <!-- 是否全天 -->
@@ -117,6 +125,28 @@
           </a-row>
 
           <a-divider orientation="left">其他信息</a-divider>
+          <!-- 颜色 -->
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="颜色">
+                <div>
+                  <a-radio-group
+                    v-decorator="['backgroundColor', { rules: [{ required: false, message: '请选择日程背景色' }] }]"
+                  >
+                    <a-radio-button value="#d1495b" style="background:#d1495b; marginRight:8px;"></a-radio-button>
+                    <a-radio-button value="#fa541c" style="background:#fa541c; marginRight:8px;"></a-radio-button>
+                    <a-radio-button value="#faad14" style="background:#faad14; marginRight:8px;"></a-radio-button>
+                    <a-radio-button value="#5497a7" style="background:#5497a7; marginRight:8px;"></a-radio-button>
+                    <a-radio-button value="#3bb273" style="background:#3bb273; marginRight:8px;"></a-radio-button>
+                    <a-radio-button value="#81c3d7" style="background:#81c3d7; marginRight:8px;"></a-radio-button>
+                    <a-radio-button value="#004e98" style="background:#004e98; marginRight:8px;"></a-radio-button>
+                    <a-radio-button value="#985277" style="background:#985277;"></a-radio-button>
+                  </a-radio-group>
+                </div>
+              </a-form-item>
+            </a-col>
+          </a-row>
+
           <!-- 文字编辑器 -->
           <a-row :gutter="24">
             <a-col :span="24">
@@ -138,7 +168,9 @@ 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'
+import { scheduleAdd, scheduleUpdate } from '@api/oa/cd-schedule'
+// import { extend } from 'dayjs'
+// import { defineComponent, ref } from 'vue'
 
 export default {
     name: 'SavePlan',
@@ -149,7 +181,10 @@ export default {
             addForm: this.$form.createForm(this, { name: 'coordinated' }),
             checked: true,
             memo: '',
-            formData: {} // 表单数据 (做回显)
+            formData: {}, // 表单数据(回显)
+            showTime: [], // 开始结束时间集合
+            isDate: false, // 默认无时分秒
+            ssmm: '' // 神神秘秘
         }
     },
     props: {
@@ -157,79 +192,160 @@ export default {
         fatherMethod: {
             type: Function,
             default: null
+        },
+        // 接收父组件的属性(点击的时间)
+        fatherData: {
+            type: String,
+            default: null
         }
     },
-    created () {
-    },
+
+    created () {},
     computed: {},
     mounted () {},
     methods: {
-        getById () {
+    // 判断点击的时间有无 时分秒
+        isDatetime (dateVal) {
+            console.log('分隔得到的点击事件:', dateVal.split('T'))
+            var t = dateVal.split('T')
+            if (t.length < 2) {
+                return false // 无 时分秒
+            }
+            return true // 有 时分秒
+        },
+
+        // 点击的日期回显到页面
+        setStartTime () {
+            this.$nextTick(() => {
+                // 1、父组件点击的时间 赋值给表单
+                this.formData.startTime = this.fatherData
+                this.formData.endTime = this.fatherData
+                console.log('在这个时间上加半小时好吗', this.formData.endTime)
+
+                /// 2、判断该时间 有无时分秒 赋值给 isDate
+                this.isDate = this.isDatetime(this.fatherData)
+                var showTime = [
+                    moment(this.formData.startTime, 'YYYY/MM/DD HH:mm'),
+                    moment(this.formData.endTime, 'YYYY/MM/DD HH:mm')
+                ]
+                // ================================================================
+                // 3、根据判断 有无时分秒 ,判断 是否需要显示 时分秒
+                if (this.isDate == true) {
+                    var e = this.formData.endTime
+                    // console.log('111', e)
+                    var ee = moment(e).format('YYYY-MM-DD HH:mm')
+                    // console.log('拿到格式后的结束时间', ee)
+                    var a = new Date(ee)
+                    var z = a.setMinutes(a.getMinutes() + 30)
+                    // console.log('半小时后的时间', reaET)
+                    var reaET = new Date(z)
+                    // console.log('22', z)
+                    showTime = [moment(this.formData.startTime, 'YYYY/MM/DD HH:mm'), moment(reaET, 'YYYY/MM/DD HH:mm')]
+                } else {
+                    showTime = [moment(this.formData.startTime, 'YYYY/MM/DD'), moment(this.formData.endTime, 'YYYY/MM/DD')]
+                }
+                // ==============================================================
+                // 赋值
+                this.addForm.setFieldsValue({
+                    continue: showTime
+                })
+            })
+        },
+
+        // 回显表单的赋值
+        getFormInfo () {
+            console.log('点击日程的ID:', this.formData.id)
             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 // 备注
+                memo: this.formData.memo, // 备注
+                backgroundColor: this.formData.backgroundColor,
+                continue: [
+                    moment(this.formData.startTime, 'YYYY/MM/DD HH:mm'),
+                    moment(this.formData.endTime, 'YYYY/MM/DD HH:mm')
+                ]
             })
         },
         // 弹框 保存
         handleOk (e) {
             this.addForm.validateFields((err, values) => {
+                console.log('跑出来', values)
                 if (!err) {
-                    // 一条数据对象
-                    console.log(values, '看看里面的日程时间')
-                    var scheduleObject = {}
+                    // ------------------------------------------------------
+                    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.startTime = values.continue[0].format('YYYY-MM-DD HH:mm')
+                    scheduleObject.endTime = values.continue[1].format('YYYY-MM-DD HH:mm')
                     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()
-                        }
-                    })
+                    scheduleObject.backgroundColor = values.backgroundColor
+                    // 修改------------------------------------------------
+                    if (this.formData.id) {
+                        scheduleObject.id = this.formData.id
+                        console.log('这是修改')
+                        scheduleUpdate(scheduleObject).then(res => {
+                            if (res.success) {
+                                this.$message.success('日程修改成功')
+                                this.savePlanModalVisible = false
+                                this.addForm.resetFields() // 清空
+                                // 调用父组件方法(查询数据)
+                                this.fatherMethod()
+                            }
+                            if (this.scheduleObject === this.formData) {
+                                console.log('00', this.scheduleObject)
+                                console.log('11', this.formData)
+                                console.log('没做修改的状态')
+                                this.$message.success('您未做任何修改')
+                                // 未做任何修改,状态不变
+                            }
+                        })
+                    } else {
+                        // 新增------------------------------------------
+                        scheduleAdd(scheduleObject).then(res => {
+                            if (res.success) {
+                                this.savePlanModalVisible = false
+                                this.$message.success('新增日程成功')
+                                this.addForm.resetFields() // 清空
+                                // 调用父组件的方法(查询数据)
+                                this.fatherMethod()
+                            }
+                        })
+                    }
+                    // ----------------------------------------------
                 } else {
+                    this.$message.success('请填写信息')
                     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')
+            // var ssmm = dateString
+            // console.log('神神秘秘', ssmm)
+            // let startTime = date[0].format('YYYY-MM-DD HH:mm') // 也可以不要具体时间
+            // let endTime = date[1].format('YYYY-MM-DD HH:mm')
+            let startTime = dateString[0]
+            let ee = dateString[1]
             console.log('startTime', startTime)
-            console.log('endTime', endTime)
+            console.log('endTime', ee)
         },
+
         handleCancel (e) {
-            console.log('取消按钮')
+            // console.log('取消按钮')
             this.addForm.resetFields() // 清空
             this.savePlanModalVisible = false
         }
     }
 }
 </script>
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.ant-radio-button-wrapper-checked {
+  border: 3px solid #36cfc9;
+  border-radius: 4px;
+}
+</style>

+ 45 - 52
src/views/oa/my-plan/schedulePlan.vue

@@ -3,7 +3,7 @@
     <a-card title="我的计划" style="width: 100%">
       <p>
         <FullCalendar :options="calendarOptions" class="eventDeal-wrap" />
-        <save-plan ref="savePlan" :fatherMethod="search"></save-plan>
+        <save-plan ref="savePlan" :fatherMethod="search" :fatherData="timeList"></save-plan>
       </p>
     </a-card>
   </div>
@@ -30,7 +30,7 @@ export default {
     },
     data () {
         return {
-            // dateStr: '', // 开始日期为点击的日期
+            timeList: '', // 点击的时间
             // 日历参数
             calendarOptions: {
                 // 日程数组
@@ -42,8 +42,8 @@ export default {
                         extendedProps: {
                             status: 'done'
                         },
-                        backgroundColor: '#ccd5ae',
-                        borderColor: 'red'
+                        backgroundColor: 'orange',
+                        borderColor: 'none'
                     }
                 ],
                 // 引入的插件
@@ -101,9 +101,9 @@ export default {
                 eventDrop: this.handleEventDrop, // 日程拖动事件
                 eventResize: this.eventResize // 日程缩放事件
             },
-
-            selectDate: {}, // 选择的日期信息集合
+            selectDate: [], // 点击的日期
             data: {}, // 表单回显数据
+            dateStr: '', // 点击日期回显的开始时间
             addForm: this.$form.createForm(this, { name: 'coordinated' })
         }
     },
@@ -113,15 +113,47 @@ export default {
     computed: {},
     mounted () {},
     methods: {
+    // 点击日期
+        handleDateClick (e) {
+            const selectData = e.dateStr
+            console.log('父组件点击的日期:', selectData)
+            // 点击的时间赋值给 timeList,并在页面传给传给子组件
+            this.timeList = selectData
+            // =====父组件拿子组件==================================
+            // this.$refs.savePlan.formData.startTime = selectData
+            // this.$refs.savePlan.formData.endTime = selectData
+            // =====================================================
+            this.$refs.savePlan.savePlanModalVisible = true
+            this.$refs.savePlan.setStartTime() // 调用子组件回显日期方法
+        },
+        // 点击日程,回显信息
+        handleEventClick (e) {
+            // 拿 子组件弹框属性
+            this.$refs.savePlan.savePlanModalVisible = true
+            console.log('点击项的ID是', e.event.id)
+            if (e.event.id) {
+                // 根据id查询日程(注意接口文档传参格式要求)
+                scheduleQueryById({ id: e.event.id }).then(res => {
+                    if (res.success) {
+                        console.log('该ID的日程', res)
+                        let formData = res.result // 查询结果赋值
+                        this.data = formData
+                        console.log('表单回显数据', this.data)
+                        this.$refs.savePlan.formData = this.data // 查询到的日程数据赋值给子组件表单
+                        this.$refs.savePlan.getFormInfo() // 调用子组件的回显数据
+                    }
+                })
+            }
+        },
         prev () {
             this.calendarApi.prev()
             console.log(this.calendarApi.prev)
         },
-        // 查询数据库日程数据
+        // 查询日程
         search () {
             scheduleGetListByTime(null).then(res => {
                 if (res.success) {
-                    console.log('查询到的总日程结果', res)
+                    // console.log('查询到的总日程结果', res)
                     let list = res.result // 查询结果
                     var eventList = [] // 日程事件集合
                     // 循环日程
@@ -131,16 +163,15 @@ export default {
                             start: e.startTime,
                             end: e.endTime,
                             id: e.id,
+                            backgroundColor: e.backgroundColor,
                             extendedProps: {
                                 status: 'done'
-                            },
-                            backgroundColor: 'orange',
-                            borderColor: 'orange'
+                            }
+                            // borderColor: 'none'
                         }
                         eventList.push(Object) // 把日程推到日程列表
-                        // console.log('打印出的事件id', Object.id)
                     })
-                    console.log('日程', eventList)
+                    // console.log('日程', eventList)
                     // 刷新 日程列表
                     this.calendarOptions.events = eventList
                 }
@@ -150,47 +181,9 @@ export default {
         // 日程总集合
         handleEvents (info) {
             // console.log('总事件集合handleEvents.info:', info)
-            // 打印了事件(完成、位置)
             // this.currentEvents = events
         },
 
-        // 日期点击
-        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
-        },
-
-        // 点击日程,回显信息,并可修改,修改请求
-        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 {
-                    }
-                })
-            }
-        },
-
         // 日程保存
         saveEvent (val) {
             let eventsArr = this.calendarOptions.events
@@ -236,7 +229,7 @@ export default {
         // 日程事件触发
         eventClick (info) {
             console.log('eventClick.info:', info)
-            info.el.style.borderColor = 'red'
+            info.el.style.borderColor = 'orange'
         },
         // 日程拖动事件
         handleEventDrop (info) {