Browse Source

AI智能标注/bug

master
xuhuajiao 4 months ago
parent
commit
0e145841e4
  1. 22
      src/api/collect/collect.js
  2. 263
      src/views/AIAssistant/AIKeywords/archivesList.vue
  3. 5
      src/views/AIAssistant/AIKeywords/index.vue
  4. 222
      src/views/AIAssistant/AIKeywords/module/editOcrContent.vue
  5. 9
      src/views/collectReorganizi/collectionLibrary/module/archivesInfo/index.vue
  6. 79
      src/views/collectReorganizi/collectionLibrary/module/markInfo/index.vue
  7. 55
      src/views/system/user/index.vue

22
src/api/collect/collect.js

@ -322,6 +322,24 @@ export function FetchAIResultZhulu(params) {
}) })
} }
// 手动解析电子原文
export function FetchManualAnalysis(data) {
return request({
url: 'api/collect/manualAnalysis',
method: 'post',
data
})
}
// 获取已解析的文本
export function FetchAnalysisedText(params) {
return request({
url: 'api/collect/getAnalysisedText',
method: 'get',
params
})
}
export default { export default {
collectAdd, collectAdd,
collectEdit, collectEdit,
@ -354,5 +372,7 @@ export default {
FetchBusinessFlowTitle, FetchBusinessFlowTitle,
FetchBecomeDocument, FetchBecomeDocument,
FetchInitExternalReceptionDetailsList, FetchInitExternalReceptionDetailsList,
FetchAIResultZhulu
FetchAIResultZhulu,
FetchManualAnalysis,
FetchAnalysisedText
} }

263
src/views/AIAssistant/AIKeywords/archivesList.vue

@ -3,17 +3,17 @@
<div class="ai-keyword-archives"> <div class="ai-keyword-archives">
<div class="collect-header"> <div class="collect-header">
<h4 class="is-juannei">{{ collectTitle }} </h4> <h4 class="is-juannei">{{ collectTitle }} </h4>
<div class="head-search" style="align-items: center;">
<div class="head-search" style="align-items: center; margin-right: 10px;">
<treeselect <treeselect
v-model="query.archive_ctg_no" v-model="query.archive_ctg_no"
:options="classifyOptions" :options="classifyOptions"
style="width: 180px; margin-right: 10px;" style="width: 180px; margin-right: 10px;"
flat flat
:multiple="false" :multiple="false"
:clearable="false"
:normalizer="normalizer" :normalizer="normalizer"
placeholder="请选择档案分类" placeholder="请选择档案分类"
@input="handleSearch(collectLevel)"
@select="handleSearch(collectLevel)"
@select="node=>treeSelectInput(node)"
> >
<p <p
slot="option-label" slot="option-label"
@ -24,8 +24,8 @@
<template> {{ node.label }} </template> <template> {{ node.label }} </template>
</p> </p>
</treeselect> </treeselect>
<el-input v-model="query.search" clearable size="small" placeholder="输入题名或档号" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="handleSearch(collectLevel)" @clear="handleSearch(collectLevel)" />
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="handleSearch(collectLevel)">搜索</el-button>
<el-input v-model="query.search" clearable size="small" placeholder="输入题名或档号" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="handleSearch()" @clear="handleSearch()" />
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="handleSearch()">搜索</el-button>
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button> <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
</div> </div>
</div> </div>
@ -40,6 +40,8 @@
height="calc(100vh - 600px)" height="calc(100vh - 600px)"
:row-class-name="tableRowClassName" :row-class-name="tableRowClassName"
:row-key="rowKey" :row-key="rowKey"
@row-click="clickRowHandler"
@cell-dblclick="tableDoubleClick"
> >
<el-table-column label="序号" width="55" align="center" show-overflow-tooltip> <el-table-column label="序号" width="55" align="center" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
@ -116,7 +118,7 @@
<el-table-column type="selection" width="55" :reserve-selection="true" align="center" /> <el-table-column type="selection" width="55" :reserve-selection="true" align="center" />
<el-table-column label="序号" width="55" align="center" show-overflow-tooltip> <el-table-column label="序号" width="55" align="center" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ (page.page === 1 ? 0 : (page.page === 0 ? 0 : page.page - 1)) * page.size + scope.$index + 1 }}</span>
<span>{{ (filePage.page === 1 ? 0 : (filePage.page === 0 ? 0 : filePage.page - 1)) * filePage.size + scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="file_name" label="原文名称" show-overflow-tooltip min-width="140" /> <el-table-column prop="file_name" label="原文名称" show-overflow-tooltip min-width="140" />
@ -126,36 +128,36 @@
{{ getFileSize(scope.row.file_size) }} {{ getFileSize(scope.row.file_size) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="file_state" label="解析状态" min-width="60" align="center" class-name="parse-column">
<el-table-column prop="is_analysis" label="解析状态" min-width="60" align="center" class-name="parse-column">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.file_state===0" class="row-state">未解析</span>
<span v-if="scope.row.file_state===1" class="row-state row-warehousing state-active">解析中</span>
<span v-if="scope.row.file_state===2" class="row-state row-binding state-active">已解析</span>
<span v-if="scope.row.is_analysis===-1" class="row-state">未解析</span>
<span v-if="scope.row.is_analysis===0" class="row-state row-warehousing state-active">解析中</span>
<span v-if="scope.row.is_analysis===1" class="row-state row-binding state-active">已解析</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="file_state" label="解析操作" min-width="60" align="center" class-name="parse-column">
<el-table-column prop="is_analysis" label="解析操作" min-width="60" align="center" class-name="parse-column">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.file_state===0" size="mini" class="check-btn" style="padding: 5px; margin: 0;" @click="handleCurrentAIOcr(scope.row)">
<el-button v-if="scope.row.is_analysis===-1" size="mini" class="check-btn" style="padding: 5px; margin: 0;" @click="handleCurrentAIOcr(scope.row)">
<i class="iconfont icon-wenjianjiexi" /> <i class="iconfont icon-wenjianjiexi" />
解析 解析
</el-button> </el-button>
<el-button v-if="scope.row.file_state===2" size="mini" class="check-btn" style="padding: 5px; margin: 0;" @click="handleEditAIOcr(scope.row)">
<el-button v-if="scope.row.is_analysis===1" size="mini" class="check-btn" style="padding: 5px; margin: 0;" @click="handleEditAIOcr(scope.row)">
<i class="iconfont icon-bianji" /> <i class="iconfont icon-bianji" />
编辑 编辑
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="file_mark_state" label="标注状态" min-width="60" align="center" class-name="mark-column">
<el-table-column prop="is_mark" label="标注状态" min-width="60" align="center" class-name="mark-column">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.file_mark_state===0" class="row-state">未标注</span>
<span v-if="scope.row.file_mark_state===1" class="row-state row-binding state-active">已标注</span>
<span v-if="scope.row.is_mark===0" class="row-state">未标注</span>
<span v-if="scope.row.is_mark===1" class="row-state row-binding state-active">已标注</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="file_mark_state" label="标注操作" min-width="60" align="center" class-name="mark-column">
<el-table-column prop="is_mark" label="标注操作" min-width="60" align="center" class-name="mark-column">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.file_state===2" size="mini" class="check-btn" style="padding: 5px; margin: 0;" @click="handleMarkKeyword(scope.row)">
<el-button v-if="scope.row.is_analysis===1" size="mini" class="check-btn" style="padding: 5px; margin: 0;" @click="handleMarkKeyword(scope.row)">
<i class="iconfont icon-bianji" /> <i class="iconfont icon-bianji" />
{{ scope.row.file_mark_state===1 ? '编辑' :'标注' }}
{{ scope.row.is_mark===1 ? '编辑' :'标注' }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -175,21 +177,24 @@
</div> </div>
<EditOcrContent ref="ocrRefs" /> <EditOcrContent ref="ocrRefs" />
<KeywordMark ref="markRefs" /> <KeywordMark ref="markRefs" />
<!-- 档案详情 -->
<ArchivesInfo ref="archivesInfo" :selected-category="selectedCategory" :arc-id="arcId" :is-title-type="3" :is-collect="true" />
</div> </div>
</template> </template>
<script> <script>
import { header, form } from '@crud/crud' import { header, form } from '@crud/crud'
import { FetchInitCategoryViewTable, FetchInitCategoryView } from '@/api/collect/collect'
import { FetchInitCategoryViewTable, FetchInitCategoryView, FetchManualAnalysis } from '@/api/collect/collect'
import { FetchArchivesClassTree } from '@/api/system/archivesClass' import { FetchArchivesClassTree } from '@/api/system/archivesClass'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import EditOcrContent from './module/editOcrContent' import EditOcrContent from './module/editOcrContent'
import KeywordMark from './module/keywordMark' import KeywordMark from './module/keywordMark'
import ArchivesInfo from '@/views/collectReorganizi/collectionLibrary/module/archivesInfo/index'
export default { export default {
name: 'Sorted', name: 'Sorted',
components: { EditOcrContent, KeywordMark, Treeselect },
components: { EditOcrContent, KeywordMark, Treeselect, ArchivesInfo },
mixins: [ mixins: [
header(), header(),
form({}) form({})
@ -202,6 +207,11 @@ export default {
} }
} }
}, },
provide() {
return {
parentsData: this
}
},
data() { data() {
return { return {
query: { query: {
@ -219,64 +229,10 @@ export default {
size: 10, size: 10,
total: 0 total: 0
}, },
currentParentRow: {},
parentId: null,
fileLoading: false, fileLoading: false,
fileData: [
{
'create_time': '2025-3-6 10:29:43',
'file_name': 'DAT 18-2022 档案著录规则_02.png',
'file_type': 'png',
'file_dpi': '1653px*2339px',
'id': '6D48990DF88B21EB7609EB',
'archive_id': 'EC7D3E9798DE5DD7A6DFC0',
'file_size': 436989,
'file_state': 0,
'file_mark_state': 0
},
{
'create_time': '2025-3-6 10:29:43',
'file_name': 'DAT 18-2022 档案著录规则_04.png',
'file_type': 'png',
'file_dpi': '1653px*2339px',
'id': '7A699E8D7FB01E3D7C1653',
'archive_id': 'EC7D3E9798DE5DD7A6DFC0',
'file_size': 512453,
'file_state': 1,
'file_mark_state': 0
},
{
'create_time': '2025-3-6 10:29:43',
'file_name': 'DAT 18-2022 档案著录规则_00.png',
'file_type': 'png',
'file_dpi': '1653px*2339px',
'id': '8A1F52E855304609020EB3',
'archive_id': 'EC7D3E9798DE5DD7A6DFC0',
'file_size': 289748,
'file_state': 2,
'file_mark_state': 0
},
{
'create_time': '2025-3-6 10:29:43',
'file_name': 'DAT 18-2022 档案著录规则_01.png',
'file_type': 'png',
'file_dpi': '1653px*2339px',
'id': 'A20895478FDC988B7EA6D5',
'archive_id': 'EC7D3E9798DE5DD7A6DFC0',
'file_size': 686235,
'file_state': 2,
'file_mark_state': 0
},
{
'create_time': '2025-3-6 10:29:43',
'file_name': 'DAT 18-2022 档案著录规则_03.png',
'file_type': 'png',
'file_dpi': '1653px*2339px',
'id': 'D594A10A3C78F3A5EB17B9',
'archive_id': 'EC7D3E9798DE5DD7A6DFC0',
'file_size': 466450,
'file_state': 2,
'file_mark_state': 1
}
],
fileData: [],
filePage: { filePage: {
page: 1, page: 1,
size: 10, size: 10,
@ -341,10 +297,11 @@ export default {
'project_class': null, 'project_class': null,
'archive_ctg_no': null 'archive_ctg_no': null
} }
this.handleSearch(this.collectLevel)
},
handleSearch(collectLevel) {
this.currentParentRow = {}
this.parentId = null
this.fileData = []
this.$refs.tableFile.clearSelection()
this.getAiFileList()
}, },
rowKey(row) { rowKey(row) {
return row.id return row.id
@ -372,51 +329,105 @@ export default {
} }
}) })
this.$nextTick(() => { this.$nextTick(() => {
console.log('2222')
this.getAiFileList() this.getAiFileList()
}) })
} }
}) })
}, },
async getAiFileList() {
getAiFileList() {
if (!this.parentId) {
this.loading = true this.loading = true
this.archivesTable = [] this.archivesTable = []
} else {
this.fileLoading = true
}
this.fileData = []
const params = { const params = {
'categoryId': this.selectedCategory.id, 'categoryId': this.selectedCategory.id,
'categoryLevel': 3,
'parentId': null,
'ignore': true,
'categoryLevel': this.parentId ? 4 : 3,
'parentId': this.parentId ? this.parentId : null,
'ignore': !this.parentId,
'isdel': false, 'isdel': false,
'page': this.page.page === 0 ? 0 : this.page.page - 1,
'page': !this.parentId ? (this.page.page === 0 ? 0 : this.page.page - 1) : 0,
'size': this.page.size, 'size': this.page.size,
'sort': this.arrySort,
'retention': null,
'security_class': null,
'search': this.query.search,
'medium_type': null,
'doc_type': null,
'archive_year': null,
'organ_or_function': null,
'sort': !this.parentId ? this.arrySort : null,
'search': !this.parentId ? this.query.search : null,
'fonds_no': this.selectedCategory.fondsId, 'fonds_no': this.selectedCategory.fondsId,
'project_class': this.query.project_class,
'archive_ctg_no': this.query.archive_ctg_no
'project_class': !this.parentId ? this.query.project_class : null,
'archive_ctg_no': !this.parentId ? this.query.archive_ctg_no : null
} }
const res = await FetchInitCategoryView(params)
FetchInitCategoryView(params).then((res) => {
if (this.parentId) {
this.fileData = res.list.content
this.filePage.total = res.list.totalElements
} else {
this.archivesTable = res.list.content this.archivesTable = res.list.content
this.page.total = res.list.totalElements this.page.total = res.list.totalElements
}
setTimeout(() => {
this.loading = false this.loading = false
this.fileLoading = false
}, 500)
})
},
handleSearch() {
this.parentId = null
this.fileData = []
this.$refs.tableFile.clearSelection()
this.page.page = 1
this.getAiFileList()
},
treeSelectInput(value) {
console.log(value)
this.query.archive_ctg_no = value.code
this.parentId = null
this.fileData = []
this.$refs.tableFile.clearSelection()
this.handleSearch()
}, },
handleSizeChange(size) { handleSizeChange(size) {
this.page.size = size this.page.size = size
this.page.page = 1 this.page.page = 1
this.parentId = null
this.fileData = []
this.$refs.tableFile.clearSelection()
this.getAiFileList() this.getAiFileList()
}, },
handleCurrentPage(val) { handleCurrentPage(val) {
this.page.page = val this.page.page = val
this.parentId = null
this.fileData = []
this.$refs.tableFile.clearSelection()
this.getAiFileList() this.getAiFileList()
}, },
clickRowHandler(row) {
console.log('tableRow', row)
this.currentParentRow = row
this.parentId = row.id
this.$refs.tableFile.clearSelection()
this.getAiFileList()
},
tableDoubleClick(row) {
this.arcId = row.id
this.$nextTick(() => {
this.$refs.archivesInfo.isHasFile = true
this.$refs.archivesInfo.detailTitle = '文件详情'
this.$refs.archivesInfo.getDetial(3, row.id)
this.$refs.archivesInfo.isFourTest = true
this.$refs.archivesInfo.archivesInfoVisible = true
this.$refs.archivesInfo.archivesTabIndex = 0
})
},
// //
refreshFile() { refreshFile() {
this.parentId = this.currentParentRow.id
if (this.parentId) {
this.$refs.tableFile.clearSelection()
this.getAiFileList()
}
}, },
// table - // table -
tableDoubleClickFile(row) { tableDoubleClickFile(row) {
@ -430,8 +441,6 @@ export default {
}, },
// //
batchAIOcrFile() { batchAIOcrFile() {
console.log('fileSelections', this.fileSelections)
this.$confirm('当前所选文件即将进行批量解析' + '<span>你是否还要继续?</span>', '提示', { this.$confirm('当前所选文件即将进行批量解析' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续', confirmButtonText: '继续',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -440,43 +449,35 @@ export default {
}).then(() => { }).then(() => {
// //
const filteredFiles = this.fileSelections.filter(file => file.file_state !== 2) const filteredFiles = this.fileSelections.filter(file => file.file_state !== 2)
console.log(filteredFiles)
// const params = {
// 'categoryId': this.selectedCategory.id,
// 'archivesIds': archivesIds
// }
// FetchDisbandArchives(params).then((res) => {
// if (res.code !== 500) {
// this.$message({ message: '', type: 'success', offset: 8 })
// this.handleSearch(this.collectLevel)
// } else {
// this.$message({ message: '', type: 'error', offset: 8 })
// }
// }).catch(err => {
// console.log(err)
// })
this.handleAnalysis(filteredFiles)
}).catch(() => { }).catch(() => {
}) })
}, },
// //
handleCurrentAIOcr(row) { handleCurrentAIOcr(row) {
// const params = {
// 'categoryId': this.selectedCategory.id,
// 'archivesIds': archivesIds
// }
// FetchDisbandArchives(params).then((res) => {
// if (res.code !== 500) {
// this.$message({ message: '', type: 'success', offset: 8 })
// this.handleSearch(this.collectLevel)
// } else {
// this.$message({ message: '', type: 'error', offset: 8 })
// }
// }).catch(err => {
// console.log(err)
// })
this.fileSelections = []
this.fileSelections.push(row)
console.log('this.fileSelections', this.fileSelections)
this.handleAnalysis(this.fileSelections)
},
handleAnalysis(filteredFiles) {
const params = {
'categoryId': this.selectedCategory.id,
'fileJsonString': JSON.stringify(filteredFiles)
}
FetchManualAnalysis(params).then((res) => {
console.log('res', res)
if (res.code !== 500) {
this.$message({ message: '提交解析文件成功', type: 'success', offset: 8 })
} else {
this.$message({ message: '提交解析文件失败', type: 'error', offset: 8 })
}
}).catch(err => {
console.log(err)
})
}, },
handleEditAIOcr(row) { handleEditAIOcr(row) {
this.$refs.ocrRefs.ocrVisible = true
this.$refs.ocrRefs.getFileConent(row)
}, },
handleMarkKeyword(row) { handleMarkKeyword(row) {
this.$refs.markRefs.markVisible = true this.$refs.markRefs.markVisible = true

5
src/views/AIAssistant/AIKeywords/index.vue

@ -126,9 +126,12 @@ export default {
localStorage.setItem('currentArchivesKey', JSON.stringify(val)) localStorage.setItem('currentArchivesKey', JSON.stringify(val))
this.selectedCategory = val this.selectedCategory = val
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.archivesListRef.parentId = null
this.$refs.archivesListRef.fileData = []
this.$refs.archivesListRef.$refs.tableFile.clearSelection()
this.$refs.archivesListRef.page.page = 1 this.$refs.archivesListRef.page.page = 1
this.$refs.archivesListRef.getViewTable()
this.$refs.archivesListRef.getInitArchivesClass() this.$refs.archivesListRef.getInitArchivesClass()
this.$refs.archivesListRef.getViewTable()
}) })
} }
}, },

