From 672cb7dd34b2afbed3ccf3fb363ce9cd928e8e37 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:48:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B5=8C=E5=85=A5?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E8=BF=87=E5=A4=A7=E6=8C=87=E5=BC=95=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E9=94=99=E8=AF=AF=20(#1802)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/application/template/embed.js | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/apps/application/template/embed.js b/apps/application/template/embed.js index f75b590a4..ec85ed540 100644 --- a/apps/application/template/embed.js +++ b/apps/application/template/embed.js @@ -67,6 +67,20 @@ const initChat=(root)=>{ const chat_button_img=root.querySelector('.maxkb-chat-button > img') // 对话框元素 const chat_container=root.querySelector('#maxkb-chat-container') + // 引导层 + const mask_content = root.querySelector('.maxkb-mask > .maxkb-content') + const mask_tips = root.querySelector('.maxkb-tips') + chat_button_img.onload=(event)=>{ + if(mask_content){ + mask_content.style.width = chat_button_img.width + 'px' + mask_content.style.height = chat_button_img.height + 'px' + if('{{x_type}}'=='left'){ + mask_tips.style.marginLeft = (chat_button_img.naturalWidth>500?500:chat_button_img.naturalWidth)-64 + 'px' + }else{ + mask_tips.style.marginRight = (chat_button_img.naturalWidth>500?500:chat_button_img.naturalWidth)-64 + 'px' + } + } + } const viewport=root.querySelector('.maxkb-openviewport') const closeviewport=root.querySelector('.maxkb-closeviewport') @@ -90,17 +104,16 @@ const initChat=(root)=>{ } const drag=(e)=>{ if (['touchmove','touchstart'].includes(e.type)) { - chat_button.style.top=(e.touches[0].clientY-25)+'px' - chat_button.style.left=(e.touches[0].clientX-25)+'px' + chat_button.style.top=(e.touches[0].clientY-chat_button_img.naturalHeight/2)+'px' + chat_button.style.left=(e.touches[0].clientX-chat_button_img.naturalWidth/2)+'px' } else { - chat_button.style.top=(e.y-25)+'px' - chat_button.style.left=(e.x-25)+'px' + chat_button.style.top=(e.y-chat_button_img.naturalHeight/2)+'px' + chat_button.style.left=(e.x-chat_button_img.naturalWidth/2)+'px' } chat_button.style.width =chat_button_img.naturalWidth+'px' chat_button.style.height =chat_button_img.naturalHeight+'px' } if({{is_draggable}}){ - console.dir(chat_button_img) chat_button.addEventListener("drag",drag) chat_button.addEventListener("dragover",(e)=>{ e.preventDefault() @@ -155,7 +168,7 @@ function initMaxkbStyle(root){ #maxkb .maxkb-mask { position: fixed; - z-index: 999; + z-index: 10001; background-color: transparent; height: 100%; width: 100%; @@ -242,8 +255,6 @@ function initMaxkbStyle(root){ {{x_type}}: {{x_value}}px; {{y_type}}: {{y_value}}px; cursor: pointer; - max-height:500px; - max-width:500px; z-index:10000; } #maxkb #maxkb-chat-container{ @@ -306,4 +317,4 @@ function embedChatbot() { initMaxkb() } else console.error('invalid parameter') } -window.onload = embedChatbot +window.addEventListener('load',embedChatbot) From adad526a4f1900c8170e6586544a2305b10773ce Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 10 Dec 2024 15:44:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1050151 --user=王孝刚 【应用】演示界面、全屏嵌入、浮窗嵌入历史记录和对话日志中不显示上传的图片 https://www.tapd.cn/57709429/s/1627628 --- .../component/question-content/index.vue | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/ui/src/components/ai-chat/component/question-content/index.vue b/ui/src/components/ai-chat/component/question-content/index.vue index 4c851fd2b..b4ccc362e 100644 --- a/ui/src/components/ai-chat/component/question-content/index.vue +++ b/ui/src/components/ai-chat/component/question-content/index.vue @@ -20,7 +20,10 @@