派生自 wuyushui/SewerAndRainNetwork

徐旺旺
2021-04-08 f150d37ee748e70379ec7bbca1c28e0013dce98d
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
<template>
    <div class="sewers-search" v-if="judgeVisible">
        <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 v-for="(item,index) in solidWasteTypeOptions" :key="index" :label="item.label+':'" size="mini"
                              class="search-panel-item">
                    <el-select style="width: 100%" v-model="form.pipelineType" @change="handlePipelineType"
                               :popper-class="'select-down'">
                        <el-option
                                v-for="item in solidWasteTypeOptions"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-radio-group v-model="form.type" class="levelOfRisk">
                    <el-radio  v-for="(item,index) in levelOfRisk" :label="item.value" :key="index"><span class="levelOfRisk-type">{{item.name}}</span></el-radio>
                </el-radio-group>
                <div class="rightButtonSearch">
                    <el-input  v-model="form.keyword" size="mini"  placeholder="在此输入关键字搜索"></el-input>
                    <el-button class="el-icon-search" @click="handleSearch"></el-button>
                </div>
            </el-form>
        </div>
        <el-scrollbar style="height:264px">
            <div class="environmental-risk-list" v-for="(item,index) in searchDataDisplay" :key="index" ><!-- v-for="(item,index) in list" :key="index" -->
                <i class="state"></i>
                <div>
                    <h3>###炼化部</h3>
                    <p>所属部门:<span>炼化部</span></p>
                    <p>风险级别:<span>三级</span></p>
                </div>
            </div>
        </el-scrollbar>
    </div>
</template>
 
<script>
 
import mapApi from '@/api/mapApi'
 
export default {
  name: 'SolidWasteSearch',
  props: ['title'],
  data () {
    return {
      levelOfRisk: [
        { name: '全部', value: '1' },
        { name: '正常', value: '2' },
        { name: '超标', value: '3' },
        { name: '异常', value: '4' },
        { name: '停产', value: '5' }
      ],
      judgeVisible: true,
      solidWasteTypeOptions: [{
        value: '1',
        label: '区域',
        options: [{
          value: '1',
          layerName: '固废',
          key: 'pipename',
          label: '全部固废'
        }],
        labelList: [{
          label: '输送介质',
          key: 'mediumtype'
        }, {
          label: '长度(m)',
          key: 'length'
        }]
      }, {
        value: '2',
        label: '企业名称',
        options: [{
          value: '1',
          layerName: '固废',
          key: 'pipename',
          label: '全部固废'
        }],
        labelList: [{
          label: '输送介质',
          key: 'mediumtype'
        }, {
          label: '长度(m)',
          key: 'length'
        }]
      }, {
        value: '3',
        label: '二级单位',
        options: [{
          value: '1',
          layerName: '固废',
          key: 'pipename',
          label: '全部固废'
        }],
        labelList: [{
          label: '输送介质',
          key: 'mediumtype'
        }, {
          label: '长度(m)',
          key: 'length'
        }]
      }, {
        value: '4',
        label: '企业名称',
        options: [{
          value: '1',
          layerName: '固废',
          key: 'pipename',
          label: '全部固废'
        }],
        labelList: [{
          label: '输送介质',
          key: 'mediumtype'
        }, {
          label: '长度(m)',
          key: 'length'
        }]
      }],
      radio: '1',
      form: {
        keyword: '输入关键字'
      },
      searchDataDisplay: [],
      total: 0
    }
  },
  methods: {
    handlePipelineType (val) {
      this.solidWasteTypeOptions.forEach((itm) => {
        if (val === itm.value) {
          this.dataTypeOptions = itm.options
          this.form.pipelineType = itm.label
          this.form.labelList = itm.labelList
        }
      })
      this.form.dataType = this.dataTypeOptions[0].label
      this.form.key = this.dataTypeOptions[0].key
    },
    // 点击搜索实现数据的搜索展示
    async handleSearch () {
      // console.log(this.form.keyword)
      const result = await mapApi.getWasteWater()
      console.log(result)
      this.searchDataDisplay = result.Result.DataInfo
      this.total = result.Result.DataInfo.length
    },
    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)
    }
  }
}
</script>
 
<style lang="less" scoped>
 
</style>