diff --git a/src/iscs/shape/stateTable.js b/src/iscs/shape/stateTable.js index 7417a9e54..5d39cd192 100644 --- a/src/iscs/shape/stateTable.js +++ b/src/iscs/shape/stateTable.js @@ -59,6 +59,12 @@ export default class StateTable extends Group { }); this.lines = []; let columnWidth = 0; + let rowNum = model.rowNum; + let contentIndex = 2; + if (model.headerType === 'none') { + rowNum = model.rowNum - 1; + contentIndex = 1; + } model.columnWidthList.forEach(item => { columnWidth += item; const line = new Line({ @@ -68,7 +74,7 @@ export default class StateTable extends Group { x1: columnWidth, y1: model.headerType === 'merge' ? model.rowHeight : 0, x2: columnWidth, - y2: model.rowNum * model.rowHeight + y2: rowNum * model.rowHeight }, style: { stroke: '#FFF', @@ -85,7 +91,7 @@ export default class StateTable extends Group { x: 0, y: 0, width: columnWidth, - height: model.rowNum * model.rowHeight + height: rowNum * model.rowHeight }, style: { stroke: '#aFFF', @@ -94,7 +100,7 @@ export default class StateTable extends Group { } }); this.grouper.add(this.tabelBorder); - for (let i = 0; i < model.rowNum; i++) { + for (let i = 0; i < rowNum; i++) { const line = new Line({ zlevel: this.zlevel, z: this.z, @@ -168,7 +174,7 @@ export default class StateTable extends Group { _subType: stateMap[item['column' + (j + 1)]], style:{ x: elem / 2 + width, - y: model.rowHeight * (i + 2), + y: model.rowHeight * (i + contentIndex), fontWeight: 'normal', fontSize: model.fontSize, fontFamily: 'consolas', diff --git a/src/views/iscs/iscsDraw/iscsOperate/stateTable.vue b/src/views/iscs/iscsDraw/iscsOperate/stateTable.vue index f4cb7d671..900d022e5 100644 --- a/src/views/iscs/iscsDraw/iscsOperate/stateTable.vue +++ b/src/views/iscs/iscsDraw/iscsOperate/stateTable.vue @@ -159,6 +159,7 @@ export default { this.addModel.tableData = model.tableData; this.addModel.headerFontSize = model.headerFontSize; this.addModel.fontSize = model.fontSize; + this.addModel.headerContextList = model.headerContextList; } } },