Browse Source

修正过后

lipengtao 6 years ago
parent
commit
a6de0f4455

+ 3 - 2
src/api/sensorAdmin.js

46
}
46
}
47
47
48
/*  传感器所属采集盒编号列表 */
48
/*  传感器所属采集盒编号列表 */
49
export function DeviceOfservice() {
49
export function DeviceOfservice(params) {
50
  return request({
50
  return request({
51
    url: '/ajax/envData/server/typeCode',
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
          <div class="tagCardText">
7
          <div class="tagCardText">
8
            <span>{{item.name}}</span>
8
            <span>{{item.name}}</span>
9
          </div>
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
        </el-card>
11
        </el-card>
12
      </div>
12
      </div>
13
    </div>
13
    </div>
26
          '01': '℃',
26
          '01': '℃',
27
          '02': '%',
27
          '02': '%',
28
          '03': 'kPa',
28
          '03': 'kPa',
29
          '04': 'm3/h'
29
          '04': 'm³/h'
30
        }
30
        }
31
      }
31
      }
32
    },
32
    },
33
    created() {
33
    created() {
34
      this.list.sort((a, b) => {
35
        return a.unit - b.unit
36
      })
34
      for (let i = 0; i < this.list.length; i++) {
37
      for (let i = 0; i < this.list.length; i++) {
35
        this.arr[this.list[i].code] = this.list[i].unit
38
        this.arr[this.list[i].code] = this.list[i].unit
36
      }
39
      }

+ 6 - 7
src/router/index.js

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

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

64
    ])
64
    ])
65
  },
65
  },
66
  created() {
66
  created() {
67
    console.log(this.$store)
68
    this.getBridgeLists()
67
    this.getBridgeLists()
69
  },
68
  },
70
  methods: {
69
  methods: {

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

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

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

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

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

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

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

6
      </div>
6
      </div>
7
      <div class="load-box" v-loading="loadprogress">
7
      <div class="load-box" v-loading="loadprogress">
8
        <el-row class="line-chart-box">
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
          </el-col>
11
          </el-col>
12
        </el-row>
12
        </el-row>
13
      </div>
13
      </div>
29
        alarmList: [],
29
        alarmList: [],
30
        loadprogress: false,
30
        loadprogress: false,
31
        array: [],
31
        array: [],
32
        truObject: {}
32
        truObject: {},
33
        echartsObj: {
34
          legend: [],
35
          xAxis: [],
36
          yAxis: [],
37
          series: []
38
        }
33
      }
39
      }
34
    },
40
    },
35
    components: {
41
    components: {
44
      this.getDustrurDetail()
50
      this.getDustrurDetail()
45
    },
51
    },
46
    methods: {
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
      getDustrurDetail() {
78
      getDustrurDetail() {
48
        this.loadprogress = true
79
        this.loadprogress = true
49
        request({
80
        request({
56
        }).then(res => {
87
        }).then(res => {
57
          if (res.success) {
88
          if (res.success) {
58
            const $data = res.data
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
            Object.keys($data).forEach(key => {
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
                    const startTime = parseTime(item.createTime, true, true).substr(0, 16)
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
            this.loadprogress = false
151
            this.loadprogress = false
138
          }
152
          }
139
        })
153
        })

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

6
  import echarts from 'echarts'
6
  import echarts from 'echarts'
7
  require('echarts/theme/macarons') // echarts theme
7
  require('echarts/theme/macarons') // echarts theme
8
  import { debounce } from '@/utils'
8
  import { debounce } from '@/utils'
9
10
  export default {
9
  export default {
11
    props: {
10
    props: {
12
      lineColor: {
13
        type: Number,
14
        default: 0
15
      },
11
16
      className: {
12
      className: {
17
        type: String,
13
        type: String,
18
        default: 'chart'
14
        default: 'chart'
23
      },
19
      },
24
      height: {
20
      height: {
25
        type: String,
21
        type: String,
26
        default: '350px'
22
        default: '600px'
27
      },
23
      },
28
      autoResize: {
24
      autoResize: {
29
        type: Boolean,
25
        type: Boolean,
41
    },
37
    },
42
    data() {
38
    data() {
43
      return {
39
      return {
44
        lineColorNow: this.lineColor % 2 === 0 ? '#FF005A' : '#3888fa',
45
        chart: null
40
        chart: null
46
      }
41
      }
47
    },
42
    },
78
    methods: {
73
    methods: {
79
      setOptions(datastr) {
74
      setOptions(datastr) {
80
        this.chart.setOption({
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
          tooltip: {
77
          tooltip: {
97
            trigger: 'axis',
78
            trigger: 'axis',
98
            axisPointer: {
79
            axisPointer: {
99
              type: 'cross'
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
          legend: {
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
          this.chart.setOption({
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
            dataZoom: [
119
            dataZoom: [
166
              {
120
              {
167
                type: 'slider',
121
                type: 'slider',

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

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

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

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

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

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

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

68
          Cookies.remove('bridgeName')
68
          Cookies.remove('bridgeName')
69
          this.showName = ''
69
          this.showName = ''
70
        } else {
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
          this.bridgeId = Cookies.get('bridgeId')
76
          this.bridgeId = Cookies.get('bridgeId')
73
          this.showName = Cookies.get('bridgeName')
77
          this.showName = Cookies.get('bridgeName')
74
          this.getBridgeLists()
78
          this.getBridgeLists()
79
      if (this.$route.name === 'dashboard') {
83
      if (this.$route.name === 'dashboard') {
80
        this.dashFalg = false
84
        this.dashFalg = false
81
      } else {
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
      this.bridgeId = Cookies.get('bridgeId')
92
      this.bridgeId = Cookies.get('bridgeId')
85
      this.showName = Cookies.get('bridgeName')
93
      this.showName = Cookies.get('bridgeName')