master
lion 3 years ago
parent 846e7648f2
commit 15d1502699

@ -0,0 +1,64 @@
// 定义一些常量
const x_PI = 3.14159265358979324 * 3000.0 / 180.0
const PI = 3.1415926535897932384626
const a = 6378245.0 // 卫星椭球坐标投影到平面地图坐标系的投影因子
const ee = 0.00669342162296594323 // 椭球的偏心率
/**
* GCJ02火星坐标系 转换为 WGS84 / 即谷歌高德转WGS84
* @param { Number } lng
* @param { Number } lat
*/
export function gcj02towgs84(lng, lat) {
if (outOfChina(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)
const mglat = lat + dlat
const mglng = lng + dlng
return [lng * 2 - mglng, lat * 2 - mglat]
}
}
/**
* 经度转换
* @param { Number } lng
* @param { Number } lat
*/
function transformlat(lng, lat) {
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
}
/**
* 纬度转换
* @param { Number } lng
* @param { Number } lat
*/
function transformlng(lng, lat) {
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
}
/**
* 判断是否在国内不在国内则不做偏移
* @param {*} lng
* @param {*} lat
*/
function outOfChina(lng, lat) {
return (lng < 72.004 || lng > 137.8347) || ((lat < 0.8293 || lat > 55.8271) || false)
}

@ -62,6 +62,9 @@ export default {
table: [],
};
},
created() {
console.log("path",this.$route.path)
},
methods: {
getToken,
show() {
@ -104,6 +107,16 @@ export default {
},
imports() {
// tab:1,2 12
let paths = this.$route.path;
let isBook = paths.split("_")[0]
console.log(isBook)
if(isBook=='/book'){
for(var k of this.tableList){
k.isBook = true
}
}
// return
imports({
table_name: this.tableName,
data: this.tableList
@ -113,9 +126,10 @@ export default {
type: 'success',
message: `成功导入${res.total}`
})
this.hidden();
this.$emit('refresh')
})
this.hidden();
this.$emit('refresh')
}
},
computed: {},

@ -7,17 +7,17 @@
import * as echarts from 'echarts';
import jtmap from './jtmap.json';
export default {
props:{
mapData:{
type:Array,
default:[]
}
export default {
props: {
mapData: {
type: Array,
default: []
}
},
data() {
return {
myChart: null,
hookToolTip: {},
hookToolTip: {},
// mapData:[]
}
},
@ -41,18 +41,23 @@
},
},
methods: {
showInfo(id) {
this.$router.push({path:"/record/personinfo",query:{id:id}})
showInfo(id) {
this.$router.push({
path: "/record/personinfo",
query: {
id: id
}
})
},
resetCharts() {
this.myChart.resize()
},
drawChart() {
let that = this
this.mapData.forEach((m,index)=>{
if(!m.coord){
m.coord = ['','']
}
let that = this
this.mapData.forEach((m, index) => {
if (!m.coord) {
m.coord = ['', '']
}
})
// domecharts
this.myChart = echarts.init(document.getElementById('chart'))
@ -70,75 +75,135 @@
if (!val.data) {
return
}
return '<div class="mapsshow' + val.data.id +'" style="cursor:pointer"><p>' + val.data.name + '</p><p style="color:red">查看详情</p><div>'
return '<div class="mapsshow' + val.data.id + '" style="cursor:pointer"><p>' + val.data.name +
'</p><p style="color:red">查看详情</p><div>'
}
},
series: [{
map: 'china',
type: 'map',
map: 'GX',
// aspectScale: 0.9,
roam: false,
geo: {
map: "GX",
roam: false, //
zoom: 1.23, //
label: {
show: true,
textStyle: {
color: '#fff',
fontSize: 12,
}
normal: {
show: false,
fontSize: "0",
color: "rgba(0,0,0,0.7)",
},
},
itemStyle: {
normal: {
borderColor: '#0AAEB0', // #0AAEB0
borderWidth: 1, // 线
borderType: 'solid', //
areaColor: '#2378f7', // #233F53
shadowBlur: 5, //
shadowColor: '#2378f7', // #233F53
shadowOffsetX: 5, // X
shadowOffsetY: 5, // Y
label: {
show: false, //
textStyle: {
color: '#fff',
fontSize: 12,
},
}
borderColor: "rgba(0, 0, 0, 0.2)",
},
//
emphasis: {
borderColor: '#fff', // #2378f7
borderWidth: '1',
areaColor: '#2378f7', // #233F53
label: {
show: false,
textStyle: {
color: '#fff',
fontSize: 14,
}
}
// areaColor: "#F3B329", //
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 20,
borderWidth: 0,
shadowColor: "rgba(0, 0, 0, 0.5)",
},
regions: [{
},
// data:this.dataList
regions: [
//
{
name: "开发区",
itemStyle: {
normal: {
areaColor: "#75bedc",
},
emphasis: {
areaColor: "#75bedc",
},
},
},
{
name: "指前镇",
itemStyle: {
normal: {
areaColor: "red",
areaColor: "#d7335a",
},
emphasis: {
areaColor: "red",
areaColor: "#d7335a",
},
},
}],
},
{
name: "朱林镇",
itemStyle: {
normal: {
areaColor: "#fc8251",
},
emphasis: {
areaColor: "#fc8251",
},
},
},
{
name: "直溪镇",
itemStyle: {
normal: {
areaColor:'#91cd77',
},
emphasis: {
areaColor:'#91cd77',
},
},
},
{
name: "薛埠镇",
itemStyle: {
normal: {
areaColor:'#ef6567',
},
emphasis: {
areaColor:'#ef6567',
},
},
},
{
name: "金城镇",
itemStyle: {
normal: {
areaColor:'#f9c956',
},
emphasis: {
areaColor:'#f9c956',
},
},
},
{
name: "儒林镇",
itemStyle: {
normal: {
areaColor:'#c968e1',
},
emphasis: {
areaColor:'#c968e1',
},
},
},
{
name: "尧塘镇",
itemStyle: {
normal: {
areaColor:'#00ffff',
},
emphasis: {
areaColor:'#00ffff',
},
},
},
effect: {
show: true,
shadowBlur: 10,
loop: true,
}
},
]
},
series: [{
name: "一户一档",
type: "map",
mapType: "china",
geoIndex: 0,
markPoint: {
symbol: 'image://' + require('@/assets/logo-mini.png'), //
symbolSize: [50, 40], //
@ -159,7 +224,7 @@
// coord
data: this.mapData
}
}]
}],
})
}

