diff --git a/src/renderer/src/assets/iconfont/iconfont.css b/src/renderer/src/assets/iconfont/iconfont.css index f5b0135..824b283 100644 --- a/src/renderer/src/assets/iconfont/iconfont.css +++ b/src/renderer/src/assets/iconfont/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 4723712 */ - src: url('iconfont.woff2?t=1737434703828') format('woff2'), - url('iconfont.woff?t=1737434703828') format('woff'), - url('iconfont.ttf?t=1737434703828') format('truetype'); + src: url('iconfont.woff2?t=1739948469020') format('woff2'), + url('iconfont.woff?t=1739948469020') format('woff'), + url('iconfont.ttf?t=1739948469020') format('truetype'); } .iconfont { @@ -13,6 +13,10 @@ -moz-osx-font-smoothing: grayscale; } +.icon-zhongxinshiyang:before { + content: "\e67b"; +} + .icon-siweidaotu:before { content: "\e606"; } diff --git a/src/renderer/src/assets/iconfont/iconfont.js b/src/renderer/src/assets/iconfont/iconfont.js index e577454..7fe4074 100644 --- a/src/renderer/src/assets/iconfont/iconfont.js +++ b/src/renderer/src/assets/iconfont/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_4723712='',(l=>{var h=(c=(c=document.getElementsByTagName("script"))[c.length-1]).getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var a,v,i,t,z,p=function(h,c){c.parentNode.insertBefore(h,c)};if(h&&!l.__iconfont__svg__cssinject__){l.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(h){console&&console.log(h)}}a=function(){var h,c=document.createElement("div");c.innerHTML=l._iconfont_svg_string_4723712,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(h=document.body).firstChild?p(c,h.firstChild):h.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(a,0):(v=function(){document.removeEventListener("DOMContentLoaded",v,!1),a()},document.addEventListener("DOMContentLoaded",v,!1)):document.attachEvent&&(i=a,t=l.document,z=!1,o(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,M())})}function M(){z||(z=!0,i())}function o(){try{t.documentElement.doScroll("left")}catch(h){return void setTimeout(o,50)}M()}})(window); \ No newline at end of file +window._iconfont_svg_string_4723712='',(l=>{var h=(c=(c=document.getElementsByTagName("script"))[c.length-1]).getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var a,v,i,t,z,p=function(h,c){c.parentNode.insertBefore(h,c)};if(h&&!l.__iconfont__svg__cssinject__){l.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(h){console&&console.log(h)}}a=function(){var h,c=document.createElement("div");c.innerHTML=l._iconfont_svg_string_4723712,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(h=document.body).firstChild?p(c,h.firstChild):h.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(a,0):(v=function(){document.removeEventListener("DOMContentLoaded",v,!1),a()},document.addEventListener("DOMContentLoaded",v,!1)):document.attachEvent&&(i=a,t=l.document,z=!1,o(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,M())})}function M(){z||(z=!0,i())}function o(){try{t.documentElement.doScroll("left")}catch(h){return void setTimeout(o,50)}M()}})(window); \ No newline at end of file diff --git a/src/renderer/src/assets/iconfont/iconfont.json b/src/renderer/src/assets/iconfont/iconfont.json index a9fb8c3..b3561c9 100644 --- a/src/renderer/src/assets/iconfont/iconfont.json +++ b/src/renderer/src/assets/iconfont/iconfont.json @@ -5,6 +5,13 @@ "css_prefix_text": "icon-", "description": "", "glyphs": [ + { + "icon_id": "4320365", + "name": "重新试样", + "font_class": "zhongxinshiyang", + "unicode": "e67b", + "unicode_decimal": 59003 + }, { "icon_id": "11685410", "name": "思维导图", diff --git a/src/renderer/src/assets/iconfont/iconfont.ttf b/src/renderer/src/assets/iconfont/iconfont.ttf index c1e8344..b733c22 100644 Binary files a/src/renderer/src/assets/iconfont/iconfont.ttf and b/src/renderer/src/assets/iconfont/iconfont.ttf differ diff --git a/src/renderer/src/assets/iconfont/iconfont.woff b/src/renderer/src/assets/iconfont/iconfont.woff index 90fadd5..53f1031 100644 Binary files a/src/renderer/src/assets/iconfont/iconfont.woff and b/src/renderer/src/assets/iconfont/iconfont.woff differ diff --git a/src/renderer/src/assets/iconfont/iconfont.woff2 b/src/renderer/src/assets/iconfont/iconfont.woff2 index aba6643..74643b4 100644 Binary files a/src/renderer/src/assets/iconfont/iconfont.woff2 and b/src/renderer/src/assets/iconfont/iconfont.woff2 differ diff --git a/src/renderer/src/components/template-study/container/right.vue b/src/renderer/src/components/template-study/container/right.vue index cd42072..6d5b0e0 100644 --- a/src/renderer/src/components/template-study/container/right.vue +++ b/src/renderer/src/components/template-study/container/right.vue @@ -69,7 +69,7 @@
- + 重新研读 @@ -223,17 +223,28 @@ const handleScroll = (index) => { const container = document.querySelector('.container-right-list'); if(isAgain.value){ scrollToTmp(index) + // const item = messageElements.value[index] + // item.scrollIntoView({ behavior: 'smooth', block: 'end' }) } else{ if (container) { - // 平滑滚动到底部 - requestAnimationFrame(() => { - container.scrollTo({ - top: container.scrollHeight, - behavior: 'smooth', + if(index == 0){ + const item = messageElements.value[index] + if(item.clientHeight > outerContainer.value.clientHeight ){ + item.scrollIntoView({ behavior: 'smooth', block: 'end' }) + } + } + else{ + // 平滑滚动到底部 + requestAnimationFrame(() => { + container.scrollTo({ + top: container.scrollHeight, + behavior: 'smooth', + }); }); - }); + } + } } @@ -242,24 +253,29 @@ const handleScroll = (index) => { } -const tmpViewHeight = container.clientHeight +// const tmpViewContainer = document.querySelector('.container-right-list') const scrollToTmp = (index) =>{ - const container = document.querySelector('.container-right-list'); - - - - const beforHeight = messageElements.value.slice(0, index + 1).reduce((sum, item) => sum + item.clientHeight, 0); - console.log(beforHeight,'beforHeight', viewHeight) - if(beforHeight > tmpViewHeight){ - container.scrollTo({ - top: beforHeight - tmpViewHeight, - behavior: 'smooth', - }); - } - - const item = messageElements.value[index] - // console.log(item.scrollTop, item.offsetHeight) - + + const now = Date.now(); + if (now - lastScrollTime >= scrollInterval) { + // 最后一个 滚到底部 + if(index == childTempList.value.length - 1){ + console.log(outerContainer.value.scrollHeight) + requestAnimationFrame(() => { + outerContainer.value.scrollTo({ + top: outerContainer.value.scrollHeight, + behavior: 'smooth', + }); + }); + } + else{ + const item = messageElements.value[index] + if(item.clientHeight > outerContainer.value.clientHeight ){ + item.scrollIntoView({ behavior: 'smooth', block: 'end' }) + } + } + lastScrollTime = now; + } } // 打字机完成后触发 @@ -356,7 +372,7 @@ const againResult = async (index, item) => { isAgain.value = true childTempList.value[index].answer = '' childTempList.value[index].showTypewriter = true - + return // 滚动到该项的位置 if (messageElements.value[index]) { messageElements.value[index].scrollIntoView({ @@ -647,14 +663,15 @@ onUnmounted(() => { .iconfont { margin-right: 3px; + font-size: 18px; } :deep(.el-button) { - font-size: 13px; + font-size: 14px; } - .icon-ai1 { - font-size: 18px; + .icon-zhongxinshiyang { + font-size: 20px; } } }