index_v1.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div class="dashboard-editor-container">
  3. <panel-group @handleSetLineChartData="handleSetLineChartData" />
  4. <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
  5. <line-chart :chart-data="lineChartData" />
  6. </el-row>
  7. <el-row :gutter="32">
  8. <el-col :xs="24" :sm="24" :lg="8">
  9. <div class="chart-wrapper">
  10. <raddar-chart />
  11. </div>
  12. </el-col>
  13. <el-col :xs="24" :sm="24" :lg="8">
  14. <div class="chart-wrapper">
  15. <pie-chart />
  16. </div>
  17. </el-col>
  18. <el-col :xs="24" :sm="24" :lg="8">
  19. <div class="chart-wrapper">
  20. <bar-chart />
  21. </div>
  22. </el-col>
  23. <el-col :xs="24" :sm="24" :lg="8">
  24. <div class="chart-wrapper">
  25. <messageManager />
  26. </div>
  27. </el-col>1
  28. </el-row>
  29. </div>
  30. </template>
  31. <script>
  32. import PanelGroup from './dashboard/PanelGroup'
  33. import LineChart from './dashboard/LineChart'
  34. import RaddarChart from './dashboard/RaddarChart'
  35. import PieChart from './dashboard/PieChart'
  36. import BarChart from './dashboard/BarChart'
  37. import messageManager from './dashboard/messageManager'
  38. const lineChartData = {
  39. newVisitis: {
  40. expectedData: [100, 120, 161, 134, 105, 160, 165],
  41. actualData: [120, 82, 91, 154, 162, 140, 145]
  42. },
  43. messages: {
  44. expectedData: [200, 192, 120, 144, 160, 130, 140],
  45. actualData: [180, 160, 151, 106, 145, 150, 130]
  46. },
  47. purchases: {
  48. expectedData: [80, 100, 121, 104, 105, 90, 100],
  49. actualData: [120, 90, 100, 138, 142, 130, 130]
  50. },
  51. shoppings: {
  52. expectedData: [130, 140, 141, 142, 145, 150, 160],
  53. actualData: [120, 82, 91, 154, 162, 140, 130]
  54. }
  55. }
  56. export default {
  57. name: 'Index',
  58. components: {
  59. PanelGroup,
  60. LineChart,
  61. RaddarChart,
  62. PieChart,
  63. BarChart,
  64. messageManager
  65. },
  66. data() {
  67. return {
  68. lineChartData: lineChartData.newVisitis
  69. }
  70. },
  71. methods: {
  72. handleSetLineChartData(type) {
  73. this.lineChartData = lineChartData[type]
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .dashboard-editor-container {
  80. padding: 32px;
  81. background-color: rgb(240, 242, 245);
  82. position: relative;
  83. .chart-wrapper {
  84. background: #fff;
  85. padding: 16px 16px 0;
  86. margin-bottom: 32px;
  87. }
  88. }
  89. @media (max-width:1024px) {
  90. .chart-wrapper {
  91. padding: 8px;
  92. }
  93. }
  94. </style>