personalLearning.vue 14 KB

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