ReportOverview.vue 5.5 KB

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