personalLearning.vue 14 KB

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