d964ab73 by renchao@pashanhoo.com

style:地图配置话

1 parent 4902817c
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-27 15:43:24
* @LastEditTime: 2023-04-03 13:41:12
-->
# 安装依赖
npm install
......@@ -30,6 +30,8 @@ npm install --registry=https://registry.npm.taobao.org
"THEME": "sb",
"CODE": "BDCJGPT", {"BDCSBPT":上报: "BDCJGPT":监管}
"SERVERAPI": "/bdcsjsb",
"AREARMAP": "hanzhong", // {"hanzhong","yushu"}
"AREARNAME": "汉中",// {汉中市,玉树}
"calcHeight": 200, {上报:160 监管:200}
"echartTextColor": "#FFFFFF", {上报:"#4A4A4A" 监管:"#FFFFFF"}
"MANAGEMENTAPI": "http://192.168.2.38:8090/management"
......
{
"TITLE": "汉中市数据上报系统",
"THEME": "sb",
"CODE": "BDCSBPT",
"THEME": "jg",
"CODE": "BDCJGPT",
"AREARMAP": "hanzhong",
"AREARNAME": "汉中市",
"SERVERAPI": "/bdcsjsb",
"calcHeight": 160,
"echartTextColor": "#4A4A4A",
......
This diff could not be displayed because it is too large.
......@@ -31,7 +31,8 @@ export default {
window.addEventListener("resize", () => {
this.key++;
});
this.getDistrictcode();
// 根据行政区代码匹配行政区
require(`@/common/map/${this.BASE_API.AREARMAP}.js`);
},
watch: {
cdata: {
......@@ -83,15 +84,12 @@ export default {
mapType: "", // 自定义扩展图表类型
top: "15%",
left: "10%",
map: "汉中市",
map: this.BASE_API.AREARNAME,
itemStyle: {
normal: {
//阴影
areaColor: "#5689FD",
// shadowColor: "#21371d",
borderWidth: 1,
// shadowOffsetX: 2,
// shadowOffsetY: 20,
},
},
}, {
......@@ -100,7 +98,7 @@ export default {
mapType: "", // 自定义扩展图表类型
top: "18%",
left: "10%",
map: "汉中市",
map: this.BASE_API.AREARNAME,
itemStyle: {
color: '#21371d',
areaColor: "#21371d",
......@@ -110,11 +108,6 @@ export default {
shadowBlur: 10,
shadowOffsetX: 0,
shadowOffsetY: -12,
// normal: {
// //阴影
// color:'#21371d',
// areaColor: "#21371d",
// },
},
emphasis: {
disabled: true
......@@ -125,19 +118,15 @@ export default {
type: "map",
aspectScale: 1, //长宽比
zoom: 1.1,
mapType: "汉中市", // 自定义扩展图表类型
mapType: this.BASE_API.AREARNAME, // 自定义扩展图表类型
top: "15%",
left: "10%",
itemStyle: {
normal: {
// areaColor: "rgba(19,54,162,.1)",
borderWidth: 1.6,
// shadowBlur: 2,
borderColor: "#9DFFFC",
// shadowColor: "#44f2fc",
},
emphasis: {
// itemStyle:{
// 地图区域的高亮颜色
areaColor: {
type: 'linear',
......@@ -158,7 +147,6 @@ export default {
shadowColor: '#000',
shadowBlur: 10,
shadowOffsetY: 4
// }
}
},
label: {
......@@ -177,41 +165,16 @@ export default {
},
},
},
// 选中区域颜色
// select:{
// itemStyle:{
// areaColor:'red'
// }
// },
data: newData,
},
],
};
// 重新选择区域
// this.handleMapRandomSelect();
},
immediate: true,
deep: true,
},
},
computed: {
...mapGetters(["sidebar", "dicData"]),
logoName () {
return (
this.dicData["sysCode"].filter((item) => { return item.DCODE == "areaMap" })
);
},
},
methods: {
// 根据行政区代码匹配行政区
getDistrictcode () {
this.mapjson = ""
if (this.logoName[0].DNAME) {
this.mapjson = this.logoName[0].DNAME;
require(`@/common/map/${this.mapjson}.js`);
}
},
// 开启定时器
startInterval () {
const _self = this;
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-04-03 13:40:18
-->
<template>
<Chart :cdata="cdata" />
</template>
......@@ -16,7 +21,6 @@ export default {
},
mounted () {
this.mapViews();
},
methods: {
async mapViews () {
......
......@@ -2,7 +2,7 @@
<div class="navbar-con">
<div class="navbar">
<div class="title">
{{ logoName[0] && logoName[0].DNAME }}
{{ BASE_API.TITLE }}
</div>
<div class="user">
欢迎进入系统 {{ userName }}
......@@ -29,12 +29,7 @@ export default {
sidebarRight,
},
computed: {
...mapGetters(["sidebar", "dicData", , "permission_routes", "userInfo"]),
logoName () {
return this.dicData['sysCode'] && this.dicData['sysCode'].filter(item =>
item.DCODE == "systemTitle"
)
},
...mapGetters(["userInfo"]),
userName () {
return this.userInfo ? this.userInfo.name : ""
}
......@@ -54,11 +49,10 @@ export default {
});
})
.catch((error) => {
// console.dir(error);
})
}
}
};
}
</script>
<style lang="scss" scoped>
.menubg {
......