mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-17 16:36:03 +08:00
数据同步功能完善
This commit is contained in:
@@ -52,6 +52,14 @@ export function getDevice(deviceId) {
|
||||
})
|
||||
}
|
||||
|
||||
// 设备数据同步
|
||||
export function deviceSynchronization(serialNumber) {
|
||||
return request({
|
||||
url: '/iot/device/synchronization/' + serialNumber,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据设备编号查询设备详细
|
||||
export function getDeviceBySerialNumber(serialNumber) {
|
||||
return request({
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
<el-tab-pane name="device04">
|
||||
<span slot="label">
|
||||
<el-tooltip class="item" effect="dark" content="用于查看发送的指令,设备是否已经响应" placement="right-start">
|
||||
<el-button type="success" size="mini" @click="dataSynchronization()" :disabled="form.deviceId==0">数据同步</el-button>
|
||||
<el-button type="success" size="mini" @click="deviceSynchronization()" :disabled="form.deviceId==0">数据同步</el-button>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
</el-tab-pane>
|
||||
@@ -169,6 +169,7 @@ import {
|
||||
loadBMap
|
||||
} from '@/utils/map.js'
|
||||
import {
|
||||
deviceSynchronization,
|
||||
getDevice,
|
||||
addDevice,
|
||||
updateDevice,
|
||||
@@ -259,8 +260,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
/** 数据同步*/
|
||||
dataSynchronization() {
|
||||
getDevice(this.form.deviceId).then(response => {
|
||||
deviceSynchronization() {
|
||||
deviceSynchronization(this.form.serialNumber).then(response => {
|
||||
this.form = response.data;
|
||||
// 选项卡切换
|
||||
this.activeName = 'runningStatus';
|
||||
@@ -272,7 +273,6 @@ export default {
|
||||
this.imageUrl = this.form.imgUrl;
|
||||
}
|
||||
this.loadMap();
|
||||
|
||||
});
|
||||
},
|
||||
/**获取设备详情*/
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-share" size="mini" @click="selectUser" v-hasPermi="['iot:device:share']">分享设备</el-button>
|
||||
<!-- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="selectUserShareAllDevice" v-hasPermi="['iot:device:share']">分享所有设备</el-button> -->
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-refresh" size="mini" @click="getList">刷新</el-button>
|
||||
@@ -57,9 +56,6 @@ import {
|
||||
delDeviceUser,
|
||||
updateDeviceUser
|
||||
} from "@/api/iot/deviceuser";
|
||||
import {
|
||||
listDeviceShort,
|
||||
} from "@/api/iot/device";
|
||||
|
||||
export default {
|
||||
name: "device-user",
|
||||
@@ -96,8 +92,6 @@ export default {
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 设备用户表格数据
|
||||
@@ -234,21 +228,7 @@ export default {
|
||||
this.devices = [this.device]
|
||||
this.$refs.userList.openSelectUser = true;
|
||||
},
|
||||
selectUserShareAllDevice() {
|
||||
this.loading = true;
|
||||
// 获取设备列表
|
||||
// 判断是否是admin角色
|
||||
if (this.$store.state.user.roles.indexOf("admin") === -1) {
|
||||
this.queryParams.userId = this.$store.state.user.userId
|
||||
}
|
||||
listDeviceShort(this.queryParams).then(response => {
|
||||
let deviceList = response.rows;
|
||||
this.devices = deviceList
|
||||
this.loading = false;
|
||||
this.$refs.userList.openSelectUser = true;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user