personalLearning.vue 14 KB

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