stuTestDetails.vue 12 KB

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