Browse Source

精简不使用的代码

master
453530270@qq.com 3 years ago
parent
commit
40f89a9f22
  1. 2
      public/config.js
  2. 8
      src/api/home.js
  3. 2
      src/utils/comm.js
  4. 104
      src/views/HomeView.vue

2
public/config.js

@ -1,4 +1,4 @@
window.publicConfig = {
// 请求地址
BASE_API:'http://192.168.66.16/api/',
BASE_API:'http://10.97.121.2/api/',
}

8
src/api/home.js

@ -32,7 +32,7 @@ export function allGroupNum(param) {
param,
})
}
// 实时进馆人数
export function allInfoDatas(param) {
return request({
url: '/pass.passcc/realTimeData',
@ -40,7 +40,7 @@ export function allInfoDatas(param) {
param,
})
}
// 今日各场馆的趋势
export function allGcgNumDatas(param) {
return request({
url: '/pass.passcc/toDayGroupsEnterNum',
@ -48,8 +48,8 @@ export function allGcgNumDatas(param) {
param,
})
}
export function allTsgInfoDatas(param) {
// 图书馆人流趋势
export function tsgTrends(param) {
return request({
url: '/library.pass/allFlowTrends',
method: 'post',

2
src/utils/comm.js

@ -24,7 +24,7 @@ export function ecMaxVal(arr){
const narr = [];
const maxval = Math.max(...arr);
for(let i=0;i<arr.length;i++){
narr[i]=maxval+250
narr[i]=maxval+267
}
return narr;
}

104
src/views/HomeView.vue

@ -157,7 +157,9 @@ export default {
week_num: 0,
mon_num: 0,
year_num: 0,
//
klqsDatas: [],
//
ssjgNumDatas: []
}
},
@ -167,21 +169,15 @@ export default {
// });
// },
mounted() {
//
this.getDataIn()
// this.showorders()
//
this.cgrs_line()
// this.cgchart()
this.getDataIn()
//
this.getGcgNumDatas()
//
this.getStat();
this.getHomeBarData();
// this.getHomeBarData();
this.getInfoDatas();
this.getGcgNumDatas()
//
// this.btgetdata(this.klselt)
},
//
methods: {
@ -342,6 +338,7 @@ export default {
type: 'solid',
},
},
//
axisLine: {
lineStyle: {
color: '#0095FF',
@ -351,10 +348,6 @@ export default {
show: false,
},
name: '',
// y
max:function(dataMax) {
console.log(dataMax)
}
},
series: [
{
@ -493,7 +486,7 @@ export default {
option && myChart.setOption(option);
},
//
// 线
cgrs_line() {
var chartDom = document.getElementById('tdrs');
@ -667,95 +660,22 @@ export default {
});
},
getHomeBarData() {
let that = this
console.log(that);
homeApi.homeBarData().then(res => {
// get allTimeData
const tmpdata = res.data.data.allTimeData
let datas = []
Object.values(tmpdata).forEach((value) => {
console.log(value.num);
datas.push(value.num)
});
console.log(datas);
this.klqsDatas = datas
console.log(tmpdata);
// this.day_num = tmpdata.day.noRepeatInNum
// this.week_num_num = tmpdata.week.noRepeatInNum
// this.mon_num = tmpdata.month.noRepeatInNum
// this.year_num = tmpdata.year.noRepeatInNum
// let btdata = new Array();
// let bvdata = new Array();
// tmpdata.foreach(function(item,index){
// console.log(item);
// console.log(index);
// });
});
},
getInfoDatas() {
let that = this
console.log(that);
homeApi.allInfoDatas().then(res => {
// get allTimeData
this.ssjgNumDatas = res.data.returnData
// let ssjgNumDatas = this.ssjgNumDatas
// ssjgNumDatas.forEach(item => {
// console.log(parseInt(item.proportion));
// let proportion = parseInt(item.proportion)
// if (proportion >= 80 && proportion <= 90) {
// console.log('11111111');
// this.$refs.proportionbox.addClass('rbrate2')
// }
// if (proportion > 90) {
// console.log('222222');
// // console.log(this.$refs.proportionbox)
// this.$refs.proportionbox.addClass('rbrate3')
// }
// })
// console.log(tmpdata);
// console.log(tmpdata.01.proportion);
// let arr = JSON.stringify(tmpdata)
// console.log(arr);
// this.day_num = tmpdata.day.noRepeatInNum
// this.week_num_num = tmpdata.week.noRepeatInNum
// this.mon_num = tmpdata.month.noRepeatInNum
// this.year_num = tmpdata.year.noRepeatInNum
// let btdata = new Array();
// let bvdata = new Array();
// tmpdata.foreach(function(item,index){
// console.log(item);
// console.log(index);
// });
});
},
getGcgNumDatas() {
let that = this
console.log(that);
homeApi.allGcgNumDatas().then(res => {
// get allTimeData
const tmpdata = res.data.returnData
console.log(tmpdata);
// this.day_num = tmpdata.day.noRepeatInNum
// this.week_num_num = tmpdata.week.noRepeatInNum
// this.mon_num = tmpdata.month.noRepeatInNum
// this.year_num = tmpdata.year.noRepeatInNum
// let btdata = new Array();
// let bvdata = new Array();
// tmpdata.foreach(function(item,index){
// console.log(item);
// console.log(index);
// });
// 线
this.cgrs_line();
});
}

Loading…
Cancel
Save