数据统计相关修复

dev_2022-04-07
yujialong 3 years ago
parent b69759e77c
commit 6c12a8e85e
  1. 4
      src/pages/index/list/index.vue
  2. 52
      src/pages/stat/list/index.vue

@ -11,7 +11,7 @@
<div class="hot" v-if="hotData.length"> <div class="hot" v-if="hotData.length">
<span class="name">热门下载</span> <span class="name">热门下载</span>
<ul class="list"> <ul class="list">
<li v-for="(item,index) in hotData" :key="index" @click="toData(item)">{{item.categoryTwo}}</li> <li v-for="(item,index) in hotData" :key="index" @click="toData(item)">{{item.secondName}}</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -317,7 +317,7 @@ export default {
// //
getHot(){ getHot(){
this.$get(this.api.queryDatabaseInfo).then(res => { this.$get(this.api.queryDatabaseInfo).then(res => {
let list = JSON.parse(res.databaseInfo) let list = res.data
list.map(n => n.download) list.map(n => n.download)
// //
list.sort((a,b) => { list.sort((a,b) => {

@ -3,7 +3,8 @@
<div class="left"> <div class="left">
<div class="products"> <div class="products">
<img class="icon" width="50" src="@/assets/img/school.png" alt=""> <img class="icon" width="50" src="@/assets/img/school.png" alt="">
<p class="school-name">{{schoolName}}</p> <p class="school-name">{{userName}}</p>
<template v-if="productList.length">
<div class="product" v-for="(item,index) in productList" :key="index"> <div class="product" v-for="(item,index) in productList" :key="index">
<p class="product-name"><img src="@/assets/img/product.png" alt=""> {{item.productName}}</p> <p class="product-name"><img src="@/assets/img/product.png" alt=""> {{item.productName}}</p>
<div class="date"> <div class="date">
@ -24,6 +25,8 @@
</p> </p>
<el-button class="renew" size="small" type="primary" v-if="!item.deadline">续费</el-button> <el-button class="renew" size="small" type="primary" v-if="!item.deadline">续费</el-button>
</div> </div>
</template>
<p v-else class="tips">暂无数据权限请下单购买</p>
</div> </div>
</div> </div>
<div class="right"> <div class="right">
@ -69,18 +72,19 @@
<el-button type="primary" size="small" @click="exportDatabase" v-auth="'/stat/list:数据库统计导出'">导出数据</el-button> <el-button type="primary" size="small" @click="exportDatabase" v-auth="'/stat/list:数据库统计导出'">导出数据</el-button>
</div> </div>
</div> </div>
<div class="type-wrap">
<el-table :data="listData" class="table" stripe header-align="center" row-key="id" @selection-change="handleSelectionChange"> <el-table :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="80" align="center"></el-table-column> <el-table-column type="selection" width="80" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="categoryOne" label="数据分类" align="center"></el-table-column> <el-table-column prop="categoryName" label="数据分类" align="center"></el-table-column>
<el-table-column prop="categoryTwo" label="数据库类别" align="center"></el-table-column> <el-table-column prop="secondName" label="数据库类别" align="center"></el-table-column>
<el-table-column prop="download" label="下载量" align="center"></el-table-column> <el-table-column prop="downloads" label="下载量" align="center"></el-table-column>
<el-table-column prop="click" label="点击量" align="center"></el-table-column> <el-table-column prop="clicks" label="点击量" align="center"></el-table-column>
</el-table> </el-table>
</div>
<div class="fold" v-if="listDataAll.length > initShowLen"> <div class="fold" v-if="listDataAll.length > initShowLen">
<span :class="{active}" @click="toggleList"> <span :class="{active}" @click="toggleList">
展开更多 {{active ? '收起' : '展开更多'}}
<i class="el-icon-arrow-down"></i> <i class="el-icon-arrow-down"></i>
</span> </span>
</div> </div>
@ -165,14 +169,14 @@ export default {
}, },
computed: { computed: {
...mapState('user', [ ...mapState('user', [
'schoolId' 'schoolId', 'userName'
]), ]),
}, },
watch: { watch: {
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.searchData() this.getDatabase()
},500) },500)
}, },
date: function(val){ date: function(val){
@ -211,9 +215,6 @@ export default {
n.endTime = util.formatDate('yyyy-MM-dd',new Date(n.endTime)) n.endTime = util.formatDate('yyyy-MM-dd',new Date(n.endTime))
}) })
this.productList = list this.productList = list
if(list.length){
this.schoolName = list[0].schoolName
}
}).catch(res => {}) }).catch(res => {})
// 访 // 访
this.$get(`${this.api.queryAccumulate}?schoolId=${this.schoolId}`).then(res => { this.$get(`${this.api.queryAccumulate}?schoolId=${this.schoolId}`).then(res => {
@ -356,23 +357,14 @@ export default {
}, },
// 使 // 使
getDatabase(){ getDatabase(){
this.$get(`${this.api.queryDatabaseInfo}?schoolId=${this.schoolId}&startTime=${this.startTime}&endTime=${this.endTime}`).then(res => { this.$get(`${this.api.queryDatabaseInfo}?schoolId=${this.schoolId}&startTime=${this.startTime}&endTime=${this.endTime}&keyWord=${this.keyword}&pageNum=1&pageSize=5`).then(res => {
let list = JSON.parse(res.databaseInfo) // let list = JSON.parse(res.databaseInfo)
// let list = res.data
// 5
this.listData = list.slice(0,this.initShowLen) this.listData = list.slice(0,this.initShowLen)
this.listDataAll = list // this.listDataAll = list //
}).catch(res => {}) }).catch(res => {})
}, },
// redis,,
searchData(){
let list = this.listDataAll
let result = []
list.map(n => {
(n.categoryOne.includes(this.keyword) || n.categoryTwo.includes(this.keyword)) && result.push(n)
})
this.listData = this.active ? result : result.slice(0,this.initShowLen)
this.listDataKeyword = result
},
// //
objectSpanMethod({ row, column, rowIndex, columnIndex }) { objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (!columnIndex || columnIndex == 1) { if (!columnIndex || columnIndex == 1) {
@ -484,6 +476,10 @@ export default {
font-weight: 600; font-weight: 600;
color: #333; color: #333;
} }
.tips {
font-size: 12px;
color: #666;
}
.product{ .product{
padding: 12px; padding: 12px;
margin-bottom: 6px; margin-bottom: 6px;
@ -533,6 +529,10 @@ export default {
.right{ .right{
max-width: calc(100% - 250px); max-width: calc(100% - 250px);
} }
.type-wrap {
max-height: 945px;
overflow: auto;
}
.page{ .page{
position: relative; position: relative;
margin-bottom: 20px; margin-bottom: 20px;

Loading…
Cancel
Save