ztxkui 10.0.95 → 10.0.97
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 +97 -0
- package/dist/components/TranslationButton/PreviewFile.d.ts +5 -0
- package/dist/components/TranslationButton/PreviewFile.js +75 -0
- package/dist/components/TranslationButton/TranslationButton.d.ts +34 -0
- package/dist/components/TranslationButton/TranslationButton.js +247 -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 +143 -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 +57 -0
- package/dist/components/business/Signatures/components/CodeModal.d.ts +3 -0
- package/dist/components/business/Signatures/components/CodeModal.js +159 -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 +45 -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 +169 -0
- package/dist/components/electron-signatures/electronComponents/useGetDeptInfo.d.ts +3 -0
- package/dist/components/electron-signatures/electronComponents/useGetDeptInfo.js +38 -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 +45 -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 +134 -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 +365 -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 +63 -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,49 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IElectronSignaturesProps, IElectronSignaturesItem } 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
|
+
dataType?: IElectronSignaturesItem['dataType'];
|
|
17
|
+
/**
|
|
18
|
+
* 当前选中的印章数据
|
|
19
|
+
*/
|
|
20
|
+
electronicSealIdList?: IElectronSignaturesItem['electronicSealIdList'];
|
|
21
|
+
/**
|
|
22
|
+
* 是否加盖责任人手签章
|
|
23
|
+
*/
|
|
24
|
+
isCheckedEconomic?: IElectronSignaturesItem['isCheckedEconomic'];
|
|
25
|
+
/**
|
|
26
|
+
* 后台用于维护当前合同id下附件id(key)与文档id(value)的关系map 后台解绑文档时使用
|
|
27
|
+
*/
|
|
28
|
+
docAttachMap?: IElectronSignaturesItem['docAttachMap'];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 电子印章列表选择相关数据 经过处理逻辑后 返回对应数据
|
|
32
|
+
*/
|
|
33
|
+
export default function useParseElectronListData(options: IOptions): {
|
|
34
|
+
/** 当前选中的电子印章数据 */
|
|
35
|
+
currentCheckedElectronicSealIdList: any;
|
|
36
|
+
/** 电子印章更改时触发 */
|
|
37
|
+
onElectronicSealIdChange: (this: any, e: any, isChange?: boolean) => void;
|
|
38
|
+
/** 当前是否需要经济责任人(一级责任人) */
|
|
39
|
+
currentIsCheckedEconomic: boolean;
|
|
40
|
+
setCurrentIsCheckedEconomic: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
41
|
+
/** 经济责任人(一级责任人)是否选中更改时触发 */
|
|
42
|
+
onCheckedEconomicChange: (this: any, e: any) => void;
|
|
43
|
+
/** 清空内部数据的方法,在某些情况下,可能要清空当前选中的电子印章数据、是否加盖一级责任人数据 */
|
|
44
|
+
onClearElectronListData: () => {
|
|
45
|
+
electronicSealIdList: any[];
|
|
46
|
+
isCheckedEconomic: boolean;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import useMemoizedFn from '../../utils/useMemoizedFn';
|
|
4
|
+
/**
|
|
5
|
+
* 电子印章列表选择相关数据 经过处理逻辑后 返回对应数据
|
|
6
|
+
*/
|
|
7
|
+
export default function useParseElectronListData(options) {
|
|
8
|
+
var isUnControlled = options.isUnControlled, onValueChange = options.onValueChange, dataType = options.dataType, electronicSealIdList = options.electronicSealIdList, isCheckedEconomic = options.isCheckedEconomic, docAttachMap = options.docAttachMap;
|
|
9
|
+
// 当前选中电子印章数据
|
|
10
|
+
var _a = useState(function () {
|
|
11
|
+
return electronicSealIdList;
|
|
12
|
+
}), currentCheckedElectronicSealIdList = _a[0], setCurrentCheckedElectronicSealIdList = _a[1];
|
|
13
|
+
// 电子印章改变时触发
|
|
14
|
+
var onElectronicSealIdChange = useMemoizedFn(function (e, isChange) {
|
|
15
|
+
var _a;
|
|
16
|
+
if (isChange === void 0) { isChange = true; }
|
|
17
|
+
// 大多数情况下 当 onChange 触发时,需要判断
|
|
18
|
+
// 1. 非受控模式。那么组件内部应该直接进行控件 value 值的切换
|
|
19
|
+
// 2. 受控模式。那么组件内部的值应该由外部的 props 中的 value 决定而不应该自主切换。
|
|
20
|
+
// if (isUnControlled) {
|
|
21
|
+
setCurrentCheckedElectronicSealIdList(e);
|
|
22
|
+
// }
|
|
23
|
+
if (!dataType) {
|
|
24
|
+
console.log(i18next.t('必须传入数据类型'));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (isChange) {
|
|
28
|
+
onValueChange &&
|
|
29
|
+
onValueChange((_a = {}, _a[dataType] = { electronicSealIdList: e }, _a));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
// 是否加盖责任人手签章
|
|
33
|
+
var isCheckedEconomicBoolean = isCheckedEconomic + '' === '1'; // 默认是加盖的
|
|
34
|
+
var _b = useState(function () {
|
|
35
|
+
var getEconomicBoolean = getIsCheckedEconomic(docAttachMap);
|
|
36
|
+
return getEconomicBoolean === null
|
|
37
|
+
? isCheckedEconomicBoolean
|
|
38
|
+
: getEconomicBoolean;
|
|
39
|
+
}), currentIsCheckedEconomic = _b[0], setCurrentIsCheckedEconomic = _b[1];
|
|
40
|
+
// 加盖责任人手签章改变时触发
|
|
41
|
+
var onCheckedEconomicChange = useMemoizedFn(function (e) {
|
|
42
|
+
var _a;
|
|
43
|
+
// 大多数情况下 当 onChange 触发时,需要判断
|
|
44
|
+
// 1. 非受控模式。那么组件内部应该直接进行控件 value 值的切换
|
|
45
|
+
// 2. 受控模式。那么组件内部的值应该由外部的 props 中的 value 决定而不应该自主切换。
|
|
46
|
+
// if (isUnControlled) {
|
|
47
|
+
setCurrentIsCheckedEconomic(e.target.checked);
|
|
48
|
+
// }
|
|
49
|
+
if (!dataType) {
|
|
50
|
+
console.log(i18next.t('必须传入数据类型'));
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
onValueChange &&
|
|
54
|
+
onValueChange((_a = {},
|
|
55
|
+
_a[dataType] = { isCheckedEconomic: e.target.checked },
|
|
56
|
+
_a));
|
|
57
|
+
});
|
|
58
|
+
// 暴露一个清空内部数据的方法
|
|
59
|
+
var onClearElectronListData = useMemoizedFn(function () {
|
|
60
|
+
// if (isUnControlled) {
|
|
61
|
+
setCurrentCheckedElectronicSealIdList([]);
|
|
62
|
+
setCurrentIsCheckedEconomic(false);
|
|
63
|
+
// }
|
|
64
|
+
return {
|
|
65
|
+
electronicSealIdList: [],
|
|
66
|
+
isCheckedEconomic: false,
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* 如果是受控模式的话,直接将props的值 赋值给 内部变量
|
|
71
|
+
*/
|
|
72
|
+
useEffect(function () {
|
|
73
|
+
// if (!isUnControlled) {
|
|
74
|
+
setCurrentCheckedElectronicSealIdList(electronicSealIdList);
|
|
75
|
+
// }
|
|
76
|
+
}, [isUnControlled, electronicSealIdList]);
|
|
77
|
+
useEffect(function () {
|
|
78
|
+
// if (!isUnControlled) {
|
|
79
|
+
var getEconomicBoolean = getIsCheckedEconomic(docAttachMap);
|
|
80
|
+
setCurrentIsCheckedEconomic(getEconomicBoolean === null
|
|
81
|
+
? isCheckedEconomicBoolean
|
|
82
|
+
: getEconomicBoolean);
|
|
83
|
+
// }
|
|
84
|
+
}, [isUnControlled, isCheckedEconomicBoolean, docAttachMap]);
|
|
85
|
+
return {
|
|
86
|
+
/** 当前选中的电子印章数据 */
|
|
87
|
+
currentCheckedElectronicSealIdList: currentCheckedElectronicSealIdList,
|
|
88
|
+
/** 电子印章更改时触发 */
|
|
89
|
+
onElectronicSealIdChange: onElectronicSealIdChange,
|
|
90
|
+
/** 当前是否需要经济责任人(一级责任人) */
|
|
91
|
+
currentIsCheckedEconomic: currentIsCheckedEconomic,
|
|
92
|
+
setCurrentIsCheckedEconomic: setCurrentIsCheckedEconomic,
|
|
93
|
+
/** 经济责任人(一级责任人)是否选中更改时触发 */
|
|
94
|
+
onCheckedEconomicChange: onCheckedEconomicChange,
|
|
95
|
+
/** 清空内部数据的方法,在某些情况下,可能要清空当前选中的电子印章数据、是否加盖一级责任人数据 */
|
|
96
|
+
onClearElectronListData: onClearElectronListData,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
// 解析文档数据 判断是否需要经济责任人(一级责任人)
|
|
100
|
+
function getIsCheckedEconomic(docAttachMap) {
|
|
101
|
+
if (typeof docAttachMap === 'string' && docAttachMap.length > 0) {
|
|
102
|
+
var _isEconomic = Object.entries(JSON.parse(docAttachMap)).find(function (_a) {
|
|
103
|
+
var key = _a[0], value = _a[1];
|
|
104
|
+
return key === 'needYjzrr';
|
|
105
|
+
});
|
|
106
|
+
if (_isEconomic) {
|
|
107
|
+
return _isEconomic[1] === 'false' || !_isEconomic[1] ? false : true;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IElectronSignaturesProps, IElectronSignaturesItem, IAppointSignLocationOptions } from '../interface';
|
|
3
|
+
import type { SpinProps } from 'antd/es/spin';
|
|
4
|
+
interface IOptions {
|
|
5
|
+
/**
|
|
6
|
+
* 是否开启非受控模式
|
|
7
|
+
* 非受控模式开启后,数值的改变交由内部控制。外部只需要在合适的时机 获取数据即可
|
|
8
|
+
*/
|
|
9
|
+
isUnControlled?: IElectronSignaturesProps['isUnControlled'];
|
|
10
|
+
/**
|
|
11
|
+
* 触发外部onChange事件
|
|
12
|
+
*/
|
|
13
|
+
onValueChange?: IElectronSignaturesItem['onValueChange'];
|
|
14
|
+
/**
|
|
15
|
+
* 当前数据类型
|
|
16
|
+
*/
|
|
17
|
+
dataType?: IElectronSignaturesItem['dataType'];
|
|
18
|
+
/**
|
|
19
|
+
* 请求方法
|
|
20
|
+
*/
|
|
21
|
+
request?: IElectronSignaturesProps['request'];
|
|
22
|
+
setLoading?: React.Dispatch<React.SetStateAction<SpinProps | undefined>>;
|
|
23
|
+
/**
|
|
24
|
+
* 新附件
|
|
25
|
+
*/
|
|
26
|
+
records?: IElectronSignaturesItem['fileList'];
|
|
27
|
+
/**
|
|
28
|
+
* 部门id
|
|
29
|
+
*/
|
|
30
|
+
deptId?: IElectronSignaturesItem['deptId'];
|
|
31
|
+
/**
|
|
32
|
+
* 二级单元id
|
|
33
|
+
*/
|
|
34
|
+
secondDepId?: IElectronSignaturesItem['secondDepId'];
|
|
35
|
+
/**
|
|
36
|
+
* 合同id
|
|
37
|
+
*/
|
|
38
|
+
contractId?: IElectronSignaturesItem['contractId'];
|
|
39
|
+
/**
|
|
40
|
+
* 文档id列表
|
|
41
|
+
*/
|
|
42
|
+
documentIdList?: IElectronSignaturesItem['documentIdList'];
|
|
43
|
+
/**
|
|
44
|
+
* 后台用于维护当前合同id下附件id(key)与文档id(value)的关系map 后台解绑文档时使用
|
|
45
|
+
*/
|
|
46
|
+
docAttachMap?: IElectronSignaturesItem['docAttachMap'];
|
|
47
|
+
/**
|
|
48
|
+
* 当前选中的电子印章数据
|
|
49
|
+
*/
|
|
50
|
+
electronicSealIdList?: IElectronSignaturesItem['electronicSealIdList'];
|
|
51
|
+
/**
|
|
52
|
+
* 当前是否需要一级责任人
|
|
53
|
+
*/
|
|
54
|
+
isCheckedEconomic?: boolean;
|
|
55
|
+
setCurrentIsCheckedEconomic?: any;
|
|
56
|
+
/**
|
|
57
|
+
* 是否可以编辑 1 可以编辑 0 不可编辑
|
|
58
|
+
*/
|
|
59
|
+
canEdit?: IElectronSignaturesItem['canEdit'];
|
|
60
|
+
/**
|
|
61
|
+
* 流程状态
|
|
62
|
+
*/
|
|
63
|
+
flowStatus?: IElectronSignaturesItem['flowStatus'];
|
|
64
|
+
onElectronicSealIdChange?: any;
|
|
65
|
+
/**
|
|
66
|
+
* 电子印章列表(用于校验必须共同使用逻辑)
|
|
67
|
+
*/
|
|
68
|
+
electronList?: any[];
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 电子印章设置相关操作
|
|
72
|
+
*/
|
|
73
|
+
export default function useParseElectronSetting(options: IOptions): {
|
|
74
|
+
/** 点击签署位置 实时记录点击时的印章列表 */
|
|
75
|
+
clickElectronicSealIdList: string[];
|
|
76
|
+
/** 当前合同id数据 */
|
|
77
|
+
currentContractId: any;
|
|
78
|
+
setCurrentContractId: React.Dispatch<any>;
|
|
79
|
+
/** 当前合同id下 附件与文档的关联关系 */
|
|
80
|
+
currentDocAttachMap: any;
|
|
81
|
+
setCurrentDocAttachMap: React.Dispatch<any>;
|
|
82
|
+
/** 当前文档列表数据 */
|
|
83
|
+
currentDocumentIdList: any;
|
|
84
|
+
setCurrentDocumentIdList: React.Dispatch<any>;
|
|
85
|
+
/** 指定签署位置 */
|
|
86
|
+
appointSignLocation: (options?: IAppointSignLocationOptions) => void;
|
|
87
|
+
/** 预览盖章效果 */
|
|
88
|
+
viewSignPage: () => void;
|
|
89
|
+
/** 暴露一个清空数据的方法 */
|
|
90
|
+
onClearElectronSetting: () => {
|
|
91
|
+
contractId: any;
|
|
92
|
+
docAttachMap: any;
|
|
93
|
+
documentIdList: any[];
|
|
94
|
+
};
|
|
95
|
+
/** 查询未确认盖章位置的印章信息列表 */
|
|
96
|
+
checkUnStampedSealList: () => any;
|
|
97
|
+
/** 未确认盖章信息的电子印章列表 */
|
|
98
|
+
unElectronicSealList: any;
|
|
99
|
+
/** 未确认盖章信息的电子印章id列表 */
|
|
100
|
+
unElectronicSealIdList: any;
|
|
101
|
+
};
|
|
102
|
+
export {};
|
|
@@ -0,0 +1,365 @@
|
|
|
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, useMemo, useState } from 'react';
|
|
14
|
+
import { unstable_batchedUpdates } from 'react-dom';
|
|
15
|
+
import { message } from '../../../index';
|
|
16
|
+
import useMemoizedFn from '../../utils/useMemoizedFn';
|
|
17
|
+
import { isFlowCompleted } from '../utils';
|
|
18
|
+
import useServiceName from '../../../hooks/useServiceName';
|
|
19
|
+
/**
|
|
20
|
+
* 电子印章设置相关操作
|
|
21
|
+
*/
|
|
22
|
+
export default function useParseElectronSetting(options) {
|
|
23
|
+
var _a = (useServiceName() || {}).scmServiceName, scmServiceName = _a === void 0 ? '/zmdms-scm-system' : _a;
|
|
24
|
+
var isUnControlled = options.isUnControlled, onValueChange = options.onValueChange, dataType = options.dataType, request = options.request, setLoading = options.setLoading, records = options.records, deptId = options.deptId, secondDepId = options.secondDepId, contractId = options.contractId, docAttachMap = options.docAttachMap, documentIdList = options.documentIdList, electronicSealIdList = options.electronicSealIdList, isCheckedEconomic = options.isCheckedEconomic, setCurrentIsCheckedEconomic = options.setCurrentIsCheckedEconomic, canEdit = options.canEdit, flowStatus = options.flowStatus, onElectronicSealIdChange = options.onElectronicSealIdChange, electronList = options.electronList;
|
|
25
|
+
// 点击签署位置 实时记录点击时的印章列表
|
|
26
|
+
var _b = useState(), clickElectronicSealIdList = _b[0], setClickElectronicSealIdList = _b[1];
|
|
27
|
+
// 当前合同id数据
|
|
28
|
+
var _c = useState(function () {
|
|
29
|
+
return contractId;
|
|
30
|
+
}), currentContractId = _c[0], setCurrentContractId = _c[1];
|
|
31
|
+
// 当前合同id下 附件与文档的关联关系
|
|
32
|
+
var _d = useState(function () {
|
|
33
|
+
return docAttachMap;
|
|
34
|
+
}), currentDocAttachMap = _d[0], setCurrentDocAttachMap = _d[1];
|
|
35
|
+
// 当前文档列表数据
|
|
36
|
+
var _e = useState(function () {
|
|
37
|
+
return documentIdList;
|
|
38
|
+
}), currentDocumentIdList = _e[0], setCurrentDocumentIdList = _e[1];
|
|
39
|
+
// 未确认盖章位置的印章信息列表
|
|
40
|
+
var _f = useState([]), unElectronicSealList = _f[0], setUnElectronicSealList = _f[1];
|
|
41
|
+
var unElectronicSealIdList = useMemo(function () {
|
|
42
|
+
return unElectronicSealList.map(function (item) { return item.sealId; });
|
|
43
|
+
}, [unElectronicSealList]);
|
|
44
|
+
// 暴露一个清空内部数据的方法
|
|
45
|
+
var onClearElectronSetting = useMemoizedFn(function () {
|
|
46
|
+
// if (isUnControlled) {
|
|
47
|
+
setCurrentContractId(undefined);
|
|
48
|
+
setCurrentDocAttachMap(null);
|
|
49
|
+
setCurrentDocumentIdList([]);
|
|
50
|
+
// }
|
|
51
|
+
return {
|
|
52
|
+
contractId: undefined,
|
|
53
|
+
docAttachMap: null,
|
|
54
|
+
documentIdList: [],
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
// 指定签署位置
|
|
58
|
+
var appointSignLocation = useMemoizedFn(function (options) {
|
|
59
|
+
var _a = options || {}, callback = _a.callback, _b = _a.otherParams, otherParams = _b === void 0 ? {} : _b, isCheckUnStampedSeal = _a.isCheckUnStampedSeal, _c = _a.spinningTip, spinningTip = _c === void 0 ? i18next.t('指定签署位置中...') : _c;
|
|
60
|
+
// 选出选了盖电子印章的附件数据
|
|
61
|
+
if (!Array.isArray(records)) {
|
|
62
|
+
console.log(i18next.t('没有选中需要盖电子印章的数据!'));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// 没有选择印章
|
|
66
|
+
if (!Array.isArray(electronicSealIdList) ||
|
|
67
|
+
(electronicSealIdList === null || electronicSealIdList === void 0 ? void 0 : electronicSealIdList.length) <= 0) {
|
|
68
|
+
console.log(i18next.t('没有选择电子印章!'));
|
|
69
|
+
message.error(i18next.t('没有选择需要盖章的电子印章!'));
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
// 校验带有"必须共同使用"标识的印章(mustUseWithOthers + useWithSealIds)
|
|
73
|
+
if (Array.isArray(electronList) && electronicSealIdList.length > 0) {
|
|
74
|
+
var selectedSealIds_1 = new Set(electronicSealIdList.map(function (id) { return id + ''; }));
|
|
75
|
+
for (var _i = 0, electronList_1 = electronList; _i < electronList_1.length; _i++) {
|
|
76
|
+
var seal = electronList_1[_i];
|
|
77
|
+
if (selectedSealIds_1.has(seal.sealId + '') &&
|
|
78
|
+
seal.mustUseWithOthers &&
|
|
79
|
+
seal.useWithSealIds) {
|
|
80
|
+
var requiredIds = seal.useWithSealIds
|
|
81
|
+
.split(',')
|
|
82
|
+
.map(function (id) { return id.trim(); })
|
|
83
|
+
.filter(Boolean);
|
|
84
|
+
var hasMatch = requiredIds.some(function (id) { return selectedSealIds_1.has(id); });
|
|
85
|
+
if (!hasMatch) {
|
|
86
|
+
var msg = i18next.t('当前所选的{{sealName}},要求必须和{{requiredSealNames}}其中之一一起使用,请重新勾选印章。', {
|
|
87
|
+
sealName: seal.sealName,
|
|
88
|
+
requiredSealNames: seal.useWithSealNames,
|
|
89
|
+
});
|
|
90
|
+
message.warning(msg);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// 找到需要盖章的附件
|
|
97
|
+
var currentCheckedElectronAttachIds = [];
|
|
98
|
+
// 处理一些异常情况。有附件数据 但是没有附件id
|
|
99
|
+
var isError = false;
|
|
100
|
+
records.forEach(function (record, index) {
|
|
101
|
+
if (!record.isElectronicSeal) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (!record.attachId && !isError) {
|
|
105
|
+
message.error(i18next.t('第{{slot0}}行附件没有附件id,无法盖章!', {
|
|
106
|
+
slot0: index + 1,
|
|
107
|
+
}));
|
|
108
|
+
isError = true;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
currentCheckedElectronAttachIds.push(record.attachId);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
if (isError) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
setLoading === null || setLoading === void 0 ? void 0 : setLoading({
|
|
118
|
+
spinning: true,
|
|
119
|
+
tip: spinningTip,
|
|
120
|
+
});
|
|
121
|
+
var params = __assign({ attachIdList: [], sealIdList: electronicSealIdList, deleteAttachIdList: [], docAttachMap: currentDocAttachMap, deptId: deptId,
|
|
122
|
+
secondDepId: secondDepId, needYjzrr: isCheckedEconomic }, otherParams);
|
|
123
|
+
// 更新最新的电子印章选中列表
|
|
124
|
+
var newSealIdList = params.sealIdList;
|
|
125
|
+
setClickElectronicSealIdList(newSealIdList);
|
|
126
|
+
// 盖过章的附件列表
|
|
127
|
+
var stampedAttachIdList = getStampedAttachIdListByMap(currentDocAttachMap);
|
|
128
|
+
// 这里参考之前的逻辑处理(不知道为什么这里没有处理印章逻辑 如果前后的印章不一致 应该也要重新勾选才是)
|
|
129
|
+
// (前后印章不同的逻辑 是在提交的时候处理的,会弹出一个模态框)
|
|
130
|
+
// 如果有合同id 传入合同id
|
|
131
|
+
// 有合同id 表明之前已经签署过位置了
|
|
132
|
+
// 需要处理下签署前后的附件数据
|
|
133
|
+
if (currentContractId) {
|
|
134
|
+
params.contractId = currentContractId;
|
|
135
|
+
// 找出此次新增加的附件
|
|
136
|
+
if (stampedAttachIdList.length === 0) {
|
|
137
|
+
params.attachIdList = currentCheckedElectronAttachIds;
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
params.attachIdList = currentCheckedElectronAttachIds.filter(function (attachId) { return !stampedAttachIdList.includes(attachId); });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
params.attachIdList = currentCheckedElectronAttachIds;
|
|
145
|
+
}
|
|
146
|
+
// 找到需要删除的附件(之前已经盖了章的附件,但是本次没有选中盖电子印章的按钮)
|
|
147
|
+
// 已盖章的附件id列表中筛选出要删除的附件id列表
|
|
148
|
+
if (Array.isArray(stampedAttachIdList)) {
|
|
149
|
+
stampedAttachIdList.forEach(function (n) {
|
|
150
|
+
if (currentCheckedElectronAttachIds.length !== 0 &&
|
|
151
|
+
!currentCheckedElectronAttachIds.includes(n)) {
|
|
152
|
+
params.deleteAttachIdList.push(n);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
request({
|
|
157
|
+
url: "/api" + scmServiceName + "/seal/confirm-seal-info",
|
|
158
|
+
method: 'POST',
|
|
159
|
+
timeout: 90000,
|
|
160
|
+
data: params,
|
|
161
|
+
})
|
|
162
|
+
.then(function (res) {
|
|
163
|
+
unstable_batchedUpdates(function () {
|
|
164
|
+
var _a;
|
|
165
|
+
setLoading === null || setLoading === void 0 ? void 0 : setLoading({
|
|
166
|
+
spinning: false,
|
|
167
|
+
});
|
|
168
|
+
if (res.status === 200 &&
|
|
169
|
+
res.data.code === 200 &&
|
|
170
|
+
res.data.data.preSignUrl) {
|
|
171
|
+
// 更新一些数据
|
|
172
|
+
var newContractId = res.data.data.contractId; // 新合同id
|
|
173
|
+
var newDocAttachMap = res.data.data.docAttachMap; // 新文档对应关系(附件:合同id)
|
|
174
|
+
var newDocumentIdList = getDocumentIdListByMap(newDocAttachMap); // 新文档id列表
|
|
175
|
+
// 非受控模式 设置下内部数据
|
|
176
|
+
// 受控模式 会在effect中进行处理
|
|
177
|
+
// if (isUnControlled) {
|
|
178
|
+
setCurrentContractId(newContractId);
|
|
179
|
+
setCurrentDocAttachMap(newDocAttachMap);
|
|
180
|
+
setCurrentDocumentIdList(newDocumentIdList);
|
|
181
|
+
onElectronicSealIdChange(newSealIdList, false);
|
|
182
|
+
// }
|
|
183
|
+
if (otherParams.needYjzrr !== undefined) {
|
|
184
|
+
setCurrentIsCheckedEconomic(otherParams.needYjzrr);
|
|
185
|
+
}
|
|
186
|
+
callback === null || callback === void 0 ? void 0 : callback({
|
|
187
|
+
checkAttachIdList: currentCheckedElectronAttachIds,
|
|
188
|
+
contractId: newContractId,
|
|
189
|
+
docAttachMap: newDocAttachMap,
|
|
190
|
+
documentIdList: newDocumentIdList,
|
|
191
|
+
});
|
|
192
|
+
// 更改当前数据
|
|
193
|
+
if (dataType) {
|
|
194
|
+
onValueChange &&
|
|
195
|
+
onValueChange((_a = {},
|
|
196
|
+
_a[dataType] = {
|
|
197
|
+
checkAttachIdList: currentCheckedElectronAttachIds,
|
|
198
|
+
contractId: newContractId,
|
|
199
|
+
docAttachMap: newDocAttachMap,
|
|
200
|
+
documentIdList: newDocumentIdList,
|
|
201
|
+
// 在这里更改下是否加盖一级责任人数据
|
|
202
|
+
isCheckedEconomic: params.needYjzrr,
|
|
203
|
+
electronicSealIdList: newSealIdList,
|
|
204
|
+
},
|
|
205
|
+
_a));
|
|
206
|
+
}
|
|
207
|
+
// 需要跳转到契约锁重新指定签署位置
|
|
208
|
+
// 如果需要检测是否还有 未确认盖章位置的印章信息列表
|
|
209
|
+
if (isCheckUnStampedSeal) {
|
|
210
|
+
if (unElectronicSealList.length > 0) {
|
|
211
|
+
window.open(res.data.data.preSignUrl);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
window.open(res.data.data.preSignUrl);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
message.error(res.data.msg || i18next.t('出错了'));
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
})
|
|
223
|
+
.catch(function (error) {
|
|
224
|
+
var _a, _b;
|
|
225
|
+
setLoading === null || setLoading === void 0 ? void 0 : setLoading({
|
|
226
|
+
spinning: false,
|
|
227
|
+
});
|
|
228
|
+
message.error(((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || i18next.t('请求失败!'));
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
// 预览盖章签署效果
|
|
232
|
+
var viewSignPage = useMemoizedFn(function () {
|
|
233
|
+
if (!currentContractId) {
|
|
234
|
+
message.error(i18next.t('缺少合同id,可能的原因:暂未指定签署位置,请重新指定!'));
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
request({
|
|
238
|
+
url: "/api" + scmServiceName + "/seal/view-seal-state",
|
|
239
|
+
// 这里有一个逻辑,后端判断流程是否完结。是flowStatus === '15' 或者 canEdit === '0'
|
|
240
|
+
data: {
|
|
241
|
+
contractId: currentContractId,
|
|
242
|
+
canEdit: canEdit,
|
|
243
|
+
flowStatus: isFlowCompleted(flowStatus) ? flowStatus : '15',
|
|
244
|
+
},
|
|
245
|
+
method: 'POST',
|
|
246
|
+
})
|
|
247
|
+
.then(function (res) {
|
|
248
|
+
if (res.status === 200 &&
|
|
249
|
+
res.data.code === 200 &&
|
|
250
|
+
res.data.data.viewUrl) {
|
|
251
|
+
window.open(res.data.data.viewUrl);
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
message.error(res.data.msg || i18next.t('出错了'));
|
|
255
|
+
}
|
|
256
|
+
})
|
|
257
|
+
.catch(function (error) {
|
|
258
|
+
var _a, _b;
|
|
259
|
+
message.error(((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || i18next.t('请求失败!'));
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
// 查询未确认盖章位置的印章信息列表
|
|
263
|
+
var checkUnStampedSealList = useMemoizedFn(function () {
|
|
264
|
+
return request({
|
|
265
|
+
url: "/api" + scmServiceName + "/seal/query-unconfirmed-position-seal-list",
|
|
266
|
+
data: {
|
|
267
|
+
contractId: currentContractId,
|
|
268
|
+
sealIdList: electronicSealIdList,
|
|
269
|
+
deptId: deptId,
|
|
270
|
+
secondDepId: secondDepId,
|
|
271
|
+
needYjzrr: isCheckedEconomic,
|
|
272
|
+
},
|
|
273
|
+
method: 'POST',
|
|
274
|
+
})
|
|
275
|
+
.then(function (res) {
|
|
276
|
+
var _a;
|
|
277
|
+
if ((res === null || res === void 0 ? void 0 : res.status) === 200 && ((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.code) === 200) {
|
|
278
|
+
var noSealList = res.data.data;
|
|
279
|
+
if (Array.isArray(noSealList) && noSealList.length > 0) {
|
|
280
|
+
setUnElectronicSealList(noSealList);
|
|
281
|
+
return Promise.resolve(false);
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
return Promise.resolve(true);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
})
|
|
288
|
+
.catch(function (error) {
|
|
289
|
+
var _a, _b;
|
|
290
|
+
message.error(((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || i18next.t('请求失败!'));
|
|
291
|
+
return Promise.resolve(false);
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
/**
|
|
295
|
+
* 如果是受控模式的话,直接将props的值 赋值给 内部变量
|
|
296
|
+
*/
|
|
297
|
+
useEffect(function () {
|
|
298
|
+
// if (!isUnControlled) {
|
|
299
|
+
setCurrentContractId(contractId);
|
|
300
|
+
// }
|
|
301
|
+
}, [isUnControlled, contractId]);
|
|
302
|
+
useEffect(function () {
|
|
303
|
+
// if (!isUnControlled) {
|
|
304
|
+
setCurrentDocAttachMap(docAttachMap);
|
|
305
|
+
// }
|
|
306
|
+
}, [isUnControlled, docAttachMap]);
|
|
307
|
+
useEffect(function () {
|
|
308
|
+
// if (!isUnControlled) {
|
|
309
|
+
setCurrentDocumentIdList(documentIdList);
|
|
310
|
+
// }
|
|
311
|
+
}, [isUnControlled, documentIdList]);
|
|
312
|
+
return {
|
|
313
|
+
/** 点击签署位置 实时记录点击时的印章列表 */
|
|
314
|
+
clickElectronicSealIdList: clickElectronicSealIdList,
|
|
315
|
+
/** 当前合同id数据 */
|
|
316
|
+
currentContractId: currentContractId,
|
|
317
|
+
setCurrentContractId: setCurrentContractId,
|
|
318
|
+
/** 当前合同id下 附件与文档的关联关系 */
|
|
319
|
+
currentDocAttachMap: currentDocAttachMap,
|
|
320
|
+
setCurrentDocAttachMap: setCurrentDocAttachMap,
|
|
321
|
+
/** 当前文档列表数据 */
|
|
322
|
+
currentDocumentIdList: currentDocumentIdList,
|
|
323
|
+
setCurrentDocumentIdList: setCurrentDocumentIdList,
|
|
324
|
+
/** 指定签署位置 */
|
|
325
|
+
appointSignLocation: appointSignLocation,
|
|
326
|
+
/** 预览盖章效果 */
|
|
327
|
+
viewSignPage: viewSignPage,
|
|
328
|
+
/** 暴露一个清空数据的方法 */
|
|
329
|
+
onClearElectronSetting: onClearElectronSetting,
|
|
330
|
+
/** 查询未确认盖章位置的印章信息列表 */
|
|
331
|
+
checkUnStampedSealList: checkUnStampedSealList,
|
|
332
|
+
/** 未确认盖章信息的电子印章列表 */
|
|
333
|
+
unElectronicSealList: unElectronicSealList,
|
|
334
|
+
/** 未确认盖章信息的电子印章id列表 */
|
|
335
|
+
unElectronicSealIdList: unElectronicSealIdList,
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
/** 根据文档 附件对应关系 获取已盖章的附件id列表 */
|
|
339
|
+
function getStampedAttachIdListByMap(currentDocAttachMap) {
|
|
340
|
+
if (currentDocAttachMap) {
|
|
341
|
+
try {
|
|
342
|
+
return Object.keys(JSON.parse(currentDocAttachMap)).filter(function (key) { return key !== 'needYjzrr'; });
|
|
343
|
+
}
|
|
344
|
+
catch (err) {
|
|
345
|
+
return [];
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return [];
|
|
349
|
+
}
|
|
350
|
+
/** 根据文档 附件对应关系 获取文档id列表 */
|
|
351
|
+
function getDocumentIdListByMap(currentDocAttachMap) {
|
|
352
|
+
if (currentDocAttachMap) {
|
|
353
|
+
try {
|
|
354
|
+
var map_1 = JSON.parse(currentDocAttachMap);
|
|
355
|
+
var keys = Object.keys(map_1).filter(function (key) { return key !== 'needYjzrr'; });
|
|
356
|
+
return keys.map(function (key) {
|
|
357
|
+
return map_1[key];
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
catch (err) {
|
|
361
|
+
return [];
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
return [];
|
|
365
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IElectronSignaturesProps, IElectronSignaturesItem } from '../interface';
|
|
2
|
+
interface IOptions {
|
|
3
|
+
/**
|
|
4
|
+
* 是否开启非受控模式
|
|
5
|
+
* 非受控模式开启后,数值的改变交由内部控制。外部只需要在合适的时机 获取数据即可
|
|
6
|
+
*/
|
|
7
|
+
isUnControlled?: IElectronSignaturesProps['isUnControlled'];
|
|
8
|
+
/**
|
|
9
|
+
* 触发外部onChange事件
|
|
10
|
+
*/
|
|
11
|
+
onValueChange?: IElectronSignaturesItem['onValueChange'];
|
|
12
|
+
/**
|
|
13
|
+
* 当前数据类型
|
|
14
|
+
*/
|
|
15
|
+
dataType?: IElectronSignaturesItem['dataType'];
|
|
16
|
+
/**
|
|
17
|
+
* 新附件
|
|
18
|
+
*/
|
|
19
|
+
records?: IElectronSignaturesItem['fileList'];
|
|
20
|
+
setRecords?: any;
|
|
21
|
+
/** 清空已选印章相关数据 */
|
|
22
|
+
onClearElectronListData?: any;
|
|
23
|
+
/** 清空已盖印章相关数据 */
|
|
24
|
+
onClearElectronSetting?: any;
|
|
25
|
+
deptId?: any;
|
|
26
|
+
secondDepId?: any;
|
|
27
|
+
electronicSealIdList?: any;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 是否需要给附件加盖电子印章
|
|
31
|
+
*/
|
|
32
|
+
export default function useParseIsNeedElectronData(options: IOptions): {
|
|
33
|
+
/** 是否加盖电子印章改变时触发 */
|
|
34
|
+
onIsStampElectronChange: (this: any, checked: any, index: any) => void;
|
|
35
|
+
/** 当前列表数据中 是否有选择加盖电子印章的数据 */
|
|
36
|
+
isStampElectron: boolean;
|
|
37
|
+
/** 清空数据 */
|
|
38
|
+
clearAllElectronDataHandler: (this: any, dataType: any) => void;
|
|
39
|
+
};
|
|
40
|
+
export {};
|