Browse Source

修正过后

lipengtao 6 years ago
parent
commit
a6de0f4455

+ 3 - 2
src/api/sensorAdmin.js

@ -46,10 +46,11 @@ export function pageQueryDevice(params) {
46 46
}
47 47
48 48
/*  传感器所属采集盒编号列表 */
49
export function DeviceOfservice() {
49
export function DeviceOfservice(params) {
50 50
  return request({
51 51
    url: '/ajax/envData/server/typeCode',
52
    method: 'get'
52
    method: 'get',
53
    params
53 54
  })
54 55
}
55 56

+ 5 - 2
src/components/Detection/index.vue

@ -7,7 +7,7 @@
7 7
          <div class="tagCardText">
8 8
            <span>{{item.name}}</span>
9 9
          </div>
10
          <p style="position: absolute;top: 80px;left:100px;font-size: 24px;">{{item.lastValue}}<span style="font-size:14px;">{{unitObj[item.unit]}}</span></p>
10
          <p style="position: absolute;top: 80px;left:70px;font-size: 24px;">{{item.lastValue}}<span style="font-size:14px;">{{unitObj[item.unit]}}</span></p>
11 11
        </el-card>
12 12
      </div>
13 13
    </div>
@ -26,11 +26,14 @@
26 26
          '01': '℃',
27 27
          '02': '%',
28 28
          '03': 'kPa',
29
          '04': 'm3/h'
29
          '04': 'm³/h'
30 30
        }
31 31
      }
32 32
    },
