luyisha 3 years ago
parent
commit
8eb3d2ac89
  1. BIN
      src/assets/index/left_t3_bg.png
  2. BIN
      src/assets/index/rb_data_bg.png
  3. BIN
      src/assets/index/总服务人次趋势-6.png
  4. BIN
      src/assets/ty/ins_count.png
  5. 123
      src/views/cultrue/index.vue
  6. 29
      src/views/index.vue
  7. 148
      src/views/ty/index.vue

BIN
src/assets/index/left_t3_bg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 KiB

After

Width:  |  Height:  |  Size: 370 KiB

BIN
src/assets/index/rb_data_bg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 37 KiB

BIN
src/assets/index/总服务人次趋势-6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

BIN
src/assets/ty/ins_count.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 27 KiB

123
src/views/cultrue/index.vue

@ -102,6 +102,11 @@ export default {
tsg_num:8662, tsg_num:8662,
data24h: [], data24h: [],
data24hX: [], data24hX: [],
//
rsqsXData: [],
rsqsDatas: [],
rsqsDataName: [],
rsqsDataAll: [],
}; };
}, },
mounted() { mounted() {
@ -116,9 +121,10 @@ export default {
}, 200); }, 200);
// //
this.bwugrs(); this.bwugrs();
this.gethomeBarData();//24
this.getData24h();//24 this.getData24h();//24
this.getGcgNumDatas();//
this.cultrue_bar2();
this.cultrue_bar3(); this.cultrue_bar3();
this.addNumber(0, this.todayNum, 'insv') this.addNumber(0, this.todayNum, 'insv')
this.addNumber(0, this.monthNum, 'insv2') this.addNumber(0, this.monthNum, 'insv2')
@ -131,6 +137,7 @@ export default {
// var name = ['', '', ''] // var name = ['', '', '']
setTimeout(() => { setTimeout(() => {
this.cultrue_bar1();//24 this.cultrue_bar1();//24
this.cultrue_bar2();//
}, 200); }, 200);
}, },
methods: { methods: {
@ -332,30 +339,25 @@ export default {
var chartDom = document.getElementById("pcgchart"); var chartDom = document.getElementById("pcgchart");
var option var option
// var xData = function() { var xData = this.rsqsXData;
// var data = []; var name = this.rsqsDataName;
// for (var i = 2011; i < 2017; i++) { // console.log(this.rsqsDataName, 'this.rsqsDataName')
// data.push(i + ""); // = ['', '', ''];
// } var data = this.rsqsDataAll;
// return data;
// }();
var xData = ['09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00',];
var color = ['#FF99CC', '#6666FF', '#FF6600', '#7049f0', '#fa704d', '#01babc',] var color = ['#FF99CC', '#6666FF', '#FF6600', '#7049f0', '#fa704d', '#01babc',]
var name = ['图书馆', '文化馆', '博物馆'] let iconData = [];
var data = [ this.rsqsDataName.forEach((item, index)=>{
[137, 34, 135, 161, 74, 152, 110, 100, 150], if(index==0){
[174, 137, 135, 34, 152, 135, 140, 160, 100], iconData.push({icon: 'image://img/tyc_icon.png', name: name[0]})
[134, 74, 137, 135, 161, 137, 300, 220, 250], }else if(index==1){
// [3.5, 15.2, 16.1, 17.4, 13.4, 6.1], iconData.push({icon: 'image://img/tyg_icon.png', name: name[1]})
// [16.1, 13.5, 3.7, 17.4, 15.2, 18.9], }else if(index==2){
// [17.4, 6.1, 13.4, 15.2, 13.7, 5.2], iconData.push({icon: 'image://img/yyg_icon.png', name: name[2]})
// [3.5, 15.2, 16.1, 17.4, 13.4, 6.1], }
// [16.1, 13.5, 3.7, 17.4, 15.2, 18.9], })
// [17.4, 6.1, 13.4, 15.2, 13.7, 5.2],
]
var series = []; var series = [];
for (var i = 0; i < 6; i++) { for (var i = 0; i < data.length; i++) {
series.push({ series.push({
name: name[i], name: name[i],
type: "line", type: "line",
@ -411,11 +413,7 @@ export default {
fontSize: '14', fontSize: '14',
// padding: [1, 12] // padding: [1, 12]
}, },
data: [ data: iconData
{ icon: 'image://img/tyc_icon.png', name: '图书馆' },
{ icon: 'image://img/tyg_icon.png', name: '文化馆' },
{ icon: 'image://img/yyg_icon.png', name: '博物馆' },
]
}, },
title: { title: {
// text: "", // text: "",
@ -831,7 +829,33 @@ export default {
bwugrs(){ bwugrs(){
homeApi.allTygGroupTimeNum({granularity:"daily",groupsId:"510"}).then(res=>{ homeApi.allTygGroupTimeNum({granularity:"daily",groupsId:"510"}).then(res=>{
let bwgrs = res.data.data.groupsData let bwgrs = res.data.data.groupsData
this.bwg_num = bwgrs[0].noRepeatInNum // this.bwg_num = bwgrs[0].noRepeatInNum
});
},
// 24
gethomeBarData(){
let that = this;
homeApi.getID().then(res=>{
// console.log(res, '=====');
let idArr = "";
res.data.data.map(item=>{
if(item.type==2){
idArr += "|"+item.groupId;
}
})
homeApi.homeBarData({groupsId:idArr}).then(res=>{
let groupsData = [];
res.data.data.groupsData.forEach(item=>{
groupsData.push(item);
});
// todayNum: 0,
// monthNum: 0,
// yearNum: 0,
that.bwg_num = groupsData[0].noRepeatInNum;
that.whg_num = groupsData[1].noRepeatInNum;
that.tsg_num = groupsData[2]?that.groupsData[2].noRepeatInNum:'';
});
}); });
}, },
// //
@ -912,7 +936,45 @@ export default {
that.data24hX = res.data.data.dkeys; that.data24hX = res.data.data.dkeys;
}); });
}); });
} },
// 线
getGcgNumDatas(){
let that = this;
homeApi.getID().then(res=>{
// console.log(res, '=====');
let idArr = "";
res.data.data.map(item=>{
if(item.type==2){
idArr += "|"+item.groupId;
}
})
homeApi.allGcgNumDatas({groupsId:idArr}).then(res=>{
console.log(res, '=====');
const tmpdata = res.data.data;
tmpdata.forEach((item) => {
that.rsqsDataName.push(item.groupName);
that.rsqsDatas.push(item.list)
})
that.rsqsXData = res.data.data[0].list.dkeys;
that.rsqsDatas.forEach((item) => {
let rsqsData = []
Object.getOwnPropertyNames(item).forEach((value) => {
if(value=='dkeys'){
}
if(value=='dvalue'){
// console.log(item, value, '-----')
// rsqsData.push(item[value])
rsqsData = item[value];
}
});
that.rsqsDataAll.push(rsqsData)
})
});
});
},
}, },
}; };
</script> </script>
@ -1247,7 +1309,8 @@ export default {
width: calc(24rem - 1.14rem) !important; width: calc(24rem - 1.14rem) !important;
height: 10.71rem !important; height: 10.71rem !important;
overflow: visible !important; overflow: visible !important;
margin: 0px 0.57rem 0px 0.57rem !important; // margin: 0px 0.57rem 0px 0.57rem !important;
margin: 0px auto !important;
box-sizing: border-box !important; box-sizing: border-box !important;
// transform-origin: center top !important; // transform-origin: center top !important;
transform: scale(1) !important; transform: scale(1) !important;

29
src/views/index.vue

@ -102,8 +102,8 @@
<!-- 各场馆实时人数 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>
<span class="rbrate" <span class="rbrate"
@ -470,9 +470,9 @@ export default {
function run(myChart) { function run(myChart) {
that.getHomeBarData(); that.getHomeBarData();
console.log('重新绘制'); console.log('重新绘制');
that.klqsDatas = that.klqsDatas.sort(function(a,b){ // that.klqsDatas = that.klqsDatas.sort(function(a,b){
return Math.random() - 0.5; // 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) {
@ -1058,11 +1058,11 @@ export default {
/* 场馆左侧 */ /* 场馆左侧 */
.indexleftbox .cgflow_leftbox { .indexleftbox .cgflow_leftbox {
width: 2rem; width: 2.16rem;
} }
.indexleftbox .cgflow_rightbox { .indexleftbox .cgflow_rightbox {
width: 2rem; width: 2.16rem;
text-align: right; text-align: right;
} }
@ -1094,6 +1094,7 @@ export default {
.indexleftbox .cgflow .cgfitem .cgtitle { .indexleftbox .cgflow .cgfitem .cgtitle {
color: #0096ff; color: #0096ff;
font-size: 16px; font-size: 16px;
flex: 1;
} }
.indexleftbox .cgflow .cgfitem .cgval { .indexleftbox .cgflow .cgfitem .cgval {
@ -1118,8 +1119,8 @@ export default {
margin-left: 4%; margin-left: 4%;
} }
#indexPie1{ #indexPie1{
width: 2.32rem; width: 2rem;
height: 2.32rem; height: 2rem;
} }
/* 各场馆人流趋势 */ /* 各场馆人流趋势 */
.indexleftbox .gcgqs { .indexleftbox .gcgqs {
@ -1297,7 +1298,7 @@ export default {
.rbox .rbox_con .rbitem .rbtitle { .rbox .rbox_con .rbitem .rbtitle {
text-align: left; text-align: left;
padding-left: 0.66rem; padding-left: 0.66rem;
padding-top: 0.1rem; padding-top: 0.08rem;
font-size: 0.24rem; font-size: 0.24rem;
} }
@ -1357,8 +1358,8 @@ export default {
// width: calc(24rem - 0.44rem) !important; // width: calc(24rem - 0.44rem) !important;
height: 10.71rem !important; height: 10.71rem !important;
overflow: visible !important; overflow: visible !important;
// margin: 0px 0.29rem 0px 0.15rem !important; margin: 0px 0.29rem 0px 0.15rem !important;
margin: 0px !important; // margin: 0px auto !important;
box-sizing: border-box !important; box-sizing: border-box !important;
// transform-origin: center top !important; // transform-origin: center top !important;
transform: scale(1) !important; transform: scale(1) !important;
@ -1367,5 +1368,9 @@ export default {
// transform: scale(1.25); // transform: scale(1.25);
/* //浏览器缩小至1536时,匹配外盒子逻辑赋予的transform: scale(0.8, 0.8) */ /* //浏览器缩小至1536时,匹配外盒子逻辑赋予的transform: scale(0.8, 0.8) */
transform-origin: 0 0; transform-origin: 0 0;
// display: flex;
// transform: scale(1.1);
// width: 100%;
// justify-content: space-between;
} }
</style> </style>

148
src/views/ty/index.vue

@ -62,11 +62,11 @@
<div class="c_title">24小时进馆人数</div> <div class="c_title">24小时进馆人数</div>
<div class="c_l" id="animationA"></div> <div class="c_l" id="animationA"></div>
<div class="c_r"> <div class="c_r">
<span class="c_r_num">21312</span> <span class="c_r_num">{{ cgn_1 }}</span>
<span class="c_r_txt">体育场</span> <span class="c_r_txt">体育场</span>
<span class="c_r_num">21312</span> <span class="c_r_num">{{ cgn_2 }}</span>
<span class="c_r_txt">体育馆</span> <span class="c_r_txt">体育馆</span>
<span class="c_r_num">21312</span> <span class="c_r_num">{{ cgn_3 }}</span>
<span class="c_r_txt">游泳场馆</span> <span class="c_r_txt">游泳场馆</span>
</div> </div>
<!-- v-for=" item in videoData" :key="item.key" --> <!-- v-for=" item in videoData" :key="item.key" -->
@ -656,19 +656,22 @@ export default {
var chartDom = document.getElementById("pcgchart2"); var chartDom = document.getElementById("pcgchart2");
var option var option
// var xData = function() {
// var data = [];
// for (var i = 2011; i < 2017; i++) {
// data.push(i + "");
// }
// return data;
// }();
var xData = this.rsqsXData; var xData = this.rsqsXData;
var color = ['#FF99CC', '#6666FF', '#FF6600', '#7049f0', '#fa704d', '#01babc',] var color = ['#FF99CC', '#6666FF', '#FF6600', '#7049f0', '#fa704d', '#01babc',]
var name = this.rsqsDataName= ['体育场', '体育馆', '游泳场馆'] var name = this.rsqsDataName
console.log(this.rsqsDataName, 'this.rsqsDataName') // console.log(this.rsqsDataName, 'this.rsqsDataName')
// = ['', '', '']; // = ['', '', ''];
var data = this.rsqsDataAll; var data = this.rsqsDataAll;
let iconData = [];
this.rsqsDataName.forEach((item, index)=>{
if(index==0){
iconData.push({icon: 'image://img/tyc_icon.png', name: name[0]})
}else if(index==1){
iconData.push({icon: 'image://img/tyg_icon.png', name: name[1]})
}else if(index==2){
iconData.push({icon: 'image://img/yyg_icon.png', name: name[2]})
}
})
var series = []; var series = [];
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
@ -726,7 +729,7 @@ export default {
// backgroundColor: "#141f56", // backgroundColor: "#141f56",
legend: { legend: {
// top: 390, // top: 390,
bottom: 0, bottom: 10,
right: 0, right: 0,
itemGap: 35, itemGap: 35,
itemWidth: 20, itemWidth: 20,
@ -735,11 +738,7 @@ export default {
color: '#fff', color: '#fff',
fontSize: '14' fontSize: '14'
}, },
data: [ data: iconData
{ icon: 'image://img/tyc_icon.png', name: '体育场' },
{ icon: 'image://img/tyg_icon.png', name: '体育馆' },
{ icon: 'image://img/yyg_icon.png', name: '游泳场馆' },
]
}, },
title: { title: {
// text: "", // text: "",
@ -832,10 +831,71 @@ export default {
series: series, series: series,
} }
function run(myChart){ function run(myChart){
let that = this;
// - // -
myChart.setOption({ that.getGcgNumDatas();
series: series setTimeout(() => {
}); var xData = this.rsqsXData;
var data = this.rsqsDataAll;
var series = [];
for (var i = 0; i < data.length; i++) {
series.push({
name: name[i],
type: "line",
symbolSize: 3,// 10 [20, 10] 2010[ default: 4 ]
symbol: 'circle',//ECharts 'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
smooth: true, //线
showSymbol: false, // symbol, false tooltip hover
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: color[i]
}, {
offset: 0.8,
color: 'rgba(255,255,255,0)'
}], false),
// shadowColor: 'rgba(255,255,255, 0.1)',
shadowBlur: 10,
opacity: 0.3,
}
},
itemStyle: {
normal: {
color: color[i],
lineStyle: {
width: 1,
type: 'solid' //'dotted'线 'solid'线
},
borderColor: color[i], // color
borderWidth: 8,//线 0 [ default: 0 ]
barBorderRadius: 0,
label: {
show: false,
},
opacity: 0.5,
}
},
markPoint: {
data: [
{
name: '最大值',
type: 'max'
}
]
},
data: data[i],
})
}
myChart.setOption({
xAxis: [{data: xData}],
series: series
});
}, 200);
} }
setTimeout(()=>{ setTimeout(()=>{
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);
@ -849,22 +909,34 @@ export default {
}, },
ty_pieDo(){ ty_pieDo(){
let that = this; let that = this;
this.ty_pie("pieChart1",this.groupsData[0]); var pieDom1 = document.getElementById("pieChart1");
this.ty_pie("pieChart2",this.groupsData[1]); var pieDom2 = document.getElementById("pieChart2");
this.ty_pie("pieChart3",this.groupsData[2]); var pieDom3 = document.getElementById("pieChart3");
var myChart1 = echarts.init(pieDom1);
var myChart2 = echarts.init(pieDom2);
var myChart3 = echarts.init(pieDom3);
function run(){ function run(){
that.gethomeBarData(); that.gethomeBarData();
setTimeout(() => { setTimeout(() => {
this.ty_pie("pieChart1",this.groupsData[0]); myChart1.clear();
this.ty_pie("pieChart2",this.groupsData[1]); that.ty_pie(myChart1,that.groupsData[0]);
this.ty_pie("pieChart3",this.groupsData[2]); }, 500);
}, 200); setTimeout(() => {
myChart2.clear();
that.ty_pie(myChart2,that.groupsData[1]);
}, 1000);
setTimeout(() => {
myChart3.clear();
that.ty_pie(myChart3,that.groupsData[2]);
}, 1500);
} }
run();
setInterval(function () { setInterval(function () {
run(); run();
}, 3000); }, 3000);
}, },
ty_pie(ElementId,DD){ ty_pie(myChart,DD){
let that = this; let that = this;
// console.log(num, '------') // console.log(num, '------')
if(!DD){ if(!DD){
@ -992,8 +1064,7 @@ export default {
// 使 // 使
setTimeout(()=>{ setTimeout(()=>{
var pieDom1 = document.getElementById(ElementId); // var myChart = echarts.init(Element);
var myChart = echarts.init(pieDom1);
option && myChart.setOption(option); option && myChart.setOption(option);
}, 200) }, 200)
}, },
@ -1003,7 +1074,7 @@ export default {
let that = this let that = this
const groups ="110|210|310"; const groups ="110|210|310";
// DAILY // DAILY
homeApi.allTygGroupTimeNum({granularity:"daily",groupsId:groups}).then(res=>{ homeApi.allTygGroupTimeNum({granularity:"daily",groupsId:groups}).then(res=>{
// 24h // 24h
that.daData = res.data.data; that.daData = res.data.data;
const tmpdata = res.data.data.allTimeData; const tmpdata = res.data.data.allTimeData;
@ -1018,15 +1089,6 @@ export default {
day_tmp.forEach(item=>{ day_tmp.forEach(item=>{
that.todayNum =+ item.noRepeatInNum that.todayNum =+ item.noRepeatInNum
}); });
//
// if(day_tmp.length>0){
// that.cgp_1 = day_tmp[0].proportion
// that.cgn_1 = day_tmp[0].groupName
// that.cgp_2 = day_tmp[1].proportion
// that.cgn_2 = day_tmp[1].groupName
// that.cgp_3 = day_tmp[2].proportion
// that.cgn_3 = day_tmp[2].groupName
// }
}) })
// MONTHLY // MONTHLY
@ -1074,6 +1136,7 @@ export default {
idArr += "|"+item.groupId; idArr += "|"+item.groupId;
} }
}) })
that.groupsData = [];
homeApi.homeBarData({groupsId:idArr}).then(res=>{ homeApi.homeBarData({groupsId:idArr}).then(res=>{
// console.log(res, '====='); // console.log(res, '=====');
res.data.data.groupsData.forEach(item=>{ res.data.data.groupsData.forEach(item=>{
@ -2142,7 +2205,8 @@ export default {
width: calc(24rem - 1.14rem) !important; width: calc(24rem - 1.14rem) !important;
height: 10.71rem !important; height: 10.71rem !important;
overflow: visible !important; overflow: visible !important;
margin: 0px 0.57rem 0px 0.57rem !important; // margin: 0px 0.57rem 0px 0.57rem !important;
margin: 0px auto !important;
box-sizing: border-box !important; box-sizing: border-box !important;
// transform-origin: center top !important; // transform-origin: center top !important;
transform: scale(1) !important; transform: scale(1) !important;

Loading…
Cancel
Save