Commit 2f36a1bc authored by zhengke's avatar zhengke

修改地图

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