12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069 |
- <template>
- <div class="body1">
- <loading :isLoading="isLoading"></loading>
- <!-- 课程数据 -->
- <div class="left">
- <div class="top">
- <div class="titleBox" style="justify-content: space-between">
- <div class="title">基础概况</div>
- <!-- <el-select v-model="cType7" class="selectBox" style="width: 110px">
- <el-option label="全部课程" value="全部课程"></el-option>
- </el-select> -->
- </div>
- <div class="dataBox">
- <div class="info_box">
- <div class="info blueBG">
- <span>课程总数</span>
- <!-- <span>{{ count }}</span> -->
- <span>{{ allCourse }}</span>
- </div>
- <div class="info blueBG">
- <span>本月新增课程环比</span>
- <span v-if="loginCountMonthArray.length">{{
- loginCountMonthArray[loginCountMonthArray.length - 1].course > 0
- ? (
- (loginCountMonthArray[loginCountMonthArray.length - 1]
- .course /
- allCourse) *
- 100
- ).toFixed(0) + "%"
- : 0
- }}</span>
- <!-- <span>{{ weekCount }}</span> -->
- <!-- <span v-if="loginCountMonthArray.length">{{
- loginCountMonthArray[loginCountMonthArray.length - 1].course -
- loginCountMonthArray[loginCountMonthArray.length - 2].course < 0 ? 0 : (
- ((loginCountMonthArray[loginCountMonthArray.length - 1].course -
- loginCountMonthArray[loginCountMonthArray.length - 2].course) / (allCourse -
- loginCountMonthArray[loginCountMonthArray.length - 1].course)) * 100).toFixed(0) + "%" }}</span> -->
- </div>
- <div class="info blueBG">
- <span>模板课程总数</span>
- <span>{{ 0 }}</span>
- <!-- <span>{{ courseTemplate }}</span> -->
- </div>
- <div class="info blueBG">
- <span>本月新增课程总数</span>
- <!-- <span>{{ weekCount }}</span> -->
- <span v-if="loginCountMonthArray.length">{{
- loginCountMonthArray[loginCountMonthArray.length - 1].course
- }}</span>
- </div>
- </div>
- <TeaFre style="height: calc(100% - 140px)" :monthArray="loginCountMonthArray"></TeaFre>
- </div>
- </div>
- <div class="bottom">
- <div class="titleBox">
- <div class="title" :class="{ isClick: skType == 0, noClick: skType != 0 }" @click="skType = 0"
- style="cursor: pointer; padding: 0 0 5px 0">
- 授课时长
- </div>
- <div class="title" :class="{ isClick: skType == 1, noClick: skType != 1 }" @click="skType = 1"
- style="cursor: pointer; padding: 0 0 5px 0">
- 作业数量
- </div>
- <el-select v-if="skType == 0" v-model="lType" @change="typeChange1" class="selectBox" style="margin-left: auto">
- <!-- <el-option label="全部" value="all"></el-option> -->
- <el-option label="年级" value="grade"></el-option>
- <el-option label="主题" value="theme"></el-option>
- <el-option label="学科" value="subject"></el-option>
- </el-select>
- <el-select v-if="skType == 1" v-model="lType1" @change="typeChange2" class="selectBox"
- style="margin-left: auto">
- <!-- <el-option label="全部" value="all"></el-option> -->
- <el-option label="年级" value="grade"></el-option>
- <el-option label="主题" value="theme"></el-option>
- <el-option label="学科" value="subject"></el-option>
- </el-select>
- <!-- <el-select v-model="cType" class="selectBox" style="width: 110px">
- <el-option label="全部年级" value="全部年级"></el-option>
- <el-option label="一年级" value="一年级"></el-option>
- <el-option label="二年级" value="二年级"></el-option>
- <el-option label="三年级" value="三年级"></el-option>
- </el-select>
- <div class="timeDiv">
- <div @click="tType = 0" :class="{ isClick: tType == 0 }">周</div>
- <div @click="tType = 1" :class="{ isClick: tType == 1 }">月</div>
- <div @click="tType = 2" :class="{ isClick: tType == 2 }">学期</div>
- </div> -->
- </div>
- <div class="dataBox">
- <div class="info_box" style="width: 96%" v-if="skType == 0">
- <div class="info blueBG" style="width: calc(100% / 3 - 10px)">
- <span>累计时长</span>
- <!-- <span>{{ count }}</span> -->
- <span>{{ allTime }}</span>
- </div>
- <div class="info blueBG" style="width: calc(100% / 3 - 10px)">
- <span>课程实施总数</span>
- <!-- <span>{{ weekCount }}</span> -->
- <span>{{ courseLength }}</span>
- </div>
- <div class="info blueBG" style="width: calc(100% / 3 - 10px)">
- <span>课均时长</span>
- <!-- <span>{{ weekCount }}</span> -->
- <span>{{
- allTime == 0 ? 0 : (allTime / courseLength).toFixed(0)
- }}</span>
- </div>
- </div>
- <div class="info_box" style="width: 96%" v-if="skType == 1">
- <div class="info blueBG" style="width: calc(100% / 3 - 10px)">
- <span>作业数量</span>
- <!-- <span>{{ count }}</span> -->
- <span>{{ worksCount }}</span>
- </div>
- <div class="info blueBG" style="width: calc(100% / 3 - 10px)">
- <span>课程开展总数</span>
- <!-- <span>{{ weekCount }}</span> -->
- <span>{{ haveWorksCourse }}</span>
- </div>
- <div class="info blueBG" style="width: calc(100% / 3 - 10px)">
- <span>课程平均作业数量</span>
- <!-- <span>{{ weekCount }}</span> -->
- <span>{{
- worksCount == 0 ? 0 : (worksCount / haveWorksCourse).toFixed(0)
- }}</span>
- </div>
- </div>
- <Bar style="height: calc(100% - 120px)" v-if="skType == 0 && !oType" :workList="tedurArray"></Bar>
- <ToolUse2 style="height: calc(100% - 120px)" v-if="skType == 0 && oType" :Josn="courseWorksCountYearArray2">
- </ToolUse2>
- <ToolUse style="height: calc(100% - 120px)" v-if="skType == 1 && !oType2" :Josn="courseWorksCountYearArray">
- </ToolUse>
- <Bar2 style="height: calc(100% - 120px)" v-if="skType == 1 && oType2" :workList="tedurArray2"></Bar2>
- <!-- <div class="otherCss" v-if="skType == 0">
- <div v-if="!oType">切换为热力图</div>
- <div v-if="oType">切换为柱状图</div>
- <div class="otherImg" @click="otherEchart">
- <img src="../../../../assets/icon/other.png" alt="" />
- </div>
- </div>
- <div class="otherCss" v-if="skType == 1">
- <div v-if="!oType2">切换为柱状图</div>
- <div v-if="oType2">切换为热力图</div>
- <div class="otherImg" @click="otherEchart2">
- <img src="../../../../assets/icon/other.png" alt="" />
- </div>
- </div> -->
- <div class="dataBoard_check_box" v-if="skType == 0">
- <div class="icon zz_icon2" :class="{ active: !oType }" @click="oType = false"><span>柱状图</span></div>
- <div class="icon rl_icon" :class="{ active: oType }" @click="oType = true"><span>热力图</span></div>
- </div>
- <div class="dataBoard_check_box" v-if="skType == 1">
- <div class="icon zz_icon2" :class="{ active: oType2 }" @click="oType2 = true"><span>柱状图</span></div>
- <div class="icon rl_icon" :class="{ active: !oType2 }" @click="oType2 = false"><span>热力图</span></div>
- </div>
- </div>
- </div>
- </div>
- <div class="center">
- <div class="top">
- <div class="courseCenterTop">
- <div class="titleBox">
- <div class="title" :class="{ isClick: courseType == 0, noClick: courseType != 0 }" @click="courseType = 0"
- style="cursor: pointer; padding: 0 0 5px 0">
- 课程分布
- </div>
- <div class="title" :class="{ isClick: courseType == 1, noClick: courseType != 1 }" @click="courseType = 1"
- style="cursor: pointer; padding: 0 0 5px 0">
- 课程总数变化
- </div>
- </div>
- <div class="allScreen" @click="allScreen = true">
- <img src="../../../../assets/icon/new/allScreen.png" alt="" />
- </div>
- </div>
- <div class="dataBox">
- <CateRank v-if="courseType == 0" style="height: calc(100% - 10px)" :courseArray="courseArray"></CateRank>
- <CourseNum v-if="courseType == 1" style="height: calc(100%)" :weekCourse2="weekCourse2"></CourseNum>
- </div>
- </div>
- <div class="bottom">
- <div class="titleBox" style="justify-content: space-between">
- <div class="title">课程实施程度</div>
- </div>
- <div class="dataBox">
- <div class="allBox" v-if="!shType" style="height: calc(100% - 50px)">
- <div class="allBox_left">
- <CourseTime v-if="!shType" :pusaDep="pusaDep"></CourseTime>
- </div>
- <div class="allBox_right">
- <div class="depth">
- <span>已提交作业</span>
- <div>
- <el-progress :width="80" type="circle" :percentage="allCourse
- ? parseInt(
- ((haveWorksCourse / allCourse) * 100).toFixed(0)
- )
- : 0
- " :stroke-width="5" :format="format" color="#106BFF"></el-progress>
- </div>
- </div>
- <div class="depth">
- <span>设置评价</span>
- <div>
- <el-progress :width="80" type="circle" :percentage="allCourse
- ? parseInt(((evaCount / allCourse) * 100).toFixed(0))
- : 0
- " :stroke-width="5" :format="format" color="#106BFF"></el-progress>
- </div>
- </div>
- <div class="depth">
- <span>已评价课程</span>
- <div>
- <el-progress :width="80" type="circle" :percentage="allCourse
- ? parseInt(
- ((evaWorksCount / allCourse) * 100).toFixed(0)
- )
- : 0
- " :stroke-width="5" :format="format" color="#106BFF"></el-progress>
- </div>
- </div>
- <div class="depth">
- <span>教学评一体化</span>
- <div>
- <el-progress :width="80" type="circle" :percentage="allCourse
- ? parseInt(
- ((evaWorksCount / allCourse) * 100).toFixed(0)
- )
- : 0
- " :stroke-width="5" :format="format" color="#106BFF"></el-progress>
- </div>
- </div>
- </div>
- </div>
- <div class="info_box" v-if="shType">
- <div class="info blueBG" style="width: calc(100% / 4 - 10px)">
- <span>平台实施课程总数</span>
- <!-- <span>{{ count }}</span> -->
- <span>{{ isCourseCount }}</span>
- </div>
- <div class="info blueBG" style="width: calc(100% / 4 - 10px)">
- <span>平台实施课程占比</span>
- <!-- <span>{{ weekCount }}</span> -->
- <span>{{
- isCourseCount
- ? ((isCourseCount / allCourseCount) * 100).toFixed(0) + "%"
- : "0%"
- }}</span>
- </div>
- <div class="info blueBG" style="width: calc(100% / 4 - 10px)">
- <span>课程平均任务数量</span>
- <!-- <span>{{ weekCount }}</span> -->
- <span>{{
- isCourseCount ? (taskCount / isCourseCount).toFixed(0) : 0
- }}</span>
- </div>
- <div class="info blueBG" style="width: calc(100% / 4 - 10px)">
- <span>课程平均作业数量</span>
- <!-- <span>{{ weekCount }}</span> -->
- <span>{{
- isCourseCount ? (workCount / isCourseCount).toFixed(0) : 0
- }}</span>
- </div>
- </div>
- <WorkNum style="height: calc(100% - 115px)" :workNumList="workNumList" @openCourse="openCourse" v-if="shType">
- </WorkNum>
- <!-- <div class="otherCss">
- <div v-if="!shType">转换为散点图</div>
- <div v-if="shType">转换为漏斗图</div>
- <div class="otherImg" @click="shEchart">
- <img src="../../../../assets/icon/other.png" alt="" />
- </div>
- </div> -->
- <div class="dataBoard_check_box">
- <div class="icon sd_icon" :class="{ active: shType }" @click="shType = true"><span>散点图</span></div>
- <div class="icon ld_icon" :class="{ active: !shType }" @click="shType = false"><span>漏斗图</span></div>
- </div>
- </div>
- </div>
- </div>
- <div class="right">
- <div class="top" style="border-radius: 5px">
- <div class="titleBox" style="justify-content: space-between">
- <div style="
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- align-items: center;
- ">
- <div class="title" :class="{ isClick: toolType == 0, noClick: toolType != 0 }" @click="toolType = 0"
- style="cursor: pointer; padding: 0 0 5px 0">
- 课程占比
- </div>
- <div class="title" :class="{ isClick: toolType == 1, noClick: toolType != 1 }" @click="toolType = 1"
- style="cursor: pointer; padding: 0 0 5px 0">
- 工具使用
- </div>
- </div>
- <el-select v-model="cType4" @change="typeChange" class="selectBox" v-if="toolType == 0">
- <!-- <el-option label="全部" value=""></el-option> -->
- <el-option label="年级" value="grade"></el-option>
- <el-option label="主题" value="theme"></el-option>
- <el-option label="学科" value="subject"></el-option>
- </el-select>
- </div>
- <div class="dataBox">
- <CourseAna style="height: calc(100%)" :courseNumberArray="courseNumberArray" v-if="toolType == 0"></CourseAna>
- <ToolChart style="height: calc(100%)" :toolArray="toolList" v-if="toolType == 1"></ToolChart>
- </div>
- </div>
- <div class="bottom">
- <div class="titleBox">
- <div class="title">课程协同情况</div>
- </div>
- <div class="dataBox">
- <WorkTime style="height: calc(100% - 45px)" :personArray="personList" v-if="xtType"></WorkTime>
- <Subjuect style="height: calc(100% - 45px)" v-if="!xtType" :resultSubject="resultSubject"></Subjuect>
- <!-- <div class="otherCss">
- <div v-if="!xtType">转换为人员协同</div>
- <div v-if="xtType">转换为学科协同</div>
- <div class="otherImg" @click="xtEchart">
- <img src="../../../../assets/icon/other.png" alt="" />
- </div>
- </div> -->
- <div class="dataBoard_check_box">
- <div class="icon hx_icon" :class="{ active: !xtType }" @click="xtType = false"><span>和弦图</span></div>
- <div class="icon bz_icon" :class="{ active: xtType }" @click="xtType = true"><span>饼状图</span></div>
- </div>
- </div>
- </div>
- </div>
- <el-dialog title="课程分布" :visible.sync="allScreen" :append-to-body="true" width="100%" :before-close="handleClose"
- class="dialog_diy">
- <CateRank v-if="courseType == 0" style="height: calc(100%)" :courseArray="courseArray"></CateRank>
- <CourseNum v-if="courseType == 1" style="height: calc(100%)" :weekCourse2="weekCourse2"></CourseNum>
- </el-dialog>
- </div>
- </template>
- <script>
- import TeaFre from "./chartList/teaFre.vue";
- import ToolUse from "./chartList/toolUse.vue";
- import ToolUse2 from "./chartList/toolUse2.vue";
- import CateRank from "./chartList/cateRank.vue";
- import WorkNum from "./chartList/workNum.vue";
- import CourseTime from "./chartList/courseTime.vue";
- import CourseAna from "./chartList/courseAna.vue";
- import WorkTime from "./chartList/workTime.vue";
- import Bar from "./chartList/bar.vue";
- import Bar2 from "./chartList/bar2.vue";
- import CourseNum from "./chartList/courseNum.vue";
- import ToolChart from "./chartList/toolChart.vue";
- import Subjuect from "./chartList/subjuect.vue";
- import loading from "../../components/loading.vue";
- export default {
- components: {
- TeaFre,
- ToolUse,
- ToolUse2,
- CateRank,
- WorkNum,
- CourseTime,
- CourseAna,
- WorkTime,
- Bar,
- Bar2,
- CourseNum,
- ToolChart,
- Subjuect,
- loading,
- },
- props: {
- oid: {
- type: String,
- },
- org: {
- type: String,
- },
- },
- data() {
- return {
- isLoading: false,
- cType: "全部年级",
- cType4: "grade",
- cType7: "全部课程",
- toolType: 0,
- tType: 0,
- skType: 0,
- courseType: 0,
- sType: 0,
- oType: false,
- oType2: false,
- shType: true,
- xtType: false,
- allCourse: 0,
- courseTemplate: 0,
- loginCountMonthArray: [],
- lType: "grade",
- lType1: "grade",
- allTimeList: [],
- tedurArray: [],
- tedurArray2: [],
- classList: [],
- subjectList: [],
- themeList: [],
- allTime: 0,
- allTimeLength: 0,
- gradeLength: 0,
- subjectLength: 0,
- themeLength: 0,
- courseTList: [],
- courseLength: 0,
- courseWorksCountYearArray: [],
- courseWorksCountYearArray2: [],
- allCourseWorks: [],
- allCourseWorks1: [],
- gradeList: [],
- subjectList2: [],
- thList: [],
- worksCount: 0,
- haveWorksCourse: 0,
- courseNumberArray: [],
- gradeArray: [],
- subjectArray: [],
- themeArray: [],
- allArray: [],
- toolList: [],
- personList: [],
- workNumList: [],
- taskCount: 0,
- workCount: 0,
- isCourseCount: 0,
- allCourseCount: 0,
- courseArray: [],
- evaCount: 0,
- evaWorksCount: 0,
- pusaDep: [
- { value: 0, name: "课程总数" },
- { value: 0, name: "设置评价课程" },
- { value: 0, name: "已提交作业课程" },
- { value: 0, name: "已评价课程" },
- { value: 0, name: "教学评一体化课程" },
- ],
- weekCourse2: [],
- resultSubject: [],
- allScreen: false,
- };
- },
- mounted() {
- this.getData();
- },
- methods: {
- handleClose(done) {
- done();
- },
- openCourse(cid) {
- window.parent.postMessage({ cid: cid, screenType: "3" }, "*");
- },
- otherEchart() {
- this.oType = !this.oType;
- },
- otherEchart2() {
- this.oType2 = !this.oType2;
- },
- shEchart() {
- this.shType = !this.shType;
- },
- xtEchart() {
- this.xtType = !this.xtType;
- },
- format(percentage) {
- return percentage + "%";
- },
- getMonth() {
- // 获取当前时间
- var currentDate = new Date();
- // 获取本月的年份和月份
- var currentYear = currentDate.getFullYear();
- var currentMonth = currentDate.getMonth() + 1; // 月份从0开始,需要加1
- // 获取上个月的年份和月份
- var lastMonthYear, lastMonth;
- if (currentMonth === 1) {
- lastMonthYear = currentYear - 1;
- lastMonth = 12;
- } else {
- lastMonthYear = currentYear;
- lastMonth = currentMonth - 1;
- }
- // 获取本月的第一天和最后一天的日期
- var firstDayOfMonth = new Date(currentYear, currentMonth - 1, 1);
- var lastDayOfMonth = new Date(currentYear, currentMonth, 0);
- // 获取上个月的第一天和最后一天的日期
- var firstDayOfLastMonth = new Date(lastMonthYear, lastMonth - 1, 1);
- var lastDayOfLastMonth = new Date(lastMonthYear, lastMonth, 0);
- // 构建本月日期的数组
- var currentMonthDates = [];
- for (var i = 1; i <= lastDayOfMonth.getDate(); i++) {
- let a = new Date(currentYear, currentMonth - 1, i);
- currentMonthDates.push(
- a.getFullYear() + "-" + (a.getMonth() + 1) + "-" + a.getDate()
- );
- }
- // 构建上个月日期的数组
- var lastMonthDates = [];
- for (
- var j = firstDayOfLastMonth.getDate();
- j <= lastDayOfLastMonth.getDate();
- j++
- ) {
- let a = new Date(lastMonthYear, lastMonth - 1, j);
- lastMonthDates.push(
- a.getFullYear() + "-" + (a.getMonth() + 1) + "-" + a.getDate()
- );
- }
- return {
- lastWeek: lastMonthDates, //上月
- toWeek: currentMonthDates, //本月
- };
- },
- typeChange1() {
- var a = [];
- if (this.lType == "all") {
- // a = this.classList.concat(this.subjectList, this.themeList);
- a = this.allTimeList;
- this.courseLength = this.allTimeLength;
- } else if (this.lType == "grade") {
- a = this.classList;
- this.courseLength = this.gradeLength;
- } else if (this.lType == "subject") {
- a = this.subjectList;
- this.courseLength = this.subjectLength;
- } else {
- a = this.themeList;
- this.courseLength = this.themeLength;
- }
- this.tedurArray = a;
- var time = 0;
- for (var i = 0; i < a.length; i++) {
- if (a[i].time) {
- time += a[i].time;
- }
- }
- this.allTime = time;
- const date = new Date();
- var Month = date.getMonth() + 1;
- var Year = date.getFullYear();
- let courseWorksCountYearArray = {};
- let timeArray = [];
- for (var i = 0; i < this.courseTList.length; i++) {
- timeArray.push({
- vtime: this.courseTList[i].time,
- time: this.courseTList[i].text,
- });
- }
- for (var i = 0; i < this.courseTList.length; i++) {
- let _type = this.courseTList[i].type
- ? this.courseTList[i].type.split(",")
- : [];
- if (this.lType1 == "all") {
- if (this.courseTList[i].text) {
- timeArray.forEach((item) => {
- courseWorksCountYearArray[item.vtime] = parseInt(
- (item.time / 60 / 60).toFixed(0)
- );
- });
- }
- } else if (this.lType1 == "grade") {
- if (this.hasCommonValue(this.gradeList, _type)) {
- if (this.courseTList[i].text) {
- timeArray.forEach((item) => {
- courseWorksCountYearArray[item.vtime] = parseInt(
- (item.time / 60 / 60).toFixed(0)
- );
- });
- }
- }
- } else if (this.lType1 == "subject") {
- if (this.hasCommonValue(this.subjectList2, _type)) {
- if (this.courseTList[i].text) {
- timeArray.forEach((item) => {
- courseWorksCountYearArray[item.vtime] = parseInt(
- (item.time / 60 / 60).toFixed(0)
- );
- });
- }
- }
- } else {
- if (this.hasCommonValue(this.thList, _type)) {
- if (this.courseTList[i].text) {
- timeArray.forEach((item) => {
- courseWorksCountYearArray[item.vtime] = parseInt(
- (item.time / 60 / 60).toFixed(0)
- );
- });
- }
- }
- }
- }
- // for (var i = Month; i > Month - 12; i--) {
- // if (i <= 0) {
- // courseWorksCountYearArray.push({
- // Year: Year - 1,
- // Month: 12 + i,
- // mon: 0,
- // tue: 0,
- // wed: 0,
- // thur: 0,
- // fri: 0,
- // sat: 0,
- // sun: 0,
- // });
- // } else {
- // courseWorksCountYearArray.push({
- // Month: i,
- // Year: Year,
- // mon: 0,
- // tue: 0,
- // wed: 0,
- // thur: 0,
- // fri: 0,
- // sat: 0,
- // sun: 0,
- // });
- // }
- // }
- // courseWorksCountYearArray = courseWorksCountYearArray.reverse();
- // for (var i = 0; i < this.courseTList.length; i++) {
- // let _date = new Date(this.courseTList[i].create_at);
- // let _type = this.courseTList[i].type
- // ? this.courseTList[i].type.split(",")
- // : [];
- // var _month = _date.getMonth() + 1;
- // var _year = _date.getFullYear();
- // var _day = _date.getDay();
- // let dayArray = ["sun", "mon", "tue", "wed", "thur", "fri", "sat"];
- // for (var j = 0; j < courseWorksCountYearArray.length; j++) {
- // let time = (this.courseTList[i].text / 3600).toFixed(0);
- // time = parseInt(time) ? parseInt(time) : 0;
- // if (this.lType1 == "all") {
- // if (
- // _month == courseWorksCountYearArray[j].Month &&
- // _year == courseWorksCountYearArray[j].Year
- // ) {
- // courseWorksCountYearArray[j][dayArray[_day]] += time;
- // break;
- // }
- // } else if (this.lType1 == "grade") {
- // if (
- // _month == courseWorksCountYearArray[j].Month &&
- // _year == courseWorksCountYearArray[j].Year &&
- // this.hasCommonValue(this.gradeList, _type)
- // ) {
- // courseWorksCountYearArray[j][dayArray[_day]] += time;
- // break;
- // }
- // } else if (this.lType1 == "subject") {
- // if (
- // _month == courseWorksCountYearArray[j].Month &&
- // _year == courseWorksCountYearArray[j].Year &&
- // this.hasCommonValue(this.subjectList2, _type)
- // ) {
- // courseWorksCountYearArray[j][dayArray[_day]] += time;
- // break;
- // }
- // } else {
- // if (
- // _month == courseWorksCountYearArray[j].Month &&
- // _year == courseWorksCountYearArray[j].Year &&
- // this.hasCommonValue(this.thList, _type)
- // ) {
- // courseWorksCountYearArray[j][dayArray[_day]] += time;
- // break;
- // }
- // }
- // }
- // }
- this.courseWorksCountYearArray2 = courseWorksCountYearArray;
- this.$forceUpdate();
- },
- typeChange2() {
- const date = new Date();
- var Month = date.getMonth() + 1;
- var Year = date.getFullYear();
- let courseWorksCountYearArray = {};
- let timeArray = [];
- for (var i = 0; i < this.allCourseWorks1.length; i++) {
- timeArray.push(this.allCourseWorks1[i].time);
- }
- for (var i = 0; i < this.allCourseWorks1.length; i++) {
- let _type = this.allCourseWorks1[i].type
- ? this.allCourseWorks1[i].type.split(",")
- : [];
- let time = this.allCourseWorks1[i].time;
- if (this.lType1 == "all") {
- courseWorksCountYearArray[time] =
- courseWorksCountYearArray[time] + 1 || 1;
- } else if (this.lType1 == "grade") {
- if (this.hasCommonValue(this.gradeList, _type)) {
- courseWorksCountYearArray[time] =
- courseWorksCountYearArray[time] + 1 || 1;
- }
- } else if (this.lType1 == "subject") {
- if (this.hasCommonValue(this.subjectList2, _type)) {
- courseWorksCountYearArray[time] =
- courseWorksCountYearArray[time] + 1 || 1;
- }
- } else {
- if (this.hasCommonValue(this.thList, _type)) {
- courseWorksCountYearArray[time] =
- courseWorksCountYearArray[time] + 1 || 1;
- }
- }
- }
- // for (var i = Month; i > Month - 12; i--) {
- // if (i <= 0) {
- // courseWorksCountYearArray.push({
- // Year: Year - 1,
- // Month: 12 + i,
- // mon: 0,
- // tue: 0,
- // wed: 0,
- // thur: 0,
- // fri: 0,
- // sat: 0,
- // sun: 0,
- // });
- // } else {
- // courseWorksCountYearArray.push({
- // Month: i,
- // Year: Year,
- // mon: 0,
- // tue: 0,
- // wed: 0,
- // thur: 0,
- // fri: 0,
- // sat: 0,
- // sun: 0,
- // });
- // }
- // }
- // courseWorksCountYearArray = courseWorksCountYearArray.reverse();
- // for (var i = 0; i < this.allCourseWorks.length; i++) {
- // let _date = new Date(this.allCourseWorks[i].create_at);
- // let _type = this.allCourseWorks[i].type
- // ? this.allCourseWorks[i].typeid.split(",")
- // : [];
- // var _month = _date.getMonth() + 1;
- // var _year = _date.getFullYear();
- // var _day = _date.getDay();
- // let dayArray = ["sun", "mon", "tue", "wed", "thur", "fri", "sat"];
- // for (var j = 0; j < courseWorksCountYearArray.length; j++) {
- // if (this.lType1 == "all") {
- // if (
- // _month == courseWorksCountYearArray[j].Month &&
- // _year == courseWorksCountYearArray[j].Year
- // ) {
- // courseWorksCountYearArray[j][dayArray[_day]]++;
- // break;
- // }
- // } else if (this.lType1 == "grade") {
- // if (
- // _month == courseWorksCountYearArray[j].Month &&
- // _year == courseWorksCountYearArray[j].Year &&
- // this.hasCommonValue(this.gradeList, _type)
- // ) {
- // courseWorksCountYearArray[j][dayArray[_day]]++;
- // break;
- // }
- // } else if (this.lType1 == "subject") {
- // if (
- // _month == courseWorksCountYearArray[j].Month &&
- // _year == courseWorksCountYearArray[j].Year &&
- // this.hasCommonValue(this.subjectList2, _type)
- // ) {
- // courseWorksCountYearArray[j][dayArray[_day]]++;
- // break;
- // }
- // } else {
- // if (
- // _month == courseWorksCountYearArray[j].Month &&
- // _year == courseWorksCountYearArray[j].Year &&
- // this.hasCommonValue(this.thList, _type)
- // ) {
- // courseWorksCountYearArray[j][dayArray[_day]]++;
- // break;
- // }
- // }
- // }
- // }
- var worksCount = 0,
- haveWorksCourse = [];
- for (var i = 0; i < this.allCourseWorks1.length; i++) {
- // if (!this.allCourseWorks[i].pcount > 0) {
- // continue;
- // }
- let _type = this.allCourseWorks1[i].type
- ? this.allCourseWorks1[i].type.split(",")
- : [];
- if (this.lType1 == "all") {
- if (this.allCourseWorks1[i].id) {
- worksCount++;
- }
- if (haveWorksCourse.length == 0) {
- haveWorksCourse.push(this.allCourseWorks1[i].courseid);
- } else {
- if (
- haveWorksCourse.indexOf(this.allCourseWorks1[i].courseid) == -1
- ) {
- haveWorksCourse.push(this.allCourseWorks1[i].courseid);
- }
- }
- } else if (this.lType1 == "grade") {
- if (this.hasCommonValue(this.gradeList, _type)) {
- if (this.allCourseWorks1[i].id) {
- worksCount++
- }
- if (haveWorksCourse.length == 0) {
- haveWorksCourse.push(this.allCourseWorks1[i].courseid);
- } else {
- if (
- haveWorksCourse.indexOf(this.allCourseWorks1[i].courseid) == -1
- ) {
- haveWorksCourse.push(this.allCourseWorks1[i].courseid);
- }
- }
- }
- } else if (this.lType1 == "subject") {
- if (this.hasCommonValue(this.subjectList2, _type)) {
- if (this.allCourseWorks1[i].id) {
- worksCount++
- }
- if (haveWorksCourse.length == 0) {
- haveWorksCourse.push(this.allCourseWorks1[i].courseid);
- } else {
- if (
- haveWorksCourse.indexOf(this.allCourseWorks1[i].courseid) == -1
- ) {
- haveWorksCourse.push(this.allCourseWorks1[i].courseid);
- }
- }
- }
- } else {
- if (this.hasCommonValue(this.thList, _type)) {
- if (this.allCourseWorks1[i].id) {
- worksCount++
- }
- if (haveWorksCourse.length == 0) {
- haveWorksCourse.push(this.allCourseWorks1[i].courseid);
- } else {
- if (
- haveWorksCourse.indexOf(this.allCourseWorks1[i].courseid) == -1
- ) {
- haveWorksCourse.push(this.allCourseWorks1[i].courseid);
- }
- }
- }
- }
- }
- var courseJson = this.allCourseWorks;
- let _allTime = JSON.parse(JSON.stringify(this.allTimeList)).filter(
- (el) => {
- el.time = 0;
- return el;
- }
- );
- let _grade = JSON.parse(JSON.stringify(this.classList)).filter((el) => {
- el.time = 0;
- return el;
- });
- let _subject = JSON.parse(JSON.stringify(this.subjectList)).filter(
- (el) => {
- el.time = 0;
- return el;
- }
- );
- let _themeList = JSON.parse(JSON.stringify(this.themeList)).filter(
- (el) => {
- el.time = 0;
- return el;
- }
- );
- for (var i = 0; i < courseJson.length; i++) {
- for (var j = 0; j < _allTime.length; j++) {
- if (
- courseJson[i].typeid &&
- courseJson[i].typeid.indexOf(_allTime[j].id) != -1
- ) {
- if (_allTime[j].time) {
- _allTime[j].time += 1;
- } else {
- _allTime[j].time = 1;
- }
- }
- }
- for (var j = 0; j < _grade.length; j++) {
- if (
- courseJson[i].typeid &&
- courseJson[i].typeid.indexOf(_grade[j].id) != -1
- ) {
- if (_grade[j].time) {
- _grade[j].time += 1;
- } else {
- _grade[j].time = 1;
- }
- }
- }
- for (var k = 0; k < _subject.length; k++) {
- if (
- courseJson[i].typeid &&
- courseJson[i].typeid.indexOf(_subject[k].id) != -1
- ) {
- if (_subject[k].time) {
- _subject[k].time += 1;
- } else {
- _subject[k].time = 1;
- }
- }
- }
- for (var l = 0; l < _themeList.length; l++) {
- if (
- courseJson[i].typeid &&
- courseJson[i].typeid.indexOf(_themeList[l].id) != -1
- ) {
- if (_themeList[l].time) {
- _themeList[l].time += 1;
- } else {
- _themeList[l].time = 1;
- }
- }
- }
- }
- if (this.lType1 == "all") {
- this.tedurArray2 = _allTime;
- } else if (this.lType1 == "grade") {
- this.tedurArray2 = _grade;
- } else if (this.lType1 == "subject") {
- this.tedurArray2 = _subject;
- } else {
- this.tedurArray2 = _themeList;
- }
- this.courseWorksCountYearArray = courseWorksCountYearArray;
- this.worksCount = worksCount;
- this.haveWorksCourse = haveWorksCourse.length;
- this.$forceUpdate();
- },
- typeChange() {
- if (this.cType4 === "") {
- this.courseNumberArray = this.allArray;
- } else if (this.cType4 === "grade") {
- this.courseNumberArray = this.gradeArray;
- } else if (this.cType4 === "theme") {
- this.courseNumberArray = this.themeArray;
- } else if (this.cType4 === "subject") {
- this.courseNumberArray = this.subjectArray;
- }
- this.$forceUpdate();
- },
- getData() {
- this.isLoading = true;
- let params = [
- {
- oid: this.oid,
- org: this.org,
- },
- ];
- this.ajax
- .post(this.$store.state.api + "selectDataBoardCourseNew", params)
- .then((res) => {
- this.isLoading = false;
- let _grade = res.data[0]; //年级
- let _subject = JSON.parse(JSON.stringify(res.data[1])); //学科
- let _themeList = res.data[2]; //主题
- let _allTime = [..._grade, ..._subject, ..._themeList]; //年级 + 学科 + 主题
- this.allCourse = res.data[3][0].count; //课程总数
- let _timeCourse = res.data[4]; //查询半年内全部课程
- this.courseTemplate = res.data[5][0].count; //查询模板课程总数
- let tList = res.data[6]; //授课时长
- // let countCourseWorks = res.data[8][0].count; //获取有作业的课程
- this.courseTList = tList;
- //将数据根据time里面的月份分成多个数组
- let loginCountMonthArray = [];
- const date = new Date();
- var Month = date.getMonth() + 1;
- var Year = date.getFullYear();
- for (var i = Month; i > Month - 6; i--) {
- if (i <= 0) {
- loginCountMonthArray.push({
- Year: Year - 1,
- Month: 12 + i,
- course: 0,
- });
- } else {
- loginCountMonthArray.push({
- Month: i,
- Year: Year,
- course: 0,
- });
- }
- }
- loginCountMonthArray = loginCountMonthArray.reverse();
- for (var i = 0; i < _timeCourse.length; i++) {
- let _date = new Date(_timeCourse[i].time);
- var _month = _date.getMonth() + 1;
- var _year = _date.getFullYear();
- for (var j = 0; j < loginCountMonthArray.length; j++) {
- if (
- _month == loginCountMonthArray[j].Month &&
- _year == loginCountMonthArray[j].Year
- ) {
- loginCountMonthArray[j].course++;
- break;
- }
- }
- }
- this.loginCountMonthArray = loginCountMonthArray;
- tList.forEach((element) => {
- element.text = element.text ? element.text : 0;
- });
- var courseJson = Object.values(
- tList.reduce(function (acc, obj) {
- if (!acc[obj.courseId]) {
- acc[obj.courseId] = { ...obj };
- acc[obj.courseId].typeid = [acc[obj.courseId].typeid];
- } else {
- // if (!acc[obj.courseId].typeid.includes(obj.typeid)) {
- // acc[obj.courseId].typeid.push(obj.typeid);
- // }
- let _typeA = obj.type ? obj.type.split(",") : [];
- for (var i = 0; i < _typeA.length; i++) {
- if (!acc[obj.courseId].typeid.includes(_typeA[i])) {
- acc[obj.courseId].typeid.push(_typeA[i]);
- }
- }
- acc[obj.courseId].text =
- parseInt(acc[obj.courseId].text) + parseInt(obj.text);
- }
- return acc;
- }, {})
- ).map(function (obj) {
- var totalTime = parseInt(obj.text);
- obj.text = (totalTime / (60 * 60)).toFixed(0);
- return obj;
- });
- for (var i = 0; i < courseJson.length; i++) {
- for (var j = 0; j < _allTime.length; j++) {
- if (
- courseJson[i].typeid &&
- courseJson[i].typeid.indexOf(_allTime[j].id) != -1
- ) {
- if (_allTime[j].time && courseJson[i].text) {
- _allTime[j].time += parseInt(courseJson[i].text);
- } else if (courseJson[i].text) {
- _allTime[j].time = parseInt(courseJson[i].text);
- }
- }
- }
- for (var j = 0; j < _grade.length; j++) {
- if (
- courseJson[i].typeid &&
- courseJson[i].typeid.indexOf(_grade[j].id) != -1
- ) {
- if (_grade[j].time && courseJson[i].text) {
- _grade[j].time += parseInt(courseJson[i].text);
- } else if (courseJson[i].text) {
- _grade[j].time = parseInt(courseJson[i].text);
- }
- }
- }
- for (var k = 0; k < _subject.length; k++) {
- if (
- courseJson[i].typeid &&
- courseJson[i].typeid.indexOf(_subject[k].id) != -1
- ) {
- if (_subject[k].time && courseJson[i].text) {
- _subject[k].time += parseInt(courseJson[i].text);
- } else if (courseJson[i].text) {
- _subject[k].time = parseInt(courseJson[i].text);
- }
- }
- }
- for (var l = 0; l < _themeList.length; l++) {
- if (
- courseJson[i].typeid &&
- courseJson[i].typeid.indexOf(_themeList[l].id) != -1
- ) {
- if (_themeList[l].time && courseJson[i].text) {
- _themeList[l].time += parseInt(courseJson[i].text);
- } else if (courseJson[i].text) {
- _themeList[l].time = parseInt(courseJson[i].text);
- }
- }
- }
- }
- this.allTimeList = _allTime;
- this.classList = _grade;
- this.subjectList = _subject;
- this.themeList = _themeList;
- var _gradeList = [],
- _subjectList = [],
- _thList = [];
- for (var i = 0; i < _grade.length; i++) {
- _gradeList.push(_grade[i].id);
- }
- for (var i = 0; i < _subject.length; i++) {
- _subjectList.push(_subject[i].id);
- }
- for (var i = 0; i < _themeList.length; i++) {
- _thList.push(_themeList[i].id);
- }
- var _courseTypeList = this.courseTList;
- var _gList = [],
- _sList = [],
- _tList = [],
- _timeList = [];
- for (var i = 0; i < _courseTypeList.length; i++) {
- if (_timeList.length == 0) {
- _timeList.push(_courseTypeList[i].courseId);
- } else {
- if (_timeList.indexOf(_courseTypeList[i].courseId) == -1) {
- _timeList.push(_courseTypeList[i].courseId);
- }
- }
- if (_gradeList.indexOf(_courseTypeList[i].typeid) != -1) {
- if (_gList.length == 0) {
- _gList.push(_courseTypeList[i].courseId);
- } else {
- if (_gList.indexOf(_courseTypeList[i].courseId) == -1) {
- _gList.push(_courseTypeList[i].courseId);
- }
- }
- }
- if (_subjectList.indexOf(_courseTypeList[i].typeid) != -1) {
- if (_sList.length == 0) {
- _sList.push(_courseTypeList[i].courseId);
- } else {
- if (_sList.indexOf(_courseTypeList[i].courseId) == -1) {
- _sList.push(_courseTypeList[i].courseId);
- }
- }
- }
- if (_thList.indexOf(_courseTypeList[i].typeid) != -1) {
- if (_tList.length == 0) {
- _tList.push(_courseTypeList[i].courseId);
- } else {
- if (_tList.indexOf(_courseTypeList[i].courseId) == -1) {
- _tList.push(_courseTypeList[i].courseId);
- }
- }
- }
- }
- this.allTimeLength = _timeList.length;
- this.gradeLength = _gList.length;
- this.subjectLength = _sList.length;
- this.themeLength = _tList.length;
- let allCourseWorks = res.data[7]; //作业总数量
- let threeMouthCourseWorks = res.data[10]; //近三个月作业总数量
- this.allCourseWorks = allCourseWorks;
- this.allCourseWorks1 = threeMouthCourseWorks;
- this.gradeList = _gradeList;
- this.subjectList2 = _subjectList;
- this.thList = _thList;
- this.typeChange2();
- this.typeChange1();
- let _course = res.data[6]; //课程
- let _gradeArray = [];
- let _subjectArray = [];
- let _themeArray = [];
- for (var i = 0; i < _grade.length; i++) {
- _gradeArray.push({
- name: _grade[i].name,
- typeid: _grade[i].id,
- course: 0,
- array: [],
- });
- for (var z = 0; z < _course.length; z++) {
- if (
- _course[z].type &&
- _course[z].type.indexOf(_grade[i].id) !== -1
- ) {
- _gradeArray[i].course++;
- _gradeArray[i].array.push(_course[z].courseId);
- }
- }
- }
- for (var i = 0; i < _subject.length; i++) {
- _subjectArray.push({
- name: _subject[i].name,
- typeid: _subject[i].id,
- course: 0,
- array: [],
- });
- for (var z = 0; z < _course.length; z++) {
- if (
- _course[z].typeid &&
- _course[z].typeid.indexOf(_subject[i].id) !== -1
- ) {
- _subjectArray[i].course++;
- _subjectArray[i].array.push(_course[z].courseId);
- }
- }
- }
- for (var i = 0; i < _themeList.length; i++) {
- _themeArray.push({
- name: _themeList[i].name,
- typeid: _themeList[i].id,
- course: 0,
- array: [],
- });
- for (var z = 0; z < _course.length; z++) {
- if (
- _course[z].typeid &&
- _course[z].typeid.indexOf(_themeList[i].id) !== -1
- ) {
- _themeArray[i].course++;
- _themeArray[i].array.push(_course[z].courseId);
- }
- }
- }
- this.gradeArray = _gradeArray;
- this.subjectArray = _subjectArray;
- this.themeArray = _themeArray;
- this.allArray = [..._gradeArray, ..._subjectArray, ..._themeArray];
- this.typeChange();
- var courseList = res.data[6];
- var cList = [];
- for (var i = 0; i < courseList.length; i++) {
- cList.push(JSON.parse(courseList[i].chapters));
- }
- var toolList = [
- [10, 65], //互动类
- [7, 1, 52, 3, 48], //思维类
- [49], //协作类
- [4, 45, 15, 16, 50, 41, 47], //测评类
- [40], //评价类
- [18, 21, 22, 23, 24, 32, 57, 63], //编程类
- [28, 31, 39, 66, 67, 68], //学科类
- ];
- var toolAllArray = [
- { name: "互动类", value: 0 },
- { name: "思维类", value: 0 },
- { name: "协作类", value: 0 },
- { name: "测评类", value: 0 },
- { name: "评价类", value: 0 },
- { name: "编程类", value: 0 },
- { name: "学科类", value: 0 },
- ];
- for (var p = 0; p < toolList.length; p++) {
- for (var i = 0; i < cList.length; i++) {
- for (var j = 0; j < cList[i].length; j++) {
- for (
- var k = 0;
- k < cList[i][j].chapterInfo[0].taskJson.length;
- k++
- ) {
- for (
- var q = 0;
- q <
- cList[i][j].chapterInfo[0].taskJson[k].toolChoose.length;
- q++
- ) {
- if (
- toolList[p].indexOf(
- cList[i][j].chapterInfo[0].taskJson[k].toolChoose[q]
- .tool[0]
- ) != -1
- ) {
- toolAllArray[p].value++;
- }
- }
- }
- }
- }
- }
- this.toolList = toolAllArray;
- var twoPerson = 0,
- threePerson = 0,
- fivePerson = 0,
- sevenPerson = 0;
- var personList = [];
- for (var i = 0; i < courseList.length; i++) {
- if (courseList[i].course_teacher) {
- if (courseList[i].course_teacher.split(",").length <= 2) {
- twoPerson++;
- } else if (
- 4 >= courseList[i].course_teacher.split(",").length &&
- courseList[i].course_teacher.split(",").length > 2
- ) {
- threePerson++;
- } else if (
- 6 >= courseList[i].course_teacher.split(",").length &&
- courseList[i].course_teacher.split(",").length > 4
- ) {
- fivePerson++;
- } else if (courseList[i].course_teacher.split(",").length > 7) {
- sevenPerson++;
- }
- }
- }
- personList.push(
- { name: "2人以下", value: twoPerson },
- { name: "3-4人", value: threePerson },
- { name: "5-6人", value: fivePerson },
- { name: "7人以上", value: sevenPerson }
- );
- this.personList = personList;
- // let _workCourse = res.data[10]; //带作业的课程
- let _workCourse = res.data[7].filter((el) => {
- return el.pcount > 0;
- }); //带作业的课程
- let _taskCount = 0; //任务数量
- var wList = [];
- for (var i = 0; i < _workCourse.length; i++) {
- if (!wList[_workCourse[i].courseId]) {
- wList[_workCourse[i].courseId] = {
- cid: _workCourse[i].courseId,
- title: _workCourse[i].title,
- task: 0,
- work: _workCourse[i].pcount,
- };
- let chapters = JSON.parse(_workCourse[i].chapters);
- for (var j = 0; j < chapters.length; j++) {
- if (wList[_workCourse[i].courseId].task == 0) {
- wList[_workCourse[i].courseId].task =
- chapters[j].chapterInfo[0].taskJson.length;
- } else {
- wList[_workCourse[i].courseId].task +=
- chapters[j].chapterInfo[0].taskJson.length;
- }
- _taskCount += chapters[j].chapterInfo[0].taskJson.length;
- }
- }
- }
- // for (var i = 0; i < _workCourse.length; i++) {
- // let a = Object.keys(wList);
- // for (var j = 0; j < Object.keys(wList).length; j++) {
- // if (
- // _workCourse[i].courseId == wList[a[j]].cid &&
- // _workCourse[i].id
- // ) {
- // wList[a[j]].work++;
- // }
- // }
- // }
- var workNumList = Object.values(wList).map((item) => [
- item.task,
- item.work,
- item.title,
- item.cid,
- ]);
- this.workNumList = workNumList;
- this.taskCount = _taskCount;
- this.workCount = _workCourse.length;
- let kcourse = res.data[6];
- let kJson = {};
- for (let i = 0; i < kcourse.length; i++) {
- if (!kJson[kcourse[i].courseId] && kcourse[i].text > 0) {
- kJson[kcourse[i].courseId] = {
- cid: kcourse[i].courseId,
- title: kcourse[i].title,
- };
- }
- }
- let kArray = Object.values(kJson);
- // this.isCourseCount = res.data[11][0].count; //课程开展总数
- this.isCourseCount = kArray.length; //课程开展总数
- // this.allCourseCount = res.data[9].length; //课程总数
- this.allCourseCount = res.data[3][0].count;
- let _gradeCourse = 0; //各年级上传课程
- let _subjectCourse = 0; //各学科上传课程
- let _courseArray = [];
- // _subject.push({ name: "其他" });
- for (var i = 0; i < _grade.length; i++) {
- _courseArray.push({
- name: _grade[i].name,
- id: _grade[i].id,
- courseid: [],
- subject: [],
- });
- for (var z = 0; z < _course.length; z++) {
- if (
- _course[z].type &&
- _course[z].type.indexOf(_grade[i].id) !== -1
- ) {
- _gradeCourse++;
- if (
- _courseArray[i].courseid.indexOf(_course[z].courseId) === -1
- ) {
- _courseArray[i].courseid.push(_course[z].courseId);
- }
- }
- }
- for (var j = 0; j < _subject.length; j++) {
- _courseArray[i].subject.push({
- name: _subject[j].name,
- id: _subject[j].id,
- course: 0,
- });
- for (var z = 0; z < _course.length; z++) {
- if (
- _course[z].type &&
- _course[z].type.indexOf(_subject[j].id) !== -1 &&
- _courseArray[i].courseid.indexOf(_course[z].courseId) !== -1
- ) {
- _courseArray[i].subject[j].course++;
- }
- }
- }
- let sum = 0;
- for (var j = 0; j < _courseArray[i].subject.length - 1; j++) {
- sum += _courseArray[i].subject[j].course;
- }
- // _courseArray[i].subject[_courseArray[i].subject.length - 1].course =
- // _courseArray[i].courseid.length - sum < 0
- // ? 0
- // : _courseArray[i].courseid.length - sum;
- }
- for (var j = 0; j < _subject.length; j++) {
- for (var z = 0; z < _course.length; z++) {
- if (
- _course[z].typeid &&
- _course[z].typeid.indexOf(_subject[j].id) !== -1
- ) {
- _subjectCourse++;
- }
- }
- }
- this.courseArray = _courseArray;
- this.evaCount = res.data[8][0].count; //设置评价
- this.evaWorksCount = res.data[9][0].count; //查询有目标并且有评价的作业
- for (var i = 0; i < this.pusaDep.length; i++) {
- if (this.pusaDep[i].name == "课程总数") {
- this.pusaDep[i].value = (
- (this.allCourse / this.allCourse) *
- 100
- ).toFixed(0);
- } else if (this.pusaDep[i].name == "设置评价课程") {
- this.pusaDep[i].value = (
- (this.evaCount / this.allCourse) *
- 100
- ).toFixed(0);
- } else if (this.pusaDep[i].name == "已提交作业课程") {
- this.pusaDep[i].value = (
- (this.haveWorksCourse / this.allCourse) *
- 100
- ).toFixed(0);
- } else if (this.pusaDep[i].name == "已评价课程") {
- this.pusaDep[i].value = (
- (this.evaWorksCount / this.allCourse) *
- 100
- ).toFixed(0);
- } else if (this.pusaDep[i].name == "教学评一体化课程") {
- this.pusaDep[i].value = (
- (this.evaWorksCount / this.allCourse) *
- 100
- ).toFixed(0);
- }
- }
- var today = new Date();
- var lastDayOfWeek = new Date(
- today.setDate(today.getDate() - today.getDay() + 7)
- ); //本周周日
- let weekArray = {
- lastWeek: [], //上周
- toWeek: [], //本周
- };
- // for (var i = 0; i < 14; i++) {
- // let time = JSON.parse(JSON.stringify(lastDayOfWeek));
- // let time2 = new Date(time);
- // var a = new Date(time2.setDate(time2.getDate() - i));
- // if (i > 6) {
- // weekArray.lastWeek.push(
- // a.getFullYear() + "-" + (a.getMonth() + 1) + "-" + a.getDate()
- // );
- // } else {
- // weekArray.toWeek.push(
- // a.getFullYear() + "-" + (a.getMonth() + 1) + "-" + a.getDate()
- // );
- // }
- // }
- weekArray = this.getMonth();
- let weekCourse = [];
- let weekCourse2 = [];
- let lastWeekCouseCount = 0;
- let toWeekCouseCount = 0;
- for (var z = 0; z < _course.length; z++) {
- let _date = new Date(weekArray.lastWeek[0]);
- if (
- new Date(_course[z].create_at) > _date
- // && _course[z].pid == "34628934-d02f-11ec-8c78-005056b86db5"
- ) {
- weekCourse.push(_course[z]);
- var a = new Date(_course[z].create_at);
- var string =
- a.getFullYear() + "-" + (a.getMonth() + 1) + "-" + a.getDate();
- if (weekArray.lastWeek.indexOf(string) != -1) {
- lastWeekCouseCount++;
- } else {
- toWeekCouseCount++;
- }
- }
- }
- let lastCourseidWeek = [];
- let toCourseidWeek = [];
- for (var i = 0; i < _grade.length; i++) {
- weekCourse2.push({
- name: _grade[i].name,
- id: _grade[i].id,
- lastCourse: 0,
- toCourse: 0,
- });
- for (var z = 0; z < weekCourse.length; z++) {
- if (
- weekCourse[z].type &&
- weekCourse[z].type.indexOf(_grade[i].id) !== -1
- ) {
- var a = new Date(weekCourse[z].create_at);
- var string =
- a.getFullYear() +
- "-" +
- (a.getMonth() + 1) +
- "-" +
- a.getDate();
- if (weekArray.lastWeek.indexOf(string) != -1) {
- weekCourse2[i].lastCourse++;
- if (lastCourseidWeek.indexOf(weekCourse[z].courseId) === -1) {
- lastCourseidWeek.push(weekCourse[z].courseId);
- }
- } else {
- weekCourse2[i].toCourse++;
- if (toCourseidWeek.indexOf(weekCourse[z].courseId) === -1) {
- toCourseidWeek.push(weekCourse[z].courseId);
- }
- }
- }
- }
- }
- // weekCourse2.push({
- // name: "其他",
- // id: "",
- // lastCourse:
- // lastWeekCouseCount - lastCourseidWeek.length > 0
- // ? lastWeekCouseCount - lastCourseidWeek.length
- // : 0,
- // toCourse:
- // toWeekCouseCount - toCourseidWeek.length > 0
- // ? toWeekCouseCount - toCourseidWeek.length
- // : 0,
- // });
- this.weekCourse2 = weekCourse2;
- let CourseLabel = res.data[6]; //带分类的课程
- let _subject2 = JSON.parse(JSON.stringify(res.data[1]));
- const resultSubject = [];
- for (let i = 0; i < _subject2.length - 1; i++) {
- for (let j = i + 1; j < _subject2.length; j++) {
- resultSubject.push({
- id: [_subject2[i].id, _subject2[j].id],
- name: [_subject2[i].name, _subject2[j].name],
- count: 0,
- });
- }
- }
- for (var i = 0; i < CourseLabel.length; i++) {
- if (!CourseLabel[i].type) {
- continue;
- }
- let array = CourseLabel[i].type.split(",");
- for (var j = 0; j < resultSubject.length; j++) {
- if (this.checkArrayInclusion(resultSubject[j].id, array)) {
- resultSubject[j].count++;
- }
- }
- }
- let resultSubject2 = [];
- for (var i = 0; i < resultSubject.length; i++) {
- let el = resultSubject[i];
- if (el.count > 0) {
- resultSubject2.push([el.name[0], el.name[1], el.count]);
- }
- }
- this.resultSubject = resultSubject2;
- console.log(resultSubject);
- this.$forceUpdate();
- })
- .catch((err) => {
- this.isLoading = false;
- this.$message.error(
- "因加载数据量过大,服务器统计异常,请联系管理员。"
- );
- console.error(err);
- });
- },
- checkArrayInclusion(arr1, arr2) {
- return arr1.every((item) => arr2.includes(item));
- },
- hasCommonValue(arr1, arr2) {
- const set1 = new Set(arr1);
- for (const val of arr2) {
- if (set1.has(val)) {
- return true;
- }
- }
- return false;
- },
- },
- };
- </script>
- <style scoped>
- .body1 {
- width: 100%;
- height: 100%;
- display: flex;
- padding: 20px;
- box-sizing: border-box;
- overflow: hidden;
- position: relative;
- }
- .left {
- width: calc(100% / 4 * 1);
- height: 100%;
- }
- .left>.top {
- width: 100%;
- height: calc(100% / 5 * 2.7 - 5px);
- /* background: #fff; */
- border-radius: 5px;
- margin: 0 0 10px 0;
- background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(224, 234, 251, 0.8) 100%);
- border: 2px solid #fff;
- box-sizing: border-box;
- }
- .left>.bottom {
- width: 100%;
- height: calc(100% / 5 * 2.3 - 5px);
- /* background: #fff; */
- border-radius: 5px;
- background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(224, 234, 251, 0.8) 100%);
- border: 2px solid #fff;
- box-sizing: border-box;
- }
- .center {
- width: calc(100% / 4 * 2 - 20px);
- height: 100%;
- margin: 0 10px;
- }
- .center>.top {
- width: 100%;
- height: calc(100% / 5 * 2.7 - 5px);
- /* background: #fff; */
- border-radius: 5px;
- margin: 0 0 10px 0;
- background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(224, 234, 251, 0.8) 100%);
- border: 2px solid #fff;
- box-sizing: border-box;
- }
- .center>.bottom {
- width: 100%;
- height: calc(100% / 5 * 2.3 - 5px);
- /* background: #fff; */
- border-radius: 5px;
- background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(224, 234, 251, 0.8) 100%);
- border: 2px solid #fff;
- box-sizing: border-box;
- }
- .right {
- width: calc(100% / 4 * 1);
- height: 100%;
- }
- .right>.top {
- width: 100%;
- height: calc(100% / 5 * 2.7 - 5px);
- /* background: #fff; */
- border-radius: 16px;
- margin: 0 0 10px 0;
- background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(224, 234, 251, 0.8) 100%);
- border: 2px solid #fff;
- box-sizing: border-box;
- }
- .right>.bottom {
- width: 100%;
- height: calc(100% / 5 * 2.3 - 5px);
- /* background: #fff; */
- border-radius: 5px;
- background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(224, 234, 251, 0.8) 100%);
- border: 2px solid #fff;
- box-sizing: border-box;
- }
- .courseCenterTop {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .titleBox {
- height: 40px;
- display: flex;
- align-items: center;
- padding: 0 15px;
- box-sizing: border-box;
- width: 100%;
- position: relative;
- }
- .titleBox::after {
- content: '';
- position: absolute;
- height: 2px;
- width: calc(100% - 30px);
- bottom: 0;
- background: linear-gradient(90deg, rgba(54, 129, 252, 0.6) 0%, rgba(54, 129, 252, 0.1) 100%);
- }
- .allScreen {
- min-width: 20px;
- width: 20px;
- height: 20px;
- padding: 0 15px;
- cursor: pointer;
- }
- .allScreen>img {
- width: 100%;
- height: 100%;
- }
- .dataBox {
- height: calc(100% - 40px);
- width: 100%;
- }
- .middleBox {
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- align-items: flex-start;
- }
- .title {
- color: #060e17;
- margin-right: 25px;
- font-weight: 700;
- display: flex;
- align-items: center;
- }
- .title::before{
- content: '';
- background-image: url('../../../../assets/icon/test/data_title_icon.png');
- background-size: 100% 100%;
- width: 20px;
- height: 20px;
- margin-right: 5px;
- }
- .teaMiddle {
- width: calc(100% / 2 - 10px);
- height: 60px;
- border-radius: 8px;
- /* border: 1px solid #e0eafb; */
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- justify-content: center;
- padding: 0 10px;
- margin: 0 10px;
- }
- .teaMiddle {
- width: calc(100% / 3 - 10px);
- }
- .cNum {
- background: linear-gradient(180deg,
- rgb(125, 227, 174, 0.2) 0%,
- rgb(23, 196, 105, 0.3) 100%) !important;
- }
- .tNum {
- background: linear-gradient(180deg,
- rgb(174, 204, 254, 0.2) 0%,
- rgb(54, 129, 252, 0.3) 100%) !important;
- }
- .tSum {
- background: linear-gradient(180deg,
- rgb(125, 227, 174, 0.2) 0%,
- rgb(23, 196, 105, 0.3) 100%) !important;
- }
- .teaLeft>div:first-child,
- .teaMiddle>div:first-child {
- font-size: 12px;
- font-weight: 400;
- color: #565e6a;
- }
- .teaLeft>div:last-child,
- .teaMiddle>div:last-child {
- font-size: 22px;
- font-weight: bold;
- color: #060e17;
- }
- .halfBox {
- width: 50%;
- height: 100%;
- }
- .selectBox {
- width: 80px;
- margin-left: 10px;
- }
- .selectBox>>>.el-input__inner {
- height: 30px;
- line-height: 30px;
- border: 1px solid #3681FC;
- }
- .selectBox>>>.el-input__icon {
- line-height: 30px;
- }
- .timeDiv {
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- align-items: center;
- margin: 0 0 0 15px;
- }
- .timeDiv>div {
- margin-right: 10px;
- cursor: pointer;
- }
- .isClick {
- /* color: #1684fc;
- border-bottom: 2px solid #1684fc; */
- box-sizing: border-box;
- }
- .noClick{
- font-weight: 500;
- opacity: .6;
- }
- .otherCss {
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- align-items: center;
- justify-content: flex-end;
- }
- .otherImg {
- width: 20px;
- height: 20px;
- margin: 0 10px;
- cursor: pointer;
- }
- .otherImg>img {
- width: 100%;
- height: 100%;
- }
- .allBox {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- align-items: center;
- }
- .allBox_left {
- width: 30%;
- height: 100%;
- }
- .allBox_right {
- display: flex;
- flex-wrap: wrap;
- height: 100%;
- width: 70%;
- margin: 0 auto;
- overflow: hidden;
- justify-content: space-between;
- }
- .depth {
- width: calc(100% / 4 - 10px);
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- }
- .depth>span:nth-child(1) {
- font-size: 14px;
- font-weight: 700;
- margin: 0 0 10px;
- }
- .depth>div:nth-child(1) {}
- .info_box {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- justify-content: space-between;
- width: 90%;
- margin: 0 auto;
- }
- .info_box>.info2,
- .info_box>.info3,
- .info_box>.info {
- width: calc(50% - 10px);
- display: flex;
- flex-direction: column-reverse;
- flex-wrap: nowrap;
- height: 60px;
- justify-content: center;
- /* align-items: center; */
- padding: 0 10px;
- box-sizing: border-box;
- margin-bottom: 10px;
- border-radius: 5px;
- }
- .info_box>.info2 {
- width: calc(100% / 4 - 10px);
- /* align-items: flex-end; */
- }
- .info_box>.info3 {
- width: 100%;
- margin-bottom: 5px;
- }
- .info_box>.info2>span:nth-child(1),
- .info_box>.info3>span:nth-child(1),
- .info_box>.info>span:nth-child(1) {
- font-size: 12px;
- /* margin: 0 0 0 20px; */
- color: #565e6a;
- /* width: 60px; */
- white-space: pre-wrap;
- word-break: break-all;
- }
- .info_box>.info2>span:nth-child(2),
- .info_box>.info3>span:nth-child(2),
- .info_box>.info>span:nth-child(2) {
- font-size: 24px;
- font-weight: 700;
- }
- .blueBG {
- /* background: rgb(243, 248, 253);
- border: 2px solid rgb(234, 246, 255); */
- }
- .dialog_diy>>>.el-dialog {
- height: 100%;
- margin: 0vh auto !important;
- }
- .dialog_diy>>>.el-dialog__header {
- background: #454545 !important;
- padding: 15px 20px;
- }
- .dialog_diy>>>.el-dialog__body {
- height: calc(100% - 124px);
- box-sizing: border-box;
- padding: 0px;
- }
- .dialog_diy>>>.el-dialog__title {
- color: #fff;
- }
- .dialog_diy>>>.el-dialog__headerbtn {
- top: 19px;
- }
- .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
- color: #fff;
- }
- .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
- color: #fff;
- }
- .dialog_diy>>>.el-dialog__body,
- .dialog_diy>>>.el-dialog__footer {
- background: rgb(rgb(240, 242, 245));
- overflow: hidden;
- }
- </style>
|