index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. <template>
  2. <div class="body1" v-loading="isLoading">
  3. <!-- 综合数据 -->
  4. <div class="left">
  5. <div class="top">
  6. <div class="titleBox">
  7. <div class="title">基础概况</div>
  8. </div>
  9. <div class="dataBox">
  10. <div class="info_box">
  11. <div class="info blueBG">
  12. <span>用户总数</span>
  13. <span>{{count}}</span>
  14. </div>
  15. <div class="info greenBG">
  16. <span>周使用频次</span>
  17. <span>{{weekCount}}</span>
  18. </div>
  19. <div class="info blueBG">
  20. <span>登录频次</span>
  21. <span>{{loginCount}}</span>
  22. </div>
  23. <div class="info greenBG">
  24. <span>人均使用频次</span>
  25. <span>{{(loginCount / count).toFixed(0)}}</span>
  26. </div>
  27. </div>
  28. <loginCount style="height: calc(100% - 140px)" :monthArray="loginCountMonthArray"></loginCount>
  29. </div>
  30. </div>
  31. <div class="bottom">
  32. <div class="titleBox">
  33. <div class="title">在线时长</div>
  34. </div>
  35. <div class="dataBox">
  36. <div class="info_box">
  37. <div class="info blueBG">
  38. <span>累计时长</span>
  39. <span>{{loginTime.toFixed(0)}}小时</span>
  40. </div>
  41. <div class="info greenBG">
  42. <span>人均时长</span>
  43. <span>{{(loginTime / count).toFixed(0)}}小时</span>
  44. </div>
  45. </div>
  46. <loginTime style="height: calc(100% - 70px)"></loginTime>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="center">
  51. <div class="top">
  52. <div class="titleBox">
  53. <div class="title">教师综合评价</div>
  54. </div>
  55. <div class="dataBox">
  56. <div class="info_box" style="width: 95%">
  57. <div class="info2 blueBG">
  58. <span>上传课程总数</span>
  59. <span>{{courseCount}}</span>
  60. </div>
  61. <div class="info2 greenBG">
  62. <span>各年级平均课程数</span>
  63. <span>15620</span>
  64. </div>
  65. <div class="info2 blueBG">
  66. <span>各学科平均课程</span>
  67. <span>15620</span>
  68. </div>
  69. <div class="info2 greenBG">
  70. <span>教师人均课程数</span>
  71. <span>{{(courseCount / teacherCount).toFixed(0)}}</span>
  72. </div>
  73. </div>
  74. <teacherInfo style="height: calc(100% - 70px)"></teacherInfo>
  75. </div>
  76. </div>
  77. <div class="bottom">
  78. <div class="titleBox">
  79. <div class="title">平台使用深度</div>
  80. </div>
  81. <div class="dataBox">
  82. <div class="depth_box">
  83. <div class="depth">
  84. <span>上传课程</span>
  85. <div>
  86. <el-progress
  87. :width="80"
  88. type="circle"
  89. :percentage="36"
  90. :stroke-width="15"
  91. :format="format"
  92. ></el-progress>
  93. </div>
  94. </div>
  95. <div class="depth">
  96. <span>指导项目</span>
  97. <div>
  98. <el-progress
  99. :width="80"
  100. type="circle"
  101. :percentage="76"
  102. :stroke-width="15"
  103. :format="format"
  104. ></el-progress>
  105. </div>
  106. </div>
  107. <div class="depth">
  108. <span>使用工具</span>
  109. <div>
  110. <el-progress
  111. :width="80"
  112. type="circle"
  113. :percentage="76"
  114. :stroke-width="15"
  115. :format="format"
  116. ></el-progress>
  117. </div>
  118. </div>
  119. <div class="depth">
  120. <span>课程评价</span>
  121. <div>
  122. <el-progress
  123. :width="80"
  124. type="circle"
  125. :percentage="76"
  126. :stroke-width="15"
  127. :format="format"
  128. ></el-progress>
  129. </div>
  130. </div>
  131. <div class="depth">
  132. <span>互动交流</span>
  133. <div>
  134. <el-progress
  135. :width="80"
  136. type="circle"
  137. :percentage="76"
  138. :stroke-width="15"
  139. :format="format"
  140. ></el-progress>
  141. </div>
  142. </div>
  143. <div class="depth">
  144. <span>参与课程</span>
  145. <div>
  146. <el-progress
  147. :width="80"
  148. type="circle"
  149. :percentage="36"
  150. :stroke-width="15"
  151. :format="format"
  152. ></el-progress>
  153. </div>
  154. </div>
  155. <div class="depth">
  156. <span>参与项目</span>
  157. <div>
  158. <el-progress
  159. :width="80"
  160. type="circle"
  161. :percentage="76"
  162. :stroke-width="15"
  163. :format="format"
  164. ></el-progress>
  165. </div>
  166. </div>
  167. <div class="depth">
  168. <span>使用工具</span>
  169. <div>
  170. <el-progress
  171. :width="80"
  172. type="circle"
  173. :percentage="25"
  174. :stroke-width="15"
  175. :format="format"
  176. ></el-progress>
  177. </div>
  178. </div>
  179. <div class="depth">
  180. <span>协同合作</span>
  181. <div>
  182. <el-progress
  183. :width="80"
  184. type="circle"
  185. :percentage="76"
  186. :stroke-width="15"
  187. :format="format"
  188. ></el-progress>
  189. </div>
  190. </div>
  191. <div class="depth">
  192. <span>合作交流</span>
  193. <div>
  194. <el-progress
  195. :width="80"
  196. type="circle"
  197. :percentage="76"
  198. :stroke-width="15"
  199. :format="format"
  200. ></el-progress>
  201. </div>
  202. </div>
  203. </div>
  204. </div>
  205. </div>
  206. </div>
  207. <div class="right">
  208. <div class="top">
  209. <div class="titleBox">
  210. <div class="title">课程数量</div>
  211. </div>
  212. <div class="dataBox">
  213. <div class="course_box">
  214. <div class="info_box">
  215. <div class="info3 blueBG">
  216. <span>课程总数</span>
  217. <span>{{courseCount}}</span>
  218. </div>
  219. <div class="info3 greenBG">
  220. <span>类别总数</span>
  221. <span>546</span>
  222. </div>
  223. <div class="info3 blueBG">
  224. <span>类别平均</span>
  225. <span>12</span>
  226. </div>
  227. </div>
  228. <div class="course_box_p">
  229. <courseInfo></courseInfo>
  230. </div>
  231. </div>
  232. <cateRank
  233. style="height: calc(100% - 200px); overflow: auto"
  234. ></cateRank>
  235. </div>
  236. </div>
  237. <div class="bottom">
  238. <div class="titleBox">
  239. <div class="title">学生综合评价</div>
  240. </div>
  241. <div class="dataBox">
  242. <studentInfo></studentInfo>
  243. </div>
  244. </div>
  245. </div>
  246. </div>
  247. </template>
  248. <script>
  249. import loginCount from "./loginCount";
  250. import loginTime from "./loginTime";
  251. import teacherInfo from "./teacherInfo";
  252. import courseInfo from "./courseInfo";
  253. import studentInfo from "./studentInfo";
  254. import cateRank from "./cateRank";
  255. export default {
  256. components: {
  257. loginCount,
  258. loginTime,
  259. teacherInfo,
  260. courseInfo,
  261. studentInfo,
  262. cateRank,
  263. },
  264. props: {
  265. oid: {
  266. type: String,
  267. },
  268. },
  269. data() {
  270. return {
  271. isLoading: false,
  272. count:0,
  273. loginCount:0,
  274. loginTime:0,
  275. courseCount:0,
  276. teacherCount:0,
  277. loginCountMonthArray:[],
  278. weekCount:0,
  279. }
  280. },
  281. mounted() {
  282. this.getData();
  283. },
  284. methods: {
  285. getData() {
  286. this.isLoading = true;
  287. let params = [
  288. {
  289. oid: this.oid,
  290. },
  291. ];
  292. this.ajax
  293. .post(this.$store.state.api + "selectDataBoardSchool", params)
  294. .then((res) => {
  295. this.isLoading = false;
  296. this.count = res.data[0][0].count
  297. this.loginCount = res.data[1][0].loginCount
  298. this.loginTime = parseInt(res.data[3][0].time) / 60 / 60
  299. this.courseCount = res.data[5][0].courseCount
  300. this.teacherCount = res.data[6][0].count
  301. let loginCountMonthArray = []
  302. const date = new Date()
  303. var Month = date.getMonth() + 1
  304. var Year = date.getFullYear()
  305. for(var i = Month;i>Month-6;i--){
  306. if(i <= 0){
  307. loginCountMonthArray.push({
  308. Year:Year-1,
  309. Month:12+i,
  310. student:0,
  311. teacher:0
  312. })
  313. }else{
  314. loginCountMonthArray.push({
  315. Month:i,
  316. Year:Year,
  317. student:0,
  318. teacher:0
  319. })
  320. }
  321. }
  322. loginCountMonthArray = loginCountMonthArray.reverse()
  323. let teacherLoginCountYear = res.data[7] // 老师半年登录次数统计
  324. let studentLoginCountYear = res.data[8] // 学生半年登录次数统计
  325. for(var i = 0;i<teacherLoginCountYear.length;i++){
  326. let _date = new Date(teacherLoginCountYear[i].create_at)
  327. var _month = _date.getMonth() + 1
  328. var _year = _date.getFullYear()
  329. for(var j = 0;j<loginCountMonthArray.length;j++){
  330. if(_month == loginCountMonthArray[j].Month && _year == loginCountMonthArray[j].Year){
  331. loginCountMonthArray[j].teacher++
  332. break;
  333. }
  334. }
  335. }
  336. for(var i = 0;i<studentLoginCountYear.length;i++){
  337. let _date = new Date(studentLoginCountYear[i].create_at)
  338. var _month = _date.getMonth() + 1
  339. var _year = _date.getFullYear()
  340. for(var j = 0;j<loginCountMonthArray.length;j++){
  341. if(_month == loginCountMonthArray[j].Month && _year == loginCountMonthArray[j].Year){
  342. loginCountMonthArray[j].student++
  343. break;
  344. }
  345. }
  346. }
  347. console.log(loginCountMonthArray);
  348. this.loginCountMonthArray = loginCountMonthArray
  349. this.weekCount = res.data[9][0].count
  350. })
  351. .catch((err) => {
  352. this.isLoading = false;
  353. console.error(err);
  354. });
  355. },
  356. format(percentage) {
  357. return percentage;
  358. },
  359. },
  360. };
  361. </script>
  362. <style scoped>
  363. .body1 {
  364. width: 100%;
  365. height: 100%;
  366. display: flex;
  367. padding: 20px;
  368. box-sizing: border-box;
  369. overflow: hidden;
  370. }
  371. .left {
  372. width: calc(100% / 4 * 1);
  373. height: 100%;
  374. }
  375. .left > .top {
  376. width: 100%;
  377. height: calc(100% / 5 * 2.8 - 20px);
  378. background: #fff;
  379. border-radius: 5px;
  380. margin: 0 0 20px 0;
  381. }
  382. .left > .bottom {
  383. width: 100%;
  384. height: calc(100% / 5 * 2.2);
  385. background: #fff;
  386. border-radius: 5px;
  387. }
  388. .center {
  389. width: calc(100% / 4 * 2 - 40px);
  390. height: 100%;
  391. margin: 0 20px;
  392. }
  393. .center > .top {
  394. width: 100%;
  395. height: calc(100% / 5 * 2.8 - 20px);
  396. background: #fff;
  397. border-radius: 5px;
  398. margin: 0 0 20px 0;
  399. }
  400. .center > .bottom {
  401. width: 100%;
  402. height: calc(100% / 5 * 2.2);
  403. background: #fff;
  404. border-radius: 5px;
  405. }
  406. .right {
  407. width: calc(100% / 4 * 1);
  408. height: 100%;
  409. }
  410. .right > .top {
  411. width: 100%;
  412. height: calc(100% / 5 * 2.8 - 20px);
  413. background: #fff;
  414. border-radius: 5px;
  415. margin: 0 0 20px 0;
  416. }
  417. .right > .bottom {
  418. width: 100%;
  419. height: calc(100% / 5 * 2.2);
  420. background: #fff;
  421. border-radius: 5px;
  422. }
  423. .titleBox {
  424. height: 40px;
  425. display: flex;
  426. align-items: center;
  427. padding: 0 15px;
  428. width: 100%;
  429. }
  430. .titleBox > .title {
  431. font-weight: 700;
  432. }
  433. .dataBox {
  434. height: calc(100% - 40px);
  435. width: 100%;
  436. }
  437. .info_box {
  438. display: flex;
  439. flex-wrap: wrap;
  440. align-items: center;
  441. justify-content: space-between;
  442. width: 90%;
  443. margin: 0 auto;
  444. }
  445. .info_box > .info2,
  446. .info_box > .info3,
  447. .info_box > .info {
  448. width: calc(50% - 10px);
  449. display: flex;
  450. flex-direction: column;
  451. height: 60px;
  452. justify-content: center;
  453. padding: 0 10px;
  454. box-sizing: border-box;
  455. margin-bottom: 10px;
  456. border-radius: 5px;
  457. }
  458. .info_box > .info2 {
  459. width: calc(100% / 4 - 10px);
  460. align-items: flex-end;
  461. }
  462. .info_box > .info3 {
  463. width: 100%;
  464. margin-bottom: 5px;
  465. }
  466. .info_box > .info2 > span:nth-child(1),
  467. .info_box > .info3 > span:nth-child(1),
  468. .info_box > .info > span:nth-child(1) {
  469. font-size: 12px;
  470. /* margin: 0 0 5px 0; */
  471. }
  472. .info_box > .info2 > span:nth-child(2),
  473. .info_box > .info3 > span:nth-child(2),
  474. .info_box > .info > span:nth-child(2) {
  475. font-size: 22px;
  476. font-weight: 700;
  477. }
  478. .blueBG {
  479. background: linear-gradient(
  480. 180deg,
  481. rgba(224, 234, 251, 0.2) 0%,
  482. rgba(54, 130, 252, 0.3) 100%
  483. );
  484. }
  485. .greenBG {
  486. background: linear-gradient(
  487. 180deg,
  488. rgb(211, 246, 228, 0.2) 0%,
  489. rgb(23, 196, 105, 0.3) 100%
  490. );
  491. }
  492. .depth_box {
  493. display: flex;
  494. flex-wrap: wrap;
  495. height: 100%;
  496. width: 95%;
  497. margin: 0 auto;
  498. overflow: hidden;
  499. justify-content: space-between;
  500. }
  501. .depth {
  502. width: calc(100% / 5 - 10px);
  503. display: flex;
  504. flex-direction: column;
  505. align-items: center;
  506. justify-content: center;
  507. }
  508. .depth > span:nth-child(1) {
  509. font-size: 14px;
  510. font-weight: 700;
  511. margin: 0 0 10px;
  512. }
  513. .depth > div:nth-child(1) {
  514. }
  515. .course_box {
  516. display: flex;
  517. height: 50%;
  518. width: 90%;
  519. margin: 0 auto;
  520. }
  521. .course_box .info_box {
  522. height: 100%;
  523. width: 100px;
  524. flex-direction: column;
  525. margin: 0;
  526. flex-wrap: nowrap;
  527. }
  528. .course_box_p {
  529. width: calc(100% - 100px);
  530. }
  531. </style>