Browse Source

优化数据字典加载及代码

luyanan 6 years ago
parent
commit
2f0d9a58c8

+ 0 - 10
src/api/bridge.js

79
    method: 'post'
79
    method: 'post'
80
  })
80
  })
81
}
81
}
82
83
export function dictory(params) {
84
  return request({
85
    url: '/ajax/dict/items',
86
    method: 'get',
87
    params: {
88
      dict: 'XZQH'
89
    }
90
  })
91
}

+ 0 - 34
src/api/numberDictionary.js

1
import request from '@/utils/request'
2
3
/*  主缆 */
4
export function mainCable() {
5
  return request({
6
    url: '/ajax/dict/items',
7
    method: 'get',
8
    params: {
9
      dict: 'ZLLX'
10
    }
11
  })
12
}
13
14
/*  位置 */
15
export function location() {
16
  return request({
17
    url: '/ajax/dict/items',
18
    method: 'get',
19
    params: {
20
      dict: 'ZLWZ'
21
    }
22
  })
23
}
24
25
/*  省市区 */
26
export function provinceCityDistrict() {
27
  return request({
28
    url: '/ajax/dict/items',
29
    method: 'get',
30
    params: {
31
      dict: 'XZQH'
32
    }
33
  })
34
}

+ 0 - 8
src/api/sensor.js

81
  })
81
  })
82
}
82
}
83
83
84
/*  数据字典 */
85
export function dictory(params) {
86
  return request({
87
    url: '/ajax/dict/items',
88
    method: 'get',
89
    params
90
  })
91
}

+ 0 - 152
src/components/Charts/keyboard.vue

1
<template>
2
  <div :class="className" :id="id" :style="{height:height,width:width}"></div>
3
</template>
4
5
<script>
6
import echarts from 'echarts'
7
import resize from './mixins/resize'
8
9
export default {
10
  mixins: [resize],
11
  props: {
12
    className: {
13
      type: String,
14
      default: 'chart'
15
    },
16
    id: {
17
      type: String,
18
      default: 'chart'
19
    },
20
    width: {
21
      type: String,
22
      default: '200px'
23
    },
24
    height: {
25
      type: String,
26
      default: '200px'
27
    }
28
  },
29
  data() {
30
    return {
31
      chart: null
32
    }
33
  },
34
  mounted() {
35
    this.initChart()
36
  },
37
  beforeDestroy() {
38
    if (!this.chart) {
39
      return
40
    }
41
    this.chart.dispose()
42
    this.chart = null
43
  },
44
  methods: {
45
    initChart() {
46
      this.chart = echarts.init(document.getElementById(this.id))
47
48
      const xAxisData = []
49
      const data = []
50
      const data2 = []
51
      for (let i = 0; i < 50; i++) {
52
        xAxisData.push(i)
53
        data.push((Math.sin(i / 5) * (i / 5 - 10) + i / 6) * 5)
54
        data2.push((Math.sin(i / 5) * (i / 5 + 10) + i / 6) * 3)
55
      }
56
      this.chart.setOption(
57
        {
58
          backgroundColor: '#08263a',
59
          xAxis: [{
60
            show: false,
61
            data: xAxisData
62
          }, {
63
            show: false,
64
            data: xAxisData
65
          }],
66
          visualMap: {
67
            show: false,
68
            min: 0,
69
            max: 50,
70
            dimension: 0,
71
            inRange: {
72
              color: ['#4a657a', '#308e92', '#b1cfa5', '#f5d69f', '#f5898b', '#ef5055']
73
            }
74
          },
75
          yAxis: {
76
            axisLine: {
77
              show: false
78
            },
79
            axisLabel: {
80
              textStyle: {
81
                color: '#4a657a'
82
              }
83
            },
84
            splitLine: {
85
              show: true,
86
              lineStyle: {
87
                color: '#08263f'
88
              }
89
            },
90
            axisTick: {
91
              show: false
92
            }
93
          },
94
          series: [{
95
            name: 'back',
96
            type: 'bar',
97
            data: data2,
98
            z: 1,
99
            itemStyle: {
100
              normal: {
101
                opacity: 0.4,
102
                barBorderRadius: 5,
103
                shadowBlur: 3,
104
                shadowColor: '#111'
105
              }
106
            }
107
          }, {
108
            name: 'Simulate Shadow',
109
            type: 'line',
110
            data,
111
            z: 2,
112
            showSymbol: false,
113
            animationDelay: 0,
114
            animationEasing: 'linear',
115
            animationDuration: 1200,
116
            lineStyle: {
117
              normal: {
118
                color: 'transparent'
119
              }
120
            },
121
            areaStyle: {
122
              normal: {
123
                color: '#08263a',
124
                shadowBlur: 50,
125
                shadowColor: '#000'
126
              }
127
            }
128
          }, {
129
            name: 'front',
130
            type: 'bar',
131
            data,
132
            xAxisIndex: 1,
133
            z: 3,
134
            itemStyle: {
135
              normal: {
136
                barBorderRadius: 5
137
              }
138
            }
139
          }],
140
          animationEasing: 'elasticOut',
141
          animationEasingUpdate: 'elasticOut',
142
          animationDelay(idx) {
143
            return idx * 20
144
          },
145
          animationDelayUpdate(idx) {
146
            return idx * 20
147
          }
148
        })
149
    }
150
  }
151
}
152
</script>

+ 0 - 227
src/components/Charts/lineMarker.vue

1
<template>
2
  <div :class="className" :id="id" :style="{height:height,width:width}"></div>
3
</template>
4
5
<script>
6
import echarts from 'echarts'
7
import resize from './mixins/resize'
8
9
export default {
10
  mixins: [resize],
11
  props: {
12
    className: {
13
      type: String,
14
      default: 'chart'
15
    },
16
    id: {
17
      type: String,
18
      default: 'chart'
19
    },
20
    width: {
21
      type: String,
22
      default: '200px'
23
    },
24
    height: {
25
      type: String,
26
      default: '200px'
27
    }
28
  },
29
  data() {
30
    return {
31
      chart: null
32
    }
33
  },
34
  mounted() {
35
    this.initChart()
36
  },
37
  beforeDestroy() {
38
    if (!this.chart) {
39
      return
40
    }
41
    this.chart.dispose()
42
    this.chart = null
43
  },
44
  methods: {
45
    initChart() {
46
      this.chart = echarts.init(document.getElementById(this.id))
47
48
      this.chart.setOption({
49
        backgroundColor: '#394056',
50
        title: {
51
          top: 20,
52
          text: 'Requests',
53
          textStyle: {
54
            fontWeight: 'normal',
55
            fontSize: 16,
56
            color: '#F1F1F3'
57
          },
58
          left: '1%'
59
        },
60
        tooltip: {
61
          trigger: 'axis',
62
          axisPointer: {
63
            lineStyle: {
64
              color: '#57617B'
65
            }
66
          }
67
        },
68
        legend: {
69
          top: 20,
70
          icon: 'rect',
71
          itemWidth: 14,
72
          itemHeight: 5,
73
          itemGap: 13,
74
          data: ['CMCC', 'CTCC', 'CUCC'],
75
          right: '4%',
76
          textStyle: {
77
            fontSize: 12,
78
            color: '#F1F1F3'
79
          }
80
        },
81
        grid: {
82
          top: 100,
83
          left: '3%',
84
          right: '4%',
85
          bottom: '2%',
86
          containLabel: true
87
        },
88
        xAxis: [{
89
          type: 'category',
90
          boundaryGap: false,
91
          axisLine: {
92
            lineStyle: {
93
              color: '#57617B'
94
            }
95
          },
96
          data: ['13:00', '13:05', '13:10', '13:15', '13:20', '13:25', '13:30', '13:35', '13:40', '13:45', '13:50', '13:55']
97
        }],
98
        yAxis: [{
99
          type: 'value',
100
          name: '(%)',
101
          axisTick: {
102
            show: false
103
          },
104
          axisLine: {
105
            lineStyle: {
106
              color: '#57617B'
107
            }
108
          },
109
          axisLabel: {
110
            margin: 10,
111
            textStyle: {
112
              fontSize: 14
113
            }
114
          },
115
          splitLine: {
116
            lineStyle: {
117
              color: '#57617B'
118
            }
119
          }
120
        }],
121
        series: [{
122
          name: 'CMCC',
123
          type: 'line',
124
          smooth: true,
125
          symbol: 'circle',
126
          symbolSize: 5,
127
          showSymbol: false,
128
          lineStyle: {
129
            normal: {
130
              width: 1
131
            }
132
          },
133
          areaStyle: {
134
            normal: {
135
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
136
                offset: 0,
137
                color: 'rgba(137, 189, 27, 0.3)'
138
              }, {
139
                offset: 0.8,
140
                color: 'rgba(137, 189, 27, 0)'
141
              }], false),
142
              shadowColor: 'rgba(0, 0, 0, 0.1)',
143
              shadowBlur: 10
144
            }
145
          },
146
          itemStyle: {
147
            normal: {
148
              color: 'rgb(137,189,27)',
149
              borderColor: 'rgba(137,189,2,0.27)',
150
              borderWidth: 12
151
152
            }
153
          },
154
          data: [220, 182, 191, 134, 150, 120, 110, 125, 145, 122, 165, 122]
155
        }, {
156
          name: 'CTCC',
157
          type: 'line',
158
          smooth: true,
159
          symbol: 'circle',
160
          symbolSize: 5,
161
          showSymbol: false,
162
          lineStyle: {
163
            normal: {
164
              width: 1
165
            }
166
          },
167
          areaStyle: {
168
            normal: {
169
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
170
                offset: 0,
171
                color: 'rgba(0, 136, 212, 0.3)'
172
              }, {
173
                offset: 0.8,
174
                color: 'rgba(0, 136, 212, 0)'
175
              }], false),
176
              shadowColor: 'rgba(0, 0, 0, 0.1)',
177
              shadowBlur: 10
178
            }
179
          },
180
          itemStyle: {
181
            normal: {
182
              color: 'rgb(0,136,212)',
183
              borderColor: 'rgba(0,136,212,0.2)',
184
              borderWidth: 12
185
186
            }
187
          },
188
          data: [120, 110, 125, 145, 122, 165, 122, 220, 182, 191, 134, 150]
189
        }, {
190
          name: 'CUCC',
191
          type: 'line',
192
          smooth: true,
193
          symbol: 'circle',
194
          symbolSize: 5,
195
          showSymbol: false,
196
          lineStyle: {
197
            normal: {
198
              width: 1
199
            }
200
          },
201
          areaStyle: {
202
            normal: {
203
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
204
                offset: 0,
205
                color: 'rgba(219, 50, 51, 0.3)'
206
              }, {
207
                offset: 0.8,
208
                color: 'rgba(219, 50, 51, 0)'
209
              }], false),
