Commit a2a0bc5c by changjin

联调设备接口

parent ca14ed82
......@@ -396,7 +396,7 @@
},
"async-validator": {
"version": "1.8.5",
"resolved": "https://registry.npm.taobao.org/async-validator/download/async-validator-1.8.5.tgz?cache=0&sync_timestamp=1605751734916&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fasync-validator%2Fdownload%2Fasync-validator-1.8.5.tgz",
"resolved": "https://registry.npm.taobao.org/async-validator/download/async-validator-1.8.5.tgz",
"integrity": "sha1-3D4I7B/Q3dtn5ghC8CwM0c7G1/A=",
"requires": {
"babel-runtime": "6.x"
......@@ -3077,7 +3077,7 @@
},
"deepmerge": {
"version": "1.5.2",
"resolved": "https://registry.npm.taobao.org/deepmerge/download/deepmerge-1.5.2.tgz?cache=0&sync_timestamp=1572279720382&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdeepmerge%2Fdownload%2Fdeepmerge-1.5.2.tgz",
"resolved": "http://registry.npm.taobao.org/deepmerge/download/deepmerge-1.5.2.tgz",
"integrity": "sha1-EEmdhohEza1P7ghC34x/bwyVp1M="
},
"default-require-extensions": {
......@@ -8812,7 +8812,7 @@
},
"normalize-wheel": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/normalize-wheel/download/normalize-wheel-1.0.1.tgz",
"resolved": "https://registry.npmjs.org/normalize-wheel/-/normalize-wheel-1.0.1.tgz",
"integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU="
},
"npm-run-path": {
......@@ -12004,7 +12004,7 @@
},
"resize-observer-polyfill": {
"version": "1.5.1",
"resolved": "https://registry.npm.taobao.org/resize-observer-polyfill/download/resize-observer-polyfill-1.5.1.tgz",
"resolved": "http://registry.npm.taobao.org/resize-observer-polyfill/download/resize-observer-polyfill-1.5.1.tgz",
"integrity": "sha1-DpAg3T0hAkRY1OvSfiPkAmmBBGQ="
},
"resolve": {
......@@ -13118,7 +13118,7 @@
},
"throttle-debounce": {
"version": "1.1.0",
"resolved": "https://registry.npm.taobao.org/throttle-debounce/download/throttle-debounce-1.1.0.tgz",
"resolved": "http://registry.npm.taobao.org/throttle-debounce/download/throttle-debounce-1.1.0.tgz?cache=0&other_urls=http%3A%2F%2Fregistry.npm.taobao.org%2Fthrottle-debounce%2Fdownload%2Fthrottle-debounce-1.1.0.tgz",
"integrity": "sha1-UYU9o3vmihVctugns1FKPEIuic0="
},
"through": {
......
......@@ -40,17 +40,17 @@
<el-form label-width="100px">
<el-col :span="18" :offset="1">
<el-form-item label="旧密码" required>
<el-input v-model="data.oldPwd" placeholder="请输入旧密码"></el-input>
<el-input type="password" v-model="data.oldPassword" placeholder="请输入旧密码"></el-input>
</el-form-item>
</el-col>
<el-col :span="18" :offset="1">
<el-form-item label="新密码" required>
<el-input v-model="data.newPwd" placeholder="请输入新密码"></el-input>
<el-input type="password" v-model="data.newPassword" placeholder="请输入新密码"></el-input>
</el-form-item>
</el-col>
<el-col :span="18" :offset="1">
<el-form-item label="确认新密码" required>
<el-input v-model="data.newPwd1" placeholder="再次输入新密码"></el-input>
<el-input type="password" v-model="data.confirmPassword" placeholder="再次输入新密码"></el-input>
</el-form-item>
</el-col>
</el-form>
......@@ -118,6 +118,34 @@ export default {
changePwd () {
this.dialogVisible = true
},
submit () {
if (!this.data.oldPassword) {
this.showAlert('请输入旧密码~')
return false
}
if (!this.data.newPassword) {
this.showAlert('请输入新密码~')
return false
}
if (!this.data.confirmPassword) {
this.showAlert('请输入确认密码~')
return false
}
this.$axios.post('/baseInfo/editAccountPassword', {
"confirmPassword": this.data.confirmPassword,
"newPassword": this.data.newPassword,
"oldPassword": this.data.oldPassword,
}).then((res) =>{
if(res.data.code === '0') {
this.$message({message: '修改成功~',type: 'success'});
this.dialogVisible = false
this.$router.push('/login')
} else {
this.$message({message: '删除失败~',type: 'error'});
}
}).catch(function (eMsg) {
})
},
showAlert: function (cont) {
this.$alert(cont, '温馨提示', {
confirmButtonText: '确定'
......
......@@ -2,47 +2,52 @@
<div class="mainContent">
<div class="tabCont clear">
<p class="font16">监控摄像头001<el-button @click="goBack()" class="right">返回</el-button></p>
<p class="font16">{{data.nickname}}<el-button @click="goBack()" class="right">返回</el-button></p>
<div class="table font14 mt20">
<el-row>
<el-col class="border grayBg" :span="3">设备类型</el-col>
<el-col class="border" :span="5">ddddd</el-col>
<el-col class="border" :span="5"><span v-for="info in data.deviceType">{{info}}</span></el-col>
<el-col class="border grayBg" :span="3">ProductKey</el-col>
<el-col class="border" :span="5">ccccc</el-col>
<el-col class="border" :span="5">{{data.site}}</el-col>
<el-col class="border grayBg" :span="3">地域</el-col>
<el-col class="border" :span="5">11111</el-col>
<el-col class="border" :span="5">{{data.site}}</el-col>
</el-row>
<el-row>
<el-col class="border grayBg" :span="3">节点类型</el-col>
<el-col class="border" :span="5">ddddd</el-col>
<el-col class="border" :span="5">{{data.site}}</el-col>
<el-col class="border grayBg" :span="3">DeviceName</el-col>
<el-col class="border" :span="5">ccccc</el-col>
<el-col class="border" :span="5">{{data.nickname}}</el-col>
<el-col class="border grayBg" :span="3">认证方式</el-col>
<el-col class="border" :span="5">11111</el-col>
<el-col class="border" :span="5">{{data.site}}</el-col>
</el-row>
<el-row>
<el-col class="border grayBg" :span="3">备注名称</el-col>
<el-col class="border" :span="5">ddddd</el-col>
<el-col class="border" :span="5">{{data.site}}</el-col>
<el-col class="border grayBg" :span="3">IP地址</el-col>
<el-col class="border" :span="5">ccccc</el-col>
<el-col class="border" :span="5">{{data.ipAddress}}</el-col>
<el-col class="border grayBg" :span="3">固件版本</el-col>
<el-col class="border" :span="5">11111</el-col>
<el-col class="border" :span="5">{{data.site}}</el-col>
</el-row>
<el-row>
<el-col class="border grayBg" :span="3">创建时间</el-col>
<el-col class="border" :span="5">ddddd</el-col>
<el-col class="border" :span="5">{{data.gmtCreate}}</el-col>
<el-col class="border grayBg" :span="3">激活时间</el-col>
<el-col class="border" :span="5">ccccc</el-col>
<el-col class="border" :span="5">{{data.gmtActive}}</el-col>
<el-col class="border grayBg" :span="3">最后上线时间</el-col>
<el-col class="border" :span="5">11111</el-col>
<el-col class="border" :span="5">{{data.gmtOnline}}</el-col>
</el-row>
<el-row class="borderB">
<el-col class="border grayBg" :span="3">当前状态</el-col>
<el-col class="border" :span="5">ddddd</el-col>
<el-col class="border" :span="5">
<span v-if="data.status === 'DISABLE'">禁用</span>
<span v-if="data.status === 'OFFLINE'">离线</span>
<span v-if="data.status === 'ONLINE'">在线</span>
<span v-if="data.status === 'UNACTIVE'">未激活</span>
</el-col>
<el-col class="border grayBg" :span="3">实时延迟</el-col>
<el-col class="border" :span="5">ccccc</el-col>
<el-col class="border" :span="5">{{data.site}}</el-col>
<el-col class="border grayBg" :span="3">设备本地日志上报</el-col>
<el-col class="border" :span="5">11111</el-col>
<el-col class="border" :span="5">{{data.site}}</el-col>
</el-row>
</div>
</div>
......@@ -57,8 +62,16 @@ export default {
size: '10',
}),
created () {
this.getData()
},
methods: {
getData () {
this.$axios.get('/deviceVehicle/findDeviceDetailById?iotId=' + this.$route.params.id).then((res) =>{
if(res.data.code === '0') {
this.data = res.data.data
}
})
},
goBack () {
this.$router.go(-1)
},
......
......@@ -4,38 +4,42 @@
<div class="searchBox">
<el-row>
<el-form label-width="70px" :model="searchForm">
<el-col :span="8">
<el-col :span="6">
<el-form-item label="设备类型">
<el-select v-model="searchForm.blockId" placeholder="请选择">
<el-option label="不限" value=""></el-option>
<el-option label="男" value="MAN"></el-option>
<el-option label="女" value="WOMAN"></el-option>
<el-option label="未知" value="SECRECY"></el-option>
<el-select v-model="searchForm.groupId" placeholder="请选择">
<el-option value="" label="全部">全部</el-option>
<el-option
v-for="item in typeList"
:key="item.groupId"
:label="item.groupName"
:value="item.groupId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备状态">
<el-select v-model="searchForm.blockId" placeholder="请选择">
<el-col :span="6">
<el-form-item label="在线状态">
<el-select v-model="searchForm.status" placeholder="请选择">
<el-option label="不限" value=""></el-option>
<el-option label="男" value="MAN"></el-option>
<el-option label="女" value="WOMAN"></el-option>
<el-option label="未知" value="SECRECY"></el-option>
<el-option label="禁用" value="DISABLE"></el-option>
<el-option label="离线" value="OFFLINE"></el-option>
<el-option label="在线" value="ONLINE"></el-option>
<el-option label="未激活" value="UNACTIVE"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="设备名称">
<el-input v-model="searchForm.customerName" placeholder="请输入设备名称"></el-input>
<el-input v-model="searchForm.name" placeholder="请输入设备名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<!-- <el-col :span="8">
<p class="font12 prompt"><i class="icon"></i>当前数据已发生变化,请手动刷新<i class="closeIcon"></i></p>
</el-col>
<el-col :span="16" class="text-right">
</el-col> -->
<el-col :span="4" class="mt5" :offset="1">
<el-button @click="getData()">查询</el-button>
<!-- <el-button class="mt5 ml10" @click="reset()">重置</el-button> -->
<el-button type="primary" @click="allotBtn(0)">刷新</el-button>
<!-- <el-button type="primary" @click="allotBtn(0)">刷新</el-button> -->
</el-col>
</el-form>
</el-row>
......@@ -43,13 +47,13 @@
<div class="infoBox">
<el-row>
<el-col :span="5" class="text-left rightLine ml10">
<p>设备数量<b class="ml10">10000</b></p>
<p>设备数量<b class="ml10">{{data1.allCount}}</b></p>
</el-col>
<el-col :span="5" class="text-center rightLine">
<p>在线设备<b class="ml10">10000</b></p>
<p>在线设备<b class="ml10">{{data1.onlineCount}}</b></p>
</el-col>
<el-col :span="5" class="text-center">
<p>离线设备<b class="ml10">10000</b></p>
<p>离线设备<b class="ml10">{{data1.offlineCount}}</b></p>
</el-col>
</el-row>
</div>
......@@ -59,16 +63,23 @@
<div class="title">设备列表</div>
<el-table :data="data.list">
<el-table-column type="index" label="序号"></el-table-column>
<el-table-column prop="name" label="设备名称"></el-table-column>
<el-table-column prop="id" label="设备ID"></el-table-column>
<el-table-column prop="allocateName" label="设备类型"></el-table-column>
<el-table-column prop="allocateTime" label="所在位置"></el-table-column>
<el-table-column prop="setTime" label="是否在线" ></el-table-column>
<el-table-column prop="actualTime" label="最近上线时间" ></el-table-column>
<el-table-column prop="deviceName" label="设备名称"></el-table-column>
<el-table-column prop="iotId" label="设备ID"></el-table-column>
<el-table-column prop="deviceType" label="设备类型"></el-table-column>
<el-table-column prop="ipAddress" label="所在位置"></el-table-column>
<el-table-column prop="status" label="是否在线" >
<template slot-scope="scope">
<span v-if="scope.row.status === 'DISABLE'">禁用</span>
<span v-if="scope.row.status === 'OFFLINE'">离线</span>
<span v-if="scope.row.status === 'ONLINE'">在线</span>
<span v-if="scope.row.status === 'UNACTIVE'">未激活</span>
</template>
</el-table-column>
<el-table-column prop="gmtOnline" label="最近上线时间" ></el-table-column>
<el-table-column label="操作" width="160">
<template slot-scope="scope">
<router-link :to="'/equipment/attribute/' + scope.row.id" class="line">属性</router-link>
<router-link :to="'/equipment/events/' + scope.row.id" class="line ml10">事件</router-link>
<router-link :to="'/equipment/attribute/' + scope.row.iotId" class="line">属性</router-link>
<router-link :to="'/equipment/events/' + scope.row.iotId" class="line ml10">事件</router-link>
</template>
</el-table-column>
</el-table>
......@@ -88,59 +99,53 @@
export default {
data: () => ({
loading: false,
searchForm:{
},
searchForm:{},
data:{
page: '1',
list:[
{
name: '监控摄像001',
id: 'MZ902',
type: '监控设备'
}, {
name: '监控摄像001',
id: 'MZ902',
type: '监控设备'
}, {
name: '监控摄像001',
id: 'MZ902',
type: '监控设备'
}, {
name: '监控摄像001',
id: 'MZ902',
type: '监控设备'
}, {
name: '监控摄像001',
id: 'MZ902',
type: '监控设备'
}, {
name: '监控摄像001',
id: 'MZ902',
type: '监控设备'
}, {
name: '监控摄像001',
id: 'MZ902',
type: '监控设备'
}, {
name: '监控摄像001',
id: 'MZ902',
type: '监控设备'
}, {
name: '监控摄像001',
id: 'MZ902',
type: '监控设备'
}, {
name: '监控摄像001',
id: 'MZ902',
type: '监控设备'
}
]
list:[]
},
size: '10',
typeList: [],
data1: {}
}),
created () {
this.projectId = window.sessionStorage.getItem('projectId')
this.projectId = 'beijing'
this.getTypeList(this.projectId)
this.getData(this.projectId)
},
methods: {
getData(){
this.$axios.post('/deviceVehicle/findDeviceList',{
p: this.data.page,
c: this.size,
groupId: this.searchForm.groupId,
name: this.searchForm.name,
projectId: this.projectId,
status: this.searchForm.status
}).then((res) =>{
if(res.data.code === '0') {
this.data = res.data.data
}
})
this.$axios.post('/deviceVehicle/findDeviceStatusCount',{
groupId: this.searchForm.groupId,
name: this.searchForm.name,
projectId: this.projectId,
status: this.searchForm.status
}).then((res) =>{
if(res.data.code === '0') {
this.data1 = res.data.data
}
})
},
getTypeList (projectId) {
this.$axios.get('/deviceVehicle/findProductTypeList?projectId=' + projectId).then((res) =>{
if(res.data.code === '0') {
this.typeList = res.data.data
}
})
},
handleSizeChange (val) {
this.size = val
this.getData()
......@@ -163,7 +168,7 @@ export default {
</script>
<style scoped lang="less">
.tableCont{
height: calc(100vh - 50px);
height: calc(100vh - 45px);
// .el-table{
// height: calc(100vh - 67px);
// overflow-y: auto;
......
......@@ -203,11 +203,11 @@ export default {
},
addBtn (type,item) {
this.type = type
this.id = item.id
if (type === 0) {
this.title = '新增项目'
} else {
this.title = '修改项目'
this.id = item.id
this.dataForm = {
"cityId": item.cityId,
"cityName": item.cityName,
......
......@@ -21,14 +21,17 @@
<el-col :span="24">
<el-form-item label="权限配置">
<div class="menuList">
<div class="menu" v-for="(item,index) in menuList" :key="index">
<div><el-checkbox v-model="item.checked" @change="choose1(item)">{{item.name}}</el-checkbox></div>
<div v-for="info in item.secondMenuList">
<div><el-checkbox class="ml10" @change="choose2(info,item)" v-model="info.checked">{{info.name}}</el-checkbox></div>
<div v-for="i in info.buttonList" class="threeNode">
<el-checkbox class="ml20" @change="choose3(i)"v-model="i.checked">{{i.name}}</el-checkbox>
</div>
</div>
<div class="menu">
<el-tree
:data="menuList"
show-checkbox
node-key="id"
ref="tree"
default-expand-all
:default-checked-keys = "menuIdList"
:props="defaultProps"
>
</el-tree>
</div>
</div>
</el-form-item>
......@@ -49,7 +52,11 @@ export default {
checked: false,
roleId: [],
menuList: [],
menuIdList: []
menuIdList: [],
defaultProps: {
children: 'childrenList',
label: 'name'
}
}),
created () {
this.roleId = this.$route.params.id
......@@ -60,47 +67,26 @@ export default {
}
},
methods: {
//选择权限
choose1 (val) {
if (val.checked) {
val.secondMenuList.forEach(e=>{
e.checked = true
this.menuIdList.push(e.id)
})
this.menuIdList.push(val.id)
} else {
val.secondMenuList.forEach(e=>{
e.checked = false
})
}
console.log(this.menuIdList)
},
choose2 (val,item) {
if (val.checked) {
if (val.buttonList.length > 0) {
val.buttonList.forEach(e=>{
e.checked = true
this.menuIdList.push(e.id)
})
}
this.menuIdList.push(val.id)
if (this.menuIdList.length == item.seconMenuList.length) {
item.checked = true
}
} else {
if (val.buttonList.length > 0) {
val.buttonList.forEach(e=>{
e.checked = false
})
}
}
console.log(this.menuIdList)
},
// 获取详情
getData () {
this.$axios.get('/baseInfo/findRoleMenu?id=' + this.roleId).then((res) =>{
if(res.data.code === '0') {
this.data = res.data.data
let menuIdList = []
this.data.roleMenuResponseList.forEach(item=>{
if (item.isChecked == 'checked') {
menuIdList.push(item.id)
}
if (item.childrenList.length > 0) {
item.childrenList.forEach(info=>{
if (info.isChecked == 'checked') {
menuIdList.push(info.id)
}
})
}
})
this.menuIdList = menuIdList
console.log(this.menuIdList)
if (this.data.status == '0') {
this.data.status = false
} else {
......@@ -130,11 +116,12 @@ export default {
} else {
url = '/baseInfo/editRole'
}
this.menuIdList = this.$refs.tree.getCheckedKeys()
that.$axios.post(url,{
"status": that.data.status ? '1' : '0',
"name": that.data.name,
"projectId": that.projectId,
"roleMenuRequestIdList": that.menuIdList,
"roleMenuRequestIdList": this.menuIdList,
"id": that.roleId
}).then((res) =>{
if(res.data.code === '0') {
......@@ -173,7 +160,7 @@ export default {
.menuList{
.menu{
border: 1px solid #E9EFF3;
width: 120px;
width: 180px;
float: left;
padding: 5px 10px 10px 10px;
margin-right: 10px;
......
......@@ -30,7 +30,7 @@
<el-switch
v-model="scope.row.status"
active-color="#DF9F01"
inactive-color="#929EAC">
inactive-color="#929EAC" @change="changeStatus(scope.row)">
</el-switch>
</template>
</el-table-column>
......@@ -100,6 +100,17 @@ export default {
})
}).catch(() => {})
},
// 修改角色状态
changeStatus (item) {
this.$axios.post('/baseInfo/editRoleStatusById',{
roleStatus: item.status ? '1' : '0',
id: item.id
}).then((res) =>{
if(res.data.code === '0') {
this.getData()
}
})
},
handleSizeChange (val) {
this.size = val
this.getData()
......
......@@ -81,7 +81,7 @@ export default {
this.userId = this.$route.params.id
this.projectId = window.sessionStorage.getItem('projectId')
this.getRoleList()
this.getProjectList(this.projectId)
this.getProjectList()
if (this.userId !== '0') {
this.getData()
}
......@@ -111,7 +111,7 @@ export default {
})
},
// 获取项目列表
getProjectList (projectId) {
getProjectList () {
this.$axios.get('/baseInfo/findProjectList').then((res) =>{
if(res.data.code === '0') {
this.projectList = res.data.data
......
......@@ -340,23 +340,6 @@ background-color:#bbb!important;
background-color: #DF9F01!important;
border-color: #DF9F01!important;
}
// .el-message-box__header{
// border-bottom: 1px solid #eee!important;
// text-align: center!important;
// padding: 15px 15px 15px!important;
// }
// .el-message-box{width: 320px!important;}
// .el-message-box__status{
// top: 30%!important;
// left: 45%!important;
// font-size: 32px!important;
// }
// .el-message-box__status.el-icon-success{color: #37A100!important;}
// .el-message-box__status.el-icon-error{color: #B82C0E!important;}
// .el-message-box__message{padding-top: 50px!important;}
// .el-message-box__title{font-size: 16px!important;color:#313D4B!important;}
// .el-message-box__btns{padding: 15px 15px 15px!important;}
// .el-message-box__btns,.el-message-box__message{text-align: center!important;}
.title{
color: #313D4B;
font-size: 14px;
......@@ -380,7 +363,7 @@ background-color:#bbb!important;
border-right: 1px solid #E9EFF3;
height: 30px;
}
.searchBox .el-select{width: 220px;}
.searchBox .el-select{width: 190px;}
.prompt{
width: 304px;
height: 31px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment