stuTestDetails.vue 16 KB

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