cui-print 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/dist/font/iconfont.css +151 -0
- package/dist/font/iconfont.js +1 -0
- package/dist/font/iconfont.json +247 -0
- package/dist/font/iconfont.ttf +0 -0
- package/dist/font/iconfont.woff +0 -0
- package/dist/font/iconfont.woff2 +0 -0
- package/dist/index.css +1 -0
- package/dist/index.es.js +51053 -0
- package/dist/index.umd.js +1030 -0
- package/dist/print-designer-api/create-style/create-base-component-style.js +116 -0
- package/dist/print-designer-api/create-style/create-complex-table-style.js +472 -0
- package/dist/print-designer-api/create-style/create-form-component-style.js +78 -0
- package/dist/print-designer-api/create-style/create-form-item-style.js +144 -0
- package/dist/print-designer-api/create-style/create-grid-style.js +49 -0
- package/dist/print-designer-api/create-style/create-table-layout-style.js +128 -0
- package/dist/print-designer-api/create-style/create-table-style.js +93 -0
- package/dist/print-designer-api/print-designer-helper.js +912 -0
- package/dist/print-designer-api/print-designer-style-helper.js +96 -0
- package/dist/print-designer-api/print-designer-utils.js +27 -0
- package/dist/print-designer-api/print-global-style/base.less +20 -0
- package/dist/print-designer-api/print-global-style/common.less +3 -0
- package/dist/print-designer-api/print-global-style/custom.less +4 -0
- package/dist/print-designer-api/print-global-style/index.css +812 -0
- package/dist/print-designer-api/print-global-style/index.js +813 -0
- package/dist/print-designer-api/print-global-style/index.less +9 -0
- package/dist/print-designer-api/print-global-style/print-base-component.less +123 -0
- package/dist/print-designer-api/print-global-style/print-container.less +57 -0
- package/dist/print-designer-api/print-global-style/print-continue/index.less +14 -0
- package/dist/print-designer-api/print-global-style/print-continue/print-complex-table/auto-continue-not-span.less +61 -0
- package/dist/print-designer-api/print-global-style/print-continue/print-complex-table/auto-continue-preview.less +12 -0
- package/dist/print-designer-api/print-global-style/print-continue/print-complex-table/auto-continue-span.less +88 -0
- package/dist/print-designer-api/print-global-style/print-continue/print-complex-table/fixed-continue.less +37 -0
- package/dist/print-designer-api/print-global-style/print-continue/print-complex-table/index.less +96 -0
- package/dist/print-designer-api/print-global-style/print-continue/print-complex-table/pagination-preview.less +12 -0
- package/dist/print-designer-api/print-global-style/print-continue/print-complex-table/pagination.less +61 -0
- package/dist/print-designer-api/print-global-style/print-form-component.less +161 -0
- package/dist/print-designer-api/print-global-style/print-form-item.less +162 -0
- package/dist/print-designer-api/print-global-style/printing.less +16 -0
- package/dist/print-designer-api/print-soket.js +31 -0
- package/dist/print-designer-api/use-create-html/create-html-utils.js +43 -0
- package/dist/print-designer-api/use-create-html/index.js +287 -0
- package/dist/print-designer-api/use-create-html/use-base-component-helper.js +129 -0
- package/dist/print-designer-api/use-create-html/use-complex-table-helper/complex-table-tools.js +129 -0
- package/dist/print-designer-api/use-create-html/use-complex-table-helper/create-table-header.js +111 -0
- package/dist/print-designer-api/use-create-html/use-complex-table-helper/index.js +87 -0
- package/dist/print-designer-api/use-create-html/use-complex-table-helper/use-auto-height-preview.js +84 -0
- package/dist/print-designer-api/use-create-html/use-complex-table-helper/use-auto-height.js +379 -0
- package/dist/print-designer-api/use-create-html/use-complex-table-helper/use-default.js +75 -0
- package/dist/print-designer-api/use-create-html/use-complex-table-helper/use-fixed-height.js +220 -0
- package/dist/print-designer-api/use-create-html/use-complex-table-helper/use-pagination-preview.js +84 -0
- package/dist/print-designer-api/use-create-html/use-complex-table-helper/use-pagination.js +272 -0
- package/dist/print-designer-api/use-create-html/use-form-component-helper.js +164 -0
- package/dist/print-designer-api/use-create-html/use-format/index.js +102 -0
- package/dist/print-designer-api/use-create-html/use-format/use-complex-table-auto.js +337 -0
- package/dist/print-designer-api/use-create-html/use-format/use-complex-table-fiexd.js +233 -0
- package/dist/print-designer-api/use-create-html/use-format/use-complex-table-pagination.js +286 -0
- package/dist/print-designer-api/use-create-html/use-grid-helper.js +35 -0
- package/dist/print-designer-api/use-create-html/use-table-layout-helper.js +213 -0
- package/dist/print-designer-api/use-create-print-js/index.js +147 -0
- package/dist/print-designer-api/use-create-print-js/use-base-component-helper.js +54 -0
- package/dist/print-designer-api/use-create-print-js/use-form-component-helper.js +4 -0
- package/dist/print-designer-api/use-create-print-js/use-table-layout-helper.js +5 -0
- package/dist/print-designer-images/demo.jpg +0 -0
- package/dist/print-designer-images/demo02.jpg +0 -0
- package/dist/style/default-style.css +137 -0
- package/dist/style/main.less +66 -0
- package/dist/test/base/designer-config.js +594 -0
- package/dist/test/base/index.js +3 -0
- package/dist/test/base/print-data.js +40 -0
- package/dist/test/complex-table/designer-config.js +1668 -0
- package/dist/test/complex-table/index.js +3 -0
- package/dist/test/complex-table/print-data.js +294 -0
- package/dist/test/form/designer-config.js +2057 -0
- package/dist/test/form/index.js +3 -0
- package/dist/test/form/print-data.js +38 -0
- package/dist/test/index.js +4 -0
- package/dist/wui-print-designer-plugins/JsBarcode.all.min.js +2 -0
- package/dist/wui-print-designer-plugins/qrcode.min.js +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import { deepCopy, camelToKebab } from "../../print-designer-utils";
|
|
2
|
+
import printDesignerStyleHelper from "../../print-designer-style-helper";
|
|
3
|
+
import complexTableTools from "./complex-table-tools";
|
|
4
|
+
import createTableHeader from "./create-table-header";
|
|
5
|
+
export default ({ printData, printConfig, formConfig, layoutConfig, createHtmlByComponentItem, errorLogs } = {}) => {
|
|
6
|
+
const createComplexTableHtml = (complexTableDetails) => {
|
|
7
|
+
if (!complexTableDetails._continueConfig) {
|
|
8
|
+
return "";
|
|
9
|
+
}
|
|
10
|
+
if (!!complexTableDetails._continueConfig && complexTableDetails._continueConfig.type == "auto_default") {
|
|
11
|
+
return _createHtml({ complexTableDetails });
|
|
12
|
+
}
|
|
13
|
+
if (!!complexTableDetails._continueConfig && complexTableDetails._continueConfig.type == "auto_continuingContent") {
|
|
14
|
+
// 添加续打表格
|
|
15
|
+
return _createContinueContentHtml({ complexTableDetails });
|
|
16
|
+
}
|
|
17
|
+
if (!!complexTableDetails._continueConfig && complexTableDetails._continueConfig.type == "auto_afterBlankRow") {
|
|
18
|
+
// 添加表格含空白内容
|
|
19
|
+
return _createHtmlHasBlankContent({ complexTableDetails });
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
function _createHtml({ complexTableDetails } = {}) {
|
|
23
|
+
let complexTableHtml = "";
|
|
24
|
+
let { spanHeaderCellDict, spanHeaderCellList } = complexTableTools.createHeaderSpanDetails({ complexTableDetails });
|
|
25
|
+
let headerRowLength = complexTableDetails.props.headerRow;
|
|
26
|
+
let colLength = complexTableDetails.props.col;
|
|
27
|
+
let tableData = complexTableTools.getTableData({ complexTableDetails, printData });
|
|
28
|
+
for (let rowIndex = 0; rowIndex < headerRowLength; rowIndex++) {
|
|
29
|
+
let headerCellHtml = ``;
|
|
30
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
31
|
+
let nowCellHtml = createTableHeader.getHeaderCellHtml({ rowIndex, colIndex, spanHeaderCellList, complexTableDetails });
|
|
32
|
+
headerCellHtml += nowCellHtml;
|
|
33
|
+
}
|
|
34
|
+
let rowHtml = `<tr class="complex-table-header-tr" header-index="${rowIndex}">${headerCellHtml}</tr>`;
|
|
35
|
+
complexTableHtml += rowHtml;
|
|
36
|
+
}
|
|
37
|
+
for (let rowIndex = 0; rowIndex < tableData.length; rowIndex++) {
|
|
38
|
+
let contentCellHtml = ``;
|
|
39
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
40
|
+
let nowCellHtml = _getContentCellHtml({ rowIndex, colIndex, tableData, complexTableDetails });
|
|
41
|
+
contentCellHtml += nowCellHtml;
|
|
42
|
+
}
|
|
43
|
+
let rowHtml = `<tr class="${_formatContentTrClass({
|
|
44
|
+
complexTableDetails,
|
|
45
|
+
rowData: tableData[rowIndex]
|
|
46
|
+
})}" content-index="${rowIndex}">${contentCellHtml}</tr>`;
|
|
47
|
+
complexTableHtml += rowHtml;
|
|
48
|
+
}
|
|
49
|
+
let tableClassList = ["print-complex-table"];
|
|
50
|
+
if (!_isAutoHeightSpanCell({ complexTableDetails })) {
|
|
51
|
+
tableClassList.push("print-complex-table--auto-continue-not-span");
|
|
52
|
+
} else {
|
|
53
|
+
tableClassList.push("print-complex-table--auto-continue-span");
|
|
54
|
+
}
|
|
55
|
+
let tableClass = tableClassList.join(" ");
|
|
56
|
+
complexTableHtml = `<table class="${tableClass}"
|
|
57
|
+
style="${printDesignerStyleHelper.createComplexTableStyle({
|
|
58
|
+
propsConfig: complexTableDetails.props,
|
|
59
|
+
styleConfig: complexTableDetails.style
|
|
60
|
+
})}"
|
|
61
|
+
cellspacing="0"
|
|
62
|
+
cellpadding="0">${complexTableHtml}
|
|
63
|
+
</table>`;
|
|
64
|
+
let isPaginationEnabled = complexTableDetails.props.isPaginationEnabled;
|
|
65
|
+
if (!!isPaginationEnabled) {
|
|
66
|
+
complexTableHtml += _getPaginationHtml({ complexTableDetails });
|
|
67
|
+
}
|
|
68
|
+
return complexTableHtml;
|
|
69
|
+
}
|
|
70
|
+
function _createContinueContentHtml({ complexTableDetails } = {}) {
|
|
71
|
+
let complexTableHtml = "";
|
|
72
|
+
let { spanHeaderCellDict, spanHeaderCellList } = complexTableTools.createHeaderSpanDetails({ complexTableDetails });
|
|
73
|
+
let headerRowLength = complexTableDetails.props.headerRow;
|
|
74
|
+
let colLength = complexTableDetails.props.col;
|
|
75
|
+
let tableData = complexTableTools.getTableData({ complexTableDetails, printData });
|
|
76
|
+
let continueConfig = complexTableDetails._continueConfig;
|
|
77
|
+
let perPageMaxRow = complexTableDetails.props.perPageMaxRow;
|
|
78
|
+
let hasEndTr = false;
|
|
79
|
+
for (let rowIndex = 0; rowIndex < headerRowLength; rowIndex++) {
|
|
80
|
+
let headerCellHtml = ``;
|
|
81
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
82
|
+
let nowCellHtml = createTableHeader.getHeaderCellHtml({ rowIndex, colIndex, spanHeaderCellList, complexTableDetails });
|
|
83
|
+
headerCellHtml += nowCellHtml;
|
|
84
|
+
}
|
|
85
|
+
let rowHtml = `<tr class="complex-table-header-tr" header-index="${rowIndex}">${headerCellHtml}</tr>`;
|
|
86
|
+
complexTableHtml += rowHtml;
|
|
87
|
+
}
|
|
88
|
+
//判断是否包含打印页的最后一行
|
|
89
|
+
if (tableData.length + continueConfig.continueBeforeRowCount == perPageMaxRow) {
|
|
90
|
+
hasEndTr = true;
|
|
91
|
+
}
|
|
92
|
+
for (let rowIndex = 0; rowIndex < continueConfig.continueBeforeRowCount; rowIndex++) {
|
|
93
|
+
let contentCellHtml = ``;
|
|
94
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
95
|
+
let nowCellHtml = _getBlankContentCellHtml({ rowIndex, colIndex, complexTableDetails });
|
|
96
|
+
contentCellHtml += nowCellHtml;
|
|
97
|
+
}
|
|
98
|
+
let rowHtml = `<tr class="complex-table-blank-tr complex-table-blank-tr--before" blank-index="${rowIndex}">${contentCellHtml}</tr>`;
|
|
99
|
+
complexTableHtml += rowHtml;
|
|
100
|
+
}
|
|
101
|
+
for (let rowIndex = 0; rowIndex < tableData.length; rowIndex++) {
|
|
102
|
+
let contentCellHtml = ``;
|
|
103
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
104
|
+
let nowCellHtml = _getContinueContentCellHtml({ rowIndex, colIndex, tableData, complexTableDetails });
|
|
105
|
+
contentCellHtml += nowCellHtml;
|
|
106
|
+
}
|
|
107
|
+
let trClass = _formatContentTrClass({
|
|
108
|
+
complexTableDetails,
|
|
109
|
+
rowData: tableData[rowIndex]
|
|
110
|
+
});
|
|
111
|
+
if (!!hasEndTr && rowIndex == tableData.length - 1) {
|
|
112
|
+
trClass += " complex-table-content-tr--page-end";
|
|
113
|
+
}
|
|
114
|
+
let rowHtml = `<tr class="${trClass}" content-index="${rowIndex}">${contentCellHtml}</tr>`;
|
|
115
|
+
complexTableHtml += rowHtml;
|
|
116
|
+
}
|
|
117
|
+
let tableClassList = ["print-complex-table"];
|
|
118
|
+
if (!_isAutoHeightSpanCell({ complexTableDetails })) {
|
|
119
|
+
tableClassList.push("print-complex-table--auto-continue-not-span");
|
|
120
|
+
tableClassList.push("print-complex-table--auto-continue-not-span_continue-content");
|
|
121
|
+
} else {
|
|
122
|
+
tableClassList.push("print-complex-table--auto-continue-span");
|
|
123
|
+
tableClassList.push("print-complex-table--auto-continue-span_continue-content");
|
|
124
|
+
}
|
|
125
|
+
let tableClass = tableClassList.join(" ");
|
|
126
|
+
complexTableHtml = `<table class="${tableClass}"
|
|
127
|
+
style="${printDesignerStyleHelper.createComplexTableStyle({
|
|
128
|
+
propsConfig: complexTableDetails.props,
|
|
129
|
+
styleConfig: complexTableDetails.style
|
|
130
|
+
})}"
|
|
131
|
+
cellspacing="0"
|
|
132
|
+
cellpadding="0">${complexTableHtml}
|
|
133
|
+
</table>`;
|
|
134
|
+
return complexTableHtml;
|
|
135
|
+
}
|
|
136
|
+
function _createHtmlHasBlankContent({ complexTableDetails } = {}) {
|
|
137
|
+
let complexTableHtml = "";
|
|
138
|
+
let { spanHeaderCellDict, spanHeaderCellList } = complexTableTools.createHeaderSpanDetails({ complexTableDetails });
|
|
139
|
+
let headerRowLength = complexTableDetails.props.headerRow;
|
|
140
|
+
let colLength = complexTableDetails.props.col;
|
|
141
|
+
let tableData = complexTableTools.getTableData({ complexTableDetails, printData });
|
|
142
|
+
let continueConfig = complexTableDetails._continueConfig;
|
|
143
|
+
for (let rowIndex = 0; rowIndex < headerRowLength; rowIndex++) {
|
|
144
|
+
let headerCellHtml = ``;
|
|
145
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
146
|
+
let nowCellHtml = createTableHeader.getHeaderCellHtml({ rowIndex, colIndex, spanHeaderCellList, complexTableDetails });
|
|
147
|
+
headerCellHtml += nowCellHtml;
|
|
148
|
+
}
|
|
149
|
+
let rowHtml = `<tr class="complex-table-header-tr" header-index="${rowIndex}">${headerCellHtml}</tr>`;
|
|
150
|
+
complexTableHtml += rowHtml;
|
|
151
|
+
}
|
|
152
|
+
for (let rowIndex = 0; rowIndex < tableData.length; rowIndex++) {
|
|
153
|
+
let contentCellHtml = ``;
|
|
154
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
155
|
+
let nowCellHtml = _getContentCellHtml({ rowIndex, colIndex, tableData, complexTableDetails });
|
|
156
|
+
contentCellHtml += nowCellHtml;
|
|
157
|
+
}
|
|
158
|
+
let rowHtml = `<tr class="${_formatContentTrClass({
|
|
159
|
+
complexTableDetails,
|
|
160
|
+
rowData: tableData[rowIndex]
|
|
161
|
+
})}" content-index="${rowIndex}">${contentCellHtml}</tr>`;
|
|
162
|
+
complexTableHtml += rowHtml;
|
|
163
|
+
}
|
|
164
|
+
for (let rowIndex = 0; rowIndex < continueConfig.blankRowCount; rowIndex++) {
|
|
165
|
+
let contentCellHtml = ``;
|
|
166
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
167
|
+
let nowCellHtml = _getBlankContentCellHtml({ rowIndex, colIndex, complexTableDetails });
|
|
168
|
+
contentCellHtml += nowCellHtml;
|
|
169
|
+
}
|
|
170
|
+
let rowHtml = `<tr class="complex-table-blank-tr complex-table-blank-tr--after" blank-index="${rowIndex}">${contentCellHtml}</tr>`;
|
|
171
|
+
complexTableHtml += rowHtml;
|
|
172
|
+
}
|
|
173
|
+
let tableClassList = ["print-complex-table"];
|
|
174
|
+
if (!_isAutoHeightSpanCell({ complexTableDetails })) {
|
|
175
|
+
tableClassList.push("print-complex-table--auto-continue-not-span");
|
|
176
|
+
} else {
|
|
177
|
+
tableClassList.push("print-complex-table--auto-continue-span");
|
|
178
|
+
}
|
|
179
|
+
let tableClass = tableClassList.join(" ");
|
|
180
|
+
complexTableHtml = `<table class="${tableClass}"
|
|
181
|
+
style="${printDesignerStyleHelper.createComplexTableStyle({
|
|
182
|
+
propsConfig: complexTableDetails.props,
|
|
183
|
+
styleConfig: complexTableDetails.style
|
|
184
|
+
})}"
|
|
185
|
+
cellspacing="0"
|
|
186
|
+
cellpadding="0">${complexTableHtml}
|
|
187
|
+
</table>`;
|
|
188
|
+
let isPaginationEnabled = complexTableDetails.props.isPaginationEnabled;
|
|
189
|
+
if (!!isPaginationEnabled) {
|
|
190
|
+
complexTableHtml += _getPaginationHtml({ complexTableDetails });
|
|
191
|
+
}
|
|
192
|
+
return complexTableHtml;
|
|
193
|
+
}
|
|
194
|
+
function _getContentCellHtml({ rowIndex, colIndex, tableData, complexTableDetails } = {}) {
|
|
195
|
+
let propsConfig = complexTableDetails.props;
|
|
196
|
+
let styleConfig = complexTableDetails.style;
|
|
197
|
+
let contentCellHtml = "";
|
|
198
|
+
let rowData = tableData[rowIndex];
|
|
199
|
+
if (!!rowData._autoHeightMode_type && rowData._autoHeightMode_type == "excessBlankRow" && rowIndex > 0) {
|
|
200
|
+
// 超出的空白行
|
|
201
|
+
contentCellHtml = `<td style="${printDesignerStyleHelper.createComplexTableContentTdStyle({
|
|
202
|
+
complexTablePropsConfig: propsConfig,
|
|
203
|
+
complexTableStyleConfig: styleConfig
|
|
204
|
+
})}"><div></div></td>`;
|
|
205
|
+
return contentCellHtml;
|
|
206
|
+
}
|
|
207
|
+
if (!!rowData._autoHeightMode_type && rowData._autoHeightMode_type == "excessBlankRow" && rowIndex === 0) {
|
|
208
|
+
// 超出的空白行 跨页
|
|
209
|
+
contentCellHtml = `<td style="${printDesignerStyleHelper.createComplexTableContentTdStyle({
|
|
210
|
+
complexTablePropsConfig: propsConfig,
|
|
211
|
+
complexTableStyleConfig: styleConfig
|
|
212
|
+
})}"><div class="excess-td-container" style="${_createExcessBlankRowTdContainerStyle({
|
|
213
|
+
rowIndex,
|
|
214
|
+
colIndex,
|
|
215
|
+
tableData,
|
|
216
|
+
complexTableDetails
|
|
217
|
+
})}"><div style="${printDesignerStyleHelper.createComplexTableContentTdContainerStyle({
|
|
218
|
+
complexTablePropsConfig: propsConfig,
|
|
219
|
+
complexTableStyleConfig: styleConfig
|
|
220
|
+
})}${_createExcessBlankRowTdContainerContentStyle({
|
|
221
|
+
rowIndex,
|
|
222
|
+
colIndex,
|
|
223
|
+
tableData,
|
|
224
|
+
complexTableDetails
|
|
225
|
+
})}">${_createContentTdText({
|
|
226
|
+
rowIndex,
|
|
227
|
+
colIndex,
|
|
228
|
+
tableData,
|
|
229
|
+
complexTableDetails
|
|
230
|
+
})}</div></div></td>`;
|
|
231
|
+
return contentCellHtml;
|
|
232
|
+
}
|
|
233
|
+
// 其他情况
|
|
234
|
+
contentCellHtml = `<td style="${printDesignerStyleHelper.createComplexTableContentTdStyle({
|
|
235
|
+
complexTablePropsConfig: propsConfig,
|
|
236
|
+
complexTableStyleConfig: styleConfig
|
|
237
|
+
})}"><div style="${printDesignerStyleHelper.createComplexTableContentTdContainerStyle({
|
|
238
|
+
complexTablePropsConfig: propsConfig,
|
|
239
|
+
complexTableStyleConfig: styleConfig
|
|
240
|
+
})}">${_createContentTdText({ rowIndex, colIndex, tableData, complexTableDetails })}</div></td>`;
|
|
241
|
+
return contentCellHtml;
|
|
242
|
+
}
|
|
243
|
+
function _getContinueContentCellHtml({ rowIndex, colIndex, tableData, complexTableDetails } = {}) {
|
|
244
|
+
let propsConfig = complexTableDetails.props;
|
|
245
|
+
let styleConfig = complexTableDetails.style;
|
|
246
|
+
let contentCellHtml = "";
|
|
247
|
+
let rowData = tableData[rowIndex];
|
|
248
|
+
if (!!rowData._autoHeightMode_type && rowData._autoHeightMode_type == "excessBlankRow") {
|
|
249
|
+
// 超出的空白行
|
|
250
|
+
contentCellHtml = `<td style="${printDesignerStyleHelper.createComplexTableContentTdStyle({
|
|
251
|
+
complexTablePropsConfig: propsConfig,
|
|
252
|
+
complexTableStyleConfig: styleConfig
|
|
253
|
+
})}"><div></div></td>`;
|
|
254
|
+
return contentCellHtml;
|
|
255
|
+
}
|
|
256
|
+
// 其他情况
|
|
257
|
+
contentCellHtml = `<td style="${printDesignerStyleHelper.createComplexTableContentTdStyle({
|
|
258
|
+
complexTablePropsConfig: propsConfig,
|
|
259
|
+
complexTableStyleConfig: styleConfig
|
|
260
|
+
})}"><div style="${printDesignerStyleHelper.createComplexTableContentTdContainerStyle({
|
|
261
|
+
complexTablePropsConfig: propsConfig,
|
|
262
|
+
complexTableStyleConfig: styleConfig
|
|
263
|
+
})}">${_createContentTdText({ rowIndex, colIndex, tableData, complexTableDetails })}</div></td>`;
|
|
264
|
+
return contentCellHtml;
|
|
265
|
+
}
|
|
266
|
+
function _createContentTdText({ rowIndex, colIndex, tableData, complexTableDetails } = {}) {
|
|
267
|
+
let propsConfig = complexTableDetails.props;
|
|
268
|
+
if (!propsConfig.columnsField || !propsConfig.columnsField[colIndex]) {
|
|
269
|
+
return "";
|
|
270
|
+
}
|
|
271
|
+
if (!tableData[rowIndex]) {
|
|
272
|
+
return "";
|
|
273
|
+
}
|
|
274
|
+
let columnField = propsConfig.columnsField[colIndex].field;
|
|
275
|
+
let columnFieldList = columnField.split("&#");
|
|
276
|
+
let nowContentTdText = "";
|
|
277
|
+
columnFieldList.forEach((filed) => {
|
|
278
|
+
let columnItemText = tableData[rowIndex][filed];
|
|
279
|
+
if (!columnItemText && columnItemText !== 0) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
columnItemText = `${columnItemText}`;
|
|
283
|
+
columnItemText = columnItemText
|
|
284
|
+
.replace(/[\s\n]+$/, "")
|
|
285
|
+
.replace(/ /g, " ")
|
|
286
|
+
.replace(/\n/g, "<br>");
|
|
287
|
+
nowContentTdText += columnItemText;
|
|
288
|
+
});
|
|
289
|
+
return nowContentTdText;
|
|
290
|
+
}
|
|
291
|
+
function _getBlankContentCellHtml({ rowIndex, colIndex, tableData, complexTableDetails } = {}) {
|
|
292
|
+
let propsConfig = complexTableDetails.props;
|
|
293
|
+
let styleConfig = complexTableDetails.style;
|
|
294
|
+
let contentCellHtml = "";
|
|
295
|
+
contentCellHtml = `<td style="${printDesignerStyleHelper.createComplexTableContentTdStyle({
|
|
296
|
+
complexTablePropsConfig: propsConfig,
|
|
297
|
+
complexTableStyleConfig: styleConfig
|
|
298
|
+
})}"><div style="${printDesignerStyleHelper.createComplexTableContentTdContainerStyle({
|
|
299
|
+
complexTablePropsConfig: propsConfig,
|
|
300
|
+
complexTableStyleConfig: styleConfig
|
|
301
|
+
})}"></div></td>`;
|
|
302
|
+
return contentCellHtml;
|
|
303
|
+
}
|
|
304
|
+
function _getPaginationHtml({ complexTableDetails } = {}) {
|
|
305
|
+
let paginationHtml = `<div class="print-complex-table_pagination">第${complexTableDetails._continueConfig.currentPage}页</div>`;
|
|
306
|
+
return paginationHtml;
|
|
307
|
+
}
|
|
308
|
+
function _createExcessBlankRowTdContainerStyle({ rowIndex, colIndex, tableData, complexTableDetails }) {
|
|
309
|
+
let propsConfig = complexTableDetails.props;
|
|
310
|
+
if (!propsConfig.columnsField || !propsConfig.columnsField[colIndex]) {
|
|
311
|
+
return "";
|
|
312
|
+
}
|
|
313
|
+
let nowRow = tableData[rowIndex];
|
|
314
|
+
if (!nowRow) {
|
|
315
|
+
return "";
|
|
316
|
+
}
|
|
317
|
+
let styleText = "";
|
|
318
|
+
let styleObj = {};
|
|
319
|
+
let containerHeight =
|
|
320
|
+
(nowRow._autoHeightMode_excessRowsLength - nowRow._autoHeightMode_excessIndex) * propsConfig.contentRowHeight;
|
|
321
|
+
styleObj.height = `${containerHeight}px`;
|
|
322
|
+
Object.keys(styleObj).forEach((key, index) => {
|
|
323
|
+
styleText += `${camelToKebab(key)}:${styleObj[key]};`;
|
|
324
|
+
});
|
|
325
|
+
return styleText;
|
|
326
|
+
}
|
|
327
|
+
function _createExcessBlankRowTdContainerContentStyle({ rowIndex, colIndex, tableData, complexTableDetails }) {
|
|
328
|
+
let propsConfig = complexTableDetails.props;
|
|
329
|
+
if (!propsConfig.columnsField || !propsConfig.columnsField[colIndex]) {
|
|
330
|
+
return "";
|
|
331
|
+
}
|
|
332
|
+
let nowRow = tableData[rowIndex];
|
|
333
|
+
if (!nowRow) {
|
|
334
|
+
return "";
|
|
335
|
+
}
|
|
336
|
+
let styleText = "";
|
|
337
|
+
let styleObj = {
|
|
338
|
+
position: "absolute",
|
|
339
|
+
top: 0,
|
|
340
|
+
left: 0,
|
|
341
|
+
right: 0
|
|
342
|
+
};
|
|
343
|
+
let topSpace = (nowRow._autoHeightMode_excessIndex + 1) * propsConfig.contentRowHeight;
|
|
344
|
+
styleObj.top = `-${topSpace}px`;
|
|
345
|
+
Object.keys(styleObj).forEach((key, index) => {
|
|
346
|
+
styleText += `${camelToKebab(key)}:${styleObj[key]};`;
|
|
347
|
+
});
|
|
348
|
+
return styleText;
|
|
349
|
+
}
|
|
350
|
+
function _isAutoHeightSpanCell({ complexTableDetails }) {
|
|
351
|
+
let propsConfig = complexTableDetails.props;
|
|
352
|
+
if (!printConfig) {
|
|
353
|
+
return false;
|
|
354
|
+
}
|
|
355
|
+
return !!propsConfig.autoHeightSpanCell;
|
|
356
|
+
}
|
|
357
|
+
function _formatContentTrClass({ complexTableDetails, rowData }) {
|
|
358
|
+
let classList = ["complex-table-content-tr"];
|
|
359
|
+
if (
|
|
360
|
+
!!rowData._autoHeightMode_type &&
|
|
361
|
+
rowData._autoHeightMode_type == "notExcess" &&
|
|
362
|
+
rowData._autoHeightMode_excessRowsLength >= 1
|
|
363
|
+
) {
|
|
364
|
+
classList.push("complex-table-content-tr--excess-blank-begin");
|
|
365
|
+
} else if (
|
|
366
|
+
!!rowData._autoHeightMode_type &&
|
|
367
|
+
rowData._autoHeightMode_type == "excessBlankRow" &&
|
|
368
|
+
rowData._autoHeightMode_excessIndex == rowData._autoHeightMode_excessRowsLength - 1
|
|
369
|
+
) {
|
|
370
|
+
classList.push("complex-table-content-tr--excess-blank-end");
|
|
371
|
+
} else if (!!rowData._autoHeightMode_type && rowData._autoHeightMode_type == "excessBlankRow") {
|
|
372
|
+
classList.push("complex-table-content-tr--excess-blank");
|
|
373
|
+
}
|
|
374
|
+
return classList.join(" ");
|
|
375
|
+
}
|
|
376
|
+
return {
|
|
377
|
+
createComplexTableHtml
|
|
378
|
+
};
|
|
379
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { deepCopy } from "../../print-designer-utils";
|
|
2
|
+
import printDesignerStyleHelper from "../../print-designer-style-helper";
|
|
3
|
+
import complexTableTools from "./complex-table-tools";
|
|
4
|
+
import createTableHeader from "./create-table-header";
|
|
5
|
+
export default ({ printData, printConfig, formConfig, layoutConfig, createHtmlByComponentItem, errorLogs } = {}) => {
|
|
6
|
+
const createComplexTableHtml = (complexTableDetails) => {
|
|
7
|
+
return _createHtml({ complexTableDetails });
|
|
8
|
+
};
|
|
9
|
+
function _createHtml({ complexTableDetails } = {}) {
|
|
10
|
+
let complexTableHtml = "";
|
|
11
|
+
let { spanHeaderCellDict, spanHeaderCellList } = complexTableTools.createHeaderSpanDetails({ complexTableDetails });
|
|
12
|
+
let headerRowLength = complexTableDetails.props.headerRow;
|
|
13
|
+
let colLength = complexTableDetails.props.col;
|
|
14
|
+
let tableData = complexTableTools.getTableData({ complexTableDetails, printData });
|
|
15
|
+
for (let rowIndex = 0; rowIndex < headerRowLength; rowIndex++) {
|
|
16
|
+
let headerCellHtml = ``;
|
|
17
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
18
|
+
let nowCellHtml = createTableHeader.getHeaderCellHtml({ rowIndex, colIndex, spanHeaderCellList, complexTableDetails });
|
|
19
|
+
headerCellHtml += nowCellHtml;
|
|
20
|
+
}
|
|
21
|
+
let rowHtml = `<tr class="complex-table-header-tr" header-index="${rowIndex}">${headerCellHtml}</tr>`;
|
|
22
|
+
complexTableHtml += rowHtml;
|
|
23
|
+
}
|
|
24
|
+
for (let rowIndex = 0; rowIndex < tableData.length; rowIndex++) {
|
|
25
|
+
let contentCellHtml = ``;
|
|
26
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
27
|
+
let nowCellHtml = _getContentCellHtml({ rowIndex, colIndex, tableData, complexTableDetails });
|
|
28
|
+
contentCellHtml += nowCellHtml;
|
|
29
|
+
}
|
|
30
|
+
let rowHtml = `<tr class="complex-table-content-tr" content-index="${rowIndex}">${contentCellHtml}</tr>`;
|
|
31
|
+
complexTableHtml += rowHtml;
|
|
32
|
+
}
|
|
33
|
+
complexTableHtml = `<table
|
|
34
|
+
class="print-complex-table"
|
|
35
|
+
style="${printDesignerStyleHelper.createComplexTableStyle({
|
|
36
|
+
propsConfig: complexTableDetails.props,
|
|
37
|
+
styleConfig: complexTableDetails.style
|
|
38
|
+
})}"
|
|
39
|
+
cellspacing="0"
|
|
40
|
+
cellpadding="0">${complexTableHtml}
|
|
41
|
+
</table>`;
|
|
42
|
+
return complexTableHtml;
|
|
43
|
+
}
|
|
44
|
+
function _getContentCellHtml({ rowIndex, colIndex, tableData, complexTableDetails } = {}) {
|
|
45
|
+
let propsConfig = complexTableDetails.props;
|
|
46
|
+
let styleConfig = complexTableDetails.style;
|
|
47
|
+
let contentCellHtml = "";
|
|
48
|
+
contentCellHtml = `<td style="${printDesignerStyleHelper.createComplexTableContentTdStyle({
|
|
49
|
+
complexTablePropsConfig: propsConfig,
|
|
50
|
+
complexTableStyleConfig: styleConfig
|
|
51
|
+
})}"><div style="${printDesignerStyleHelper.createComplexTableContentTdContainerStyle({
|
|
52
|
+
complexTablePropsConfig: propsConfig,
|
|
53
|
+
complexTableStyleConfig: styleConfig
|
|
54
|
+
})}">${_createContentTdText({ rowIndex, colIndex, tableData, complexTableDetails })}</div></td>`;
|
|
55
|
+
return contentCellHtml;
|
|
56
|
+
}
|
|
57
|
+
function _createContentTdText({ rowIndex, colIndex, tableData, complexTableDetails } = {}) {
|
|
58
|
+
let propsConfig = complexTableDetails.props;
|
|
59
|
+
if (!propsConfig.columnsField || !propsConfig.columnsField[colIndex]) {
|
|
60
|
+
return "";
|
|
61
|
+
}
|
|
62
|
+
let columnField = propsConfig.columnsField[colIndex].field;
|
|
63
|
+
if (!tableData[rowIndex]) {
|
|
64
|
+
return "";
|
|
65
|
+
}
|
|
66
|
+
let nowContentTdText = tableData[rowIndex][columnField];
|
|
67
|
+
if (!!nowContentTdText || nowContentTdText === 0) {
|
|
68
|
+
return nowContentTdText;
|
|
69
|
+
}
|
|
70
|
+
return "";
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
createComplexTableHtml
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { deepCopy } from "../../print-designer-utils";
|
|
2
|
+
import printDesignerStyleHelper from "../../print-designer-style-helper";
|
|
3
|
+
import complexTableTools from "./complex-table-tools";
|
|
4
|
+
import createTableHeader from "./create-table-header";
|
|
5
|
+
export default ({ printData, printConfig, formConfig, layoutConfig, createHtmlByComponentItem, errorLogs } = {}) => {
|
|
6
|
+
const createComplexTableHtml = (complexTableDetails) => {
|
|
7
|
+
if (!complexTableDetails._continueConfig) {
|
|
8
|
+
return "";
|
|
9
|
+
}
|
|
10
|
+
if (!!complexTableDetails._continueConfig && complexTableDetails._continueConfig.type == "fixed_default") {
|
|
11
|
+
return _createHtml({ complexTableDetails });
|
|
12
|
+
}
|
|
13
|
+
if (!!complexTableDetails._continueConfig && complexTableDetails._continueConfig.type == "fixed_continuingContent") {
|
|
14
|
+
// 添加续打表格
|
|
15
|
+
return _createContinueContentHtml({ complexTableDetails });
|
|
16
|
+
}
|
|
17
|
+
if (!!complexTableDetails._continueConfig && complexTableDetails._continueConfig.type == "fixed_afterBlankRow") {
|
|
18
|
+
// 添加表格含空白内容
|
|
19
|
+
return _createHtmlHasBlankContent({ complexTableDetails });
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
function _createHtml({ complexTableDetails } = {}) {
|
|
23
|
+
let complexTableHtml = "";
|
|
24
|
+
let { spanHeaderCellDict, spanHeaderCellList } = complexTableTools.createHeaderSpanDetails({ complexTableDetails });
|
|
25
|
+
let headerRowLength = complexTableDetails.props.headerRow;
|
|
26
|
+
let colLength = complexTableDetails.props.col;
|
|
27
|
+
let tableData = complexTableTools.getTableData({ complexTableDetails, printData });
|
|
28
|
+
for (let rowIndex = 0; rowIndex < headerRowLength; rowIndex++) {
|
|
29
|
+
let headerCellHtml = ``;
|
|
30
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
31
|
+
let nowCellHtml = createTableHeader.getHeaderCellHtml({ rowIndex, colIndex, spanHeaderCellList, complexTableDetails });
|
|
32
|
+
headerCellHtml += nowCellHtml;
|
|
33
|
+
}
|
|
34
|
+
let rowHtml = `<tr class="complex-table-header-tr" header-index="${rowIndex}">${headerCellHtml}</tr>`;
|
|
35
|
+
complexTableHtml += rowHtml;
|
|
36
|
+
}
|
|
37
|
+
for (let rowIndex = 0; rowIndex < tableData.length; rowIndex++) {
|
|
38
|
+
let contentCellHtml = ``;
|
|
39
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
40
|
+
let nowCellHtml = _getContentCellHtml({ rowIndex, colIndex, tableData, complexTableDetails });
|
|
41
|
+
contentCellHtml += nowCellHtml;
|
|
42
|
+
}
|
|
43
|
+
let rowHtml = `<tr class="complex-table-content-tr" content-index="${rowIndex}">${contentCellHtml}</tr>`;
|
|
44
|
+
complexTableHtml += rowHtml;
|
|
45
|
+
}
|
|
46
|
+
complexTableHtml = `<table
|
|
47
|
+
class="print-complex-table print-complex-table--fixed-continue"
|
|
48
|
+
style="${printDesignerStyleHelper.createComplexTableStyle({
|
|
49
|
+
propsConfig: complexTableDetails.props,
|
|
50
|
+
styleConfig: complexTableDetails.style
|
|
51
|
+
})}"
|
|
52
|
+
cellspacing="0"
|
|
53
|
+
cellpadding="0">${complexTableHtml}
|
|
54
|
+
</table>`;
|
|
55
|
+
let isPaginationEnabled = complexTableDetails.props.isPaginationEnabled;
|
|
56
|
+
if (!!isPaginationEnabled) {
|
|
57
|
+
complexTableHtml += _getPaginationHtml({ complexTableDetails });
|
|
58
|
+
}
|
|
59
|
+
return complexTableHtml;
|
|
60
|
+
}
|
|
61
|
+
function _createContinueContentHtml({ complexTableDetails } = {}) {
|
|
62
|
+
let complexTableHtml = "";
|
|
63
|
+
let { spanHeaderCellDict, spanHeaderCellList } = complexTableTools.createHeaderSpanDetails({ complexTableDetails });
|
|
64
|
+
let headerRowLength = complexTableDetails.props.headerRow;
|
|
65
|
+
let colLength = complexTableDetails.props.col;
|
|
66
|
+
let tableData = complexTableTools.getTableData({ complexTableDetails, printData });
|
|
67
|
+
let continueConfig = complexTableDetails._continueConfig;
|
|
68
|
+
for (let rowIndex = 0; rowIndex < headerRowLength; rowIndex++) {
|
|
69
|
+
let headerCellHtml = ``;
|
|
70
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
71
|
+
let nowCellHtml = createTableHeader.getHeaderCellHtml({ rowIndex, colIndex, spanHeaderCellList, complexTableDetails });
|
|
72
|
+
headerCellHtml += nowCellHtml;
|
|
73
|
+
}
|
|
74
|
+
let rowHtml = `<tr class="complex-table-header-tr" header-index="${rowIndex}">${headerCellHtml}</tr>`;
|
|
75
|
+
complexTableHtml += rowHtml;
|
|
76
|
+
}
|
|
77
|
+
for (let rowIndex = 0; rowIndex < continueConfig.continueBeforeRowCount; rowIndex++) {
|
|
78
|
+
let contentCellHtml = ``;
|
|
79
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
80
|
+
let nowCellHtml = _getBlankContentCellHtml({ rowIndex, colIndex, complexTableDetails });
|
|
81
|
+
contentCellHtml += nowCellHtml;
|
|
82
|
+
}
|
|
83
|
+
let rowHtml = `<tr class="complex-table-blank-tr complex-table-blank-tr--before" blank-index="${rowIndex}">${contentCellHtml}</tr>`;
|
|
84
|
+
complexTableHtml += rowHtml;
|
|
85
|
+
}
|
|
86
|
+
for (let rowIndex = 0; rowIndex < tableData.length; rowIndex++) {
|
|
87
|
+
let contentCellHtml = ``;
|
|
88
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
89
|
+
let nowCellHtml = _getContinueContentCellHtml({ rowIndex, colIndex, tableData, complexTableDetails });
|
|
90
|
+
contentCellHtml += nowCellHtml;
|
|
91
|
+
}
|
|
92
|
+
let rowHtml = `<tr class="complex-table-content-tr" content-index="${rowIndex}">${contentCellHtml}</tr>`;
|
|
93
|
+
complexTableHtml += rowHtml;
|
|
94
|
+
}
|
|
95
|
+
complexTableHtml = `<table
|
|
96
|
+
class="print-complex-table print-complex-table--fixed-continue print-complex-table--fixed-continue_continue-content"
|
|
97
|
+
style="${printDesignerStyleHelper.createComplexTableStyle({
|
|
98
|
+
propsConfig: complexTableDetails.props,
|
|
99
|
+
styleConfig: complexTableDetails.style
|
|
100
|
+
})}"
|
|
101
|
+
cellspacing="0"
|
|
102
|
+
cellpadding="0">${complexTableHtml}
|
|
103
|
+
</table>`;
|
|
104
|
+
return complexTableHtml;
|
|
105
|
+
}
|
|
106
|
+
function _createHtmlHasBlankContent({ complexTableDetails } = {}) {
|
|
107
|
+
let complexTableHtml = "";
|
|
108
|
+
let { spanHeaderCellDict, spanHeaderCellList } = complexTableTools.createHeaderSpanDetails({ complexTableDetails });
|
|
109
|
+
let headerRowLength = complexTableDetails.props.headerRow;
|
|
110
|
+
let colLength = complexTableDetails.props.col;
|
|
111
|
+
let tableData = complexTableTools.getTableData({ complexTableDetails, printData });
|
|
112
|
+
let continueConfig = complexTableDetails._continueConfig;
|
|
113
|
+
for (let rowIndex = 0; rowIndex < headerRowLength; rowIndex++) {
|
|
114
|
+
let headerCellHtml = ``;
|
|
115
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
116
|
+
let nowCellHtml = createTableHeader.getHeaderCellHtml({ rowIndex, colIndex, spanHeaderCellList, complexTableDetails });
|
|
117
|
+
headerCellHtml += nowCellHtml;
|
|
118
|
+
}
|
|
119
|
+
let rowHtml = `<tr class="complex-table-header-tr" header-index="${rowIndex}">${headerCellHtml}</tr>`;
|
|
120
|
+
complexTableHtml += rowHtml;
|
|
121
|
+
}
|
|
122
|
+
for (let rowIndex = 0; rowIndex < tableData.length; rowIndex++) {
|
|
123
|
+
let contentCellHtml = ``;
|
|
124
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
125
|
+
let nowCellHtml = _getContentCellHtml({ rowIndex, colIndex, tableData, complexTableDetails });
|
|
126
|
+
contentCellHtml += nowCellHtml;
|
|
127
|
+
}
|
|
128
|
+
let rowHtml = `<tr class="complex-table-content-tr" content-index="${rowIndex}">${contentCellHtml}</tr>`;
|
|
129
|
+
complexTableHtml += rowHtml;
|
|
130
|
+
}
|
|
131
|
+
for (let rowIndex = 0; rowIndex < continueConfig.blankRowCount; rowIndex++) {
|
|
132
|
+
let contentCellHtml = ``;
|
|
133
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
134
|
+
let nowCellHtml = _getBlankContentCellHtml({ rowIndex, colIndex, complexTableDetails });
|
|
135
|
+
contentCellHtml += nowCellHtml;
|
|
136
|
+
}
|
|
137
|
+
let rowHtml = `<tr class="complex-table-blank-tr complex-table-blank-tr--after" blank-index="${rowIndex}">${contentCellHtml}</tr>`;
|
|
138
|
+
complexTableHtml += rowHtml;
|
|
139
|
+
}
|
|
140
|
+
complexTableHtml = `<table
|
|
141
|
+
class="print-complex-table print-complex-table--fixed-continue"
|
|
142
|
+
style="${printDesignerStyleHelper.createComplexTableStyle({
|
|
143
|
+
propsConfig: complexTableDetails.props,
|
|
144
|
+
styleConfig: complexTableDetails.style
|
|
145
|
+
})}"
|
|
146
|
+
cellspacing="0"
|
|
147
|
+
cellpadding="0">${complexTableHtml}
|
|
148
|
+
</table>`;
|
|
149
|
+
let isPaginationEnabled = complexTableDetails.props.isPaginationEnabled;
|
|
150
|
+
if (!!isPaginationEnabled) {
|
|
151
|
+
complexTableHtml += _getPaginationHtml({ complexTableDetails });
|
|
152
|
+
}
|
|
153
|
+
return complexTableHtml;
|
|
154
|
+
}
|
|
155
|
+
function _getContentCellHtml({ rowIndex, colIndex, tableData, complexTableDetails } = {}) {
|
|
156
|
+
let propsConfig = complexTableDetails.props;
|
|
157
|
+
let styleConfig = complexTableDetails.style;
|
|
158
|
+
let contentCellHtml = "";
|
|
159
|
+
contentCellHtml = `<td style="${printDesignerStyleHelper.createComplexTableContentTdStyle({
|
|
160
|
+
complexTablePropsConfig: propsConfig,
|
|
161
|
+
complexTableStyleConfig: styleConfig
|
|
162
|
+
})}"><div style="${printDesignerStyleHelper.createComplexTableContentTdContainerStyle({
|
|
163
|
+
complexTablePropsConfig: propsConfig,
|
|
164
|
+
complexTableStyleConfig: styleConfig
|
|
165
|
+
})}">${_createContentTdText({ rowIndex, colIndex, tableData, complexTableDetails })}</div></td>`;
|
|
166
|
+
return contentCellHtml;
|
|
167
|
+
}
|
|
168
|
+
function _getContinueContentCellHtml({ rowIndex, colIndex, tableData, complexTableDetails } = {}) {
|
|
169
|
+
let propsConfig = complexTableDetails.props;
|
|
170
|
+
let styleConfig = complexTableDetails.style;
|
|
171
|
+
let headerRules = complexTableDetails.headerRules;
|
|
172
|
+
let contentCellHtml = "";
|
|
173
|
+
contentCellHtml = `<td style="${printDesignerStyleHelper.createComplexTableContentTdStyle({
|
|
174
|
+
complexTablePropsConfig: propsConfig,
|
|
175
|
+
complexTableStyleConfig: styleConfig,
|
|
176
|
+
complexTableHeaderRules: headerRules,
|
|
177
|
+
rowIndex,
|
|
178
|
+
colIndex
|
|
179
|
+
})}"><div style="${printDesignerStyleHelper.createComplexTableContentTdContainerStyle({
|
|
180
|
+
complexTablePropsConfig: propsConfig,
|
|
181
|
+
complexTableStyleConfig: styleConfig
|
|
182
|
+
})}">${_createContentTdText({ rowIndex, colIndex, tableData, complexTableDetails })}</div></td>`;
|
|
183
|
+
return contentCellHtml;
|
|
184
|
+
}
|
|
185
|
+
function _createContentTdText({ rowIndex, colIndex, tableData, complexTableDetails } = {}) {
|
|
186
|
+
let propsConfig = complexTableDetails.props;
|
|
187
|
+
if (!propsConfig.columnsField || !propsConfig.columnsField[colIndex]) {
|
|
188
|
+
return "";
|
|
189
|
+
}
|
|
190
|
+
let columnField = propsConfig.columnsField[colIndex].field;
|
|
191
|
+
if (!tableData[rowIndex]) {
|
|
192
|
+
return "";
|
|
193
|
+
}
|
|
194
|
+
let nowContentTdText = tableData[rowIndex][columnField];
|
|
195
|
+
if (!!nowContentTdText || nowContentTdText === 0) {
|
|
196
|
+
return nowContentTdText;
|
|
197
|
+
}
|
|
198
|
+
return "";
|
|
199
|
+
}
|
|
200
|
+
function _getBlankContentCellHtml({ rowIndex, colIndex, tableData, complexTableDetails } = {}) {
|
|
201
|
+
let propsConfig = complexTableDetails.props;
|
|
202
|
+
let styleConfig = complexTableDetails.style;
|
|
203
|
+
let contentCellHtml = "";
|
|
204
|
+
contentCellHtml = `<td style="${printDesignerStyleHelper.createComplexTableContentTdStyle({
|
|
205
|
+
complexTablePropsConfig: propsConfig,
|
|
206
|
+
complexTableStyleConfig: styleConfig
|
|
207
|
+
})}"><div style="${printDesignerStyleHelper.createComplexTableContentTdContainerStyle({
|
|
208
|
+
complexTablePropsConfig: propsConfig,
|
|
209
|
+
complexTableStyleConfig: styleConfig
|
|
210
|
+
})}"></div></td>`;
|
|
211
|
+
return contentCellHtml;
|
|
212
|
+
}
|
|
213
|
+
function _getPaginationHtml({ complexTableDetails } = {}) {
|
|
214
|
+
let paginationHtml = `<div class="print-complex-table_pagination">第${complexTableDetails._continueConfig.currentPage}页</div>`;
|
|
215
|
+
return paginationHtml;
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
createComplexTableHtml
|
|
219
|
+
};
|
|
220
|
+
};
|