index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <div class="dashboard-editor-container">
  3. <!--每一列间隔32项目-->
  4. <el-row :gutter="32">
  5. <!--屏幕尺寸不够的时候自己沾满一行-->
  6. <el-col :xs="24" :sm="24" :lg="8">
  7. <div class="topWindowBox">
  8. <div class="twbTitle">
  9. <div class="twbIconbgRed"></div>网站数量
  10. </div>
  11. <div class="twbNumber">1,000</div>
  12. <div class="twbStatus"><img src="@/assets/index/arrow-up.png"/> +12% <span>较上周</span></div>
  13. </div>
  14. </el-col>
  15. <el-col :xs="24" :sm="24" :lg="8">
  16. <div class="topWindowBox">
  17. <div class="twbTitle">
  18. <div class="twbIconbgBlue"></div>内容发布数量
  19. </div>
  20. <div class="twbNumber">68,888</div>
  21. <div class="twbStatus"><img src="@/assets/index/arrow-up.png"/> +18% <span>较昨天</span></div>
  22. </div>
  23. </el-col>
  24. <el-col :xs="24" :sm="24" :lg="8">
  25. <div class="topWindowBox">
  26. <div class="twbTitle">
  27. <div class="twbIconbgPurple"></div>公共栏目数量
  28. </div>
  29. <div class="twbNumber">24</div>
  30. <div class="twbStatusDown"><img src="@/assets/index/arrow-down.png"/> -2% <span>较上个月</span></div>
  31. </div>
  32. </el-col>
  33. </el-row>
  34. <el-row :gutter="32">
  35. <el-col :xs="24" :sm="24" :lg="16">
  36. <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
  37. <line-chart :chart-data="lineChartData" />
  38. </el-row>
  39. </el-col>
  40. <el-col :xs="24" :sm="24" :lg="8">
  41. <div class="chart-wrapper">
  42. <pie-chart />
  43. </div>
  44. </el-col>
  45. </el-row>
  46. </div>
  47. </template>
  48. <script>
  49. import GithubCorner from '@/components/GithubCorner'
  50. import PanelGroup from './components/PanelGroup'
  51. import LineChart from './components/LineChart'
  52. import RaddarChart from './components/RaddarChart'
  53. import PieChart from './components/PieChart'
  54. import BarChart from './components/BarChart'
  55. import TransactionTable from './components/TransactionTable'
  56. import TodoList from './components/TodoList'
  57. import BoxCard from './components/BoxCard'
  58. const lineChartData = {
  59. newVisitis: {
  60. expectedData: [100, 120, 161, 134, 105, 160, 165],
  61. actualData: [120, 82, 91, 154, 162, 140, 145]
  62. },
  63. messages: {
  64. expectedData: [200, 192, 120, 144, 160, 130, 140],
  65. actualData: [180, 160, 151, 106, 145, 150, 130]
  66. },
  67. purchases: {
  68. expectedData: [80, 100, 121, 104, 105, 90, 100],
  69. actualData: [120, 90, 100, 138, 142, 130, 130]
  70. },
  71. shoppings: {
  72. expectedData: [130, 140, 141, 142, 145, 150, 160],
  73. actualData: [120, 82, 91, 154, 162, 140, 130]
  74. }
  75. }
  76. export default {
  77. name: 'DashboardAdmin',
  78. components: {
  79. GithubCorner,
  80. PanelGroup,
  81. LineChart,
  82. RaddarChart,
  83. PieChart,
  84. BarChart,
  85. TransactionTable,
  86. TodoList,
  87. BoxCard
  88. },
  89. data() {
  90. return {
  91. lineChartData: lineChartData.newVisitis
  92. }
  93. },
  94. methods: {
  95. handleSetLineChartData(type) {
  96. this.lineChartData = lineChartData[type]
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="less" scoped>
  102. .topWindowBox{
  103. background:#FFFFFF;
  104. border-Radius:20px;
  105. height:200px;
  106. width:100%;
  107. margin-bottom:30px;
  108. padding:25px;
  109. box-sizing: border-box;
  110. .twbTitle {
  111. display:flex;
  112. align-items: center;
  113. font-size:16px;
  114. color:#212227;
  115. .twbIconbgRed,.twbIconbgBlue,.twbIconbgPurple{
  116. width: 40px;
  117. height: 40px;
  118. border-radius: 50%;
  119. margin-right: 15px;
  120. }
  121. .twbIconbgRed {
  122. background: #EA79BA;
  123. }
  124. .twbIconbgBlue {
  125. background: #6DACE7;
  126. }
  127. .twbIconbgPurple{
  128. background: #AA7AEB;
  129. }
  130. }
  131. .twbNumber {
  132. font-size: 30px;
  133. margin-top:32px;
  134. font-weight: 1000;
  135. }
  136. .twbStatus,.twbStatusDown {
  137. font-size:14px;
  138. margin-top: 35px;
  139. display:flex;
  140. img {
  141. display: block;
  142. margin-right: 4px;
  143. }
  144. span {
  145. color:#707B81;
  146. margin-left: 8px;
  147. }
  148. }
  149. .twbStatus {
  150. color:#23C581;
  151. }
  152. .twbStatusDown {
  153. color:#E74545
  154. }
  155. }
  156. .dashboard-editor-container {
  157. padding: 32px;
  158. background-color: rgb(240, 242, 245);
  159. position: relative;
  160. .github-corner {
  161. position: absolute;
  162. top: 0px;
  163. border: 0;
  164. right: 0;
  165. }
  166. .chart-wrapper {
  167. background: #fff;
  168. padding: 16px 16px 0;
  169. margin-bottom: 32px;
  170. }
  171. }
  172. @media (max-width:1024px) {
  173. .chart-wrapper {
  174. padding: 8px;
  175. }
  176. }
  177. </style>