-
+
{{ i.deviceName }}
-
-
-
-
-
-
+
+
+
{{ val }}:
+
+
{{ i.deviceDataMap[val] }}
+
@@ -84,14 +92,14 @@
import {
treeList,
selectDevicesByMonitorUnitId,
- getMonitorById
+ getMonitorById,
+ publishControlCommand
} from '@/api/board/equipment'
let getDeviceInterval = null
export default {
- components: {
- },
+ components: {},
data() {
return {
show: false,
@@ -111,26 +119,42 @@ export default {
async mounted() {
await this.getData()
this.sceneId = this.$store.getters.sceneId
- if(this.$route.query.monitorUnitId){
+ if (this.$route.query.monitorUnitId) {
this.deviceId = this.$route.query.monitorUnitId
- await this.treeClick({id:this.$route.query.monitorUnitId})
+ await this.treeClick({id: this.$route.query.monitorUnitId})
}
},
methods: {
async getData() {
await this.getTree()
},
- switchChange(e) {
- this.$confirm((this.controlList[e].deviceType === '1' ? '关闭' : '开启') + '该设备?', '提示', {
+ switchChange(functionIdentifier, deviceId, deviceCode,modeFunctionId) {
+ console.log(this.controlList)
+ console.log(this.controlList)
+ this.$confirm('确定执行么?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
- this.$message({
- type: 'success',
- message: '成功!'
- });
- this.controlList[e].deviceType === '1' ? this.controlList[e].deviceType = '0' : this.controlList[e].deviceType = '1'
+ publishControlCommand({
+ deviceId:deviceId,
+ modeFunctionId:modeFunctionId,
+ deviceCode:deviceCode,
+ type:functionIdentifier,
+ }).then(e => {
+ if (e.code === 200) {
+ this.$message({
+ type: 'success',
+ message: '成功!'
+ });
+ this.controlList.find(e => e.deviceId === deviceId).deviceType === '1' ? this.controlList.find(e => e.deviceId === deviceId).deviceType = '0' : this.controlList.find(e => e.deviceId === deviceId).deviceType = '1'
+ }else{
+ this.$message({
+ type: 'info',
+ message: '网络错误'
+ });
+ }
+ })
}).catch(() => {
this.$message({
type: 'info',
@@ -166,8 +190,9 @@ export default {
const {data} = await getMonitorById(e.id)
this.MonitorInfo = data
},
- toHistory() {
- this.$router.push({path: "/board/senso"});
+ toHistory(e,i) {
+ console.log(i)
+ this.$router.push({path: "/board/senso",query:{id:e,deviceModeId:i}});
}
},
beforeDestroy() {
@@ -283,10 +308,10 @@ export default {
.terminalList {
position: absolute;
- top: 12%;
+ top: 1%;
left: 0%;
width: 100%;
- height: 85%;
+ height: 95%;
overflow: auto;
::-webkit-scrollbar {
@@ -362,6 +387,17 @@ export default {
height: 16vh;
}
+ .icon {
+
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ position: absolute;
+ top: calc(16% + 1vh);
+ left: calc(5% + 0.5vw);
+ width: 14vh;
+ height: 14vh;
+ }
+
.rightBg {
background-image: url("~@/assets/board/equipment/right.png");
background-repeat: no-repeat;
diff --git a/ruoyi-ui/src/views/board/equipmentMonitoring/index.vue b/ruoyi-ui/src/views/board/equipmentMonitoring/index.vue
index acb0730..bd6b9ba 100644
--- a/ruoyi-ui/src/views/board/equipmentMonitoring/index.vue
+++ b/ruoyi-ui/src/views/board/equipmentMonitoring/index.vue
@@ -37,34 +37,36 @@
:header-cell-style="{ textAlign: 'center',backgroundColor:'#0a457d' }"
:max-height="maxHeight">
style="width: 100%">
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -105,27 +107,32 @@ export default {
tableData: [],
deviceList:[],
sceneId: 0,
- offset:0,
+ offset:1,
limit:10,
- total:0
+ total:0,
+ deviceDataColumns:[],
}
},
async mounted() {
this.maxHeight = this.$refs.right.clientHeight - this.$refs.search.clientHeight - this.$refs.pagination.clientHeight - 12
- this.tableShow = true
await this.getData()
},
methods: {
+ async currentChange(){
+ await this.getRightData()
+ },
async getRightData(e){
this.loading = true
await this.setSelectLatestDataByDeviceMode({
"sceneId": this.$store.getters.sceneId,
"deviceModeId": e.deviceModeId,
"startTime": 0,
- "offset": this.offset,
+ "offset": this.offset-1,
"limit": 10
})
this.loading = false
+ this.tableShow = false
+ this.tableShow = true
},
async getData() {
await this.setDeviceModesBySceneId()
@@ -139,6 +146,7 @@ export default {
},
async setSelectLatestDataByDeviceMode(e){
const {data} = await selectLatestDataByDeviceMode(e)
+ this.deviceDataColumns = data.deviceDataColumns
this.tableData = data.latestData || []
this.total=data.total
},
diff --git a/ruoyi-ui/src/views/board/senso/index.vue b/ruoyi-ui/src/views/board/senso/index.vue
index 97cc634..f61445b 100644
--- a/ruoyi-ui/src/views/board/senso/index.vue
+++ b/ruoyi-ui/src/views/board/senso/index.vue
@@ -3,7 +3,7 @@
-
+
@@ -12,16 +12,16 @@
{{ topData.monitorUnitName }}
-
所属区域
-
{{ topData.deviceName }}
+
设备编号:
+
{{ topData.deviceCode }}
-
位置:
-
深圳
+
设备名称:
+
{{ topData.deviceName }}
-
日期:
-
2023-01-01 00:00:00
+
设备位置:
+
{{ topData.deviceLocation }}
@@ -47,24 +47,24 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -114,15 +114,30 @@ export default {
return {
topData: {},
bottomData: [],
+ collapseNo:'1',
radio: '日统计报表',
tableData: [],
- sceneId:0
+ sceneId:0,
+ deviceId:0,
+ deviceModeId:0,
+ total:0,
+ currentPage:1,
+ deviceDataColumns:[],
+ show:false
}
},
async mounted() {
+ if(this.$route.query.id){
+ this.deviceId = this.$route.query.id
+ this.deviceModeId = this.$route.query.deviceModeId
+ }
await this.getData()
},
methods: {
+ async currentChange(e){
+ this.currentPage = e
+ await this.setHistoryData()
+ },
async getData() {
await this.setDeviceInfo()
await this.setLinkDevices()
@@ -136,26 +151,28 @@ export default {
}
},
async setDeviceInfo() {
- const {data} = await getDeviceInfo(this.$store.getters.sceneId)
+ const {data} = await getDeviceInfo(this.deviceId)
this.topData = data || {}
},
async setHistoryData() {
+ this.show = false
const {data} = await getHistoryData({
"sceneId":this.$store.getters.sceneId,
- "deviceId": 2,
- "offset": 0,
- "limit": 5,
- "startTime": 1266666666666
+ "deviceId": this.deviceId,
+ deviceModeId:this.deviceModeId,
+ "offset": this.currentPage -1,
+ "limit": 1,
+ "startTime": 0
})
- this.tableData = (data?.historyData?.rows || []).map((e, i) => {
- return {
- ...e,
- ...data.deviceDataColumns[i]
- }
+ this.tableData = data.historyData.dataList
+ this.total = data.historyData.count
+ this.deviceDataColumns = data.deviceDataColumns
+ this.$nextTick(()=>{
+ this.show = true
})
},
async setLinkDevices() {
- const {data} = await getLinkDevices(this.$store.getters.sceneId)
+ const {data} = await getLinkDevices(this.deviceId)
this.bottomData = data
}
}
@@ -261,9 +278,9 @@ export default {
background-size: 100% 100%;
position: absolute;
top: 50%;
- left: 10vh;
- width: 2.6vh;
- height: 3.3vh;
+ left: 6.2vh;
+ width: 10.6vh;
+ height: 10.3vh;
transform: translateY(-50%);
}