Browse Source

接口调整

master
453530270@qq.com 3 years ago
parent
commit
4a84ae66c8
  1. 9
      src/api/home.js
  2. 99
      src/views/WhView.vue

9
src/api/home.js

@ -74,4 +74,13 @@ export function wh24ServiceTrends(param){
method: 'post',
param,
})
}
// 图书解决数据查询
export function libLeaseData(param){
return request({
url:'/library.pass/getLibraryLeaseData',
method: 'post',
param,
})
}

99
src/views/WhView.vue

@ -13,17 +13,17 @@
<div class="jgitem">
<div class="jgimg"><img src="../assets/img/icon01.png" /></div>
<span class="jgival">{{ tdjg }}</span>
<span class="jgival" id="wtdjg">{{ tdjg }}</span>
<span class="jgdesc">今日进馆人数</span>
</div>
<div class="jgitem">
<div class="jgimg"><img src="../assets/img/icon02.png" /></div>
<span class="jgival"> {{ tmjg }} </span>
<span class="jgival" id="wtmjg"> {{ tmjg }} </span>
<span class="jgdesc">本月进馆人数</span>
</div>
<div class="jgitem">
<div class="jgimg"><img src="../assets/img/icon03.png" /></div>
<span class="jgival"> {{ tyjg }} </span>
<span class="jgival" id="wtyjg"> {{ tyjg }} </span>
<span class="jgdesc">本年进馆人数</span>
</div>
</div>
@ -322,6 +322,7 @@ import * as echarts from 'echarts';
// api
import * as homeApi from '@/api/home'
import { ecMaxVal,numGrow } from '@/utils/comm';
export default {
name: 'TycView',
@ -335,6 +336,11 @@ export default {
gkbwg:0,
gktsg:0,
gkwhg:0,
// 24
wh24xdata:[],
wh24ydata:[],
//
libleaData:[],
}
},
@ -342,33 +348,47 @@ export default {
//
this.sgrsStat()
// 24h ins k line
this.cgsf_line()
// 24
this.getWh24hdata()
//
this.gc_line()
//
this.tsg_line()
this.libinfoData()
//this.tsg_line()
this.getTsgInfoDatas()
},
methods: {
//
sgrsStat(){
// let guid="510|"
//
homeApi.allGroupNum({type:2}).then(res=>{
const tdata = res.data.returnData;
this.tdjg = tdata.day.noRepeatInNum
this.tmjg = tdata.month.noRepeatInNum
this.tyjg = tdata.year.noRepeatInNum
});
homeApi.tsgTrends().then(res=>{
const tdata = res.data.data;
this.tdjg = tdata.today.incount
this.tmjg = tdata.month.incount
this.tyjg = tdata.year.incount
//24
// //24
const sgdata = tdata.hour24
this.gktsg = sgdata[0].incount
this.gkbwg = sgdata[1].incount
this.gkwhg = sgdata[2].incount
});
},
// 24
getWh24hdata(){
homeApi.wh24ServiceTrends().then(res=>{
const whtdata = res.data.data
this.wh24xdata=whtdata.dkeys
this.wh24ydata=whtdata.dvalue
// console.log("dvv",whtdata.dvalue)
//this.wh24hdata = res.data.data
// do line
this.cgsf_line()
})
},
// ---24
cgsf_line() {
var chartDom = document.getElementById('gcins_charts');
@ -376,15 +396,6 @@ export default {
var option;
option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: function (params) {
return params[0].name + "</br>" + params[0].value
}
},
grid: {
left: '-8%',
right: '4%',
@ -393,9 +404,7 @@ export default {
containLabel: true
},
xAxis: [{
data: [
'08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00',
],
data:this.wh24xdata,
axisLine: {
lineStyle: {
color: '#0095FF',
@ -439,7 +448,6 @@ export default {
},
}],
series: [{
// name: '',
type: 'bar',
barGap: '5%',
barWidth: '10%',
@ -461,41 +469,32 @@ export default {
)
}
},
data: [
14000,
11000,
10000,
9000,
8000,
7000,
5000,
4000,
3000,
],
data: this.wh24ydata,
zlevel: 11
},
{
// name: '',
type: 'scatter',
stack: 1,
xAxisIndex: 0,
symbolOffset: [0, 0], //
data: [0, 0, 0, 0, 0, 0, 0, 0, 0],
data: this.wh24ydata,
// data: [0, 0, 0, 0, 0, 0, 0, 0, 0],
itemStyle: {
normal: {
color: '#fff'
color: '#f0f0f0'
}
},
symbolSize: 13,
zlevel: 10,
z: 2,
},
//
{
name: '背景',
type: 'bar',
barWidth: '10%',
barGap: '-100%',
data: [15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000],
data: ecMaxVal(this.wh24ydata),
// data: [15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000],
itemStyle: {
normal: {
color: '#004298',
@ -677,6 +676,14 @@ export default {
option && myChart.setOption(option);
},
//
libinfoData(){
homeApi.libLeaseData().then(res=>{
this.libleaData = res.data.data
//
this.tsg_line()
});
},
//
tsg_line() {
var chartDom = document.getElementById("tsgchart");
@ -685,15 +692,15 @@ export default {
var data = [{
name: '今日办证人数',
value: 323,
value: this.libleaData.newreader,
},
{
name: '今日还书册数',
value: 209,
value: this.libleaData.returncount,
},
{
name: '今日借书册数',
value: 323,
value: this.libleaData.servcount,
},
];
//
@ -729,7 +736,6 @@ export default {
return arr;
}
console.log(getSymbolData(data));
option = {
grid: {
show: false,
@ -746,11 +752,8 @@ export default {
{
triggerEvent: true,
show: true,
// inverse: true,
// data: getArrByKey(data, 'name'),
data: [
'Lend', 'Still', 'Accreditation'
// '../assets/img/wh_right1.png','../assets/img/wh_right1.png','../assets/img/wh_right1.png'
],
// max:80,
axisLine: {

Loading…
Cancel
Save