ReportOverview.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <div class="report-overview">
  3. <el-row :gutter="20" type="flex">
  4. <el-col :span="6">
  5. <div class="overview-yk part-box">
  6. <div class="overview-yk-info">
  7. <h5>应考</h5>
  8. <p>{{ examTotal }}</p>
  9. <p>(单位:科次)</p>
  10. </div>
  11. </div>
  12. </el-col>
  13. <el-col :span="5">
  14. <div class="overview-detail">
  15. <div
  16. class="overview-detail-item part-box"
  17. v-for="(item, index) in progressData"
  18. :key="index"
  19. >
  20. <i :class="['overview-detail-line', `line-${item.color}`]"></i>
  21. <h5>{{ item.name }} (科次)</h5>
  22. <p>{{ item.count }}</p>
  23. </div>
  24. </div>
  25. </el-col>
  26. <el-col :span="13">
  27. <div class="overview-progress overview-chart part-box">
  28. <h3 class="overview-part-title">
  29. <span>考试总体进度</span>
  30. <el-popover
  31. placement="top-start"
  32. popper-class="warning-popover"
  33. width="200"
  34. trigger="hover"
  35. content="批次下的实时考试进度。"
  36. >
  37. <i class="el-icon-question" slot="reference"></i>
  38. </el-popover>
  39. </h3>
  40. <echart-render
  41. :chart-data="progressData"
  42. chart-type="pie"
  43. ></echart-render>
  44. </div>
  45. </el-col>
  46. </el-row>
  47. <div class="overview-distribution overview-chart part-box">
  48. <h3 class="overview-part-title">
  49. <span>考试科次时间分布</span>
  50. <el-popover
  51. placement="top-start"
  52. popper-class="warning-popover"
  53. width="200"
  54. trigger="hover"
  55. content="按时间维度呈现已完成的科次数量分布。"
  56. >
  57. <i class="el-icon-question" slot="reference"></i>
  58. </el-popover>
  59. </h3>
  60. <echart-render
  61. :chart-data="distributionData"
  62. chart-type="lineMark"
  63. ></echart-render>
  64. </div>
  65. </div>
  66. </template>
  67. <script>
  68. import { reportOverviewData } from "@/api/invigilation";
  69. import EchartRender from "../common/EchartRender";
  70. export default {
  71. name: "report-overview",
  72. components: { EchartRender },
  73. props: {
  74. filter: {
  75. type: Object,
  76. default() {
  77. return {};
  78. },
  79. },
  80. },
  81. data() {
  82. return {
  83. examTotal: "0",
  84. progressData: [
  85. {
  86. name: "实考",
  87. count: 0,
  88. color: "blue",
  89. },
  90. {
  91. name: "缺考",
  92. count: 0,
  93. color: "yellow",
  94. },
  95. {
  96. name: "未完成",
  97. count: 0,
  98. color: "cyan",
  99. },
  100. ],
  101. distributionData: [
  102. {
  103. name: "6月1号",
  104. count: 13,
  105. },
  106. ],
  107. };
  108. },
  109. mounted() {
  110. this.getData();
  111. },
  112. methods: {
  113. async getData() {
  114. const datas = {
  115. ...this.filter,
  116. };
  117. const res = await reportOverviewData(datas);
  118. const resData = res.data.data;
  119. this.examTotal = resData.examTotal;
  120. this.progressData = [
  121. {
  122. name: "实考",
  123. count: resData.actualExamTotal,
  124. color: "blue",
  125. },
  126. {
  127. name: "缺考",
  128. count: resData.deficiencyExamTotal,
  129. color: "yellow",
  130. },
  131. {
  132. name: "未完成",
  133. count: resData.completeOffExamTotal,
  134. color: "cyan",
  135. },
  136. ];
  137. this.distributionData = resData.examTotalList.map((item) => {
  138. const days = item.day.split("-");
  139. return {
  140. ...item,
  141. name: `${days[1] * 1}月${days[2] * 1}日`,
  142. };
  143. });
  144. },
  145. },
  146. };
  147. </script>
  148. <style lang="scss" scoped>
  149. .overview-yk {
  150. height: 100%;
  151. min-width: 258px;
  152. min-height: 258px;
  153. position: relative;
  154. .overview-yk-info {
  155. width: 258px;
  156. height: 258px;
  157. position: absolute;
  158. top: 50%;
  159. left: 50%;
  160. margin-left: -129px;
  161. margin-top: -129px;
  162. text-align: center;
  163. background-image: url(../../../assets/bg-liu.png);
  164. background-size: 100% 100%;
  165. background-repeat: no-repeat;
  166. color: #ffffff;
  167. > h5 {
  168. font-size: 16px;
  169. font-weight: 600;
  170. line-height: 22px;
  171. margin-top: 69px;
  172. margin-bottom: 0;
  173. }
  174. > p:nth-of-type(1) {
  175. font-size: 56px;
  176. font-weight: 600;
  177. line-height: 78px;
  178. margin: 0;
  179. }
  180. > p:nth-of-type(2) {
  181. font-size: 12px;
  182. font-weight: 400;
  183. line-height: 17px;
  184. }
  185. }
  186. }
  187. .overview-detail-item {
  188. position: relative;
  189. padding-bottom: 16px;
  190. &:last-child {
  191. margin-bottom: 0;
  192. }
  193. > h5 {
  194. font-size: 14px;
  195. font-weight: 400;
  196. color: #626a82;
  197. line-height: 21px;
  198. margin: 0;
  199. }
  200. > p {
  201. font-size: 32px;
  202. font-weight: 600;
  203. color: #202b4b;
  204. line-height: 45px;
  205. margin: 0;
  206. }
  207. }
  208. .overview-detail-line {
  209. position: absolute;
  210. width: 41px;
  211. height: 13px;
  212. top: 50%;
  213. right: 20px;
  214. margin-top: -7px;
  215. z-index: auto;
  216. background-size: 100% 100%;
  217. &.line-blue {
  218. background-image: url(../../../assets/bg-line-blue.png);
  219. }
  220. &.line-yellow {
  221. background-image: url(../../../assets/bg-line-yellow.png);
  222. }
  223. &.line-cyan {
  224. background-image: url(../../../assets/bg-line-cyan.png);
  225. }
  226. }
  227. .overview-part-title {
  228. font-size: 16px;
  229. font-weight: 500;
  230. color: #202b4b;
  231. line-height: 22px;
  232. z-index: 9;
  233. }
  234. .overview-progress {
  235. height: 346px;
  236. margin-bottom: 0;
  237. }
  238. .overview-distribution {
  239. margin-top: 20px;
  240. height: 326px;
  241. }
  242. .overview-chart {
  243. position: relative;
  244. padding-bottom: 5px;
  245. .overview-part-title {
  246. position: absolute;
  247. top: 20px;
  248. }
  249. }
  250. </style>