index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913
  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 :yearArray="loginCountYearArray" 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>{{ gradeCourse.toFixed(0) }}</span>
  64. </div>
  65. <div class="info2 blueBG">
  66. <span>各学科平均课程数</span>
  67. <span>{{ subjectCourse.toFixed(0) }}</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)" :courseArray="courseArray" @openCourse="openCourse"></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 :width="80" type="circle"
  87. :percentage="lightJson.upCourseTeachers ? ((lightJson.upCourseTeachers / lightJson.teachers) * 100).toFixed(0) : 0"
  88. :stroke-width="15" :format="format" color="#106BFF"></el-progress>
  89. </div>
  90. </div>
  91. <div class="depth">
  92. <span>上传项目</span>
  93. <div>
  94. <el-progress :width="80" type="circle" :percentage="lightJson.upCourseUsers ? ((lightJson.upCourseUsers / lightJson.users) * 100).toFixed(0) : 0" :stroke-width="15" :format="format"
  95. color="#106BFF"></el-progress>
  96. </div>
  97. </div>
  98. <div class="depth">
  99. <span>使用工具</span>
  100. <div>
  101. <el-progress :width="80" type="circle" :percentage="lightJson.toolUsers ? ((lightJson.toolUsers / lightJson.users) * 100).toFixed(0) : 0" :stroke-width="15" :format="format"
  102. color="#106BFF"></el-progress>
  103. </div>
  104. </div>
  105. <div class="depth">
  106. <span>课程评价</span>
  107. <div>
  108. <el-progress :width="80" type="circle" :percentage="lightJson.rateUser ? ((lightJson.rateUser / lightJson.users) * 100).toFixed(0) : 0" :stroke-width="15" :format="format"
  109. color="#106BFF"></el-progress>
  110. </div>
  111. </div>
  112. <div class="depth">
  113. <span>互动交流</span>
  114. <div>
  115. <el-progress :width="80" type="circle" :percentage="lightJson.commentUsers ? ((lightJson.commentUsers / lightJson.users) * 100).toFixed(0) : 0" :stroke-width="15" :format="format"
  116. color="#106BFF"></el-progress>
  117. </div>
  118. </div>
  119. <div class="depth">
  120. <span>参与课程</span>
  121. <div>
  122. <el-progress :width="80" type="circle" :percentage="lightJson.gCourseTeachers ? ((lightJson.gCourseTeachers / lightJson.teachers) * 100).toFixed(0) : 0" :stroke-width="15" :format="format"
  123. color="#106BFF"></el-progress>
  124. </div>
  125. </div>
  126. <div class="depth">
  127. <span>参与项目</span>
  128. <div>
  129. <el-progress :width="80" type="circle" :percentage="lightJson.gCourseUsers ? ((lightJson.gCourseUsers / lightJson.users) * 100).toFixed(0) : 0" :stroke-width="15" :format="format"
  130. color="#106BFF"></el-progress>
  131. </div>
  132. </div>
  133. <div class="depth">
  134. <span>使用工具</span>
  135. <div>
  136. <el-progress :width="80" type="circle" :percentage="25" :stroke-width="15" :format="format"
  137. color="#106BFF"></el-progress>
  138. </div>
  139. </div>
  140. <div class="depth">
  141. <span>协同合作</span>
  142. <div>
  143. <el-progress :width="80" type="circle" :percentage="lightJson.upgCourseTeachers ? ((lightJson.upgCourseTeachers / lightJson.teachers) * 100).toFixed(0) > 100 ? 100 : ((lightJson.upgCourseTeachers / lightJson.teachers) * 100).toFixed(0) : 0" :stroke-width="15" :format="format"
  144. color="#106BFF"></el-progress>
  145. </div>
  146. </div>
  147. <div class="depth">
  148. <span>合作交流</span>
  149. <div>
  150. <el-progress :width="80" type="circle" :percentage="76" :stroke-width="15" :format="format"
  151. color="#106BFF"></el-progress>
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. <div class="right">
  159. <div class="top">
  160. <div class="titleBox">
  161. <div class="title">课程数量</div>
  162. <el-select v-model="cType" @change="typeChange" class="selectBox">
  163. <el-option label="全部" value=""></el-option>
  164. <el-option label="年级" value="grade"></el-option>
  165. <el-option label="主题" value="theme"></el-option>
  166. <el-option label="学科" value="subject"></el-option>
  167. </el-select>
  168. </div>
  169. <div class="dataBox">
  170. <div class="course_box">
  171. <div class="info_box">
  172. <div class="info3 blueBG">
  173. <span>课程总数</span>
  174. <span>{{ typeCourseCount }}</span>
  175. </div>
  176. <div class="info3 greenBG">
  177. <span>类别总数</span>
  178. <span>{{ typeCount }}</span>
  179. </div>
  180. <div class="info3 blueBG">
  181. <span>类别平均</span>
  182. <span>{{ (typeCourseCount / typeCount).toFixed(0) }}</span>
  183. </div>
  184. </div>
  185. <div class="course_box_p">
  186. <courseInfo :courseNumberArray="courseNumberArray" @openCourse="openCourse2"></courseInfo>
  187. </div>
  188. </div>
  189. <cateRank style="height: calc(100% - 50% - 10px); overflow: auto" :courseNumberArray="courseNumberArray">
  190. </cateRank>
  191. </div>
  192. </div>
  193. <div class="bottom">
  194. <div class="titleBox">
  195. <div class="title">学生综合评价</div>
  196. <el-select v-model="eva" @change="typeChange2" @focus="setMinWidth" class="selectBox" style="width: 150px;">
  197. <el-option v-for="item in evArray" :key="item.id" :label="item.title" :value="item.id" :style="{'width': minWidth + 2 + 'px'}"></el-option>
  198. </el-select>
  199. </div>
  200. <div class="dataBox">
  201. <studentInfo :evCourseArray="evCourseArray" :eva="eva"></studentInfo>
  202. </div>
  203. </div>
  204. </div>
  205. </div>
  206. </template>
  207. <script>
  208. import loginCount from "./loginCount";
  209. import loginTime from "./loginTime";
  210. import teacherInfo from "./teacherInfo";
  211. import courseInfo from "./courseInfo";
  212. import studentInfo from "./studentInfo";
  213. import cateRank from "./cateRank";
  214. export default {
  215. components: {
  216. loginCount,
  217. loginTime,
  218. teacherInfo,
  219. courseInfo,
  220. studentInfo,
  221. cateRank,
  222. },
  223. props: {
  224. oid: {
  225. type: String,
  226. },
  227. org: {
  228. type: String,
  229. },
  230. },
  231. data() {
  232. return {
  233. isLoading: false,
  234. count: 0,
  235. loginCount: 0,
  236. loginTime: 0,
  237. courseCount: 0,
  238. teacherCount: 0,
  239. loginCountMonthArray: [],
  240. weekCount: 0,
  241. loginCountYearArray: [],
  242. gradeCourse: 0,
  243. subjectCourse: 0,
  244. courseArray: [],
  245. cType: '',
  246. gradeArray: [],
  247. subjectArray: [],
  248. themeArray: [],
  249. allArray: [],
  250. courseNumberArray: [],
  251. typeCount: 0,
  252. typeCourseCount: 0,
  253. lightJson: {
  254. users: 0,
  255. teachers: 0,
  256. students: 0,
  257. upCourseTeachers: 0,
  258. gCourseTeachers: 0,
  259. upCourseUsers: 0,
  260. gCourseUsers: 0,
  261. toolUsers: 0,
  262. rateUser: 0,
  263. upgCourseTeachers: 0,
  264. commentUsers: 0,
  265. },
  266. evArray:[],
  267. eva:'',
  268. evCourseArray:[],
  269. minWidth:0
  270. }
  271. },
  272. mounted() {
  273. this.getData();
  274. },
  275. methods: {
  276. setMinWidth (val) {
  277. this.minWidth = val.srcElement.clientWidth
  278. },
  279. openCourse(classIndex,subIndex){
  280. // console.log(classIndex,subIndex);
  281. // console.log(this.courseArray);
  282. // console.log(this.courseArray[classIndex].id,this.courseArray[classIndex].subject[subIndex].id || '');
  283. window.topU.postMessage(
  284. {
  285. tools: "openCourse",
  286. typea: this.courseArray[classIndex].id,
  287. typed: this.courseArray[classIndex].subject[subIndex].id || '',
  288. },
  289. "*"
  290. );
  291. },
  292. openCourse2(index){
  293. console.log(index);
  294. // console.log(this.courseNumberArray);
  295. let id = this.courseNumberArray[index].typeid
  296. let typea = ""
  297. let typeb = ""
  298. let typed = ""
  299. // console.log(this.gradeArray);
  300. // console.log(this.subjectArray);
  301. // console.log(this.themeArray);
  302. let key = 0
  303. for (key in this.gradeArray) {
  304. if (this.gradeArray.hasOwnProperty.call(this.gradeArray, key)) {
  305. const element = this.gradeArray[key];
  306. if(element.typeid == id){
  307. typea = id
  308. }
  309. }
  310. }
  311. for (key in this.subjectArray) {
  312. if (this.subjectArray.hasOwnProperty.call(this.subjectArray, key)) {
  313. const element = this.subjectArray[key];
  314. if(element.typeid == id){
  315. typed = id
  316. }
  317. }
  318. }
  319. for (key in this.themeArray) {
  320. if (this.themeArray.hasOwnProperty.call(this.themeArray, key)) {
  321. const element = this.themeArray[key];
  322. if(element.typeid == id){
  323. typeb = id
  324. }
  325. }
  326. }
  327. window.topU.postMessage(
  328. {
  329. tools: "openCourse",
  330. typea: typea || "",
  331. typeb: typeb || "",
  332. typed: typed || "",
  333. },
  334. "*"
  335. );
  336. },
  337. getData() {
  338. this.isLoading = true;
  339. let params = [
  340. {
  341. oid: this.oid,
  342. org: this.org,
  343. },
  344. ];
  345. this.ajax
  346. .post(this.$store.state.api + "selectDataBoardSchool", params)
  347. .then((res) => {
  348. this.isLoading = false;
  349. this.count = res.data[0][0].count
  350. this.loginCount = res.data[1][0].loginCount
  351. this.loginTime = parseInt(res.data[3][0].time) / 60 / 60
  352. this.courseCount = res.data[5][0].courseCount
  353. this.teacherCount = res.data[6][0].count
  354. let loginCountMonthArray = []
  355. const date = new Date()
  356. var Month = date.getMonth() + 1
  357. var Year = date.getFullYear()
  358. for (var i = Month; i > Month - 6; i--) {
  359. if (i <= 0) {
  360. loginCountMonthArray.push({
  361. Year: Year - 1,
  362. Month: 12 + i,
  363. student: 0,
  364. teacher: 0
  365. })
  366. } else {
  367. loginCountMonthArray.push({
  368. Month: i,
  369. Year: Year,
  370. student: 0,
  371. teacher: 0
  372. })
  373. }
  374. }
  375. loginCountMonthArray = loginCountMonthArray.reverse()
  376. let teacherLoginCountYear = res.data[7] // 老师半年登录次数统计
  377. let studentLoginCountYear = res.data[8] // 学生半年登录次数统计
  378. for (var i = 0; i < teacherLoginCountYear.length; i++) {
  379. let _date = new Date(teacherLoginCountYear[i].create_at)
  380. var _month = _date.getMonth() + 1
  381. var _year = _date.getFullYear()
  382. for (var j = 0; j < loginCountMonthArray.length; j++) {
  383. if (_month == loginCountMonthArray[j].Month && _year == loginCountMonthArray[j].Year) {
  384. loginCountMonthArray[j].teacher++
  385. break;
  386. }
  387. }
  388. }
  389. for (var i = 0; i < studentLoginCountYear.length; i++) {
  390. let _date = new Date(studentLoginCountYear[i].create_at)
  391. var _month = _date.getMonth() + 1
  392. var _year = _date.getFullYear()
  393. for (var j = 0; j < loginCountMonthArray.length; j++) {
  394. if (_month == loginCountMonthArray[j].Month && _year == loginCountMonthArray[j].Year) {
  395. loginCountMonthArray[j].student++
  396. break;
  397. }
  398. }
  399. }
  400. console.log(loginCountMonthArray);
  401. this.loginCountMonthArray = loginCountMonthArray
  402. this.weekCount = res.data[9][0].count
  403. let loginCountYear = res.data[10]
  404. let loginCountYearArray = []
  405. for (var i = Month; i > Month - 12; i--) {
  406. if (i <= 0) {
  407. loginCountYearArray.push({
  408. Year: Year - 1,
  409. Month: 12 + i,
  410. mon: 0,
  411. tue: 0,
  412. wed: 0,
  413. thur: 0,
  414. fri: 0,
  415. sat: 0,
  416. sun: 0,
  417. })
  418. } else {
  419. loginCountYearArray.push({
  420. Month: i,
  421. Year: Year,
  422. mon: 0,
  423. tue: 0,
  424. wed: 0,
  425. thur: 0,
  426. fri: 0,
  427. sat: 0,
  428. sun: 0,
  429. })
  430. }
  431. }
  432. loginCountYearArray = loginCountYearArray.reverse()
  433. for (var i = 0; i < loginCountYear.length; i++) {
  434. let _date = new Date(loginCountYear[i].create_at)
  435. var _month = _date.getMonth() + 1
  436. var _year = _date.getFullYear()
  437. var _day = _date.getDay()
  438. let dayArray = ['sun', 'mon', 'tue', 'wed', 'thur', 'fri', 'sat']
  439. for (var j = 0; j < loginCountYearArray.length; j++) {
  440. if (_month == loginCountYearArray[j].Month && _year == loginCountYearArray[j].Year) {
  441. loginCountYearArray[j][dayArray[_day]]++
  442. break;
  443. }
  444. }
  445. }
  446. console.log(loginCountYearArray);
  447. this.loginCountYearArray = loginCountYearArray
  448. let _grade = res.data[11] //年级
  449. let _subject = res.data[12] //学科
  450. let _course = res.data[13] //课程
  451. let _gradeCourse = 0 //各年级上传课程
  452. let _subjectCourse = 0 //各学科上传课程
  453. let _courseArray = []
  454. _subject.push({ name: '其他' })
  455. for (var i = 0; i < _grade.length; i++) {
  456. _courseArray.push({
  457. name: _grade[i].name,
  458. id: _grade[i].id,
  459. courseid: [],
  460. subject: [],
  461. })
  462. for (var z = 0; z < _course.length; z++) {
  463. if (_course[z].typeid == _grade[i].id) {
  464. _gradeCourse++
  465. if (_courseArray[i].courseid.indexOf(_course[z].courseid) === -1) {
  466. _courseArray[i].courseid.push(_course[z].courseid)
  467. }
  468. }
  469. }
  470. for (var j = 0; j < _subject.length; j++) {
  471. _courseArray[i].subject.push({
  472. name: _subject[j].name,
  473. id: _subject[j].id,
  474. course: 0
  475. })
  476. for (var z = 0; z < _course.length; z++) {
  477. if (_course[z].typeid == _subject[j].id && _courseArray[i].courseid.indexOf(_course[z].courseid) !== -1) {
  478. _courseArray[i].subject[j].course++
  479. }
  480. }
  481. }
  482. let sum = 0
  483. for (var j = 0; j < _courseArray[i].subject.length - 1; j++) {
  484. sum += _courseArray[i].subject[j].course
  485. }
  486. _courseArray[i].subject[_courseArray[i].subject.length - 1].course = (_courseArray[i].courseid.length - sum) < 0 ? 0 : _courseArray[i].courseid.length - sum
  487. }
  488. for (var j = 0; j < _subject.length; j++) {
  489. for (var z = 0; z < _course.length; z++) {
  490. if (_course[z].typeid == _subject[j].id) {
  491. _subjectCourse++
  492. }
  493. }
  494. }
  495. console.log(_courseArray);
  496. this.gradeCourse = _gradeCourse / _grade.length
  497. this.subjectCourse = _subjectCourse / _subject.length
  498. this.courseArray = _courseArray
  499. let _theme = res.data[14] //主题
  500. this.typeCount = _grade.length + _subject.length + _theme.length
  501. let _gradeArray = []
  502. let _subjectArray = []
  503. let _themeArray = []
  504. for (var i = 0; i < _grade.length; i++) {
  505. _gradeArray.push({
  506. name: _grade[i].name,
  507. typeid: _grade[i].id,
  508. course: 0,
  509. array:[]
  510. })
  511. for (var z = 0; z < _course.length; z++) {
  512. if (_course[z].typeid == _grade[i].id) {
  513. _gradeArray[i].course++
  514. _gradeArray[i].array.push(_course[z].courseid)
  515. }
  516. }
  517. }
  518. for (var i = 0; i < _subject.length; i++) {
  519. _subjectArray.push({
  520. name: _subject[i].name,
  521. typeid: _subject[i].id,
  522. course: 0,
  523. array: []
  524. })
  525. for (var z = 0; z < _course.length; z++) {
  526. if (_course[z].typeid == _subject[i].id) {
  527. _subjectArray[i].course++
  528. _subjectArray[i].array.push(_course[z].courseid)
  529. }
  530. }
  531. }
  532. for (var i = 0; i < _theme.length; i++) {
  533. _themeArray.push({
  534. name: _theme[i].name,
  535. typeid: _theme[i].id,
  536. course: 0,
  537. array: []
  538. })
  539. for (var z = 0; z < _course.length; z++) {
  540. if (_course[z].typeid == _theme[i].id) {
  541. _themeArray[i].course++
  542. _themeArray[i].array.push(_course[z].courseid)
  543. }
  544. }
  545. }
  546. this.gradeArray = _gradeArray
  547. this.subjectArray = _subjectArray
  548. this.themeArray = _themeArray
  549. this.allArray = [..._gradeArray, ..._subjectArray, ..._themeArray]
  550. this.typeChange();
  551. let _teachers = res.data[15][0].count //老师数量
  552. let _students = res.data[16][0].count //学生数量
  553. let _upCourseTeachers = res.data[17][0].count //上传课程老师的数量
  554. let _gCourseTeachers = res.data[18][0].count //参与课程的老师
  555. let _upCourseUsers = res.data[19][0].count //上传项目的用户
  556. let _gCourseUsers = res.data[20][0].count //参与项目的用户
  557. let _toolUsers = res.data[21][0].count //使用工具的用户
  558. let _rateUser = res.data[22][0].count //被评价的用户
  559. let _upgCourseTeachers = res.data[23][0].count //参与协同课程的老师
  560. let _commentUsers = res.data[24][0].count //参与互动交流的用户
  561. this.lightJson = {
  562. users: this.count,
  563. teachers: _teachers,
  564. students: _students,
  565. upCourseTeachers: _upCourseTeachers,
  566. gCourseTeachers: _gCourseTeachers,
  567. upCourseUsers: _upCourseUsers,
  568. gCourseUsers: _gCourseUsers,
  569. toolUsers: _toolUsers,
  570. rateUser: _rateUser,
  571. upgCourseTeachers: _upgCourseTeachers,
  572. commentUsers: _commentUsers,
  573. }
  574. let _evArray = res.data[25] //目标数组
  575. let _evWorkArray = res.data[26] //目标课程的作业
  576. let _evCourseArray = [] //计算总分
  577. let _evCourse = [] //筛选有目标的数组
  578. for(var i = 0;i<_evWorkArray.length;i++){
  579. let courseJson = JSON.parse(_evWorkArray[i].chapters)
  580. let _rate = JSON.parse(_evWorkArray[i].rate)
  581. delete _rate.content
  582. if(courseJson[_evWorkArray[i].stage] &&
  583. courseJson[_evWorkArray[i].stage].chapterInfo[0].taskJson[_evWorkArray[i].task] &&
  584. courseJson[_evWorkArray[i].stage].chapterInfo[0].taskJson[_evWorkArray[i].task].eList &&
  585. courseJson[_evWorkArray[i].stage].chapterInfo[0].taskJson[_evWorkArray[i].task].eList.length){
  586. let _elist = courseJson[_evWorkArray[i].stage].chapterInfo[0].taskJson[_evWorkArray[i].task].eList
  587. let _rateC = Object.keys(_rate)
  588. let json = {}
  589. for(var j = 0;j<_rateC.length;j++){
  590. for(var k = 0;k<_elist.length;k++){
  591. if(_elist[k].value == _rateC[j] && _elist[k].target){
  592. json[_elist[k].target[0]] = _rate[_rateC[j]]
  593. break;
  594. }
  595. }
  596. }
  597. if(Object.keys(json).length){
  598. _evCourse.push({
  599. evid:_evWorkArray[i].evaId,
  600. rateJson:json
  601. })
  602. }
  603. }
  604. }
  605. for(var i = 0;i<_evArray.length;i++){
  606. _evCourseArray.push({
  607. title:_evArray[i].title,
  608. evid:_evArray[i].id,
  609. evJson:{}
  610. })
  611. for(var j = 0;j<_evCourse.length;j++){
  612. if(_evArray[i].id == _evCourse[j].evid){
  613. let _rate = Object.keys(_evCourse[j].rateJson)
  614. for(var k = 0;k<_rate.length;k++){
  615. if(_evCourseArray[i].evJson[_rate[k]]){
  616. _evCourseArray[i].evJson[_rate[k]].push(_evCourse[j].rateJson[_rate[k]])
  617. }else{
  618. _evCourseArray[i].evJson[_rate[k]] = [_evCourse[j].rateJson[_rate[k]]]
  619. }
  620. }
  621. }
  622. }
  623. }
  624. for(var i = 0;i < _evCourseArray.length; i++){
  625. _evCourseArray[i].indicator = []
  626. _evCourseArray[i].value = []
  627. let evJson = Object.keys(_evCourseArray[i].evJson)
  628. for(var j = 0;j < evJson.length;j++){
  629. _evCourseArray[i].indicator.push({
  630. name:evJson[j],
  631. max: 5
  632. })
  633. let sum = 0
  634. _evCourseArray[i].evJson[evJson[j]].forEach((value)=>{
  635. sum+=value
  636. })
  637. _evCourseArray[i].value.push((sum / _evCourseArray[i].evJson[evJson[j]].length).toFixed(1))
  638. }
  639. }
  640. this.evArray = _evArray
  641. this.eva = _evArray[0].id
  642. this.evCourseArray = _evCourseArray
  643. this.$forceUpdate();
  644. })
  645. .catch((err) => {
  646. this.isLoading = false;
  647. console.error(err);
  648. });
  649. },
  650. typeChange() {
  651. if (this.cType === '') {
  652. this.courseNumberArray = this.allArray
  653. } else if (this.cType === 'grade') {
  654. this.courseNumberArray = this.gradeArray
  655. } else if (this.cType === 'theme') {
  656. this.courseNumberArray = this.themeArray
  657. } else if (this.cType === 'subject') {
  658. this.courseNumberArray = this.subjectArray
  659. }
  660. let course = []
  661. for(var i = 0;i<this.courseNumberArray.length;i++){
  662. let _array = this.courseNumberArray[i].array
  663. for(var j = 0; j <_array.length;j++){
  664. console.log(_array[j]);
  665. if(course.indexOf(_array[j]) == -1){
  666. course.push(_array[j])
  667. }
  668. }
  669. }
  670. this.typeCount = this.courseNumberArray.length
  671. this.typeCourseCount = course.length
  672. this.$forceUpdate();
  673. },
  674. typeChange2(){
  675. },
  676. format(percentage) {
  677. return percentage + '%';
  678. },
  679. },
  680. };
  681. </script>
  682. <style scoped>
  683. .body1 {
  684. width: 100%;
  685. height: 100%;
  686. display: flex;
  687. padding: 20px;
  688. box-sizing: border-box;
  689. overflow: hidden;
  690. }
  691. .left {
  692. width: calc(100% / 4 * 1);
  693. height: 100%;
  694. }
  695. .left>.top {
  696. width: 100%;
  697. height: calc(100% / 5 * 2.8 - 20px);
  698. background: #fff;
  699. border-radius: 5px;
  700. margin: 0 0 20px 0;
  701. }
  702. .left>.bottom {
  703. width: 100%;
  704. height: calc(100% / 5 * 2.2);
  705. background: #fff;
  706. border-radius: 5px;
  707. }
  708. .center {
  709. width: calc(100% / 4 * 2 - 40px);
  710. height: 100%;
  711. margin: 0 20px;
  712. }
  713. .center>.top {
  714. width: 100%;
  715. height: calc(100% / 5 * 2.8 - 20px);
  716. background: #fff;
  717. border-radius: 5px;
  718. margin: 0 0 20px 0;
  719. }
  720. .center>.bottom {
  721. width: 100%;
  722. height: calc(100% / 5 * 2.2);
  723. background: #fff;
  724. border-radius: 5px;
  725. }
  726. .right {
  727. width: calc(100% / 4 * 1);
  728. height: 100%;
  729. }
  730. .right>.top {
  731. width: 100%;
  732. height: calc(100% / 5 * 2.8 - 20px);
  733. background: #fff;
  734. border-radius: 5px;
  735. margin: 0 0 20px 0;
  736. }
  737. .right>.bottom {
  738. width: 100%;
  739. height: calc(100% / 5 * 2.2);
  740. background: #fff;
  741. border-radius: 5px;
  742. }
  743. .titleBox {
  744. height: 40px;
  745. display: flex;
  746. align-items: center;
  747. padding: 0 15px;
  748. width: 100%;
  749. }
  750. .titleBox>.title {
  751. font-weight: 700;
  752. }
  753. .dataBox {
  754. height: calc(100% - 40px);
  755. width: 100%;
  756. }
  757. .info_box {
  758. display: flex;
  759. flex-wrap: wrap;
  760. align-items: center;
  761. justify-content: space-between;
  762. width: 90%;
  763. margin: 0 auto;
  764. }
  765. .info_box>.info2,
  766. .info_box>.info3,
  767. .info_box>.info {
  768. width: calc(50% - 10px);
  769. display: flex;
  770. flex-direction: column;
  771. height: 60px;
  772. justify-content: center;
  773. padding: 0 10px;
  774. box-sizing: border-box;
  775. margin-bottom: 10px;
  776. border-radius: 5px;
  777. }
  778. .info_box>.info2 {
  779. width: calc(100% / 4 - 10px);
  780. align-items: flex-end;
  781. }
  782. .info_box>.info3 {
  783. width: 100%;
  784. margin-bottom: 5px;
  785. }
  786. .info_box>.info2>span:nth-child(1),
  787. .info_box>.info3>span:nth-child(1),
  788. .info_box>.info>span:nth-child(1) {
  789. font-size: 12px;
  790. /* margin: 0 0 5px 0; */
  791. color: #565e6a;
  792. }
  793. .info_box>.info2>span:nth-child(2),
  794. .info_box>.info3>span:nth-child(2),
  795. .info_box>.info>span:nth-child(2) {
  796. font-size: 22px;
  797. font-weight: 700;
  798. }
  799. .blueBG {
  800. background: linear-gradient(180deg,
  801. rgba(224, 234, 251, 0.2) 0%,
  802. rgba(54, 130, 252, 0.3) 100%);
  803. }
  804. .greenBG {
  805. background: linear-gradient(180deg,
  806. rgb(211, 246, 228, 0.2) 0%,
  807. rgb(23, 196, 105, 0.3) 100%);
  808. }
  809. .depth_box {
  810. display: flex;
  811. flex-wrap: wrap;
  812. height: 100%;
  813. width: 95%;
  814. margin: 0 auto;
  815. overflow: hidden;
  816. justify-content: space-between;
  817. }
  818. .depth {
  819. width: calc(100% / 5 - 10px);
  820. display: flex;
  821. flex-direction: column;
  822. align-items: center;
  823. justify-content: center;
  824. }
  825. .depth>span:nth-child(1) {
  826. font-size: 14px;
  827. font-weight: 700;
  828. margin: 0 0 10px;
  829. }
  830. .depth>div:nth-child(1) {}
  831. .course_box {
  832. display: flex;
  833. height: 50%;
  834. width: 95%;
  835. margin: 0 auto;
  836. }
  837. .course_box .info_box {
  838. height: 100%;
  839. width: 100px;
  840. flex-direction: column;
  841. margin: 0;
  842. flex-wrap: nowrap;
  843. }
  844. .course_box_p {
  845. width: calc(100% - 100px);
  846. }
  847. .selectBox {
  848. width: 80px;
  849. margin-left: 10px;
  850. }
  851. .selectBox>>>.el-input__inner {
  852. height: 30px;
  853. line-height: 30px;
  854. }
  855. .selectBox>>>.el-input__icon {
  856. line-height: 30px;
  857. }
  858. </style>