33 33
    created() {
34
      this.list.sort((a, b) => {
35
        return a.unit - b.unit
36
      })
34 37
      for (let i = 0; i < this.list.length; i++) {
35 38
        this.arr[this.list[i].code] = this.list[i].unit
36 39
      }

+ 6 - 7
src/router/index.js

@ -111,7 +111,7 @@ export const asyncRouterMapGeneralUser = [
111 111
  {
112 112
    path: '',
113 113
    name: 'account',
114
    component: com,
114
    component: Layout,
115 115
    hidden: true,
116 116
    meta: { title: '账户设置' },
117 117
    children: [
@ -198,17 +198,16 @@ export const asyncRouterMapAdmin = [
198 198
    component: Layout,
199 199
    name: 'peoplesManage',
200 200
    meta: {
201
      title: '用户管理系统',
202
      icon: 'peoples',
201
      title: '',
203 202
      roles: ['1']
204 203
    },
205
    alwaysShow: true,
204
    alwaysShow: false,
206 205
    children: [
207 206
      {
208 207
        path: 'infoManage',
209 208
        name: 'infoManage',
210 209
        component: () => import('@/views/peoplesManage/infoManage/index'),
211
        meta: { title: '用户信息管理' }
210
        meta: { title: '用户信息管理', icon: 'peoples' }
212 211
      }
213 212
    ]
214 213
  },
@ -234,7 +233,7 @@ export const asyncRouterMapAdmin = [
234 233
    component: Layout,
235 234
    name: 'BaseInfoManage',
236 235
    meta: {
237
      title: '声脉系统',
236
      title: '音频监测系统',
238 237
      icon: 'list',
239 238
      roles: ['1']
240 239
    },
@ -264,7 +263,7 @@ export const asyncRouterMapAdmin = [
264 263
    component: Layout,
265 264
    name: 'arefactionManage',
266 265
    meta: {
267
      title: '除湿系统',
266
      title: '除湿监测系统',
268 267
      icon: 'arefaction',
269 268
      roles: ['1']
270 269
    },

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

@ -64,7 +64,6 @@ export default {
64 64
    ])
65 65
  },
66 66
  created() {
67
    console.log(this.$store)
68 67
    this.getBridgeLists()
69 68
  },
70 69
  methods: {

+ 6 - 1
src/views/dehumidificationSystem/airClamp.vue

@ -1,7 +1,7 @@
1 1
<template>
2 2
  <div class="app-container" style="padding-bottom: 0px;padding-top: 0px;">
3 3
    <h4>气夹监测系统</h4>
4
    <div class="filter-container" style="overflow: auto;" v-loading="loadprogress">
4
    <div class="filter-container" style="overflow: auto;" v-loading="loadprogress" v-if="blockShow">
5 5
      <div class="airItem">
6 6
        <p class="pText">上游气夹监测</p>
7 7
        <div class="imgBox">
@ -83,6 +83,7 @@
83 83
      return {
84 84
        saddleObj: {},
85 85
        loadprogress: true,
86
        blockShow: false,
86 87
        bridgeId: '',
87 88
        arr1obj: {
88 89
          txt: '浦口侧上游排气夹',
@ -176,6 +177,10 @@
176 177
      this.bridgeId = Cookies.get('bridgeId')
177 178
      byBridgeAll(this.bridgeId, (res) => {
178 179
        this.loadprogress = false
180
        if (res.server.length === 0) {
181
          return
182
        }
183
        this.blockShow = true
179 184
        const array1 = ['', '', '']
180 185
        const array2 = ['', '', '']
181 186
        const array3 = ['', '']

+ 3 - 0
src/views/dehumidificationSystem/airPreparationStation.vue

@ -24,6 +24,9 @@
24 24
      this.bridgeId = Cookies.get('bridgeId')
25 25
      byBridgeAll(this.bridgeId, (res) => {
26 26
        this.loadprogress = false
27
        if (res.server.length === 0) {
28
          return
29
        }
27 30
        this.saddleObj = res['04']
28 31
      })
29 32
    },

+ 4 - 1
src/views/dehumidificationSystem/anchorChamber.vue

@ -37,8 +37,11 @@
37 37
        }
38 38
        byBridgeAll(this.bridgeId, (res) => {
39 39
          this.loadprogress = false
40
          if (res.server.length === 0) {
41
            return
42
          }
40 43
          const obj = {}
41
          const oFl = { '01': '上游', '02': '下游' }
44
          const oFl = { '01': '上游', '02': '下游', '99': '' }
42 45
          Object.keys(res['03']).forEach((key) => {
43 46
            res['03'][key].forEach((item) => {
44 47
              const index = this.arr.indexOf(item.position)

+ 87 - 73
src/views/dehumidificationSystem/history.vue

@ -6,8 +6,8 @@
6 6
      </div>
7 7
      <div class="load-box" v-loading="loadprogress">
8 8
        <el-row class="line-chart-box">
9
          <el-col :xs="24" :sm="24" :lg="24" v-for="item in alarmList" :key="item.index">
10
            <lineChart :chartData="item" :historyM="historyM"></lineChart>
9
          <el-col :xs="24" :sm="24" :lg="24">
10
            <lineChart :chartData="echartsObj"></lineChart>
11 11
          </el-col>
12 12
        </el-row>
13 13
      </div>
@ -29,7 +29,13 @@
29 29
        alarmList: [],
30 30
        loadprogress: false,
31 31
        array: [],
32
        truObject: {}
32
        truObject: {},
33
        echartsObj: {
34
          legend: [],
35
          xAxis: [],
36
          yAxis: [],
37
          series: []
38
        }
33 39
      }
34 40
    },
35 41
    components: {
@ -44,6 +50,31 @@
44 50
      this.getDustrurDetail()
45 51
    },
46 52
    methods: {
53
      seriesFun(name, stringType, idx, ydata) {
54
        return {
55
          name: name,
56
          type: stringType,
57
          yAxisIndex: idx,
58
          data: ydata
59
        }
60
      },
61
      yAxisFun(name, min, max, position, color, unit) {
62
        return {
63
          type: 'value',
64
          name: name,
65
          min: min,
66
          max: max,
67
          position: position,
68
          axisLine: {
69
            lineStyle: {
70
              color: color
71
            }
72
          },
73
          axisLabel: {
74
            formatter: '{value} ' + unit
75
          }
76
        }
77
      },
47 78
      getDustrurDetail() {
48 79
        this.loadprogress = true
49 80
        request({
@ -56,84 +87,67 @@
56 87
        }).then(res => {
57 88
          if (res.success) {
58 89
            const $data = res.data
59
            const rList = []
60
            const rWsata = {
61
              tit: '',
62
              arr: [],
63
              xData: [],
64
              weData: [],
65
              seData: [],
66
              xInterval: 0
90
            let flag = false
91
            const echObj = {
92
              color: [],
93
              legend: [],
94
              xAxis: [],
95
              yAxis: [],
96
              series: []
67 97
            }
68
            let sf = false
69 98
            Object.keys($data).forEach(key => {
70
              const rData = {
71
                tit: '',
72
                arr: [],
73
                xData: [],
74
                seData: [],
75
                xInterval: 0
76
              }
77
              if (this.truObject[key] === '01' || this.truObject[key] === '02') {
78
                if (this.truObject[key] === '01') {
79
                  rWsata.arr.push('温度')
80
                  rWsata.tit = '温度℃ '
81
                } else {
82
                  rWsata.arr.push('湿度')
83
                  if (rWsata.tit) {
84
                    rWsata.tit += '/ 湿度%'
85
                  } else {
86
                    rWsata.tit += '湿度%'
99
              const idx = echObj.legend.length
100
              switch (this.truObject[key]) {
101
                case '01':
102
                  echObj.color.push('#5793f3')
103
                  echObj.yAxis.push(this.yAxisFun('温度', -50, 100, 'left', '#5793f3', '℃'))
104
                  echObj.series.push(this.seriesFun('温度', 'line', idx, []))
105
                  echObj.legend.push('温度')
106
                  break
107
                case '02':
108
                  const yAxisItem = this.yAxisFun('湿度', 0, 100, 'left', '#d14a61', '%')
109
                  if (idx === 1) {
110
                    yAxisItem.offset = 60
87 111
                  }
88
                }
89
                if (!sf) {
90
                  rList.push(rWsata)
91
                  sf = true
92
                }
93
              } else {
94
                if (this.truObject[key] === '03') {
95
                  rData.arr.push('压力')
96
                  rData.tit = '压力kPa'
97
                } else {
98
                  rData.arr.push('风量')
99
                  rData.tit = '风量m3/h'
100
                }
101
                rList.push(rData)
112
                  echObj.color.push('#d14a61')
113
                  echObj.yAxis.push(yAxisItem)
114
                  echObj.series.push(this.seriesFun('湿度', 'line', idx, []))
115
                  echObj.legend.push('湿度')
116
                  break
117
                case '03':
118
                  echObj.color.push('#675bba')
119
                  echObj.yAxis.push(this.yAxisFun('压力', 0, 250, 'right', '#675bba', 'kPa'))
120
                  echObj.series.push(this.seriesFun('压力', 'bar', idx, []))
121
                  echObj.legend.push('压力')
122
                  break
123
                case '04':
124
                  const yItem = this.yAxisFun('风量', 0, 250, 'right', '#67C23A', 'm³/h')
125
                  if (echObj.color.indexOf('#675bba') >= 0) {
126
                    yItem.offset = 80
127
                  }
128
                  echObj.color.push('#67C23A')
129
                  echObj.yAxis.push(yItem)
130
                  echObj.series.push(this.seriesFun('风量', 'bar', idx, []))
131
                  echObj.legend.push('风量')
132
                  break
102 133
              }
103
              if (this.truObject[key] === '01' || this.truObject[key] === '02') {
104
                rWsata.xData = []
105
                $data[key].forEach((item, index) => {
106
                  if (index % 2 === 0) {
134
              $data[key].forEach((item, index) => {
135
                if (index % 2 === 0) {
136
                  if (!flag) {
107 137
                    const startTime = parseTime(item.createTime, true, true).substr(0, 16)
108
                    rWsata.xData.unshift(startTime)
109
                    if (this.truObject[key] === '02') {
110
                      rWsata.weData.unshift(item.itemValue)
111
                    } else {
112
                      rWsata.seData.unshift(item.itemValue)
113
                    }
114
                  } else {
115
                    rWsata.xData.unshift('')
116
                    if (this.truObject[key] === '02') {
117
                      rWsata.weData.unshift(item.itemValue)
118
                    } else {
119
                      rWsata.seData.unshift(item.itemValue)
120
                    }
138
                    echObj.xAxis.unshift(startTime)
121 139
                  }
122
                })
123
              } else {
124
                $data[key].forEach((item, index) => {
125
                  if (index % 2 === 0) {
126
                    const startTime = parseTime(item.createTime, true, true).substr(0, 16)
127
                    rData.xData.unshift(startTime)
128
                    rData.seData.unshift(item.itemValue)
129
                  } else {
130
                    rData.xData.unshift('')
131
                    rData.seData.unshift(item.itemValue)
140
                  echObj.series[idx].data.unshift(item.itemValue)
141
                } else {
142
                  if (!flag) {
143
                    echObj.xAxis.unshift('')
132 144
                  }
133
                })
134
              }
145
                  echObj.series[idx].data.unshift(item.itemValue)
146
                }
147
              })
148
              flag = true
135 149
            })
136
            this.alarmList = rList
150
            this.echartsObj = echObj
137 151
            this.loadprogress = false
138 152
          }
139 153
        })

+ 33 - 79
src/views/dehumidificationSystem/lineChart/LineChart.vue

@ -6,13 +6,9 @@
6 6
  import echarts from 'echarts'
7 7
  require('echarts/theme/macarons') // echarts theme
8 8
  import { debounce } from '@/utils'
9
10 9
  export default {
11 10
    props: {
12
      lineColor: {
13
        type: Number,
14
        default: 0
15
      },
11
16 12
      className: {
17 13
        type: String,
18 14
        default: 'chart'
@ -23,7 +19,7 @@
23 19
      },
24 20
      height: {
25 21
        type: String,
26
        default: '350px'
22
        default: '600px'
27 23
      },
28 24
      autoResize: {
29 25
        type: Boolean,
@ -41,7 +37,6 @@
41 37
    },
42 38
    data() {
43 39
      return {
44
        lineColorNow: this.lineColor % 2 === 0 ? '#FF005A' : '#3888fa',
45 40
        chart: null
46 41
      }
47 42
    },
@ -78,90 +73,49 @@
78 73
    methods: {
79 74
      setOptions(datastr) {
80 75
        this.chart.setOption({
81
          title: {
82
            text: datastr.tit,
83
            textStyle: {
84
              color: '#333',
85
              fontSize: 14
86
            },
87
            top: '0'
88
          },
89
          grid: {
90
            left: 10,
91
            right: 10,
92
            bottom: 20,
93
            top: 60,
94
            containLabel: true
95
          },
76
          color: [],
96 77
          tooltip: {
97 78
            trigger: 'axis',
98 79
            axisPointer: {
99 80
              type: 'cross'
100
            },
101
            padding: [5, 10]
102
          },
103
          xAxis: {
104
            data: datastr.xData,
105
            max: this.maxXcount
81
            }
106 82
          },
107
          yAxis: {
108
            type: 'value',
109
            max: 100,
110
            min: -90
83
          grid: {
84
            right: '20%'
111 85
          },
112 86
          legend: {
113
            data: datastr.arr
114
          }
87
            data: []
88
          },
89
          xAxis: [
90
            {
91
              type: 'category',
92
              axisTick: {
93
                alignWithLabel: true
94
              },
95
              data: []
96
            }
97
          ],
98
          yAxis: {},
99
          series: [
100
          ]
115 101
        })
116
        if (datastr.arr.length === 2) {
117
          this.chart.setOption({
118
            series: [
119
              {
120
                name: datastr.arr[0], itemStyle: {
121
                  normal: {
122
                    color: this.lineColorNow,
123
                    lineStyle: {
124
                      color: this.lineColorNow,
125
                      width: 2
126
                    }
127
                  }
128
                },
129
                smooth: true,
130
                type: 'line',
131
                data: datastr.seData,
132
                animationDuration: 2800,
133
                animationEasing: 'cubicInOut'
134
              }, {
135
                name: datastr.arr[1],
136
                type: 'line',
137
                data: datastr.weData
138
              }
139
            ]
140
          })
141
        } else {
102
        if (!this.historyM) {
142 103
          this.chart.setOption({
143
            series: [
104
            color: datastr.color,
105
            series: datastr.series,
106
            legend: {
107
              data: datastr.legend
108
            },
109
            xAxis: [
144 110
              {
145
                name: datastr.arr[0], itemStyle: {
146
                  normal: {
147
                    color: this.lineColorNow,
148
                    lineStyle: {
149
                      color: this.lineColorNow,
150
                      width: 2
151
                    }
152
                  }
111
                type: 'category',
112
                axisTick: {
113
                  alignWithLabel: true
153 114
                },
154
                smooth: true,
155
                type: 'line',
156
                data: datastr.seData,
157
                animationDuration: 2800,
158
                animationEasing: 'cubicInOut'
115
                data: datastr.xAxis
159 116
              }
160
            ]
161
          })
162
        }
163
        if (this.historyM) {
164
          this.chart.setOption({
117
            ],
118
            yAxis: datastr.yAxis,
165 119
            dataZoom: [
166 120
              {
167 121
                type: 'slider',

+ 3 - 0
src/views/dehumidificationSystem/saddleRoom.vue

@ -24,6 +24,9 @@
24 24
      this.bridgeId = Cookies.get('bridgeId')
25 25
      byBridgeAll(this.bridgeId, (res) => {
26 26
        this.loadprogress = false
27
        if (res.server.length === 0) {
28
          return
29
        }
27 30
        this.saddleObj = res['02']
28 31
      })
29 32
    },

+ 3 - 0
src/views/dehumidificationSystem/steelBoxGirder.vue

@ -24,6 +24,9 @@
24 24
      this.bridgeId = Cookies.get('bridgeId')
25 25
      byBridgeAll(this.bridgeId, (res) => {
26 26
        this.loadprogress = false
27
        if (res.server.length === 0) {
28
          return
29
        }
27 30
        this.saddleObj = res['05']
28 31
      })
29 32
    },

+ 3 - 3
src/views/dehumidificationSystemAdmin/sensor.vue

@ -54,7 +54,7 @@
54 54
          </el-col>
55 55
          <el-col :span="8">
56 56
            <el-form-item label="所属组" prop="organize">
57
              <el-select v-model="ruleForm2.organize" placeholder="请选择所属系统">
57
              <el-select v-model="ruleForm2.organize" placeholder="请选择所属">
58 58
                <el-option v-for="item in 100" :key="item" :value="item">
59 59
                </el-option>
60 60
              </el-select>
@ -78,7 +78,7 @@
78 78
          <el-col :span="8">
79 79
            <el-form-item label="所属方位" prop="position">
80 80
              <el-autocomplete class="inline-input" v-model="ruleForm2.position" :fetch-suggestions="querySearch"
81
                placeholder="请输入内容" @select="handleSelect">
81
                placeholder="请输入所属方位" @select="handleSelect">
82 82
              </el-autocomplete>
83 83
            </el-form-item>
84 84
          </el-col>
@ -253,7 +253,7 @@
253 253
      }
254 254
    },
255 255
    created() {
256
      DeviceOfservice().then(res => {
256
      DeviceOfservice({ active: 1 }).then(res => {
257 257
        if (res.success) {
258 258
          this.serverList = res.data
259 259
        }

+ 10 - 2
src/views/layout/components/TopNavbar.vue

@ -68,7 +68,11 @@
68 68
          Cookies.remove('bridgeName')
69 69
          this.showName = ''
70 70
        } else {
71
          this.dashFalg = true
71
          if (to.path === '/modifyPassword' || to.path === '/modifyData') {
72
            this.dashFalg = false
73
          } else {
74
            this.dashFalg = true
75
          }
72 76
          this.bridgeId = Cookies.get('bridgeId')
73 77
          this.showName = Cookies.get('bridgeName')
74 78
          this.getBridgeLists()
@ -79,7 +83,11 @@
79 83
      if (this.$route.name === 'dashboard') {
80 84
        this.dashFalg = false
81 85
      } else {
82
        this.dashFalg = true
86
        if (this.$route.name === 'modifyPassword' || this.$route.name === 'modifyData') {
87
          this.dashFalg = false
88
        } else {
89
          this.dashFalg = true
90
        }
83 91
      }
84 92
      this.bridgeId = Cookies.get('bridgeId')
85 93
      this.showName = Cookies.get('bridgeName')