Преглед на файлове

fix: 修复多个UI问题和功能缺陷

修复AI聊天弹窗尺寸问题,调整语言提示文本
修正学生视图的布局和样式问题
优化画布工具和缩略图的交互体验
更新多语言文本翻译
调整视口大小计算逻辑
lsc преди 4 дни
родител
ревизия
41f64e92fe

+ 0 - 1
src/App.vue

@@ -91,7 +91,6 @@ const getInitialViewMode = () => {
   if (modeFromStorage) {
     return modeFromStorage
   }
-
   // 默认返回编辑模式
   return 'editor'
 }

+ 9 - 1
src/hooks/useImport.ts

@@ -1594,6 +1594,11 @@ export default () => {
     }
     const { cover, fixedViewport, signal, onclose } = { ...defaultOptions, ...options }
 
+    let isNone = false
+    if (slides.value.length === 1 && slides.value[0].elements.length === 0) {
+      isNone = true
+    }
+
     const file = files[0]
     if (!file) return
 
@@ -1642,7 +1647,10 @@ export default () => {
         ratio = 1000 / width // 固定视口宽度为 1000px
       }
       else {
-        slidesStore.setViewportSize(width * ratio) // 调整画布大小
+        const targetViewportSize = width * ratio
+        if (isNone || targetViewportSize > slidesStore.viewportSize) {
+          slidesStore.setViewportSize(targetViewportSize) // 调整画布大小
+        }
       }
 
       // 设置主题色

+ 2 - 2
src/tools/aiChat.ts

@@ -50,7 +50,7 @@ export const chat_no_stream = (msg: string, agentId: string, userId: string, lan
         : language === 'hk'
           ? 'Traditional Chinese'
           : 'Chinese'
-      } ${msg}`,
+      } ${msg} ${language === 'hk' ? '請用繁體中文回复' : language === 'en' ? 'Please reply in English' : '請用中文回复'}`,
       uid: uuidv4(),
       stream: false,
       model: agentData?.modelType || 'open-doubao',
@@ -115,7 +115,7 @@ export const chat_stream = async (
       : language === 'hk'
         ? 'Traditional Chinese'
         : 'Chinese'
-    } ${msg}`,
+    } ${msg}  ${language === 'hk' ? '請用繁體中文回复' : language === 'en' ? 'Please reply in English' : '請用中文回复'}`,
     uid: uuidv4(),
     stream: true,
     model: agentData?.modelType || 'open-doubao',

+ 2 - 1
src/utils/common.ts

@@ -13,7 +13,8 @@ export const fillDigit = (digit: number, len: number) => {
  * 判断设备
  */
 export const isPC = () => {
-  return !navigator.userAgent.match(/(iPhone|iPod|iPad|Android|Mobile|BlackBerry|Symbian|Windows Phone)/i)
+  // return !navigator.userAgent.match(/(iPhone|iPod|iPad|Android|Mobile|BlackBerry|Symbian|Windows Phone)/i)
+  return true
 }
 
 /**

+ 21 - 13
src/views/Editor/CanvasTool/index2.vue

@@ -18,7 +18,7 @@
             <span>{{ lang.ssQandA }}</span>
           </div>
         </template>
-        <div class="handler-item">
+        <div class="handler-item" :class="{active: toolVisible}">
           <span class="svg-icon">
             <svg v-if="frametype == 45" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
               <circle cx="12" cy="12" r="10" />
@@ -467,6 +467,18 @@ const editContent = (toolType: number) => {
   user-select: none;
 }
 
+.left-handler,
+.right-handler {
+  .handler-item {
+    padding: 0 15px;
+
+    &:not(.disable):hover,
+    &:not(.active):hover{
+      background-color: #f1f1f1;
+    }
+  }
+}
+
 .left-handler {
   display: flex;
   align-items: center;
@@ -483,7 +495,11 @@ const editContent = (toolType: number) => {
     }
 
     &.active {
-      color: $themeColor;
+      // color: $themeColor;
+      color: #000;
+      border: 1px solid #f59f4a;
+      background: #fef7ef !important;
+      font-weight: 600;
     }
 
     .icon {
@@ -513,17 +529,7 @@ const editContent = (toolType: number) => {
   }
 }
 
-.left-handler,
-.right-handler {
-  .handler-item {
-    padding: 0 15px;
 
-    &.active,
-    &:not(.disable):hover {
-      background-color: #f1f1f1;
-    }
-  }
-}
 
 .right-handler {
   display: flex;
@@ -568,7 +574,9 @@ const editContent = (toolType: number) => {
   }
 
   &:hover {
-    background-color: #f3f4f6;
+    // background-color: #f3f4f6;
+    background-color: #fff5e5;
+    color: #f89c46;
   }
 
   &+.popover-menu-item {

+ 3 - 3
src/views/Editor/Thumbnails/index2.vue

@@ -17,7 +17,7 @@
         <div class="select-btn"><IconDown /></div>
       </Popover> -->
     </div>
-
+    <!-- :disabled="editingSectionId" -->
     <Draggable 
       class="thumbnail-list"
       ref="thumbnailsRef"
@@ -25,7 +25,7 @@
       :animation="200"
       :scroll="true"
       :scrollSensitivity="50"
-      :disabled="editingSectionId"
+      :disabled="true"
       @end="handleDragEnd"
       itemKey="id"
     >
@@ -61,7 +61,7 @@
           >
             <div class="label" :class="{ 'offset-left': index >= 99 }">{{ fillDigit(index + 1, 2) }}</div>
             <ThumbnailSlide class="thumbnail" :slide="element" :size="120" :visible="index < slidesLoadLimit" />
-  
+
             <div class="note-flag" v-if="element.notes && element.notes.length" @click="openNotesPanel()">{{ element.notes.length }}</div>
           </div>
         </div>

+ 4 - 2
src/views/Student/components/aiChat.vue

@@ -664,8 +664,10 @@ onMounted(() => {
 
 .ai-chat-popup {
   position: absolute;
-  width: 400px;
-  height: 500px;
+  width: 40%;
+  height: 60%;
+  max-width: 400px;
+  max-height: 500px;
   background: #fffefa;
   display: flex;
   flex-direction: column;

+ 10 - 6
src/views/Student/index.vue

@@ -79,7 +79,7 @@
           top: isFullscreen ? '0' : `${(containerHeight - slideHeight * canvasScale) / 2}px`
         }" @mousemove="handleLaserMove">
           <div class="homework-check-box" v-if="currentSlideHasIframe && !currentSlideHasBilibiliVideo && props.type == '1'" v-show="currentSlideHasIframe" :style="{
-            top: isFullscreen ? '0' : `15px`
+            top: isFullscreen ? '0' : `0`
           }">
             <div class="homework-check-box-item" @click="openChoiceQuestionDetail2(slideIndex)" :class="{'active': !choiceQuestionDetailDialogOpenList.includes(slideIndex)}">
               <div class="homework-check-box-item-title">{{ lang.ssQuestion }}</div>
@@ -723,7 +723,7 @@ const calculateSlideSize = () => {
   const winWidth = slideWrapRef?.clientWidth || 0
   const winHeight = slideWrapRef?.clientHeight || 0
   const winWidth2 = slideWrapRef && typeof slideWrapRef.clientWidth === 'number' ? slideWrapRef.clientWidth - 40 : 0
-  const winHeight2 = slideWrapRef && typeof slideWrapRef.clientHeight === 'number' ? slideWrapRef.clientHeight - 85 : 0
+  const winHeight2 = slideWrapRef && typeof slideWrapRef.clientHeight === 'number' ? slideWrapRef.clientHeight - 60 - 65 - 10 : 0 // 底部栏 顶部高度 底部高度的
 
 
   // 根据视口比例计算最佳尺寸
@@ -1037,6 +1037,10 @@ watch(() => slideIndex.value, () => {
       writingBoardSyncBlackboard.value = null
       console.log('📝 当前幻灯片没有画图数据,隐藏画图工具')
     }
+
+    if (visibleAIChat.value) {
+      visibleAIChat.value = false
+    }
   }
 })
 
@@ -4827,7 +4831,7 @@ const clearTimerState = () => {
 .slide-list-wrap-n{
   border: 5px solid #595959;
   background: #000;
-  padding: 15px 0 0 0;
+  padding: 65px 0 0 0;
   box-sizing: border-box;
 }
 
@@ -5455,14 +5459,14 @@ const clearTimerState = () => {
 
 .homework-check-box {
   position: absolute;
-  top: 15px;
+  top: 0;
   left: 50%;
   transform: translate(-50%, 0);
   display: flex;
   align-items: center;
-  box-shadow: 0px 3px 4px 3px #f2f2f2;
+  // box-shadow: 0px 3px 4px 3px #f2f2f2;
   padding: 8px;
-  border-radius: 5px;
+  border-radius: 0 0 5px 5px;
   background: #fff;
   z-index: 999;
 

+ 1 - 1
src/views/lang/cn.json

@@ -692,7 +692,7 @@
   "ssImageTextPage": "图文页",
   "ssUploadPPT": "上传PPT",
   "ssAddInteractiveTool": "添加互动工具",
-  "ssSelectToolCreateInteractive": "选择工具创建互动面",
+  "ssSelectToolCreateInteractive": "选择工具创建互动面",
   "ssAddAIApp": "添加AI应用",
   "ssAppCenter": "应用中心",
   "ssCreateApp": "创建应用",

+ 1 - 1
src/views/lang/en.json

@@ -692,7 +692,7 @@
   "ssImageTextPage": "Image Text Page",
   "ssUploadPPT": "Upload PPT",
   "ssAddInteractiveTool": "Add Interactive Tool",
-  "ssSelectToolCreateInteractive": "Select tool to create interactive screen",
+  "ssSelectToolCreateInteractive": "Select tool to create interactive page",
   "ssAddAIApp": "Add AI Application",
   "ssAppCenter": "App Center",
   "ssCreateApp": "Create App",

+ 4 - 4
src/views/lang/hk.json

@@ -49,7 +49,7 @@
   "ssSectName": "輸入節名稱",
   "ssUntitledSec": "無標題節",
   "ssDefSec": "預設節",
-  "ssSlidePage": "投影片",
+  "ssSlidePage": "頁碼為",
   "ssStyle": "樣式",
   "ssSymbol": "符號",
   "ssPosition": "位置",
@@ -659,8 +659,8 @@
   "ssCreateFromAI": "從AI創建",
   "ssAIGenerateContent": "AI自動生成完整教學內容",
   "ssComingSoon": "待上線",
-  "ssUploadLocalFile": "上本地文件",
-  "ssUploadPPTFile": "上傳本地PPT文件並解析",
+  "ssUploadLocalFile": "上本地文件",
+  "ssUploadPPTFile": "上載本地Slides並解析",
   "ssImportFromLibrary": "從資源庫導入",
   "ssSelectExistingContent": "選擇已有的課程資源",
   "ssCreateBlank": "創建空白",
@@ -692,7 +692,7 @@
   "ssImageTextPage": "圖文頁",
   "ssUploadPPT": "上傳PPT",
   "ssAddInteractiveTool": "添加互動工具",
-  "ssSelectToolCreateInteractive": "選擇工具創建互動面",
+  "ssSelectToolCreateInteractive": "選擇工具創建互動面",
   "ssAddAIApp": "添加AI應用",
   "ssAppCenter": "應用中心",
   "ssCreateApp": "創建應用",