fix(Embedded Management): The page embed style is incorrect

This commit is contained in:
dataeaseShu
2025-09-02 18:04:57 +08:00
parent eee92862c2
commit f35b5af455
+14 -3
View File
@@ -16,12 +16,14 @@ import { nextTick, onBeforeMount, onBeforeUnmount, reactive, ref } from 'vue'
import { useRoute } from 'vue-router'
import { assistantApi } from '@/api/assistant'
import { useAssistantStore } from '@/stores/assistant'
import { useAppearanceStoreWithOut } from '@/stores/appearance'
import { useI18n } from 'vue-i18n'
import { request } from '@/utils/request'
import { setCurrentColor } from '@/utils/utils'
const { t } = useI18n()
const chatRef = ref()
const appearanceStore = useAppearanceStoreWithOut()
const assistantStore = useAssistantStore()
assistantStore.setPageEmbedded(true)
const route = useRoute()
@@ -96,9 +98,7 @@ const registerReady = (assistantId: any) => {
}
const setPageCustomColor = (val: any) => {
const selector =
dynamicType.value === 4 ? '.sqlbot--embedded-page' : '.sqlbot-embedded-assistant-page'
const ele = document.querySelector(selector) as HTMLElement
const ele = document.querySelector('body') as HTMLElement
setCurrentColor(val, ele)
}
@@ -158,6 +158,17 @@ onBeforeMount(async () => {
}
}
if (!rawData.theme) {
const { customColor, themeColor } = appearanceStore
const currentColor =
themeColor === 'custom' && customColor
? customColor
: themeColor === 'blue'
? '#3370ff'
: '#1CBA90'
customSet.theme = currentColor || customSet.theme
}
nextTick(() => {
setPageCustomColor(customSet.theme)
})