Browse Source

优化

master
xuhuajiao 3 months ago
parent
commit
6e4ed7cc6a
  1. 11
      src/api/ai/ai.js
  2. 12
      src/api/collect/collect.js
  3. 39
      src/views/AIAssistant/AICataloging/running/index.vue
  4. 5
      src/views/AIAssistant/AIIntelligentCoding/aiForm.vue
  5. 36
      src/views/AIAssistant/AIIntelligentCoding/index.vue
  6. 6
      src/views/AIAssistant/AIKeywords/archivesList.vue
  7. 2
      src/views/collectReorganizi/collectionLibrary/mixins/index.js
  8. 51
      src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
  9. 119
      src/views/collectReorganizi/collectionLibrary/module/collectMoveFile/index.vue
  10. 1
      src/views/components/category/PreviewForm.vue

11
src/api/ai/ai.js

@ -59,4 +59,13 @@ export function FetchEditResearchAI(data) {
})
}
export default { FetchInitAssistEnter, FetchDoHandleEnterAnalysis, FetchInitAssistEnterTemp, FetchDelAssistEnter, FetchHandleEnterAnalysis, FetchInitShowByCategory, FetchEditResearchAI }
// 删除AI编研
export function FetchDelResearchAI(data) {
return request({
url: 'api/ai/delResearchAI',
method: 'post',
data
})
}
export default { FetchInitAssistEnter, FetchDoHandleEnterAnalysis, FetchInitAssistEnterTemp, FetchDelAssistEnter, FetchHandleEnterAnalysis, FetchInitShowByCategory, FetchEditResearchAI, FetchDelResearchAI }

12
src/api/collect/collect.js

