lsc 10 jam lalu
induk
melakukan
57a0639066

+ 27 - 11
src/views/Editor/CanvasTool/index2.vue

@@ -70,7 +70,7 @@
           </svg>
           </svg>
         </div>
         </div>
       </Popover>
       </Popover>
-      <!-- 工具iframe字号缩放:比例1~24,每±1对应字号±1px,初始16px -->
+      <!-- 工具iframe字号缩放:初始100%,每±1对应±20% -->
       <div class="handler-item font-scale-ctrl" v-if="hasInteractiveTool">
       <div class="handler-item font-scale-ctrl" v-if="hasInteractiveTool">
         <span class="scale-btn" :class="{ disable: fontScale <= MIN_FONT_SCALE }" @click="changeFontScale(-1)">
         <span class="scale-btn" :class="{ disable: fontScale <= MIN_FONT_SCALE }" @click="changeFontScale(-1)">
           <svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
           <svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
@@ -78,7 +78,8 @@
             <line x1="5" y1="12" x2="19" y2="12" />
             <line x1="5" y1="12" x2="19" y2="12" />
           </svg>
           </svg>
         </span>
         </span>
-        <span class="scale-value">{{ fontScale }}</span>
+        <span class="scale-label">{{ lang.ssFontScale }}</span>
+        <span class="scale-value">{{ fontScalePercent }}%</span>
         <span class="scale-btn" :class="{ disable: fontScale >= MAX_FONT_SCALE }" @click="changeFontScale(1)">
         <span class="scale-btn" :class="{ disable: fontScale >= MAX_FONT_SCALE }" @click="changeFontScale(1)">
           <svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
           <svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
             stroke-linecap="round">
             stroke-linecap="round">
@@ -152,7 +153,7 @@
           <span>{{ lang.ssShape }}</span>
           <span>{{ lang.ssShape }}</span>
         </div>
         </div>
       </Popover>
       </Popover>
-      <RichTextBase  v-if="handleElement?.type == 'text'"/>
+      <RichTextBase  v-if="handleElement?.type == 'text' || handleElement?.type == 'shape'"/>
       <div style="display: flex; align-items: center;" v-if="handleElement?.type == 'shape'">
       <div style="display: flex; align-items: center;" v-if="handleElement?.type == 'shape'">
         <Select 
         <Select 
           style="flex: 1;" 
           style="flex: 1;" 
@@ -358,21 +359,28 @@ const hasInteractiveTool = computed(() => {
   return elements.some((el: any) => el.type === 'frame' && toolTypeArray.value.includes(el.toolType))
   return elements.some((el: any) => el.type === 'frame' && toolTypeArray.value.includes(el.toolType))
 })
 })
 
 
-// 工具iframe字号缩放:比例最小1最大24,每±1对应字号±1px,初始16px
-const MIN_FONT_SCALE = 1
-const MAX_FONT_SCALE = 24
+// 工具iframe字号缩放:初始100%,每±1对应±20%,sessionStorage 同会话内保持,重新进入课程清空
+const MIN_FONT_SCALE = -3 // 40%
+const MAX_FONT_SCALE = 5 // 200%
 const BASE_FONT_SIZE = 16
 const BASE_FONT_SIZE = 16
-const fontScale = ref(1)
+const STORAGE_KEY = 'toolIframeFontScale'
+const fontScale = ref(parseInt(sessionStorage.getItem(STORAGE_KEY) || '0', 10))
+const fontScalePercent = computed(() => 100 + fontScale.value * 20)
 
 
 const setToolIframeFontSize = () => {
 const setToolIframeFontSize = () => {
   try {
   try {
     const iframe = document.getElementsByTagName('iframe')[0] as HTMLIFrameElement | undefined
     const iframe = document.getElementsByTagName('iframe')[0] as HTMLIFrameElement | undefined
     const iframeDoc = iframe?.contentWindow?.document
     const iframeDoc = iframe?.contentWindow?.document
     if (iframeDoc?.documentElement) {
     if (iframeDoc?.documentElement) {
-      iframeDoc.documentElement.style.fontSize = `${BASE_FONT_SIZE + fontScale.value - 1}px`
+      const fontSize = BASE_FONT_SIZE * (1 + fontScale.value * 0.2)
+      console.log(fontSize)
+      
+      iframeDoc.documentElement.style.fontSize = `${fontSize}px`
     }
     }
   }
   }
   catch (error) {
   catch (error) {
+    const fontSize = BASE_FONT_SIZE * (1 + fontScale.value * 0.2)
+    console.log(fontSize)
     console.warn('设置iframe字号失败:', error)
     console.warn('设置iframe字号失败:', error)
   }
   }
 }
 }
@@ -381,12 +389,15 @@ const changeFontScale = (delta: number) => {
   const next = fontScale.value + delta
   const next = fontScale.value + delta
   if (next < MIN_FONT_SCALE || next > MAX_FONT_SCALE) return
   if (next < MIN_FONT_SCALE || next > MAX_FONT_SCALE) return
   fontScale.value = next
   fontScale.value = next
+  sessionStorage.setItem(STORAGE_KEY, String(next))
   setToolIframeFontSize()
   setToolIframeFontSize()
 }
 }
 
 
