1、新增文档和工具统计

2、样式调整
3、文件下载分页(还有一部分没有调整)
This commit is contained in:
pan
2024-09-05 22:35:43 +08:00
parent 72d894b846
commit dd9940e78e
10 changed files with 211 additions and 32 deletions

View File

@@ -7,7 +7,7 @@
<!-- -->
<div class="tjbox2" v-if="isPieChart">
<PieChart
height="400px"
height="285px"
:data="toolTypeData"
:legendData="toolTypeLegendData"
legendBottom="5"
@@ -22,7 +22,7 @@
<div slot="header" class="clearfix"><span class="tline">文档来源统计</span></div>
<div class="tjbox2" v-if="isPieChart">
<PieChart
height="400px"
height="285px"
:data="toolSourceData"
:legendData="toolSourceLegendData"
legendBottom="5"
@@ -34,11 +34,109 @@
</el-col><!--el-col-->
</el-row><!--el-row-->
<el-row :gutter="20">
<el-col :span="24">
<el-card>
<div slot="header" class="clearfix"><span class="tline">文档下载统计</span></div>
<div class="tjbox2">
<el-form label-width="70px" ref="queryForm" :model="queryParams">
<div class="search">
<div class="sl">
<el-form-item label="下载时间">
<el-date-picker
v-model="dateRange"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="文档编号" prop="docCode">
<el-input
v-model="queryParams.docCode"
placeholder="请输入文档编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="文档名称" prop="docName">
<el-input
v-model="queryParams.docName"
placeholder="请输入文档名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</div>
<div class="sr">
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh-left" @click="reset">重置</el-button>
</div>
</div>
</el-form>
<!-- <img src="images/tjt6.jpg" /> -->
</div>
<div class="rt">
<el-table v-loading="downLoading" :data="toolDownStatList">
<el-table-column type="index" label="序号" width="50" />
<el-table-column label="文档编号" align="center" key="docCode" prop="docCode" />
<el-table-column label="文档名称" align="center" key="docName" prop="docName" :show-overflow-tooltip="true" />
<el-table-column label="下载次数" align="center" key="docDownNum" prop="docDownNum" width="120" />
<el-table-column
label="操作"
align="center"
width="250"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button type="text" icon="el-icon-info" @click="handleDetail(scope.row)">详情</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="downTotal>0"
:total="downTotal"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getDocDownStatistics"
/>
</div><!--rt -->
</el-card><!--el-card-->
</el-col><!--el-col-->
</el-row><!--el-row-->
<!-- <DownStatDetail :show.sync="detailDrawerOpen" :toolId="toolId" :toolName="toolName" /> -->
<el-dialog
:title="`${toolName}下载详情统计`"
:visible.sync="detailDrawerOpen"
width="85%"
append-to-body
@open="openEvent"
@close="detailDrawerOpen = false"
>
<el-table :data="toolDownDetailStatList" v-loading="loading">
<el-table-column label="下载用户" align="center" key="nickName" prop="nickName" min-width="120" />
<el-table-column label="附件名称" align="center" key="attName" prop="attName" :show-overflow-tooltip="true" />
<el-table-column label="下载次数" align="center" key="toolDownNum" prop="toolDownNum" min-width="120" />
<el-table-column label="下载时间" align="center" key="createTime" prop="createTime" min-width="120" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams1.pageNum"
:limit.sync="queryParams1.pageSize"
@pagination="getDocDownDetailStatistics"
/>
</el-dialog>
</div>
</template>
<script>
import { getStatistics } from "@/api/document/document";
import { listDocCount,userDownList } from "@/api/tool/downloadCount";
import PieChart from './PieChart'
export default {
@@ -82,11 +180,13 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
docCode: null,
docName: null,
},
queryParams1: {
pageNum: 1,
pageSize: 10,
toolId: ''
businessId: ''
},
// 工具下载统计详情组件控制属性
detailDrawerOpen: false,
@@ -101,9 +201,21 @@ export default {
},
created () {
this.getCountData()
// this.getToolDownStatistics()
this.getDocDownStatistics()
},
methods: {
openEvent() {
this.getDocDownDetailStatistics()
},
getDocDownDetailStatistics() {
let self = this
this.loading = true
userDownList(this.addDateRange(this.queryParams1)).then(res => {
self.total = res?.total
self.toolDownDetailStatList = res?.rows || []
self.loading = false
}).catch(() => { self.loading = false });
},
// 工具下载重置查询
reset() {
this.toolDownStatList = []
@@ -116,6 +228,7 @@ export default {
*/
handleQuery() {
this.queryParams.pageNum = 1
this.getDocDownStatistics()
},
/** 统计类型、类别、状态**/
getCountData(){
@@ -160,7 +273,24 @@ export default {
self.pageloading= false
console.error(err)
});
}
},
handleDetail(row){
this.$set(this.queryParams1, "businessId", row.businessId)
this.detailDrawerOpen = true
},
/**
* 获取工具下载列表数据
*/
getDocDownStatistics() {
let self = this
this.downLoading = true
listDocCount(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
console.info("res.total=============", res.total)
self.downTotal = res.total
self.toolDownStatList = res?.rows || []
self.downLoading = false
}).catch(() => { self.downLoading = false });
},
}
}
</script>