2018-10-16 16:32:22 +08:00
|
|
|
// 表格类
|
|
|
|
class Table {
|
|
|
|
rowLength: number;
|
|
|
|
columnLength: number;
|
|
|
|
selectedRow: string;
|
|
|
|
selectedCell: string;
|
|
|
|
instanceOfCells: any;
|
|
|
|
constructor(rowLength: number, columnLength: number, instanceOfCells: any) {
|
|
|
|
this.rowLength = rowLength;
|
|
|
|
this.columnLength = columnLength;
|
|
|
|
this.instanceOfCells = instanceOfCells;
|
|
|
|
this.selectedRow;
|
|
|
|
this.selectedCell;
|
|
|
|
}
|
|
|
|
render() {}
|
2018-10-18 09:26:28 +08:00
|
|
|
deleteCurrentRow() {}
|
|
|
|
deleteCurrenCol() {}
|
|
|
|
insertColToLeft() {}
|
|
|
|
insertColToRight() {}
|
|
|
|
insertRowToTop() {}
|
|
|
|
insertRowToBottom() {}
|
|
|
|
mergeRightCell() {}
|
|
|
|
mergeBottomCell() {}
|
|
|
|
|
|
|
|
addTemplate() {}
|
|
|
|
addFormHeader() {}
|
|
|
|
addSplitedGroupHeader() {}
|
|
|
|
addBanCaiDetails() {}
|
|
|
|
addSplitedGroupFooter() {}
|
|
|
|
addFormFooter() {}
|
2018-10-16 16:32:22 +08:00
|
|
|
}
|
2018-10-18 09:26:28 +08:00
|
|
|
|
2018-10-16 16:32:22 +08:00
|
|
|
// 单元类
|
|
|
|
class Cell {
|
|
|
|
cellId: string;
|
2018-10-17 15:20:24 +08:00
|
|
|
font: string;
|
2018-10-16 16:32:22 +08:00
|
|
|
fontSize: string;
|
2018-10-17 15:20:24 +08:00
|
|
|
fontColor: string;
|
|
|
|
fontWeight: string;
|
|
|
|
fontStyle: string;
|
|
|
|
textDecoration: string; // underline or line throught
|
|
|
|
border: string;
|
|
|
|
backgroundColor: string;
|
|
|
|
textAlign: string;
|
2018-10-16 16:32:22 +08:00
|
|
|
constructor(id) {
|
|
|
|
this.cellId = id;
|
2018-10-17 15:20:24 +08:00
|
|
|
this.font = "Serif";
|
2018-10-16 16:32:22 +08:00
|
|
|
this.fontSize = "12";
|
2018-10-17 15:20:24 +08:00
|
|
|
this.fontColor = "black";
|
|
|
|
this.fontWeight = "normal";
|
|
|
|
this.fontStyle = "normal";
|
|
|
|
this.textDecoration = "";
|
|
|
|
this.border = "";
|
|
|
|
this.backgroundColor = "";
|
|
|
|
this.textAlign = "left";
|
2018-10-16 16:32:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
CreateCellElement() {
|
|
|
|
let tdElement = document.createElement("td");
|
2018-10-17 15:20:24 +08:00
|
|
|
|
|
|
|
tdElement.style.fontFamily = this.font;
|
|
|
|
tdElement.style.backgroundColor = this.backgroundColor;
|
|
|
|
|
2018-10-16 16:32:22 +08:00
|
|
|
tdElement.style.border = this.border + "px solid";
|
|
|
|
tdElement.style.fontSize = this.fontSize + "px";
|
2018-10-17 15:20:24 +08:00
|
|
|
tdElement.style.color = this.fontColor;
|
|
|
|
tdElement.style.fontWeight = this.fontWeight;
|
|
|
|
tdElement.style.fontStyle = this.fontStyle;
|
|
|
|
tdElement.style.textDecoration = this.textDecoration;
|
|
|
|
tdElement.style.textAlign = this.textAlign;
|
|
|
|
tdElement.innerHTML = "cell";
|
2018-10-16 16:32:22 +08:00
|
|
|
|
|
|
|
return tdElement;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export { Table, Cell };
|