|
|
@ -1,13 +1,14 @@ |
|
|
|
<template> |
|
|
|
<!-- 插件 --> |
|
|
|
<el-dialog class="insertFile-dialog" title="插件" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="insertFileVisible"> |
|
|
|
<el-dialog class="insertFile-dialog" title="插件" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="insertFileVisible" :before-close="handleCloseDialog"> |
|
|
|
<div class="head-search"> |
|
|
|
<el-input v-model="query.search" clearable size="small" placeholder="输入题名搜索" prefix-icon="el-icon-search" style="width: 200px; margin-right: 10px;" class="filter-item" @keyup.enter.native="toQuery" /> |
|
|
|
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button> |
|
|
|
<el-input v-model="query.search" clearable size="small" placeholder="输入题名搜索" prefix-icon="el-icon-search" style="width: 200px; margin-right: 10px;" class="filter-item" @keyup.enter.native="toQuery" @clear="toQuery" /> |
|
|
|
<el-button class="filter-item filter-search" style="margin-right: 10px;" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button> |
|
|
|
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button> |
|
|
|
</div> |
|
|
|
<el-table |
|
|
|
ref="table" |
|
|
|
v-loading="tableLoading" |
|
|
|
:data="tableData" |
|
|
|
highlight-current-row |
|
|
|
style="width: 100%;" |
|
|
@ -54,7 +55,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { FetchInitCategoryViewTable, FetchInitCategoryView } from '@/api/collect/collect' |
|
|
|
import { FetchInitCategoryViewTable, FetchInitCategoryView, FetchInsertSingle } from '@/api/collect/collect' |
|
|
|
export default { |
|
|
|
name: 'InsertFile', |
|
|
|
props: { |
|
|
@ -82,10 +83,14 @@ export default { |
|
|
|
search: null |
|
|
|
}, |
|
|
|
insertFileVisible: false, |
|
|
|
tableLoading: false, |
|
|
|
insertSelections: [], |
|
|
|
tableData: [], |
|
|
|
tableDisplayFields: [], |
|
|
|
arrySort: [], |
|
|
|
parentsId: null, |
|
|
|
categoryLevel: null, |
|
|
|
fileNoSelectionData: [], |
|
|
|
page: { |
|
|
|
page: 1, |
|
|
|
size: 10, |
|
|
@ -102,30 +107,33 @@ export default { |
|
|
|
rowKey(row) { |
|
|
|
return row.id |
|
|
|
}, |
|
|
|
toQuery() { |
|
|
|
|
|
|
|
}, |
|
|
|
resetQuery() { |
|
|
|
this.query.search = null |
|
|
|
}, |
|
|
|
getInsertViewTable() { |
|
|
|
this.tableDisplayFields = [] |
|
|
|
let parentsId |
|
|
|
let categoryLevel |
|
|
|
setInsertBase() { |
|
|
|
if (this.collectLevel === 2) { |
|
|
|
// 该门类下的"未整理"文件列表 |
|
|
|
parentsId = null |
|
|
|
categoryLevel = 3 |
|
|
|
this.parentsId = null |
|
|
|
this.categoryLevel = 3 |
|
|
|
} else if (this.collectLevel === 3) { |
|
|
|
// 该门类下的"已整理"案卷列表 |
|
|
|
categoryLevel = 2 |
|
|
|
this.categoryLevel = 2 |
|
|
|
if (this.selectedCategory.arrangeType === 3) { |
|
|
|
parentsId = this.parentsData.parentsProjectId |
|
|
|
this.parentsId = this.parentsData.parentsProjectId |
|
|
|
} else { |
|
|
|
parentsId = null |
|
|
|
this.parentsId = null |
|
|
|
} |
|
|
|
} |
|
|
|
FetchInitCategoryViewTable({ categoryId: this.selectedCategory.id, categoryLevel: categoryLevel }).then((res) => { |
|
|
|
}, |
|
|
|
toQuery() { |
|
|
|
this.setInsertBase() |
|
|
|
this.getInsertList(this.categoryLevel, this.parentsId) |
|
|
|
}, |
|
|
|
resetQuery() { |
|
|
|
this.query.search = null |
|
|
|
this.toQuery() |
|
|
|
}, |
|
|
|
getInsertViewTable() { |
|
|
|
this.tableDisplayFields = [] |
|
|
|
this.setInsertBase() |
|
|
|
FetchInitCategoryViewTable({ categoryId: this.selectedCategory.id, categoryLevel: this.categoryLevel }).then((res) => { |
|
|
|
if (res) { |
|
|
|
this.arrySort = [] |
|
|
|
this.tableDisplayFields = res |
|
|
@ -136,12 +144,13 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
this.$nextTick(() => { |
|
|
|
this.getInsertList(categoryLevel, parentsId) |
|
|
|
this.getInsertList(this.categoryLevel, this.parentsId) |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getInsertList(categoryLevel, parentsId) { |
|
|
|
this.tableLoading = true |
|
|
|
const params = { |
|
|
|
'parentId': parentsId, |
|
|
|
'categoryId': this.selectedCategory.id, |
|
|
@ -156,39 +165,102 @@ export default { |
|
|
|
this.insertFileVisible = true |
|
|
|
this.tableData = res.list.content |
|
|
|
this.page.total = res.list.totalElements |
|
|
|
setTimeout(() => { |
|
|
|
this.tableLoading = false |
|
|
|
}, 500) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// table - 全选 |
|
|
|
selectAll(val) { |
|
|
|
this.insertSelections = val |
|
|
|
if (this.categoryLevel === 2) { |
|
|
|
val.splice(0, val.length) |
|
|
|
this.insertSelections = val |
|
|
|
} else { |
|
|
|
this.insertSelections = val |
|
|
|
} |
|
|
|
}, |
|
|
|
clickRowHandler(row) { |
|
|
|
this.$refs.table.toggleRowSelection(row) |
|
|
|
// this.insertSelections = this.crud.selections |
|
|
|
console.log('row', row) |
|
|
|
if (this.categoryLevel === 2) { |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.$refs.table.toggleRowSelection(row) |
|
|
|
this.insertSelections = [] |
|
|
|
this.insertSelections.push(row) |
|
|
|
} else { |
|
|
|
this.$refs.table.toggleRowSelection(row) |
|
|
|
} |
|
|
|
}, |
|
|
|
selectionChangeHandler(val) { |
|
|
|
this.insertSelections = val |
|
|
|
selectionChangeHandler(selection) { |
|
|
|
if (this.categoryLevel === 2) { |
|
|
|
if (selection.length > 1) { |
|
|
|
selection.splice(0, selection.length - 1) |
|
|
|
this.insertSelections = selection |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.insertSelections = selection |
|
|
|
} |
|
|
|
}, |
|
|
|
handleCurrentChange(selection, row) { |
|
|
|
this.insertSelections = selection |
|
|
|
if (this.categoryLevel === 2) { |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.$refs.table.toggleRowSelection(row) |
|
|
|
this.insertSelections = [] |
|
|
|
this.insertSelections.push(row) |
|
|
|
} else { |
|
|
|
this.insertSelections = selection |
|
|
|
} |
|
|
|
}, |
|
|
|
handleComfireInsertFile() { |
|
|
|
console.log('insertSelections', this.insertSelections) |
|
|
|
// this.insertFileVisible = false |
|
|
|
let archivesIds |
|
|
|
let params |
|
|
|
if (this.collectLevel === 2) { |
|
|
|
archivesIds = this.insertSelections.map(item => item.id) |
|
|
|
params = { |
|
|
|
'categoryId': this.selectedCategory.id, // 门类id |
|
|
|
'archivesIds': archivesIds, // 卷内级档案id |
|
|
|
'parentsId': this.selections[0].id // 案卷级档案id |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (this.selections.length === 0) { |
|
|
|
archivesIds = this.fileNoSelectionData.map(item => item.id) |
|
|
|
} else { |
|
|
|
archivesIds = this.selections.map(item => item.id) |
|
|
|
} |
|
|
|
params = { |
|
|
|
'categoryId': this.selectedCategory.id, // 门类id |
|
|
|
'archivesIds': archivesIds, // 卷内级档案id |
|
|
|
'parentsId': this.insertSelections[0].id // 案卷级档案id |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(params) |
|
|
|
FetchInsertSingle(params).then((res) => { |
|
|
|
if (res.code !== 500) { |
|
|
|
this.$message.success('插件成功') |
|
|
|
this.$emit('close-dialog') |
|
|
|
} else { |
|
|
|
this.$message.error('插件失败') |
|
|
|
} |
|
|
|
this.insertFileVisible = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleSizeChange(size) { |
|
|
|
this.page.size = size |
|
|
|
this.page.page = 1 |
|
|
|
this.toQuery() |
|
|
|
}, |
|
|
|
handleCurrentPage(val) { |
|
|
|
this.page.page = val |
|
|
|
this.toQuery() |
|
|
|
}, |
|
|
|
handleCloseDialog(done) { |
|
|
|
// 重置表单数据 |
|
|
|
this.query.search = null |
|
|
|
this.tableDisplayFields = [] |
|
|
|
this.tableData = [] |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.insertSelections = [] |
|
|
|
this.insertFileVisible = false |
|
|
|
// 关闭弹框 |
|
|
|
// done() |
|
|
|