@ -376,6 +376,15 @@ export function FetchInitFileMarkCategoryView(params) {
})
}
// 通过案卷id获取最大件号
export function FetchMaxItemNoByParentId(params) {
return request({
url: 'api/collect/getMaxItemNoByParentId',
method: 'get',
params
})
}
export default {
collectAdd,
collectEdit,
@ -414,5 +423,6 @@ export default {
FetchSetAnalysisedText,
FetchEditMarkByFileId,
FetchMarkByFileId,
FetchInitFileMarkCategoryView
FetchInitFileMarkCategoryView,
FetchMaxItemNoByParentId
}

39
src/views/AIAssistant/AICataloging/running/index.vue

@ -46,7 +46,7 @@
row-key="id"
@select="crud.selectChange"
@select-all="crud.selectAllChange"
@cell-dblclick="tableDoubleClick"
@row-dblclick="tableDoubleClick"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" align="center" />
@ -98,7 +98,7 @@
<Detail ref="aiCatalogingFile" :is-histroy="isHistroy" />
<!-- 文件上传 -->
<el-dialog class="fileUpload-dialog" title="文件上传" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="uploadVisible">
<el-dialog class="fileUpload-dialog" title="文件上传" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="uploadVisible" :before-close="handleClose">
<div class="setting-dialog">
<div class="upload-container">
<i v-if="fileList.length === 0" class="iconfont icon-tianjiawenjian upload-icon" />
@ -511,6 +511,9 @@ export default {
// })
} else {
this.$message({ message: '已清空所有要上传的附件', offset: 8 })
if (this.$refs.fileInput) {
this.$refs.fileInput.value = ''
}
}
},
// base64
@ -733,7 +736,34 @@ export default {
jsonData.archival_category_code = this.aiAddArchiveCategory.code
jsonData.is_entity = 1
console.log('jsonData', jsonData)
this.$refs.previewForm.addOrUpdateForm = jsonData
const newFormData = {}
for (const key in jsonData) {
if (jsonData.hasOwnProperty(key)) {
const value = jsonData[key]
const fieldConfig = this.formPreviewData.find(config => config.fieldName === key)
if (fieldConfig) {
//
if (fieldConfig.isInputClass === 'number' && fieldConfig.isDataType === 2 && fieldConfig.isDataTypeDetails === 'int') {
const numMatch = value.match(/\d+/)
if (numMatch) {
// newFormData[key] = parseInt(numMatch[0])
newFormData[key] = numMatch[0]
} else {
console.log(`字段 ${key} 的值 ${value} 不包含有效数字,将不提交该字段`)
continue
}
} else {
newFormData[key] = value
}
} else {
newFormData[key] = value
}
}
}
console.log('newFormData', newFormData)
this.$refs.previewForm.addOrUpdateForm = newFormData
}
}
this.reader = null //
@ -795,6 +825,9 @@ export default {
if (this.reader) {
this.reader.cancel() //
}
if (this.$refs.fileInput) {
this.$refs.fileInput.value = ''
}
},
//
handleDel(data) {

5
src/views/AIAssistant/AIIntelligentCoding/aiForm.vue

@ -465,6 +465,11 @@ export default {
this.researchContext = ''
this.message = []
this.formVisible = false
if (this.$refs.form) {
// this.$refs.form.clearValidate()
this.$refs.form.resetFields()
this.form = {}
}
this.deleteFile()
},
handleEditorChange(value) {

36
src/views/AIAssistant/AIIntelligentCoding/index.vue

@ -67,7 +67,7 @@
<el-dialog class="detail-dialog ai-detial-dialog" title="编研详情" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="onlineEditDetail" :before-close="handleCloseDialog">
<div class="setting-dialog">
<!-- overflow-y: scroll; -->
<div style="width: 100%; height: 500px; overflow: hidden; ">
<div style="width: 100%;">
<div style="margin: 20px; line-height: 30px;">
<p>专题名称{{ currentResearch && currentResearch.researchTitle }}</p>
<p>编研类型{{ currentResearch && currentResearch.researchType }}</p>
@ -90,7 +90,7 @@
<script>
import CRUD, { presenter, crud } from '@crud/crud'
import crudEditing from '@/api/archiveUtilize/archiveEditing'
import { FetchDelResearchAI } from '@/api/ai/ai'
import pagination from '@crud/Pagination'
import crudOperation from '@crud/CRUD.operation'
import aiForm from './aiForm'
@ -104,7 +104,7 @@ export default {
return CRUD({
url: 'api/ai/initResearchAI',
title: 'AI智能编研',
crudMethod: { ...crudEditing },
crudMethod: { },
optShow: {
add: false,
edit: false,
@ -178,22 +178,21 @@ export default {
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
// const ids = data.map(item => item.id)
const ids = data.map(item => item.id)
// const params = {
// 'ids': ids,
// 'operator': this.user.username
// 'ids': ids
// }
// crudEditing.del(params).then((res) => {
// console.log(res)
// if (res.code !== 500) {
// this.$message({ message: '', type: 'success', offset: 8 })
// } else {
// this.$message({ message: res.message, type: 'error', offset: 8 })
// }
// this.initData()
// }).catch(err => {
// console.log(err)
// })
FetchDelResearchAI(ids).then((res) => {
console.log(res)
if (res === 'SUCCESS') {
this.$message({ message: '删除成功', type: 'success', offset: 8 })
} else {
this.$message({ message: res.message, type: 'error', offset: 8 })
}
this.initData()
}).catch(err => {
console.log(err)
})
}).catch(() => {
})
},
@ -216,7 +215,8 @@ export default {
.ai-detial-dialog{
::v-deep .v-note-wrapper{
width: 100% !important;
min-height: 500px !important;
height: 500px !important;
overflow-y: scroll;
}
}

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

@ -130,14 +130,14 @@
</el-table-column>
<el-table-column prop="is_analysis" label="解析状态" min-width="60" align="center" class-name="parse-column">
<template slot-scope="scope">
<span v-if="scope.row.is_analysis===-1" class="row-state">未解析</span>
<span v-if="scope.row.is_analysis===-1|| scope.row.is_analysis===''" 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>
</el-table-column>
<el-table-column prop="is_analysis" label="解析操作" min-width="60" align="center" class-name="parse-column">
<template slot-scope="scope">
<el-button v-if="scope.row.is_analysis===-1" size="mini" class="check-btn" style="padding: 5px; margin: 0;" @click="handleCurrentAIOcr(scope.row)">
<el-button v-if="scope.row.is_analysis===-1|| scope.row.is_analysis===''" size="mini" class="check-btn" style="padding: 5px; margin: 0;" @click="handleCurrentAIOcr(scope.row)">
<i class="iconfont icon-wenjianjiexi" />
解析
</el-button>
@ -329,7 +329,6 @@ export default {
}
})
this.$nextTick(() => {
console.log('2222')
this.getAiFileList()
})
}
@ -472,6 +471,7 @@ export default {
} else {
this.$message({ message: '提交解析文件失败', type: 'error', offset: 8 })
}
// this.refreshFile()
}).catch(err => {
console.log(err)
})

2
src/views/collectReorganizi/collectionLibrary/mixins/index.js

@ -171,7 +171,7 @@ export const collectionLibraryCrud = {
}
if (type === 'search') {
// projectObj.projectData = res.list.content
this.projectData = res.list.content.map(item => {
projectObj.projectData = res.list.content.map(item => {
return {
...item,
baseCategory: baseCategory

51
src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue

@ -282,7 +282,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, FetchMaxItemNoByParentId } from '@/api/collect/collect'
import { FetchInitAssistEnter, FetchDoHandleEnterAnalysis } from '@/api/ai/ai'
import { FetchArchivesClassTree } from '@/api/system/archivesClass'
import Treeselect from '@riophae/vue-treeselect'
@ -529,6 +529,7 @@ export default {
if (this.parentsData.parentsProjectId && this.isTitleType === 3) {
console.log('项目下的案卷')
} else {
console.log('111')
if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
this.$message({ message: '当前档案处于归档流程中,不可操作新增,请先确认!', offset: 8 })
return false
@ -539,6 +540,7 @@ export default {
this.quickPaper = true
this.formTitle = '新增案卷'
} else {
console.log('222')
this.formTitle = '新增' + this.collectTitle
this.quickPaper = false
}
@ -603,7 +605,11 @@ export default {
this.$nextTick(() => {
this.$refs.previewForm.archivesType = 'add'
this.$refs.previewForm.activeIndex = this.activeIndex
console.log('this.parentsData.parentsAnjuanRow ', this.parentsData.parentsAnjuanRow)
console.log('this.collectTitle', this.collectTitle)
const savePrevFromData = JSON.parse(localStorage.getItem('savePrevFromData'))
console.log('savePrevFromData', savePrevFromData)
if (savePrevFromData) {
if ('record_no' in savePrevFromData && 'item_no' in savePrevFromData) {
if (savePrevFromData.item_no && !isNaN(Number(savePrevFromData.item_no))) {
@ -618,7 +624,6 @@ export default {
savePrevFromData.item_no = (parseInt(savePrevFromData.item_no) + 1).toString()
}
}
// item_no record_no
const findAndPadField = (fieldName) => {
const field = this.formPreviewData.find(item => item.fieldName === fieldName)
@ -634,12 +639,54 @@ export default {
findAndPadField('record_no')
this.$refs.previewForm.addOrUpdateForm = savePrevFromData
} else if (this.collectTitle === '卷内' && this.parentsData.parentsAnjuanRow) {
// fonds_noarchival_category_codearchive_ctg_noarchive_yearretentionrecord_nosigner
const rowAjData = this.parentsData.parentsAnjuanRow
const fields = ['fonds_no', 'archive_ctg_no', 'archive_year', 'retention', 'record_no', 'signer']
const result = { is_entity: 1, archival_category_code: this.selectedCategory.code }
fields.forEach(field => {
if (rowAjData.hasOwnProperty(field)) {
result[field] = rowAjData[field]
}
})
const params = {
'archivesId': this.parentsData.parentsAnjuanRow.id
}
FetchMaxItemNoByParentId(params).then((res) => {
if (res) {
const field = this.formPreviewData.find(item => item.fieldName === 'item_no')
if (field && field.isFilling) {
const fillingDigit = field.fillingDigit
result.item_no = (parseInt(res) + 1).toString().padStart(fillingDigit, '0')
} else {
result.item_no = this.incrementString(res)
}
} else {
result.item_no = ''
}
}).catch(err => {
console.log(err)
})
console.log('result', result)
this.$refs.previewForm.addOrUpdateForm = result
}
this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
})
})
}
},
incrementString(str) {
const num = parseInt(str, 10)
const incrementedNum = num + 1
const numLength = str.length
if (/^0+$/.test(str.replace(/\d/g, '0'))) {
return incrementedNum.toString().padStart(numLength, '0')
}
return incrementedNum.toString()
},
// form - submit
handlerArchivesSubmit(type) {
this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id, this.quickPaperArcId, type)

119
src/views/collectReorganizi/collectionLibrary/module/collectMoveFile/index.vue

@ -241,46 +241,57 @@ export default {
this.toCategoryLevel = 2
} else {
//
//
console.log('this.collectLevel', this.collectLevel)
if (this.collectLevel === 3) {
//
//
if (this.moveSelections.length === 0) {
this.toCategoryLevel = 3
} else {
// tab
if (this.tabIndex === 1) {
this.toCategoryLevel = 2
} else {
this.toCategoryLevel = 3
}
}
} else {
//
if (this.tabIndex === 1) {
this.toCategoryLevel = 2
} else {
this.toCategoryLevel = 1
}
}
this.toCategoryLevel = 2
// //
// if (this.collectLevel === 3) {
// console.log('444')
// //
// //
// if (this.moveSelections.length === 0) {
// this.toCategoryLevel = 3
// console.log('555')
// } else {
// console.log('666')
// // tab
// if (this.tabIndex === 1) {
// this.toCategoryLevel = 2
// console.log('777')
// } else {
// this.toCategoryLevel = 3
// console.log('888')
// }
// }
// } else {
// console.log('999')
// //
// if (this.tabIndex === 1) {
// console.log('10')
// this.toCategoryLevel = 2
// } else {
// console.log('11')
// this.toCategoryLevel = 1
// }
// }
}
if (this.collectLevel === 2) {
if (this.toCategoryLevel === 3) {
this.$message({ message: '案卷不可移动到文件级,请先确认!', offset: 8 })
return false
}
}
console.log('parentsId', this.parentsId)
console.log('this.currentCategory', this.currentCategory)
console.log('this.collectLevel', this.collectLevel)
console.log('this.toCategoryLevel', this.toCategoryLevel)
console.log('this.selections', this.selections)
console.log('this.moveSelections', this.moveSelections)
// if (this.collectLevel === 2) {
// if (this.toCategoryLevel === 3) {
// this.$message({ message: '', offset: 8 })
// return false
// }
// }
if (this.collectLevel === this.toCategoryLevel) {
if (this.moveSelections.length === 0) {
if (this.currentCategory.arrangeType !== 1) {
this.$message({ message: '请选择一个案卷条目进行移动操作!', offset: 8 })
this.$message({ message: '1请选择一个案卷条目进行移动操作!', offset: 8 })
return false
} else {
if (this.selectedCategory.id === this.currentCategory.id) {
@ -297,56 +308,24 @@ export default {
this.$message({ message: '正在移动的档案不操作移动到自身档案下!', offset: 8 })
return false
}
// const targetId = this.moveSelections[0].id
// const isExists = archivesIds.includes(targetId)
// if (isExists) {
// this.$message({ message: '!', offset: 8 })
// return false
// }
}
} else {
if (this.moveSelections.length === 0) {
if (this.currentCategory.arrangeType === 2) {
this.$message({ message: '请选择一个案卷条目进行移动操作!', offset: 8 })
return false
}
this.$message({ message: '请选择一个案卷条目进行移动操作!', offset: 8 })
return false
} else {
if (this.currentCategory.arrangeType === 1) {
this.$message({ message: '不可选择文件条目进行移动!', offset: 8 })
return false
} else {
if (this.parentsId === this.moveSelections[0].id) {
this.$message({ message: '正在移动的档案不操作移动到自身档案下!', offset: 8 })
return false
}
}
}
}
// if (this.collectLevel === 3 && this.toCategoryLevel === 2) {
// if (this.moveSelections.length !== 0) {
// if (this.parentsId === this.moveSelections[0].id) {
// this.$message({ message: '!', offset: 8 })
// return false
// }
// }
// }
console.log('this.toCategoryLevel', this.toCategoryLevel)
// if (this.currentCategory.arrangeType === 3 && this.collectLevel === 2) {
// if (this.moveSelections.length === 0) {
// this.$message({ message: '!', offset: 8 })
// return false
// }
// }
// if (this.currentCategory.arrangeType === 3 && this.collectLevel === 3) {
// if (this.moveSelections.length === 0) {
// this.$message({ message: '!', offset: 8 })
// return false
// }
// }
console.log('this.selections', this.selections)
console.log('this.moveSelections', this.moveSelections)
// const toArchivesIds = this.moveSelections.map(item => item.id)
let toArchivesId
if (this.moveSelections.length === 0) {
@ -367,7 +346,7 @@ export default {
// toArchivesId = this.moveSelections[0].id
// }
}
// this.btnLoading = true
this.btnLoading = true
const params = {
'reserve': this.isReserve, // true false
'categoryId': this.selectedCategory.id, // id

1
src/views/components/category/PreviewForm.vue

@ -786,7 +786,6 @@ export default {
//
const fieldValue = this.addOrUpdateForm[item.fieldName]
// isDataType
if (item.isDataType && fieldValue) {
switch (item.isDataType) {
case 1:

Loading…
Cancel
Save