Browse Source

[日程计划列表] [企业公告] 接口完成、富文本高度完成

liangyan0105 3 years ago
parent
commit
4ce08a4edd

+ 17 - 16
src/api/oa/cd-enterprise-announcement.js

@@ -1,31 +1,32 @@
-import { getAction,deleteAction,putAction,postAction} from '@/api/manage'
+import { getAction, deleteAction, putAction, postAction } from '@/api/manage'
 
-/**
- * 企业公告
- */
+/** 企业公告 **/
+
+// 查询分页数据
+const enterpriseEList = (params) => getAction('/oa/cdEnterpriseEnnouncement/list', params)
+
+// 新增
+const enterpriseEAdd = (params) => postAction('/oa/cdEnterpriseEnnouncement/add', params)
+
+// 根据id查询  params:{id:''}
+const enterpriseEQueryById = (params) => getAction('/oa/cdEnterpriseEnnouncement/queryById', params)
 
-//查询分页数据
-const  enterpriseEList= (params)=>getAction("/oa/cdEnterpriseEnnouncement/list",params);
-//新增
-const enterpriseEAdd= (params)=>postAction("/oa/cdEnterpriseEnnouncement/add",params);
-//根据id查询
-//params:{id:''}
-const enterpriseEQueryById = (params)=>getAction("/oa/cdEnterpriseEnnouncement/queryById",params);
-//修改
-const enterpriseEUpdate= (params)=>postAction("/oa/cdEnterpriseEnnouncement/edit",params);
+// 修改
+const enterpriseEUpdate = (params) => putAction('/oa/cdEnterpriseEnnouncement/edit', params)
 /**
  * 发布与取消发布接口
- * @param {*} params 
+ * @param {*} params
  * {
  *  id:'',//需修改的id
  *  isRelease:''//修改成需要的发布状态
  * }
  */
-const  enterpriseEReleseUpdate= (params)=>getAction("/oa/cdEnterpriseEnnouncement/releaseUpdate",params);
+const enterpriseEReleseUpdate = (params) => getAction('/oa/cdEnterpriseEnnouncement/releaseUpdate', params)
 
 export {
+    enterpriseEReleseUpdate,
     enterpriseEList,
     enterpriseEAdd,
     enterpriseEQueryById,
     enterpriseEUpdate
-}
+}

+ 19 - 12
src/api/oa/cd-schedule.js

@@ -1,21 +1,25 @@
-import {
-  getAction,
-  deleteAction,
-  putAction,
-  postAction
+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) => putAction('/oa/cdSchedule/edit', params)
+
 // 查询上月我的计划数量
 // params:
 // {
@@ -23,12 +27,15 @@ const scheduleUpdate = (params) => putAction('/oa/cdSchedule/edit', params)
 //    whereTimeType:'',时间类型(0无时间筛选1查询上月的2本月)
 // }
 const scheduleGetLastMonth = (params) => getAction('/oa/cdSchedule/getLastMonth', params)
-//列表分页查询
+
+// 列表分页查询
 const scheduleList = (params) => getAction('/oa/cdSchedule/list', params)
+
 export {
-  scheduleGetListByTime,
-  scheduleQueryById,
-  scheduleAdd,
-  scheduleUpdate,
-  scheduleGetLastMonth
-}
+    scheduleGetListByTime,
+    scheduleQueryById,
+    scheduleAdd,
+    scheduleUpdate,
+    scheduleList,
+    scheduleGetLastMonth
+}

+ 2 - 1
src/components/jeecg/JEditor.vue

