mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
fix(Embedded Management): The page embed style is incorrect
This commit is contained in:
@@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user