From c42c548a635e7086f6cffc132625c5c7902b63b5 Mon Sep 17 00:00:00 2001
From: 陈泽平 <chenzeping>
Date: 星期六, 29 五月 2021 11:12:48 +0800
Subject: [PATCH] 企业应急-事件上报-定位修改
---
src/components/base-page/enterprise-emergency/discard/PipelineFile.vue | 10 +-
src/components/base-page/enterprise-emergency/events-reported/ReportLocationPoint.vue | 111 ++++++++++++++++++++++
src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue | 12 +-
src/components/base-page/enterprise-emergency/discard/PositionChange.vue | 3
src/components/base-page/enterprise-emergency/discard/ReportIncident.vue | 6
src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue | 21 +--
src/views/MapTemplate.vue | 2
src/components/base-page/enterprise-emergency/events-reported/EventsReported.vue | 14 +-
src/utils/utils.js | 2
src/components/base-page/enterprise-emergency/events-reported/ReportLocation.vue | 111 +---------------------
10 files changed, 148 insertions(+), 144 deletions(-)
diff --git a/src/components/base-page/enterprise-emergency/PipelineFile.vue b/src/components/base-page/enterprise-emergency/discard/PipelineFile.vue
similarity index 89%
rename from src/components/base-page/enterprise-emergency/PipelineFile.vue
rename to src/components/base-page/enterprise-emergency/discard/PipelineFile.vue
index dafd268..54ac0db 100644
--- a/src/components/base-page/enterprise-emergency/PipelineFile.vue
+++ b/src/components/base-page/enterprise-emergency/discard/PipelineFile.vue
@@ -6,7 +6,7 @@
<el-form-item label="绠$嚎鍚嶇О">
<el-input v-model="form.pipeName">
<el-button style="padding-right:10px;" slot="suffix" type="text">
- <img src="../../../../public/assets/images/map/emergency/search.png" alt="">
+ <img src="../../../../../public/assets/images/map/emergency/search.png" alt="">
</el-button>
</el-input>
</el-form-item>
@@ -15,7 +15,7 @@
<el-form-item label="绠℃缂栫爜">
<el-input v-model="form.pipeCode">
<el-button style="padding-right:10px;" slot="suffix" type="text">
- <img src="../../../../public/assets/images/map/emergency/search.png" alt="">
+ <img src="../../../../../public/assets/images/map/emergency/search.png" alt="">
</el-button>
</el-input>
</el-form-item>
@@ -45,9 +45,9 @@
</template>
<script>
-import eventBus from '../../../eventBus'
-import foldPng from '../../../../public/assets/images/map/emergency/fold.png'
-import filePng from '../../../../public/assets/images/map/emergency/file.png'
+import eventBus from '../../../../eventBus'
+import foldPng from '../../../../../public/assets/images/map/emergency/fold.png'
+import filePng from '../../../../../public/assets/images/map/emergency/file.png'
export default {
name: 'PipelineFile',
diff --git a/src/components/base-page/enterprise-emergency/PositionChange.vue b/src/components/base-page/enterprise-emergency/discard/PositionChange.vue
similarity index 99%
rename from src/components/base-page/enterprise-emergency/PositionChange.vue
rename to src/components/base-page/enterprise-emergency/discard/PositionChange.vue
index e45dd7d..c1cb2ca 100644
--- a/src/components/base-page/enterprise-emergency/PositionChange.vue
+++ b/src/components/base-page/enterprise-emergency/discard/PositionChange.vue
@@ -99,8 +99,7 @@
</template>
<script>
-import eventBus from '../../../eventBus'
-
+import eventBus from '../../../../eventBus'
export default {
name: 'PositionChange',
props: ['location'],
diff --git a/src/components/base-page/enterprise-emergency/ReportIncident.vue b/src/components/base-page/enterprise-emergency/discard/ReportIncident.vue
similarity index 98%
rename from src/components/base-page/enterprise-emergency/ReportIncident.vue
rename to src/components/base-page/enterprise-emergency/discard/ReportIncident.vue
index c4437be..2dbf167 100644
--- a/src/components/base-page/enterprise-emergency/ReportIncident.vue
+++ b/src/components/base-page/enterprise-emergency/discard/ReportIncident.vue
@@ -70,7 +70,7 @@
<!-- @click="locationInfo"></el-button>-->
<el-button style="padding-right:10px;" slot="suffix" type="text"
@click="locationInfo">
- <img src="../../../../public/assets/images/map/loc.png" alt="">
+ <img src="../../../../../public/assets/images/map/loc.png" alt="">
</el-button>
</el-input>
</el-form-item>
@@ -148,8 +148,8 @@
</div>
</template>
<script>
-import '../../../utils/dragBoxes'
-import eventBus from '../../../eventBus'
+import '../../../../utils/dragBoxes'
+import eventBus from '../../../../eventBus'
// 寮曞叆缁勪欢
import PositionChange from './PositionChange'
import PipelineFile from './PipelineFile'
diff --git a/src/components/base-page/enterprise-emergency/events-reported/EventsReported.vue b/src/components/base-page/enterprise-emergency/events-reported/EventsReported.vue
index b94555a..0c6335b 100644
--- a/src/components/base-page/enterprise-emergency/events-reported/EventsReported.vue
+++ b/src/components/base-page/enterprise-emergency/events-reported/EventsReported.vue
@@ -139,7 +139,7 @@
:modal="false"
v-dialogDrag
>
- <ReportLocation @locationClick="getlocaltionClick"></ReportLocation>
+ <ReportLocation></ReportLocation>
</el-dialog>
</div>
</template>
@@ -336,12 +336,12 @@
})
},
methods: {
- // 鎺ユ敹瀛愮粍浠朵紶閫掔殑鏁版嵁
- getlocaltionClick (val) {
- // console.log(val)
- this.ruleForm.positionOf = val.latPos + '-' + val.longPos
- this.dialogLocation = !this.dialogLocation
- },
+ // // 鎺ユ敹瀛愮粍浠朵紶閫掔殑鏁版嵁
+ // getlocaltionClick (val) {
+ // // console.log(val)
+ // this.ruleForm.positionOf = val.latPos + '-' + val.longPos
+ // this.dialogLocation = !this.dialogLocation
+ // },
// 娑堟伅鎺ㄩ�� 閫夋嫨鎺ㄩ�佺殑瀵硅薄
infoChange () {
if (this.ruleForm.beingPushed.indexOf('鐭俊鎺ㄩ��') > -1 || this.ruleForm.beingPushed.indexOf('鎵嬫満搴旂敤鎺ㄩ��') > -1) {
diff --git a/src/components/base-page/enterprise-emergency/events-reported/ReportLocation.vue b/src/components/base-page/enterprise-emergency/events-reported/ReportLocation.vue
index 084d73e..e42ad35 100644
--- a/src/components/base-page/enterprise-emergency/events-reported/ReportLocation.vue
+++ b/src/components/base-page/enterprise-emergency/events-reported/ReportLocation.vue
@@ -8,133 +8,34 @@
<ReportLocationSection></ReportLocationSection>
</el-tab-pane>
<el-tab-pane label="缁忕含搴﹀畾浣�" name="third">
- <el-row class="place-box">
- <div class="place-left">
- <el-form :model="LongLatPos" label-width="90px">
- <el-form-item label="缁忓害:">
- <el-input v-model="LongLatPos.longPos"></el-input>
- </el-form-item>
- <el-form-item label="绾害:">
- <el-input v-model="LongLatPos.latPos"></el-input>
- </el-form-item>
- </el-form>
- </div>
- <div class="place-right">
- <el-button type="primary" size="small" @click="mapPoints">鐐瑰嚮瀹氫綅</el-button>
- <el-button type="primary" size="small" @click="dataPoints">鏁版嵁瀹氫綅</el-button>
- </div>
- </el-row>
- <div class="place-bottom" style="text-align: center;margin: 5px">
- <el-button type="primary" @click="confirm">纭</el-button>
- </div>
+ <ReportLocationPoint></ReportLocationPoint>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
-// import eventBus from '../../../../eventBus'
+
// 绠℃瀹氫綅缁勪欢
import ReportLocationSection from './ReportLocationSection'
import ReportLocationSearch from './ReportLocationSearch'
-
-import { pulseEffect } from '../../../../utils/utils'
-
-import iconUrl from '../../../../../public/assets/images/map/loc.png'
+import ReportLocationPoint from './ReportLocationPoint'
export default {
name: 'ReportLocation',
components: {
ReportLocationSearch,
- ReportLocationSection
+ ReportLocationSection,
+ ReportLocationPoint
},
data () {
return {
// active tab鍒囨崲
- activeName: 'first',
- // 缁忕含搴﹀畾浣�
- LongLatPos: {
- longPos: '',
- latPos: ''
- }
- }
- },
- methods: {
- // 鐐瑰嚮瀹氫綅
- mapPoints () {
- window.map.on('click', (e) => {
- this.LongLatPos.longPos = parseFloat(e.latlng.lng).toFixed(6)
- this.LongLatPos.latPos = parseFloat(e.latlng.lat).toFixed(6)
- const as = [this.LongLatPos.latPos, this.LongLatPos.longPos]
- // console.log(as)
- window.map.setView(as, 17)
- pulseEffect(as)
- const marker = window.L.marker(as, {
- icon: window.L.icon({
- iconUrl: iconUrl,
- iconSize: [30, 30],
- iconAnchor: [15, 15]
- })
- })
- window.map.addLayer(marker)
- window.map.off('click')
- })
- },
- // 閫氳繃鏁版嵁瀹氫綅
- dataPoints () {
- const as = [this.LongLatPos.latPos, this.LongLatPos.longPos]
- // console.log(as)
- window.map.setView(as, 17)
- pulseEffect(as)
- const marker = window.L.marker(as, {
- icon: window.L.icon({
- iconUrl: iconUrl,
- iconSize: [30, 30],
- iconAnchor: [15, 15]
- })
- })
- window.map.addLayer(marker)
- this.LongLatPos.latPos = ''
- this.LongLatPos.longPos = ''
- },
- // 鐐瑰嚮纭鎸夐挳浜嬩欢
- confirm () {
- // 閫氳繃瀛愮粍浠跺悜鐖剁粍浠朵紶閫掓暟鎹�
- this.$emit('locationClick', this.LongLatPos)
- this.clickLocation = ''
- this.LongLatPos.longPos = ''
- this.LongLatPos.latPos = ''
+ activeName: 'first'
}
}
}
</script>
<style lang="less" scoped>
- .place-box {
- display: flex;
- align-items: center;
- justify-content: space-around;
- }
-
- .place {
- text-align: center;
-
- .place-top {
- display: flex;
- align-items: center;
- justify-content: space-around;
-
- .place-right {
- .el-button {
- margin: 15px;
- }
- }
- }
-
- .place-bottom {
- .el-button {
- /*margin: 15px;*/
- }
- }
- }
</style>
diff --git a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationPoint.vue b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationPoint.vue
new file mode 100644
index 0000000..091d523
--- /dev/null
+++ b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationPoint.vue
@@ -0,0 +1,111 @@
+<template>
+ <div class="location-lon-and-lat">
+ <el-row class="place-box">
+ <div class="place-left">
+ <el-form :model="LongLatPos" label-width="90px">
+ <el-form-item label="缁忓害:">
+ <el-input v-model="LongLatPos.longPos"></el-input>
+ </el-form-item>
+ <el-form-item label="绾害:">
+ <el-input v-model="LongLatPos.latPos"></el-input>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div class="place-right">
+ <el-button type="primary" size="small" @click="mapPoints">鐐瑰嚮瀹氫綅</el-button>
+ <el-button type="primary" size="small" @click="dataPoints">鏁版嵁瀹氫綅</el-button>
+ </div>
+ </el-row>
+ <div class="place-bottom" style="text-align: right;margin: 5px">
+ <el-button type="primary" @click="confirm">纭</el-button>
+ </div>
+ </div>
+</template>
+
+<script>
+import { pulseEffect } from '../../../../utils/utils'
+import iconUrl from '../../../../../public/assets/images/map/loc.png'
+import eventBus from '../../../../eventBus'
+
+export default {
+ name: 'ReportLocationPoint',
+ data () {
+ return {
+ // 缁忕含搴﹀畾浣�
+ LongLatPos: {
+ longPos: '',
+ latPos: ''
+ }
+ }
+ },
+ methods: {
+ // 鐐瑰嚮瀹氫綅
+ mapPoints () {
+ window.map.on('click', (e) => {
+ this.LongLatPos.longPos = parseFloat(e.latlng.lng).toFixed(6)
+ this.LongLatPos.latPos = parseFloat(e.latlng.lat).toFixed(6)
+ const as = [this.LongLatPos.latPos, this.LongLatPos.longPos]
+ // console.log(as)
+ window.map.setView(as, 17)
+ pulseEffect(as)
+ const marker = window.L.marker(as, {
+ icon: window.L.icon({
+ iconUrl: iconUrl,
+ iconSize: [30, 30],
+ iconAnchor: [15, 15]
+ })
+ })
+ window.map.addLayer(marker)
+ window.map.off('click')
+ })
+ },
+ // 閫氳繃鏁版嵁瀹氫綅
+ dataPoints () {
+ const as = [this.LongLatPos.latPos, this.LongLatPos.longPos]
+ // console.log(as)
+ window.map.setView(as, 17)
+ pulseEffect(as)
+ const marker = window.L.marker(as, {
+ icon: window.L.icon({
+ iconUrl: iconUrl,
+ iconSize: [30, 30],
+ iconAnchor: [15, 15]
+ })
+ })
+ window.map.addLayer(marker)
+ this.LongLatPos.latPos = ''
+ this.LongLatPos.longPos = ''
+ },
+ // 鐐瑰嚮纭鎸夐挳浜嬩欢
+ confirm () {
+ eventBus.$emit('location-setChange', true)
+ this.LongLatPos.longPos = ''
+ this.LongLatPos.latPos = ''
+ }
+ }
+}
+</script>
+
+<style lang="less" scoped>
+ .place-box {
+ display: flex;
+ align-items: center;
+ justify-content: space-around;
+ }
+
+ .place {
+ text-align: center;
+
+ .place-top {
+ display: flex;
+ align-items: center;
+ justify-content: space-around;
+
+ .place-right {
+ .el-button {
+ margin: 15px;
+ }
+ }
+ }
+ }
+</style>
diff --git a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue
index 33bf401..a96d691 100644
--- a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue
+++ b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue
@@ -18,8 +18,8 @@
<!-- </el-pagination>-->
</el-row>
</el-scrollbar>
- <el-row>
- <el-button type="primary" @click="confirm" style="text-align: right">纭</el-button>
+ <el-row style="text-align: right">
+ <el-button type="primary" @click="confirm">纭</el-button>
</el-row>
</div>
</template>
@@ -41,7 +41,7 @@
}
},
methods: {
- // 鑾峰緱鐒︾偣 杩涜瀹氫綅
+ // 鎼滅储瀹氫綅
focusLocation () {
// console.log(this.clickLocation)
// console.log(window.map.getZoom())
@@ -75,6 +75,7 @@
// }
// }
})
+ this.clickLocation = ''
},
// 鐐瑰嚮瀹氫綅
locationMapClick (val) {
@@ -108,10 +109,9 @@
},
// 鐐瑰嚮纭鎸夐挳浜嬩欢
confirm () {
- // 閫氳繃瀛愮粍浠跺悜鐖剁粍浠朵紶閫掓暟鎹�
- // this.$emit('locationClick', this.LongLatPos)
+ this.searchList = []
+ this.clickLocation = ''
eventBus.$emit('location-setChange', true)
- // console.log('鎼滅储瀹氫綅')
}
}
}
diff --git a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue
index 16b9c4d..3d6c07b 100644
--- a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue
+++ b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue
@@ -117,7 +117,7 @@
<el-table-column
show-overflow-tooltip
width="150"
- prop="properties.code"
+ prop="properties.pipecode"
label="缂栧彿">
</el-table-column>
<el-table-column
@@ -147,12 +147,9 @@
</template>
<script>
-
-// import { pulseEffect } from '../../../../utils/utils'
-// import mapApi from '../../../../api/mapApi'
+import { highlight, fitBounds } from '../../../helpers/LocateHelper'
import WfsHelper from '@components/helpers/WfsHelper'
import AjaxUtils from '@utils/AjaxUtils'
-import { fitBounds, highlight } from '../../../../components/helpers/LocateHelper'
import eventBus from '../../../../eventBus'
import { WMS_URL } from '../../../../conf/Constants'
@@ -208,10 +205,6 @@
const resAffFac = await AjaxUtils.GetDataAsynByUrl(this.wfsHelper.getUrl(), {})
console.log(resAffFac)
if (resAffFac instanceof Object && Object.prototype.hasOwnProperty.call(resAffFac, 'features')) {
- // console.log(resAffFac.features)
- // for (let i = 0; i < resAffFac.features.length; i++) {
- // console.log(resAffFac.features[i])
- // }
this.tableDataAffFac = resAffFac.features
}
this.wfsHelper = new WfsHelper()
@@ -273,7 +266,7 @@
EXCEPTIONS: 'application/vnd.ogc.se_inimage'
})
AjaxUtils.get4JsonDataByUrl(WMS_URL, wmsParams, (res) => {
- console.log(res)
+ // console.log(res)
for (let i = 0; i < res.data.features.length; i++) {
// console.log(res.data.features[i])
this.tableList.push(res.data.features[i])
@@ -289,8 +282,8 @@
// 鏁版嵁 閲嶆柊鑾峰彇 杩涜缃┖
this.tableList = []
this.tableListSection = []
- this.form.pipeName = ''
this.tableDataAffFac = []
+ this.form.pipeName = ''
this.form.sectionName = ''
this.form.affiliatedFacilities = ''
},
@@ -332,8 +325,8 @@
const wmsParams = Object.assign({
LAYERS: 'sewer:view_pipeline',
QUERY_LAYERS: 'sewer:view_pipeline',
- // LAYERS: 'pipeline_fs',
- // QUERY_LAYERS: 'pipeline_fs',
+ // LAYERS: 'sewer:pipeline_fs',
+ // QUERY_LAYERS: 'sewer:pipeline_fs',
WIDTH: size.x,
HEIGHT: size.y,
X: Math.round(point.x),
@@ -352,7 +345,7 @@
EXCEPTIONS: 'application/vnd.ogc.se_inimage'
})
AjaxUtils.get4JsonDataByUrl(WMS_URL, wmsParams, (res) => {
- // console.log(res)
+ console.log(res)
for (let i = 0; i < res.data.features.length; i++) {
this.tableDataAffFac.push(res.data.features[i])
}
diff --git a/src/utils/utils.js b/src/utils/utils.js
index c187b1c..d8d5e40 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -27,7 +27,7 @@
* 鑴夊啿鏁堟灉
*/
export function pulseEffect (xy) {
- let times = 1000
+ let times = 5
const colors = ['#00f100', '#ff0000']
// 鎻掍欢 鏁堟灉瀹炵幇
var pulsingIcon = window.L.icon.pulse({
diff --git a/src/views/MapTemplate.vue b/src/views/MapTemplate.vue
index cfd9a1c..632f8bf 100644
--- a/src/views/MapTemplate.vue
+++ b/src/views/MapTemplate.vue
@@ -40,7 +40,7 @@
// // 鍏叡灞曠ず鏁版嵁
// import PublicBounced from '@components/base-page/PublicBounced/PublicBounced'
import LayerFactory from '@components/LayerController/service/LayerFactory'
-import ReportIncident from '../components/base-page/enterprise-emergency/ReportIncident'
+import ReportIncident from '../components/base-page/enterprise-emergency/discard/ReportIncident'
import Emergency from '@components/emergency/index'
import MapManager from '../components/helpers/MapManager'
import Message from '@components/message/index'
--
Gitblit v1.8.0