examReport.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. <template>
  2. <view class="page-view">
  3. <top-return color="#FFF"></top-return>
  4. <!-- 背景 -->
  5. <view class="bg1"></view>
  6. <view class="flex-row">
  7. <view class="flex-column" style="margin: 120rpx 0 0 50rpx;">
  8. <view class="report-title">评测</view>
  9. <view class="report-title">分析报告</view>
  10. <view class="report-subtitle">{{examData[index].examInfo.name}}</view>
  11. </view>
  12. <view class="detail-image1" :style="{backgroundImage:`url(${image1})`}"></view>
  13. <view class="detail-image2" :style="{backgroundImage:`url(${image2})`}"></view>
  14. </view>
  15. <view class="card-view">
  16. <view class="card-item">
  17. <view class="card-box">
  18. <view class="card-image" :style="{backgroundImage:`url(${image3})`}"></view>
  19. <view class="flex-column">
  20. <view class="title">成绩总分:</view>
  21. <view class="flex-row">
  22. <view class="YS-title">{{reportData.totalScore}}</view>
  23. <view class="title" style="margin: 12rpx 0 0 4rpx;">分</view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="card-data">
  28. <view class="flex-column" v-for="(item,i) in reportData.gradeData" :key="i">
  29. <view class="YS-title">{{item.subject}}</view>
  30. <view class="flex-baseline">
  31. <view class="title">{{item.grade}}</view>
  32. <view class="subtitle">/{{item.score}}</view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="card-item">
  38. <view class="title-box">
  39. <view class="title-tag"></view>
  40. <view class="title">成绩对比</view>
  41. <view class="subsection">
  42. <u-subsection :list="contrastList" :current="contrastCurrent" @change="changeContrast"
  43. activeColor="#FFF">
  44. </u-subsection>
  45. </view>
  46. </view>
  47. <view class="table-container">
  48. <uni-table :loading="tableLoading">
  49. <!-- 表头行 -->
  50. <uni-tr>
  51. <uni-th width="40" align="center">科目</uni-th>
  52. <uni-th width="25" align="center">分数</uni-th>
  53. <!-- <uni-th>名次</uni-th> -->
  54. <uni-th width="25" align="center">平均分</uni-th>
  55. <uni-th width="25" align="center">最高分</uni-th>
  56. <uni-th width="25" align="center">差距分</uni-th>
  57. </uni-tr>
  58. <uni-tr v-for="(item,index) in reportData.tableData" :key="index">
  59. <uni-td width="40" align="center">
  60. <view class="title">{{item.subject}}</view>
  61. </uni-td>
  62. <uni-td width="25" align="center">
  63. <view class="YS-title" :style="{color: item.grade > item.average ?'#23b46c':'#ff5959'}">
  64. {{item.grade}}
  65. </view>
  66. </uni-td>
  67. <uni-td width="25" align="center">
  68. <view class="YS-title" style="color: #909399;">{{item.average}}</view>
  69. </uni-td>
  70. <uni-td width="25" align="center">
  71. <view class="YS-title" style="color: #ff8caf;">{{item.top}}</view>
  72. </uni-td>
  73. <uni-td width="25" align="center">
  74. <view class="YS-title" :style="{color: item.gap === 0 ?'#23b46c':'#f9c752'}">
  75. {{item.gap}}
  76. </view>
  77. </uni-td>
  78. </uni-tr>
  79. </uni-table>
  80. </view>
  81. <view class="msg-box">
  82. <view class="flex-baseline">
  83. <view class="subtitle">班级</view>
  84. <view class="title">{{reportData.classNum}}</view>
  85. <view class="subtitle">人</view>
  86. </view>
  87. <view class="flex-baseline">
  88. <view class="subtitle">年级</view>
  89. <view class="title">{{reportData.gradeNum}}</view>
  90. <view class="subtitle">人</view>
  91. </view>
  92. <view class="flex-baseline">
  93. <view class="subtitle">联考</view>
  94. <view class="title">{{reportData.areaNum}}</view>
  95. <view class="subtitle">人</view>
  96. </view>
  97. </view>
  98. </view>
  99. <view class="card-item">
  100. <view class="title-box">
  101. <view class="title-tag"></view>
  102. <view class="title">成绩分布</view>
  103. <view class="subsection">
  104. <u-subsection :list="distributionList" :current="distributionCurrent"
  105. @change="changeDistribution" activeColor="#FFF">
  106. </u-subsection>
  107. </view>
  108. </view>
  109. <view class="chart-box" style="height: 420rpx;">
  110. <qiun-data-charts type="column" ontouch="true" :chartData="reportData.distributionChartData"
  111. tooltipFormat="distributionColumn"
  112. :opts="{legend:{show:false},padding:[20, 20, 20, 10],yAxis:{gridType: 'dash',dashLength: 10},extra:{column:{barBorderCircle: false ,barBorderRadius: [6,6,0,0]}}}" />
  113. </view>
  114. <view class="distribution-box">
  115. <view class="segment-data">
  116. <view class="text">孩子分段数</view>
  117. <view class="text">{{reportData.distributionNum}}分</view>
  118. </view>
  119. <view class="sutdent-data">
  120. <view class="data-item">
  121. <view class="title-box">
  122. <view class="title">班级学生数</view>
  123. </view>
  124. <view class="YS-title">{{reportData.distributionData[0]}}人</view>
  125. </view>
  126. <view class="data-item">
  127. <view class="title-box">
  128. <view class="title">年级学生数</view>
  129. </view>
  130. <view class="YS-title">{{reportData.distributionData[1]}}人</view>
  131. </view>
  132. <view class="data-item">
  133. <view class="title-box">
  134. <view class="title">联考学生数</view>
  135. </view>
  136. <view class="YS-title">{{reportData.distributionData[2]}}人</view>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. <view class="card-item">
  142. <view class="title-box">
  143. <view class="title-tag"></view>
  144. <view class="title">科目优劣</view>
  145. <view class="subsection">
  146. <u-subsection :list="meritsList" :current="meritsCurrent" @change="changeMerits"
  147. activeColor="#FFF">
  148. </u-subsection>
  149. </view>
  150. </view>
  151. <view class="chart-box">
  152. <qiun-data-charts type="radar" ontouch="true" :chartData="reportData.advantageChartData" tooltipFormat="meritsRadar"/>
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. </template>
  158. <script>
  159. import {
  160. mapState
  161. } from 'vuex'
  162. export default {
  163. computed: {
  164. ...mapState('m_children', ['examData'])
  165. },
  166. data() {
  167. return {
  168. index: '',
  169. reportData: {
  170. totalScore: 525,
  171. gradeData: [{
  172. subject: '语文',
  173. grade: 82,
  174. score: 100,
  175. }, {
  176. subject: '数学',
  177. grade: 94,
  178. score: 100,
  179. }, {
  180. subject: '英语',
  181. grade: 84,
  182. score: 100,
  183. }, {
  184. subject: '科学',
  185. grade: 78,
  186. score: 100,
  187. }, {
  188. subject: '思品',
  189. grade: 95,
  190. score: 100,
  191. }, {
  192. subject: '体育',
  193. grade: 92,
  194. score: 100,
  195. }],
  196. tableData: [{
  197. subject: '总分',
  198. grade: 525,
  199. average: 499,
  200. top: 521,
  201. gap: 38
  202. },
  203. {
  204. subject: '语文',
  205. grade: 83,
  206. average: 80,
  207. top: 92,
  208. gap: 9
  209. },
  210. {
  211. subject: '数学',
  212. grade: 93,
  213. average: 84,
  214. top: 99,
  215. gap: 6
  216. },
  217. {
  218. subject: '外语',
  219. grade: 92,
  220. average: 87,
  221. top: 96,
  222. gap: 4
  223. },
  224. {
  225. subject: '思品',
  226. grade: 80,
  227. average: 83,
  228. top: 92,
  229. gap: 3
  230. },
  231. {
  232. subject: '体育',
  233. grade: 99,
  234. average: 87,
  235. top: 99,
  236. gap: 0
  237. },
  238. {
  239. subject: '科学',
  240. grade: 93,
  241. average: 89,
  242. top: 96,
  243. gap: 3
  244. }
  245. ],
  246. classNum: 55,
  247. gradeNum: 1200,
  248. areaNum: 16000,
  249. distributionChartData: {
  250. "categories": ["0-100", "100-200", "200-300", "300-400", "400-500", "500-600", "600-700"],
  251. "series": [{
  252. "name": "年级学生数",
  253. "data": [7, 15, 72, 252, 333, 243, 18]
  254. },
  255. {
  256. "name": "班级学生数",
  257. "data": [1, 5, 12, 23, 22, 7, 1]
  258. }
  259. ]
  260. },
  261. distributionNum: "500-600",
  262. distributionData: [12, 130, 333],
  263. advantageChartData: {
  264. "categories": ["语文", "数学", "英语", "思品", "科学", "体育"],
  265. "series": [{
  266. "name": "个人得分率",
  267. "data": [90, 75, 85, 78, 82, 92]
  268. },
  269. {
  270. "name": "平均得分率",
  271. "data": [88, 67, 90, 82, 75, 81]
  272. },
  273. {
  274. "name": "最高得分率",
  275. "data": [96, 92, 94, 91, 89, 90]
  276. }
  277. ]
  278. }
  279. },
  280. contrastList: ['班级', '年级', '联考'],
  281. contrastCurrent: 0,
  282. distributionList: ['校级', '联考'],
  283. distributionCurrent: 0,
  284. meritsList: ['班级', '年级', '联考'],
  285. meritsCurrent: 0,
  286. tableLoading: false,
  287. image1: 'https://ouch-cdn2.icons8.com/PvGwCISfYx-NAQwl4UsdY2QXtMMiNDB6LllqLZ4jGoA/rs:fit:367:456/czM6Ly9pY29uczgu/b3VjaC1wcm9kLmFz/c2V0cy9wbmcvNzg1/LzhiM2MwZWU2LWFl/ODMtNDM2Mi05MGQy/LTBmMDk0N2M4N2E1/OC5wbmc.png',
  288. image2: 'https://ouch-cdn2.icons8.com/I-PEjM-V1LXrgVE1_yaPi7LY2XrgFXgKmEvBD3r1h_Y/rs:fit:484:456/czM6Ly9pY29uczgu/b3VjaC1wcm9kLmFz/c2V0cy9wbmcvMzcy/LzA0ZDY3Y2NlLTM3/YTUtNGE3OC1iZTVi/LTY4MzgyYTQ2YmUz/Zi5wbmc.png',
  289. image3: 'https://cdn-icons-png.flaticon.com/512/4524/4524486.png',
  290. };
  291. },
  292. onLoad(param) {
  293. this.index = param.index
  294. },
  295. methods: {
  296. changeContrast(e) {
  297. this.contrastCurrent = e
  298. },
  299. changeDistribution(e) {
  300. this.distributionCurrent = e
  301. },
  302. changeMerits(e) {
  303. this.meritsCurrent = e
  304. }
  305. },
  306. }
  307. </script>
  308. <style lang="scss">
  309. @import 'data_pages.scss';
  310. @import 'top_info.scss';
  311. .bg1 {
  312. position: fixed;
  313. width: 100%;
  314. height: 800rpx;
  315. background-size: 100%;
  316. background-repeat: no-repeat;
  317. background-image: linear-gradient(to top, #f3f4f9, #ff8caf);
  318. }
  319. .detail-image1 {
  320. position: absolute;
  321. top: 150rpx;
  322. left: 580rpx;
  323. width: 300rpx;
  324. height: 350rpx;
  325. background-size: 100%;
  326. background-repeat: no-repeat;
  327. z-index: 51;
  328. }
  329. .detail-image2 {
  330. position: absolute;
  331. top: 200rpx;
  332. left: 380rpx;
  333. width: 300rpx;
  334. height: 350rpx;
  335. background-size: 100%;
  336. background-repeat: no-repeat;
  337. z-index: 50;
  338. }
  339. .card-item {
  340. width: 100%;
  341. .card-box {
  342. display: flex;
  343. padding: 20rpx 30rpx;
  344. justify-content: space-around;
  345. height: 180rpx;
  346. border-radius: $border-radius;
  347. background-color: #ff8caf;
  348. opacity: 0.8;
  349. .flex-column {
  350. height: 100%;
  351. justify-content: space-around;
  352. .title {
  353. color: #FFF;
  354. font-size: 38rpx;
  355. font-weight: 400;
  356. }
  357. .YS-title {
  358. font-size: 80rpx;
  359. color: #FFF;
  360. }
  361. }
  362. .card-image {
  363. position: relative;
  364. top: -20rpx;
  365. height: 220rpx;
  366. width: 220rpx;
  367. background-size: cover;
  368. background-repeat: no-repeat;
  369. z-index: 2;
  370. }
  371. }
  372. .card-data {
  373. padding: 20rpx;
  374. display: flex;
  375. flex-flow: row wrap;
  376. justify-content: space-between;
  377. .flex-column {
  378. justify-content: space-around;
  379. height: 120rpx;
  380. margin: 20rpx 40rpx;
  381. .title {
  382. font-size: 40rpx;
  383. }
  384. .subtitle {
  385. font-weight: 400;
  386. }
  387. .YS-title {
  388. font-size: 40rpx;
  389. }
  390. }
  391. }
  392. .title-box {
  393. display: flex;
  394. align-items: center;
  395. padding: 20rpx 0;
  396. .title-tag {
  397. margin-left: -10rpx;
  398. margin-right: 20rpx;
  399. height: 100%;
  400. width: 20rpx;
  401. border-radius: 100rpx;
  402. background-color: #ff8caf;
  403. z-index: 99;
  404. }
  405. .title {
  406. font-size: 35rpx;
  407. line-height: 50rpx;
  408. }
  409. .subsection {
  410. width: 300rpx;
  411. height: 100%;
  412. margin: 0 30rpx 0 auto;
  413. .u-subsection--button__bar {
  414. background-color: #ff8caf !important;
  415. }
  416. }
  417. }
  418. .table-container {
  419. margin-bottom: 20rpx;
  420. .title {
  421. line-height: 30rpx;
  422. font-size: 30rpx;
  423. color: $title;
  424. }
  425. }
  426. .msg-box {
  427. margin: 0 20rpx 40rpx 20rpx;
  428. padding: 20rpx;
  429. display: flex;
  430. border-radius: $border-radius;
  431. justify-content: space-around;
  432. background-color: #f3f4f9;
  433. .title {
  434. color: #ff8caf;
  435. margin: 0 6rpx;
  436. line-height: 30rpx;
  437. }
  438. }
  439. .chart-box {
  440. height: 650rpx;
  441. }
  442. .distribution-box {
  443. margin: 0 20rpx 40rpx 20rpx;
  444. height: 150rpx;
  445. display: flex;
  446. border-radius: $border-radius;
  447. background-color: #f3f4f9;
  448. overflow: hidden;
  449. .segment-data {
  450. display: flex;
  451. flex-direction: column;
  452. align-items: center;
  453. background-color: #ff8caf;
  454. justify-content: space-around;
  455. padding: 16rpx 0;
  456. width: 30%;
  457. .text {
  458. font-size: 30rpx;
  459. line-height: 30rpx;
  460. color: #FFF;
  461. }
  462. }
  463. .sutdent-data {
  464. display: flex;
  465. justify-content: space-around;
  466. width: 70%;
  467. .data-item {
  468. display: flex;
  469. flex-direction: column;
  470. align-items: center;
  471. width: 33%;
  472. height: 100%;
  473. .title-box {
  474. display: flex;
  475. align-items: center;
  476. justify-content: center;
  477. background-color: #ffe6ed;
  478. height: 40rpx;
  479. width: 101%;
  480. .title {
  481. line-height: 28rpx;
  482. font-size: 28rpx;
  483. font-weight: 400;
  484. color: $title;
  485. }
  486. }
  487. .YS-title {
  488. line-height: 70rpx;
  489. font-size: 36rpx;
  490. }
  491. }
  492. }
  493. }
  494. }
  495. </style>