222
src/views/AIAssistant/AIKeywords/module/editOcrContent.vue

@ -2,7 +2,22 @@
<!-- 编辑解析 --> <!-- 编辑解析 -->
<el-dialog class="aiFile-dialog" title="编辑解析" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="ocrVisible" :before-close="handleCloseDialog"> <el-dialog class="aiFile-dialog" title="编辑解析" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="ocrVisible" :before-close="handleCloseDialog">
<div class="setting-dialog"> <div class="setting-dialog">
<div v-show="onlyFile" style="display: flex; justify-content: space-between; height: 700px;">
<div id="printArea" ref="output" v-loading="filePrewLoading" class="well-box" :style="{overflowY : !filePrewLoading ? 'auto' : 'hidden'}" />
<div v-for="(item, index) in swiperImg" :key="index">
<div
v-loading="ocrLoading"
class="aiText"
:class="{ editable: editingIndex === index }"
contenteditable="false"
@click="startEditing(index)"
@blur="saveEditing(index)"
v-html="item.textWithBr"
/>
</div>
</div>
<swiper <swiper
v-show="!onlyFile"
ref="mySwiper" ref="mySwiper"
class="swiper-server" class="swiper-server"
:options="swiperOptionServer" :options="swiperOptionServer"
@ -13,7 +28,7 @@
> >
<swiper-slide v-for="(item, index) in swiperImg" :key="index" class="swiper-slide-server"> <swiper-slide v-for="(item, index) in swiperImg" :key="index" class="swiper-slide-server">
<div class="aiImg"> <div class="aiImg">
<img src="~@/assets/images/test/4.png">
<img :src="item.ocr_path">
</div> </div>
<div <div
class="aiText" class="aiText"
@ -35,6 +50,9 @@
</template> </template>
<script> <script>
import { FetchAnalysisedText } from '@/api/collect/collect'
import { FetchBase64ByFileId } from '@/api/archivesManage/library'
import { getExtend, readBuffer, render } from '@/components/util'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { swiper, swiperSlide } from 'vue-awesome-swiper' import { swiper, swiperSlide } from 'vue-awesome-swiper'
import 'swiper/css/swiper.css' import 'swiper/css/swiper.css'
@ -51,21 +69,6 @@ export default {
displayedText: '', displayedText: '',
isTxtEditing: new Array(3).fill(false), isTxtEditing: new Array(3).fill(false),
swiperImg: [ swiperImg: [
{
'file_path': '~@/assets/images/test/1.png',
'ocr_path': 'D:/ProjectsFTZN/Python/Project_AI_dangan/service_AI_archives_fileParsing/files\\img\\ocr_1.jpg',
'content': 'ICS 01.140.30\nA13\nGB\n中华人民共和国国家标准\nGB/T7408-2005/ISO8601:2000\n代替GB/T7408-1994\n数据元和交换格式\n信息交换\n日期和时间表示法\nDataelementsandinterchangeformats-\nInformation interchange-Representation of dates and times\n(ISO8601:2000,IDT)\n2005-03-28发布\n2005-10-01实施\n中华人民共和国国家质量监督检验检疫总局\n发布\n中国国家标准化管理委员会'
},
{
'file_path': '~@/assets/images/test/2.png',
'ocr_path': 'D:/ProjectsFTZN/Python/Project_AI_dangan/service_AI_archives_fileParsing/files\\img\\ocr_2.jpg',
'content': 'GB/T7408--2005/ISO8601:2000\n目\n次\n前言\n1范围\n2规范性引用文件\n3术语和定义\n4基本原则\n5表示法\n....\nX\n附录A(资料性附录)举例\n20\nA.1日期(见表A.1)\n20\nA.2\n日的时间(见表A.2)\n20\nA.3\n日期和该日的时间的组合(见表A.3)\n21\nA.4\n时间间隔(见表A.4)\n22\nA.5\n循环时间间隔(见表A.5)\n22'
},
{
'file_path': '~@/assets/images/test/3.png',
'ocr_path': 'D:/ProjectsFTZN/Python/Project_AI_dangan/service_AI_archives_fileParsing/files\\img\\ocr_3.jpg',
'content': 'GB/T7408-2005/ISO8601:2000\n前言\n本标准等同采用国际标准ISO8601一2000《数据元和交换格式信息交换日期和时间表示法》\n(英文版),并且代替GB/T7408一1994《数据元和交换格式信息交换日期和时间表示法》。\n本标准与GB/T7408-1994相比主要变化如下:\n增加日期和时间历法系统(本版的4.3);\n一一完善1994年版本的日期和时间的各种表示法(本版本的5.1,5.2,5.3,5.4);\n一增加时间间隔和循环时间间隔的表示法(本版本的5.5,5.6)。\n本标准的附录A为资料性附录。\n本标准由中国标准化研究院提出。\n本标准由全国电子业务标准化技术委员会归口。\n本标准起草单位:中国标准化研究院。\n本标准主要起草人:章建方、刘碧松、魏宏、孙文峰、刘颖。'
}
], ],
swiperOptionServer: { swiperOptionServer: {
autoplay: false, autoplay: false,
@ -79,7 +82,34 @@ export default {
return '<span class="' + className + '">' + (index + 1) + '</span>' return '<span class="' + className + '">' + (index + 1) + '</span>'
} }
} }
}
},
onlyFile: true,
src: '',
filePrewLoading: false,
//
last: null,
//
hidden: false,
printObj: {
id: 'printArea',
preview: true, // false
previewTitle: '电子原文预览', //
previewPrintBtnLabel: '预览结束,开始打印',
zIndex: 20002, // z-index20002
extraCss: '', // css
extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>,<style> #printArea { height: auto !important; } <style>', //
previewBeforeOpenCallback() { console.log('正在加载预览窗口!') }, // callback
previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // callback
beforeOpenCallback() { console.log('开始打印之前!') }, // callback
openCallback() { console.log('执行打印了!') }, // callback
closeCallback() { console.log('关闭了打印工具!') }, // callback(or)
clickMounted() { console.log('点击v-print绑定的按钮了!') },
standard: '',
extarCss: ''
},
timer: null,
toFile: null,
fileCurrent: null
} }
}, },
computed: { computed: {
@ -105,11 +135,142 @@ export default {
} }
}, },
created() { created() {
this.swiperImg = this.processedSwiperImg
}, },
mounted() { mounted() {
}, },
methods: { methods: {
getFileConent(row) {
this.ocrLoading = true
this.swiperImg = []
const params = {
'filePath': row.file_path
}
FetchAnalysisedText(params).then((res) => {
this.ocrVisible = true
const resultJson = JSON.parse(res)
console.log('resultJson', resultJson.data)
console.log('resultJson.length', resultJson.data.length)
console.log('resultJson.length2', resultJson.data[0].ocr_path)
// ,
if (resultJson.data.length === 1) {
console.log('非多个图片的情况,用自身的预览')
if (resultJson.data[0].ocr_path === null) {
this.onlyFile = true
this.$nextTick(() => {
this.getBase64ByFileId(row)
})
} else {
this.onlyFile = false
}
} else {
this.onlyFile = false
console.log('多张图片,用swiper')
}
this.swiperImg = resultJson.data
this.swiperImg = this.processedSwiperImg
}).catch(err => {
console.log(err)
})
},
getBase64ByFileId(row) {
this.filePrewLoading = true
const params = {
'fileId': row.id
}
FetchBase64ByFileId(params).then(res => {
console.log('res', res)
var base64String = res
var fileName = row.file_name
var mimeType = row.file_type
this.toFile = this.base64ToFile(base64String, fileName, mimeType)
if (this.toFile) {
this.handleChange()
}
})
},
base64ToFile(base64String, fileName, mimeType) {
var byteCharacters = atob(base64String)
var byteArrays = []
for (var offset = 0; offset < byteCharacters.length; offset += 512) {
var slice = byteCharacters.slice(offset, offset + 512)
var byteNumbers = new Array(slice.length)
for (var i = 0; i < slice.length; i++) {
byteNumbers[i] = slice.charCodeAt(i)
}
var byteArray = new Uint8Array(byteNumbers)
byteArrays.push(byteArray)
}
var file = new Blob(byteArrays, { type: mimeType })
file.name = fileName
return file
},
async handleChange(e) {
try {
clearTimeout(this.timer)
// const [file] = e.target.files
// console.log('file', file)
const fileReader = new FileReader()
fileReader.readAsArrayBuffer(this.toFile)
fileReader.onload = () => {
this.src = fileReader.result
}
const arrayBuffer = await readBuffer(this.toFile)
this.last = await this.displayResult(arrayBuffer, this.toFile)
this.$nextTick(() => {
//
// const extend = getExtend(this.toFile.name)
//
const maskDiv = document.getElementsByClassName('mask_div')
const imgMaskDiv = document.getElementsByClassName('weterbox')
if (imgMaskDiv.length === 1) {
document.getElementsByClassName('water-mask')[0].removeChild(imgMaskDiv[0])
}
// docx-wrapper docx
for (var j = maskDiv.length - 1; j >= 0; j--) {
document.getElementsByClassName('water-mask')[0].removeChild(maskDiv[j])
}
// if (!extend.includes('pdf')) {
// this.getWatermark()
// }
})
} catch (e) {
console.error(e)
} finally {
this.timer = setTimeout(() => {
this.filePrewLoading = false
this.ocrLoading = false
}, 1000)
}
},
displayResult(buffer, file) {
//
const { name } = file
//
const extend = getExtend(name)
//
const { output } = this.$refs
console.log('output', output)
// dom
const node = document.createElement('div')
// vuedom
if (this.last) {
output.removeChild(this.last.$el)
this.last.$destroy()
}
console.log('output', output)
const child = output.appendChild(node)
//
return new Promise((resolve, reject) =>
render(buffer, extend, child).then(resolve).catch(reject)
)
},
startEditing(index) { startEditing(index) {
this.editingIndex = index this.editingIndex = index
const slide = this.$el.querySelectorAll('.swiper-slide-server')[index] const slide = this.$el.querySelectorAll('.swiper-slide-server')[index]
@ -186,8 +347,13 @@ export default {
width: 100%; width: 100%;
} }
} }
}
}
}
.aiText { .aiText {
flex: 1;
width: 600px;
padding: 0 10px; padding: 0 10px;
white-space: pre-wrap; white-space: pre-wrap;
word-wrap: break-word; word-wrap: break-word;
@ -196,15 +362,25 @@ export default {
padding: 10px; padding: 10px;
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 4px; border-radius: 4px;
height: calc(100vh - 245px);
height: calc(100vh - 240px);
overflow: hidden; overflow: hidden;
overflow-y: auto; overflow-y: auto;
} }
}
}
}
.dialog-footer{ .dialog-footer{
margin-top: 0; margin-top: 0;
} }
.well-box{
position: relative;
width: 800px;
border: 1px solid #edeff3;
background-color: #f6f8fc;
height: calc(100vh - 240px);
margin-right: 20px;
overflow: hidden;
}
::v-deep .home_wrap .pdf_down{
display: none;
}
</style> </style>

9
src/views/collectReorganizi/collectionLibrary/module/archivesInfo/index.vue

@ -13,6 +13,7 @@
<li :class="{'active-tab-nav': archivesTabIndex == 2}" @click="changeActiveTab(2)">元数据</li> <li :class="{'active-tab-nav': archivesTabIndex == 2}" @click="changeActiveTab(2)">元数据</li>
<li v-if="isFourTest" :class="{'active-tab-nav': archivesTabIndex == 3}" @click="changeActiveTab(3)">四性检测</li> <li v-if="isFourTest" :class="{'active-tab-nav': archivesTabIndex == 3}" @click="changeActiveTab(3)">四性检测</li>
<li v-if="isFourTest && isHasFile" :class="{'active-tab-nav': archivesTabIndex == 4}" @click="changeActiveTab(4)">操作记录</li> <li v-if="isFourTest && isHasFile" :class="{'active-tab-nav': archivesTabIndex == 4}" @click="changeActiveTab(4)">操作记录</li>
<li v-if="isFourTest && isHasFile" :class="{'active-tab-nav': archivesTabIndex == 6}" @click="changeActiveTab(6)">标注信息</li>
</ul> </ul>
<!-- 基本信息 --> <!-- 基本信息 -->
<div v-if="archivesTabIndex==0" class="base-info item-content"> <div v-if="archivesTabIndex==0" class="base-info item-content">
@ -42,6 +43,7 @@
<FourTestInfo v-show="archivesTabIndex===3" ref="fourTestInfoRefs" /> <FourTestInfo v-show="archivesTabIndex===3" ref="fourTestInfoRefs" />
<HandleInfo v-show="archivesTabIndex===4" ref="handleInfoRefs" /> <HandleInfo v-show="archivesTabIndex===4" ref="handleInfoRefs" />
<ArchivesListModule v-show="archivesTabIndex===5" ref="archivesListModuleRef" :selected-category="selectedCategory" :is-title-type="isTitleType" :is-collect="isCollect" /> <ArchivesListModule v-show="archivesTabIndex===5" ref="archivesListModuleRef" :selected-category="selectedCategory" :is-title-type="isTitleType" :is-collect="isCollect" />
<MarkInfo v-show="archivesTabIndex===6" ref="markInfoRefs" />
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
@ -53,9 +55,10 @@ import { FetchDetailsById, FetchArchivesMetadata } from '@/api/collect/collect'
import UploadFile from '../uploadFile/index' import UploadFile from '../uploadFile/index'
import FourTestInfo from '../fourTestInfo/index' import FourTestInfo from '../fourTestInfo/index'
import HandleInfo from '../handleInfo/index' import HandleInfo from '../handleInfo/index'
import MarkInfo from '../markInfo/index'
export default { export default {
name: 'ArchivesInfo', name: 'ArchivesInfo',
components: { UploadFile, FourTestInfo, HandleInfo },
components: { UploadFile, FourTestInfo, HandleInfo, MarkInfo },
mixins: [ mixins: [
form({}) form({})
], ],
@ -159,6 +162,10 @@ export default {
this.$refs.archivesListModuleRef.parentId = this.arcId this.$refs.archivesListModuleRef.parentId = this.arcId
this.$refs.archivesListModuleRef.isDetail = true this.$refs.archivesListModuleRef.isDetail = true
this.$refs.archivesListModuleRef.getViewTable() this.$refs.archivesListModuleRef.getViewTable()
} else if (this.archivesTabIndex === 6) {
console.log(this.$refs.markInfoRefs)
this.$refs.markInfoRefs.currentArcId = this.arcId
this.$refs.markInfoRefs.getArchivesOperateLog(this.arcId)
} }
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.uploadFile) { if (this.$refs.uploadFile) {

79
src/views/collectReorganizi/collectionLibrary/module/markInfo/index.vue

@ -0,0 +1,79 @@
<template>
<!--档案详情-标注信息-->
<div class="fourTest-container">
<el-table class="archives-table" :data="tableData" style="min-width: 100%" height="calc(100vh - 440px)">
<el-table-column prop="operateType" label="标注对象" min-width="60" />
<el-table-column prop="opinion" label="标注" />
</el-table>
<!-- <el-pagination
v-if="tableData.length !== 0"
:current-page="page.page"
:total="page.total"
:page-size="page.size"
:pager-count="5"
layout="total, prev, pager, next, sizes"
@size-change="handleSizeChange"
@current-change="handleCurrentPage"
/> -->
</div>
</template>
<script>
import { FetchArchivesOperateLog } from '@/api/archivesManage/library'
export default {
name: 'MarkInfo',
components: { },
mixins: [],
data() {
return {
currentArcId: null,
tableData: [],
page: {
page: 0,
size: 10,
total: 0
}
}
},
created() {
},
mounted() {
},
methods: {
getArchivesOperateLog(arcId) {
// 1. 2.退 3. 4. 5. 6.线7.线 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19.
const params = {
'archivesId': arcId,
// 'operateType': null,
'page': this.page.page,
'size': this.page.size
// 'startTime': '',
// 'endTime': ''
}
FetchArchivesOperateLog(params).then(data => {
if (data.content && data.content.length !== 0) {
this.tableData = data.content
this.page.total = data.totalElements
} else {
this.tableData = []
this.page.total = 0
}
})
},
handleSizeChange(size) {
this.page.size = size
this.page.page = 0
this.getArchivesOperateLog(this.currentArcId)
},
handleCurrentPage(val) {
this.page.page = val
this.getArchivesOperateLog(this.currentArcId)
}
}
}
</script>
<style lang='scss' scoped>
@import "~@/assets/styles/collect-reorganizi.scss";
</style>

55
src/views/system/user/index.vue

@ -364,18 +364,20 @@ export default {
[CRUD.HOOK.afterToCU](crud, form) { [CRUD.HOOK.afterToCU](crud, form) {
this.getRoles() this.getRoles()
this.getPosts() this.getPosts()
},
//
[CRUD.HOOK.beforeToAdd](crud, form) {
this.postDatas = []
this.roleDatas = []
crud.form.id = null
if (this.leftFondsId) { if (this.leftFondsId) {
this.changeFondsValue(this.leftFondsId) this.changeFondsValue(this.leftFondsId)
form.fonds.id = this.leftFondsId form.fonds.id = this.leftFondsId
form.dept.id = this.query.deptsId ? this.query.deptsId : null
this.leftDeptsId = null
form.dept.id = this.crud.query.deptsId ? this.crud.query.deptsId : null
} }
}, },
//
[CRUD.HOOK.beforeToAdd]() {
this.postDatas = []
this.roleDatas = []
},
// //
[CRUD.HOOK.beforeToEdit](crud, form) { [CRUD.HOOK.beforeToEdit](crud, form) {
this.lastValue = '' this.lastValue = ''
@ -384,9 +386,8 @@ export default {
form.posts = [] form.posts = []
this.leftDeptsId = crud.form.deptId this.leftDeptsId = crud.form.deptId
if (this.leftFondsId) { if (this.leftFondsId) {
form.fonds.id = this.leftFondsId
form.dept.id = this.leftDeptsId
this.changeFondsValue(this.leftFondsId) this.changeFondsValue(this.leftFondsId)
form.fonds.id = this.leftFondsId
this.levelNumber = 4 this.levelNumber = 4
} }
if (form.roleIds.includes(',')) { if (form.roleIds.includes(',')) {
@ -437,6 +438,8 @@ export default {
const data = { id: job.id } const data = { id: job.id }
userPosts.push(data) userPosts.push(data)
}) })
crud.form.id = crud.form.userId
}, },
// //
[CRUD.HOOK.afterValidateCU](crud) { [CRUD.HOOK.afterValidateCU](crud) {
@ -453,12 +456,12 @@ export default {
this.$message({ message: '角色不能为空', type: 'warning', offset: 8 }) this.$message({ message: '角色不能为空', type: 'warning', offset: 8 })
return false return false
} }
if (crud.form.userId) {
crud.form.id = crud.form.userId
} else {
crud.form.id = null
}
// console.log('crud.form.userId', crud.form.userId)
// if (crud.form.userId) {
// crud.form.id = crud.form.userId
// } else {
// crud.form.id = null
// }
crud.form.roles = userRoles crud.form.roles = userRoles
crud.form.posts = userPosts crud.form.posts = userPosts
delete crud.form.deptsId delete crud.form.deptsId
@ -468,6 +471,8 @@ export default {
delete crud.form.roleIds delete crud.form.roleIds
delete crud.form.deptsName delete crud.form.deptsName
delete crud.form.job delete crud.form.job
console.log(' crud.form', crud.form)
return true return true
}, },
clickRowHandler(row) { clickRowHandler(row) {
@ -539,25 +544,29 @@ export default {
const selectedKey = this.$refs.tree.getCurrentNode() const selectedKey = this.$refs.tree.getCurrentNode()
// const selectedParentVal = this.$refs.tree.getNode(selectedKey).parent.data.id // const selectedParentVal = this.$refs.tree.getNode(selectedKey).parent.data.id
console.log('selectedKey', selectedKey) console.log('selectedKey', selectedKey)
console.log('data.pid', data.pid)
if (data.pid === 0) { if (data.pid === 0) {
this.query.deptsId = null
this.query.deptsName = null
this.crud.query.deptsId = null
this.crud.query.deptsName = null
this.leftFondsId = null this.leftFondsId = null
this.leftDeptsId = null this.leftDeptsId = null
} else { } else {
console.log('data.fondsNo', data.fondsNo)
if (data.fondsNo) { if (data.fondsNo) {
const selectedParentVal = this.$refs.tree.getNode(selectedKey).data.id const selectedParentVal = this.$refs.tree.getNode(selectedKey).data.id
this.query.fondsId = data.id
this.query.deptsId = null
this.query.deptsName = null
this.crud.query.fondsId = data.id
this.crud.query.deptsId = null
this.crud.query.deptsName = null
this.leftFondsId = selectedParentVal this.leftFondsId = selectedParentVal
} else { } else {
const selectedParentVal = this.$refs.tree.getNode(selectedKey).parent.data.id const selectedParentVal = this.$refs.tree.getNode(selectedKey).parent.data.id
this.query.deptsId = data.id
this.query.deptsName = data.deptsName
console.log('const selectedParentVal ', selectedParentVal)
this.crud.query.deptsId = data.id
this.crud.query.deptsName = data.deptsName
this.leftFondsId = selectedParentVal this.leftFondsId = selectedParentVal
} }
} }
this.crud.query.fondsId = this.leftFondsId
this.crud.toQuery() this.crud.toQuery()
}, },
getFondsDatas() { getFondsDatas() {
@ -621,6 +630,10 @@ export default {
} }
return obj return obj
}) })
if (this.leftDeptsId) {
this.form.dept.id = this.leftDeptsId
}
}) })
}, },
// //

Loading…
Cancel
Save