Skip to content

Commit

Permalink
Merge pull request #62 from Xavier9896/main
Browse files Browse the repository at this point in the history
  • Loading branch information
CcSimple committed Sep 14, 2023
2 parents 5362521 + b750a9d commit 44ab5e1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
11 changes: 5 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
### 💐 同时自动更新 GitHub Pages 同步 Gitee;
### 💐 感谢各位贡献者的支持。 🔥

## 0.0.55-beta6(2023-09-11)
## 0.0.55-beta8(2023-09-12)
<details>
<summary>01. 🌈 添加国际化支持,目前已支持 英语(机翻待订正),更多语言期待大家的 pr </summary>
<summary>01. 🌈 添加国际化 i18n 支持 </summary>

原生为简体中文,英语、德语、西班牙语、法语、意大利语、日语、俄语、繁体中文皆为 AI 机翻,欢迎帮助 [订正](https://github.com/CcSimple/vue-plugin-hiprint/tree/main/src/i18n)

```js
hiprint.init({
providers: [provider.f],
host: 'http://localhost:17521', // 可在此处设置连接地址与端口号
token: 'token', // 可在此处设置连接 token
lang: 'en', // 设置语言 ['cn', 'en'] TODO: ['de', 'es', 'fr', 'ja', 'ko', 'ru']
lang: 'en', // 设置语言 ['cn', 'en', 'de', 'es', 'fr', 'it', 'ja', 'ru', 'cn_tw']
});
```
</details>
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,13 @@ hiprintTemplate.print({});

## i18n 设置

可在 init 时传入语言进行设置,默认为 `cn` , 更多语言期待社区共同维护。
原生为简体中文,英语、德语、西班牙语、法语、意大利语、日语、俄语、繁体中文皆为 AI 机翻,欢迎帮助 [订正](https://github.com/CcSimple/vue-plugin-hiprint/tree/main/src/i18n)

可在 init 时传入语言进行设置,默认为 `cn`

```js
hiprint.init({
lang: 'en', // 设置语言 ['cn', 'en'] TODO: ['de', 'es', 'fr', 'ja', 'ko', 'ru']
lang: 'en', // 设置语言 ['cn', 'en', 'de', 'es', 'fr', 'it', 'ja', 'ru', 'cn_tw']
});
```

Expand Down
6 changes: 3 additions & 3 deletions src/hiprint/hiprint.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ var hiprint = function (t) {
switch (column.tableSummary) {
case "count":
var title = tst(column, text || `${i18n.__('计数')}:`, o);
var count = toUpperCase(upperCaseType,tSumData.length || 0);
var count = toUpperCase(upperCaseType,tSumData.filter(i => i).length || 0);
tableFooter.append(`<td style="${style}" colspan="${colspan}">${title}${count}</td>`);
break;
case "sum":
Expand Down Expand Up @@ -1866,7 +1866,7 @@ var hiprint = function (t) {
p = a ? a(e[t.field], e, i, n) : e[t.field];
var rf = TableExcelHelper.getColumnRenderFormatter(t);
if (rf) {
r.html(rf(e[t.field], e, i, n))
r.html(rf(e[t.field], e, i, n, rowIndex))
//表格内容插入二维码等
} else if ("text" == t.tableTextType || t.tableTextType == void 0) r.html(p);
else {
Expand Down Expand Up @@ -5013,7 +5013,7 @@ var hiprint = function (t) {
}

return t.prototype.createTarget = function () {
return this.target = $(`<div class="hiprint-option-item hiprint-option-item-row">\n <div class="hiprint-option-item-label">\n ${i18n.__('单元格渲染函数')}\n </div>\n <div class="hiprint-option-item-field">\n <textarea style="height:80px;" placeholder="function(value,row,index,options){ return \'<td></td>\'; }" class="auto-submit"></textarea>\n </div>\n </div>`), this.target;
return this.target = $(`<div class="hiprint-option-item hiprint-option-item-row">\n <div class="hiprint-option-item-label">\n ${i18n.__('单元格渲染函数')}\n </div>\n <div class="hiprint-option-item-field">\n <textarea style="height:80px;" placeholder="function(value,row,colIndex,options,rowIndex){ return \'<td></td>\'; }" class="auto-submit"></textarea>\n </div>\n </div>`), this.target;
}, t.prototype.getValue = function () {
var t = this.target.find("textarea").val();
if (t) return t;
Expand Down

0 comments on commit 44ab5e1

Please sign in to comment.