From b2741ef779de49eaa244b668c280d2cd10598069 Mon Sep 17 00:00:00 2001
From: seatonwan9 <seatonwan9@163.com>
Date: 星期日, 30 五月 2021 20:23:47 +0800
Subject: [PATCH] 环境风险查询修改
---
src/components/panel/topicSearch/EnvRiskSearch.vue | 76 ++++++++------
src/components/LayerController/logic/GovernEquipment.js | 4
public/assets/company.json | 155 +++++++++++++++++++++++++++++++
src/api/mapApi.js | 6
public/assets/governEquipment.json | 28 +++-
src/api/mapUrl.js | 6 +
6 files changed, 228 insertions(+), 47 deletions(-)
diff --git a/public/assets/company.json b/public/assets/company.json
new file mode 100644
index 0000000..ee4120b
--- /dev/null
+++ b/public/assets/company.json
@@ -0,0 +1,155 @@
+{
+ "Result": {
+ "IsSuccess": 1,
+ "ErrorMsg": "",
+ "DataInfo": [
+ {
+ "name": "澶╂触鐭冲寲",
+ "companyId": 3900100145,
+ "type":1,
+ "Longitude": 117.422,
+ "Latitude": 38.831
+ },
+ {
+ "name": "涓婃捣鐭冲寲",
+ "companyId": 1400100201,
+ "type":1,
+ "Longitude": 121.056878,
+ "Latitude": 30.591937
+ },
+ {
+ "name": "閲戦櫟鐭冲寲",
+ "companyId": 1700101341,
+ "type":1,
+ "Longitude": 118.923724,
+ "Latitude": 32.163427
+ },
+ {
+ "name": "楂樻ˉ鐭冲寲",
+ "companyId": 1900100201,
+ "type":1,
+ "Longitude": 121.55639,
+ "Latitude": 31.33715
+ },
+ {
+ "name": "涔濇睙鐭冲寲",
+ "companyId": 2100100201,
+ "type":1,
+ "Longitude": 116.066971,
+ "Latitude": 29.740328
+ },
+ {
+ "name": "瀹夊簡鐭冲寲",
+ "companyId": 1800100201,
+ "type":1,
+ "Longitude": 117.022,
+ "Latitude": 30.5322
+ },
+ {
+ "name": "鑽嗛棬鐭冲寲",
+ "companyId": 2600100221,
+ "type":1,
+ "Longitude": 112.21625,
+ "Latitude": 31.01867
+ },
+ {
+ "name": "宸撮櫟鐭冲寲",
+ "companyId": 2400100204,
+ "type":1,
+ "Longitude": 113.151436,
+ "Latitude": 29.409209
+ },
+ {
+ "name": "涓煩鐭冲寲",
+ "companyId": 3100100201,
+ "type":1,
+ "Longitude": 114.442669,
+ "Latitude": 30.659068
+ },
+ {
+ "name": "鍗楀寲鍏徃",
+ "companyId": 2900100201,
+ "type":1,
+ "Longitude": 118.774384,
+ "Latitude": 32.224584
+ },
+ {
+ "name": "婀栧寳鍖栬偉",
+ "companyId": 3000100201,
+ "type":1,
+ "Longitude": 111.76934,
+ "Latitude": 30.434414
+ },
+ {
+ "name": "閲嶅簡宸濈淮",
+ "companyId": 3500100263,
+ "type":1,
+ "Longitude": 106.63,
+ "Latitude": 29.45
+ },
+ {
+ "name": "鎵瓙鐭冲寲",
+ "companyId": 4100100171,
+ "type":1,
+ "Longitude": 118.79333 ,
+ "Latitude": 32.2637
+ },
+ {
+ "name": "闀垮箔鐐煎寲",
+ "companyId": 4000100201,
+ "type":1,
+ "Longitude": 113.3648,
+ "Latitude": 29.5395
+ },
+ {
+ "name": "鍌寲鍓傚叕鍙�",
+ "companyId": 4500101097,
+ "type":1,
+ "Longitude": 113.34333,
+ "Latitude": 29.53667
+ },
+ {
+ "name": "姹熻嫃娌圭敯",
+ "companyId": 4400101560,
+ "type":2,
+ "Longitude": 119.53111,
+ "Latitude": 32.45861
+ },
+ {
+ "name": "浠緛鍖栫氦",
+ "companyId": 4500100201,
+ "type":1,
+ "Longitude": 119.142108,
+ "Latitude": 32.260143
+ },
+ {
+ "name": "涓師娌圭敯",
+ "companyId": 4400101614,
+ "type":2,
+ "Longitude": 107.733944,
+ "Latitude": 31.526666
+ },
+ {
+ "name": "涓婃捣璧涚",
+ "companyId": 18,
+ "type":1,
+ "Longitude": 121.41667,
+ "Latitude": 30.76667
+ },
+ {
+ "name": "姹熸眽娌圭敯",
+ "companyId": 4800102108,
+ "type":2,
+ "Longitude": 112.687783,
+ "Latitude": 30.451289
+ },
+ {
+ "name": "瑗垮崡娌规皵",
+ "companyId": 4800102118,
+ "type":2,
+ "Longitude": 104.079193,
+ "Latitude": 30.666026
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/public/assets/governEquipment.json b/public/assets/governEquipment.json
index 17d1b68..7e47157 100644
--- a/public/assets/governEquipment.json
+++ b/public/assets/governEquipment.json
@@ -1,22 +1,32 @@
[
{
"no": 0,
- "company": "鎵瓙鐭冲寲",
+ "company": "澶╂触鐭冲寲",
"plate": "鐐兼补鏉垮潡",
- "unitName": "鑺崇儍鍘傘�佺偧娌瑰巶",
+ "unitName": "鐑數閮�",
"governName": "纭:鍥炴敹娌荤悊璁炬柦",
- "Longitude": 118.7936111111,
- "Latitude": 32.2583305556,
+ "Longitude": 117.40307807922363,
+ "Latitude": 38.8203915264457,
"status": 1
},
{
"no": 1,
- "company": "涓煩鐭冲寲",
+ "company": "澶╂触鐭冲寲",
"plate": "鐐兼补鏉垮潡",
- "unitName": "鐐兼补浜岄儴",
- "governName": "鍌寲瑁傚寲娌荤悊璁炬柦",
- "Longitude": 114.44016,
- "Latitude": 30.65305,
+ "unitName": "鍖栧伐閮�",
+ "governName": "1#鍌寲瑁傚寲娌荤悊璁炬柦",
+ "Longitude": 117.42582321166992,
+ "Latitude": 38.833937724123906,
+ "status": 1
+ },
+ {
+ "no": 1,
+ "company": "澶╂触鐭冲寲",
+ "plate": "鐐兼补鏉垮潡",
+ "unitName": "鍖栧伐閮�",
+ "governName": "2#鍌寲瑁傚寲娌荤悊璁炬柦",
+ "Longitude": 117.41543769836426,
+ "Latitude": 38.830508306990176,
"status": 1
}
]
diff --git a/src/api/mapApi.js b/src/api/mapApi.js
index 9654615..6689828 100644
--- a/src/api/mapApi.js
+++ b/src/api/mapApi.js
@@ -66,7 +66,7 @@
return axios.get(mapUrl.getDataItems, data)
},
getCompany (data) {
- return axios.get(mapUrl.getCompany, data)
+ return axios.get('/assets/company.json', data)
},
DataItems (data) {
return axios.get(mapUrl.DataItems, data)
@@ -87,8 +87,8 @@
getCrossSection (data) {
return axios.get(mapUrl.getCrossSection, data)
},
- 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/api/mapUrl.js b/src/api/mapUrl.js
index 3b36f17..9c8905f 100644
--- a/src/api/mapUrl.js
+++ b/src/api/mapUrl.js
@@ -37,4 +37,8 @@
export const getCrossSection = $HOSTANALYSE + '/getCrossSection'
// 姹℃煋婧�
-export const getSourcesPoll = 'http://localhost:8080/static/SourcesPoll.json'
+export const getGovernEquipment = $HOST + '/assets/governEquipment.json' // 娌荤悊璁炬柦
+
+// 鐜椋庨櫓
+export const getEnvironmentRisk = $HOST + '/assets/environmentRisk.json' // 椋庨櫓缁熻鍥�
+export const getEnvironmentRiskPoint = $HOST + '/assets/environmentRiskPoint.json' // 椋庨櫓婧�
diff --git a/src/components/LayerController/logic/GovernEquipment.js b/src/components/LayerController/logic/GovernEquipment.js
index f5f174f..87e7223 100644
--- a/src/components/LayerController/logic/GovernEquipment.js
+++ b/src/components/LayerController/logic/GovernEquipment.js
@@ -30,8 +30,8 @@
totransferData: data[i],
icon: L.icon({
iconUrl: iconUrl,
- iconSize: [30, 30],
- iconAnchor: [15, 15]
+ iconSize: [20, 20],
+ iconAnchor: [10, 10]
})
})
layer.addLayer(marker)
diff --git a/src/components/panel/topicSearch/EnvRiskSearch.vue b/src/components/panel/topicSearch/EnvRiskSearch.vue
index a452a64..ae56021 100644
--- a/src/components/panel/topicSearch/EnvRiskSearch.vue
+++ b/src/components/panel/topicSearch/EnvRiskSearch.vue
@@ -3,7 +3,7 @@
<div class="panel-title">{{title}}</div>
<div class="search-panel ">
<el-form ref="form" :model="form" label-width="90px" class="search-form">
- <el-form-item label="鍖哄煙锛�" size="mini" class="search-panel-item">
+<!-- <el-form-item label="鍖哄煙锛�" size="mini" class="search-panel-item">
<el-select style="width: 100%" v-model="form.areaVal" @change="areaType" :popper-class="'select-down'">
<el-option
v-for="item in areaTypeOptions"
@@ -12,7 +12,7 @@
:value="item.value">
</el-option>
</el-select>
- </el-form-item>
+ </el-form-item>-->
<el-form-item label="浼佷笟鍚嶇О锛�" size="mini">
<el-select style="width: 100%" v-model="form.enterpriseVal" @change="enterpriseType" :popper-class="'select-down'">
<el-option
@@ -23,7 +23,7 @@
</el-option>
</el-select>
</el-form-item>
- <el-form-item label="浜岀骇鍗曚綅锛�" size="mini">
+ <el-form-item label="鍗曚綅閮ㄩ棬锛�" size="mini">
<el-select style="width: 100%" v-model="form.enterpriseSubunitsVal" @change="enterpriseSubunitsType" :popper-class="'select-down'">
<el-option
v-for="item in enterpriseSubunitsTypeOptions"
@@ -51,12 +51,12 @@
</el-form>
</div>
<el-scrollbar style="height:264px">
- <div class="environmental-risk-list" v-for="(item,index) in 5" :key="index" ><!-- v-for="(item,index) in list" :key="index" -->
- <i class="state"></i>
+ <div class="environmental-risk-list" v-for="(item,index) in list" :key="index"
+ @click="handleLocation(item)">
+ <img :src='iconUrl[item.riskLevel]' alt="" class="state"/>
<div>
- <h3>###鐐煎寲閮�</h3>
- <p>鎵�灞為儴闂細<span>鐐煎寲閮�</span></p>
- <p>椋庨櫓绾у埆锛�<span>涓夌骇</span></p>
+ <h3>{{ item.riskname }}</h3>
+ <p>鎵�灞為儴闂細<span>{{ item.unitname }}</span></p>
</div>
</div>
</el-scrollbar>
@@ -83,8 +83,11 @@
</template>
<script>
-import WfsHelper from '@components/helpers/WfsHelper'
-import AjaxUtils from '@utils/AjaxUtils'
+
+import { pulseEffect, setPanTo } from '@utils/utils'
+import RiskSourceIndex from '@components/base-page/RiskSource/RiskSourceIndex'
+const mapApi = require('../../../api/mapApi').default
+
export default {
name: 'EnvRiskSearch',
data () {
@@ -92,7 +95,7 @@
gdVisible: true,
list: [],
total: 0,
- inareaTypeOptions: [],
+ // inareaTypeOptions: [],
enterpriseTypeOptions: [],
enterpriseSubunitsTypeOptions: [],
form: {
@@ -101,8 +104,8 @@
enterpriseSubunitsVal: '',
type: ''
},
- // pageSize: 10,
- // current: 1,
+ pageSize: 10,
+ current: 1,
isWaybillHover: true,
isRouteHover: false,
levelOfRisk: [
@@ -111,19 +114,25 @@
{ name: '浜岀骇椋庨櫓', value: '3', color: 'yellow' },
{ name: '涓夌骇椋庨櫓', value: '4', color: 'green' }
],
- areaTypeOptions: []
+ areaTypeOptions: [],
+ iconUrl: ['',
+ require('../../../../public/assets/images/map/environmentRisk/risk_red.png'),
+ require('../../../../public/assets/images/map/environmentRisk/risk_sandybrown.png'),
+ require('../../../../public/assets/images/map/environmentRisk/risk_yellow.png'),
+ require('../../../../public/assets/images/map/environmentRisk/risk_green.png')
+ ]
}
},
props: ['title'],
methods: {
// 鍖哄煙绛涢��
- areaType (val) {
+ /* areaType (val) {
this.pipelineTypeOptions.forEach((itm) => {
if (val === itm.value) {
}
})
- },
+ }, */
// 浼佷笟绛涢��
enterpriseType (val) {
this.dataTypeOptions.forEach((itm) => {
@@ -136,27 +145,30 @@
enterpriseSubunitsType (val) {
},
+
async handleSearch () {
const param = {
- pipelineType: this.form.pipelineType,
- dataType: this.form.dataType
}
- console.log(param)
- var wfsHelper = new WfsHelper()
- wfsHelper.addTypeName(this.form.query.layerName)
- wfsHelper.addLike(this.form.query.key, this.form.keyword)
- // const _this = this
- const res = await AjaxUtils.GetDataAsynByUrl(wfsHelper.getUrl(), {})
- if (res.data instanceof Object && Object.prototype.hasOwnProperty.call(res.data, 'features')) {
- this.list = res.data.features
- }
+ const res = await mapApi.getEnvironmentRiskPoint(param)
+ this.list = res[0].concat(res[1], res[2], res[3]) // 涓存椂鏁版嵁
},
+
handleLocation (val) {
- console.log(val)
- const bound = this.L.geoJSON([val], {}).getBounds()
- var layer = window.serviceLayerHelper.getByLayerId(val.id)
- layer && layer.openPopup()
- this.$store.state.map.map.flyToBounds(bound)
+ const pos = [val.Latitude, val.Longitude]
+ debugger
+ window.map.setView(pos, 15)
+ window.$layer.open({
+ content: {
+ comp: RiskSourceIndex, // 缁勪欢
+ parent: this, // 鐖剁粍浠�
+ data: { // 浼犻�掔殑鍙傛暟
+ storagePlaceId: val.no
+ }
+ },
+ title: '澶╂触鐭冲寲' + val.riskname
+ })
+ pulseEffect([val.Latitude, val.Longitude])
+ setPanTo(pos, 250)
}
}
}
--
Gitblit v1.8.0