diff --git a/.env.loc b/.env.loc index 539cae6..dc60f36 100644 --- a/.env.loc +++ b/.env.loc @@ -2,7 +2,7 @@ VITE_ENV = 'loc' # 主域名 -VITE_HOST = 'https://test.gitcode.net' +VITE_HOST = 'http://124.223.71.235:8080' # 接口地址 VITE_API_HOST = 'https://test.gitcode.net' @@ -26,7 +26,7 @@ VITE_CSDN_URL = 'https://test.gitcode.net/oauth/login/csdn' VITE_ORG_COMMUNITY = 'https://test.gitcode.net' # 静态资源域名 -VITE_STATIC_HOST = 'https://test.gitcode.net' +VITE_STATIC_HOST = 'http://124.223.71.235:8080' # 主页搜索子应用 VITE_CHILD_HOMEWEB_HOST = 'https://local.gitcode.net:8001/child/homeweb-app' @@ -36,3 +36,5 @@ VITE_USER_CENTER_HOST = 'https://local.gitcode.net:8002' # ai-copilot 子应用 VITE_COPILOT_HOST = 'https://local.gitcode.net:8003/child/aichat-app' + +VITE_BASE_URL=/openRepoPortal/ diff --git a/package.json b/package.json index 1727d36..f9bbbc4 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "build:test": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode test", "build:pre": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode pre", "build:prod": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode production", + "build:loc": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode loc", "analysis": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode analysis", "preview": "vite preview", "type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false", diff --git a/src/assets/imgs/jyh/ai/icon_generate.png b/src/assets/imgs/jyh/ai/icon_generate.png new file mode 100644 index 0000000..0029e9d Binary files /dev/null and b/src/assets/imgs/jyh/ai/icon_generate.png differ diff --git a/src/assets/imgs/jyh/ai/icon_skgc.png b/src/assets/imgs/jyh/ai/icon_skgc.png new file mode 100644 index 0000000..8f4bf10 Binary files /dev/null and b/src/assets/imgs/jyh/ai/icon_skgc.png differ diff --git a/src/views/Jyh/AI/Home/GuessYouWantToAsk.vue b/src/views/Jyh/AI/Home/GuessYouWantToAsk.vue index 939397a..b2f6a51 100644 --- a/src/views/Jyh/AI/Home/GuessYouWantToAsk.vue +++ b/src/views/Jyh/AI/Home/GuessYouWantToAsk.vue @@ -11,7 +11,7 @@
-
@@ -21,6 +21,8 @@ + + diff --git a/src/views/Jyh/AI/Home/index.vue b/src/views/Jyh/AI/Home/index.vue index cc9a5a6..3dc46ba 100644 --- a/src/views/Jyh/AI/Home/index.vue +++ b/src/views/Jyh/AI/Home/index.vue @@ -3,17 +3,51 @@
@@ -31,20 +65,20 @@
- +
- -
+ + + + + + + + +
@@ -98,6 +132,7 @@ import { ref, defineComponent, nextTick, onMounted } from 'vue'; import { introPrompt, simplePrompt, mockAnswer, guessQuestions } from './mock.constants'; import SwiperComponent from './SwiperComponent.vue'; import GuessYouWantToAsk from './GuessYouWantToAsk.vue'; +import OssList from './components/OssList.vue'; const inputValue = ref(''); const startChat = ref(false); @@ -156,31 +191,41 @@ const onSubmit = (e, answer = undefined) => { behavior: 'smooth', }); }); - getAIAnswer(answer ?? e); + // getAIAnswer(answer ?? e); + getAIAnswer(mockAnswer); }; const getAIAnswer = (content) => { messages.value.push({ from: 'ai-model', - content: '', + content: content, avatarPosition: 'side-left', avatarConfig: { ...aiModelAvatar }, - loading: true, + loading: false, }); - /* 模拟流式数据返回 */ - setTimeout(async () => { - messages.value.at(-1).loading = false; - for (let i = 0; i < content.length;) { - await new Promise(r => setTimeout(r, 300 * Math.random())); - messages.value[messages.value.length - 1].content = content.slice(0, i += Math.random() * 10); - nextTick(() => { - conversationRef.value?.scrollTo({ - top: conversationRef.value.scrollHeight - }); - }); - } - }, 1000); + + // messages.value.push({ + // from: 'ai-model', + // content: '', + // avatarPosition: 'side-left', + // avatarConfig: { ...aiModelAvatar }, + // loading: true, + // }); + + // /* 模拟流式数据返回 */ + // setTimeout(async () => { + // messages.value.at(-1).loading = false; + // for (let i = 0; i < content.length;) { + // await new Promise(r => setTimeout(r, 300 * Math.random())); + // messages.value[messages.value.length - 1].content = content.slice(0, i += Math.random() * 10); + // nextTick(() => { + // conversationRef.value?.scrollTo({ + // top: conversationRef.value.scrollHeight + // }); + // }); + // } + // }, 1000); }; const onNewConvo = () => { @@ -201,6 +246,26 @@ const themeChange = () => { } } +const isLoading = ref(false); +let interval = null; +const thinkBtnText = ref('思考过程'); +const btnIcon = ref('icon-chevron-down-2'); + +const toggleThink = (idx) => { + if (isLoading.value) { + return + } + const targetNode = document.querySelectorAll('.mc-bubble-content-container')[idx]; + if (targetNode) { + const thinkBlock = targetNode.querySelector('.mc-think-block'); + if (thinkBlock) { + const currentDisplay = getComputedStyle(thinkBlock).display; + thinkBlock.style.display = currentDisplay === 'none' ? 'block' : 'none'; + btnIcon.value = currentDisplay === 'none' ? 'icon-chevron-up-2' :'icon-chevron-down-2' + } + } +} + onMounted(() => { if(typeof window !== 'undefined'){ themeService = window['devuiThemeService']; @@ -215,7 +280,7 @@ onMounted(() => {