From 2887cde644b586ceff61201705a5c4bdfe7e2b31 Mon Sep 17 00:00:00 2001
From: litian <2804272236@qq.com>
Date: 星期四, 13 六月 2024 18:09:25 +0800
Subject: [PATCH] web

---
 src/views/readerPages/webHome.vue | 1444 ++++++++++++++++++++++++++++++++-------------------------
 1 files changed, 817 insertions(+), 627 deletions(-)

diff --git a/src/views/readerPages/webHome.vue b/src/views/readerPages/webHome.vue
index ab528dc..9e000d8 100644
--- a/src/views/readerPages/webHome.vue
+++ b/src/views/readerPages/webHome.vue
@@ -13,13 +13,12 @@
     <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 +93,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,11 +103,11 @@
               @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>
@@ -117,6 +116,17 @@
             <div class="tabItem hover" @click="selectResourceType('teacher')">
               <div>鏁欏笀璧勬簮</div>
               <div :class="resourceType == 'teacher' ? 'text' : 'line'"></div>
+            </div>
+          </div>
+          <div v-if="activeMenu == '涔犻'" class="resourceTab">
+            <div class="tabItem hover" @click="selectExercisesType('exercises')">
+              <div>涔犻</div>
+              <div :class="exercisesType == 'exercises' ? 'text' : 'line'"></div>
+            </div>
+            <hr class="hr" />
+            <div class="tabItem hover" @click="selectExercisesType('wrong')">
+              <div>閿欓鏈�</div>
+              <div :class="exercisesType == 'wrong' ? 'text' : 'line'"></div>
             </div>
           </div>
         </div>
@@ -133,7 +143,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 +150,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">
@@ -160,10 +170,19 @@
                   <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>
@@ -291,7 +310,7 @@
                 @clear="handleClear"
               >
                 <template #prefix>
-                  <img :src="listSearch" @click="searchBook" class="hover"/>
+                  <img :src="listSearch" @click="searchBook" class="hover" />
                 </template>
               </el-input>
             </div>
@@ -368,7 +387,7 @@
                                 item.resourceType == '闊抽' ||
                                 item.resourceType == '涔犻' ||
                                 item.resourceType == '鍥剧墖'
-                              )
+                              ) && item.isDownload == '鏄�'
                             "
                             ><Download
                           /></el-icon>
@@ -428,6 +447,40 @@
                 </div>
                 <div class="deleteReMarkImg">
                   <img :src="shanchu" class="icon hover" @click="deleteReMark(item)" />
+                </div>
+              </div>
+            </div>
+            <div v-else>
+              <el-empty :image-size="60" description="鏆傛棤鏁版嵁" />
+            </div>
+          </div>
+        </div>
+        <div class="questionList" v-if="activeMenu == '涔犻'">
+          <div class="resourceSearchBox">
+            <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="JumpPosition(item)"
+                  :title="item.resourceName"
+                >
+                  {{ item.resourceName }}
                 </div>
               </div>
             </div>
@@ -720,9 +773,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 +872,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"
@@ -1128,7 +1175,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref, reactive, watch, onMounted, onBeforeMount, inject } from 'vue'
+import { ref, reactive, watch, onMounted, onBeforeMount, onBeforeUnmount, inject } from 'vue'
 import { useRouter, useRoute } from 'vue-router'
 import useClipboard from 'vue-clipboard3'
 const { toClipboard } = useClipboard()
@@ -1270,7 +1317,6 @@
         window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
     })()
   }
