6 Commits 750437dec4 ... f5a7d89168

Author SHA1 Message Date
  lsc f5a7d89168 style(lang/hk): 移除繁体中文文案末尾多余的句号 1 month ago
  lsc c52bd92814 fix: 修复快速操作按钮交互逻辑并补全页面跳转延迟处理 1 month ago
  lsc 57f0f54ee5 refactor: 优化批量互动工具相关逻辑与文案提示 1 month ago
  lsc 8126ed9945 fix(editor): 修复子页面切换显示异常问题,添加调试日志 1 month ago
  lsc 526ee6a385 fix(student page): remove userid parameter from iframe hash 1 month ago
  lsc 2ca4d4ebc8 fix: 为页面跳转链接添加userid查询参数 1 month ago

+ 12 - 9
src/components/CollapsibleToolbar/componets/aiChat.vue

@@ -30,7 +30,7 @@
           </div>
           <div class="coco-quick-list">
             <button type="button" class="coco-quick-action" v-if="cocoQuickTab === 'page'"
-              @click="sendQuickAction(lang.ssAiChatQuickAction3)">
+              @click="sendQuickAction(lang.ssAiChatQuickAction3, 1)">
               <span class="coco-quick-action-copy">
                 <span class="coco-quick-action-title">{{ lang.ssAiChatQuickGenChoicesTitle }}</span>
                 <span class="coco-quick-action-desc">{{ lang.ssAiChatQuickGenChoicesDesc }}</span>
@@ -45,7 +45,7 @@
             </button>
 
             <button type="button" class="coco-quick-action" v-if="cocoQuickTab === 'page'"
-              @click="sendQuickAction(lang.ssAiChatQuickAction4)">
+              @click="sendQuickAction(lang.ssAiChatQuickAction4, 1)">
               <span class="coco-quick-action-copy">
                 <span class="coco-quick-action-title">{{ lang.ssAiChatQuickGenWebTitle }}</span>
                 <span class="coco-quick-action-desc">{{ lang.ssAiChatQuickGenWebDesc }}</span>
@@ -59,7 +59,7 @@
               </span>
             </button>
             <button type="button" class="coco-quick-action" v-if="cocoQuickTab === 'course'"
-              @click="sendQuickAction(lang.ssAiChatQuickAction5)">
+              @click="sendQuickAction(lang.ssAiChatQuickAction5, 1)">
               <span class="coco-quick-action-copy">
                 <span class="coco-quick-action-title">{{ lang.ssAiChatQuickRecommendToolsTitle }}</span>
                 <span class="coco-quick-action-desc">{{ lang.ssAiChatQuickRecommendToolsDesc }}</span>
@@ -72,7 +72,7 @@
                 </svg>
               </span>
             </button>
-            <button type="button" class="coco-quick-action" v-if="cocoQuickTab === 'course'" @click="sendQuickAction(lang.ssBatchInteractiveWeb)">
+            <button type="button" class="coco-quick-action" v-if="cocoQuickTab === 'course'" @click="sendQuickAction(lang.ssBatchInteractiveWeb, 1)">
                 <span class="coco-quick-action-copy">
                     <span class="coco-quick-action-title">{{ lang.ssAiChatQuickBatchGenToolsTitle }}</span>
                     <span class="coco-quick-action-desc">{{ lang.ssAiChatQuickBatchGenToolsDesc }}</span>
@@ -434,8 +434,11 @@ const prevChatResult = () => {
   })
 }
 
