数据统计相关修复

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

@ -11,7 +11,7 @@
<div class="hot" v-if="hotData.length">
<span class="name">热门下载</span>
<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>
</div>
</div>
@ -317,7 +317,7 @@ export default {
//
getHot(){
this.$get(this.api.queryDatabaseInfo).then(res => {
let list = JSON.parse(res.databaseInfo)
let list = res.data
list.map(n => n.download)
//
list.sort((a,b) => {

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

Loading…
Cancel
Save