Commit 248c894b authored by yaqizhang's avatar yaqizhang

统计图首页地图切换

parent d1172cb1
...@@ -279,4 +279,104 @@ export default class Mutil { ...@@ -279,4 +279,104 @@ export default class Mutil {
that.MAP.removeInteraction(drawPoly); that.MAP.removeInteraction(drawPoly);
}) })
} }
tianSlA() {
this.MAP.getLayers().getArray()[0].setVisible(true);
this.MAP.getLayers().getArray()[1].setVisible(false);
this.MAP.getLayers().getArray()[2].setVisible(false);
};
tianSlB() {
console.log("gsfdgfdhgsgfhgfdhf")
this.MAP.getLayers().getArray()[0].setVisible(false);
this.MAP.getLayers().getArray()[1].setVisible(true);
this.MAP.getLayers().getArray()[2].setVisible(false);
};
tianSlC() {
this.MAP.getLayers().getArray()[0].setVisible(false);
this.MAP.getLayers().getArray()[1].setVisible(false);
this.MAP.getLayers().getArray()[2].setVisible(true);
}
drawArea(json) {
let pointsz = []; //存储点坐标
let points = json.points; //获取点坐标
//对获取的点坐标数据进行处理,重构,得到我们需要的数据结构
for (let i = 0; i < points.length; i++) {
let region = points[i].region; //单个面
let pointArr = region.split(',');
for (let j = 0; j < pointArr.length - 1; j++) {
let p = pointArr[j];
let pArr = p.split(' ');
let pos = fromLonLat(pArr); //将坐标转为默认投影,默认投影是EPSG:3857
let hdms = transform(pos, 'EPSG:3857', 'EPSG:4326'); //坐标系间坐标转换,由前面的坐标转为后面坐标系坐标
pointsz.push(pArr) //将转化格式后的点坐标存储起来
}
}
;
//自己造的地图数据(GeoJSON数据)
let geojsonObject = {
'type': 'FeatureCollection', //要素集合
'crs': {
'type': 'name',
'properties': { //特性
'name': 'EPSG:3857'
},
'features': [{ //要素
'type': 'Feature',
'geometry': { //几何图形
'type': 'GeometryCollection', //几何图形集合
'geometries': [{ //几何形状
'type': 'Polygon', //多边形
'coordinates': [pointsz] //坐标
}]
}
}]
}
};
let vectorSource = new VectorSource({ //提供矢量图层的数据
features: (new GeoJSON().readFeatures(geojsonObject))
});
let vectorLayer = new VectorLayer({
source: vectorSource, //来源
style: new Style({
stroke: new Stroke({
color: 'yellow',
width: 6
}),
fill: new Fill({
color: 'rgba(255,255,0,0.1)'
})
})
});
if (this.tempLayer != ' ') {
this.MAP.removeLayer(this.tempLayer);
}
this.MAP.addLayer(vectorLayer);
this.tempLayer = vectorLayer;
}
changeCenter(name) { //根据name传参
console.log("fdssffffffffffffffffffffffffffffffffffffffffffffffff")
//调取天地图返回的数据
let param = {};
param.serachWord = name;
param.serachType = '1'; //查询类型(0:根据code查询;1:根据名称)
param.needSunInfo = 'false' ; //是否需要下一级信息
param.needAll = 'false'; // 是否需要所有子节点(包括孙子节点)
param.needPolygon = 'true'; //是否需要行政区划范围
param.needPre = 'true'; //是否需要上一级所有信息
param.tk = 'd0cf74b31931aab68af181d23fa23d8d'; //自己的天地图秘钥
this.$axios.get('http://api.tianditu.gov.cn/administrative',param).then(res => {
console.log(res.data[0])
let resData = res.data[0];
let view = new View({
center: transfrom(fromLonLat([resData.lnt,resData.lat]),'EPSG:3857','EPSG:4326'), //将中心点坐标转为EPSG:4326
projection: get('EPSG:4326'), //投影坐标系 EPSG:4326
zoom: resData.level -1
});
this.MAP.setView(view);
this.drawArea(resData)
})
}
} }
...@@ -22,7 +22,6 @@ export default { ...@@ -22,7 +22,6 @@ export default {
MenuMg: "System", MenuMg: "System",
RoleMg: "System", RoleMg: "System",
UserMg: "System", UserMg: "System",
VideoList: "Video"
}, },
deleteFun(that: any, url: any, callback: any) { deleteFun(that: any, url: any, callback: any) {
(that as any) (that as any)
...@@ -55,4 +54,5 @@ export default { ...@@ -55,4 +54,5 @@ export default {
callback(res) callback(res)
}) })
}, },
} }
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div id="main1" style="width:500px;height:500px;"></div> <div id="main1" style="width:500px;height:500px;"></div>
</div> </div>
<div id="pie2" style="float:right;width:50%;height: 500px;"> <div id="pie2" style="float:right;width:50%;height: 500px;">
<div id="main2" style="width:600px;height:500px;"></div> <div id="main2" style="width:650px;height:500px;"></div>
</div> </div>
</div> </div>
</template> </template>
...@@ -37,16 +37,16 @@ export default { ...@@ -37,16 +37,16 @@ export default {
var getData2 = []; var getData2 = [];
METHOD.axiosGet( METHOD.axiosGet(
this, this,
`/enterpriseInfo/getNumberByRegulation`, `/enterpriseGoods/getNumberByEnterprise`,
function(res) { function(res) {
if (res.code === 0) { if (res.code === 0) {
//先进行赋值 //先进行赋值
for(let i=0; i<res.data.result.length; i++) { for(let i=0; i<res.data.result.length; i++) {
var obj = new Object(); var obj = new Object();
var arr = new Object(); var arr = new Object();
obj.name = res.data.result[i].type; obj.name = res.data.result[i].name;
obj.value = res.data.result[i].number; obj.value = res.data.result[i].number;
arr = res.data.result[i].type; arr = res.data.result[i].name;
getData1[i] = obj; getData1[i] = obj;
getData2[i] = arr; getData2[i] = arr;
} }
...@@ -64,8 +64,8 @@ export default { ...@@ -64,8 +64,8 @@ export default {
// 绘制图表 // 绘制图表
myChart1.setOption({ myChart1.setOption({
title : { title : {
text: '泽宏云',//主标题 text: '企业按监管分类统计',//主标题
subtext: '饼状图',//副标题 // subtext: '饼状图',//副标题
x:'center',//x轴方向对齐方式 x:'center',//x轴方向对齐方式
}, },
tooltip : { tooltip : {
...@@ -105,7 +105,7 @@ export default { ...@@ -105,7 +105,7 @@ export default {
var getData2 = []; var getData2 = [];
METHOD.axiosGet( METHOD.axiosGet(
this, this,
`/enterpriseGoods/getNumberByEnterprise`, `/enterpriseInfo/getNumberByRegulation`,
function(res) { function(res) {
if (res.code === 0) { if (res.code === 0) {
//先进行赋值 //先进行赋值
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
var obj = new Object(); var obj = new Object();
var arr = new Object(); var arr = new Object();
obj = res.data.result[i].number; obj = res.data.result[i].number;
arr = res.data.result[i].name; arr = res.data.result[i].type;
getData1[i] = obj; getData1[i] = obj;
getData2[i] = arr; getData2[i] = arr;
} }
...@@ -131,8 +131,8 @@ export default { ...@@ -131,8 +131,8 @@ export default {
myChart2.setOption({ myChart2.setOption({
// color:['rgb(8,252,7)','rgb(255,168,0)','rgb(0,121,254)','rgb(0,255,251)','rgb(3,120,251)','rgb(0,200,251)'], // color:['rgb(8,252,7)','rgb(255,168,0)','rgb(0,121,254)','rgb(0,255,251)','rgb(3,120,251)','rgb(0,200,251)'],
title: { title: {
text: '泽宏云',//主标题 text: '企业危险源数量统计',//主标题
subtext: '柱状图', // subtext: '柱状图',
}, },
tooltip: {}, tooltip: {},
legend: { legend: {
...@@ -168,9 +168,16 @@ export default { ...@@ -168,9 +168,16 @@ export default {
/* border:1px #000000 solid; */ /* border:1px #000000 solid; */
padding: 30px; padding: 30px;
} }
.el-main .el-tabs{ .el-main .el-tabs .el-tabs__content{
background-color: #f9f9f9; background-image: url(gif.gif);
background-repeat: no-repeat;
background-size: 100% 100%;
/* height: 100%; */
padding: 0px !important;
} }
/* .el-tabs__content .el-tab-pane .EnseList{
height: 100%;
} */
/* .pie #pie1 #main1{ /* .pie #pie1 #main1{
width:100%;height:500px; width:100%;height:500px;
} }
......
<template> <template>
<el-tabs v-model="activeName" type="border-card" > <el-tabs v-model="activeName" type="border-card" >
<el-tab-pane label="列表" name="first"> <el-tab-pane label="列表" name="first">
<div class="EnseList"> <div class="EnseList" style="height: 700px;background-color: #fff;padding: 20px;">
<el-row class="topBar"> <el-row class="topBar">
<el-col> <el-col>
<el-form :inline="true" :model="searchData"> <el-form :inline="true" :model="searchData">
...@@ -34,10 +34,10 @@ ...@@ -34,10 +34,10 @@
<el-table-column prop="legalPerson" label="企业法人"></el-table-column> <el-table-column prop="legalPerson" label="企业法人"></el-table-column>
<el-table-column prop="orgCode" label="组织机构代码"></el-table-column> <el-table-column prop="orgCode" label="组织机构代码"></el-table-column>
<el-table-column prop="legalPersonEmail" label="法人邮箱"></el-table-column> <el-table-column prop="legalPersonEmail" label="法人邮箱"></el-table-column>
<el-table-column prop="userName" label="管理员名称"></el-table-column> <el-table-column prop="" label="监管分类"></el-table-column>
<el-table-column prop="account" label="管理员账号"></el-table-column> <el-table-column prop="" label="危险源数量"></el-table-column>
<el-table-column prop="status" label="账号状态"> <el-table-column prop="" label="企业地址">
<template slot-scope="scope"> <!-- <template slot-scope="scope">
<font v-if="scope.row.accountStatus === '0'" class="colorM"> <font v-if="scope.row.accountStatus === '0'" class="colorM">
<i class="iconfont iconzhengchang"></i> 正常 <i class="iconfont iconzhengchang"></i> 正常
</font> </font>
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<font v-else-if="scope.row.accountStatus == 4" class="colorR"> <font v-else-if="scope.row.accountStatus == 4" class="colorR">
<i class="iconfont iconweitongguo"></i> 审核未通过 <i class="iconfont iconweitongguo"></i> 审核未通过
</font> </font>
</template> </template> -->
</el-table-column> </el-table-column>
<el-table-column label="操作" width="170"> <el-table-column label="操作" width="170">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -75,6 +75,29 @@ ...@@ -75,6 +75,29 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="图表" name="second"> <el-tab-pane label="图表" name="second">
<div style="width: 100%;height: 10em;">
<div class="el-tab-pane-div second-div" style="">
<div style="width: 40%;height: 100%; text-align: center;float: left;font-size: 15px;">
<img src="../../assets/logo2.png" width="25%" style="margin-top: 2rem;">
<p>危险源数量</p>
</div>
<div style="width: 60%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">12345</div>
</div>
<div class="el-tab-pane-div second-div" style="">
<div style="width: 40%;height: 100%; text-align: center;float: left;font-size: 15px;">
<img src="../../assets/logo2.png" width="25%" style="margin-top: 2rem;">
<p>注册企业数量</p>
</div>
<div style="width: 60%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">12345</div>
</div>
<div class="el-tab-pane-div second-div" style="">
<div style="width: 40%;height: 100%; text-align: center;float: left;font-size: 15px;">
<img src="../../assets/logo2.png" width="25%" style="margin-top: 2rem;">
<p>待审批数量</p>
</div>
<div style="width: 60%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">12345</div>
</div>
</div>
<Demo></Demo> <Demo></Demo>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -177,5 +200,32 @@ export default class EnterprisesMg extends Vue { ...@@ -177,5 +200,32 @@ export default class EnterprisesMg extends Vue {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/utils/public.scss"; @import "@/utils/public.scss";
.second-div{
margin-top: 20px;
width: 30%;
float: left;
margin-left: 2.5%;
height: 9rem;
color: #FFFFFF;
background-color: rgba(47, 96, 177, 0.1);
border-radius: 5px;
border: 2px solid rgb(22, 151, 207, 0.3);
box-shadow: 0 0 8px 8px rgba(131, 229, 255, 0.1)inset, 0 0 7px 7px rgba(22, 151, 207, 0.2);
}
main > div {
background: #ffffff;
height: calc(100vh - 120px);
padding: 0px !important;
}
main > div .el-table[data-v-350d47e5] {
min-height: calc(100% - 580px);
max-height: calc(100% - 120px);
height: auto;
}
main > div .el-table {
min-height: calc(100% - 180px) !important;
max-height: calc(100% - 120px) !important;
height: auto;
}
</style> </style>
\ No newline at end of file
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
<!-- <Search :MAP="MAP" :Mutil="Mutil" v-if="mapLoadDone"></Search> --> <!-- <Search :MAP="MAP" :Mutil="Mutil" v-if="mapLoadDone"></Search> -->
<!-- <DrawTool :MAP="MAP" v-if="mapLoadDone"></DrawTool> --> <!-- <DrawTool :MAP="MAP" v-if="mapLoadDone"></DrawTool> -->
<!-- <div style="width:200px;height:250px;" class="show-box" > --> <!-- <div style="width:200px;height:250px;" class="show-box" > -->
<button @click="Mutil.tianSlA()">切换1</button>
<button @click="Mutil.tianSlB()">切换2</button>
<button @click="Mutil.tianSlC()">切换3</button>
<dv-border-box-10 class="show-box" :color="['#4980b5','#4980b5']" backgroundColor="rgba(255, 255, 255, 0.5)" style="width:220px;height:280px;" > <dv-border-box-10 class="show-box" :color="['#4980b5','#4980b5']" backgroundColor="rgba(255, 255, 255, 0.5)" style="width:220px;height:280px;" >
<div class="markBox"> <div class="markBox">
<ul> <ul>
...@@ -31,6 +34,14 @@ ...@@ -31,6 +34,14 @@
<li><img width="10px" src="@/assets/mark/markqy.png" /> 企业图例</li> <li><img width="10px" src="@/assets/mark/markqy.png" /> 企业图例</li>
</ul> </ul>
</div> --> </div> -->
<!-- <div class="BoxWrap">
<div class="horn">
<div class="lt"></div>
<div class="rt"></div>
<div class="rb"></div>
<div class="lb"></div>
</div>
</div> -->
</div> </div>
</div> </div>
</template> </template>
...@@ -90,6 +101,8 @@ export default class GIS extends Vue { ...@@ -90,6 +101,8 @@ export default class GIS extends Vue {
@Provide() mouseTool: any; //测量工具 @Provide() mouseTool: any; //测量工具
@Provide() toolVisble: boolean = false; @Provide() toolVisble: boolean = false;
@Provide() tjNumberObj: any = {}; @Provide() tjNumberObj: any = {};
getMapData() { getMapData() {
let that = this; let that = this;
METHOD.axiosPost( METHOD.axiosPost(
...@@ -236,6 +249,7 @@ export default class GIS extends Vue { ...@@ -236,6 +249,7 @@ export default class GIS extends Vue {
} }
created() { created() {
this.getMapData(); this.getMapData();
} }
mounted() { mounted() {
let that = this; let that = this;
...@@ -246,7 +260,8 @@ export default class GIS extends Vue { ...@@ -246,7 +260,8 @@ export default class GIS extends Vue {
let id = evt.selected[0].get('did'); let id = evt.selected[0].get('did');
if (id) that.getPopcon(id); if (id) that.getPopcon(id);
}) })
this.getStatiData() this.getStatiData();
this.Mutil.changeCenter("石家庄");
} }
getStatiData() { getStatiData() {
let that = this; let that = this;
...@@ -276,12 +291,71 @@ export default class GIS extends Vue { ...@@ -276,12 +291,71 @@ export default class GIS extends Vue {
} }
); );
} }
// tianSlA() {
// console.log("dfsddddddddddddddddddddddddddddddddd")
// this.tianSlA.setVisible(true);
// this.tianSlB.setVisible(false);
// this.tianSlC.setVisible(false);
// };
// tianSlB() {
// console.log("gsfdgfdhgsgfhgfdhf")
// this.tianSlA.setVisible(false);
// this.tianSlB.setVisible(true);
// this.tianSlC.setVisible(false);
// };
// tianSlC() {
// this.tianSlA.setVisible(false)
// this.tianSlB.setVisible(false)
// this.tianSlC.setVisible(true)
// }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
@import "@/utils/public.scss"; @import "@/utils/public.scss";
/* // .BoxWrap{
// width: 200px;
// height: 200px;
// position: relative;
// }
// .horn{
// position: absolute;
// width: 100%;
// height: 100%;
// border:1px solid #00d3e7;
// }
// .horn>div{
// width: 10px;
// height: 10px;
// position:absolute;
// }
// .horn .lt{
// border-top: 3px solid #00d3e7;
// border-left: 3px solid #00d3e7;
// left: -2px;
// top: -2px;
// }
// .horn .rt{
// border-top: 3px solid #00d3e7;
// border-right: 3px solid #00d3e7;
// right: -2px;
// top: -2px;
// }
// .horn .rb{
// border-bottom:3px solid #00d3e7;
// border-right: 3px solid #00d3e7;
// right: -2px;
// bottom: -2px;
// }
// .horn .lb{
// border-bottom:3px solid #00d3e7;
// border-left: 3px solid #00d3e7;
// left: -2px;
// bottom: -2px;
// } */
#mapbox { #mapbox {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
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