Browse Source

修正引用错误

lite
453530270@qq.com 3 years ago
parent
commit
cea6f0e3d7
  1. 6
      src/App.vue
  2. 9
      src/api/home.js
  3. 2
      src/views/cultrue/index.vue
  4. 281
      src/views/index.vue

6
src/App.vue

@ -87,12 +87,6 @@ export default {
this.sumYear_num = tmpdata.sumYear.noRepeatInNum this.sumYear_num = tmpdata.sumYear.noRepeatInNum
// let btdata = new Array();
// let bvdata = new Array();
// tmpdata.foreach(function(item,index){
// console.log(item);
// console.log(index);
// });
}); });
}, },

9
src/api/home.js

@ -49,15 +49,16 @@ export function homeBarData(param) {
param, param,
}) })
} }
// 总览数据(今日进馆、本周以及本月进馆人数)
export function allGroupNum(param) { export function allGroupNum(param) {
return request({ return request({
url: '/pass.passcc/allGroupNum', url: '/pass.passcc/allGroupNum',
method: 'post', method: 'get',
param, param,
}) })
} }
//实时数据
export function allInfoDatas(param) { export function allInfoDatas(param) {
return request({ return request({
url: '/pass.passcc/realTimeData', url: '/pass.passcc/realTimeData',
@ -65,11 +66,11 @@ export function allInfoDatas(param) {
param, param,
}) })
} }
// http://btgym.xingtongworld.com/index.php?s=/api/pass.passcc/toDayGroupsEnterNum // 今日各场馆趋势
export function allGcgNumDatas(param) { export function allGcgNumDatas(param) {
return request({ return request({
url: '/pass.passcc/toDayGroupsEnterNum', url: '/pass.passcc/toDayGroupsEnterNum',
method: 'post', method: 'get',
param, param,
}) })
} }

2
src/views/cultrue/index.vue

@ -449,6 +449,8 @@ export default {
option && myChart.setOption(option); option && myChart.setOption(option);
}, },
//
cultrue_bar3() { cultrue_bar3() {
var chartDom = document.getElementById("tsgchart"); var chartDom = document.getElementById("tsgchart");
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);

281
src/views/index.vue

@ -229,7 +229,6 @@ export default {
// console.log(rqtp); // console.log(rqtp);
// //
homeApi.allGroupTimeNum().then(res => { homeApi.allGroupTimeNum().then(res => {
console.log(res);
const kldata = res.data.data.allTimeData const kldata = res.data.data.allTimeData
// //
let kltd = new Array; let kltd = new Array;
@ -241,14 +240,11 @@ export default {
}) })
this.kltdata = kltd this.kltdata = kltd
this.klvdata = tmpkvd this.klvdata = tmpkvd
console.log(this.kltdata);
console.log(this.klvdata);
}); });
}, },
btgetdata2() { btgetdata2() {
// //
homeApi.allGroupTimeNum2().then(res => { homeApi.allGroupTimeNum2().then(res => {
console.log(res);
const kldata = res.data.data.allTimeData const kldata = res.data.data.allTimeData
// //
let kltd = new Array; let kltd = new Array;
@ -260,14 +256,11 @@ export default {
}) })
this.kltdata = kltd this.kltdata = kltd
this.klvdata = tmpkvd this.klvdata = tmpkvd
console.log(this.kltdata);
console.log(this.klvdata);
}); });
}, },
btgetdata3() { btgetdata3() {
// //
homeApi.allGroupTimeNum3().then(res => { homeApi.allGroupTimeNum3().then(res => {
console.log(res);
const kldata = res.data.data.allTimeData const kldata = res.data.data.allTimeData
// //
let kltd = new Array; let kltd = new Array;
@ -279,26 +272,22 @@ export default {
}) })
this.kltdata = kltd this.kltdata = kltd
this.klvdata = tmpkvd this.klvdata = tmpkvd
console.log(this.kltdata);
console.log(this.klvdata);
}); });
}, },
// //
selitem(type) { selitem(type) {
console.log('1111111111'); // console.log(type);
console.log(type);
this.klselt = type; this.klselt = type;
this.btgetdata() this.btgetdata()
}, },
selitem2(type) { selitem2(type) {
console.log('1111111111'); // console.log(type);
console.log(type);
this.klselt = type; this.klselt = type;
this.btgetdata2() this.btgetdata2()
}, },
selitem3(type) { selitem3(type) {
console.log('1111111111'); // console.log(type);
console.log(type);
this.klselt = type; this.klselt = type;
this.btgetdata3() this.btgetdata3()
}, },
@ -408,12 +397,6 @@ export default {
type: 'bar', type: 'bar',
barMaxWidth: 'auto', barMaxWidth: 'auto',
barWidth: 15, barWidth: 15,
// backgroundStyle: {
// showBackground: true,
// borderColor: '#B03A5B',
// shadowColor: 'rgba(42, 18, 255,0.5)',
// shadowBlur: 15
// },
itemStyle: { itemStyle: {
normal: { normal: {
color: function () { color: function () {
@ -427,24 +410,6 @@ export default {
} }
}, },
// color: {
// x: 0,
// y: 0,
// x2: 0,
// y2: 1,
// type: 'linear',
// global: false,
// colorStops: [
// {
// offset: 0,
// color: '#0b9eff',
// },
// {
// offset: 1,
// color: '#63caff',
// },
// ],
// },
}, },
label: { label: {
show: true, show: true,
@ -481,24 +446,6 @@ export default {
// barGap: '40%', // barGap: '40%',
zlevel: -1, zlevel: -1,
// backgroundStyle: {
// showBackground: true,
// borderColor: '#B03A5B',
// shadowColor: 'rgba(42, 18, 255,0.5)',
// shadowBlur: 15
// },
itemStyle: {
normal: {
// color: function () {
// return new echarts.graphic.LinearGradient(0, 0, 0, 0.7, [
// { offset: 0, color: "#00B4FF" },
// { offset: 1, color: "#2F00FF" }
// ], false)
// },
// color:'rgba(8, 15, 56,1)'
},
}
}, },
{ {
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
@ -533,12 +480,7 @@ export default {
color: '#fff' color: '#fff'
}, },
extraCssText: 'box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);', // extraCssText: 'box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);', //
formatter: function (params) {
console.log(params);
if (params.seriesName != "") {
return params.name + ' : 有 ' + params.value + ' 人';
}
},
}, },
}; };
@ -546,75 +488,12 @@ export default {
option && myChart.setOption(option); option && myChart.setOption(option);
}, },
// 线 //
// line_zone() {
// var chartDom = document.getElementById("kl-line");
// var myChart = echarts.init(chartDom);
// var option;
// let base = +new Date(2022, 9, 3);
// let oneDay = 24 * 3600 * 1000;
// let date = [];
// let data = [Math.random() * 300];
// for (let i = 1; i < 20000; i++) {
// var now = new Date((base += oneDay));
// date.push(
// [now.getFullYear(), now.getMonth() + 1, now.getDate()].join("/")
// );
// data.push(Math.round((Math.random() - 0.5) * 20 + data[i - 1]));
// }
// option = {
// xAxis: {
// type: "category",
// boundaryGap: false,
// data: date,
// },
// yAxis: {
// type: "value",
// boundaryGap: [0, "100%"],
// //线
// splitLine: {
// lineStyle: {
// type: "soild",
// color: "#2F00FF",
// },
// },
// },
// series: [
// {
// name: "Fake Data",
// type: "line",
// symbol: "none",
// sampling: "lttb",
// itemStyle: {
// color: "rgb(255, 170, 131)",
// },
// areaStyle: {
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 0,
// color: "rgba(255, 158, 68,0.6)",
// },
// {
// offset: 1,
// color: "rgb(255, 70, 131,0.6)",
// },
// ]),
// },
// data: data,
// },
// ],
// };
// option && myChart.setOption(option);
// },
line_zone() { line_zone() {
var chartDom = document.getElementById("kl-line"); var chartDom = document.getElementById("kl-line");
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);
var option; var option;
console.log(this.rsqsData_z);
var xData = ['09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '20:00', '21:00']; var xData = ['09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '20:00', '21:00'];
var color = ['#FF99CC', '#6666FF', '#FF6600', '#7049f0', '#fa704d', '#01babc',] var color = ['#FF99CC', '#6666FF', '#FF6600', '#7049f0', '#fa704d', '#01babc',]
var name = [] var name = []
@ -800,29 +679,18 @@ export default {
getStat() { getStat() {
let that = this let that = this
console.log(that);
homeApi.allGroupNum().then(res => { homeApi.allGroupNum().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.day_num = tmpdata.day.noRepeatInNum
this.week_num_num = tmpdata.week.noRepeatInNum this.week_num = tmpdata.week.noRepeatInNum
this.mon_num = tmpdata.month.noRepeatInNum this.mon_num = tmpdata.month.noRepeatInNum
this.year_num = tmpdata.year.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);
// });
}); });
}, },
getHomeBarData() { getHomeBarData() {
let that = this let that = this
console.log(that);
homeApi.homeBarData().then(res => { homeApi.homeBarData().then(res => {
// get allTimeData // get allTimeData
const tmpdata = res.data.data.allTimeData const tmpdata = res.data.data.allTimeData
@ -831,155 +699,58 @@ export default {
let datas = [] let datas = []
Object.values(tmpdata).forEach((value) => { Object.values(tmpdata).forEach((value) => {
console.log(value.num);
datas.push(value.num) datas.push(value.num)
}); });
console.log(datas);
that.klqsDatas = datas that.klqsDatas = datas
console.log(this.klqsDatas);
groupsData.forEach((item) => {
console.log(item);
// that.proportionData = item.proportion
// console.log(this.proportionData);
that.proportionData.push(item.proportion)
console.log(this.proportionData);
that.groupNameData.push(item.groupName)
console.log(this.groupNameData);
// console.log(value);
// datas.push(value)
})
// this.proportionData.forEach((item) => { // groupsData.forEach((item) => {
// console.log(item); // that.proportionData.push(item.proportion)
// let rsqsData = [] // that.groupNameData.push(item.groupName)
// Object.values(item).forEach((value) => {
// // console.log(value);
// rsqsData.push(value)
// console.log(rsqsData);
// });
// that.proportionData_z.push(rsqsData)
// console.log(that.proportionData_z);
// }) // })
// let rsqsData = []
// Object.values(this.rsqsDatas).forEach((value) => {
// console.log(value);
// rsqsData.push(value)
// console.log(rsqsData);
// that.rsqsData_z = rsqsData
// console.log(that.rsqsData_z);
// });
// 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);
homeApi.allInfoDatas().then(res => { homeApi.allInfoDatas().then(res => {
// get allTimeData that.ssjgNumDatas = res.data.returnData
console.log(res);
this.ssjgNumDatas = res.data.returnData ssjgNumDatas.forEach(item => {
// this.ssjgNumDatas = res.data.returnData let proportion = parseInt(item.proportion)
// let ssjgNumDatas = this.ssjgNumDatas if (proportion >= 80 && proportion <= 90) {
// ssjgNumDatas.forEach(item => { this.$refs.proportionbox.addClass('rbrate2')
// console.log(parseInt(item.proportion)); }
// let proportion = parseInt(item.proportion) if (proportion > 90) {
// if (proportion >= 80 && proportion <= 90) { this.$refs.proportionbox.addClass('rbrate3')
// 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
const tmpdata = res.data.data const tmpdata = res.data.data
console.log(tmpdata);
tmpdata.forEach((item) => { tmpdata.forEach((item) => {
console.log(item);
console.log(item.list);
that.rsqsDatas.push(item.list) that.rsqsDatas.push(item.list)
console.log(this.rsqsDatas);
// console.log(value);
// datas.push(value)
// let rsqsData = []
// Object.values(item.list).forEach((value) => {
// console.log(value);
// rsqsData.push(value)
// // console.log(rsqsData);
// that.rsqsData_z.push(rsqsData)
// console.log(that.rsqsData_z);
// // console.log(that.rsqsData_z);
// });
}) })
this.rsqsDatas.forEach((item) => { this.rsqsDatas.forEach((item) => {
console.log(item);
let rsqsData = [] let rsqsData = []
Object.values(item).forEach((value) => { Object.values(item).forEach((value) => {
// console.log(value);
rsqsData.push(value) rsqsData.push(value)
console.log(rsqsData);
}); });
that.rsqsData_z.push(rsqsData) that.rsqsData_z.push(rsqsData)
console.log(that.rsqsData_z);
}) })
// 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);
// });
}); });
} }
}, },

Loading…
Cancel
Save