zmdms-webui 3.5.2 → 3.5.3

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.
Files changed (148) hide show
  1. package/dist/es/applayoutheader/setting/fullCom.js +5 -1
  2. package/dist/es/applayoutheader/setting/userInfo.js +9 -5
  3. package/dist/es/applayoutheader/setting/userInfoModal.js +18 -12
  4. package/dist/es/applayoutheader/setting/userPwdModal.js +19 -13
  5. package/dist/es/applayoutheader/tabs/index.js +10 -6
  6. package/dist/es/applayoutsider/menu/Logo.js +5 -1
  7. package/dist/es/applayoutsider/menu/SearchInput.js +6 -2
  8. package/dist/es/applayoutsider/menu/SubMenu.js +6 -2
  9. package/dist/es/asyncdynamicsetting/asyncDynamicDrawer.js +2 -0
  10. package/dist/es/asyncdynamicsetting/useAsyncDrawer.js +2 -0
  11. package/dist/es/button/button.js +4 -2
  12. package/dist/es/button/buttonDownload.js +6 -4
  13. package/dist/es/button/buttonExport.js +8 -4
  14. package/dist/es/button/buttonPreview.js +6 -3
  15. package/dist/es/canvastable/canvasTable.js +33 -29
  16. package/dist/es/canvastable/components/CanvasTableMenu.js +5 -1
  17. package/dist/es/canvastable/components/FilterPopover.js +15 -11
  18. package/dist/es/canvastable/hooks/useProcessedColumns.js +7 -2
  19. package/dist/es/canvastable/hooks/useSummaryRow.js +6 -2
  20. package/dist/es/canvastable/hooks/useTableRender.js +5 -1
  21. package/dist/es/chatroom/chat-room.js +8 -3
  22. package/dist/es/config/i18n/en/appLayoutHeader.js +70 -0
  23. package/dist/es/config/i18n/en/appLayoutSider.js +14 -0
  24. package/dist/es/config/i18n/en/asyncDynamicSetting.js +42 -0
  25. package/dist/es/config/i18n/en/authLoading.js +6 -0
  26. package/dist/es/config/i18n/en/button.js +14 -0
  27. package/dist/es/config/i18n/en/canvasTable.js +50 -0
  28. package/dist/es/config/i18n/en/chatRoom.js +14 -0
  29. package/dist/es/config/i18n/en/datePicker.js +22 -0
  30. package/dist/es/config/i18n/en/detailList.js +6 -0
  31. package/dist/es/config/i18n/en/differences.js +6 -0
  32. package/dist/es/config/i18n/en/dynamicSetting.js +72 -0
  33. package/dist/es/config/i18n/en/electronSignatures.js +173 -0
  34. package/dist/es/config/i18n/en/enhanceSelect.js +8 -0
  35. package/dist/es/config/i18n/en/footer.js +8 -0
  36. package/dist/es/config/i18n/en/form.js +26 -0
  37. package/dist/es/config/i18n/en/formItem.js +8 -0
  38. package/dist/es/config/i18n/en/inputNumber.js +7 -0
  39. package/dist/es/config/i18n/en/login.js +76 -0
  40. package/dist/es/config/i18n/en/modal.js +8 -0
  41. package/dist/es/config/i18n/en/notAuthPage.js +8 -0
  42. package/dist/es/config/i18n/en/notRoutePage.js +8 -0
  43. package/dist/es/config/i18n/en/operationBtn.js +10 -0
  44. package/dist/es/config/i18n/en/print.js +16 -0
  45. package/dist/es/config/i18n/en/select.js +6 -0
  46. package/dist/es/config/i18n/en/table.js +65 -0
  47. package/dist/es/config/i18n/en/tabs.js +10 -0
  48. package/dist/es/config/i18n/en/translationButton.js +26 -0
  49. package/dist/es/config/i18n/en/tree.js +6 -0
  50. package/dist/es/config/i18n/en/uploadList.js +82 -0
  51. package/dist/es/config/i18n/en/ztTransfer.js +14 -0
  52. package/dist/es/config/i18n/en.js +65 -1
  53. package/dist/es/config/i18n/i18nInstance.js +33 -0
  54. package/dist/es/config/i18n/zh_cn/appLayoutHeader.js +70 -0
  55. package/dist/es/config/i18n/zh_cn/appLayoutSider.js +14 -0
  56. package/dist/es/config/i18n/zh_cn/asyncDynamicSetting.js +42 -0
  57. package/dist/es/config/i18n/zh_cn/authLoading.js +6 -0
  58. package/dist/es/config/i18n/zh_cn/button.js +14 -0
  59. package/dist/es/config/i18n/zh_cn/canvasTable.js +50 -0
  60. package/dist/es/config/i18n/zh_cn/chatRoom.js +14 -0
  61. package/dist/es/config/i18n/zh_cn/datePicker.js +22 -0
  62. package/dist/es/config/i18n/zh_cn/detailList.js +6 -0
  63. package/dist/es/config/i18n/zh_cn/differences.js +6 -0
  64. package/dist/es/config/i18n/zh_cn/dynamicSetting.js +72 -0
  65. package/dist/es/config/i18n/zh_cn/electronSignatures.js +342 -0
  66. package/dist/es/config/i18n/zh_cn/enhanceSelect.js +8 -0
  67. package/dist/es/config/i18n/zh_cn/footer.js +8 -0
  68. package/dist/es/config/i18n/zh_cn/form.js +26 -0
  69. package/dist/es/config/i18n/zh_cn/formItem.js +8 -0
  70. package/dist/es/config/i18n/zh_cn/inputNumber.js +7 -0
  71. package/dist/es/config/i18n/zh_cn/login.js +76 -0
  72. package/dist/es/config/i18n/zh_cn/modal.js +8 -0
  73. package/dist/es/config/i18n/zh_cn/notAuthPage.js +8 -0
  74. package/dist/es/config/i18n/zh_cn/notRoutePage.js +8 -0
  75. package/dist/es/config/i18n/zh_cn/operationBtn.js +10 -0
  76. package/dist/es/config/i18n/zh_cn/print.js +16 -0
  77. package/dist/es/config/i18n/zh_cn/select.js +6 -0
  78. package/dist/es/config/i18n/zh_cn/table.js +65 -0
  79. package/dist/es/config/i18n/zh_cn/tabs.js +10 -0
  80. package/dist/es/config/i18n/zh_cn/translationButton.js +26 -0
  81. package/dist/es/config/i18n/zh_cn/tree.js +6 -0
  82. package/dist/es/config/i18n/zh_cn/uploadList.js +82 -0
  83. package/dist/es/config/i18n/zh_cn/ztTransfer.js +14 -0
  84. package/dist/es/config/i18n/zh_cn.d.ts +538 -0
  85. package/dist/es/config/i18n/zh_cn.js +65 -1
  86. package/dist/es/config/index.js +1 -1
  87. package/dist/es/config/useLocale.d.ts +554 -0
  88. package/dist/es/config/useLocale.js +41 -8
  89. package/dist/es/datepicker/index.js +9 -3
  90. package/dist/es/datepicker/utils.js +32 -26
  91. package/dist/es/detaillist/item.js +7 -2
  92. package/dist/es/detaillist/list.js +2 -0
  93. package/dist/es/differences/differences.js +8 -1
  94. package/dist/es/dynamicsetting/dynamicDrawer.js +41 -24
  95. package/dist/es/dynamicsetting/hooks.js +2 -0
  96. package/dist/es/dynamicsetting/moreConfig.js +6 -2
  97. package/dist/es/dynamicsetting/useSearch.js +5 -1
  98. package/dist/es/dynamicsetting/useTemplate.js +19 -15
  99. package/dist/es/electronsignatures/content.js +52 -31
  100. package/dist/es/electronsignatures/filecomponents/file-upload.js +2 -0
  101. package/dist/es/electronsignatures/filecomponents/useFetchFileTypeData.js +2 -0
  102. package/dist/es/enhanceselect/enhance-select.js +7 -3
  103. package/dist/es/enhanceselect/list-query.js +2 -0
  104. package/dist/es/enhanceselect/page-query.js +2 -0
  105. package/dist/es/form/common-search-list.js +7 -2
  106. package/dist/es/form/form.js +9 -5
  107. package/dist/es/form/resetButton.js +16 -11
  108. package/dist/es/form/useCommonSearch.js +12 -9
  109. package/dist/es/formitem/formItem.js +4 -2
  110. package/dist/es/inputnumber/inputNumber.js +11 -2
  111. package/dist/es/inputnumber/utils.js +41 -8
  112. package/dist/es/login/forget-password.js +9 -5
  113. package/dist/es/login/index.js +12 -8
  114. package/dist/es/modal/modal.js +6 -2
  115. package/dist/es/operationbtn/operationBtn.js +5 -3
  116. package/dist/es/select/hooks.js +5 -1
  117. package/dist/es/table/components/ColumnAddDel.js +11 -5
  118. package/dist/es/table/components/EnhanceBodyCell.js +7 -5
  119. package/dist/es/table/components/FilterDropdown.js +7 -3
  120. package/dist/es/table/components/SortTitle.js +8 -4
  121. package/dist/es/table/components/TableMenu.js +5 -1
  122. package/dist/es/table/components/TitleOperation.js +5 -1
  123. package/dist/es/table/components/table-header-operation/FillDown.js +7 -3
  124. package/dist/es/table/excel.js +8 -4
  125. package/dist/es/table/hooks/useSelectSubtotal.js +8 -1
  126. package/dist/es/table/table.js +6 -4
  127. package/dist/es/table/useColumns.js +8 -4
  128. package/dist/es/table/useSummary.js +6 -2
  129. package/dist/es/table/useTableValidate.js +39 -7
  130. package/dist/es/table/utils.js +10 -5
  131. package/dist/es/tabs/tab-type.js +10 -1
  132. package/dist/es/title/title.js +2 -0
  133. package/dist/es/translationbutton/DownFile.js +8 -4
  134. package/dist/es/translationbutton/PreviewFile.js +5 -3
  135. package/dist/es/translationbutton/hooks.js +5 -1
  136. package/dist/es/translationbutton/translationButton.js +15 -12
  137. package/dist/es/tree/tree.js +8 -2
  138. package/dist/es/uploadlist/hooks.js +17 -11
  139. package/dist/es/uploadlist/uploadList.js +39 -26
  140. package/dist/es/uploadlist/uploadListDetail.js +15 -11
  141. package/dist/es/uploadlist/uploadTable.js +23 -19
  142. package/dist/es/uploadlist/utils.js +8 -1
  143. package/dist/es/zttransfer/Container.js +5 -1
  144. package/dist/es/zttransfer/SelectContainer.js +5 -1
  145. package/dist/es/zttransfer/zt-transfer.js +5 -1
  146. package/dist/index.build.d.ts +1 -0
  147. package/dist/index.es.js +1 -0
  148. package/package.json +5 -2
@@ -1,6 +1,9 @@
1
1
  import { useRef, useCallback, useEffect } from 'react';
2
2
  import { domFind, domParentsUntil } from '../../config/utils.js';
3
3
  import { copyToClipboard, plus } from 'zmdms-utils';
4
+ import useLocale, { formatLocaleText } from '../../config/useLocale.js';
5
+ import '../../config/ZtxkContext.js';
6
+ import '../../config/MyStorage.js';
4
7
  import useCtrl from './useCtrl.js';
5
8
 
6
9
  // ==================== 工具函数 ====================
@@ -115,6 +118,7 @@ function getCellValue(td) {
115
118
  */
116
119
  function useSelectSubtotal(tableRef, props) {
117
120
  var isMove = props.isMove, isEdit = props.isEdit, scroll = props.scroll;
121
+ var locale = useLocale().Table;
118
122
  var tipRef = useRef(null);
119
123
  var rowResultRef = useRef([]);
120
124
  var getCtrlKeyPressed = useCtrl().getCtrlKeyPressed;
@@ -239,7 +243,10 @@ function useSelectSubtotal(tableRef, props) {
239
243
  var maxTop = contaienrRect.height;
240
244
  var top_1 = 0, left = 0;
241
245
  if (e.target) {
242
- $tip.innerText = "\u5C0F\u8BA1\uFF1A ".concat(result, " \u5DF2\u9009\uFF1A").concat(textArr.length, "\u9879");
246
+ $tip.innerText = formatLocaleText(locale.subtotalTip, {
247
+ result: result,
248
+ count: textArr.length,
249
+ });
243
250
  top_1 = e.clientY - contaienrRect.top;
244
251
  left = e.clientX - contaienrRect.left;
245
252
  var tipRect = $tip.getBoundingClientRect();
@@ -11,6 +11,12 @@ import './components/ColumnDynamic.js';
11
11
  import './components/ColumnAddDel.js';
12
12
  import './components/TitleOperation.js';
13
13
  import { IS_SUMMARY, TABLE_DYNAMIC_TEMPLATE_KEY, MERGE_KEY, TABLE_DYNAMIC_KEY, INNER_TABLE_PAGINATION_POSITION, INNER_TABLE_PAGINATION_PAGESIZEOPTIONS } from './constant.js';
14
+ import 'react-i18next';
15
+ import '../config/ZtxkContext.js';
16
+ import '../config/i18n/i18nInstance.js';
17
+ import useBaseContext from '../config/useBaseContext.js';
18
+ import '../config/MyStorage.js';
19
+ import { getFinalValue } from '../config/utils.js';
14
20
  import './components/PopoverIcon.js';
15
21
  import { useLatest, useMemoizedFn } from 'ahooks';
16
22
  import { useParseColumns } from './useParseColumns.js';
@@ -27,10 +33,6 @@ import TableDynamicHeader from './components/TableDynamicHeader.js';
27
33
  import { useExcelExport } from './excel.js';
28
34
  import TableMenu from './components/TableMenu.js';
29
35
  import { useContextMenu as Fe } from '../node_modules/react-contexify/dist/index.js';
30
- import '../config/ZtxkContext.js';
31
- import useBaseContext from '../config/useBaseContext.js';
32
- import '../config/MyStorage.js';
33
- import { getFinalValue } from '../config/utils.js';
34
36
  import useTableSummaryCollapse from './useTableSummaryCollapse.js';
35
37
  import useSelectSubtotal from './hooks/useSelectSubtotal.js';
36
38
  import MehOutlined from '../node_modules/@ant-design/icons/es/icons/MehOutlined.js';
@@ -5,6 +5,9 @@ import { getTableColumns, parsePasteData, getFilterRecords, startColumnInsertTab
5
5
  import '../node_modules/classnames/index.js';
6
6
  import { MERGE_INDEX, IS_SUMMARY } from './constant.js';
7
7
  import 'ahooks';
8
+ import useLocale from '../config/useLocale.js';
9
+ import '../config/ZtxkContext.js';
10
+ import '../config/MyStorage.js';
8
11
  import './components/EnhanceHeaderCell.js';
9
12
  import ColumnDynamic from './components/ColumnDynamic.js';
10
13
  import ColumnAddDel, { ColumnDelAll, ColumnAdd } from './components/ColumnAddDel.js';
@@ -26,6 +29,7 @@ import ModalComponent from '../modal/modal.js';
26
29
  function useColumns(columns, options) {
27
30
  var _this = this;
28
31
  var _a, _b;
32
+ var locale = useLocale().Table;
29
33
  var dynamicKey = options.dynamicKey, isRemeberFilter = options.isRemeberFilter, hiddenDynamicIcon = options.hiddenDynamicIcon, currentDynamicList = options.currentDynamicList, dataSource = options.dataSource, dataSourceRef = options.dataSourceRef, mergedDataForFilterRef = options.mergedDataForFilterRef, onEditableSave = options.onEditableSave, isEdit = options.isEdit, isAdd = options.isAdd, isTheadTitleAdd = options.isTheadTitleAdd, isDel = options.isDel, delPopTitle = options.delPopTitle, dynamicSettingRef = options.dynamicSettingRef, onCurrentListChange = options.onCurrentListChange, onAddAndDel = options.onAddAndDel, getRefreshScuCell = options.getRefreshScuCell, isDelAll = options.isDelAll, currentPage = options.currentPage, onTableChange = options.onTableChange, order = options.order, setOrder = options.setOrder, customSortHandle = options.customSortHandle, isResizableColumn = options.isResizableColumn, isResizableTitleEllipsis = options.isResizableTitleEllipsis, isRealTimeValidate = options.isRealTimeValidate, hiddenDelBtnHandleRef = options.hiddenDelBtnHandleRef, hiddenAddBtnHandleRef = options.hiddenAddBtnHandleRef, rowKey = options.rowKey, filterConfigRef = options.filterConfigRef, rowSelection = options.rowSelection, addAndDelProps = options.addAndDelProps, headerAlign = options.headerAlign, mode = options.mode, isAutoMerge = options.isAutoMerge, handleFilterConfigChange = options.handleFilterConfigChange, _c = options.isAutoMergeAddAndDel, isAutoMergeAddAndDel = _c === void 0 ? true : _c, isDynamicColumnTextEnable = options.isDynamicColumnTextEnable;
30
34
  var newColumns = getTableColumns(columns, currentDynamicList).columns;
31
35
  // 处理自动合并的加减和选择框
@@ -232,9 +236,9 @@ function useColumns(columns, options) {
232
236
  isContinue_1 = true;
233
237
  return [4 /*yield*/, new Promise(function (resolve, reject) {
234
238
  ModalComponent.confirm({
235
- title: "发现粘贴内容中有分隔符。请确认是否只将值填入当前输入框,还是执行扩展!",
236
- okText: "确认扩展",
237
- cancelText: "仅粘贴到当前输入框",
239
+ title: locale.pasteConfirmTitle,
240
+ okText: locale.pasteExpandOk,
241
+ cancelText: locale.pasteExpandCancel,
238
242
  onOk: function () {
239
243
  isContinue_1 = true;
240
244
  resolve(1);
@@ -451,7 +455,7 @@ function useColumns(columns, options) {
451
455
  }
452
456
  if (mode === "index") {
453
457
  myNewColumns.unshift({
454
- title: "序号",
458
+ title: locale.serialNumber,
455
459
  width: 60,
456
460
  key: MERGE_INDEX,
457
461
  fixed: "left",
@@ -5,6 +5,9 @@ import { Table } from 'antd';
5
5
  import { plus, addThousedSeparator } from 'zmdms-utils';
6
6
  import { IS_SUMMARY, MERGE_ROW_SPANS } from './constant.js';
7
7
  import { getFieldMergeKey } from './utils.js';
8
+ import { getLocale } from '../config/useLocale.js';
9
+ import '../config/ZtxkContext.js';
10
+ import '../config/MyStorage.js';
8
11
 
9
12
  function useSummary(summaryConfig, columns, options) {
10
13
  var summaryFixed = options.summaryFixed, rowSelection = options.rowSelection, expandable = options.expandable, isAdd = options.isAdd, isDel = options.isDel, isTableSummaryCollapse = options.isTableSummaryCollapse, showSummary = options.showSummary, renderTableSummaryCollapse = options.renderTableSummaryCollapse;
@@ -75,6 +78,7 @@ function recursionColumns(columns, options) {
75
78
  function getSummaryData(summaryConfig, dataSource, options) {
76
79
  var _summaryData = [];
77
80
  var fillNumber = options.fillNumber, columns = options.columns;
81
+ var locale = getLocale().Table;
78
82
  if (Array.isArray(summaryConfig)) {
79
83
  summaryConfig.forEach(function (summary) {
80
84
  var type = summary.type, fields = summary.fields, title = summary.title;
@@ -97,7 +101,7 @@ function getSummaryData(summaryConfig, dataSource, options) {
97
101
  dataObj: summaryTotalObj,
98
102
  });
99
103
  _summaryData.push({
100
- title: title == null ? "小计" : title,
104
+ title: title == null ? locale.subtotal : title,
101
105
  titleIndex: 0 + fillNumber,
102
106
  key: "subtotal",
103
107
  list: Array(fillNumber).fill(undefined).concat(subtotalResult),
@@ -121,7 +125,7 @@ function getSummaryData(summaryConfig, dataSource, options) {
121
125
  dataObj: totalObj,
122
126
  });
123
127
  _summaryData.push({
124
- title: title == null ? "总计" : title,
128
+ title: title == null ? locale.grandTotal : title,
125
129
  titleIndex: 0 + fillNumber,
126
130
  key: "total",
127
131
  list: Array(fillNumber).fill(undefined).concat(totalResult),
@@ -1,6 +1,9 @@
1
1
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
2
2
  import { useRef, useCallback } from 'react';
3
3
  import { ERROR_TD_CLASSNAME } from './constant.js';
4
+ import { formatLocaleText, getLocale } from '../config/useLocale.js';
5
+ import '../config/ZtxkContext.js';
6
+ import '../config/MyStorage.js';
4
7
 
5
8
  function useTableValidate() {
6
9
  var tableRef = useRef();
@@ -50,12 +53,13 @@ function domFind(el, selector) {
50
53
  }
51
54
  function tableValidate(dataSource, columns, restParams) {
52
55
  return __awaiter(this, void 0, void 0, function () {
53
- var getCurrentTable, rowSelection, expandable, tableName, isInnerPagination, setCurrent, pageSize,
56
+ var locale, getCurrentTable, rowSelection, expandable, tableName, isInnerPagination, setCurrent, pageSize,
54
57
  // 需要验证的字段,如果没传 那就所有字段都校验
55
58
  validateKeys, requiredFileds, childrenLen, isMerge, parseValidateFiledsHandle, i, item, _loop_1, j, state_1;
56
59
  return __generator(this, function (_a) {
57
60
  switch (_a.label) {
58
61
  case 0:
62
+ locale = getLocale().Table;
59
63
  getCurrentTable = restParams.getCurrentTable, rowSelection = restParams.rowSelection, expandable = restParams.expandable, tableName = restParams.tableName, isInnerPagination = restParams.isInnerPagination, setCurrent = restParams.setCurrent, pageSize = restParams.pageSize, validateKeys = restParams.validateKeys;
60
64
  if (!Array.isArray(dataSource) || dataSource.length === 0) {
61
65
  console.info("没有数据,无需验证!");
@@ -264,13 +268,23 @@ function tableValidate(dataSource, columns, restParams) {
264
268
  setElementState(innerCurrentI, index, ERROR_TD_CLASSNAME);
265
269
  });
266
270
  return [2 /*return*/, { value: Promise.reject({
267
- errors: "".concat(tableName || "", " \u7B2C").concat(innerCurrentI + 1, "\u884C ").concat(title, " ").concat(msg || "填写错误!"),
271
+ errors: "".concat(tableName || "", " ") +
272
+ formatLocaleText(locale.rowError, {
273
+ row: innerCurrentI + 1,
274
+ title: title,
275
+ message: msg || locale.fillError,
276
+ }),
268
277
  }) }];
269
278
  }
270
279
  else {
271
280
  setElementState(i, index, ERROR_TD_CLASSNAME);
272
281
  return [2 /*return*/, { value: Promise.reject({
273
- errors: "".concat(tableName || "", " \u7B2C").concat(i + 1, "\u884C ").concat(title, " ").concat(msg || "填写错误!"),
282
+ errors: "".concat(tableName || "", " ") +
283
+ formatLocaleText(locale.rowError, {
284
+ row: i + 1,
285
+ title: title,
286
+ message: msg || locale.fillError,
287
+ }),
274
288
  }) }];
275
289
  }
276
290
  }
@@ -285,13 +299,23 @@ function tableValidate(dataSource, columns, restParams) {
285
299
  setElementState(innerCurrentI, index, ERROR_TD_CLASSNAME);
286
300
  });
287
301
  return [2 /*return*/, { value: Promise.reject({
288
- errors: "".concat(tableName || "", " \u7B2C").concat(innerCurrentI + 1, "\u884C ").concat(title, " ").concat(message || "填写错误!"),
302
+ errors: "".concat(tableName || "", " ") +
303
+ formatLocaleText(locale.rowError, {
304
+ row: innerCurrentI + 1,
305
+ title: title,
306
+ message: message || locale.fillError,
307
+ }),
289
308
  }) }];
290
309
  }
291
310
  else {
292
311
  setElementState(i, index, ERROR_TD_CLASSNAME);
293
312
  return [2 /*return*/, { value: Promise.reject({
294
- errors: "".concat(tableName || "", " \u7B2C").concat(i + 1, "\u884C ").concat(title, " ").concat((validate === null || validate === void 0 ? void 0 : validate.message) || "填写错误!"),
313
+ errors: "".concat(tableName || "", " ") +
314
+ formatLocaleText(locale.rowError, {
315
+ row: i + 1,
316
+ title: title,
317
+ message: (validate === null || validate === void 0 ? void 0 : validate.message) || locale.fillError,
318
+ }),
295
319
  }) }];
296
320
  }
297
321
  }
@@ -305,7 +329,11 @@ function tableValidate(dataSource, columns, restParams) {
305
329
  setElementState(innerCurrentI, index, ERROR_TD_CLASSNAME);
306
330
  });
307
331
  return [2 /*return*/, { value: Promise.reject({
308
- errors: "".concat(tableName || "", " \u7B2C").concat(innerCurrentI + 1, "\u884C ").concat(title, " \u4E3A\u7A7A!"),
332
+ errors: "".concat(tableName || "", " ") +
333
+ formatLocaleText(locale.rowRequiredError, {
334
+ row: innerCurrentI + 1,
335
+ title: title,
336
+ }),
309
337
  rowIndex: i,
310
338
  colIndex: index,
311
339
  }) }];
@@ -313,7 +341,11 @@ function tableValidate(dataSource, columns, restParams) {
313
341
  else {
314
342
  setElementState(i, index, ERROR_TD_CLASSNAME);
315
343
  return [2 /*return*/, { value: Promise.reject({
316
- errors: "".concat(tableName || "", " \u7B2C").concat(i + 1, "\u884C ").concat(title, " \u4E3A\u7A7A!"),
344
+ errors: "".concat(tableName || "", " ") +
345
+ formatLocaleText(locale.rowRequiredError, {
346
+ row: i + 1,
347
+ title: title,
348
+ }),
317
349
  rowIndex: i,
318
350
  colIndex: index,
319
351
  }) }];
@@ -2,6 +2,10 @@ import { __spreadArray, __assign, __awaiter, __generator } from '../_virtual/_ts
2
2
  import { filterHandle } from './components/FilterDropdown.js';
3
3
  import { MERGE_ROW_SPANS, MERGE_KEY, MERGE_INDEX, IS_SUMMARY } from './constant.js';
4
4
  import { plus } from 'zmdms-utils';
5
+ import { getLocale, formatLocaleText } from '../config/useLocale.js';
6
+ import 'react';
7
+ import '../config/ZtxkContext.js';
8
+ import '../config/MyStorage.js';
5
9
  import myMessage from '../message/index.js';
6
10
 
7
11
  // 递归处理columns
@@ -121,6 +125,7 @@ function getTableColumns(columns, currentDynamicList) {
121
125
  // 复制整列方法
122
126
  function copyColData(key, options) {
123
127
  var _a, _b;
128
+ var locale = getLocale().Table;
124
129
  var dataSource = options.dataSource, filterConfig = options.filterConfig;
125
130
  if (Array.isArray(dataSource)) {
126
131
  var newDataSource = getFilterRecords(dataSource, filterConfig);
@@ -138,7 +143,7 @@ function copyColData(key, options) {
138
143
  try {
139
144
  if ((navigator === null || navigator === void 0 ? void 0 : navigator.clipboard) && window.isSecureContext) {
140
145
  (_b = (_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.writeText(str)) === null || _b === void 0 ? void 0 : _b.then(function () {
141
- myMessage.success("复制成功!");
146
+ myMessage.success(locale.copySuccess);
142
147
  });
143
148
  }
144
149
  else {
@@ -147,17 +152,17 @@ function copyColData(key, options) {
147
152
  document.body.appendChild(textarea);
148
153
  textarea.select();
149
154
  if (document.execCommand) {
150
- myMessage.success("复制成功!");
155
+ myMessage.success(locale.copySuccess);
151
156
  document.execCommand("copy");
152
157
  }
153
158
  else {
154
- myMessage.info("\u590D\u5236\u5931\u8D25\uFF01\u8BF7\u624B\u5DE5\u590D\u5236\n ".concat(str));
159
+ myMessage.info(formatLocaleText(locale.copyFailManual, { content: str }));
155
160
  }
156
161
  document.body.removeChild(textarea);
157
162
  }
158
163
  }
159
164
  catch (err) {
160
- myMessage.info("\u590D\u5236\u5931\u8D25\uFF01\u8BF7\u624B\u5DE5\u590D\u5236\n ".concat(str));
165
+ myMessage.info(formatLocaleText(locale.copyFailManual, { content: str }));
161
166
  }
162
167
  }
163
168
  }
@@ -855,7 +860,7 @@ columns // 列配置,用于查找字段的 mergeKey
855
860
  var dimensionKey = allDimensionKeys[i];
856
861
  if (i === summaryLevelIndex) {
857
862
  // 当前合计维度字段加上"合计"后缀
858
- summaryRow[dimensionKey] = "".concat(groupKey[i], "\u5408\u8BA1");
863
+ summaryRow[dimensionKey] = formatLocaleText(getLocale().Table.dimensionTotal, { name: groupKey[i] });
859
864
  }
860
865
  else if (i < summaryLevelIndex) {
861
866
  // 前面的维度字段保持原值
@@ -2,10 +2,19 @@ import { __assign } from '../_virtual/_tslib.js';
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { memo } from 'react';
4
4
  import { ItemIcon } from './tabs.js';
5
+ import useLocale from '../config/useLocale.js';
6
+ import '../config/ZtxkContext.js';
7
+ import '../config/MyStorage.js';
5
8
 
6
9
  var type = ["completed", "incomplete", "partially"];
7
- var typeMsg = ["已完成", "未填写", "部分填写"];
8
10
  var TabType = function () {
11
+ var locale = useLocale().Tabs;
12
+ // 与 type 数组一一对应的状态文案
13
+ var typeMsg = [
14
+ locale.completed,
15
+ locale.incomplete,
16
+ locale.partially,
17
+ ];
9
18
  return (jsx("div", __assign({ className: "tabs-self--type-container" }, { children: type.map(function (key, index) {
10
19
  return (jsxs("div", __assign({ className: "tabs-self--type-msg" }, { children: [ItemIcon[key], " ", typeMsg[index]] }), key));
11
20
  }) })));
@@ -2,7 +2,9 @@ import { __assign } from '../_virtual/_tslib.js';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import classNames from '../node_modules/classnames/index.js';
4
4
  import 'react';
5
+ import 'react-i18next';
5
6
  import '../config/ZtxkContext.js';
7
+ import '../config/i18n/i18nInstance.js';
6
8
  import useBaseContext from '../config/useBaseContext.js';
7
9
  import '../config/MyStorage.js';
8
10
  import IconFont from '../icon/index.js';
@@ -1,6 +1,9 @@
1
1
  import { __assign } from '../_virtual/_tslib.js';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { useState, useCallback, useEffect } from 'react';
4
+ import useLocale from '../config/useLocale.js';
5
+ import '../config/ZtxkContext.js';
6
+ import '../config/MyStorage.js';
4
7
  import ButtonCom from '../button/button.js';
5
8
  import myMessage from '../message/index.js';
6
9
  import { Dropdown } from 'antd';
@@ -8,6 +11,7 @@ import DownloadOutlined from '../node_modules/@ant-design/icons/es/icons/Downloa
8
11
 
9
12
  var DownFile = function (_a) {
10
13
  var request = _a.request, tid = _a.tid, fileName = _a.fileName;
14
+ var locale = useLocale().TranslationButton;
11
15
  // 下载类型选择
12
16
  var _b = useState([]), downloadTypeDict = _b[0], setDownloadTypeDict = _b[1];
13
17
  var _c = useState(false), loading = _c[0], setLoading = _c[1];
@@ -47,7 +51,7 @@ var DownFile = function (_a) {
47
51
  type: "application/vnd.ms-excel",
48
52
  });
49
53
  if (blob.size < 1) {
50
- myMessage.warning("下载失败,下载的内容为空!");
54
+ myMessage.warning(locale.downloadEmpty);
51
55
  return;
52
56
  }
53
57
  var aLink = document.createElement("a");
@@ -74,15 +78,15 @@ var DownFile = function (_a) {
74
78
  .text()
75
79
  .then(function (data) {
76
80
  var result = JSON.parse(data);
77
- myMessage.error((result === null || result === void 0 ? void 0 : result.msg) || "接口调用失败!");
81
+ myMessage.error((result === null || result === void 0 ? void 0 : result.msg) || locale.apiError);
78
82
  })
79
83
  .catch(function () {
80
84
  var _a, _b;
81
- myMessage.error(((_b = (_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || "接口调用失败!");
85
+ myMessage.error(((_b = (_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || locale.apiError);
82
86
  });
83
87
  }
84
88
  catch (e) {
85
- myMessage.error(((_c = (_b = err === null || err === void 0 ? void 0 : err.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.msg) || "接口调用失败!");
89
+ myMessage.error(((_c = (_b = err === null || err === void 0 ? void 0 : err.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.msg) || locale.apiError);
86
90
  }
87
91
  })
88
92
  .finally(function () {
@@ -3,12 +3,14 @@ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import React__default from 'react';
4
4
  import { createOriginalLink } from 'zmdms-utils';
5
5
  import DownFile from './DownFile.js';
6
- import '../config/ZtxkContext.js';
6
+ import useLocale from '../config/useLocale.js';
7
7
  import useBaseContext from '../config/useBaseContext.js';
8
+ import '../config/ZtxkContext.js';
8
9
  import '../config/MyStorage.js';
9
10
 
10
11
  var PreviewFile = function () {
11
12
  var _a = useBaseContext(), request = _a.request, fileBaseUrl = _a.fileBaseUrl;
13
+ var locale = useLocale().TranslationButton;
12
14
  var params = new URLSearchParams(window.location.search);
13
15
  var oldId = params.get("oldId");
14
16
  var tid = params.get("tid");
@@ -49,11 +51,11 @@ var PreviewFile = function () {
49
51
  height: "100vh",
50
52
  justifyContent: "space-between",
51
53
  overflow: "hidden",
52
- } }, { children: [jsx("iframe", { style: { width: "100%", height: "100%", border: "2px solid #333" }, src: oldUrl, title: "原文档" }), jsx("div", { style: { width: "5px", height: "100px" } }), jsxs("div", __assign({ style: {
54
+ } }, { children: [jsx("iframe", { style: { width: "100%", height: "100%", border: "2px solid #333" }, src: oldUrl, title: locale.originalDoc }), jsx("div", { style: { width: "5px", height: "100px" } }), jsxs("div", __assign({ style: {
53
55
  position: "relative",
54
56
  width: "100%",
55
57
  border: "2px solid #333",
56
- } }, { children: [jsx("iframe", { style: { width: "100%", height: "100%" }, src: translatedUrl, title: "翻译文档" }), jsx("div", __assign({ style: {
58
+ } }, { children: [jsx("iframe", { style: { width: "100%", height: "100%" }, src: translatedUrl, title: locale.translatedDoc }), jsx("div", __assign({ style: {
57
59
  position: "absolute",
58
60
  right: "20px",
59
61
  bottom: "50%",
@@ -1,8 +1,12 @@
1
1
  import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
2
2
  import { useState, useRef, useEffect } from 'react';
3
+ import { getLocale } from '../config/useLocale.js';
4
+ import '../config/ZtxkContext.js';
5
+ import '../config/MyStorage.js';
3
6
  import myMessage from '../message/index.js';
4
7
 
5
8
  function getTranslateProgress(request, currentTid) {
9
+ var locale = getLocale().TranslationButton;
6
10
  return request === null || request === void 0 ? void 0 : request({
7
11
  url: "/api/zmdms-resource/fanyi/query-trans-progress/".concat(currentTid),
8
12
  method: "GET",
@@ -20,7 +24,7 @@ function getTranslateProgress(request, currentTid) {
20
24
  });
21
25
  }).catch(function (err) {
22
26
  var _a, _b;
23
- myMessage.error(((_b = (_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || "接口调用失败!");
27
+ myMessage.error(((_b = (_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || locale.apiError);
24
28
  return Promise.reject(false);
25
29
  });
26
30
  }
@@ -3,20 +3,23 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
3
  import { useMemo, useState } from 'react';
4
4
  import { unstable_batchedUpdates } from 'react-dom';
5
5
  import { usePercent } from './hooks.js';
6
- import '../config/ZtxkContext.js';
6
+ import useLocale, { formatLocaleText } from '../config/useLocale.js';
7
7
  import useBaseContext from '../config/useBaseContext.js';
8
+ import '../config/ZtxkContext.js';
8
9
  import '../config/MyStorage.js';
9
10
  import { useQuery } from '@tanstack/react-query';
10
11
  import ButtonCom from '../button/button.js';
11
12
  import myMessage from '../message/index.js';
12
13
  import { Progress, Dropdown } from 'antd';
13
14
 
14
- var translationTypeList = [
15
- { dictKey: "2", dictValue: "英文转中文" },
16
- { dictKey: "1", dictValue: "中文转英文" },
17
- ];
18
15
  var TranslationButton = function (props) {
19
16
  var _a = useBaseContext(), request = _a.request, translationPreviewRoute = _a.translationPreviewRoute, dictApiUrl = _a.dictApiUrl;
17
+ var locale = useLocale().TranslationButton;
18
+ // 翻译类型选项
19
+ var translationTypeList = useMemo(function () { return [
20
+ { dictKey: "2", dictValue: locale.enToZh },
21
+ { dictKey: "1", dictValue: locale.zhToEn },
22
+ ]; }, [locale]);
20
23
  var attachId = props.attachId, tid = props.tid, translationParams = props.translationParams, tidChange = props.tidChange, previewUrl = props.previewUrl;
21
24
  var previewRoute = useMemo(function () {
22
25
  return previewUrl || translationPreviewRoute || "";
@@ -103,13 +106,13 @@ var TranslationButton = function (props) {
103
106
  });
104
107
  }
105
108
  else {
106
- myMessage.error(((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.msg) || "接口调用失败!");
109
+ myMessage.error(((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.msg) || locale.apiError);
107
110
  setLoading(false);
108
111
  }
109
112
  })
110
113
  .catch(function (err) {
111
114
  var _a, _b;
112
- myMessage.error(((_b = (_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || "接口调用失败!");
115
+ myMessage.error(((_b = (_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || locale.apiError);
113
116
  setLoading(false);
114
117
  });
115
118
  };
@@ -120,7 +123,7 @@ var TranslationButton = function (props) {
120
123
  loopProgress();
121
124
  }
122
125
  else {
123
- myMessage.info("没有 找到任务id!");
126
+ myMessage.info(locale.noTaskId);
124
127
  setLoading(false);
125
128
  }
126
129
  function loopProgress() {
@@ -140,7 +143,7 @@ var TranslationButton = function (props) {
140
143
  // download(dType);
141
144
  }
142
145
  else {
143
- myMessage.warning("\u5F53\u524D\u7FFB\u8BD1\u8FDB\u5EA6".concat(percent_1, "%"));
146
+ myMessage.warning(formatLocaleText(locale.translatingProgress, { percent: percent_1 }));
144
147
  setLoading(false);
145
148
  }
146
149
  return [3 /*break*/, 3];
@@ -171,7 +174,7 @@ var TranslationButton = function (props) {
171
174
  });
172
175
  }).catch(function (err) {
173
176
  var _a, _b;
174
- myMessage.error(((_b = (_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || "接口调用失败!");
177
+ myMessage.error(((_b = (_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || locale.apiError);
175
178
  return Promise.reject(false);
176
179
  });
177
180
  }
@@ -187,9 +190,9 @@ var TranslationButton = function (props) {
187
190
  };
188
191
  switch (translationStatus) {
189
192
  case "start":
190
- return renderTranslationDropdown("翻译文件");
193
+ return renderTranslationDropdown(locale.translateFile);
191
194
  case "pending":
192
- return (jsxs(Fragment, { children: [jsx(ButtonCom, __assign({ type: "link", loading: loading, onClick: handleDownloadTranslation, disabled: isTranslating, style: { padding: "2px 6px" } }, { children: "查看译文" })), isTranslating && (jsx(Progress, { type: "circle", percent: percent, width: 35 })), !isTranslating && renderTranslationDropdown("重译")] }));
195
+ return (jsxs(Fragment, { children: [jsx(ButtonCom, __assign({ type: "link", loading: loading, onClick: handleDownloadTranslation, disabled: isTranslating, style: { padding: "2px 6px" } }, { children: locale.viewTranslation })), isTranslating && (jsx(Progress, { type: "circle", percent: percent, width: 35 })), !isTranslating && renderTranslationDropdown(locale.retranslate)] }));
193
196
  }
194
197
  return jsx(Fragment, {});
195
198
  };
@@ -4,6 +4,9 @@ import { memo, forwardRef, useRef, useImperativeHandle } from 'react';
4
4
  import { Tree as Tree$1 } from 'antd';
5
5
  import Input from '../input/input.js';
6
6
  import classNames from '../node_modules/classnames/index.js';
7
+ import useLocale, { formatLocaleText } from '../config/useLocale.js';
8
+ import '../config/ZtxkContext.js';
9
+ import '../config/MyStorage.js';
7
10
  import { useBasicInfo, useAllCheckData, useAllDataHandle, useSearchHandle, useLazySearchExpands } from './hooks.js';
8
11
 
9
12
  var Tree = function (props, ref) {
@@ -44,6 +47,7 @@ var Tree = function (props, ref) {
44
47
  }), onSearchHandle = _f.onSearchHandle, onChangeHandle = _f.onChangeHandle, searchValue = _f.searchValue, expandProps = __rest(_f, ["onSearchHandle", "onChangeHandle", "searchValue"]);
45
48
  var _g = useLazySearchExpands(lazySearchTreeData), lazySearchExpandedKeys = _g.expandedKeys, lazySearchAutoExpandParent = _g.autoExpandParent, lazySearchOnExpand = _g.onExpand;
46
49
  var showLazySearchTreeData = !!(searchType === "lazy" && searchValue);
50
+ var locale = useLocale().Tree;
47
51
  useImperativeHandle(ref, function () {
48
52
  return {
49
53
  /** 可以根据keys来匹配 */
@@ -59,11 +63,13 @@ var Tree = function (props, ref) {
59
63
  },
60
64
  };
61
65
  });
62
- return (jsxs("div", __assign({ className: classes, style: __assign({ height: cssTreeHeight }, style) }, { children: [searchType ? (jsx(Input.Search, { value: searchValue, onChange: onChangeHandle, onSearch: onSearchHandle })) : null, (props.checkable || props.multiple) && checkedKeys && showCount ? (jsxs("div", { children: ["\u5DF2\u9009\u4E2D\uFF1A", checkedKeys
66
+ return (jsxs("div", __assign({ className: classes, style: __assign({ height: cssTreeHeight }, style) }, { children: [searchType ? (jsx(Input.Search, { value: searchValue, onChange: onChangeHandle, onSearch: onSearchHandle })) : null, (props.checkable || props.multiple) && checkedKeys && showCount ? (jsx("div", { children: formatLocaleText(locale.checkedCount, {
67
+ count: checkedKeys
63
68
  ? Array.isArray(checkedKeys)
64
69
  ? checkedKeys.length
65
70
  : (_a = checkedKeys.checked) === null || _a === void 0 ? void 0 : _a.length
66
- : 0, "\u9879"] })) : null, searchType === "lazy" && (jsx(Tree$1, __assign({ treeData: lazySearchTreeData, className: showLazySearchTreeData ? "" : "ztxk-tree--hidden", defaultExpandAll: true, expandedKeys: lazySearchExpandedKeys, autoExpandParent: lazySearchAutoExpandParent, onExpand: onExpand ? onExpand : lazySearchOnExpand, onCheck: onCheckHandle, onSelect: onSelectHandle, ref: lazyTreeRef }, resetProps))), jsx(Tree$1, __assign({}, expandProps, { treeData: treeData, loadData: loadData, className: showLazySearchTreeData ? "ztxk-tree--hidden" : "", style: treeStyle, onCheck: onCheckHandle, onSelect: onSelectHandle, ref: treeRef }, resetProps))] })));
71
+ : 0,
72
+ }) })) : null, searchType === "lazy" && (jsx(Tree$1, __assign({ treeData: lazySearchTreeData, className: showLazySearchTreeData ? "" : "ztxk-tree--hidden", defaultExpandAll: true, expandedKeys: lazySearchExpandedKeys, autoExpandParent: lazySearchAutoExpandParent, onExpand: onExpand ? onExpand : lazySearchOnExpand, onCheck: onCheckHandle, onSelect: onSelectHandle, ref: lazyTreeRef }, resetProps))), jsx(Tree$1, __assign({}, expandProps, { treeData: treeData, loadData: loadData, className: showLazySearchTreeData ? "ztxk-tree--hidden" : "", style: treeStyle, onCheck: onCheckHandle, onSelect: onSelectHandle, ref: treeRef }, resetProps))] })));
67
73
  };
68
74
  var MemoTree = memo(forwardRef(Tree));
69
75
  MemoTree.displayName = "ZTXK_WEBUI_Tree";