Browse Source

修正关于管理员内容的bug

lipengtao 6 years ago
parent
commit
a0e531a04a

+ 32 - 28
src/views/baseInfoManage/boxesConfig/index.vue

196
        if (valid) {
196
        if (valid) {
197
          if (!this.edit) {
197
          if (!this.edit) {
198
            addDevice(this.ruleForm2).then(response => {
198
            addDevice(this.ruleForm2).then(response => {
199
              this.getList()
200
              setTimeout(function() {
201
                that.pop('已成功添加采集盒')
202
              }, 1000)
203
              this.resetForm('ruleForm2')
204
              this.dialogTableVisible = false
199
              if (response.success) {
200
                this.getList()
201
                setTimeout(function() {
202
                  that.pop('已成功添加采集盒')
203
                }, 1000)
204
                this.resetForm('ruleForm2')
205
                this.dialogTableVisible = false
206
              }
205
            }).catch(error => {
207
            }).catch(error => {
206
              console.log(error)
208
              console.log(error)
207
            })
209
            })
244
      var that = this
246
      var that = this
245
      this.listLoading = true
247
      this.listLoading = true
246
      pageQueryDevice(this.listQuery).then(response => {
248
      pageQueryDevice(this.listQuery).then(response => {
247
        const $data = response.data.data
248
        var hdata = { num: 1, data: $data }
249
        for (let i = 0; i < $data.length; i++) {
250
          hdata.num++
251
          const str = $data[i]
252
          queryBase.getServer(str.serverId, function(sc, value) {
253
            if (sc) {
254
              str.serverName = value.code
255
              hdata.num--
256
              if (hdata.num === 0) {
257
                that.list = hdata.data
249
        if (response.success) {
250
          const $data = response.data.data
251
          var hdata = { num: 1, data: $data }
252
          for (let i = 0; i < $data.length; i++) {
253
            hdata.num++
254
            const str = $data[i]
255
            queryBase.getServer(str.serverId, function(sc, value) {
256
              if (sc) {
257
                str.serverName = value.code
258
                hdata.num--
259
                if (hdata.num === 0) {
260
                  that.list = hdata.data
261
                }
258
              }
262
              }
259
            }
260
          })
261
        }
262
        hdata.num--
263
        if (hdata.num === 0) {
264
          that.list = hdata.data
263
            })
264
          }
265
          hdata.num--
266
          if (hdata.num === 0) {
267
            that.list = hdata.data
268
          }
269
          that.total = response.data.total
270
          setTimeout(() => {
271
            that.listLoading = false
272
          }, 1.5 * 1000)
265
        }
273
        }
266
        that.total = response.data.total
267
        setTimeout(() => {
268
          that.listLoading = false
269
        }, 1.5 * 1000)
270
      })
274
      })
271
    },
275
    },
272
    handleFilter() {
276
    handleFilter() {
340
      this.ruleForm2.serverId = ''
344
      this.ruleForm2.serverId = ''
341
      clearTimeout(this.timeout)
345
      clearTimeout(this.timeout)
342
      this.timeout = setTimeout(() => {
346
      this.timeout = setTimeout(() => {
343
        DeviceOfservice({ code: this.ruleForm2.server }).then(response => {
347
        DeviceOfservice({ code: this.ruleForm2.server, active: 1 }).then(response => {
344
          const $info = response.data
348
          const $info = response.data
345
          if ($info.length) {
349
          if ($info.length) {
346
            const $data = $info.map(item => {
350
            const $data = $info.map(item => {

+ 15 - 11
src/views/baseInfoManage/bridgesInfo/index.vue

313
        if (valid) {
313
        if (valid) {
314
          if (!this.edit) {
314
          if (!this.edit) {
315
            addDevice(this.ruleForm2).then(response => {
315
            addDevice(this.ruleForm2).then(response => {
316
              this.getList()
317
              setTimeout(function() {
318
                that.pop('已成功添加桥梁')
319
              }, 1000)
320
              this.resetForm('ruleForm2')
321
              this.dialogTableVisible = false
316
              if (response.success) {
317
                this.getList()
318
                setTimeout(function() {
319
                  that.pop('已成功添加桥梁')
320
                }, 1000)
321
                this.resetForm('ruleForm2')
322
                this.dialogTableVisible = false
323
              }
322
            }).catch(error => {
324
            }).catch(error => {
323
              console.log(error)
325
              console.log(error)
324
            })
326
            })
368
    getList() {
370
    getList() {
369
      this.listLoading = true
371
      this.listLoading = true
370
      pageQueryDevice(this.listQuery).then(response => {
372
      pageQueryDevice(this.listQuery).then(response => {
371
        this.list = response.data.data
372
        this.total = response.data.total
373
        setTimeout(() => {
374
          this.listLoading = false
375
        }, 1.5 * 1000)
373
        if (response.success) {
374
          this.list = response.data.data
375
          this.total = response.data.total
376
          setTimeout(() => {
377
            this.listLoading = false
378
          }, 1.5 * 1000)
379
        }
376
      })
380
      })
377
    },
381
    },
378
    handleFilter() {
382
    handleFilter() {

+ 34 - 30
src/views/baseInfoManage/sensorsConfig/index.vue

241
        if (valid) {
241
        if (valid) {
242
          if (!this.edit) {
242
          if (!this.edit) {
243
            addDevice(this.ruleForm2).then(response => {
243
            addDevice(this.ruleForm2).then(response => {
244
              this.getList()
245
              setTimeout(function() {
246
                that.pop('已成功添加传感器')
247
              }, 1000)
248
              this.resetForm('ruleForm2')
249
              this.dialogTableVisible = false
244
              if (response.success) {
245
                this.getList()
246
                setTimeout(function() {
247
                  that.pop('已成功添加传感器')
248
                }, 1000)
249
                this.resetForm('ruleForm2')
250
                this.dialogTableVisible = false
251
              }
250
            }).catch(error => {
252
            }).catch(error => {
251
              console.log(error)
253
              console.log(error)
252
            })
254
            })
290
      var that = this
292
      var that = this
291
      this.listLoading = true
293
      this.listLoading = true
292
      pageQueryDevice(that.listQuery).then(response => {
294
      pageQueryDevice(that.listQuery).then(response => {
293
        var $data = response.data.data
294
        var hdata = { num: 1, data: $data }
295
        for (let i = 0; i < $data.length; i++) {
296
          hdata.num++
297
          $data[i].cableType = that.cableMain[$data[i].cableType]
298
          $data[i].locType = that.addr[$data[i].locType]
299
          const str = $data[i]
300
          queryBase.getDevice(str.deviceId, function(sc, value) {
301
            if (sc) {
302
              str.deviceName = value.code
303
              hdata.num--
304
              if (hdata.num === 0) {
305
                that.listG = hdata.data
295
        if (response.success) {
296
          var $data = response.data.data
297
          var hdata = { num: 1, data: $data }
298
          for (let i = 0; i < $data.length; i++) {
299
            hdata.num++
300
            $data[i].cableType = that.cableMain[$data[i].cableType]
301
            $data[i].locType = that.addr[$data[i].locType]
302
            const str = $data[i]
303
            queryBase.getDevice(str.deviceId, function(sc, value) {
304
              if (sc) {
305
                str.deviceName = value.code
306
                hdata.num--
307
                if (hdata.num === 0) {
308
                  that.listG = hdata.data
309
                }
306
              }
310
              }
307
            }
308
          })
309
        }
310
        hdata.num--
311
        if (hdata.num === 0) {
312
          that.listG = hdata.data
311
            })
312
          }
313
          hdata.num--
314
          if (hdata.num === 0) {
315
            that.listG = hdata.data
316
          }
317
          that.total = response.data.total
318
          setTimeout(() => {
319
            that.listLoading = false
320
          }, 1.5 * 1000)
313
        }
321
        }
314
        that.total = response.data.total
315
        setTimeout(() => {
316
          that.listLoading = false
317
        }, 1.5 * 1000)
318
      })
322
      })
319
    },
323
    },
320
    handleFilter() {
324
    handleFilter() {
385
      this.ruleForm2.deviceId = ''
389
      this.ruleForm2.deviceId = ''
386
      clearTimeout(this.timeout)
390
      clearTimeout(this.timeout)
387
      this.timeout = setTimeout(() => {
391
      this.timeout = setTimeout(() => {
388
        DeviceOfservice({ code: this.ruleForm2.device }).then(response => {
392
        DeviceOfservice({ code: this.ruleForm2.device, active: 1 }).then(response => {
389
          const $info = response.data
393
          const $info = response.data
390
          if ($info.length) {
394
          if ($info.length) {
391
            const $data = $info.map(item => {
395
            const $data = $info.map(item => {

+ 32 - 28
src/views/baseInfoManage/serversConfig/index.vue

196
        if (valid) {
196
        if (valid) {
197
          if (!this.edit) {
197
          if (!this.edit) {
198
            addDevice(this.ruleForm2).then(response => {
198
            addDevice(this.ruleForm2).then(response => {
199
              this.getList()
200
              setTimeout(function() {
201
                that.pop('已成功添加服务器')
202
              }, 1000)
203
              this.resetForm('ruleForm2')
204
              this.dialogTableVisible = false
199
              if (response.success) {
200
                this.getList()
201
                setTimeout(function() {
202
                  that.pop('已成功添加服务器')
203
                }, 1000)
204
                this.resetForm('ruleForm2')
205
                this.dialogTableVisible = false
206
              }
205
            }).catch(error => {
207
            }).catch(error => {
206
              console.log(error)
208
              console.log(error)
207
            })
209
            })
244
      var that = this
246
      var that = this
245
      this.listLoading = true
247
      this.listLoading = true
246
      pageQueryDevice(this.listQuery).then(response => {
248
      pageQueryDevice(this.listQuery).then(response => {
247
        const $data = response.data.data
248
        var hdata = { num: 1, data: $data }
249
        for (let i = 0; i < $data.length; i++) {
250
          hdata.num++
251
          const str = $data[i]
252
          queryBase.getBridge(str.bridgeId, function(sc, value) {
253
            if (sc) {
254
              str.bridgeName = value.shortName
255
              hdata.num--
256
              if (hdata.num === 0) {
257
                that.list = hdata.data
249
        if (response.success) {
250
          const $data = response.data.data
251
          var hdata = { num: 1, data: $data }
252
          for (let i = 0; i < $data.length; i++) {
253
            hdata.num++
254
            const str = $data[i]
255
            queryBase.getBridge(str.bridgeId, function(sc, value) {
256
              if (sc) {
257
                str.bridgeName = value.shortName
258
                hdata.num--
259
                if (hdata.num === 0) {
260
                  that.list = hdata.data
261
                }
258
              }
262
              }
259
            }
260
          })
261
        }
262
        hdata.num--
263
        if (hdata.num === 0) {
264
          that.list = hdata.data
263
            })
264
          }
265
          hdata.num--
266
          if (hdata.num === 0) {
267
            that.list = hdata.data
268
          }
269
          that.total = response.data.total
270
          setTimeout(() => {
271
            that.listLoading = false
272
          }, 1.5 * 1000)
265
        }
273
        }
266
        that.total = response.data.total
267
        setTimeout(() => {
268
          that.listLoading = false
269
        }, 1.5 * 1000)
270
      })
274
      })
271
    },
275
    },
272
    handleFilter() {
276
    handleFilter() {
291
        deleteDevice({ id: row.id }).then(response => {
295
        deleteDevice({ id: row.id }).then(response => {
292
          if (response.success) {
296
          if (response.success) {
293
            this.getList()
297
            this.getList()
294
            this.pop('已成功删除该传感器')
298
            this.pop('已成功删除该服务器')
295
          }
299
          }
296
        })
300
        })
297
      }).catch(() => {
301
      }).catch(() => {

+ 8 - 6
src/views/peoplesManage/infoManage/editUser.vue

189
        if (valid) {
189
        if (valid) {
190
          if (!this.edit) {
190
          if (!this.edit) {
191
            addRegister(this.ruleForm2).then(response => {
191
            addRegister(this.ruleForm2).then(response => {
192
              this.$emit('chilF')
193
              setTimeout(function() {
194
                that.pop('已成功添加')
195
              }, 1000)
196
              this.resetForm(this.ruleForm2)
197
              this.dialogTableVisible = false
192
              if (response.success) {
193
                this.$emit('chilF')
194
                setTimeout(function() {
195
                  that.pop('已成功添加')
196
                }, 1000)
197
                this.resetForm(this.ruleForm2)
198
                this.dialogTableVisible = false
199
              }
198
            }).catch(error => {
200
            }).catch(error => {
199
              console.log(error)
201
              console.log(error)
200
            })
202
            })

+ 9 - 7
src/views/peoplesManage/infoManage/editUserPermissions.vue

138
  methods: {
138
  methods: {
139
    getAllBridges() {
139
    getAllBridges() {
140
      DeviceOfservice({ key: this.state4, active: 1 }).then(response => {
140
      DeviceOfservice({ key: this.state4, active: 1 }).then(response => {
141
        const $info = response.data
142
        if ($info.length) {
143
          this.bridgeListsChecked.push($info[0].id)
144
          const $data = $info.map(item => {
145
            return { 'value': item.shortName, 'id': item.id }
146
             return { 'value': item.shortName, 'id': item.id })
147
          this.bridgeLists = $data
141
        if (response.success) {
142
          const $info = response.data
143
          if ($info.length) {
144
            this.bridgeListsChecked.push($info[0].id)
145
            const $data = $info.map(item => {
146
              return { 'value': item.shortName, 'id': item.id    return { 'value': item.shortName, 'id': item.id }
147
            })
148
            this.bridgeLists = $data
149
          }
148
        }
150
        }
149
      })
151
      })
150
    },
152
    },

+ 25 - 23
src/views/peoplesManage/infoManage/index.vue

117
    getList() {
117
    getList() {
118
      this.listLoading = true
118
      this.listLoading = true
119
      pageQueryUser(this.listQuery).then(response => {
119
      pageQueryUser(this.listQuery).then(response => {
120
        if (response.data === null) {
121
          this.list = []
122
          this.total = 0
120
        if (response.success) {
121
          if (response.data === null) {
122
            this.list = []
123
            this.total = 0
124
            setTimeout(() => {
125
              this.listLoading = false
126
            }, 1.5 * 1000)
127
            return
128
          }
129
          const $data = response.data.data
130
          for (let i = 0; i < $data.length; i++) {
131
            $data[i].bridgeName = ''
132
            queryResponsibleBridge({ uid: $data[i].id, active: 1 }).then(response => {
133
              if (response.success) {
134
                const arr = []
135
                const $info = response.data
136
                for (let j = 0; j < $info.length; j++) {
137
                  arr.push($info[j].shortName)
138
                }
139
                $data[i].bridgeName = arr.join(',')
140
              }
141
            })
142
          }
143
          this.list = $data
144
          this.total = response.data.total
123
          setTimeout(() => {
145
          setTimeout(() => {
124
            this.listLoading = false
146
            this.listLoading = false
125
          }, 1.5 * 1000)
147
          }, 1.5 * 1000)
126
          return
127
        }
128
        const $data = response.data.data
129
        for (let i = 0; i < $data.length; i++) {
130
          $data[i].bridgeName = ''
131
          queryResponsibleBridge({ uid: $data[i].id, active: 1 }).then(response => {
132
            if (response.success) {
133
              const arr = []
134
              const $info = response.data
135
              for (let j = 0; j < $info.length; j++) {
136
                arr.push($info[j].shortName)
137
              }
138
              $data[i].bridgeName = arr.join(',')
139
            }
140
             })
141
        }
148
        }
142
        this.list = $data
143
        this.total = response.data.total
144
        setTimeout(() => {
145
          this.listLoading = false
146
        }, 1.5 * 1000)
147
      })
149
      })
148
    },
150
    },
149
    handleFilter() {
151
    handleFilter() {