|
@@ -1,9 +1,9 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <div style="width: 90vw;height: 90vh;" id="diagramContainer">
|
|
|
+ <div style="width: 95%;height: calc(100vh - 300px);" id="diagramContainer">
|
|
|
<ul class="box">
|
|
|
<li class="leftMenu">
|
|
|
- <h3>选择节点</h3>
|
|
|
+ <!-- <h3>装置列表</h3> -->
|
|
|
<el-collapse>
|
|
|
<el-collapse-item :title="item1.name" v-for="(item1, index) in leftMenuData" :key="index">
|
|
|
<draggable @start="moveStart" @end="moveEnd" v-model="item1.children" :options="options">
|
|
@@ -16,12 +16,15 @@
|
|
|
</el-collapse>
|
|
|
</li>
|
|
|
<li class="plumbBox" id="plumbBox">
|
|
|
+ <!-- <div class="setBox">
|
|
|
+
|
|
|
+ </div> -->
|
|
|
<div v-for="(item, index) in info" :key="index" :id="item.id" :style="getStyle(item)"
|
|
|
:class="item.id === activeNode.id ? 'activeNode' : 'normalNode'" @click="sendActive(item)">
|
|
|
<div class="plumbNode" :id="item.id + 'plumbNode'">
|
|
|
- <el-icon :size="20">
|
|
|
+ <!-- <el-icon :size="20">
|
|
|
<CirclePlusFilled />
|
|
|
- </el-icon>
|
|
|
+ </el-icon> -->
|
|
|
</div>
|
|
|
{{ item.config[0].value }}
|
|
|
<el-icon class="is-loading" v-if="item.status === 'loading'" color="blue">
|
|
@@ -125,13 +128,13 @@ let globalConfig = {
|
|
|
//左侧
|
|
|
let leftMenuData = ref([
|
|
|
{
|
|
|
- name: "起始列表",
|
|
|
+ name: "装置列表",
|
|
|
children: [
|
|
|
{
|
|
|
to: [],
|
|
|
top: 0,
|
|
|
left: 0,
|
|
|
- status: "loading",
|
|
|
+ // status: "loading",
|
|
|
isSource: true,
|
|
|
isTarget: false,
|
|
|
config: [
|
|
@@ -139,7 +142,7 @@ let leftMenuData = ref([
|
|
|
label: "名称",
|
|
|
name: "label",
|
|
|
type: "text",
|
|
|
- value: "起始节点1",
|
|
|
+ value: "保护(高压制)",
|
|
|
require: true,
|
|
|
},
|
|
|
{
|
|
@@ -167,7 +170,7 @@ let leftMenuData = ref([
|
|
|
to: [],
|
|
|
top: 0,
|
|
|
left: 0,
|
|
|
- status: "loading",
|
|
|
+ // status: "loading",
|
|
|
isSource: true,
|
|
|
isTarget: true,
|
|
|
config: [
|
|
@@ -175,7 +178,7 @@ let leftMenuData = ref([
|
|
|
label: "名称",
|
|
|
name: "label",
|
|
|
type: "text",
|
|
|
- value: "起始节点2",
|
|
|
+ value: "合并单元(高压制)",
|
|
|
require: true,
|
|
|
},
|
|
|
{
|
|
@@ -199,39 +202,141 @@ let leftMenuData = ref([
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- name: "完结列表",
|
|
|
- children: [
|
|
|
{
|
|
|
to: [],
|
|
|
top: 0,
|
|
|
left: 0,
|
|
|
- status: "loading",
|
|
|
- type: "target",
|
|
|
- isSource: false,
|
|
|
+ // status: "loading",
|
|
|
+ isSource: true,
|
|
|
isTarget: false,
|
|
|
config: [
|
|
|
{
|
|
|
label: "名称",
|
|
|
name: "label",
|
|
|
type: "text",
|
|
|
- value: "完结节点1",
|
|
|
+ value: "保护(低压制)",
|
|
|
require: true,
|
|
|
},
|
|
|
{
|
|
|
label: "描述",
|
|
|
name: "description",
|
|
|
type: "textarea",
|
|
|
+ value: "",
|
|
|
+ require: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "归属",
|
|
|
+ name: "affiliation",
|
|
|
+ type: "select",
|
|
|
value: "check",
|
|
|
+ require: true,
|
|
|
+ options: [
|
|
|
+ { label: "审核信息", value: "check" },
|
|
|
+ { label: "生产经营", value: "manage" },
|
|
|
+ { label: "结算报销", value: "account" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ to: [],
|
|
|
+ top: 0,
|
|
|
+ left: 0,
|
|
|
+ // status: "loading",
|
|
|
+ isSource: true,
|
|
|
+ isTarget: false,
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ label: "名称",
|
|
|
+ name: "label",
|
|
|
+ type: "text",
|
|
|
+ value: "合并单元(低压制)",
|
|
|
+ require: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "描述",
|
|
|
+ name: "description",
|
|
|
+ type: "textarea",
|
|
|
+ value: "",
|
|
|
+ require: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "归属",
|
|
|
+ name: "affiliation",
|
|
|
+ type: "select",
|
|
|
+ value: "check",
|
|
|
+ require: true,
|
|
|
+ options: [
|
|
|
+ { label: "审核信息", value: "check" },
|
|
|
+ { label: "生产经营", value: "manage" },
|
|
|
+ { label: "结算报销", value: "account" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ to: [],
|
|
|
+ top: 0,
|
|
|
+ left: 0,
|
|
|
+ // status: "loading",
|
|
|
+ isSource: true,
|
|
|
+ isTarget: false,
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ label: "名称",
|
|
|
+ name: "label",
|
|
|
+ type: "text",
|
|
|
+ value: "本体测控",
|
|
|
+ require: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "描述",
|
|
|
+ name: "description",
|
|
|
+ type: "textarea",
|
|
|
+ value: "",
|
|
|
require: false,
|
|
|
},
|
|
|
{
|
|
|
label: "归属",
|
|
|
name: "affiliation",
|
|
|
type: "select",
|
|
|
+ value: "check",
|
|
|
+ require: true,
|
|
|
+ options: [
|
|
|
+ { label: "审核信息", value: "check" },
|
|
|
+ { label: "生产经营", value: "manage" },
|
|
|
+ { label: "结算报销", value: "account" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ to: [],
|
|
|
+ top: 0,
|
|
|
+ left: 0,
|
|
|
+ // status: "loading",
|
|
|
+ isSource: true,
|
|
|
+ isTarget: false,
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ label: "名称",
|
|
|
+ name: "label",
|
|
|
+ type: "text",
|
|
|
+ value: "母线保护",
|
|
|
+ require: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "描述",
|
|
|
+ name: "description",
|
|
|
+ type: "textarea",
|
|
|
value: "",
|
|
|
+ require: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "归属",
|
|
|
+ name: "affiliation",
|
|
|
+ type: "select",
|
|
|
+ value: "check",
|
|
|
require: true,
|
|
|
options: [
|
|
|
{ label: "审核信息", value: "check" },
|
|
@@ -245,15 +350,159 @@ let leftMenuData = ref([
|
|
|
to: [],
|
|
|
top: 0,
|
|
|
left: 0,
|
|
|
- status: "loading",
|
|
|
- isSource: false,
|
|
|
+ // status: "loading",
|
|
|
+ isSource: true,
|
|
|
isTarget: false,
|
|
|
config: [
|
|
|
{
|
|
|
label: "名称",
|
|
|
name: "label",
|
|
|
type: "text",
|
|
|
- value: "完结节点2",
|
|
|
+ value: "高压侧测控",
|
|
|
+ require: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "描述",
|
|
|
+ name: "description",
|
|
|
+ type: "textarea",
|
|
|
+ value: "",
|
|
|
+ require: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "归属",
|
|
|
+ name: "affiliation",
|
|
|
+ type: "select",
|
|
|
+ value: "check",
|
|
|
+ require: true,
|
|
|
+ options: [
|
|
|
+ { label: "审核信息", value: "check" },
|
|
|
+ { label: "生产经营", value: "manage" },
|
|
|
+ { label: "结算报销", value: "account" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ to: [],
|
|
|
+ top: 0,
|
|
|
+ left: 0,
|
|
|
+ // status: "loading",
|
|
|
+ isSource: true,
|
|
|
+ isTarget: false,
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ label: "名称",
|
|
|
+ name: "label",
|
|
|
+ type: "text",
|
|
|
+ value: "母联智能终端",
|
|
|
+ require: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "描述",
|
|
|
+ name: "description",
|
|
|
+ type: "textarea",
|
|
|
+ value: "",
|
|
|
+ require: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "归属",
|
|
|
+ name: "affiliation",
|
|
|
+ type: "select",
|
|
|
+ value: "check",
|
|
|
+ require: true,
|
|
|
+ options: [
|
|
|
+ { label: "审核信息", value: "check" },
|
|
|
+ { label: "生产经营", value: "manage" },
|
|
|
+ { label: "结算报销", value: "account" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ to: [],
|
|
|
+ top: 0,
|
|
|
+ left: 0,
|
|
|
+ // status: "loading",
|
|
|
+ isSource: true,
|
|
|
+ isTarget: false,
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ label: "名称",
|
|
|
+ name: "label",
|
|
|
+ type: "text",
|
|
|
+ value: "智能终端(高压侧)",
|
|
|
+ require: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "描述",
|
|
|
+ name: "description",
|
|
|
+ type: "textarea",
|
|
|
+ value: "",
|
|
|
+ require: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "归属",
|
|
|
+ name: "affiliation",
|
|
|
+ type: "select",
|
|
|
+ value: "check",
|
|
|
+ require: true,
|
|
|
+ options: [
|
|
|
+ { label: "审核信息", value: "check" },
|
|
|
+ { label: "生产经营", value: "manage" },
|
|
|
+ { label: "结算报销", value: "account" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ to: [],
|
|
|
+ top: 0,
|
|
|
+ left: 0,
|
|
|
+ // status: "loading",
|
|
|
+ isSource: true,
|
|
|
+ isTarget: false,
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ label: "名称",
|
|
|
+ name: "label",
|
|
|
+ type: "text",
|
|
|
+ value: "智能终端(低压侧)",
|
|
|
+ require: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "描述",
|
|
|
+ name: "description",
|
|
|
+ type: "textarea",
|
|
|
+ value: "",
|
|
|
+ require: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "归属",
|
|
|
+ name: "affiliation",
|
|
|
+ type: "select",
|
|
|
+ value: "check",
|
|
|
+ require: true,
|
|
|
+ options: [
|
|
|
+ { label: "审核信息", value: "check" },
|
|
|
+ { label: "生产经营", value: "manage" },
|
|
|
+ { label: "结算报销", value: "account" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ to: [],
|
|
|
+ top: 0,
|
|
|
+ left: 0,
|
|
|
+ // status: "loading",
|
|
|
+ isSource: true,
|
|
|
+ isTarget: false,
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ label: "名称",
|
|
|
+ name: "label",
|
|
|
+ type: "text",
|
|
|
+ value: "母线合并单元",
|
|
|
require: true,
|
|
|
},
|
|
|
{
|
|
@@ -279,6 +528,84 @@ let leftMenuData = ref([
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
+ // {
|
|
|
+ // name: "完结列表",
|
|
|
+ // children: [
|
|
|
+ // {
|
|
|
+ // to: [],
|
|
|
+ // top: 0,
|
|
|
+ // left: 0,
|
|
|
+ // status: "loading",
|
|
|
+ // type: "target",
|
|
|
+ // isSource: false,
|
|
|
+ // isTarget: false,
|
|
|
+ // config: [
|
|
|
+ // {
|
|
|
+ // label: "名称",
|
|
|
+ // name: "label",
|
|
|
+ // type: "text",
|
|
|
+ // value: "完结节点1",
|
|
|
+ // require: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // label: "描述",
|
|
|
+ // name: "description",
|
|
|
+ // type: "textarea",
|
|
|
+ // value: "check",
|
|
|
+ // require: false,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // label: "归属",
|
|
|
+ // name: "affiliation",
|
|
|
+ // type: "select",
|
|
|
+ // value: "",
|
|
|
+ // require: true,
|
|
|
+ // options: [
|
|
|
+ // { label: "审核信息", value: "check" },
|
|
|
+ // { label: "生产经营", value: "manage" },
|
|
|
+ // { label: "结算报销", value: "account" },
|
|
|
+ // ],
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // to: [],
|
|
|
+ // top: 0,
|
|
|
+ // left: 0,
|
|
|
+ // status: "loading",
|
|
|
+ // isSource: false,
|
|
|
+ // isTarget: false,
|
|
|
+ // config: [
|
|
|
+ // {
|
|
|
+ // label: "名称",
|
|
|
+ // name: "label",
|
|
|
+ // type: "text",
|
|
|
+ // value: "完结节点2",
|
|
|
+ // require: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // label: "描述",
|
|
|
+ // name: "description",
|
|
|
+ // type: "textarea",
|
|
|
+ // value: "",
|
|
|
+ // require: false,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // label: "归属",
|
|
|
+ // name: "affiliation",
|
|
|
+ // type: "select",
|
|
|
+ // value: "check",
|
|
|
+ // require: true,
|
|
|
+ // options: [
|
|
|
+ // { label: "审核信息", value: "check" },
|
|
|
+ // { label: "生产经营", value: "manage" },
|
|
|
+ // { label: "结算报销", value: "account" },
|
|
|
+ // ],
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
+ // },
|
|
|
]);
|
|
|
//渲染节点信息(默认是后台传过来的)
|
|
|
let info = ref([]);
|
|
@@ -417,7 +744,7 @@ const makeFun = (item) => {
|
|
|
['Arrow', { width: 12, length: 12, location: 0.5 }],
|
|
|
// ["Label", { location: 0.5, label: "标签", cssClass: "endpointTargetLabel", visible: true, id: "label" }]
|
|
|
],
|
|
|
- anchor: ['Bottom'],
|
|
|
+ // anchor: ['Bottom'],
|
|
|
// anchor: "Continuous"
|
|
|
}
|
|
|
plumbInit.addEndpoint(item.id + '', common)
|
|
@@ -468,25 +795,23 @@ const getStyle = function (item) {
|
|
|
position: "absolute",
|
|
|
left: item.left + "px",
|
|
|
top: item.top + "px",
|
|
|
- // color:item.color,
|
|
|
- // border:'1px solid #',
|
|
|
- width: "180px",
|
|
|
- height: "36px",
|
|
|
- lineHeight: "36px",
|
|
|
+ width: "calc(100% - 750px)",
|
|
|
+ height: "40px",
|
|
|
+ lineHeight: "40px",
|
|
|
textAlign: "center",
|
|
|
- borderLeft: "5px solid blue",
|
|
|
- borderRadius: "4%",
|
|
|
- boxShadow: "#eee 3px 3px 3px 3px",
|
|
|
+ color:' #255CE7',
|
|
|
+ backgroundColor: '#EDF2FF',
|
|
|
cursor: "pointer",
|
|
|
+ border:' solid 1px #255CE7'
|
|
|
};
|
|
|
};
|
|
|
//初始化jsplumb实例
|
|
|
let plumbInit = jsPlumb.getInstance();
|
|
|
//
|
|
|
plumbInit.bind("click", (conn, originalEvent) => {
|
|
|
- console.log(conn, "点击连线");
|
|
|
+ console.log(conn, "点击连线1");
|
|
|
let lineInfo = {};
|
|
|
- console.log(info.value, "整体信息");
|
|
|
+ // console.log(info.value, "整体信息");
|
|
|
let sourceInfo = info.value.find((v) => v.id === conn.sourceId);
|
|
|
let targetInfo = info.value.find((v) => v.id === conn.targetId);
|
|
|
lineInfo = {
|
|
@@ -591,6 +916,12 @@ onMounted(() => {
|
|
|
renderFlag.value = "render";
|
|
|
});
|
|
|
}, 2000);
|
|
|
+ jsPlumb.bind('click', function (conn, originalEvent) {
|
|
|
+ // console.log(conn,'comn');
|
|
|
+ // if (window.prompt('确定删除所点击的链接吗? 输入1确定') === '1') {
|
|
|
+ // jsPlumb.detach(conn)
|
|
|
+ // }
|
|
|
+ })
|
|
|
});
|
|
|
//右侧保存值
|
|
|
const changeActiveNodeInfo = (info) => {
|
|
@@ -640,14 +971,22 @@ defineExpose({
|
|
|
});
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
+ul {
|
|
|
+ list-style: none;
|
|
|
+ margin: 0;
|
|
|
+ padding: 0;
|
|
|
+ margin-left: 5px;
|
|
|
+}
|
|
|
+
|
|
|
.box {
|
|
|
width: 100%;
|
|
|
- height: 100%;
|
|
|
+ height: calc(100vh - 360px);
|
|
|
display: flex;
|
|
|
+ margin-top: 10px;
|
|
|
}
|
|
|
|
|
|
.leftMenu {
|
|
|
- width: 240px;
|
|
|
+ width: calc(100% - 1080px);
|
|
|
border-right: 1px solid #d3d3d3;
|
|
|
border-bottom: 1px solid #d3d3d3;
|
|
|
|
|
@@ -660,14 +999,17 @@ defineExpose({
|
|
|
}
|
|
|
|
|
|
.content {
|
|
|
- width: 180px;
|
|
|
+ width: calc(100% - 20px);
|
|
|
height: 40px;
|
|
|
- border: dashed 1px #030303;
|
|
|
+ border: solid 1px #255CE7;
|
|
|
text-align: center;
|
|
|
line-height: 40px;
|
|
|
margin-bottom: 10px;
|
|
|
- margin-right: 10px;
|
|
|
- cursor: pointer;
|
|
|
+ // margin-right: 10px;
|
|
|
+ cursor: pointer;
|
|
|
+ color: #255CE7;
|
|
|
+ background-color: #EDF2FF;
|
|
|
+ overflow-y: auto;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -709,6 +1051,14 @@ defineExpose({
|
|
|
.activeNode {
|
|
|
background-color: #80eaf8;
|
|
|
}
|
|
|
+:deep(.el-collapse-item__content){
|
|
|
+ padding: 0;
|
|
|
+}
|
|
|
+.setBox{
|
|
|
+ width: 100%;
|
|
|
+ height: calc(100% - 500px);
|
|
|
+ border: 1px solid blue;
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
|