From 8b3d72fdaa282ab92ffd999fcbd62d151bbc33cd Mon Sep 17 00:00:00 2001
From: xuhuajiao <13476289682@163.com>
Date: Thu, 20 Mar 2025 17:26:25 +0800
Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D/Ai=E7=9F=A5=E8=AF=86?=
=?UTF-8?q?=E5=9B=BE=E8=B0=B1/AI=E6=99=BA=E8=83=BD=E7=BC=96=E7=A0=94?=
=?UTF-8?q?=E9=83=A8=E5=88=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 2 +-
.env.production | 2 +-
public/static/config.js | 2 +-
src/layout/components/Sidebar/index.vue | 12 ++++
src/utils/upload.js | 9 +++
.../AIAssistant/AIDigitalHuman/index.vue | 8 ++-
.../AIIntelligentCoding/aiForm.vue | 53 +++++++++------
.../AIAssistant/AIIntelligentCoding/index.vue | 4 +-
.../AIAssistant/AIknowledgeGraph/index.vue | 40 +++++------
.../managementLibrary/index.vue | 2 +-
.../managementLibrary/mixins/index.js | 66 ++++++++++++++++---
.../module/collectHeader.vue | 4 ++
.../module/exportZip/index.vue | 6 +-
.../managementLibrary/module/handOverForm.vue | 7 +-
.../module/packingBox/index.vue | 52 +++++++++++----
.../openInventory/module/detail.vue | 14 ++--
.../batchConnection/module/form.vue | 8 ++-
.../collectionLibrary/index.vue | 3 +
.../module/archivesInfo/index.vue | 7 +-
.../module/collectHeader.vue | 19 ++----
.../module/packingBox/index.vue | 9 ++-
src/views/components/category/PreviewForm.vue | 6 +-
src/views/components/echarts/graph.vue | 36 +++++-----
src/views/prearchiveLibrary/index.vue | 20 +++++-
.../prearchiveLibrary/module/batchFile.vue | 5 +-
.../prearchiveLibrary/module/moveFile.vue | 5 +-
.../module/businessDetails/index.vue | 2 +-
.../runningProcess/module/detail.vue | 5 +-
.../system/user/processCenter/module/form.vue | 3 +-
29 files changed, 278 insertions(+), 133 deletions(-)
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 @@