-// 切换页码时重置缩放比例回1
-watch(slideIndex, () => {
-  fontScale.value = 1
+// iframe 加载后应用持久化的缩放比例
+watch(hasInteractiveTool, (val) => {
+  if (val) {
+    setTimeout(() => setToolIframeFontSize(), 500)
+  }
 })
 })
 
 
 const iframeLabel = computed(() => {
 const iframeLabel = computed(() => {
@@ -802,6 +813,11 @@ const updateGradientColors = (color: string) => {
     }
     }
   }
   }
 
 
+  .scale-label {
+    font-size: 13px;
+    color: #6b7280;
+  }
+
   .scale-value {
   .scale-value {
     min-width: 20px;
     min-width: 20px;
     text-align: center;
     text-align: center;

+ 15 - 3
src/views/Student/components/DialoguePanel.vue

@@ -184,11 +184,13 @@ import { lang } from '@/main'
 interface Props {
 interface Props {
   courseid?: string | null
   courseid?: string | null
   userid?: string | null
   userid?: string | null
+  fileid?: string | ''
 }
 }
 
 
 const props = withDefaults(defineProps<Props>(), {
 const props = withDefaults(defineProps<Props>(), {
   courseid: null,
   courseid: null,
   userid: null,
   userid: null,
+  fileid: '',
 })
 })
 
 
 interface Message {
 interface Message {
@@ -284,8 +286,9 @@ const sendMessage = () => {
     message: userInput,
     message: userInput,
     userId: props.userid,
     userId: props.userid,
     // model: node.properties.item.modelType,
     // model: node.properties.item.modelType,
-    model: 'qwen3.5-flash',
-    file_ids: [],
+    // model: 'qwen3.5-flash',
+    model: agentData.value.modelType,
+    file_ids: [props.fileid],
     sound_url: '',
     sound_url: '',
     temperature: 0.2,
     temperature: 0.2,
     top_p: 1,
     top_p: 1,
@@ -547,6 +550,8 @@ onMounted(() => {
           margin-top: 5px;
           margin-top: 5px;
           display: flex;
           display: flex;
           flex-direction: column;
           flex-direction: column;
+          overflow: hidden;
+
           .dp_ml_i_m_ma_name{
           .dp_ml_i_m_ma_name{
             max-width: 100%;
             max-width: 100%;
             overflow: hidden;
             overflow: hidden;
@@ -558,12 +563,19 @@ onMounted(() => {
             margin-bottom: 5px;
             margin-bottom: 5px;
           }
           }
           .dp_ml_i_m_ma_textBlok{
           .dp_ml_i_m_ma_textBlok{
-            width: fit-content;
+            max-width: 100%;
             display: block;
             display: block;
             background-color: #F8F9FA;
             background-color: #F8F9FA;
             padding: 10px;
             padding: 10px;
             border: solid 1px #E9ECEF;
             border: solid 1px #E9ECEF;
             border-radius: 4px;
             border-radius: 4px;
+            box-sizing: border-box;
+
+            * {
+              word-break: break-word;
+              white-space: unset;
+            }
+
             &>svg{
             &>svg{
               width: 17px;
               width: 17px;
               height: 17px;
               height: 17px;

+ 1 - 1
src/views/Student/index.vue

@@ -350,7 +350,7 @@
         
         
         <!-- 对话区内容 -->
         <!-- 对话区内容 -->
         <div v-show="!workPanelCollapsed && rightPanelMode === 'dialogue'" class="panel-content">
         <div v-show="!workPanelCollapsed && rightPanelMode === 'dialogue'" class="panel-content">
-          <DialoguePanel :userid="props.userid" :courseid="props.courseid"/>
+          <DialoguePanel :userid="props.userid" :courseid="props.courseid" :fileid="pptJsonFileid"/>
         </div>
         </div>
         
         
         <!-- 选择题统计内容 -->
         <!-- 选择题统计内容 -->

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

@@ -502,6 +502,7 @@
   "ssResetPoster": "重置封面",
   "ssResetPoster": "重置封面",
   "ssBgFillTit": "背景填充",
   "ssBgFillTit": "背景填充",
   "ssBgContain": "缩放",
   "ssBgContain": "缩放",
+  "ssFontScale": "缩放",
   "ssBgRepeat": "拼贴",
   "ssBgRepeat": "拼贴",
   "ssBgCover": "缩放铺满",
   "ssBgCover": "缩放铺满",
   "ssApplyBgAll": "应用背景到全部",
   "ssApplyBgAll": "应用背景到全部",

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

@@ -503,6 +503,7 @@
   "ssResetPoster": "Reset poster",
   "ssResetPoster": "Reset poster",
   "ssBgFillTit": "Background fill",
   "ssBgFillTit": "Background fill",
   "ssBgContain": "Contain",
   "ssBgContain": "Contain",
+  "ssFontScale": "Scale",
   "ssBgRepeat": "Tile",
   "ssBgRepeat": "Tile",
   "ssBgCover": "Cover",
   "ssBgCover": "Cover",
   "ssApplyBgAll": "Apply background to all",
   "ssApplyBgAll": "Apply background to all",

+ 1 - 0
src/views/lang/hk.json

@@ -503,6 +503,7 @@
   "ssResetPoster": "重置封面",
   "ssResetPoster": "重置封面",
   "ssBgFillTit": "背景填充",
   "ssBgFillTit": "背景填充",
   "ssBgContain": "縮放",
   "ssBgContain": "縮放",
+  "ssFontScale": "縮放",
   "ssBgRepeat": "拼貼",
   "ssBgRepeat": "拼貼",
   "ssBgCover": "縮放鋪滿",
   "ssBgCover": "縮放鋪滿",
   "ssApplyBgAll": "應用背景到全部",
   "ssApplyBgAll": "應用背景到全部",