stuTestDetails.vue 15 KB

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