参数绑定

master
fanluyan 1 year ago
parent 6dd3a78195
commit b34d0a4914

2
dist/index.html vendored

@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>cacfrontend</title><script defer="defer" src="static/js/chunk-vendors.b4199f52.js"></script><script defer="defer" src="static/js/app.15223002.js"></script><link href="static/css/app.c8924e65.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but cacfrontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>cacfrontend</title><script defer="defer" src="static/js/chunk-vendors.b4199f52.js"></script><script defer="defer" src="static/js/app.bef6aa9a.js"></script><link href="static/css/app.c8924e65.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but cacfrontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

@ -38,6 +38,10 @@ export default {
path: "/icdConfig",
name: "icd配置",
},
{
path: "/paramBinding",
name: "参数绑定",
},
],
};
},

@ -105,6 +105,14 @@ const routes = [
title: "icd配置",
},
},
{
path: "/paramBinding",
component: () => import("../views/paramBinding/index.vue"),
name: "paramBinding",
meta: {
title: "参数绑定",
},
},
],
},
];

@ -358,3 +358,36 @@ export function modevListAllApi(data) {
},
});
}
//参数绑定相关接口
//获取树结构
export function getParamTreeApi(data) {
return request({
url: "/parambind/getTree",
method: "get",
data,
});
}
//查询逻辑设备实例列表
export function getinstListApi(data) {
return request({
url: "/parambind/instList",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//查询绑定信息
export function getBindApi(data) {
return request({
url: "/parambind/getBind",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}

@ -28,10 +28,13 @@
>
<el-option
v-for="item in colOptions"
:key="item"
:label="item"
:value="item"
></el-option>
:key="item.name"
:label="item.name"
:value="item.name"
>
{{ item.name
}}<span v-if="item.comment != ''">({{ item.comment }})</span>
</el-option>
</el-select>
<span v-show="scope.$index != cellIndex">{{
scope.row.colName
@ -71,7 +74,7 @@
</el-table>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="hide"></el-button>
<el-button type="primary" @click="hide"></el-button>
</div>
</el-dialog>
</div>

@ -0,0 +1,327 @@
<template>
<div class="paramBindingBox">
<div class="leftTree">
<h3>设备列表</h3>
<div class="treeBox">
<el-tree
ref="tree"
:data="paramTreeData"
:props="defaultProps"
node-key="id"
:default-expanded-keys="defaultExpandedKeys"
highlight-current
:current-node-key="currentNodekey"
:expand-on-click-node="true"
@node-click="handleNodeClick"
accordion
>
<template class="custom-tree-node" slot-scope="{ node, data }">
<!-- <span>{{ data.name || data.mc }}</span> -->
<span v-if="data.mc">
<span>{{ data.mc }} </span>
</span>
<span v-else-if="data.name">
<span class="el-icon-document" style="margin-right: 6px"> </span>
<span :title="data.name">{{ data.name }} </span>
</span>
</template>
</el-tree>
</div>
</div>
<div class="paramTable">
<div class="paramHead">
<h3>参数绑定</h3>
</div>
<div class="paramContain">
{{ bindInfo }}
<div class="headSelect">
<div class="iedlistBox">
<span>ied列表</span>
<el-select
v-model="iedName"
placeholder="请选择"
@change="changeTablename"
>
<el-option
v-for="item in iedOptions"
:key="item"
:label="item"
:value="item"
></el-option>
</el-select>
</div>
<div class="ljsbBox">
<span>逻辑设备</span>
<el-select
v-model="ljName"
placeholder="请选择"
@change="changeTablename"
>
<el-option
v-for="item in ljOptions"
:key="item"
:label="item"
:value="item"
></el-option>
</el-select>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import {
getParamTreeApi,
getinstListApi,
getBindApi,
iedListApi,
} from "@/utils/api/index";
export default {
name: "paramBinding",
components: {},
data() {
return {
filterText: "", //
paramTreeData: [], //
defaultExpandedKeys: [],
currentNodeData: [], //
currentId: "", //id
crrrentName: "",
currentNodekey: "", //
selectedNode: null, //
defaultProps: {
children: "children",
label: "mc",
},
bindInfo: "", //
iedName: "", //iedname
iedOptions: [],
ljName: "",
ljOptions: [],
};
},
computed: {},
created() {
this.getParamTreeList();
},
methods: {
getParamTreeList() {
getParamTreeApi()
.then((res) => {
console.log(res);
this.paramTreeData = res.data;
this.defaultExpandedKeys = [this.paramTreeData[0].id];
this.currentNodeData =
this.paramTreeData[0].children[0].children[0].children[0];
this.currentNodekey =
this.paramTreeData[0].children[0].children[0].children[0].id;
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.currentNodekey); //
this.handleNodeClick(this.currentNodeData);
});
})
.catch((err) => {
console.log(err); //
});
},
handleNodeClick(data, node) {
console.log(data);
if (data.hasOwnProperty("children")) {
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.currentNodeKey);
});
return;
}
this.currentNodeKey = data.id;
this.getBindList();
this.getiedList();
},
//
getBindList() {
getBindApi({
eqmid: this.currentNodeKey,
})
.then((res) => {
console.log(res);
this.bindInfo = res.data;
})
.catch((err) => {
console.log(err); //
});
},
//iedlist
getiedList() {
iedListApi()
.then((res) => {
console.log(res);
this.iedOptions = res.data;
})
.catch((err) => {
console.log(err); //
});
},
},
};
</script>
<style lang="less">
.paramBindingBox {
display: flex;
height: 100%;
.leftTree {
min-width: 220px;
max-width: 220px;
height: 100%;
overflow: auto;
//border: 1px solid #fff;
margin-right: 24px;
background: rgba(8, 9, 36, 0.28);
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
box-shadow: inset 0 4px 44px 0 #106cde;
padding: 0px 12px;
h3 {
font-size: 14px;
color: #fff;
font-weight: normal;
height: 40px;
line-height: 40px;
}
.treeBox {
width: 100%;
height: calc(100% - 48px);
background-color: #fff;
padding-top: 8px;
.searchBar {
width: 94%;
margin: 0px auto;
margin-bottom: 8px;
}
.el-tree {
overflow-y: auto;
/* overflow-x: hidden; */
height: calc(100% - 40px);
.el-tree-node__content {
height: 32px;
font-size: 12px;
}
.custom-tree-node {
color: #333;
overflow: hidden;
span {
display: flex;
display: inline-table;
overflow: hidden;
align-items: center;
}
.num {
color: #169e8c;
}
}
}
.el-tree--highlight-current
.el-tree-node.is-current
> .el-tree-node__content {
//
color: #fff;
background: #3889cf;
.custom-tree-node {
color: #fff;
//overflow: hidden;
span {
display: flex;
//overflow: hidden;
align-items: center;
.num {
color: #fff;
}
.iconfont {
//width: 30px;
display: inline-table;
}
}
}
}
.el-tree .el-tree-node__expand-icon.expanded {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
.el-tree .el-tree-node__expand-icon.expanded {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
/* //有子节点 且未展开 */
.el-tree .el-icon-caret-right:before {
content: "\e783";
display: block;
width: 16px;
height: 16px;
font-size: 16px;
background-size: 16px;
color: #333;
}
/* //有子节点 且已展开 */
.el-tree .el-tree-node__expand-icon.expanded.el-icon-caret-right:before {
content: "\e781";
display: block;
width: 16px;
height: 16px;
font-size: 16px;
background-size: 16px;
color: #333;
}
/* //没有子节点 */
.el-tree .el-tree-node__expand-icon.is-leaf::before {
background: #fff;
content: "";
display: block;
width: 0px;
height: 0px;
font-size: 16px;
background-size: 16px;
}
}
}
.paramTable {
flex: 1;
overflow-x: hidden;
background: rgba(8, 9, 36, 0.28);
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
box-shadow: inset 0 4px 44px 0 #106cde;
padding: 0px 12px;
.paramHead {
height: 40px;
line-height: 40px;
display: flex;
align-items: center;
justify-content: space-between;
h3 {
font-size: 14px;
color: #fff;
font-weight: normal;
height: 40px;
line-height: 40px;
}
.searchMain {
display: flex;
align-items: center;
}
}
.paramContain {
height: calc(100% - 42px);
//background: #fcc;
background: #fff;
border: 1px solid #dcdfe6;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04);
color: #333;
}
}
}
</style>
Loading…
Cancel
Save