From bfd90be7b80fa5391681530c62e3761742879fcf Mon Sep 17 00:00:00 2001
From: 陈泽平 <chenzeping>
Date: 星期日, 30 五月 2021 14:54:09 +0800
Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop
---
/dev/null | 36 ------------
src/components/LayerController/logic/GovernEquipment.js | 93 +++++++++++++++++++++++++++++++
dist.zip | 0
public/assets/images/map/governEquipment/govern_green.png | 0
src/conf/Constants.js | 8 +-
src/conf/layers/LayerEnvRisk.js | 8 +-
src/api/mapApi.js | 3 +
public/assets/governEquipment.json | 22 +++++++
8 files changed, 126 insertions(+), 44 deletions(-)
diff --git a/dist.zip b/dist.zip
new file mode 100644
index 0000000..1e1ad71
--- /dev/null
+++ b/dist.zip
Binary files differ
diff --git a/public/assets/governEquipment.json b/public/assets/governEquipment.json
new file mode 100644
index 0000000..17d1b68
--- /dev/null
+++ b/public/assets/governEquipment.json
@@ -0,0 +1,22 @@
+[
+ {
+ "no": 0,
+ "company": "鎵瓙鐭冲寲",
+ "plate": "鐐兼补鏉垮潡",
+ "unitName": "鑺崇儍鍘傘�佺偧娌瑰巶",
+ "governName": "纭:鍥炴敹娌荤悊璁炬柦",
+ "Longitude": 118.7936111111,
+ "Latitude": 32.2583305556,
+ "status": 1
+ },
+ {
+ "no": 1,
+ "company": "涓煩鐭冲寲",
+ "plate": "鐐兼补鏉垮潡",
+ "unitName": "鐐兼补浜岄儴",
+ "governName": "鍌寲瑁傚寲娌荤悊璁炬柦",
+ "Longitude": 114.44016,
+ "Latitude": 30.65305,
+ "status": 1
+ }
+]
diff --git a/public/assets/images/map/governEquipment/govern_green.png b/public/assets/images/map/governEquipment/govern_green.png
new file mode 100644
index 0000000..1b30b11
--- /dev/null
+++ b/public/assets/images/map/governEquipment/govern_green.png
Binary files differ
diff --git a/src/api/mapApi.js b/src/api/mapApi.js
index ae65d02..2897794 100644
--- a/src/api/mapApi.js
+++ b/src/api/mapApi.js
@@ -90,6 +90,9 @@
getSourcesPoll (data) {
return axios.get(mapUrl.getSourcesPoll, data)
},
+ getGovernEquipment (data) {
+ return axios.get('/assets/governEquipment.json', data)
+ },
getEnvironmentRisk (data) {
return axios.get('/assets/environmentRisk.json', data)
},
diff --git a/src/components/LayerController/logic/GovernEquipment.js b/src/components/LayerController/logic/GovernEquipment.js
new file mode 100644
index 0000000..f5f174f
--- /dev/null
+++ b/src/components/LayerController/logic/GovernEquipment.js
@@ -0,0 +1,93 @@
+/**
+ * 姹℃煋婧�
+ */
+// 淇℃伅缁勪欢
+const GovernEquipmentIndex = require('../../base-page/RiskSource/RiskSourceIndex.vue').default
+// 浣跨敤灏佽鏂规硶
+const AnimalService = require('../service/AnimalService').default
+// 璇锋眰鎺ュ彛鏁版嵁
+const mapApi = require('../../../api/mapApi').default
+// 鍏叡鏂规硶 panTo() 寮曠敤
+const { setPanTo } = require('../../../utils/utils')
+
+const governGreen = '/assets/images/map/governEquipment/govern_green.png'
+
+module.exports = function () {
+ /**
+ * 鍒濆鍖栧苟鍔犺浇鍥惧眰
+ * @param L leaflet瀵硅薄
+ */
+ this.init = async (layer, L) => {
+ this.animalService = new AnimalService({
+ L: L,
+ layer: layer
+ })
+ const data = await mapApi.getGovernEquipment()
+ for (let i = 0; i < data.length; i++) {
+ const postion = [data[i].Latitude, data[i].Longitude] // 鍧愭爣
+ const iconUrl = this.governIconUrl(data[i].status) // 娌荤悊璁炬柦鍥炬爣
+ const marker = L.marker(postion, {
+ totransferData: data[i],
+ icon: L.icon({
+ iconUrl: iconUrl,
+ iconSize: [30, 30],
+ iconAnchor: [15, 15]
+ })
+ })
+ layer.addLayer(marker)
+ }
+ }
+
+ /**
+ * 鎻愮ず绐�
+ * @param layer
+ * @returns {string}
+ */
+ this.bindTooltip = (layer) => {
+ return layer.options.totransferData.governName
+ }
+
+ /**
+ * 淇℃伅寮圭獥
+ * @param e
+ */
+ this.clickListener = (e) => {
+ // 鑴夊啿鏁堟灉
+ this.animalService.pulseEffect(e.latlng)
+ // 淇℃伅寮圭獥骞崇Щ
+ setPanTo(e.latlng, 200)
+ // 寮规鏍囬
+ const title = e.layer.options.totransferData.Name
+ window.$layer.open({
+ content: {
+ comp: GovernEquipmentIndex, // 缁勪欢
+ parent: this, // 鐖剁粍浠�
+ data: { // 浼犻�掔殑鍙傛暟
+ riskSourceId: e.layer.options.totransferData.no
+ }
+ },
+ title: title // 鏍囬
+ })
+ }
+
+ /**
+ * 娌荤悊璁炬柦鍥炬爣閰嶇疆
+ * @param t
+ * @returns {string}
+ */
+ this.governIconUrl = (t) => {
+ let iconUrl = null
+ switch (t) {
+ case 1:
+ iconUrl = governGreen
+ break
+ case 2:
+ iconUrl = ''
+ break
+ default:
+ iconUrl = ''
+ break
+ }
+ return iconUrl
+ }
+}
diff --git a/src/components/LayerController/logic/SourcesPollution.js b/src/components/LayerController/logic/SourcesPollution.js
deleted file mode 100644
index 27899ce..0000000
--- a/src/components/LayerController/logic/SourcesPollution.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 姹℃煋婧�
- * */
-
-// 璇锋眰鎺ュ彛鏁版嵁
-const mapApi = require('../../../api/mapApi').default
-// 浣跨敤灏佽鏂规硶
-const AnimalService = require('../service/AnimalService').default
-
-module.exports = function () {
- this.init = async (layer, L) => {
- this.animalService = new AnimalService({
- L: L,
- layer: layer
- })
- const result = await mapApi.getSourcesPoll()
- // console.log(result)
- const resultData = result.Result.DataInfo || []
- const polygon = L.polygon(resultData, { color: 'yellow' })
- polygon.addTo(layer)
- }
- this.bindTooltip = (layer) => {
- return 'layer'
- }
- this.click = () => {
- window.$layer.open({
- content: {
- content: 'Popup', // 缁勪欢
- data: { // 浼犻�掔殑鍙傛暟
- datas: 'popupDatas'
- }
- },
- title: ''
- })
- }
-}
diff --git a/src/conf/Constants.js b/src/conf/Constants.js
index 3abd745..af7e312 100644
--- a/src/conf/Constants.js
+++ b/src/conf/Constants.js
@@ -17,12 +17,12 @@
}
export const logicMapper = {
- wasteGasPfk: 'WasteGas.js',
- wasteWaterPfk: 'WasteWater.js',
- wasteSolidCcd: 'WasteSolid.js',
+ wasteGasPfk: 'WasteGas.js', // 搴熸皵
+ wasteWaterPfk: 'WasteWater.js', // 搴熸按
+ wasteSolidCcd: 'WasteSolid.js', // 鍥哄簾
sewersAreaGs: 'Company.js',
pipesegment: 'PipeLineAnimal.js',
- pollutionSources: 'SourcesPollution.js',
+ pollutionSourcesZlss: 'GovernEquipment.js', // 姹℃煋婧�-娌荤悊璁炬柦
envRiskChart: 'EnvironmentRisk.js', // 椋庨櫓缁熻鍥�
envRiskMajor: 'RiskSource.js', // 閲嶅ぇ椋庨櫓婧�
envRiskFirst: 'RiskSource.js', // 涓�绾ч闄╂簮
diff --git a/src/conf/layers/LayerEnvRisk.js b/src/conf/layers/LayerEnvRisk.js
index 1ca0e15..983fe54 100644
--- a/src/conf/layers/LayerEnvRisk.js
+++ b/src/conf/layers/LayerEnvRisk.js
@@ -26,7 +26,7 @@
name: '閲嶅ぇ椋庨櫓',
sname: '閲嶅ぇ椋庨櫓',
checked: false, // 榛樿閫変腑鐘舵��
- minZoom: 10,
+ // minZoom: 10,
color: 'red',
level: 0
},
@@ -36,7 +36,7 @@
sname: '涓�绾ч闄�',
checked: false, // 榛樿閫変腑鐘舵��
type: 0,
- minZoom: 10,
+ // minZoom: 10,
color: 'sandybrown',
level: 1
},
@@ -46,7 +46,7 @@
sname: '浜岀骇椋庨櫓',
checked: false,
type: 0,
- minZoom: 10,
+ // minZoom: 10,
color: 'yellow',
level: 2
},
@@ -56,7 +56,7 @@
sname: '涓夌骇椋庨櫓',
checked: false,
type: 0,
- minZoom: 10,
+ // minZoom: 10,
color: 'green',
level: 3
}
--
Gitblit v1.8.0