ztxkui 10.0.95 → 10.0.96
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/components/TranslationButton/DownFile.d.ts +7 -0
- package/dist/components/TranslationButton/DownFile.js +95 -0
- package/dist/components/TranslationButton/PreviewFile.d.ts +5 -0
- package/dist/components/TranslationButton/PreviewFile.js +73 -0
- package/dist/components/TranslationButton/TranslationButton.d.ts +34 -0
- package/dist/components/TranslationButton/TranslationButton.js +245 -0
- package/dist/components/TranslationButton/demoComponents/index.d.ts +3 -0
- package/dist/components/TranslationButton/demoComponents/index.js +9 -0
- package/dist/components/TranslationButton/hooks.d.ts +8 -0
- package/dist/components/TranslationButton/hooks.js +139 -0
- package/dist/components/TranslationButton/index.d.ts +4 -0
- package/dist/components/TranslationButton/index.js +4 -0
- package/dist/components/Upload/utils.d.ts +8 -1
- package/dist/components/Upload/utils.js +56 -4
- package/dist/components/UploadCustom/hooks/useDg.d.ts +6 -0
- package/dist/components/UploadCustom/hooks/useDg.js +55 -0
- package/dist/components/business/Signatures/components/CodeModal.d.ts +3 -0
- package/dist/components/business/Signatures/components/CodeModal.js +157 -0
- package/dist/components/electron-signatures/content.d.ts +9 -0
- package/dist/components/electron-signatures/content.js +1126 -0
- package/dist/components/electron-signatures/demoComponents/data.d.ts +58 -0
- package/dist/components/electron-signatures/demoComponents/data.js +1307 -0
- package/dist/components/electron-signatures/demoComponents/detail.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/detail.js +283 -0
- package/dist/components/electron-signatures/demoComponents/index.d.ts +2 -0
- package/dist/components/electron-signatures/demoComponents/index.js +27 -0
- package/dist/components/electron-signatures/demoComponents/index_old.d.ts +3 -0
- package/dist/components/electron-signatures/demoComponents/index_old.js +502 -0
- package/dist/components/electron-signatures/demoComponents/jgqrd.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/jgqrd.js +135 -0
- package/dist/components/electron-signatures/demoComponents/making.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/making.js +211 -0
- package/dist/components/electron-signatures/demoComponents/makingData.d.ts +663 -0
- package/dist/components/electron-signatures/demoComponents/makingData.js +1164 -0
- package/dist/components/electron-signatures/demoComponents/newDetail.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/newDetail.js +283 -0
- package/dist/components/electron-signatures/demoComponents/preview.d.ts +3 -0
- package/dist/components/electron-signatures/demoComponents/preview.js +9 -0
- package/dist/components/electron-signatures/demoComponents/singleQjDetail.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/singleQjDetail.js +530 -0
- package/dist/components/electron-signatures/demoComponents/singleQjMaking.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/singleQjMaking.js +219 -0
- package/dist/components/electron-signatures/demoComponents/test.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/test.js +119 -0
- package/dist/components/electron-signatures/dgComponents/contract-comparison.d.ts +39 -0
- package/dist/components/electron-signatures/dgComponents/contract-comparison.js +53 -0
- package/dist/components/electron-signatures/dgComponents/file-comparison-btn.d.ts +11 -0
- package/dist/components/electron-signatures/dgComponents/file-comparison-btn.js +180 -0
- package/dist/components/electron-signatures/dgComponents/new-contract-comparison.d.ts +45 -0
- package/dist/components/electron-signatures/dgComponents/new-contract-comparison.js +68 -0
- package/dist/components/electron-signatures/dgComponents/useContractColumns.d.ts +21 -0
- package/dist/components/electron-signatures/dgComponents/useContractColumns.js +171 -0
- package/dist/components/electron-signatures/electron-signatures-fragment.d.ts +8 -0
- package/dist/components/electron-signatures/electron-signatures-fragment.js +344 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-batch-download.d.ts +52 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-batch-download.js +513 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-detail.d.ts +8 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-detail.js +59 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-download.d.ts +16 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-download.js +89 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-firstLevelPerson.d.ts +9 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-firstLevelPerson.js +16 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item-detail.d.ts +15 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item-detail.js +16 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item.d.ts +20 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item.js +47 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-list.d.ts +11 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-list.js +191 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-setting.d.ts +15 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-setting.js +10 -0
- package/dist/components/electron-signatures/electronComponents/last-qys-modal.d.ts +7 -0
- package/dist/components/electron-signatures/electronComponents/last-qys-modal.js +42 -0
- package/dist/components/electron-signatures/electronComponents/useCheckedSealInfoList.d.ts +3 -0
- package/dist/components/electron-signatures/electronComponents/useCheckedSealInfoList.js +43 -0
- package/dist/components/electron-signatures/electronComponents/useElectronColumns.d.ts +30 -0
- package/dist/components/electron-signatures/electronComponents/useElectronColumns.js +380 -0
- package/dist/components/electron-signatures/electronComponents/useFetchElectronData.d.ts +20 -0
- package/dist/components/electron-signatures/electronComponents/useFetchElectronData.js +167 -0
- package/dist/components/electron-signatures/electronComponents/useGetDeptInfo.d.ts +3 -0
- package/dist/components/electron-signatures/electronComponents/useGetDeptInfo.js +35 -0
- package/dist/components/electron-signatures/fileComponents/file-operation.d.ts +7 -0
- package/dist/components/electron-signatures/fileComponents/file-operation.js +67 -0
- package/dist/components/electron-signatures/fileComponents/file-type-select.d.ts +12 -0
- package/dist/components/electron-signatures/fileComponents/file-type-select.js +10 -0
- package/dist/components/electron-signatures/fileComponents/file-upload.d.ts +11 -0
- package/dist/components/electron-signatures/fileComponents/file-upload.js +146 -0
- package/dist/components/electron-signatures/fileComponents/fileUtils.d.ts +17 -0
- package/dist/components/electron-signatures/fileComponents/fileUtils.js +36 -0
- package/dist/components/electron-signatures/fileComponents/new-file-operation.d.ts +10 -0
- package/dist/components/electron-signatures/fileComponents/new-file-operation.js +73 -0
- package/dist/components/electron-signatures/fileComponents/useFetchFileTypeData.d.ts +13 -0
- package/dist/components/electron-signatures/fileComponents/useFetchFileTypeData.js +43 -0
- package/dist/components/electron-signatures/fileComponents/useFileColumns.d.ts +38 -0
- package/dist/components/electron-signatures/fileComponents/useFileColumns.js +329 -0
- package/dist/components/electron-signatures/fileComponents/useFileTypeColumns.d.ts +19 -0
- package/dist/components/electron-signatures/fileComponents/useFileTypeColumns.js +72 -0
- package/dist/components/electron-signatures/hooks/useGetQjVerifyCode.d.ts +30 -0
- package/dist/components/electron-signatures/hooks/useGetQjVerifyCode.js +132 -0
- package/dist/components/electron-signatures/hooks/useMergeRecords.d.ts +17 -0
- package/dist/components/electron-signatures/hooks/useMergeRecords.js +49 -0
- package/dist/components/electron-signatures/hooks/useParseElectronListData.d.ts +49 -0
- package/dist/components/electron-signatures/hooks/useParseElectronListData.js +111 -0
- package/dist/components/electron-signatures/hooks/useParseElectronSetting.d.ts +102 -0
- package/dist/components/electron-signatures/hooks/useParseElectronSetting.js +363 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedElectronData.d.ts +40 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedElectronData.js +139 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedQunjData.d.ts +36 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedQunjData.js +48 -0
- package/dist/components/electron-signatures/hooks/useParseQunjListData.d.ts +56 -0
- package/dist/components/electron-signatures/hooks/useParseQunjListData.js +204 -0
- package/dist/components/electron-signatures/hooks/useParseQunjSingleData.d.ts +34 -0
- package/dist/components/electron-signatures/hooks/useParseQunjSingleData.js +110 -0
- package/dist/components/electron-signatures/hooks/useParseRecords.d.ts +65 -0
- package/dist/components/electron-signatures/hooks/useParseRecords.js +165 -0
- package/dist/components/electron-signatures/index.d.ts +13 -0
- package/dist/components/electron-signatures/index.js +54 -0
- package/dist/components/electron-signatures/index_old.d.ts +9 -0
- package/dist/components/electron-signatures/index_old.js +966 -0
- package/dist/components/electron-signatures/interface.d.ts +849 -0
- package/dist/components/electron-signatures/interface.js +57 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-apply.d.ts +6 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-apply.js +8 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-check.d.ts +21 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-check.js +41 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-detail.d.ts +35 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-detail.js +267 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-list.d.ts +24 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-list.js +346 -0
- package/dist/components/electron-signatures/qunjComponents/useFetchQunjData.d.ts +20 -0
- package/dist/components/electron-signatures/qunjComponents/useFetchQunjData.js +61 -0
- package/dist/components/electron-signatures/qunjComponents/useQunjColumns.d.ts +36 -0
- package/dist/components/electron-signatures/qunjComponents/useQunjColumns.js +321 -0
- package/dist/components/electron-signatures/translateComponents/TranslateButton.d.ts +10 -0
- package/dist/components/electron-signatures/translateComponents/TranslateButton.js +44 -0
- package/dist/components/electron-signatures/translateComponents/useTranslateCom.d.ts +22 -0
- package/dist/components/electron-signatures/translateComponents/useTranslateCom.js +50 -0
- package/dist/components/electron-signatures/utils.d.ts +26 -0
- package/dist/components/electron-signatures/utils.js +67 -0
- package/dist/components/utils/ZtxkContext.d.ts +16 -0
- package/dist/components/utils/ZtxkContext.js +4 -0
- package/dist/components/utils/useMemoizedFn.d.ts +6 -0
- package/dist/components/utils/useMemoizedFn.js +22 -0
- package/dist/components/utils/usePrevious.d.ts +3 -0
- package/dist/components/utils/usePrevious.js +13 -0
- package/dist/index.css +686 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +105 -87
- package/dist/request.js +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IElectronSignaturesProps, IElectronSignaturesItemPublic, IElectronSignaturesItem, IFileItem } from '../interface';
|
|
3
|
+
interface IOptions {
|
|
4
|
+
/**
|
|
5
|
+
* 是否开启非受控模式
|
|
6
|
+
* 非受控模式开启后,数值的改变交由内部控制。外部只需要在合适的时机 获取数据即可
|
|
7
|
+
*/
|
|
8
|
+
isUnControlled?: IElectronSignaturesProps['isUnControlled'];
|
|
9
|
+
/**
|
|
10
|
+
* 触发外部onChange事件
|
|
11
|
+
*/
|
|
12
|
+
onValueChange?: IElectronSignaturesItem['onValueChange'];
|
|
13
|
+
/**
|
|
14
|
+
* 新附件
|
|
15
|
+
*/
|
|
16
|
+
fileList?: IElectronSignaturesItem['fileList'];
|
|
17
|
+
/**
|
|
18
|
+
* 数据类型
|
|
19
|
+
*/
|
|
20
|
+
dataType?: IElectronSignaturesItem['dataType'];
|
|
21
|
+
/**
|
|
22
|
+
* 数据拆分规则
|
|
23
|
+
*/
|
|
24
|
+
fileSplitRules?: IElectronSignaturesItem['fileSplitRules'];
|
|
25
|
+
fileSplitStringRules?: IElectronSignaturesItem['fileSplitStringRules'];
|
|
26
|
+
isSingleQj?: IElectronSignaturesItemPublic['isSingleQj'];
|
|
27
|
+
isSupportNoAttachQj?: IElectronSignaturesItemPublic['isSupportNoAttachQj'];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 内部用来区分当前附件所属类型的KEY值
|
|
31
|
+
*/
|
|
32
|
+
export declare const DATA_TYPE_KEY = "__DATA_TYPE_KEY";
|
|
33
|
+
/**
|
|
34
|
+
* 附件数据处理
|
|
35
|
+
*/
|
|
36
|
+
export default function useParseRecords(options: IOptions): {
|
|
37
|
+
/** 当前的附件列表数据 */
|
|
38
|
+
records: IFileItem[];
|
|
39
|
+
/** 设置当前附件列表数据 调用这个方法 回触发onValueChange回调 */
|
|
40
|
+
setRecords: (this: any, info: any) => void;
|
|
41
|
+
/** 修改内部数据 只是修改数据 并不会触发onValueChange回调 需要自己手动触发 */
|
|
42
|
+
innerSetRecords: import("react").Dispatch<import("react").SetStateAction<IFileItem[]>>;
|
|
43
|
+
};
|
|
44
|
+
export declare function getColumnMergeProp(options: {
|
|
45
|
+
record: any;
|
|
46
|
+
records: any;
|
|
47
|
+
dataTypeSort: any;
|
|
48
|
+
index: any;
|
|
49
|
+
}): {
|
|
50
|
+
/** 当前的数据类型 */
|
|
51
|
+
currentDataType: any;
|
|
52
|
+
/** 合并规则 */
|
|
53
|
+
props: {
|
|
54
|
+
rowSpan: any;
|
|
55
|
+
};
|
|
56
|
+
/** 当前数据类型之前的数据长度 */
|
|
57
|
+
preDataTypeRecordsLength: number;
|
|
58
|
+
};
|
|
59
|
+
export declare function getColumnRecordProp(options: {
|
|
60
|
+
record: any;
|
|
61
|
+
}): {
|
|
62
|
+
/** 当前的数据类型 */
|
|
63
|
+
currentDataType: any;
|
|
64
|
+
};
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
13
|
+
import { useEffect, useState, useMemo, useRef, useContext } from 'react';
|
|
14
|
+
import useMemoizedFn from '../../utils/useMemoizedFn';
|
|
15
|
+
import { onlyQunjAttachId, detailOnlyQunjAttachId } from '../utils';
|
|
16
|
+
import { ElectronSignaturesContext } from '..';
|
|
17
|
+
/**
|
|
18
|
+
* 内部用来区分当前附件所属类型的KEY值
|
|
19
|
+
*/
|
|
20
|
+
export var DATA_TYPE_KEY = '__DATA_TYPE_KEY';
|
|
21
|
+
/**
|
|
22
|
+
* 附件数据处理
|
|
23
|
+
*/
|
|
24
|
+
export default function useParseRecords(options) {
|
|
25
|
+
var isUnControlled = options.isUnControlled, onValueChange = options.onValueChange, dataType = options.dataType, fileList = options.fileList, fileSplitRules = options.fileSplitRules, fileSplitStringRules = options.fileSplitStringRules, isSingleQj = options.isSingleQj, isSupportNoAttachQj = options.isSupportNoAttachQj;
|
|
26
|
+
var isNewQys = useContext(ElectronSignaturesContext).isNewQys;
|
|
27
|
+
var fileSplitRulesRef = useRef(fileSplitRules);
|
|
28
|
+
fileSplitRulesRef.current = fileSplitRules;
|
|
29
|
+
var fileSplitStringRulesRef = useRef(fileSplitStringRules);
|
|
30
|
+
fileSplitStringRulesRef.current = fileSplitStringRules;
|
|
31
|
+
var _a = useState(function () {
|
|
32
|
+
return fileList === null || fileList === void 0 ? void 0 : fileList.map(function (item, index) {
|
|
33
|
+
var _a;
|
|
34
|
+
return __assign(__assign({}, item), (_a = {}, _a[DATA_TYPE_KEY] = dataType, _a));
|
|
35
|
+
});
|
|
36
|
+
}), _records = _a[0], _setRecords = _a[1];
|
|
37
|
+
// 代理records
|
|
38
|
+
var records = useMemo(function () {
|
|
39
|
+
var _a;
|
|
40
|
+
// 这里可能外部没有传入_records 没有传入_records时,也要显示占位符数据
|
|
41
|
+
if ((Array.isArray(_records) && _records.length === 0) || !_records) {
|
|
42
|
+
if (isNewQys && !isSupportNoAttachQj) {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
if (isSingleQj) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
return [
|
|
49
|
+
(_a = {
|
|
50
|
+
attachId: detailOnlyQunjAttachId
|
|
51
|
+
},
|
|
52
|
+
_a[DATA_TYPE_KEY] = dataType,
|
|
53
|
+
_a),
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
if (Array.isArray(_records) && fileSplitRulesRef.current) {
|
|
57
|
+
var newRecords_1 = [];
|
|
58
|
+
if (fileSplitStringRulesRef.current) {
|
|
59
|
+
fileSplitStringRulesRef.current.forEach(function (key) {
|
|
60
|
+
var keyRecords = _records.filter(function (record) { return fileSplitRulesRef.current(record).key === key; });
|
|
61
|
+
newRecords_1 = newRecords_1.concat(keyRecords);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
var recordMap_1 = {};
|
|
66
|
+
_records.forEach(function (record) {
|
|
67
|
+
var key = fileSplitRulesRef.current(record).key;
|
|
68
|
+
if (!Array.isArray(recordMap_1[key])) {
|
|
69
|
+
recordMap_1[key] = [record];
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
recordMap_1[key].push(record);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
Object.keys(recordMap_1).forEach(function (key) {
|
|
76
|
+
newRecords_1 = newRecords_1.concat(recordMap_1[key]);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return newRecords_1;
|
|
80
|
+
}
|
|
81
|
+
return _records;
|
|
82
|
+
}, [_records, dataType, isSingleQj, isNewQys, isSupportNoAttachQj]);
|
|
83
|
+
// 代理下set 触发onChange方法
|
|
84
|
+
var setRecords = useMemoizedFn(function (info) {
|
|
85
|
+
var _a;
|
|
86
|
+
var newRecords = typeof info === 'function' ? info(records) : info;
|
|
87
|
+
// if (isUnControlled) {
|
|
88
|
+
_setRecords(newRecords);
|
|
89
|
+
// }
|
|
90
|
+
if (!dataType) {
|
|
91
|
+
console.log(i18next.t('必须传入数据类型'));
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
// 20250519 批量删除所有数据时,也要触发onValueChange回调 因为此时的newRecords是空数组
|
|
95
|
+
onValueChange && onValueChange((_a = {}, _a[dataType] = { fileList: newRecords }, _a));
|
|
96
|
+
// 如果数据仅剩下这个数据 那么交给调用方处理
|
|
97
|
+
if (newRecords.length === 1 &&
|
|
98
|
+
newRecords[0].attachId + '' === onlyQunjAttachId) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
// 如果清空附件 触发外部行为也需要外部处理
|
|
102
|
+
if (newRecords.length === 0) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
// onValueChange && onValueChange({ [dataType]: { fileList: newRecords } });
|
|
106
|
+
});
|
|
107
|
+
/**
|
|
108
|
+
* 如果是受控模式的话,直接将props的值 赋值给 内部变量
|
|
109
|
+
*/
|
|
110
|
+
useEffect(function () {
|
|
111
|
+
// if (!isUnControlled) {
|
|
112
|
+
_setRecords(fileList === null || fileList === void 0 ? void 0 : fileList.map(function (item, index) {
|
|
113
|
+
var _a;
|
|
114
|
+
return __assign(__assign({}, item), (_a = {}, _a[DATA_TYPE_KEY] = dataType, _a));
|
|
115
|
+
}));
|
|
116
|
+
// }
|
|
117
|
+
}, [isUnControlled, fileList, dataType]);
|
|
118
|
+
return {
|
|
119
|
+
/** 当前的附件列表数据 */
|
|
120
|
+
records: records,
|
|
121
|
+
/** 设置当前附件列表数据 调用这个方法 回触发onValueChange回调 */
|
|
122
|
+
setRecords: setRecords,
|
|
123
|
+
/** 修改内部数据 只是修改数据 并不会触发onValueChange回调 需要自己手动触发 */
|
|
124
|
+
innerSetRecords: _setRecords,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
// 记录合并规则 返回数据类型 和 行合并规则
|
|
128
|
+
export function getColumnMergeProp(options) {
|
|
129
|
+
var record = options.record, records = options.records, dataTypeSort = options.dataTypeSort, index = options.index;
|
|
130
|
+
// 获取当前项的类型
|
|
131
|
+
var currentDataType = record === null || record === void 0 ? void 0 : record[DATA_TYPE_KEY];
|
|
132
|
+
// 找到当前项类型 对应的 类型排序位置
|
|
133
|
+
var currentDataTypeIndex = dataTypeSort === null || dataTypeSort === void 0 ? void 0 : dataTypeSort.findIndex(function (type) { return type === currentDataType; });
|
|
134
|
+
// 找到数据中是当前类型的数据
|
|
135
|
+
var dataTypeRecords = records === null || records === void 0 ? void 0 : records.filter(function (record) { return (record === null || record === void 0 ? void 0 : record[DATA_TYPE_KEY]) === currentDataType; });
|
|
136
|
+
// 数据中当前类型数据的长度
|
|
137
|
+
var currentDataTypeRecordsLength = dataTypeRecords.length;
|
|
138
|
+
// 当前项之前的匹配项
|
|
139
|
+
var preDataType = dataTypeSort.slice(0, currentDataTypeIndex);
|
|
140
|
+
// 所有之前数据的长度
|
|
141
|
+
var preDataTypeRecordsLength = 0;
|
|
142
|
+
preDataType.forEach(function (preDataType) {
|
|
143
|
+
var preDataTypeRecords = records === null || records === void 0 ? void 0 : records.filter(function (record) { return (record === null || record === void 0 ? void 0 : record[DATA_TYPE_KEY]) === preDataType; });
|
|
144
|
+
preDataTypeRecordsLength += preDataTypeRecords.length || 0;
|
|
145
|
+
});
|
|
146
|
+
return {
|
|
147
|
+
/** 当前的数据类型 */
|
|
148
|
+
currentDataType: currentDataType,
|
|
149
|
+
/** 合并规则 */
|
|
150
|
+
props: {
|
|
151
|
+
rowSpan: index === preDataTypeRecordsLength ? currentDataTypeRecordsLength : 0,
|
|
152
|
+
},
|
|
153
|
+
/** 当前数据类型之前的数据长度 */
|
|
154
|
+
preDataTypeRecordsLength: preDataTypeRecordsLength,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
// 只返回数据类型 相比于上一个方法 性能更佳 针对只需要得到数据类型的列
|
|
158
|
+
export function getColumnRecordProp(options) {
|
|
159
|
+
var record = options.record;
|
|
160
|
+
var currentDataType = record === null || record === void 0 ? void 0 : record[DATA_TYPE_KEY];
|
|
161
|
+
return {
|
|
162
|
+
/** 当前的数据类型 */
|
|
163
|
+
currentDataType: currentDataType,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IElectronSignaturesProps } from './interface';
|
|
3
|
+
interface IElectronSignaturesContext {
|
|
4
|
+
isQjVerifyCode?: boolean;
|
|
5
|
+
isNewQys?: boolean;
|
|
6
|
+
/** 电子印章是否使用新版展示样式 */
|
|
7
|
+
isNewElectronSealStyle?: boolean;
|
|
8
|
+
/** 群杰印章是否使用新版展示样式 */
|
|
9
|
+
isNewQunjSealStyle?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const ElectronSignaturesContext: React.Context<IElectronSignaturesContext>;
|
|
12
|
+
declare const _default: React.NamedExoticComponent<IElectronSignaturesProps>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React, { memo, useMemo, createContext } from 'react';
|
|
24
|
+
import ElectronSignatures from './content';
|
|
25
|
+
import useBaseContext from '../utils/useBaseContext';
|
|
26
|
+
export var ElectronSignaturesContext = createContext({
|
|
27
|
+
isNewQys: true,
|
|
28
|
+
isQjVerifyCode: true,
|
|
29
|
+
isNewElectronSealStyle: false,
|
|
30
|
+
isNewQunjSealStyle: false,
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* 容器组件,为了将context传递给组件,方便组件能快速访问到一些信息
|
|
34
|
+
*/
|
|
35
|
+
var ElectronSignaturesWrap = function (props) {
|
|
36
|
+
var _a, _b, _c, _d;
|
|
37
|
+
// 这里未上线之前,都使用默认为false。不采用最新版本的修改
|
|
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;
|
|
43
|
+
var defaultContext = useMemo(function () {
|
|
44
|
+
return {
|
|
45
|
+
isNewQys: isNewQys,
|
|
46
|
+
isQjVerifyCode: isQjVerifyCode,
|
|
47
|
+
isNewElectronSealStyle: isNewElectronSealStyle,
|
|
48
|
+
isNewQunjSealStyle: isNewQunjSealStyle,
|
|
49
|
+
};
|
|
50
|
+
}, [isNewQys, isQjVerifyCode, isNewElectronSealStyle, isNewQunjSealStyle]);
|
|
51
|
+
return (React.createElement(ElectronSignaturesContext.Provider, { value: defaultContext },
|
|
52
|
+
React.createElement(ElectronSignatures, __assign({ isQjVerifyCode: isQjVerifyCode, isNewQys: isNewQys, isNewElectronSealStyle: isNewElectronSealStyle, isNewQunjSealStyle: isNewQunjSealStyle }, resetProps))));
|
|
53
|
+
};
|
|
54
|
+
export default memo(ElectronSignaturesWrap);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IElectronSignaturesProps } from './interface';
|
|
3
|
+
interface IElectronSignaturesContext {
|
|
4
|
+
isQjVerifyCode?: boolean;
|
|
5
|
+
isNewQys?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const ElectronSignaturesContext: React.Context<IElectronSignaturesContext>;
|
|
8
|
+
declare const _default: React.NamedExoticComponent<IElectronSignaturesProps>;
|
|
9
|
+
export default _default;
|