diff --git a/.env.development b/.env.development index cacfa24..8f3fa89 100644 --- a/.env.development +++ b/.env.development @@ -5,6 +5,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_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 2673c62..899ea56 100644 --- a/.env.production +++ b/.env.production @@ -2,11 +2,11 @@ ENV = 'production' # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置 # 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http -VUE_APP_BASE_API = 'http://192.168.99.107:11100' +# VUE_APP_BASE_API = 'http://192.168.99.107:11100' VUE_APP_AIDEEPSEEK_API = 'http://192.168.99.86:11434' # 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' +VUE_APP_BASE_API = 'http://192.168.99.71:11110' # 如果接口是 http 形式, wss 需要改为 ws VUE_APP_WS_API = 'ws://27.16.212.58:11110' VUE_APP_CAMERA_API = '192.168.99.107:3000' diff --git a/public/static/config.js b/public/static/config.js index ae3949a..902d239 100644 --- a/public/static/config.js +++ b/public/static/config.js @@ -1,8 +1,8 @@ window.g = { AXIOS_TIMEOUT: 10000, // ApiUrl: 'http://27.16.212.58:11100', // 配置服务器地址, - // ApiUrl: 'http://192.168.99.71:11110', - ApiUrl: 'http://192.168.99.107:11100', + ApiUrl: 'http://192.168.99.71:11110', + // ApiUrl: 'http://192.168.99.107:11100', AIDeepSeekUrl:'http://192.168.99.86:11434', // ParentPage: { // 后续看需求配置 // CrossDomainProxyUrl: '/Home/CrossDomainProxy', diff --git a/src/assets/iconfonts/light/iconfont.css b/src/assets/iconfonts/light/iconfont.css index 0ac23a2..ce15f5c 100644 --- a/src/assets/iconfonts/light/iconfont.css +++ b/src/assets/iconfonts/light/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 3966148 */ - src: url('iconfont.woff2?t=1741163523495') format('woff2'), - url('iconfont.woff?t=1741163523495') format('woff'), - url('iconfont.ttf?t=1741163523495') format('truetype'); + src: url('iconfont.woff2?t=1741250796308') format('woff2'), + url('iconfont.woff?t=1741250796308') format('woff'), + url('iconfont.ttf?t=1741250796308') format('truetype'); } .iconfont { @@ -13,6 +13,10 @@ -moz-osx-font-smoothing: grayscale; } +.icon-wenjianjiexi:before { + content: "\e82f"; +} + .icon-shendusikao:before { content: "\e876"; } diff --git a/src/assets/iconfonts/light/iconfont.js b/src/assets/iconfonts/light/iconfont.js index 6e2249d..31d10c6 100644 --- a/src/assets/iconfonts/light/iconfont.js +++ b/src/assets/iconfonts/light/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_3966148='',(c=>{var a=(l=(l=document.getElementsByTagName("script"))[l.length-1]).getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var h,i,o,t,s,z=function(a,l){l.parentNode.insertBefore(a,l)};if(a&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}h=function(){var a,l=document.createElement("div");l.innerHTML=c._iconfont_svg_string_3966148,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?z(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),h()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=h,t=c.document,s=!1,p(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,v())})}function v(){s||(s=!0,o())}function p(){try{t.documentElement.doScroll("left")}catch(a){return void setTimeout(p,50)}v()}})(window); \ No newline at end of file +window._iconfont_svg_string_3966148='',(c=>{var a=(l=(l=document.getElementsByTagName("script"))[l.length-1]).getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var h,i,o,t,s,z=function(a,l){l.parentNode.insertBefore(a,l)};if(a&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}h=function(){var a,l=document.createElement("div");l.innerHTML=c._iconfont_svg_string_3966148,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?z(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),h()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=h,t=c.document,s=!1,p(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,v())})}function v(){s||(s=!0,o())}function p(){try{t.documentElement.doScroll("left")}catch(a){return void setTimeout(p,50)}v()}})(window); \ No newline at end of file diff --git a/src/assets/iconfonts/light/iconfont.json b/src/assets/iconfonts/light/iconfont.json index 074f925..f1cf633 100644 --- a/src/assets/iconfonts/light/iconfont.json +++ b/src/assets/iconfonts/light/iconfont.json @@ -5,6 +5,13 @@ "css_prefix_text": "icon-", "description": "", "glyphs": [ + { + "icon_id": "40591561", + "name": "文件解析", + "font_class": "wenjianjiexi", + "unicode": "e82f", + "unicode_decimal": 59439 + }, { "icon_id": "43375318", "name": "深度思考", diff --git a/src/assets/iconfonts/light/iconfont.ttf b/src/assets/iconfonts/light/iconfont.ttf index 16315bc..e82ef55 100644 Binary files a/src/assets/iconfonts/light/iconfont.ttf and b/src/assets/iconfonts/light/iconfont.ttf differ diff --git a/src/assets/iconfonts/light/iconfont.woff b/src/assets/iconfonts/light/iconfont.woff index e6b7f71..5eff03c 100644 Binary files a/src/assets/iconfonts/light/iconfont.woff and b/src/assets/iconfonts/light/iconfont.woff differ diff --git a/src/assets/iconfonts/light/iconfont.woff2 b/src/assets/iconfonts/light/iconfont.woff2 index 2bc0724..fe67253 100644 Binary files a/src/assets/iconfonts/light/iconfont.woff2 and b/src/assets/iconfonts/light/iconfont.woff2 differ diff --git a/src/views/AIAssistant/AICataloging/running/index.vue b/src/views/AIAssistant/AICataloging/running/index.vue index a38f2ca..2c9b491 100644 --- a/src/views/AIAssistant/AICataloging/running/index.vue +++ b/src/views/AIAssistant/AICataloging/running/index.vue @@ -293,7 +293,8 @@ export default { }, computed: { ...mapGetters([ - 'baseApi' + 'baseApi', + 'user' ]) // collectLevel() { // if (this.isTitleType === 2) { @@ -477,6 +478,7 @@ export default { fileDefault, JSON.stringify(arrayUpload) ).then(res => { + console.log('res.data.data', res.data.data) if (res.data.data !== null) { this.$message({ message: '著录附件传输成功', type: 'success', offset: 8 }) this.crud.toQuery() @@ -484,6 +486,9 @@ export default { this.$message({ message: '著录附件传输失败', type: 'error', offset: 8 }) } this.handleClose() + }).catch(() => { + this.$message({ message: '著录附件传输失败', type: 'error', offset: 8 }) + this.handleClose() }) }) .catch((error) => { @@ -636,16 +641,20 @@ export default { } FetchDoHandleEnterAnalysis(params).then(data => { console.log(data) - const inputMessage = data.query + '需要提取得内容部分是' + data.context - this.sendMessage(inputMessage) + // const inputMessage = data.query + '需要提取得内容部分是' + data.context + this.sendMessage(data.query, data.context) }) }, // 向deepseek发出提问和分析内容 - async sendMessage(inputMessage) { + async sendMessage(prompt, context) { const linkSrc = process.env.NODE_ENV === 'production' ? window.g.AIDeepSeekUrl : process.env.VUE_APP_AIDEEPSEEK_API this.displayedText = '' this.isDialogClosed = false // 重置标志位 try { + // { 'role': 'system', 'content': '你是一个数据分析助手' }, + const messages = [ + { 'role': 'user', 'content': `${context}\n\n${prompt}` } + ] const response = await fetch(linkSrc + '/api/generate', { method: 'POST', headers: { @@ -654,7 +663,7 @@ export default { body: JSON.stringify({ model: 'deepseek-r1:14b', // model: 'qwen:7b', - prompt: inputMessage, + prompt: messages[0].content, stream: true }) }) @@ -703,11 +712,20 @@ export default { this.aiResultCaLoading = false if (!this.isDialogClosed) { console.log('this.displayedText.', this.displayedText) + + // 去除 之间的内容 + const thinkStartIndex = this.displayedText.indexOf('') + const thinkEndIndex = this.displayedText.indexOf('') + let lastContent = this.displayedText + if (thinkStartIndex !== -1 && thinkEndIndex !== -1) { + lastContent = lastContent.slice(0, thinkStartIndex) + lastContent.slice(thinkEndIndex + ''.length) + } + console.log('lastContent', lastContent) // 提取 JSON 部分 - const startIndex = this.displayedText.indexOf('{') - const endIndex = this.displayedText.lastIndexOf('}') + const startIndex = lastContent.indexOf('{') + const endIndex = lastContent.lastIndexOf('}') if (startIndex !== -1 && endIndex !== -1 && endIndex > startIndex) { - const jsonStr = this.displayedText.slice(startIndex, endIndex + 1) + const jsonStr = lastContent.slice(startIndex, endIndex + 1) console.log('jsonStr', jsonStr) const jsonData = JSON.parse(jsonStr) console.log('提取并过滤后的 JSON 数据:', jsonData) @@ -721,13 +739,29 @@ export default { this.reader = null // 清空读取器 } }, + replaceSeparators(str) { + return str.replace(/[,,、]/g, ' ') + }, + // 新增档案提交 handlerArchivesSubmit() { console.log(this.$refs.previewForm.addOrUpdateForm) - // this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id, this.quickPaperArcId) + // const newFormData = {} + // for (const key in this.$refs.previewForm.addOrUpdateForm) { + // if (this.$refs.previewForm.addOrUpdateForm.hasOwnProperty(key)) { + // const value = this.$refs.previewForm.addOrUpdateForm[key] + // if (typeof value === 'string' && (value.includes(',') || value.includes('、') || value.includes(','))) { + // newFormData[key] = this.replaceSeparators(value) + // } else { + // newFormData[key] = value + // } + // } + // } + // console.log('newFormData', newFormData) this.$refs.previewForm.$refs.addOrUpdateForm.validate((valid) => { if (valid) { const params = { + 'fondsAffiliation': this.user.fonds.id.toString(), 'categoryId': this.aiAddArchiveCategory.id, 'assistEnterId': this.currentAnId.id, 'jsonString': JSON.stringify(this.$refs.previewForm.addOrUpdateForm) @@ -736,6 +770,7 @@ export default { console.log('data', data) this.$message({ message: data, type: 'success', offset: 8 }) this.crud.toQuery() + this.handleClose() }) } else { console.log('error submit!!') diff --git a/src/views/AIAssistant/AIKeywords/archivesList.vue b/src/views/AIAssistant/AIKeywords/archivesList.vue new file mode 100644 index 0000000..3236b4a --- /dev/null +++ b/src/views/AIAssistant/AIKeywords/archivesList.vue @@ -0,0 +1,442 @@ + + + + + diff --git a/src/views/AIAssistant/AIKeywords/index copy.vue b/src/views/AIAssistant/AIKeywords/index copy.vue new file mode 100644 index 0000000..d67690f --- /dev/null +++ b/src/views/AIAssistant/AIKeywords/index copy.vue @@ -0,0 +1,768 @@ +