Commit 34bbb913 authored by 劳工's avatar 劳工

Merge branch 'chao' into 'dev'

updateui

See merge request !10
parents ef3ff29e 3478629f
......@@ -93,6 +93,9 @@ $dock-pin-width: 9px;
&.hover, &:hover {
stroke: $--color-primary;
stroke-dasharray: 5, 1;
}
&.contact {
stroke: $--color-primary;
}
}
......
......@@ -28,7 +28,7 @@
ref="tree"
:data="views"
:props="defaultProps"
:expand-on-click-node="false"
:expand-on-click-node="true"
:default-expanded-keys="expandedKeys"
draggable
node-key="uuid"
......@@ -43,6 +43,7 @@
>
<div slot-scope="{ node, data }" class="tree-node">
<div class="node-name" >
<i v-show="Object.keys(iconMap).includes(data.type)" :class="iconMap[data.type]" style="color:#9b82e3"></i>
{{data.name}}
</div>
......@@ -92,6 +93,10 @@
},
expandedKeys: [],
nodeFilterPresets: this.$t('nodeFilterPresets'),
iconMap: {
image: 'el-icon-picture',
label: 'el-icon-edit-outline'
}
};
},
mounted() {
......@@ -217,6 +222,8 @@
* 点击左侧视图列表
*/
handleNodeClick(data, node) {
console.log('handleNodeClick');
this.$store.dispatch('activeComponent', {data, node});
},
toAddView() {
......
......@@ -434,12 +434,43 @@
let hint = 'pn_' + process.uuid === key;
processNode.setActive(hint);
if (hint && this.selectedProcessNode !== processNode) {
// 相关联的线点亮
this.setContactLine(process);
this.selectedProcessNode = processNode;
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) {
this.$nextTick(() => {
......
<template>
<path class="line" :d="transPath" @dblclick="onDblClick"></path>
<path :class="['line', {'contact': onContact}]" :d="transPath" @dblclick="onDblClick"></path>
</template>
<script>
......@@ -8,12 +8,15 @@
export default {
name: "LinkLine",
props: ['data'],
created() {
this.onContact = false
},
mounted() {
console.log();
},
watch: {
'data': function (v) {
this.onContact = v.onContact;
}
},
computed: {
......
......@@ -59,6 +59,8 @@
@mousedown="onPinDown"
></dock-pin>
</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>
</foreignObject>
</template>
......
......@@ -6780,7 +6780,7 @@ promise-inflight@^1.0.1:
"props-compute@http://gitlab2.dui88.com/laoqifeng/props-compute.git":
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:
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