Browse Source

预归档库

master
xuhuajiao 1 year ago
parent
commit
f53f7e0a46
  1. 21
      src/api/collect/collect.js
  2. 28
      src/api/prearchiveLibrary/prearchiveLibrary.js
  3. 2
      src/assets/styles/yxk-admin.scss
  4. 11
      src/utils/upload.js
  5. 41
      src/views/components/category/PreviewForm.vue
  6. 24
      src/views/prearchiveLibrary/index.vue
  7. 12
      src/views/prearchiveLibrary/module/batchFile.vue
  8. 228
      src/views/prearchiveLibrary/module/detail.vue
  9. 179
      src/views/prearchiveLibrary/module/moveFile.vue

21
src/api/collect/collect.js

@ -0,0 +1,21 @@
import request from '@/utils/request'
// 根据门类父id获取卷内列表列
export function FetchInitCategoryViewTable(params) {
return request({
url: 'api/collect/initCategoryViewTable',
method: 'get',
params
})
}
// 根据门类父id获取卷内列表
export function FetchInitSingleCategoryView(params) {
return request({
url: 'api/collect/initSingleCategoryView',
method: 'get',
params
})
}
export default { FetchInitCategoryViewTable, FetchInitSingleCategoryView }

28
src/api/prearchiveLibrary/prearchiveLibrary.js

@ -83,4 +83,30 @@ export function FetchMove(data) {
})
}
export default { add, prearchEdit, del, FetchInitPreDocument, FetchInitDocumentsViewTable, FetchDoeditDocument, FetchBatchToFile, FetchMergeToFile, FetchMove }
// 详情
export function FetchArchivesDetails(params) {
return request({
url: 'api/re-document/archivesDetails',
method: 'get',
params
})
}
// 根据预归档档案获取电子原文列表
export function FetchFileListByDocumentId(params) {
return request({
url: 'api/re-document/getFileListByDocumentId',
method: 'get',
params
})
}
export function FetchArchivesMetadata(params) {
return request({
url: 'api/re-document/archivesMetadata',
method: 'get',
params
})
}
export default { add, prearchEdit, del, FetchInitPreDocument, FetchInitDocumentsViewTable, FetchDoeditDocument, FetchBatchToFile, FetchMergeToFile, FetchMove, FetchArchivesDetails, FetchFileListByDocumentId, FetchArchivesMetadata }

2
src/assets/styles/yxk-admin.scss

