Compare commits

...

2 Commits

Author SHA1 Message Date
wangqiujuan0808 4c92d07df8 解决冲突 2024-08-12 16:17:45 +08:00
wangqiujuan0808 0a7d8fffd2 .。 2024-06-29 14:34:15 +08:00
4 changed files with 140 additions and 135 deletions

2
package-lock.json generated
View File

@ -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": {

View File

@ -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;

View File

@ -1,45 +1,39 @@
<template>
<el-card class="content-div">
<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)">
<img src="../assets/qd.png" alt="">
{{ item.name }}
</div>
</fieldset>
<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, item)">
<img src="../assets/qd.png" alt="">
{{ item.driver_name }}
</div>
</fieldset>
<div class="right">
<div class="right-set">
<el-tree
:data="data"
:props="defaultProps"
:highlight-current="true"
accordion
node-key="id"
:current-node-key="currentNodekey"
@node-click="handleNodeClick">
</el-tree>
<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"
<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>
</template>
</el-table-column>
</el-table>
@ -50,59 +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: '设备三',
}],
currentNodekey: 11,
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
};
},
};
@ -112,43 +131,48 @@ export default {
display: flex;
justify-content: space-between;
font-size: 14px;
.left {
width: 15%;
border: 1px solid #006b3b;
font-size: 16px;
overflow:auto;
img {
width: 24px;
.left {
width: 15%;
border: 1px solid #006b3b;
font-size: 16px;
img {
width: 24px;
}
>div {
background: #e2f4e5;
margin-top: 10px;
text-align: center;
line-height: 40px;
cursor: pointer;
}
.active {
background: #00AAA3;
color: #fff;
}
}
>div {
background: #e2f4e5;
margin-top: 10px;
text-align: center;
line-height: 40px;
cursor:pointer;
.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 {
// border: 1px solid #ddd !important;
// margin-top: 10px !important;
// }
}
}
.active {
background: #00AAA3;
color: #fff;
}
}
.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>

View File

@ -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')
}