ztxkui 4.2.23-604 → 4.2.23-606
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/UI/Detail/index.js +5 -1
- package/dist/UI/Table/EditTable.js +5 -3
- package/dist/components/Table/table-menu.js +1 -1
- package/dist/components/electron-signatures/content.js +54 -5
- package/dist/components/electron-signatures/demoComponents/making.js +4 -4
- package/dist/components/electron-signatures/demoComponents/makingData.d.ts +8 -1
- package/dist/components/electron-signatures/demoComponents/makingData.js +11 -3
- package/dist/components/electron-signatures/electronComponents/electron-seal-detail.js +33 -5
- package/dist/components/electron-signatures/electronComponents/electron-seal-list.js +136 -25
- package/dist/components/electron-signatures/fileComponents/useFileColumns.js +47 -0
- package/dist/components/electron-signatures/index.d.ts +4 -0
- package/dist/components/electron-signatures/index.js +17 -4
- package/dist/components/electron-signatures/interface.d.ts +12 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-detail.d.ts +4 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-detail.js +29 -9
- package/dist/components/electron-signatures/qunjComponents/qunj-list.js +166 -3
- package/dist/components/electron-signatures/qunjComponents/useQunjColumns.js +115 -88
- package/dist/components/utils/ZtxkContext.d.ts +16 -0
- package/dist/components/utils/ZtxkContext.js +4 -0
- package/dist/components/utils/useBaseContext.d.ts +4 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/index.css +329 -0
- package/dist/index.css.map +1 -1
- package/dist/main.js +11 -1
- package/dist/request.js +1 -1
- package/package.json +2 -2
package/dist/UI/Detail/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import i18next from 'ztxkutils/dist/i18next';
|
|
|
2
2
|
import React, { useMemo, useRef } from 'react';
|
|
3
3
|
import { DetailHeader, OperationBtnGroup, Container, Button, InputNumber, Input, Tabs, Dropdown, DatePicker, Collapse, Modal, Tooltip, } from '../../index.build';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
|
+
import EditTable from '../Table/EditTable';
|
|
5
6
|
var Detail = function () {
|
|
6
7
|
var rangeDatesRef = useRef(null);
|
|
7
8
|
var items = useMemo(function () {
|
|
@@ -211,6 +212,7 @@ var Detail = function () {
|
|
|
211
212
|
return item.render ? item.render() : null;
|
|
212
213
|
}))),
|
|
213
214
|
React.createElement(InputNumber, { precision: 6, min: 0 }),
|
|
215
|
+
React.createElement(InputNumber, { precision: 0, min: 0, formatterType: "currency" }),
|
|
214
216
|
React.createElement(Input, { placeholder: i18next.t('若遇"共同责任"、"授权委托"审批情形,则"合同金额"字段填写(拟)授信金额。') }),
|
|
215
217
|
React.createElement(Input.Quill, { placeholder: i18next.t('若遇"共同责任"、"授权委托"审批情形,则"合同金额"字段填写(拟)授信金额。') }),
|
|
216
218
|
React.createElement(Tabs, { isHeader: true }, Array.from({ length: 6 }, function (_, i) { return (React.createElement(Tabs.TabPane, { key: i, tab: React.createElement(Dropdown, { trigger: ['contextMenu'], overlay: React.createElement("div", null,
|
|
@@ -223,7 +225,9 @@ var Detail = function () {
|
|
|
223
225
|
React.createElement(Collapse.Panel, { key: "1", header: "\u9762\u677F1" }, "\u9762\u677F1"),
|
|
224
226
|
React.createElement(Collapse.Panel, { key: "2", header: "\u9762\u677F2" }, "\u9762\u677F2")),
|
|
225
227
|
React.createElement(Button, { onClick: function () { return setVisible(true); } }, "\u6253\u5F00\u5F39\u6846"),
|
|
226
|
-
React.createElement(Modal, { title: "\u5F39\u6846\u6807\u9898", loading: false, visible: visible, onCancel: function () { return setVisible(false); } },
|
|
228
|
+
React.createElement(Modal, { title: "\u5F39\u6846\u6807\u9898", loading: false, visible: visible, onCancel: function () { return setVisible(false); } },
|
|
229
|
+
"\u6211\u662F\u5F39\u6846\u5185\u5BB9",
|
|
230
|
+
React.createElement(EditTable, null)),
|
|
227
231
|
React.createElement(Tooltip, { title: "\u6211\u662F\u63D0\u793A" },
|
|
228
232
|
React.createElement(Button, null, "\u6211\u662F\u6309\u94AE"))));
|
|
229
233
|
};
|
|
@@ -92,6 +92,10 @@ function useColumns(tableHandleRef) {
|
|
|
92
92
|
width: 100,
|
|
93
93
|
dataIndex: 'test1',
|
|
94
94
|
key: 'test1',
|
|
95
|
+
shouldCellUpdate: function (record, preRecord) {
|
|
96
|
+
return record.test1 !== preRecord.test1;
|
|
97
|
+
},
|
|
98
|
+
fixed: 'left',
|
|
95
99
|
render: function (text, record, index) {
|
|
96
100
|
return (React.createElement(Input, { value: text, onChange: function (e) {
|
|
97
101
|
var _a;
|
|
@@ -622,9 +626,7 @@ export default function EditTable() {
|
|
|
622
626
|
// defaultInnerPageSize={10}
|
|
623
627
|
virtualTableKey: "single-110011",
|
|
624
628
|
// 是否选择
|
|
625
|
-
isChoice: true, choiceMode: "radio", selectedRowKeys: selectedRowKeys, onSelectedRowChange: onSelectedRowChange, onChange: onChange, summaryFixed: true,
|
|
626
|
-
// hideIndexColumnEditBtn
|
|
627
|
-
summaryConfig: [
|
|
629
|
+
isChoice: true, choiceMode: "radio", selectedRowKeys: selectedRowKeys, onSelectedRowChange: onSelectedRowChange, onChange: onChange, summaryFixed: true, hideIndexColumnEditBtn: false, summaryConfig: [
|
|
628
630
|
{
|
|
629
631
|
type: 'subtotal',
|
|
630
632
|
fields: [
|
|
@@ -296,7 +296,7 @@ var TableMenu = forwardRef(function (_a, ref) {
|
|
|
296
296
|
onEditableSave || !isContextMenuFullscreen ? null : (React.createElement(Item, { data: "fullscreen", onClick: onMenuItemClick }, isFull ? i18next.t('退出全屏') : i18next.t('全屏')))),
|
|
297
297
|
React.createElement(Modal, { width: "80%", title: i18next.t('详情'), visible: visible, onCancel: onCancel,
|
|
298
298
|
// stick
|
|
299
|
-
mask: false, loading: false, className: className, footer: React.createElement(Button, { type: "primary", onClick: onCancel }, i18next.t('确定'))
|
|
299
|
+
mask: false, loading: false, className: className, footer: React.createElement(Button, { type: "primary", onClick: onCancel }, i18next.t('确定')) },
|
|
300
300
|
React.createElement("div", { style: { maxHeight: '70vh', minWidth: '800px', overflow: 'auto' } },
|
|
301
301
|
React.createElement("div", { className: "zt-table-detail-grid" }, record && renderItem(items))))));
|
|
302
302
|
});
|
|
@@ -111,11 +111,36 @@ var ElectronSignatures = function (props) {
|
|
|
111
111
|
// fmsIsElectronicSealPushLabel = '推送银行',
|
|
112
112
|
_j = props.fmsIsElectronicSealPushLabel,
|
|
113
113
|
// fmsIsElectronicSealPushLabel = '推送银行',
|
|
114
|
-
fmsIsElectronicSealPushLabel = _j === void 0 ? i18next.t('加盖银行签章') : _j, _k = props.openingContractSealLabel, openingContractSealLabel = _k === void 0 ? i18next.t('盖光盈电子章') : _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, sealDownloadFlowStatus = props.sealDownloadFlowStatus, 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", "sealDownloadFlowStatus"]);
|
|
114
|
+
fmsIsElectronicSealPushLabel = _j === void 0 ? i18next.t('加盖银行签章') : _j, _k = props.openingContractSealLabel, openingContractSealLabel = _k === void 0 ? i18next.t('盖光盈电子章') : _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, isNewElectronSealStyle = props.isNewElectronSealStyle, isNewQunjSealStyle = props.isNewQunjSealStyle, _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, sealDownloadFlowStatus = props.sealDownloadFlowStatus, 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", "isNewElectronSealStyle", "isNewQunjSealStyle", "isShowBatchUseElectronicSealBtn", "isShowBatchUseOpeningContractSealBtn", "isShowOpeningContractSeal", "customButtons", "goWorkflowSeal", "isShowSealApply", "otherColumns", "isShowOpeningContractSealNotRelyQys", "isNoWatermarkProcess", "qunjListRenderFilter", "sealDownloadFlowStatus"]);
|
|
115
115
|
var selectRows = useRef(null);
|
|
116
|
+
// 批量更新时用于合并 onValueChange 调用,避免多次触发外部回调
|
|
117
|
+
var batchUpdateRef = useRef({
|
|
118
|
+
active: false,
|
|
119
|
+
data: {},
|
|
120
|
+
});
|
|
116
121
|
var onValueChange = useMemoizedFn(function (info) {
|
|
122
|
+
if (batchUpdateRef.current.active) {
|
|
123
|
+
// 批量模式:合并数据,延迟通知外部
|
|
124
|
+
Object.keys(info).forEach(function (key) {
|
|
125
|
+
batchUpdateRef.current.data[key] = __assign(__assign({}, batchUpdateRef.current.data[key]), info[key]);
|
|
126
|
+
});
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
117
129
|
_onValueChange && _onValueChange(info);
|
|
118
130
|
});
|
|
131
|
+
/**
|
|
132
|
+
* 批量执行操作,期间的所有 onValueChange 调用会合并为一次外部通知。
|
|
133
|
+
* 适用于批量删除等会触发多次 onValueChange 的场景。
|
|
134
|
+
*/
|
|
135
|
+
var batchOnValueChange = useMemoizedFn(function (fn) {
|
|
136
|
+
batchUpdateRef.current = { active: true, data: {} };
|
|
137
|
+
fn();
|
|
138
|
+
var batchedData = batchUpdateRef.current.data;
|
|
139
|
+
batchUpdateRef.current = { active: false, data: {} };
|
|
140
|
+
if (Object.keys(batchedData).length > 0) {
|
|
141
|
+
_onValueChange && _onValueChange(batchedData);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
119
144
|
var onFileTypeChangeGetItem = useMemoizedFn(function (info) {
|
|
120
145
|
if (_onFileTypeChangeGetItem) {
|
|
121
146
|
return _onFileTypeChangeGetItem(info);
|
|
@@ -937,16 +962,40 @@ var ElectronSignatures = function (props) {
|
|
|
937
962
|
};
|
|
938
963
|
}
|
|
939
964
|
}
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
965
|
+
// 使用 batch 模式,将删除附件、清理电子印章、清理群杰印章的多次 onValueChange 合并为一次
|
|
966
|
+
batchOnValueChange(function () {
|
|
967
|
+
Object.entries(deleteInfo).forEach(function (_a) {
|
|
968
|
+
var _b;
|
|
969
|
+
var _c;
|
|
970
|
+
var dataType = _a[0], _d = _a[1], records = _d.records, setRecords = _d.setRecords, deleteList = _d.deleteList;
|
|
971
|
+
var newRecords = records === null || records === void 0 ? void 0 : records.filter(function (record) {
|
|
944
972
|
return !(deleteList === null || deleteList === void 0 ? void 0 : deleteList.some(function (item) {
|
|
945
973
|
return item.id
|
|
946
974
|
? item.id === record.id
|
|
947
975
|
: item.attachId === record.attachId;
|
|
948
976
|
}));
|
|
949
977
|
});
|
|
978
|
+
setRecords(function () { return newRecords; });
|
|
979
|
+
// 批量删除后,检查是否需要清理印章信息
|
|
980
|
+
var dataTypeData = allData[dataType] || {};
|
|
981
|
+
// 电子印章:同类型下不再有任何勾选电子印章的附件时,清空共享数据
|
|
982
|
+
var deletedHasElectronicSeal = deleteList === null || deleteList === void 0 ? void 0 : deleteList.some(function (item) { return (item === null || item === void 0 ? void 0 : item.isElectronicSeal) + '' === '1'; });
|
|
983
|
+
if (deletedHasElectronicSeal) {
|
|
984
|
+
var hasElectronicSealFile = newRecords === null || newRecords === void 0 ? void 0 : newRecords.some(function (record) { return (record === null || record === void 0 ? void 0 : record.isElectronicSeal) + '' === '1'; });
|
|
985
|
+
if (!hasElectronicSealFile) {
|
|
986
|
+
var onClearElectronListData = dataTypeData.onClearElectronListData, onClearElectronSetting = dataTypeData.onClearElectronSetting;
|
|
987
|
+
var clearElectronListData = onClearElectronListData === null || onClearElectronListData === void 0 ? void 0 : onClearElectronListData();
|
|
988
|
+
var clearElectronSetting = onClearElectronSetting === null || onClearElectronSetting === void 0 ? void 0 : onClearElectronSetting();
|
|
989
|
+
onValueChange((_b = {},
|
|
990
|
+
_b[dataType] = __assign(__assign({}, clearElectronListData), clearElectronSetting),
|
|
991
|
+
_b));
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
// 群杰印章:整体模式下附件全部删完时才清空共享数据
|
|
995
|
+
// 单附件模式(isSingleQj)群杰数据存在附件 record 上,删除附件即删除数据
|
|
996
|
+
if (!isSingleQj && (!newRecords || newRecords.length === 0)) {
|
|
997
|
+
(_c = dataTypeData.setQunjChecked) === null || _c === void 0 ? void 0 : _c.call(dataTypeData, false);
|
|
998
|
+
}
|
|
950
999
|
});
|
|
951
1000
|
});
|
|
952
1001
|
}
|
|
@@ -74,9 +74,7 @@ var Making = function () {
|
|
|
74
74
|
console.log(params);
|
|
75
75
|
return (React.createElement(React.Fragment, null,
|
|
76
76
|
React.createElement(Button, { type: "link", disabled: true }, i18next.t('我是一个链接按钮111')),
|
|
77
|
-
React.createElement(ElectronSignatures, __assign({ request: request, dataTypeName: i18next.t('新附件1'), dataType: "key1",
|
|
78
|
-
// otherOptions={otherOptions}
|
|
79
|
-
customButtons: React.createElement(React.Fragment, null,
|
|
77
|
+
React.createElement(ElectronSignatures, __assign({ request: request, dataTypeName: i18next.t('新附件1'), dataType: "key1", otherOptions: otherOptions, customButtons: React.createElement(React.Fragment, null,
|
|
80
78
|
React.createElement(Button, { type: "primary" }, i18next.t('挑选合同附件'))), isNewQys: true, isBgColor: true,
|
|
81
79
|
// isDefaultQunj={false}
|
|
82
80
|
// 是否显示上传附件按钮
|
|
@@ -165,7 +163,9 @@ var Making = function () {
|
|
|
165
163
|
electronHandleRef: electronHandleRef, isValidateSuccess: function () {
|
|
166
164
|
// 最后会调用一个接口 验证下是否所选的电子印章都已经盖了章 如果没有盖章 就会弹出一个选择框 让用户重新选择 重新选择后 如果用户把所有未盖章的电子印章都取消勾选的话 那么就会调用这个方法 说明校验通过 可以进行下一步
|
|
167
165
|
console.log(i18next.t('最终校验通过了!!!'));
|
|
168
|
-
}
|
|
166
|
+
},
|
|
167
|
+
// 是否显示合同分数
|
|
168
|
+
isContranctNum: true })),
|
|
169
169
|
React.createElement("button", { onClick: function () {
|
|
170
170
|
setParams(function (preParams) {
|
|
171
171
|
return __assign(__assign({}, preParams), { deptId: preParams.deptId === '1514842376723976194'
|
|
@@ -270,10 +270,17 @@ declare const historyData1: {
|
|
|
270
270
|
}[];
|
|
271
271
|
qunjSeal: {
|
|
272
272
|
vertifyCode: number;
|
|
273
|
-
contranctNum:
|
|
273
|
+
contranctNum: number;
|
|
274
274
|
isTakeOut: number;
|
|
275
275
|
details: {
|
|
276
|
+
companyType: string;
|
|
277
|
+
companyTypeName: string;
|
|
278
|
+
sealName: string;
|
|
276
279
|
sealNo: string;
|
|
280
|
+
areaType: number;
|
|
281
|
+
areaTypeName: string;
|
|
282
|
+
useType: number;
|
|
283
|
+
useTypeName: string;
|
|
277
284
|
sealCount: number;
|
|
278
285
|
}[];
|
|
279
286
|
};
|
|
@@ -575,7 +575,8 @@ var historyData1 = [
|
|
|
575
575
|
needQj: 1,
|
|
576
576
|
deptId: '1514842459376930817',
|
|
577
577
|
memberId: null,
|
|
578
|
-
flowId: 'scm_order_contract_ccwlht',
|
|
578
|
+
// flowId: 'scm_order_contract_ccwlht',
|
|
579
|
+
flowId: 'scm_order_contract_cght',
|
|
579
580
|
contractId: null,
|
|
580
581
|
caseId: 'ab0f7dff-0294-4187-bffe-bf489101546b',
|
|
581
582
|
docAttachMap: null,
|
|
@@ -610,11 +611,18 @@ var historyData1 = [
|
|
|
610
611
|
],
|
|
611
612
|
qunjSeal: {
|
|
612
613
|
vertifyCode: 281109,
|
|
613
|
-
contranctNum:
|
|
614
|
+
contranctNum: 3,
|
|
614
615
|
isTakeOut: 0,
|
|
615
616
|
details: [
|
|
616
617
|
{
|
|
617
|
-
|
|
618
|
+
companyType: 'K000',
|
|
619
|
+
companyTypeName: '浙商中拓集团股份有限公司',
|
|
620
|
+
sealName: '浙商中拓集团股份有限公司公章(杭州)',
|
|
621
|
+
sealNo: 'YZ-2023-008',
|
|
622
|
+
areaType: 1,
|
|
623
|
+
areaTypeName: '杭州',
|
|
624
|
+
useType: 3,
|
|
625
|
+
useTypeName: '公章',
|
|
618
626
|
sealCount: 1,
|
|
619
627
|
},
|
|
620
628
|
],
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import i18next from 'ztxkutils/dist/i18next';
|
|
2
|
-
import React, { memo } from 'react';
|
|
2
|
+
import React, { memo, useContext } from 'react';
|
|
3
|
+
import { ElectronSignaturesContext } from '..';
|
|
4
|
+
/** 公司简称 fallback 到全称 */
|
|
5
|
+
function getOwnerShortName(item) {
|
|
6
|
+
return (item === null || item === void 0 ? void 0 : item.ownerShortName) || (item === null || item === void 0 ? void 0 : item.ownerName) || '';
|
|
7
|
+
}
|
|
8
|
+
/** 印章简称 fallback 到全称 */
|
|
9
|
+
function getSealShortName(item) {
|
|
10
|
+
return (item === null || item === void 0 ? void 0 : item.sealShortName) || (item === null || item === void 0 ? void 0 : item.sealName) || '';
|
|
11
|
+
}
|
|
3
12
|
export var NoUseElectronSeal = function () {
|
|
4
13
|
return (React.createElement("div", { style: {
|
|
5
14
|
height: '100%',
|
|
@@ -13,6 +22,7 @@ export var NoUseElectronSeal = function () {
|
|
|
13
22
|
*/
|
|
14
23
|
var ElectronSealDetail = function (_a) {
|
|
15
24
|
var sealList = _a.sealList, value = _a.value;
|
|
25
|
+
var isNewElectronSealStyle = useContext(ElectronSignaturesContext).isNewElectronSealStyle;
|
|
16
26
|
// 电子印章数据没有加载完成或者加载出错
|
|
17
27
|
if (!Array.isArray(sealList)) {
|
|
18
28
|
return null;
|
|
@@ -21,11 +31,29 @@ var ElectronSealDetail = function (_a) {
|
|
|
21
31
|
if (sealList.length === 0) {
|
|
22
32
|
return React.createElement(NoUseElectronSeal, null);
|
|
23
33
|
}
|
|
24
|
-
//
|
|
25
|
-
|
|
34
|
+
// 非编辑模式下,没有选中任何印章
|
|
35
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
36
|
+
return React.createElement(NoUseElectronSeal, null);
|
|
37
|
+
}
|
|
38
|
+
// 新版展示样式:按照"公司简称 印章简称"模式展示,带"已选印章"标题
|
|
39
|
+
if (isNewElectronSealStyle) {
|
|
40
|
+
return (React.createElement("div", { className: "electron-seal-detail-new--wrap" },
|
|
41
|
+
React.createElement("div", { className: "seal-selected-title" }, "\u5DF2\u9009\u5370\u7AE0"),
|
|
42
|
+
value.map(function (id) {
|
|
43
|
+
var _a;
|
|
44
|
+
var completeItem = (_a = sealList === null || sealList === void 0 ? void 0 : sealList.find) === null || _a === void 0 ? void 0 : _a.call(sealList, function (sealItem) { return sealItem.sealId === id; });
|
|
45
|
+
return (React.createElement("div", { key: id, className: "seal-selected-item", title: (((completeItem === null || completeItem === void 0 ? void 0 : completeItem.ownerName) || '') + " " + ((completeItem === null || completeItem === void 0 ? void 0 : completeItem.sealName) || '')).trim() },
|
|
46
|
+
getOwnerShortName(completeItem),
|
|
47
|
+
" ",
|
|
48
|
+
getSealShortName(completeItem)));
|
|
49
|
+
})));
|
|
50
|
+
}
|
|
51
|
+
// 旧版展示样式:只显示印章简称
|
|
52
|
+
return (React.createElement("div", { className: "electron-seal-detail--wrap" }, value === null || value === void 0 ? void 0 : value.map(function (id) {
|
|
26
53
|
var _a;
|
|
27
54
|
var completeItem = (_a = sealList === null || sealList === void 0 ? void 0 : sealList.find) === null || _a === void 0 ? void 0 : _a.call(sealList, function (sealItem) { return sealItem.sealId === id; });
|
|
28
|
-
|
|
29
|
-
|
|
55
|
+
var displayName = (completeItem === null || completeItem === void 0 ? void 0 : completeItem.sealShortName) || (completeItem === null || completeItem === void 0 ? void 0 : completeItem.sealName);
|
|
56
|
+
return (React.createElement("div", { key: id, className: "electron-seal-detail--wrap__item", title: completeItem === null || completeItem === void 0 ? void 0 : completeItem.sealName }, displayName));
|
|
57
|
+
})));
|
|
30
58
|
};
|
|
31
59
|
export default memo(ElectronSealDetail);
|
|
@@ -20,42 +20,153 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
24
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
25
|
+
to[j] = from[i];
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
import React, { memo, useMemo, useState, useContext, useEffect } from 'react';
|
|
24
29
|
import { Checkbox, Collapse } from '../../../index.build';
|
|
30
|
+
import { ElectronSignaturesContext } from '..';
|
|
31
|
+
import useBaseContext from '../../utils/useBaseContext';
|
|
32
|
+
/** 公司简称优先排序关键词(按指定顺序排前) */
|
|
33
|
+
var PRIORITY_OWNERS = ['浙商中拓', '浙江中拓', '湖南中拓', '海南中拓'];
|
|
34
|
+
/** 按优先级排序公司简称列表 */
|
|
35
|
+
function sortOwners(owners) {
|
|
36
|
+
var prioritized = PRIORITY_OWNERS.filter(function (o) { return owners.includes(o); });
|
|
37
|
+
var rest = owners.filter(function (o) { return !PRIORITY_OWNERS.includes(o); });
|
|
38
|
+
return __spreadArray(__spreadArray([], prioritized), rest);
|
|
39
|
+
}
|
|
40
|
+
/** 公司简称 fallback 到全称 */
|
|
41
|
+
function getOwnerShortName(item) {
|
|
42
|
+
return (item === null || item === void 0 ? void 0 : item.ownerShortName) || (item === null || item === void 0 ? void 0 : item.ownerName) || '';
|
|
43
|
+
}
|
|
44
|
+
/** 印章简称 fallback 到全称 */
|
|
45
|
+
function getSealShortName(item) {
|
|
46
|
+
return (item === null || item === void 0 ? void 0 : item.sealShortName) || (item === null || item === void 0 ? void 0 : item.sealName) || '';
|
|
47
|
+
}
|
|
25
48
|
/**
|
|
26
49
|
* 电子签章选择列表
|
|
27
50
|
*/
|
|
28
51
|
var ElectronSealList = function (_a) {
|
|
29
|
-
var sealList = _a.sealList, onChange = _a.onChange, isEdit = _a.isEdit, resetProp = __rest(_a, ["sealList", "onChange", "isEdit"]);
|
|
30
|
-
|
|
31
|
-
var
|
|
52
|
+
var sealList = _a.sealList, onChange = _a.onChange, isEdit = _a.isEdit, value = _a.value, resetProp = __rest(_a, ["sealList", "onChange", "isEdit", "value"]);
|
|
53
|
+
var isNewElectronSealStyle = useContext(ElectronSignaturesContext).isNewElectronSealStyle;
|
|
54
|
+
var _b = useBaseContext().electronSealTabTrigger, electronSealTabTrigger = _b === void 0 ? 'hover' : _b;
|
|
55
|
+
// 新版:以公司简称维度拆分数据
|
|
56
|
+
var _c = useMemo(function () {
|
|
32
57
|
if (!Array.isArray(sealList)) {
|
|
33
58
|
return {
|
|
34
|
-
|
|
35
|
-
|
|
59
|
+
ownerList: [],
|
|
60
|
+
ownerMap: {},
|
|
36
61
|
};
|
|
37
62
|
}
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
63
|
+
var map = {};
|
|
64
|
+
sealList.forEach(function (item) {
|
|
65
|
+
var name = getOwnerShortName(item);
|
|
66
|
+
if (!map[name])
|
|
67
|
+
map[name] = [];
|
|
68
|
+
map[name].push(item);
|
|
42
69
|
});
|
|
43
70
|
return {
|
|
44
|
-
|
|
45
|
-
|
|
71
|
+
ownerList: sortOwners(Object.keys(map)),
|
|
72
|
+
ownerMap: map,
|
|
46
73
|
};
|
|
47
|
-
}, [sealList]);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
74
|
+
}, [sealList]), ownerList = _c.ownerList, ownerMap = _c.ownerMap;
|
|
75
|
+
// 旧版:以 ownerName 维度拆分数据
|
|
76
|
+
var _d = useMemo(function () {
|
|
77
|
+
if (!Array.isArray(sealList)) {
|
|
78
|
+
return { ownerNameList: [], ownerNameResult: {} };
|
|
79
|
+
}
|
|
80
|
+
var list = Array.from(new Set(sealList.map(function (item) { return item.ownerName; })));
|
|
81
|
+
var result = {};
|
|
82
|
+
list.forEach(function (ownerName) {
|
|
83
|
+
result[ownerName] = sealList.filter(function (item) { return item.ownerName === ownerName; });
|
|
84
|
+
});
|
|
85
|
+
return { ownerNameList: list, ownerNameResult: result };
|
|
86
|
+
}, [sealList]), ownerNameList = _d.ownerNameList, ownerNameResult = _d.ownerNameResult;
|
|
87
|
+
// 新版:当前选中的公司(默认第一个)
|
|
88
|
+
var _e = useState(ownerList[0]), selectedOwner = _e[0], setSelectedOwner = _e[1];
|
|
89
|
+
useEffect(function () {
|
|
90
|
+
// 公司列表变化时,重置选中公司为第一个
|
|
91
|
+
if (ownerList.length > 0 && !ownerList.includes(selectedOwner)) {
|
|
92
|
+
setSelectedOwner(ownerList[0]);
|
|
93
|
+
}
|
|
94
|
+
}, [ownerList, selectedOwner]);
|
|
95
|
+
// 新版:当前选中公司下的印章列表
|
|
96
|
+
var currentSeals = ownerMap[selectedOwner] || [];
|
|
97
|
+
// 新版:sealId → 公司简称 映射,用于统计每个公司选中了几个印章
|
|
98
|
+
var sealIdToOwner = useMemo(function () {
|
|
99
|
+
var map = {};
|
|
100
|
+
Object.keys(ownerMap).forEach(function (owner) {
|
|
101
|
+
ownerMap[owner].forEach(function (item) {
|
|
102
|
+
map[item.sealId] = owner;
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
return map;
|
|
106
|
+
}, [ownerMap]);
|
|
107
|
+
// 新版:每个公司下选中的印章数量
|
|
108
|
+
var ownerSelectedCount = useMemo(function () {
|
|
109
|
+
var countMap = {};
|
|
110
|
+
if (Array.isArray(value)) {
|
|
111
|
+
value.forEach(function (sealId) {
|
|
112
|
+
var owner = sealIdToOwner[sealId];
|
|
113
|
+
if (owner) {
|
|
114
|
+
countMap[owner] = (countMap[owner] || 0) + 1;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
return countMap;
|
|
119
|
+
}, [value, sealIdToOwner]);
|
|
120
|
+
// 新版:已选印章完整信息列表
|
|
121
|
+
var selectedSealList = useMemo(function () {
|
|
122
|
+
if (!Array.isArray(value) || !Array.isArray(sealList)) {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
return value
|
|
126
|
+
.map(function (id) { return sealList.find(function (item) { return item.sealId === id; }); })
|
|
127
|
+
.filter(Boolean);
|
|
128
|
+
}, [value, sealList]);
|
|
129
|
+
// ========= 旧版渲染(手风琴模式) =========
|
|
130
|
+
if (!isNewElectronSealStyle) {
|
|
131
|
+
return ownerNameList.length === 0 ? null : (React.createElement(Checkbox.Group, __assign({ value: value, onChange: function (e) {
|
|
132
|
+
onChange && onChange(e);
|
|
133
|
+
}, disabled: !isEdit, className: "electron-seal-list--wrap" }, resetProp),
|
|
134
|
+
React.createElement(Collapse, { defaultActiveKey: ownerNameList.map(function (item, index) { return index; }), style: { width: '100%' } }, ownerNameList.map(function (ownerName, index) {
|
|
135
|
+
var _a;
|
|
136
|
+
return (React.createElement(Collapse.Panel, { key: index, header: React.createElement("div", { className: "electron-seal-list--owner-name" }, ownerName) }, (_a = ownerNameResult[ownerName]) === null || _a === void 0 ? void 0 : _a.map(function (item) {
|
|
137
|
+
return (React.createElement(Checkbox, { key: item.sealId, value: item.sealId }, item.sealName));
|
|
138
|
+
})));
|
|
139
|
+
}))));
|
|
140
|
+
}
|
|
141
|
+
// ========= 新版渲染(三段式布局) =========
|
|
142
|
+
if (ownerList.length === 0) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
return (React.createElement("div", __assign({ className: "electron-seal-list-new--wrap" }, resetProp),
|
|
146
|
+
React.createElement("div", { className: "seal-owner-tabs" }, ownerList.map(function (owner) {
|
|
147
|
+
var _a, _b;
|
|
148
|
+
var count = ownerSelectedCount[owner] || 0;
|
|
149
|
+
return (React.createElement("div", __assign({ key: owner, className: "seal-owner-tab " + (selectedOwner === owner ? 'seal-owner-tab--active' : ''), title: ((_b = (_a = ownerMap[owner]) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.ownerName) || owner }, (electronSealTabTrigger === 'hover'
|
|
150
|
+
? { onMouseEnter: function () { return setSelectedOwner(owner); } }
|
|
151
|
+
: { onClick: function () { return setSelectedOwner(owner); } })),
|
|
152
|
+
React.createElement("span", { className: "seal-owner-tab--name" }, owner),
|
|
153
|
+
count > 0 && (React.createElement("span", { className: "seal-owner-tab--count" }, count))));
|
|
154
|
+
})),
|
|
155
|
+
React.createElement("div", { className: "seal-list-current" }, currentSeals.map(function (item) {
|
|
156
|
+
var checked = Array.isArray(value) && value.includes(item.sealId);
|
|
157
|
+
return (React.createElement(Checkbox, { key: item.sealId, checked: checked, disabled: !isEdit, onChange: function () {
|
|
158
|
+
var newValue = checked
|
|
159
|
+
? (value || []).filter(function (id) { return id !== item.sealId; })
|
|
160
|
+
: __spreadArray(__spreadArray([], (value || [])), [item.sealId]);
|
|
161
|
+
onChange && onChange(newValue);
|
|
162
|
+
} },
|
|
163
|
+
React.createElement("span", { title: item.sealName }, getSealShortName(item))));
|
|
164
|
+
})),
|
|
165
|
+
React.createElement("div", { className: "seal-selected-summary" },
|
|
166
|
+
React.createElement("div", { className: "seal-selected-title" }, "\u5DF2\u9009\u5370\u7AE0"),
|
|
167
|
+
selectedSealList.length > 0 ? (selectedSealList.map(function (item) { return (React.createElement("div", { key: item.sealId, className: "seal-selected-item", title: ((item.ownerName || '') + " " + (item.sealName || '')).trim() },
|
|
168
|
+
getOwnerShortName(item),
|
|
169
|
+
" ",
|
|
170
|
+
getSealShortName(item))); })) : (React.createElement("div", { className: "seal-selected-empty" }, "\u6682\u672A\u9009\u62E9\u5370\u7AE0")))));
|
|
60
171
|
};
|
|
61
172
|
export default memo(ElectronSealList);
|
|
@@ -22,6 +22,37 @@ import { onlyQunjAttachId, currentRecordIsOnlyQunj } from '../utils';
|
|
|
22
22
|
import dayjs from 'dayjs';
|
|
23
23
|
import { ElectronSignaturesContext } from '..';
|
|
24
24
|
import { isFlowCompleted } from '../utils';
|
|
25
|
+
/**
|
|
26
|
+
* 删除附件后,检查同类型下是否还有勾选了电子印章的附件。
|
|
27
|
+
* 如果被删除的附件勾选了电子印章,且删除后同类型不再有任何勾选电子印章的附件,
|
|
28
|
+
* 则清空共享的电子印章信息(印章列表、合同id、签署位置等)。
|
|
29
|
+
*
|
|
30
|
+
* 群杰印章不在此处处理:
|
|
31
|
+
* - 单附件模式(isSingleQj):群杰数据存在附件 record 上,删除附件即删除数据。
|
|
32
|
+
* - 整体模式(!isSingleQj):所有附件共用群杰信息,只有附件全部删完时才清空
|
|
33
|
+
* (在 copyRecords.length === 0 分支中处理)。
|
|
34
|
+
*
|
|
35
|
+
* 参考 useParseIsNeedElectronData 中 onIsStampElectronChange 的清理模式。
|
|
36
|
+
*/
|
|
37
|
+
function clearElectronDataWhenNoSealFile(deletedRecord, remainingRecords, allData, currentDataType, onValueChange) {
|
|
38
|
+
var _a;
|
|
39
|
+
// 被删除的附件没有勾选电子印章,不影响电子印章信息
|
|
40
|
+
if ((deletedRecord === null || deletedRecord === void 0 ? void 0 : deletedRecord.isElectronicSeal) + '' !== '1') {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
// 同类型下是否还有勾选电子印章的附件
|
|
44
|
+
var hasElectronicSealFile = remainingRecords === null || remainingRecords === void 0 ? void 0 : remainingRecords.some(function (record) { return (record === null || record === void 0 ? void 0 : record.isElectronicSeal) + '' === '1'; });
|
|
45
|
+
if (hasElectronicSealFile) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
// 没有任何附件需要盖电子印章了,清空共享的电子印章信息
|
|
49
|
+
var _b = allData[currentDataType] || {}, onClearElectronListData = _b.onClearElectronListData, onClearElectronSetting = _b.onClearElectronSetting;
|
|
50
|
+
var clearElectronListData = onClearElectronListData === null || onClearElectronListData === void 0 ? void 0 : onClearElectronListData();
|
|
51
|
+
var clearElectronSetting = onClearElectronSetting === null || onClearElectronSetting === void 0 ? void 0 : onClearElectronSetting();
|
|
52
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange((_a = {},
|
|
53
|
+
_a[currentDataType] = __assign(__assign({}, clearElectronListData), clearElectronSetting),
|
|
54
|
+
_a));
|
|
55
|
+
}
|
|
25
56
|
// 创建附件的clomuns
|
|
26
57
|
export default function useFileColumns(options) {
|
|
27
58
|
var records = options.records, dataTypeSort = options.dataTypeSort, allData = options.allData, isShowFileUpload = options.isShowFileUpload, apiBaseUrl = options.apiBaseUrl, fileBaseUrl = options.fileBaseUrl, firstDataType = options.firstDataType,
|
|
@@ -114,11 +145,16 @@ export default function useFileColumns(options) {
|
|
|
114
145
|
var dataTypeIndex = index - preDataTypeRecordsLength;
|
|
115
146
|
var copyRecords = sameTypeRecords === null || sameTypeRecords === void 0 ? void 0 : sameTypeRecords.slice();
|
|
116
147
|
if (Array.isArray(copyRecords)) {
|
|
148
|
+
// 记录被删除的附件,用于判断是否需要清理电子印章信息
|
|
149
|
+
var deletedRecord = copyRecords[dataTypeIndex];
|
|
117
150
|
copyRecords.splice(dataTypeIndex, 1);
|
|
118
151
|
if (copyRecords.length === 0) {
|
|
119
152
|
setSameTypeRecords(defaultOnlyQunjRecords);
|
|
120
153
|
var clearElectronListData = onClearElectronListData === null || onClearElectronListData === void 0 ? void 0 : onClearElectronListData();
|
|
121
154
|
var clearElectronSetting = onClearElectronSetting === null || onClearElectronSetting === void 0 ? void 0 : onClearElectronSetting();
|
|
155
|
+
// 所有附件删完时,同时清理群杰印章共享数据
|
|
156
|
+
var setQunjChecked = (allData[currentDataType] || {}).setQunjChecked;
|
|
157
|
+
setQunjChecked === null || setQunjChecked === void 0 ? void 0 : setQunjChecked(false);
|
|
122
158
|
onValueChange &&
|
|
123
159
|
onValueChange(__assign(__assign((_a = {}, _a[firstDataType] = {
|
|
124
160
|
fileList: defaultOnlyQunjRecords,
|
|
@@ -126,6 +162,9 @@ export default function useFileColumns(options) {
|
|
|
126
162
|
}
|
|
127
163
|
else {
|
|
128
164
|
setSameTypeRecords(copyRecords);
|
|
165
|
+
// 同类型的附件共用电子印章信息,只有当被删除的附件勾选了电子印章
|
|
166
|
+
// 且删除后同类型下不再有任何勾选电子印章的附件时,才清理电子印章信息
|
|
167
|
+
clearElectronDataWhenNoSealFile(deletedRecord, copyRecords, allData, currentDataType, onValueChange);
|
|
129
168
|
}
|
|
130
169
|
}
|
|
131
170
|
}, onWatermarkChange: function (isChecked) {
|
|
@@ -212,11 +251,16 @@ export default function useFileColumns(options) {
|
|
|
212
251
|
var dataTypeIndex = index - preDataTypeRecordsLength;
|
|
213
252
|
var copyRecords = sameTypeRecords === null || sameTypeRecords === void 0 ? void 0 : sameTypeRecords.slice();
|
|
214
253
|
if (Array.isArray(copyRecords)) {
|
|
254
|
+
// 记录被删除的附件,用于判断是否需要清理电子印章信息
|
|
255
|
+
var deletedRecord = copyRecords[dataTypeIndex];
|
|
215
256
|
copyRecords.splice(dataTypeIndex, 1);
|
|
216
257
|
if (copyRecords.length === 0) {
|
|
217
258
|
setSameTypeRecords(defaultOnlyQunjRecords);
|
|
218
259
|
var clearElectronListData = onClearElectronListData === null || onClearElectronListData === void 0 ? void 0 : onClearElectronListData();
|
|
219
260
|
var clearElectronSetting = onClearElectronSetting === null || onClearElectronSetting === void 0 ? void 0 : onClearElectronSetting();
|
|
261
|
+
// 所有附件删完时,同时清理群杰印章共享数据
|
|
262
|
+
var setQunjChecked = (allData[currentDataType] || {}).setQunjChecked;
|
|
263
|
+
setQunjChecked === null || setQunjChecked === void 0 ? void 0 : setQunjChecked(false);
|
|
220
264
|
onValueChange &&
|
|
221
265
|
onValueChange(__assign(__assign((_a = {}, _a[firstDataType] = {
|
|
222
266
|
fileList: defaultOnlyQunjRecords,
|
|
@@ -224,6 +268,9 @@ export default function useFileColumns(options) {
|
|
|
224
268
|
}
|
|
225
269
|
else {
|
|
226
270
|
setSameTypeRecords(copyRecords);
|
|
271
|
+
// 同类型的附件共用电子印章信息,只有当被删除的附件勾选了电子印章
|
|
272
|
+
// 且删除后同类型下不再有任何勾选电子印章的附件时,才清理电子印章信息
|
|
273
|
+
clearElectronDataWhenNoSealFile(deletedRecord, copyRecords, allData, currentDataType, onValueChange);
|
|
227
274
|
}
|
|
228
275
|
}
|
|
229
276
|
}, onWatermarkChange: function (isChecked) {
|
|
@@ -3,6 +3,10 @@ import { IElectronSignaturesProps } from './interface';
|
|
|
3
3
|
interface IElectronSignaturesContext {
|
|
4
4
|
isQjVerifyCode?: boolean;
|
|
5
5
|
isNewQys?: boolean;
|
|
6
|
+
/** 电子印章是否使用新版展示样式 */
|
|
7
|
+
isNewElectronSealStyle?: boolean;
|
|
8
|
+
/** 群杰印章是否使用新版展示样式 */
|
|
9
|
+
isNewQunjSealStyle?: boolean;
|
|
6
10
|
}
|
|
7
11
|
export declare const ElectronSignaturesContext: React.Context<IElectronSignaturesContext>;
|
|
8
12
|
declare const _default: React.NamedExoticComponent<IElectronSignaturesProps>;
|
|
@@ -22,20 +22,33 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import React, { memo, useMemo, createContext } from 'react';
|
|
24
24
|
import ElectronSignatures from './content';
|
|
25
|
+
import useBaseContext from '../utils/useBaseContext';
|
|
25
26
|
export var ElectronSignaturesContext = createContext({
|
|
26
27
|
isNewQys: true,
|
|
27
28
|
isQjVerifyCode: true,
|
|
29
|
+
isNewElectronSealStyle: false,
|
|
30
|
+
isNewQunjSealStyle: false,
|
|
28
31
|
});
|
|
29
32
|
/**
|
|
30
33
|
* 容器组件,为了将context传递给组件,方便组件能快速访问到一些信息
|
|
31
34
|
*/
|
|
32
35
|
var ElectronSignaturesWrap = function (props) {
|
|
36
|
+
var _a, _b, _c, _d;
|
|
33
37
|
// 这里未上线之前,都使用默认为false。不采用最新版本的修改
|
|
34
|
-
var
|
|
38
|
+
var _e = props.isQjVerifyCode, isQjVerifyCode = _e === void 0 ? false : _e, _f = props.isNewQys, isNewQys = _f === void 0 ? false : _f, resetProps = __rest(props, ["isQjVerifyCode", "isNewQys"]);
|
|
39
|
+
// 全局配置:组件 props 优先,未传时取全局 ZtxkContext 配置
|
|
40
|
+
var _g = useBaseContext(), globalElectronSealStyle = _g.isNewElectronSealStyle, globalQunjSealStyle = _g.isNewQunjSealStyle;
|
|
41
|
+
var isNewElectronSealStyle = (_b = (_a = props.isNewElectronSealStyle) !== null && _a !== void 0 ? _a : globalElectronSealStyle) !== null && _b !== void 0 ? _b : false;
|
|
42
|
+
var isNewQunjSealStyle = (_d = (_c = props.isNewQunjSealStyle) !== null && _c !== void 0 ? _c : globalQunjSealStyle) !== null && _d !== void 0 ? _d : false;
|
|
35
43
|
var defaultContext = useMemo(function () {
|
|
36
|
-
return {
|
|
37
|
-
|
|
44
|
+
return {
|
|
45
|
+
isNewQys: isNewQys,
|
|
46
|
+
isQjVerifyCode: isQjVerifyCode,
|
|
47
|
+
isNewElectronSealStyle: isNewElectronSealStyle,
|
|
48
|
+
isNewQunjSealStyle: isNewQunjSealStyle,
|
|
49
|
+
};
|
|
50
|
+
}, [isNewQys, isQjVerifyCode, isNewElectronSealStyle, isNewQunjSealStyle]);
|
|
38
51
|
return (React.createElement(ElectronSignaturesContext.Provider, { value: defaultContext },
|
|
39
|
-
React.createElement(ElectronSignatures, __assign({ isQjVerifyCode: isQjVerifyCode, isNewQys: isNewQys }, resetProps))));
|
|
52
|
+
React.createElement(ElectronSignatures, __assign({ isQjVerifyCode: isQjVerifyCode, isNewQys: isNewQys, isNewElectronSealStyle: isNewElectronSealStyle, isNewQunjSealStyle: isNewQunjSealStyle }, resetProps))));
|
|
40
53
|
};
|
|
41
54
|
export default memo(ElectronSignaturesWrap);
|