stuTestDetails.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  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" id="canvasRadar" class="charts myRadar"></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(650);
  189. this.cHeight=uni.upx2px(400);
  190. },
  191. methods: {
  192. //点击添加个人信息
  193. onClick_p1_add() {
  194. this.showIndex_userInfo = 1;
  195. },
  196. bindPickerChange_sex: function(e) {
  197. console.log('picker发送选择改变,携带值为', e.target.value)
  198. this.sexIndex = e.target.value
  199. },
  200. bindPickerChange_zj: function(e) {
  201. this.zjIndex = e.target.value
  202. },
  203. bindPickerChange_mz: function(e) {
  204. this.mzIndex = e.target.value
  205. },
  206. updateInfo(data) {
  207. // console.log('data=',data)
  208. this.model.Name = data.Name;
  209. this.model.Class = data.Class;
  210. this.model.StudentID = data.StudentID;
  211. userController.data_scores = data.UserScore;
  212. this.model.Score_ylrz=userController.getScore_ylrz();
  213. this.model.Score_sjkc=userController.getScore_sjck();
  214. this.model.Score_xnjsdj=userController.getScore_xnjsdj();
  215. this.model.Score_xnyscz=userController.getScore_xnyscz();
  216. },
  217. updateLearnProgress(data) {
  218. if( data[0].Score!=-1)
  219. {
  220. this.YLRZ_P = parseInt(data[0].Score/10*100);
  221. }
  222. if( data[1].Score!=-1)
  223. {
  224. this.SJKC_P = parseInt(data[1].Score/5*100);
  225. }
  226. let totalScore = 0;
  227. for(let i=2;i<16;i++)
  228. {
  229. if(data[i].Score!=-1)
  230. {
  231. totalScore++;
  232. }
  233. }
  234. this.XNSY_P = parseInt(totalScore/14*100);
  235. //五维图
  236. let aData= [];
  237. //原理认知
  238. if(data[0].Score=='-1')
  239. {
  240. aData.push(0);
  241. }
  242. else{
  243. aData.push(parseInt(data[0].Score));
  244. }
  245. //实景考察
  246. if(data[1].Score=='-1')
  247. {
  248. aData.push(0);
  249. }
  250. else{
  251. aData.push(parseInt(data[1].Score));
  252. }
  253. //虚拟技术搭建
  254. let XNJSDJ_score = 0;
  255. for(let i=2;i<5;i++)
  256. {
  257. if(data[i].Score!='-1')
  258. {
  259. XNJSDJ_score+=parseInt(data[i].Score);
  260. }
  261. }
  262. // = parseInt(data[3])+parseInt(data[4])+parseInt(data[5]);
  263. aData.push(XNJSDJ_score);
  264. //虚拟艺术创作
  265. // 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]);
  266. let XNYSCZ_score = 0;
  267. for(let i=6;i<15;i++)
  268. {
  269. if(data[i].Score!='-1')
  270. {
  271. XNYSCZ_score+=parseInt(data[i].Score);
  272. }
  273. }
  274. aData.push(XNYSCZ_score);
  275. console.log('data=',data);
  276. //教师评分(加分项目)
  277. if(data[15].Score=='-1')
  278. {
  279. aData.push(0);
  280. }
  281. else{
  282. aData.push(parseInt(data[15].Score));
  283. }
  284. // aData.push(parseInt(data[16]));
  285. // console.log('aData=',aData)
  286. this.getServerData(aData);
  287. },
  288. getServerData(aData){
  289. // 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]}]}
  290. // let data = {"categories":["原理认知","实景勘察","虚拟技术搭建","虚拟艺术创作","教师评分(加分项目)"],"series":[{"name":"成绩分布","data":[90,110,165,195,187]}]}
  291. // let data = {"categories":["维度1","维度2","维度3"],"series":[{"name":"成交量1","data":[90,110,165,195,187,172]}]}
  292. let data = {"categories":["原理认知","实景考察","虚拟技术搭建","虚拟艺术创作","教师评分(加分项目)"],"series":[{"name":"成绩分布","data":aData}]}
  293. _self.showRadar("canvasRadar",data);
  294. },
  295. showRadar(canvasId,chartData){
  296. canvaRadar=new uCharts({
  297. $this:_self,
  298. canvasId: canvasId,
  299. type: 'radar',
  300. fontSize:11,
  301. padding:[15,15,0,15],
  302. legend:{
  303. show:true,
  304. padding:5,
  305. lineHeight:11,
  306. margin:0,
  307. },
  308. background:'#FFFFFF',
  309. pixelRatio:_self.pixelRatio,
  310. animation: true,
  311. dataLabel: true,
  312. categories: chartData.categories,
  313. series: chartData.series,
  314. width: _self.cWidth*_self.pixelRatio,
  315. height: _self.cHeight*_self.pixelRatio,
  316. extra: {
  317. radar: {
  318. max: 200,//雷达数值的最大值
  319. gridType:'radar'//radar或者circle可选,网格样式,默认radar
  320. }
  321. }
  322. });
  323. },
  324. }
  325. }
  326. </script>
  327. <style lang="scss">
  328. .user-full {
  329. width: 100%;
  330. height: 100%;
  331. }
  332. .user-right-box {
  333. // background: #FFFFFF;
  334. background: #F4F4F4;
  335. box-shadow: px2vw(3) 0px px2vw(6) 0px rgba(0, 0, 0, 0.1);
  336. flex: 1;
  337. margin-left: px2vw(10);
  338. }
  339. .user-right-01-tip {
  340. font-size: px2vw(22);
  341. color: #FF7373;
  342. line-height: px2vw(29);
  343. margin-top: px2vw(37);
  344. }
  345. .self-btn01 {
  346. width: px2vw(200);
  347. height: px2vw(58);
  348. background: #EA252C;
  349. border-radius: px2vw(8);
  350. font-size: px2vw(24);
  351. color: #FFFFFF;
  352. line-height: px2vw(31);
  353. margin-top: px2vw(94);
  354. }
  355. .user-right-self01 {
  356. background: #FFFFFF;
  357. }
  358. .box1 {
  359. height: px2vw(200);
  360. background: #FFFFFF;
  361. }
  362. .self-avatar {
  363. margin-left: px2vw(227);
  364. }
  365. .self-avatar img {
  366. width: px2vw(120);
  367. }
  368. .self-btn02 {
  369. width: px2vw(200);
  370. height: px2vw(58);
  371. background: #EA252C;
  372. border-radius: px2vw(8);
  373. font-size: px2vw(24);
  374. color: #FFFFFF;
  375. line-height: px2vw(31);
  376. margin-left: px2vw(57);
  377. }
  378. .box2 {
  379. // height: px2vw(553);
  380. background: #FFFFFF;
  381. margin-top: px2vw(10);
  382. }
  383. .box2-content {
  384. margin-left: px2vw(71);
  385. margin-top: px2vw(31);
  386. margin-bottom: px2vw(57);
  387. }
  388. .form-input {
  389. width: px2vw(355);
  390. height: px2vw(54);
  391. padding: px2vw(14) px2vw(20);
  392. font-size: px2vw(20);
  393. color: #070707;
  394. line-height: px2vw(26);
  395. background: #FFFFFF;
  396. border-radius: px2vw(4);
  397. border: 1px solid #B4B4B4;
  398. }
  399. .title-text {
  400. margin-left: px2vw(16);
  401. }
  402. .box2-table-box {
  403. // margin-top: px2vw(44);
  404. // margin-bottom: px2vw(44);
  405. width: px2vw(1377);
  406. }
  407. .box2-table-box-cjfb{
  408. width: px2vw(1377);
  409. height: px2vw(300);
  410. }
  411. .box2-table-box-left {
  412. width: px2vw(500);
  413. }
  414. .box2-table-box-left-item {
  415. width: 100%;
  416. margin-top: px2vw(30);
  417. }
  418. .table-title {
  419. font-size: px2vw(22);
  420. color: #555555;
  421. line-height: px2vw(29);
  422. }
  423. .box2-table-box-right {
  424. width: px2vw(500);
  425. margin-left: px2vw(92);
  426. }
  427. .box3 {
  428. // height: px2vw(553);
  429. background: #FFFFFF;
  430. margin-top: px2vw(10);
  431. }
  432. .btn-box {
  433. // margin-top: px2vw(10);
  434. }
  435. .btn-submit {
  436. width: px2vw(353);
  437. height: px2vw(58);
  438. background: #EA252C;
  439. border-radius: px2vw(8);
  440. font-size: px2vw(24);
  441. color: #FFFFFF;
  442. line-height: px2vw(31);
  443. margin-top: px2vw(94);
  444. }
  445. .btn-cancel {
  446. width: px2vw(200);
  447. height: px2vw(58);
  448. background: #D8D8D8;
  449. border-radius: px2vw(8);
  450. font-size: px2vw(24);
  451. color: #FFFFFF;
  452. line-height: px2vw(31);
  453. margin-top: px2vw(94);
  454. margin-left: px2vw(30);
  455. }
  456. .m_right {
  457. width: 100%;
  458. height: 100%;
  459. margin-top: 5rpx;
  460. padding: 0 150rpx;
  461. background-color: #fff;
  462. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  463. .m_right_hander {
  464. text-align: right;
  465. height: 250rpx;
  466. position: relative;
  467. .m_btn_red {
  468. position: absolute;
  469. height: 80rpx;
  470. line-height: 80rpx;
  471. padding: 0 40rpx;
  472. right: 0;
  473. top: 50%;
  474. transform: translateY(-50%);
  475. background: #EA252C;
  476. color: #fff;
  477. }
  478. }
  479. }
  480. tbody tr {
  481. border-top: 2rpx solid #DDDDDD !important;
  482. }
  483. tbody tr th {
  484. font-weight: 400 !important;
  485. height: 140rpx;
  486. line-height: 140rpx;
  487. }
  488. tbody tr:hover {
  489. // color: #fff;
  490. background: #FDEBEC;
  491. // opacity: 0.08;
  492. }
  493. .m-table-hander {
  494. background-color: #FFF8F7;
  495. height: 140rpx;
  496. line-height: 140rpx;
  497. font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  498. font-weight: bold;
  499. }
  500. .m_edit {
  501. position: absolute;
  502. top: 50%;
  503. left: 50%;
  504. transform: translate(-50%, -50%);
  505. background: rgb(67, 127, 250);
  506. color: rgb(255, 255, 255);
  507. min-width: 130rpx;
  508. }
  509. .m_delete {
  510. position: absolute;
  511. top: 50%;
  512. left: 50%;
  513. min-width: 130rpx;
  514. transform: translate(-50%, -50%);
  515. background: rgb(234, 37, 44);
  516. color: rgb(255, 255, 255);
  517. }
  518. .m_right_footer {
  519. margin-top: 80rpx;
  520. margin-bottom: 80rpx;
  521. }
  522. .m_paging {
  523. text-align: right;
  524. .m_paging_item {
  525. padding: 10rpx 18rpx;
  526. border: 1rpx solid #DDDDDD;
  527. border-radius: 8rpx;
  528. margin-right: 10rpx;
  529. }
  530. .p_act {
  531. background: #EA252C;
  532. color: #fff;
  533. border: inherit;
  534. }
  535. }
  536. .m_paging_item:hover {
  537. background: #EA252C;
  538. color: #fff;
  539. border: inherit;
  540. }
  541. .m_act1 {
  542. color: #FF0019;
  543. }
  544. .m_right_container {
  545. width: 100%;
  546. margin-top: px2vw(40);
  547. }
  548. .progress-item{
  549. margin-top: px2vw(40);
  550. }
  551. .progress-box {
  552. width: px2vw(700);
  553. // margin-top: px2vw(40);
  554. }
  555. .xxjd-text {
  556. margin-top: px2vw(40);
  557. }
  558. .progress-text {
  559. font-size: px2vw(24);
  560. color: #070707;
  561. line-height: px2vw(26);
  562. margin-left: px2vw(40);
  563. }
  564. .webview{
  565. height: 650upx;
  566. width: 500upx;
  567. }
  568. </style>