Commit 3478629f authored by 张超's avatar 张超 🎱

updateui

parent ef3ff29e
...@@ -93,7 +93,10 @@ $dock-pin-width: 9px; ...@@ -93,7 +93,10 @@ $dock-pin-width: 9px;
&.hover, &:hover { &.hover, &:hover {
stroke: $--color-primary; stroke: $--color-primary;
stroke-dasharray: 5, 1; stroke-dasharray: 5, 1;
} }
&.contact {
stroke: $--color-primary;
}
} }
.node { .node {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
ref="tree" ref="tree"
:data="views" :data="views"
:props="defaultProps" :props="defaultProps"
:expand-on-click-node="false" :expand-on-click-node="true"
:default-expanded-keys="expandedKeys" :default-expanded-keys="expandedKeys"
draggable draggable
node-key="uuid" node-key="uuid"
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
> >
<div slot-scope="{ node, data }" class="tree-node"> <div slot-scope="{ node, data }" class="tree-node">
<div class="node-name" > <div class="node-name" >
<i v-show="Object.keys(iconMap).includes(data.type)" :class="iconMap[data.type]" style="color:#9b82e3"></i>
{{data.name}} {{data.name}}
</div> </div>
...@@ -91,7 +92,11 @@ ...@@ -91,7 +92,11 @@
authorization: 'Bearer ' + window['zeroing_token'], authorization: 'Bearer ' + window['zeroing_token'],
}, },
expandedKeys: [], expandedKeys: [],
nodeFilterPresets: this.$t('nodeFilterPresets'), nodeFilterPresets: this.$t('nodeFilterPresets'),
iconMap: {
image: 'el-icon-picture',
label: 'el-icon-edit-outline'
}
}; };
}, },
mounted() { mounted() {
...@@ -217,6 +222,8 @@ ...@@ -217,6 +222,8 @@
* 点击左侧视图列表 * 点击左侧视图列表
*/ */
handleNodeClick(data, node) { handleNodeClick(data, node) {
console.log('handleNodeClick');
this.$store.dispatch('activeComponent', {data, node}); this.$store.dispatch('activeComponent', {data, node});
}, },
toAddView() { toAddView() {
......
...@@ -286,7 +286,7 @@ ...@@ -286,7 +286,7 @@
prev: process, prev: process,
next: nextProcess.data, next: nextProcess.data,
outputType, outputType,
outputIndex, outputIndex,
}); });
this.drawState.lineID++; this.drawState.lineID++;
} else { } else {
...@@ -432,15 +432,46 @@ ...@@ -432,15 +432,46 @@
if (processNode) { if (processNode) {
let hint = 'pn_' + process.uuid === key; let hint = 'pn_' + process.uuid === key;
processNode.setActive(hint); processNode.setActive(hint);
if (hint && this.selectedProcessNode !== processNode) { if (hint && this.selectedProcessNode !== processNode) {
// 相关联的线点亮
this.setContactLine(process);
this.selectedProcessNode = processNode; this.selectedProcessNode = processNode;
this.$emit('select-process-node', process); this.$emit('select-process-node', process);
} }
} }
} }
} }
}, },
setContactLine(process) {
let preArr = [];
let _fetchNode = (_uuid, type) => {
Object.keys(this.lines).filter(_sliceKey => !preArr.includes(_sliceKey)).map(key => {
let itemLine = this.lines[key];
if(type === 'pre') {
if(itemLine.next && itemLine.next.uuid === _uuid) {
preArr.push(key)
if(itemLine.prev && itemLine.prev.uuid) {
_fetchNode(itemLine.prev.uuid, 'pre')
}
}
} else if(type === 'next'){
if(itemLine.prev && itemLine.prev.uuid === _uuid) {
preArr.push(key)
if(itemLine.next && itemLine.next.uuid) {
_fetchNode(itemLine.next.uuid, 'next')
}
}
}
})
}
_fetchNode(process._data.uuid, 'pre');
_fetchNode(process._data.uuid, 'next');
Object.keys(this.lines).map(key => {
this.$set(this.lines, key, { ...this.lines[key], onContact: preArr.includes(key)})
})
},
updateProcessNode(metaID) { updateProcessNode(metaID) {
this.$nextTick(() => { this.$nextTick(() => {
......
<template> <template>
<path class="line" :d="transPath" @dblclick="onDblClick"></path> <path :class="['line', {'contact': onContact}]" :d="transPath" @dblclick="onDblClick"></path>
</template> </template>
<script> <script>
...@@ -7,13 +7,16 @@ ...@@ -7,13 +7,16 @@
export default { export default {
name: "LinkLine", name: "LinkLine",
props: ['data'], props: ['data'],
created() {
this.onContact = false
},
mounted() { mounted() {
console.log(); console.log();
}, },
watch: { watch: {
'data': function (v) { 'data': function (v) {
this.onContact = v.onContact;
} }
}, },
computed: { computed: {
......
...@@ -59,6 +59,8 @@ ...@@ -59,6 +59,8 @@
@mousedown="onPinDown" @mousedown="onPinDown"
></dock-pin> ></dock-pin>
</div> </div>
<!-- 判断是否有子节点 -->
<i class="sub-mark el-icon-s-tools" v-show="meta.sub && meta.from === 'custom' && Object.keys(meta.sub).length > 0" style="color:#9b82e3;text-align: center;"></i>
</div> </div>
</foreignObject> </foreignObject>
</template> </template>
......
...@@ -6780,7 +6780,7 @@ promise-inflight@^1.0.1: ...@@ -6780,7 +6780,7 @@ promise-inflight@^1.0.1:
"props-compute@http://gitlab2.dui88.com/laoqifeng/props-compute.git": "props-compute@http://gitlab2.dui88.com/laoqifeng/props-compute.git":
version "1.0.0" version "1.0.0"
resolved "http://gitlab2.dui88.com/laoqifeng/props-compute.git#c676e9e12a06ccc3556101197171ee47e9ebdd3c" resolved "http://gitlab2.dui88.com/laoqifeng/props-compute.git#9c6abcccf41f8d38d3a327716060f5e7722c7c1a"
proxy-addr@~2.0.5: proxy-addr@~2.0.5:
version "2.0.5" version "2.0.5"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment