stuTestDetails.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. <template>
  2. <!-- 学生实验情况 -->
  3. <view class="user-full">
  4. <view class="box2 df ">
  5. <view class="box2-content">
  6. <view class="title df fdr aic">
  7. <view class="df">
  8. <img src="../../assets/user/pic_user_02.png"></img>
  9. </view>
  10. <view class="title-text">学生信息</view>
  11. </view>
  12. <view class="box2-table-box df fdr">
  13. <view class="m_right_container">
  14. <table style="width: 100%;border: 1px solid #DDDDDD;border-collapse: collapse">
  15. <thead class="m-table-hander">
  16. <tr>
  17. <th>姓名</th>
  18. <th>班级</th>
  19. <th>学号</th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. <tr>
  24. <th style="color: #EA252C;">{{model.Name}}</th>
  25. <th>{{model.Class}}</th>
  26. <th>{{model.StudentID}}</th>
  27. </tr>
  28. </tbody>
  29. </table>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="box2 df ">
  35. <view class="box2-content">
  36. <view class="title df fdr aic">
  37. <view class="df">
  38. <img src="../../assets/user/pic_user_02.png"></img>
  39. </view>
  40. <view class="title-text">成绩分布</view>
  41. </view>
  42. <view class="box2-table-box-cjfb df fdr aic">
  43. <canvas canvas-id="canvasRadar" class="charts myRadar radarChat"></canvas>
  44. <!-- 五维图暂缓 -->
  45. </view>
  46. </view>
  47. </view>
  48. <view class="box2 df ">
  49. <view class="box2-content">
  50. <view class="title df fdr aic">
  51. <view class="df">
  52. <img src="../../assets/user/pic_user_02.png"></img>
  53. </view>
  54. <view class="title-text">学习进度</view>
  55. </view>
  56. <view class="box2-table-box df fdc">
  57. <view class="progress-item df fdr aic">
  58. <view class="progress-box">
  59. <progress :percent=YLRZ_P activeColor="#e93f52" active stroke-width="8" />
  60. </view>
  61. <view class="progress-text">{{YLRZ_P}}%</view>
  62. </view>
  63. <view class="progress-item df fdr aic">
  64. <view class="progress-box">
  65. <progress :percent=SJKC_P activeColor="#d6ebbf" active stroke-width="8" />
  66. </view>
  67. <view class="progress-text">{{SJKC_P}}%</view>
  68. </view>
  69. <view class="progress-item df fdr aic">
  70. <view class="progress-box">
  71. <progress :percent=XNSY_P activeColor="#60b4f0" active stroke-width="8" />
  72. </view>
  73. <view class="progress-text">{{XNSY_P}}%</view>
  74. </view>
  75. <view class="xxjd-text">红色为原理认知,绿色为实景勘察,蓝色为虚拟实验</view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="box3 df ">
  80. <view class="box2-content">
  81. <view class="title df fdr aic">
  82. <view class="df">
  83. <img src="../../assets/user/pic_user_02.png"></img>
  84. </view>
  85. <view class="title-text">测试成绩</view>
  86. </view>
  87. <view class="box2-table-box df fdr">
  88. <view class="m_right_container">
  89. <table style="width: 100%;border: 1px solid #DDDDDD;border-collapse: collapse">
  90. <thead class="m-table-hander">
  91. <tr>
  92. <th>测试项目</th>
  93. <th>是否学习</th>
  94. <th>是否通过</th>
  95. <th>分值</th>
  96. </tr>
  97. </thead>
  98. <tbody>
  99. <tr>
  100. <th>原理认知</th>
  101. <th>{{model.Score_ylrz>0?'是':'否'}}</th>
  102. <th>{{model.Score_ylrz>=10?'是':'否'}}</th>
  103. <th>{{model.Score_ylrz>0?model.Score_ylrz:'0'}}</th>
  104. </tr>
  105. <tr>
  106. <th>实景勘察</th>
  107. <th>{{model.Score_sjkc>0?'是':'否'}}</th>
  108. <th>{{model.Score_sjkc>=10?'是':'否'}}</th>
  109. <th>{{model.Score_sjkc>0?model.Score_sjkc:'0'}}</th>
  110. </tr>
  111. <tr>
  112. <th>虚拟技术搭建</th>
  113. <th>{{model.Score_xnjsdj>0?'是':'否'}}</th>
  114. <th>{{model.Score_xnjsdj>=10?'是':'否'}}</th>
  115. <th>{{model.Score_xnjsdj>0?model.Score_xnjsdj:'0'}}</th>
  116. </tr>
  117. <tr>
  118. <th>虚拟艺术创作</th>
  119. <th>{{model.Score_xnyscz>0?'是':'否'}}</th>
  120. <th>{{model.Score_xnyscz>=10?'是':'否'}}</th>
  121. <th>{{model.Score_xnyscz>0?model.Score_xnyscz:'0'}}</th>
  122. </tr>
  123. </tbody>
  124. </table>
  125. </view>
  126. </view>
  127. <view class="btn-box df fdr aic jcc">
  128. <view class="btn-submit df aic jcc">成绩添加与修改</view>
  129. </view>
  130. </view>
  131. </view>
  132. </view>
  133. </template>
  134. <script>
  135. import uCharts from '@/components/u-charts/u-charts.js';
  136. var _self;
  137. var canvaRadar=null;
  138. export default {
  139. components: {
  140. uCharts
  141. },
  142. data() {
  143. return {
  144. cWidth:'',
  145. cHeight:'',
  146. pixelRatio:1,
  147. textarea:'',
  148. //0添加1个人
  149. showIndex_userInfo: 1,
  150. sexIndex: 0,
  151. zjIndex: 0,
  152. mzIndex: 0,
  153. //学习进度
  154. YLRZ_P:0,
  155. SJKC_P:0,
  156. XNSY_P:0,
  157. model: {
  158. "Name": "", //姓名
  159. "Class": "", //班级
  160. "StudentID": '', //学号
  161. "Score_ylrz": null, //原理认知分数
  162. "Score_sjkc": null, //实景勘察分数
  163. "Score_xnjsdj": null, //虚拟技术搭建分数
  164. "Score_xnyscz": null, //虚拟艺术创作分数
  165. },
  166. array_sex: ['男', '女'],
  167. array_zj: ['身份证', '护照'],
  168. array_mz: ['汉族', '少数民族'],
  169. testResults:['原理认知', '实景勘察', '虚拟技术搭建', '虚拟艺术创作']
  170. }
  171. },
  172. mounted() {
  173. _self = this;
  174. //#ifdef MP-ALIPAY
  175. uni.getSystemInfo({
  176. success: function (res) {
  177. if(res.pixelRatio>1){
  178. //正常这里给2就行,如果pixelRatio=3性能会降低一点
  179. //_self.pixelRatio =res.pixelRatio;
  180. _self.pixelRatio =2;
  181. }
  182. }
  183. });
  184. //#endif
  185. this.cWidth=uni.upx2px(900);
  186. this.cHeight=uni.upx2px(900);
  187. },
  188. methods: {
  189. //点击添加个人信息
  190. onClick_p1_add() {
  191. this.showIndex_userInfo = 1;
  192. },
  193. bindPickerChange_sex: function(e) {
  194. console.log('picker发送选择改变,携带值为', e.target.value)
  195. this.sexIndex = e.target.value
  196. },
  197. bindPickerChange_zj: function(e) {
  198. this.zjIndex = e.target.value
  199. },
  200. bindPickerChange_mz: function(e) {
  201. this.mzIndex = e.target.value
  202. },
  203. updateInfo(data) {
  204. // console.log('data=',data)
  205. this.model.Name = data.Name;
  206. this.model.Class = data.Class;
  207. this.model.StudentID = data.StudentID;
  208. userController.data_scores = data.UserScore;
  209. this.model.Score_ylrz=userController.getScore_ylrz();
  210. this.model.Score_sjkc=userController.getScore_sjck();
  211. this.model.Score_xnjsdj=userController.getScore_xnjsdj();
  212. this.model.Score_xnyscz=userController.getScore_xnyscz();
  213. },
  214. updateLearnProgress(data) {
  215. if( data[0].Score!=-1)
  216. {
  217. this.YLRZ_P = parseInt(data[0].Score/10*100);
  218. }
  219. if( data[1].Score!=-1)
  220. {
  221. this.SJKC_P = parseInt(data[1].Score/5*100);
  222. }
  223. let totalScore = 0;
  224. for(let i=2;i<16;i++)
  225. {
  226. if(data[i].Score!=-1)
  227. {
  228. totalScore++;
  229. }
  230. }
  231. this.XNSY_P = parseInt(totalScore/14*100);
  232. //五维图
  233. let aData= [];
  234. let miniPoint = 0;
  235. //原理认知
  236. if(data[0].Score=='-1')
  237. {
  238. aData.push(miniPoint);
  239. }
  240. else{
  241. aData.push(parseInt(data[0].Score));
  242. }
  243. //实景考察
  244. if(data[1].Score=='-1')
  245. {
  246. aData.push(miniPoint);
  247. }
  248. else{
  249. aData.push(parseInt(data[1].Score));
  250. }
  251. //虚拟技术搭建
  252. let XNJSDJ_score = 0;
  253. for(let i=2;i<5;i++)
  254. {
  255. if(data[i].Score!='-1')
  256. {
  257. XNJSDJ_score+=parseInt(data[i].Score);
  258. }
  259. }
  260. // = parseInt(data[3])+parseInt(data[4])+parseInt(data[5]);
  261. aData.push(XNJSDJ_score);
  262. //虚拟艺术创作
  263. // let XNYSCZ_score = parseInt(data[6])+parseInt(data[7])+parseInt(data[8])+parseInt(data[9])+parseInt(data[10])+parseInt(data[11])+parseInt(data[12])+parseInt(data[13])+parseInt(data[14])+parseInt(data[15]);
  264. let XNYSCZ_score = 0;
  265. for(let i=6;i<15;i++)
  266. {
  267. if(data[i].Score!='-1')
  268. {
  269. XNYSCZ_score+=parseInt(data[i].Score);
  270. }
  271. }
  272. aData.push(XNYSCZ_score);
  273. // console.log('data=',data);
  274. //教师评分(加分项目)
  275. if(data[15].Score=='-1')
  276. {
  277. aData.push(miniPoint);
  278. }
  279. else{
  280. aData.push(parseInt(data[15].Score));
  281. }
  282. // aData.push(parseInt(data[16]));
  283. console.log('aData=',aData)
  284. this.getServerData(aData);
  285. },
  286. getServerData(aData){
  287. // let data = {"categories":["维度1","维度2","维度3","维度4","维度5","维度6"],"series":[{"name":"成交量1","data":[90,110,165,195,187,172]},{"name":"成交量2","data":[190,210,105,35,27,102]}]}
  288. // let data = {"categories":["原理认知","实景勘察","虚拟技术搭建","虚拟艺术创作","教师评分(加分项目)"],"series":[{"name":"成绩分布","data":[90,110,165,195,187]}]}
  289. // let data = {"categories":["维度1","维度2","维度3"],"series":[{"name":"成交量1","data":[90,110,165,195,187,172]}]}
  290. let data = {"categories":["原理认知","实景考察","虚拟技术搭建","虚拟艺术创作","教师评分(加分项目)"],"series":[{"name":"成绩分布","data":aData}]}
  291. _self.showRadar("canvasRadar",data);
  292. },
  293. showRadar(canvasId,chartData){
  294. canvaRadar=new uCharts({
  295. $this:_self,
  296. canvasId: canvasId,
  297. type: 'radar',
  298. fontSize:11,
  299. padding:[15,15,0,15],
  300. legend:{
  301. show:true,
  302. padding:5,
  303. lineHeight:11,
  304. margin:0,
  305. },
  306. background:'#FFFFFF',
  307. pixelRatio:_self.pixelRatio,
  308. animation: true,
  309. dataLabel: true,
  310. categories: chartData.categories,
  311. series: chartData.series,
  312. width: _self.cWidth*_self.pixelRatio,
  313. height: _self.cHeight*_self.pixelRatio,
  314. extra: {
  315. radar: {
  316. max: 200,//雷达数值的最大值
  317. gridType:'radar'//radar或者circle可选,网格样式,默认radar
  318. }
  319. }
  320. });
  321. },
  322. }
  323. }
  324. </script>
  325. <style lang="scss">
  326. .user-full {
  327. width: 100%;
  328. height: 100%;
  329. }
  330. .user-right-box {
  331. // background: #FFFFFF;
  332. background: #F4F4F4;
  333. box-shadow: px2vw(3) 0px px2vw(6) 0px rgba(0, 0, 0, 0.1);
  334. flex: 1;
  335. margin-left: px2vw(10);
  336. }
  337. .user-right-01-tip {
  338. font-size: px2vw(22);
  339. color: #FF7373;
  340. line-height: px2vw(29);
  341. margin-top: px2vw(37);
  342. }
  343. .self-btn01 {
  344. width: px2vw(200);
  345. height: px2vw(58);
  346. background: #EA252C;
  347. border-radius: px2vw(8);
  348. font-size: px2vw(24);
  349. color: #FFFFFF;
  350. line-height: px2vw(31);
  351. margin-top: px2vw(94);
  352. }
  353. .user-right-self01 {
  354. background: #FFFFFF;
  355. }
  356. .box1 {
  357. height: px2vw(200);
  358. background: #FFFFFF;
  359. }
  360. .self-avatar {
  361. margin-left: px2vw(227);
  362. }
  363. .self-avatar img {
  364. width: px2vw(120);
  365. }
  366. .self-btn02 {
  367. width: px2vw(200);
  368. height: px2vw(58);
  369. background: #EA252C;
  370. border-radius: px2vw(8);
  371. font-size: px2vw(24);
  372. color: #FFFFFF;
  373. line-height: px2vw(31);
  374. margin-left: px2vw(57);
  375. }
  376. .box2 {
  377. // height: px2vw(553);
  378. background: #FFFFFF;
  379. margin-top: px2vw(10);
  380. }
  381. .box2-content {
  382. margin-left: px2vw(71);
  383. margin-top: px2vw(31);
  384. margin-bottom: px2vw(57);
  385. }
  386. .form-input {
  387. width: px2vw(355);
  388. height: px2vw(54);
  389. padding: px2vw(14) px2vw(20);
  390. font-size: px2vw(20);
  391. color: #070707;
  392. line-height: px2vw(26);
  393. background: #FFFFFF;
  394. border-radius: px2vw(4);
  395. border: 1px solid #B4B4B4;
  396. }
  397. .title-text {
  398. margin-left: px2vw(16);
  399. }
  400. .box2-table-box {
  401. // margin-top: px2vw(44);
  402. // margin-bottom: px2vw(44);
  403. width: px2vw(1377);
  404. }
  405. .box2-table-box-cjfb{
  406. display: flex;/*父元素设置flex属性*/
  407. justify-content: center;/*水平主轴居中*/
  408. align-items: center;/*垂直交叉轴居中*/
  409. width: px2vw(1377);
  410. height: px2vw(500);
  411. //宽度
  412. }
  413. .radarChat{
  414. // border: 1px solid #DDDDDD;
  415. width: px2vw(600);
  416. height: px2vw(600);
  417. }
  418. .box2-table-box-left {
  419. width: px2vw(500);
  420. }
  421. .box2-table-box-left-item {
  422. width: 100%;
  423. margin-top: px2vw(30);
  424. }
  425. .table-title {
  426. font-size: px2vw(22);
  427. color: #555555;
  428. line-height: px2vw(29);
  429. }
  430. .box2-table-box-right {
  431. width: px2vw(500);
  432. margin-left: px2vw(92);
  433. }
  434. .box3 {
  435. // height: px2vw(553);
  436. background: #FFFFFF;
  437. margin-top: px2vw(10);
  438. }
  439. .btn-box {
  440. // margin-top: px2vw(10);
  441. }
  442. .btn-submit {
  443. width: px2vw(353);
  444. height: px2vw(58);
  445. background: #EA252C;
  446. border-radius: px2vw(8);
  447. font-size: px2vw(24);
  448. color: #FFFFFF;
  449. line-height: px2vw(31);
  450. margin-top: px2vw(94);
  451. }
  452. .btn-cancel {
  453. width: px2vw(200);
  454. height: px2vw(58);
  455. background: #D8D8D8;
  456. border-radius: px2vw(8);
  457. font-size: px2vw(24);
  458. color: #FFFFFF;
  459. line-height: px2vw(31);
  460. margin-top: px2vw(94);
  461. margin-left: px2vw(30);
  462. }
  463. .m_right {
  464. width: 100%;
  465. height: 100%;
  466. margin-top: 5rpx;
  467. padding: 0 150rpx;
  468. background-color: #fff;
  469. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  470. .m_right_hander {
  471. text-align: right;
  472. height: 250rpx;
  473. position: relative;
  474. .m_btn_red {
  475. position: absolute;
  476. height: 80rpx;
  477. line-height: 80rpx;
  478. padding: 0 40rpx;
  479. right: 0;
  480. top: 50%;
  481. transform: translateY(-50%);
  482. background: #EA252C;
  483. color: #fff;
  484. }
  485. }
  486. }
  487. tbody tr {
  488. border-top: 2rpx solid #DDDDDD !important;
  489. }
  490. tbody tr th {
  491. font-weight: 400 !important;
  492. height: 140rpx;
  493. line-height: 140rpx;
  494. }
  495. tbody tr:hover {
  496. // color: #fff;
  497. background: #FDEBEC;
  498. // opacity: 0.08;
  499. }
  500. .m-table-hander {
  501. background-color: #FFF8F7;
  502. height: 140rpx;
  503. line-height: 140rpx;
  504. font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  505. font-weight: bold;
  506. }
  507. .m_edit {
  508. position: absolute;
  509. top: 50%;
  510. left: 50%;
  511. transform: translate(-50%, -50%);
  512. background: rgb(67, 127, 250);
  513. color: rgb(255, 255, 255);
  514. min-width: 130rpx;
  515. }
  516. .m_delete {
  517. position: absolute;
  518. top: 50%;
  519. left: 50%;
  520. min-width: 130rpx;
  521. transform: translate(-50%, -50%);
  522. background: rgb(234, 37, 44);
  523. color: rgb(255, 255, 255);
  524. }
  525. .m_right_footer {
  526. margin-top: 80rpx;
  527. margin-bottom: 80rpx;
  528. }
  529. .m_paging {
  530. text-align: right;
  531. .m_paging_item {
  532. padding: 10rpx 18rpx;
  533. border: 1rpx solid #DDDDDD;
  534. border-radius: 8rpx;
  535. margin-right: 10rpx;
  536. }
  537. .p_act {
  538. background: #EA252C;
  539. color: #fff;
  540. border: inherit;
  541. }
  542. }
  543. .m_paging_item:hover {
  544. background: #EA252C;
  545. color: #fff;
  546. border: inherit;
  547. }
  548. .m_act1 {
  549. color: #FF0019;
  550. }
  551. .m_right_container {
  552. width: 100%;
  553. margin-top: px2vw(40);
  554. }
  555. .progress-item{
  556. margin-top: px2vw(40);
  557. }
  558. .progress-box {
  559. width: px2vw(700);
  560. // margin-top: px2vw(40);
  561. }
  562. .xxjd-text {
  563. margin-top: px2vw(40);
  564. }
  565. .progress-text {
  566. font-size: px2vw(24);
  567. color: #070707;
  568. line-height: px2vw(26);
  569. margin-left: px2vw(40);
  570. }
  571. </style>