personalLearning.vue 14 KB

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