210
              shadowColor: 'rgba(0, 0, 0, 0.1)',
211
              shadowBlur: 10
212
            }
213
          },
214
          itemStyle: {
215
            normal: {
216
              color: 'rgb(219,50,51)',
217
              borderColor: 'rgba(219,50,51,0.2)',
218
              borderWidth: 12
219
            }
220
          },
221
          data: [220, 182, 125, 145, 122, 191, 134, 150, 120, 110, 165, 122]
222
        }]
223
      })
224
    }
225
  }
226
}
227
</script>

+ 0 - 269
src/components/Charts/mixChart.vue

1
<template>
2
  <div :class="className" :id="id" :style="{height:height,width:width}"></div>
3
</template>
4
5
<script>
6
import echarts from 'echarts'
7
import resize from './mixins/resize'
8
9
export default {
10
  mixins: [resize],
11
  props: {
12
    className: {
13
      type: String,
14
      default: 'chart'
15
    },
16
    id: {
17
      type: String,
18
      default: 'chart'
19
    },
20
    width: {
21
      type: String,
22
      default: '200px'
23
    },
24
    height: {
25
      type: String,
26
      default: '200px'
27
    }
28
  },
29
  data() {
30
    return {
31
      chart: null
32
    }
33
  },
34
  mounted() {
35
    this.initChart()
36
  },
37
  beforeDestroy() {
38
    if (!this.chart) {
39
      return
40
    }
41
    this.chart.dispose()
42
    this.chart = null
43
  },
44
  methods: {
45
    initChart() {
46
      this.chart = echarts.init(document.getElementById(this.id))
47
      const xData = (function() {
48
        const data = []
49
        for (let i = 1; i < 13; i++) {
50
          data.push(i + 'month')
51
        }
52
        return data
53
      }())
54
      this.chart.setOption({
55
        backgroundColor: '#344b58',
56
        title: {
57
          text: 'statistics',
58
          x: '20',
59
          top: '20',
60
          textStyle: {
61
            color: '#fff',
62
            fontSize: '22'
63
          },
64
          subtextStyle: {
65
            color: '#90979c',
66
            fontSize: '16'
67
          }
68
        },
69
        tooltip: {
70
          trigger: 'axis',
71
          axisPointer: {
72
            textStyle: {
73
              color: '#fff'
74
            }
75
          }
76
        },
77
        grid: {
78
          borderWidth: 0,
79
          top: 110,
80
          bottom: 95,
81
          textStyle: {
82
            color: '#fff'
83
          }
84
        },
85
        legend: {
86
          x: '5%',
87
          top: '10%',
88
          textStyle: {
89
            color: '#90979c'
90
          },
91
          data: ['female', 'male', 'average']
92
        },
93
        calculable: true,
94
        xAxis: [{
95
          type: 'category',
96
          axisLine: {
97
            lineStyle: {
98
              color: '#90979c'
99
            }
100
          },
101
          splitLine: {
102
            show: false
103
          },
104
          axisTick: {
105
            show: false
106
          },
107
          splitArea: {
108
            show: false
109
          },
110
          axisLabel: {
111
            interval: 0
112
113
          },
114
          data: xData
115
        }],
116
        yAxis: [{
117
          type: 'value',
118
          splitLine: {
119
            show: false
120
          },
121
          axisLine: {
122
            lineStyle: {
123
              color: '#90979c'
124
            }
125
          },
126
          axisTick: {
127
            show: false
128
          },
129
          axisLabel: {
130
            interval: 0
131
          },
132
          splitArea: {
133
            show: false
134
          }
135
        }],
136
        dataZoom: [{
137
          show: true,
138
          height: 30,
139
          xAxisIndex: [
140
            0
141
          ],
142
          bottom: 30,
143
          start: 10,
144
          end: 80,
145
          handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
146
          handleSize: '110%',
147
          handleStyle: {
148
            color: '#d3dee5'
149
150
          },
151
          textStyle: {
152
            color: '#fff' },
153
          borderColor: '#90979c'
154
155
        }, {
156
          type: 'inside',
157
          show: true,
158
          height: 15,
159
          start: 1,
160
          end: 35
161
        }],
162
        series: [{
163
          name: 'female',
164
          type: 'bar',
165
          stack: 'total',
166
          barMaxWidth: 35,
167
          barGap: '10%',
168
          itemStyle: {
169
            normal: {
170
              color: 'rgba(255,144,128,1)',
171
              label: {
172
                show: true,
173
                textStyle: {
174
                  color: '#fff'
175
                },
176
                position: 'insideTop',
177
                formatter(p) {
178
                  return p.value > 0 ? p.value : ''
179
                }
180
              }
181
            }
182
          },
183
          data: [
184
            709,
185
            1917,
186
            2455,
187
            2610,
188
            1719,
189
            1433,
190
            1544,
191
            3285,
192
            5208,
193
            3372,
194
            2484,
195
            4078
196
          ]
197
        },
198
199
        {
200
          name: 'male',
201
          type: 'bar',
202
          stack: 'total',
203
          itemStyle: {
204
            normal: {
205
              color: 'rgba(0,191,183,1)',
206
              barBorderRadius: 0,
207
              label: {
208
                show: true,
209
                position: 'top',
210
                formatter(p) {
211
                  return p.value > 0 ? p.value : ''
212
                }
213
              }
214
            }
215
          },
216
          data: [
217
            327,
218
            1776,
219
            507,
220
            1200,
221
            800,
222
            482,
223
            204,
224
            1390,
225
            1001,
226
            951,
227
            381,
228
            220
229
          ]
230
        }, {
231
          name: 'average',
232
          type: 'line',
233
          stack: 'total',
234
          symbolSize: 10,
235
          symbol: 'circle',
236
          itemStyle: {
237
            normal: {
238
              color: 'rgba(252,230,48,1)',
239
              barBorderRadius: 0,
240
              label: {
241
                show: true,
242
                position: 'top',
243
                formatter(p) {
244
                  return p.value > 0 ? p.value : ''
245
                }
246
              }
247
            }
248
          },
249
          data: [
250
            1036,
251
            3693,
252
            2962,
253
            3810,
254
            2519,
255
            1915,
256
            1748,
257
            4675,
258
            6209,
259
            4323,
260
            2865,
261
            4298
262
          ]
263
        }
264
        ]
265
      })
266
    }
267
  }
268
}
269
</script>

+ 0 - 15
src/components/Charts/mixins/resize.js

