@newview/report-tools 1.0.9 → 1.0.10
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/dist/report-tools.js +41 -1
- package/dist/report-tools.umd.cjs +1 -1
- package/package.json +1 -1
- package/readme.md +3 -0
package/dist/report-tools.js
CHANGED
|
@@ -358608,6 +358608,7 @@ class reportTool extends BaseInstance {
|
|
|
358608
358608
|
let sheetTag = JSON.parse(((_b = (_a2 = page.data[0][0]) == null ? void 0 : _a2.flag) == null ? void 0 : _b.sheettag) ?? "{}");
|
|
358609
358609
|
let rows = [];
|
|
358610
358610
|
let alias = page.config.alias;
|
|
358611
|
+
let textBox = this.getTextBox(page.textBoxs);
|
|
358611
358612
|
page.data.forEach((row, rowIndex) => {
|
|
358612
358613
|
let cols = [];
|
|
358613
358614
|
row.forEach((tdObj, colIndex) => {
|
|
@@ -358696,7 +358697,8 @@ class reportTool extends BaseInstance {
|
|
|
358696
358697
|
rows,
|
|
358697
358698
|
width: this.sumForArray(layoutData.columnWidths) + "px",
|
|
358698
358699
|
height: this.sumForArray(layoutData.rowHeights) + "px",
|
|
358699
|
-
sheetTag
|
|
358700
|
+
sheetTag,
|
|
358701
|
+
textBox
|
|
358700
358702
|
});
|
|
358701
358703
|
}
|
|
358702
358704
|
this.pageInfo = {
|
|
@@ -358750,6 +358752,28 @@ class reportTool extends BaseInstance {
|
|
|
358750
358752
|
}
|
|
358751
358753
|
return value;
|
|
358752
358754
|
}
|
|
358755
|
+
/**
|
|
358756
|
+
* 获取文本框信息
|
|
358757
|
+
* */
|
|
358758
|
+
getTextBox(textBox) {
|
|
358759
|
+
let arr = [];
|
|
358760
|
+
if (Object.keys(textBox).length !== 0) {
|
|
358761
|
+
for (let key2 in textBox) {
|
|
358762
|
+
let item2 = textBox[key2];
|
|
358763
|
+
arr.push(
|
|
358764
|
+
{
|
|
358765
|
+
alias: item2.alias,
|
|
358766
|
+
width: item2.default.width,
|
|
358767
|
+
height: item2.default.height,
|
|
358768
|
+
top: item2.default.top,
|
|
358769
|
+
left: item2.default.left,
|
|
358770
|
+
innerHtml: ""
|
|
358771
|
+
}
|
|
358772
|
+
);
|
|
358773
|
+
}
|
|
358774
|
+
}
|
|
358775
|
+
return arr;
|
|
358776
|
+
}
|
|
358753
358777
|
/**
|
|
358754
358778
|
* 获取单元格合并信息
|
|
358755
358779
|
*/
|
|
@@ -359073,6 +359097,22 @@ class reportTool extends BaseInstance {
|
|
|
359073
359097
|
}
|
|
359074
359098
|
}
|
|
359075
359099
|
}
|
|
359100
|
+
/**
|
|
359101
|
+
* 根据别名向文本框添加图片
|
|
359102
|
+
* @param alias 别名
|
|
359103
|
+
* @param base64 图片base64码
|
|
359104
|
+
* @param sheetHandle 页码-从0开始
|
|
359105
|
+
* @returns
|
|
359106
|
+
*/
|
|
359107
|
+
setTextBoxByAlias(alias, base64, sheetHandle) {
|
|
359108
|
+
let sheetIndex = sheetHandle || 0;
|
|
359109
|
+
let textBox = this.pageInfo.sheets[sheetIndex].textBox;
|
|
359110
|
+
for (let i2 = 0; i2 < textBox.length; i2++) {
|
|
359111
|
+
if (textBox[i2].alias == alias) {
|
|
359112
|
+
textBox[i2].innerHtml = `<img src="${base64}" style="height: 100%;width: 100%;object-fit: contain;" />`;
|
|
359113
|
+
}
|
|
359114
|
+
}
|
|
359115
|
+
}
|
|
359076
359116
|
/**
|
|
359077
359117
|
* 根据别名添加图片
|
|
359078
359118
|
* @param alias 别名
|