Merge branch 'main' of https://git.cityme.com.cn/xiangshan/ggfwjsc
This commit is contained in:
commit
2bff350d95
|
@ -0,0 +1,66 @@
|
||||||
|
var x_PI = 3.14159265358979324 * 3000.0 / 180.0;
|
||||||
|
var PI = 3.1415926535897932384626;
|
||||||
|
var a = 6378245.0;
|
||||||
|
var ee = 0.00669342162296594323;
|
||||||
|
function gcj02towgs84(lng, lat) {
|
||||||
|
var lat = +lat;
|
||||||
|
var lng = +lng;
|
||||||
|
if (out_of_china(lng, lat)) {
|
||||||
|
return [lng, lat]
|
||||||
|
} else {
|
||||||
|
var dlat = transformlat(lng - 105.0, lat - 35.0);
|
||||||
|
var dlng = transformlng(lng - 105.0, lat - 35.0);
|
||||||
|
var radlat = lat / 180.0 * PI;
|
||||||
|
var magic = Math.sin(radlat);
|
||||||
|
magic = 1 - ee * magic * magic;
|
||||||
|
var sqrtmagic = Math.sqrt(magic);
|
||||||
|
dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI);
|
||||||
|
dlng = (dlng * 180.0) / (a / sqrtmagic * Math.cos(radlat) * PI);
|
||||||
|
var mglat = lat + dlat;
|
||||||
|
var mglng = lng + dlng;
|
||||||
|
return [lng * 2 - mglng, lat * 2 - mglat]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
function out_of_china(lng, lat) {
|
||||||
|
var lat = +lat;
|
||||||
|
var lng = +lng;
|
||||||
|
// 纬度3.86~53.55,经度73.66~135.05
|
||||||
|
return !(lng > 73.66 && lng < 135.05 && lat > 3.86 && lat < 53.55);
|
||||||
|
};
|
||||||
|
function transformlat(lng, lat) {
|
||||||
|
var lat = +lat;
|
||||||
|
var lng = +lng;
|
||||||
|
var ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng));
|
||||||
|
ret += (20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0 / 3.0;
|
||||||
|
ret += (20.0 * Math.sin(lat * PI) + 40.0 * Math.sin(lat / 3.0 * PI)) * 2.0 / 3.0;
|
||||||
|
ret += (160.0 * Math.sin(lat / 12.0 * PI) + 320 * Math.sin(lat * PI / 30.0)) * 2.0 / 3.0;
|
||||||
|
return ret
|
||||||
|
};
|
||||||
|
function transformlng(lng, lat) {
|
||||||
|
var lat = +lat;
|
||||||
|
var lng = +lng;
|
||||||
|
var ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng));
|
||||||
|
ret += (20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0 / 3.0;
|
||||||
|
ret += (20.0 * Math.sin(lng * PI) + 40.0 * Math.sin(lng / 3.0 * PI)) * 2.0 / 3.0;
|
||||||
|
ret += (150.0 * Math.sin(lng / 12.0 * PI) + 300.0 * Math.sin(lng / 30.0 * PI)) * 2.0 / 3.0;
|
||||||
|
return ret
|
||||||
|
};
|
||||||
|
function latLng2WebMercator(lng, lat) {
|
||||||
|
var earthRad = 6378137.0;
|
||||||
|
var x = lng * Math.PI / 180 * earthRad;
|
||||||
|
var a = lat * Math.PI / 180;
|
||||||
|
var y = earthRad / 2 * Math.log((1.0 + Math.sin(a)) / (1.0 - Math.sin(a)));
|
||||||
|
return [x, y]; //[12727039.383734727, 3579066.6894065146]
|
||||||
|
}
|
||||||
|
function wgs84utmToGCJ02() {
|
||||||
|
var retransformX = document.getElementById("retransformX");
|
||||||
|
var retransformY = document.getElementById("retransformY");
|
||||||
|
var transformX = document.getElementById("transformX");
|
||||||
|
var transformY = document.getElementById("transformY");
|
||||||
|
var g84 = gcj02towgs84(Number(retransformX.value), Number(retransformY.value))
|
||||||
|
var mer = latLng2WebMercator(g84[0], g84[1])
|
||||||
|
transformX.value = mer[0];
|
||||||
|
transformY.value = mer[1];
|
||||||
|
|
||||||
|
}
|
||||||
|
export default gcj02towgs84;
|
|
@ -33,12 +33,12 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
list: [709, 3424, 2064, 2980, ,],
|
list: [],
|
||||||
unlist: [, , , 2980, 1790, 3100],
|
unlist: [],
|
||||||
list2: [1548, 5895, 2753, 4602, ,],
|
list2: [],
|
||||||
unlist2: [, , , 4602, 2030, 3900],
|
unlist2: [],
|
||||||
list3: [180, 930, 632, 780, ,],
|
list3: [],
|
||||||
unlist3: [, , , 780, 520, 600],
|
unlist3: [],
|
||||||
year: [],
|
year: [],
|
||||||
option: {},
|
option: {},
|
||||||
bg: [],
|
bg: [],
|
||||||
|
@ -47,11 +47,30 @@ const data = reactive({
|
||||||
const chart = ref(); // 创建DOM引用
|
const chart = ref(); // 创建DOM引用
|
||||||
const getOption = () => {
|
const getOption = () => {
|
||||||
data.option = {
|
data.option = {
|
||||||
// tooltip: {
|
tooltip: {
|
||||||
// trigger: "axis",
|
trigger: "axis",
|
||||||
// padding: [20, 10, 20, 10],
|
padding: [20, 10, 20, 10],
|
||||||
// formatter: "{b0}:</br>{a0}:{c0}</br>{a1}:{c1}</br>{a2}:{c2}",
|
formatter: function (params) {
|
||||||
// },
|
let result = "";
|
||||||
|
if (params[0].name <= data.year[2]) {
|
||||||
|
result = `${params[0].name}<br/>`;
|
||||||
|
} else {
|
||||||
|
result = `${params[0].name}预测数据<br/>`;
|
||||||
|
}
|
||||||
|
params.forEach(function (item, index) {
|
||||||
|
if (item.axisValue <= data.year[2]) {
|
||||||
|
if (index <= 2) {
|
||||||
|
result += `${item.seriesName}: ${item.value}<br/>`;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (index > 2) {
|
||||||
|
result += `${item.seriesName}: ${item.value}<br/>`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
},
|
||||||
legend: {
|
legend: {
|
||||||
data: ["0-18岁", "19-60岁", "60岁以上"],
|
data: ["0-18岁", "19-60岁", "60岁以上"],
|
||||||
top: "3%",
|
top: "3%",
|
||||||
|
@ -416,16 +435,56 @@ watch(
|
||||||
() => props.list,
|
() => props.list,
|
||||||
(newValue, oldValue) => {
|
(newValue, oldValue) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// data.list = props.list;
|
change()
|
||||||
// data.list2 = props.list2;
|
|
||||||
// data.list3 = props.list3;
|
|
||||||
data.year = props.year;
|
|
||||||
getOption();
|
getOption();
|
||||||
setChart();
|
setChart();
|
||||||
}, 600);
|
}, 600);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
const change = () => {
|
||||||
|
data.list.length=0;
|
||||||
|
data.list2.length=0;
|
||||||
|
data.list3.length=0;
|
||||||
|
data.unlist.length=0;
|
||||||
|
data.unlist2.length=0;
|
||||||
|
data.unlist3.length=0;
|
||||||
|
props.list.forEach((item, index) => {
|
||||||
|
if (index <= 2) {
|
||||||
|
data.list.push(item);
|
||||||
|
} else {
|
||||||
|
data.list.push("");
|
||||||
|
}
|
||||||
|
if (index >= 2) {
|
||||||
|
data.unlist.push(item);
|
||||||
|
} else {
|
||||||
|
data.unlist.push("");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
props.list2.forEach((item, index) => {
|
||||||
|
if (index <= 2) {
|
||||||
|
data.list2.push(item);
|
||||||
|
} else {
|
||||||
|
data.list2.push("");
|
||||||
|
}
|
||||||
|
if (index >= 2) {
|
||||||
|
data.unlist2.push(item);
|
||||||
|
} else {
|
||||||
|
data.unlist2.push("");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
props.list3.forEach((item, index) => {
|
||||||
|
if (index <= 2) {
|
||||||
|
data.list3.push(item);
|
||||||
|
} else {
|
||||||
|
data.list3.push("");
|
||||||
|
}
|
||||||
|
if (index >= 2) {
|
||||||
|
data.unlist3.push(item);
|
||||||
|
} else {
|
||||||
|
data.unlist3.push("");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
const setChart = () => {
|
const setChart = () => {
|
||||||
// Vue3中: 需要引入
|
// Vue3中: 需要引入
|
||||||
var myChart = echarts.init(chart.value);
|
var myChart = echarts.init(chart.value);
|
||||||
|
@ -433,12 +492,9 @@ const setChart = () => {
|
||||||
// 使用刚指定的配置项和数据显示图表。
|
// 使用刚指定的配置项和数据显示图表。
|
||||||
myChart.setOption(data.option);
|
myChart.setOption(data.option);
|
||||||
};
|
};
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// data.list = props.list;
|
change();
|
||||||
// data.list2 = props.list2;
|
|
||||||
// data.list3 = props.list3;
|
|
||||||
data.year = props.year;
|
data.year = props.year;
|
||||||
getOption();
|
getOption();
|
||||||
setChart();
|
setChart();
|
||||||
|
|
|
@ -154,6 +154,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="btns">
|
||||||
|
<div class="btnopen" @click="openEdit">编辑</div>
|
||||||
|
<div class="btnsave">保存</div>
|
||||||
|
<div class="btnclose" @click="closeEdit">取消</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Dialog
|
<Dialog
|
||||||
:dialogShow="dialogShow"
|
:dialogShow="dialogShow"
|
||||||
:columns="tableType.columns"
|
:columns="tableType.columns"
|
||||||
|
@ -255,6 +261,7 @@ import xcbg from "@/assets/images/map/xcbg.png";
|
||||||
import AED from "@/assets/images/map/AED.png";
|
import AED from "@/assets/images/map/AED.png";
|
||||||
import Dialog from "./dialog/dialogMapDp.vue";
|
import Dialog from "./dialog/dialogMapDp.vue";
|
||||||
import personDetail from "./person/index.vue";
|
import personDetail from "./person/index.vue";
|
||||||
|
import gcj02towgs84 from "@/utils/gcj02towgs84.js";
|
||||||
//--------定义参数-------
|
//--------定义参数-------
|
||||||
//加载
|
//加载
|
||||||
const loadingss = ref(false);
|
const loadingss = ref(false);
|
||||||
|
@ -796,6 +803,20 @@ const initMap = () => {
|
||||||
//添加街道名
|
//添加街道名
|
||||||
addJd();
|
addJd();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//开启编辑
|
||||||
|
const openEdit = () => {
|
||||||
|
console.log(cs_choose_arr.value[0]);
|
||||||
|
cs_choose_arr.value[0].enableEditing();
|
||||||
|
|
||||||
|
// let a=gcj02towgs84(13275212.822414309,3334688.527092757)
|
||||||
|
// console.log(a);
|
||||||
|
};
|
||||||
|
//关闭编辑
|
||||||
|
const closeEdit = () => {
|
||||||
|
cs_choose_arr.value[0].disableEditing();
|
||||||
|
console.log(cs_choose_arr.value[0]);
|
||||||
|
};
|
||||||
//点击龙游县初始化
|
//点击龙游县初始化
|
||||||
const csh = () => {
|
const csh = () => {
|
||||||
clear();
|
clear();
|
||||||
|
@ -2252,7 +2273,7 @@ const addPolygonCounty = () => {
|
||||||
map.clearOverlays();
|
map.clearOverlays();
|
||||||
let fillColor = "#ffffff";
|
let fillColor = "#ffffff";
|
||||||
mapTownDataDK.map((item) => {
|
mapTownDataDK.map((item) => {
|
||||||
item.leg = 0;
|
// item.leg = 0;
|
||||||
//地区的坐标范围
|
//地区的坐标范围
|
||||||
let points = [];
|
let points = [];
|
||||||
item.point.map((p) => points.push(new BMapGL.Point(...p)));
|
item.point.map((p) => points.push(new BMapGL.Point(...p)));
|
||||||
|
@ -2503,7 +2524,6 @@ const loadCs = (name) => {
|
||||||
};
|
};
|
||||||
//添加村社区块
|
//添加村社区块
|
||||||
const addPolygonCountyCs = () => {
|
const addPolygonCountyCs = () => {
|
||||||
// console.log(11111111111111, xkzDk);
|
|
||||||
xkzDk.map((item, index) => {
|
xkzDk.map((item, index) => {
|
||||||
let num = index % 9;
|
let num = index % 9;
|
||||||
let fillColor = colorList[num].bg;
|
let fillColor = colorList[num].bg;
|
||||||
|
@ -2985,7 +3005,7 @@ const reset_font2 = () => {
|
||||||
"scale(" + width / 1920 + "," + height / 1080 + ")";
|
"scale(" + width / 1920 + "," + height / 1080 + ")";
|
||||||
};
|
};
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// tools.data.set("token", "6b0e380b4a8f46baae4923f83faf670d");
|
tools.data.set("token", "6b0e380b4a8f46baae4923f83faf670d");
|
||||||
loadingss.value = true;
|
loadingss.value = true;
|
||||||
reset_font();
|
reset_font();
|
||||||
initMap();
|
initMap();
|
||||||
|
@ -3559,7 +3579,14 @@ onMounted(async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.btns {
|
||||||
|
z-index: 999;
|
||||||
|
position: absolute;
|
||||||
|
color: #ffffff;
|
||||||
|
top: 80px;
|
||||||
|
left: 600px;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
.title {
|
.title {
|
||||||
background-image: url(@/assets/images/map/map_title_bg.png);
|
background-image: url(@/assets/images/map/map_title_bg.png);
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
|
|
@ -15,8 +15,8 @@ export default defineConfig({
|
||||||
// 第一个代理
|
// 第一个代理
|
||||||
"/api": {
|
"/api": {
|
||||||
// 匹配到啥来进行方向代理
|
// 匹配到啥来进行方向代理
|
||||||
target: "http://10.0.0.65:8095/", //刘进
|
// target: "http://10.0.0.65:8095/", //刘进
|
||||||
// target: "http://220.191.238.50:996/", //线上
|
target: "http://220.191.238.50:996/", //线上
|
||||||
changeOrigin: true, //是否支持跨域
|
changeOrigin: true, //是否支持跨域
|
||||||
//rewrite: (path) => path.replace(/^\/api/, '') // 如果不需要api 直接把路径上的api 替换成空,这个
|
//rewrite: (path) => path.replace(/^\/api/, '') // 如果不需要api 直接把路径上的api 替换成空,这个
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue