Bladeren bron

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

lipengtao 6 jaren geleden
bovenliggende
commit
ff824a1fe0

+ 9 - 0
src/api/bridge.js

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

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

23
      </el-table-column>
23
      </el-table-column>
24
      <el-table-column min-width="150px" align="center" label="桥梁位置">
24
      <el-table-column min-width="150px" align="center" label="桥梁位置">
25
        <template slot-scope="scope">
25
        <template slot-scope="scope">
26
          <span>{{scope.row.location}}</span>
26
          <span>{{citys[scope.row.addrCode]}}</span>
27
        </template>
27
        </template>
28
      </el-table-column>
28
      </el-table-column>
29
      <el-table-column min-width="150px" align="center" label="维护机构">
29
      <el-table-column min-width="150px" align="center" label="维护机构">
147
</template>
147
</template>
148
148
149
<script>
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
import waves from '@/directive/waves'
151
import waves from '@/directive/waves'
152
import city from '../../city/linkage'
152
import city from '../../city/linkage'
153
export default {
153
export default {
226
      }
226
      }
227
    }
227
    }
228
    return {
228
    return {
229
      provinceCityCounties: [],
230
      citys: [],
229
      edit: '',
231
      edit: '',
230
      imageUrl: '',
232
      imageUrl: '',
231
      ruleForm2: {
233
      ruleForm2: {
292
    }
294
    }
293
  },
295
  },
294
  created() {
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
  components: {
309
  components: {
298
    city
310
    city
433
      this.dialogTableVisible = true
445
      this.dialogTableVisible = true
434
      this.imageUrl = '/data/bridge' + row.img
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
    handleSelect(item) {
448
    handleSelect(item) {
463
      this.ruleForm2.deviceId = item.id
449
      this.ruleForm2.deviceId = item.id
464
    },
450
    },

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

213
            addDevice(this.ruleForm2).then(response => {
213
            addDevice(this.ruleForm2).then(response => {
214
              this.getList()
214
              this.getList()
215
              setTimeout(function() {
215
              setTimeout(function() {
216
                that.pop('已成功添加传感器')
216
                that.pop('已成功添加服务器')
217
              }, 1000)
217
              }, 1000)
218
              this.resetForm(this.ruleForm2)
218
              this.resetForm(this.ruleForm2)
219
              this.dialogTableVisible = false
219
              this.dialogTableVisible = false
226
            updateDevice(par).then(response => {
226
            updateDevice(par).then(response => {
227
              if (response.success) {
227
              if (response.success) {
228
                setTimeout(function() {
228
                setTimeout(function() {
229
                  that.pop('已成功更新传感器')
229
                  that.pop('已成功更新服务器')
230
                }, 1000)
230
                }, 1000)
231
                this.resetForm('ruleForm2')
231
                this.resetForm('ruleForm2')
232
                this.getList()
232
                this.getList()
361
    },
361
    },
362
    handleSelect(item) {
362
    handleSelect(item) {
363
      this.ruleForm2.bridgeId = item.id
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
    </el-select>
35
    </el-select>
36
  </div>
36
  </div>
37
</template>
37
</template>
38
39
<script>
38
<script>
40
import axios from 'axios'
39
import axios from 'axios'
41
export default {
40
export default {
86
      var that = this
85
      var that = this
87
      axios.get('/ajax/dict/items?dict=XZQH').then(function(response) {
86
      axios.get('/ajax/dict/items?dict=XZQH').then(function(response) {
88
        if (response.status === 200) {
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
          that.province = []
91
          that.province = []
91
          that.city = []
92
          that.city = []
92
          that.block = []
93
          that.block = []

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

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

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

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

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

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