|
|
@ -2,21 +2,42 @@ |
|
|
|
<!-- 插件 --> |
|
|
|
<el-dialog class="insertFile-dialog" title="插件" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="insertFileVisible"> |
|
|
|
<div class="head-search"> |
|
|
|
<el-input v-model="query.blurry" 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; 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-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button> |
|
|
|
</div> |
|
|
|
<el-table :data="crud.data" style="width: 100%"> |
|
|
|
<el-table |
|
|
|
ref="table" |
|
|
|
:data="tableData" |
|
|
|
highlight-current-row |
|
|
|
style="width: 100%;" |
|
|
|
:row-key="rowKey" |
|
|
|
@select-all="selectAll" |
|
|
|
@selection-change="selectionChangeHandler" |
|
|
|
@row-click="clickRowHandler" |
|
|
|
@select="handleCurrentChange" |
|
|
|
> |
|
|
|
<el-table-column type="selection" :reserve-selection="true" width="55" align="center" /> |
|
|
|
<el-table-column prop="number" label="题名" width="120" /> |
|
|
|
<el-table-column prop="operator" label="档号" width="120" /> |
|
|
|
<el-table-column prop="operationType" label="年度" width="120" /> |
|
|
|
<el-table-column prop="file" label="所属门类" width="160" /> |
|
|
|
<el-table-column prop="createDate" label="所属分类" width="200" /> |
|
|
|
<el-table-column prop="createDate" label="起始时间" width="200" /> |
|
|
|
<el-table-column prop="createDate" label="终止时间" width="200" /> |
|
|
|
<el-table-column type="index" label="序号" width="55" align="center" /> |
|
|
|
<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> |
|
|
|
<!--分页组件--> |
|
|
|
<el-pagination |
|
|
|
v-if="tableData.length !== 0" |
|
|
|
:current-page="page.page" |
|
|
|
:total="page.total" |
|
|
|
:page-size="page.size" |
|
|
@ -26,40 +47,45 @@ |
|
|
|
@current-change="handleCurrentPage" |
|
|
|
/> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="text" @click="insertFileVisible = false">取消</el-button> |
|
|
|
<el-button type="text" @click="handleCloseDialog">取消</el-button> |
|
|
|
<el-button type="primary" @click.native="handleComfireInsertFile">确定</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import CRUD, { presenter, crud } from '@crud/crud' |
|
|
|
import rrOperation from '@crud/RR.operation' |
|
|
|
import { FetchInitCategoryViewTable, FetchInitCategoryView } from '@/api/collect/collect' |
|
|
|
export default { |
|
|
|
name: 'InsertFile', |
|
|
|
components: { 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 |
|
|
|
props: { |
|
|
|
selectedCategory: { |
|
|
|
type: Object, |
|
|
|
default: function() { |
|
|
|
return {} |
|
|
|
} |
|
|
|
}, |
|
|
|
collectLevel: { |
|
|
|
type: Number, |
|
|
|
default: function() { |
|
|
|
return null |
|
|
|
} |
|
|
|
}, |
|
|
|
selections: { |
|
|
|
type: Array, |
|
|
|
default: () => [] |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
inject: ['parentsData'], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
query: { |
|
|
|
blurry: '' |
|
|
|
search: null |
|
|
|
}, |
|
|
|
insertFileVisible: false, |
|
|
|
insertSelections: [], |
|
|
|
tableData: [], |
|
|
|
tableDisplayFields: [], |
|
|
|
arrySort: [], |
|
|
|
page: { |
|
|
|
page: 1, |
|
|
|
size: 10, |
|
|
@ -70,10 +96,86 @@ export default { |
|
|
|
created() { |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
rowKey(row) { |
|
|
|
return row.id |
|
|
|
}, |
|
|
|
toQuery() { |
|
|
|
|
|
|
|
}, |
|
|
|
resetQuery() { |
|
|
|
this.query.search = null |
|
|
|
}, |
|
|
|
getInsertViewTable() { |
|
|
|
this.tableDisplayFields = [] |
|
|
|
let parentsId |
|
|
|
let categoryLevel |
|
|
|
if (this.collectLevel === 2) { |
|
|
|
// 该门类下的"未整理"文件列表 |
|
|
|
parentsId = null |
|
|
|
categoryLevel = 3 |
|
|
|
} else if (this.collectLevel === 3) { |
|
|
|
// 该门类下的"已整理"案卷列表 |
|
|
|
categoryLevel = 2 |
|
|
|
if (this.selectedCategory.arrangeType === 3) { |
|
|
|
parentsId = this.parentsData.parentsProjectId |
|
|
|
} else { |
|
|
|
parentsId = null |
|
|
|
} |
|
|
|
} |
|
|
|
FetchInitCategoryViewTable({ categoryId: this.selectedCategory.id, categoryLevel: categoryLevel }).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.getInsertList(categoryLevel, parentsId) |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getInsertList(categoryLevel, parentsId) { |
|
|
|
const params = { |
|
|
|
'parentId': parentsId, |
|
|
|
'categoryId': this.selectedCategory.id, |
|
|
|
'categoryLevel': categoryLevel, |
|
|
|
'search': this.query.search, |
|
|
|
'page': this.page.page - 1, |
|
|
|
'size': this.page.size, |
|
|
|
'sort': this.arrySort |
|
|
|
} |
|
|
|
FetchInitCategoryView(params).then((res) => { |
|
|
|
if (res.code !== 500) { |
|
|
|
this.insertFileVisible = true |
|
|
|
this.tableData = res.list.content |
|
|
|
this.page.total = res.list.totalElements |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// table - 全选 |
|
|
|
selectAll(val) { |
|
|
|
this.insertSelections = val |
|
|
|
}, |
|
|
|
clickRowHandler(row) { |
|
|
|
this.$refs.table.toggleRowSelection(row) |
|
|
|
// this.insertSelections = this.crud.selections |
|
|
|
}, |
|
|
|
selectionChangeHandler(val) { |
|
|
|
this.insertSelections = val |
|
|
|
}, |
|
|
|
handleCurrentChange(selection, row) { |
|
|
|
this.insertSelections = selection |
|
|
|
}, |
|
|
|
handleComfireInsertFile() { |
|
|
|
this.insertFileVisible = false |
|
|
|
console.log('insertSelections', this.insertSelections) |
|
|
|
// this.insertFileVisible = false |
|
|
|
}, |
|
|
|
handleSizeChange(size) { |
|
|
|
this.page.size = size |
|
|
@ -81,6 +183,15 @@ export default { |
|
|
|
}, |
|
|
|
handleCurrentPage(val) { |
|
|
|
this.page.page = val |
|
|
|
}, |
|
|
|
handleCloseDialog(done) { |
|
|
|
// 重置表单数据 |
|
|
|
this.query.search = null |
|
|
|
this.tableDisplayFields = [] |
|
|
|
this.tableData = [] |
|
|
|
this.insertFileVisible = false |
|
|
|
// 关闭弹框 |
|
|
|
// done() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|