|
|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<div class="app-container row-container"> |
|
|
|
<div class="connection-header"> |
|
|
|
<div class="head-search"> |
|
|
|
<div class="connection-header collect-header" style="padding: 0; border-top: none; height: auto; margin-bottom: 20px;"> |
|
|
|
<div class="head-search" style="margin-bottom: 0;"> |
|
|
|
<el-select |
|
|
|
v-model="fondsIds" |
|
|
|
multiple |
|
|
|
@ -16,34 +16,59 @@ |
|
|
|
:value="item.id" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
<el-select |
|
|
|
v-model="years" |
|
|
|
multiple |
|
|
|
collapse-tags |
|
|
|
placeholder="请选择年份" |
|
|
|
style="width: 150px;" |
|
|
|
<date-range-picker v-model="blurryTime" class="date-item" style="width: 240px !important; margin-right: 10px;" /> |
|
|
|
<el-input |
|
|
|
v-model="typeValue" |
|
|
|
size="small" |
|
|
|
clearable |
|
|
|
placeholder="请输入关键词" |
|
|
|
style="width: 300px;" |
|
|
|
class="input-prepend filter-item" |
|
|
|
@clear="getBorrowdRegisterStatisticsList" |
|
|
|
@keyup.enter.native="getBorrowdRegisterStatisticsList" |
|
|
|
@input="typeInput" |
|
|
|
> |
|
|
|
<el-select slot="prepend" v-model="inputSelect" style="width: 92px" @change="clearInputValue"> |
|
|
|
<el-option |
|
|
|
v-for="item in yearsOptions" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id" |
|
|
|
v-for="item in options" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="getTotalStatistics">查询</el-button> |
|
|
|
</el-input> |
|
|
|
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="getBorrowdRegisterStatisticsList">查询</el-button> |
|
|
|
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button> |
|
|
|
</div> |
|
|
|
<el-button size="mini" @click="doExport()"> |
|
|
|
<i class="iconfont icon-daochu" /> |
|
|
|
导出 |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="table-container"> |
|
|
|
<el-table class="archives-table" :data="allData" :summary-method="getSummaries" show-summary border style="width: 100%;"> |
|
|
|
<!-- :summary-method="getSummaries" show-summary border --> |
|
|
|
<el-table v-loading="loading" class="archives-table" :data="allData" height="calc(100vh - 280px)" style="width: 100%;"> |
|
|
|
<el-table-column type="index" label="序号" width="60" align="center" /> |
|
|
|
<el-table-column prop="categoryName" label="档案门类(国标分类)" align="center" /> |
|
|
|
<el-table-column prop="archivesCount" label="案卷数(卷)" align="center" /> |
|
|
|
<el-table-column prop="singleCount" label="卷内件数(件)" align="center" /> |
|
|
|
<el-table-column prop="fileCount" label="电子原文数量(份)" align="center" /> |
|
|
|
<el-table-column prop="fileSize" label="电子档案存储容量(GB)" align="center" /> |
|
|
|
<el-table-column prop="applicantName" label="借阅人" align="center" /> |
|
|
|
<el-table-column prop="deptName" label="所属部门" align="center" /> |
|
|
|
<el-table-column prop="viewCount" label="累计查看次数" align="center" /> |
|
|
|
<el-table-column prop="downloadCount" label="累计下载次数" align="center" /> |
|
|
|
<el-table-column prop="borrowCount" label="累计借阅人次" align="center" /> |
|
|
|
<el-table-column prop="firstUseTime" label="首次利用时间" align="center" /> |
|
|
|
<el-table-column prop="lastUseTime" label="末次利用时间" align="center" /> |
|
|
|
</el-table> |
|
|
|
<el-pagination |
|
|
|
v-if="allData.length !== 0" |
|
|
|
style="margin: 24px 0 10px 0 !important;" |
|
|
|
:current-page="page.page+1" |
|
|
|
:total="page.total" |
|
|
|
:page-size="page.size" |
|
|
|
:pager-count="5" |
|
|
|
layout="total, prev, pager, next, sizes" |
|
|
|
@size-change="handleSizeChange" |
|
|
|
@current-change="handleCurrentPage" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
@ -51,89 +76,131 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { FetchFondsAll } from '@/api/system/fonds' |
|
|
|
import { FetchTotalStatistics, FetchArchivedAllYear } from '@/api/statistics/statistics' |
|
|
|
import { FetchBorrowdRegisterStatisticsList } from '@/api/statistics/statistics' |
|
|
|
import DateRangePicker from '@/components/DateRangePicker' |
|
|
|
import qs from 'qs' |
|
|
|
import { exportFile } from '@/utils/index' |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'UtilizeRegistrationStatistics', |
|
|
|
components: { |
|
|
|
DateRangePicker |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
allData: [], |
|
|
|
fondsOptions: [], |
|
|
|
fondsIds: [], |
|
|
|
yearsOptions: [], |
|
|
|
years: [] |
|
|
|
blurryTime: [], |
|
|
|
loading: false, |
|
|
|
page: { |
|
|
|
page: 0, |
|
|
|
size: 10, |
|
|
|
total: 0 |
|
|
|
}, |
|
|
|
typeValue: null, |
|
|
|
options: [ |
|
|
|
{ value: 'search', label: '借阅人' }, |
|
|
|
{ value: 'borrowReason', label: '借阅目的' } |
|
|
|
], |
|
|
|
inputSelect: '', |
|
|
|
query: {} |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapGetters([ |
|
|
|
'baseApi' |
|
|
|
]) |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.inputSelect = this.options[0].value |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.getFondsDatas() |
|
|
|
this.getArchivedAllYearDatas() |
|
|
|
this.getTotalStatistics() |
|
|
|
this.getBorrowdRegisterStatisticsList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getSummaries(param) { |
|
|
|
const { columns, data } = param |
|
|
|
const sums = [] |
|
|
|
console.log('columns', columns) |
|
|
|
console.log('data', data) |
|
|
|
columns.forEach((column, index) => { |
|
|
|
if (index === 1) { |
|
|
|
sums[index] = '合计(全库总量)' |
|
|
|
return |
|
|
|
typeInput(e) { |
|
|
|
this.typeInputkey = this.getDescByValue( |
|
|
|
this.inputSelect, |
|
|
|
this.options, |
|
|
|
'value', |
|
|
|
'value' |
|
|
|
) |
|
|
|
this.query[this.typeInputkey] = e |
|
|
|
}, |
|
|
|
clearInputValue(val) { |
|
|
|
this.inputSelect = val |
|
|
|
this.typeValue = '' |
|
|
|
if (this.typeInputkey) { |
|
|
|
delete this.query[this.typeInputkey] |
|
|
|
} |
|
|
|
const values = data.map(item => Number(item[column.property])) |
|
|
|
console.log(values) |
|
|
|
if (!values.every(value => isNaN(value))) { |
|
|
|
if (column.property === 'fileSize') { |
|
|
|
sums[index] = values.reduce((prev, curr) => { |
|
|
|
return prev + curr |
|
|
|
}, 0).toFixed(3) |
|
|
|
} else { |
|
|
|
sums[index] = values.reduce((prev, curr) => { |
|
|
|
return prev + curr |
|
|
|
}, 0) |
|
|
|
}, |
|
|
|
getDescByValue(inputValue, data, inputKey = 'value', outputKey = 'value') { |
|
|
|
let outputValue = '' |
|
|
|
if (data && data.length > 0) { |
|
|
|
for (let i = 0; i < data.length; i++) { |
|
|
|
const item = data[i] |
|
|
|
const itemValue = item[inputKey] |
|
|
|
if (inputValue + '' === itemValue + '') { |
|
|
|
outputValue = item[outputKey] |
|
|
|
break |
|
|
|
} |
|
|
|
} else { |
|
|
|
sums[index] = '-' |
|
|
|
} |
|
|
|
}) |
|
|
|
return sums |
|
|
|
} |
|
|
|
return outputValue |
|
|
|
}, |
|
|
|
resetQuery() { |
|
|
|
this.clearInputValue() |
|
|
|
this.fondsIds = [] |
|
|
|
this.years = [] |
|
|
|
this.getTotalStatistics() |
|
|
|
this.blurryTime = [] |
|
|
|
this.inputSelect = this.options[0].value |
|
|
|
this.query = {} |
|
|
|
this.page.page = 0 |
|
|
|
this.getBorrowdRegisterStatisticsList() |
|
|
|
}, |
|
|
|
getFondsDatas() { |
|
|
|
FetchFondsAll().then(res => { |
|
|
|
this.fondsOptions = res |
|
|
|
// 默认全选所有档案库 |
|
|
|
// this.fondsIds = res.map(item => item.id) |
|
|
|
// this.checkAndQuery() |
|
|
|
}) |
|
|
|
}, |
|
|
|
getArchivedAllYearDatas() { |
|
|
|
FetchArchivedAllYear().then(res => { |
|
|
|
this.yearsOptions = res.map(item => ({ |
|
|
|
id: item, |
|
|
|
name: item |
|
|
|
})) |
|
|
|
// 默认全选所有年份 |
|
|
|
// this.years = res.map(item => item) |
|
|
|
// this.checkAndQuery() |
|
|
|
getBorrowdRegisterStatisticsList() { |
|
|
|
this.loading = true |
|
|
|
FetchBorrowdRegisterStatisticsList({ |
|
|
|
fondsIds: this.fondsIds, |
|
|
|
startTime: this.blurryTime ? this.blurryTime[0] : null, |
|
|
|
endTime: this.blurryTime ? this.blurryTime[1] : null, |
|
|
|
pageNo: this.page.page, |
|
|
|
pageSize: this.page.size, |
|
|
|
search: this.query.search || null, |
|
|
|
borrowReason: this.query.borrowReason || null |
|
|
|
}).then(res => { |
|
|
|
this.allData = res.records |
|
|
|
this.page.total = res.total |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
checkAndQuery() { |
|
|
|
// 当两个数据都加载完成后才执行查询 |
|
|
|
if (this.fondsOptions.length > 0 && this.yearsOptions.length > 0) { |
|
|
|
this.getTotalStatistics() |
|
|
|
} |
|
|
|
handleSizeChange(size) { |
|
|
|
this.page.size = size |
|
|
|
this.page.page = 0 |
|
|
|
this.getBorrowdRegisterStatisticsList() |
|
|
|
}, |
|
|
|
getTotalStatistics() { |
|
|
|
FetchTotalStatistics({ |
|
|
|
fondsIds: this.fondsIds, |
|
|
|
years: this.years |
|
|
|
}).then(res => { |
|
|
|
this.allData = res |
|
|
|
handleCurrentPage(page) { |
|
|
|
this.page.page = page - 1 |
|
|
|
this.page.size = 10 |
|
|
|
this.getBorrowdRegisterStatisticsList() |
|
|
|
}, |
|
|
|
doExport() { |
|
|
|
this.$confirm('此操作将导出当前统计数据' + '<span>你是否还要继续?</span>', '提示', { |
|
|
|
confirmButtonText: '继续', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning', |
|
|
|
dangerouslyUseHTMLString: true |
|
|
|
}).then(() => { |
|
|
|
exportFile(this.baseApi + '/api/control/exportBusinessFlow?' + qs.stringify({}, { indices: false })) |
|
|
|
}).catch(() => { |
|
|
|
console.log('取消') |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -152,5 +219,17 @@ export default { |
|
|
|
::v-deep .el-table__footer{ |
|
|
|
font-size: 14px; |
|
|
|
} |
|
|
|
// ::v-deep .el-table__body, |
|
|
|
// ::v-deep .el-table__body-wrapper{ |
|
|
|
// border-bottom: 1px solid #e4e7ed; |
|
|
|
// } |
|
|
|
// ::v-deep .el-table__empty-block{ |
|
|
|
// border-bottom: 1px solid #e4e7ed; |
|
|
|
// } |
|
|
|
} |
|
|
|
|
|
|
|
::v-deep .input-prepend .el-input__inner{ |
|
|
|
padding-left: 100px; |
|
|
|
} |
|
|
|
|
|
|
|
</style> |