更改PCTree结构
This commit is contained in:
parent
99d466d195
commit
99d8db171c
@ -5,7 +5,7 @@ SV.registerLayout('PCTree', {
|
||||
|
||||
sourcesPreprocess(sources) {
|
||||
|
||||
sources[0].rootLabel = ['data', 'parent', 'fistChild'];
|
||||
sources[0].rootLabel = ['data', 'parent', 'firstChild'];
|
||||
|
||||
return sources;
|
||||
},
|
||||
@ -28,7 +28,7 @@ SV.registerLayout('PCTree', {
|
||||
size: [60, 27],
|
||||
style: {
|
||||
stroke: '#333',
|
||||
fill: '#95e1d3'
|
||||
fill: '#00AF92'
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -68,7 +68,7 @@ SV.registerLayout('PCTree', {
|
||||
xInterval: 50
|
||||
},
|
||||
behavior: {
|
||||
dragNode: false
|
||||
dragNode: ['PCTreeNode']
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
@ -124,6 +124,35 @@
|
||||
type: 'PCTreeNode',
|
||||
data: 1,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
data: 'b',
|
||||
type: 'PCTreeHead',
|
||||
parent: '0',
|
||||
index: 1,
|
||||
},
|
||||
],
|
||||
layouter: 'PCTree'
|
||||
}
|
||||
},
|
||||
{
|
||||
pctree:{
|
||||
data:[
|
||||
{
|
||||
id: 1,
|
||||
data: 'a',
|
||||
type: 'PCTreeHead',
|
||||
parent: '-1',
|
||||
headNext: 'PCTreeNode#2',
|
||||
index: 0,
|
||||
root: true
|
||||
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
type: 'PCTreeNode',
|
||||
data: 1,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
data: 'b',
|
||||
@ -135,8 +164,14 @@
|
||||
{
|
||||
id: 5,
|
||||
type: 'PCTreeNode',
|
||||
next: 'PCTreeNode#6',
|
||||
data: 2,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
data: 3,
|
||||
type: 'PCTreeNode'
|
||||
}
|
||||
],
|
||||
layouter: 'PCTree'
|
||||
}
|
||||
|
||||
11629
dist/sv.js
vendored
11629
dist/sv.js
vendored
File diff suppressed because one or more lines are too long
@ -1,3 +1,11 @@
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2022-01-26 01:58:25
|
||||
* @LastEditTime: 2022-02-17 21:57:51
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
* @FilePath: \水功能c:\Users\13127\Desktop\最近的前端文件\可视化0126\StructV2\src\RegisteredShape\linkListNode.ts
|
||||
*/
|
||||
import { Util } from "../Common/util";
|
||||
|
||||
|
||||
@ -36,8 +44,9 @@ export default Util.registerShape('link-list-node', {
|
||||
draggable: true
|
||||
});
|
||||
|
||||
const style = (cfg.labelCfg && cfg.labelCfg.style) || {};
|
||||
|
||||
if (cfg.label) {
|
||||
const style = (cfg.labelCfg && cfg.labelCfg.style) || {};
|
||||
group.addShape('text', {
|
||||
attrs: {
|
||||
x: width * (5 / 6),
|
||||
@ -52,6 +61,24 @@ export default Util.registerShape('link-list-node', {
|
||||
draggable: true
|
||||
});
|
||||
}
|
||||
|
||||
//节点没有后续指针时
|
||||
if(!cfg.next){
|
||||
group.addShape('text', {
|
||||
attrs: {
|
||||
x: width * (4 / 3),
|
||||
y: height * ( 6 / 5),
|
||||
textAlign: 'center',
|
||||
textBaseline: 'middle',
|
||||
text: '^',
|
||||
fill: style.fill || '#000',
|
||||
fontSize: 18,
|
||||
cursor: cfg.style.cursor,
|
||||
},
|
||||
name: 'text',
|
||||
draggable: true
|
||||
});
|
||||
}
|
||||
|
||||
return wrapperRect;
|
||||
},
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2022-01-18 20:42:31
|
||||
* @LastEditTime: 2022-01-26 01:59:47
|
||||
* @LastEditTime: 2022-02-17 21:57:59
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
* @FilePath: \测试数据c:\Users\13127\Desktop\最近的前端文件\可视化源码-new\StructV2\src\RegisteredShape\treeCellNode.ts
|
||||
@ -66,8 +66,9 @@ export default registerNode('three-cell', {
|
||||
textAlign: 'center',
|
||||
textBaseline: 'middle',
|
||||
text: cfg.rootLabel[0],
|
||||
fill: style.fill || '#000',
|
||||
fill: style.fill || '#bbb',
|
||||
fontSize: style.fontSize || 16,
|
||||
fontStyle: 'italic',
|
||||
cursor: cfg.style.cursor,
|
||||
},
|
||||
name: 'text',
|
||||
@ -81,8 +82,9 @@ export default registerNode('three-cell', {
|
||||
textAlign: 'center',
|
||||
textBaseline: 'middle',
|
||||
text: cfg.rootLabel[1],
|
||||
fill: style.fill || '#000',
|
||||
fill: style.fill || '#bbb',
|
||||
fontSize: style.fontSize || 16,
|
||||
fontStyle: 'italic',
|
||||
cursor: cfg.style.cursor,
|
||||
},
|
||||
name: 'text',
|
||||
@ -96,8 +98,9 @@ export default registerNode('three-cell', {
|
||||
textAlign: 'center',
|
||||
textBaseline: 'middle',
|
||||
text: cfg.rootLabel[2],
|
||||
fill: style.fill || '#000',
|
||||
fill: style.fill || '#bbb',
|
||||
fontSize: style.fontSize || 16,
|
||||
fontStyle: 'italic',
|
||||
cursor: cfg.style.cursor,
|
||||
},
|
||||
name: 'text',
|
||||
@ -114,8 +117,9 @@ export default registerNode('three-cell', {
|
||||
textAlign: 'center',
|
||||
textBaseline: 'middle',
|
||||
text: cfg.index,
|
||||
fill: style.fill || '#000',
|
||||
fill: style.fill || '#bbb',
|
||||
fontSize: style.fontSize || 16,
|
||||
fontStyle: 'italic',
|
||||
cursor: cfg.style.cursor,
|
||||
},
|
||||
name: 'text',
|
||||
|
||||
@ -174,7 +174,7 @@ export class Reconcile {
|
||||
const prevLabel = prevItem.get('label'),
|
||||
label = item.get('label');
|
||||
|
||||
if (prevLabel !== label) {
|
||||
if (String(prevLabel) !== String(label)) {
|
||||
labelChangeModels.push(item);
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user