@@ -101,7 +101,8 @@ export default {
                 language_url: '/tinymce/langs/zh_CN.js',
                 language: 'zh_CN',
                 skin_url: '/tinymce/skins/lightgray',
-                height: 300,
+                max_height: 700,
+                min_height: 350,
                 // plugins: this.plugins,
                 // toolbar: this.toolbar,
                 // 新增

+ 2 - 2
src/views/jeecg/RichText.vue

@@ -7,12 +7,12 @@
 </template>
 
 <script>
-import tinymce from 'tinymce/tinymce'
+// import tinymce from 'tinymce/tinymce'
 import Editor from '@tinymce/tinymce-vue'
 import 'tinymce/themes/silver/theme' // 引用主题文件
 import 'tinymce/icons/default' // 引用图标文件
 import 'tinymce/plugins/link'
-import 'tinymce/plugins/code'
+// import 'tinymce/plugins/code'
 import 'tinymce/plugins/table'
 import 'tinymce/plugins/lists'
 import 'tinymce/plugins/advlist'

+ 51 - 41
src/views/oa/enter-ann/add/addAnnModal.vue

@@ -67,8 +67,8 @@
           <a-col :span="12">
             <a-form-item label="公告内容:"></a-form-item>
           </a-col>
-          <a-col :span="21">
-            <JEditor ref="JEditor" :value="smallText" style="margin:0 170px 0 130px;"> </JEditor>
+          <a-col :span="24">
+            <JEditor ref="JEditor" :value="smallText" style="margin:0 170px 0 130px;"></JEditor>
           </a-col>
         </a-row>
       </a-form>
@@ -77,9 +77,10 @@
 </template>
 
 <script>
-import moment from 'moment'
+// import moment from 'moment'
 import 'moment/locale/zh-cn'
 import JEditor from '@/components/jeecg/JEditor'
+import { enterpriseEAdd, enterpriseEUpdate } from '@api/oa/cd-enterprise-announcement'
 export default {
     name: 'AddAnnModal',
     components: {
@@ -97,57 +98,67 @@ export default {
     },
     props: {
     // 接收父组件查询公告的方法
-    // fatherGetAnnList: {
-    //     type: Function,
-    //     default: null
-    // }
+        fatherGetList: {
+            type: Function,
+            default: null
+        }
     },
-    // 上海2套公寓、外加1套小办公室
-    // 合肥2套公寓、外加1套别墅
-    // 海南1套大公寓
-    // 墨尔本1套公寓
-
-    //  就这儿子结婚后 跟老婆住在30平小办公室
-
     created () {},
 
     methods: {
     // 回显表单
-        getAnnFormInfo () {
-            console.log('点击项ID', this.annInfo.id)
-            // 回显赋值
-            this.addForm.setFieldsValue({
-                title: this.annInfo.title,
-                type: this.annInfo.type,
-                createBy: this.annInfo.createBy,
-                createTime: moment(this.annInfo.createTime, 'YYYY/MM/DD HH:mm:ss'),
-                isRelease: this.annInfo.isRelease,
-                myValue: this.annInfo.myValue
+        getAnnFormInfo (e) {
+            console.log('弹框拿到编辑项ID', this.annInfo.id)
+            this.$nextTick(() => {
+                this.addAnnForm.setFieldsValue({
+                    title: this.annInfo.title,
+                    type: this.annInfo.type,
+                    isRelease: this.isRelease
+                })
+                this.$refs.JEditor.myValue = this.annInfo.content
+                console.log('回显完成,保存按钮判断是否编辑')
             })
         },
-        // 弹框保存
+        // 弹框 保存
         handleOk () {
-            // 赋值 触发表单验证、发送新增请求、提示新增成功、关闭弹框
             this.addAnnForm.validateFields((err, vals) => {
-                console.log('新增企业公告的信息:', vals)
                 if (!err && this.$refs.JEditor.myValue !== '') {
-                    // -------------------------------------------------
                     var news = {}
                     news.title = vals.title
                     news.type = vals.type
-                    // news.createBy = vals.createBy
-                    // news.createTime = vals.createTime.format('YYYY-MM-DD HH:mm:ss')
-                    console.log(this.$refs.JEditor.myValue)
-                    news.myValue = this.$refs.JEditor.myValue // 拿到子组件的富文本 内容
-                    console.log('这是添加的一条日程计划:', news)
-                    // -----------------------------------------------
-                    this.addModalVisible = false
-                    this.$message.success('新增企业公告成功')
-                    this.addAnnForm.resetFields() // 清空
-                    // 调用父组件查询公告列表 方法
-                    // this.fatherGetAnnList()
+                    news.createBy = vals.createBy
+                    news.createTime = vals.createTime
+                    news.isRelease = vals.isRelease
+                    news.content = this.$refs.JEditor.myValue
+                    // console.log(news.content )
+                    // 编辑--------------------------------------
+                    if (this.annInfo.id) {
+                        news.id = this.annInfo.id
+                        console.log('这是修改')
+                        enterpriseEUpdate(news).then(res => {
+                            if (res.success) {
+                                this.$message.success('日程计划修改成功')
+                                this.addModalVisible = false
+                                this.addAnnForm.resetFields() // 清空表单
+                                this.$refs.JEditor.myValue = '' // 清空富文本
+                                this.fatherGetList() // 调用父组件的查询方法
+                            }
+                        })
+                    } else {
+                        // 新增--------------------------------------
+                        enterpriseEAdd(news).then(res => {
+                            if (res.success) {
+                                // console.log(res)
+                                this.addModalVisible = false
+                                this.$message.success('新增企业公告成功')
+                                this.addAnnForm.resetFields() // 清空
+                                this.$refs.JEditor.myValue = '' // 清空富文本
+                                this.fatherGetList()
+                            }
+                        })
+                    }
                 } else {
-                    this.$message.error('请填写完整的日程计划')
+                    this.$message.error('请填写企业公告必要信息')
                 }
             })
         },
@@ -160,7 +171,6 @@ export default {
             this.close()
         },
         createTimeChange (value, dateString) {
-            // value:Moment[],dateString:string[]
             console.log('选择的时间:', value)
             console.log('格式化选择的时间:', dateString)
         },

+ 44 - 72
src/views/oa/enterpriseAnnouncement.vue

@@ -1,5 +1,5 @@
 <template>
-  <a-card>
+  <a-card :bordered="false">
     <!-- 查询 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
@@ -46,7 +46,7 @@
         <a-table
           bordered
           :columns="columns"
-          :dataSource="annDataList"
+          :dataSource="annList"
           :loading="loading"
           :pagination="pagination"
           :row-key="record => record.id"
@@ -78,12 +78,13 @@
     </div>
 
     <!-- 新增弹框 组件 :fatherGetAnnList="getAnnList" -->
-    <addAnn-modal ref="AddAnnModal" @ok="modalFormOk"></addAnn-modal>
+    <addAnn-modal ref="AddAnnModal" @ok="modalFormOk" :fatherGetList="getAnnList"></addAnn-modal>
   </a-card>
 </template>
 
 <script>
 import AddAnnModal from '@views/oa/enter-ann/add/addAnnModal.vue'
+import { enterpriseEList, enterpriseEQueryById } from '@api/oa/cd-enterprise-announcement'
 export default {
     name: 'EnterpriseAnnouncement', // 企业公告
 
@@ -94,7 +95,6 @@ export default {
         return {
             id: '', // 唯一标识 双休绑定后自动生成,删除
             loading: false, // 表格加载
-            pagination: {}, // 分页
             queryParam: {}, // 查询条件对象
             // 表头
             columns: [
@@ -132,80 +132,55 @@ export default {
                     width: '20%'
                 }
             ],
-            // 公告数据
-            annDataList: [
-                {
-                    id: '1',
-                    title: '企业文化KPI考核',
-                    type: '正常',
-                    createBy: 'admin',
-                    createTime: '2020/09/09',
-                    isRelease: '0',
-                    content: '哈哈哈哈哈哈'
-                },
-                {
-                    id: '2',
-                    title: '周末全体员工聚餐',
-                    type: '财务',
-                    createBy: 'admin',
-                    createTime: '2021/12/19',
-                    isRelease: '1',
-                    content: '牛牛牛牛牛'
-                }
-            ],
-            showInfo: {} // 编辑时回显的公告数据
+            annList: [], // 公告数据
+            pagination: {}, // 分页
+            showInfo: {}, // 编辑时回显的公告数据
+            // 查询接口的查询条件
+            whichOne: {
+                pageNo: 1,
+                title: ''
+            }
         }
     },
     created () {
-    // this.getAnnList() //渲染公告
+        this.getAnnList() // 渲染公告
     },
     methods: {
     // 查询日程计划列表
-    // getAnnList () {
-    //     jiekou(null).then(res => {
-    //         if (res.success) {
-    //             let list = res.result // 查询结果
-    //             var annList = [] // 企业公告集合
-    //             list.forEach(e => {
-    //                 let annObj = {
-    //                     title: e.title,
-    //                     type: e.type,
-    //                     content: e.content,
-    //                     createBy: e.createBy,
-    //                     createTime: e.createTime,
-    //                     isRelease: e.isRelease
-    //                 }
-    //                 // 一条公告数据放到公告列表中
-    //                 annList.push(annObj)
-    //             })
-    //         }
-    //     })
-    // },
-    // 新增
+        getAnnList () {
+            enterpriseEList(this.whichOne).then(res => {
+                if (res.success) {
+                    this.annList = res.result.records
+                    console.log('当前页数据', this.annList)
+                    this.pagination = {
+                        total: res.result.total,
+                        current: res.result.current,
+                        pageSize: res.result.size
+                    }
+                    // console.log(this.pagination)
+                }
+            })
+        },
+
+        // 新增 按钮
         addOpen () {
-            console.log('点击了大页面的新增')
-            // 拿到子组件的弹框 属性
+            console.log('点击新增,负责打开弹框,剩下功能在子组件的保存按钮')
             this.$refs.AddAnnModal.addModalVisible = true
             this.$refs.AddAnnModal.title = '新增企业公告'
         },
-        // 编辑
-        editAnn (e) {
-            console.log('编辑,该公告:', e)
+        // 点击编辑  回显
+        editAnn (obj) {
+            console.log('负责打开编辑弹框,剩下功能在子组件的保存按钮')
             this.$refs.AddAnnModal.addModalVisible = true
             this.$refs.AddAnnModal.title = '编辑企业公告'
-            if (e.id) {
-                console.log('该项id', e.id)
-                // 发送根据 id 查询公告请求
-                // gg().then(res => {
-                //     if (res.success) {
-                //         console.log(res)
-                //         let annInfo = res.result
-                //         this.showInfo = annInfo // 互通
-                //         console.log('回显的公告', this.showInfo)
-                //         this.$refs.AddAnnModal.annInfo = this.showInfo
-                //     }
-                // })
-            }
+            // 根据id查询公告
+            enterpriseEQueryById({ id: obj.id }).then(res => {
+                if (res.success) {
+                    console.log(res)
+                }
+            })
+            this.$refs.AddAnnModal.annInfo = obj
+            this.$refs.AddAnnModal.getAnnFormInfo()
         },
         // 查询按钮
         searchQuery () {
@@ -222,12 +197,9 @@ export default {
         modalFormOk () {},
         // 分页、排序、筛选变化时触发
         handleTableChange (pagination, filters, sorter) {
-            // if (Object.keys(sorter).length > 0) {
-            //     this.isorter.column = sorter.field
-            //     this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
-            // }
-            // this.ipagination = pagination
-            // this.loadData();
+            // console.log('当前页信息>>>>',pagination)
+            this.whichOne.pageNo = pagination.current
+            this.getAnnList()
         },
 
         // 发布

+ 81 - 72
src/views/oa/my-plan/add/savePlan.vue

@@ -38,7 +38,7 @@
             >
               <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>
@@ -135,14 +135,14 @@
           </a-form-item>
         </a-col>
       </a-row>
-      <!-- 内容 -->
+
+      <!-- 日程富文本 -->
       <a-row :gutter="24">
         <a-col :span="12">
           <a-form-item label="日程内容:" style="marginBottom:0;"></a-form-item>
         </a-col>
         <a-col :span="24">
-          <!-- <JEditor ref="JEditor" :richTextVal="smallText" style="margin:0 170px 0 130px;"></JEditor> -->
-          <JEditor ref="JEditor" :value="smallText" style="margin:0 170px 0 130px;"> </JEditor>
+          <JEditor ref="JEditor" :value="smallText" style="margin:0 170px 0 130px;"></JEditor>
         </a-col>
       </a-row>
     </a-form>
@@ -150,7 +150,6 @@
 </template>
 
 <script>
-
 import moment from 'moment'
 import 'moment/locale/zh-cn'
 import JEditor from '../../../../components/jeecg/JEditor.vue'
@@ -178,15 +177,20 @@ export default {
             timeList: [], // 开始/结束时间集合
             isDate: false, // 默认无时分秒
             smallText: '', // 富文本内容
-            title: ''
+            title: '' // 弹框头部
         }
     },
     props: {
-    // 接收父组件方法 (查询日程
+    // 接收日历 (父组件方法)
         fatherMethod: {
             type: Function,
             default: null
         },
+        // 接收日历列表 (父组件方法)
+        calTableMethod: {
+            type: Function,
+            default: null
+        },
         // 接收父组件的属性(点击的时间)
         fatherData: {
             type: String,
@@ -198,7 +202,75 @@ export default {
     computed: {},
     mounted () {},
     methods: {
-    // 判断点击的时间有无 时分秒
+        // 回显表单的赋值
+        getFormInfo (e) {
+            console.log('点击日程ID>>', this.formData.id)
+            this.$nextTick(() => {
+                this.addForm.setFieldsValue({
+                    title: this.formData.title,
+                    type: this.formData.type,
+                    degreeOfUrgency: this.formData.degreeOfUrgency,
+                    backgroundColor: this.formData.backgroundColor,
+                    continue: [
+                        moment(this.formData.startTime, 'YYYY/MM/DD HH:mm'),
+                        moment(this.formData.endTime, 'YYYY/MM/DD HH:mm')
+                    ]
+                })
+                this.$refs.JEditor.myValue = this.formData.memo
+                console.log('走到这')
+            })
+        },
+        // 弹框 保存
+        handleOk (e) {
+            this.addForm.validateFields((err, values) => {
+                // console.log('跑出来', values)
+                // console.log('>>>>>>>', this.$refs.JEditor.myValue)
+                if (!err) {
+                    var scheduleObject = {}
+                    scheduleObject.title = values.title
+                    scheduleObject.type = values.type
+                    scheduleObject.degreeOfUrgency = values.degreeOfUrgency
+                    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.backgroundColor = values.backgroundColor
+                    scheduleObject.memo = this.$refs.JEditor.myValue
+                    // 编辑--------------------------------------------
+                    if (this.formData.id) {
+                        scheduleObject.id = this.formData.id
+                        console.log('这是修改')
+                        scheduleUpdate(scheduleObject).then(res => {
+                            if (res.success && this.fatherMethod) {
+                                this.$message.success('日程计划修改成功')
+                                this.savePlanModalVisible = false
+                                this.addForm.resetFields() // 清空表单
+                                this.$refs.JEditor.myValue = '' // 清空富文本
+                                this.fatherMethod() // 调用父组件的查询方法
+                            } else {
+                                this.$message.success('日程计划列表修改成功')
+                                this.savePlanModalVisible = false
+                                this.addForm.resetFields() // 清空表单
+                                this.$refs.JEditor.myValue = '' // 清空富文本
+                                this.calTableMethod() // 调用父组件的查询方法
+                            }
+                        })
+                    } else {
+                        // 新增------------------------------------------
+                        scheduleAdd(scheduleObject).then(res => {
+                            if (res.success) {
+                                this.savePlanModalVisible = false
+                                this.$message.success('新增日程成功')
+                                this.addForm.resetFields() // 清空表单
+                                this.$refs.JEditor.myValue = ''
+                            }
+                        })
+                    }
+                } else {
+                    this.$message.error('请填写信息')
+                }
+            })
+        },
+
+        // 判断点击的时间有无 时分秒
         isDatetime (dateVal) {
             console.log('分隔得到的点击事件:', dateVal.split('T'))
             var t = dateVal.split('T')
@@ -246,69 +318,6 @@ export default {
             })
         },
 
-        // 回显表单的赋值
-        getFormInfo (e) {
-            console.log('点击日程的ID:', this.formData.id) // 2
-            this.$nextTick(() => {
-                this.addForm.setFieldsValue({
-                    title: this.formData.title,
-                    type: this.formData.type, // 日程类型
-                    degreeOfUrgency: this.formData.degreeOfUrgency, // 紧急程度
-                    backgroundColor: this.formData.backgroundColor,
-                    continue: [moment(this.formData.startTime, 'YYYY/MM/DD HH:mm'), moment(this.formData.endTime, 'YYYY/MM/DD HH:mm')]
-                })
-                this.$refs.JEditor.myValue = this.formData.memo
-            })
-        },
-
-        // 弹框 保存
-        handleOk (e) {
-            this.addForm.validateFields((err, values) => {
-                console.log('跑出来', values)
-                console.log('>>>>>>>', this.$refs.JEditor.myValue)
-                if (!err) {
-                    // ---赋值-------------------------------------------
-                    var scheduleObject = {}
-                    scheduleObject.title = values.title
-                    scheduleObject.type = values.type
-                    scheduleObject.degreeOfUrgency = values.degreeOfUrgency
-                    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.backgroundColor = values.backgroundColor
-                    scheduleObject.memo = this.$refs.JEditor.myValue
-                    // 修改------------------------------------------------
-                    if (this.formData.id) {
-                        scheduleObject.id = this.formData.id
-                        console.log('这是修改')
-                        scheduleUpdate(scheduleObject).then(res => {
-                            // console.log('怎么修改功能没有了', res)
-                            if (res.success) {
-                                this.$message.success('日程修改成功')
-                                this.savePlanModalVisible = false
-                                this.addForm.resetFields() // 清空
-                                this.fatherMethod()// 调用父组件的查询方法
-                            }
-                        })
-                    } else {
-                        // 新增------------------------------------------
-                        scheduleAdd(scheduleObject).then(res => {
-                            if (res.success) {
-                                this.savePlanModalVisible = false
-                                this.$message.success('新增日程成功')
-                                this.addForm.resetFields() // 清空表单
-                                this.$refs.JEditor.myValue = ''
-                                this.fatherMethod() // 调用父组件的查询方法
-                            }
-                        })
-                    }
-                    // ----------------------------------------------
-                } else {
-                    this.$message.error('请填写信息')
-                    console.log('未填写相关信息')
-                }
-            })
-        },
-
         // 日程时间
         continueTimeChange (date, dateString) {
             console.log('date>>>>>>>>>>>>>>>', date)
@@ -321,7 +330,7 @@ export default {
 
         handleCancel (e) {
             this.addForm.resetFields() // 清空
-            this.$refs.JEditor.myValue = ''// 清空富文本
+            this.$refs.JEditor.myValue = '' // 清空富文本
             this.savePlanModalVisible = false
         }
     }

+ 68 - 54
src/views/oa/my-plan/calTable.vue

@@ -1,6 +1,5 @@
 <template>
-  <!-- :bordered="false" -->
-  <a-card>
+  <a-card :bordered="false">
     <!-- 查询 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
@@ -88,15 +87,16 @@
       </template>
     </a-alert>
 
-    <!-- 使用 rowKey 来指定数据的唯一标识 id -->
+    <!-- :scroll="scroll"-->
     <a-table
       bordered
       :columns="columns"
       :dataSource="planList"
       :pagination="pagination"
-      :row-key="record => record.id"
+      :rowKey="record => record.id"
       :rowSelection="rowSelection"
       @change="handleTableChange"
+      style="height:100%"
     >
       <!-- 操作 -->
       <span slot="operationSlot" slot-scope="text, record">
@@ -109,8 +109,7 @@
     </a-table>
     <!-- table 结束-->
 
-    <!-- 新增日程弹框  :fatherMethod="search"-->
-    <save-plan ref="savePlan"></save-plan>
+    <save-plan ref="savePlan" :calTableMethod="getplanList"></save-plan>
   </a-card>
 </template>
 
@@ -119,7 +118,7 @@
 import 'moment/locale/zh-cn'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import SavePlan from '@views/oa/my-plan/add/savePlan' // 子组件
-
+import { scheduleList, scheduleQueryById } from '@api/oa/cd-schedule'
 export default {
     name: 'CalTable',
     components: { JEllipsis, SavePlan },
@@ -127,8 +126,12 @@ export default {
         return {
             tokenHeader: {},
             queryParam: {}, // 查询条件对象
-            pagination: {}, // 分页 // 富文本内容
-            // planObj: {}, // 表单数据(回显)
+            pagination: {
+                total: 0,
+                current: 0,
+                pageSize: 0
+            }, // 分页
+            planList: [], // 列表数据
             // 表头
             columns: [
                 {
@@ -160,39 +163,14 @@ export default {
                     title: '操作',
                     dataIndex: 'operation',
                     scopedSlots: { customRender: 'operationSlot' },
-                    align: 'center',
-                    width: '20%'
+                    align: 'center'
                 }
             ],
-            planList: [
-                {
-                    id: '1',
-                    title: '11月19日的KPI考核(2)',
-                    type: '下周计划',
-                    degreeOfUrgency: '紧急',
-                    startTime: '2021/11/19',
-                    endTime: '2021/11/19',
-                    memo: '哈哈哈哈哈哈'
-                },
-                {
-                    id: '2',
-                    title: '12月17日的KPI考核(3)',
-                    type: '日程记录',
-                    degreeOfUrgency: '一般',
-                    startTime: '2021/12/17',
-                    endTime: '2021/12/17',
-                    memo: '呵呵呵呵'
-                },
-                {
-                    id: '3',
-                    title: '做点什么',
-                    type: '本周计划',
-                    degreeOfUrgency: '重要',
-                    startTime: '2022/01/30',
-                    endTime: '2022/02/15',
-                    memo: '呵呵呵呵'
-                }
-            ]
+            // 查询接口的查询条件
+            whichOne: {
+                pageNo: 1, // 当前页
+                title: ''// 假定搜索栏搜索条件
+            }
         }
     },
     computed: {
@@ -214,28 +192,65 @@ export default {
                 })
             }
         }
+    // scroll: function () {
+    //     var width = window.innerWidth
+    //     // ant-table
+    //     let $antTable = window.document.getElementsByClassName('ant-table')
+    //     if ($antTable[0]) {
+    //         width = $antTable[0].clientWidth
+    //     }
+    //     return {
+    //         x: 1160,
+    //         y: window.innerHeight / 2
+    //     }
+    // }
+    },
+    created () {
+        this.getplanList()
     },
     methods: {
-    // 新增日程计划   弹框
+    // 分页查询 日程列表
+        getplanList () {
+            scheduleList(this.whichOne).then(res => {
+                if (res.success) {
+                    // console.log(res)
+                    this.planList = res.result.records // 结果赋值给 planList
+                    console.log('当前页数据', this.planList)
+                    this.pagination = { // 分页信息赋值
+                        total: res.result.total,
+                        current: res.result.current,
+                        pageSize: res.result.size
+                    }
+                }
+            })
+        },
+
+        // 新增日程计划   弹框
         addPlan () {
-            console.log('点击了新增日程')
+            console.log('点击新增,负责打开弹框即可 剩下功能在子组件的保存按钮')
             this.$refs.savePlan.savePlanModalVisible = true
             this.$refs.savePlan.title = '新增日程计划'
         },
-        // 编辑 (操作)
+        // 点击编辑  回显
         editPlan (obj) {
-            /* ------------------------------
-                打开弹框、发送根据id查询、
-                数据赋值到对象集合中、
-                回显到表单、调用回显的方法,
-                提示修改成功、刷新列表
-              ------------------------------- */
-            console.log('点击对象为:', obj)
+            console.log('编辑,负责打开弹框 剩下功能在子组件的回显方法')
             this.$refs.savePlan.savePlanModalVisible = true
-            this.$refs.savePlan.title = '编辑日程计划'
+            this.$refs.savePlan.title = '编辑日程计划列表'
+            // 根据id查询日程
+            scheduleQueryById({ id: obj.id }).then(res => {
+                if (res.success) {
+                    console.log('编辑的对象', res)
+                }
+            })
             this.$refs.savePlan.formData = obj
             this.$refs.savePlan.getFormInfo()
         },
+        // 分页、排序、筛选变化时触发
+        handleTableChange (pagination, filters, sorter) {
+            // console.log('当前页信息>>>>',pagination)
+            this.whichOne.pageNo = pagination.current
+            this.getplanList()
+        },
         // 操作 删除
         delPlan () {},
         // ------------------------------------------
@@ -255,9 +270,8 @@ export default {
         // 导入
         myPlanImportExcel () {},
         // 批量删除
-        batchDel () {},
-        // 分页、排序、筛选变化时触发
-        handleTableChange (pagination, filters, sorter) {}
+        batchDel () {}
+
     }
 }
 </script>

+ 0 - 1
src/views/oa/my-plan/schedulePlan.vue

@@ -137,7 +137,6 @@ export default {
                 this.$nextTick(() => {
                     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)