personalLearning.vue 14 KB

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