stuTestDetails.vue 15 KB

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