1
import { debounce } from '@/utils'
2
3
export default {
4
  mounted() {
5
    this.__resizeHanlder = debounce(() => {
6
      if (this.chart) {
7
        this.chart.resize()
8
      }
9
    }, 100)
10
    window.addEventListener('resize', this.__resizeHanlder)
11
  },
12
  beforeDestroy() {
13
    window.removeEventListener('resize', this.__resizeHanlder)
14
  }
15
}

+ 142 - 0
src/components/CityPicker/index.vue

1
<template>
2
  <div class="linkage">
3
    <el-row :gutter="10">
4
      <el-col :span="8">
5
        <el-select
6
          v-model="sheng"
7
          @change="choseProvince"
8
          placeholder="省">
9
          <el-option
10
            v-for="item in province"
11
            :key="item.id"
12
            :label="item.value"
13
            :value="item.id">
14
          </el-option>
15
        </el-select>
16
      </el-col>
17
      <el-col :span="8">
18
        <el-select
19
          v-model="shi"
20
          @change="choseCity"
21
          placeholder="市">
22
          <el-option
23
            v-for="item in shi1"
24
            :key="item.id"
25
            :label="item.value"
26
            :value="item.id">
27
          </el-option>
28
        </el-select>
29
      </el-col>
30
      <el-col :span="8">
31
        <el-select
32
          v-model="qu"
33
          @change="choseBlock"
34
          placeholder="区(县)">
35
          <el-option
36
            v-for="item in qu1"
37
            :key="item.id"
38
            :label="item.value"
39
            :value="item.id">
40
          </el-option>
41
        </el-select>
42
      </el-col>
43
    </el-row>
44
  </div>
45
</template>
46
<script>
47
import queryDict from '@/utils/queryDict'
48
export default {
49
  props: ['addrCode'],
50
  data() {
51
    return {
52
      firstFlag: false,
53
      province: [],
54
      sheng: '',
55
      shi: '',
56
      shi1: [],
57
      qu: '',
58
      qu1: [],
59
      city: '',
60
      block: ''
61
    }
62
  },
63
  watch: {
64
    addrCode: function() {
65
      this.initpsq()
66
    }
67
  },
68
  methods: {
69
    getCityData: function() {
70
      var that = this
71
      queryDict.applyDict('XZQH', function(dictData) {
72
        if (dictData) {
73
          var data = dictData.sort((obj1, obj2) => {
74
            return obj1.code - obj2.code
75
          })
76
          that.province = {}
77
          data.map(item => {
78
            if (item.code.match(/0000$/)) {
79
              that.province[item.code] = { id: item.code, value: item.caption, children: {}}
80
            } else if (item.code.match(/00$/)) {
81
              var p = that.province[item.code.slice(0, 2) + '0000']
82
              p.children[item.code] = { id: item.code, value: item.caption, children: {}}
83
              if (!p.defaultChild) {
84
                p.defaultChild = p.children[item.code]
85
              }
86
            } else {
87
              var pp = that.province[item.code.slice(0, 2) + '0000'].children[item.code.slice(0, 4) + '00']
88
              pp.children[item.code] = { id: item.code, value: item.caption }
89
              if (!pp.defaultChild) {
90
                pp.defaultChild = pp.children[item.code]
91
              }
92
            }
93
          })
94
        } else {
95
          console.log(dictData.status)
96
        }
97
      })
98
    },
99
    choseProvince: function(e) {
100
      var p = this.province[e]
101
      this.shi1 = p.children
102
      this.shi = p.defaultChild.value
103
      this.qu1 = p.defaultChild.children
104
      this.qu = p.defaultChild.defaultChild.value
105
      this.E = p.defaultChild.defaultChild.id
106
      this.sheng = p.value
107
      this.$emit('paren', this.E)
108
    },
109
    choseCity: function(e) {
110
      var p = this.province[e.slice(0, 2) + '0000'].children[e]
111
      this.shi = p.value
112
      this.qu1 = p.children
113
      this.qu = p.defaultChild.value
114
      this.E = p.defaultChild.id
115
      this.$emit('paren', this.E)
116
    },
117
    choseBlock: function(e) {
118
      this.qu = this.province[e.slice(0, 2) + '0000'].children[e.slice(0, 4) + '00'].children[e].value
119
      this.E = e
120
      this.$emit('paren', this.E)
121
    },
122
    initpsq: function() {
123
      if (!this.addrCode) {
124
        this.sheng = ''
125
        this.shi = ''
126
        this.qu = ''
127
        return
128
      }
129
      const s = this.addrCode.substring(0, 2) + '0000'
130
      const si = this.addrCode.substring(0, 4) + '00'
131
      const x = this.addrCode
132
      var p = this.province[s]
133
      this.sheng = p.value
134
      this.shi = p.children[si].value
135
      this.qu = p.children[si].children[x].value
136
    }
137
  },
138
  created: function() {
139
    this.getCityData()
140
  }
141
}
142
</script>

+ 7 - 4
src/components/Marqueebox/index.vue

6
      </el-form>
6
      </el-form>
7
      <div class="limit_num">还可以输入{{ableNum}}字</div>
7
      <div class="limit_num">还可以输入{{ableNum}}字</div>
8
      <div slot="footer" class="dialog-footer">
8
      <div slot="footer" class="dialog-footer">
9
        <el-button @click="dialogFormVisible = false">取 消</el-button>
10
        <el-button type="primary" @click="setNotice('formNotice')">确 定</el-button>
9
        <el-button v-waves @click="dialogFormVisible = false">取 消</el-button>
10
        <el-button type="primary" v-waves @click="setNotice('formNotice')">确 定</el-button>
11
      </div>
11
      </div>
12
    </el-dialog>
12
    </el-dialog>
13
    <el-menu class="message-box" mode="horizontal">
13
    <el-menu class="message-box" mode="horizontal">
24
</template>
24
</template>
25
 
25
 
26
<script>
26
<script>
27
import waves from '@/directive/waves'
27
import { getNotice, updateNotice } from '@/api/login'
28
import { getNotice, updateNotice } from '@/api/login'
28
export default {
29
export default {
29
  props: {
30
  props: {
31
      type: Boolean
32
      type: Boolean
32
    }
33
    }
33
  },
34
  },
35
  directives: {
36
    waves
37
  },
