Rap 原分销系统代码Web
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

108 行
2.5KB

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