diff --git a/.env.development b/.env.development index 8f3fa89..de82b93 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ ENV = 'development' # 许镇-本地服地址 VUE_APP_BASE_API = 'http://192.168.99.72:11100' -VUE_APP_AIDEEPSEEK_API = 'http://192.168.99.86:11434' +VUE_APP_AIDEEPSEEK_API = 'http://192.168.99.86:12123' # VUE_APP_BASE_API = 'http://192.168.99.71:11110' # VUE_APP_BASE_API = 'http://192.168.99.107:11100' diff --git a/.env.production b/.env.production index 899ea56..17af5ef 100644 --- a/.env.production +++ b/.env.production @@ -3,7 +3,7 @@ ENV = 'production' # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置 # 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http # VUE_APP_BASE_API = 'http://192.168.99.107:11100' -VUE_APP_AIDEEPSEEK_API = 'http://192.168.99.86:11434' +VUE_APP_AIDEEPSEEK_API = 'http://192.168.99.86:12123' # VUE_APP_BASE_API = 'http://27.19.215.77:11100' # VUE_APP_BASE_API = 'http://27.16.212.58:11100' VUE_APP_BASE_API = 'http://192.168.99.71:11110' diff --git a/public/static/config.js b/public/static/config.js index 902d239..835f952 100644 --- a/public/static/config.js +++ b/public/static/config.js @@ -3,7 +3,7 @@ window.g = { // ApiUrl: 'http://27.16.212.58:11100', // 配置服务器地址, ApiUrl: 'http://192.168.99.71:11110', // ApiUrl: 'http://192.168.99.107:11100', - AIDeepSeekUrl:'http://192.168.99.86:11434', + AIDeepSeekUrl:'http://192.168.99.86:12123', // ParentPage: { // 后续看需求配置 // CrossDomainProxyUrl: '/Home/CrossDomainProxy', // BtnsApi: '/api/services/app/Authorization/GetBtns', diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index 37394c0..4439010 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -10,6 +10,7 @@ :active-text-color="variables.menuActiveText" :collapse-transition="false" mode="vertical" + @select="handleSelect" > @@ -32,6 +33,8 @@ export default { activeMenu() { const route = this.$route const { meta, path } = route + console.log('meta', meta) + console.log('path', path) // if set path, the sidebar will highlight the path you set if (meta.activeMenu) { return meta.activeMenu @@ -47,6 +50,15 @@ export default { isCollapse() { return !this.sidebar.opened } + }, + mounted() { + console.log('sidebarRouters', this.sidebarRouters) + }, + methods: { + handleSelect(key, keyPath) { + console.log('el-menu') + console.log(key, keyPath) + } } } diff --git a/src/utils/upload.js b/src/utils/upload.js index 7e1b452..dec7586 100644 --- a/src/utils/upload.js +++ b/src/utils/upload.js @@ -136,3 +136,12 @@ export function aiUpload(api, file, fileJsonString) { } return axios.post(api, data, config) } +// AI 编研 +export function aiEditUpload(api, file) { + var data = new FormData() + data.append('files', file) + const config = { + headers: { 'Authorization': getToken() } + } + return axios.post(api, data, config) +} diff --git a/src/views/AIAssistant/AIDigitalHuman/index.vue b/src/views/AIAssistant/AIDigitalHuman/index.vue index 11d3420..ba263c2 100644 --- a/src/views/AIAssistant/AIDigitalHuman/index.vue +++ b/src/views/AIAssistant/AIDigitalHuman/index.vue @@ -34,9 +34,10 @@
{{ word }}
+
深度思考
- 发送 + 发送
@@ -114,6 +115,7 @@ export default { if (this.inputMessage.trim() === '') return const linkSrc = process.env.NODE_ENV === 'production' ? window.g.AIDeepSeekUrl : process.env.VUE_APP_AIDEEPSEEK_API + console.log('linkSrc', linkSrc) this.messages.push({ sender: 'user', content: this.inputMessage }) this.inputMessage = '' @@ -126,6 +128,8 @@ export default { method: 'POST', headers: { 'Content-Type': 'application/json' + // 'x-api-key': 'yxk_ollama_83560792' + // 'Authorization': 'Bearer yxk_ollama_83560792' }, body: JSON.stringify({ model: this.modelVal, @@ -463,7 +467,7 @@ export default { } ::v-deep .v-note-wrapper .v-note-panel .v-note-show .v-show-content{ border-radius: 12px; - padding: 0 !important; + // padding: 0 !important; } ::v-deep .el-textarea__inner { resize: none; diff --git a/src/views/AIAssistant/AIIntelligentCoding/aiForm.vue b/src/views/AIAssistant/AIIntelligentCoding/aiForm.vue index 6366da4..817cc43 100644 --- a/src/views/AIAssistant/AIIntelligentCoding/aiForm.vue +++ b/src/views/AIAssistant/AIIntelligentCoding/aiForm.vue @@ -123,6 +123,7 @@ import { form } from '@crud/crud' import { mapGetters } from 'vuex' import { FetchDictionaryTree } from '@/api/system/dict' +import { aiEditUpload } from '@/utils/upload' const defaultForm = { id: null, title: null, researchType: null } export default { @@ -158,11 +159,13 @@ export default { }, isUploading: false, progress: 0, - animationDuration: 0 + animationDuration: 0, + context: '' } }, computed: { ...mapGetters([ + 'baseApi', 'user' ]) }, @@ -210,26 +213,33 @@ export default { // const formData = new FormData() // formData.append('file', file) - // try { - // // 发送文件上传请求 - // const response = await axios.post('/upload', formData, { - // headers: { - // 'Content-Type': 'multipart/form-data' - // } - // }) + try { + aiEditUpload(this.baseApi + '/api/ai/uploadAIResearchFiles', + file, + ).then(res => { + console.log('res.data.data', res.data.data) + if (res.data.data !== null) { + this.context = res.data.data.results[0].content + this.$message({ message: '编研附件传输成功', type: 'success', offset: 8 }) + } else { + this.$message({ message: '编研附件传输失败', type: 'error', offset: 8 }) + } + }).catch(() => { + // this.$message({ message: '编研附件传输失败', type: 'error', offset: 8 }) + }) - // const endTime = Date.now() - // const uploadTime = (endTime - startTime) / 1000 - // this.animationDuration = uploadTime + // const endTime = Date.now() + // const uploadTime = (endTime - startTime) / 1000 + // this.animationDuration = uploadTime - // // 处理上传成功的逻辑 - // this.$message.success('文件上传成功') - // } catch (error) { - // // 处理上传失败的逻辑 - // this.$message.error('文件上传失败') - // } finally { - // this.isUploading = false - // } + // // 处理上传成功的逻辑 + // this.$message.success('文件上传成功') + } catch (error) { + // 处理上传失败的逻辑 + // this.$message.error('文件上传失败') + } finally { + this.isUploading = false + } const uploadTime = 2 this.animationDuration = uploadTime @@ -281,7 +291,10 @@ export default { try { this.controller = new AbortController() const signal = this.controller.signal - this.arequestData.messages.push({ role: 'user', content: this.inputValue }) + // 'content': `${context}\n\n${prompt}` + // this.inputValue + console.log('this.context', this.context) + this.arequestData.messages.push({ role: 'user', content: `${this.context}\n\n${this.inputValue}` }) const linkSrc = process.env.NODE_ENV === 'production' ? window.g.AIDeepSeekUrl : process.env.VUE_APP_AIDEEPSEEK_API const response = await fetch(linkSrc + '/api/chat', { method: 'POST', diff --git a/src/views/AIAssistant/AIIntelligentCoding/index.vue b/src/views/AIAssistant/AIIntelligentCoding/index.vue index 11ba175..4000474 100644 --- a/src/views/AIAssistant/AIIntelligentCoding/index.vue +++ b/src/views/AIAssistant/AIIntelligentCoding/index.vue @@ -101,8 +101,8 @@ export default { mixins: [presenter(), crud()], cruds() { return CRUD({ - url: 'api/archivesUtilize/initResearchList', - title: '档案编研', + url: 'api/ai/initResearchAI', + title: 'AI智能编研', crudMethod: { ...crudEditing }, optShow: { add: false, diff --git a/src/views/AIAssistant/AIknowledgeGraph/index.vue b/src/views/AIAssistant/AIknowledgeGraph/index.vue index 51b2754..ef6c4aa 100644 --- a/src/views/AIAssistant/AIknowledgeGraph/index.vue +++ b/src/views/AIAssistant/AIknowledgeGraph/index.vue @@ -43,7 +43,7 @@