diff --git a/package.json b/package.json index e715b04..8b54828 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "fuse.js": "3.4.4", "handsontable": "^14.1.0", "highlight.js": "^11.11.1", + "html-docx-js": "^0.3.1", "html2canvas": "^1.4.1", "jquery": "^3.2.1", "js-beautify": "^1.10.2", diff --git a/src/vendors/ofd/ofd.js b/src/vendors/ofd/ofd.js index 7d2039c..3499346 100644 --- a/src/vendors/ofd/ofd.js +++ b/src/vendors/ofd/ofd.js @@ -148,7 +148,6 @@ export const digestCheck = function(options) { } export const setPageScale = function(scale) { - console.log('setPageScale', scale) setPageScal(scale) } diff --git a/src/vendors/ofd/utils/ofd_render.js b/src/vendors/ofd/utils/ofd_render.js index 406870b..8a7810a 100644 --- a/src/vendors/ofd/utils/ofd_render.js +++ b/src/vendors/ofd/utils/ofd_render.js @@ -396,7 +396,9 @@ const renderLayer = function( isStampAnnot, compositeObjectBoundary ) - pageDiv.appendChild(element) + if (element) { + pageDiv.appendChild(element); + } } } const pathObjects = layer['ofd:PathObject'] @@ -415,7 +417,9 @@ const renderLayer = function( compositeObjectBoundary, compositeObjectCTM ) - pageDiv.appendChild(svg) + if (svg) { + pageDiv.appendChild(svg); + } } } const textObjects = layer['ofd:TextObject'] @@ -429,7 +433,9 @@ const renderLayer = function( fillColor, strokeColor ) - pageDiv.appendChild(svg) + if (svg) { + pageDiv.appendChild(svg); + } } } const compositeObjects = layer['ofd:CompositeObject'] @@ -488,10 +494,17 @@ export const renderImageObject = function( let boundary = parseStBox(imageObject['@_Boundary']) boundary = converterBox(boundary) const resId = imageObject['@_ResourceID'] - if (multiMediaResObj[resId].format === 'gbig2') { - const img = multiMediaResObj[resId].img - const width = multiMediaResObj[resId].width - const height = multiMediaResObj[resId].height + + const mediaObj = multiMediaResObj[resId]; + if (!mediaObj) { + // 处理 mediaObj 为 undefined 的情况,例如返回 null 或者抛出一个更友好的错误 + return null; + } + + if (mediaObj.format === 'gbig2') { + const img =mediaObj.img + const width = mediaObj.width + const height = mediaObj.height return renderImageOnCanvas( img, width, @@ -504,7 +517,7 @@ export const renderImageObject = function( return renderImageOnDiv( pageWidth, pageHeight, - multiMediaResObj[resId].img, + mediaObj.img, boundary, false, isStampAnnot, @@ -832,7 +845,6 @@ export const renderPathObject = function( // path.setAttribute('stroke', `url(#${pathObject['@_ID']})`); // } } - console.log('defaultFillColor', defaultFillColor) if (pathObject['@_Fill'] != 'false') { path.setAttribute( 'fill', diff --git a/src/vendors/ofd/utils/ofd_util.js b/src/vendors/ofd/utils/ofd_util.js index 06b3efb..141b319 100644 --- a/src/vendors/ofd/utils/ofd_util.js +++ b/src/vendors/ofd/utils/ofd_util.js @@ -174,7 +174,6 @@ export const setPageScal = function(scale) { // scale = Math.ceil(scale); Scale = scale > 1 ? scale : 1 Scale = Scale > 10 ? 10 : Scale - console.log('setPageScal', Scale) } export const getPageScal = function() { diff --git a/src/views/AIAssistant/AICataloging/running/index.vue b/src/views/AIAssistant/AICataloging/running/index.vue index 8642c7d..db70f98 100644 --- a/src/views/AIAssistant/AICataloging/running/index.vue +++ b/src/views/AIAssistant/AICataloging/running/index.vue @@ -98,7 +98,11 @@ - + +
@@ -125,7 +129,16 @@
-
+
    +
  • AI辅助著录可支持的文件格式包括:
  • +
  • 1.文本文件:
    doc/docx、txt
  • +
  • 2.电子表格和演示文稿:
    xls/xlsx、ppt/pptx
  • +
  • 3.图像文件:
    jpge/jpg、png
  • +
  • 4.其他文件:
    pdf、ofd
  • +
  • 注意:目前支持单次上传多个图像文件或1个非图像文件,单个文件的大小不得超过10M。文件解析耗时根据文件的大小以及类型各有不同,用户可在上传成功后手动点击“刷新”按钮更新文件解析状态。
  • +
+ +
@@ -192,6 +202,9 @@ export default { console.log(err) }) }, + openFileSelector() { + this.$refs.fileInput.click() + }, async handleFileChange(event) { const file = event.target.files[0] const allowedExtensions = ['.xlsx', '.xls', '.docx', '.doc', '.pdf', '.ofd', '.pptx', '.txt'] diff --git a/src/views/AIAssistant/AIIntelligentCoding/index.vue b/src/views/AIAssistant/AIIntelligentCoding/index.vue index 9891051..24f6212 100644 --- a/src/views/AIAssistant/AIIntelligentCoding/index.vue +++ b/src/views/AIAssistant/AIIntelligentCoding/index.vue @@ -68,11 +68,15 @@
-
-

专题名称:{{ currentResearch && currentResearch.researchTitle }}

-

编研类型:{{ currentResearch && currentResearch.researchType }}

+
+
+

专题名称:{{ currentResearch && currentResearch.researchTitle }}

+

编研类型:{{ currentResearch && currentResearch.researchType }}

+
+ 导出为 Word
diff --git a/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue b/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue index a4b73db..035d80d 100644 --- a/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue +++ b/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue @@ -173,7 +173,7 @@ - +
+ + + + + + + + + + @@ -202,7 +252,7 @@
-
- + +
@@ -283,7 +334,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, FetchMaxItemNoByParentId } from '@/api/collect/collect' -import { FetchInitAssistEnter, FetchDoHandleEnterAnalysis } from '@/api/ai/ai' +import { FetchInitAssistEnter, FetchDoHandleEnterAnalysis, FetchInitAssistEnterTemp } from '@/api/ai/ai' import { FetchArchivesClassTree } from '@/api/system/archivesClass' import Treeselect from '@riophae/vue-treeselect' import '@riophae/vue-treeselect/dist/vue-treeselect.css' @@ -365,6 +416,8 @@ export default { aIAssistEnterVisible: false, aiCategoryData: [], aiCategoryloading: false, + childLoading: false, + expandedRows: [], aiResultCaLoading: true, // ai分析得内容结果前得loading isDialogClosed: false, // 新增标志位,用于控制是否继续处理流式响应 reader: null // 用于存储响应体的读取器 @@ -1486,11 +1539,13 @@ export default { 'isHandle': 0 } FetchInitAssistEnter(params).then(data => { + data.forEach(function(item, index) { + item.hasChildren = true + item.children = null + item.childLoading = false + }) this.aiCategoryData = data this.aiCategoryloading = false - setTimeout(() => { - this.getDoHandleEnterAnalysis() - }, 1000) }) }, // 获取自动分析内容和提问 @@ -1499,13 +1554,48 @@ export default { this.aIAssistEnterVisible = false const params = { 'categoryId': this.selectedCategory.id, - 'anId': null + 'anId': row.id } FetchDoHandleEnterAnalysis(params).then(data => { // const inputMessage = data.query + '需要提取得内容部分是' + data.context this.sendMessage(data.query, data.context) }) }, + handleExpandChange(row, expandedRows) { + if (expandedRows.length > 0) { + // 展开行 + this.loadFile(row) + } else { + // 收起行 + row.children = null + } + }, + loadFile(row) { + row.childLoading = true + const params = { + 'anId': row ? row.id : null + } + FetchInitAssistEnterTemp(params).then(data => { + row.children = data + setTimeout(() => { + row.childLoading = false + }, 500) + }).catch(error => { + console.error('请求接口失败', error) + setTimeout(() => { + row.childLoading = false + }, 500) + }) + }, + handleAIClose() { + this.aiCategoryData = [] + this.aIAssistEnterVisible = false + }, + getFileSize(fileSize) { + const fileSizeInKB = (fileSize / 1024).toFixed(2) + 'kB' + const fileSizeInB = fileSize + 'B' + return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB + }, // 向deepseek发出提问和分析内容 async sendMessage(prompt, context) { const linkSrc = process.env.NODE_ENV === 'production' ? window.g.AIDeepSeekUrl : process.env.VUE_APP_AIDEEPSEEK_API @@ -1644,7 +1734,7 @@ export default { } .aiAssist-dialog{ ::v-deep .el-dialog{ - width: 1000px !important; + width: 1160px !important; } } @@ -1659,5 +1749,7 @@ pre { overflow: hidden; overflow-y: auto; } - +::v-deep .el-table.child-table tr{ + background-color: #f0f9eb; +}