main
parent
2390dd9eb7
commit
0a7d8fffd2
|
@ -5209,7 +5209,7 @@
|
|||
},
|
||||
"node_modules/postcss-pxtorem": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/postcss-pxtorem/-/postcss-pxtorem-6.1.0.tgz",
|
||||
"resolved": "https://registry.npmmirror.com/postcss-pxtorem/-/postcss-pxtorem-6.1.0.tgz",
|
||||
"integrity": "sha512-ROODSNci9ADal3zUcPHOF/K83TiCgNSPXQFSbwyPHNV8ioHIE4SaC+FPOufd8jsr5jV2uIz29v1Uqy1c4ov42g==",
|
||||
"dev": true,
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -164,37 +164,18 @@ const infoApi = {
|
|||
getCom(params) {
|
||||
return postPBRequest("/info", null, 51001, params.name);
|
||||
},
|
||||
// // 获取上报列表
|
||||
// getSc(params) {
|
||||
// return getRequest('/sb/list', params)
|
||||
// },
|
||||
// // 获取上报驱动
|
||||
// getQuDong(params) {
|
||||
// return getRequest('/sb/support', params)
|
||||
// },
|
||||
// // 新增上报
|
||||
// saveTx(params) {
|
||||
// return postJsonRequest("/sb", params);
|
||||
// },
|
||||
// // 编辑通讯
|
||||
// updateTx(params) {
|
||||
// return putRequest('/sb', params);
|
||||
// },
|
||||
// // 上报启停
|
||||
// stopSc(params) {
|
||||
// return putRequest("/sc", params);
|
||||
// },
|
||||
// // 删除上报
|
||||
// delSc(params) {
|
||||
// return deleteRequest("/sb", params);
|
||||
// },
|
||||
// // 规则查询
|
||||
// getRules(params) {
|
||||
// return getRequest('/rule', params);
|
||||
// },
|
||||
// // 规则操作
|
||||
// postRules(params) {
|
||||
// return postJsonRequest('/rule', params)
|
||||
// },
|
||||
// 实时数据
|
||||
// 获取驱动数据
|
||||
getDriverData(params) {
|
||||
return postPBRequest("/data", null, 55000);
|
||||
},
|
||||
// 获取驱动下设备数据
|
||||
getDeviceData(params) {
|
||||
return postPBRequest("/data", params, 55001);
|
||||
},
|
||||
// 获取设备下的点位
|
||||
getPointData(params) {
|
||||
return postPBRequest("/data", params, 55002);
|
||||
}
|
||||
};
|
||||
export default infoApi;
|
|
@ -3,38 +3,34 @@
|
|||
<div class="all-content">
|
||||
<fieldset class="left box2">
|
||||
<legend class="box-ht">驱动列表</legend>
|
||||
<div v-for="(item, i) in qdDatas" :class="i===indexi?'active': ''" :key="i" @click="changeQd(i)">
|
||||
<div v-for="(item, i) in qdDatas" :class="i === indexi ? 'active' : ''" :key="i" @click="changeQd(i, item)">
|
||||
<img src="../assets/qd.png" alt="">
|
||||
{{ item.name }}
|
||||
{{ item.driver_name }}
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="right">
|
||||
<div class="right-set">
|
||||
<el-tree
|
||||
:data="data"
|
||||
:props="defaultProps"
|
||||
:highlight-current="true"
|
||||
accordion
|
||||
<el-tree ref="taskTree" :data="data" node-key="device_name" :props="defaultProps" :highlight-current="true" accordion
|
||||
@node-click="handleNodeClick">
|
||||
</el-tree>
|
||||
</div>
|
||||
<div class="right-table">
|
||||
<el-table :data="tableData" border :row-class-name="tableRowClassName"
|
||||
:header-cell-style="{ background: '#F6F7FC' }" size="large">
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="name" label="名称" width="150" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="description" label="描述" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="description" label="质量" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="description" label="值" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="description" label="单位" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="description" label="类型" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="description" label="时间戳" align="center" show-overflow-tooltip />
|
||||
<el-table-column type="index" label="序号" width="80" align="center" />
|
||||
<el-table-column prop="point_name" label="名称" width="150" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="point_description" label="描述" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="point_quality" label="质量" width="100" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="point_value" label="值" width="100" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="point_Unit" label="单位" width="100" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="point_type" label="类型" width="100" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="point_timestamp" label="时间戳" width="200" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-button type="success" size="large">
|
||||
历史
|
||||
</el-button>
|
||||
<el-button type="warning" size="large">
|
||||
<el-button type="warning" size="large" v-if="scope.row.point_permissions ==2">
|
||||
写值
|
||||
</el-button>
|
||||
|
||||
|
@ -48,57 +44,84 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { onMounted, reactive, ref, toRefs } from "vue";
|
||||
import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
|
||||
import infoApi from "@/api/infoApi.js";
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
name: "data",
|
||||
setup() {
|
||||
const ruleFormRef = ref(null);
|
||||
const taskTree = ref(null);
|
||||
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: '设备三',
|
||||
|
||||
}],
|
||||
tableData: []
|
||||
qdDatas: [],
|
||||
data: [],
|
||||
tableData: [],
|
||||
defaultProps: {
|
||||
label: 'device_name',
|
||||
children: 'children'
|
||||
}
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
getDriverData();
|
||||
});
|
||||
const changeQd = (i) => {
|
||||
state.indexi = i;
|
||||
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
const changeQd = (i, item) => {
|
||||
state.indexi = i;
|
||||
getDeviceData(item.driver_name);
|
||||
}
|
||||
|
||||
const getDeviceData = async (driver_name) => {
|
||||
const param = {
|
||||
driver_name: driver_name
|
||||
}
|
||||
const res = await infoApi.getDeviceData(param);
|
||||
if (res.code == 0) {
|
||||
state.data = res.data || [];
|
||||
if (state.data.length > 0) {
|
||||
handleNodeClick(state.data[0]);
|
||||
nextTick(() => {
|
||||
taskTree.value.setCurrentKey(state.data[0].device_name);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const handleNodeClick = (item) => {
|
||||
getPointData(item);
|
||||
}
|
||||
|
||||
const getPointData = async (item) => {
|
||||
const param = {
|
||||
driver_name: item.driver_name,
|
||||
device_name: item.device_name
|
||||
}
|
||||
|
||||
const res = await infoApi.getPointData(param);
|
||||
if(res.code == 0) {
|
||||
state.tableData = res.data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
changeQd
|
||||
changeQd,
|
||||
handleNodeClick,
|
||||
taskTree
|
||||
};
|
||||
},
|
||||
};
|
||||
|
@ -108,13 +131,16 @@ export default {
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
|
||||
.left {
|
||||
width: 15%;
|
||||
border: 1px solid #006b3b;
|
||||
font-size: 16px;
|
||||
|
||||
img {
|
||||
width: 24px;
|
||||
}
|
||||
|
||||
>div {
|
||||
background: #e2f4e5;
|
||||
margin-top: 10px;
|
||||
|
@ -122,20 +148,24 @@ export default {
|
|||
line-height: 40px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.active {
|
||||
background: #00AAA3;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 84%;
|
||||
border: 1px solid #006b3b;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
|
||||
.right-set {
|
||||
width: 10%;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.right-table {
|
||||
width: 88%;
|
||||
// .el-tree-node {
|
||||
|
|
|
@ -37,8 +37,8 @@ export default ({ mode }) => defineConfig({
|
|||
'/api': {
|
||||
// target: 'http://cdcm_test_api.shikicc.com:58909',
|
||||
// target: 'http://frp.shikicc.com:58951',
|
||||
// target: 'http://10.10.14.123',
|
||||
target: 'https://cdcm_api.shikicc.com',
|
||||
target: 'https://cdcm_api2.shikicc.com',
|
||||
// target: 'https://cdcm_api.shikicc.com',
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace(/^\/api/, '/api')
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue