|
|
|
@ -69,7 +69,7 @@ |
|
|
|
|
<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="fold"> |
|
|
|
|
<div class="fold" v-if="listData.length > 10"> |
|
|
|
|
<span :class="{active}" @click="toggleList"> |
|
|
|
|
展开更多 |
|
|
|
|
<i class="el-icon-arrow-down"></i> |
|
|
|
@ -190,26 +190,29 @@ export default { |
|
|
|
|
'setInfo' |
|
|
|
|
]), |
|
|
|
|
getData(){ |
|
|
|
|
// 查询产品列表 |
|
|
|
|
this.$get(`${this.api.getProductInfoBySchoolId}?schoolId=${this.schoolId}`).then(res => { |
|
|
|
|
let list = res.message |
|
|
|
|
list.map(n => { |
|
|
|
|
// 时间格式化 |
|
|
|
|
n.startTime = util.formatDate('yyyy-MM-dd',new Date(n.startTime)) |
|
|
|
|
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 => {}) |
|
|
|
|
|
|
|
|
|
// 查询平均日访客量和累计下载 |
|
|
|
|
this.$get(`${this.api.queryAccumulate}?schoolId=${this.schoolId}`).then(res => { |
|
|
|
|
this.dayCount = res.dayCount |
|
|
|
|
this.schoolCount = res.schoolCount |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
|
|
// 查询按月份统计数据库使用概况 |
|
|
|
|
this.$get(`${this.api.queryDatabaseInfoByMonth}?schoolId=${this.schoolId}`).then(res => { |
|
|
|
|
let list = res.message |
|
|
|
|
let result = [] |
|
|
|
|
// 每年的每个月份赋值 |
|
|
|
|
for(let i in list){ |
|
|
|
|
for(let n in list[i]){ |
|
|
|
|
let item = { |
|
|
|
@ -224,25 +227,26 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.monthData = result |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
|
|
// 查询本校累计用户数量 |
|
|
|
|
this.$get(`${this.api.getUserTotalBySchoolId}?schoolId=${this.schoolId}`).then(res => { |
|
|
|
|
this.userCount = res.totalCount |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
|
|
// 查询当前在线人数 |
|
|
|
|
this.$get(this.api.onlineNumber).then(res => { |
|
|
|
|
this.onlineCunt = res.message |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
this.getDatabase() |
|
|
|
|
}, |
|
|
|
|
// 查询按数据库统计使用概况 |
|
|
|
|
getDatabase(){ |
|
|
|
|
this.$get(`${this.api.queryDatabaseInfo}?schoolId=${this.schoolId}&startTime=${this.startTime}&endTime=${this.endTime}`).then(res => { |
|
|
|
|
let list = JSON.parse(res.databaseInfo) |
|
|
|
|
// 只展示前十条 |
|
|
|
|
// 只展示前十条,页面上点展开更多去展示全部 |
|
|
|
|
this.listData = list.slice(0,10) |
|
|
|
|
this.listDataAll = list |
|
|
|
|
this.listDataAll = list // 把全部数据先存起来,点展开的时候直接取这个列表 |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
// 因为后端的数据存在redis了,所以无法做模糊查询,只能在前端实现 |
|
|
|
|
// 模糊查询,因为后端的数据存在redis了,所以无法做模糊查询,只能在前端实现 |
|
|
|
|
searchData(){ |
|
|
|
|
let list = this.listDataAll |
|
|
|
|
let result = [] |
|
|
|
@ -273,7 +277,9 @@ export default { |
|
|
|
|
handleSelectionChange1(val) { |
|
|
|
|
this.multipleSelection1 = val |
|
|
|
|
}, |
|
|
|
|
// 展开收缩 |
|
|
|
|
toggleList(){ |
|
|
|
|
// 如果是输入了关键词,则不是取默认的listDataAll列表,而是取模糊查询后的全部数据列表 listDataKeyword |
|
|
|
|
if(this.keyword){ |
|
|
|
|
if(this.active){ |
|
|
|
|
this.listData = this.listDataKeyword.slice(0,10) |
|
|
|
|