diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index b1271bf..98f35f4 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,7 +20,7 @@ {{ deviceForm.onlineStateName }} - + {{ deviceForm.cell }} @@ -36,7 +36,7 @@ - + {{ deviceForm.concenCode }} @@ -118,21 +118,7 @@ // 初始化对话框 initDialog: function(dialogStatus, row = null) { this.dialogFormVisible = true - this.deviceForm = { - id: row.id, - deviceName: row.deviceName, - devcode: row.devcode, - deviceType: row.deviceType, - deviceTypeName: row.deviceTypeName, - wellCode: row.wellCode, - modelName: row.modelName, - installDate: row.installDate, - concenCode: row.concenCode, - onlineStateName: row.onlineStateName, - deptName: row.deptName, - bfztName: row.bfztName, - position: row.position - } + this.deviceForm = row // 展示相对应的设备列表组件 this.cmpName = this.compDict[row.deviceType] setTimeout(() => { diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index b1271bf..98f35f4 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,7 +20,7 @@ {{ deviceForm.onlineStateName }} - + {{ deviceForm.cell }} @@ -36,7 +36,7 @@ - + {{ deviceForm.concenCode }} @@ -118,21 +118,7 @@ // 初始化对话框 initDialog: function(dialogStatus, row = null) { this.dialogFormVisible = true - this.deviceForm = { - id: row.id, - deviceName: row.deviceName, - devcode: row.devcode, - deviceType: row.deviceType, - deviceTypeName: row.deviceTypeName, - wellCode: row.wellCode, - modelName: row.modelName, - installDate: row.installDate, - concenCode: row.concenCode, - onlineStateName: row.onlineStateName, - deptName: row.deptName, - bfztName: row.bfztName, - position: row.position - } + this.deviceForm = row // 展示相对应的设备列表组件 this.cmpName = this.compDict[row.deviceType] setTimeout(() => { diff --git a/src/views/deviceManage/listDevice.vue b/src/views/deviceManage/listDevice.vue index fc61332..1245b35 100644 --- a/src/views/deviceManage/listDevice.vue +++ b/src/views/deviceManage/listDevice.vue @@ -261,7 +261,10 @@ this.multipleSelection.forEach(function(value, index) { deviceIds.push(value.id) }) - // wellNames = wellNames.slice(0, wellNames.length - 1) + let minusOnePage = false + if (deviceIds.length === this.list.length) { + minusOnePage = true + } this.$confirm( '确定要删除所选设备吗?', '确认操作', @@ -274,6 +277,9 @@ delDevice(deviceIds).then(response => { if (response.code === 200) { this.$message.success('删除成功') + if (minusOnePage) { + this.listQuery.offset = this.listQuery.offset > 1 ? this.listQuery.offset - 1 : 1 + } this.fetchData() } }) diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index b1271bf..98f35f4 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,7 +20,7 @@ {{ deviceForm.onlineStateName }} - + {{ deviceForm.cell }} @@ -36,7 +36,7 @@ - + {{ deviceForm.concenCode }} @@ -118,21 +118,7 @@ // 初始化对话框 initDialog: function(dialogStatus, row = null) { this.dialogFormVisible = true - this.deviceForm = { - id: row.id, - deviceName: row.deviceName, - devcode: row.devcode, - deviceType: row.deviceType, - deviceTypeName: row.deviceTypeName, - wellCode: row.wellCode, - modelName: row.modelName, - installDate: row.installDate, - concenCode: row.concenCode, - onlineStateName: row.onlineStateName, - deptName: row.deptName, - bfztName: row.bfztName, - position: row.position - } + this.deviceForm = row // 展示相对应的设备列表组件 this.cmpName = this.compDict[row.deviceType] setTimeout(() => { diff --git a/src/views/deviceManage/listDevice.vue b/src/views/deviceManage/listDevice.vue index fc61332..1245b35 100644 --- a/src/views/deviceManage/listDevice.vue +++ b/src/views/deviceManage/listDevice.vue @@ -261,7 +261,10 @@ this.multipleSelection.forEach(function(value, index) { deviceIds.push(value.id) }) - // wellNames = wellNames.slice(0, wellNames.length - 1) + let minusOnePage = false + if (deviceIds.length === this.list.length) { + minusOnePage = true + } this.$confirm( '确定要删除所选设备吗?', '确认操作', @@ -274,6 +277,9 @@ delDevice(deviceIds).then(response => { if (response.code === 200) { this.$message.success('删除成功') + if (minusOnePage) { + this.listQuery.offset = this.listQuery.offset > 1 ? this.listQuery.offset - 1 : 1 + } this.fetchData() } }) diff --git a/src/views/deviceStatics/components/deviceCountByOffline.vue b/src/views/deviceStatics/components/deviceCountByOffline.vue index bc03334..86deb52 100644 --- a/src/views/deviceStatics/components/deviceCountByOffline.vue +++ b/src/views/deviceStatics/components/deviceCountByOffline.vue @@ -163,7 +163,8 @@ fetchData() { this.listLoading = true getOfflineDeviceList(this.listQuery).then(response => { - this.tableOption.total = response.total + debugger + this.tableOption.total = response.data.total this.list = response.data.rows this.listLoading = false }).catch(_ => { this.listLoading = false })