@@ -44,12 +44,9 @@ export default class TableNode extends Node {
44
44
mounted ( ) {
45
45
// 生成field的endpoint
46
46
this . _createNodeEndpoint ( ) ;
47
- // 保持title宽度
48
- if ( this . fieldsList . length > 0 ) {
49
- let width = $ ( this . fieldsList [ 0 ] . dom ) . width ( ) ;
50
- $ ( this . dom ) . find ( '.title' ) . css ( 'width' , width ) ;
51
- } else {
52
- $ ( this . dom ) . find ( '.title' ) . css ( 'width' , this . options . _emptyWidth || width ) ;
47
+
48
+ if ( this . fieldsList . length === 0 ) {
49
+ $ ( this . dom ) . find ( '.title' ) . css ( 'width' , this . options . _emptyWidth || 150 ) ;
53
50
}
54
51
55
52
$ ( this . dom ) . on ( 'dblclick' , ( e ) => {
@@ -96,8 +93,8 @@ export default class TableNode extends Node {
96
93
97
94
// 记录状态
98
95
this . status = 'expand' ;
99
- // 改变icon状态
100
- $ ( this . dom ) . find ( '.table-build-icon-xiala' ) . removeClass ( 'collapse' ) ;
96
+ // 改变伸缩状态
97
+ $ ( this . dom ) . removeClass ( 'collapse' ) ;
101
98
}
102
99
103
100
_collapse ( oldEdges ) {
@@ -113,8 +110,8 @@ export default class TableNode extends Node {
113
110
} ) ;
114
111
// 记录状态
115
112
this . status = 'collapse' ;
116
- // 改变icon状态
117
- $ ( this . dom ) . find ( '.table-build-icon-xiala' ) . addClass ( 'collapse' ) ;
113
+ // 改变伸缩状态
114
+ $ ( this . dom ) . addClass ( 'collapse' ) ;
118
115
119
116
// 生成新线段,并去重
120
117
let newEdges = [ ] ;
@@ -391,11 +388,6 @@ export default class TableNode extends Node {
391
388
_ . set ( this , 'options._columns' , newCol ) ;
392
389
this . _addFields ( ) ;
393
390
394
- // 获取所有columns的宽度
395
- let width = getWidth ( newCol ) ;
396
- let textWidth = width - OPER_ICON_WIDTH ;
397
- $ ( this . dom ) . find ( '.title' ) . css ( 'width' , width ) ;
398
- $ ( this . dom ) . find ( '.title-text' ) . css ( 'width' , textWidth ) ;
399
391
}
400
392
401
393
_createTitleEndpoint ( ) {
0 commit comments