diff --git a/vue/src/api/iot/device.js b/vue/src/api/iot/device.js
index f7204391..22ce8188 100644
--- a/vue/src/api/iot/device.js
+++ b/vue/src/api/iot/device.js
@@ -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({
diff --git a/vue/src/views/iot/device/device-edit.vue b/vue/src/views/iot/device/device-edit.vue
index 8a571ba9..8621a66b 100644
--- a/vue/src/views/iot/device/device-edit.vue
+++ b/vue/src/views/iot/device/device-edit.vue
@@ -127,7 +127,7 @@
- 数据同步
+ 数据同步
@@ -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();
-
});
},
/**获取设备详情*/
diff --git a/vue/src/views/iot/device/device-user.vue b/vue/src/views/iot/device/device-user.vue
index 22873c17..2fe10e8f 100644
--- a/vue/src/views/iot/device/device-user.vue
+++ b/vue/src/views/iot/device/device-user.vue
@@ -3,7 +3,6 @@
分享设备
-
刷新
@@ -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;
- });
-
- }
+
}
};