Browse Source

修改

lite
453530270@qq.com 3 years ago
parent
commit
455e93325e
  1. 86
      src/views/index.vue

86
src/views/index.vue

@ -102,7 +102,7 @@
<!-- 各场馆实时人数 cg1 --> <!-- 各场馆实时人数 cg1 -->
<!-- v-for="(item, index) in 6" :key="index" --> <!-- v-for="(item, index) in 6" :key="index" -->
<div class="rbitem" v-for="item in ssjgNumDatas" :key="item.groupId"> <div class="rbitem" v-for="item in ssjgNumDatas" :key="item.groupId">
<span class="rbcgname">{{ item.groupName||'劳务工博物馆' }}</span> <span class="rbcgname">{{ item.groupName||'博物馆' }}</span>
<span class="rbtitle">日累计人数</span> <span class="rbtitle">日累计人数</span>
<!-- <span class="rbval">4,738</span> --> <!-- <span class="rbval">4,738</span> -->
<span class="rbval">{{ item.allEnter }}</span> <span class="rbval">{{ item.allEnter }}</span>
@ -182,19 +182,6 @@ export default {
this.index_pie1(); this.index_pie1();
}, 1000) }, 1000)
// 线
// this.home_bar(this.klqsDatas);
// 线
// this.line_zone();
// this.addNumber(0, 345235, 'jgval1');
// this.addNumber(0, 345235, 'jgval2');
// this.addNumber(0, 345235, 'jgval3');
// this.getStat();
// this.getHomeBarData();
// this.getInfoDatas();
// this.getGcgNumDatas()
// this.selitem('y')
}, },
methods: { methods: {
btgetdata() { btgetdata() {
@ -409,17 +396,6 @@ export default {
color: '#fff', color: '#fff',
}, },
}, },
// {
// data: dataLenArr,
// type: 'pictorialBar',
// barMaxWidth: '15',
// symbol: 'circle',
// symbolOffset: [0, '50%'],
// symbolSize: [10, 5],
// color: '#fff',
// zlevel: 0,
// //
// },
{ {
data: data, data: data,
type: 'pictorialBar', type: 'pictorialBar',
@ -471,10 +447,6 @@ export default {
option && myChart.setOption(option); option && myChart.setOption(option);
function run(myChart) { function run(myChart) {
that.getHomeBarData(); that.getHomeBarData();
console.log('重新绘制');
// that.klqsDatas = that.klqsDatas.sort(function(a,b){
// return Math.random() - 0.5;
// });
let max=that.klqsDatas[0]; let max=that.klqsDatas[0];
for (let i = 0; i < that.klqsDatas.length; i++) { for (let i = 0; i < that.klqsDatas.length; i++) {
if (that.klqsDatas[i]>max) { if (that.klqsDatas[i]>max) {
@ -495,10 +467,6 @@ export default {
type: 'bar', type: 'bar',
data: that.klqsDatas data: that.klqsDatas
}, },
// {
// type: 'pictorialBar',
// data: dataLenArr
// },
{ {
type: 'pictorialBar', type: 'pictorialBar',
data: that.klqsDatas data: that.klqsDatas
@ -518,7 +486,7 @@ export default {
myChart.clear(); myChart.clear();
option && myChart.setOption(option); option && myChart.setOption(option);
run(myChart); run(myChart);
}, 3000); }, 3600);
}, },
// //
@ -527,7 +495,7 @@ export default {
var option; var option;
var xData = this.rsqsXData; var xData = this.rsqsXData;
var color = ['#FF99CC', '#6666FF', '#FF6600', '#7049f0', '#fa704d', '#01babc'] var gcolor = ['#FF99CC', '#6666FF', '#FF6600', '#7049f0', '#fa704d', '#01babc']
var name = [] var name = []
// var data = [ // var data = [
// [174, 137, 135, 34, 152, 135, 140, 160, 100, 174, 137, 135, 34], // [174, 137, 135, 34, 152, 135, 140, 160, 100, 174, 137, 135, 34],
@ -540,6 +508,8 @@ export default {
var series = []; var series = [];
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
console.log(gcolor[i])
series.push({ series.push({
name: this.rsqsDataName[i], name: this.rsqsDataName[i],
type: "line", type: "line",
@ -551,10 +521,10 @@ export default {
normal: { normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0, offset: 0,
color: color[i] color: gcolor[i]
}, { }, {
offset: 0.8, offset: 0.8,
color: 'rgba(255,255,255,0)', color: '#fff',
}], false), }], false),
// shadowColor: 'rgba(255,255,255, 0.1)', // shadowColor: 'rgba(255,255,255, 0.1)',
shadowBlur: 10, shadowBlur: 10,
@ -563,12 +533,12 @@ export default {
}, },
itemStyle: { itemStyle: {
normal: { normal: {
color: color[i], color: gcolor[i],
lineStyle: { lineStyle: {
width: 1, width: 1,
type: 'solid' //'dotted'线 'solid'线 type: 'solid' //'dotted'线 'solid'线
}, },
borderColor: color[i], // color borderColor: gcolor[i], // color
borderWidth: 8,//线 0 [ default: 0 ] borderWidth: 8,//线 0 [ default: 0 ]
barBorderRadius: 0, barBorderRadius: 0,
label: { label: {
@ -581,6 +551,8 @@ export default {
}) })
} }
// setting option
option = { option = {
// backgroundColor: "#141f56", // backgroundColor: "#141f56",
legend: { legend: {
@ -617,9 +589,9 @@ export default {
} }
}, },
formatter: '{b}<br />{a0}: {c0}<br />{a1}: {c1}<br />{a2}: {c2}<br />{a3}: {c3}<br />{a4}: {c4}<br />{a5}: {c5}', formatter: '{b}<br />{a0}: {c0}<br />{a1}: {c1}<br />{a2}: {c2}<br />{a3}: {c3}<br />{a4}: {c4}<br />{a5}: {c5}',
backgroundColor: 'rgba(0,0,0,0.7)', // backgroundColor: '#000', //
padding: [8, 10], // padding: [8, 10], //
extraCssText: 'box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);', // extraCssText: 'box-shadow: 0 0 3px #fffff;', //
}, },
grid: { grid: {
borderWidth: 0, borderWidth: 0,
@ -667,13 +639,13 @@ export default {
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: '#0B0765 ', color: '#0B0765',
} }
}, },
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: '#0B0765 ', color: '#0B0765',
} }
}, },
axisLabel: { axisLabel: {
@ -687,21 +659,21 @@ export default {
}, },
series: series, series: series,
} }
function run(myChart){ // function run(myChart){
// - // // -
myChart.setOption({ // myChart.setOption({
series: series // series: series
}); // });
} // }
setTimeout(()=>{ // setTimeout(()=>{
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);
option && myChart.setOption(option); option && myChart.setOption(option);
setInterval(function () { // setInterval(function () {
myChart.clear(); // myChart.clear();
option && myChart.setOption(option); // option && myChart.setOption(option);
run(myChart); // run(myChart);
}, 1000); // }, 600);
}, 1000) // }, 600)
}, },
addNumber(start, end, id) { addNumber(start, end, id) {
@ -761,8 +733,6 @@ export default {
}) })
}) })
console.log(groupsData, 'groupsData', that.dataP);
}); });
}, },

Loading…
Cancel
Save