zmdms-webui 3.5.2 → 3.5.4
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/es/applayout/index.css +1 -1
- package/dist/es/applayoutheader/setting/fullCom.js +5 -1
- package/dist/es/applayoutheader/setting/userInfo.js +9 -5
- package/dist/es/applayoutheader/setting/userInfoModal.js +18 -12
- package/dist/es/applayoutheader/setting/userPwdModal.js +19 -13
- package/dist/es/applayoutheader/tabs/index.js +10 -6
- package/dist/es/applayoutsider/menu/Logo.js +5 -1
- package/dist/es/applayoutsider/menu/SearchInput.js +6 -2
- package/dist/es/applayoutsider/menu/SubMenu.js +6 -2
- package/dist/es/asyncdynamicsetting/asyncDynamicDrawer.js +2 -0
- package/dist/es/asyncdynamicsetting/useAsyncDrawer.js +2 -0
- package/dist/es/button/button.js +4 -2
- package/dist/es/button/buttonDownload.js +6 -4
- package/dist/es/button/buttonExport.js +8 -4
- package/dist/es/button/buttonPreview.js +6 -3
- package/dist/es/canvastable/canvasTable.js +46 -29
- package/dist/es/canvastable/components/CanvasTableMenu.js +5 -1
- package/dist/es/canvastable/components/FilterPopover.js +15 -11
- package/dist/es/canvastable/hooks/useProcessedColumns.js +7 -2
- package/dist/es/canvastable/hooks/useSelectionSnapshot.js +115 -0
- package/dist/es/canvastable/hooks/useSummaryRow.js +6 -2
- package/dist/es/canvastable/hooks/useTableRender.js +5 -1
- package/dist/es/canvastable/interface.d.ts +29 -1
- package/dist/es/chatroom/chat-room.js +8 -3
- package/dist/es/config/i18n/en/appLayoutHeader.js +70 -0
- package/dist/es/config/i18n/en/appLayoutSider.js +14 -0
- package/dist/es/config/i18n/en/asyncDynamicSetting.js +42 -0
- package/dist/es/config/i18n/en/authLoading.js +6 -0
- package/dist/es/config/i18n/en/button.js +14 -0
- package/dist/es/config/i18n/en/canvasTable.js +50 -0
- package/dist/es/config/i18n/en/chatRoom.js +14 -0
- package/dist/es/config/i18n/en/datePicker.js +22 -0
- package/dist/es/config/i18n/en/detailList.js +6 -0
- package/dist/es/config/i18n/en/differences.js +6 -0
- package/dist/es/config/i18n/en/dynamicSetting.js +72 -0
- package/dist/es/config/i18n/en/electronSignatures.js +173 -0
- package/dist/es/config/i18n/en/enhanceSelect.js +8 -0
- package/dist/es/config/i18n/en/footer.js +8 -0
- package/dist/es/config/i18n/en/form.js +26 -0
- package/dist/es/config/i18n/en/formItem.js +8 -0
- package/dist/es/config/i18n/en/inputNumber.js +7 -0
- package/dist/es/config/i18n/en/login.js +76 -0
- package/dist/es/config/i18n/en/modal.js +8 -0
- package/dist/es/config/i18n/en/notAuthPage.js +8 -0
- package/dist/es/config/i18n/en/notRoutePage.js +8 -0
- package/dist/es/config/i18n/en/operationBtn.js +10 -0
- package/dist/es/config/i18n/en/print.js +16 -0
- package/dist/es/config/i18n/en/select.js +6 -0
- package/dist/es/config/i18n/en/table.js +65 -0
- package/dist/es/config/i18n/en/tabs.js +10 -0
- package/dist/es/config/i18n/en/translationButton.js +26 -0
- package/dist/es/config/i18n/en/tree.js +6 -0
- package/dist/es/config/i18n/en/uploadList.js +82 -0
- package/dist/es/config/i18n/en/ztTransfer.js +14 -0
- package/dist/es/config/i18n/en.js +65 -1
- package/dist/es/config/i18n/i18nInstance.js +33 -0
- package/dist/es/config/i18n/zh_cn/appLayoutHeader.js +70 -0
- package/dist/es/config/i18n/zh_cn/appLayoutSider.js +14 -0
- package/dist/es/config/i18n/zh_cn/asyncDynamicSetting.js +42 -0
- package/dist/es/config/i18n/zh_cn/authLoading.js +6 -0
- package/dist/es/config/i18n/zh_cn/button.js +14 -0
- package/dist/es/config/i18n/zh_cn/canvasTable.js +50 -0
- package/dist/es/config/i18n/zh_cn/chatRoom.js +14 -0
- package/dist/es/config/i18n/zh_cn/datePicker.js +22 -0
- package/dist/es/config/i18n/zh_cn/detailList.js +6 -0
- package/dist/es/config/i18n/zh_cn/differences.js +6 -0
- package/dist/es/config/i18n/zh_cn/dynamicSetting.js +72 -0
- package/dist/es/config/i18n/zh_cn/electronSignatures.js +342 -0
- package/dist/es/config/i18n/zh_cn/enhanceSelect.js +8 -0
- package/dist/es/config/i18n/zh_cn/footer.js +8 -0
- package/dist/es/config/i18n/zh_cn/form.js +26 -0
- package/dist/es/config/i18n/zh_cn/formItem.js +8 -0
- package/dist/es/config/i18n/zh_cn/inputNumber.js +7 -0
- package/dist/es/config/i18n/zh_cn/login.js +76 -0
- package/dist/es/config/i18n/zh_cn/modal.js +8 -0
- package/dist/es/config/i18n/zh_cn/notAuthPage.js +8 -0
- package/dist/es/config/i18n/zh_cn/notRoutePage.js +8 -0
- package/dist/es/config/i18n/zh_cn/operationBtn.js +10 -0
- package/dist/es/config/i18n/zh_cn/print.js +16 -0
- package/dist/es/config/i18n/zh_cn/select.js +6 -0
- package/dist/es/config/i18n/zh_cn/table.js +65 -0
- package/dist/es/config/i18n/zh_cn/tabs.js +10 -0
- package/dist/es/config/i18n/zh_cn/translationButton.js +26 -0
- package/dist/es/config/i18n/zh_cn/tree.js +6 -0
- package/dist/es/config/i18n/zh_cn/uploadList.js +82 -0
- package/dist/es/config/i18n/zh_cn/ztTransfer.js +14 -0
- package/dist/es/config/i18n/zh_cn.d.ts +538 -0
- package/dist/es/config/i18n/zh_cn.js +65 -1
- package/dist/es/config/index.js +1 -1
- package/dist/es/config/useLocale.d.ts +560 -0
- package/dist/es/config/useLocale.js +41 -8
- package/dist/es/datepicker/index.js +9 -3
- package/dist/es/datepicker/utils.js +32 -26
- package/dist/es/detaillist/item.js +7 -2
- package/dist/es/detaillist/list.js +2 -0
- package/dist/es/differences/differences.js +8 -1
- package/dist/es/dynamicsetting/dynamicDrawer.js +41 -24
- package/dist/es/dynamicsetting/hooks.js +2 -0
- package/dist/es/dynamicsetting/moreConfig.js +6 -2
- package/dist/es/dynamicsetting/useSearch.js +5 -1
- package/dist/es/dynamicsetting/useTemplate.js +19 -15
- package/dist/es/electronsignatures/content.js +52 -31
- package/dist/es/electronsignatures/filecomponents/file-upload.js +2 -0
- package/dist/es/electronsignatures/filecomponents/useFetchFileTypeData.js +2 -0
- package/dist/es/enhanceselect/enhance-select.js +7 -3
- package/dist/es/enhanceselect/list-query.js +2 -0
- package/dist/es/enhanceselect/page-query.js +2 -0
- package/dist/es/form/common-search-list.js +7 -2
- package/dist/es/form/form.js +9 -5
- package/dist/es/form/resetButton.js +16 -11
- package/dist/es/form/useCommonSearch.js +12 -9
- package/dist/es/formitem/formItem.js +4 -2
- package/dist/es/inputnumber/inputNumber.js +11 -2
- package/dist/es/inputnumber/utils.js +41 -8
- package/dist/es/login/forget-password.js +9 -5
- package/dist/es/login/index.js +12 -8
- package/dist/es/modal/modal.js +6 -2
- package/dist/es/operationbtn/operationBtn.js +5 -3
- package/dist/es/select/hooks.js +5 -1
- package/dist/es/table/components/ColumnAddDel.js +11 -5
- package/dist/es/table/components/EnhanceBodyCell.js +7 -5
- package/dist/es/table/components/FilterDropdown.js +7 -3
- package/dist/es/table/components/SortTitle.js +8 -4
- package/dist/es/table/components/TableMenu.js +5 -1
- package/dist/es/table/components/TitleOperation.js +5 -1
- package/dist/es/table/components/table-header-operation/FillDown.js +7 -3
- package/dist/es/table/excel.js +8 -4
- package/dist/es/table/hooks/useSelectSubtotal.js +8 -1
- package/dist/es/table/table.js +6 -4
- package/dist/es/table/useColumns.js +8 -4
- package/dist/es/table/useSummary.js +6 -2
- package/dist/es/table/useTableValidate.js +39 -7
- package/dist/es/table/utils.js +10 -5
- package/dist/es/tabs/tab-type.js +10 -1
- package/dist/es/title/title.js +2 -0
- package/dist/es/translationbutton/DownFile.js +8 -4
- package/dist/es/translationbutton/PreviewFile.js +5 -3
- package/dist/es/translationbutton/hooks.js +5 -1
- package/dist/es/translationbutton/translationButton.js +15 -12
- package/dist/es/tree/tree.js +8 -2
- package/dist/es/uploadlist/hooks.js +17 -11
- package/dist/es/uploadlist/uploadList.js +39 -26
- package/dist/es/uploadlist/uploadListDetail.js +15 -11
- package/dist/es/uploadlist/uploadTable.js +23 -19
- package/dist/es/uploadlist/utils.js +8 -1
- package/dist/es/zttransfer/Container.js +5 -1
- package/dist/es/zttransfer/SelectContainer.js +5 -1
- package/dist/es/zttransfer/zt-transfer.js +5 -1
- package/dist/index.build.d.ts +2 -1
- package/dist/index.dark.css +2 -2
- package/dist/index.default.css +2 -2
- package/dist/index.es.js +1 -0
- package/package.json +6 -3
|
@@ -2,8 +2,9 @@ import { __rest, __assign, __spreadArray, __awaiter, __generator } from '../_vir
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { createContext, memo, useRef, useMemo, useState, useEffect, useImperativeHandle } from 'react';
|
|
4
4
|
import { Button, Table } from 'antd';
|
|
5
|
-
import '../config/
|
|
5
|
+
import useLocale, { formatLocaleText } from '../config/useLocale.js';
|
|
6
6
|
import useBaseContext from '../config/useBaseContext.js';
|
|
7
|
+
import '../config/ZtxkContext.js';
|
|
7
8
|
import '../config/MyStorage.js';
|
|
8
9
|
import ElectronSignaturesFragment from './electron-signatures-fragment.js';
|
|
9
10
|
import { useMemoizedFn } from 'ahooks';
|
|
@@ -40,15 +41,16 @@ var ElectronSignaturesContext = createContext({
|
|
|
40
41
|
*/
|
|
41
42
|
var ElectronSignatures = function (props) {
|
|
42
43
|
var _a, _b, _c;
|
|
44
|
+
var locale = useLocale().ElectronSignatures;
|
|
43
45
|
var request = props.request, isTranslation = props.isTranslation, previewUrl = props.previewUrl, _d = props.isUnControlled, isUnControlled = _d === void 0 ? true : _d, _e = props.contractNumFlowIds, contractNumFlowIds = _e === void 0 ? FLOW_IDS : _e, fileUploadProps = props.fileUploadProps, isShowFileUpload = props.isShowFileUpload, isShowFileUploadIndependence = props.isShowFileUploadIndependence, otherOptions = props.otherOptions, _fileBaseUrl = props.fileBaseUrl, _apiBaseUrl = props.apiBaseUrl, electronHandleRef = props.electronHandleRef, _onValueChange = props.onValueChange, isValidateSuccess = props.isValidateSuccess, refreshCode = props.refreshCode, onCheckedComparison = props.onCheckedComparison, _onFileTypeChangeGetItem = props.onFileTypeChangeGetItem, tableScroll = props.tableScroll, _getCreateTimeHand = props.getCreateTimeHand, isShowElectronBatchBtn = props.isShowElectronBatchBtn, isShowDownloadBatchBtn = props.isShowDownloadBatchBtn, isShowBatchDeleteBtn = props.isShowBatchDeleteBtn, isShowBatchDeleteBtnIndependence = props.isShowBatchDeleteBtnIndependence, beforeBatchDelete = props.beforeBatchDelete, isShowBatchPreviewBtn = props.isShowBatchPreviewBtn, isShowFileComparisonBtn = props.isShowFileComparisonBtn, batchDownloadZipName = props.batchDownloadZipName, isShowDoubleSignedBatchBtn = props.isShowDoubleSignedBatchBtn, _f = props.isShowFileType, isShowFileType = _f === void 0 ? true : _f, _g = props.isShowFileTypeMerge, isShowFileTypeMerge = _g === void 0 ? true : _g,
|
|
44
46
|
// fmsIsElectronicSealLabel = '产业链综合服务平台-客户电子签章',
|
|
45
47
|
_h = props.fmsIsElectronicSealLabel,
|
|
46
48
|
// fmsIsElectronicSealLabel = '产业链综合服务平台-客户电子签章',
|
|
47
|
-
fmsIsElectronicSealLabel = _h === void 0 ?
|
|
49
|
+
fmsIsElectronicSealLabel = _h === void 0 ? locale.fmsSealLabel : _h,
|
|
48
50
|
// fmsIsElectronicSealPushLabel = '推送银行',
|
|
49
51
|
_j = props.fmsIsElectronicSealPushLabel,
|
|
50
52
|
// fmsIsElectronicSealPushLabel = '推送银行',
|
|
51
|
-
fmsIsElectronicSealPushLabel = _j === void 0 ?
|
|
53
|
+
fmsIsElectronicSealPushLabel = _j === void 0 ? locale.bankSealLabel : _j, _k = props.openingContractSealLabel, openingContractSealLabel = _k === void 0 ? locale.openingContractSealLabel : _k, isSingleQj = props.isSingleQj, _l = props.isQjUseModal, isQjUseModal = _l === void 0 ? true : _l, defaultJustNeedQj = props.defaultJustNeedQj, isDeleteAllFileWhenJustUseQj = props.isDeleteAllFileWhenJustUseQj, _m = props.isShowQysWhenNeedNotQys, isShowQysWhenNeedNotQys = _m === void 0 ? true : _m, _o = props.isControlNeedQys, isControlNeedQys = _o === void 0 ? true : _o, isDeletePlaceholderFileData = props.isDeletePlaceholderFileData, isSupportNoAttachQj = props.isSupportNoAttachQj, caseId = props.caseId, _p = props.isChoiseChangeTemplateValid, isChoiseChangeTemplateValid = _p === void 0 ? true : _p, _q = props.isToggleQys, isToggleQys = _q === void 0 ? false : _q, _r = props.isQjVerifyCode, isQjVerifyCode = _r === void 0 ? false : _r, _s = props.isNewQys, isNewQys = _s === void 0 ? false : _s, _t = props.isShowBatchUseElectronicSealBtn, isShowBatchUseElectronicSealBtn = _t === void 0 ? true : _t, isShowBatchUseOpeningContractSealBtn = props.isShowBatchUseOpeningContractSealBtn, isShowOpeningContractSeal = props.isShowOpeningContractSeal, customButtons = props.customButtons, goWorkflowSeal = props.goWorkflowSeal, isShowSealApply = props.isShowSealApply, otherColumns = props.otherColumns, isShowOpeningContractSealNotRelyQys = props.isShowOpeningContractSealNotRelyQys, isNoWatermarkProcess = props.isNoWatermarkProcess, qunjListRenderFilter = props.qunjListRenderFilter, resetProps = __rest(props, ["request", "isTranslation", "previewUrl", "isUnControlled", "contractNumFlowIds", "fileUploadProps", "isShowFileUpload", "isShowFileUploadIndependence", "otherOptions", "fileBaseUrl", "apiBaseUrl", "electronHandleRef", "onValueChange", "isValidateSuccess", "refreshCode", "onCheckedComparison", "onFileTypeChangeGetItem", "tableScroll", "getCreateTimeHand", "isShowElectronBatchBtn", "isShowDownloadBatchBtn", "isShowBatchDeleteBtn", "isShowBatchDeleteBtnIndependence", "beforeBatchDelete", "isShowBatchPreviewBtn", "isShowFileComparisonBtn", "batchDownloadZipName", "isShowDoubleSignedBatchBtn", "isShowFileType", "isShowFileTypeMerge", "fmsIsElectronicSealLabel", "fmsIsElectronicSealPushLabel", "openingContractSealLabel", "isSingleQj", "isQjUseModal", "defaultJustNeedQj", "isDeleteAllFileWhenJustUseQj", "isShowQysWhenNeedNotQys", "isControlNeedQys", "isDeletePlaceholderFileData", "isSupportNoAttachQj", "caseId", "isChoiseChangeTemplateValid", "isToggleQys", "isQjVerifyCode", "isNewQys", "isShowBatchUseElectronicSealBtn", "isShowBatchUseOpeningContractSealBtn", "isShowOpeningContractSeal", "customButtons", "goWorkflowSeal", "isShowSealApply", "otherColumns", "isShowOpeningContractSealNotRelyQys", "isNoWatermarkProcess", "qunjListRenderFilter"]);
|
|
52
54
|
var selectRows = useRef(null);
|
|
53
55
|
var onValueChange = useMemoizedFn(function (info) {
|
|
54
56
|
_onValueChange && _onValueChange(info);
|
|
@@ -92,11 +94,11 @@ var ElectronSignatures = function (props) {
|
|
|
92
94
|
resolve((_c = res.data.data) === null || _c === void 0 ? void 0 : _c.taskId);
|
|
93
95
|
}
|
|
94
96
|
else {
|
|
95
|
-
reject(
|
|
97
|
+
reject(locale.compareApiFail);
|
|
96
98
|
}
|
|
97
99
|
})
|
|
98
100
|
.catch(function (err) {
|
|
99
|
-
reject(err ||
|
|
101
|
+
reject(err || locale.compareApiFail);
|
|
100
102
|
});
|
|
101
103
|
}
|
|
102
104
|
});
|
|
@@ -302,7 +304,7 @@ var ElectronSignatures = function (props) {
|
|
|
302
304
|
// 组装columns
|
|
303
305
|
var columns = [
|
|
304
306
|
{
|
|
305
|
-
title:
|
|
307
|
+
title: locale.serialNumber,
|
|
306
308
|
dataIndex: "index",
|
|
307
309
|
key: "index",
|
|
308
310
|
width: 50,
|
|
@@ -441,7 +443,9 @@ var ElectronSignatures = function (props) {
|
|
|
441
443
|
: item.attachType === "001"));
|
|
442
444
|
});
|
|
443
445
|
if (isValidateAttachTypeIndex !== -1) {
|
|
444
|
-
msg =
|
|
446
|
+
msg = formatLocaleText(locale.needChooseTemplate, {
|
|
447
|
+
row: isValidateAttachTypeIndex + 1,
|
|
448
|
+
});
|
|
445
449
|
myMessage.warning(msg);
|
|
446
450
|
return [2 /*return*/, Promise.reject(msg)];
|
|
447
451
|
}
|
|
@@ -455,7 +459,9 @@ var ElectronSignatures = function (props) {
|
|
|
455
459
|
: item.attachType === "001"));
|
|
456
460
|
});
|
|
457
461
|
if (isValidateDgIndex !== -1) {
|
|
458
|
-
msg =
|
|
462
|
+
msg = formatLocaleText(locale.needStartCompare, {
|
|
463
|
+
row: isValidateDgIndex + 1,
|
|
464
|
+
});
|
|
459
465
|
myMessage.warning(msg);
|
|
460
466
|
return [2 /*return*/, Promise.reject(msg)];
|
|
461
467
|
}
|
|
@@ -464,7 +470,9 @@ var ElectronSignatures = function (props) {
|
|
|
464
470
|
});
|
|
465
471
|
if (resetProps.isAllowedPatchFileType &&
|
|
466
472
|
isValidateAttachType !== -1) {
|
|
467
|
-
msg =
|
|
473
|
+
msg = formatLocaleText(locale.needChooseAttachType, {
|
|
474
|
+
row: isValidateAttachType + 1,
|
|
475
|
+
});
|
|
468
476
|
myMessage.warning(msg);
|
|
469
477
|
return [2 /*return*/, Promise.reject(msg)];
|
|
470
478
|
}
|
|
@@ -477,10 +485,10 @@ var ElectronSignatures = function (props) {
|
|
|
477
485
|
preElectronicSealIdList &&
|
|
478
486
|
electronicSealIdList.length !== (preElectronicSealIdList === null || preElectronicSealIdList === void 0 ? void 0 : preElectronicSealIdList.length)) {
|
|
479
487
|
ModalComponent.confirm({
|
|
480
|
-
title:
|
|
481
|
-
okText:
|
|
488
|
+
title: locale.sealDiffConfirm,
|
|
489
|
+
okText: locale.yesText,
|
|
482
490
|
okType: "danger",
|
|
483
|
-
cancelText:
|
|
491
|
+
cancelText: locale.noText,
|
|
484
492
|
onOk: function () {
|
|
485
493
|
isClickElectronSureRef.current = true;
|
|
486
494
|
},
|
|
@@ -488,7 +496,7 @@ var ElectronSignatures = function (props) {
|
|
|
488
496
|
isClickElectronSureRef.current = false;
|
|
489
497
|
},
|
|
490
498
|
});
|
|
491
|
-
return [2 /*return*/, Promise.reject(
|
|
499
|
+
return [2 /*return*/, Promise.reject(locale.sealDiffConfirm)];
|
|
492
500
|
}
|
|
493
501
|
// 2. 给附件勾选了加盖电子印章 但是未选择电子印章列表
|
|
494
502
|
if (isEdit &&
|
|
@@ -496,7 +504,7 @@ var ElectronSignatures = function (props) {
|
|
|
496
504
|
electronicSealIdList.length === 0 &&
|
|
497
505
|
hasElectronicSeal &&
|
|
498
506
|
!isOnlyQj) {
|
|
499
|
-
msg =
|
|
507
|
+
msg = locale.needCheckSealList;
|
|
500
508
|
myMessage.warning(msg);
|
|
501
509
|
return [2 /*return*/, Promise.reject(msg)];
|
|
502
510
|
}
|
|
@@ -517,8 +525,8 @@ var ElectronSignatures = function (props) {
|
|
|
517
525
|
}
|
|
518
526
|
});
|
|
519
527
|
if (!isEqual(electronicSealFileList.sort(), electronicSealedFileList_1.sort())) {
|
|
520
|
-
myMessage.warning(
|
|
521
|
-
return [2 /*return*/, Promise.reject(
|
|
528
|
+
myMessage.warning(locale.sealInfoChanged);
|
|
529
|
+
return [2 /*return*/, Promise.reject(locale.sealInfoChanged)];
|
|
522
530
|
}
|
|
523
531
|
}
|
|
524
532
|
// 3. 群杰超过4倍 禁止提交审批
|
|
@@ -539,7 +547,9 @@ var ElectronSignatures = function (props) {
|
|
|
539
547
|
return false;
|
|
540
548
|
});
|
|
541
549
|
if (isMoreQunjCountIndex !== -1) {
|
|
542
|
-
msg =
|
|
550
|
+
msg = formatLocaleText(locale.qunjCountOverRowLimit, {
|
|
551
|
+
row: isMoreQunjCountIndex + 1,
|
|
552
|
+
});
|
|
543
553
|
myMessage.warning(msg);
|
|
544
554
|
return [2 /*return*/, Promise.reject(msg)];
|
|
545
555
|
}
|
|
@@ -548,7 +558,7 @@ var ElectronSignatures = function (props) {
|
|
|
548
558
|
if (!isSingleQj) {
|
|
549
559
|
isMoreQunjCount = countIsValidate(qunjSeal, false);
|
|
550
560
|
if (!isMoreQunjCount) {
|
|
551
|
-
msg =
|
|
561
|
+
msg = locale.qunjCountOverLimit;
|
|
552
562
|
myMessage.warning(msg);
|
|
553
563
|
return [2 /*return*/, Promise.reject(msg)];
|
|
554
564
|
}
|
|
@@ -579,13 +589,15 @@ var ElectronSignatures = function (props) {
|
|
|
579
589
|
return false;
|
|
580
590
|
});
|
|
581
591
|
if (isCheckTakeOutNoAddressIndex !== -1) {
|
|
582
|
-
msg =
|
|
592
|
+
msg = formatLocaleText(locale.takeOutNoAddressRow, {
|
|
593
|
+
row: isCheckTakeOutNoAddressIndex + 1,
|
|
594
|
+
});
|
|
583
595
|
myMessage.warning(msg);
|
|
584
596
|
return [2 /*return*/, Promise.reject(msg)];
|
|
585
597
|
}
|
|
586
598
|
}
|
|
587
599
|
else if (isCheckTakeOutNoAddress(submitData)) {
|
|
588
|
-
msg =
|
|
600
|
+
msg = locale.takeOutNoAddress;
|
|
589
601
|
myMessage.warning(msg);
|
|
590
602
|
return [2 /*return*/, Promise.reject(msg)];
|
|
591
603
|
}
|
|
@@ -596,7 +608,7 @@ var ElectronSignatures = function (props) {
|
|
|
596
608
|
hasElectronicSeal &&
|
|
597
609
|
!contractId &&
|
|
598
610
|
!isOnlyQj) {
|
|
599
|
-
msg =
|
|
611
|
+
msg = locale.needAppointSign;
|
|
600
612
|
myMessage.warning(msg);
|
|
601
613
|
return [2 /*return*/, Promise.reject(msg)];
|
|
602
614
|
}
|
|
@@ -619,7 +631,9 @@ var ElectronSignatures = function (props) {
|
|
|
619
631
|
return false;
|
|
620
632
|
});
|
|
621
633
|
if (hasNoWritContranctNum !== -1) {
|
|
622
|
-
msg =
|
|
634
|
+
msg = formatLocaleText(locale.qunjContractNumMissingRow, {
|
|
635
|
+
row: hasNoWritContranctNum + 1,
|
|
636
|
+
});
|
|
623
637
|
myMessage.warning(msg);
|
|
624
638
|
return [2 /*return*/, Promise.reject(msg)];
|
|
625
639
|
}
|
|
@@ -639,7 +653,9 @@ var ElectronSignatures = function (props) {
|
|
|
639
653
|
return false;
|
|
640
654
|
});
|
|
641
655
|
if (hasNoCheckedQjSeal !== -1) {
|
|
642
|
-
msg =
|
|
656
|
+
msg = formatLocaleText(locale.qunjNoSealRow, {
|
|
657
|
+
row: hasNoCheckedQjSeal + 1,
|
|
658
|
+
});
|
|
643
659
|
myMessage.warning(msg);
|
|
644
660
|
return [2 /*return*/, Promise.reject(msg)];
|
|
645
661
|
}
|
|
@@ -663,7 +679,10 @@ var ElectronSignatures = function (props) {
|
|
|
663
679
|
return false;
|
|
664
680
|
});
|
|
665
681
|
if (hasNoNumCheckedQjSeal !== -1) {
|
|
666
|
-
msg =
|
|
682
|
+
msg = formatLocaleText(locale.qunjNoSealCountRow, {
|
|
683
|
+
row: hasNoNumCheckedQjSeal + 1,
|
|
684
|
+
name: noNumSealName_1,
|
|
685
|
+
});
|
|
667
686
|
myMessage.warning(msg);
|
|
668
687
|
return [2 /*return*/, Promise.reject(msg)];
|
|
669
688
|
}
|
|
@@ -676,23 +695,25 @@ var ElectronSignatures = function (props) {
|
|
|
676
695
|
((_j = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _j === void 0 ? void 0 : _j.length) > 0) {
|
|
677
696
|
// 合同份数为空
|
|
678
697
|
if (isContranctNum && !qunjSeal.contranctNum) {
|
|
679
|
-
myMessage.warning(
|
|
680
|
-
return [2 /*return*/, Promise.reject(
|
|
698
|
+
myMessage.warning(locale.fillContractNum);
|
|
699
|
+
return [2 /*return*/, Promise.reject(locale.fillContractNum)];
|
|
681
700
|
}
|
|
682
701
|
// 勾选了群杰印章 没有填用印次数
|
|
683
702
|
if (((_k = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _k === void 0 ? void 0 : _k.length) > 0) {
|
|
684
703
|
qunjSeal.details.forEach(function (item) {
|
|
685
704
|
if (!item.sealCount) {
|
|
686
|
-
myMessage.warning(
|
|
705
|
+
myMessage.warning(formatLocaleText(locale.fillSealCount, {
|
|
706
|
+
name: item.sealName,
|
|
707
|
+
}));
|
|
687
708
|
}
|
|
688
709
|
});
|
|
689
710
|
if (qunjSeal.details.filter(function (item) { return !item.sealCount; }).length >
|
|
690
711
|
0) {
|
|
691
|
-
return [2 /*return*/, Promise.reject(
|
|
712
|
+
return [2 /*return*/, Promise.reject(locale.fillSealCounts)];
|
|
692
713
|
}
|
|
693
714
|
}
|
|
694
715
|
else {
|
|
695
|
-
msg =
|
|
716
|
+
msg = locale.selectQunjSeal;
|
|
696
717
|
myMessage.warning(msg);
|
|
697
718
|
return [2 /*return*/, Promise.reject(msg)];
|
|
698
719
|
}
|
|
@@ -705,7 +726,7 @@ var ElectronSignatures = function (props) {
|
|
|
705
726
|
electronicSealIdList.length > 0) {
|
|
706
727
|
setLoading({
|
|
707
728
|
spinning: true,
|
|
708
|
-
tip:
|
|
729
|
+
tip: locale.serverValidating,
|
|
709
730
|
});
|
|
710
731
|
// 调用接口
|
|
711
732
|
return [2 /*return*/, getNoSealInfoList({
|
|
@@ -727,7 +748,7 @@ var ElectronSignatures = function (props) {
|
|
|
727
748
|
modalHandleRef.current.setInfo(true, {
|
|
728
749
|
unSealList: res,
|
|
729
750
|
});
|
|
730
|
-
return Promise.reject(
|
|
751
|
+
return Promise.reject(locale.sealUnverified);
|
|
731
752
|
}
|
|
732
753
|
else {
|
|
733
754
|
return Promise.resolve(true);
|
|
@@ -2,7 +2,9 @@ import { __assign } from '../../_virtual/_tslib.js';
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { memo, useState, useCallback, useMemo } from 'react';
|
|
4
4
|
import { Upload } from 'antd';
|
|
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 { useLatest } from 'ahooks';
|
|
@@ -3,6 +3,9 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { memo, forwardRef } from 'react';
|
|
4
4
|
import MemoListQuery from './list-query.js';
|
|
5
5
|
import MemoPageQuery from './page-query.js';
|
|
6
|
+
import useLocale from '../config/useLocale.js';
|
|
7
|
+
import '../config/ZtxkContext.js';
|
|
8
|
+
import '../config/MyStorage.js';
|
|
6
9
|
import MemoSelect from '../select/select.js';
|
|
7
10
|
import ButtonCom from '../button/button.js';
|
|
8
11
|
|
|
@@ -13,17 +16,18 @@ import ButtonCom from '../button/button.js';
|
|
|
13
16
|
*/
|
|
14
17
|
var EnhanceSelect = function (props, ref) {
|
|
15
18
|
var isPage = props.isPage; props.request; props.url; props.params; props.method; props.timeout; props.isCache; props.transformData; props.firstLoadDataKey; props.pageSize; props.remoteSearchKey; props.mustQueryKeys; var resetProps = __rest(props, ["isPage", "request", "url", "params", "method", "timeout", "isCache", "transformData", "firstLoadDataKey", "pageSize", "remoteSearchKey", "mustQueryKeys"]);
|
|
19
|
+
var locale = useLocale().EnhanceSelect;
|
|
16
20
|
return !isPage ? (jsx(MemoListQuery, __assign({}, props, { customRender: function (_a) {
|
|
17
21
|
var list = _a.list, isLoading = _a.isLoading, refetch = _a.refetch, isEnabled = _a.isEnabled;
|
|
18
|
-
return (jsx(MemoSelect, __assign({ placeholder:
|
|
22
|
+
return (jsx(MemoSelect, __assign({ placeholder: locale.placeholder, list: list, loading: isLoading, dropdownButton: jsx(ButtonCom, __assign({ onClick: function () {
|
|
19
23
|
if (!isEnabled()) {
|
|
20
24
|
return;
|
|
21
25
|
}
|
|
22
26
|
refetch();
|
|
23
|
-
} }, { children:
|
|
27
|
+
} }, { children: locale.refreshData })), ref: ref }, resetProps)));
|
|
24
28
|
} }))) : (jsx(MemoPageQuery, __assign({}, props, { customRender: function (_a) {
|
|
25
29
|
var list = _a.list, isLoading = _a.isLoading, hasNextPage = _a.hasNextPage, fetchNextPage = _a.fetchNextPage, onSearchHandle = _a.onSearchHandle, onBlurHandle = _a.onBlurHandle, onClearHandle = _a.onClearHandle;
|
|
26
|
-
return (jsx(MemoSelect, __assign({ placeholder:
|
|
30
|
+
return (jsx(MemoSelect, __assign({ placeholder: locale.placeholder, list: list, loading: isLoading, ref: ref, isRemoteSearch: true }, resetProps, { onPopupScroll: function (e) {
|
|
27
31
|
var target = e.target;
|
|
28
32
|
if (target.scrollTop + target.offsetHeight >=
|
|
29
33
|
target.scrollHeight - 100) {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { __awaiter, __generator } from '../_virtual/_tslib.js';
|
|
2
2
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { memo } from 'react';
|
|
4
|
+
import 'react-i18next';
|
|
4
5
|
import '../config/ZtxkContext.js';
|
|
6
|
+
import '../config/i18n/i18nInstance.js';
|
|
5
7
|
import useBaseContext from '../config/useBaseContext.js';
|
|
6
8
|
import '../config/MyStorage.js';
|
|
7
9
|
import { useQuery } from '@tanstack/react-query';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { __assign, __awaiter, __generator } from '../_virtual/_tslib.js';
|
|
2
2
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { memo, useMemo, useState, useRef } from 'react';
|
|
4
|
+
import 'react-i18next';
|
|
4
5
|
import '../config/ZtxkContext.js';
|
|
6
|
+
import '../config/i18n/i18nInstance.js';
|
|
5
7
|
import useBaseContext from '../config/useBaseContext.js';
|
|
6
8
|
import '../config/MyStorage.js';
|
|
7
9
|
import { useInfiniteQuery } from '@tanstack/react-query';
|
|
@@ -2,6 +2,10 @@ import { __assign } from '../_virtual/_tslib.js';
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useMemoizedFn } from 'ahooks';
|
|
4
4
|
import update from '../node_modules/immutability-helper/index.js';
|
|
5
|
+
import useLocale from '../config/useLocale.js';
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../config/ZtxkContext.js';
|
|
8
|
+
import '../config/MyStorage.js';
|
|
5
9
|
import Sortable from '../sortable/sortable.js';
|
|
6
10
|
import ButtonCom from '../button/button.js';
|
|
7
11
|
import DeleteOutlined from '../node_modules/@ant-design/icons/es/icons/DeleteOutlined.js';
|
|
@@ -10,6 +14,7 @@ import { Popconfirm } from 'antd';
|
|
|
10
14
|
var sortableType = Symbol("commonSearchList");
|
|
11
15
|
var CommonSearchList = function (props) {
|
|
12
16
|
var commonSearchList = props.commonSearchList, currentCommonSearchKey = props.currentCommonSearchKey, setCurrentCommonSearchKey = props.setCurrentCommonSearchKey, form = props.form, reTransformData = props.reTransformData, deleteData = props.deleteData, setReplaceData = props.setReplaceData, updateServerData = props.updateServerData, onSearchHandle = props.onSearchHandle, dynamicKey = props.dynamicKey, dynamicSettingRef = props.dynamicSettingRef;
|
|
17
|
+
var locale = useLocale().Form;
|
|
13
18
|
var onMoveItem = useMemoizedFn(function (dragIndex, hoverIndex) {
|
|
14
19
|
// 由于对于固定列,不能进行拖拽排序,所以需要找出所有包含固定列的属性出来
|
|
15
20
|
var dragCard = commonSearchList[dragIndex];
|
|
@@ -59,10 +64,10 @@ var CommonSearchList = function (props) {
|
|
|
59
64
|
var deleteItem = function (index) {
|
|
60
65
|
deleteData === null || deleteData === void 0 ? void 0 : deleteData(index);
|
|
61
66
|
};
|
|
62
|
-
return (commonSearchList === null || commonSearchList === void 0 ? void 0 : commonSearchList.length) ? (jsxs("div", __assign({ className: "common-search-list--container" }, { children: [jsx("div", __assign({ className: "common-search-list--title" }, { children:
|
|
67
|
+
return (commonSearchList === null || commonSearchList === void 0 ? void 0 : commonSearchList.length) ? (jsxs("div", __assign({ className: "common-search-list--container" }, { children: [jsx("div", __assign({ className: "common-search-list--title" }, { children: locale.commonSearch })), jsx("div", __assign({ className: "common-search-list--content" }, { children: jsx(Sortable, { children: commonSearchList.map(function (item, index) {
|
|
63
68
|
return (jsx(Sortable.Item, __assign({ id: item.key, title: item.title, onMoveItem: onMoveItem, onMoveEnd: onMoveEnd, index: index, type: sortableType, direction: "horizontal" }, { children: jsxs(ButtonCom, __assign({ type: currentCommonSearchKey === item.key ? "default" : undefined, isWhite: currentCommonSearchKey === item.key ? false : true, onClick: function () {
|
|
64
69
|
handleClick(item);
|
|
65
|
-
} }, { children: [item.title, jsx(Popconfirm, __assign({ title:
|
|
70
|
+
} }, { children: [item.title, jsx(Popconfirm, __assign({ title: locale.confirmDelete, onConfirm: function (e) {
|
|
66
71
|
var _a, _b;
|
|
67
72
|
(_a = e === null || e === void 0 ? void 0 : e.preventDefault) === null || _a === void 0 ? void 0 : _a.call(e);
|
|
68
73
|
(_b = e === null || e === void 0 ? void 0 : e.stopPropagation) === null || _b === void 0 ? void 0 : _b.call(e);
|
package/dist/es/form/form.js
CHANGED
|
@@ -9,8 +9,9 @@ import ResetButton from './resetButton.js';
|
|
|
9
9
|
import DefaultDom from './detaultDom.js';
|
|
10
10
|
import ItemTipDom from './itemTipDom.js';
|
|
11
11
|
import Toggle from './toggle.js';
|
|
12
|
-
import '../config/
|
|
12
|
+
import useLocale from '../config/useLocale.js';
|
|
13
13
|
import useBaseContext from '../config/useBaseContext.js';
|
|
14
|
+
import '../config/ZtxkContext.js';
|
|
14
15
|
import '../config/MyStorage.js';
|
|
15
16
|
import { getFinalValue } from '../config/utils.js';
|
|
16
17
|
import CommonSearchList from './common-search-list.js';
|
|
@@ -31,6 +32,7 @@ var FormContext = createContext({});
|
|
|
31
32
|
var Form = function (props, ref) {
|
|
32
33
|
var form = props.form, bottomBorder = props.bottomBorder, _a = props.isFlex, isFlex = _a === void 0 ? true : _a, wrapClassName = props.wrapClassName, leftClassName = props.leftClassName; props.itemClassName; var rightWrapVisible = props.rightWrapVisible, rightClassName = props.rightClassName, children = props.children, dynamicKey = props.dynamicKey, dynamicVersion = props.dynamicVersion, formPreferences = props.formPreferences, items = props.items, outsideState = props.outsideState, onValuesChange = props.onValuesChange, isResetAndClear = props.isResetAndClear, onResetHandle = props.onResetHandle, onSearchHandle = props.onSearchHandle, type = props.type, directionColumn = props.directionColumn, isToggle = props.isToggle, toggleNum = props.toggleNum, defaultToggle = props.defaultToggle, isCommonSearch = props.isCommonSearch, isNewFormLayout = props.isNewFormLayout, restProps = __rest(props, ["form", "bottomBorder", "isFlex", "wrapClassName", "leftClassName", "itemClassName", "rightWrapVisible", "rightClassName", "children", "dynamicKey", "dynamicVersion", "formPreferences", "items", "outsideState", "onValuesChange", "isResetAndClear", "onResetHandle", "onSearchHandle", "type", "directionColumn", "isToggle", "toggleNum", "defaultToggle", "isCommonSearch", "isNewFormLayout"]);
|
|
33
34
|
var _b = useBaseContext(), enableCommonSearch = _b.enableCommonSearch, enableNewFormLayout = _b.enableNewFormLayout, isUIWeeklyReview = _b.isUIWeeklyReview;
|
|
35
|
+
var locale = useLocale().Form;
|
|
34
36
|
// 是否开启常用搜索
|
|
35
37
|
// 如果全局开启了默认添加,那么只要没有单独配置关闭,都认为需要打开
|
|
36
38
|
var isCommonSearchEnabled = rightWrapVisible && getFinalValue(enableCommonSearch, isCommonSearch);
|
|
@@ -189,13 +191,15 @@ var Form = function (props, ref) {
|
|
|
189
191
|
setToggleHandle: setToggleHandle,
|
|
190
192
|
};
|
|
191
193
|
});
|
|
192
|
-
var resetButtonComponent = isResetAndClear ? (jsx(ResetButton, { onClick: onDropdownResetHandleInner })) : (jsx(ButtonCom, __assign({ type: "default", onClick: onResetHandleInner }, { children:
|
|
193
|
-
return (jsxs(FormContext.Provider, __assign({ value: { onSearch: onSearchHandleInner } }, { children: [jsxs(Form$1, __assign({ form: form, onValuesChange: onValuesChangeHandle }, restProps, { className: wrapClasses }, { children: [jsx("div", __assign({ className: leftClasses, ref: leftWrapRef }, { children: items ? (jsx(FormItems, { items: dynamicKey ? newItems : configInfoItems, outsideState: outsideState })) : (children) })), jsxs("div", __assign({ className: "ztxk-form--operation" }, { children: [dynamicKey ? (jsx(DynamicSetting, { dynamicKey: dynamicKey, parentDynamicKey: FORM_DYNAMIC_KEY, defaultList: dynamicList, onCurrentListChange: onCurrentListChange, ref: dynamicSettingRef, hiddenOperationIcon: isNewFormLayoutEnabled })) : null, isToggle ? (jsx(Toggle, { style: { marginTop: isNewFormLayoutEnabled ? 0 : "4px" }, toggle: toggle, onClick: onToggleChange })) : null] })), rightWrapVisible ? (jsxs("div", __assign({ className: rightClasses }, { children: [jsxs("div", __assign({ className: "ztxk-form__right--common-left" }, { children: [resetButtonComponent, jsx(ButtonCom, __assign({ type: "primary", onClick: onSearchHandleInner }, { children:
|
|
194
|
+
var resetButtonComponent = isResetAndClear ? (jsx(ResetButton, { onClick: onDropdownResetHandleInner })) : (jsx(ButtonCom, __assign({ type: "default", onClick: onResetHandleInner }, { children: locale.reset })));
|
|
195
|
+
return (jsxs(FormContext.Provider, __assign({ value: { onSearch: onSearchHandleInner } }, { children: [jsxs(Form$1, __assign({ form: form, onValuesChange: onValuesChangeHandle }, restProps, { className: wrapClasses }, { children: [jsx("div", __assign({ className: leftClasses, ref: leftWrapRef }, { children: items ? (jsx(FormItems, { items: dynamicKey ? newItems : configInfoItems, outsideState: outsideState })) : (children) })), jsxs("div", __assign({ className: "ztxk-form--operation" }, { children: [dynamicKey ? (jsx(DynamicSetting, { dynamicKey: dynamicKey, parentDynamicKey: FORM_DYNAMIC_KEY, defaultList: dynamicList, onCurrentListChange: onCurrentListChange, ref: dynamicSettingRef, hiddenOperationIcon: isNewFormLayoutEnabled })) : null, isToggle ? (jsx(Toggle, { style: { marginTop: isNewFormLayoutEnabled ? 0 : "4px" }, toggle: toggle, onClick: onToggleChange })) : null] })), rightWrapVisible ? (jsxs("div", __assign({ className: rightClasses }, { children: [jsxs("div", __assign({ className: "ztxk-form__right--common-left" }, { children: [resetButtonComponent, jsx(ButtonCom, __assign({ type: "primary", onClick: onSearchHandleInner }, { children: locale.search }))] })), isCommonSearchEnabled || isNewFormLayoutEnabled ? (jsxs("div", __assign({ className: classNames("ztxk-form__right--common-right", {
|
|
194
196
|
"ztxk-form__right--common-right--new-layout": isNewFormLayoutEnabled,
|
|
195
|
-
}) }, { children: [isNewFormLayoutEnabled && dynamicKey ? (jsx(ButtonCom, __assign({ type: "default", onClick: function () { var _a; return (_a = dynamicSettingRef.current) === null || _a === void 0 ? void 0 : _a.setVisible(true); } }, { children:
|
|
197
|
+
}) }, { children: [isNewFormLayoutEnabled && dynamicKey ? (jsx(ButtonCom, __assign({ type: "default", onClick: function () { var _a; return (_a = dynamicSettingRef.current) === null || _a === void 0 ? void 0 : _a.setVisible(true); } }, { children: locale.customize }))) : null, isCommonSearchEnabled ? (jsx(ButtonCom, __assign({ style: {
|
|
196
198
|
width: "100%",
|
|
197
199
|
marginLeft: isNewFormLayoutEnabled && dynamicKey ? 10 : 0,
|
|
198
|
-
}, onClick: onCommonSearchHandle }, { children: isNewFormLayoutEnabled
|
|
200
|
+
}, onClick: onCommonSearchHandle }, { children: isNewFormLayoutEnabled
|
|
201
|
+
? locale.commonSearch
|
|
202
|
+
: locale.saveCommonSearch }))) : null] }))) : null] }))) : null] })), isCommonSearchEnabled ? (jsx(CommonSearchList, { commonSearchList: commonSearchList, setCommonSearchList: setCommonSearchList, currentCommonSearchKey: currentCommonSearchKey, setCurrentCommonSearchKey: setCurrentCommonSearchKey, form: form, reTransformData: reTransformData, deleteData: deleteData, setReplaceData: setReplaceData, updateServerData: updateServerData, onSearchHandle: onSearchHandleInner, dynamicSettingRef: dynamicSettingRef, dynamicKey: dynamicKey })) : null] })));
|
|
199
203
|
};
|
|
200
204
|
var MemoForm = memo(forwardRef(Form));
|
|
201
205
|
MemoForm.displayName = "ZTXK_WEBUI_Form";
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import { __assign } from '../_virtual/_tslib.js';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
+
import useLocale from '../config/useLocale.js';
|
|
5
|
+
import '../config/ZtxkContext.js';
|
|
6
|
+
import '../config/MyStorage.js';
|
|
4
7
|
import MoreOutlined from '../node_modules/@ant-design/icons/es/icons/MoreOutlined.js';
|
|
5
8
|
import { Dropdown } from 'antd';
|
|
6
9
|
|
|
7
|
-
var items = [
|
|
8
|
-
{
|
|
9
|
-
key: "reset",
|
|
10
|
-
label: "重置",
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
key: "clear",
|
|
14
|
-
label: "清除",
|
|
15
|
-
},
|
|
16
|
-
];
|
|
17
10
|
var ResetButton = function (_a) {
|
|
18
11
|
var onClick = _a.onClick;
|
|
12
|
+
var locale = useLocale().Form;
|
|
19
13
|
var _b = useState("reset"), resetType = _b[0], setResetType = _b[1];
|
|
14
|
+
// 菜单选项在组件内构建,以便响应语言切换
|
|
15
|
+
var items = [
|
|
16
|
+
{
|
|
17
|
+
key: "reset",
|
|
18
|
+
label: locale.reset,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: "clear",
|
|
22
|
+
label: locale.clear,
|
|
23
|
+
},
|
|
24
|
+
];
|
|
20
25
|
var onMenuClick = function (e) {
|
|
21
26
|
setResetType(e.key);
|
|
22
27
|
onClick && onClick(e.key);
|
|
@@ -24,7 +29,7 @@ var ResetButton = function (_a) {
|
|
|
24
29
|
var onButtonClick = function (e) {
|
|
25
30
|
onClick && onClick(resetType);
|
|
26
31
|
};
|
|
27
|
-
return (jsxs(Dropdown.Button, __assign({ menu: { items: items, onClick: onMenuClick }, onClick: onButtonClick, type: "default", className: "zt-btn-dropdown--default", icon: jsx(MoreOutlined, {}) }, { children: [resetType === "reset" ?
|
|
32
|
+
return (jsxs(Dropdown.Button, __assign({ menu: { items: items, onClick: onMenuClick }, onClick: onButtonClick, type: "default", className: "zt-btn-dropdown--default", icon: jsx(MoreOutlined, {}) }, { children: [resetType === "reset" ? locale.reset : locale.clear, jsx("span", {})] })));
|
|
28
33
|
};
|
|
29
34
|
|
|
30
35
|
export { ResetButton as default };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef, useState, useImperativeHandle, useRef, useEffect } from 'react';
|
|
4
|
-
import '../config/
|
|
4
|
+
import useLocale from '../config/useLocale.js';
|
|
5
5
|
import useBaseContext from '../config/useBaseContext.js';
|
|
6
|
+
import '../config/ZtxkContext.js';
|
|
6
7
|
import MyStorage from '../config/MyStorage.js';
|
|
7
8
|
import { useMount } from 'ahooks';
|
|
8
9
|
import dayjs from 'dayjs';
|
|
@@ -213,6 +214,7 @@ function useCommonSearch(options) {
|
|
|
213
214
|
function useCommonSearchModal(options) {
|
|
214
215
|
var commonSearchList = options.commonSearchList, currentCommonSearchKey = options.currentCommonSearchKey, form = options.form, setData = options.setData, isCommonSearchEnabled = options.isCommonSearchEnabled, setCurrentCommonSearchKey = options.setCurrentCommonSearchKey, currentDynamicList = options.currentDynamicList;
|
|
215
216
|
var iptRef = useRef(null);
|
|
217
|
+
var locale = useLocale().Form;
|
|
216
218
|
useEffect(function () {
|
|
217
219
|
var _a;
|
|
218
220
|
if (!isCommonSearchEnabled) {
|
|
@@ -231,13 +233,13 @@ function useCommonSearchModal(options) {
|
|
|
231
233
|
*/
|
|
232
234
|
var onCommonSearchHandle = function () {
|
|
233
235
|
if (!form) {
|
|
234
|
-
myMessage.info(
|
|
236
|
+
myMessage.info(locale.needFormInstance);
|
|
235
237
|
return;
|
|
236
238
|
}
|
|
237
239
|
ModalComponent.confirm({
|
|
238
240
|
icon: null,
|
|
239
241
|
// title: currentCommonSearchKey ? "更新常用搜索" : "保存为常用搜索",
|
|
240
|
-
title:
|
|
242
|
+
title: locale.saveCommonSearch,
|
|
241
243
|
content: jsx(MyInput, { ref: iptRef }),
|
|
242
244
|
onOk: function () {
|
|
243
245
|
var _a, _b;
|
|
@@ -248,8 +250,8 @@ function useCommonSearchModal(options) {
|
|
|
248
250
|
case 0:
|
|
249
251
|
currentCommonName = (_a = iptRef.current) === null || _a === void 0 ? void 0 : _a.getValue();
|
|
250
252
|
if (!currentCommonName) {
|
|
251
|
-
myMessage.info(
|
|
252
|
-
return [2 /*return*/, Promise.reject(new Error(
|
|
253
|
+
myMessage.info(locale.inputNamePlaceholder);
|
|
254
|
+
return [2 /*return*/, Promise.reject(new Error(locale.inputNamePlaceholder))];
|
|
253
255
|
}
|
|
254
256
|
currentData = form.getFieldsValue();
|
|
255
257
|
console.log("当前表单数据", currentData);
|
|
@@ -267,13 +269,13 @@ function useCommonSearchModal(options) {
|
|
|
267
269
|
case 2:
|
|
268
270
|
_c.sent();
|
|
269
271
|
setCurrentCommonSearchKey === null || setCurrentCommonSearchKey === void 0 ? void 0 : setCurrentCommonSearchKey(data.key);
|
|
270
|
-
myMessage.info(
|
|
272
|
+
myMessage.info(locale.saveSuccess);
|
|
271
273
|
(_b = iptRef.current) === null || _b === void 0 ? void 0 : _b.setValue("");
|
|
272
274
|
return [3 /*break*/, 4];
|
|
273
275
|
case 3:
|
|
274
276
|
_c.sent();
|
|
275
|
-
myMessage.info(
|
|
276
|
-
return [2 /*return*/, Promise.reject(new Error(
|
|
277
|
+
myMessage.info(locale.saveFailed);
|
|
278
|
+
return [2 /*return*/, Promise.reject(new Error(locale.saveFailed))];
|
|
277
279
|
case 4: return [2 /*return*/];
|
|
278
280
|
}
|
|
279
281
|
});
|
|
@@ -299,6 +301,7 @@ function useCommonSearchModal(options) {
|
|
|
299
301
|
};
|
|
300
302
|
}
|
|
301
303
|
var MyInput = forwardRef(function (props, ref) {
|
|
304
|
+
var locale = useLocale().Form;
|
|
302
305
|
var _a = useState(""), value = _a[0], setValue = _a[1];
|
|
303
306
|
var onChange = function (e) {
|
|
304
307
|
setValue(e.target.value);
|
|
@@ -307,7 +310,7 @@ var MyInput = forwardRef(function (props, ref) {
|
|
|
307
310
|
getValue: function () { return value; },
|
|
308
311
|
setValue: setValue,
|
|
309
312
|
}); });
|
|
310
|
-
return (jsx(Input, { placeholder:
|
|
313
|
+
return (jsx(Input, { placeholder: locale.inputNamePlaceholder, value: value, onChange: onChange }));
|
|
311
314
|
});
|
|
312
315
|
|
|
313
316
|
export { COMMON_SEARCH_KEY, useCommonSearch, useCommonSearchModal };
|
|
@@ -3,6 +3,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
import { Form, Col, Tooltip } from 'antd';
|
|
5
5
|
import classNames from '../node_modules/classnames/index.js';
|
|
6
|
+
import useLocale, { formatLocaleText } from '../config/useLocale.js';
|
|
6
7
|
import '../config/ZtxkContext.js';
|
|
7
8
|
import isEqual from '../config/isEqual.js';
|
|
8
9
|
import '../config/MyStorage.js';
|
|
@@ -13,6 +14,7 @@ var hiddenLabelCol = { span: 0 };
|
|
|
13
14
|
var FormItem = function (props) {
|
|
14
15
|
var children = props.children, isDisplay = props.isDisplay, isRequired = props.isRequired, isChangeable = props.isChangeable, isStress = props.isStress, preNode = props.preNode, nextNode = props.nextNode; props.dynamicDisabled; var hiddenBorder = props.hiddenBorder, singleSelectShowBorder = props.singleSelectShowBorder, singleSelect = props.singleSelect, hiddenLabel = props.hiddenLabel, width = props.width, className = props.className, itemClassName = props.itemClassName, render = props.render, shouldUpdateNames = props.shouldUpdateNames; props.shouldUpdateClear; var dependencies = props.dependencies, shouldUpdate = props.shouldUpdate; props.index; props.outsideState; props.shouldUpdateBeOutsideState; props.nonForm; var isCustomItem = props.isCustomItem, customStyle = props.customStyle, tipString = props.tipString, directionColumn = props.directionColumn, divider = props.divider, label = props.label; props.labelString; var resetProps = __rest(props, ["children", "isDisplay", "isRequired", "isChangeable", "isStress", "preNode", "nextNode", "dynamicDisabled", "hiddenBorder", "singleSelectShowBorder", "singleSelect", "hiddenLabel", "width", "className", "itemClassName", "render", "shouldUpdateNames", "shouldUpdateClear", "dependencies", "shouldUpdate", "index", "outsideState", "shouldUpdateBeOutsideState", "nonForm", "isCustomItem", "customStyle", "tipString", "directionColumn", "divider", "label", "labelString"]);
|
|
15
16
|
var form = Form.useFormInstance();
|
|
17
|
+
var locale = useLocale().FormItem;
|
|
16
18
|
var getLabel = function (formInstance) {
|
|
17
19
|
return typeof label === "function" ? label(formInstance) : label;
|
|
18
20
|
};
|
|
@@ -42,7 +44,7 @@ var FormItem = function (props) {
|
|
|
42
44
|
if (typeof label === "function") {
|
|
43
45
|
var newLabel = getLabel(form);
|
|
44
46
|
message =
|
|
45
|
-
typeof newLabel === "string" ? (
|
|
47
|
+
typeof newLabel === "string" ? (formatLocaleText(locale.notFilled, { label: newLabel })) : (jsxs("span", __assign({ style: { display: "inline-flex" } }, { children: [newLabel, locale.notFilledSuffix] })));
|
|
46
48
|
}
|
|
47
49
|
rules.splice(requiredIndex, 1, {
|
|
48
50
|
required: isRequireBoolean,
|
|
@@ -51,7 +53,7 @@ var FormItem = function (props) {
|
|
|
51
53
|
}
|
|
52
54
|
else {
|
|
53
55
|
var newLabel = getLabel(form);
|
|
54
|
-
var newMessage = typeof newLabel === "string" ? (
|
|
56
|
+
var newMessage = typeof newLabel === "string" ? (formatLocaleText(locale.notFilled, { label: newLabel })) : (jsxs("span", __assign({ style: { display: "inline-flex" } }, { children: [newLabel, locale.notFilledSuffix] })));
|
|
55
57
|
rules.unshift({
|
|
56
58
|
required: isRequireBoolean,
|
|
57
59
|
message: newMessage,
|
|
@@ -17,9 +17,14 @@ var InputNumber = function (props, ref) {
|
|
|
17
17
|
// 元素是否获得焦点
|
|
18
18
|
// 用来处理formatter优先级比precision高的问题
|
|
19
19
|
var isFocusRef = useRef(false);
|
|
20
|
-
|
|
20
|
+
// 记录用户输入的小数位数,用于在聚焦时补回被 JS 丢弃的尾零
|
|
21
|
+
// 例如:用户输入 21.00,JS 存为 21,此 ref 记录 2,
|
|
22
|
+
// formatter 据此用 toFixed(2) 补回为 "21.00"
|
|
23
|
+
var decimalLengthRef = useRef(0);
|
|
24
|
+
var _a = getFormatter(formatterType, currencySymbol, isFocusRef, precision, decimalLengthRef), _formatter = _a.formatter, _parser = _a.parser, _precision = _a.precision;
|
|
21
25
|
var onBlurHandle = function (e) {
|
|
22
26
|
isFocusRef.current = false;
|
|
27
|
+
decimalLengthRef.current = 0;
|
|
23
28
|
onBlur && onBlur(e);
|
|
24
29
|
};
|
|
25
30
|
var onFocusHandle = function (e) {
|
|
@@ -30,7 +35,11 @@ var InputNumber = function (props, ref) {
|
|
|
30
35
|
// "ant-input-number-focused": leftRightStyle,
|
|
31
36
|
"ztxk-input-number-leftRight": leftRightStyle,
|
|
32
37
|
});
|
|
33
|
-
|
|
38
|
+
// 无 formatterType 时,不传自定义 formatter,让 antd 原生 precision 机制处理
|
|
39
|
+
// 这样编辑中删除小数末位时能保留尾零(如 21.001 删一位显示 21.00),
|
|
40
|
+
// 失焦后 antd 自动补齐精度(如 21.00 → 21.000)
|
|
41
|
+
var finalFormatter = formatterType ? (formatter || _formatter) : formatter;
|
|
42
|
+
return (jsx(InputNumber$2, __assign({ formatter: finalFormatter, parser: parser || _parser, precision: precision !== null && precision !== void 0 ? precision : _precision, onBlur: onBlurHandle, onFocus: onFocusHandle, className: classes, controls: leftRightStyle ? controls : undefined }, resetProps, { ref: ref, onPressEnter: isEnterSearch
|
|
34
43
|
? function (e) {
|
|
35
44
|
var _a;
|
|
36
45
|
(_a = props.onPressEnter) === null || _a === void 0 ? void 0 : _a.call(props, e);
|