更改PCTree结构
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user