index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <div>
  3. <panel-group />
  4. <el-row :gutter="20">
  5. <el-col :span="10">
  6. <div class="chart__wrap">
  7. <echart :options="pieEchatOptions" :height="'300px'" />
  8. </div>
  9. </el-col>
  10. <el-col :span="14">
  11. <div class="chart__wrap">
  12. <echart :options="barEchatOptions" :height="'300px'" />
  13. </div>
  14. </el-col>
  15. </el-row>
  16. <div class="chart__wrap">
  17. <echart :options="lineEchatOptions" :height="'300px'" />
  18. </div>
  19. <panel-group />
  20. <el-row :gutter="20">
  21. <el-col :span="10">
  22. <div class="chart__wrap">
  23. <echart :options="pieEchatOptions" :height="'300px'" />
  24. </div>
  25. </el-col>
  26. <el-col :span="14">
  27. <div class="chart__wrap">
  28. <echart :options="barEchatOptions" :height="'300px'" />
  29. </div>
  30. </el-col>
  31. </el-row>
  32. <div class="chart__wrap">
  33. <echart :options="lineEchatOptions" :height="'300px'" />
  34. </div>
  35. <panel-group />
  36. <el-row :gutter="20">
  37. <el-col :span="10">
  38. <div class="chart__wrap">
  39. <echart :options="pieEchatOptions" :height="'300px'" />
  40. </div>
  41. </el-col>
  42. <el-col :span="14">
  43. <div class="chart__wrap">
  44. <echart :options="barEchatOptions" :height="'300px'" />
  45. </div>
  46. </el-col>
  47. </el-row>
  48. <div class="chart__wrap">
  49. <echart :options="lineEchatOptions" :height="'300px'" />
  50. </div>
  51. <panel-group />
  52. <el-row :gutter="20">
  53. <el-col :span="10">
  54. <div class="chart__wrap">
  55. <echart :options="pieEchatOptions" :height="'300px'" />
  56. </div>
  57. </el-col>
  58. <el-col :span="14">
  59. <div class="chart__wrap">
  60. <echart :options="barEchatOptions" :height="'300px'" />
  61. </div>
  62. </el-col>
  63. </el-row>
  64. <div class="chart__wrap">
  65. <echart :options="lineEchatOptions" :height="'300px'" />
  66. </div>
  67. <panel-group />
  68. <el-row :gutter="20">
  69. <el-col :span="10">
  70. <div class="chart__wrap">
  71. <echart :options="pieEchatOptions" :height="'300px'" />
  72. </div>
  73. </el-col>
  74. <el-col :span="14">
  75. <div class="chart__wrap">
  76. <echart :options="barEchatOptions" :height="'300px'" />
  77. </div>
  78. </el-col>
  79. </el-row>
  80. <div class="chart__wrap">
  81. <echart :options="lineEchatOptions" :height="'300px'" />
  82. </div>
  83. </div>
  84. </template>
  85. <script lang="ts">
  86. import { defineComponent, reactive } from 'vue'
  87. import Echart from '_c/Echart/index.vue'
  88. import PanelGroup from './components/PanelGroup.vue'
  89. import { lineOptions, pieOptions, barOptions } from './echart-data'
  90. import type { EChartOption } from 'echarts'
  91. export default defineComponent({
  92. name: 'Dashboard',
  93. components: {
  94. Echart,
  95. PanelGroup
  96. },
  97. setup() {
  98. const lineEchatOptions = reactive<EChartOption>(lineOptions)
  99. const pieEchatOptions = reactive<EChartOption>(pieOptions)
  100. const barEchatOptions = reactive<EChartOption>(barOptions)
  101. return {
  102. lineEchatOptions,
  103. pieEchatOptions,
  104. barEchatOptions
  105. }
  106. }
  107. })
  108. </script>
  109. <style lang="less" scoped>
  110. .chart__wrap {
  111. margin-bottom: 20px;
  112. border-radius: 5px;
  113. background-color: @contentBg;
  114. padding: 10px;
  115. }
  116. </style>