0c69173b6ffd83c53a6d14a89b72d6399e0df9fb.svn-base 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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-row>
  24. <el-row :gutter="8">
  25. <el-col :xs="{span: 24}" :sm="{span: 24}" :md="{span: 24}" :lg="{span: 12}" :xl="{span: 12}" style="padding-right:8px;margin-bottom:30px;">
  26. <transaction-table />
  27. </el-col>
  28. <el-col :xs="{span: 24}" :sm="{span: 12}" :md="{span: 12}" :lg="{span: 6}" :xl="{span: 6}" style="margin-bottom:30px;">
  29. <todo-list />
  30. </el-col>
  31. <el-col :xs="{span: 24}" :sm="{span: 12}" :md="{span: 12}" :lg="{span: 6}" :xl="{span: 6}" style="margin-bottom:30px;">
  32. <box-card />
  33. </el-col>
  34. </el-row>
  35. </div>
  36. </template>
  37. <script>
  38. import PanelGroup from './components/PanelGroup'
  39. import LineChart from './components/LineChart'
  40. import RaddarChart from './components/RaddarChart'
  41. import PieChart from './components/PieChart'
  42. import BarChart from './components/BarChart'
  43. import TransactionTable from './components/TransactionTable'
  44. import TodoList from './components/TodoList'
  45. import BoxCard from './components/BoxCard'
  46. const lineChartData = {
  47. newVisitis: {
  48. expectedData: [100, 120, 161, 134, 105, 160, 165],
  49. actualData: [120, 82, 91, 154, 162, 140, 145]
  50. },
  51. messages: {
  52. expectedData: [200, 192, 120, 144, 160, 130, 140],
  53. actualData: [180, 160, 151, 106, 145, 150, 130]
  54. },
  55. purchases: {
  56. expectedData: [80, 100, 121, 104, 105, 90, 100],
  57. actualData: [120, 90, 100, 138, 142, 130, 130]
  58. },
  59. shoppings: {
  60. expectedData: [130, 140, 141, 142, 145, 150, 160],
  61. actualData: [120, 82, 91, 154, 162, 140, 130]
  62. }
  63. }
  64. export default {
  65. name: 'DashboardAdmin',
  66. components: {
  67. PanelGroup,
  68. LineChart,
  69. RaddarChart,
  70. PieChart,
  71. BarChart,
  72. TransactionTable,
  73. TodoList,
  74. BoxCard
  75. },
  76. data() {
  77. return {
  78. lineChartData: lineChartData.newVisitis
  79. }
  80. },
  81. methods: {
  82. handleSetLineChartData(type) {
  83. this.lineChartData = lineChartData[type]
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .dashboard-editor-container {
  90. padding: 32px;
  91. background-color: rgb(240, 242, 245);
  92. position: relative;
  93. .github-corner {
  94. position: absolute;
  95. top: 0px;
  96. border: 0;
  97. right: 0;
  98. }
  99. .chart-wrapper {
  100. background: #fff;
  101. padding: 16px 16px 0;
  102. margin-bottom: 32px;
  103. }
  104. }
  105. @media (max-width:1024px) {
  106. .chart-wrapper {
  107. padding: 8px;
  108. }
  109. }
  110. </style>