Browse Source

收集库-移动/插件/合卷

master
xuhuajiao 1 year ago
parent
commit
08610444d8
  1. 12
      src/api/collect/collect.js
  2. 4
      src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
  3. 100
      src/views/collectReorganizi/collectionLibrary/module/collectMoveFile/index.vue
  4. 2
      src/views/collectReorganizi/collectionLibrary/module/combineFile/index.vue
  5. 128
      src/views/collectReorganizi/collectionLibrary/module/insertFile/index.vue

12
src/api/collect/collect.js

@ -171,6 +171,15 @@ export function FetchMergeArchives(data) {
}) })
} }
// 插件
export function FetchInsertSingle(data) {
return request({
url: 'api/collect/insertSingle',
method: 'post',
data
})
}
export default { export default {
collectAdd, collectAdd,
collectEdit, collectEdit,
@ -188,5 +197,6 @@ export default {
FetchDoArchivesAdjust, FetchDoArchivesAdjust,
FetchArchivesAdjust, FetchArchivesAdjust,
FetchDisbandArchives, FetchDisbandArchives,
FetchMergeArchives
FetchMergeArchives,
FetchInsertSingle
} }

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

@ -184,7 +184,7 @@
<!-- 插件 --> <!-- 插件 -->
<InsertFile ref="insertFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" /> <InsertFile ref="insertFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
<!-- 移动 --> <!-- 移动 -->
<CollectMoveFile ref="collectMoveFileRef" />
<CollectMoveFile ref="collectMoveFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
<!-- 归档 --> <!-- 归档 -->
<el-dialog class="tip-dialog" title="归档" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="filingVisible"> <el-dialog class="tip-dialog" title="归档" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="filingVisible">
@ -857,6 +857,8 @@ export default {
type: 'warning', type: 'warning',
dangerouslyUseHTMLString: true dangerouslyUseHTMLString: true
}).then(() => { }).then(() => {
console.log(this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData)
this.$refs.insertFileRef.fileNoSelectionData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
this.$refs.insertFileRef.getInsertViewTable() this.$refs.insertFileRef.getInsertViewTable()
}).catch(() => { }).catch(() => {
}) })

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

@ -1,6 +1,6 @@
<template> <template>
<!-- 移动 --> <!-- 移动 -->
<el-dialog class="collectMoveFile-dialog" title="移动" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="collectMoveFileVisible" @opened="opened">
<el-dialog class="collectMoveFile-dialog" title="移动" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="collectMoveFileVisible">
<div class="collectMove-main"> <div class="collectMove-main">
<div class="collectMove-left"> <div class="collectMove-left">
<CategoryTree ref="categoryTree" @nodeClick="handleNodeClick" /> <CategoryTree ref="categoryTree" @nodeClick="handleNodeClick" />
@ -8,8 +8,9 @@
<div class="collectMove-right"> <div class="collectMove-right">
<div class="head-search"> <div class="head-search">
<el-input v-model="query.search" clearable size="small" placeholder="输入题名或档号搜索" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<rrOperation />
<el-input v-model="query.search" clearable size="small" placeholder="输入题名或档号搜索" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="getViewTableList" @clear="getViewTableList" />
<el-button class="filter-item filter-search" style="margin: 0 10px;" size="mini" type="success" icon="el-icon-search" @click="getViewTableList">搜索</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 class="table-list"> <div class="table-list">
<el-table <el-table
@ -78,42 +79,40 @@
<script> <script>
import CategoryTree from '@/views/components/categoryTree' import CategoryTree from '@/views/components/categoryTree'
import { FetchInitCategoryViewTable, FetchInitCategoryView } from '@/api/collect/collect' import { FetchInitCategoryViewTable, FetchInitCategoryView } from '@/api/collect/collect'
import CRUD, { presenter, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
export default { export default {
name: 'CollectMoveFile', name: 'CollectMoveFile',
components: { CategoryTree, rrOperation },
mixins: [presenter(), crud()],
cruds() {
return CRUD({
url: 'api/category/menu',
crudMethod: { },
optShow: {
add: false,
edit: false,
del: false,
reset: true,
download: false,
group: false
components: { CategoryTree },
props: {
selectedCategory: {
type: Object,
default: function() {
return {}
} }
})
},
collectLevel: {
type: Number,
default: function() {
return null
}
},
selections: {
type: Array,
default: () => []
}
}, },
data() { data() {
return { return {
defaultProps: {
children: 'children',
label: 'cnName'
},
query: { query: {
search: ''
search: null
}, },
currentCategory: null, currentCategory: null,
currentLevel: null,
collectMoveFileVisible: false, collectMoveFileVisible: false,
loading: false, loading: false,
arrySort: [], arrySort: [],
tableData: [], tableData: [],
tableDisplayFields: [], tableDisplayFields: [],
selections: [],
moveSelections: [],
page: { page: {
page: 1, page: 1,
size: 10, size: 10,
@ -122,41 +121,16 @@ export default {
checkList: [] checkList: []
} }
}, },
created() {
},
mounted() { mounted() {
}, },
methods: { methods: {
resetQuery() {
this.query.search = null
this.getViewTableList()
},
getRowKey(row) { getRowKey(row) {
return row.id return row.id
}, },
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
})
} else {
currentKey = this.crud.data[0]
}
//
this.$refs.treeMove.setCurrentKey(currentKey.id)
this.$nextTick(() => {
//
const selectedKey = this.$refs.treeMove.getCurrentNode()
if (this.$refs.treeMove.getNode(selectedKey) && this.$refs.treeMove.getNode(selectedKey).parent) {
this.expandParents(this.$refs.treeMove.getNode(selectedKey).parent)
}
//
this.handleMoveNodeClick(selectedKey)
})
}
},
handleNodeClick(data) { handleNodeClick(data) {
if (data) { if (data) {
this.currentCategory = data this.currentCategory = data
@ -166,7 +140,13 @@ export default {
getViewTable() { getViewTable() {
this.loading = true this.loading = true
this.tableDisplayFields = [] this.tableDisplayFields = []
FetchInitCategoryViewTable({ categoryId: this.currentCategory.id, categoryLevel: 3 }).then((res) => {
console.log('this.collectLevel', this.currentCategory.arrangeType)
if (this.currentCategory.arrangeType === 1) {
this.currentLevel = 3
} else {
this.currentLevel = 2
}
FetchInitCategoryViewTable({ categoryId: this.currentCategory.id, categoryLevel: this.currentLevel }).then((res) => {
if (res) { if (res) {
this.arrySort = [] this.arrySort = []
this.tableDisplayFields = res this.tableDisplayFields = res
@ -188,7 +168,7 @@ export default {
this.loading = true this.loading = true
const params = { const params = {
'categoryId': this.currentCategory.id, 'categoryId': this.currentCategory.id,
'categoryLevel': 3,
'categoryLevel': this.currentLevel,
'search': this.query.search, 'search': this.query.search,
'page': this.page.page - 1, 'page': this.page.page - 1,
'size': this.page.size 'size': this.page.size
@ -203,13 +183,13 @@ export default {
}) })
}, },
clickRowHandler(row) { clickRowHandler(row) {
this.selections = []
this.moveSelections = []
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(row) this.$refs.table.toggleRowSelection(row)
this.selections.push(row)
this.moveSelections.push(row)
}, },
selectionChangeHandler(selection, row) { selectionChangeHandler(selection, row) {
this.selections = selection
this.moveSelections = selection
}, },
handleComfireCollectMoveFile() { handleComfireCollectMoveFile() {
this.collectMoveFileVisible = false this.collectMoveFileVisible = false
@ -217,9 +197,11 @@ export default {
handleSizeChange(size) { handleSizeChange(size) {
this.page.size = size this.page.size = size
this.page.page = 1 this.page.page = 1
this.getViewTableList()
}, },
handleCurrentPage(val) { handleCurrentPage(val) {
this.page.page = val this.page.page = val
this.getViewTableList()
} }
} }
} }

2
src/views/collectReorganizi/collectionLibrary/module/combineFile/index.vue

@ -73,7 +73,7 @@ export default {
this.$message.success('合卷成功') this.$message.success('合卷成功')
this.$emit('close-dialog') this.$emit('close-dialog')
} else { } else {
this.$message.success('合卷失败')
this.$message.error('合卷失败')
} }
this.combineFileVisible = false this.combineFileVisible = false
}) })

128
src/views/collectReorganizi/collectionLibrary/module/insertFile/index.vue

@ -1,13 +1,14 @@
<template> <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"> <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> <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
</div> </div>
<el-table <el-table
ref="table" ref="table"
v-loading="tableLoading"
:data="tableData" :data="tableData"
highlight-current-row highlight-current-row
style="width: 100%;" style="width: 100%;"
@ -54,7 +55,7 @@
</template> </template>
<script> <script>
import { FetchInitCategoryViewTable, FetchInitCategoryView } from '@/api/collect/collect'
import { FetchInitCategoryViewTable, FetchInitCategoryView, FetchInsertSingle } from '@/api/collect/collect'
export default { export default {
name: 'InsertFile', name: 'InsertFile',
props: { props: {
@ -82,10 +83,14 @@ export default {
search: null search: null
}, },
insertFileVisible: false, insertFileVisible: false,
tableLoading: false,
insertSelections: [], insertSelections: [],
tableData: [], tableData: [],
tableDisplayFields: [], tableDisplayFields: [],
arrySort: [], arrySort: [],
parentsId: null,
categoryLevel: null,
fileNoSelectionData: [],
page: { page: {
page: 1, page: 1,
size: 10, size: 10,
@ -102,30 +107,33 @@ export default {
rowKey(row) { rowKey(row) {
return row.id return row.id
}, },
toQuery() {
},
resetQuery() {
this.query.search = null
},
getInsertViewTable() {
this.tableDisplayFields = []
let parentsId
let categoryLevel
setInsertBase() {
if (this.collectLevel === 2) { if (this.collectLevel === 2) {
// "" // ""
parentsId = null
categoryLevel = 3
this.parentsId = null
this.categoryLevel = 3
} else if (this.collectLevel === 3) { } else if (this.collectLevel === 3) {
// "" // ""
categoryLevel = 2
this.categoryLevel = 2
if (this.selectedCategory.arrangeType === 3) { if (this.selectedCategory.arrangeType === 3) {
parentsId = this.parentsData.parentsProjectId
this.parentsId = this.parentsData.parentsProjectId
} else { } 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) { if (res) {
this.arrySort = [] this.arrySort = []
this.tableDisplayFields = res this.tableDisplayFields = res
@ -136,12 +144,13 @@ export default {
} }
}) })
this.$nextTick(() => { this.$nextTick(() => {
this.getInsertList(categoryLevel, parentsId)
this.getInsertList(this.categoryLevel, this.parentsId)
}) })
} }
}) })
}, },
getInsertList(categoryLevel, parentsId) { getInsertList(categoryLevel, parentsId) {
this.tableLoading = true
const params = { const params = {
'parentId': parentsId, 'parentId': parentsId,
'categoryId': this.selectedCategory.id, 'categoryId': this.selectedCategory.id,
@ -156,39 +165,102 @@ export default {
this.insertFileVisible = true this.insertFileVisible = true
this.tableData = res.list.content this.tableData = res.list.content
this.page.total = res.list.totalElements this.page.total = res.list.totalElements
setTimeout(() => {
this.tableLoading = false
}, 500)
} }
}) })
}, },
// table - // table -
selectAll(val) { selectAll(val) {
this.insertSelections = val
if (this.categoryLevel === 2) {
val.splice(0, val.length)
this.insertSelections = val
} else {
this.insertSelections = val
}
}, },
clickRowHandler(row) { 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) { 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() { handleComfireInsertFile() {
console.log('insertSelections', this.insertSelections) 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) { handleSizeChange(size) {
this.page.size = size this.page.size = size
this.page.page = 1 this.page.page = 1
this.toQuery()
}, },
handleCurrentPage(val) { handleCurrentPage(val) {
this.page.page = val this.page.page = val
this.toQuery()
}, },
handleCloseDialog(done) { handleCloseDialog(done) {
// //
this.query.search = null this.query.search = null
this.tableDisplayFields = [] this.tableDisplayFields = []
this.tableData = [] this.tableData = []
this.$refs.table.clearSelection()
this.insertSelections = []
this.insertFileVisible = false this.insertFileVisible = false
// //
// done() // done()

Loading…
Cancel
Save