|
@@ -168,6 +168,7 @@ export default {
|
|
|
},
|
|
|
data(){
|
|
|
return{
|
|
|
+ showSign: null,
|
|
|
charts: null,
|
|
|
childCharts: null,
|
|
|
childExCharts: null,
|
|
@@ -189,17 +190,17 @@ export default {
|
|
|
{ name: "吕梁市", appOrg: "1J001" }
|
|
|
],
|
|
|
points: [
|
|
|
- { name: "太原市", coordinate: [111.8493, 37.9570], appOrg: "1A003", x: "1", y: "2" },
|
|
|
- { name: "大同市", coordinate: [113.3002, 40.0768], appOrg: "1B001", x: "1", y: "2" },
|
|
|
- { name: "阳泉市", coordinate: [113.3805, 38.3563], appOrg: "1C001", x: "1", y: "2" },
|
|
|
- { name: "长治市", coordinate: [113.1163, 36.6254], appOrg: "1D001", x: "1", y: "2" },
|
|
|
- { name: "晋城市", coordinate: [112.2113, 35.4007], appOrg: "1E001", x: "1", y: "2" },
|
|
|
- { name: "朔州市", coordinate: [112.4329, 39.6312], appOrg: "1F001", x: "1", y: "2" },
|
|
|
+ { name: "太原市", coordinate: [111.9393, 37.7570], appOrg: "1A003", x: "1", y: "2" },
|
|
|
+ { name: "大同市", coordinate: [113.6802, 39.5768], appOrg: "1B001", x: "1", y: "2" },
|
|
|
+ { name: "阳泉市", coordinate: [113.583285, 37.861188], appOrg: "1C001", x: "1", y: "2" },
|
|
|
+ { name: "长治市", coordinate: [113.113556, 36.021112], appOrg: "1D001", x: "1", y: "2" },
|
|
|
+ { name: "晋城市", coordinate: [112.851274, 35.497553], appOrg: "1E001", x: "1", y: "2" },
|
|
|
+ { name: "朔州市", coordinate: [112.4029, 39.3812], appOrg: "1F001", x: "1", y: "2" },
|
|
|
{ name: "晋中市", coordinate: [113.3827, 37.1870], appOrg: "1K001", x: "1", y: "2" },
|
|
|
- { name: "临汾市", coordinate: [111.1286, 36.2582], appOrg: "1L001", x: "1", y: "2" },
|
|
|
- { name: "忻州市", coordinate: [111.7341, 38.7167], appOrg: "1H001", x: "1", y: "2" },
|
|
|
- { name: "运城市", coordinate: [111.0069, 35.4264], appOrg: "1M001", x: "1", y: "2" },
|
|
|
- { name: "吕梁市", coordinate: [111.1443, 37.1183], appOrg: "1J001", x: "1", y: "2" }
|
|
|
+ { name: "临汾市", coordinate: [111.517973, 36.08415], appOrg: "1L001", x: "1", y: "2" },
|
|
|
+ { name: "忻州市", coordinate: [112.703538, 38.43769], appOrg: "1H001", x: "1", y: "2" },
|
|
|
+ { name: "运城市", coordinate: [111.003957, 35.022778], appOrg: "1M001", x: "1", y: "2" },
|
|
|
+ { name: "吕梁市", coordinate: [111.134335, 37.524366], appOrg: "1J001", x: "1", y: "2" }
|
|
|
],
|
|
|
appOrg: "10001",
|
|
|
showBack: false,
|
|
@@ -351,10 +352,12 @@ export default {
|
|
|
methods: {
|
|
|
getProject(appOrg){
|
|
|
this.projectList = []
|
|
|
+ this.showSign = true
|
|
|
if (!appOrg) {
|
|
|
this.setChartsOption(this.projectList)
|
|
|
}
|
|
|
else {
|
|
|
+ this.showSign = false
|
|
|
getProjectByAppOrg(appOrg).then((res) => {
|
|
|
if (Number(res.code) === 200) {
|
|
|
for (let it of res.data){
|
|
@@ -377,11 +380,14 @@ export default {
|
|
|
setChartsOption(projectList){
|
|
|
if (this.charts){
|
|
|
this.charts.setOption({
|
|
|
- series: [{ name: 'prj', type: 'scatter', data: projectList.map(({ name, coordinate }) => ({
|
|
|
- name, // 点名称
|
|
|
- value: coordinate // 经纬度坐标
|
|
|
- }))
|
|
|
- }]
|
|
|
+ series: [
|
|
|
+ { name: 'prj', type: 'scatter', data: projectList.map(({ name, coordinate }) => ({
|
|
|
+ name, // 点名称
|
|
|
+ value: coordinate // 经纬度坐标
|
|
|
+ }))
|
|
|
+ },
|
|
|
+ { name: 'master', type: 'scatter', label:{show: this.showSign} }
|
|
|
+ ]
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -471,26 +477,34 @@ export default {
|
|
|
{
|
|
|
type: "scatter", // 散点图(用于标注特殊位置)
|
|
|
coordinateSystem: "geo", // 使用 `geo` 作为坐标系
|
|
|
- symbol: "image://" + require("@/assets/zhang/myMap/projectPosition.png"), // 自定义标记(图片)
|
|
|
- symbolSize: [30, 20], // 标记大小(宽 30,高 20)
|
|
|
+ name: "master",
|
|
|
+ // symbol: "image://" + require("@/assets/zhang/myMap/blue.png"), // 自定义标记(图片)
|
|
|
+ // symbolSize: [25, 29], // 标记大小(宽 30,高 20)
|
|
|
+ itemStyle: {
|
|
|
+ color: 'rgba(0,0,0,0)' // 设置点为完全透明
|
|
|
+ },
|
|
|
label: {
|
|
|
show: true, // 直接显示数值
|
|
|
position: 'top',
|
|
|
formatter: (params) => // 格式化提示框内容
|
|
|
params.seriesType === "scatter"
|
|
|
- ? `{myStyle|在建:${params.data.x}}\n{myStyle|施工:${params.data.y}}`
|
|
|
+ ? `{myStyle|${params.data.x}}\n{myStyle|${params.data.y}}`
|
|
|
: params.name,
|
|
|
- rich:{
|
|
|
+ rich: {
|
|
|
myStyle: {
|
|
|
color: "#fff", // 文字颜色
|
|
|
- fontSize: 12, // 字体大小
|
|
|
- lineHeight: 18
|
|
|
+ fontSize: 15, // 字体大小
|
|
|
+ lineHeight: 19,
|
|
|
+ padding: [0, 0, 0, 25]
|
|
|
}
|
|
|
},
|
|
|
- borderColor: "rgba(56,236,250)", // 边框颜色
|
|
|
- backgroundColor: "#0E7884",
|
|
|
+ backgroundColor: {
|
|
|
+ image: require("@/assets/zhang/myMap/bg.png"), // 使用图片背景
|
|
|
+ },
|
|
|
+ width: 45,
|
|
|
+ height: 38,
|
|
|
borderWidth: 1,
|
|
|
- padding: [4, 5], // 文字内边距(可选)
|
|
|
+ padding: [4, 10, 3], // 文字内边距(可选)
|
|
|
borderRadius: 2, // 文字框圆角(可选)
|
|
|
},
|
|
|
data: this.points.map(({ name, coordinate, appOrg, x, y }) => ({
|
|
@@ -499,7 +513,7 @@ export default {
|
|
|
appOrg,
|
|
|
x, // 额外数据(在建项目数)
|
|
|
y, // 额外数据(施工项目数)
|
|
|
- })),
|
|
|
+ }))
|
|
|
},
|
|
|
|
|
|
{
|
|
@@ -515,7 +529,7 @@ export default {
|
|
|
type: "scatter", // 散点图(用于标注特殊位置)
|
|
|
coordinateSystem: "geo", // 使用 `geo` 作为坐标系
|
|
|
name: "center",
|
|
|
- symbol: "image://" + require("@/assets/images/build_icon.png"),
|
|
|
+ symbol: "image://" + require("@/assets/zhang/myMap/building.png"),
|
|
|
symbolSize: 40, // 标记的大小
|
|
|
data: [{
|
|
|
name: "山西省公司(本部)",
|