派生自 wuyushui/SewerAndRainNetwork

yangdelong
2021-05-26 3072da92f3c3f08b2ee0ca03ee4e74b12f545b0e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
<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>