-
   // 鍔犺浇寰簲鐢�
   microApp = loadMicroApp(microApps[localStorage.getItem('bookId')], {
     sandbox: {
@@ -1294,7 +1340,7 @@
 
   // 瀹氫箟鐖跺眰鏂规硶
   window.qiankunActions.setGlobalState({
-    state:1,
+    state: 1,
     disableSign: false,
     windowSelection: (data) => {
       // 缁戝畾瀛愬簲鐢ㄩ�夋嫨鐩戝惉浜嬩欢
@@ -1381,6 +1427,11 @@
   // }
 })
 
+onBeforeUnmount(() => {
+  if (microApp) {
+    microApp.unmount() // 鍗歌浇寰簲鐢�
+  }
+})
 // watch(
 //   () => screenWidth.value,
 //   (val) => {
@@ -1425,7 +1476,6 @@
       } else if (phoneInfo) {
         userInfo.value = {
           name: phoneInfo.credential
-
         }
         localStorage.setItem('userInfo', JSON.stringify(userInfo.value))
       }
@@ -1477,6 +1527,11 @@
       name: '涔︾',
       icon: biaoqian,
       isShow: bookConfig.value.textbookComponents.indexOf('CF2E1400') > -1
+    },
+    {
+      name: '涔犻',
+      icon: zhishitupu,
+      isShow: true
     }
   ]
   teachToolsMenuData = [
@@ -1692,233 +1747,202 @@
 const playIndex = ref(null) //闊抽鎾斁
 const audioPlayer = ref(null)
 const getResourceData = () => {
-  imgPreviewList.value = []
-  listLoading.value = true
-  axios
-    .get(bookConfig.value.resourceUrl + '/resource.json?t=12')
-    .then(function (response) {
-      var json = response.data
-      // 澶勭悊鑾峰彇鍒扮殑json鏁版嵁
-      if (json.length > 0) {
-        defaultResourceList.value = []
-        teacherResourceList.value = []
-        // 鑾峰彇鏁扮粍涓墍鏈夊璞$殑age灞炴�х殑鏁伴噺
-        json.forEach((item) => {
-          if (item.iconPath) {
-            item.icon = bookConfig.value.resourceUrl + '/' + item.iconPath
-          } else {
-            item.icon = ''
-          }
-          if (resourceType.value == 'default') {
-            if (item.isTeacherResource == '鍚�') {
-              defaultResourceList.value.push(item)
-            }
-          } else {
-            if (item.isTeacherResource == '鏄�') {
-              teacherResourceList.value.push(item)
-            }
-          }
-        })
-        if (defaultResourceList.value.length > 0) {
-          let imgCount = 0
-          let audioCount = 0
-          let videoCount = 0
-          let exercisesCount = 0
-          let otherCount = 0
-          resourceDataList.value = []
-          defaultResourceList.value.forEach((resItem) => {
-            if (resItem.resourceType == '鍥剧墖') {
-              if (resItem.resourcePath) {
-                resItem.resourcePath = bookConfig.value.resourceUrl + '/' + resItem.resourcePath
-              } else {
-                resItem.resourcePath =
-                  bookConfig.value.requestCtx + '/file/GetPreViewImage?md5=' + resItem.md5
-              }
-
-              imgPreviewList.value.push(resItem.resourcePath)
-              if (activeClassify.value == 'image') {
-                resourceDataList.value.push(resItem)
-              }
-              imgCount++
-            } else if (resItem.resourceType == '闊抽') {
-              if (activeClassify.value == 'audio') {
-                resourceDataList.value.push(resItem)
-              }
-              audioCount++
-            } else if (resItem.resourceType == '瑙嗛') {
-              if (activeClassify.value == 'video') {
-                resourceDataList.value.push(resItem)
-              }
-              videoCount++
-            } else if (resItem.resourceType == '涔犻') {
-              if (activeClassify.value == 'exercises') {
-                resourceDataList.value.push(resItem)
-              }
-              exercisesCount++
+  if (token) {
+    imgPreviewList.value = []
+    listLoading.value = true
+    axios
+      .get(bookConfig.value.resourceUrl + '/resource.json?t=12')
+      .then(function (response) {
+        var json = response.data
+        // 澶勭悊鑾峰彇鍒扮殑json鏁版嵁
+        if (json.length > 0) {
+          defaultResourceList.value = []
+          teacherResourceList.value = []
+          // 鑾峰彇鏁扮粍涓墍鏈夊璞$殑age灞炴�х殑鏁伴噺
+          json.forEach((item) => {
+            if (item.iconPath) {
+              item.icon = bookConfig.value.resourceUrl + '/' + item.iconPath
             } else {
-              if (activeClassify.value == 'other') {
-                resourceDataList.value.push(resItem)
+              item.icon = ''
+            }
+            if (resourceType.value == 'default') {
+              if (item.isTeacherResource == '鍚�') {
+                defaultResourceList.value.push(item)
               }
-              otherCount++
+            } else {
+              if (item.isTeacherResource == '鏄�') {
+                teacherResourceList.value.push(item)
+              }
             }
           })
-          classifySelectList.value = []
-          if (imgCount > 0) {
-            classifySelectList.value.push({
-              title: '鍥剧墖',
-              count: imgCount,
-              key: 'image'
-            })
-          }
-          if (audioCount > 0) {
-            classifySelectList.value.push({
-              title: '闊抽',
-              count: audioCount,
-              key: 'audio'
-            })
-          }
-          if (videoCount > 0) {
-            classifySelectList.value.push({
-              title: '瑙嗛',
-              count: videoCount,
-              key: 'video'
-            })
-          }
-          if (exercisesCount > 0) {
-            classifySelectList.value.push({
-              title: '涔犻',
-              count: exercisesCount,
-              key: 'exercises'
-            })
-          }
-          if (otherCount > 0) {
-            classifySelectList.value.push({
-              title: '鍏朵粬',
-              count: otherCount,
-              key: 'other'
-            })
-          }
-          if (!activeClassify.value) {
-            activeClassify.value = classifySelectList.value[0].key
-            defaultResourceList.value.forEach((resItem1) => {
-              if (resItem1.resourceType == classifySelectList.value[0].title) {
-                resourceDataList.value.push(resItem1)
-              }
-            })
-          }
-          // if(activeClassify.value == "video"){
-          //   resourceDataList.value.forEach((item,index)=>{
-          //     console.log(item,"item")
-          //     let video = document.createElement("video");
-          //     video.src = bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + item.md5;
-          //     const canvas = document.createElement('canvas')
-          //     canvas.width = 130
-          //     canvas.height = 80
-          //     const ctx:any = canvas.getContext('2d');
-          //     video.crossOrigin = 'anonymous' // 瑙e喅璺ㄥ煙闂锛屼篃灏辨槸鎻愮ず姹℃煋璧勬簮鏃犳硶杞崲瑙嗛
-          //     video.currentTime = 1 // 绗竴甯�
+          if (defaultResourceList.value.length > 0) {
+            let imgCount = 0
+            let audioCount = 0
+            let videoCount = 0
+            let exercisesCount = 0
+            let otherCount = 0
+            resourceDataList.value = []
+            defaultResourceList.value.forEach((resItem) => {
+              if (resItem.resourceType == '鍥剧墖') {
+                if (resItem.resourcePath) {
+                  resItem.resourcePath = bookConfig.value.resourceUrl + '/' + resItem.resourcePath
+                } else {
+                  resItem.resourcePath =
+                    bookConfig.value.requestCtx + '/file/GetPreViewImage?md5=' + resItem.md5
+                }
 
-          //     video.oncanplay = () => {  //瑙嗛鍑嗗鎾斁
-          //       ctx.drawImage(video, 0, 0, canvas.width, canvas.height)
-          //       item.icon = canvas.toDataURL("image/png");  //鑾峰彇base64鏍煎紡鐨勫浘鐗�
-          //     }
-          //   })
-
-          // }
-        } else {
-          let imgCount = 0
-          let audioCount = 0
-          let videoCount = 0
-          let exercisesCount = 0
-          let otherCount = 0
-          resourceDataList.value = []
-          teacherResourceList.value.forEach((resItem) => {
-            if (resItem.resourceType == '鍥剧墖') {
-              if (resItem.resourcePath) {
-                resItem.resourcePath = bookConfig.value.resourceUrl + '/' + resItem.resourcePath
+                imgPreviewList.value.push(resItem.resourcePath)
+                if (activeClassify.value == 'image') {
+                  resourceDataList.value.push(resItem)
+                }
+                imgCount++
+              } else if (resItem.resourceType == '闊抽') {
+                if (activeClassify.value == 'audio') {
+                  resourceDataList.value.push(resItem)
+                }
+                audioCount++
+              } else if (resItem.resourceType == '瑙嗛') {
+                if (activeClassify.value == 'video') {
+                  resourceDataList.value.push(resItem)
+                }
+                videoCount++
               } else {
-                resItem.resourcePath =
-                  bookConfig.value.requestCtx + '/file/GetPreViewImage?md5=' + resItem.md5
+                if (activeClassify.value == 'other') {
+                  resourceDataList.value.push(resItem)
+                }
+                otherCount++
               }
-              imgPreviewList.value.push(resItem.resourcePath)
-              if (activeClassify.value == 'image') {
-                resourceDataList.value.push(resItem)
-              }
-              imgCount++
-            } else if (resItem.resourceType == '闊抽') {
-              if (activeClassify.value == 'audio') {
-                resourceDataList.value.push(resItem)
-              }
-              audioCount++
-            } else if (resItem.resourceType == '瑙嗛') {
-              if (activeClassify.value == 'video') {
-                resourceDataList.value.push(resItem)
-              }
-              videoCount++
-            } else if (resItem.resourceType == '涔犻') {
-              if (activeClassify.value == 'exercises') {
-                resourceDataList.value.push(resItem)
-              }
-              exercisesCount++
-            } else {
-              if (activeClassify.value == 'other') {
-                resourceDataList.value.push(resItem)
-              }
-              otherCount++
+            })
+            classifySelectList.value = []
+            if (imgCount > 0) {
+              classifySelectList.value.push({
+                title: '鍥剧墖',
+                count: imgCount,
+                key: 'image'
+              })
             }
-          })
-          classifySelectList.value = []
-          if (imgCount > 0) {
-            classifySelectList.value.push({
-              title: '鍥剧墖',
-              count: imgCount,
-              key: 'image'
-            })
-          }
-          if (audioCount > 0) {
-            classifySelectList.value.push({
-              title: '闊抽',
-              count: audioCount,
-              key: 'audio'
-            })
-          }
-          if (videoCount > 0) {
-            classifySelectList.value.push({
-              title: '瑙嗛',
-              count: videoCount,
-              key: 'video'
-            })
-          }
-          if (exercisesCount > 0) {
-            classifySelectList.value.push({
-              title: '涔犻',
-              count: exercisesCount,
-              key: 'exercises'
-            })
-          }
-          if (otherCount > 0) {
-            classifySelectList.value.push({
-              title: '鍏朵粬',
-              count: otherCount,
-              key: 'other'
-            })
-          }
-          if (!activeClassify.value) {
-            activeClassify.value = classifySelectList.value[0].key
-            teacherResourceList.value.forEach((resItem1) => {
-              if (resItem1.resourceType == classifySelectList.value[0].title) {
-                resourceDataList.value.push(resItem1)
+            if (audioCount > 0) {
+              classifySelectList.value.push({
+                title: '闊抽',
+                count: audioCount,
+                key: 'audio'
+              })
+            }
+            if (videoCount > 0) {
+              classifySelectList.value.push({
+                title: '瑙嗛',
+                count: videoCount,
+                key: 'video'
+              })
+            }
+            if (otherCount > 0) {
+              classifySelectList.value.push({
+                title: '鍏朵粬',
+                count: otherCount,
+                key: 'other'
+              })
+            }
+            if (!activeClassify.value) {
+              activeClassify.value = classifySelectList.value[0].key
+              defaultResourceList.value.forEach((resItem1) => {
+                if (resItem1.resourceType == classifySelectList.value[0].title) {
+                  resourceDataList.value.push(resItem1)
+                }
+              })
+            }
+          } else {
+            let imgCount = 0
+            let audioCount = 0
+            let videoCount = 0
+            let exercisesCount = 0
+            let otherCount = 0
+            resourceDataList.value = []
+            teacherResourceList.value.forEach((resItem) => {
+              if (resItem.resourceType == '鍥剧墖') {
+                if (resItem.resourcePath) {
+                  resItem.resourcePath = bookConfig.value.resourceUrl + '/' + resItem.resourcePath
+                } else {
+                  resItem.resourcePath =
+                    bookConfig.value.requestCtx + '/file/GetPreViewImage?md5=' + resItem.md5
+                }
+                imgPreviewList.value.push(resItem.resourcePath)
+                if (activeClassify.value == 'image') {
+                  resourceDataList.value.push(resItem)
+                }
+                imgCount++
+              } else if (resItem.resourceType == '闊抽') {
+                if (activeClassify.value == 'audio') {
+                  resourceDataList.value.push(resItem)
+                }
+                audioCount++
+              } else if (resItem.resourceType == '瑙嗛') {
+                if (activeClassify.value == 'video') {
+                  resourceDataList.value.push(resItem)
+                }
+                videoCount++
+              } else {
+                if (activeClassify.value == 'other') {
+                  resourceDataList.value.push(resItem)
+                }
+                otherCount++
               }
             })
+            classifySelectList.value = []
+            if (imgCount > 0) {
+              classifySelectList.value.push({
+                title: '鍥剧墖',
+                count: imgCount,
+                key: 'image'
+              })
+            }
+            if (audioCount > 0) {
+              classifySelectList.value.push({
+                title: '闊抽',
+                count: audioCount,
+                key: 'audio'
+              })
+            }
+            if (videoCount > 0) {
+              classifySelectList.value.push({
+                title: '瑙嗛',
+                count: videoCount,
+                key: 'video'
+              })
+            }
+            if (otherCount > 0) {
+              classifySelectList.value.push({
+                title: '鍏朵粬',
+                count: otherCount,
+                key: 'other'
+              })
+            }
+            if (!activeClassify.value) {
+              activeClassify.value = classifySelectList.value[0].key
+              teacherResourceList.value.forEach((resItem1) => {
+                if (resItem1.resourceType == classifySelectList.value[0].title) {
+                  resourceDataList.value.push(resItem1)
+                }
+              })
+            }
           }
         }
-
-      }
-      listLoading.value = false
+        listLoading.value = false
+      })
+      .catch(function (error) {
+        console.log(error)
+      })
+  } else {
+    ElMessageBox.confirm('璇峰厛鐧诲綍锛�', {
+      confirmButtonText: '鍘荤櫥褰�',
+      cancelButtonText: '鍙栨秷',
+      autofocus: false,
+      type: 'warning'
     })
-    .catch(function (error) {
-      console.log(error)
-    })
+      .then(() => {
+        router.push('/login')
+      })
+      .catch(() => {})
+  }
 }
 //璧勬簮鎾斁瑙嗛
 const goPlay = (data, index) => {
@@ -1995,13 +2019,63 @@
   }
 }
 
+//涔犻
+const exercisesType = ref('exercises') //涔犻绫诲瀷
+const questionList = ref([])
+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
+    })
+  } else {
+    ElMessageBox.confirm('璇峰厛鐧诲綍锛�', {
+      confirmButtonText: '鍘荤櫥褰�',
+      cancelButtonText: '鍙栨秷',
+      autofocus: false,
+      type: 'warning'
+    })
+      .then(() => {
+        router.push('/login')
+      })
+      .catch(() => {})
+  }
+}
+const selectExercisesType = (type) => {
+  exercisesType.value = type
+  searchText.value = ''
+
+  if (type == 'exercises') {
+    getExercisesList()
+  } else {
+    questionList.value = []
+  }
+}
+
 // 閫変腑鑿滃崟
 const activeMenu = ref('鐩綍')
 
 // 鑿滃崟鐐瑰嚮
 const menuItemClick = (name) => {
   searchText.value = ''
-  allSearchReault.value =[]
+  allSearchReault.value = []
   if (menuState.open && activeMenu.value == name) {
     menuState.open = false
   } else {
@@ -2026,6 +2100,9 @@
       getReMarkList()
       break
     case '妫�绱�':
+      break
+    case '涔犻':
+      getExercisesList()
       break
   }
 }
@@ -2143,7 +2220,7 @@
 const allSearchReault = ref([])
 const searchReaultData = reactive({
   isShow: true,
-  openIndex: 0,
+  openIndex: 0
 })
 const searchBook = async () => {
   switch (activeMenu.value) {
@@ -2175,6 +2252,9 @@
       break
     case '涔︾':
       getReMarkList()
+      break
+    case '涔犻':
+      getExercisesList()
       break
     case '妫�绱�':
       listLoading.value = true
@@ -2214,7 +2294,6 @@
           console.log(allSearchReault.value, 444)
           listLoading.value = false
         }
-        
       }
       break
   }
@@ -2265,7 +2344,6 @@
 
 //妫�绱㈣烦杞�
 const goSearchContent = (item) => {
-  console.log(item,1111111111111111111111111111111111111111111111111111)
   if (window.qiankunState && window.qiankunState.gotoPage) {
     window.qiankunState.jumpSearchItem(item)
   }
@@ -2293,6 +2371,9 @@
     case '妫�绱�':
       allSearchReault.value = []
       break
+    case '涔犻':
+      getExercisesList()
+      break
   }
 }
 
@@ -2310,26 +2391,39 @@
 const resourceUrl = ref('')
 
 const selectTeachTools = (item) => {
-  activeTool.value = item.name
-  switch (item.name) {
-    case 'AI鏅鸿兘闂瓟':
-      wendaVisible.value = true
-      break
-    case 'GGB鍑芥暟宸ュ叿':
-      functionVisible.value = true
-      break
-    case '鎬濈淮瀵煎浘':
-      siweiVisble.value = true
-      break
-    case '妯″瀷宸ュ叿':
-      modelToolVisble.value = true
-      break
-    case '璇嶅吀':
-      cidianVisible.value = true
-      break
-    case '鐢熻瘝鍗$墖':
-      resourceUrl.value = bookConfig.value.resourceUrl
-      shengciVisble.value = true
+  if (token) {
+    activeTool.value = item.name
+    switch (item.name) {
+      case 'AI鏅鸿兘闂瓟':
+        wendaVisible.value = true
+        break
+      case 'GGB鍑芥暟宸ュ叿':
+        functionVisible.value = true
+        break
+      case '鎬濈淮瀵煎浘':
+        siweiVisble.value = true
+        break
+      case '妯″瀷宸ュ叿':
+        modelToolVisble.value = true
+        break
+      case '璇嶅吀':
+        cidianVisible.value = true
+        break
+      case '鐢熻瘝鍗$墖':
+        resourceUrl.value = bookConfig.value.resourceUrl
+        shengciVisble.value = true
+    }
+  } else {
+    ElMessageBox.confirm('璇峰厛鐧诲綍锛�', {
+      confirmButtonText: '鍘荤櫥褰�',
+      cancelButtonText: '鍙栨秷',
+      autofocus: false,
+      type: 'warning'
+    })
+      .then(() => {
+        router.push('/login')
+      })
+      .catch(() => {})
   }
 }
 
@@ -2392,7 +2486,7 @@
   console.log(floatingToolData.activeToolData, 'floatingToolData.activeToolData')
   if (floatingToolData.activeToolData == '鐢荤瑪') {
     floatingToolData.activeToolData = ''
-  }else {
+  } else {
     floatingToolData.activeToolData = item.name
   }
 
@@ -2405,11 +2499,10 @@
     case '鏍囪':
       break
     case '涔︾':
-      if(floatingToolData.activeBookmark != '涔︾' ){
+      if (floatingToolData.activeBookmark != '涔︾') {
         floatingToolData.activeBookmark = '涔︾'
         reMark()
       }
-      
       break
     case '鎴睆':
       jitT()
@@ -2517,72 +2610,100 @@
 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(() => {
+        router.push('/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(() => {
+        router.push('/login')
+      })
+      .catch(() => {})
+  }
 }
 
 //璺宠浆
@@ -2638,12 +2759,25 @@
 //鎴浘
 //鎴浘浜嬩欢
 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(() => {
+        router.push('/login')
+      })
+      .catch(() => {})
+  }
 }
 //纭鍥炶皟
 const callback = (val: any) => {
@@ -2708,34 +2842,47 @@
 }
 
 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(() => {
+        router.push('/login')
+      })
+      .catch(() => {})
+  }
 }
 //鏌ョ湅鎴浘
 const getCapture = (item, index) => {
@@ -2800,7 +2947,7 @@
 
 ///鍐呭閫変腑
 const getSelection = (data) => {
-  if (data.txt && token) {
+  if (data.txt) {
     toolActive.value = ''
     dialogToolData.txt = data.txt
     dialogToolData.page = data.page
@@ -2873,56 +3020,71 @@
 
 const synth = window.speechSynthesis
 const dialogToolHandle = async (item) => {
-  toolActive.value = item.name
-  colorActive.value = ''
-  switch (item.name) {
-    case 'AI闃呰':
-      window.speechSynthesis.cancel()
-      const synth = window.speechSynthesis
-      const utterance = new SpeechSynthesisUtterance(dialogToolData.txt)
-      console.log(utterance, 1)
-      utterance.lang = 'zh-CN' // 璁剧疆璇█涓轰腑鏂�
-      synth.speak(utterance)
-      showToolBox.value = false
-      break
-    case '鍒掔嚎':
-      break
-    case '楂樹寒':
-      break
-    case '绗旇':
-      formData.desc = ''
-      noteColorActive.value = '#F5E12A'
-      addNoteVisble.value = true
-      showToolBox.value = false
-      break
-    case '鏍囨敞':
-      break
-    case '澶嶅埗':
-      try {
-        //澶嶅埗
-        await toClipboard(dialogToolData.txt)
-        //涓嬮潰鍙互璁剧疆澶嶅埗鎴愬姛鐨勬彁绀烘绛夋搷浣�
-        ElMessage({
-          message: '澶嶅埗鎴愬姛',
-          type: 'success'
-        })
-      } catch (err) {
-        ElMessage.error('鏃犳硶澶嶅埗鏂囨湰锛�' + err)
-      }
-      showToolBox.value = false
-      toolActive.value = ''
-      break
-    case '璇嶅吀':
-      getSearchResult()
+  if (token) {
+    toolActive.value = item.name
+    colorActive.value = ''
+    switch (item.name) {
+      case 'AI闃呰':
+        window.speechSynthesis.cancel()
+        const synth = window.speechSynthesis
+        const utterance = new SpeechSynthesisUtterance(dialogToolData.txt)
+        console.log(utterance, 1)
+        utterance.lang = 'zh-CN' // 璁剧疆璇█涓轰腑鏂�
+        synth.speak(utterance)
+        showToolBox.value = false
+        break
+      case '鍒掔嚎':
+        break
+      case '楂樹寒':
+        break
+      case '绗旇':
+        formData.desc = ''
+        noteColorActive.value = '#F5E12A'
+        addNoteVisble.value = true
+        showToolBox.value = false
+        break
+      case '鏍囨敞':
+        break
+      case '澶嶅埗':
+        try {
+          //澶嶅埗
+          await toClipboard(dialogToolData.txt)
+          //涓嬮潰鍙互璁剧疆澶嶅埗鎴愬姛鐨勬彁绀烘绛夋搷浣�
+          ElMessage({
+            message: '澶嶅埗鎴愬姛',
+            type: 'success'
+          })
+        } catch (err) {
+          ElMessage.error('鏃犳硶澶嶅埗鏂囨湰锛�' + err)
+        }
+        showToolBox.value = false
+        toolActive.value = ''
+        break
+      case '璇嶅吀':
+        getSearchResult()
 
-      showToolBox.value = false
-      // cidianVisible.value = true
-      console.log(dialogToolData.txt)
-      break
-    case '鐧剧':
-      console.log('https://baike.baidu.com/item/' + dialogToolData.txt)
-      baiduVisible.value = true
-      break
+        showToolBox.value = false
+        // cidianVisible.value = true
+        console.log(dialogToolData.txt)
+        break
+      case '鐧剧':
+        console.log('https://baike.baidu.com/item/' + dialogToolData.txt)
+        baiduVisible.value = true
+        break
+    }
+  } else {
+    ElMessageBox.confirm('璇峰厛鐧诲綍锛�', {
+      confirmButtonText: '鍘荤櫥褰�',
+      cancelButtonText: '鍙栨秷',
+      autofocus: false,
+      type: 'warning'
+    })
+      .then(() => {
+        router.push('/login')
+      })
+      .catch(() => {
+        showToolBox.value = false
+      })
   }
 }
 
@@ -2936,218 +3098,257 @@
 }
 
 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(() => {
+        router.push('/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(() => {
+        router.push('/login')
+      })
+      .catch(() => {})
+  }
 }
 
 //鑿滃崟绗旇鍒楄〃
 const getNotesList = () => {
-  let chapterList = []
-  listLoading.value = true
-  catalogueData.value.forEach((item) => {
-    chapterList.push(item.chapter + '')
-  })
-  let uniqueArray = [...new Set(chapterList)]
-  scribeData.noteList = []
-  MG.identity
-    .getUserKey({
-      domain: 'notes-' + bookConfig.value.bookId,
-      keys: uniqueArray
+  if (token) {
+    let chapterList = []
+    listLoading.value = true
+    catalogueData.value.forEach((item) => {
+      chapterList.push(item.chapter + '')
     })
-    .then((res) => {
-      if (res && res.length > 0) {
-        for (let i = 0; i < res.length; i++) {
-          const item = res[i]
-          // 鍌ㄥ��
-          let data = catalogueData.value.find((item1) => item1.chapter == Number(item.key))
-          // console.log(data,'666')
-          let dataList = []
-          if (catalogueData.value.length > 0) {
-            catalogueData.value.forEach((item1) => {
-              if (item1.chapter == Number(item.key)) {
-                dataList.push(item1)
-              }
-            })
-          }
-          let labels = ''
-          if (dataList.length > 1) labels = dataList.map((item) => item.label).join('/')
+    let uniqueArray = [...new Set(chapterList)]
+    scribeData.noteList = []
+    MG.identity
+      .getUserKey({
+        domain: 'notes-' + bookConfig.value.bookId,
+        keys: uniqueArray
+      })
+      .then((res) => {
+        if (res && res.length > 0) {
+          for (let i = 0; i < res.length; i++) {
+            const item = res[i]
+            // 鍌ㄥ��
+            let data = catalogueData.value.find((item1) => item1.chapter == Number(item.key))
+            // console.log(data,'666')
+            let dataList = []
+            if (catalogueData.value.length > 0) {
+              catalogueData.value.forEach((item1) => {
+                if (item1.chapter == Number(item.key)) {
+                  dataList.push(item1)
+                }
+              })
+            }
+            let labels = ''
+            if (dataList.length > 1) labels = dataList.map((item) => item.label).join('/')
 
-          let list = JSON.parse(item.value)
-          let itemList = []
-          if (list.length > 0) {
-            list.forEach((item) => {
-              if (searchText.value) {
-                let text = searchText.value.replace(/^\s*|\s*$/g, '')
-                if (item.note.indexOf(text) > -1 || item.txt.indexOf(text) > -1) {
+            let list = JSON.parse(item.value)
+            let itemList = []
+            if (list.length > 0) {
+              list.forEach((item) => {
+                if (searchText.value) {
+                  let text = searchText.value.replace(/^\s*|\s*$/g, '')
+                  if (item.note.indexOf(text) > -1 || item.txt.indexOf(text) > -1) {
+                    if (menuState.notesColor == 'all') {
+                      itemList.push(item)
+                    } else if (item.color == menuState.notesColor) {
+                      itemList.push(item)
+                    }
+                  }
+                } else {
                   if (menuState.notesColor == 'all') {
                     itemList.push(item)
                   } else if (item.color == menuState.notesColor) {
                     itemList.push(item)
                   }
                 }
-              } else {
-                if (menuState.notesColor == 'all') {
-                  itemList.push(item)
-                } else if (item.color == menuState.notesColor) {
-                  itemList.push(item)
-                }
-              }
-            })
+              })
+            }
+            if (dataList[0].chapter == Number(item.key) && itemList.length > 0) {
+              scribeData.noteList.push({
+                chapter: dataList[0].chapter,
+                chapterName: labels ? labels : dataList[0].label,
+                noteList: itemList
+              })
+            }
           }
-          if (dataList[0].chapter == Number(item.key) && itemList.length > 0) {
-            scribeData.noteList.push({
-              chapter: dataList[0].chapter,
-              chapterName: labels ? labels : dataList[0].label,
-              noteList: itemList
-            })
-          }
+          console.log(scribeData.noteList, 'scribeData.noteList')
         }
-        console.log(scribeData.noteList, 'scribeData.noteList')
-      }
-      listLoading.value = false
+        listLoading.value = false
+      })
+  } else {
+    ElMessageBox.confirm('璇峰厛鐧诲綍锛�', {
+      confirmButtonText: '鍘荤櫥褰�',
+      cancelButtonText: '鍙栨秷',
+      autofocus: false,
+      type: 'warning'
     })
+      .then(() => {
+        router.push('/login')
+      })
+      .catch(() => {})
+  }
 }
 
 //姝f枃涓垹闄ら珮浜紝鍒掔嚎锛岀瑪璁版搷浣滄
@@ -3275,7 +3476,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
     }
@@ -3423,11 +3624,11 @@
 
 const layoutBtn = () => {
   localStorage.removeItem('token')
-  localStorage.removeItem("userInfo")
+  localStorage.removeItem('userInfo')
   router.push('/login')
 }
 const goLogin = () => {
-  localStorage.removeItem("userInfo")
+  localStorage.removeItem('userInfo')
   router.push('/login')
 }
 </script>
@@ -3496,14 +3697,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;
@@ -3905,11 +4099,6 @@
           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;
@@ -3923,9 +4112,14 @@
             display: flex;
             align-items: center;
           }
+          .questionCon {
+            width: 240px;
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+          }
         }
-       
-        
+
         .allSearchList {
           .searchItem {
             margin: 15px;
@@ -3933,13 +4127,12 @@
             border-radius: 10px;
             padding: 10px;
             display: flex;
-            .index{
+            .index {
               line-height: 24px;
-              margin-right:10px;
-
+              margin-right: 10px;
             }
             .searchCon {
-              flex:1;
+              flex: 1;
               width: 240px;
               overflow: hidden;
               margin-right: 8px;
@@ -3949,18 +4142,22 @@
               -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;
+      }
     }
     .menuStateBox {
       width: 25px;
@@ -4082,10 +4279,6 @@
       -moz-user-select: none;
       -khtml-user-select: none;
       user-select: none;
-      .notClick {
-        pointer-events: none;
-        color:#949494 !important;
-      }
       .toolTitle {
         height: 57px;
         line-height: 53px;
@@ -4214,9 +4407,6 @@
       border-radius: 10px;
       padding: 6px;
       overflow: hidden;
-      .notClick {
-        pointer-events: none;
-      }
       .floatToolItem {
         margin: 10px 0;
         height: 30px;

--
Gitblit v1.9.1