| | |
| | | <div class="dashboard-editor-container"> |
| | | <panel-group :user-info="userInfo" @handleSetLineChartData="handleSetLineChartData" /> |
| | | <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;"> |
| | | <FullCalendar ref="fullCalendar" :options="calendarOptions" class="eventDeal-wrap" /> |
| | | <FullCalendar ref="fullCalendar" :options="calendarOptions" /> |
| | | </el-row> |
| | | </div> |
| | | </div> |
| | |
| | | import moment from 'moment' |
| | | |
| | | const lineChartData = { |
| | | newVisitis: { |
| | | expectedData: [100, 120, 161, 134, 105, 160, 165], |
| | | actualData: [120, 82, 91, 154, 162, 140, 145] |
| | | }, |
| | | messages: { |
| | | expectedData: [200, 192, 120, 144, 160, 130, 140], |
| | | actualData: [180, 160, 151, 106, 145, 150, 130] |
| | | }, |
| | | purchases: { |
| | | expectedData: [80, 100, 121, 104, 105, 90, 100], |
| | | actualData: [120, 90, 100, 138, 142, 130, 130] |
| | | }, |
| | | shoppings: { |
| | | expectedData: [130, 140, 141, 142, 145, 150, 160], |
| | | actualData: [120, 82, 91, 154, 162, 140, 130] |
| | | } |
| | | // newVisitis: { |
| | | // expectedData: [100, 120, 161, 134, 105, 160, 165], |
| | | // actualData: [120, 82, 91, 154, 162, 140, 145] |
| | | // }, |
| | | // messages: { |
| | | // expectedData: [200, 192, 120, 144, 160, 130, 140], |
| | | // actualData: [180, 160, 151, 106, 145, 150, 130] |
| | | // }, |
| | | // purchases: { |
| | | // expectedData: [80, 100, 121, 104, 105, 90, 100], |
| | | // actualData: [120, 90, 100, 138, 142, 130, 130] |
| | | // }, |
| | | // shoppings: { |
| | | // expectedData: [130, 140, 141, 142, 145, 150, 160], |
| | | // actualData: [120, 82, 91, 154, 162, 140, 130] |
| | | // } |
| | | } |
| | | |
| | | export default { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | lineChartData: lineChartData.newVisitis, |
| | | // lineChartData: lineChartData.newVisitis, |
| | | calendarOptions: { |
| | | // 引入的插件 |
| | | plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin], |
| | |
| | | locale: 'zh-ch', |
| | | firstDay: '1', |
| | | weekNumberCalculation: 'ISO', |
| | | eventCOlor: '#3d8eec', |
| | | eventColor: '#3d8eec', |
| | | timeGridEventMinHeight: '20', |
| | | aspectRatio: '1.5', |
| | | displayEventTime: false, |
| | |
| | | // 获取打卡信息 |
| | | getUserCalendarInfo(month) { |
| | | crudUser.getUserCalendarInfo(month).then(res => { |
| | | console.log('res', res) |
| | | this.calendarOptions.events = res.map(function(obj) { |
| | | obj.start = obj.date |
| | | // obj.start = obj.date |
| | | obj.color = obj.isOk ? 'green' : 'red' |
| | | obj.date1 = obj.date |
| | | // obj.date1 = obj.date |
| | | return obj |
| | | }) |
| | | setTimeout(() => { |
| | | console.log(this.calendarOptions.events) |
| | | }, 1000) |
| | | }).catch(() => { |
| | | this.calendarOptions.events = [] |
| | | }) |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style rel="stylesheet/scss" lang="scss" scoped> |
| | | .dashboard-editor-container { |
| | | padding: 32px; |
| | | background-color: rgb(240, 242, 245); |
| | | position: relative; |
| | | // <style rel="stylesheet/scss" lang="scss" scoped> |
| | | // .dashboard-editor-container { |
| | | // padding: 32px; |
| | | // background-color: rgb(240, 242, 245); |
| | | // position: relative; |
| | | |
| | | .github-corner { |
| | | position: absolute; |
| | | top: 0; |
| | | border: 0; |
| | | right: 0; |
| | | } |
| | | // .github-corner { |
| | | // position: absolute; |
| | | // top: 0; |
| | | // border: 0; |
| | | // right: 0; |
| | | // } |
| | | |
| | | .chart-wrapper { |
| | | background: #fff; |
| | | padding: 16px 16px 0; |
| | | margin-bottom: 32px; |
| | | } |
| | | } |
| | | // .chart-wrapper { |
| | | // background: #fff; |
| | | // padding: 16px 16px 0; |
| | | // margin-bottom: 32px; |
| | | // } |
| | | // } |
| | | |
| | | @media (max-width:1024px) { |
| | | .chart-wrapper { |
| | | padding: 8px; |
| | | } |
| | | } |
| | | </style> |
| | | // @media (max-width:1024px) { |
| | | // .chart-wrapper { |
| | | // padding: 8px; |
| | | // } |
| | | // } |
| | | // </style> |