<template>
|
<div class="report-location-box">
|
<div class="report-location">
|
<el-tabs v-model="activeName">
|
<el-tab-pane label="点击定位" name="first">
|
<div class="click-location">
|
<el-row>
|
<el-input type="text" v-model="clickLocation" clearable @focus="focusLocation"></el-input>
|
</el-row>
|
<el-row>
|
<el-button type="primary" @click="confirm">确认</el-button>
|
</el-row>
|
</div>
|
</el-tab-pane>
|
<el-tab-pane label="管段定位" name="second">
|
<div class="place">
|
<div class="place-top">
|
<!-- <div class="place-left">-->
|
<el-form :model="linePos" label-width="90px">
|
<el-row class="elrow">
|
<el-col :span="16">
|
<!-- 管段编码-->
|
<el-form-item label="管线名称:">
|
<el-input v-model="linePos.lineName"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="8" style="vertical-align: middle !important;">
|
<el-button type="primary" size="mini" @click="fileChoose">...</el-button>
|
<el-button type="primary" size="mini" @click="tableAccod">搜索</el-button>
|
</el-col>
|
</el-row>
|
<el-form-item label="附属设施:">
|
<el-select v-model="linePos.affFac">
|
<el-option
|
v-for="item in linePos.affFacList"
|
:key="item.code"
|
:label="item.name"
|
:value="item.code">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-form>
|
</div>
|
<div class="place-bottom">
|
<el-button type="primary" @click="confirm">确认</el-button>
|
</div>
|
</div>
|
<div class="pipe-table" v-show="pipeTable">
|
<el-table
|
:data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)"
|
border
|
style="width: 100%">
|
<el-table-column
|
prop="number"
|
label="序号">
|
</el-table-column>
|
<el-table-column
|
prop="seares"
|
label="搜索结果">
|
</el-table-column>
|
<el-table-column
|
prop="restype"
|
label="结果类型">
|
</el-table-column>
|
</el-table>
|
<!-- <el-card class="footer-page" v-if="total >= 0">-->
|
<el-pagination
|
mini
|
@size-change="handleSizeChange"
|
@current-change="handlePage"
|
:page-size=pageSize
|
:current-page="currentPage"
|
layout="prev, pager, next"
|
:total=total
|
class="warnPagination"
|
>
|
</el-pagination>
|
<!-- </el-card>-->
|
</div>
|
</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" @click="mapPoints">定位</el-button>
|
</div>
|
</el-row>
|
<div class="place-bottom">
|
<el-button type="primary" @click="confirm">确认</el-button>
|
</div>
|
</el-tab-pane>
|
</el-tabs>
|
</div>
|
<el-dialog
|
custom-class="el-dialog--center"
|
:visible.sync="dialogFile"
|
:append-to-body="true"
|
:modal="false"
|
v-dialogDragBottom
|
>
|
<ReportFile></ReportFile>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import eventBus from '../../../eventBus'
|
import ReportFile from '../../../components/base-page/enterprise-emergency/ReportFile'
|
|
import { LayerFsss } from '../../../conf/layers/LayerFsss'
|
|
export default {
|
name: 'ReportLocation',
|
components: {
|
ReportFile
|
},
|
data () {
|
return {
|
dialogFile: false,
|
pipelineFile: false,
|
// active tab切换
|
activeName: 'first',
|
// 管段查询table
|
pipeTable: false,
|
// 分页功能
|
pageSize: 3,
|
total: 0,
|
currentPage: 1,
|
// 点击定位绑定数据
|
clickLocation: '',
|
// 经纬度定位
|
LongLatPos: {
|
longPos: '',
|
latPos: ''
|
},
|
// 管段定位
|
linePos: {
|
lineName: '',
|
affFac: '',
|
affFacList: LayerFsss.layers
|
},
|
tableData: [
|
{
|
number: 1,
|
seares: '20路雨水管线',
|
restype: '管线名称'
|
}, {
|
number: 2,
|
seares: '20路雨水管线',
|
restype: '管线名称'
|
}, {
|
number: 3,
|
seares: '100020',
|
restype: '管段编码'
|
},
|
{
|
number: 4,
|
seares: '20路雨水管线',
|
restype: '管线名称'
|
}, {
|
number: 5,
|
seares: '20路雨水管线',
|
restype: '管线名称'
|
}, {
|
number: 6,
|
seares: '100020',
|
restype: '管段编码'
|
}
|
]
|
}
|
},
|
mounted () {
|
// 接收规定 每次重新选择定位 都指定 选择第一个开始
|
eventBus.$on('tab-change', (obj) => {
|
this.activeName = obj
|
})
|
},
|
methods: {
|
// 地图上点击
|
selectPipeLine () {
|
window.map.on('click', this.selectClick)
|
// window.mapManager.clickDialogSwitch = false
|
},
|
// 地图上点击回调
|
selectClick (e) {
|
window.map.off('click', this.selectClick)
|
// const point = [e.latlng.lng, e.latlng.lat]
|
const pointX = e.latlng.lng
|
const pointY = e.latlng.lat
|
this.clickLocation = '\'' + pointX + '\'' + pointY + ''
|
this.mapPointResult(e)
|
},
|
mapPointResult (e) {
|
console.log(e)
|
this.LongLatPos.longPos = e.latlng.lng
|
this.LongLatPos.latPos = e.latlng.lat
|
},
|
// 获得焦点 进行定位
|
focusLocation () {
|
this.selectPipeLine()
|
},
|
// 经纬度定位
|
mapPoints () {
|
this.selectPipeLine()
|
},
|
// 分页功能 currentPage 改变时会触发
|
handlePage (val) {
|
// console.log(val)
|
this.currentPage = val
|
},
|
// 分页功能 pageSize 改变时会触发
|
handleSizeChange (val) {
|
// console.log(val)
|
this.pageSize = val
|
},
|
// 点击文件选择 显示第三级页面 进行管线/段选择
|
fileChoose () {
|
this.dialogFile = !this.dialogFile
|
},
|
// 点击确认按钮事件
|
confirm () {
|
// 通过子组件向父组件传递数据
|
this.$emit('locationClick', this.LongLatPos)
|
this.clickLocation = ''
|
this.LongLatPos.longPos = ''
|
this.LongLatPos.latPos = ''
|
},
|
// 管段查询表格展示
|
tableAccod () {
|
this.pipeTable = !this.pipeTable
|
}
|
}
|
}
|
</script>
|
|
<style lang="less" scoped>
|
|
/deep/ .el-dialog--center {
|
/*left: 2rem !important;*/
|
margin-left: 8rem !important;
|
margin-top: 0.13979rem !important;
|
}
|
|
/deep/ .el-dialog {
|
width: 20%;
|
}
|
|
.place-box {
|
display: flex;
|
align-items: center;
|
justify-content: space-around;
|
}
|
|
#pane-third {
|
text-align: center;
|
}
|
|
/*/deep/ .el-dialog .el-dialog__header {*/
|
/* display: none;*/
|
/*}*/
|
/deep/
|
.warnPagination {
|
.btn-quicknext, .btn-quickprev {
|
color: #e4e8f1 !important;
|
background-color: transparent;
|
// border: 1px solid #25AECD;
|
border-left: 1px solid #25AECD;
|
border-bottom: 1px solid #25AECD;
|
border-top: 1px solid #25AECD;
|
color: #e4e8f1;
|
}
|
|
.el-pager li {
|
color: #e4e8f1;
|
background: transparent;
|
// border: 1px solid #25AECD;
|
border-left: 1px solid #25AECD;
|
border-bottom: 1px solid #25AECD;
|
border-top: 1px solid #25AECD;
|
}
|
|
.el-pager li.active {
|
border-color: #25AECD;
|
background-color: rgba(38, 222, 253, 0.3);
|
color: #e4e8f1;
|
}
|
|
.el-pager li:hover {
|
border-color: #25AECD;
|
background-color: rgba(38, 222, 253, 0.3);
|
color: #34e0ff;
|
}
|
|
.btn-prev {
|
background-color: transparent;
|
// border: 1px solid #25AECD;
|
border-left: 1px solid #25AECD;
|
border-bottom: 1px solid #25AECD;
|
border-top: 1px solid #25AECD;
|
color: #e4e8f1;
|
}
|
|
.btn-next {
|
background-color: transparent;
|
border: 1px solid #25AECD;
|
color: #e4e8f1;
|
}
|
}
|
|
.elrow {
|
display: flex;
|
align-items: center;
|
justify-content: space-around;
|
}
|
|
.event-report-dialog {
|
min-width: 1.94532rem;
|
max-width: 1.94532rem;
|
}
|
|
.click-location {
|
margin: 0 auto;
|
text-align: center;
|
|
.el-input {
|
width: 80%;
|
margin: 15px auto;
|
}
|
|
.el-button {
|
margin: 15px auto;
|
}
|
}
|
|
.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>
|