|
@@ -1,19 +1,16 @@
|
|
<template>
|
|
<template>
|
|
<div class="zy-template">
|
|
<div class="zy-template">
|
|
- <div class="zy-main-title">设备列表</div>
|
|
|
|
|
|
+ <div class="zy-main-title">设备列表-路牌</div>
|
|
<div class="zy-module">
|
|
<div class="zy-module">
|
|
<el-form ref="form" :model="query" label-width="60px">
|
|
<el-form ref="form" :model="query" label-width="60px">
|
|
<el-form-item label="设备码:" class="zy-search-form-item">
|
|
<el-form-item label="设备码:" class="zy-search-form-item">
|
|
<el-input v-model="query.openNum" size="mini" clearable></el-input>
|
|
<el-input v-model="query.openNum" size="mini" clearable></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
-
|
|
|
|
<el-form-item label="设备组:" class="zy-search-form-item">
|
|
<el-form-item label="设备组:" class="zy-search-form-item">
|
|
- <el-select v-model="query.groupId" filterable clearable placeholder="请输入设备号"
|
|
|
|
- :filter-method="remoteMethod" size="mini">
|
|
|
|
|
|
+ <el-select v-model="query.groupId" filterable clearable placeholder=" " size="mini">
|
|
<el-option v-for="item in groups" :key="item" :value="item" />
|
|
<el-option v-for="item in groups" :key="item" :value="item" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
-
|
|
|
|
<el-button type="primary" size="mini" @click="submit">查询</el-button>
|
|
<el-button type="primary" size="mini" @click="submit">查询</el-button>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
@@ -21,22 +18,23 @@
|
|
<div class="zy-module">
|
|
<div class="zy-module">
|
|
<el-table :data="page.records" header-cell-class-name="zy-table-header-cell" cell-class-name='zy-table-cell'
|
|
<el-table :data="page.records" header-cell-class-name="zy-table-header-cell" cell-class-name='zy-table-cell'
|
|
stripe>
|
|
stripe>
|
|
- <el-table-column prop="openNum" label="设备码" width="180" min-width="10%" />
|
|
|
|
- <el-table-column prop="username" label="MQTT用户名" width="180" min-width="10%" />
|
|
|
|
- <el-table-column prop="groupId" label="设备组" width="120" min-width="10%" />
|
|
|
|
- <el-table-column prop="createTime" label="创建时间" width="180" min-width="10%" />
|
|
|
|
- <el-table-column prop="battery" label="电量" width="80" min-width="10%" />
|
|
|
|
- <el-table-column prop="s4g" label="信号" width="80" min-width="10%" />
|
|
|
|
- <el-table-column label="状态" width="100" min-width="10%">
|
|
|
|
|
|
+ <el-table-column prop="openNum" label="设备码" min-width="180">
|
|
|
|
+ <template #default="scope">IMEI{{scope.row.openNum}}</template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="groupId" label="设备组" min-width="120" />
|
|
|
|
+ <el-table-column prop="createTime" label="创建时间" min-width="180" />
|
|
|
|
+ <el-table-column prop="battery" label="电量" min-width="80" />
|
|
|
|
+ <el-table-column prop="s4g" label="信号" min-width="80" />
|
|
|
|
+ <el-table-column label="状态" min-width="100">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-tag type="success" v-if="scope.row.status===1" size="small">在线</el-tag>
|
|
<el-tag type="success" v-if="scope.row.status===1" size="small">在线</el-tag>
|
|
<el-tag type="danger" v-if="scope.row.status===0" size="small">离线</el-tag>
|
|
<el-tag type="danger" v-if="scope.row.status===0" size="small">离线</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="updateTime" label="最近通讯时间" width="180" />
|
|
|
|
- <el-table-column label="操作" width="80">
|
|
|
|
|
|
+ <el-table-column prop="updateTime" label="最近通讯时间" min-width="180" />
|
|
|
|
+ <el-table-column label="操作" min-width="80">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <el-button @click="setGroups(scope.row.id)" type="text" size="small">详情</el-button>
|
|
|
|
|
|
+ <el-button @click="detailHandler(scope.row.openNum)" type="text" size="small">详情</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -44,6 +42,27 @@
|
|
:current-page="page.current" :total="page.total" :page-size="page.size" @current-change="pagination" />
|
|
:current-page="page.current" :total="page.total" :page-size="page.size" @current-change="pagination" />
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
+ <el-dialog title="设备详情" v-model="detailDialog" width="500px">
|
|
|
|
+ <el-descriptions :column="2" border>
|
|
|
|
+ <el-descriptions-item label="设备码:">{{detail.openNum}}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="唤醒间隔:">{{detail.wakeInt}}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="阈值:">{{detail.thresh}}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="温度:">{{detail.temp}}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="电量:">{{detail.battery}}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="信号:">{{detail.s4g}}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="上传类型:">{{detail.dataType}}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="X:">{{detail.x}}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="Y:">{{detail.y}}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="Z:">{{detail.z}}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="angleX:">{{detail.anglex}}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="angleY:">{{detail.angley}}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="angleZ:">{{detail.anglexz}}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="经度:">{{detail.lon}}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="纬度:">{{detail.lat}}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="定位模式:">{{detail.mode==1?'GPS':'基站'}}</el-descriptions-item>
|
|
|
|
+ </el-descriptions>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -59,10 +78,14 @@
|
|
current: 1,
|
|
current: 1,
|
|
size: 20,
|
|
size: 20,
|
|
},
|
|
},
|
|
|
|
+ groups: [], //设备组
|
|
|
|
+ detailDialog: false, //详情弹出框
|
|
|
|
+ detail: {}, //设备详情
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.getList();
|
|
|
|
|
|
+ this.getDevicesList();
|
|
|
|
+ this.getGroupList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
/**
|
|
/**
|
|
@@ -75,34 +98,61 @@
|
|
groupId: this.query.groupId,
|
|
groupId: this.query.groupId,
|
|
openNum: this.query.openNum,
|
|
openNum: this.query.openNum,
|
|
};
|
|
};
|
|
- this.getList(param);
|
|
|
|
|
|
+ this.getDevicesList(param);
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
* 分页点击事件
|
|
* 分页点击事件
|
|
*/
|
|
*/
|
|
pagination: function(current) {
|
|
pagination: function(current) {
|
|
const param = {
|
|
const param = {
|
|
- current: current,
|
|
|
|
|
|
+ current: 1,
|
|
size: this.page.size,
|
|
size: this.page.size,
|
|
|
|
+ groupId: this.query.groupId,
|
|
openNum: this.query.openNum,
|
|
openNum: this.query.openNum,
|
|
- type: this.query.type,
|
|
|
|
- m: this.query.m,
|
|
|
|
};
|
|
};
|
|
- this.getListPage(param);
|
|
|
|
|
|
+ this.getDevicesList(param);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查看详情
|
|
|
|
+ */
|
|
|
|
+ detailHandler: function(openNum) {
|
|
|
|
+ console.log(openNum);
|
|
|
|
+ this.detailDialog = true;
|
|
|
|
+ this.getDeviceDetail(openNum);
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 获取日志列表
|
|
|
|
|
|
+ * 获取设备列表
|
|
*/
|
|
*/
|
|
- getList: function(params) {
|
|
|
|
|
|
+ getDevicesList: function(params) {
|
|
this.$http.Get(this.$global.lp.listPage, params).then(res => {
|
|
this.$http.Get(this.$global.lp.listPage, params).then(res => {
|
|
- console.log(res.data)
|
|
|
|
this.page = res.data;
|
|
this.page = res.data;
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取设备详情
|
|
|
|
+ */
|
|
|
|
+ getDeviceDetail: function(openNum) {
|
|
|
|
+ const params = {
|
|
|
|
+ openNum: openNum
|
|
|
|
+ }
|
|
|
|
+ this.$http.Get(this.$global.lp.detail, params).then(res => {
|
|
|
|
+ this.detail = res.data;
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取设备组
|
|
|
|
+ */
|
|
|
|
+ getGroupList() {
|
|
|
|
+ this.$http.Get(this.$global.group.listAll, {}).then(res => {
|
|
|
|
+ this.groups = res.data.map(item => {
|
|
|
|
+ return item.code;
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
-
|
|
|
|
-<style lang="scss">
|
|
|
|
-</style>
|
|
|