diff --git a/src/api/collect/collect.js b/src/api/collect/collect.js index 555bb4c..be2932a 100644 --- a/src/api/collect/collect.js +++ b/src/api/collect/collect.js @@ -313,6 +313,15 @@ export function FetchInitExternalReceptionDetailsList(params) { }) } +// AI著录 - 得到AI返回结果 +export function FetchAIResultZhulu(params) { + return request({ + url: 'api/collect/getAIResultZhulu', + method: 'get', + params + }) +} + export default { collectAdd, collectEdit, @@ -344,5 +353,6 @@ export default { FetchRestoreArchives, FetchBusinessFlowTitle, FetchBecomeDocument, - FetchInitExternalReceptionDetailsList + FetchInitExternalReceptionDetailsList, + FetchAIResultZhulu } diff --git a/src/assets/styles/yxk-admin.scss b/src/assets/styles/yxk-admin.scss index 0227261..7c8f943 100644 --- a/src/assets/styles/yxk-admin.scss +++ b/src/assets/styles/yxk-admin.scss @@ -2083,4 +2083,18 @@ input[type ='number'] { font-size: 16px; } } +} + +.check-btn{ + color: #fff !important; + background-color: #0348f3; +} + + +.el-button.check-btn:hover, +.el-button.check-btn:focus, +.el-button--info.check-btn.is-plain:hover, +.el-button--info.check-btn.is-plain:focus{ + color: #fff !important; + background-color: #0348f3 !important; } \ No newline at end of file diff --git a/src/views/AIAssistant/AICataloging/history/index.vue b/src/views/AIAssistant/AICataloging/history/index.vue new file mode 100644 index 0000000..847b1f3 --- /dev/null +++ b/src/views/AIAssistant/AICataloging/history/index.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/src/views/AIAssistant/AICataloging/index copy.vue b/src/views/AIAssistant/AICataloging/index copy.vue new file mode 100644 index 0000000..7a35b30 --- /dev/null +++ b/src/views/AIAssistant/AICataloging/index copy.vue @@ -0,0 +1,664 @@ + + + + diff --git a/src/views/AIAssistant/AICataloging/index.vue b/src/views/AIAssistant/AICataloging/index.vue index 63e0a64..5bd8a1f 100644 --- a/src/views/AIAssistant/AICataloging/index.vue +++ b/src/views/AIAssistant/AICataloging/index.vue @@ -1,645 +1,55 @@ + diff --git a/src/views/AIAssistant/AICataloging/running/index.vue b/src/views/AIAssistant/AICataloging/running/index.vue new file mode 100644 index 0000000..20c39c3 --- /dev/null +++ b/src/views/AIAssistant/AICataloging/running/index.vue @@ -0,0 +1,387 @@ + + + + + diff --git a/src/views/AIAssistant/AICataloging/running/module/detail.vue b/src/views/AIAssistant/AICataloging/running/module/detail.vue new file mode 100644 index 0000000..dca2535 --- /dev/null +++ b/src/views/AIAssistant/AICataloging/running/module/detail.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue b/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue index e5890f0..4ef726c 100644 --- a/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue +++ b/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue @@ -178,7 +178,7 @@ @@ -246,7 +246,7 @@ import CRUD, { crud } from '@crud/crud' import { collectionLibraryCrud } from '../mixins/index' import { FetchInitCategoryInputFieldByPid, FetchCategoryMenu } from '@/api/system/category/category' -import { FetchDetailsById, collectDel, FetchRemoveArchivesSingle, FetchDeleteArchivesFile, FetchUpdateArchivesNo, FetchDisbandArchives, FetchReturnReDocument, FetchCompleteDelArchives, FetchRestoreArchives } from '@/api/collect/collect' +import { FetchDetailsById, collectDel, FetchRemoveArchivesSingle, FetchDeleteArchivesFile, FetchUpdateArchivesNo, FetchDisbandArchives, FetchReturnReDocument, FetchCompleteDelArchives, FetchRestoreArchives, FetchAIResultZhulu } from '@/api/collect/collect' import { FetchArchivesClassTree } from '@/api/system/archivesClass' import Treeselect from '@riophae/vue-treeselect' import '@riophae/vue-treeselect/dist/vue-treeselect.css' @@ -330,7 +330,8 @@ export default { displayedText: '', typingInterval: null, typingFinished: false, - currentLineIndex: 0 + currentLineIndex: 0, + shouldContinueFetching: true } }, computed: { @@ -569,6 +570,7 @@ export default { }, // 关闭 handleClose(done) { + this.shouldContinueFetching = false this.formVisible = false this.quickPaper = false @@ -581,6 +583,7 @@ export default { clearInterval(this.typingInterval) } this.fileList = [] + this.aiLoading = false done() }, // 删除 @@ -1305,22 +1308,26 @@ export default { const existingNonImageFiles = this.fileList.filter(item => item.formatType !== 'image') if (imageFiles.length > 0) { - if (existingImageFiles.length > 0) { - if (existingImageFiles.length + imageFiles.length > 3) { - // 若加入新图片会超过 3 张,清空已有图片 - this.fileList = this.fileList.filter(item => item.formatType !== 'image') - } - } else if (existingNonImageFiles.length > 0) { + // if (existingImageFiles.length > 0) { + // if (existingImageFiles.length + imageFiles.length > 3) { + // // 若加入新图片会超过 3 张,清空已有图片 + // this.fileList = this.fileList.filter(item => item.formatType !== 'image') + // } + // } else if (existingNonImageFiles.length > 0) { + // // 若已有非图片文件,清空已有非图片文件 + // this.fileList = this.fileList.filter(item => item.formatType === 'image') + // } + + // // 检查图片文件数量 + // if (imageFiles.length > 3) { + // this.$message.error('图片文件最多只能选择 3 个,请重新选择') + // return + // } + if (existingNonImageFiles.length > 0) { // 若已有非图片文件,清空已有非图片文件 this.fileList = this.fileList.filter(item => item.formatType === 'image') } - // 检查图片文件数量 - if (imageFiles.length > 3) { - this.$message.error('图片文件最多只能选择 3 个,请重新选择') - return - } - for (const file of imageFiles) { // 检查文件是否已存在 if (this.fileList.some(item => item.name === file.name)) { @@ -1386,13 +1393,13 @@ export default { } }, FetchAiFileUplaod(files) { + this.aiLoading = true this.nowDate = getCurrentTime() const promiseArray = files.map(async(item, index) => { const json = {} json.file_name = item.name json.file_size = item.size json.file_type = item.postfix - // json.file_path = this.filePath[index].path json.file_path = '' json.archive_id = this.arcId json.file_dpi = item.px @@ -1400,32 +1407,46 @@ export default { json.create_time = this.nowDate json.id = null json.last_modified = item.file.lastModified - // json.digital_summary = null - // json.public_key = null - // json.private_key = null return json }) console.log('promiseArray', promiseArray) - // 原始得上传文件二进制 const fileDefault = files.map(item => item.file) Promise.all(promiseArray) .then((arrayUpload) => { - // 上传附件 archivesUpload(this.baseApi + '/api/collect/uploadAssistEnterFiles', fileDefault, this.selectedCategory.id, this.arcId, JSON.stringify(arrayUpload) ).then(res => { - if (res.data.code === 200) { - this.$message({ message: res.data.data, type: 'success', offset: 8 }) - // this.aiJsonData = res.data; - // this.startTypingEffect(); + if (res.data.data !== null) { + const params = { + 'code': res.data.data.code, + 'id': res.data.data.id + } + const fetchAiZhuluResult = () => { + // 检查是否应该继续请求 + if (!this.shouldContinueFetching) return + + FetchAIResultZhulu(params).then((res) => { + const data = JSON.parse(res) + console.log('data', data) + if (data.result !== null && data.status === 'success') { + this.$message({ message: '解析著录附件成功', type: 'success', offset: 8 }) + this.aiJsonData = data.result + this.startTypingEffect() + } else { + setTimeout(fetchAiZhuluResult, 3000) + } + }).catch(err => { + console.log(err) + }) + } + fetchAiZhuluResult() } else { - this.$message({ message: '上传附件失败', type: 'error', offset: 8 }) + this.$message({ message: '著录附件传输失败', type: 'error', offset: 8 }) } - // this.handleClose() }) }) .catch((error) => { @@ -1449,7 +1470,7 @@ export default { this.typingFinished = true if (this.aiJsonData) { // this.$refs.previewForm.archivesType = 'add' - this.$refs.previewForm.addOrUpdateForm = JSON.parse(this.aiJsonData) + // this.$refs.previewForm.addOrUpdateForm = JSON.parse(this.aiJsonData) this.aiLoading = false } }, 1000) diff --git a/src/views/components/echarts/graph.vue b/src/views/components/echarts/graph.vue index 18f1dae..7aeac38 100644 --- a/src/views/components/echarts/graph.vue +++ b/src/views/components/echarts/graph.vue @@ -33,19 +33,12 @@ import { getGraphData } from '../../../neo4j.js' import RelationGraph from 'relation-graph' -const graph_json_data = { - 'nodes': [ - ], - 'lines': [ - ] -} - export default { name: 'Demo', components: { RelationGraph }, data() { return { - allData: graph_json_data, + allData: { 'nodes': [], 'lines': [] }, isShowCodePanel: false, isShowNodeTipsPanel: false, nodeMenuPanelPosition: { x: 0, y: 0 }, @@ -67,7 +60,7 @@ export default { defaultLineColor: 'rgba(0,0,0,0.5)', defaultNodeBorderWidth: 0, defaultNodeBorderColor: 'transpanret', - defaultNodeFontColor: '#000', + defaultNodeFontColor: '#fff', defaultFocusRootNode: false }, isLoading: false, @@ -81,6 +74,8 @@ export default { // const graphInstance = this.$refs.graphRef.getInstance(); // await graphInstance.zoomToFit(); }, 3000) + this.allData.nodes = [] + this.allData.lines = [] const query = "MATCH path = (target:Archives {id: '0047B3542CE88B895E41DE'})-[rels:HAS_KEYWORD*1..4]-(related:Archives) WHERE target <> related UNWIND relationships(path) AS r WITH startNode(r) AS n, r, endNode(r) AS m, length(path)/2 AS depth RETURN DISTINCT n, r, m;" this.fetchData(query) }, @@ -93,16 +88,29 @@ export default { this.errorMessage = '' try { const { nodes, edges } = await getGraphData(query) - const colors = ['rgb(225,151,102)', 'rgb(194,159,87)', 'rgb(253,183,112)', 'rgb(127,181,123)', 'rgb(224,178,159)', 'rgb(196,149,72)', 'rgb(255,162,24)', 'rgb(189,237,229)'] - const typeColorMap = {} + // 档案Archives、门类Category、档案分类CategoryClass、全宗Fonds、关键词Keywords、保管期限Retention、保密期限SecrecyPeriod、密级SecurityClass const newNodes = nodes.map(item => { const newItem = { ...item, id: String(item.id) } - if (item.type) { - if (!typeColorMap[item.type]) { - typeColorMap[item.type] = colors[Object.keys(typeColorMap).length % colors.length] - } - newItem.color = typeColorMap[item.type] - newItem.borderColor = typeColorMap[item.type] + + const typeToColorMap = { + Archives: '#0348F3', + Category: '#14C9C9', + CategoryClass: '#F8B722', + Fonds: '#722ED1', + Keywords: '#F4647B', + Retention: '#018BFF', + SecrecyPeriod: '#FEBD98', + SecurityClass: '#B1EBDF' + } + + const defaultColor = '#000000' // 默认颜色 + + if (typeToColorMap[item.type]) { + newItem.color = typeToColorMap[item.type] + newItem.borderColor = typeToColorMap[item.type] + } else { + newItem.color = defaultColor + newItem.borderColor = defaultColor } return newItem })