index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <div class="center">
  3. <div class="up">
  4. <div
  5. class="bg-color-black item"
  6. v-for="item in titleItem"
  7. :key="item.title"
  8. >
  9. <p class="ml-3 colorBlue fw-b">{{ item.title }}</p>
  10. <div>
  11. <dv-digital-flop class="dv-dig-flop ml-1 mt-1 pl-3" :config="item.config" />
  12. </div>
  13. </div>
  14. </div>
  15. <div class="down">
  16. <div class="ranking bg-color-black">
  17. <span>
  18. <i class="iconfont icon-tongji2"></i>
  19. </span>
  20. <span class="fs-xl text mx-2 mb-1">年度负责人组件达标榜</span>
  21. <dv-scroll-ranking-board class="dv-scr-rank-board" :config="ranking" />
  22. </div>
  23. <div class="percent">
  24. <div class="item bg-color-black">
  25. <span>今日任务通过率</span>
  26. <chart
  27. :tips="rate[0].tips"
  28. :colorObj="rate[0].colorData"
  29. />
  30. </div>
  31. <div class="item bg-color-black">
  32. <span>今日任务达标率</span>
  33. <chart
  34. :tips="rate[1].tips"
  35. :colorObj="rate[1].colorData"
  36. />
  37. </div>
  38. <div class="water">
  39. <dv-water-level-pond class="dv-wa-le-po" :config="water" />
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </template>
  45. <script>
  46. import { defineComponent, reactive, onMounted } from 'vue'
  47. import Chart from '../center/chart/draw'
  48. export default defineComponent({
  49. components: {
  50. Chart
  51. },
  52. setup() {
  53. // 下层数据
  54. const titleDate = [
  55. {
  56. number: 1020,
  57. text: '今年累计任务建次数'
  58. },
  59. {
  60. number: 18,
  61. text: '本月累计任务次数'
  62. },
  63. {
  64. number: 4,
  65. text: '今日累计任务次数'
  66. },
  67. {
  68. number: 71,
  69. text: '今年失败任务次数'
  70. },
  71. {
  72. number: 949,
  73. text: '今年失败成功次数'
  74. },
  75. {
  76. number: 811,
  77. text: '今年达标任务个数'
  78. },
  79. ]
  80. const titleItem = reactive([])
  81. // 初始化数据
  82. onMounted(() => {
  83. setData()
  84. })
  85. const ranking = reactive({
  86. data: [
  87. {
  88. name: '周口',
  89. value: 55
  90. },
  91. {
  92. name: '南阳',
  93. value: 120
  94. },
  95. {
  96. name: '西峡',
  97. value: 78
  98. },
  99. {
  100. name: '驻马店',
  101. value: 66
  102. },
  103. {
  104. name: '新乡',
  105. value: 80
  106. },
  107. {
  108. name: '新乡2',
  109. value: 80
  110. },
  111. {
  112. name: '新乡3',
  113. value: 80
  114. },
  115. {
  116. name: '新乡4',
  117. value: 80
  118. },
  119. {
  120. name: '新乡5',
  121. value: 80
  122. },
  123. {
  124. name: '新乡6',
  125. value: 80
  126. }
  127. ],
  128. carousel: 'single',
  129. unit: '人'
  130. })
  131. const water = reactive({
  132. data: [24, 45],
  133. shape: 'roundRect',
  134. formatter: '{value}%',
  135. waveNum: 3
  136. })
  137. const rate = reactive([
  138. {
  139. id: 'centerRate1',
  140. tips: 60,
  141. colorData: {
  142. textStyle: '#3fc0fb',
  143. series: {
  144. color: ['#00bcd44a', 'transparent'],
  145. dataColor: {
  146. normal: '#03a9f4',
  147. shadowColor: '#97e2f5'
  148. }
  149. }
  150. }
  151. },
  152. {
  153. id: 'centerRate2',
  154. tips: 40,
  155. colorData: {
  156. textStyle: '#67e0e3',
  157. series: {
  158. color: ['#faf3a378', 'transparent'],
  159. dataColor: {
  160. normal: '#ff9800',
  161. shadowColor: '#fcebad'
  162. }
  163. }
  164. }
  165. }
  166. ])
  167. // 设置数据
  168. const setData = () => {
  169. titleDate.map(e => {
  170. titleItem.push({
  171. title: e.text,
  172. config: {
  173. number: [e.number],
  174. toFixed: 1,
  175. textAlign: 'left',
  176. content: '{nt}',
  177. style: {
  178. fontSize: 26
  179. }
  180. }
  181. })
  182. })
  183. }
  184. return {
  185. titleItem,
  186. ranking,
  187. water,
  188. rate
  189. }
  190. }
  191. })
  192. </script>
  193. <style lang="scss" scoped>
  194. .center {
  195. display: flex;
  196. flex-direction: column;
  197. .up {
  198. width: 100%;
  199. display: flex;
  200. flex-wrap: wrap;
  201. justify-content: space-around;
  202. .item {
  203. border-radius: 6px;
  204. padding-top: 8px;
  205. margin-top: 8px;
  206. width: 32%;
  207. height: 70px;
  208. .dv-dig-flop {
  209. width: 150px;
  210. height: 30px;
  211. }
  212. }
  213. }
  214. .down {
  215. padding: 6px 4px;
  216. padding-bottom: 0;
  217. width: 100%;
  218. display: flex;
  219. height: 255px;
  220. justify-content: space-between;
  221. .bg-color-black {
  222. border-radius: 5px;
  223. }
  224. .ranking {
  225. padding: 10px;
  226. width: 59%;
  227. .dv-scr-rank-board {
  228. height: 220px;
  229. }
  230. }
  231. .percent {
  232. width: 40%;
  233. display: flex;
  234. flex-wrap: wrap;
  235. .item {
  236. width: 50%;
  237. height: 120px;
  238. span {
  239. margin-top: 8px;
  240. font-size: 14px;
  241. display: flex;
  242. justify-content: center;
  243. }
  244. }
  245. .water {
  246. width: 100%;
  247. .dv-wa-le-po {
  248. height: 120px;
  249. }
  250. }
  251. }
  252. }
  253. }
  254. </style>