@ -47,11 +47,13 @@
getparameter
} from "@/api/system/dictionary";
import {
index
index,
save
} from "@/api/system/baseForm.js"
import {
Message
} from 'element-ui'
} from 'element-ui'
export default {
data() {
return {
@ -193,7 +195,8 @@
//
setMapMarker() {
var that = this
// console.log("123",m.longitude, m.latitude)
// console.log('456',gcj02towgs84(m.longitude, m.latitude))
that.map.remove(that.makerList)
that.makerList = []
// this.map.clearMap();
@ -354,30 +357,40 @@
// return
this.mapList = _data
var geocoder = null
let that = this
AMap.plugin("AMap.Geocoder", function() {
geocoder = new AMap.Geocoder({
city: '常州' // city adcode citycode
})
_nolng.map((k, index) => {
geocoder.getLocation(k.reside, function(status, result) {
if (status === 'complete' && result.info === 'OK') {
// result
k.longitude = result.geocodes[0].location.lng
k.latitude = result.geocodes[0].location.lat
}
if (index == _nolng.length - 1) {
that.mapList.push(..._nolng)
that.setMapMarker()
that.fullscreenLoading = false;
}
})
})
// for (let k of _nolng) {
let that = this
if(_nolng.length>0){
AMap.plugin("AMap.Geocoder", function() {
geocoder = new AMap.Geocoder({
city: '常州' // city adcode citycode
})
_nolng.map((k, index) => {
geocoder.getLocation(k.reside, function(status, result) {
if (status === 'complete' && result.info === 'OK') {
// result
k.longitude = result.geocodes[0].location.lng
k.latitude = result.geocodes[0].location.lat
save({
table_name: that.select.table_name,
...k
})
}
if (index == _nolng.length - 1) {
that.mapList.push(..._nolng)
that.setMapMarker()
that.fullscreenLoading = false;
}
})
})
// for (let k of _nolng) {
// }
})
}else{
that.setMapMarker()
that.fullscreenLoading = false;
}
// }
})
// setTimeout(function() {
// that.mapList.push(..._nolng)
// that.setMapMarker()

@ -132,8 +132,18 @@
for(var k of res.idcard_workflows_idcard_relation){
if(k.work_status=='通过'){
console.log(k)
workflows+=`<p>${k.created_at?.substring(0,10)}/${k.guanlianbiaoming}<p>`
//
if(k.guanlianbiao=='assists'){
workflows+=`<p>${k.created_at?.substring(0,10)}/${k.guanlianbiaoming}<p>`
workflows+=`<p>管理年限:${k.detail.guanlinianxian}<p>`
workflows+=`<p>辅具类别:${k.detail.sub_type}<p>`
workflows+=`<p>可申请补贴金额:${k.detail.apply_money}<p>`
workflows+=`<p>已申请补贴金额:${k.detail.get_money}<p>`
workflows+=`<p>结余金额:${k.detail.surplus_money}<p>`
}else{
workflows+=`<p>${k.created_at?.substring(0,10)}/${k.guanlianbiaoming}<p>`
}
}
}
}

Loading…
Cancel
Save