litian
3 天以前 8bb0a518dd4d9450370582c4d4ac3ae1dba1466b
src/views/readerPages/webHome.vue
@@ -6,20 +6,26 @@
      <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 class="layout hover" @click="openFormulaDialog">公式</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>
@@ -94,7 +100,7 @@
      <!-- 菜单内容 -->
      <div class="menuContent" v-if="menuState.open">
        <div class="searchBox">
          <div class="inputBox" v-if="activeMenu !== '资源'">
          <div class="inputBox" v-if="activeMenu !== '资源' && activeMenu !== '题库'">
            <el-input
              class="custom-input"
              placeholder="请输入内容"
@@ -104,20 +110,62 @@
              @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>
            </div>
            <hr class="hr" />
            <div class="tabItem hover" @click="selectResourceType('teacher')">
            <hr class="hr" v-if="userInfo.role == 'Teacher'"/>
            <div class="tabItem hover" @click="selectResourceType('teacher')" v-if="userInfo.role == 'Teacher'">
              <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>
        <!-- 目录 -->
@@ -133,7 +181,6 @@
            v-if="catalogueData.length > 0"
            @node-click="handleNodeClick"
            :filter-node-method="filterNode"
            empty-text="暂无数据"
          >
            <template #default="{ node, data }">
              <div class="custom-tree-node">
@@ -141,10 +188,11 @@
                <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">
@@ -155,15 +203,27 @@
                    @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>
                  >
                    <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>
                  <div
                    class="searchCon hover"
                    @click="goSearchContent(item)"
                    v-html="item.txt1"
                    :title="item.txt"
                  ></div>
                </div>
              </div>
            </div>
@@ -173,7 +233,7 @@
          </div>
        </div>
        <!-- 笔记 -->
        <div class="notesBox" v-if="activeMenu == '笔记'">
        <div class="notesBox" v-if="activeMenu == '笔记'" v-loading="listLoading">
          <div class="screenBox">
            <div class="title">筛选</div>
            <div class="flex1 hover" @click="searchClick('all')">
@@ -191,7 +251,7 @@
              ></div>
            </div>
          </div>
          <div class="list-box" v-loading="listLoading">
          <div class="list-box">
            <div v-if="scribeData.noteList.length > 0">
              <div v-for="(noteItem, index) in scribeData.noteList" :key="noteItem">
                <div class="chapterName">
@@ -199,9 +259,12 @@
                    @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>
                  >
                    <ArrowDown />
                  </el-icon>
                  <el-icon @click="noteOpen(index)" v-else class="hover">
                    <ArrowRight />
                  </el-icon>
                  <span>{{ noteItem.chapterName }}</span>
                </div>
                <div
@@ -291,7 +354,7 @@
                @clear="handleClear"
              >
                <template #prefix>
                  <img :src="listSearch" @click="searchBook" class="hover"/>
                  <img :src="listSearch" @click="searchBook" class="hover" />
                </template>
              </el-input>
            </div>
@@ -313,65 +376,106 @@
                        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>
                            v-if="item.pagination"
                          >
                            <LocationInformation />
                          </el-icon>
                          <el-icon
                            @click="goPlay(item)"
                            size="20"
                            class="icon hover"
                            v-if="item.resourceType == '视频'"
                            ><VideoPlay
                          /></el-icon>
                          >
                            <VideoPlay />
                          </el-icon>
                          <el-icon
                            @click="goPlay(item, index)"
                            size="20"
                            class="icon hover"
                            v-if="item.resourceType == '音频' && playIndex != index"
                            ><VideoPlay
                          /></el-icon>
                          >
                            <VideoPlay />
                          </el-icon>
                          <el-icon
                            @click="goPause()"
                            size="20"
                            class="icon hover"
                            v-if="item.resourceType == '音频' && playIndex == index"
                            ><VideoPause
                          /></el-icon>
                          >
                            <VideoPause />
                          </el-icon>
                          <el-icon
                            @click="getCapture(item, index)"
                            size="20"
                            class="icon hover"
                            v-if="item.resourceType == '图片'"
                            ><View
                          /></el-icon>
                          >
                            <View />
                          </el-icon>
                          <!-- 其他类型预览或直接下载 -->
                          <el-icon
                            @click="goPlay(item)"
                            size="20"
                            class="icon hover"
                            v-if="
                              item.resourceType != '视频' &&
                              item.resourceType != '音频' &&
                              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 == '图片'
                            @click="goDownload(item)"
                            v-if="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
                              )
                            "
                            ><Download
                          /></el-icon>
                          />
                        </div>
                      </div>
                    </div>
@@ -394,17 +498,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 +523,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,6 +540,54 @@
            </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
@@ -496,6 +648,18 @@
            <!-- 画笔画布 -->
            <div class="canvas-box" v-show="canvasShow">
              <canvas id="canvasRef" :width="canvasWith" :height="canvasheight"></canvas>
            </div>
            <!-- 番茄闹钟组件 -->
            <div
              class="watch-box"
              v-if="pomodoroRef && pomodoroRef.isShow"
              :style="{ top:position.x + 'px', left:position.y + 'px'}"
            >
              <p @mousedown.native="mouseDown">{{ formatTime(pomodoroRef.pageData.currentTime) }}</p>
              <span @click="()=> pomodoroRef.isRuning ? pomodoroRef.pauseFun() : pomodoroRef.startFun()">{{pomodoroRef.isRuning ? '暂停': '开始'}}</span>
              <span @click="pomodoroRef.resetFun" >重置</span>
              <span @click="pomodoroRef.handleRestFun(false)">长休息</span>
              <span @click="pomodoroRef.handleRestFun(true)">短休息</span>
            </div>
          </div>
        </div>
@@ -645,16 +809,24 @@
                <div class="graphBox">
                  <div class="graphSelect">
                    <div class="flex1">
                      <div class="square hover" @click="graphSelect('square')"></div>
                      <div :class="toolSelectData.graphType == 'square' ? 'acitveGraphType' : ''">
                        <div class="square hover" @click="graphSelect('square')"></div>
                      </div>
                    </div>
                    <div class="flex1">
                      <div class="rotundity hover" @click="graphSelect('rotundity')"></div>
                      <div :class="toolSelectData.graphType == 'rotundity' ? 'acitveGraphType' : ''">
                        <div class="rotundity hover" @click="graphSelect('rotundity')"></div>
                      </div>
                    </div>
                    <div class="flex1">
                      <div class="triangle hover" @click="graphSelect('triangle')"></div>
                      <div :class="toolSelectData.graphType == 'triangle' ? 'acitveGraphType' : ''">
                        <div class="triangle hover" @click="graphSelect('triangle')"></div>
                      </div>
                    </div>
                    <div class="flex1">
                      <div class="lineSegment hover" @click="graphSelect('lineSegment')">/</div>
                      <div :class="toolSelectData.graphType == 'lineSegment' ? 'acitveGraphType' : ''">
                        <div class="lineSegment hover" @click="graphSelect('lineSegment')">/</div>
                      </div>
                    </div>
                  </div>
                  <div class="lineStyle">
@@ -711,6 +883,10 @@
            </div>
          </div>
        </div>
        <!-- 语音阅读组件 -->
        <!-- <div class="voice-reader">
          <voiceReader />
         </div> -->
      </div>
      <!-- 教学组件 -->
      <div class="toolBox">
@@ -720,9 +896,8 @@
        </div>
        <div class="menuList">
          <ul class="menu" v-if="teachToolsMenuData.length > 0">
            <li v-for="item in teachToolsMenuData" :key="item.key">
            <li v-for="item in teachToolsMenuData" :key="item.key" class="hover">
              <div
                :class="token ? 'hover' : 'notClick'"
                :style="!toolState.open ? 'padding:10px 15px' : ''"
                v-if="item.isShow"
                @click="selectTeachTools(item)"
@@ -820,12 +995,7 @@
        :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 v-for="item in floatingToolBox" :key="item.name" @click="floatItemHandle(item)">
          <div v-if="item.isShow">
            <el-popover
              placement="right"
@@ -994,6 +1164,11 @@
    </div>
  </div>
  <!-- 白板 -->
  <div v-if="whiteBoard" class="whiteBoardBox">
    <whiteBoardBox @whiteBoardClose="whiteBoardClose"></whiteBoardBox>
  </div>
  <el-dialog
    title="资源"
    align-center
@@ -1006,9 +1181,12 @@
      <video controls controlslist="nodownload" :src="testVideo"></video>
    </div>
    <!-- <div class="wordBox" v-if="resourType == 'word'">
      <vue-office-docx :src="testWord" />
    </div> -->
    <div class="wordBox" v-if="resourType == 'PDF' || resourType == 'PPT' || resourType == 'WORD'">
      <div v-for="(item, index) in showData" :key="index" class="pdfItem" :page="index + 1">
        <img :src="item.showSrc" alt="" style="min-height: 550px" loading="lazy" />
        <el-divider content-position="center"> 第 {{ index + 1 }} 页 </el-divider>
      </div>
    </div>
  </el-dialog>
  <div class="audioBox" v-show="false">
    <!-- <video controls controlslist="nodownload" :src="testVideo"></video> -->
@@ -1117,6 +1295,11 @@
  </el-dialog>
  <el-dialog title="模型工具" align-center v-model="modelToolVisble" width="80%" class="myDialogs">
    <div class="wendabox">
      <iframe :src="sceneUrl" frameborder="0"></iframe>
    </div>
  </el-dialog>
  <el-dialog title="模型工具" align-center v-model="modelTool" width="80%" class="myDialogs">
    <div class="wendabox">
      <iframe src="https://adjam93.github.io/threejs-model-viewer/#" frameborder="0"></iframe>
    </div>
  </el-dialog>
@@ -1125,16 +1308,50 @@
      <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>
  <el-dialog title="公式编辑" align-center v-model="formulaDialog" class="myDialogs">
    <div class="wendabox">
      <formula />
    </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> -->
    <iframe src="https://www.geogebra.org/scientific" frameborder="0" class="iframe-box"></iframe>
  </el-dialog>
  <!-- 番茄闹钟 -->
  <!-- <pomodoro ref="pomodoroRef" /> -->
</template>
<script setup lang="ts">
import { ref, reactive, watch, onMounted, onBeforeMount, inject } from 'vue'
import examination from '@/views/examination/index.vue'
import pomodoro from '@/views/components/pomodoro.vue'
import { ref, reactive, watch, onMounted, onBeforeMount, onBeforeUnmount, inject } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { ElMessage, ElMessageBox, valueEquals } from 'element-plus'
import { useFormatData } from '@/hooks/public'
import useClipboard from 'vue-clipboard3'
const { toClipboard } = useClipboard()
const { formatTime } = useFormatData()
const MG: any = inject('MG')
const toolClass = inject('toolClass')
const qiankunActions = inject('qiankunActions')
//获取路由器
let router = useRouter()
//获取当前路由的信息
@@ -1142,7 +1359,10 @@
import moment from 'moment'
import dictionary from '@/views/components/dictionary.vue'
import newWord from '@/views/components/newWord.vue'
import { ElMessage, ElMessageBox, valueEquals } from 'element-plus'
import formula from '@/views/components/formula.vue'
import wrongQuestion from '@/views/components/wrongQuestion.vue'
import voiceReader from '@/views/components/voiceReader.vue'
import whiteBoardBox from '@/views/components/whiteBoard.vue'
import logo from '@/assets/images/header/logo.png'
import mulu from '@/assets/images/menu/mulu.png'
import biji from '@/assets/images/menu/biji.png'
@@ -1151,6 +1371,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 +1385,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,8 +1459,9 @@
import { loadMicroApp } from 'qiankun'
import { microApps } from '@/child.ts'
import { open } from 'fs'
let token = localStorage.getItem('token')
const canvasWith = ref(1000)
const canvasWith = ref(800)
const canvasheight = ref(3000)
const screenWidth = ref(
  window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
@@ -1249,9 +1471,16 @@
const bookConfig = ref({})
const activeCatalog = ref()
const reMarResult = ref()
const bookInfo = ref()
const isBuy = ref(false)
const tryPageCount = ref(0)
const searchText = ref()
onMounted(() => {
  if (token) {
    getUserInfo()
  }
  if (localStorage.getItem('bookId')) {
    getBookInfo()
  }
  setTimeout(() => {
    canvasWith.value = document.querySelector('.content-box').offsetWidth
@@ -1270,7 +1499,6 @@
        window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
    })()
  }
  // 加载微应用
  microApp = loadMicroApp(microApps[localStorage.getItem('bookId')], {
    sandbox: {
@@ -1283,18 +1511,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 +1611,11 @@
  // }
})
onBeforeUnmount(() => {
  if (microApp) {
    microApp.unmount() // 卸载微应用
  }
})
// watch(
//   () => screenWidth.value,
//   (val) => {
@@ -1395,6 +1630,45 @@
//     }
//   }
// )
//根据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, '图书信息')
    if (!res.datas.length) return
    bookInfo.value = res.datas[0]
    if (res.datas[0].purchasedSaleMethodIdList.indexOf(res.datas[0].defaultSaleMethodId) > -1) {
      isBuy.value = true
    } else {
      isBuy.value = false
    }
    tryPageCount.value = Number(res.datas[0].probationPage)
  })
}
const getUserInfo = () => {
  MG.identity.getCurrentAppUser().then((res) => {
@@ -1425,7 +1699,6 @@
      } else if (phoneInfo) {
        userInfo.value = {
          name: phoneInfo.credential
        }
        localStorage.setItem('userInfo', JSON.stringify(userInfo.value))
      }
@@ -1467,16 +1740,26 @@
      name: '知识图谱',
      icon: zhishitupu,
      isShow: bookConfig.value.textbookComponents.indexOf('6BE6A3DC') > -1
    },
    {
      name: '截图',
      icon: jietu,
      isShow: bookConfig.value.textbookComponents.indexOf('CB0EACEC') > -1
      // isShow: true
    },
    {
      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
    },
    {
      name: '截图',
      icon: jietu,
      isShow: bookConfig.value.textbookComponents.indexOf('CB0EACEC') > -1
    }
  ]
  teachToolsMenuData = [
@@ -1550,17 +1833,24 @@
      icon: fanqiezhong,
      isShow: bookConfig.value.textbookComponents.indexOf('E4DC9777') > -1
    }
    // {
    //   name: '番茄闹钟',
    //   icon: fanqiezhong,
    //   isShow: true
    // }
  ]
  floatingToolBox = [
    {
      icon: huabi,
      name: '画笔',
      isShow: bookConfig.value.textbookComponents.indexOf('800109C0') > -1
      // isShow: true
    },
    {
      icon: baiban,
      name: '白板',
      isShow: bookConfig.value.textbookComponents.indexOf('029DB3E0') > -1
      // isShow: true
    },
    {
      icon: biaozhu,
@@ -1637,9 +1927,19 @@
      catalogueData.value = json.data
      headerData.totlePage = json.data[json.data.length - 1].end
      listLoading.value = false
      if (localStorage.getItem('chapter') && localStorage.getItem('startPage')) {
        let chapter = Number(localStorage.getItem('chapter'))
        let start = Number(localStorage.getItem('startPage'))
        if (window.qiankunState && window.qiankunState.gotoPage) {
          window.qiankunState.gotoPage(chapter, start)
          localStorage.removeItem('chapter')
          localStorage.removeItem('startPage')
        }
      }
    })
    .catch(function (error) {
      console.log(error)
      listLoading.value = false
    })
}
const defaultProps = {
@@ -1654,9 +1954,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,237 +1990,237 @@
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.isDefaultResource == '是') {
                defaultResourceList.value.push(item)
              }
              otherCount++
            } else {
              if (item.isTeacherResource == '是' && item.isDefaultResource == '否') {
                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' // 解决跨域问题,也就是提示污染资源无法转换视频
          //     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)
                }
                if (activeClassify.value == 'other') {
                  if (
                    resItem1.resourceType != '图片' &&
                    resItem1.resourceType != '视频' &&
                    resItem1.resourceType != '音频'
                  ) {
                    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)
                }
                if (activeClassify.value == 'other') {
                  if (
                    resItem1.resourceType != '图片' &&
                    resItem1.resourceType != '视频' &&
                    resItem1.resourceType != '音频'
                  ) {
                    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 sceneUrl = ref()
const showData = ref()
const goPlay = (data, index) => {
  console.log(data.resourceType, 123)
  resourType.value = data.resourceType
  if (data.resourceType == '视频') {
    if (data.md5) {
@@ -1938,6 +2237,59 @@
      testAudio.value = bookConfig.value.resourceUrl + '/' + data.resourcePath
    }
    autoPlay()
  } else if (data.resourceType == '模型') {
    console.log(data, 222)
    let file = bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5
    console.log(file.exd, 777)
    const ctx = 'https://jsek.bnuic.com'
    if (data.md5) {
      sceneUrl.value =
        'https://jsek.bnuic.com/books/book/civilAviation/static/modelView/index.html?md5=' +
        data.md5 +
        '&name=je' +
        '&domain=' +
        ctx +
        '&exd=obj' +
        '&target=iframe'
    } else {
      sceneUrl.value = bookConfig.value.resourceUrl + '/' + data.resourcePath
    }
    modelToolVisble.value = true
    // if (data.md5) {
    //   window.open(bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5)
    // } else if (data.resourcePath) {
    //   window.open(bookConfig.value.resourceUrl + '/' + data.resourcePath)
    // }
  } else if (data.resourceType == 'PPT' || data.resourceType == 'PDF' || data.resourceType == 'WORD') {
    let md5 = data.md5
    let dataList = []
    MG.file
      .getPdfInfo({
        md5
      })
      .then((res: any) => {
        console.log()
        if (res && res.totalPages) {
          for (let i = 0; i < res.totalPages; i++) {
            const src =
              bookConfig.value.requestCtx +
              '/file/GetPdfPageImage?md5=' +
              md5 +
              '&index=' +
              (i + 1) +
              '&dpi=300'
            dataList.push({
              showSrc: src
            })
          }
          console.log(dataList)
          showData.value = dataList
          // 启动页码观察
          setTimeout(() => {
            resourVisble.value = true
          }, 500)
        }
      })
  } else {
    if (data.md5) {
      window.open(bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5)
@@ -1949,6 +2301,13 @@
  //  else if (data.resourceType == 'word') {
  //   testWord.value = bookConfig.value.resourceUrl + '/' + data.resourcePath
  // }
}
const goDownload = (data) => {
  if (data.md5) {
    window.open(bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5)
  } else if (data.resourcePath) {
    window.open(bookConfig.value.resourceUrl + '/' + data.resourcePath)
  }
}
// 关闭视频
const resourVisbleClose = () => {
@@ -1968,7 +2327,6 @@
//资源跳转到指定位置
const JumpPosition = (data) => {
  console.log(data, '跳转')
  if (window.qiankunState && window.qiankunState.gotoPage) {
    window.qiankunState.gotoPage(Number(data.chapterNum), Number(data.pagination))
  }
@@ -1977,15 +2335,26 @@
//资源类型选择默认/教师
const selectResourceType = (type) => {
  resourceType.value = type
  resourceDataList.value = []
  classifySelectList.value = []
  activeClassify.value = ''
  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()
  }
}
const searchBtn = () => {
  if (searchShow.value) {
@@ -1995,13 +2364,287 @@
  }
}
// 获取收藏的资源
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)
                }
                if (activeClassify.value == 'other') {
                  if (
                    resItem1.resourceType != '图片' &&
                    resItem1.resourceType != '视频' &&
                    resItem1.resourceType != '音频'
                  ) {
                    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) => {
  if (collectResourceList.value.findIndex((item) => item.id == id) > -1) {
    collectResourceList.value = collectResourceList.value.filter((item) => item.id != id)
  } else {
    collectResourceList.value.push({
      id,
      md5,
      resourcePath: resourcePath.replace(bookConfig.value.resourceUrl + '/', ''),
      resourceType,
      source,
      resourceName
    })
  }
  MG.identity.setUserKey({
    setKeyRequests: [
      {
        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 = []
  listLoading.value = false
  if (menuState.open && activeMenu.value == name) {
    menuState.open = false
  } else {
@@ -2027,6 +2670,9 @@
      break
    case '检索':
      break
    case '题库':
      getExercisesList()
      break
  }
}
//刷新当前页面
@@ -2045,7 +2691,6 @@
  // }
}
const searchText = ref<string>('') //筛选
const menuState = reactive({
  open: true,
  notesColor: 'all' //笔记颜色
@@ -2143,7 +2788,7 @@
const allSearchReault = ref([])
const searchReaultData = reactive({
  isShow: true,
  openIndex: 0,
  openIndex: 0
})
const searchBook = async () => {
  switch (activeMenu.value) {
@@ -2176,13 +2821,16 @@
    case '书签':
      getReMarkList()
      break
    case '题库':
      getExercisesList()
      break
    case '检索':
      listLoading.value = true
      allSearchReault.value = []
      console.log(window.qiankunState.searchBookByKeyword)
      if (window.qiankunState && window.qiankunState.searchBookByKeyword) {
        console.log(window.qiankunState.searchBookByKeyword)
        let searchReault = window.qiankunState.searchBookByKeyword(searchText.value)
        if (searchReault.length > 0) {
          listLoading.value = true
          let catalogueList = sortArr(catalogueData.value, 'chapter')
          if (catalogueList.length > 0) {
            catalogueList.forEach((item) => {
@@ -2211,10 +2859,10 @@
              }
            })
          }
          console.log(allSearchReault.value, 444)
          listLoading.value = false
        }else{
          listLoading.value = false
        }
      }
      break
  }
@@ -2265,7 +2913,6 @@
//检索跳转
const goSearchContent = (item) => {
  console.log(item,1111111111111111111111111111111111111111111111111111)
  if (window.qiankunState && window.qiankunState.gotoPage) {
    window.qiankunState.jumpSearchItem(item)
  }
@@ -2293,43 +2940,74 @@
    case '检索':
      allSearchReault.value = []
      break
    case '题库':
      getExercisesList()
      break
  }
}
type pomodoroType = InstanceType<typeof Pomodoro>
const baiduVisible = ref(false)
const wendaVisible = ref(false)
const cidianVisible = ref(false)
const functionVisible = ref(false)
const siweiVisble = ref(false)
const modelToolVisble = ref(false)
const modelTool = ref(false)
const shengciVisble = ref(false)
const calculatorVisble = ref(false)
const pomodoroRef = ref<pomodoroType>()
const activeTool = ref(0)
const toolState = reactive({
  open: true
})
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
const selectTeachTools = (item: any) => {
  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 '模型工具':
        modelTool.value = true
        break
      case '词典':
        cidianVisible.value = true
        break
      case '生词卡片':
        resourceUrl.value = bookConfig.value.resourceUrl
        shengciVisble.value = true
        break
      case '计算器':
        calculatorVisble.value = true
      case '番茄闹钟':
        pomodoroRef.value.setDialogVisable(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(() => {})
  }
}
@@ -2359,7 +3037,7 @@
//画布悬浮操作
let canvas = null
let canvasBox: any = null
const floatingToolData = reactive({
  activeToolData: '', //选中工具
  activeBookmark: '', //选中书签
@@ -2370,6 +3048,10 @@
//画布
const canvasShow = ref(false)
let textBox: any = null
let activeElBox: any = null
//白板
const whiteBoard = ref(false)
//截图事件
const nameRef = ref()
@@ -2389,27 +3071,32 @@
//浮窗工具栏点击事件
const floatItemHandle = (item) => {
  console.log(floatingToolData.activeToolData, 'floatingToolData.activeToolData')
  if (floatingToolData.activeToolData == '画笔') {
    floatingToolData.activeToolData = ''
  }else {
  } else {
    floatingToolData.activeToolData = item.name
  }
  canvasShow.value = false
  whiteBoard.value = false
  switch (floatingToolData.activeToolData) {
    case '画笔':
      canvasShow.value = true
      toolSelectData.activeTool = 'huabi'
      canvasBox = new fabric.Canvas('canvasRef')
      canvasBox.setZoom(1); // 设置画布缩放比例为1
      canvasBox.absolutePan({ x: 0, y: 0 });
      break
    case '白板':
      whiteBoard.value = true
      break
    case '标记':
      break
    case '书签':
      if(floatingToolData.activeBookmark != '书签' ){
      if (floatingToolData.activeBookmark != '书签') {
        floatingToolData.activeBookmark = '书签'
        reMark()
      }
      break
    case '截屏':
      jitT()
@@ -2429,18 +3116,53 @@
const toolSelectHandle = (title) => {
  toolSelectData.activeTool = title
  toolSelectData.lineColorActive = ''
  canvasBox.isDrawingMode = false
  switch (title) {
    case 'huabi':
      init()
      canvasBox.skipTargetFind = false
      canvasBox.isDrawingMode = true
      toolSelectData.graphType = ''
      canvasBox.freeDrawingBrush.color = '#333'
      canvasBox.freeDrawingBrush.width = '3'
      canvasBox.on('mouse:down', '') // 鼠标在画布上按下
      canvasBox.on('mouse:up', '')
      canvasBox.on('mouse:move', '')
      break
    case 'wenzi':
      canvasBox.skipTargetFind = false
      canvasBox.isDrawingMode = false
      toolSelectData.graphType = ''
      textBox = new fabric.IText('请输入文本', {
        left: 50,
        top: 50,
        fontSize: toolSelectData.fontSizeActive
      })
      canvasBox.add(textBox)
      canvasBox.on('mouse:down', '') // 鼠标在画布上按下
      canvasBox.on('mouse:up', '')
      canvasBox.on('mouse:move', '')
      break
    case 'tuxing':
      canvasBox.isDrawingMode = false
      canvasBox.selectionColor = 'transparent'
      canvasBox.skipTargetFind = true
      toolSelectData.lineColorActive = '#000'
      break
    case 'chexiao':
      canvasBox.skipTargetFind = false
      canvasBox.isDrawingMode = false
      canvasBox.remove(activeElBox)
      canvasBox.requestRenderAll()
      activeElBox = null
      break
    case 'tuichu':
      canvasBox.skipTargetFind = false
      canvasBox.isDrawingMode = false
      canvasShow.value = false
      floatingToolData.activeToolData = ''
      break
    case 'qingchu':
      canvas.clear()
      canvasBox.clear()
      break
  }
}
@@ -2448,31 +3170,32 @@
//选中画笔粗细
const selectThickness = (str) => {
  toolSelectData.thicknessActive = str
  canvas.freeDrawingBrush.color = toolSelectData.thicknessActive
  canvasBox.freeDrawingBrush.width = toolSelectData.thicknessActive
}
const selectLineType = (str) => {
  toolSelectData.lineTypeActive = str
  init()
  if (toolSelectData.lineTypeActive == 'dashed') {
    canvasBox.freeDrawingBrush.strokeDashArray = [10]
  } else {
    canvasBox.freeDrawingBrush.strokeDashArray = null
  }
}
//画笔颜色选择
const lineColorSelect = (item) => {
  toolSelectData.lineColorActive = item.key
  canvas.freeDrawingBrush.color = item.key
}
//画布属性
const isDrawing = ref(true) // 是否开启绘图,true 开启;false 关闭
const init = () => {
  canvas = new fabric.Canvas('canvasRef', {
    isDrawingMode: isDrawing.value // 启用绘画模式
  })
  canvas.freeDrawingBrush.color = toolSelectData.lineColorActive
  canvas.freeDrawingBrush.width = toolSelectData.thicknessActive
  if ((toolSelectData.activeTool == 'huabi')) {
    canvasBox.freeDrawingBrush.color = item.key
  }
  if ((toolSelectData.activeTool == 'wenzi')) {
    textBox.fill = toolSelectData.lineColorActive
  }
}
//文字大小
const selectfontSize = (str) => {
  toolSelectData.fontSizeActive = str
  textBox.fontSize = toolSelectData.fontSizeActive
}
//选择图形
@@ -2480,14 +3203,190 @@
  toolSelectData.graphType = type
  switch (type) {
    case 'square':
      canvasBox.on('mouse:down', canvasMouseDown) // 鼠标在画布上按下
      canvasBox.on('mouse:up', canvasMouseUp)
      canvasBox.selectionBorderColor = toolSelectData.lineColorActive
      break
    case 'rotundity':
      canvasBox.on('mouse:down', canvasMouseDown) // 鼠标在画布上按下
      canvasBox.on('mouse:up', canvasMouseUp)
      canvasBox.on('mouse:move', canvasMouseMove)
      break
    case 'triangle':
      canvasBox.on('mouse:down', canvasMouseDown) // 鼠标在画布上按下
      canvasBox.on('mouse:up', canvasMouseUp)
      canvasBox.on('mouse:move', canvasMouseMove)
      break
    case 'lineSegment':
      canvasBox.on('mouse:down', canvasMouseDown) // 鼠标在画布上按下
      canvasBox.on('mouse:move', canvasMouseMove) // 鼠标在画布上移动
      canvasBox.on('mouse:up', canvasMouseUp)
      break
  }
}
let downPoint = null // 鼠标按下的坐标
let upPoint = null
let currentCircle = null // 临时圆,创建圆的时候使用
let currentTriangle = null // 临时三角形
let currentLine = null // 临时线段
function canvasOnMouseDownDel(opt) {
  // 右键,且在元素上右键
  // button: 1-左键;2-中键;3-右键
  // 在画布上右键,target 为 null
  if (opt.button === 1 && opt.target) {
    // 获取当前元素
    activeElBox = opt.target
  }
}
// 鼠标在画布上按下
function canvasMouseDown(e) {
  downPoint = e.absolutePointer
  if (toolSelectData.graphType === 'rotundity') {
    currentCircle = new fabric.Circle({
      top: downPoint.y,
      left: downPoint.x,
      radius: 0,
      fill: 'transparent',
      stroke: toolSelectData.lineColorActive
    })
    canvasBox.add(currentCircle)
  }
  if (toolSelectData.graphType === 'triangle') {
    currentTriangle = new fabric.Triangle({
      top: downPoint.y,
      left: downPoint.x,
      width: 0,
      height: 0,
      fill: 'transparent',
      stroke: toolSelectData.lineColorActive
    })
    canvasBox.add(currentTriangle)
  }
  if (toolSelectData.graphType === 'lineSegment') {
    currentLine = new fabric.Line(
      [
        downPoint.x,
        downPoint.y, // 起始点坐标
        downPoint.x,
        downPoint.y // 结束点坐标
      ],
      {
        stroke: toolSelectData.lineColorActive // 笔触颜色
      }
    )
    canvasBox.add(currentLine)
  }
}
// 鼠标在画布上松开
function canvasMouseUp(e) {
  if (toolSelectData.graphType === 'square') {
    // 创建矩形
    createRect(e.absolutePointer)
  }
  if (toolSelectData.graphType === 'rotundity') {
    if (JSON.stringify(downPoint) === JSON.stringify(upPoint)) {
      canvasBox.remove(currentCircle)
    } else {
      if (currentCircle) {
        currentCircle.set('stroke', toolSelectData.lineColorActive)
      }
    }
    currentCircle = null
  }
  if (toolSelectData.graphType === 'triangle') {
    if (JSON.stringify(downPoint) === JSON.stringify(upPoint)) {
      canvasBox.remove(currentTriangle)
    } else {
      currentTriangle.set('stroke', toolSelectData.lineColorActive)
    }
    currentTriangle = null
  }
  if (toolSelectData.graphType === 'lineSegment') {
    if (JSON.stringify(downPoint) === JSON.stringify(upPoint)) {
      canvasBox.remove(currentLine)
    } else {
      currentLine.set('stroke', toolSelectData.lineColorActive)
    }
    currentLine = null
  }
}
// 创建矩形
function createRect(pointer) {
  // 点击事件,不生成矩形
  if (JSON.stringify(downPoint) === JSON.stringify(pointer)) {
    return
  }
  // 创建矩形
  // 矩形参数计算
  let top = Math.min(downPoint.y, pointer.y)
  let left = Math.min(downPoint.x, pointer.x)
  let width = Math.abs(downPoint.x - pointer.x)
  let height = Math.abs(downPoint.y - pointer.y)
  // 矩形对象
  const rect = new fabric.Rect({
    top,
    left,
    width,
    height,
    fill: 'transparent',
    stroke: toolSelectData.lineColorActive
  })
  // 将矩形添加到画布上
  canvasBox.add(rect)
  downPoint = null
}
// 鼠标在画布上移动
function canvasMouseMove(e) {
  if (toolSelectData.graphType === 'rotundity' && currentCircle) {
    const currentPoint = e.absolutePointer
    let radius =
      Math.min(Math.abs(downPoint.x - currentPoint.x), Math.abs(downPoint.y - currentPoint.y)) / 2
    let top = currentPoint.y > downPoint.y ? downPoint.y : downPoint.y - radius * 2
    let left = currentPoint.x > downPoint.x ? downPoint.x : downPoint.x - radius * 2
    currentCircle.set('radius', radius)
    currentCircle.set('top', top)
    currentCircle.set('left', left)
    canvasBox.requestRenderAll()
  }
  if (toolSelectData.graphType === 'triangle' && currentTriangle) {
    const currentPoint = e.absolutePointer
    let width = Math.abs(downPoint.x - currentPoint.x)
    let height = Math.abs(downPoint.y - currentPoint.y)
    let top = currentPoint.y > downPoint.y ? downPoint.y : currentPoint.y
    let left = currentPoint.x > downPoint.x ? downPoint.x : currentPoint.x
    currentTriangle.set('width', width)
    currentTriangle.set('height', height)
    currentTriangle.set('top', top)
    currentTriangle.set('left', left)
    canvasBox.requestRenderAll()
  }
  if (toolSelectData.graphType === 'lineSegment' && currentLine) {
    const currentPoint = e.absolutePointer
    currentLine.set('x2', currentPoint.x)
    currentLine.set('y2', currentPoint.y)
    canvasBox.requestRenderAll()
  }
}
//白板关闭
const whiteBoardClose = () => {
  whiteBoard.value = false
  floatingToolData.activeToolData = ''
}
//标记显示隐藏
const labelShow = (str) => {
@@ -2517,77 +3416,116 @@
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(() => {})
  }
}
//跳转
const goReMark = (item) => {
  console.log(item)
  if (window.qiankunState && window.qiankunState.gotoPage) {
    window.qiankunState.gotoPage(Number(item.chapterNum), Number(item.page))
  }
@@ -2638,12 +3576,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) => {
@@ -2653,7 +3610,6 @@
}
//取消回调
const closeFn = (base64: any) => {
  console.log(base64)
  floatingToolData.activeToolData = ''
}
//保存截图
@@ -2708,34 +3664,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) => {
@@ -2800,7 +3775,7 @@
///内容选中
const getSelection = (data) => {
  if (data.txt && token) {
  if (data.txt) {
    toolActive.value = ''
    dialogToolData.txt = data.txt
    dialogToolData.page = data.page
@@ -2873,56 +3848,74 @@
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)
        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
        break
      case '百科':
        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 +3929,273 @@
}
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))
            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')
      }
      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(() => {})
  }
}
//正文中删除高亮,划线,笔记操作框
@@ -3200,13 +4248,11 @@
  document.addEventListener('mousemove', function (event) {
    var x = event.offsetX
    var y = event.offsetY
    // console.log('鼠标坐标位置:', x, y)
    noteContent.top = event.clientY + 20
    noteContent.left = event.clientX
  })
}
window.noteOut = (type) => {
  console.log(type, 123)
  noteContent.show = false
}
@@ -3256,7 +4302,6 @@
//笔记跳转
const jumpContent = (item) => {
  console.log(item)
  if (window.qiankunState && window.qiankunState.gotoPage) {
    window.qiankunState.gotoPage(Number(item.chapterNum), Number(item.page))
  }
@@ -3264,7 +4309,6 @@
//菜单笔记编辑
const update = (item) => {
  console.log(item)
  dialogToolData.chapter = item.chapterNum
  noteColorActive.value = item.color
  formData.id = item.id
@@ -3275,7 +4319,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
    }
@@ -3347,13 +4391,11 @@
        }
      ])
      .then((res) => {
        console.log(res[0][0], 'cid')
        if (res.length > 0 && res[0].length > 0) {
          res[0].map((item) => {
            item.trans = JSON.parse(item.trans)
          })
          dictionaryData.data = res[0][0]
          console.log(dictionaryData.data, '14')
          dictionaryData.showContent = true
        }
      })
@@ -3423,12 +4465,54 @@
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'
    })
  }
}
const formulaDialog = ref(false)
const openFormulaDialog = () => {
  formulaDialog.value = true
}
// 番茄钟移动
const isMove = ref<boolean>(false)
const position = reactive({x:100,y:100})
const dragOffset = reactive({x:0,y:0})
const mouseDown = (e: MouseEvent) => {
  isMove.value = true
  dragOffset.x = e.clientX - position.x
  dragOffset.y = e.clientY - position.y
  document.addEventListener('mousemove', mouseMove)
  document.addEventListener('mouseup', mouseUp)
}
const mouseUp = (e: MouseEvent) => {
  isMove.value = false
  document.removeEventListener('mousemove', mouseMove)
  document.removeEventListener('mouseup', mouseUp)
}
const mouseMove = (e: MouseEvent) => {
  if (isMove.value) {
    position.x = e.clientX - dragOffset.x
    position.y = e.clientY - dragOffset.y
  }
}
</script>
@@ -3451,15 +4535,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 +4554,7 @@
        border-right: 1px solid #e0e0e0;
        color: #2c2c2c;
      }
      .layout {
        width: 69px;
        height: 30px;
@@ -3478,11 +4566,13 @@
      }
    }
  }
  .contentBox {
    overflow: hidden;
    flex: 1;
    display: flex;
    position: relative;
    .menuBox {
      width: 80px;
      flex-shrink: 0;
@@ -3496,14 +4586,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 +4595,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 +4632,9 @@
        text-align: center;
      }
    }
    .menuContent {
      // position: relative;
      width: 300px;
      flex-shrink: 0;
      height: calc(100vh - 48px);
@@ -3552,6 +4643,7 @@
      -moz-user-select: none;
      -khtml-user-select: none;
      user-select: none;
      .searchBox {
        width: 100%;
        height: 60px;
@@ -3561,22 +4653,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 +4684,19 @@
            height: 18px;
            font-size: 12px;
          }
          .activeClassify,
          .classifyItem:hover {
            .title {
              color: #0093ff;
            }
            .count {
              background: #0093ff;
              color: #fff;
            }
          }
          .showSearch {
            .imgBox {
              width: 39px;
@@ -3604,17 +4704,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 +4725,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 +4748,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 +4768,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 +4835,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 +4860,13 @@
              align-items: center;
              justify-content: center;
              position: relative;
              img {
                height: 100%;
                width: 100%;
                object-fit: contain;
              }
              .handleBox {
                position: absolute;
                top: 0;
@@ -3757,11 +4876,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 +4898,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 +4926,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 +4940,7 @@
                }
              }
            }
            // .capture {
            //   width: 100%;
            // }
@@ -3836,22 +4964,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 +4996,7 @@
                margin-left: 5px;
              }
            }
            .chapter {
              color: #b7b7b7;
              margin: 5px 5px 5px 14px;
@@ -3876,10 +5009,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 +5024,17 @@
            }
          }
        }
        .chapterName {
          margin: 15px;
          display: flex;
          align-items: center;
          span {
            margin-left: 5px;
          }
        }
        .reMarkItem {
          margin: 15px;
          background: #fff;
@@ -3904,13 +5042,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 +5054,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 +5075,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 +5092,51 @@
              -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 {
        height: 83%;
      }
      .question-bottom {
        position: absolute;
        bottom: 0;
        display: flex;
        justify-content: space-evenly;
        width: 300px;
        padding: 20px 0;
        background-color: #fff;
        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 +5148,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 +5159,7 @@
      flex: 1;
      font-size: 16px;
      position: relative;
      .pageBox-header {
        height: 57px;
        padding: 0 20px;
@@ -3991,6 +5168,7 @@
        z-index: 99;
        align-items: center;
        justify-content: space-between;
        .classTime {
          display: flex;
          align-items: center;
@@ -3998,6 +5176,7 @@
          border-radius: 20px 20px 20px 20px;
          color: #0093ff;
          padding: 8px;
          .qureIcon {
            width: 9px;
            height: 9px;
@@ -4006,16 +5185,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 +5208,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 +5235,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%;
@@ -4072,8 +5264,36 @@
          z-index: 96;
          background: rgba(255, 255, 255, 0.2);
        }
        .watch-box {
          display: flex;
          align-items: center;
          position: absolute;
          background-color: #555;
          color: #fff;
          padding: 10px;
          border-radius: 5px;
          width: max-content;
          p {
            cursor: move;
            padding: 0 8px;
            font-size: 18px;
            border-radius: 4px;
            margin-right: 10px;
            background-color: #666;
          }
          span {
            cursor: pointer;
            border-right: 1px solid #fff;
            padding: 0 4px;
            font-size: 14px;
            &:last-child {
              border-right: none;
            }
          }
        }
      }
    }
    .toolBox {
      position: relative;
      box-shadow: -3px 0px 6px 1px rgba(0, 0, 0, 0.07);
@@ -4082,15 +5302,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,11 +5317,13 @@
          border-radius: 3px 3px 0px 0px;
        }
      }
      .menu {
        padding-top: 20px;
        li > div {
          // height: 50px;
          padding: 10px 36px;
          padding: 10px 36px 10px 25px;
          font-size: 16px;
          display: flex;
          align-items: center;
@@ -4120,6 +5340,7 @@
          }
        }
      }
      .openBox {
        width: 25px;
        height: 25px;
@@ -4138,22 +5359,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 +5387,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 +5404,7 @@
              border-radius: 5px;
              border: 2px solid #cfcfcf;
            }
            .typeActive {
              text-align: center;
              color: #0093ff;
@@ -4184,6 +5414,7 @@
              background: rgba(0, 147, 255, 0.13);
            }
          }
          .giveLessons {
            color: #0093ff;
            width: 90px;
@@ -4194,6 +5425,7 @@
            display: flex;
            align-items: center;
            justify-content: center;
            span {
              margin-left: 10px;
            }
@@ -4214,9 +5446,7 @@
      border-radius: 10px;
      padding: 6px;
      overflow: hidden;
      .notClick {
        pointer-events: none;
      }
      .floatToolItem {
        margin: 10px 0;
        height: 30px;
@@ -4226,11 +5456,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 +5478,12 @@
            margin: auto;
          }
        }
        .text {
          margin-right: 5px;
        }
      }
      .floatToolItem:hover,
      .floatToolActive {
        background-color: rgba(255, 255, 255, 0.3);
@@ -4268,10 +5502,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 +5518,7 @@
          align-items: center;
          // flex: 1;
          font-size: 14px;
          .imgBox {
            height: 18px;
            width: 18px;
@@ -4289,9 +5526,11 @@
            margin: 0 auto;
          }
        }
        .floatToolItem:hover {
          background-color: rgba(44, 44, 44, 0.2);
        }
        .layOutTool {
          height: 20px;
          margin-right: 5px;
@@ -4303,6 +5542,7 @@
    .dialogToolBox {
      position: fixed;
      z-index: 2;
      .toolSelectBox {
        height: 40px;
        display: flex;
@@ -4312,6 +5552,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 +5563,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 +5578,7 @@
        }
      }
    }
    .colorSelectBox {
      padding: 5px 10px;
      width: 190px;
@@ -4344,8 +5588,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 +5606,7 @@
    }
  }
}
.lineDeleteBox {
  position: fixed;
  z-index: 2;
@@ -4369,6 +5616,7 @@
  background-color: rgba(90, 90, 90, 0.9);
  border-radius: 5px;
  display: flex;
  .dialogToolItem {
    padding: 3px;
    margin: 0 5px;
@@ -4377,10 +5625,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 +5638,7 @@
  padding: 10px;
  border-radius: 5px;
}
.dictionaryDataBox {
  position: fixed;
  z-index: 2;
@@ -4395,9 +5646,11 @@
  padding: 5px 20px;
  background: #fff;
  border-radius: 5px;
  .word {
    font-weight: bold;
  }
  .phone_con {
    .per-phone {
      align-items: center;
@@ -4411,38 +5664,56 @@
      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: 82vh;
  padding:20px;
  iframe {
    width: 100%;
    height: 100%;
  }
}
.whiteBoardBox {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  background-color: rgba(2, 2, 2, 0.3);
}
.myDialogs,
@@ -4469,38 +5740,48 @@
    top: 0px !important;
    right: 0px !important;
  }
  .el-dialog__body {
    padding: 20px !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,24 +5794,50 @@
    }
  }
}
.videoBox {
  text-align: center;
  video {
    width: 100%;
  }
}
.audioBox {
  // display:none;
}
.wordBox {
  height: 600px;
  width: 100%;
  overflow-y: scroll;
  img {
    display: block;
    margin: 0 auto;
    width: 90%;
    height: auto;
    box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.1);
    object-fit: contain;
  }
}
.imgUrlBox {
  width: 100%;
  text-align: center;
  img {
    width: 100%;
  }
}
.voice-reader {
  position: absolute;
  bottom: 30px;
  left: 50px;
}
.iframe-box {
  width: 100%;
  height: 800px;
}
</style>