Merge pull request #10946 from dataease/pr@dev-v2@refactor_ai

refactor(工作台): Ai助手显示优化
This commit is contained in:
王嘉豪 2024-07-12 18:52:55 +08:00 committed by GitHub
commit e0be96c899
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 8 deletions

View File

@ -46,3 +46,5 @@ CREATE TABLE `core_copilot_config` (
INSERT INTO `core_copilot_config` VALUES (1, 'https://copilot-demo.test.fit2cloud.dev:5000', 'xlab', 'Q2Fsb25nQDIwMTU='); INSERT INTO `core_copilot_config` VALUES (1, 'https://copilot-demo.test.fit2cloud.dev:5000', 'xlab', 'Q2Fsb25nQDIwMTU=');
UPDATE `core_sys_setting` SET `pkey` = 'ai.baseUrl', `pval` = 'https://maxkb.fit2cloud.com/ui/chat/2ddd8b594ce09dbb?mode=embed', `type` = 'text', `sort` = 0 WHERE `id` = 3;

View File

@ -46,3 +46,5 @@ CREATE TABLE `core_copilot_config` (
INSERT INTO `core_copilot_config` VALUES (1, 'https://copilot-demo.test.fit2cloud.dev:5000', 'xlab', 'Q2Fsb25nQDIwMTU='); INSERT INTO `core_copilot_config` VALUES (1, 'https://copilot-demo.test.fit2cloud.dev:5000', 'xlab', 'Q2Fsb25nQDIwMTU=');
UPDATE `core_sys_setting` SET `pkey` = 'ai.baseUrl', `pval` = 'https://maxkb.fit2cloud.com/ui/chat/2ddd8b594ce09dbb?mode=embed', `type` = 'text', `sort` = 0 WHERE `id` = 3;

View File

@ -26,7 +26,7 @@ const { push } = useRouter()
const route = useRoute() const route = useRoute()
import { useCache } from '@/hooks/web/useCache' import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache('localStorage') const { wsCache } = useCache('localStorage')
const aiBaseUrl = ref(null) const aiBaseUrl = ref('https://maxkb.fit2cloud.com/ui/chat/2ddd8b594ce09dbb?mode=embed')
const handleIconClick = () => { const handleIconClick = () => {
if (route.path === '/workbranch/index') return if (route.path === '/workbranch/index') return
push('/workbranch/index') push('/workbranch/index')
@ -56,7 +56,7 @@ const downloadClick = params => {
const routers: any[] = formatRoute(permissionStore.getRoutersNotHidden as AppCustomRouteRecordRaw[]) const routers: any[] = formatRoute(permissionStore.getRoutersNotHidden as AppCustomRouteRecordRaw[])
const showSystem = ref(false) const showSystem = ref(false)
const showToolbox = ref(false) const showToolbox = ref(false)
const showOverlay = ref(true) const showOverlay = ref(false)
const showOverlayCopilot = ref(true) const showOverlayCopilot = ref(true)
const handleSelect = (index: string) => { const handleSelect = (index: string) => {
// //
@ -76,16 +76,18 @@ const navigateBg = computed(() => appearanceStore.getNavigateBg)
const navigate = computed(() => appearanceStore.getNavigate) const navigate = computed(() => appearanceStore.getNavigate)
const initAiBase = async () => { const initAiBase = async () => {
const aiTipsCheck = wsCache.get('DE-AI-TIPS-CHECK') // const aiTipsCheck = wsCache.get('DE-AI-TIPS-CHECK')
if (aiTipsCheck === 'CHECKED') { // if (aiTipsCheck === 'CHECKED') {
showOverlay.value = false // showOverlay.value = false
} else { // } else {
showOverlay.value = true // showOverlay.value = true
} // }
await findBaseParams().then(rsp => { await findBaseParams().then(rsp => {
const params = rsp.data const params = rsp.data
if (params && params['ai.baseUrl']) { if (params && params['ai.baseUrl']) {
aiBaseUrl.value = params['ai.baseUrl'] aiBaseUrl.value = params['ai.baseUrl']
} else {
aiBaseUrl.value = null
} }
}) })
} }