34
  data() {
38
  data() {
35
    return {
39
    return {
36
      dialogFormVisible: false,
40
      dialogFormVisible: false,
89
.message-box{
93
.message-box{
90
  height: 50px;
94
  height: 50px;
91
  line-height: 50px;
95
  line-height: 50px;
92
  padding: 0 10px;
93
  border-radius: 0px !important;
96
  border-radius: 0px !important;
94
  color: #303133;
97
  color: #303133;
95
  background: #c7e3ff;
98
  background: #c7e3ff;
126
  text-align: right;
129
  text-align: right;
127
}
130
}
128
.popper-tips{
131
.popper-tips{
129
  font-size:14px;
132
  font-size: 13px;
130
  line-height: 20px;
133
  line-height: 20px;
131
  display:block;
134
  display:block;
132
  max-width: 500px;
135
  max-width: 500px;

+ 0 - 49
src/directive/clipboard/clipboard.js

1
// Inspired by https://github.com/Inndy/vue-clipboard2
2
const Clipboard = require('clipboard')
3
if (!Clipboard) {
4
  throw new Error('you shold npm install `clipboard` --save at first ')
5
}
6
7
export default {
8
  bind(el, binding) {
9
    if (binding.arg === 'success') {
10
      el._v_clipboard_success = binding.value
11
    } else if (binding.arg === 'error') {
12
      el._v_clipboard_error = binding.value
13
    } else {
14
      const clipboard = new Clipboard(el, {
15
        text() { return binding.value },
16
        action() { return binding.arg === 'cut' ? 'cut' : 'copy' }
17
      })
18
      clipboard.on('success', e => {
19
        const callback = el._v_clipboard_success
20
        callback && callback(e) // eslint-disable-line
21
      })
22
      clipboard.on('error', e => {
23
        const callback = el._v_clipboard_error
24
        callback && callback(e) // eslint-disable-line
25
      })
26
      el._v_clipboard = clipboard
27
    }
28
  },
29
  update(el, binding) {
30
    if (binding.arg === 'success') {
31
      el._v_clipboard_success = binding.value
32
    } else if (binding.arg === 'error') {
33
      el._v_clipboard_error = binding.value
34
    } else {
35
      el._v_clipboard.text = function() { return binding.value }
36
      el._v_clipboard.action = function() { return binding.arg === 'cut' ? 'cut' : 'copy' }
37
    }
38
  },
39
  unbind(el, binding) {
40
    if (binding.arg === 'success') {
41
      delete el._v_clipboard_success
42
    } else if (binding.arg === 'error') {
43
      delete el._v_clipboard_error
44
    } else {
45
      el._v_clipboard.destroy()
46
      delete el._v_clipboard
47
    }
48
  }
49
}

+ 0 - 13
src/directive/clipboard/index.js

1
import Clipboard from './clipboard'
2
3
const install = function(Vue) {
4
  Vue.directive('Clipboard', Clipboard)
5
}
6
7
if (window.Vue) {
8
  window.clipboard = Clipboard
9
  Vue.use(install); // eslint-disable-line
10
}
11
12
Clipboard.install = install
13
export default Clipboard

+ 0 - 77
src/directive/el-dragDialog/drag.js

1
export default{
2
  bind(el, binding, vnode) {
3
    const dialogHeaderEl = el.querySelector('.el-dialog__header')
4
    const dragDom = el.querySelector('.el-dialog')
5
    dialogHeaderEl.style.cssText += ';cursor:move;'
6
    dragDom.style.cssText += ';top:0px;'
7
8
    // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
9
    const getStyle = (function() {
10
      if (window.document.currentStyle) {
11
        return (dom, attr) => dom.currentStyle[attr]
12
      } else {
13
        return (dom, attr) => getComputedStyle(dom, false)[attr]
14
      }
15
    })()
16
17
    dialogHeaderEl.onmousedown = (e) => {
18
      // 鼠标按下,计算当前元素距离可视区的距离
19
      const disX = e.clientX - dialogHeaderEl.offsetLeft
20
      const disY = e.clientY - dialogHeaderEl.offsetTop
21
22
      const dragDomWidth = dragDom.offsetWidth
23
      const dragDomheight = dragDom.offsetHeight
24
25
      const screenWidth = document.body.clientWidth
26
      const screenHeight = document.body.clientHeight
27
28
      const minDragDomLeft = dragDom.offsetLeft
29
      const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth
30
31
      const minDragDomTop = dragDom.offsetTop
32
      const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight
33
34
      // 获取到的值带px 正则匹配替换
35
      let styL = getStyle(dragDom, 'left')
36
      let styT = getStyle(dragDom, 'top')
37
38
      if (styL.includes('%')) {
39
        styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100)
40
        styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100)
41
      } else {
42
        styL = +styL.replace(/\px/g, '')
43
        styT = +styT.replace(/\px/g, '')
44
      }
45
46
      document.onmousemove = function(e) {
47
        // 通过事件委托,计算移动的距离
48
        let left = e.clientX - disX
49
        let top = e.clientY - disY
50
51
        // 边界处理
52
        if (-(left) > minDragDomLeft) {
53
          left = -minDragDomLeft
54
        } else if (left > maxDragDomLeft) {
55
          left = maxDragDomLeft
56
        }
57
58
        if (-(top) > minDragDomTop) {
59
          top = -minDragDomTop
60
        } else if (top > maxDragDomTop) {
61
          top = maxDragDomTop
62
        }
63
64
        // 移动当前元素
65
        dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
66
67
        // emit onDrag event
68
        vnode.child.$emit('dragDialog')
69
      }
70
71
      document.onmouseup = function(e) {
72
        document.onmousemove = null
73
        document.onmouseup = null
74
      }
75
    }
76
  }
77
}

+ 0 - 13
src/directive/el-dragDialog/index.js

1
import drag from './drag'
2
3
const install = function(Vue) {
4
  Vue.directive('el-drag-dialog', drag)
5
}
6
7
if (window.Vue) {
8
  window['el-drag-dialog'] = drag
9
  Vue.use(install); // eslint-disable-line
10
}
11
12
drag.install = install
13
export default drag

+ 54 - 0
src/utils/queryDict.js

1
/**
2
 * Created by luyanan on 18/8/23.
3
 * 'ZLLX'----'传感器主缆'
4
 * 'ZLWZ'----'传感器位置'
5
 * 'XZQH'----'城市级联'
6
 */
7
/* eslint-disable one-var */
8
import request from '@/utils/request'
9
10
var cacheDict = {
11
    bool: [
12
      { code: '0', caption: '否', enabled: true },
13
      { code: '1', caption: '是', enabled: true }
14
    ]
15
  },
16
  handCache = {},
17
  uri = '/ajax/dict/items',
18
  setDict = function(code, items) {
19
    cacheDict[code] = items
20
    var hs = handCache[code]
21
    if (hs && hs.length) {
22
      hs.forEach(h => h(items))
23
      delete handCache[code]
24
    }
25
  },
26
  loadDict = function(code) {
27
    request({
28
      url: uri,
29
      method: 'get',
30
      params: {
31
        dict: code
32
      }
33
    }).then(res => {
34
      setDict(code, res.data)
35
    })
36
  },
37
  applyDict = function(code, hander) {
38
    var dict = cacheDict[code]
39
    if (!dict) {
40
      var hs = handCache[code]
41
      if (!hs) {
42
        handCache[code] = hs = []
43
        loadDict(code)
44
      }
45
      hs.push(hander)
46
    } else {
47
      hander(dict)
48
    }
49
  },
50
  ret = {
51
    applyDict: applyDict
52
  }
53
54
export default ret

+ 0 - 33
src/utils/validate.js

1
/**
2
 * Created by luyanan on 18/8/13.
3
 */
4
5
export function isvalidUsername(str) {
6
  const valid_map = ['admin', 'editor']
7
  return valid_map.indexOf(str.trim()) >= 0
8
}
9
10
/* 合法uri*/
11
export function validateURL(textval) {
12
  const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
13
  return urlregex.test(textval)
14
}
15
16
/* 小写字母*/
17
export function validateLowerCase(str) {
18
  const reg = /^[a-z]+$/
19
  return reg.test(str)
20
}
21
22
/* 大写字母*/
23
export function validateUpperCase(str) {
24
  const reg = /^[A-Z]+$/
25
  return reg.test(str)
26
}
27
28
/* 大小写字母*/
29
export function validatAlphabets(str) {
30
  const reg = /^[A-Za-z]+$/
31
  return reg.test(str)
32
}
33

+ 7 - 7
src/views/baseInfoManage/boxesConfig/index.vue

5
      </el-input>
5
      </el-input>
6
       <el-input style="width: 200px;" class="filter-item" placeholder="采集盒编号" v-model="listQuery.code">
6
       <el-input style="width: 200px;" class="filter-item" placeholder="采集盒编号" v-model="listQuery.code">
7
      </el-input>
7
      </el-input>
8
      <el-button class="filter-item" style="margin-left: 10px;" @click="handleFilter" type="primary" icon="el-icon-search">查找</el-button>
9
      <el-button class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="el-icon-edit">添加采集盒</el-button>
8
      <el-button v-waves class="filter-item" style="margin-left: 10px;" @click="handleFilter" type="primary" icon="el-icon-search">查找</el-button>
9
      <el-button v-waves class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="el-icon-edit">添加采集盒</el-button>
10
    </div>
10
    </div>
11
11
12
    <el-table :key='tableKey' :data="list" v-loading="listLoading" border fit highlight-current-row
12
    <el-table :key='tableKey' :data="list" v-loading="listLoading" border fit highlight-current-row
31
          <span>{{scope.row.remark}}</span>
31
          <span>{{scope.row.remark}}</span>
32
        </template>
32
        </template>
33
      </el-table-column>
33
      </el-table-column>
34
      <el-table-column align="center" label="Actions" width="230" class-name="small-padding fixed-width">
34
      <el-table-column align="center" label="操作" width="230" class-name="small-padding fixed-width">
35
        <template slot-scope="scope"> 
35
        <template slot-scope="scope"> 
36
          <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button> 
37
          <el-button size="mini" type="danger" @click="handleModifyStatus(scope.row,'deleted')">删除
36
          <el-button v-waves v-waves type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button> 
37
          <el-button v-waves size="mini" type="danger" @click="handleModifyStatus(scope.row,'deleted')">删除
38
          </el-button>
38
          </el-button>
39
        </template>
39
        </template>
40
      </el-table-column>
40
      </el-table-column>
74
          </el-col>
74
          </el-col>
75
          <el-col :span="24" class="el-btn-col">
75
          <el-col :span="24" class="el-btn-col">
76
            <div class="el-btn-col-box">
76
            <div class="el-btn-col-box">
77
              <el-button type="primary" @click="submitForm('ruleForm2')">确认</el-button>
78
              <el-button type="info" @click="resetForm('ruleForm2')">返回</el-button>
77
              <el-button v-waves type="primary" @click="submitForm('ruleForm2')">确认</el-button>
78
              <el-button v-waves type="info" @click="resetForm('ruleForm2')">返回</el-button>
79
            </div>
79
            </div>
80
          </el-col>
80
          </el-col>
81
        </el-row>
81
        </el-row>

+ 24 - 24
src/views/baseInfoManage/bridgesInfo/index.vue

5
      </el-input>
5
      </el-input>
6
       <el-input style="width: 200px;" class="filter-item" placeholder="桥梁编号" v-model="listQuery.code">
6
       <el-input style="width: 200px;" class="filter-item" placeholder="桥梁编号" v-model="listQuery.code">
7
      </el-input>
7
      </el-input>
8
      <el-button class="filter-item" style="margin-left: 10px;" @click="handleFilter" type="primary" icon="el-icon-search">查找</el-button>
9
      <el-button class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="el-icon-edit">添加桥梁</el-button>
8
      <el-button v-waves class="filter-item" style="margin-left: 10px;" @click="handleFilter" type="primary" icon="el-icon-search">查找</el-button>
9
      <el-button v-waves class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="el-icon-edit">添加桥梁</el-button>
10
    </div>
10
    </div>
11
11
12
    <el-table :key='tableKey' :data="list" v-loading="listLoading" border fit highlight-current-row
12
    <el-table :key='tableKey' :data="list" v-loading="listLoading" border fit highlight-current-row
36
          <span>{{scope.row.remark}}</span>
36
          <span>{{scope.row.remark}}</span>
37
        </template>
37
        </template>
38
      </el-table-column>
38
      </el-table-column>
39
      <el-table-column align="center" label="Actions" width="230" class-name="small-padding fixed-width">
39
      <el-table-column align="center" label="操作" width="230" class-name="small-padding fixed-width">
40
        <template slot-scope="scope"> 
40
        <template slot-scope="scope"> 
41
          <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button> 
42
          <el-button size="mini" type="danger" @click="handleModifyStatus(scope.row,'deleted')">删除
41
          <el-button v-waves type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button> 
42
          <el-button v-waves size="mini" type="danger" @click="handleModifyStatus(scope.row,'deleted')">删除
43
          </el-button>
43
          </el-button>
44
        </template>
44
        </template>
45
      </el-table-column>
45
      </el-table-column>
66
              </el-col>
66
              </el-col>
67
              <el-col :span="24">
67
              <el-col :span="24">
68
                <el-form-item label="桥梁位置信息" prop="addrCode">
68
                <el-form-item label="桥梁位置信息" prop="addrCode">
69
                  <city @paren="toshow" :addrCode='ruleForm2.addrCode'></city>
69
                  <!-- <city @paren="toshow" :addrCode='ruleForm2.addrCode'></city> -->
70
                  <CityPicker @paren="toshow" :addrCode='ruleForm2.addrCode'></CityPicker>
70
                </el-form-item>
71
                </el-form-item>
71
              </el-col>
72
              </el-col>
72
              <el-col :span="12">
73
              <el-col :span="12">
129
          </el-col>
130
          </el-col>
130
          <el-col :span="24" class="el-btn-col">
131
          <el-col :span="24" class="el-btn-col">
131
            <div class="el-btn-col-box">
132
            <div class="el-btn-col-box">
132
              <el-button type="primary" @click="submitForm('ruleForm2')">确认</el-button>
133
              <el-button type="primary" @click="resetForm('ruleForm2')">返回</el-button>
133
              <el-button v-waves type="primary" @click="submitForm('ruleForm2')">确认</el-button>
134
              <el-button v-waves type="primary" @click="resetForm('ruleForm2')">返回</el-button>
134
            </div>
135
            </div>
135
          </el-col>
136
          </el-col>
136
        </el-row>
137
        </el-row>
144
</template>
145
</template>
145
146
146
<script>
147
<script>
147
import { addDevice, updateDevice, deleteDevice, pageQueryDevice, checkDeviceCode, checkBridgeShortName, checkBridgeName, dictory } from '@/api/bridge'
148
import { addDevice, updateDevice, deleteDevice, pageQueryDevice, checkDeviceCode, checkBridgeShortName, checkBridgeName } from '@/api/bridge'
148
import waves from '@/directive/waves'
149
import waves from '@/directive/waves'
149
import city from '../../city/linkage'
150
import CityPicker from '@/components/CityPicker'
151
import queryDict from '@/utils/queryDict'
150
export default {
152
export default {
151
  name: 'complexTable',
153
  name: 'complexTable',
152
  directives: {
154
  directives: {
223
      }
225
      }
224
    }
226
    }
225
    return {
227
    return {
226
      provinceCityCounties: [],
227
      citys: [],
228
      citys: {},
228
      edit: '',
229
      edit: '',
229
      imageUrl: '',
230
      imageUrl: '',
230
      ruleForm2: {
231
      ruleForm2: {
291
    }
292
    }
292
  },
293
  },
293
  created() {
294
  created() {
294
    dictory().then(response => {
295
      if (response.success) {
296
        this.provinceCityCounties = response.data.sort((obj1, obj2) => {
297
          return obj1.code - obj2.code
298
        })
299
        response.data.map(item => {
300
          this.citys[item.code] = item.fullCaption
301
        })
302
        this.getList()
303
      }
304
    })
295
    this.getDictoryData()
305
  },
296
  },
306
  components: {
297
  components: {
307
    city
298
    CityPicker
308
  },
299
  },
309
  methods: {
300
  methods: {
301
    getDictoryData() {
302
      const that = this
303
      queryDict.applyDict('XZQH', function(dictData) {
304
        dictData.map(item => {
305
          that.citys[item.code] = item.fullCaption
306
        })
307
        that.getList()
308
      }) // 城市级联
309
    },
310
    submitForm(formName) {
310
    submitForm(formName) {
311
      const that = this
311
      const that = this
312
      this.$refs[formName].validate((valid) => {
312
      this.$refs[formName].validate((valid) => {

+ 25 - 29
src/views/baseInfoManage/sensorsConfig/index.vue

5
      </el-input>
5
      </el-input>
6
       <el-input style="width: 200px;" class="filter-item" placeholder="传感器编号" v-model="listQuery.code">
6
       <el-input style="width: 200px;" class="filter-item" placeholder="传感器编号" v-model="listQuery.code">
7
      </el-input>
7
      </el-input>
8
      <el-button class="filter-item" style="margin-left: 10px;" @click="handleFilter" type="primary" icon="el-icon-search">查找</el-button>
9
      <el-button class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="el-icon-edit">添加传感器</el-button>
8
      <el-button v-waves class="filter-item" style="margin-left: 10px;" @click="handleFilter" type="primary" icon="el-icon-search">查找</el-button>
9
      <el-button v-waves class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="el-icon-edit">添加传感器</el-button>
10
    </div>
10
    </div>
11
11
12
    <el-table :key='tableKey' :data="list" v-loading="listLoading" border fit highlight-current-row
12
    <el-table :key='tableKey' :data="list" v-loading="listLoading" border fit highlight-current-row
36
          <span>{{scope.row.remark}}</span>
36
          <span>{{scope.row.remark}}</span>
37
        </template>
37
        </template>
38
      </el-table-column>
38
      </el-table-column>
39
      <el-table-column align="center" label="Actions" width="230" class-name="small-padding fixed-width">
39
      <el-table-column align="center" label="操作" width="230" class-name="small-padding fixed-width">
40
        <template slot-scope="scope"> 
40
        <template slot-scope="scope"> 
41
          <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button> 
42
          <el-button size="mini" type="danger" @click="handleModifyStatus(scope.row,'deleted')">删除
41
          <el-button v-waves type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button> 
42
          <el-button v-waves size="mini" type="danger" @click="handleModifyStatus(scope.row,'deleted')">删除
43
          </el-button>
43
          </el-button>
44
        </template>
44
        </template>
45
      </el-table-column>
45
      </el-table-column>
98
          </el-col>
98
          </el-col>
99
          <el-col :span="24" class="el-btn-col">
99
          <el-col :span="24" class="el-btn-col">
100
            <div class="el-btn-col-box">
100
            <div class="el-btn-col-box">
101
              <el-button type="primary" @click="submitForm('ruleForm2')">确认</el-button>
102
              <el-button type="info" @click="resetForm('ruleForm2')">返回</el-button>
101
              <el-button v-waves type="primary" @click="submitForm('ruleForm2')">确认</el-button>
102
              <el-button v-waves type="info" @click="resetForm('ruleForm2')">返回</el-button>
103
            </div>
103
            </div>
104
          </el-col>
104
          </el-col>
105
        </el-row>
105
        </el-row>
114
114
115
<script>
115
<script>
116
import { addDevice, updateDevice, deleteDevice, pageQueryDevice, DeviceOfservice, checkDeviceCode, checkDeviceInternalCode, queryServer } from '@/api/sensor'
116
import { addDevice, updateDevice, deleteDevice, pageQueryDevice, DeviceOfservice, checkDeviceCode, checkDeviceInternalCode, queryServer } from '@/api/sensor'
117
import { mainCable, location } from '@/api/numberDictionary'
118
import waves from '@/directive/waves'
117
import waves from '@/directive/waves'
118
import queryDict from '@/utils/queryDict'
119
export default {
119
export default {
120
  name: 'complexTable',
120
  name: 'complexTable',
121
  directives: {
121
  directives: {
235
    }
235
    }
236
  },
236
  },
237
  created() {
237
  created() {
238
    mainCable().then(response => {
239
      if (response.success) {
240
        response.data.map(item => {
241
          this.options.push({ value: item.code, label: item.caption })
242
          this.cableMain[item.code] = item.caption
243
        })
244
      }
245
      return Promise.resolve()
246
    }).then(response => {
247
      location().then(response => {
248
        if (response.success) {
249
          response.data.map(item => {
250
            this.options1.push({ value: item.code, label: item.caption })
251
            this.addr[item.code] = item.caption
252
          })
253
        }
254
        return Promise.resolve()
255
      })
256
    }).then(response => {
257
      this.getList()
258
    })
238
    this.getDictoryData()
259
  },
239
  },
260
  methods: {
240
  methods: {
241
    getDictoryData() {
242
      const that = this
243
      queryDict.applyDict('ZLLX', function(dictData) {
244
        dictData.map(item => {
245
          that.options.push({ value: item.code, label: item.caption })
246
          that.cableMain[item.code] = item.caption
247
        })
248
      }) // 主缆
249
      queryDict.applyDict('ZLWZ', function(dictData) {
250
        dictData.map(item => {
251
          that.options1.push({ value: item.code, label: item.caption })
252
          that.addr[item.code] = item.caption
253
        })
254
      }) // 位置
255
      that.getList()
256
    },
261
    submitForm(formName) {
257
    submitForm(formName) {
262
      const that = this
258
      const that = this
263
      this.$refs[formName].validate((valid) => {
259
      this.$refs[formName].validate((valid) => {

+ 7 - 7
src/views/baseInfoManage/serversConfig/index.vue

5
      </el-input>
5
      </el-input>
6
       <el-input style="width: 200px;" class="filter-item" placeholder="服务器编号" v-model="listQuery.code">
6
       <el-input style="width: 200px;" class="filter-item" placeholder="服务器编号" v-model="listQuery.code">
7
      </el-input>
7
      </el-input>
8
      <el-button class="filter-item" style="margin-left: 10px;" @click="handleFilter" type="primary" icon="el-icon-search">查找</el-button>
9
      <el-button class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="el-icon-edit">添加服务器</el-button>
8
      <el-button v-waves class="filter-item" style="margin-left: 10px;" @click="handleFilter" type="primary" icon="el-icon-search">查找</el-button>
9
      <el-button v-waves class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="el-icon-edit">添加服务器</el-button>
10
    </div>
10
    </div>
11
11
12
    <el-table :key='tableKey' :data="list" v-loading="listLoading" border fit highlight-current-row
12
    <el-table :key='tableKey' :data="list" v-loading="listLoading" border fit highlight-current-row
31
          <span>{{scope.row.remark}}</span>
31
          <span>{{scope.row.remark}}</span>
32
        </template>
32
        </template>
33
      </el-table-column>
33
      </el-table-column>
34
      <el-table-column align="center" label="Actions" width="230" class-name="small-padding fixed-width">
34
      <el-table-column align="center" label="操作" width="230" class-name="small-padding fixed-width">
35
        <template slot-scope="scope"> 
35
        <template slot-scope="scope"> 
36
          <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button> 
37
          <el-button size="mini" type="danger" @click="handleModifyStatus(scope.row,'deleted')">删除
36
          <el-button v-waves type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button> 
37
          <el-button v-waves size="mini" type="danger" @click="handleModifyStatus(scope.row,'deleted')">删除
38
          </el-button>
38
          </el-button>
39
        </template>
39
        </template>
40
      </el-table-column>
40
      </el-table-column>
74
          </el-col>
74
          </el-col>
75
          <el-col :span="24" class="el-btn-col">
75
          <el-col :span="24" class="el-btn-col">
76
            <div class="el-btn-col-box">
76
            <div class="el-btn-col-box">
77
              <el-button type="primary" @click="submitForm('ruleForm2')">确认</el-button>
78
              <el-button type="info" @click="resetForm('ruleForm2')">返回</el-button>
77
              <el-button v-waves type="primary" @click="submitForm('ruleForm2')">确认</el-button>
78
              <el-button v-waves type="info" @click="resetForm('ruleForm2')">返回</el-button>
79
            </div>
79
            </div>
80
          </el-col>
80
          </el-col>
81
        </el-row>
81
        </el-row>

+ 1 - 1
src/views/bridgesConsole/bridgeDetail/components/BInfoDialog01.vue

66
  data() {
66
  data() {
67
    return {
67
    return {
68
      dialogW: '',
68
      dialogW: '',
69
      childCitys: [],
69
      childCitys: {},
70
      dialogTableVisible: false,
70
      dialogTableVisible: false,
71
      dataInfo: ''
71
      dataInfo: ''
72
    }
72
    }

+ 2 - 2
src/views/bridgesConsole/bridgeDetail/components/BInfoDialog04.vue

62
      dialogW: '',
62
      dialogW: '',
63
      bridgeId: '',
63
      bridgeId: '',
64
      transducerList: [],
64
      transducerList: [],
65
      childCableMain: [],
66
      childAddr: [],
65
      childCableMain: {},
66
      childAddr: {},
67
      dialogTableVisible: false,
67
      dialogTableVisible: false,
68
      pageSize: 4,
68
      pageSize: 4,
69
      pageNo: 1
69
      pageNo: 1

+ 19 - 25
src/views/bridgesConsole/bridgeDetail/index.vue

81
import '@/styles/roleuser.scss'
81
import '@/styles/roleuser.scss'
82
import Cookies from 'js-cookie'
82
import Cookies from 'js-cookie'
83
import queryInfo from '@/utils/queryInfo'
83
import queryInfo from '@/utils/queryInfo'
84
import queryDict from '@/utils/queryDict'
84
import { urlParse, parseTime, turnTime } from '@/utils'
85
import { urlParse, parseTime, turnTime } from '@/utils'
85
import { getDangerList, getTimingMonitor } from '@/api/bridgeInfo'
86
import { getDangerList, getTimingMonitor } from '@/api/bridgeInfo'
86
import { mainCable, location, provinceCityDistrict } from '@/api/numberDictionary'
87
87
88
import lineChart2 from '../lineChart/LineChart2'
88
import lineChart2 from '../lineChart/LineChart2'
89
import BInfoDialog01 from './components/BInfoDialog01'
89
import BInfoDialog01 from './components/BInfoDialog01'
113
      bridgeId: '',
113
      bridgeId: '',
114
      bridgeName: '',
114
      bridgeName: '',
115
      dialogW: '860px',
115
      dialogW: '860px',
116
      citys: [],
117
      cableMain: [],
118
      addr: [],
116
      citys: {},
117
      cableMain: {},
118
      addr: {},
119
      dangerList: '',
119
      dangerList: '',
120
      serverSeqArr: [],
120
      serverSeqArr: [],
121
      monitorList: [],
121
      monitorList: [],
210
      })
210
      })
211
    },
211
    },
212
    getDictoryData() {
212
    getDictoryData() {
213
      mainCable().then(response => {
214
        if (response.success) {
215
          response.data.map(item => {
216
            this.cableMain[item.code] = item.caption
217
          })
218
        }
219
      }).then(response => {
220
        location().then(response => {
221
          if (response.success) {
222
            response.data.map(item => {
223
              this.addr[item.code] = item.caption
224
            })
225
          }
213
      const that = this
214
      queryDict.applyDict('ZLLX', function(dictData) {
215
        dictData.map(item => {
216
          that.cableMain[item.code] = item.caption
226
        })
217
        })
227
      })
228
      provinceCityDistrict().then(response => {
229
        if (response.success) {
230
          response.data.map(item => {
231
            this.citys[item.code] = item.fullCaption
232
          })
233
        }
234
      })
218
      }) // 主缆
219
      queryDict.applyDict('ZLWZ', function(dictData) {
220
        dictData.map(item => {
221
          that.addr[item.code] = item.caption
222
        })
223
      }) // 位置
224
      queryDict.applyDict('XZQH', function(dictData) {
225
        dictData.map(item => {
226
          that.citys[item.code] = item.fullCaption
227
        })
228
      }) // 城市级联
235
    },
229
    },
236
    addData(shift) {
230
    addData(shift) {
237
      this.dateArr.push(this.currentTime)
231
      this.dateArr.push(this.currentTime)

+ 0 - 178
src/views/city/linkage.vue

1
<template>
2
  <div class="linkage">
3
    <el-row :gutter='10'>
4
      <el-col :span='8'>
5
        <el-select
6
          v-model="sheng"
7
          @change="choseProvince"
8
          placeholder="省">
9
          <el-option
10
            v-for="item in province"
11
            :key="item.id"
12
            :label="item.value"
13
            :value="item.id">
14
          </el-option>
15
        </el-select>
16
      </el-col>
17
      <el-col :span='8'>
18
        <el-select
19
          v-model="shi"
20
          @change="choseCity"
21
          placeholder="市">
22
          <el-option
23
            v-for="item in shi1"
24
            :key="item.id"
25
            :label="item.value"
26
            :value="item.id">
27
          </el-option>
28
        </el-select>
29
      </el-col>
30
      <el-col :span='8'>
31
        <el-select
32
          v-model="qu"
33
          @change="choseBlock"
34
          placeholder="区(县)">
35
          <el-option
36
            v-for="item in qu1"
37
            :key="item.id"
38
            :label="item.value"
39
            :value="item.id">
40
          </el-option>
41
        </el-select>
42
      </el-col>
43
    </el-row>
44
  </div>
45
</template>
46
<script>
47
import axios from 'axios'
48
export default {
49
  props: ['addrCode'],
50
  data() {
51
    return {
52
      firstFlag: false,
53
      province: [],
54
      sheng: '',
55
      shi: '',
56
      shi1: [],
57
      qu: '',
58
      qu1: [],
59
      city: '',
60
      block: ''
61
    }
62
  },
63
  watch: {
64
    addrCode: function() {
65
      this.initpsq()
66
    }
67
  },
68
  methods: {
69
    getCityData: function() {
70
      var that = this
71
      axios.get('/ajax/dict/items?dict=XZQH').then(function(response) {
72
        if (response.status === 200) {
73
          var data = response.data.data.sort((obj1, obj2) => {
74
            return obj1.code - obj2.code
75
          })
76
          that.province = []
77
          that.city = []
78
          that.block = []
79
          data.map(item => {
80
            if (item.code.match(/0000$/)) {
81
              that.province.push({ id: item.code, value: item.caption, children: [] })
82
            } else if (item.code.match(/00$/)) {
83
              that.city.push({ id: item.code, value: item.caption, children: [] })
84
            } else {
85
              that.block.push({ id: item.code, value: item.caption })
86
            }
87
          })
88
          for (var index in that.province) {
89
            for (var index1 in that.city) {
90
              if (that.province[index].id.slice(0, 2) === that.city[index1].id.slice(0, 2)) {
91
                that.province[index].children.push(that.city[index1])
92
              }
93
            }
94
          }
95
          for (var item1 in that.city) {
96
            for (var item2 in that.block) {
97
              if (that.block[item2].id.slice(0, 4) === that.city[item1].id.slice(0, 4)) {
98
                that.city[item1].children.push(that.block[item2])
99
              }
100
            }
101
          }
102
          if (!that.firstFlag) {
103
            that.initpsq()
104
          }
105
        } else {
106
          console.log(response.status)
107
        }
108
      })
109
    },
110
    choseProvince: function(e) {
111
      for (var index2 in this.province) {
112
        if (e === this.province[index2].id) {
113
          this.shi1 = this.province[index2].children
114
          this.shi = this.province[index2].children[0].value
115
          this.qu1 = this.province[index2].children[0].children
116
          this.qu = this.province[index2].children[0].children[0].value
117
          this.E = this.qu1[0].id
118
          this.sheng = this.province[index2].value
119
        }
120
      }
121
      this.$emit('paren', this.E)
122
    },
123
    choseCity: function(e) {
124
      for (var index3 in this.city) {
125
        if (e === this.city[index3].id) {
126
          this.qu1 = this.city[index3].children
127
          this.qu = this.city[index3].children[0].value
128
          this.E = this.qu1[0].id
129
          this.shi = this.city[index3].value
130
        }
131
      }
132
      this.$emit('paren', this.E)
133
    },
134
    choseBlock: function(e) {
135
      for (var index3 in this.qu1) {
136
        if (e === this.qu1[index3].id) {
137
          this.qu = this.qu1[index3].value
138
        }
139
      }
140
      this.E = e
141
      this.$emit('paren', this.E)
142
    },
143
    initpsq: function() {
144
      if (!this.addrCode) {
145
        this.sheng = ''
146
        this.shi = ''
147
        this.qu = ''
148
        return
149
      }
150
      const s = this.addrCode.substring(0, 2) + '0000'
151
      const si = this.addrCode.substring(0, 4) + '00'
152
      const x = this.addrCode
153
      this.province.map(item => {
154
        if (item.id === s) {
155
          this.sheng = item.value
156
          item.children.map(item => {
157
            if (item.id === si) {
158
              this.shi = item.value
159
              item.children.map(item => {
160
                if (x === item.id) {
161
                  this.qu = item.value
162
                }
163
              })
164
            }
165
          })
166
        }
167
      })
168
    }
169
  },
170
  created: function() {
171
    this.getCityData()
172
  }
173
}
174
</script>
175
176
<style rel="stylesheet/scss" lang="scss" scoped>
177
 
178
</style>

+ 4 - 2
src/views/dashboard/index.vue

8
import { mapGetters } from 'vuex'
8
import { mapGetters } from 'vuex'
9
import adminDashboard from './admin'
9
import adminDashboard from './admin'
10
import otherDashboard from './other'
10
import otherDashboard from './other'
11
12
export default {
11
export default {
13
  name: 'dashboard',
12
  name: 'dashboard',
14
  components: { adminDashboard, otherDashboard },
13
  components: {
14
    adminDashboard,
15
    otherDashboard
16
  },
15
  data() {
17
  data() {
16
    return {
18
    return {
17
      currentRole: 'adminDashboard'
19
      currentRole: 'adminDashboard'

+ 1 - 1
src/views/dashboard/other/index.vue

88
    goToDashboardC(id, name) {
88
    goToDashboardC(id, name) {
89
      Cookies.set('bridgeId', id)
89
      Cookies.set('bridgeId', id)
90
      Cookies.set('bridgeName', name)
90
      Cookies.set('bridgeName', name)
91
      this.$router.replace({ name: 'bridgeHome' })
91
      this.$router.push({ name: 'bridgeHome' })
92
    },
92
    },
93
    handleCurrentChange(val) {
93
    handleCurrentChange(val) {
94
      this.pageNo = val
94
      this.pageNo = val

+ 10 - 6
src/views/findPwd/index.vue

20
            </el-form-item>
20
            </el-form-item>
21
            <el-form-item prop="msgVC">
21
            <el-form-item prop="msgVC">
22
              <el-input v-model="ruleForm.msgVC" placeholder="请输入短信验证码" class="code-btn" style="width:100%">
22
              <el-input v-model="ruleForm.msgVC" placeholder="请输入短信验证码" class="code-btn" style="width:100%">
23
                <el-button slot="append" type="primary" :disabled="phoneCodeBol" @click="clickMsgVcLogin">
23
                <el-button v-waves slot="append" type="primary" :disabled="phoneCodeBol" @click="clickMsgVcLogin">
24
                  <span v-if="sendMsgDisabled">{{seconds + '秒后获取'}}</span>
24
                  <span v-if="sendMsgDisabled">{{seconds + '秒后获取'}}</span>
25
                  <span v-if="!sendMsgDisabled">获取验证码</span>
25
                  <span v-if="!sendMsgDisabled">获取验证码</span>
26
                </el-button>
26
                </el-button>
27
             </el-input>
27
             </el-input>
28
            </el-form-item>
28
            </el-form-item>
29
            <el-form-item>
29
            <el-form-item>
30
              <el-button class="log-btn" type="primary" :disabled="isDisabl" @click="nextStep('ruleForm')">下一步</el-button>
30
              <el-button v-waves class="log-btn" type="primary" :disabled="isDisabl" @click="nextStep('ruleForm')">下一步</el-button>
31
            </el-form-item>
31
            </el-form-item>
32
            <el-form-item class="el-form-find">
32
            <el-form-item class="el-form-find">
33
              <el-button type="text" @click="goLogin">又想起来了</el-button>
33
              <el-button v-waves type="text" @click="goLogin">又想起来了</el-button>
34
            </el-form-item>
34
            </el-form-item>
35
          </el-form>
35
          </el-form>
36
          <el-form v-show="stepSecond" :model="ruleForm2" :rules="rules2" ref="ruleForm2" class="demo-ruleForm">
36
          <el-form v-show="stepSecond" :model="ruleForm2" :rules="rules2" ref="ruleForm2" class="demo-ruleForm">
41
              <el-input type="password" v-model="ruleForm2.checkPass" placeholder="请再次输入密码确认" auto-complete="off"></el-input>
41
              <el-input type="password" v-model="ruleForm2.checkPass" placeholder="请再次输入密码确认" auto-complete="off"></el-input>
42
            </el-form-item>
42
            </el-form-item>
43
            <el-form-item>
43
            <el-form-item>
44
              <el-button class="log-btn" type="primary" :disabled="isDisabl" @click.native.prevent="resetPwd('ruleForm2')">重置密码</el-button>
44
              <el-button v-waves class="log-btn" type="primary" :disabled="isDisabl" @click.native.prevent="resetPwd('ruleForm2')">重置密码</el-button>
45
            </el-form-item>
45
            </el-form-item>
46
          </el-form>
46
          </el-form>
47
        </div>
47
        </div>
53
<script>
53
<script>
54
  import { isReg, getResetMsgPhone, resetPwdByTel } from '@/api/login'
54
  import { isReg, getResetMsgPhone, resetPwdByTel } from '@/api/login'
55
  import '@/styles/loginform.scss'
55
  import '@/styles/loginform.scss'
56
  import waves from '@/directive/waves'
56
57
57
  export default {
58
  export default {
59
    directives: {
60
      waves
61
    },
58
    data() {
62
    data() {
59
      var validPhone = (rule, value, callback) => {
63
      var validPhone = (rule, value, callback) => {
60
        const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
64
        const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
213
                  center: true,
217
                  center: true,
214
                  callback: action => {
218
                  callback: action => {
215
                    if (action === 'confirm') {
219
                    if (action === 'confirm') {
216
                      this.$router.replace({ path: '/login' })
220
                      this.$router.push({ path: '/login' })
217
                    }
221
                    }
218
                  }
222
                  }
219
                })
223
                })
239
        })
243
        })
240
      },
244
      },
241
      goLogin() {
245
      goLogin() {
242
        this.$router.replace({ path: '/login' })
246
        this.$router.push({ path: '/login' })
243
      }
247
      }
244
    }
248
    }
245
  }
249
  }

+ 1 - 1
src/views/layout/components/Navbar.vue

43
.navbar {
43
.navbar {
44
  height: 50px;
44
  height: 50px;
45
  line-height: 50px;
45
  line-height: 50px;
46
  padding: 0 10px;
46
  padding: 0 12px;
47
  border-radius: 0px !important;
47
  border-radius: 0px !important;
48
  .hamburger-container {
48
  .hamburger-container {
49
    line-height: 58px;
49
    line-height: 58px;

+ 1 - 0
src/views/layout/components/TopNavbar.vue

125
  z-index:1002;
125
  z-index:1002;
126
  border-radius: 0px !important;
126
  border-radius: 0px !important;
127
  background-color: #2d3a4b;
127
  background-color: #2d3a4b;
128
  border-bottom: 1px solid #e6e6e6;
128
  .logo-container {
129
  .logo-container {
129
    display: inline-block;
130
    display: inline-block;
130
    position: absolute;
131
    position: absolute;

+ 8 - 4
src/views/login/index.vue

27
        <img slot="append" :src="imgVcUrl" @click="changeImgVc" /></el-input>
27
        <img slot="append" :src="imgVcUrl" @click="changeImgVc" /></el-input>
28
      </el-form-item>
28
      </el-form-item>
29
      <el-form-item>
29
      <el-form-item>
30
        <el-button class="log-btn" type="primary" :loading="loading" @click.native.prevent="handleLogin">登录</el-button>
30
        <el-button v-waves class="log-btn" type="primary" :loading="loading" @click.native.prevent="handleLogin">登录</el-button>
31
      </el-form-item>
31
      </el-form-item>
32
      <el-form-item class="el-form-find">
32
      <el-form-item class="el-form-find">
33
        <el-button type="text" @click.native.prevent="goBackPwd">忘记密码?</el-button>
33
        <el-button v-waves type="text" @click.native.prevent="goBackPwd">忘记密码?</el-button>
34
      </el-form-item>
34
      </el-form-item>
35
    </el-form>
35
    </el-form>
36
  </div>
36
  </div>
39
<script>
39
<script>
40
import { Message } from 'element-ui'
40
import { Message } from 'element-ui'
41
import { getPictureVC } from '@/api/pictureVc'
41
import { getPictureVC } from '@/api/pictureVc'
42
import waves from '@/directive/waves'
42
import '@/styles/loginform.scss'
43
import '@/styles/loginform.scss'
43
44
44
export default {
45
export default {
45
  name: 'login',
46
  name: 'login',
47
  directives: {
48
    waves
49
  },
46
  data() {
50
  data() {
47
    var validPhone = (rule, value, callback) => {
51
    var validPhone = (rule, value, callback) => {
48
      const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
52
      const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
94
              if (response.data) {
98
              if (response.data) {
95
                this.$store.dispatch('GetUserInfo').then(res => {
99
                this.$store.dispatch('GetUserInfo').then(res => {
96
                })
100
                })
97
                this.$router.replace({ path: '/' })
101
                this.$router.push({ path: '/' })
98
              } else {
102
              } else {
99
                Message.error('登录账号与密码不匹配,请检查后重试')
103
                Message.error('登录账号与密码不匹配,请检查后重试')
100
                this.changeImgVc()
104
                this.changeImgVc()
132
      })
136
      })
133
    },
137
    },
134
    goBackPwd() {
138
    goBackPwd() {
135
      this.$router.replace({ path: '/findPwd' })
139
      this.$router.push({ path: '/findPwd' })
136
    },
140
    },
137
    changeImgVc() {
141
    changeImgVc() {
138
      this.imgVcUrl = getPictureVC('PIC_LOGIN')
142
      this.imgVcUrl = getPictureVC('PIC_LOGIN')

+ 6 - 6
src/views/peoplesManage/infoManage/index.vue

7
      </el-input>
7
      </el-input>
8
       <el-input style="width: 250px;" class="filter-item" placeholder="所在机构" v-model="listQuery.comp">
8
       <el-input style="width: 250px;" class="filter-item" placeholder="所在机构" v-model="listQuery.comp">
9
      </el-input>
9
      </el-input>
10
      <el-button class="filter-item" style="margin-left: 10px;" @click="handleFilter" type="primary" icon="el-icon-search">查找</el-button>
11
      <el-button class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="el-icon-edit">添加用户</el-button>
10
      <el-button v-waves class="filter-item" style="margin-left: 10px;" @click="handleFilter" type="primary" icon="el-icon-search">查找</el-button>
11
      <el-button v-waves class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="el-icon-edit">添加用户</el-button>
12
    </div>
12
    </div>
13
    <el-table :key='tableKey' :data="list" v-loading="listLoading" border fit highlight-current-row
13
    <el-table :key='tableKey' :data="list" v-loading="listLoading" border fit highlight-current-row
14
      style="width: 100%;min-height:550px;">
14
      style="width: 100%;min-height:550px;">
52
          <span>{{scope.row.bridgeName}}</span>
52
          <span>{{scope.row.bridgeName}}</span>
53
        </template>
53
        </template>
54
      </el-table-column>
54
      </el-table-column>
55
      <el-table-column align="center" label="Actions" width="260px" class-name="small-padding fixed-width">
55
      <el-table-column align="center" label="操作" width="260px" class-name="small-padding fixed-width">
56
        <template slot-scope="scope"> 
56
        <template slot-scope="scope"> 
57
          <el-button :type="((!scope.row.active) ? 'info' : 'primary')" size="mini" @click="handleUpdate(scope.row)" :disabled='!scope.row.active'>编辑</el-button> 
58
          <el-button size="mini" :type="((!scope.row.active) ? 'info' : 'danger')" @click="handleModifyStatus(scope.row,'deleted')" :disabled='!scope.row.active'>停用
57
          <el-button v-waves :type="((!scope.row.active) ? 'info' : 'primary')" size="mini" @click="handleUpdate(scope.row)" :disabled='!scope.row.active'>编辑</el-button> 
58
          <el-button v-waves size="mini" :type="((!scope.row.active) ? 'info' : 'danger')" @click="handleModifyStatus(scope.row,'deleted')" :disabled='!scope.row.active'>停用
59
          </el-button>
59
          </el-button>
60
           <el-button size="mini" :type="((!scope.row.active) ? 'info' : 'primary')" @click="distribution(scope.row)" :disabled='!scope.row.active'>分配权限
60
           <el-button v-waves size="mini" :type="((!scope.row.active) ? 'info' : 'primary')" @click="distribution(scope.row)" :disabled='!scope.row.active'>分配权限
61
          </el-button>
61
          </el-button>
62
        </template>
62
        </template>
63
        
63