diff --git a/src/api/infoApi.js b/src/api/infoApi.js index c29488f..2e42305 100644 --- a/src/api/infoApi.js +++ b/src/api/infoApi.js @@ -165,17 +165,17 @@ const infoApi = { return postPBRequest("/info", null, 51001, params.name); }, // 实时数据 - // 获取驱动数据 + // 获取驱动 getDriverData(params) { - return postPBRequest("/data", null, 55000); + return postPBRequest("/data", null, 56200); }, // 获取驱动下设备数据 getDeviceData(params) { - return postPBRequest("/data", params, 55001); + return postPBRequest("/data", params, 56100); }, // 获取设备下的点位 getPointData(params) { - return postPBRequest("/data", params, 55002); + return postPBRequest("/data", params, 56000); } }; export default infoApi; \ No newline at end of file diff --git a/src/views/Data.vue b/src/views/Data.vue index 534c8a9..4b3f356 100644 --- a/src/views/Data.vue +++ b/src/views/Data.vue @@ -2,47 +2,73 @@
- 驱动列表 -
+ 通讯列表 +
{{ item.driver_name }}
-
- - +
+ 通讯信息 + + 通讯名称:{{ curDriver.driver_name }} + 通讯总计数:{{ curDriver.driver_name }} + 通讯描述:{{ curDriver.driver_description }} + 通讯状态:{{ curDriver.driver_status }} + 通讯成功计数:{{ curDriver.driver_name }} + 通讯失败计数:{{ curDriver.driver_name }} + 通讯最后一次成功时间:{{ curDriver.driver_name }} + 通讯最后一次失败时间:{{ curDriver.driver_name }} + 通讯最后一次失败原因:{{ curDriver.driver_name }} +
-
- - - - - - - - - - - + + +
@@ -60,36 +86,15 @@ export default { const state = reactive({ indexi: 0, - qdDatas: [{ - id: 1, - name: '驱动一', - },{ - id: 2, - name: '驱动二', - },{ - id: 3, - name: '驱动三', - },{ - id: 4, - name: '驱动四', - },{ - id: 5, - name: '驱动五', - }], - data: [{ - id: 11, - label: '设备一', - }, { - id: 12, - label: '设备二', - }, { - id: 13, - label: '设备三', - - }], + driverData: [], + driceData: [ ], currentNodekey: 11, tableData: [], - + defaultProps: { + children: "children", + label: "device_name" + }, + curDriver: {} }); onMounted(() => { @@ -99,9 +104,10 @@ export default { const getDriverData = async () => { const res = await infoApi.getDriverData(); if (res.code == 0) { - state.qdDatas = res.data || []; - if (state.qdDatas.length > 0) { - changeQd(0, state.qdDatas[0]); + state.driverData = res.data || []; + if (state.driverData.length > 0) { + changeQd(0, state.driverData[0]); + state.curDriver = state.driverData[0]; } } @@ -109,6 +115,7 @@ export default { } const changeQd = (i, item) => { state.indexi = i; + state.curDriver = item; getDeviceData(item.driver_name); } @@ -118,11 +125,13 @@ export default { } const res = await infoApi.getDeviceData(param); if (res.code == 0) { - state.data = res.data || []; - if (state.data.length > 0) { - handleNodeClick(state.data[0]); + state.driceData = res.data || []; + console.log(123, state.driceData) + if (state.driceData.length > 0) { + handleNodeClick(state.driceData[0]); nextTick(() => { - taskTree.value.setCurrentKey(state.data[0].device_name); + console.log(123 , state.driceData[0].device_name) + taskTree.value.setCurrentKey(state.driceData[0].device_name); }) } } @@ -142,6 +151,7 @@ export default { const res = await infoApi.getPointData(param); if(res.code == 0) { state.tableData = res.data; + } } @@ -149,9 +159,9 @@ export default { return { ...toRefs(state), + taskTree, changeQd, - handleNodeClick, - taskTree + handleNodeClick }; }, }; @@ -165,18 +175,40 @@ export default { .left { width: 15%; border: 1px solid #006b3b; - font-size: 16px; - width: 24px; + font-size: 16px; + .qd-one { + display: flex; + justify-content: space-around; + align-items: center; + width: 100%; + height: 45px; + img { + width: 24px; + } + } } .right { width: 84%; border: 1px solid #006b3b; justify-content: space-around; - +.box-title { + height:100% !important; + width: 30px; + background: #00AAA3; + color:#fff; + // border-right: 1px solid #006b3b; + display: flex; + justify-content: center; + align-items: center; +} + .right-con { + display: flex; + justify-content: space-between; + } .right-set { - width: 10%; - padding: 20px; + width: 12%; + padding: 5px; } .right-table { @@ -192,11 +224,12 @@ export default { color: #fff; } } + .right { width: 84%; - border: 1px solid #006b3b; - display: flex; - justify-content: space-around; + border: 1px solid #006b3b; + + .right-set { width: 10%; padding: 20px; @@ -210,4 +243,22 @@ export default { // } } } +.box-info { + width:100%; + // border: 1px solid red; + display: flex; + flex-wrap: wrap; + justify-content: space-between; + align-items: center; + ::v-deep .el-tag { + margin: 10px; + } + } + .des { + border-bottom: 1px solid #006b3b; + display: flex; + align-items: center; + width:100%; + + }