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. 122
      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 {
collectAdd,
collectEdit,
@ -188,5 +197,6 @@ export default {
FetchDoArchivesAdjust,
FetchArchivesAdjust,
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" />
<!-- 移动 -->
<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">
@ -857,6 +857,8 @@ export default {
type: 'warning',
dangerouslyUseHTMLString: true
}).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()
}).catch(() => {
})

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

@ -1,6 +1,6 @@
<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-left">
<CategoryTree ref="categoryTree" @nodeClick="handleNodeClick" />
@ -8,8 +8,9 @@
<div class="collectMove-right">
<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 class="table-list">
<el-table
@ -78,42 +79,40 @@
<script>
import CategoryTree from '@/views/components/categoryTree'
import { FetchInitCategoryViewTable, FetchInitCategoryView } from '@/api/collect/collect'
import CRUD, { presenter, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
export default {
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() {
return {
defaultProps: {
children: 'children',
label: 'cnName'
},
query: {
search: ''
search: null
},
currentCategory: null,
currentLevel: null,
collectMoveFileVisible: false,
loading: false,
arrySort: [],
tableData: [],
tableDisplayFields: [],
selections: [],
moveSelections: [],
page: {
page: 1,
size: 10,
@ -122,41 +121,16 @@ export default {
checkList: []
}
},
created() {
},
mounted() {
},
methods: {
resetQuery() {
this.query.search = null
this.getViewTableList()
},
getRowKey(row) {
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) {
if (data) {
this.currentCategory = data
@ -166,7 +140,13 @@ export default {
getViewTable() {
this.loading = true
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) {
this.arrySort = []
this.tableDisplayFields = res
@ -188,7 +168,7 @@ export default {
this.loading = true
const params = {
'categoryId': this.currentCategory.id,
'categoryLevel': 3,
'categoryLevel': this.currentLevel,
'search': this.query.search,
'page': this.page.page - 1,
'size': this.page.size
@ -203,13 +183,13 @@ export default {
})
},
clickRowHandler(row) {
this.selections = []
this.moveSelections = []
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(row)
this.selections.push(row)
this.moveSelections.push(row)
},
selectionChangeHandler(selection, row) {
this.selections = selection
this.moveSelections = selection
},
handleComfireCollectMoveFile() {
this.collectMoveFileVisible = false
@ -217,9 +197,11 @@ export default {
handleSizeChange(size) {
this.page.size = size
this.page.page = 1
this.getViewTableList()
},
handleCurrentPage(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.$emit('close-dialog')
} else {
this.$message.success('合卷失败')
this.$message.error('合卷失败')
}
this.combineFileVisible = false
})

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

@ -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) {
if (this.categoryLevel === 2) {
val.splice(0, val.length)
this.insertSelections = val
} else {
this.insertSelections = val
}
},
clickRowHandler(row) {
console.log('row', row)
if (this.categoryLevel === 2) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(row)
// this.insertSelections = this.crud.selections
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) {
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()

Loading…
Cancel
Save