From 752ed00ca8085cd8bb7e602d55fde39d45f487be Mon Sep 17 00:00:00 2001 From: litian <2804272236@qq.com> Date: 星期五, 14 六月 2024 11:19:24 +0800 Subject: [PATCH] web1 --- src/views/readerPages/webHome.vue | 101 ++++++++++++++++++++------------- src/views/components/newWord.vue | 7 + src/assets/images/menu/function.png | 0 src/router/index.ts | 6 ++ src/views/components/wrongQuestion.vue | 9 +++ src/assets/images/menu/question.svg | 1 6 files changed, 83 insertions(+), 41 deletions(-) diff --git a/src/assets/images/menu/function.png b/src/assets/images/menu/function.png new file mode 100644 index 0000000..cebeace --- /dev/null +++ b/src/assets/images/menu/function.png Binary files differ diff --git a/src/assets/images/menu/question.svg b/src/assets/images/menu/question.svg new file mode 100644 index 0000000..357b62b --- /dev/null +++ b/src/assets/images/menu/question.svg @@ -0,0 +1 @@ +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1718273871563" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17369" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M511.488 511.488m-509.44 0a509.44 509.44 0 1 0 1018.88 0 509.44 509.44 0 1 0-1018.88 0Z" fill="#FF5656" p-id="17370"></path><path d="M377.856 410.112H298.496c-4.608 0-11.264-4.608-11.264-11.264 0-6.656 6.656-11.264 11.264-11.264h109.568c36.352-33.28 58.88-77.824 58.88-126.976 0-18.432-3.072-36.352-9.216-53.248h-163.84c-51.2 0-93.184 40.448-93.184 92.672v139.264c16.896 3.584 34.816 5.632 53.248 5.632 46.08-0.512 89.088-13.312 123.904-34.816z" fill="#FFFFFF" opacity=".4" p-id="17371"></path><path d="M298.496 410.112c-4.608 0-11.264-4.608-11.264-11.264 0 6.656 6.656 11.264 11.264 11.264h79.36-79.36z" fill="#FFFFFF" p-id="17372"></path><path d="M684.544 206.848H457.728c6.144 16.896 9.216 34.816 9.216 53.248 0 49.152-22.528 94.208-58.88 126.976h23.552c4.608 0 8.192 2.048 9.728 5.632 1.024 1.536 1.024 3.584 1.024 5.12v1.024c0 2.048-0.512 3.584-1.024 5.12-2.048 3.584-5.12 5.632-9.728 5.632H377.856c-34.816 21.504-77.824 34.304-123.904 34.304-18.432 0-35.84-2.048-53.248-5.632v287.232c0 49.664 41.984 90.112 93.184 90.112h403.456c44.544 0 80.384-35.84 80.384-80.896v-435.2c0-51.712-41.984-92.672-93.184-92.672z m-313.856 382.464c-0.512 0.512-1.536 0.512-2.048 1.024-1.024 0.512-2.56 0.512-3.584 0.512h-66.56c-4.096 0-7.168-1.536-9.216-4.096-1.536-2.048-2.048-4.096-2.048-7.168 0-2.56 1.024-5.12 2.048-7.168v-0.512c2.048-2.56 5.12-3.584 8.704-3.584h66.56c6.656 0 11.264 4.608 11.264 11.264 0.512 4.608-2.048 8.192-5.12 9.728z m69.12-92.16c-2.048 2.048-4.608 3.072-8.192 3.072h-133.12c-4.608 0-11.264-4.608-11.264-11.264s4.608-11.264 11.264-11.264h133.12c6.656 0 11.264 4.608 11.264 11.264 0 3.584-1.536 6.656-3.072 8.192z m292.864-68.096h-95.744v270.848c0 5.12-4.096 9.728-9.728 9.728h-34.304c-5.12 0-9.216-4.096-9.216-9.216v-271.36H487.936c-6.144 0-11.264-5.12-11.264-11.264v-27.136c0-5.12 4.096-9.216 9.216-9.216h249.344c5.632 0 10.752 4.608 10.752 10.752v24.064c-0.512 6.656-6.144 12.8-13.312 12.8z" fill="#FFFFFF" p-id="17373"></path></svg> \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index 18e560d..09a9650 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -60,6 +60,12 @@ name: 'newWord', meta: { auth: true, name: '鐢熻瘝' }, component: () => import('@/views/components/newWord.vue') + }, + { + path: '/wrongQuestion', + name: 'wrongQuestion', + meta: { auth: true, name: '閿欓' }, + component: () => import('@/views/components/wrongQuestion.vue') } ] }, diff --git a/src/views/components/newWord.vue b/src/views/components/newWord.vue index 2d33c03..745e04c 100644 --- a/src/views/components/newWord.vue +++ b/src/views/components/newWord.vue @@ -158,6 +158,7 @@ const handleNodeClick1 = (data) => { wordData.value = [] + isShow.value = null if (data.words) { wordData.value = data.words } @@ -274,7 +275,8 @@ display: flex; margin: 10px 0; .pos { - width: 35px; + min-width: 30px; + padding:2px 5px; line-height: 16px; text-align: center; background: rgba(90, 180, 246, 0.18); @@ -346,7 +348,8 @@ display: flex; margin: 10px 0; .pos { - width: 35px; + min-width: 30px; + padding:2px 5px; line-height: 16px; text-align: center; background: rgba(90, 180, 246, 0.18); diff --git a/src/views/components/wrongQuestion.vue b/src/views/components/wrongQuestion.vue new file mode 100644 index 0000000..9eadab2 --- /dev/null +++ b/src/views/components/wrongQuestion.vue @@ -0,0 +1,9 @@ +<template> + <div></div> +</template> + +<script setup lang="ts"> +</script> + +<style lang="less"> +</style> \ No newline at end of file diff --git a/src/views/readerPages/webHome.vue b/src/views/readerPages/webHome.vue index d7fb39c..b8b0ceb 100644 --- a/src/views/readerPages/webHome.vue +++ b/src/views/readerPages/webHome.vue @@ -93,7 +93,7 @@ <!-- 鑿滃崟鍐呭 --> <div class="menuContent" v-if="menuState.open"> <div class="searchBox"> - <div class="inputBox" v-if="activeMenu !== '璧勬簮' && activeMenu !== '涔犻'"> + <div class="inputBox" v-if="activeMenu !== '璧勬簮' && activeMenu !== '棰樺簱'"> <el-input class="custom-input" placeholder="璇疯緭鍏ュ唴瀹�" @@ -118,15 +118,20 @@ <div :class="resourceType == 'teacher' ? 'text' : 'line'"></div> </div> </div> - <div v-if="activeMenu == '涔犻'" class="resourceTab"> - <div class="tabItem hover" @click="selectExercisesType('exercises')"> + <div v-if="activeMenu == '棰樺簱'" class="resourceTab"> + <div class="tabItem hover" @click="selectExercisesType('exercises')" v-if="bookConfig.textbookComponents.indexOf('3D3B4F55') > -1"> <div>涔犻</div> <div :class="exercisesType == 'exercises' ? 'text' : 'line'"></div> </div> - <hr class="hr" /> - <div class="tabItem hover" @click="selectExercisesType('wrong')"> + <hr class="hr" v-if="bookConfig.textbookComponents.indexOf('AFC1A288') > -1"/> + <div class="tabItem hover" @click="selectExercisesType('wrong')" v-if="bookConfig.textbookComponents.indexOf('AFC1A288') > -1"> <div>閿欓鏈�</div> <div :class="exercisesType == 'wrong' ? 'text' : 'line'"></div> + </div> + <hr class="hr" v-if="bookConfig.textbookComponents.indexOf('A434F2C0') > -1"/> + <div class="tabItem hover" @click="selectExercisesType('collection')" v-if="bookConfig.textbookComponents.indexOf('A434F2C0') > -1"> + <div>鏀惰棌</div> + <div :class="exercisesType == 'collection' ? 'text' : 'line'"></div> </div> </div> </div> @@ -192,7 +197,7 @@ </div> </div> <!-- 绗旇 --> - <div class="notesBox" v-if="activeMenu == '绗旇'"> + <div class="notesBox" v-if="activeMenu == '绗旇'" v-loading="listLoading"> <div class="screenBox"> <div class="title">绛涢��</div> <div class="flex1 hover" @click="searchClick('all')"> @@ -210,7 +215,7 @@ ></div> </div> </div> - <div class="list-box" v-loading="listLoading"> + <div class="list-box"> <div v-if="scribeData.noteList.length > 0"> <div v-for="(noteItem, index) in scribeData.noteList" :key="noteItem"> <div class="chapterName"> @@ -413,8 +418,8 @@ </div> </div> <!-- 鎴浘 --> - <div class="screenshotList" v-if="activeMenu == '鎴浘'"> - <div class="list-box" v-loading="listLoading"> + <div class="screenshotList" v-if="activeMenu == '鎴浘'" v-loading="listLoading"> + <div class="list-box"> <div class="screenshot" v-if="screenshotList.length > 0"> <div v-for="(item, index) in screenshotList" :key="item" class="captureItem"> <div class="imgBox" @mouseover="showDelete = index" @mouseleave="showDelete = null"> @@ -438,8 +443,8 @@ </div> </div> <!-- 涔︾ --> - <div class="reMarkList" v-if="activeMenu == '涔︾'"> - <div class="list-box" v-loading="listLoading"> + <div class="reMarkList" v-if="activeMenu == '涔︾'" v-loading="listLoading"> + <div class="list-box"> <div v-if="reMarkList.length > 0"> <div v-for="(item, index) in reMarkList" :key="index" class="reMarkItem"> <div class="reMarkCon hover" @click="goReMark(item)"> @@ -455,7 +460,7 @@ </div> </div> </div> - <div class="questionList" v-if="activeMenu == '涔犻'"> + <div class="questionList" v-if="activeMenu == '棰樺簱'" v-loading="listLoading"> <div class="resourceSearchBox"> <div class="inputBox"> <el-input @@ -1172,6 +1177,11 @@ <newWord :resourceUrl="resourceUrl" /> </div> </el-dialog> + <el-dialog title="閿欓鏈�" align-center v-model="wrongQuestionVisble" width="800" class="myDialogs"> + <div class="wendabox"> + <wrongQuestion /> + </div> + </el-dialog> </template> <script setup lang="ts"> @@ -1189,6 +1199,7 @@ import moment from 'moment' import dictionary from '@/views/components/dictionary.vue' import newWord from '@/views/components/newWord.vue' +import wrongQuestion from '@/views/components/wrongQuestion.vue' import { ElMessage, ElMessageBox, valueEquals } from 'element-plus' import logo from '@/assets/images/header/logo.png' import mulu from '@/assets/images/menu/mulu.png' @@ -1198,6 +1209,7 @@ import jietu from '@/assets/images/menu/jietu.png' import biaoqian from '@/assets/images/menu/biaoqian.png' import allSearch from '@/assets/images/menu/allSearch.svg' +import question from '@/assets/images/menu/question.svg' import topbg from '@/assets/images/header/top-bg.png' import setting from '@/assets/images/operation/setting.png' import search from '@/assets/images/operation/search.png' @@ -1211,7 +1223,7 @@ import shengzikapian from '@/assets/images/menu/shengzikapian.png' import hudongwenda from '@/assets/images/menu/hudongwenda.png' import siweidaotu from '@/assets/images/menu/siweidaotu.png' -import GGB from '@/assets/images/menu/GGB.png' +import GGB from '@/assets/images/menu/function.png' import jihe from '@/assets/images/menu/jihe.png' import python from '@/assets/images/menu/python.png' import cjiajia from '@/assets/images/menu/C++.png' @@ -1528,11 +1540,11 @@ icon: biaoqian, isShow: bookConfig.value.textbookComponents.indexOf('CF2E1400') > -1 }, - // { - // name: '涔犻', - // icon: zhishitupu, - // isShow: true - // } + { + name: '棰樺簱', + icon: question, + isShow: bookConfig.value.textbookComponents.indexOf('3D3B4F55') > -1 || bookConfig.value.textbookComponents.indexOf('AFC1A288') > -1 || bookConfig.value.textbookComponents.indexOf('A434F2C0') > -1 + } ] teachToolsMenuData = [ { @@ -1694,6 +1706,7 @@ listLoading.value = false }) .catch(function (error) { + listLoading.value = false console.log(error) }) } @@ -1930,6 +1943,7 @@ }) .catch(function (error) { console.log(error) + listLoading.value = false }) } else { ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { @@ -2026,25 +2040,30 @@ if (token) { listLoading.value = true questionList.value = [] - axios.get(bookConfig.value.resourceUrl + '/resource.json').then(function (response) { - var json = response.data - // 澶勭悊鑾峰彇鍒扮殑json鏁版嵁 - if (json.length > 0) { - json.forEach((item) => { - if (item.resourceType == '涔犻') { - let text = searchText.value.replace(/^\s*|\s*$/g, '') - if (searchText.value) { - if (item.resourceName.indexOf(text) > -1) { + axios + .get(bookConfig.value.resourceUrl + '/resource.json') + .then(function (response) { + var json = response.data + // 澶勭悊鑾峰彇鍒扮殑json鏁版嵁 + if (json.length > 0) { + json.forEach((item) => { + if (item.resourceType == '涔犻') { + let text = searchText.value.replace(/^\s*|\s*$/g, '') + if (searchText.value) { + if (item.resourceName.indexOf(text) > -1) { + questionList.value.push(item) + } + } else { questionList.value.push(item) } - } else { - questionList.value.push(item) } - } - }) - } - listLoading.value = false - }) + }) + } + listLoading.value = false + }) + .catch(() => { + listLoading.value = false + }) } else { ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { confirmButtonText: '鍘荤櫥褰�', @@ -2058,13 +2077,17 @@ .catch(() => {}) } } + +//閿欓鏈� +const wrongQuestionVisble = ref(false) const selectExercisesType = (type) => { exercisesType.value = type searchText.value = '' - if (type == 'exercises') { getExercisesList() - } else { + } else if(type == 'wrong'){ + questionList.value = [] + }else{ questionList.value = [] } } @@ -2101,7 +2124,7 @@ break case '妫�绱�': break - case '涔犻': + case '棰樺簱': getExercisesList() break } @@ -2253,7 +2276,7 @@ case '涔︾': getReMarkList() break - case '涔犻': + case '棰樺簱': getExercisesList() break case '妫�绱�': @@ -2371,7 +2394,7 @@ case '妫�绱�': allSearchReault.value = [] break - case '涔犻': + case '棰樺簱': getExercisesList() break } -- Gitblit v1.9.1