派生自 wuyushui/SewerAndRainNetwork

徐旺旺
2021-05-30 a312e0dd96d8f7e96fb3341f1a55561b12394405
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
<template>
    <div class="side-box map-background" v-show="location">
        <el-tabs v-model="activeName">
            <el-tab-pane label="点击定位" name="first">
                <div class="click-location">
                    <el-input v-model="clickLocation"></el-input>
                    <el-button type="primary" @click="confirm">确认</el-button>
                </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.value"
                                            :label="item.label"
                                            :value="item.value">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-form>
                    </div>
                    <div class="place-bottom">
                        <el-button type="primary" @click="confirm">确认</el-button>
                    </div>
                </div>
            </el-tab-pane>
            <el-tab-pane label="经纬度定位" name="third">
                <div class="place">
                    <div class="place-top">
                        <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">搜索</el-button>
                        </div>
                    </div>
                    <div class="place-bottom">
                        <el-button type="primary" @click="confirm">确认</el-button>
                    </div>
                </div>
            </el-tab-pane>
        </el-tabs>
        <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>
    </div>
</template>
 
<script>
import eventBus from '../../../../eventBus'
export default {
  name: 'PositionChange',
  props: ['location'],
  data () {
    return {
      // 接收数据 控制页面展示/隐藏
      pipelineFile: false,
      // active tab切换
      activeName: 'first',
      // 管段查询table
      pipeTable: false,
      // 分页功能
      pageSize: 3,
      total: 0,
      currentPage: 1,
      // 点击定位绑定数据
      clickLocation: '',
      // 经纬度定位
      LongLatPos: {
        longPos: '',
        latPos: ''
      },
      // 管段定位
      linePos: {
        lineName: '',
        affFac: '',
        affFacList: [
          {
            label: '阀门A',
            value: '1'
          },
          {
            label: '阀门B',
            value: '2'
          }
        ]
      },
      fileChoChange: false,
      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: {
    // 分页功能 currentPage 改变时会触发
    handlePage (val) {
      // console.log(val)
      this.currentPage = val
    },
    // 分页功能 pageSize 改变时会触发
    handleSizeChange (val) {
      // console.log(val)
      this.pageSize = val
    },
    // 点击文件选择 显示第三级页面 进行管线/段选择
    fileChoose () {
      this.fileChoChange = !this.fileChoChange
      eventBus.$emit('pipelineFile-choose', this.fileChoChange)
    },
    // 点击确认按钮事件
    confirm () {
      // 子组件通过事件 传递数据 控制自身显示隐藏
      this.$emit('localCation', false)
      // 通过bus 控制三级附属弹框的隐藏
      eventBus.$emit('pipelineFile-choose', false)
    },
    // 管段查询表格展示
    tableAccod () {
      this.pipeTable = !this.pipeTable
    }
  }
}
</script>
 
<style lang="less" scoped>
    /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;
    }
 
    .side-box {
        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>