diff --git a/.env.development b/.env.development
index 0252384..a3ff90d 100644
--- a/.env.development
+++ b/.env.development
@@ -36,3 +36,6 @@ VITE_USER_CENTER_HOST = 'https://test.gitcode.net/child/user-center/'
VITE_COPILOT_HOST = 'https://test.gitcode.net/child/aichat-app/'
VITE_BASE_URL=/
+
+# AI大模型接口地址
+VITE_AI_API_HOST = ''http://222.20.126.208:8089'
diff --git a/.env.loc b/.env.loc
index dc60f36..09fd3ed 100644
--- a/.env.loc
+++ b/.env.loc
@@ -38,3 +38,6 @@ VITE_USER_CENTER_HOST = 'https://local.gitcode.net:8002'
VITE_COPILOT_HOST = 'https://local.gitcode.net:8003/child/aichat-app'
VITE_BASE_URL=/openRepoPortal/
+
+# AI大模型接口地址
+VITE_AI_API_HOST = ''http://222.20.126.208:8089'
diff --git a/.env.pre b/.env.pre
index 2037785..cbefc44 100644
--- a/.env.pre
+++ b/.env.pre
@@ -38,3 +38,6 @@ VITE_USER_CENTER_HOST = 'https://pre-usercenter-app.gitcode.com'
VITE_COPILOT_HOST = 'https://pre-copilot-app.gitcode.com'
VITE_BASE_URL=/openRepoPortal/
+
+# AI大模型接口地址
+VITE_AI_API_HOST = ''http://222.20.126.208:8089'
diff --git a/.env.production b/.env.production
index 08dc3a4..6727555 100644
--- a/.env.production
+++ b/.env.production
@@ -38,3 +38,6 @@ VITE_USER_CENTER_HOST = 'https://usercenter-app.gitcode.com'
VITE_COPILOT_HOST = 'https://copilot-app.gitcode.com'
VITE_BASE_URL=/openRepoPortal/
+
+# AI大模型接口地址
+VITE_AI_API_HOST = ''http://222.20.126.208:8089'
diff --git a/src/layouts/AILayout/ViewHistoryAside/ViewHistoryAside.vue b/src/layouts/AILayout/ViewHistoryAside/ViewHistoryAside.vue
index 817f361..7553f64 100644
--- a/src/layouts/AILayout/ViewHistoryAside/ViewHistoryAside.vue
+++ b/src/layouts/AILayout/ViewHistoryAside/ViewHistoryAside.vue
@@ -113,6 +113,115 @@
+
+
+
+
+
+
+
+ 今天
+
+
+
+
+
+
+
+
+
+
+
+

+
{{ item.text }}
+
+
+ {{ formatTime(item.time) }}
+
+
+
+
+
+
+
+
+
+
+ 昨天
+
+
+
+
+
+
+
+
+
+

+
{{ item.text }}
+
+
+ {{ formatTime(item.time) }}
+
+
+
+
+
+
+
+
+
+
+ 历史对话保存条数
+
+ 10
+ 20
+ 30
+ 0
+
+
+
+
+
+
+
+ 批量管理
+
+
+
+
diff --git a/src/layouts/AILayout/index.vue b/src/layouts/AILayout/index.vue
index 1bda097..77c5489 100644
--- a/src/layouts/AILayout/index.vue
+++ b/src/layouts/AILayout/index.vue
@@ -64,7 +64,7 @@
-
-
+
@@ -104,6 +104,9 @@ const refHeader: any = ref(null);
const footerSize = useElementSize(refFooter);
const isHome = computed(() => route.name === 'home');
+// 控制 ViewHistoryAside 组件的显示状态
+const isHistoryVisible = ref(false);
+
// aside 设置可见性 header有两层,有顶栏信息,两层sidebar 都不可见
const asideSetShow = computed(() => {
if (route.meta.asideMenu === 'drawer') return false;
@@ -160,26 +163,10 @@ const handleClickMenu = () => {
}
};
-const outOfSearch = ref(true); // 在search页面隐藏footer
-router.afterEach((to, form) => {
- outOfSearch.value = to.name !== 'search';
-});
-microApp.router.afterEach({
- 'micoro-app-homeweb-app': (to, from) => {
- outOfSearch.value = to.pathname !== '/search';
- }
-});
-const checkPage = (data: any) => {
- if (data.type === 'checkPage') {
- return 'ready';
- }
+// 切换 ViewHistoryAside 组件的显示与隐藏
+const toggleHistory = () => {
+ isHistoryVisible.value =!isHistoryVisible.value;
};
-onMounted(() => {
- microApp.addDataListener('micoro-app-homeweb-app', checkPage, false);
-});
-onUnmounted(() => {
- microApp.removeDataListener('micoro-app-homeweb-app', checkPage);
-});
diff --git a/src/views/Jyh/AI/Home/components/Other.vue b/src/views/Jyh/AI/Home/components/Other.vue
new file mode 100644
index 0000000..f93ae25
--- /dev/null
+++ b/src/views/Jyh/AI/Home/components/Other.vue
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/views/Jyh/AI/Home/index.vue b/src/views/Jyh/AI/Home/index.vue
index c7e74a3..6cf2a02 100644
--- a/src/views/Jyh/AI/Home/index.vue
+++ b/src/views/Jyh/AI/Home/index.vue
@@ -22,27 +22,10 @@
-
-
-
-
+
+
+
+
@@ -56,6 +39,24 @@
+
@@ -142,6 +143,15 @@ import GuessYouWantToAsk from './GuessYouWantToAsk.vue';
import OssList from './components/OssList.vue';
import WarningList from './components/WarningList.vue';
import OssDetail from './components/OssDetail.vue';
+import Other from './components/Other.vue';
+import AIList from './components/AIList.vue';
+import { getChat } from '@/api/jyh';
+import axios from 'axios';
+import { useDiscussGetUserInfo } from '@/api/discussion/hook';
+
+// 获取当前用户信息 & 是否登录
+const { isLogin = false, userInfo = {}} = useDiscussGetUserInfo();
+debugger
const inputValue = ref('');
const startChat = ref(false);
@@ -201,20 +211,32 @@ const onSubmit = (e, answer = undefined) => {
});
});
// getAIAnswer(answer ?? e);
- getAIAnswer(mockAnswer,1);
+ getAIAnswer(e,1);
};
-const getAIAnswer = (content,type) => {
+const getAIAnswer = async (content) => {
messages.value.push({
from: 'ai-model',
- type: type || 1,
- content: content,
+ type: '',
+ content: '',
avatarPosition: 'side-left',
avatarConfig: { ...aiModelAvatar },
- loading: false,
+ loading: true,
});
+ const {data} = await axios.get('http://222.20.126.208:8089/api/v0/chat_use_sql?question='+content);
+ debugger
+ const {text,type} = data;
+ if(type==='text') {
+ messages.value[messages.value.length - 1].content = text;
+ messages.value[messages.value.length - 1].loading = false;
+ messages.value[messages.value.length - 1].type = 'text';
+ } else if(type==='df') {
+ messages.value[messages.value.length - 1].content = data[type];
+ messages.value[messages.value.length - 1].loading = false;
+ messages.value[messages.value.length - 1].type = 'df';
+ }
// messages.value.push({
// from: 'ai-model',
// content: '',