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