|
|
@ -173,7 +173,7 @@ |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- AI辅助著录未处理已解析的文件 --> |
|
|
|
<el-dialog class="aiAssist-dialog" title="AI已解析文件" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="aIAssistEnterVisible"> |
|
|
|
<el-dialog class="aiAssist-dialog" title="AI已解析文件" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="aIAssistEnterVisible" :before-close="handleAIClose"> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<!-- @select="crud.selectChange" |
|
|
|
@select-all="crud.selectAllChange" |
|
|
@ -185,9 +185,59 @@ |
|
|
|
class="archives-table" |
|
|
|
:data="aiCategoryData" |
|
|
|
row-key="id" |
|
|
|
height="calc(100vh - 300px)" |
|
|
|
:default-expanded-rows="expandedRows" |
|
|
|
@expand-change="handleExpandChange" |
|
|
|
> |
|
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
|
<el-table-column label="任务编号" prop="id" /> |
|
|
|
<el-table-column type="expand"> |
|
|
|
<template slot-scope="{row }"> |
|
|
|
<el-table v-loading="row.childLoading" :data="row.children" class="child-table" :show-header="false"> |
|
|
|
<el-table-column width="100" align="center" /> |
|
|
|
<el-table-column prop="fileName" label="文件名称" show-overflow-tooltip min-width="200"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<i class="iconfont icon-attachment" /> |
|
|
|
<span style="margin-left: 10px">{{ scope.row.fileName }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column prop="fileType" label="格式" min-width="60" align="center" /> --> |
|
|
|
<el-table-column prop="fileSize" label="大小" min-width="85" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ getFileSize(scope.row.fileSize) }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="fileThumbnail" label="缩略图" min-width="60" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div v-if="scope.row.fileType === 'jpg' || scope.row.fileType === 'jpeg' || scope.row.fileType === 'png' || scope.row.fileType === 'bmp'|| scope.row.fileType === 'gif'"> |
|
|
|
<i class="fileIcon icon-image" /> |
|
|
|
</div> |
|
|
|
<div v-else-if="scope.row.fileType === 'xlsx' || scope.row.fileType === 'xls'"> |
|
|
|
<i class="fileIcon icon-excel" /> |
|
|
|
</div> |
|
|
|
<div v-else-if="scope.row.fileType === 'docx' || scope.row.fileType === 'doc'"> |
|
|
|
<i class="fileIcon icon-word" /> |
|
|
|
</div> |
|
|
|
<div v-else-if="scope.row.fileType === 'pdf'"> |
|
|
|
<i class="fileIcon icon-pdf" /> |
|
|
|
</div> |
|
|
|
<div v-else-if="scope.row.fileType === 'ppt' || scope.row.fileType === 'pptx'"> |
|
|
|
<i class="fileIcon icon-ppt" /> |
|
|
|
</div> |
|
|
|
<div v-else-if="scope.row.fileType === 'zip' || scope.row.fileType === 'rar'"> |
|
|
|
<i class="fileIcon icon-zip" /> |
|
|
|
</div> |
|
|
|
<div v-else-if="scope.row.fileType === 'txt'"> |
|
|
|
<i class="fileIcon icon-txt" /> |
|
|
|
</div> |
|
|
|
<div v-else> |
|
|
|
<i class="fileIcon icon-other" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="任务编号" prop="id" min-width="280" /> |
|
|
|
<el-table-column label="文件数量" prop="fileNum" /> |
|
|
|
<el-table-column label="创建人" prop="create_by" /> |
|
|
|
<el-table-column label="创建时间" prop="update_time" align="center" width="160"> |
|
|
@ -202,7 +252,7 @@ |
|
|
|
<div v-else>-</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="状态" prop="status" align="center" width="140"> |
|
|
|
<el-table-column label="状态" prop="status" align="center" width="80"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="!scope.row.isAnalysis" class="row-state row-warehousing state-active">解析中</span> |
|
|
|
<span v-else class="row-state row-binding state-active">已解析</span> |
|
|
@ -216,6 +266,7 @@ |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
@ -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; |
|
|
|
} |
|
|
|
</style> |