-const sendQuickAction = (action: string) => {
+const sendQuickAction = (action: string, type: number = 2) => {
   inputText.value = action
+  if (type === 1) {
+    isQuickActions.value = []
+  }
   // sendMessage()
 }
 
@@ -795,7 +798,7 @@ const generate = (message: ChatMessage) => {
       gType.value = 'chat'
       setPageId(45, res).then(res => {
         const baseUrl = setUrl()
-        const url = `${baseUrl}/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${45}`
+        const url = `${baseUrl}/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${45}&userid=${props.userid || ''}`
         createSlide()
         createFrameElement(url, 45)
         message.gLoading = false
@@ -816,7 +819,7 @@ const generate = (message: ChatMessage) => {
       gType.value = 'chat'
       setPageId(15, res).then(res => {
         const baseUrl = setUrl()
-        const url = `${baseUrl}/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${15}`
+        const url = `${baseUrl}/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${15}&userid=${props.userid || ''}`
         createSlide()
         createFrameElement(url, 15)
         message.gLoading = false
@@ -837,7 +840,7 @@ const generate = (message: ChatMessage) => {
       gType.value = 'chat'
       setPageId(78, res).then(res => {
         const baseUrl = setUrl()
-        const url = `${baseUrl}/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${78}`
+        const url = `${baseUrl}/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${78}&userid=${props.userid || ''}`
         createSlide()
         createFrameElement(url, 78)
         message.gLoading = false
@@ -858,7 +861,7 @@ const generate = (message: ChatMessage) => {
       gType.value = 'chat'
       setPageId(79, res).then(res => {
         const baseUrl = setUrl()
-        const url = `${baseUrl}/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${79}`
+        const url = `${baseUrl}/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${79}&userid=${props.userid || ''}`
         createSlide()
         createFrameElement(url, 79)
         message.gLoading = false

+ 2 - 0
src/store/main.ts

@@ -219,6 +219,8 @@ export const useMainStore = defineStore('main', {
       this.showAIPPTDialog = show
     },
     setChildPageState(show: boolean, tools: any[], pageIndex: number) {
+      const slidesStore = useSlidesStore()
+      slidesStore.panAllToolsArray()
       this.childPageVisible = show
       this.childPageToolsArray = tools
       this.childPageIndex = pageIndex

+ 11 - 0
src/store/slides.ts

@@ -189,6 +189,7 @@ export const useSlidesStore = defineStore('slides', {
     },
   
     updateSlideIndex(index: number) {
+      this.panAllToolsArray()
       this.slideIndex = index
     },
   
@@ -230,5 +231,15 @@ export const useSlidesStore = defineStore('slides', {
       })
       this.slides[slideIndex].elements = (elements as PPTElement[])
     },
+    panAllToolsArray() {
+      this.slides.forEach(slide => {
+        if (slide.toolsArray) {
+          const allToolsSet = slide.toolsArray.every(t => t.isSet)
+          if (allToolsSet) {
+            slide.toolsArray = []
+          }
+        }
+      })
+    },
   },
 })

+ 13 - 1
src/views/Editor/Canvas/ChildPageDisplay.vue

@@ -175,7 +175,7 @@ const createTool = async (array: any[], tool: any, index: number) => {
   
   const pageId = await setPageId(type, res)
   const baseUrl = setUrl()
-  const url = `${baseUrl}/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${pageId}&type=${type}`
+  const url = `${baseUrl}/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${pageId}&type=${type}&userid=${userid.value || ''}`
   array[index].url = url
   setTool()
 }
@@ -235,17 +235,25 @@ const changeSlideIndex = (index: number) => {
 }
 // 保留工具
 const saveTool = (url: string, type: any, index: number) => {
+  console.log('保留工具')
+  
   createSlide()
   createFrameElement(url, type)
   changeSlideIndex(childPageIndex.value)
   toolsArray[index].isSet = true
   setTool()
+  setTimeout(() => {
+    changeSlideIndex(childPageIndex.value + 1)
+    setChildPageState(false, [], slideIndex.value || 0)
+  }, 100)
+  console.log('保留工具', toolsArray)
 }
 
 // 放弃工具
 const discardTool = (index: number) => {
   toolsArray[index].isSet = true
   setTool()
+  console.log('放弃工具', toolsArray)
 }
 
 // 保留所有工具
@@ -259,6 +267,10 @@ const keepAllTools = () => {
   })
   changeSlideIndex(childPageIndex.value)
   setTool()
+  setTimeout(() => {
+    changeSlideIndex(childPageIndex.value + 1)
+    setChildPageState(false, [], slideIndex.value || 0)
+  }, 100)
 }
 
 // 判断工具type

+ 13 - 4
src/views/Editor/Thumbnails/ThumbnailChildPage.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="thumbnail-child-page" @click="handleClick">
+  <div class="thumbnail-child-page" @click="handleClick" :class="{ 'active': slideIndexStore === props.slideIndex || 0 }">
     <div class="child-page-icon">
       <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
         <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
@@ -26,19 +26,24 @@ const props = defineProps<{
 const mainStore = useMainStore()
 const { setChildPageState } = mainStore
 const slidesStore = useSlidesStore()
-const { slideIndex } = storeToRefs(slidesStore)
+const { currentSlide, slideIndex: slideIndexStore } = storeToRefs(slidesStore)
 
 // 切换页面
 const changeSlideIndex = (index: number) => {
   mainStore.setActiveElementIdList([])
 
-  if (slideIndex.value === index) return
+  if (slideIndexStore.value === index) return
   slidesStore.updateSlideIndex(index)
 }
 
 const handleClick = () => {
+  if (slideIndexStore.value === props.slideIndex) return
+  console.log(props.slideIndex)
   changeSlideIndex(props.slideIndex || 0)
-  setChildPageState(true, props.toolsArray || [], props.slideIndex || 0)
+  setChildPageState(false, [], props.slideIndex || 0)
+  setTimeout(() => {
+    setChildPageState(true, props.toolsArray || [], props.slideIndex || 0)
+  }, 500)
 }
 
 // 计算待处理任务数量
@@ -62,6 +67,10 @@ const pendingCount = computed(() => {
   cursor: pointer;
   transition: all 0.2s;
 
+  &.active {
+    border-style: solid;
+  }
+
   &:hover {
     background-color: #fef3c7;
     border-style: solid;

+ 4 - 0
src/views/Student/index.vue

@@ -1646,6 +1646,10 @@ const elementDone = async (element: any, slideIndex: number) => {
         const parts = iframeSrc.split('#')
         baseUrl = parts[0]
         hashPart = parts[1]
+        // 去除hashPart中的userid参数
+        if (hashPart.includes('userid=')) {
+          hashPart = hashPart.replace(/[?&]userid=[^&]+/g, '').replace(/^&/, '?')
+        }
       }
 
       // 构建新的hash部分,添加参数

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

@@ -941,7 +941,7 @@
   "ssDiscard": "丢弃",
   "ssKeepAll": "保留全部",
   "ssUploadSuccess": "上传完成",
-  "ssBatchInteractiveWebConfirm": "是否需要为课件批量生成工具?",
+  "ssBatchInteractiveWebConfirm": "是否需要为课件批量生成工具(预计3-5分钟完成)?",
   "ssBatchInteractiveWebConfirmDesc": "是,立即添加",
   "ssBatchInteractiveWebConfirmDesc2": "暂不需要",
   "ssPendingCount": "待处理"

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

@@ -941,7 +941,7 @@
   "ssDiscard": "Discard",
   "ssKeepAll": "Keep All",
   "ssUploadSuccess": "Upload Success",
-  "ssBatchInteractiveWebConfirm": "Need to generate tools for the course?",
+  "ssBatchInteractiveWebConfirm": "Need to generate tools for the course (estimated 3-5 minutes)?",
   "ssBatchInteractiveWebConfirmDesc": "Yes, add now",
   "ssBatchInteractiveWebConfirmDesc2": "No",
   "ssPendingCount": "Pending Count"

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

@@ -901,8 +901,8 @@
   "ssImportAndSaveDesc": "導入為課件頁面,並同步保存到資源庫。",
   "ssReadingFile": "正在讀取文件...",
   "ssAiChatQuickAction3": "為當頁內容生成2道選擇題",
-  "ssAiChatQuickAction4": "為當頁生成互動網頁",
-  "ssAiChatQuickAction5": "為課件推薦適合的互動工具",
+  "ssAiChatQuickAction4": "為當頁生成互動網頁",
+  "ssAiChatQuickAction5": "為課件推薦適合的互動工具",
   "ssDragAndDropHint": "點擊或拖拽文件至此,或點擊選擇",
   "ssSupportHTML": "支持 HTML、HTM 格式",
   "ssPasteHTML": "請在此处粘貼完整的HTML代碼",
@@ -930,9 +930,9 @@
   "ssOpenWorkspace": "打開工作台",
   "ssInteractiveWebWorkspaceDesc": "點擊卡片進入工作台,確認互動網頁。",
   "ssBatchInteractiveWeb": "為課件批量生成互動工具",
-  "ssBatchInteractiveWebDesc": "已收到「新课程」的批量生成任务,正在读取资料来源...",
-  "ssBatchInteractiveWebDesc2": "工具待选区,请在底部待选区页面处理「保留/丢弃/全部保留」。",
-  "ssBatchInteractiveWebDesc3": "还存在未处理的待选区,请先处理待选区后再批量生成互动工具。",
+  "ssBatchInteractiveWebDesc": "已收到「新課程」的批量生成任務,正在讀取資料來源。",
+  "ssBatchInteractiveWebDesc2": "工具待選區,請在底部待選區頁面處理「保留/丟棄/全部保留」。",
+  "ssBatchInteractiveWebDesc3": "尚有未處理的待選區,請先處理待選區後再批量生成互動工具。",
   "ssChildPageLabel": "待選頁",
   "ssWaitSelection": "待選區",
   "ssWaitSelectionHint": "此位置有 {0} 個候選工具",
@@ -941,8 +941,8 @@
   "ssDiscard": "丟棄",
   "ssKeepAll": "保留全部",
   "ssUploadSuccess": "上傳成功",
-  "ssBatchInteractiveWebConfirm": "是否需要為課件批量生成工具?",
+  "ssBatchInteractiveWebConfirm": "是否需要為課件批量生成工具(預計3-5分鐘完成)?",
   "ssBatchInteractiveWebConfirmDesc": "是,立即添加",
-  "ssBatchInteractiveWebConfirmDesc2": "不需要添加",
-  "ssPendingCount": "待理"
+  "ssBatchInteractiveWebConfirmDesc2": "不需要添加",
+  "ssPendingCount": "待理"
 }