|
|
|
@ -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; |
|
|
|
|