Browse Source

Merge branch 'master' of ssh://git.xingtongworld.com:10022/xioayue/btgymm

master
453530270@qq.com 3 years ago
parent
commit
913a7b9940
  1. BIN
      src/assets/img/yyg_icon.png
  2. BIN
      src/assets/img/yyg_icon_2.png
  3. 45
      src/views/HomeView.vue
  4. 87
      src/views/TycView.vue

BIN
src/assets/img/yyg_icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 794 B

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/assets/img/yyg_icon_2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

45
src/views/HomeView.vue

@ -142,7 +142,7 @@ import { numGrow,ecMaxVal,numberGrow} from '@/utils/comm';
// api // api
import * as homeApi from '@/api/home' import * as homeApi from '@/api/home'
let ws = null;
export default { export default {
name: 'HomeView', name: 'HomeView',
data() { data() {
@ -442,7 +442,7 @@ export default {
} }
}, },
{ {
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], data: [1, 1, 1, 1, 1, 1, 1, 1],
type: 'pictorialBar', type: 'pictorialBar',
barMaxWidth: '15', barMaxWidth: '15',
symbol: 'circle', symbol: 'circle',
@ -489,7 +489,8 @@ export default {
option = { option = {
color: ["#F2A0CE", "#0780e2", "#FF6504", "#01FE00", "#00FFFF", "#fdff00"], // color: ["#F2A0CE", "#0780e2", "#FF6504", "#01FE00", "#00FFFF", "#fdff00"],
color: ['#ff9acc', '#6666ff', '#a9eeff', '#02ff00','#00ffff', '#fdff00'],
series: [ series: [
{ {
@ -700,12 +701,12 @@ export default {
getsckdata(){ getsckdata(){
let that = this; let that = this;
// websocket // websocket
const ws = new WebSocket(publicConfig.WS_URL_ZL); ws = new WebSocket(publicConfig.WS_URL_ZL);
ws.onopen = function() { ws.onopen = function() {
console.log("ws connected success!") // console.log("ws connected success!")
}; };
ws.onclose = function(event) { ws.onclose = function(event) {
console.log('WebSocket连接已关闭'); // console.log('WebSocket');
}; };
ws.onmessage = (e)=> { ws.onmessage = (e)=> {
var jstr = JSON.parse(e.data); var jstr = JSON.parse(e.data);
@ -822,6 +823,9 @@ export default {
}); });
} }
},
beforeUnmount(){
ws.close();
} }
} }
@ -843,7 +847,9 @@ export default {
color: #fff; color: #fff;
left: 0; left: 0;
top: 0; top: 0;
background-color: #080A25; /* background-color: #080A25; */
background-color: #032461;
box-shadow: 0px 3px 4px 0px rgba(255, 255, 255, 0.1);
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
@ -942,6 +948,13 @@ export default {
width: 20%; width: 20%;
height: 3.2rem; height: 3.2rem;
float: left; float: left;
width: 5rem;
height: 4rem;
}
.numbox .numicon img{
width: 100%;
height: 100%;
margin-top: 0.7rem;
} }
.numbox .numdiv { .numbox .numdiv {
@ -990,11 +1003,11 @@ export default {
.klqs .klqs_bg { .klqs .klqs_bg {
float: left; float: left;
/* width: 80%; */ /* width: 80%; */
margin-left: 4rem; margin-left: 5rem;
/* padding-left: 6.4rem; */ /* padding-left: 6.4rem; */
line-height: 2.8rem; line-height: 2.8rem;
font-size: 1.1rem; font-size: 1.1rem;
color: gray; color: #999;
} }
.klqs .klbtn { .klqs .klbtn {
@ -1117,10 +1130,10 @@ export default {
background-size: 100% 100%; background-size: 100% 100%;
background-position: -1.04rem 0.2rem; background-position: -1.04rem 0.2rem;
height: 3.2rem; height: 3.2rem;
line-height: 0rem; line-height: 3.5rem;
padding-left: 4.6rem; padding-left: 5rem;
font-size: 1.1rem; font-size: 1.1rem;
color: gray; color: #999;
padding-bottom: 1rem; padding-bottom: 1rem;
} }
@ -1139,9 +1152,9 @@ export default {
height: 3.8rem; height: 3.8rem;
line-height: 2.8rem; line-height: 2.8rem;
background-position: -1.04rem 0.2rem; background-position: -1.04rem 0.2rem;
padding-left: 4.6rem; padding-left: 5.5rem;
font-size: 1.1rem; font-size: 1.1rem;
color: gray; color: #999;
} }
.pcgrs .pcg_item { .pcgrs .pcg_item {
@ -1167,6 +1180,7 @@ export default {
margin-top: 1.6rem; margin-top: 1.6rem;
margin-right: 1.1rem; margin-right: 1.1rem;
/* padding-right: 0.9rem; */ /* padding-right: 0.9rem; */
color: #3E96F7;
} }
.pcgrs .pcg_item .pcval { .pcgrs .pcg_item .pcval {
@ -1222,7 +1236,8 @@ export default {
font-size: 0.2rem; font-size: 0.2rem;
} }
.pcgrs .pcg_item .rbrate0 { .pcgrs .pcg_item .rbrate0 {
width: 32%; /* width: 32%; */
width: 3.4rem;
height: 3.4rem; height: 3.4rem;
line-height: 3.4rem; line-height: 3.4rem;
display: block; display: block;

87
src/views/TycView.vue

@ -402,6 +402,7 @@ import * as echarts from 'echarts';
import * as btApi from '../api/home' import * as btApi from '../api/home'
import { ecMaxVal,numGrow } from '@/utils/comm'; import { ecMaxVal,numGrow } from '@/utils/comm';
let ws = null;
export default { export default {
name: 'TycView', name: 'TycView',
data() { data() {
@ -431,6 +432,8 @@ export default {
this.cg_line() this.cg_line()
// //
this.getTdcg() this.getTdcg()
this.getsckdata()
}, },
methods: { methods: {
// 110,210,310 // 110,210,310
@ -495,7 +498,7 @@ export default {
}); });
// 2 // 2
}, },
// 24H // 24H
cgsf_line() { cgsf_line() {
var chartDom = document.getElementById('gcins_charts'); var chartDom = document.getElementById('gcins_charts');
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);
@ -625,19 +628,19 @@ export default {
] ]
} }
option && myChart.setOption(option); // option && myChart.setOption(option);
// //
setInterval(()=>{ // setInterval(()=>{
myChart.clear() myChart.clear()
option && myChart.setOption(option); option && myChart.setOption(option);
},4000); // },4000);
}, },
// //
getTdcg(){ getTdcg(){
let guids = "110|210|310" let guids = "110|210|310"
btApi.tdGroupRealTimeEnter({groupsId:guids}).then(res=>{ btApi.tdGroupRealTimeEnter({type:1}).then(res=>{
console.log(res) console.log(res)
const tmpdata = res.data.data const tmpdata = res.data.data
// X // X
@ -658,7 +661,7 @@ export default {
}) })
}, },
// // 线
cg_line() { cg_line() {
var chartDom = document.getElementById("gc_charts"); var chartDom = document.getElementById("gc_charts");
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);
@ -817,9 +820,81 @@ export default {
series: series, series: series,
} }
myChart.clear()
option && myChart.setOption(option); option && myChart.setOption(option);
}, },
getsckdata(){
let that = this;
// websocket
ws = new WebSocket(publicConfig.WS_URL_TY);
ws.onopen = function() {
// console.log("ws connected success!")
};
ws.onclose = function(event) {
// console.log('WebSocket');
};
ws.onmessage = (e)=> {
var jstr = JSON.parse(e.data);
if(!jstr){
return;
}
// 24
const vkdata = new Array;
vkdata.push({
xname: jstr.getPassHoursData.data.dkeys.slice(-8, jstr.getPassHoursData.data.dkeys.length),
xval: jstr.getPassHoursData.data.dvalue.slice(-8, jstr.getPassHoursData.data.dvalue.length)
})
that.ecbardata = vkdata;
that.cgsf_line();
// 线
function linedata(){
that.zxliddata=[];
that.rsqsDataName=[],that.rsqsDatas=[];
const tmpdata = jstr.toDayGroupsEnterNum.data;
tmpdata.forEach((item) => {
that.rsqsDataName.push(item.groupName);
that.rsqsDatas.push(item.list)
})
that.zxlindata = jstr.toDayGroupsEnterNum.data[0].list.dkeys;
that.rsqsDatas.forEach((item) => {
let rsqsData = []
Object.getOwnPropertyNames(item).forEach((value) => {
if(value=='dvalue'){
rsqsData = item[value];
}
});
that.zxliddata.push(rsqsData)
})
that.cg_line()
}
linedata();
//
function proportion(){
//
const tgdata = jstr.allGroupTimeNum.data.data.groupsData
that.cgdata = tgdata
// today in
// tgdata.forEach(item=>{
// that.tdnum += item.noRepeatInNum
// });
}
proportion();
//
const rtdata = jstr.allGroupNum.data
that.tdnum = rtdata.day.noRepeatInNum
that.wdnum = rtdata.week.noRepeatInNum
that.tmdata = rtdata.month.noRepeatInNum
that.tydata = rtdata.year.noRepeatInNum
}
}
}, },
beforeUnmount(){
// console.log('');
ws.close();
}
} }
</script> </script>
Loading…
Cancel
Save