workReport.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  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">{{workData[index].work.name}}</view>
  11. </view>
  12. <view class="detail-image" :style="{backgroundImage:`url(${image})`}"></view>
  13. </view>
  14. <view class="card-view">
  15. <view class="card-item">
  16. <view class="title-box">
  17. <view class="title-tag"></view>
  18. <view class="title">作业题详情</view>
  19. </view>
  20. <view class="table-container">
  21. <uni-table :loading="tableLoading">
  22. <!-- 表头行 -->
  23. <uni-tr>
  24. <uni-th width="46" align="center">题号</uni-th>
  25. <uni-th width="12" align="center">题型</uni-th>
  26. <!-- <uni-th>名次</uni-th> -->
  27. <uni-th width="25" align="center">作答</uni-th>
  28. <uni-th width="25" align="center">答案</uni-th>
  29. <uni-th width="25" align="center">更多</uni-th>
  30. </uni-tr>
  31. <uni-tr v-for="(item,index) in reportData.tableData" :key="index" v-if="index < showTableNum">
  32. <uni-td width="46" align="center">
  33. <view class="data">{{item.name}}</view>
  34. </uni-td>
  35. <uni-td width="12" align="center">
  36. <view class="subtitle">{{item.type}}</view>
  37. </uni-td>
  38. <uni-td width="25" align="center">
  39. <view v-if="item.answer != '详情'" class="data"
  40. :style="{color: item.answer === item.rightAnswer?'#23b46c':'#ff5959'}">
  41. {{item.answer}}
  42. </view>
  43. <view class="table-box" v-if="item.answer === '详情'">
  44. <view class="data" style="color: #4169E1">{{item.answer}}
  45. </view>
  46. <view class="t-icon t-icon-you"></view>
  47. </view>
  48. </uni-td>
  49. <uni-td width="25" align="center">
  50. <view v-if="item.rightAnswer != '详情'" class="data">
  51. {{item.rightAnswer}}
  52. </view>
  53. <view class="table-box" v-if="item.rightAnswer === '详情'">
  54. <view class="data" style="color: #4169E1">{{item.rightAnswer}}
  55. </view>
  56. <view class="t-icon t-icon-you"></view>
  57. </view>
  58. </uni-td>
  59. <uni-td width="25" align="center">
  60. <view class="table-box">
  61. <view class="data" style="color: #4169E1;">解析</view>
  62. <view class="t-icon t-icon-you"></view>
  63. </view>
  64. </uni-td>
  65. </uni-tr>
  66. </uni-table>
  67. </view>
  68. <view class="table-btn" v-if="reportData.tableData.length > showTableNum">
  69. <view class="btn-text" @click="showTableList">展开全部作业题</view>
  70. <u-icon name="arrow-down" color="#616367" @click="showTableList"></u-icon>
  71. </view>
  72. </view>
  73. <view class="card-item">
  74. <view class="title-box">
  75. <view class="title-tag"></view>
  76. <view class="title">知识点分析</view>
  77. <view class="subsection">
  78. <u-subsection :list="pointList" :current="pointCurrent" @change="changePoint"
  79. activeColor="#FFF">
  80. </u-subsection>
  81. </view>
  82. </view>
  83. <view class="chart-box" style="height: 700rpx;width: 100%;">
  84. <qiun-data-charts type="bar" ontouch="true" :chartData="reportData.pointChartData"
  85. :opts="{legend:{position: 'top',float:'left'},xAxis:{format:'xAxisBar'}}" />
  86. </view>
  87. <view class="point-analyse">
  88. <view class="flex-row">
  89. <view class="analyse-box1">
  90. <view class="analyse-title">知识点</view>
  91. </view>
  92. <view class="analyse-box2">
  93. <view class="analyse-subtitle">掌握程度</view>
  94. </view>
  95. </view>
  96. <view class="flex-row" v-for="(item,index) in reportData.pointData" :key="index">
  97. <view class="analyse-box1" style="background-color: #f3f4f9;">
  98. <view class="point-box">
  99. <view class="point-title" style="margin-left: 30rpx;">{{item.pointName}}</view>
  100. </view>
  101. </view>
  102. <view class="analyse-box2" style="background-color: #f3f4f9;">
  103. <view class="circle" :style="{backgroundColor: item.level === '优秀掌握'?'#23b46c': item.level === '部分掌握'? '#f9c752':'#FF6D31'}"></view>
  104. <view class="point-title">{{item.level}}</view>
  105. <u-icon name="arrow-right" color="#616367" size="15"></u-icon>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="card-item">
  111. <view class="title-box">
  112. <view class="title-tag"></view>
  113. <view class="title">作业分趋势</view>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. </template>
  119. <script>
  120. import {
  121. mapState
  122. } from 'vuex'
  123. export default {
  124. computed: {
  125. ...mapState('m_children', ['workData'])
  126. },
  127. data() {
  128. return {
  129. index: '',
  130. reportData: {
  131. tableData: [{
  132. name: '单选题01',
  133. type: '单选',
  134. answer: 'A',
  135. rightAnswer: 'A',
  136. }, {
  137. name: '单选题02',
  138. type: '单选',
  139. answer: 'B',
  140. rightAnswer: 'A',
  141. }, {
  142. name: '单选题03',
  143. type: '单选',
  144. answer: 'C',
  145. rightAnswer: 'C',
  146. }, {
  147. name: '单选题04',
  148. type: '单选',
  149. answer: 'A',
  150. rightAnswer: 'D',
  151. }, {
  152. name: '填空题01',
  153. type: '填空',
  154. answer: '123',
  155. rightAnswer: '321',
  156. }, {
  157. name: '填空题02',
  158. type: '填空',
  159. answer: '正确',
  160. rightAnswer: '错误',
  161. }, {
  162. name: '解答题01',
  163. type: '解答',
  164. answer: '详情',
  165. rightAnswer: '详情',
  166. }, {
  167. name: '解答题02',
  168. type: '解答',
  169. answer: '详情',
  170. rightAnswer: '详情',
  171. }],
  172. pointChartData: {
  173. "categories": ["文案居中", "知识点信息", "知识点信息", "知识点信息", "知识点信息", "知识点信息"],
  174. "series": [{
  175. "name": "个人得分率",
  176. "data": [80, 100, 55, 10, 100, 70]
  177. },
  178. {
  179. "name": "班级得分率",
  180. "data": [70, 90, 65, 50, 80, 50]
  181. }
  182. ]
  183. },
  184. pointData: [{
  185. pointName: '化学能与热能',
  186. level: '未掌握'
  187. },
  188. {
  189. pointName: '化学反应速率与化学平衡',
  190. level: '未掌握'
  191. },
  192. {
  193. pointName: '溶液中得离子平衡',
  194. level: '部分掌握'
  195. },
  196. {
  197. pointName: '化学能与电能',
  198. level: '部分掌握'
  199. },
  200. {
  201. pointName: '化学反应原理综合',
  202. level: '部分掌握'
  203. },
  204. {
  205. pointName: '原子结构与性质',
  206. level: '优秀掌握'
  207. },
  208. {
  209. pointName: '晶体结构与性质',
  210. level: '优秀掌握'
  211. }
  212. ]
  213. },
  214. showTableNum: 5,
  215. tableLoading: false,
  216. pointList: ['优势', '短板'],
  217. pointCurrent: 0,
  218. image: 'https://ouch-cdn2.icons8.com/L7XZ0sgjVoRcfTOPCIQaYDAjSFWSuLHiH__hrCVy_CQ/rs:fit:439:456/czM6Ly9pY29uczgu/b3VjaC1wcm9kLmFz/c2V0cy9wbmcvNTM2/L2M3ZmQyOTdiLTgz/ODEtNGQzYy1hNzk1/LWY1MmY3ZWUyMjIw/YS5wbmc.png'
  219. };
  220. },
  221. onLoad(param) {
  222. this.index = param.index
  223. },
  224. methods: {
  225. showTableList() {
  226. this.showTableNum = this.reportData.tableData.length
  227. },
  228. changePoint(e) {
  229. this.pointCurrent = e
  230. }
  231. },
  232. }
  233. </script>
  234. <style lang="scss">
  235. @import 'data_pages.scss';
  236. @import 'top_info.scss';
  237. .bg1 {
  238. position: fixed;
  239. width: 100%;
  240. height: 1200rpx;
  241. background-size: 100%;
  242. background-repeat: no-repeat;
  243. background-image: linear-gradient(to top, #f3f4f9, #f9c752);
  244. }
  245. .detail-image {
  246. position: absolute;
  247. top: 140rpx;
  248. left: 430rpx;
  249. width: 330rpx;
  250. height: 360rpx;
  251. background-size: 100%; //背景图片自适应
  252. background-repeat: no-repeat;
  253. z-index: 50;
  254. }
  255. .card-item {
  256. width: 100%;
  257. .title-box {
  258. display: flex;
  259. align-items: center;
  260. padding: 20rpx 0;
  261. .title-tag {
  262. margin-left: -10rpx;
  263. margin-right: 20rpx;
  264. height: 100%;
  265. width: 20rpx;
  266. border-radius: 100rpx;
  267. background-color: #f9c752;
  268. z-index: 99;
  269. }
  270. .title {
  271. font-size: 35rpx;
  272. line-height: 50rpx;
  273. }
  274. .subsection {
  275. width: 300rpx;
  276. height: 100%;
  277. margin: 0 30rpx 0 auto;
  278. .u-subsection--button__bar {
  279. background-color: #f9c752 !important;
  280. }
  281. }
  282. }
  283. .table-container {
  284. margin-bottom: 20rpx;
  285. .uni-table-td {
  286. padding: 26rpx 10rpx !important;
  287. }
  288. .table-box {
  289. display: flex;
  290. align-items: center;
  291. justify-content: center;
  292. margin-right: -22rpx;
  293. }
  294. .data {
  295. line-height: 28rpx;
  296. font-size: 28rpx;
  297. font-weight: bold;
  298. color: $title;
  299. }
  300. .subtitle {
  301. line-height: 24rpx;
  302. font-size: 24rpx;
  303. font-weight: bold;
  304. color: $subtitle;
  305. }
  306. .t-icon {
  307. width: 30rpx;
  308. height: 30rpx;
  309. }
  310. }
  311. .table-btn {
  312. width: 100%;
  313. height: 50rpx;
  314. display: flex;
  315. align-items: center;
  316. justify-content: center;
  317. margin-bottom: 40rpx;
  318. .btn-text {
  319. font-size: 26rpx;
  320. font-weight: bold;
  321. color: #616367;
  322. margin-right: 10rpx;
  323. }
  324. }
  325. .point-analyse {
  326. margin: 0 20rpx 20rpx 20rpx;
  327. border-radius: $border-radius;
  328. display: flex;
  329. flex-direction: column;
  330. border-radius: $border-radius;
  331. overflow: hidden;
  332. .analyse-box1 {
  333. display: flex;
  334. align-items: center;
  335. justify-content: center;
  336. background-color: #f9c752;
  337. height: 80rpx;
  338. width: 70%;
  339. .point-box{
  340. display: flex;
  341. align-items: center;
  342. width: 100%;
  343. height: 100%;
  344. }
  345. .analyse-title {
  346. line-height: 32rpx;
  347. font-size: 32rpx;
  348. font-weight: bold;
  349. color: #FFF;
  350. }
  351. .point-title {
  352. line-height: 30rpx;
  353. font-size: 30rpx;
  354. font-weight: bold;
  355. color: #616367;
  356. }
  357. }
  358. .analyse-box2 {
  359. display: flex;
  360. align-items: center;
  361. justify-content: center;
  362. background-color: #f9edc6;
  363. height: 80rpx;
  364. width: 30%;
  365. .circle{
  366. height: 24rpx;
  367. width: 24rpx;
  368. border-radius: 50%;
  369. margin-right: 10rpx;
  370. }
  371. .analyse-subtitle {
  372. line-height: 32rpx;
  373. font-size: 32rpx;
  374. font-weight: bold;
  375. color: $title;
  376. }
  377. .point-title {
  378. line-height: 28rpx;
  379. font-size: 28rpx;
  380. font-weight: bold;
  381. color: #616367;
  382. }
  383. }
  384. }
  385. }
  386. </style>