|
|
@ -87,8 +87,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
<el-table :data="monthData" class="table" stripe header-align="center" row-key="id" :span-method="objectSpanMethod" @selection-change="handleSelectionChange1"> |
|
|
|
<el-table :data="monthData" class="table" stripe header-align="center" row-key="id" :span-method="objectSpanMethod" @selection-change="handleSelectionChange1"> |
|
|
|
<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 prop="year" label="年份" align="center"></el-table-column> |
|
|
|
<el-table-column prop="year" width="80" label="年份" align="center"></el-table-column> |
|
|
|
<el-table-column prop="type" label="类别" align="center"></el-table-column> |
|
|
|
<el-table-column prop="type" width="80" label="类别" align="center"></el-table-column> |
|
|
|
<el-table-column prop="1" label="1月" align="center"></el-table-column> |
|
|
|
<el-table-column prop="1" label="1月" align="center"></el-table-column> |
|
|
|
<el-table-column prop="2" label="2月" align="center"></el-table-column> |
|
|
|
<el-table-column prop="2" label="2月" align="center"></el-table-column> |
|
|
|
<el-table-column prop="3" label="3月" align="center"></el-table-column> |
|
|
|
<el-table-column prop="3" label="3月" align="center"></el-table-column> |
|
|
@ -102,6 +102,7 @@ |
|
|
|
<el-table-column prop="11" label="11月" align="center"></el-table-column> |
|
|
|
<el-table-column prop="11" label="11月" align="center"></el-table-column> |
|
|
|
<el-table-column prop="12" label="12月" align="center"></el-table-column> |
|
|
|
<el-table-column prop="12" label="12月" align="center"></el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<div class="chart" :id="'chart' + i" v-for="i in yearLen" :key="i"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -109,6 +110,7 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
|
|
|
|
import * as echarts from 'echarts' |
|
|
|
import { mapState, mapActions } from 'vuex' |
|
|
|
import { mapState, mapActions } from 'vuex' |
|
|
|
import Setting from '@/setting' |
|
|
|
import Setting from '@/setting' |
|
|
|
import axios from 'axios' |
|
|
|
import axios from 'axios' |
|
|
@ -133,21 +135,8 @@ export default { |
|
|
|
listDataAll: [], |
|
|
|
listDataAll: [], |
|
|
|
initShowLen: 5, // 按数据库统计使用概况默认展示的数据条数 |
|
|
|
initShowLen: 5, // 按数据库统计使用概况默认展示的数据条数 |
|
|
|
multipleSelection: [], |
|
|
|
multipleSelection: [], |
|
|
|
monthData: [ |
|
|
|
yearLen: 0, |
|
|
|
{ |
|
|
|
monthData: [], |
|
|
|
year: 2020, |
|
|
|
|
|
|
|
type: '登录量', |
|
|
|
|
|
|
|
month1: 1 |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
year: 2020, |
|
|
|
|
|
|
|
type: '下载量', |
|
|
|
|
|
|
|
month1: 1 |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
year: 2020, |
|
|
|
|
|
|
|
type: '点击量', |
|
|
|
|
|
|
|
month1: 1 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
multipleSelection1: [], |
|
|
|
multipleSelection1: [], |
|
|
|
active: false |
|
|
|
active: false |
|
|
|
} |
|
|
|
} |
|
|
@ -213,20 +202,23 @@ export default { |
|
|
|
this.$get(`${this.api.queryDatabaseInfoByMonth}?schoolId=${this.schoolId}`).then(res => { |
|
|
|
this.$get(`${this.api.queryDatabaseInfoByMonth}?schoolId=${this.schoolId}`).then(res => { |
|
|
|
let list = res.message |
|
|
|
let list = res.message |
|
|
|
let result = [] |
|
|
|
let result = [] |
|
|
|
|
|
|
|
let len = 0 |
|
|
|
// 每年的每个月份赋值 |
|
|
|
// 每年的每个月份赋值 |
|
|
|
for(let i in list){ |
|
|
|
for(let i in list){ |
|
|
|
|
|
|
|
len++ |
|
|
|
for(let n in list[i]){ |
|
|
|
for(let n in list[i]){ |
|
|
|
let item = { |
|
|
|
let item = { |
|
|
|
year: i, |
|
|
|
year: i, |
|
|
|
type: n, |
|
|
|
type: n, |
|
|
|
} |
|
|
|
} |
|
|
|
list[i][n].map((val,index) => { |
|
|
|
|
|
|
|
item[index + 1] = val |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
result.push(item) |
|
|
|
result.push(item) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.yearLen = len |
|
|
|
this.monthData = result |
|
|
|
this.monthData = result |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
this.initChart(list) |
|
|
|
|
|
|
|
}) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
// 查询本校累计用户数量 |
|
|
|
// 查询本校累计用户数量 |
|
|
|
this.$get(`${this.api.getUserTotalBySchoolId}?schoolId=${this.schoolId}`).then(res => { |
|
|
|
this.$get(`${this.api.getUserTotalBySchoolId}?schoolId=${this.schoolId}`).then(res => { |
|
|
@ -238,6 +230,50 @@ export default { |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
this.getDatabase() |
|
|
|
this.getDatabase() |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 按月份统计数据库使用概况图表 |
|
|
|
|
|
|
|
initChart(list){ |
|
|
|
|
|
|
|
const seriesList = [] |
|
|
|
|
|
|
|
const data = ['下载量', '点击量', '登录量'] |
|
|
|
|
|
|
|
for (let i in list) { |
|
|
|
|
|
|
|
const series = [] |
|
|
|
|
|
|
|
for (let n in list[i]) { |
|
|
|
|
|
|
|
const temp = { |
|
|
|
|
|
|
|
name: n, |
|
|
|
|
|
|
|
type: 'line', |
|
|
|
|
|
|
|
stack: 'Total', |
|
|
|
|
|
|
|
data: list[i][n] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
series.push(temp) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
seriesList.push(series) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
seriesList.map((e, i) => { |
|
|
|
|
|
|
|
echarts.init(document.querySelector(`#chart${i + 1}`)).setOption({ |
|
|
|
|
|
|
|
title: { |
|
|
|
|
|
|
|
text: '' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
tooltip: { |
|
|
|
|
|
|
|
trigger: 'axis' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// legend: { |
|
|
|
|
|
|
|
// data |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
grid: { |
|
|
|
|
|
|
|
left: '3%', |
|
|
|
|
|
|
|
right: '4%', |
|
|
|
|
|
|
|
bottom: '3%', |
|
|
|
|
|
|
|
containLabel: true |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
xAxis: { |
|
|
|
|
|
|
|
show: false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
yAxis: { |
|
|
|
|
|
|
|
show: false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
series: e |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
// 查询按数据库统计使用概况 |
|
|
|
// 查询按数据库统计使用概况 |
|
|
|
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}`).then(res => { |
|
|
@ -432,6 +468,11 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.chart{ |
|
|
|
|
|
|
|
width: calc(100% - 240px); |
|
|
|
|
|
|
|
height: 132px; |
|
|
|
|
|
|
|
margin: -132px 0 0 240px; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.fold{ |
|
|
|
.fold{ |
|
|
|
margin-top: 15px; |
|
|
|
margin-top: 15px; |
|
|
|