@ -765,7 +765,7 @@
.field-setting-dialog,
.edit-form-dialog{
.el-dialog{
width: 536px;
width: 600px;
.el-dialog__body {
.el-form-item{
&:nth-child(odd){

11
src/utils/upload.js

@ -21,6 +21,17 @@ export function archivesUpload(api, file, categoryId) {
return axios.post(api, data, config)
}
// 档案上传附件
export function reDocumentUpload(api, file, documentId) {
var data = new FormData()
data.append('file', file)
data.append('documentId', documentId)
const config = {
headers: { 'Authorization': getToken() }
}
return axios.post(api, data, config)
}
// 上传模型
export function modelUpload(api, file, name) {
var data = new FormData()

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

@ -77,9 +77,9 @@
<div class="setting-dialog">
<el-table ref="popoverTable" :data="popoverTableData" highlight-current-row row-key="dictionaryId" :tree-props="{children: 'childMenus', hasChildren: 'hasChildren'}" height="600" style="width: 100%;" @selection-change="handleSelectionChange" @row-click="clickRowHandler">
<el-table-column type="selection" width="55" />
<el-table-column prop="dictionaryName" label="字典名称" />
<el-table-column prop="dictionaryName" label="字典名称" show-overflow-tooltip />
<el-table-column prop="dictionaryCode" label="字典代码" />
<el-table-column prop="dictionaryRemarks" label="内容说明" />
<el-table-column prop="dictionaryRemarks" label="内容说明" show-overflow-tooltip />
</el-table>
</div>
</el-dialog>
@ -88,9 +88,9 @@
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<el-table ref="popoverTable" :data="popoverTableDataFonds" highlight-current-row row-key="id" :tree-props="{children: 'childMenus', hasChildren: 'hasChildren'}" height="600" style="width: 100%; he" @selection-change="handleSelectionChange" @row-click="clickRowHandler">
<el-table-column type="selection" width="55" />
<el-table-column type="selection" width="55" show-overflow-tooltip />
<el-table-column prop="fondsNo" label="全宗号" />
<el-table-column prop="fondsName" label="全宗名称" />
<el-table-column prop="fondsName" label="全宗名称" show-overflow-tooltip />
<el-table-column prop="fondsOrders" label="排序" width="60" />
</el-table>
</div>
@ -101,10 +101,10 @@
<div class="setting-dialog">
<el-table ref="popoverTable" :data="popoverTableDataClassify" highlight-current-row row-key="id" :tree-props="{children: 'childArchivesClass', hasChildren: 'hasChildren'}" height="600" style="width: 100%;" @selection-change="handleSelectionChange" @row-click="clickRowHandler">
<el-table-column type="selection" width="55" />
<el-table-column label="分类名称" prop="name" width="130" />
<el-table-column label="分类名称" prop="name" width="130" show-overflow-tooltip />
<el-table-column label="分类编号" prop="code" />
<el-table-column label="排序" prop="classSeq" />
<el-table-column label="所属门类" prop="categoryName" />
<el-table-column label="所属门类" prop="categoryName" show-overflow-tooltip />
</el-table>
</div>
</el-dialog>
@ -124,6 +124,8 @@ import { FetchSonDictionaryList } from '@/api/system/dict'
import { FetchFondsAll } from '@/api/system/fonds'
import { FetchArchivesClassTree, FetchSonArchivesClass } from '@/api/system/archivesClass'
import { parseTime, getCurrentTime } from '@/utils/index'
import { reDocumentUpload } from '@/utils/upload'
import { mapGetters } from 'vuex'
export default {
name: 'PreviewForm',
@ -144,6 +146,12 @@ export default {
return {}
}
},
selectedDocument: {
type: Object,
default: function() {
return {}
}
},
arcId: {
type: String,
default: ''
@ -201,9 +209,16 @@ export default {
mergeFileCategory: null
}
},
computed: {
...mapGetters([
'baseApi'
])
},
watch: {
selectedCategory: function(newValue, oldValue) {
},
selectedDocument: function(newValue, oldValue) {
},
arcId: function(newValue, oldValue) {
},
parentsId: function(newValue, oldValue) {
@ -728,14 +743,13 @@ export default {
} else {
this.px = ''
}
this.uploadSave()
//
// archivesUpload(this.baseApi + '/api/archives/uploadFile', this.file, this.categoryId).then(res => {
// if (res.data.code === 200) {
// this.filePath = res.data.data
// this.uploadSave()
// }
// })
reDocumentUpload(this.baseApi + '/api/re-document/uploadFile', this.file, this.selectedDocument.id).then(res => {
if (res.data.code === 200) {
this.filePath = res.data.data
this.uploadSave()
}
})
},
// -
uploadSave() {
@ -888,5 +902,4 @@ export default {
}
}
}
</style>

24
src/views/prearchiveLibrary/index.vue

@ -43,6 +43,7 @@
ref="table"
v-loading="crud.loading"
:data="crud.data"
@row-click="clickRowHandler"
@select="crud.selectChange"
@select-all="crud.selectAllChange"
@selection-change="crud.selectionChangeHandler"
@ -68,11 +69,11 @@
<!--分页组件-->
<pagination v-if="crud.data.length !== 0" />
</div>
<detail ref="archivesInfo" />
<detail ref="archivesInfo" :selected-document="selectedDocument" />
<!-- 批量成件 -->
<batchFile ref="batchForm" :selected-document="selectedDocument" @refresh="crud.refresh" />
<!-- 移动 -->
<moveFile ref="moveForm" />
<moveFile ref="moveForm" :selected-document="selectedDocument" @refresh="crud.refresh" />
<!-- 合并成件 -->
<el-dialog class="dialog-middle" :modal-append-to-body="false" :close-on-click-modal="false" :before-close="handleClose" :visible="mergeVisible" title="合并成件">
<span class="dialog-right-top" />
@ -104,7 +105,7 @@
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<PreviewForm ref="previewForm" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" :is-des-form-type="isDesFormType" :is-disabled="isDisabled" :is-has-code="isHasCode" @close-dialog="closeDialog" />
<PreviewForm ref="previewForm" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" :is-des-form-type="isDesFormType" :is-disabled="isDisabled" :selected-document="selectedDocument" :is-has-code="isHasCode" @close-dialog="closeDialog" />
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="closeDialog">取消</el-button>
<el-button type="primary" @click="handlerArchivesSubmit">确定</el-button>
@ -283,11 +284,16 @@ export default {
handlerArchivesSubmit() {
this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedDocument.id)
},
clickRowHandler(row) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(row)
},
//
tableDoubleClick(row) {
console.log('tableDoubleClick', row)
this.$refs.archivesInfo.archivesInfoVisible = true
this.$refs.archivesInfo.archivesTabIndex = 0
// this.$refs.archivesInfo.getDetial(row.id)
this.$refs.archivesInfo.getDetial(row.id)
},
//
toDelete(datas) {
@ -339,14 +345,21 @@ export default {
}).catch(() => {
})
},
//
handleBatch() {
this.$refs.batchForm.batchVisible = true
this.$refs.batchForm.selectionsArc = this.crud.selections
},
//
handelMerge() {
this.mergeVisible = true
this.getCategoryDataTree()
},
//
handleMove() {
this.$refs.moveForm.moveVisible = true
this.$refs.moveForm.moveArc = this.crud.selections
},
getCategoryDataTree() {
FetchCategoryMenu().then(res => {
this.categoryTree = this.filterData(res)
@ -374,9 +387,6 @@ export default {
closeDialog() {
this.formVisible = false
this.mergeVisible = false
},
handleMove() {
this.$refs.moveForm.moveVisible = true
}
}
}

12
src/views/prearchiveLibrary/module/batchFile.vue

@ -282,6 +282,18 @@ export default {
res.forEach((item, index) => {
this.selectStatus.push({ mode: false, fiedType: item.categoryFieldId.isDefaultValue === '' ? 1 : 2, value: item.categoryFieldId.isDefaultValue === '' ? item.documentFieldId.fieldCnName : item.categoryFieldId.isDefaultValue, field: item.documentFieldId, isInput: item.documentFieldId.isInput })
})
if (this.form.scope) {
const indexClass = res.findIndex(item => item.categoryFieldId.fieldName === 'archive_ctg_no')
const indexRetention = res.findIndex(item => item.categoryFieldId.fieldName === 'retention')
if (indexClass !== -1 && this.scopeSelection[0].archivesClass !== null) {
this.selectStatus.splice(indexClass, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].archivesClass.name, field: this.allFieldData[indexClass].documentFieldId, isInput: this.allFieldData[indexClass].documentFieldId.isInput })
}
if (indexRetention !== -1 && this.scopeSelection[0].retention !== '') {
this.selectStatus.splice(indexRetention, 1, { mode: false, fiedType: 2, value: this.scopeSelection[0].retention, field: this.allFieldData[indexRetention].documentFieldId, isInput: this.allFieldData[indexRetention].documentFieldId.isInput })
}
}
this.fieldLoading = false
})
},

228
src/views/prearchiveLibrary/module/detail.vue

@ -8,38 +8,16 @@
<ul class="tab-nav">
<li :class="{'active-tab-nav': archivesTabIndex == 0}" @click="changeActiveTab(0)">基本信息</li>
<li :class="{'active-tab-nav': archivesTabIndex == 1}" @click="changeActiveTab(1)">电子原件</li>
<li :class="{'active-tab-nav': archivesTabIndex == 2}" @click="changeActiveTab(2)">元数据</li>
</ul>
<!-- 基本信息 -->
<div v-if="archivesTabIndex===0" class="base-info item-content">
<el-row>
<el-col v-for="(item,index) in archivesDetailsData" v-show="index<archivesDetailsData.length-5" :key="index" :span="item.isLine ? 24 : 12" class="base-info-item">
<el-col v-for="(item,index) in archivesDetailsData" :key="index" :span="item.isLine ? 24 : 12" class="base-info-item">
<span>{{ item.fieldCnName }}</span>
<p :style="{ width: ( item.editLength ? item.editLength+'px' : '' ), flex: ( !item.editLength ? 1 : '' )}">{{ item.context }}</p>
</el-col>
</el-row>
<el-row v-if="isDetailsInfo">
<el-col v-for="(item,index) in archivesDetailsData.slice(archivesDetailsData.length-5,archivesDetailsData.length)" :key="'last'+index" :span=" 12" class="base-info-item">
<span>{{ item.fieldCnName }}</span>
<div v-if="item.fieldName === 'folder_location' && item.context" :style="{ width: item.editLength+'px', marginTop:'-6px'}">
<div v-if="item.context.indexOf(',')">
<el-tag
v-for="(val,key) in item.context.split(',')"
:key="key"
:type="val"
effect="dark"
>
{{ val }}
</el-tag>
</div>
<div v-else-if="!item.context.indexOf(',')">
<el-tag effect="dark">{{ item.context }}</el-tag>
</div>
</div>
<div v-else :style="{ width: item.editLength+'px'}" :class="[ (item.fieldName === 'borrow_type') ? 'row-state row-lending' : '' ]">
{{ item.context }}
</div>
</el-col>
</el-row>
</div>
<!-- 电子原件 -->
<div v-if="archivesTabIndex===1" class="item-content">
@ -62,7 +40,7 @@
<el-table-column prop="file_thumbnail" label="缩览图" min-width="60" align="center">
<template slot-scope="scope">
<div v-if="scope.row.file_type === 'jpg' || scope.row.file_type === 'jpeg' || scope.row.file_type === 'png' || scope.row.file_type === 'bmp'|| scope.row.file_type === 'gif'">
<img width="60px" height="32px" class="screenshot" :src="baseApi+ '/downloadFile' +scope.row.file_path" :onerror="defaultImg" @click="showCoverPreview(scope.row)">
<img width="60px" height="32px" class="screenshot" :src="baseApi+ '/downloadFile' + scope.row.file_path" :onerror="defaultImg" @click="showCoverPreview(scope.row)">
</div>
<div v-else>
<svg-icon icon-class="fujian" class-name="svg-style" />
@ -71,6 +49,22 @@
</el-table-column>
</el-table>
</div>
<!-- 元数据 -->
<div v-if="archivesTabIndex==2" class="metadata-cont item-content">
<pre v-highlightjs="xml_show">
<code class="highlight_s">
{[xml_show]}
</code>
</pre>
</div>
<!-- 点击缩略图看大图 -->
<el-dialog class="preview-dialog" :append-to-body="true" :close-on-click-modal="false" :before-close="handleClose" :visible="showCoverVisible" title="查看大图">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog" style="max-height:calc(100vh - 230px); overflow:auto;">
<img style="max-width:100%; object-fit: contain;" :src="previewSrc" :onerror="defaultImg">
</div>
</el-dialog>
</div>
</div>
</el-dialog>
@ -78,9 +72,8 @@
<script>
import { form } from '@crud/crud'
import { FetchArchivesDetails, FetchArchivesMetadata } from '@/api/archivesManage/archivesList'
// import detailData from './data.json'
// import metaData from './metadata.json'
import { FetchArchivesDetails, FetchFileListByDocumentId, FetchArchivesMetadata } from '@/api/prearchiveLibrary/prearchiveLibrary'
import { mapGetters } from 'vuex'
export default {
name: 'PrearchiveLibraryDetail',
components: { },
@ -88,64 +81,47 @@ export default {
form({})
],
props: {
categoryId: {
type: String,
selectedDocument: {
type: Object,
default: function() {
return ''
}
},
arcId: {
type: String,
default: function() {
return ''
return {}
}
}
},
data() {
return {
defaultImg: 'this.src="' + require('@/assets/images/cover-bg.png') + '"',
archivesInfoVisible: false,
archivesTabIndex: 0,
archivesDetailsData: [],
archivesDetailsMetadata: []
archivesDetailsMetadata: [],
xml_show: null,
selections: [],
tableData: [],
showCoverVisible: false,
previewSrc: '' // src
}
},
computed: {
...mapGetters([
'baseApi'
])
},
created() {
this.archivesDetailsData = []
this.archivesDetailsMetadata = []
},
mounted() {
},
methods: {
getDetial(rowId) {
const params = {
categoryId: this.categoryId,
documentId: this.selectedDocument.id,
archivesId: rowId
}
FetchArchivesDetails(params).then(data => {
this.archivesDetailsData = data
// /
this.archivesDetailsData.forEach(item => {
if (item.fieldName === 'borrow_type') {
if (item.context === 1) {
item.context = '待登记'
} else if (item.context === 2) {
item.context = '待借阅'
} else if (item.context === 3) {
item.context = '待归还'
} else if (item.context === 4 || item.context === '' || item.context === null) {
item.context = '-'
} else if (item.context === -1) {
item.context = '在库'
}
}
})
// - tid/''
if (!this.isTidOrBorrow) {
const indexBorrow = this.archivesDetailsData.findIndex(item => item.fieldName === 'borrow_type')
const indexTid = this.archivesDetailsData.findIndex(item => item.fieldName === 'tid')
this.archivesDetailsData.splice(indexBorrow, 1)
this.archivesDetailsData.splice(indexTid, 1)
}
FetchFileListByDocumentId(params).then(data => {
this.tableData = data.returnlist
})
FetchArchivesMetadata(params).then(data => {
this.archivesDetailsMetadata = data
@ -153,11 +129,109 @@ export default {
},
changeActiveTab(index) {
this.archivesTabIndex = index
if (this.archivesTabIndex === 2) {
this.setXml()
}
},
// table
clickRowHandler(row) {
this.$refs.table.toggleRowSelection(row)
},
// table
selectionChangeHandler(val) {
this.selections = val
},
// -
// dialog - close
handleClose(done) {
this.archivesInfoVisible = false
this.showCoverVisible = false
done()
},
//
showCoverPreview(row) {
this.showCoverVisible = true
this.previewSrc = this.baseApi + '/downloadFile' + row.file_path
},
setXml() {
const xmlstr = this.archivesDetailsMetadata
this.xml_show = this.showXml(xmlstr)
},
// xml
showXml(str) {
var that = this
var text = str
//
text =
'\n' +
text
.replace(/(<\w+)(\s.*?>)/g, function($0, name, props) {
return name + ' ' + props.replace(/\s+(\w+=)/g, ' $1')
})
.replace(/>\s*?</g, '>\n<')
//
text = text
.replace(/\n/g, '\r')
.replace(/<!--(.+?)-->/g, function($0, text) {
var ret = '<!--' + escape(text) + '-->'
return ret
})
.replace(/\r/g, '\n')
//
var rgx = /\n(<(([^\?]).+?)(?:\s|\s*?>|\s*?(\/)>)(?:.*?(?:(?:(\/)>)|(?:<(\/)\2>)))?)/gm
var nodeStack = []
var output = text.replace(rgx, function(
$0,
all,
name,
isBegin,
isCloseFull1,
isCloseFull2,
isFull1,
isFull2
) {
var isClosed =
isCloseFull1 === '/' ||
isCloseFull2 === '/' ||
isFull1 === '/' ||
isFull2 === '/'
var prefix = ''
if (isBegin === '!') {
prefix = that.getPrefix(nodeStack.length)
} else {
if (isBegin !== '/') {
prefix = that.getPrefix(nodeStack.length)
if (!isClosed) {
nodeStack.push(name)
}
} else {
nodeStack.pop()
prefix = that.getPrefix(nodeStack.length)
}
}
var ret = '\n' + prefix + all
return ret
})
var outputText = output.substring(1)
//
outputText = outputText
.replace(/\n/g, '\r')
.replace(/(\s*)<!--(.+?)-->/g, function($0, prefix, text) {
if (prefix.charAt(0) === '\r') prefix = prefix.substring(1)
text = unescape(text).replace(/\r/g, '\n')
var ret =
'\n' + prefix + '<!--' + text.replace(/^\s*/gm, prefix) + '-->'
return ret
})
outputText = outputText.replace(/\s+$/g, '').replace(/\r/g, '\r\n')
return outputText
},
getPrefix(prefixIndex) {
var span = ' '
var output = []
for (var i = 0; i < prefixIndex; ++i) {
output.push(span)
}
return output.join('')
}
}
}
@ -168,9 +242,12 @@ export default {
.metadata-cont{
background-color: #F6F8FC;
}
//
.base-info{
padding: 20px 0;
overflow: hidden;
overflow-y: scroll;
.base-info-item{
display: flex;
flex-direction: row;
@ -178,11 +255,30 @@ export default {
color: #545B65;
span{
display: block;
width: 120px;
width: 160px;
font-weight: bold;
margin-right: 5px;
text-align: right;
color: #0C0E1E;
}
}
}
code.hljs {
font-size: 12px;
color: #0C0E1E !important;
height: 530px !important;
}
::v-deep .hljs-name{
color: #0C0E1E !important;
}
.base-info .base-info-item span.el-tag{
width: auto;
color: #fff;
}
.svg-style{
width: 60px;
height: 32px;
}
</style>

179
src/views/prearchiveLibrary/module/moveFile.vue

@ -1,6 +1,6 @@
<template>
<!-- 移动 -->
<el-dialog class="move-form" append-to-body :modal-append-to-body="false" :close-on-click-modal="false" :before-close="handleClose" :visible="moveVisible" title="移动">
<el-dialog class="move-form" append-to-body :modal-append-to-body="false" :close-on-click-modal="false" :before-close="handleClose" :visible="moveVisible" title="移动" @opened="opened">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
@ -19,8 +19,8 @@
</div>
<div class="move-right">
<div style="padding: 10px;">
<el-input v-model="query.keyWord" placeholder="输入题名或档号搜索" style="width: 200px;" />
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search">搜索</el-button>
<el-input v-model="query.search" placeholder="输入题名或档号搜索" style="width: 200px;" />
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="getViewTableList">搜索</el-button>
</div>
<div class="raido-main">
<!-- @select="handleSelect"
@ -28,33 +28,48 @@
@row-click="clickRowHandler" -->
<el-table
ref="table"
v-loading="crud.loading"
v-loading="loading"
lazy
:show-header="false"
:data="tableData"
:row-key="getRowKey"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
highlight-current-row
@selection-change="selectionChangeHandler"
@row-click="clickRowHandler"
>
<el-table-column type="selection" align="center" width="55" />
<el-table-column prop="status" label="状态" />
<el-table-column :show-overflow-tooltip="true" prop="scopeName" label="名称" />
<el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip>
<template slot="header">
<el-tooltip
class="item"
effect="dark"
:content="field.fieldCnName"
placement="top-start"
>
<span>{{ field.fieldCnName }}</span>
</el-tooltip>
</template>
<template slot-scope="scope">
{{ scope.row[field.fieldName] }}
</template>
</el-table-column>
</el-table>
</div>
<el-pagination
:current-page="currentPage"
:page-sizes="[10, 20, 30, 50]"
:page-size="10"
layout="total, sizes, prev, pager, next, jumper"
:total="30"
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="handleCurrentChange"
@current-change="handleCurrentPage"
/>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="formVisible = false">取消</el-button>
<el-button type="primary" @click="formVisible = false">确定</el-button>
<el-button type="text" @click="closedDialog">取消</el-button>
<el-button type="primary" @click="handleComfirmed">确定</el-button>
</div>
</div>
</el-dialog>
@ -63,7 +78,8 @@
<script>
import { preLibraryCrud } from '../mixins/index'
import CRUD, { presenter, header, crud } from '@crud/crud'
// import { FetchMove } from '@/api/prearchiveLibrary/prearchiveLibrary'
import { FetchMove } from '@/api/prearchiveLibrary/prearchiveLibrary'
import { FetchInitCategoryViewTable, FetchInitSingleCategoryView } from '@/api/collect/collect'
import Vue from 'vue'
export default {
name: 'MoveFile',
@ -77,27 +93,37 @@ export default {
]
},
mixins: [presenter(), header(), crud(), preLibraryCrud],
props: {
selectedDocument: {
type: Object,
default: function() {
return {}
}
}
},
data() {
return {
selectedCategoryMove: {},
options: [
{
value: 1,
label: '已整理'
},
{
value: 2,
label: '未整理'
}
],
query: {
status: '',
keyWord: ''
search: ''
},
moveVisible: false,
loading: false,
arrySort: [],
tableData: [],
tableDisplayFields: [],
selections: [],
moveArc: [],
defaultProps: { children: 'children', label: 'cnName' },
currentPage: 1
page: {
page: 1,
size: 10,
total: 0
}
}
},
watch: {
selectedDocument: function(newValue, oldValue) {
}
},
created() {
@ -108,10 +134,15 @@ export default {
},
[CRUD.HOOK.afterRefresh]() {
this.crud.data = this.filterData(this.crud.data)
this.$nextTick(() => {
},
opened() {
this.refresh()
},
refresh() {
if (this.$refs.treeMove) {
let currentKey
if (this.crud.data[0].isType === 1) {
console.log(currentKey)
currentKey = this.findNode(this.crud.data[0].children, (node) => {
return node.isType !== 1
})
@ -130,7 +161,6 @@ export default {
this.handleMoveNodeClick(selectedKey)
})
}
})
},
//
handleMoveNodeClick(val) {
@ -139,17 +169,96 @@ export default {
if (val.pid !== '0') {
Vue.set(this.selectedCategoryMove, 'parentName', this.$refs.treeMove.getNode(val.pid).data.cnName)
}
this.getViewTable()
}
},
getViewTable() {
this.loading = true
this.tableDisplayFields = []
FetchInitCategoryViewTable({ categoryId: this.selectedCategoryMove.id, categoryLevel: 3 }).then((res) => {
if (res) {
this.arrySort = []
this.tableDisplayFields = res
const orderSortArry = this.tableDisplayFields.filter(item => item.displayOrder).sort((a, b) => a.displayOrder - b.displayOrder)
orderSortArry.forEach(item => {
if (item.displayOrderBy) {
this.arrySort.push(item.fieldName + ',' + item.displayOrderBy)
}
})
this.$nextTick(() => {
this.getViewTableList()
})
this.loading = false
}
})
},
getViewTableList() {
this.tableData = []
this.loading = true
const params = {
'categoryId': this.selectedCategoryMove.id,
'search': this.query.search,
'page': this.page.page - 1,
'size': this.page.size
}
FetchInitSingleCategoryView(params).then((res) => {
console.log(res)
if (res.code !== 500) {
this.tableData = res.list.content
this.page.total = res.list.totalElements
}
this.loading = false
})
},
handleClose(done) {
this.moveVisible = false
this.query.search = null
done()
},
handleSizeChange(val) {
console.log(`每页 ${val}`)
closedDialog() {
this.moveVisible = false
this.query.search = null
},
clickRowHandler(row) {
this.selections = []
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(row)
this.selections.push(row)
},
selectionChangeHandler(selection, row) {
this.selections = selection
},
handleComfirmed() {
if (this.selections.length === 0) {
this.crud.notify('请选择要移动到收集库的档案', CRUD.NOTIFICATION_TYPE.WARNING)
return false
}
const archivesIds = this.moveArc.map(item => {
return item.id
})
const params = {
'archivesId': this.selections[0].id, // id
'archivesIds': archivesIds, //
'categoryId': this.selectedCategoryMove.id, // id
'documentId': this.selectedDocument.id // id
}
console.log(params)
FetchMove(params).then((res) => {
this.$message.success(res)
this.moveVisible = false
this.query.search = null
this.selections = []
this.$emit('refresh')
})
},
handleSizeChange(size) {
this.page.size = size
this.page.page = 1
this.getViewTableList()
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
handleCurrentPage(val) {
this.page.page = val
this.getViewTableList()
}
}
}

Loading…
Cancel
Save