From 4a84ae66c8dbe106f425684e3d004a172561d161 Mon Sep 17 00:00:00 2001 From: "453530270@qq.com" Date: Fri, 11 Aug 2023 18:21:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home.js | 9 ++++ src/views/WhView.vue | 99 +++++++++++++++++++++++--------------------- 2 files changed, 60 insertions(+), 48 deletions(-) diff --git a/src/api/home.js b/src/api/home.js index c6267b9..48ff4e2 100644 --- a/src/api/home.js +++ b/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, + }) } \ No newline at end of file diff --git a/src/views/WhView.vue b/src/views/WhView.vue index c96550d..dd6487b 100644 --- a/src/views/WhView.vue +++ b/src/views/WhView.vue @@ -13,17 +13,17 @@
- {{ tdjg }} + {{ tdjg }} 今日进馆人数
- {{ tmjg }} + {{ tmjg }} 本月进馆人数
- {{ tyjg }} + {{ tyjg }} 本年进馆人数
@@ -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 + "
" + 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: {