123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398 |
- /* 学习助手 */
- <template>
- <div class="learn_container">
- <el-card class="header" style="padding-bottom: 0">
- <div class="tab">
- <div
- class="tab_item"
- :class="tabActive == 0 ? 'tab_active' : ''"
- @click="switchTab(0)"
- >
- 收藏夹
- </div>
- <div
- class="tab_item"
- :class="tabActive == 1 ? 'tab_active' : ''"
- @click="switchTab(1)"
- >
- 错题本
- </div>
- <div
- class="tab_item"
- :class="tabActive == 2 ? 'tab_active' : ''"
- @click="switchTab(2)"
- >
- 学习记录
- </div>
- </div>
- <div class="radio_contianer" v-show="tabActive == 0">
- <div style="margin-bottom: 16px">
- <span>类型</span>
- <el-radio-group v-model="form.type" size="mini" @change="toggleType">
- <el-radio-button
- :label="item.type"
- v-for="item in types"
- :key="item.type"
- >{{ item.name }}</el-radio-button
- >
- </el-radio-group>
- </div>
- <div style="margin-bottom: 16px">
- <span>学科</span>
- <el-radio-group
- v-model="form.subjectName"
- size="mini"
- @change="toggleSub"
- >
- <el-radio-button
- :label="item"
- v-for="(item, index) in subjects"
- :key="index"
- >{{ item }}</el-radio-button
- >
- </el-radio-group>
- </div>
- <div style="margin-bottom: 16px" v-if="form.type == 'question'">
- <span>题型</span>
- <el-radio-group
- v-model="form.qtype"
- size="mini"
- @change="toggleQueType"
- >
- <el-radio-button
- :label="item"
- v-for="(item, index) in queTypes"
- :key="index"
- >{{ item }}</el-radio-button
- >
- </el-radio-group>
- </div>
- </div>
- <div class="radio_contianer" v-show="tabActive == 1">
- <div style="margin-bottom: 16px">
- <span>科目</span>
- <el-radio-group
- v-model="form.worngSubjectName"
- size="mini"
- @change="toggleWrongSub"
- >
- <el-radio-button
- :label="item"
- v-for="(item, index) in wrongSubject"
- :key="index"
- >{{ item }}</el-radio-button
- >
- </el-radio-group>
- </div>
- <div style="margin-bottom: 16px">
- <span>题型</span>
- <el-radio-group
- v-model="form.wrongType"
- size="mini"
- @change="toggleWrongType"
- >
- <el-radio-button
- :label="item"
- v-for="(item, index) in wrongTypes"
- :key="index"
- >{{ item }}</el-radio-button
- >
- </el-radio-group>
- </div>
- </div>
- </el-card>
- <!-- 收藏夹 -->
- <div class="shoucan_content" v-show="tabActive == 0">
- <!-- 试题收藏 -->
- <div class="topic" v-show="form.type == 'question'">
- <!-- 题目 -->
- <div class="paper_questions" id="collect-question">
- <div
- class="que_item"
- v-for="(item, index) in collectQue"
- :key="item.id"
- >
- <div class="que_content" style="display: flex">
- <div>{{ index + 1 }}.</div>
- <div v-html="item.title"></div>
- </div>
- <div class="option" v-if="item.optionA">
- <div style="margin-right: 5px">A:</div>
- <div v-html="item.optionA"></div>
- </div>
- <div class="option" v-if="item.optionB">
- <div style="margin-right: 5px">B:</div>
- <div v-html="item.optionB"></div>
- </div>
- <div class="option" v-if="item.optionC">
- C:
- <div v-html="item.optionC"></div>
- </div>
- <div class="option" v-if="item.optionD">
- <div style="margin-right: 5px">D:</div>
- <div v-html="item.optionD"></div>
- </div>
- <div class="que_footer">
- <div class="spans">
- <span class="id">ID: {{ item.id }}</span>
- <span>题型: {{ item.qtpye }}</span>
- <span>难度: 一般</span>
- </div>
- <div class="operation">
- <div class="shoucan">
- <div
- v-show="item.collect"
- @click="toCancelCollectQue(item)"
- style="display: flex; align-items: center"
- >
- <img
- src="@/assets/images/icon_shoucang_s.png"
- style="margin-right: 8px"
- />
- <span>已收藏</span>
- </div>
- <div
- v-show="!item.collect"
- @click="toCollectQue(item)"
- style="display: flex; align-items: center"
- >
- <img
- src="@/assets/images/icon_shoucang_n.png"
- style="margin-right: 8px"
- />
- <span>收藏</span>
- </div>
- </div>
- <div class="detail" @click="viewDetail(index)">
- <img src="@/assets/images/icon_chakan.png" alt="" />
- <span>查看解析>></span>
- </div>
- <div class="addQue">
- <i
- class="el-icon-shopping-cart-2"
- style="margin-right: 5px"
- ></i>
- <span>加入选题</span>
- </div>
- </div>
- </div>
- <div
- class="parse"
- v-show="item.createTime"
- v-html="item.parse"
- ></div>
- </div>
- </div>
- </div>
- <!-- 试卷收藏 -->
- <div class="exam" v-show="form.type == 'paper'">
- <div class="paper_container">
- <div class="paper_item" v-for="item in collectPaper" :key="item.id">
- <div class="tit">
- <div>{{ item.papername }}</div>
- <div class="viewCount">
- <img src="@/assets/images/icon_eye.png" alt="" />
- <span>{{item.readNum}}人已预览</span>
- </div>
- </div>
- <div class="opera">
- <div class="view" @click="toPreView(item.id, item.papername)">
- <img
- style="margin-right: 8px"
- src="@/assets/images/icon_view.png"
- alt=""
- />
- <span>预览</span>
- </div>
- <div class="download">下载</div>
- <div>
- <img
- src="@/assets/images/icon_shoucang_s.png"
- alt=""
- style="margin-right: 8px"
- />
- <span>已收藏</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 分页 -->
- <div style="display: flex; justify-content: center; margin-top: 92px">
- <el-pagination
- layout="prev, pager, next"
- :total="total"
- :current-page="pageNum"
- :page-size="pageSize"
- @prev-click="prev"
- @next-click="next"
- >
- </el-pagination>
- </div>
- </div>
- <!-- 错题本 -->
- <div class="mis_content" v-show="tabActive == 1">
- <div class="topic">
- <!-- 题目 -->
- <div class="paper_questions" id="wrong-question">
- <div
- class="que_item"
- v-for="(item, index) in wrongQues"
- :key="item.id"
- >
- <div class="que_content" style="display: flex">
- <div>{{ index + 1 }}.</div>
- <div v-html="item.title"></div>
- </div>
- <div class="option" v-if="item.optionA">
- <div style="margin-right: 5px">A:</div>
- <div v-html="item.optionA"></div>
- </div>
- <div class="option" v-if="item.optionB">
- <div style="margin-right: 5px">B:</div>
- <div v-html="item.optionB"></div>
- </div>
- <div class="option" v-if="item.optionC">
- C:
- <div v-html="item.optionC"></div>
- </div>
- <div class="option" v-if="item.optionD">
- <div style="margin-right: 5px">D:</div>
- <div v-html="item.optionD"></div>
- </div>
- <div class="que_footer">
- <div class="spans">
- <span>题型: {{ item.qtpye }}</span>
- <span>难度: 一般</span>
- </div>
- <div class="operation">
- <div class="delete" style="display: flex; align-items: center">
- <div
- style="margin-right: 24px; cursor: pointer display: flex;align-items: center;"
- @click="toDeleteWrongQue(item.id, index)"
- >
- <img
- src="@/assets/images/icon_wrong.png"
- style="margin-right: 8px"
- />
- <span>删除错题</span>
- </div>
- </div>
- <div class="detail" @click="viewWrongDetail(index)">
- <img src="@/assets/images/icon_chakan.png" alt="" />
- <span>查看解析>></span>
- </div>
- </div>
- </div>
- <div
- class="parse"
- v-show="item.createTime"
- v-html="item.parse"
- ></div>
- </div>
- </div>
- </div>
- <!-- 错题分页 -->
- <div style="display: flex; justify-content: center; margin-top: 92px">
- <el-pagination
- layout="prev, pager, next"
- :total="wrongForm.total"
- :current-page="wrongForm.pageNum"
- :page-size="wrongForm.pageSize"
- @prev-click="wrongPrev"
- @next-click="wrongNext"
- >
- </el-pagination>
- </div>
- </div>
- <!-- 学习记录 -->
- <div class="record_content" v-show="tabActive == 2">
- <div class="record_contian">
- <div class="tit">数据统计(总)</div>
- <div style="display: flex; justify-content: space-between">
- <div class="count_item">
- <img src="" alt="" />
- <div class="count_intro">
- <p style="color: #ff974d">{{ learnInfo.videoCount }}</p>
- <p class="gary">共看完视频(节)</p>
- </div>
- </div>
- <div class="count_item">
- <img src="" alt="" />
- <div class="count_intro">
- <p style="color: #89928a">{{ learnInfo.videoMinutes }}</p>
- <p class="gary">共看完视频时长(分钟)</p>
- </div>
- </div>
- <div class="count_item">
- <img src="" alt="" />
- <div class="count_intro">
- <p style="color: #86dcf2">{{ learnInfo.questionCount }}</p>
- <p class="gary">共完成习题</p>
- </div>
- </div>
- <div class="count_item">
- <img src="" alt="" />
- <div class="count_intro">
- <p style="color: #ee625c">
- {{
- learnInfo.correctPercent == "" ? 0 : learnInfo.correctPercent
- }}
- </p>
- <p class="gary">正确率</p>
- </div>
- </div>
- </div>
- </div>
- <div class="record_contian">
- <div class="tit">数据统计(周)</div>
- <el-form
- :inline="true"
- :model="dateForm"
- :rules="dateRule"
- ref="ruleForm"
- class="demo-form-inline"
- >
- <div class="date_contain">
- <el-form-item label="日期" prop="year">
- <el-select
- v-model="dateForm.year"
- placeholder="年份"
- size="small"
- >
- <el-option
- v-for="(item, index) in dateYears"
- :key="index"
- :value="item"
- :label="item + '年'"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="" prop="month">
- <el-select
- v-model="dateForm.month"
- placeholder="月份"
- size="small"
- >
- <el-option
- v-for="(item, index) in dateMonth"
- :key="index"
- :value="item"
- :label="item + '月'"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="周" prop="week">
- <el-select
- v-model="dateForm.week"
- placeholder="第几周"
- size="small"
- >
- <el-option
- v-for="(item, index) in dateWeek"
- :key="index"
- :value="item"
- :label="'第' + item + '周'"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-button
- style="margin-left: 24px; width: 100px; height: 40px"
- type="primary"
- icon="el-icon-search"
- @click="searchData"
- ></el-button>
- </div>
- </el-form>
- <div style="display: flex; justify-content: space-around">
- <div style="width: 300px; height: 269px" id="echarts_quecount"></div>
- <div style="width: 320px; height: 269px" id="echarts_queBySub"></div>
- <div
- style="width: 300px; height: 269px"
- id="echarts_videocount"
- ></div>
- <div style="width: 320px; height: 269px" id="echarts_vidBysub"></div>
- </div>
- </div>
- <div class="record_contian">
- <div class="tit">学习记录</div>
- <div class="video_contian" v-if="videoRecord.length > 0">
- <div class="video_item" v-for="item in videoRecord" :key="item.id">
- <img :src="item.pict" alt="" />
- <p>{{ item.title }}</p>
- <p>
- {{ item.percent > 90 ? "已看完" : "观看" + item.percent + "%" }}
- </p>
- </div>
- </div>
- <div class="empty" v-else>
- <img src="@/assets/images/icon_data.png" />
- <span>没有信息</span>
- </div>
- </div>
- <div class="record_contian">
- <div class="tit">知识点诊断记录</div>
- <div>
- <el-table :data="knowRecord" style="width: 100%">
- <el-table-column prop="day" label="日期"> </el-table-column>
- <el-table-column prop="coursename" label="科目"> </el-table-column>
- <el-table-column prop="knowledgeName" label="知识点" width="500">
- </el-table-column>
- <el-table-column label="用时">
- <template slot-scope="scope">
- {{
- scope.row.seconds != "null"
- ? Math.ceil(scope.row.seconds / 60) + "分钟"
- : scope.row.seconds
- }}
- </template>
- </el-table-column>
- <el-table-column prop="wrongs" label="正确率">
- <template slot-scope="scope">
- {{ (scope.row.rights / 10) * 100 }}%
- </template>
- </el-table-column>
- <template slot="empty">
- <div class="empty">
- <img src="@/assets/images/icon_data.png" />
- <span>没有信息</span>
- </div>
- </template>
- </el-table>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import {
- favSubjects,
- favQueTypes,
- favQuestions,
- favPapers,
- wrongSubjects,
- wrongTypes,
- wrongQuestions,
- deleteWrongQuestion,
- summary,
- questionStatsByDay,
- videoStatsBySubject,
- videoStatsByDay,
- questionStatsBySubject,
- videoWatchRecords,
- knowRecords,
- queCancelCollect,
- queCollect,
- } from "@/api/webApi/webQue.js";
- const echarts = require("echarts/lib/echarts");
- require("echarts/lib/component/title");
- require("echarts/lib/component/tooltip");
- require("echarts/lib/component/grid");
- require("echarts/lib/component/legend");
- require("echarts/lib/chart/line");
- require("echarts/lib/chart/pie");
- var date = new Date();
- var myChart1;
- var myChart2;
- var myChart3;
- var myChart4;
- var flag = 1;
- export default {
- data() {
- return {
- tabActive: 0,
- dateYears: [2021, 2020],
- dateMonth: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
- dateWeek: [1, 2, 3, 4, 5],
- form: {
- type: "",
- subjectName: "",
- qtype: "",
- worngSubjectName: "",
- wrongType: "",
- },
- types: [
- { type: "question", name: "试题收藏" },
- { type: "paper", name: "试卷收藏" },
- ],
- subjects: [],
- queTypes: [],
- collectQue: [],
- collectPaper: [],
- wrongSubject: [],
- wrongTypes: [],
- pageSize: 10,
- pageNum: 1,
- total: 0,
- wrongQues: [],
- wrongForm: {
- total: 0,
- pageSize: 10,
- pageNum: 1,
- },
- learnInfo: {},
- dateForm: {
- year: date.getFullYear(),
- month: date.getMonth() + 1,
- week: date.getDay / 7 > 0 ? date.getDay / 7 : 5,
- },
- dateRule: {
- year: [{ required: true, message: "请选择年份", trigger: "change" }],
- month: [{ required: true, message: "请选择月份", trigger: "change" }],
- week: [{ required: true, message: "请选择周数", trigger: "change" }],
- },
- knowRecord: [],
- videoRecord: [],
- // 数据统计-做题数量
- queCountOption: {
- title: {
- text: "做题数目(道数)",
- textStyle: {
- color: "#676767",
- fontWeight: "400",
- fontSize: 16,
- },
- },
- tooltip: {
- trigger: "axis",
- },
- xAxis: {
- type: "category",
- data: ["周一", "周二", "周三", "周四", "周五", "周六", "周七"],
- axisTick: {
- show: false,
- },
- },
- yAxis: {
- type: "value",
- axisTick: {
- show: false,
- },
- axisLine: { show: false },
- },
- series: [
- {
- data: [0, 0, 0, 0, 0, 0, 0],
- type: "line",
- name: "做题数",
- lineStyle: {
- color: "#47c6a2",
- width: 2,
- },
- itemStyle: {
- normal: {
- color: "#47c6a2",
- borderColor: "#47c6a2", //拐点边框颜色
- },
- },
- },
- ],
- },
- // 数据统计-视频时长
- videoCountOption: {
- title: {
- text: "看视频时长(分钟)",
- textStyle: {
- color: "#676767",
- fontWeight: "400",
- fontSize: 16,
- },
- },
- tooltip: {
- trigger: "axis",
- },
- xAxis: {
- type: "category",
- data: ["周一", "周二", "周三", "周四", "周五", "周六", "周七"],
- axisTick: {
- show: false,
- },
- },
- yAxis: {
- type: "value",
- axisTick: {
- show: false,
- },
- axisLine: { show: false },
- },
- series: [
- {
- data: [0, 0, 0, 0, 0, 0, 0],
- type: "line",
- name: "观看时长",
- lineStyle: {
- color: "#2EC7C9",
- width: 2,
- },
- itemStyle: {
- normal: {
- color: "#2EC7C9",
- borderColor: "#2EC7C9", //拐点边框颜色
- },
- },
- },
- ],
- },
- // 数据统计-做题数量 根据科目
- queSubCount: {
- title: {
- text: "学科分类数据(道数)",
- textStyle: {
- color: "#676767",
- fontWeight: "400",
- fontSize: 16,
- },
- },
- tooltip: {
- trigger: "item",
- },
- color: [
- "#5B8FF9",
- "#5AD8A6",
- "#DEEAFF",
- "#FFE18B",
- "#FEB3A2",
- "#BAEF83",
- "#DBC7FA",
- "#FFE6D2",
- "#76DDDC",
- ],
- legend: {
- orient: "vertical",
- left: "right",
- align: "left",
- icon: "circle",
- top: "20",
- },
- series: [
- {
- name: "做题数",
- type: "pie",
- radius: "70%",
- data: [
- { value: 0, name: "语文" },
- { value: 0, name: "数学" },
- { value: 0, name: "英语" },
- { value: 0, name: "物理" },
- { value: 0, name: "化学" },
- { value: 0, name: "生物" },
- { value: 0, name: "历史" },
- { value: 0, name: "地理" },
- { value: 0, name: "政治" },
- ],
- left: "-80",
- label: {
- position: "inside",
- formatter: "{c}",
- color: "#000000",
- },
- labelLine: {
- show: false,
- },
- },
- ],
- },
- // 数据统计-视频时长 根据科目
- vidSubCount: {
- title: {
- text: "学科分类数据(分钟)",
- textStyle: {
- color: "#676767",
- fontWeight: "400",
- fontSize: 16,
- },
- },
- tooltip: {
- trigger: "item",
- },
- color: [
- "#5B8FF9",
- "#5AD8A6",
- "#DEEAFF",
- "#FFE18B",
- "#FEB3A2",
- "#BAEF83",
- "#DBC7FA",
- "#FFE6D2",
- "#76DDDC",
- ],
- legend: {
- orient: "vertical",
- left: "right",
- align: "left",
- icon: "circle",
- top: "20",
- },
- series: [
- {
- name: "做题时长",
- type: "pie",
- radius: "70%",
- data: [
- { value: 0, name: "语文" },
- { value: 0, name: "数学" },
- { value: 0, name: "英语" },
- { value: 0, name: "物理" },
- { value: 0, name: "化学" },
- { value: 0, name: "生物" },
- { value: 0, name: "历史" },
- { value: 0, name: "地理" },
- { value: 0, name: "政治" },
- ],
- label: {
- position: "inside",
- formatter: "{c}",
- color: "#000000",
- },
- left: "-80",
- labelLine: {
- show: false,
- },
- },
- ],
- },
- };
- },
- created() {
- // 设置默认高亮
- this.tabActive = this.$route.query.tabActive
- ? this.$route.query.tabActive
- : 0;
- if (this.tabActive == 1) {
- this.switchTab(1);
- } else if (this.tabActive == 2) {
- this.switchTab(2);
- } else {
- this.toggleType("question");
- }
- },
- methods: {
- switchTab(index) {
- this.tabActive = index;
- if (this.tabActive == 1) {
- this.getWrongSubject();
- } else if (this.tabActive == 2 && flag == 1) {
- let queCountChart = document.getElementById("echarts_quecount");
- myChart1 = echarts.init(queCountChart);
- myChart1.setOption(this.queCountOption);
- let videoCountChart = document.getElementById("echarts_videocount");
- myChart2 = echarts.init(videoCountChart);
- myChart2.setOption(this.videoCountOption);
- let queBySubChart = document.getElementById("echarts_queBySub");
- myChart3 = echarts.init(queBySubChart);
- myChart3.setOption(this.queSubCount);
- let vidBySubChart = document.getElementById("echarts_vidBysub");
- myChart4 = echarts.init(vidBySubChart);
- myChart4.setOption(this.vidSubCount);
- flag++;
- }
- if (index == 2) {
- this.getSummary();
- this.searchData();
- }
- },
- toggleType(e) {
- this.form.type = e;
- this.getSubjects();
- },
- // 收藏涉及的学科
- getSubjects() {
- favSubjects({ type: this.form.type }).then((res) => {
- console.log(res);
- this.form.subjectName = res.data[0];
- this.subjects = res.data;
- if (this.form.type == "question") {
- this.getFavQue();
- } else if (this.form.type == "paper") {
- this.getFavPapers();
- }
- });
- },
- // 收藏涉及的题型
- getFavQue() {
- favQueTypes({ subjectName: this.form.subjectName }).then((res) => {
- this.form.qtype = res.data[0];
- this.queTypes = res.data;
- this.getFavQuestions();
- });
- },
- // 错题涉及的题型
- getWrongTypes() {
- wrongTypes({ subjectName: this.form.worngSubjectName }).then((res) => {
- if (res.data.length > 0) {
- this.form.wrongType = res.data[0];
- }
- this.wrongTypes = res.data;
- this.wrongForm.pageNum;
- this.getWrongQuestions();
- });
- },
- // 错题涉及的科目
- getWrongSubject() {
- wrongSubjects().then((res) => {
- if (res.data.length > 0) {
- this.form.worngSubjectName = res.data[0];
- }
- this.wrongSubject = res.data;
- this.getWrongTypes();
- });
- },
- // 错题列表
- getWrongQuestions() {
- wrongQuestions({
- subjectName: this.form.worngSubjectName,
- qtype: this.form.wrongType,
- pageSize: this.wrongForm.pageSize,
- pageNum: this.wrongForm.pageNum,
- }).then((res) => {
- this.wrongQues = res.rows;
- this.wrongForm.total = res.total;
- this.$nextTick(_=>this.mxGlobal.MathQueue('wrong-question'))
- console.log(res);
- });
- },
- // 收藏的问题列表
- getFavQuestions() {
- favQuestions({
- subjectName: this.form.subjectName,
- qtype: this.form.qtype,
- pageNum: this.pageNum,
- pageSize: this.pageSize,
- }).then((res) => {
- this.total = res.total;
- this.collectQue = res.rows;
- this.$nextTick(_=>this.mxGlobal.MathQueue('collect-question'))
- console.log(res);
- });
- },
- getFavPapers() {
- favPapers({
- subjectName: this.form.subjectName,
- pageNum: this.pageNum,
- pageSize: this.pageSize,
- }).then((res) => {
- console.log(res);
- this.total = res.total;
- this.collectPaper = res.rows;
- });
- },
- toggleSub() {
- this.pageNum == 1;
- if (this.form.type == "paper") {
- this.getFavPapers();
- } else {
- this.getFavQue();
- }
- },
- toggleQueType() {
- this.pageNum == 1;
- this.getFavQuestions();
- },
- viewDetail(index) {
- if (this.collectQue[index].createTime) {
- this.collectQue[index].createTime = false;
- } else {
- this.collectQue[index].createTime = true;
- }
- },
- viewWrongDetail(index) {
- if (this.wrongQues[index].createTime) {
- this.wrongQues[index].createTime = false;
- } else {
- this.wrongQues[index].createTime = true;
- }
- },
- // 跳转到预览页面
- toPreView(paperId, paperName) {
- this.$router.push({
- path: "/question-center/bestPaper/preview",
- query: { paperId, paperName },
- });
- },
- prev() {
- this.pageNum = this.pageNum - 1;
- if (this.form.type == "question") {
- this.getFavQuestions();
- } else {
- }
- },
- next() {
- this.pageNum = this.pageNum + 1;
- if (this.form.type == "question") {
- this.getFavQuestions();
- } else {
- this.getFavPapers();
- }
- },
- toDeleteWrongQue(id, index) {
- this.wrongQues.splice(index, 1);
- deleteWrongQuestion({ questionId: id }).then((res) => {
- this.msgSuccess("删除成功");
- console.log(res);
- });
- },
- toggleWrongType() {
- this.wrongForm.pageNum = 1;
- this.getWrongQuestions();
- },
- toggleWrongSub() {
- this.getWrongTypes();
- },
- wrongNext() {
- this.wrongForm.pageNum++;
- this.getWrongQuestions();
- },
- wrongPrev() {
- this.wrongForm.pageNum--;
- this.getWrongQuestions();
- },
- getSummary() {
- summary().then((res) => {
- this.learnInfo = res.data;
- console.log(res);
- });
- },
- // 数据统计-做题数量-按天
- getQuestionStatsByDay() {
- questionStatsByDay({
- year: this.dateForm.year,
- month: this.dateForm.month,
- week: this.dateForm.week,
- }).then((res) => {
- let arr = [];
- const kesArr = Object.keys(res.data).sort();
- for (const key of kesArr) {
- arr.push(res.data[key]);
- }
- this.queCountOption.series[0].data = arr;
- myChart1.setOption(this.queCountOption);
- });
- },
- // 数据统计-视频观看时长 - 按天
- getVideoStatsByDay() {
- videoStatsByDay({
- year: this.dateForm.year,
- month: this.dateForm.month,
- week: this.dateForm.week,
- }).then((res) => {
- let arr = [];
- const kesArr = Object.keys(res.data).sort();
- for (const key of kesArr) {
- arr.push(res.data[key]);
- }
- this.videoCountOption.series[0].data = arr;
- myChart2.setOption(this.videoCountOption);
- });
- },
- // 数据统计-视频观看时长 - 按学科
- getVideoStatsBySubject() {
- videoStatsBySubject({
- year: this.dateForm.year,
- month: this.dateForm.month,
- week: this.dateForm.week,
- }).then((res) => {
- console.log(res);
- if (Object.keys(res.data).length > 0) {
- console.log(res);
- let objArr = [];
- for (const key in res.data) {
- objArr.push({ name: key, value: res.data[key] });
- }
- console.log(objArr);
- this.vidSubCount.series[0].data = objArr;
- myChart4.setOption(this.vidSubCount);
- } else {
- this.vidSubCount.series[0].data = [
- { value: 0, name: "语文" },
- { value: 0, name: "数学" },
- { value: 0, name: "英语" },
- { value: 0, name: "物理" },
- { value: 0, name: "化学" },
- { value: 0, name: "生物" },
- { value: 0, name: "历史" },
- { value: 0, name: "地理" },
- { value: 0, name: "政治" },
- ];
- myChart4.setOption(this.vidSubCount);
- }
- });
- },
- // 数据统计-做题数量 - 按学科
- getQuestionStatsBySubject() {
- questionStatsBySubject({
- year: this.dateForm.year,
- month: this.dateForm.month,
- week: this.dateForm.week,
- }).then((res) => {
- if (Object.keys(res.data).length > 0) {
- console.log(res);
- let objArr = [];
- for (const key in res.data) {
- objArr.push({ name: key, value: res.data[key] });
- }
- console.log(objArr);
- this.queSubCount.series[0].data = objArr;
- myChart3.setOption(this.queSubCount);
- } else {
- this.queSubCount.series[0].data = [
- { value: 0, name: "语文" },
- { value: 0, name: "数学" },
- { value: 0, name: "英语" },
- { value: 0, name: "物理" },
- { value: 0, name: "化学" },
- { value: 0, name: "生物" },
- { value: 0, name: "历史" },
- { value: 0, name: "地理" },
- { value: 0, name: "政治" },
- ];
- myChart3.setOption(this.queSubCount);
- }
- });
- },
- // 视频学习记录
- getVideoRecord() {
- videoWatchRecords({
- year: this.dateForm.year,
- month: this.dateForm.month,
- week: this.dateForm.week,
- }).then((res) => {
- this.videoRecord = res.data;
- console.log(res);
- });
- },
- // 知识点诊断记录
- getKnowRecords() {
- knowRecords({
- year: this.dateForm.year,
- month: this.dateForm.month,
- week: this.dateForm.week,
- }).then((res) => {
- this.knowRecord = res.data;
- console.log(this.knowRecord);
- });
- },
- searchData() {
- console.log(this.dateForm);
- this.$refs.ruleForm.validate((valid) => {
- if (valid) {
- this.getQuestionStatsByDay();
- this.getVideoStatsByDay();
- this.getQuestionStatsBySubject();
- this.getVideoStatsBySubject();
- this.getVideoRecord();
- this.getKnowRecords();
- /* this.getVideoStatsByDay();
- this.getQuestionStatsBySubject(); */
- } else {
- console.log("error submit!!");
- return false;
- }
- });
- },
- toCollectQue(item) {
- queCollect({ questionId: item.id }).then((res) => {
- item.collect = !item.collect;
- this.msgSuccess("收藏成功");
- console.log(res);
- });
- },
- toCancelCollectQue(item) {
- queCancelCollect({ questionId: item.id }).then((res) => {
- item.collect = !item.collect;
- this.msgSuccess("取消收藏成功");
- console.log(res);
- });
- },
- },
- };
- </script>
- <style scoped>
- .empty {
- display: flex;
- justify-content: center;
- flex-direction: column;
- align-items: center;
- font-size: 14px;
- color: #909399;
- }
- .option {
- padding-left: 33px;
- display: flex;
- margin-bottom: 10px;
- }
- .learn_container {
- padding: 20px;
- background: #f7f7f7;
- min-height: 100vh;
- }
- .header {
- margin-bottom: 16px;
- }
- .mis_content,
- .shoucan_content {
- background: #fff;
- padding: 32px 28px;
- }
- .record_content {
- padding: 32px 28px;
- }
- .record_content .record_contian {
- border-radius: 8px;
- margin-bottom: 20px;
- background: #fff;
- padding: 32px 28px;
- }
- .record_content .record_contian .tit {
- color: #47c6a2;
- margin-bottom: 36px;
- }
- .record_content .record_contian .count_item img {
- margin-right: 16px;
- }
- .tab {
- display: flex;
- margin-bottom: 14px;
- border-bottom: 1px solid #dedede;
- }
- .delete > div:first-child > span {
- color: #f44949;
- }
- .tab .tab_item {
- flex: 1;
- text-align: center;
- font-size: 16px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- line-height: 22px;
- padding-bottom: 28px;
- position: relative;
- }
- .tab .tab_active {
- color: #47c6a2;
- }
- .tab .tab_active::after {
- content: "";
- height: 4px;
- width: 100%;
- background: #47c6a2;
- position: absolute;
- transform: translateY(50%);
- left: 0;
- bottom: 0;
- }
- .tab .tab_item:hover {
- color: #47c6a2;
- }
- .tab .tab_item:hover::after {
- content: "";
- width: 100%;
- height: 4px;
- position: absolute;
- background: #47c6a2;
- left: 0;
- transform: translateY(50%);
- bottom: 0;
- }
- .que_item {
- border-radius: 1px;
- border: 1px solid #dedede;
- margin-bottom: 8px;
- }
- .que_content {
- padding: 12px 24px 0 33px;
- font-size: 14px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #4c4c4c;
- line-height: 27px;
- margin-bottom: 40px;
- }
- .que_footer {
- border-top: 1px solid #dedede;
- padding-left: 33px;
- overflow: hidden;
- padding-bottom: 23px;
- padding-top: 21px;
- }
- .que_footer .spans {
- float: left;
- font-size: 12px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #979797;
- line-height: 20px;
- }
- .que_footer .spans > span {
- margin-right: 20px;
- }
- .operation {
- display: flex;
- align-items: center;
- font-size: 14px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #47c6a2;
- line-height: 20px;
- justify-content: flex-end;
- }
- .operation > div {
- display: flex;
- align-items: center;
- cursor: pointer;
- }
- .operation .shoucan {
- margin-right: 46px;
- }
- .operation .detail span {
- border-radius: 1px;
- border-bottom: 1px solid #47c6a2;
- }
- .operation .detail {
- margin-right: 32px;
- }
- .operation > div > img {
- margin-right: 10px;
- }
- .operation .addQue {
- padding: 7px;
- border-radius: 4px;
- border: 1px solid #979797;
- margin-right: 24px;
- }
- .info {
- padding: 12px 40px;
- }
- .radio_contianer > div {
- margin-bottom: 16px;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- }
- .radio_contianer > div > span {
- flex-shrink: 0;
- font-size: 14px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #232323;
- line-height: 20px;
- height: 20px;
- width: 50px;
- }
- .paper_item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding-right: 30px;
- margin-bottom: 40px;
- }
- .paper_item .tit {
- font-size: 16px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #343434;
- line-height: 22px;
- }
- .paper_item .viewCount {
- margin-top: 16px;
- color: #9f9f9f;
- font-size: 14px;
- display: flex;
- align-items: center;
- }
- .paper_item .viewCount img {
- margin-right: 9px;
- }
- .paper_item .opera {
- display: flex;
- justify-content: space-between;
- }
- .paper_item .opera > div {
- cursor: pointer;
- display: flex;
- flex-direction: row;
- align-items: center;
- }
- .paper_item .opera .view {
- color: #47c6a2;
- border-radius: 4px;
- border: 1px solid #47c6a2;
- padding: 6px 12px;
- }
- .paper_item .opera .download {
- border-radius: 4px;
- border: 1px solid #47c6a2;
- padding: 6px 22px;
- background: #47c6a2;
- color: white;
- margin: 0 24px;
- }
- .paper_item .opera > div:last-child {
- color: #47c6a2;
- }
- .parse {
- padding: 0 30px;
- }
- .gary {
- margin-top: 8px;
- font-size: 16px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #7a7a7a;
- line-height: 22px;
- }
- .date_contain > span {
- display: inline-block;
- border-radius: 1px;
- margin-right: 16px;
- font-size: 16px;
- }
- .el-card__body {
- padding-bottom: 0;
- }
- .video_contian {
- display: flex;
- }
- .video_contian img {
- width: 200px;
- }
- .video_contian .video_item {
- margin-right: 80px;
- }
- .video_contian .video_item > p:first-child {
- color: #4a4a4a;
- font-size: 14px;
- margin-top: 7px;
- margin-bottom: 4px;
- }
- .video_contian .video_item > p:last-child {
- font-size: 12px;
- color: #bdbdbd;
- }
- </style>
- <style >
- .el-dialog__header .el-dialog__title {
- color: #47c6a2;
- }
- .radio_contianer .el-radio-button__inner {
- border-left: 1px solid #dcdfe6;
- }
- .radio_contianer .el-radio-button .el-radio-button__inner {
- border-radius: 16px;
- margin-bottom: 5px;
- }
- .radio_contianer .el-radio-button:first-child:last-child .el-radio-button__inner {
- border-radius: 16px;
- }
- .radio_contianer .el-radio-button {
- margin-right: 8px;
- }
- </style>
|