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

2
src/utils/comm.js

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

104
src/views/HomeView.vue

@ -157,7 +157,9 @@ export default {
week_num: 0, week_num: 0,
mon_num: 0, mon_num: 0,
year_num: 0, year_num: 0,
//
klqsDatas: [], klqsDatas: [],
//
ssjgNumDatas: [] ssjgNumDatas: []
} }
}, },
@ -167,21 +169,15 @@ export default {
// }); // });
// }, // },
mounted() { mounted() {
//
this.getDataIn()
// this.showorders()
// //
this.cgrs_line() this.getDataIn()
// this.cgchart() //
this.getGcgNumDatas()
//
this.getStat(); this.getStat();
this.getHomeBarData(); // this.getHomeBarData();
this.getInfoDatas(); this.getInfoDatas();
this.getGcgNumDatas()
//
// this.btgetdata(this.klselt)
}, },
// //
methods: { methods: {
@ -342,6 +338,7 @@ export default {
type: 'solid', type: 'solid',
}, },
}, },
//
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: '#0095FF', color: '#0095FF',
@ -351,10 +348,6 @@ export default {
show: false, show: false,
}, },
name: '', name: '',
// y
max:function(dataMax) {
console.log(dataMax)
}
}, },
series: [ series: [
{ {
@ -493,7 +486,7 @@ export default {
option && myChart.setOption(option); option && myChart.setOption(option);
}, },
// // 线
cgrs_line() { cgrs_line() {
var chartDom = document.getElementById('tdrs'); 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() { getInfoDatas() {
let that = this let that = this
console.log(that); console.log(that);
homeApi.allInfoDatas().then(res => { homeApi.allInfoDatas().then(res => {
// get allTimeData // get allTimeData
this.ssjgNumDatas = res.data.returnData 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() { getGcgNumDatas() {
let that = this let that = this
console.log(that);
homeApi.allGcgNumDatas().then(res => { homeApi.allGcgNumDatas().then(res => {
// get allTimeData // get allTimeData
const tmpdata = res.data.returnData const tmpdata = res.data.returnData
console.log(tmpdata); // 线
// this.day_num = tmpdata.day.noRepeatInNum this.cgrs_line();
// 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);
// });
}); });
} }

Loading…
Cancel
Save