Commit 2f36a1bc authored by zhengke's avatar zhengke

修改地图

parent 214d3fd4
......@@ -2,7 +2,7 @@
<div class="echarts" :style="{height:'110%',width:'110%'}">
<div :style="{height:'110%',width:'110%'}" ref="myEchart"></div>
<div v-if="isShow" v-for="(item, index) in points" :key="index" class="viittoHot" :style="{left:(item[0]-5)+'px',top:(item[1]-5)+'px'}"></div>
<div v-for="(item, subIndex) in ActivateList" :key="subIndex+50000" class="viittoActive" :style="{left:(item[0]-5)+'px',top:(item[1]-5)+'px'}"></div>
<div v-if="isShow2" v-for="(item, subIndex) in ActivateList" :key="subIndex+50000" class="viittoActive" :style="{left:(item[0]-5)+'px',top:(item[1]-5)+'px'}"></div>
</div>
</template>
<script>
......@@ -12,7 +12,7 @@ import "../../../../node_modules/echarts/map/js/china.js"; // 引入中国地图
import BMap from 'BMap';
export default {
name: "echarts",
props: ["userJson","dataArea","InActiveLen"],
props: ["userJson","dataArea"],
data() {
return {
chart: null,
......@@ -22,10 +22,10 @@ export default {
ActivateList:[],
myChart:{},
isShow:false,
isShow2:false,
};
},
mounted() {
console.log(this.InActiveLen,'InActiveLen');
this.bus.$on('addpoint',addTradeInfo=>{
this.addPoint(addTradeInfo)
})
......@@ -88,7 +88,11 @@ export default {
textStyle: {
color: "rgba(0,0,0,0.4)"
}
},
emphasis: {//对应的鼠标悬浮效果
show: false
}
},
itemStyle: {
normal: {
......@@ -97,16 +101,16 @@ export default {
borderWidth: 1, //省份的边框宽度
opacity: 0.8, //图形透明度
textStyle: {
show: false
color:"#242B46"
}
},
emphasis: {
areaColor: "rgb(60,180,207)", //高亮时候地图显示的颜色
areaColor: "#242B46", //高亮时候地图显示的颜色
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 20,
borderWidth: 0,
shadowColor: "rgb(60,180,207)"
borderWidth: 1,
opacity: 0.8,
borderColor: "#151A30"
}
}
},
......@@ -127,7 +131,6 @@ export default {
});
},
addPoint(param){
console.log(param);
let ad=param.address?param.address:param.city
var myGeo = new BMap.Geocoder();
var that=this
......@@ -141,13 +144,9 @@ export default {
}
}
})
console.log(that.points.length,'that.points.length');
console.log(that.InActiveLen,'that.points.length');
if(that.points.length==that.InActiveLen){
that.isShow=true;
console.log(that.points,'points');
}
setTimeout(()=>{
that.isShow=true;
}, 6000);
},
//获取活跃人数
ActivePoint(param){
......@@ -164,8 +163,10 @@ export default {
}
}
})
setTimeout(()=>{
that.isShow2=true;
}, 6000);
}
}
};
</script>
......
......@@ -415,15 +415,13 @@ export default {
num:1
}
},mounted() {
//this.loadSites();
//this.getCityByIp();
this.init();
setTimeout(() => {
this.connec();
}, 1000);
// setTimeout(() => {
// this.exChangeBoard();
// }, 300000);
setTimeout(() => {
this.exChangeBoard();
}, 300000);
},methods:{
//不同进度条不同颜色
customColorMethod(percentage) {
......@@ -441,8 +439,8 @@ export default {
// }
},
init(){
//let url='http://47.96.23.199:5000/api/user/get_b2b_data'
let url = 'http://192.168.2.16:5001/api/user/get_b2b_data'
let url='http://47.96.23.199:5000/api/user/get_b2b_data'
//let url = 'http://192.168.2.16:5001/api/user/get_b2b_data'
let msg={
tdsourcetag:'s_pcqq_aiomsg'
}
......@@ -490,8 +488,8 @@ export default {
},
//切换统计看板
exChangeBoard(){
//window.location="http://data.oytour.com/#/viittoData2"
window.location="http://192.168.0.112:8080/#/viittoData2"
window.location="http://data.oytour.com/#/viittoData2"
//window.location="http://192.168.0.112:8080/#/viittoData2"
}
}
}
......
......@@ -288,7 +288,7 @@
<div class="ditu2">客户统计</div>
</div>
<div class="map-box" style="position:relative;left:-90px;top:-80px;z-index:1;">
<centerMp :InActiveLen="InActiveLen"></centerMp>
<centerMp></centerMp>
</div>
<el-row class="tonghangshu">
<el-col :span="12">
......@@ -351,9 +351,7 @@ export default {
//活跃用户的名称
ActiveDataName:[],
//活跃用户的数据
ActiveData:[],
//不活跃数组长度
InActiveLen:0,
ActiveData:[]
};
},
mounted() {
......@@ -362,9 +360,9 @@ export default {
setTimeout(() => {
this.connec();
}, 1000);
// setTimeout(() => {
// this.exChangeBoard();
// }, 300000);
setTimeout(() => {
this.exChangeBoard();
}, 300000);
},
methods: {
getdata(){
......@@ -512,8 +510,8 @@ export default {
},
//切换统计看板
exChangeBoard(){
// window.location="http://data.oytour.com/#/viittoData"
window.location="http://192.168.0.112:8080/#/viittoData"
window.location="http://data.oytour.com/#/viittoData"
//window.location="http://192.168.0.112:8080/#/viittoData"
},
//获取地址、
getB2BAddress(){
......@@ -524,24 +522,20 @@ export default {
var result = [];
var obj = {};
for(var i =0; i<InActiveList.length; i++){
if(!obj[InActiveList[i].Province]){
if(!obj[InActiveList[i].District]){
result.push(InActiveList[i]);
obj[InActiveList[i].Province] = true;
obj[InActiveList[i].District] = true;
}
}
//活动的
var resultActive = [];
var obj2 = {};
for(var i =0; i<ActivateList.length; i++){
if(!obj2[ActivateList[i].Province]){
if(!obj2[ActivateList[i].District]){
resultActive.push(ActivateList[i]);
obj2[ActivateList[i].Province] = true;
obj2[ActivateList[i].District] = true;
}
}
console.log(result,'不毁约');
this.InActiveLen = result.length;
console.log(this.InActiveLen,'钱');
console.log(resultActive,'去重后');
if(res.data.resultCode==1){
result.forEach(x=>{
this.bus.$emit("addpoint",{
......@@ -549,12 +543,12 @@ export default {
address:x.District
});
})
// resultActive.forEach(x=>{
// this.bus.$emit("addActivePoint",{
// city:x.City,
// address:x.District
// });
// })
resultActive.forEach(x=>{
this.bus.$emit("addActivePoint",{
city:x.City,
address:x.District
});
})
}else{
this.Error(res.data.message);
......
......@@ -7,8 +7,9 @@ module.exports = {
'views': '@/views',
}
},
externals: {
BMap: 'BMap'
}
externals: [
'BMap',
require('webpack-require-http')
]
},
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment