Browse Source

用户管理页面及管理员页面

lipengtao 6 years ago
parent
commit
ff824a1fe0

+ 9 - 0
src/api/bridge.js

@ -80,3 +80,12 @@ export function uploadBridgeImg() {
80 80
  })
81 81
}
82 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
}

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

@ -213,7 +213,7 @@ export default {
213 213
            addDevice(this.ruleForm2).then(response => {
214 214
              this.getList()
215 215
              setTimeout(function() {
216
                that.pop('已成功添加传感器')
216
                that.pop('已成功添加采集盒')
217 217
              }, 1000)
218 218
              this.resetForm(this.ruleForm2)
219 219
              this.dialogTableVisible = false
@ -226,7 +226,7 @@ export default {
226 226
            updateDevice(par).then(response => {
227 227
              if (response.success) {
228 228
                setTimeout(function() {
229
                  that.pop('已成功更新传感器')
229
                  that.pop('已成功更新采集盒')
230 230
                }, 1000)
231 231
                this.resetForm('ruleForm2')
232 232
                this.getList()
@ -295,7 +295,7 @@ export default {
295 295
        deleteDevice({ id: row.id }).then(response => {
296 296
          if (response.success) {
297 297
            this.getList()
298
            this.pop('已成功删除该传感器')
298
            this.pop('已成功删除该采集盒')
299 299
            /*  this.$message({
300 300
              type: 'success',
301 301
              message: '已成功删除该采集盒!'

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

@ -23,7 +23,7 @@
23 23
      </el-table-column>
24 24
      <el-table-column min-width="150px" align="center" label="桥梁位置">
25 25
        <template slot-scope="scope">
26
          <span>{{scope.row.location}}</span>
26
          <span>{{citys[scope.row.addrCode]}}</span>
27 27
        </template>
28 28
      </el-table-column>
29 29
      <el-table-column min-width="150px" align="center" label="维护机构">
@ -147,7 +147,7 @@
147 147
</template>
148 148
149 149
<script>
150
import { addDevice, updateDevice, deleteDevice, pageQueryDevice, DeviceOfservice, checkDeviceCode, checkBridgeShortName, checkBridgeName } from '@/api/bridge'
150
import { addDevice, updateDevice, deleteDevice, pageQueryDevice, checkDeviceCode, checkBridgeShortName, checkBridgeName, dictory } from '@/api/bridge'
151 151
import waves from '@/directive/waves'
152 152
import city from '../../city/linkage'
153 153
export default {
@ -226,6 +226,8 @@ export default {
226 226
      }
227 227
    }
228 228
    return {
229
      provinceCityCounties: [],
230
      citys: [],
229 231
      edit: '',
230 232
      imageUrl: '',
231 233
      ruleForm2: {
@ -292,7 +294,17 @@ export default {
292 294
    }
293 295
  },
294 296
  created() {
295
    this.getList()
297
    dictory().then(response => {
298
      if (response.success) {
299
        this.provinceCityCounties = response.data.sort((obj1, obj2) => {
300
          return obj1.code - obj2.code
301
        })
302
        response.data.map(item => {
303
          this.citys[item.code] = item.fullCaption
304
        })
305
        this.getList()
306
      }
307
    })
296 308
  },
297 309
  components: {
298 310
    city
@ -433,32 +445,6 @@ export default {
433 445
      this.dialogTableVisible = true
434 446
      this.imageUrl = '/data/bridge' + row.img
435 447
    },
436
    querySearchAsync(queryString, cb) {
437
      if (queryString === '') {
438
        cb([])
439
        return
440
      }
441
      this.ruleForm2.deviceId = ''
442
      clearTimeout(this.timeout)
443
      this.timeout = setTimeout(() => {
444
        DeviceOfservice({ code: this.ruleForm2.device }).then(response => {
445
          const $info = response.data
446
          if ($info.length) {
447
            const $data = $info.map(item => {
448
              return { 'value': item.code, 'id': item.id }
449
            })
450
            cb($data)
451
            if ($info.length === 1 && this.ruleForm2.bridge === $info[0].code) {
452
              this.ruleForm2.deviceId = $info[0].id
453
            } else {
454
              this.ruleForm2.deviceId = ''
455
            }
456
          } else {
457
            cb([])
458
          }
459
        })
460
      }, 3000 * Math.random())
461
    },
462 448
    handleSelect(item) {
463 449
      this.ruleForm2.deviceId = item.id
464 450
    },

+ 2 - 3
src/views/baseInfoManage/serversConfig/index.vue

@ -213,7 +213,7 @@ export default {
213 213
            addDevice(this.ruleForm2).then(response => {
214 214
              this.getList()
215 215
              setTimeout(function() {
216
                that.pop('已成功添加传感器')
216
                that.pop('已成功添加服务器')
217 217
              }, 1000)
218 218
              this.resetForm(this.ruleForm2)
219 219
              this.dialogTableVisible = false
@ -226,7 +226,7 @@ export default {
226 226
            updateDevice(par).then(response => {
227 227
              if (response.success) {
228 228
                setTimeout(function() {
229
                  that.pop('已成功更新传感器')
229
                  that.pop('已成功更新服务器')
230 230
                }, 1000)
231 231
                this.resetForm('ruleForm2')
232 232
                this.getList()
@ -361,7 +361,6 @@ export default {
361 361
    },
362 362
    handleSelect(item) {
363 363
      this.ruleForm2.bridgeId = item.id
364
      console.log(item.id)
365 364
    }
366 365
  }
367 366
}

+ 3 - 2
src/views/city/linkage.vue

@ -35,7 +35,6 @@
35 35
    </el-select>
36 36
  </div>
37 37
</template>
38
39 38
<script>
40 39
import axios from 'axios'
41 40
export default {
@ -86,7 +85,9 @@ export default {
86 85
      var that = this
87 86
      axios.get('/ajax/dict/items?dict=XZQH').then(function(response) {
88 87
        if (response.status === 200) {
89
          var data = response.data.data
88
          var data = response.data.data.sort((obj1, obj2) => {
89
            return obj1.code - obj2.code
90
          })
90 91
          that.province = []
91 92
          that.city = []
92 93
          that.block = []

+ 4 - 0
src/views/peoplesManage/infoManage/editUser.vue

@ -95,6 +95,8 @@ export default {
95 95
      } else {
96 96
        if (!regTel.test(value)) {
97 97
          callback(new Error('手机号码格式不正确'))
98
        } else {
99
          callback()
98 100
        }
99 101
      }
100 102
    }
@ -105,6 +107,8 @@ export default {
105 107
      } else {
106 108
        if (!regTel.test(value)) {
107 109
          callback(new Error('邮箱格式不正确'))
110
        } else {
111
          callback()
108 112
        }
109 113
      }
110 114
    }

+ 4 - 0
src/views/peoplesManage/infoManage/editUserPermissions.vue

@ -181,6 +181,10 @@ export default {
181 181
      this.tableData3.map(item => {
182 182
        this.arr.push(item.address)
183 183
      })
184
      if (!this.arr.length) {
185
        this.$message.error('请至少选择一个桥梁')
186
        return
187
      }
184 188
      updatePermission({ id: this.id, bridges: this.arr }).then(response => {
185 189
        if (response.success) {
186 190
          this.tableData3 = []

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

@ -10,7 +10,6 @@
10 10
      <el-button class="filter-item" style="margin-left: 10px;" @click="handleFilter" type="primary" icon="el-icon-search">查找</el-button>
11 11
      <el-button class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="el-icon-edit">添加用户</el-button>
12 12
    </div>
13
14 13
    <el-table :key='tableKey' :data="list" v-loading="listLoading" border fit highlight-current-row
15 14
      style="width: 100%;min-height:550px;">
16 15
      <el-table-column width="110px" align="center" label="账号">
@ -64,7 +63,6 @@
64 63
      </el-table-column>
65 64
    </el-table>
66 65
    <editUser :dialog="dialogTableVisible" @chilF='chilF' :id='edit'></editUser>
67
    <editSystemMessage></editSystemMessage>
68 66
    <editUserPermissions :dialog='dialogPerssion' @chilF='chilF' :id='edit'></editUserPermissions>
69 67
    <div class="pagination-container" style="text-align:center;">
70 68
      <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listQuery.page" :page-size="listQuery.limit" layout="prev, pager, next, jumper" :total="total">
@ -77,7 +75,6 @@
77 75
import { deleteUser, queryResponsibleBridge, pageQueryUser } from '@/api/userManagemen'
78 76
import waves from '@/directive/waves'
79 77
import editUser from './editUser'
80
import editSystemMessage from './editSystemMessage'
81 78
import editUserPermissions from './editUserPermissions'
82 79
83 80
export default {
@ -98,7 +95,6 @@ export default {
98 95
        account: '',
99 96
        name: '',
100 97
        comp: '',
101
        active: 0,
102 98
        pageSize: 10,
103 99
        pageNo: 1
104 100
      }
@ -114,7 +110,6 @@ export default {
114 110
  },
115 111
  components: {
116 112
    editUser,
117
    editSystemMessage,
118 113
    editUserPermissions
119 114
  },
120 115
  methods: {
@ -203,4 +198,4 @@ export default {
203 198
  .editTe{
204 199
    margin: 10px 0 0 22px
205 200
  }
206
</style>
201
</style>