index.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069
  1. <template>
  2. <div class="body1" v-loading="isLoading">
  3. <!-- 课程数据 -->
  4. <div class="left">
  5. <div class="top">
  6. <div class="titleBox" style="justify-content: space-between">
  7. <div class="title">基础概况</div>
  8. <!-- <el-select v-model="cType7" class="selectBox" style="width: 110px">
  9. <el-option label="全部课程" value="全部课程"></el-option>
  10. </el-select> -->
  11. </div>
  12. <div class="dataBox">
  13. <div class="info_box">
  14. <div class="info blueBG">
  15. <span>项目总数</span>
  16. <span>{{ allCourse }}</span>
  17. </div>
  18. <div class="info blueBG">
  19. <span>本月新增项目环比</span>
  20. <span v-if="loginCountMonthArray.length">{{ (loginCountMonthArray[loginCountMonthArray.length - 1].course) >
  21. 0 ? (((loginCountMonthArray[loginCountMonthArray.length - 1].course) / allCourse) * 100).toFixed(0) + '%'
  22. : 0 }}</span>
  23. <!-- <span v-if="loginCountMonthArray.length">{{
  24. loginCountMonthArray[loginCountMonthArray.length - 1].course -
  25. loginCountMonthArray[loginCountMonthArray.length - 2].course < 0 ? 0 : (
  26. (loginCountMonthArray[loginCountMonthArray.length - 1].course -
  27. loginCountMonthArray[loginCountMonthArray.length - 2].course) / (allCourse -
  28. loginCountMonthArray[loginCountMonthArray.length - 1].course) * 100).toFixed(0) + "%" }}</span> -->
  29. <span v-else>0</span>
  30. </div>
  31. <div class="info blueBG">
  32. <span>模板项目总数</span>
  33. <!-- <span>{{ courseTemplate }}</span> -->
  34. <span>{{ 0 }}</span>
  35. </div>
  36. <div class="info blueBG">
  37. <span>本月新增项目总数</span>
  38. <span v-if="loginCountMonthArray.length">{{
  39. loginCountMonthArray[loginCountMonthArray.length - 1].course
  40. }}</span>
  41. <span v-else>0</span>
  42. </div>
  43. </div>
  44. <TeaFre style="height: calc(100% - 140px)" :monthArray="loginCountMonthArray"></TeaFre>
  45. </div>
  46. </div>
  47. <div class="bottom">
  48. <div class="titleBox">
  49. <!-- <div class="title" :class="{ isClick: skType == 0 }" @click="skType = 0"
  50. style="cursor: pointer; padding: 0 0 5px 0">
  51. 项目时长
  52. </div> -->
  53. <div class="title" :class="{ isClick: skType == 1 }" @click="skType = 1"
  54. style="cursor: pointer; padding: 0 0 5px 0">
  55. 作业数量
  56. </div>
  57. <!-- <el-select v-model="cType" class="selectBox" style="width: 110px">
  58. <el-option label="全部年级" value="全部年级"></el-option>
  59. <el-option label="一年级" value="一年级"></el-option>
  60. <el-option label="二年级" value="二年级"></el-option>
  61. <el-option label="三年级" value="三年级"></el-option>
  62. </el-select>
  63. <div class="timeDiv">
  64. <div @click="tType = 0" :class="{ isClick: tType == 0 }">周</div>
  65. <div @click="tType = 1" :class="{ isClick: tType == 1 }">月</div>
  66. <div @click="tType = 2" :class="{ isClick: tType == 2 }">学期</div>
  67. </div> -->
  68. </div>
  69. <div class="info_box" v-if="skType == 1">
  70. <div class="info blueBG" style="width: calc(100% / 3 - 10px)">
  71. <span>作业数量</span>
  72. <span>{{ worksCount }}</span>
  73. </div>
  74. <div class="info blueBG" style="width: calc(100% / 3 - 10px)">
  75. <span>项目开展总数</span>
  76. <span>{{ haveWorksCourse }}</span>
  77. </div>
  78. <div class="info blueBG" style="width: calc(100% / 3 - 10px)">
  79. <span>项目平均作业数量</span>
  80. <span>{{
  81. !worksCount ? 0 : (worksCount / haveWorksCourse).toFixed(0)
  82. }}</span>
  83. </div>
  84. </div>
  85. <div class="info_box" v-if="skType == 0">
  86. <div class="info blueBG" style="width: calc(100% / 3 - 10px)">
  87. <span>累计时长</span>
  88. <span>{{ 132 }}</span>
  89. </div>
  90. <div class="info blueBG" style="width: calc(100% / 3 - 10px)">
  91. <span>项目开展总数</span>
  92. <span>{{ haveWorksCourse }}</span>
  93. </div>
  94. <div class="info blueBG" style="width: calc(100% / 3 - 10px)">
  95. <span>项目平均时长</span>
  96. <span>{{ 18 }}</span>
  97. </div>
  98. </div>
  99. <div class="dataBox" style="height: calc(100% - 110px);">
  100. <ToolUse style="height: calc(100%)" v-if="skType == 1" :worksYearArray="worksYearArray"></ToolUse>
  101. <Bar style="height: calc(100%)" v-if="skType == 0"></Bar>
  102. <!-- <div class="otherCss">
  103. <div v-if="!oType">切换为柱状图</div>
  104. <div v-if="oType">切换为热力图</div>
  105. <div class="otherImg" @click="otherEchart">
  106. <img src="../../../../assets/icon/other.png" alt="" />
  107. </div>
  108. </div> -->
  109. </div>
  110. </div>
  111. </div>
  112. <div class="center">
  113. <div class="top">
  114. <div class="titleBox">
  115. <div class="title" :class="{ isClick: courseType == 0 }" @click="courseType = 0"
  116. style="cursor: pointer; padding: 0 0 5px 0">
  117. 项目分布
  118. </div>
  119. <div class="title" :class="{ isClick: courseType == 1 }" @click="courseType = 1"
  120. style="cursor: pointer; padding: 0 0 5px 0">
  121. 项目总数增幅
  122. </div>
  123. </div>
  124. <div class="dataBox">
  125. <CateRank v-if="courseType == 0" style="height: calc(100%)" :courseArray="courseArray"></CateRank>
  126. <CourseNum v-if="courseType == 1" style="height: calc(100%)" :weekCourse2="weekCourse"></CourseNum>
  127. </div>
  128. </div>
  129. <div class="bottom">
  130. <div class="titleBox" style="justify-content: space-between">
  131. <div class="title">项目开展情况</div>
  132. <!-- <div v-if="!shType" style="
  133. display: flex;
  134. flex-direction: row;
  135. flex-wrap: nowrap;
  136. align-items: center;
  137. ">
  138. <el-select v-model="cType8" class="selectBox" style="width: 110px">
  139. <el-option label="全部年级" value="全部年级"></el-option>
  140. </el-select>
  141. <el-select v-model="cType9" class="selectBox" style="width: 110px">
  142. <el-option label="全部学科" value="全部学科"></el-option>
  143. </el-select>
  144. </div> -->
  145. <!-- <div v-if="shType" style="
  146. display: flex;
  147. flex-direction: row;
  148. flex-wrap: nowrap;
  149. align-items: center;
  150. ">
  151. <el-select v-model="cType1" class="selectBox" style="width: 110px">
  152. <el-option label="全部年级" value="全部年级"></el-option>
  153. </el-select>
  154. <el-select v-model="cType2" class="selectBox" style="width: 110px">
  155. <el-option label="全部学科" value="全部学科"></el-option>
  156. </el-select>
  157. <el-select v-model="cType3" class="selectBox" style="width: 110px">
  158. <el-option label="全部主题" value="全部主题"></el-option>
  159. </el-select>
  160. </div> -->
  161. </div>
  162. <div class="dataBox">
  163. <div v-if="!shType" style="height: calc(100% - 35px);overflow: auto;">
  164. <!-- <barFinish style="height: calc(100% / 3 - 10px);"></barFinish> -->
  165. <!-- <barCCourse style="height: calc(100% / 3 - 10px);"></barCCourse> -->
  166. <barTeacherStudent style="height: calc(100%);" :tsArray="tsArray"></barTeacherStudent>
  167. <!-- <barTime style="height: calc(100% / 4 - 10px);"></barTime> -->
  168. </div>
  169. <!-- <CourseTime v-if="!shType" style="height: calc(100% - 30px)"></CourseTime> -->
  170. <div class="info_box" v-if="shType">
  171. <div class="info blueBG" style="width: calc(100% / 4 - 10px)">
  172. <span>项目实施总数</span>
  173. <span>{{ haveWorksCourse }}</span>
  174. </div>
  175. <div class="info blueBG" style="width: calc(100% / 4 - 10px)">
  176. <span>平台实施项目占比</span>
  177. <span>{{ haveWorksCourse && allCourse ? (haveWorksCourse / allCourse * 100).toFixed(0) + '%' : 0 + '%'
  178. }}</span>
  179. </div>
  180. <div class="info blueBG" style="width: calc(100% / 4 - 10px)">
  181. <span>项目平均任务数量</span>
  182. <span>{{ taskCount && allCourse ? (taskCount / allCourse).toFixed(0) : 0 }}</span>
  183. </div>
  184. <div class="info blueBG" style="width: calc(100% / 4 - 10px)">
  185. <span>项目平均作业数量</span>
  186. <span>{{ worksCount && allCourse ? (worksCount / allCourse).toFixed(0) : 0 }}</span>
  187. </div>
  188. </div>
  189. <WorkNum v-if="shType" style="height: calc(100% - 105px)" :workNumList="workNumList"></WorkNum>
  190. <div class="otherCss">
  191. <div v-if="!shType">转换为散点图</div>
  192. <div v-if="shType">转换为堆积柱状图</div>
  193. <div class="otherImg" @click="shEchart">
  194. <img src="../../../../assets/icon/other.png" alt="" />
  195. </div>
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. <div class="right">
  201. <div class="top" style="border-radius: 5px">
  202. <div class="titleBox" style="justify-content: space-between">
  203. <div style="
  204. display: flex;
  205. flex-direction: row;
  206. flex-wrap: nowrap;
  207. align-items: center;
  208. ">
  209. <div class="title" :class="{ isClick: toolType == 0 }" @click="toolType = 0"
  210. style="cursor: pointer; padding: 0 0 5px 0">
  211. 项目占比
  212. </div>
  213. <div class="title" :class="{ isClick: toolType == 1 }" @click="toolType = 1"
  214. style="cursor: pointer; padding: 0 0 5px 0">
  215. 工具使用
  216. </div>
  217. </div>
  218. <el-select v-model="cType4" class="selectBox" style="width: 110px" v-if="toolType == 0 && courseNumberArray.length" @change="typeChange">
  219. <el-option label="赛道" value="box"></el-option>
  220. <el-option label="主题" value="theme"></el-option>
  221. </el-select>
  222. <!-- <div v-if="toolType == 1" style="
  223. display: flex;
  224. flex-direction: row;
  225. flex-wrap: nowrap;
  226. align-items: center;
  227. ">
  228. <el-select v-model="cType5" class="selectBox" style="width: 110px">
  229. <el-option label="全部学科" value="全部学科"></el-option>
  230. <el-option label="语文" value="语文"></el-option>
  231. <el-option label="数学" value="数学"></el-option>
  232. </el-select>
  233. <el-select v-model="cType6" class="selectBox" style="width: 110px">
  234. <el-option label="全部年级" value="全部年级"></el-option>
  235. <el-option label="一年级" value="一年级"></el-option>
  236. <el-option label="二年级" value="二年级"></el-option>
  237. </el-select>
  238. </div> -->
  239. </div>
  240. <div class="dataBox">
  241. <CourseAna style="height: calc(100% - 40px)" v-if="toolType == 0 && courseNumberArray.length" :courseNumberArray="courseNumberArray"></CourseAna>
  242. <ToolChart style="height: calc(100% - 40px)" v-if="toolType == 1" :toolArray="toolList"></ToolChart>
  243. </div>
  244. </div>
  245. <div class="bottom">
  246. <div class="titleBox">
  247. <div class="title">项目学科分布</div>
  248. </div>
  249. <div class="dataBox">
  250. <subjuect style="height: calc(100% - 30px)" v-if="!xtType"></subjuect>
  251. <WorkTime style="height: calc(100% - 30px)" v-if="xtType" :personArray="personList"></WorkTime>
  252. <div class="otherCss">
  253. <div v-if="!xtType">转换为人员协同</div>
  254. <div v-if="xtType">转换为学科协同</div>
  255. <div class="otherImg" @click="xtEchart">
  256. <img src="../../../../assets/icon/other.png" alt="" />
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. </div>
  262. </div>
  263. </template>
  264. <script>
  265. import TeaFre from "./chartList/teaFre.vue";
  266. import ToolUse from "./chartList/toolUse.vue";
  267. import CateRank from "./chartList/cateRank.vue";
  268. import WorkNum from "./chartList/workNum.vue";
  269. import CourseTime from "./chartList/courseTime.vue";
  270. import CourseAna from "./chartList/courseAna.vue";
  271. import WorkTime from "./chartList/workTime.vue";
  272. import Bar from "./chartList/bar.vue";
  273. import CourseNum from "./chartList/courseNum.vue";
  274. import ToolChart from "./chartList/toolChart.vue";
  275. import subjuect from "./chartList/subjuect.vue";
  276. import barFinish from "./chartList/bar/finish.vue";
  277. import barCCourse from "./chartList/bar/cCourse.vue";
  278. import barTeacherStudent from "./chartList/bar/teacherStudent.vue";
  279. import barTime from "./chartList/bar/time.vue";
  280. export default {
  281. components: {
  282. TeaFre,
  283. ToolUse,
  284. CateRank,
  285. WorkNum,
  286. CourseTime,
  287. CourseAna,
  288. WorkTime,
  289. Bar,
  290. CourseNum,
  291. ToolChart,
  292. subjuect,
  293. barFinish,
  294. barCCourse,
  295. barTeacherStudent,
  296. barTime,
  297. },
  298. props: {
  299. oid: {
  300. type: String,
  301. },
  302. org: {
  303. type: String,
  304. },
  305. },
  306. data() {
  307. return {
  308. isLoading: false,
  309. cType: "全部年级",
  310. cType1: "全部年级",
  311. cType2: "全部学科",
  312. cType3: "全部主题",
  313. cType4: "box",
  314. cType5: "全部学科",
  315. cType6: "全部年级",
  316. cType7: "全部课程",
  317. cType8: "全部年级",
  318. cType9: "全部学科",
  319. toolType: 0,
  320. tType: 0,
  321. skType: 1,
  322. courseType: 0,
  323. sType: 0,
  324. oType: false,
  325. shType: true,
  326. xtType: false,
  327. allCourse: 0,
  328. courseTemplate: 0,
  329. loginCountMonthArray: [],
  330. haveWorksCourse: 0,
  331. worksCount: 0,
  332. workNumList: [],
  333. taskCount: 0,
  334. toolList: [],
  335. personList: [],
  336. weekCourse: [],
  337. tsArray: {},
  338. gradeCourseList:[],
  339. subjectCourseList:[],
  340. courseNumberArray:[],
  341. courseArray: []
  342. };
  343. },
  344. mounted() {
  345. this.getData();
  346. },
  347. methods: {
  348. otherEchart() {
  349. this.oType = !this.oType;
  350. },
  351. shEchart() {
  352. this.shType = !this.shType;
  353. },
  354. xtEchart() {
  355. this.xtType = !this.xtType;
  356. },
  357. format(percentage) {
  358. return percentage + '%';
  359. },
  360. getMonth() {
  361. // 获取当前时间
  362. var currentDate = new Date();
  363. // 获取本月的年份和月份
  364. var currentYear = currentDate.getFullYear();
  365. var currentMonth = currentDate.getMonth() + 1; // 月份从0开始,需要加1
  366. // 获取上个月的年份和月份
  367. var lastMonthYear, lastMonth;
  368. if (currentMonth === 1) {
  369. lastMonthYear = currentYear - 1;
  370. lastMonth = 12;
  371. } else {
  372. lastMonthYear = currentYear;
  373. lastMonth = currentMonth - 1;
  374. }
  375. // 获取本月的第一天和最后一天的日期
  376. var firstDayOfMonth = new Date(currentYear, currentMonth - 1, 1);
  377. var lastDayOfMonth = new Date(currentYear, currentMonth, 0);
  378. // 获取上个月的第一天和最后一天的日期
  379. var firstDayOfLastMonth = new Date(lastMonthYear, lastMonth - 1, 1);
  380. var lastDayOfLastMonth = new Date(lastMonthYear, lastMonth, 0);
  381. // 构建本月日期的数组
  382. var currentMonthDates = [];
  383. for (var i = 1; i <= lastDayOfMonth.getDate(); i++) {
  384. let a = new Date(currentYear, currentMonth - 1, i)
  385. currentMonthDates.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
  386. }
  387. // 构建上个月日期的数组
  388. var lastMonthDates = [];
  389. for (var j = firstDayOfLastMonth.getDate(); j <= lastDayOfLastMonth.getDate(); j++) {
  390. let a = new Date(lastMonthYear, lastMonth - 1, j)
  391. lastMonthDates.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
  392. }
  393. return {
  394. lastWeek: lastMonthDates,//上月
  395. toWeek: currentMonthDates //本月
  396. }
  397. },
  398. getData() {
  399. this.isLoading = true;
  400. let params = [
  401. {
  402. oid: this.oid,
  403. org: this.org,
  404. },
  405. ];
  406. this.ajax
  407. .post(this.$store.state.api + "selectDataBoardStudentCourseNew", params)
  408. .then((res) => {
  409. this.isLoading = false;
  410. let _grade = JSON.parse(JSON.stringify(res.data[0])); //赛道
  411. let _subject = JSON.parse(JSON.stringify(res.data[1])); //主题
  412. this.allCourse = res.data[2][0].count; //课程总数
  413. let _timeCourse = res.data[3]; //查询半年内全部课程
  414. this.courseTemplate = res.data[4][0].count; //查询模板课程总数
  415. //将数据根据time里面的月份分成多个数组
  416. let loginCountMonthArray = [];
  417. const date = new Date();
  418. var Month = date.getMonth() + 1;
  419. var Year = date.getFullYear();
  420. for (var i = Month; i > Month - 6; i--) {
  421. if (i <= 0) {
  422. loginCountMonthArray.push({
  423. Year: Year - 1,
  424. Month: 12 + i,
  425. course: 0,
  426. });
  427. } else {
  428. loginCountMonthArray.push({
  429. Month: i,
  430. Year: Year,
  431. course: 0,
  432. });
  433. }
  434. }
  435. loginCountMonthArray = loginCountMonthArray.reverse();
  436. for (var i = 0; i < _timeCourse.length; i++) {
  437. let _date = new Date(_timeCourse[i].time);
  438. var _month = _date.getMonth() + 1;
  439. var _year = _date.getFullYear();
  440. for (var j = 0; j < loginCountMonthArray.length; j++) {
  441. if (
  442. _month == loginCountMonthArray[j].Month &&
  443. _year == loginCountMonthArray[j].Year
  444. ) {
  445. loginCountMonthArray[j].course++;
  446. break;
  447. }
  448. }
  449. }
  450. this.loginCountMonthArray = loginCountMonthArray;
  451. this.haveWorksCourse = res.data[5][0].count; //项目开展总数
  452. this.worksCount = res.data[6][0].count; //作业数量
  453. let worksArray = res.data[7];//一年内提交的作业
  454. let worksYearArray = []
  455. for (var i = Month; i > Month - 12; i--) {
  456. if (i <= 0) {
  457. worksYearArray.push({
  458. Year: Year - 1,
  459. Month: 12 + i,
  460. mon: 0,
  461. tue: 0,
  462. wed: 0,
  463. thur: 0,
  464. fri: 0,
  465. sat: 0,
  466. sun: 0,
  467. })
  468. } else {
  469. worksYearArray.push({
  470. Month: i,
  471. Year: Year,
  472. mon: 0,
  473. tue: 0,
  474. wed: 0,
  475. thur: 0,
  476. fri: 0,
  477. sat: 0,
  478. sun: 0,
  479. })
  480. }
  481. }
  482. worksYearArray = worksYearArray.reverse()
  483. for (var i = 0; i < worksArray.length; i++) {
  484. let _date = new Date(worksArray[i].create_at)
  485. var _month = _date.getMonth() + 1
  486. var _year = _date.getFullYear()
  487. var _day = _date.getDay()
  488. let dayArray = ['sun', 'mon', 'tue', 'wed', 'thur', 'fri', 'sat']
  489. for (var j = 0; j < worksYearArray.length; j++) {
  490. if (_month == worksYearArray[j].Month && _year == worksYearArray[j].Year) {
  491. worksYearArray[j][dayArray[_day]]++
  492. break;
  493. }
  494. }
  495. }
  496. console.log(worksYearArray);
  497. this.worksYearArray = worksYearArray
  498. let _workCourse = res.data[8]; //带作业的课程
  499. let _taskCount = 0 //任务数量
  500. var toolAllArray = [
  501. { name: "电子白板", value: 0 },
  502. { name: "思维导图", value: 0 },
  503. { name: "表格", value: 0 },
  504. { name: "文档", value: 0 },
  505. { name: "资源库", value: 0 },
  506. { name: "拍照", value: 0 },
  507. { name: "投票", value: 0 },
  508. { name: "CocoPi", value: 0 },
  509. { name: "其他", value: 0 },
  510. ];
  511. var twoPerson = 0, threePerson = 0, fivePerson = 0, sevenPerson = 0;
  512. let personList = []
  513. var wList = [];
  514. var today = new Date();
  515. var lastDayOfWeek = new Date(today.setDate(today.getDate() - today.getDay() + 7));;//本周周日
  516. let weekArray = {
  517. lastWeek: [],//上周
  518. toWeek: [] //本周
  519. }
  520. let weekCourse = [{
  521. name: '项目数量',
  522. lastWeekCouseCount: 0,
  523. toWeekCouseCount: 0
  524. }]
  525. // for (var i = 0; i < 14; i++) {
  526. // let time = JSON.parse(JSON.stringify(lastDayOfWeek))
  527. // let time2 = new Date(time)
  528. // var a = new Date(time2.setDate(time2.getDate() - i));
  529. // if (i > 6) {
  530. // weekArray.lastWeek.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
  531. // } else {
  532. // weekArray.toWeek.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
  533. // }
  534. // }
  535. weekArray = this.getMonth()
  536. var _tsArray = {
  537. tt: 0,
  538. ts: 0,
  539. ss: 0,
  540. } //记录项目的师生分工
  541. for (var i = 0; i < _workCourse.length; i++) {
  542. if (!wList[_workCourse[i].courseId]) {
  543. let _date = new Date(weekArray.lastWeek[0])
  544. if (new Date(_workCourse[i].create_at) > _date) {
  545. var a = new Date(_workCourse[i].create_at)
  546. var string = a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate()
  547. if (weekArray.lastWeek.indexOf(string) != -1) {
  548. weekCourse[0].lastWeekCouseCount++
  549. } else {
  550. weekCourse[0].toWeekCouseCount++
  551. }
  552. }
  553. if ((_workCourse[i].type == _workCourse[i].type2 == 1) || (!_workCourse[i].type2 && _workCourse[i].type == 1)) {
  554. _tsArray.tt++
  555. } else if ((_workCourse[i].type == 2 && _workCourse[i].type2 == 1) || (_workCourse[i].type == 1 && _workCourse[i].type2 == 2)) {
  556. _tsArray.ts++
  557. } else if ((_workCourse[i].type == _workCourse[i].type2 == 2) || (!_workCourse[i].type2 && _workCourse[i].type == 2)) {
  558. _tsArray.ss++
  559. } else {
  560. _tsArray.ts++
  561. }
  562. wList[_workCourse[i].courseId] = {
  563. cid: _workCourse[i].courseId,
  564. title: _workCourse[i].title,
  565. task: 0,
  566. work: 0,
  567. };
  568. let chapters = JSON.parse(_workCourse[i].chapters);
  569. for (var j = 0; j < chapters.length; j++) {
  570. if (wList[_workCourse[i].courseId].task == 0) {
  571. wList[_workCourse[i].courseId].task =
  572. chapters[j].chapterInfo[0].taskJson.length;
  573. } else {
  574. wList[_workCourse[i].courseId].task +=
  575. chapters[j].chapterInfo[0].taskJson.length;
  576. }
  577. _taskCount += chapters[j].chapterInfo[0].taskJson.length;
  578. let _taskJson = chapters[j].chapterInfo[0].taskJson
  579. for (
  580. var k = 0;
  581. k < _taskJson.length;
  582. k++
  583. ) {
  584. console.log(_taskJson[k].toolArray);
  585. for (
  586. var q = 0;
  587. q <
  588. _taskJson[k].toolArray ? _taskJson[k].toolArray.length : 0;
  589. q++
  590. ) {
  591. if (_taskJson[k].toolArray[q].tool == 1) {
  592. toolAllArray[0].value++;
  593. } else if (_taskJson[k].toolArray[q].tool == 3) {
  594. toolAllArray[1].value++;
  595. } else if (_taskJson[k].toolArray[q].tool == 48) {
  596. toolAllArray[2].value++;
  597. } else if (_taskJson[k].toolArray[q].tool == 52) {
  598. toolAllArray[3].value++;
  599. } else if (_taskJson[k].toolArray[q].tool == 51) {
  600. toolAllArray[4].value++;
  601. } else if (_taskJson[k].toolArray[q].tool == 54) {
  602. toolAllArray[5].value++;
  603. } else if (_taskJson[k].toolArray[q].tool == 56) {
  604. toolAllArray[6].value++;
  605. } else if (_taskJson[k].toolArray[q].tool == 57) {
  606. toolAllArray[7].value++;
  607. } else {
  608. toolAllArray[8].value++;
  609. }
  610. }
  611. }
  612. }
  613. if (_workCourse[i].course_teacher) {
  614. if (_workCourse[i].course_teacher.split(',').length <= 2) {
  615. twoPerson++
  616. } else if (4 >= _workCourse[i].course_teacher.split(',').length && _workCourse[i].course_teacher.split(',').length > 2) {
  617. threePerson++;
  618. } else if (6 >= _workCourse[i].course_teacher.split(',').length && _workCourse[i].course_teacher.split(',').length > 4) {
  619. fivePerson++;
  620. } else if (_workCourse[i].course_teacher.split(',').length >= 7) {
  621. sevenPerson++;
  622. }
  623. }
  624. }
  625. }
  626. for (var i = 0; i < _workCourse.length; i++) {
  627. let a = Object.keys(wList);
  628. for (var j = 0; j < Object.keys(wList).length; j++) {
  629. if (_workCourse[i].courseId == wList[a[j]].cid && _workCourse[i].id) {
  630. wList[a[j]].work++;
  631. }
  632. }
  633. }
  634. var workNumList = Object.values(wList).map((item) => [
  635. item.task,
  636. item.work,
  637. item.title,
  638. item.cid,
  639. ]);
  640. this.workNumList = workNumList;
  641. this.taskCount = _taskCount
  642. this.toolList = toolAllArray;
  643. personList.push({ name: "2人以下", value: twoPerson }, { name: "3-4人", value: threePerson }, { name: "5-6人", value: fivePerson }, { name: "7人以上", value: sevenPerson });
  644. this.personList = personList;
  645. this.weekCourse = weekCourse;
  646. this.tsArray = _tsArray
  647. let _course = res.data[9]
  648. let _gradeCourseList = []
  649. let _subjectCourseList = []
  650. for (var i = 0; i < _grade.length; i++) {
  651. _gradeCourseList.push({
  652. name: _grade[i].name,
  653. typeid: _grade[i].id,
  654. course: 0,
  655. array: []
  656. })
  657. for (var z = 0; z < _course.length; z++) {
  658. if (_course[z].typeid == _grade[i].id) {
  659. _gradeCourseList[i].course++
  660. _gradeCourseList[i].array.push(_course[z].courseid)
  661. }
  662. }
  663. }
  664. for (var i = 0; i < _subject.length; i++) {
  665. _subjectCourseList.push({
  666. name: _subject[i].name,
  667. typeid: _subject[i].id,
  668. course: 0,
  669. array: []
  670. })
  671. for (var z = 0; z < _course.length; z++) {
  672. if (_course[z].typeid == _subject[i].id) {
  673. _subjectCourseList[i].course++
  674. _subjectCourseList[i].array.push(_course[z].courseid)
  675. }
  676. }
  677. }
  678. this.gradeCourseList = _gradeCourseList
  679. this.subjectCourseList = _subjectCourseList
  680. this.typeChange()
  681. let _courseArray = []
  682. let _gradeCourse = 0 //各年级上传课程
  683. let _subjectCourse = 0 //各学科上传课程
  684. _subject.push({ name: '其他' })
  685. for (var i = 0; i < _grade.length; i++) {
  686. _courseArray.push({
  687. name: _grade[i].name,
  688. id: _grade[i].id,
  689. courseid: [],
  690. subject: [],
  691. })
  692. for (var z = 0; z < _course.length; z++) {
  693. if (_course[z].typeid == _grade[i].id) {
  694. _gradeCourse++
  695. if (_courseArray[i].courseid.indexOf(_course[z].courseid) === -1) {
  696. _courseArray[i].courseid.push(_course[z].courseid)
  697. }
  698. }
  699. }
  700. for (var j = 0; j < _subject.length; j++) {
  701. _courseArray[i].subject.push({
  702. name: _subject[j].name,
  703. id: _subject[j].id,
  704. course: 0
  705. })
  706. for (var z = 0; z < _course.length; z++) {
  707. if (_course[z].typeid == _subject[j].id && _courseArray[i].courseid.indexOf(_course[z].courseid) !== -1) {
  708. _courseArray[i].subject[j].course++
  709. }
  710. }
  711. }
  712. let sum = 0
  713. for (var j = 0; j < _courseArray[i].subject.length - 1; j++) {
  714. sum += _courseArray[i].subject[j].course
  715. }
  716. _courseArray[i].subject[_courseArray[i].subject.length - 1].course = (_courseArray[i].courseid.length - sum) < 0 ? 0 : _courseArray[i].courseid.length - sum
  717. }
  718. for (var j = 0; j < _subject.length; j++) {
  719. for (var z = 0; z < _course.length; z++) {
  720. if (_course[z].typeid == _subject[j].id) {
  721. _subjectCourse++
  722. }
  723. }
  724. }
  725. this.courseArray = _courseArray
  726. this.$forceUpdate();
  727. })
  728. .catch((err) => {
  729. this.isLoading = false;
  730. console.error(err);
  731. });
  732. },
  733. typeChange() {
  734. if (this.cType4 === 'box') {
  735. this.courseNumberArray = this.gradeCourseList
  736. } else if (this.cType4 === 'theme') {
  737. this.courseNumberArray = this.subjectCourseList
  738. }
  739. this.$forceUpdate();
  740. },
  741. },
  742. };
  743. </script>
  744. <style scoped>
  745. .body1 {
  746. width: 100%;
  747. height: 100%;
  748. display: flex;
  749. padding: 20px;
  750. box-sizing: border-box;
  751. overflow: hidden;
  752. }
  753. .left {
  754. width: calc(100% / 4 * 1);
  755. height: 100%;
  756. }
  757. .left>.top {
  758. width: 100%;
  759. height: calc(100% / 2 - 10px);
  760. background: #fff;
  761. border-radius: 5px;
  762. margin: 0 0 20px 0;
  763. }
  764. .left>.bottom {
  765. width: 100%;
  766. height: calc(100% / 2 - 10px);
  767. background: #fff;
  768. border-radius: 5px;
  769. }
  770. .center {
  771. width: calc(100% / 4 * 2 - 40px);
  772. height: 100%;
  773. margin: 0 20px;
  774. }
  775. .center>.top {
  776. width: 100%;
  777. height: calc(100% / 5 * 3 - 10px);
  778. background: #fff;
  779. border-radius: 5px;
  780. margin: 0 0 20px 0;
  781. }
  782. .center>.bottom {
  783. width: 100%;
  784. height: calc(100% / 5 * 2 - 10px);
  785. background: #fff;
  786. border-radius: 5px;
  787. }
  788. .right {
  789. width: calc(100% / 4 * 1);
  790. height: 100%;
  791. }
  792. .right>.top {
  793. width: 100%;
  794. height: calc(100% / 2 - 10px);
  795. background: #fff;
  796. border-radius: 16px;
  797. margin: 0 0 20px 0;
  798. }
  799. .right>.bottom {
  800. width: 100%;
  801. height: calc(100% / 2 - 10px);
  802. background: #fff;
  803. border-radius: 5px;
  804. }
  805. .titleBox {
  806. height: 40px;
  807. display: flex;
  808. align-items: center;
  809. padding: 0 15px;
  810. box-sizing: border-box;
  811. width: 100%;
  812. }
  813. .dataBox {
  814. height: calc(100% - 40px);
  815. width: 100%;
  816. }
  817. .middleBox {
  818. display: flex;
  819. flex-direction: row;
  820. flex-wrap: nowrap;
  821. align-items: flex-start;
  822. }
  823. .title {
  824. color: #060e17;
  825. margin-right: 10px;
  826. }
  827. .teaMiddle {
  828. width: calc(100% / 2 - 10px);
  829. height: 60px;
  830. border-radius: 8px;
  831. /* border: 1px solid #e0eafb; */
  832. display: flex;
  833. flex-direction: column;
  834. align-items: flex-start;
  835. justify-content: center;
  836. padding: 0 10px;
  837. margin: 0 10px;
  838. }
  839. .teaMiddle {
  840. width: calc(100% / 3 - 10px);
  841. }
  842. .cNum {
  843. background: linear-gradient(180deg,
  844. rgb(125, 227, 174, 0.2) 0%,
  845. rgb(23, 196, 105, 0.3) 100%) !important;
  846. }
  847. .tNum {
  848. background: linear-gradient(180deg,
  849. rgb(174, 204, 254, 0.2) 0%,
  850. rgb(54, 129, 252, 0.3) 100%) !important;
  851. }
  852. .tSum {
  853. background: linear-gradient(180deg,
  854. rgb(125, 227, 174, 0.2) 0%,
  855. rgb(23, 196, 105, 0.3) 100%) !important;
  856. }
  857. .teaLeft>div:first-child,
  858. .teaMiddle>div:first-child {
  859. font-size: 12px;
  860. font-weight: 400;
  861. color: #565e6a;
  862. }
  863. .teaLeft>div:last-child,
  864. .teaMiddle>div:last-child {
  865. font-size: 22px;
  866. font-weight: bold;
  867. color: #060e17;
  868. }
  869. .halfBox {
  870. width: 50%;
  871. height: 100%;
  872. }
  873. .selectBox {
  874. width: 80px;
  875. margin-left: 10px;
  876. }
  877. .selectBox>>>.el-input__inner {
  878. height: 30px;
  879. line-height: 30px;
  880. }
  881. .selectBox>>>.el-input__icon {
  882. line-height: 30px;
  883. }
  884. .timeDiv {
  885. display: flex;
  886. flex-direction: row;
  887. flex-wrap: nowrap;
  888. align-items: center;
  889. margin: 0 0 0 15px;
  890. }
  891. .timeDiv>div {
  892. margin-right: 10px;
  893. cursor: pointer;
  894. }
  895. .isClick {
  896. color: #1684fc;
  897. border-bottom: 2px solid #1684fc;
  898. box-sizing: border-box;
  899. }
  900. .otherCss {
  901. display: flex;
  902. flex-direction: row;
  903. flex-wrap: nowrap;
  904. align-items: center;
  905. justify-content: flex-end;
  906. }
  907. .otherImg {
  908. width: 20px;
  909. height: 20px;
  910. margin: 0 10px;
  911. cursor: pointer;
  912. }
  913. .otherImg>img {
  914. width: 100%;
  915. height: 100%;
  916. }
  917. .allBox {
  918. width: 100%;
  919. height: 100%;
  920. display: flex;
  921. flex-direction: row;
  922. flex-wrap: nowrap;
  923. align-items: center;
  924. }
  925. .allBox_left {
  926. width: 30%;
  927. height: 100%;
  928. }
  929. .allBox_right {
  930. display: flex;
  931. flex-wrap: wrap;
  932. height: 100%;
  933. width: 70%;
  934. margin: 0 auto;
  935. overflow: hidden;
  936. justify-content: space-between;
  937. }
  938. .depth {
  939. width: calc(100% / 4 - 10px);
  940. display: flex;
  941. flex-direction: column;
  942. align-items: center;
  943. justify-content: center;
  944. }
  945. .depth>span:nth-child(1) {
  946. font-size: 14px;
  947. font-weight: 700;
  948. margin: 0 0 10px;
  949. }
  950. .depth>div:nth-child(1) {}
  951. .info_box {
  952. display: flex;
  953. flex-wrap: wrap;
  954. align-items: center;
  955. justify-content: space-between;
  956. width: 90%;
  957. margin: 0 auto;
  958. }
  959. .info_box>.info2,
  960. .info_box>.info3,
  961. .info_box>.info {
  962. width: calc(50% - 10px);
  963. display: flex;
  964. flex-direction: row;
  965. flex-wrap: nowrap;
  966. height: 60px;
  967. justify-content: space-between;
  968. align-items: center;
  969. padding: 0 10px;
  970. box-sizing: border-box;
  971. margin-bottom: 10px;
  972. border-radius: 5px;
  973. }
  974. .info_box>.info2 {
  975. width: calc(100% / 4 - 10px);
  976. /* align-items: flex-end; */
  977. }
  978. .info_box>.info3 {
  979. width: 100%;
  980. margin-bottom: 5px;
  981. }
  982. .info_box>.info2>span:nth-child(1),
  983. .info_box>.info3>span:nth-child(1),
  984. .info_box>.info>span:nth-child(1) {
  985. font-size: 12px;
  986. /* margin: 0 0 0 20px; */
  987. color: #565e6a;
  988. width: 60px;
  989. white-space: pre-wrap;
  990. word-break: break-all;
  991. }
  992. .info_box>.info2>span:nth-child(2),
  993. .info_box>.info3>span:nth-child(2),
  994. .info_box>.info>span:nth-child(2) {
  995. font-size: 24px;
  996. /* font-weight: 700; */
  997. }
  998. .blueBG {
  999. background: rgb(243, 248, 253);
  1000. border: 2px solid rgb(234, 246, 255);
  1001. }
  1002. </style>