From 37b05361d8d7fbc822b7c9ffe924369743118fc6 Mon Sep 17 00:00:00 2001 From: litian <2804272236@qq.com> Date: 星期二, 10 九月 2024 14:52:57 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/TextbookReader --- src/views/readerPages/webHome.vue | 2727 +++++++++++++++++++++++++++++++++++----------------------- 1 files changed, 1,624 insertions(+), 1,103 deletions(-) diff --git a/src/views/readerPages/webHome.vue b/src/views/readerPages/webHome.vue index ab528dc..0b14be8 100644 --- a/src/views/readerPages/webHome.vue +++ b/src/views/readerPages/webHome.vue @@ -6,20 +6,20 @@ <span></span> <div class="userInfoBox"> <div class="userName" v-if="userInfo.name">{{ userInfo.name }}</div> - <div v-if="token"><div class="layout hover" @click="layoutBtn">閫�鍑�</div></div> - <div v-else><div class="layout hover" @click="goLogin">鐧诲綍</div></div> + <div v-if="token"> + <div class="layout hover" @click="layoutBtn">閫�鍑�</div> + </div> + <div v-else> + <div class="layout hover" @click="goLogin">鐧诲綍</div> + </div> </div> </div> <div class="contentBox"> <!-- 鑿滃崟 --> <div class="menuBox"> - <div - v-for="(item, index) in menuData" - :key="index" - @click="menuItemClick(item.name)" - :class="token ? '' : 'notClick'" - > - <div :class="['menuItem', activeMenu == item.name ? 'active' : '']" v-if="item.isShow"> + <div v-for="(item, index) in menuData" :key="index"> + <div :class="['menuItem', activeMenu == item.name ? 'active' : '']" @click="menuItemClick(item.name)" + v-if="item.isShow"> <div class="menuIcon imgBox"> <img :src="item.icon" /> </div> @@ -34,16 +34,10 @@ <el-form-item label="瀛椾綋澶у皬"> <div class="lineStyle"> <div class="lineTypeBox"> - <div - v-for="item in settingForm.fontSizeList" - :key="item.key" - :class=" - settingForm.fontSizeActive == item.key - ? 'typeItem lineTypeActive' - : 'typeItem' - " - @click="fontSizeSelect(item)" - > + <div v-for="item in settingForm.fontSizeList" :key="item.key" :class="settingForm.fontSizeActive == item.key + ? 'typeItem lineTypeActive' + : 'typeItem' + " @click="fontSizeSelect(item)"> {{ item.lable }} <div class="activeIcon" v-if="settingForm.fontSizeActive == item.key"> <img :src="xuanzhong" /> @@ -62,20 +56,13 @@ </div> --> <el-form-item label="搴曡壊"> <div class="bgColor"> - <div - v-for="item in settingForm.bgColorList" - :key="item.key" - class="flex1 hover" - @click="bgColorSelect(item)" - > - <div - :style="{ - background: item.key, - 'border-color': - item.key == settingForm.bgColorActive ? '#0093FF' : '#EBEBEB' - }" - class="scribeItem" - > + <div v-for="item in settingForm.bgColorList" :key="item.key" class="flex1 hover" + @click="bgColorSelect(item)"> + <div :style="{ + background: item.key, + 'border-color': + item.key == settingForm.bgColorActive ? '#0093FF' : '#EBEBEB' + }" class="scribeItem"> <img :src="xuanzhong1" v-if="item.key == settingForm.bgColorActive" /> </div> </div> @@ -94,21 +81,15 @@ <!-- 鑿滃崟鍐呭 --> <div class="menuContent" v-if="menuState.open"> <div class="searchBox"> - <div class="inputBox" v-if="activeMenu !== '璧勬簮'"> - <el-input - class="custom-input" - placeholder="璇疯緭鍏ュ唴瀹�" - v-model="searchText" - @keyup.enter="searchBook" - clearable - @clear="handleClear" - > + <div class="inputBox" v-if="activeMenu !== '璧勬簮' && activeMenu !== '棰樺簱'"> + <el-input class="custom-input" placeholder="璇疯緭鍏ュ唴瀹�" v-model="searchText" @keyup.enter="searchBook" clearable + @clear="handleClear"> <template #prefix> - <img :src="listSearch" @click="searchBook" class="hover"/> + <img :src="listSearch" @click="searchBook" class="hover" /> </template> </el-input> </div> - <div v-else class="resourceTab"> + <div v-if="activeMenu == '璧勬簮'" class="resourceTab"> <div class="tabItem hover" @click="selectResourceType('default')"> <div>榛樿璧勬簮</div> <div :class="resourceType == 'default' ? 'text' : 'line'"></div> @@ -118,49 +99,77 @@ <div>鏁欏笀璧勬簮</div> <div :class="resourceType == 'teacher' ? 'text' : 'line'"></div> </div> + <hr class="hr" /> + <div class="tabItem hover" @click="selectResourceType('collect')"> + <div>鏀惰棌璧勬簮</div> + <div :class="resourceType == 'collect' ? 'text' : 'line'"></div> + </div> + </div> + <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" v-if="bookConfig.textbookComponents.indexOf('A4821F71') > -1" /> + <div class="tabItem hover" @click="selectExercisesType('additional')" + v-if="bookConfig.textbookComponents.indexOf('A4821F71') > -1"> + <div>闄勫姞棰�</div> + <div :class="exercisesType == 'additional' ? 'text' : 'line'"></div> + </div> + <!-- <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> <!-- 鐩綍 --> <div class="menuList" v-if="activeMenu == '鐩綍'" v-loading="listLoading"> - <el-tree - ref="catalogTree" - default-expand-all="true" - :expand-on-click-node="false" - node-key="start" - highlight-current - :data="catalogueData" - :props="defaultProps" - v-if="catalogueData.length > 0" - @node-click="handleNodeClick" - :filter-node-method="filterNode" - empty-text="鏆傛棤鏁版嵁" - > + <el-tree ref="catalogTree" default-expand-all="true" :expand-on-click-node="false" node-key="start" + highlight-current :data="catalogueData" :props="defaultProps" v-if="catalogueData.length > 0" + @node-click="handleNodeClick" :filter-node-method="filterNode"> <template #default="{ node, data }"> <div class="custom-tree-node"> <div class="catalogueLabel" :title="node.label">{{ node.label }}</div> <span class="pageNum">{{ data.page }}</span> </div> </template> + <template #empty> + <el-empty :image-size="60" description="鏆傛棤鏁版嵁" /> + </template> </el-tree> - <div v-else> - <el-empty :image-size="60" description="鏆傛棤鏁版嵁" /> - </div> + <div v-else></div> </div> <div class="allSearch" v-if="activeMenu == '妫�绱�'"> <div class="list-box" v-loading="listLoading"> <div v-if="allSearchReault.length > 0" class="allSearchList"> <div v-for="(reault, index) in allSearchReault" :key="index"> <div class="chapterName"> - <el-icon - @click="searchClose(index)" - v-if="searchReaultData.isShow && searchReaultData.openIndex == index" - class="hover" - ><ArrowDown - /></el-icon> - <el-icon @click="searchOpen(index)" v-else class="hover"><ArrowRight /></el-icon> + <el-icon @click="searchClose(index)" + v-if="searchReaultData.isShow && searchReaultData.openIndex == index" class="hover"> + <ArrowDown /> + </el-icon> + <el-icon @click="searchOpen(index)" v-else class="hover"> + <ArrowRight /> + </el-icon> <span>{{ reault.chapterName }} 锛坽{ reault.itemList.length }}锛�</span> </div> - <div v-for="(item, index1) in reault.itemList" :key="index1" class="searchItem" v-show="searchReaultData.isShow && searchReaultData.openIndex == index"> + <div v-for="(item, index1) in reault.itemList" :key="index1" class="searchItem" + v-show="searchReaultData.isShow && searchReaultData.openIndex == index"> <div class="index">{{ index1 + 1 }}.</div> <div class="searchCon hover" @click="goSearchContent(item)" v-html="item.txt1" :title="item.txt"> </div> @@ -173,50 +182,36 @@ </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')"> <div :class="menuState.notesColor == 'all' ? ' allActive' : 'all'">鍏ㄩ儴</div> </div> - <div - v-for="item in colorSelectList" - :key="item.key" - class="flex1 hover" - @click="searchClick(item)" - > - <div - :style="{ background: item.key }" - :class="item.key == menuState.notesColor ? 'activeScribe scribeItem' : 'scribeItem'" - ></div> + <div v-for="item in colorSelectList" :key="item.key" class="flex1 hover" @click="searchClick(item)"> + <div :style="{ background: item.key }" + :class="item.key == menuState.notesColor ? 'activeScribe scribeItem' : 'scribeItem'"></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"> - <el-icon - @click="noteClose(index)" - v-if="scribeData.isShow && scribeData.openIndex == index" - class="hover" - ><ArrowDown - /></el-icon> - <el-icon @click="noteOpen(index)" v-else class="hover"><ArrowRight /></el-icon> + <el-icon @click="noteClose(index)" v-if="scribeData.isShow && scribeData.openIndex == index" + class="hover"> + <ArrowDown /> + </el-icon> + <el-icon @click="noteOpen(index)" v-else class="hover"> + <ArrowRight /> + </el-icon> <span>{{ noteItem.chapterName }}</span> </div> - <div - v-for="(item, index1) in noteItem.noteList" - :key="item.key" - class="listItem" - v-show="scribeData.isShow && scribeData.openIndex == index" - > + <div v-for="(item, index1) in noteItem.noteList" :key="item.key" class="listItem" + v-show="scribeData.isShow && scribeData.openIndex == index"> <div class="textBox"> <div class="title"> <div class="title-con"> - <div - class="border-left" - :style="{ 'border-right-color': item.color }" - ></div> + <div class="border-left" :style="{ 'border-right-color': item.color }"></div> <span>{{ moment(item.createDate).format('YYYY-MM-DD') }}</span> </div> <div> @@ -224,24 +219,20 @@ <img :src="shanchu" @click="deleteBtn(item)" class="hover" /> </div> </div> - <div - class="noteText hover 123456" - @click="jumpContent(item)" - :style="{ - background: - item.color == '#F5E12A' - ? 'rgba(255,234,41,0.1)' - : item.color == '#76F0AE' - ? 'rgba(83,255,162,0.1)' - : item.color == '#59CFF5' - ? 'rgba(93,216,255,0.1)' - : item.color == '#CAA5FC' - ? 'rgba(205,167,255,0.1)' - : item.color == '#F5A0B9' - ? 'rgba(255,167,193,0.1)' - : item.color - }" - > + <div class="noteText hover 123456" @click="jumpContent(item)" :style="{ + background: + item.color == '#F5E12A' + ? 'rgba(255,234,41,0.1)' + : item.color == '#76F0AE' + ? 'rgba(83,255,162,0.1)' + : item.color == '#59CFF5' + ? 'rgba(93,216,255,0.1)' + : item.color == '#CAA5FC' + ? 'rgba(205,167,255,0.1)' + : item.color == '#F5A0B9' + ? 'rgba(255,167,193,0.1)' + : item.color + }"> <div class="con hover"> {{ item.note }} </div> @@ -260,17 +251,9 @@ <div class="resourceBox" v-if="activeMenu == '璧勬簮'" v-loading="listLoading"> <div class="resourceSearchBox" v-if="classifySelectList.length > 0"> <div class="classification"> - <div - v-for="item in classifySelectList" - :key="item.key" - class="flex1 hover" - @click="classifyClick(item)" - > - <div - :class=" - item.key == activeClassify ? 'activeClassify classifyItem' : 'classifyItem' - " - > + <div v-for="item in classifySelectList" :key="item.key" class="flex1 hover" @click="classifyClick(item)"> + <div :class="item.key == activeClassify ? 'activeClassify classifyItem' : 'classifyItem' + "> <div class="title">{{ item.title }}</div> <div class="count">{{ item.count }}</div> </div> @@ -282,16 +265,10 @@ </div> </div> <div class="inputBox" v-if="!searchShow"> - <el-input - class="custom-input" - placeholder="璇疯緭鍏ュ唴瀹�" - v-model="searchText" - @keyup.enter="searchBook" - clearable - @clear="handleClear" - > + <el-input class="custom-input" placeholder="璇疯緭鍏ュ唴瀹�" v-model="searchText" @keyup.enter="searchBook" + clearable @clear="handleClear"> <template #prefix> - <img :src="listSearch" @click="searchBook" class="hover"/> + <img :src="listSearch" @click="searchBook" class="hover" /> </template> </el-input> </div> @@ -301,77 +278,54 @@ <el-row :gutter="20"> <el-col :span="12" v-for="(item, index) in resourceDataList" :key="item"> <div class="resourceItem"> - <div - class="resourceImg" - @mouseover="showHandle = index" - @mouseleave="showHandle = null" - > + <div class="resourceImg" @mouseover="showHandle = index" @mouseleave="showHandle = null"> <img :src="item.resourcePath" mode="" v-if="activeClassify == 'image'" /> - <img - :src="item.icon" - mode="" - v-else-if="item.icon && activeClassify != 'image'" - /> + <img :src="item.icon" mode="" v-else-if="item.icon && activeClassify != 'image'" /> <!-- <el-icon v-else-if="activeClassify == 'image'" size="30"></el-icon> --> - <el-icon v-else-if="activeClassify == 'audio'" size="30"><Headset /></el-icon> - <el-icon v-else-if="activeClassify == 'video'" size="30" + <!-- <el-icon v-else-if="activeClassify == 'audio'" size="30"><Headset /></el-icon> --> + <!-- <el-icon v-else-if="activeClassify == 'video'" size="30" ><VideoCamera - /></el-icon> - <el-icon v-else-if="activeClassify == 'other'" size="30"><Files /></el-icon> - <el-icon v-else-if="activeClassify == 'exercises'" size="30" - ><Tickets - /></el-icon> + /></el-icon> --> + <!-- <el-icon v-else-if="activeClassify == 'other'" size="30"><Files /></el-icon> --> + <img src="@/assets/images/resource/yp-mr.png" v-else-if="activeClassify == 'audio'" /> + <img src="@/assets/images/resource/sp-mr.png" v-else-if="activeClassify == 'video'" /> + <img src="@/assets/images/resource/qt-mr.png" v-else-if="activeClassify == 'other'" /> <div class="handleBox" v-if="showHandle == index"> <div class="delImg"> - <el-icon - class="icon hover" - size="20" - @click="JumpPosition(item)" - v-if="resourceType == 'default'" - ><LocationInformation - /></el-icon> - <el-icon - @click="goPlay(item)" - size="20" - class="icon hover" - v-if="item.resourceType == '瑙嗛'" - ><VideoPlay - /></el-icon> - <el-icon - @click="goPlay(item, index)" - size="20" - class="icon hover" - v-if="item.resourceType == '闊抽' && playIndex != index" - ><VideoPlay - /></el-icon> - <el-icon - @click="goPause()" - size="20" - class="icon hover" - v-if="item.resourceType == '闊抽' && playIndex == index" - ><VideoPause - /></el-icon> - <el-icon - @click="getCapture(item, index)" - size="20" - class="icon hover" - v-if="item.resourceType == '鍥剧墖'" - ><View - /></el-icon> - <el-icon - size="20" - class="icon hover" - @click="goPlay(item)" - v-if=" - !( - item.resourceType == '瑙嗛' || - item.resourceType == '闊抽' || - item.resourceType == '涔犻' || - item.resourceType == '鍥剧墖' - ) - " - ><Download - /></el-icon> + <el-icon class="icon hover" size="20" @click="JumpPosition(item)" + v-if="resourceType == 'default'"> + <LocationInformation /> + </el-icon> + <el-icon @click="goPlay(item)" size="20" class="icon hover" v-if="item.resourceType == '瑙嗛'"> + <VideoPlay /> + </el-icon> + <el-icon @click="goPlay(item, index)" size="20" class="icon hover" + v-if="item.resourceType == '闊抽' && playIndex != index"> + <VideoPlay /> + </el-icon> + <el-icon @click="goPause()" size="20" class="icon hover" + v-if="item.resourceType == '闊抽' && playIndex == index"> + <VideoPause /> + </el-icon> + <el-icon @click="getCapture(item, index)" size="20" class="icon hover" + v-if="item.resourceType == '鍥剧墖'"> + <View /> + </el-icon> + <el-icon size="20" class="icon hover" @click="goPlay(item)" v-if=" + !( + item.resourceType == '瑙嗛' || + item.resourceType == '闊抽' || + item.resourceType == '涔犻' || + item.resourceType == '鍥剧墖' + ) && item.isDownload == '鏄�' + "> + <Download /> + </el-icon> + <!-- 鏀惰棌鎸夐挳 --> + <img + :src="collectResourceList.findIndex(citem => citem.id == item.id) > -1 ? isHeart : heart" + class="icon hover" style="width: 15px;" + @click="handleCollectResource(item.id, item.md5 ? item.md5 : '', item.resourcePath ? item.resourcePath : '', item.resourceType, item.resourceType == '瑙嗛' || '闊抽' ? 'bits' : 'json', item.resourceName)" /> </div> </div> </div> @@ -394,17 +348,17 @@ </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"> <img :src="item.imgUrl" class="capture hover" mode="aspectFill" /> <div class="deleteBox" v-if="showDelete == index"> <div class="delImg"> - <el-icon @click="getCapture(item, index)" size="18" class="icon hover" - ><View - /></el-icon> + <el-icon @click="getCapture(item, index)" size="18" class="icon hover"> + <View /> + </el-icon> <img :src="bianji" class="icon hover" @click="updateScreenshot(item)" /> <img :src="shanchu" class="icon hover" @click="deleteScreenshot(item)" /> </div> @@ -419,8 +373,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)"> @@ -436,21 +390,44 @@ </div> </div> </div> + <div class="questionList" v-if="activeMenu == '棰樺簱'" v-loading="listLoading"> + <div class="resourceSearchBox" v-if="exercisesType !== 'collection' && exercisesType !== 'wrong'"> + <div class="inputBox"> + <el-input class="custom-input" placeholder="璇疯緭鍏ュ唴瀹�" v-model="searchText" @keyup.enter="searchBook" + clearable @clear="handleClear"> + <template #prefix> + <img :src="listSearch" @click="searchBook" class="hover" /> + </template> + </el-input> + </div> + </div> + <div class="list-box" v-loading="listLoading"> + <div v-if="questionList.length > 0"> + <div v-for="(item, index) in questionList" :key="index" class="reMarkItem"> + <div class="questionCon hover" @click="clickQuestion(exercisesType, item)" :title="item.resourceName"> + {{ item.resourceName }} + </div> + </div> + </div> + <div v-if=" + questionList.length == 0 && + exercisesType !== 'collection' && + exercisesType !== 'wrong' + "> + <el-empty :image-size="60" description="鏆傛棤鏁版嵁" /> + </div> + </div> + </div> + <!-- 棰樺簱搴曢儴鏀惰棌澶瑰拰閿欓闆� --> + <ul class="question-bottom" v-if="activeMenu == '棰樺簱'"> + <li @click="selectExercisesType('collection')">鏀惰棌澶�</li> + <li @click="selectExercisesType('wrong')">閿欓鏈�</li> + </ul> <!-- 鑿滃崟鍐呭鏀惰捣 --> <div class="menuStateBox" v-if="menuState.open"> - <svg - @click="menuState.open = false" - xmlns="http://www.w3.org/2000/svg" - width="20" - height="20" - viewBox="0 0 20 20" - fill="none" - stroke="currentColor" - stroke-width="2" - stroke-linecap="round" - stroke-linejoin="round" - class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-bar-to-left" - > + <svg @click="menuState.open = false" xmlns="http://www.w3.org/2000/svg" width="20" height="20" + viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" + stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-bar-to-left"> <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M10 12l10 0" /> <path d="M10 12l4 4" /> @@ -506,42 +483,28 @@ <div class="popinnerBox"> <div class="brush"> <div class="thickness"> - <div - :class="toolSelectData.thicknessActive == '1' ? 'small active' : 'small'" - @click="selectThickness('1')" - ></div> - <div - :class="toolSelectData.thicknessActive == '3' ? 'middle active' : 'middle'" - @click="selectThickness('3')" - ></div> - <div - :class="toolSelectData.thicknessActive == '5' ? 'large active' : 'large'" - @click="selectThickness('5')" - ></div> + <div :class="toolSelectData.thicknessActive == '1' ? 'small active' : 'small'" + @click="selectThickness('1')"></div> + <div :class="toolSelectData.thicknessActive == '3' ? 'middle active' : 'middle'" + @click="selectThickness('3')"></div> + <div :class="toolSelectData.thicknessActive == '5' ? 'large active' : 'large'" + @click="selectThickness('5')"></div> </div> <div class="lineStyle"> <div class="lineTypeBox"> - <div - :class=" - toolSelectData.lineTypeActive == 'solid' - ? 'typeItem lineTypeActive' - : 'typeItem' - " - @click="selectLineType('solid')" - > + <div :class="toolSelectData.lineTypeActive == 'solid' + ? 'typeItem lineTypeActive' + : 'typeItem' + " @click="selectLineType('solid')"> <div class="solid"></div> <div class="activeIcon" v-if="toolSelectData.lineTypeActive == 'solid'"> <img :src="xuanzhong" /> </div> </div> - <div - :class=" - toolSelectData.lineTypeActive == 'dashed' - ? 'typeItem lineTypeActive' - : 'typeItem' - " - @click="selectLineType('dashed')" - > + <div :class="toolSelectData.lineTypeActive == 'dashed' + ? 'typeItem lineTypeActive' + : 'typeItem' + " @click="selectLineType('dashed')"> <div class="dashed"></div> <div class="activeIcon" v-if="toolSelectData.lineTypeActive == 'dashed'"> <img :src="xuanzhong" /> @@ -549,12 +512,8 @@ </div> </div> <div class="colorSelectBox"> - <div - v-for="item in colorSelectList" - :key="item.key" - class="flex1 hover" - @click="lineColorSelect(item)" - > + <div v-for="item in colorSelectList" :key="item.key" class="flex1 hover" + @click="lineColorSelect(item)"> <div :style="{ background: item.key }" class="scribeItem"> <img :src="xuanzhong" v-if="item.key == toolSelectData.lineColorActive" /> </div> @@ -576,40 +535,28 @@ <div class="popinnerBox"> <div class="lineStyle"> <div class="lineTypeBox"> - <div - :class=" - toolSelectData.fontSizeActive == '14' - ? 'typeItem lineTypeActive' - : 'typeItem' - " - @click="selectfontSize('14')" - > + <div :class="toolSelectData.fontSizeActive == '14' + ? 'typeItem lineTypeActive' + : 'typeItem' + " @click="selectfontSize('14')"> 灏� <div class="activeIcon" v-if="toolSelectData.fontSizeActive == '14'"> <img :src="xuanzhong" /> </div> </div> - <div - :class=" - toolSelectData.fontSizeActive == '16' - ? 'typeItem lineTypeActive' - : 'typeItem' - " - @click="selectfontSize('16')" - > + <div :class="toolSelectData.fontSizeActive == '16' + ? 'typeItem lineTypeActive' + : 'typeItem' + " @click="selectfontSize('16')"> 涓� <div class="activeIcon" v-if="toolSelectData.fontSizeActive == '16'"> <img :src="xuanzhong" /> </div> </div> - <div - :class=" - toolSelectData.fontSizeActive == '18' - ? 'typeItem lineTypeActive' - : 'typeItem' - " - @click="selectfontSize('18')" - > + <div :class="toolSelectData.fontSizeActive == '18' + ? 'typeItem lineTypeActive' + : 'typeItem' + " @click="selectfontSize('18')"> 澶� <div class="activeIcon" v-if="toolSelectData.fontSizeActive == '18'"> <img :src="xuanzhong" /> @@ -618,12 +565,8 @@ </div> <div class="lineStyle"> <div class="colorSelectBox"> - <div - v-for="item in colorSelectList" - :key="item.key" - class="flex1 hover" - @click="lineColorSelect(item)" - > + <div v-for="item in colorSelectList" :key="item.key" class="flex1 hover" + @click="lineColorSelect(item)"> <div :style="{ background: item.key }" class="scribeItem"> <img :src="xuanzhong" v-if="item.key == toolSelectData.lineColorActive" /> </div> @@ -659,12 +602,8 @@ </div> <div class="lineStyle"> <div class="colorSelectBox"> - <div - v-for="item in colorSelectList" - :key="item.key" - class="flex1 hover" - @click="lineColorSelect(item)" - > + <div v-for="item in colorSelectList" :key="item.key" class="flex1 hover" + @click="lineColorSelect(item)"> <div :style="{ background: item.key }" class="scribeItem"> <img :src="xuanzhong" v-if="item.key == toolSelectData.lineColorActive" /> </div> @@ -711,6 +650,10 @@ </div> </div> </div> + <!-- 璇煶闃呰缁勪欢 --> + <!-- <div class="voice-reader"> + <voiceReader /> + </div> --> </div> <!-- 鏁欏缁勪欢 --> <div class="toolBox"> @@ -720,59 +663,30 @@ </div> <div class="menuList"> <ul class="menu" v-if="teachToolsMenuData.length > 0"> - <li v-for="item in teachToolsMenuData" :key="item.key"> - <div - :class="token ? 'hover' : 'notClick'" - :style="!toolState.open ? 'padding:10px 15px' : ''" - v-if="item.isShow" - @click="selectTeachTools(item)" - > + <li v-for="item in teachToolsMenuData" :key="item.key" class="hover"> + <div :style="!toolState.open ? 'padding:10px 15px' : ''" v-if="item.isShow" + @click="selectTeachTools(item)"> <img :src="item.icon" alt="" /> <span v-if="toolState.open">{{ item.name }}</span> </div> </li> </ul> </div> - <div - :class="['openBox', toolState.open ? 'right' : '']" - v-if="teachToolsMenuData.length > 0" - > + <div :class="['openBox', toolState.open ? 'right' : '']" v-if="teachToolsMenuData.length > 0"> <!-- <img :src="shouqiR" v-if="toolState.open" @click="toolState.open = false" /> --> <!-- <img :src="shouqiL" v-if="!toolState.open" @click="toolState.open = true" /> --> - <svg - v-if="!toolState.open" - @click="toolState.open = true" - xmlns="http://www.w3.org/2000/svg" - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - stroke="currentColor" - stroke-width="2" - stroke-linecap="round" - stroke-linejoin="round" - class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-bar-to-left" - > + <svg v-if="!toolState.open" @click="toolState.open = true" xmlns="http://www.w3.org/2000/svg" width="24" + height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" + stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-bar-to-left"> <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M10 12l10 0" /> <path d="M10 12l4 4" /> <path d="M10 12l4 -4" /> <path d="M4 4l0 16" /> </svg> - <svg - v-if="toolState.open" - @click="toolState.open = false" - xmlns="http://www.w3.org/2000/svg" - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - stroke="currentColor" - stroke-width="2" - stroke-linecap="round" - stroke-linejoin="round" - class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-bar-to-right" - > + <svg v-if="toolState.open" @click="toolState.open = false" xmlns="http://www.w3.org/2000/svg" width="24" + height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" + stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-bar-to-right"> <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M14 12l-10 0" /> <path d="M14 12l-4 4" /> @@ -785,17 +699,13 @@ <el-tab-pane label="澶囪缁勪欢" name="first"> <div class="tabBox"> <div class="insertSelect"> - <div - :class="selectType == 'resource' ? 'typeActive' : 'selectItem hover'" - @click="selectTypeClick('resource')" - > + <div :class="selectType == 'resource' ? 'typeActive' : 'selectItem hover'" + @click="selectTypeClick('resource')"> <img :src="selectType == 'resource' ? charuziyuan_blue : charuziyuan" /> <div>鎻掑叆璧勬簮</div> </div> - <div - :class="selectType == 'answer' ? 'typeActive' : 'selectItem hover'" - @click="selectTypeClick('answer')" - > + <div :class="selectType == 'answer' ? 'typeActive' : 'selectItem hover'" + @click="selectTypeClick('answer')"> <img :src="selectType == 'answer' ? dati_charu_blue : dati_charu" /> <div>鎻掑叆绛旈</div> </div> @@ -814,25 +724,11 @@ </div> </div> <!-- 鐢荤瑪宸ュ叿鏍� --> - <div - draggable="true" - class="draggableBox" - :style="`left:${floatingToolData.elLeft}px`" - v-if="floatingToolBox.length > 0" - > - <div - :class="token ? 'hover' : 'notClick'" - v-for="item in floatingToolBox" - :key="item.name" - @click="floatItemHandle(item)" - > + <div draggable="true" class="draggableBox" :style="`left:${floatingToolData.elLeft}px`" + v-if="floatingToolBox.length > 0"> + <div v-for="item in floatingToolBox" :key="item.name" @click="floatItemHandle(item)"> <div v-if="item.isShow"> - <el-popover - placement="right" - width="120" - trigger="click" - v-if="floatingToolData.activeToolData == '鏍囪'" - > + <el-popover placement="right" width="120" trigger="click" v-if="floatingToolData.activeToolData == '鏍囪'"> <div class="popinnerBox"> <div class="label" v-if="floatingToolData.activeToolData == '鏍囪'"> <div class="labelItem hover" @click="labelShow('hide')"> @@ -846,13 +742,10 @@ </div> </div> <template #reference> - <div - :class=" - floatingToolData.activeToolData == item.name - ? 'floatToolActive floatToolItem' - : 'floatToolItem' - " - > + <div :class="floatingToolData.activeToolData == item.name + ? 'floatToolActive floatToolItem' + : 'floatToolItem' + "> <el-tooltip class="box-item" effect="dark" :content="item.name" placement="right"> <div class="imgBox"> <img :src="item.icon" alt="" /> @@ -870,17 +763,13 @@ </div> </el-tooltip> </div> - <div - :class=" - floatingToolData.activeToolData == item.name - ? 'floatToolActive floatToolItem' - : 'floatToolItem' - " - v-else-if=" + <div :class="floatingToolData.activeToolData == item.name + ? 'floatToolActive floatToolItem' + : 'floatToolItem' + " v-else-if=" floatingToolData.activeToolData != '涔︾' && floatingToolData.activeToolData != '鏍囪' - " - > + "> <el-tooltip class="box-item" effect="dark" :content="item.name" placement="right"> <div class="imgBox"> <img :src="item.icon" alt="" /> @@ -893,19 +782,10 @@ </div> <!-- 閫変腑宸ュ叿鏍� --> - <div - class="dialogToolBox" - id="dialogToolBox" - v-show="showToolBox" - :style="{ top: `${dialogToolData.top}px`, left: `${dialogToolData.left}px` }" - > + <div class="dialogToolBox" id="dialogToolBox" v-show="showToolBox" + :style="{ top: `${dialogToolData.top}px`, left: `${dialogToolData.left}px` }"> <div class="colorSelectBox" v-show="toolActive == '楂樹寒' || toolActive == '鍒掔嚎'"> - <div - v-for="item in colorSelectList" - :key="item.key" - class="flex1 hover" - @click="clickSelect(item)" - > + <div v-for="item in colorSelectList" :key="item.key" class="flex1 hover" @click="clickSelect(item)"> <div :style="{ background: item.key }" class="scribeItem"> <img :src="xuanzhong1" v-if="item.key == colorActive" /> </div> @@ -913,10 +793,7 @@ </div> <div class="toolSelectBox" v-show="toolActive != '楂樹寒' && toolActive != '鍒掔嚎'"> <div v-for="item in dialogToolList" :key="item.icon" @click="dialogToolHandle(item)"> - <div - :class="item.name == toolActive ? 'dialogToolItem active' : 'dialogToolItem'" - v-if="item.isShow" - > + <div :class="item.name == toolActive ? 'dialogToolItem active' : 'dialogToolItem'" v-if="item.isShow"> <el-tooltip class="box-item" effect="dark" :content="item.name" placement="bottom"> <img :src="item.icon" alt="" /> </el-tooltip> @@ -928,11 +805,8 @@ </div> </div> <!-- 鍒掔嚎锛岄珮浜垹闄� --> - <div - class="lineDeleteBox" - v-show="lineDelete.showLineDelete" - :style="{ top: `${lineDelete.top}px`, left: `${lineDelete.left}px` }" - > + <div class="lineDeleteBox" v-show="lineDelete.showLineDelete" + :style="{ top: `${lineDelete.top}px`, left: `${lineDelete.left}px` }"> <!-- <el-button @click="delUserKey">鍒犻櫎</el-button> --> <div class="dialogToolItem"> <el-tooltip class="box-item" effect="dark" content="鍒犻櫎" placement="bottom"> @@ -946,41 +820,26 @@ </div> </div> <!-- 绗旇鎮诞妗� --> - <div - class="noteContentBox" - v-show="noteContent.show" - :style="{ - top: `${noteContent.top}px`, - left: `${noteContent.left}px`, - background: noteContent.color - }" - > + <div class="noteContentBox" v-show="noteContent.show" :style="{ + top: `${noteContent.top}px`, + left: `${noteContent.left}px`, + background: noteContent.color + }"> <div>{{ noteContent.note }}</div> </div> <!-- 鑻辨枃涔﹂�変腑鍗曡瘝璇嶅吀鍐呭 --> - <div - class="dictionaryDataBox" - v-if="dictionaryData.showContent" - :style="{ top: `${dialogToolData.top}px`, left: `${dialogToolData.left}px` }" - > + <div class="dictionaryDataBox" v-if="dictionaryData.showContent" + :style="{ top: `${dialogToolData.top}px`, left: `${dialogToolData.left}px` }"> <div class="content"> <div class="word">{{ dictionaryData.data.word }}</div> <div class="phone_con"> <div class="per-phone"> - 鑻� <span>/{{ dictionaryData.data.ukPhone }}/</span - ><img - :src="sound" - class="soundBtn hover" - @click="soundWord(dictionaryData.data.word, 'en-UK')" - /> + 鑻� <span>/{{ dictionaryData.data.ukPhone }}/</span><img :src="sound" class="soundBtn hover" + @click="soundWord(dictionaryData.data.word, 'en-UK')" /> </div> <div class="per-phone"> - 缇� <span>/{{ dictionaryData.data.usPhone }}/</span - ><img - :src="sound" - class="soundBtn hover" - @click="soundWord(dictionaryData.data.word, 'en-US')" - /> + 缇� <span>/{{ dictionaryData.data.usPhone }}/</span><img :src="sound" class="soundBtn hover" + @click="soundWord(dictionaryData.data.word, 'en-US')" /> </div> </div> <div class="trans"> @@ -994,14 +853,8 @@ </div> </div> - <el-dialog - title="璧勬簮" - align-center - v-model="resourVisble" - width="845" - class="resourDialog" - :before-close="resourVisbleClose" - > + <el-dialog title="璧勬簮" align-center v-model="resourVisble" width="845" class="resourDialog" + :before-close="resourVisbleClose"> <div class="videoBox" v-if="resourType == '瑙嗛'"> <video controls controlslist="nodownload" :src="testVideo"></video> </div> @@ -1015,35 +868,14 @@ <audio ref="audioPlayer" :src="testAudio" controls @loadedmetadata="autoPlay"></audio> </div> <!-- 鍥剧墖 --> - <el-image-viewer - v-if="confirmDialog" - :zoom-rate="1.2" - @close="closePreview" - :initial-index="previewIndex" - :url-list="imgPreviewList" - /> - <el-dialog - title="娣诲姞绗旇" - align-center - v-model="addNoteVisble" - :before-close="handleClose" - class="myNoteDialogs" - > + <el-image-viewer v-if="confirmDialog" :zoom-rate="1.2" @close="closePreview" :initial-index="previewIndex" + :url-list="imgPreviewList" /> + <el-dialog title="娣诲姞绗旇" align-center v-model="addNoteVisble" :before-close="handleClose" class="myNoteDialogs"> <div class="formBox"> - <el-input - type="textarea" - :rows="4" - v-model="formData.desc" - placeholder="璇疯緭鍏ョ瑪璁板唴瀹�" - ></el-input> + <el-input type="textarea" :rows="4" v-model="formData.desc" placeholder="璇疯緭鍏ョ瑪璁板唴瀹�"></el-input> </div> <div class="noteColorSelectBox"> - <div - v-for="item in colorSelectList" - :key="item.key" - class="flex1 hover" - @click="clickSelectColor(item)" - > + <div v-for="item in colorSelectList" :key="item.key" class="flex1 hover" @click="clickSelectColor(item)"> <div :style="{ background: item.key }" class="scribeItem"> <img :src="xuanzhong" v-if="item.key == noteColorActive" /> </div> @@ -1057,23 +889,15 @@ </span> </template> </el-dialog> - <el-dialog - title="淇濆瓨鎴浘" - align-center - v-model="screenshotVisble" - :before-close="screenshotClose" - width="400" - class="resourDialog screenshotDialog" - > + <el-dialog title="淇濆瓨鎴浘" align-center v-model="screenshotVisble" :before-close="screenshotClose" width="400" + class="resourDialog screenshotDialog"> <div class="formBox"> <el-input v-model="nameData" placeholder="璇疯緭鍏ユ埅鍥惧悕绉�"></el-input> </div> <template #footer> <span class="dialog-footer"> <el-button @click="screenshotClose">鍙� 娑�</el-button> - <el-button type="primary" @click="addScreenshot" :loading="screenshotLoading" - >纭� 瀹�</el-button - > + <el-button type="primary" @click="addScreenshot" :loading="screenshotLoading">纭� 瀹�</el-button> </span> </template> </el-dialog> @@ -1082,13 +906,7 @@ <iframe :src="'https://baike.baidu.com/item/' + dialogToolData.txt" frameborder="0"></iframe> </div> </el-dialog> - <el-dialog - title="AI鏅鸿兘闂瓟" - align-center - v-model="wendaVisible" - width="60%" - class="myAnserDialogs" - > + <el-dialog title="AI鏅鸿兘闂瓟" align-center v-model="wendaVisible" width="60%" class="myAnserDialogs"> <div class="wendabox"> <iframe src="https://yiyan.baidu.com/" frameborder="0"></iframe> </div> @@ -1099,13 +917,7 @@ <dictionary /> </div> </el-dialog> - <el-dialog - title="GGB鍑芥暟宸ュ叿" - align-center - v-model="functionVisible" - width="80%" - class="myDialogs" - > + <el-dialog title="GGB鍑芥暟宸ュ叿" align-center v-model="functionVisible" width="80%" class="myDialogs"> <div class="wendabox"> <iframe src="https://www.geogebra.org/calculator" frameborder="0"></iframe> </div> @@ -1125,16 +937,21 @@ <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> + <!-- 绛旈鍣� --> + <examination ref="examinationRef" :activeBook="bookConfig" :info="examinationData.info" :type="examinationData.type" + :infoType="examinationData.infoType" /> + <!-- 璁$畻鍣� --> + <el-dialog title="璁$畻鍣�" align-center v-model="calculatorVisble" width="850" class="myDialogs"> + <calculatorNew></calculatorNew> + </el-dialog> </template> - -<script setup lang="ts"> -import { ref, reactive, watch, onMounted, onBeforeMount, inject } from 'vue' -import { useRouter, useRoute } from 'vue-router' -import useClipboard from 'vue-clipboard3' -const { toClipboard } = useClipboard() const MG: any = inject('MG') const toolClass = inject('toolClass') -const qiankunActions = inject('qiankunActions') //鑾峰彇璺敱鍣� let router = useRouter() //鑾峰彇褰撳墠璺敱鐨勪俊鎭� @@ -1142,6 +959,8 @@ 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 voiceReader from '@/views/components/voiceReader.vue' import { ElMessage, ElMessageBox, valueEquals } from 'element-plus' import logo from '@/assets/images/header/logo.png' import mulu from '@/assets/images/menu/mulu.png' @@ -1151,6 +970,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' @@ -1164,7 +984,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' @@ -1238,6 +1058,7 @@ import { loadMicroApp } from 'qiankun' import { microApps } from '@/child.ts' +import { open } from 'fs' let token = localStorage.getItem('token') const canvasWith = ref(1000) const canvasheight = ref(3000) @@ -1249,9 +1070,15 @@ const bookConfig = ref({}) const activeCatalog = ref() const reMarResult = ref() +const bookInfo = ref() +const isBuy = ref(false) +const tryPageCount = ref(0) onMounted(() => { if (token) { getUserInfo() + } + if (localStorage.getItem('bookId')) { + getBookInfo() } setTimeout(() => { canvasWith.value = document.querySelector('.content-box').offsetWidth @@ -1270,7 +1097,6 @@ window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth })() } - // 鍔犺浇寰簲鐢� microApp = loadMicroApp(microApps[localStorage.getItem('bookId')], { sandbox: { @@ -1283,18 +1109,20 @@ window.qiankunActions.onGlobalStateChange((state, prev) => { console.log('鐖跺眰state鍙樺寲', state) window.qiankunState = state - - if (window.qiankunState && window.qiankunState.initTestBook) { - window.qiankunState.initTestBook( - localStorage.getItem('bookId') + '', - localStorage.getItem('tryPageCount') - ) + if (isBuy.value) { + if (window.qiankunState && window.qiankunState.initTestBook) { + window.qiankunState.initTestBook(localStorage.getItem('bookId') + '') + } + } else { + if (window.qiankunState && window.qiankunState.initTestBook) { + window.qiankunState.initTestBook(localStorage.getItem('bookId') + '', tryPageCount.value) + } } }) // 瀹氫箟鐖跺眰鏂规硶 window.qiankunActions.setGlobalState({ - state:1, + state: 1, disableSign: false, windowSelection: (data) => { // 缁戝畾瀛愬簲鐢ㄩ�夋嫨鐩戝惉浜嬩欢 @@ -1381,6 +1209,11 @@ // } }) +onBeforeUnmount(() => { + if (microApp) { + microApp.unmount() // 鍗歌浇寰簲鐢� + } +}) // watch( // () => screenWidth.value, // (val) => { @@ -1395,6 +1228,44 @@ // } // } // ) + +//鏍规嵁refcode鑾峰彇鍥句功淇℃伅 + +const getBookInfo = () => { + const obj = { + storeInfo: 'jsek_digitalTextbooks', + path: '*', + queryType: '*', + coverSize: { + width: 150 + }, + paging: { + start: 0, + size: 6 + }, + filterList: [ + { + value: 'Normal', + field: 'state' + } + ], + fields: { + author: [], + RefCodes: [localStorage.getItem('bookId')], + probationPage: [] + } + } + MG.store.getProductList(obj).then((res) => { + console.log(res.datas, '鍥句功淇℃伅') + bookInfo.value = res.datas[0] + if (res.datas[0].purchasedSaleMethodIdList.includes(res.datas[0].defaultSaleMethodId)) { + isBuy.value = true + } else { + isBuy.value = false + } + tryPageCount.value = Number(res.datas[0].probationPage) + }) +} const getUserInfo = () => { MG.identity.getCurrentAppUser().then((res) => { @@ -1425,7 +1296,6 @@ } else if (phoneInfo) { userInfo.value = { name: phoneInfo.credential - } localStorage.setItem('userInfo', JSON.stringify(userInfo.value)) } @@ -1477,6 +1347,15 @@ name: '涔︾', icon: biaoqian, isShow: bookConfig.value.textbookComponents.indexOf('CF2E1400') > -1 + }, + { + name: '棰樺簱', + icon: question, + isShow: + bookConfig.value.textbookComponents.indexOf('3D3B4F55') > -1 || + bookConfig.value.textbookComponents.indexOf('AFC1A288') > -1 || + bookConfig.value.textbookComponents.indexOf('A434F2C0') > -1 || + bookConfig.value.textbookComponents.indexOf('A4821F71') > -1 } ] teachToolsMenuData = [ @@ -1555,7 +1434,8 @@ { icon: huabi, name: '鐢荤瑪', - isShow: bookConfig.value.textbookComponents.indexOf('800109C0') > -1 + // isShow: bookConfig.value.textbookComponents.indexOf('800109C0') > -1 + isShow:true }, { icon: baiban, @@ -1639,6 +1519,7 @@ listLoading.value = false }) .catch(function (error) { + listLoading.value = false console.log(error) }) } @@ -1655,8 +1536,8 @@ const handleNodeClick = (data) => { console.log(data) - if (localStorage.getItem('tryPageCount')) { - if (data.start < localStorage.getItem('tryPageCount')) { + if (!isBuy.value) { + if (data.start < tryPageCount.value) { headerData.process = data.start if (window.qiankunState && window.qiankunState.gotoPage) window.qiankunState.gotoPage(data.chapter, data.start) @@ -1691,234 +1572,213 @@ const showHandle = ref(null) const playIndex = ref(null) //闊抽鎾斁 const audioPlayer = ref(null) +const collectResourceList = ref([]) const getResourceData = () => { - imgPreviewList.value = [] - listLoading.value = true - axios - .get(bookConfig.value.resourceUrl + '/resource.json?t=12') - .then(function (response) { - var json = response.data - // 澶勭悊鑾峰彇鍒扮殑json鏁版嵁 - if (json.length > 0) { - defaultResourceList.value = [] - teacherResourceList.value = [] - // 鑾峰彇鏁扮粍涓墍鏈夊璞$殑age灞炴�х殑鏁伴噺 - json.forEach((item) => { - if (item.iconPath) { - item.icon = bookConfig.value.resourceUrl + '/' + item.iconPath - } else { - item.icon = '' - } - if (resourceType.value == 'default') { - if (item.isTeacherResource == '鍚�') { - defaultResourceList.value.push(item) - } - } else { - if (item.isTeacherResource == '鏄�') { - teacherResourceList.value.push(item) - } - } - }) - if (defaultResourceList.value.length > 0) { - let imgCount = 0 - let audioCount = 0 - let videoCount = 0 - let exercisesCount = 0 - let otherCount = 0 - resourceDataList.value = [] - defaultResourceList.value.forEach((resItem) => { - if (resItem.resourceType == '鍥剧墖') { - if (resItem.resourcePath) { - resItem.resourcePath = bookConfig.value.resourceUrl + '/' + resItem.resourcePath - } else { - resItem.resourcePath = - bookConfig.value.requestCtx + '/file/GetPreViewImage?md5=' + resItem.md5 - } - - imgPreviewList.value.push(resItem.resourcePath) - if (activeClassify.value == 'image') { - resourceDataList.value.push(resItem) - } - imgCount++ - } else if (resItem.resourceType == '闊抽') { - if (activeClassify.value == 'audio') { - resourceDataList.value.push(resItem) - } - audioCount++ - } else if (resItem.resourceType == '瑙嗛') { - if (activeClassify.value == 'video') { - resourceDataList.value.push(resItem) - } - videoCount++ - } else if (resItem.resourceType == '涔犻') { - if (activeClassify.value == 'exercises') { - resourceDataList.value.push(resItem) - } - exercisesCount++ + if (token) { + imgPreviewList.value = [] + listLoading.value = true + axios + .get(bookConfig.value.resourceUrl + '/resource.json?t=12') + .then(function (response) { + var json = response.data + // 澶勭悊鑾峰彇鍒扮殑json鏁版嵁 + if (json.length > 0) { + defaultResourceList.value = [] + teacherResourceList.value = [] + // 鑾峰彇鏁扮粍涓墍鏈夊璞$殑age灞炴�х殑鏁伴噺 + json.forEach((item) => { + if (item.iconPath) { + item.icon = bookConfig.value.resourceUrl + '/' + item.iconPath } else { - if (activeClassify.value == 'other') { - resourceDataList.value.push(resItem) + item.icon = '' + } + if (resourceType.value == 'default') { + if (item.isTeacherResource == '鍚�') { + defaultResourceList.value.push(item) } - otherCount++ + } else { + if (item.isTeacherResource == '鏄�') { + teacherResourceList.value.push(item) + } } }) - classifySelectList.value = [] - if (imgCount > 0) { - classifySelectList.value.push({ - title: '鍥剧墖', - count: imgCount, - key: 'image' - }) - } - if (audioCount > 0) { - classifySelectList.value.push({ - title: '闊抽', - count: audioCount, - key: 'audio' - }) - } - if (videoCount > 0) { - classifySelectList.value.push({ - title: '瑙嗛', - count: videoCount, - key: 'video' - }) - } - if (exercisesCount > 0) { - classifySelectList.value.push({ - title: '涔犻', - count: exercisesCount, - key: 'exercises' - }) - } - if (otherCount > 0) { - classifySelectList.value.push({ - title: '鍏朵粬', - count: otherCount, - key: 'other' - }) - } - if (!activeClassify.value) { - activeClassify.value = classifySelectList.value[0].key - defaultResourceList.value.forEach((resItem1) => { - if (resItem1.resourceType == classifySelectList.value[0].title) { - resourceDataList.value.push(resItem1) - } - }) - } - // if(activeClassify.value == "video"){ - // resourceDataList.value.forEach((item,index)=>{ - // console.log(item,"item") - // let video = document.createElement("video"); - // video.src = bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + item.md5; - // const canvas = document.createElement('canvas') - // canvas.width = 130 - // canvas.height = 80 - // const ctx:any = canvas.getContext('2d'); - // video.crossOrigin = 'anonymous' // 瑙e喅璺ㄥ煙闂锛屼篃灏辨槸鎻愮ず姹℃煋璧勬簮鏃犳硶杞崲瑙嗛 - // video.currentTime = 1 // 绗竴甯� + if (defaultResourceList.value.length > 0) { + let imgCount = 0 + let audioCount = 0 + let videoCount = 0 + let exercisesCount = 0 + let otherCount = 0 + resourceDataList.value = [] + defaultResourceList.value.forEach((resItem) => { + if (resItem.resourceType == '鍥剧墖') { + if (resItem.resourcePath) { + resItem.resourcePath = bookConfig.value.resourceUrl + '/' + resItem.resourcePath + } else { + resItem.resourcePath = + bookConfig.value.requestCtx + '/file/GetPreViewImage?md5=' + resItem.md5 + } - // video.oncanplay = () => { //瑙嗛鍑嗗鎾斁 - // ctx.drawImage(video, 0, 0, canvas.width, canvas.height) - // item.icon = canvas.toDataURL("image/png"); //鑾峰彇base64鏍煎紡鐨勫浘鐗� - // } - // }) - - // } - } else { - let imgCount = 0 - let audioCount = 0 - let videoCount = 0 - let exercisesCount = 0 - let otherCount = 0 - resourceDataList.value = [] - teacherResourceList.value.forEach((resItem) => { - if (resItem.resourceType == '鍥剧墖') { - if (resItem.resourcePath) { - resItem.resourcePath = bookConfig.value.resourceUrl + '/' + resItem.resourcePath + imgPreviewList.value.push(resItem.resourcePath) + if (activeClassify.value == 'image') { + resourceDataList.value.push(resItem) + } + imgCount++ + } else if (resItem.resourceType == '闊抽') { + if (activeClassify.value == 'audio') { + resourceDataList.value.push(resItem) + } + audioCount++ + } else if (resItem.resourceType == '瑙嗛') { + if (activeClassify.value == 'video') { + resourceDataList.value.push(resItem) + } + videoCount++ } else { - resItem.resourcePath = - bookConfig.value.requestCtx + '/file/GetPreViewImage?md5=' + resItem.md5 + if (activeClassify.value == 'other') { + resourceDataList.value.push(resItem) + } + otherCount++ } - imgPreviewList.value.push(resItem.resourcePath) - if (activeClassify.value == 'image') { - resourceDataList.value.push(resItem) - } - imgCount++ - } else if (resItem.resourceType == '闊抽') { - if (activeClassify.value == 'audio') { - resourceDataList.value.push(resItem) - } - audioCount++ - } else if (resItem.resourceType == '瑙嗛') { - if (activeClassify.value == 'video') { - resourceDataList.value.push(resItem) - } - videoCount++ - } else if (resItem.resourceType == '涔犻') { - if (activeClassify.value == 'exercises') { - resourceDataList.value.push(resItem) - } - exercisesCount++ - } else { - if (activeClassify.value == 'other') { - resourceDataList.value.push(resItem) - } - otherCount++ + }) + classifySelectList.value = [] + if (imgCount > 0) { + classifySelectList.value.push({ + title: '鍥剧墖', + count: imgCount, + key: 'image' + }) } - }) - classifySelectList.value = [] - if (imgCount > 0) { - classifySelectList.value.push({ - title: '鍥剧墖', - count: imgCount, - key: 'image' - }) - } - if (audioCount > 0) { - classifySelectList.value.push({ - title: '闊抽', - count: audioCount, - key: 'audio' - }) - } - if (videoCount > 0) { - classifySelectList.value.push({ - title: '瑙嗛', - count: videoCount, - key: 'video' - }) - } - if (exercisesCount > 0) { - classifySelectList.value.push({ - title: '涔犻', - count: exercisesCount, - key: 'exercises' - }) - } - if (otherCount > 0) { - classifySelectList.value.push({ - title: '鍏朵粬', - count: otherCount, - key: 'other' - }) - } - if (!activeClassify.value) { - activeClassify.value = classifySelectList.value[0].key - teacherResourceList.value.forEach((resItem1) => { - if (resItem1.resourceType == classifySelectList.value[0].title) { - resourceDataList.value.push(resItem1) + if (audioCount > 0) { + classifySelectList.value.push({ + title: '闊抽', + count: audioCount, + key: 'audio' + }) + } + if (videoCount > 0) { + classifySelectList.value.push({ + title: '瑙嗛', + count: videoCount, + key: 'video' + }) + } + if (otherCount > 0) { + classifySelectList.value.push({ + title: '鍏朵粬', + count: otherCount, + key: 'other' + }) + } + if (!activeClassify.value) { + activeClassify.value = classifySelectList.value[0].key + defaultResourceList.value.forEach((resItem1) => { + if (resItem1.resourceType == classifySelectList.value[0].title) { + resourceDataList.value.push(resItem1) + } + }) + } + } else { + let imgCount = 0 + let audioCount = 0 + let videoCount = 0 + let exercisesCount = 0 + let otherCount = 0 + resourceDataList.value = [] + teacherResourceList.value.forEach((resItem) => { + if (resItem.resourceType == '鍥剧墖') { + if (resItem.resourcePath) { + resItem.resourcePath = bookConfig.value.resourceUrl + '/' + resItem.resourcePath + } else { + resItem.resourcePath = + bookConfig.value.requestCtx + '/file/GetPreViewImage?md5=' + resItem.md5 + } + imgPreviewList.value.push(resItem.resourcePath) + if (activeClassify.value == 'image') { + resourceDataList.value.push(resItem) + } + imgCount++ + } else if (resItem.resourceType == '闊抽') { + if (activeClassify.value == 'audio') { + resourceDataList.value.push(resItem) + } + audioCount++ + } else if (resItem.resourceType == '瑙嗛') { + if (activeClassify.value == 'video') { + resourceDataList.value.push(resItem) + } + videoCount++ + } else { + if (activeClassify.value == 'other') { + resourceDataList.value.push(resItem) + } + otherCount++ } }) + classifySelectList.value = [] + if (imgCount > 0) { + classifySelectList.value.push({ + title: '鍥剧墖', + count: imgCount, + key: 'image' + }) + } + if (audioCount > 0) { + classifySelectList.value.push({ + title: '闊抽', + count: audioCount, + key: 'audio' + }) + } + if (videoCount > 0) { + classifySelectList.value.push({ + title: '瑙嗛', + count: videoCount, + key: 'video' + }) + } + if (otherCount > 0) { + classifySelectList.value.push({ + title: '鍏朵粬', + count: otherCount, + key: 'other' + }) + } + if (!activeClassify.value) { + activeClassify.value = classifySelectList.value[0].key + teacherResourceList.value.forEach((resItem1) => { + if (resItem1.resourceType == classifySelectList.value[0].title) { + resourceDataList.value.push(resItem1) + } + }) + } } } - - } - listLoading.value = false + listLoading.value = false + }) + .catch(function (error) { + console.log(error) + resourceDataList.value = [] + classifySelectList.value = [] + listLoading.value = false + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' }) - .catch(function (error) { - console.log(error) - }) + .then(() => { + if (sessionStorage.getItem('loginCtx')) { + window.open(sessionStorage.getItem('loginCtx')) + } else { + router.replace({ + path: '/login' + }) + } + }) + .catch(() => { }) + } } //璧勬簮鎾斁瑙嗛 const goPlay = (data, index) => { @@ -1968,7 +1828,6 @@ //璧勬簮璺宠浆鍒版寚瀹氫綅缃� const JumpPosition = (data) => { - console.log(data, '璺宠浆') if (window.qiankunState && window.qiankunState.gotoPage) { window.qiankunState.gotoPage(Number(data.chapterNum), Number(data.pagination)) } @@ -1978,14 +1837,26 @@ const selectResourceType = (type) => { resourceType.value = type searchText.value = '' - getResourceData() + if (type == 'collect') { + getCollectResource() + } else { + getResourceData() + } } //璧勬簮绫诲瀷鍥剧墖/瑙嗛/闊抽/涔犻/鍏朵粬 const classifyClick = (item) => { activeClassify.value = item.key resourceDataList.value = [] searchText.value = '' - getResourceData() + if (resourceType.value == 'collect') { + getCollectResource() + } else { + getResourceData() + } +<<<<<<< HEAD +======= + +>>>>>>> bcee5cd49c38973e2c6c316e1405f27ab1b74db7 } const searchBtn = () => { if (searchShow.value) { @@ -1995,13 +1866,285 @@ } } +// 鑾峰彇鏀惰棌鐨勮祫婧� +const getCollectResource = () => { + if (token) { + MG.identity + .getUserKey({ + domain: 'collectResource', + keys: [bookConfig.value.bookId] + }) + .then((res) => { + if (res.length) { + collectResourceList.value = JSON.parse(res[0].value) + console.log('鏀惰棌璧勬簮鍒楄〃', collectResourceList.value) + if (collectResourceList.value.length > 0) { + let imgCount = 0 + let audioCount = 0 + let videoCount = 0 + let exercisesCount = 0 + let otherCount = 0 + resourceDataList.value = [] + collectResourceList.value.forEach((resItem) => { + if (resItem.resourceType == '鍥剧墖') { + if (resItem.resourcePath) { + resItem.resourcePath = bookConfig.value.resourceUrl + '/' + resItem.resourcePath + } else { + resItem.resourcePath = + bookConfig.value.requestCtx + '/file/GetPreViewImage?md5=' + resItem.md5 + } + + imgPreviewList.value.push(resItem.resourcePath) + if (activeClassify.value == 'image') { + resourceDataList.value.push(resItem) + } + imgCount++ + } else if (resItem.resourceType == '闊抽') { + if (activeClassify.value == 'audio') { + resourceDataList.value.push(resItem) + } + audioCount++ + } else if (resItem.resourceType == '瑙嗛') { + if (activeClassify.value == 'video') { + resourceDataList.value.push(resItem) + } + videoCount++ + } else { + if (activeClassify.value == 'other') { + resourceDataList.value.push(resItem) + } + otherCount++ + } + }) + classifySelectList.value = [] + if (imgCount > 0) { + classifySelectList.value.push({ + title: '鍥剧墖', + count: imgCount, + key: 'image' + }) + } + if (audioCount > 0) { + classifySelectList.value.push({ + title: '闊抽', + count: audioCount, + key: 'audio' + }) + } + if (videoCount > 0) { + classifySelectList.value.push({ + title: '瑙嗛', + count: videoCount, + key: 'video' + }) + } + if (otherCount > 0) { + classifySelectList.value.push({ + title: '鍏朵粬', + count: otherCount, + key: 'other' + }) + } + if (!activeClassify.value) { + activeClassify.value = classifySelectList.value[0].key + collectResourceList.value.forEach((resItem1) => { + if (resItem1.resourceType == classifySelectList.value[0].title) { + resourceDataList.value.push(resItem1) + } + }) + } + } + } else { + resourceDataList.value = [] + } + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' + }) + .then(() => { + if (sessionStorage.getItem('loginCtx')) { + window.open(sessionStorage.getItem('loginCtx')) + } else { + router.replace({ + path: '/login' + }) + } + }) + .catch(() => { }) + } +} +// 鏀惰棌鎸夐挳 +const handleCollectResource = (id, md5, resourcePath, resourceType, source, resourceName) => { +<<<<<<< HEAD + if (collectResourceList.value.findIndex((item) => item.id == id) > -1) { + collectResourceList.value = collectResourceList.value.filter((item) => item.id != id) +======= + if (collectResourceList.value.findIndex(item => item.id == id) > -1) { + collectResourceList.value = collectResourceList.value.filter(item => item.id != id) +>>>>>>> bcee5cd49c38973e2c6c316e1405f27ab1b74db7 + } else { + collectResourceList.value.push({ + id, + md5, + resourcePath: resourcePath.replace(bookConfig.value.resourceUrl + '/', ''), + resourceType, + source, + resourceName + }) + } + MG.identity.setUserKey({ + setKeyRequests: [ + { +<<<<<<< HEAD + domain: 'collectResource', + key: bookConfig.value.bookId, + value: JSON.stringify(collectResourceList.value) + } + ] + }, + ], + }) +} + +//涔犻 +const exercisesType = ref('exercises') //涔犻绫诲瀷 +const questionList = ref([]) +const examinationRef = ref() // 绛旈鍣ㄥ疄渚� +const examinationData = reactive({ + type: '', // 绛旈绫诲瀷 option 娴嬭瘯 + infoType: '', // 鏁版嵁鏉ユ簮 bits 姣旂壒鍚庡彴 json 鍋囨暟鎹� + info: {} // 杩欏棰樼殑淇℃伅 +}) +// 鑾峰彇涔犻 +const getExercisesList = () => { + 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) { + questionList.value.push(item) + } + } else { + questionList.value.push(item) + } + } + }) + } + listLoading.value = false + }) + .catch(() => { + listLoading.value = false + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' + }) + .then(() => { + if (sessionStorage.getItem('loginCtx')) { + window.open(sessionStorage.getItem('loginCtx')) + } else { + router.replace({ + path: '/login' + }) + } + }) + .catch(() => { }) + } +} + +// 鑾峰彇闄勫姞棰� +const getAdditionalList = () => { + if (token) { + listLoading.value = true + questionList.value = [] + axios + .get(bookConfig.value.resourceUrl + '/bits-question.json') + .then((res) => { + // 澶勭悊鑾峰彇鍒扮殑json鏁版嵁 + if (res.data.data.length > 0) { + questionList.value = res.data.data + examinationData.infoType = res.data.type + } + listLoading.value = false + }) + .catch(() => { + listLoading.value = false + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' + }) + .then(() => { + router.push('/login') + }) + .catch(() => { }) + } +} + +//閿欓鏈� +const wrongQuestionVisble = ref(false) +const selectExercisesType = (type) => { + if (type == 'exercises') { + getExercisesList() + exercisesType.value = type + searchText.value = '' + } else if (type == 'additional') { + getAdditionalList() + exercisesType.value = type + searchText.value = '' + } else if (type == 'wrong') { + openExaminationDialog(true, {}, 'errorQuestion') + } else { + openExaminationDialog(true, {}, 'collectQuestion') + } +} +// 棰樺垪琛ㄧ偣鍑� +const clickQuestion = (type: string, data: any) => { + switch (type) { + case 'exercises': + JumpPosition(data) + break + case 'additional': + openExaminationDialog(true, data, 'option') + break + default: + break + } +} +const openExaminationDialog = (isSHow: boolean, data: any, type: string) => { + if (examinationRef.value) { + examinationRef.value.handleExaminationDialog(isSHow) + examinationData.type = type + examinationData.info = data + } +} + // 閫変腑鑿滃崟 const activeMenu = ref('鐩綍') // 鑿滃崟鐐瑰嚮 const menuItemClick = (name) => { searchText.value = '' - allSearchReault.value =[] + allSearchReault.value = [] if (menuState.open && activeMenu.value == name) { menuState.open = false } else { @@ -2026,6 +2169,9 @@ getReMarkList() break case '妫�绱�': + break + case '棰樺簱': + getExercisesList() break } } @@ -2143,7 +2289,7 @@ const allSearchReault = ref([]) const searchReaultData = reactive({ isShow: true, - openIndex: 0, + openIndex: 0 }) const searchBook = async () => { switch (activeMenu.value) { @@ -2175,6 +2321,9 @@ break case '涔︾': getReMarkList() + break + case '棰樺簱': + getExercisesList() break case '妫�绱�': listLoading.value = true @@ -2214,7 +2363,6 @@ console.log(allSearchReault.value, 444) listLoading.value = false } - } break } @@ -2265,7 +2413,6 @@ //妫�绱㈣烦杞� const goSearchContent = (item) => { - console.log(item,1111111111111111111111111111111111111111111111111111) if (window.qiankunState && window.qiankunState.gotoPage) { window.qiankunState.jumpSearchItem(item) } @@ -2293,6 +2440,9 @@ case '妫�绱�': allSearchReault.value = [] break + case '棰樺簱': + getExercisesList() + break } } @@ -2303,6 +2453,7 @@ const siweiVisble = ref(false) const modelToolVisble = ref(false) const shengciVisble = ref(false) +const calculatorVisble = ref(false) const activeTool = ref(0) const toolState = reactive({ open: true @@ -2310,26 +2461,49 @@ const resourceUrl = ref('') const selectTeachTools = (item) => { - activeTool.value = item.name - switch (item.name) { - case 'AI鏅鸿兘闂瓟': - wendaVisible.value = true - break - case 'GGB鍑芥暟宸ュ叿': - functionVisible.value = true - break - case '鎬濈淮瀵煎浘': - siweiVisble.value = true - break - case '妯″瀷宸ュ叿': - modelToolVisble.value = true - break - case '璇嶅吀': - cidianVisible.value = true - break - case '鐢熻瘝鍗$墖': - resourceUrl.value = bookConfig.value.resourceUrl - shengciVisble.value = true + if (token) { + activeTool.value = item.name + switch (item.name) { + case 'AI鏅鸿兘闂瓟': + wendaVisible.value = true + break + case 'GGB鍑芥暟宸ュ叿': + functionVisible.value = true + break + case '鎬濈淮瀵煎浘': + siweiVisble.value = true + break + case '妯″瀷宸ュ叿': + modelToolVisble.value = true + break + case '璇嶅吀': + cidianVisible.value = true + break + case '鐢熻瘝鍗$墖': + resourceUrl.value = bookConfig.value.resourceUrl + shengciVisble.value = true + break + case '璁$畻鍣�': + calculatorVisble.value = true + break + } + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' + }) + .then(() => { + if (sessionStorage.getItem('loginCtx')) { + window.open(sessionStorage.getItem('loginCtx')) + } else { + router.replace({ + path: '/login' + }) + } + }) + .catch(() => { }) } } @@ -2392,7 +2566,7 @@ console.log(floatingToolData.activeToolData, 'floatingToolData.activeToolData') if (floatingToolData.activeToolData == '鐢荤瑪') { floatingToolData.activeToolData = '' - }else { + } else { floatingToolData.activeToolData = item.name } @@ -2405,11 +2579,10 @@ case '鏍囪': break case '涔︾': - if(floatingToolData.activeBookmark != '涔︾' ){ + if (floatingToolData.activeBookmark != '涔︾') { floatingToolData.activeBookmark = '涔︾' reMark() } - break case '鎴睆': jitT() @@ -2517,72 +2690,112 @@ const reMarkCon = ref('') const reMark = () => { - let chapterData = catalogueData.value.find((item) => item.chapter == Number(currentChapter.value)) - if (catalogueData.value.length > 0) { - catalogueData.value.forEach((item1) => { - if (item1.chapter == Number(currentChapter.value) && item1.start == headerData.process) { - chapterData.label = item1.label - } - }) - } + if (token) { + let chapterData = catalogueData.value.find( + (item) => item.chapter == Number(currentChapter.value) + ) + if (catalogueData.value.length > 0) { + catalogueData.value.forEach((item1) => { + if (item1.chapter == Number(currentChapter.value) && item1.start == headerData.process) { + chapterData.label = item1.label + } + }) + } - if (chapterData) { - reMarkData.value.push({ - id: toolClass.uuid(8), - createDate: new Date(), - page: headerData.process, - chapterNum: currentChapter.value, - chapterName: chapterData.label, - content: reMarkCon.value || chapterData.label - }) - MG.identity - .setUserKey({ - setKeyRequests: [ - { - domain: 'reMark', - key: bookConfig.value.bookId, - value: JSON.stringify(reMarkData.value) - } - ] + if (chapterData) { + reMarkData.value.push({ + id: toolClass.uuid(8), + createDate: new Date(), + page: headerData.process, + chapterNum: currentChapter.value, + chapterName: chapterData.label, + content: reMarkCon.value || chapterData.label }) - .then((res) => { - floatingToolData.activeToolData = '' - - ElMessage({ - message: '娣诲姞涔︾鎴愬姛!', - type: 'success' + MG.identity + .setUserKey({ + setKeyRequests: [ + { + domain: 'reMark', + key: bookConfig.value.bookId, + value: JSON.stringify(reMarkData.value) + } + ] }) - getReMarkList() + .then((res) => { + floatingToolData.activeToolData = '' + + ElMessage({ + message: '娣诲姞涔︾鎴愬姛!', + type: 'success' + }) + getReMarkList() + }) + .catch(function (error) { }) + } + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' + }) + .then(() => { + if (sessionStorage.getItem('loginCtx')) { + window.open(sessionStorage.getItem('loginCtx')) + } else { + router.replace({ + path: '/login' + }) + } }) - .catch(function (error) {}) + .catch(() => { }) } } const getReMarkList = () => { - reMarkList.value = [] - reMarkData.value = [] - listLoading.value = true - MG.identity - .getUserKey({ - domain: 'reMark', - keys: [bookConfig.value.bookId] - }) - .then((res) => { - if (res && res.length > 0 && res[0].value) { - reMarkData.value = JSON.parse(res[0].value) - let list = JSON.parse(res[0].value) - list.forEach((item) => { - let text = searchText.value.replace(/^\s*|\s*$/g, '') - if (searchText.value) { - if (item.content.indexOf(text) > -1) { + if (token) { + reMarkList.value = [] + reMarkData.value = [] + listLoading.value = true + MG.identity + .getUserKey({ + domain: 'reMark', + keys: [bookConfig.value.bookId] + }) + .then((res) => { + if (res && res.length > 0 && res[0].value) { + reMarkData.value = JSON.parse(res[0].value) + let list = JSON.parse(res[0].value) + list.forEach((item) => { + let text = searchText.value.replace(/^\s*|\s*$/g, '') + if (searchText.value) { + if (item.content.indexOf(text) > -1) { + reMarkList.value.push(item) + } + } else { reMarkList.value.push(item) } - } else { - reMarkList.value.push(item) - } - }) - } - listLoading.value = false + }) + } + listLoading.value = false + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' }) + .then(() => { + if (sessionStorage.getItem('loginCtx')) { + window.open(sessionStorage.getItem('loginCtx')) + } else { + router.replace({ + path: '/login' + }) + } + }) + .catch(() => { }) + } } //璺宠浆 @@ -2638,12 +2851,31 @@ //鎴浘 //鎴浘浜嬩欢 function jitT() { - const screenShotHandler = new ScreenShort({ - enableWebRtc: false, // 鏄惁鏄剧ず閫夐」妗� - level: 999, // 灞傜骇绾у埆 - completeCallback: callback, //纭鍥炶皟 - closeCallback: closeFn //鍙栨秷鍥炶皟 - } as any) + if (token) { + const screenShotHandler = new ScreenShort({ + enableWebRtc: false, // 鏄惁鏄剧ず閫夐」妗� + level: 999, // 灞傜骇绾у埆 + completeCallback: callback, //纭鍥炶皟 + closeCallback: closeFn //鍙栨秷鍥炶皟 + } as any) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' + }) + .then(() => { + if (sessionStorage.getItem('loginCtx')) { + window.open(sessionStorage.getItem('loginCtx')) + } else { + router.replace({ + path: '/login' + }) + } + }) + .catch(() => { }) + } } //纭鍥炶皟 const callback = (val: any) => { @@ -2708,34 +2940,53 @@ } const getScreenshotList = () => { - screenshotData.value = [] - screenshotList.value = [] - imgPreviewList.value = [] - listLoading.value = true - MG.identity - .getUserKey({ - domain: 'screenshot', - keys: [bookConfig.value.bookId] - }) - .then((res) => { - if (res && res.length > 0 && res[0].value) { - screenshotData.value = JSON.parse(res[0].value) - let list = JSON.parse(res[0].value) - list.forEach((item) => { - let text = searchText.value.replace(/^\s*|\s*$/g, '') - if (searchText.value) { - if (item.name.indexOf(text) > -1) { + if (token) { + screenshotData.value = [] + screenshotList.value = [] + imgPreviewList.value = [] + listLoading.value = true + MG.identity + .getUserKey({ + domain: 'screenshot', + keys: [bookConfig.value.bookId] + }) + .then((res) => { + if (res && res.length > 0 && res[0].value) { + screenshotData.value = JSON.parse(res[0].value) + let list = JSON.parse(res[0].value) + list.forEach((item) => { + let text = searchText.value.replace(/^\s*|\s*$/g, '') + if (searchText.value) { + if (item.name.indexOf(text) > -1) { + screenshotList.value.push(item) + imgPreviewList.value.push(item.imgUrl) + } + } else { screenshotList.value.push(item) imgPreviewList.value.push(item.imgUrl) } - } else { - screenshotList.value.push(item) - imgPreviewList.value.push(item.imgUrl) - } - }) - } - listLoading.value = false + }) + } + listLoading.value = false + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' }) + .then(() => { + if (sessionStorage.getItem('loginCtx')) { + window.open(sessionStorage.getItem('loginCtx')) + } else { + router.replace({ + path: '/login' + }) + } + }) + .catch(() => { }) + } } //鏌ョ湅鎴浘 const getCapture = (item, index) => { @@ -2782,7 +3033,7 @@ getScreenshotList() }) }) - .catch(() => {}) + .catch(() => { }) } //閫変腑鏂囧瓧宸ュ叿鏍� @@ -2800,7 +3051,7 @@ ///鍐呭閫変腑 const getSelection = (data) => { - if (data.txt && token) { + if (data.txt) { toolActive.value = '' dialogToolData.txt = data.txt dialogToolData.page = data.page @@ -2873,56 +3124,77 @@ const synth = window.speechSynthesis const dialogToolHandle = async (item) => { - toolActive.value = item.name - colorActive.value = '' - switch (item.name) { - case 'AI闃呰': - window.speechSynthesis.cancel() - const synth = window.speechSynthesis - const utterance = new SpeechSynthesisUtterance(dialogToolData.txt) - console.log(utterance, 1) - utterance.lang = 'zh-CN' // 璁剧疆璇█涓轰腑鏂� - synth.speak(utterance) - showToolBox.value = false - break - case '鍒掔嚎': - break - case '楂樹寒': - break - case '绗旇': - formData.desc = '' - noteColorActive.value = '#F5E12A' - addNoteVisble.value = true - showToolBox.value = false - break - case '鏍囨敞': - break - case '澶嶅埗': - try { - //澶嶅埗 - await toClipboard(dialogToolData.txt) - //涓嬮潰鍙互璁剧疆澶嶅埗鎴愬姛鐨勬彁绀烘绛夋搷浣� - ElMessage({ - message: '澶嶅埗鎴愬姛', - type: 'success' - }) - } catch (err) { - ElMessage.error('鏃犳硶澶嶅埗鏂囨湰锛�' + err) - } - showToolBox.value = false - toolActive.value = '' - break - case '璇嶅吀': - getSearchResult() + if (token) { + toolActive.value = item.name + colorActive.value = '' + switch (item.name) { + case 'AI闃呰': + window.speechSynthesis.cancel() + const synth = window.speechSynthesis + const utterance = new SpeechSynthesisUtterance(dialogToolData.txt) + console.log(utterance, 1) + utterance.lang = 'zh-CN' // 璁剧疆璇█涓轰腑鏂� + synth.speak(utterance) + showToolBox.value = false + break + case '鍒掔嚎': + break + case '楂樹寒': + break + case '绗旇': + formData.desc = '' + noteColorActive.value = '#F5E12A' + addNoteVisble.value = true + showToolBox.value = false + break + case '鏍囨敞': + break + case '澶嶅埗': + try { + //澶嶅埗 + await toClipboard(dialogToolData.txt) + //涓嬮潰鍙互璁剧疆澶嶅埗鎴愬姛鐨勬彁绀烘绛夋搷浣� + ElMessage({ + message: '澶嶅埗鎴愬姛', + type: 'success' + }) + } catch (err) { + ElMessage.error('鏃犳硶澶嶅埗鏂囨湰锛�' + err) + } + showToolBox.value = false + toolActive.value = '' + break + case '璇嶅吀': + getSearchResult() - showToolBox.value = false - // cidianVisible.value = true - console.log(dialogToolData.txt) - break - case '鐧剧': - console.log('https://baike.baidu.com/item/' + dialogToolData.txt) - baiduVisible.value = true - break + showToolBox.value = false + // cidianVisible.value = true + console.log(dialogToolData.txt) + break + case '鐧剧': + console.log('https://baike.baidu.com/item/' + dialogToolData.txt) + baiduVisible.value = true + break + } + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' + }) + .then(() => { + if (sessionStorage.getItem('loginCtx')) { + window.open(sessionStorage.getItem('loginCtx')) + } else { + router.replace({ + path: '/login' + }) + } + }) + .catch(() => { + showToolBox.value = false + }) } } @@ -2936,218 +3208,275 @@ } const addUserKey = () => { - let dom = '' - let data = null - switch (toolActive.value) { - case '楂樹寒': - dom = 'highLightData-' + bookConfig.value.bookId - data = dialogToolData.lineHeight[dialogToolData.chapter] - if (!data) data = [] - data.push({ - id: toolClass.uuid(8), - txt: dialogToolData.txt, - page: dialogToolData.page, - chapterNum: dialogToolData.chapter, - type: 'Highlight', - color: colorActive.value - }) - break - case '鍒掔嚎': - dom = 'underline-' + bookConfig.value.bookId - data = dialogToolData.scribeList[dialogToolData.chapter] - if (!data) data = [] - data.push({ - id: toolClass.uuid(8), - txt: dialogToolData.txt, - page: dialogToolData.page, - chapterNum: dialogToolData.chapter, - type: 'Dashing', - color: colorActive.value - }) - break - case '绗旇': - if (!formData.desc.replace(/^\s*|\s*$/g, '')) { - ElMessage.error('绗旇鍐呭涓嶈兘涓虹┖!') - return - } - if (!noteColorActive.value) { - ElMessage.error('璇烽�夋嫨绗旇棰滆壊!') - return - } - dom = 'notes-' + bookConfig.value.bookId - data = dialogToolData.notesList[dialogToolData.chapter] - if (!data) data = [] - data.push({ - id: toolClass.uuid(8), - txt: dialogToolData.txt, - page: dialogToolData.page, - chapterNum: dialogToolData.chapter, - type: 'Note', - color: noteColorActive.value, - createDate: new Date(), - note: formData.desc.replace(/^\s*|\s*$/g, '') - }) - - break - } - MG.identity - .setUserKey({ - setKeyRequests: [ - { - domain: dom, - key: dialogToolData.chapter, - value: JSON.stringify(data) + if (token) { + let dom = '' + let data = null + switch (toolActive.value) { + case '楂樹寒': + dom = 'highLightData-' + bookConfig.value.bookId + data = dialogToolData.lineHeight[dialogToolData.chapter] + if (!data) data = [] + data.push({ + id: toolClass.uuid(8), + txt: dialogToolData.txt, + page: dialogToolData.page, + chapterNum: dialogToolData.chapter, + type: 'Highlight', + color: colorActive.value + }) + break + case '鍒掔嚎': + dom = 'underline-' + bookConfig.value.bookId + data = dialogToolData.scribeList[dialogToolData.chapter] + if (!data) data = [] + data.push({ + id: toolClass.uuid(8), + txt: dialogToolData.txt, + page: dialogToolData.page, + chapterNum: dialogToolData.chapter, + type: 'Dashing', + color: colorActive.value + }) + break + case '绗旇': + if (!formData.desc.replace(/^\s*|\s*$/g, '')) { + ElMessage.error('绗旇鍐呭涓嶈兘涓虹┖!') + return } - ] + if (!noteColorActive.value) { + ElMessage.error('璇烽�夋嫨绗旇棰滆壊!') + return + } + dom = 'notes-' + bookConfig.value.bookId + data = dialogToolData.notesList[dialogToolData.chapter] + if (!data) data = [] + data.push({ + id: toolClass.uuid(8), + txt: dialogToolData.txt, + page: dialogToolData.page, + chapterNum: dialogToolData.chapter, + type: 'Note', + color: noteColorActive.value, + createDate: new Date(), + note: formData.desc.replace(/^\s*|\s*$/g, '') + }) + + break + } + MG.identity + .setUserKey({ + setKeyRequests: [ + { + domain: dom, + key: dialogToolData.chapter, + value: JSON.stringify(data) + } + ] + }) + .then((res) => { + showToolBox.value = false + addNoteVisble.value = false + colorActive.value = '' + noteColorActive.value = '' + toolActive.value = '' + getSignData() + getNotesList() + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' }) - .then((res) => { - showToolBox.value = false - addNoteVisble.value = false - colorActive.value = '' - noteColorActive.value = '' - toolActive.value = '' - getSignData() - getNotesList() - }) + .then(() => { + if (sessionStorage.getItem('loginCtx')) { + window.open(sessionStorage.getItem('loginCtx')) + } else { + router.replace({ + path: '/login' + }) + } + }) + .catch(() => { }) + } } const getSignData = () => { - MG.identity - .getUserKey({ - domain: 'highLightData-' + bookConfig.value.bookId, - keys: activeCatalog.value.map((item) => item + '') - }) - .then((res) => { - if (res && res.length > 0) { - for (let i = 0; i < res.length; i++) { - const item = res[i] - const data = JSON.parse(item.value) - // 鍌ㄥ�� - dialogToolData.lineHeight[item.key] = data - // 娓叉煋 - for (let j = 0; j < data.length; j++) { - const citem = data[j] - if (window.qiankunState && window.qiankunState.renderSign) - window.qiankunState.renderSign(citem.type, citem) + if (token) { + MG.identity + .getUserKey({ + domain: 'highLightData-' + bookConfig.value.bookId, + keys: activeCatalog.value.map((item) => item + '') + }) + .then((res) => { + if (res && res.length > 0) { + for (let i = 0; i < res.length; i++) { + const item = res[i] + const data = JSON.parse(item.value) + // 鍌ㄥ�� + dialogToolData.lineHeight[item.key] = data + // 娓叉煋 + for (let j = 0; j < data.length; j++) { + const citem = data[j] + if (window.qiankunState && window.qiankunState.renderSign) + window.qiankunState.renderSign(citem.type, citem) + } } } - } - }) - MG.identity - .getUserKey({ - domain: 'underline-' + bookConfig.value.bookId, - keys: activeCatalog.value.map((item) => item + '') - }) - .then((res) => { - if (res && res.length > 0) { - for (let i = 0; i < res.length; i++) { - const item = res[i] - const data = JSON.parse(item.value) - // 鍌ㄥ�� - dialogToolData.scribeList[item.key] = data + }) + MG.identity + .getUserKey({ + domain: 'underline-' + bookConfig.value.bookId, + keys: activeCatalog.value.map((item) => item + '') + }) + .then((res) => { + if (res && res.length > 0) { + for (let i = 0; i < res.length; i++) { + const item = res[i] + const data = JSON.parse(item.value) + // 鍌ㄥ�� + dialogToolData.scribeList[item.key] = data - // 娓叉煋 - if (data.length > 0) { - for (let j = 0; j < data.length; j++) { - const citem = data[j] - if (window.qiankunState && window.qiankunState.renderSign) - window.qiankunState.renderSign(citem.type, citem) + // 娓叉煋 + if (data.length > 0) { + for (let j = 0; j < data.length; j++) { + const citem = data[j] + if (window.qiankunState && window.qiankunState.renderSign) + window.qiankunState.renderSign(citem.type, citem) + } } } } - } - }) - MG.identity - .getUserKey({ - domain: 'notes-' + bookConfig.value.bookId, - keys: activeCatalog.value.map((item) => item + '') - }) - .then((res) => { - if (res && res.length > 0) { - for (let i = 0; i < res.length; i++) { - const item = res[i] - const data = JSON.parse(item.value) - // 鍌ㄥ�� - dialogToolData.notesList[item.key] = data - // 娓叉煋 - if (data.length > 0) { - for (let j = 0; j < data.length; j++) { - const citem = data[j] - if (window.qiankunState && window.qiankunState.renderSign) - window.qiankunState.renderSign(citem.type, citem) + }) + MG.identity + .getUserKey({ + domain: 'notes-' + bookConfig.value.bookId, + keys: activeCatalog.value.map((item) => item + '') + }) + .then((res) => { + if (res && res.length > 0) { + for (let i = 0; i < res.length; i++) { + const item = res[i] + const data = JSON.parse(item.value) + // 鍌ㄥ�� + dialogToolData.notesList[item.key] = data + // 娓叉煋 + if (data.length > 0) { + for (let j = 0; j < data.length; j++) { + const citem = data[j] + if (window.qiankunState && window.qiankunState.renderSign) + window.qiankunState.renderSign(citem.type, citem) + } } } } - } + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' }) + .then(() => { + if (sessionStorage.getItem('loginCtx')) { + window.open(sessionStorage.getItem('loginCtx')) + } else { + router.replace({ + path: '/login' + }) + } + }) + .catch(() => { }) + } } //鑿滃崟绗旇鍒楄〃 const getNotesList = () => { - let chapterList = [] - listLoading.value = true - catalogueData.value.forEach((item) => { - chapterList.push(item.chapter + '') - }) - let uniqueArray = [...new Set(chapterList)] - scribeData.noteList = [] - MG.identity - .getUserKey({ - domain: 'notes-' + bookConfig.value.bookId, - keys: uniqueArray + if (token) { + let chapterList = [] + listLoading.value = true + catalogueData.value.forEach((item) => { + chapterList.push(item.chapter + '') }) - .then((res) => { - if (res && res.length > 0) { - for (let i = 0; i < res.length; i++) { - const item = res[i] - // 鍌ㄥ�� - let data = catalogueData.value.find((item1) => item1.chapter == Number(item.key)) - // console.log(data,'666') - let dataList = [] - if (catalogueData.value.length > 0) { - catalogueData.value.forEach((item1) => { - if (item1.chapter == Number(item.key)) { - dataList.push(item1) - } - }) - } - let labels = '' - if (dataList.length > 1) labels = dataList.map((item) => item.label).join('/') + let uniqueArray = [...new Set(chapterList)] + scribeData.noteList = [] + MG.identity + .getUserKey({ + domain: 'notes-' + bookConfig.value.bookId, + keys: uniqueArray + }) + .then((res) => { + if (res && res.length > 0) { + for (let i = 0; i < res.length; i++) { + const item = res[i] + // 鍌ㄥ�� + let data = catalogueData.value.find((item1) => item1.chapter == Number(item.key)) + // console.log(data,'666') + let dataList = [] + if (catalogueData.value.length > 0) { + catalogueData.value.forEach((item1) => { + if (item1.chapter == Number(item.key)) { + dataList.push(item1) + } + }) + } + let labels = '' + if (dataList.length > 1) labels = dataList.map((item) => item.label).join('/') - let list = JSON.parse(item.value) - let itemList = [] - if (list.length > 0) { - list.forEach((item) => { - if (searchText.value) { - let text = searchText.value.replace(/^\s*|\s*$/g, '') - if (item.note.indexOf(text) > -1 || item.txt.indexOf(text) > -1) { + let list = JSON.parse(item.value) + let itemList = [] + if (list.length > 0) { + list.forEach((item) => { + if (searchText.value) { + let text = searchText.value.replace(/^\s*|\s*$/g, '') + if (item.note.indexOf(text) > -1 || item.txt.indexOf(text) > -1) { + if (menuState.notesColor == 'all') { + itemList.push(item) + } else if (item.color == menuState.notesColor) { + itemList.push(item) + } + } + } else { if (menuState.notesColor == 'all') { itemList.push(item) } else if (item.color == menuState.notesColor) { itemList.push(item) } } - } else { - if (menuState.notesColor == 'all') { - itemList.push(item) - } else if (item.color == menuState.notesColor) { - itemList.push(item) - } - } - }) + }) + } + if (dataList[0].chapter == Number(item.key) && itemList.length > 0) { + scribeData.noteList.push({ + chapter: dataList[0].chapter, + chapterName: labels ? labels : dataList[0].label, + noteList: itemList + }) + } } - if (dataList[0].chapter == Number(item.key) && itemList.length > 0) { - scribeData.noteList.push({ - chapter: dataList[0].chapter, - chapterName: labels ? labels : dataList[0].label, - noteList: itemList - }) - } + console.log(scribeData.noteList, 'scribeData.noteList') } - console.log(scribeData.noteList, 'scribeData.noteList') - } - listLoading.value = false + listLoading.value = false + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' }) + .then(() => { + if (sessionStorage.getItem('loginCtx')) { + window.open(sessionStorage.getItem('loginCtx')) + } else { + router.replace({ + path: '/login' + }) + } + }) + .catch(() => { }) + } } //姝f枃涓垹闄ら珮浜紝鍒掔嚎锛岀瑪璁版搷浣滄 @@ -3275,7 +3604,7 @@ const updateUserKey = () => { let data = scribeData.noteList.find((item1) => item1.chapter == dialogToolData.chapter) data.noteList.forEach((itemNote) => { - if ((itemNote.id == formData.id)) { + if (itemNote.id == formData.id) { itemNote.note = formData.desc itemNote.color = noteColorActive.value } @@ -3333,7 +3662,7 @@ } }) }) - .catch(() => {}) + .catch(() => { }) } //鑾峰彇閫変腑鑻辨枃璇嶅吀 @@ -3423,12 +3752,26 @@ const layoutBtn = () => { localStorage.removeItem('token') - localStorage.removeItem("userInfo") - router.push('/login') + localStorage.removeItem('userInfo') + // router.push('/login') + if (sessionStorage.getItem('loginCtx')) { + window.open(sessionStorage.getItem('loginCtx')) + } else { + router.replace({ + path: '/login' + }) + } } const goLogin = () => { - localStorage.removeItem("userInfo") - router.push('/login') + localStorage.removeItem('userInfo') + // router.push('/login') + if (sessionStorage.getItem('loginCtx')) { + window.open(sessionStorage.getItem('loginCtx')) + } else { + router.replace({ + path: '/login' + }) + } } </script> @@ -3451,15 +3794,18 @@ display: flex; justify-content: space-between; align-items: center; + .logoTxt { font-size: 24px; color: #333; letter-spacing: 2px; font-weight: bold; } + .userInfoBox { display: flex; align-items: center; + .userName { font-size: 18px; margin-right: 15px; @@ -3467,6 +3813,7 @@ border-right: 1px solid #e0e0e0; color: #2c2c2c; } + .layout { width: 69px; height: 30px; @@ -3478,11 +3825,13 @@ } } } + .contentBox { overflow: hidden; flex: 1; display: flex; position: relative; + .menuBox { width: 80px; flex-shrink: 0; @@ -3496,14 +3845,7 @@ -moz-user-select: none; -khtml-user-select: none; user-select: none; - .notClick { - - pointer-events: none; - .name{ - color:#949494 !important; - } - - } + .menuItem { text-align: center; line-height: 1; @@ -3512,30 +3854,36 @@ width: 63px; margin: 10px auto; border-radius: 10px; + &.active, &:hover { background-color: rgba(0, 147, 255, 0.1); + p { color: #0093ff; } } + .menuIcon { display: inline-block; width: 32px; height: 32px; } + .name { text-align: center; line-height: 1; color: #2c3e50; } } + .reload { width: 80px; position: absolute; bottom: 100px; text-align: center; } + .setting { width: 80px; position: absolute; @@ -3543,7 +3891,9 @@ text-align: center; } } + .menuContent { + // position: relative; width: 300px; flex-shrink: 0; height: calc(100vh - 48px); @@ -3552,6 +3902,7 @@ -moz-user-select: none; -khtml-user-select: none; user-select: none; + .searchBox { width: 100%; height: 60px; @@ -3561,22 +3912,27 @@ align-items: center; border-bottom: 1px solid #efefef; } + .resourceSearchBox { padding: 10px 0; margin: 0 20px; border-bottom: 1px solid rgba(204, 204, 204, 0.32); + .classification { width: 100%; display: flex; justify-content: space-between; align-items: center; + .flex1 { flex: 1; text-align: center; } + .title { color: #999999; } + .count { width: 35px; margin: 0 auto; @@ -3587,16 +3943,19 @@ height: 18px; font-size: 12px; } + .activeClassify, .classifyItem:hover { .title { color: #0093ff; } + .count { background: #0093ff; color: #fff; } } + .showSearch { .imgBox { width: 39px; @@ -3604,17 +3963,20 @@ border-radius: 16px; margin: 0 auto; } + .imgBox:hover, .activeSearch { border: 1px solid #0093ff; } } } + .inputBox { margin-top: 10px; width: 100% !important; } } + .resourceTab { width: 100%; height: 60px; @@ -3622,18 +3984,22 @@ justify-content: center; align-items: center; font-size: 16px; + .hr { height: 25px; color: #dbdbdb !important; } + .tabItem:first-child(1) { border-right: 1px solid #707070; } + .tabItem { flex: 1; text-align: center; line-height: 57px; } + .text { width: 43px; height: 3px; @@ -3641,12 +4007,15 @@ background: #0093ff; border-radius: 3px 3px 0px 0px; } + .line { height: 3px; } } + .inputBox { width: 85%; + .custom-input { border: 1px solid #0093ff !important; border-radius: 50px; @@ -3658,19 +4027,23 @@ .is-focus, .el-input__wrapper { box-shadow: none !important; + .el-input__inner { border: none !important; height: 34px !important; } } + .el-input-group__append { padding: 0 10px !important; background: none !important; } } + .screenBox { display: flex; padding: 0 10px; + .title { margin: 10px 0; line-height: 40px; @@ -3721,14 +4094,17 @@ border: 1px solid #0093ff; } } + .menuList { height: calc(100% - 60px); overflow-y: auto; padding: 10px 0; } + .list-box { .resourceList { padding: 10px; + .resourceItem { padding: 10px 0; align-items: center; @@ -3743,11 +4119,13 @@ align-items: center; justify-content: center; position: relative; + img { height: 100%; width: 100%; object-fit: contain; } + .handleBox { position: absolute; top: 0; @@ -3757,11 +4135,13 @@ background: rgba(44, 44, 44, 0.6); text-align: center; padding: 2px; + .delImg { height: 100%; display: flex; align-items: center; justify-content: center; + .icon { position: static; margin: 5px; @@ -3777,21 +4157,25 @@ } } } + .screenshot { padding: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; + .captureItem { margin-bottom: 10px; width: 46%; position: relative; + .imgBox { border: 1px solid #d8d8d8; width: 100%; height: 80px; margin-bottom: 5px; } + .deleteBox { position: absolute; top: 0; @@ -3801,11 +4185,13 @@ background: rgba(44, 44, 44, 0.6); text-align: center; padding: 2px; + .delImg { height: 100%; display: flex; align-items: center; justify-content: center; + .icon { position: static; margin: 5px; @@ -3813,6 +4199,7 @@ } } } + // .capture { // width: 100%; // } @@ -3836,22 +4223,26 @@ background: #fff; border-radius: 5px; padding: 10px 0; + .textBox { .title { display: flex; justify-content: space-between; align-items: center; margin-right: 10px; + .border-left { height: 25px; border-right: 4px solid; border-radius: 0 5px 5px 0; margin-right: 10px; } + .title-con { display: flex; align-items: center; color: #949494; + .round { width: 10px; height: 10px; @@ -3864,6 +4255,7 @@ margin-left: 5px; } } + .chapter { color: #b7b7b7; margin: 5px 5px 5px 14px; @@ -3876,10 +4268,12 @@ padding: 0 5px; } } + .noteText { margin: 10px 10px 10px 15px; border-radius: 3px; padding: 2px 5px; + .con { max-height: 65px; display: -webkit-box; @@ -3889,14 +4283,17 @@ } } } + .chapterName { margin: 15px; display: flex; align-items: center; + span { margin-left: 5px; } } + .reMarkItem { margin: 15px; background: #fff; @@ -3904,13 +4301,10 @@ padding: 10px; display: flex; justify-content: space-between; + .reMarkCon { - // width: 240px; - // white-space: nowrap; - // overflow: hidden; - // text-overflow: ellipsis; - // margin-right: 8px; display: flex; + .con { width: 200px; white-space: nowrap; @@ -3919,13 +4313,20 @@ margin-right: 8px; } } + .deleteReMarkImg { display: flex; align-items: center; } + + .questionCon { + width: 240px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } } - - + .allSearchList { .searchItem { margin: 15px; @@ -3933,13 +4334,14 @@ border-radius: 10px; padding: 10px; display: flex; - .index{ - line-height: 24px; - margin-right:10px; + .index { + line-height: 24px; + margin-right: 10px; } + .searchCon { - flex:1; + flex: 1; width: 240px; overflow: hidden; margin-right: 8px; @@ -3949,19 +4351,59 @@ -webkit-box-orient: vertical; -webkit-line-clamp: 2; text-overflow: ellipsis; - .searchColor{ - background:rgb(245, 225, 42, 0.5) + + .searchColor { + background: rgb(245, 225, 42, 0.5); } } - } - } - } - .allSearch,.notesBox,.resourceBox,.reMarkList,.screenshotList { - height: calc(100% - 60px); - overflow-y: auto; } + } + + .allSearch, + .notesBox, + .resourceBox, + .reMarkList, + .questionList, + .screenshotList { + height: calc(100% - 60px); + overflow-y: auto; + } + + .questionList { +<<<<<<< HEAD + height: 83%; +======= + height: 83% +>>>>>>> bcee5cd49c38973e2c6c316e1405f27ab1b74db7 + } + + .question-bottom { + position: absolute; + bottom: 0; + display: flex; + justify-content: space-evenly; + width: 300px; + padding: 20px 0; + background-color: #fff; +<<<<<<< HEAD +======= + +>>>>>>> bcee5cd49c38973e2c6c316e1405f27ab1b74db7 + li { + cursor: pointer; + width: 65px; + height: 65px; + border: 1px solid #cfcfcf; + border-radius: 10px; + background-color: #f9f9f9; + display: flex; + justify-content: center; + align-items: center; + } + } } + .menuStateBox { width: 25px; height: 25px; @@ -3973,6 +4415,7 @@ text-align: center; box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.3); z-index: 2; + img { height: 10px; width: 18px; @@ -3983,6 +4426,7 @@ flex: 1; font-size: 16px; position: relative; + .pageBox-header { height: 57px; padding: 0 20px; @@ -3991,6 +4435,7 @@ z-index: 99; align-items: center; justify-content: space-between; + .classTime { display: flex; align-items: center; @@ -3998,6 +4443,7 @@ border-radius: 20px 20px 20px 20px; color: #0093ff; padding: 8px; + .qureIcon { width: 9px; height: 9px; @@ -4006,16 +4452,20 @@ margin: 0 5px; } } + .progress { text-align: center; + .bookName { font-weight: 800; margin-bottom: 5px; color: #333; } } + .rightBox { display: flex; + .pageSizeBox { display: flex; align-items: center; @@ -4025,21 +4475,25 @@ padding: 5px; display: flex; align-items: center; + img { width: 18px; height: 18px; } } } + .brushImgBox { display: flex; align-items: center; border-left: 1px solid #d8d8d8; + div { padding: 5px; display: flex; align-items: center; } + .brushImg { width: 22px; margin-left: 20px; @@ -4048,21 +4502,26 @@ } } } + .pageBox-content { height: calc(100% - 57px); background: #fbf9f4; padding: 10px 0; + .content-box { height: 100%; position: relative; + #container { background: #fbf9f4; height: 100%; + #__qiankun_microapp_wrapper_for_app_content__ { height: 100%; } } } + .canvas-box { height: 100%; width: 100%; @@ -4074,6 +4533,7 @@ } } } + .toolBox { position: relative; box-shadow: -3px 0px 6px 1px rgba(0, 0, 0, 0.07); @@ -4082,15 +4542,13 @@ -moz-user-select: none; -khtml-user-select: none; user-select: none; - .notClick { - pointer-events: none; - color:#949494 !important; - } + .toolTitle { height: 57px; line-height: 53px; text-align: center; border-bottom: 1px solid #efefef; + .text { width: 43px; height: 3px; @@ -4099,9 +4557,11 @@ border-radius: 3px 3px 0px 0px; } } + .menu { padding-top: 20px; - li > div { + + li>div { // height: 50px; padding: 10px 36px; font-size: 16px; @@ -4120,6 +4580,7 @@ } } } + .openBox { width: 25px; height: 25px; @@ -4138,22 +4599,27 @@ width: 18px; } } + .right { right: 198px !important; border-radius: 0px 3px 3px 0px !important; } + .classRoomBox { position: absolute; bottom: 0; width: 100%; + .el-tabs__nav { width: 100% !important; } + .el-tabs__item { flex: 1 !important; padding: 0 !important; text-align: center; } + .el-tabs__active-bar { width: 43px !important; left: 30px !important; @@ -4161,13 +4627,16 @@ bottom: 1px; border-radius: 3px 3px 0px 0px; } + .tabBox { height: 100px; padding: 10px 17px; text-align: center; + .insertSelect { display: flex; justify-content: space-between; + .selectItem { text-align: center; background: rgba(207, 207, 207, 0.13); @@ -4175,6 +4644,7 @@ border-radius: 5px; border: 2px solid #cfcfcf; } + .typeActive { text-align: center; color: #0093ff; @@ -4184,6 +4654,7 @@ background: rgba(0, 147, 255, 0.13); } } + .giveLessons { color: #0093ff; width: 90px; @@ -4194,6 +4665,7 @@ display: flex; align-items: center; justify-content: center; + span { margin-left: 10px; } @@ -4214,9 +4686,7 @@ border-radius: 10px; padding: 6px; overflow: hidden; - .notClick { - pointer-events: none; - } + .floatToolItem { margin: 10px 0; height: 30px; @@ -4226,11 +4696,13 @@ border-radius: 5px; color: #fff; cursor: pointer; + .imgBox { width: 24px; height: 24px; margin: 0 auto; position: relative; + img { width: 100%; height: 100%; @@ -4246,10 +4718,12 @@ margin: auto; } } + .text { margin-right: 5px; } } + .floatToolItem:hover, .floatToolActive { background-color: rgba(255, 255, 255, 0.3); @@ -4268,10 +4742,12 @@ background: #fff; overflow: hidden; box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.3); + .toolList { display: flex; justify-content: center; align-items: center; + .floatToolItem { margin: 6px 8px; padding: 5px; @@ -4282,6 +4758,7 @@ align-items: center; // flex: 1; font-size: 14px; + .imgBox { height: 18px; width: 18px; @@ -4289,9 +4766,11 @@ margin: 0 auto; } } + .floatToolItem:hover { background-color: rgba(44, 44, 44, 0.2); } + .layOutTool { height: 20px; margin-right: 5px; @@ -4303,6 +4782,7 @@ .dialogToolBox { position: fixed; z-index: 2; + .toolSelectBox { height: 40px; display: flex; @@ -4312,6 +4792,7 @@ overflow: hidden; padding: 5px; background-color: rgba(90, 90, 90, 0.9); + // background-image: linear-gradient(to right, #0093ff, #005dff); .dialogToolItem { user-select: none; @@ -4322,10 +4803,12 @@ margin: 0 5px; cursor: pointer; text-align: center; + span { color: #fff; } } + .dialogToolItem:hover, .active { background-color: rgba(255, 255, 255, 0.2); @@ -4335,6 +4818,7 @@ } } } + .colorSelectBox { padding: 5px 10px; width: 190px; @@ -4344,8 +4828,10 @@ box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.16); border-radius: 5px; margin-bottom: 10px; + .flex1 { flex: 1; + .scribeItem { width: 18px; height: 18px; @@ -4360,6 +4846,7 @@ } } } + .lineDeleteBox { position: fixed; z-index: 2; @@ -4369,6 +4856,7 @@ background-color: rgba(90, 90, 90, 0.9); border-radius: 5px; display: flex; + .dialogToolItem { padding: 3px; margin: 0 5px; @@ -4377,10 +4865,12 @@ justify-content: center; align-items: center; } + .dialogToolItem:hover { background-color: rgba(255, 255, 255, 0.3); } } + .noteContentBox { max-width: 240px; position: fixed; @@ -4388,6 +4878,7 @@ padding: 10px; border-radius: 5px; } + .dictionaryDataBox { position: fixed; z-index: 2; @@ -4395,9 +4886,11 @@ padding: 5px 20px; background: #fff; border-radius: 5px; + .word { font-weight: bold; } + .phone_con { .per-phone { align-items: center; @@ -4411,33 +4904,40 @@ margin-right: 10px; margin-top: 10px; padding: 8px 10px; + span { margin: 0 10px; flex: 1; } } + .soundBtn { width: 16px; height: 14px; } } + .trans { padding: 20px 0; + .itemList { display: flex; padding: 10px 0; + .index { margin-right: 15px; } + .pos { margin-right: 30px; } } } } + .wendabox { width: 100%; - height: 80vh; + height: 95vh; iframe { width: 100%; @@ -4469,38 +4969,48 @@ top: 0px !important; right: 0px !important; } + .el-dialog__body { padding: 20px !important; } + .el-dialog__footer { padding: 10px 20px 20px !important; text-align: right; box-sizing: border-box; } } + .myDialogs { height: 90vh; } + .myAnserDialogs { width: 700px; height: 90vh; } + .myNoteDialogs { width: 500px !important; } + .screenshotDialog { width: 400px !important; } + .baiduDialog { width: 90vw; height: 90vh; } + .noteColorSelectBox { margin-top: 10px; width: 190px; display: flex; + .flex1 { flex: 1; + .scribeItem { width: 18px; height: 18px; @@ -4513,12 +5023,15 @@ } } } + .videoBox { text-align: center; + video { width: 100%; } } + .audioBox { // display:none; } @@ -4526,11 +5039,19 @@ .wordBox { height: 600px; } + .imgUrlBox { width: 100%; text-align: center; + img { width: 100%; } } + +.voice-reader { + position: absolute; + bottom: 30px; + left: 50px; +} </style> -- Gitblit v1.9.1