Compare commits
No commits in common. "4c92d07df82c5cbb2d1060cfa6c08df4b7e52560" and "762ce0c7d1759cffcf8597916447114c0d8c80c1" have entirely different histories.
4c92d07df8
...
762ce0c7d1
|
@ -5209,7 +5209,7 @@
|
||||||
},
|
},
|
||||||
"node_modules/postcss-pxtorem": {
|
"node_modules/postcss-pxtorem": {
|
||||||
"version": "6.1.0",
|
"version": "6.1.0",
|
||||||
"resolved": "https://registry.npmmirror.com/postcss-pxtorem/-/postcss-pxtorem-6.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/postcss-pxtorem/-/postcss-pxtorem-6.1.0.tgz",
|
||||||
"integrity": "sha512-ROODSNci9ADal3zUcPHOF/K83TiCgNSPXQFSbwyPHNV8ioHIE4SaC+FPOufd8jsr5jV2uIz29v1Uqy1c4ov42g==",
|
"integrity": "sha512-ROODSNci9ADal3zUcPHOF/K83TiCgNSPXQFSbwyPHNV8ioHIE4SaC+FPOufd8jsr5jV2uIz29v1Uqy1c4ov42g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|
|
@ -164,18 +164,37 @@ const infoApi = {
|
||||||
getCom(params) {
|
getCom(params) {
|
||||||
return postPBRequest("/info", null, 51001, params.name);
|
return postPBRequest("/info", null, 51001, params.name);
|
||||||
},
|
},
|
||||||
// 实时数据
|
// // 获取上报列表
|
||||||
// 获取驱动数据
|
// getSc(params) {
|
||||||
getDriverData(params) {
|
// return getRequest('/sb/list', params)
|
||||||
return postPBRequest("/data", null, 55000);
|
// },
|
||||||
},
|
// // 获取上报驱动
|
||||||
// 获取驱动下设备数据
|
// getQuDong(params) {
|
||||||
getDeviceData(params) {
|
// return getRequest('/sb/support', params)
|
||||||
return postPBRequest("/data", params, 55001);
|
// },
|
||||||
},
|
// // 新增上报
|
||||||
// 获取设备下的点位
|
// saveTx(params) {
|
||||||
getPointData(params) {
|
// return postJsonRequest("/sb", params);
|
||||||
return postPBRequest("/data", params, 55002);
|
// },
|
||||||
}
|
// // 编辑通讯
|
||||||
|
// 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)
|
||||||
|
// },
|
||||||
};
|
};
|
||||||
export default infoApi;
|
export default infoApi;
|
|
@ -1,39 +1,45 @@
|
||||||
<template>
|
<template>
|
||||||
<el-card class="content-div">
|
<el-card class="content-div">
|
||||||
<div class="all-content">
|
<div class="all-content">
|
||||||
<fieldset class="left box2">
|
<fieldset class="left box2">
|
||||||
<legend class="box-ht">驱动列表</legend>
|
<legend class="box-ht">驱动列表</legend>
|
||||||
<div v-for="(item, i) in qdDatas" :class="i === indexi ? 'active' : ''" :key="i" @click="changeQd(i, item)">
|
<div v-for="(item, i) in qdDatas" :class="i===indexi?'active': ''" :key="i" @click="changeQd(i)">
|
||||||
<img src="../assets/qd.png" alt="">
|
<img src="../assets/qd.png" alt="">
|
||||||
{{ item.driver_name }}
|
{{ item.name }}
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<div class="right-set">
|
<div class="right-set">
|
||||||
<el-tree ref="taskTree" :data="data" node-key="device_name" :props="defaultProps" :highlight-current="true" accordion
|
<el-tree
|
||||||
@node-click="handleNodeClick">
|
:data="data"
|
||||||
</el-tree>
|
:props="defaultProps"
|
||||||
|
:highlight-current="true"
|
||||||
|
accordion
|
||||||
|
node-key="id"
|
||||||
|
:current-node-key="currentNodekey"
|
||||||
|
@node-click="handleNodeClick">
|
||||||
|
</el-tree>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-table">
|
<div class="right-table">
|
||||||
<el-table :data="tableData" border :row-class-name="tableRowClassName"
|
<el-table :data="tableData" border :row-class-name="tableRowClassName"
|
||||||
:header-cell-style="{ background: '#F6F7FC' }" size="large">
|
:header-cell-style="{ background: '#F6F7FC' }" size="large">
|
||||||
<el-table-column type="index" label="序号" width="80" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
<el-table-column prop="point_name" label="名称" width="150" align="center" show-overflow-tooltip />
|
<el-table-column prop="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="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="description" label="质量" align="center" show-overflow-tooltip />
|
||||||
<el-table-column prop="point_value" label="值" width="100" align="center" show-overflow-tooltip />
|
<el-table-column prop="description" label="值" align="center" show-overflow-tooltip />
|
||||||
<el-table-column prop="point_Unit" label="单位" width="100" align="center" show-overflow-tooltip />
|
<el-table-column prop="description" label="单位" align="center" show-overflow-tooltip />
|
||||||
<el-table-column prop="point_type" label="类型" width="100" align="center" show-overflow-tooltip />
|
<el-table-column prop="description" label="类型" align="center" show-overflow-tooltip />
|
||||||
<el-table-column prop="point_timestamp" label="时间戳" width="200" align="center" show-overflow-tooltip />
|
<el-table-column prop="description" label="时间戳" align="center" show-overflow-tooltip />
|
||||||
<el-table-column label="操作" align="center" show-overflow-tooltip>
|
<el-table-column label="操作" align="center" show-overflow-tooltip>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button type="success" size="large">
|
<el-button type="success" size="large">
|
||||||
历史
|
历史
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="warning" size="large" v-if="scope.row.point_permissions ==2">
|
<el-button type="warning" size="large">
|
||||||
写值
|
写值
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -44,84 +50,59 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
|
import { onMounted, reactive, ref, toRefs } from "vue";
|
||||||
import infoApi from "@/api/infoApi.js";
|
import infoApi from "@/api/infoApi.js";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
export default {
|
export default {
|
||||||
name: "data",
|
name: "data",
|
||||||
setup() {
|
setup() {
|
||||||
const taskTree = ref(null);
|
const ruleFormRef = ref(null);
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
indexi: 0,
|
indexi: 0,
|
||||||
qdDatas: [],
|
|
||||||
data: [],
|
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: '设备三',
|
||||||
|
|
||||||
|
}],
|
||||||
|
currentNodekey: 11,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
defaultProps: {
|
|
||||||
label: 'device_name',
|
|
||||||
children: 'children'
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getDriverData();
|
|
||||||
});
|
});
|
||||||
|
const changeQd = (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;
|
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 {
|
return {
|
||||||
...toRefs(state),
|
...toRefs(state),
|
||||||
changeQd,
|
changeQd
|
||||||
handleNodeClick,
|
|
||||||
taskTree
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -131,48 +112,43 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
.left {
|
||||||
.left {
|
width: 15%;
|
||||||
width: 15%;
|
border: 1px solid #006b3b;
|
||||||
border: 1px solid #006b3b;
|
font-size: 16px;
|
||||||
font-size: 16px;
|
overflow:auto;
|
||||||
|
img {
|
||||||
img {
|
width: 24px;
|
||||||
width: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
>div {
|
|
||||||
background: #e2f4e5;
|
|
||||||
margin-top: 10px;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 40px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
background: #00AAA3;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
>div {
|
||||||
.right {
|
background: #e2f4e5;
|
||||||
width: 84%;
|
margin-top: 10px;
|
||||||
border: 1px solid #006b3b;
|
text-align: center;
|
||||||
display: flex;
|
line-height: 40px;
|
||||||
justify-content: space-around;
|
cursor:pointer;
|
||||||
|
}
|
||||||
.right-set {
|
.active {
|
||||||
width: 10%;
|
background: #00AAA3;
|
||||||
padding: 20px;
|
color: #fff;
|
||||||
}
|
|
||||||
|
|
||||||
.right-table {
|
|
||||||
width: 88%;
|
|
||||||
// .el-tree-node {
|
|
||||||
// border: 1px solid #ddd !important;
|
|
||||||
// margin-top: 10px !important;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.right {
|
||||||
|
width: 84%;
|
||||||
|
border: 1px solid #006b3b;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
.right-set {
|
||||||
|
width: 10%;
|
||||||
|
padding: 20px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.right-table {
|
||||||
|
width: 88%;
|
||||||
|
// .el-tree-node {
|
||||||
|
// border: 1px solid #ddd !important;
|
||||||
|
// margin-top: 10px !important;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -37,8 +37,8 @@ export default ({ mode }) => defineConfig({
|
||||||
'/api': {
|
'/api': {
|
||||||
// target: 'http://cdcm_test_api.shikicc.com:58909',
|
// target: 'http://cdcm_test_api.shikicc.com:58909',
|
||||||
// target: 'http://frp.shikicc.com:58951',
|
// target: 'http://frp.shikicc.com:58951',
|
||||||
target: 'https://cdcm_api2.shikicc.com',
|
// target: 'http://10.10.14.123',
|
||||||
// target: 'https://cdcm_api.shikicc.com',
|
target: 'https://cdcm_api.shikicc.com',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: path => path.replace(/^\/api/, '/api')
|
rewrite: path => path.replace(/^\/api/, '/api')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue