stuTestDetails.vue 15 KB

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