zmdms-webui 3.1.7 → 3.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/applayoutsider/menu/MainMenu.js +1 -1
- package/dist/es/applayoutsider/menu/SubMenu.js +8 -1
- package/dist/es/canvastable/canvasTable.js +1 -0
- package/dist/es/config/MyStorage.js +11 -5
- package/dist/es/config/ZtxkContext.d.ts +10 -0
- package/dist/es/config/ZtxkContext.js +2 -0
- package/dist/es/config/index.js +1 -0
- package/dist/es/config/utils.js +58 -1
- package/dist/es/dynamicsetting/dynamicDrawer.js +61 -19
- package/dist/es/dynamicsetting/dynamicSetting.js +4 -4
- package/dist/es/dynamicsetting/hooks.js +4 -4
- package/dist/es/dynamicsetting/index.css +1 -1
- package/dist/es/dynamicsetting/index.js +1 -0
- package/dist/es/dynamicsetting/interface.d.ts +5 -0
- package/dist/es/dynamicsetting/useDynamic.js +5 -1
- package/dist/es/dynamicsetting/useSearch.js +26 -6
- package/dist/es/dynamicsetting/useTemplate.d.ts +4 -0
- package/dist/es/dynamicsetting/useTemplate.js +428 -0
- package/dist/es/electronsignatures/content.js +974 -0
- package/dist/es/electronsignatures/dgcomponents/contract-comparison.js +2 -2
- package/dist/es/electronsignatures/dgcomponents/file-comparison-btn.js +136 -0
- package/dist/es/electronsignatures/dgcomponents/new-contract-comparison.js +54 -0
- package/dist/es/electronsignatures/dgcomponents/useContractColumns.js +110 -39
- package/dist/es/electronsignatures/electron-signatures-fragment.js +11 -3
- package/dist/es/electronsignatures/electroncomponents/electron-seal-batch-download.js +179 -67
- package/dist/es/electronsignatures/electroncomponents/electron-seal-detail.js +5 -5
- package/dist/es/electronsignatures/electroncomponents/electron-seal-item-detail.js +15 -0
- package/dist/es/electronsignatures/electroncomponents/electron-seal-item.js +9 -6
- package/dist/es/electronsignatures/electroncomponents/useElectronColumns.js +330 -154
- package/dist/es/electronsignatures/electroncomponents/useFetchElectronData.js +58 -9
- package/dist/es/electronsignatures/electroncomponents/utils.js +119 -28
- package/dist/es/electronsignatures/filecomponents/file-operation.js +6 -4
- package/dist/es/electronsignatures/filecomponents/new-file-operation.js +56 -0
- package/dist/es/electronsignatures/filecomponents/useFileColumns.js +179 -102
- package/dist/es/electronsignatures/hooks/useGetQjVerifyCode.js +134 -0
- package/dist/es/electronsignatures/hooks/useMergeRecords.js +4 -3
- package/dist/es/electronsignatures/hooks/useParseElectronSetting.js +5 -3
- package/dist/es/electronsignatures/hooks/useParseIsNeedElectronData.js +21 -2
- package/dist/es/electronsignatures/hooks/useParseQunjSingleData.js +6 -1
- package/dist/es/electronsignatures/hooks/useParseRecords.js +41 -34
- package/dist/es/electronsignatures/index.css +1 -1
- package/dist/es/electronsignatures/index.js +18 -833
- package/dist/es/electronsignatures/interface.d.ts +129 -5
- package/dist/es/electronsignatures/interface.js +9 -4
- package/dist/es/electronsignatures/qunjcomponents/qunj-check.js +2 -2
- package/dist/es/electronsignatures/qunjcomponents/qunj-detail.js +135 -14
- package/dist/es/electronsignatures/qunjcomponents/qunj-list.js +33 -13
- package/dist/es/electronsignatures/qunjcomponents/useFetchQunjData.js +8 -3
- package/dist/es/electronsignatures/qunjcomponents/useQunjColumns.js +202 -202
- package/dist/es/electronsignatures/translatecomponents/TranslateButton.js +27 -0
- package/dist/es/electronsignatures/translatecomponents/useTranslateCom.js +35 -0
- package/dist/es/form/common-search-list.js +28 -9
- package/dist/es/form/form.js +13 -11
- package/dist/es/form/useCommonSearch.js +3 -4
- package/dist/es/table/components/EnhanceBodyBasicCell.js +9 -0
- package/dist/es/table/components/useDragRef.js +6 -0
- package/dist/es/table/constant.js +4 -1
- package/dist/es/table/hooks/useCtrl.js +44 -0
- package/dist/es/table/hooks/useSelectSubtotal.js +376 -0
- package/dist/es/table/index.css +1 -1
- package/dist/es/table/interface.d.ts +6 -0
- package/dist/es/table/table.js +15 -3
- package/dist/index.build.d.ts +1 -0
- package/dist/index.dark.css +1 -1
- package/dist/index.default.css +1 -1
- package/dist/index.es.js +1 -0
- package/dist/less/components/DynamicSetting/style/index.less +38 -0
- package/dist/less/components/ElectronSignatures/style/index.less +37 -5
- package/dist/less/components/Table/style/index.less +41 -0
- package/package.json +1 -1
- package/dist/es/electronsignatures/electroncomponents/electron-seal-download.js +0 -74
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { useState, useMemo, useCallback, useEffect } from 'react';
|
|
2
|
+
import { getToken, parseToken } from 'zmdms-utils';
|
|
3
|
+
import myMessage from '../../message/index.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 根据规则获取群杰验证码
|
|
7
|
+
*/
|
|
8
|
+
function useGetQjVerifyCode(options) {
|
|
9
|
+
var allOptions = options.allOptions, request = options.request, isNewQys = options.isNewQys;
|
|
10
|
+
var _a = useState([]), qjVerifyCodeData = _a[0], setQjVerifyCodeData = _a[1];
|
|
11
|
+
// 根据allOptions解析出需要的参数
|
|
12
|
+
var params = useMemo(function () {
|
|
13
|
+
if (!isNewQys) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
if (Array.isArray(allOptions)) {
|
|
17
|
+
return allOptions
|
|
18
|
+
.filter(function (item) { return item.wfProcessInstId; })
|
|
19
|
+
.map(function (option) { return ({
|
|
20
|
+
verifyUserIds: option.verifyUserIds,
|
|
21
|
+
wfProcessInstId: option.wfProcessInstId,
|
|
22
|
+
isAuth: comparePermission(option.verifyUserIds),
|
|
23
|
+
}); });
|
|
24
|
+
}
|
|
25
|
+
if (allOptions && allOptions.wfProcessInstId) {
|
|
26
|
+
return [
|
|
27
|
+
{
|
|
28
|
+
verifyUserIds: allOptions.verifyUserIds,
|
|
29
|
+
wfProcessInstId: allOptions.wfProcessInstId,
|
|
30
|
+
isAuth: comparePermission(allOptions.verifyUserIds),
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
return [];
|
|
35
|
+
}, [allOptions, isNewQys]);
|
|
36
|
+
// 根据解析出来的参数,和当前用户信息,获取最终查询参数
|
|
37
|
+
var queryParams = useMemo(function () {
|
|
38
|
+
if (!isNewQys) {
|
|
39
|
+
return "";
|
|
40
|
+
}
|
|
41
|
+
if (params) {
|
|
42
|
+
return params
|
|
43
|
+
.filter(function (item) { return item.isAuth && item.wfProcessInstId; })
|
|
44
|
+
.map(function (item) { return item.wfProcessInstId; })
|
|
45
|
+
.join(",");
|
|
46
|
+
}
|
|
47
|
+
return "";
|
|
48
|
+
}, [params, isNewQys]);
|
|
49
|
+
var getQjVerifyCodeHandle = useCallback(function (queryParams) {
|
|
50
|
+
return request({
|
|
51
|
+
url: "/api/zmdms-resource/qjverificationcode/get-verify-code-by-processids?processIds=".concat(queryParams),
|
|
52
|
+
method: "get",
|
|
53
|
+
})
|
|
54
|
+
.then(function (res) {
|
|
55
|
+
if (res.status === 200 && res.data.code === 200) {
|
|
56
|
+
return res;
|
|
57
|
+
}
|
|
58
|
+
return Promise.reject(res);
|
|
59
|
+
})
|
|
60
|
+
.catch(function (error) {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
myMessage.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) || "群杰验证码请求失败!");
|
|
63
|
+
return Promise.reject(error);
|
|
64
|
+
});
|
|
65
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
66
|
+
}, []);
|
|
67
|
+
// 发出请求
|
|
68
|
+
useEffect(function () {
|
|
69
|
+
if (queryParams && isNewQys) {
|
|
70
|
+
getQjVerifyCodeHandle(queryParams)
|
|
71
|
+
.then(function (res) {
|
|
72
|
+
if (res.status === 200 && res.data.code === 200) {
|
|
73
|
+
setQjVerifyCodeData(res.data.data);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
// 接口请求失败时,将数据拆分一下,让各自的列表自行去重复上传
|
|
77
|
+
var list = queryParams.split(",");
|
|
78
|
+
setQjVerifyCodeData(list.map(function (item) {
|
|
79
|
+
return {
|
|
80
|
+
processId: item,
|
|
81
|
+
qjVerificationCode: "",
|
|
82
|
+
isError: true,
|
|
83
|
+
};
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
.catch(function (error) {
|
|
88
|
+
var _a, _b;
|
|
89
|
+
// 接口请求失败时,将数据拆分一下,让各自的列表自行去重复上传
|
|
90
|
+
var list = queryParams.split(",");
|
|
91
|
+
setQjVerifyCodeData(list.map(function (item) {
|
|
92
|
+
return {
|
|
93
|
+
processId: item,
|
|
94
|
+
qjVerificationCode: "",
|
|
95
|
+
isError: true,
|
|
96
|
+
};
|
|
97
|
+
}));
|
|
98
|
+
myMessage.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) || "群杰验证码请求失败!");
|
|
99
|
+
return Promise.reject(error);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
103
|
+
}, [queryParams, isNewQys]);
|
|
104
|
+
return {
|
|
105
|
+
qjVerifyCodeData: qjVerifyCodeData,
|
|
106
|
+
getQjVerifyCodeHandle: getQjVerifyCodeHandle,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* @returns 根据token获取用户信息
|
|
111
|
+
*/
|
|
112
|
+
function getUserInfoByToken() {
|
|
113
|
+
var token = getToken();
|
|
114
|
+
if (token) {
|
|
115
|
+
var userInfo = parseToken(token);
|
|
116
|
+
return userInfo;
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* 权限比对
|
|
122
|
+
*/
|
|
123
|
+
function comparePermission(permission) {
|
|
124
|
+
var userInfo = getUserInfoByToken();
|
|
125
|
+
if (userInfo && permission) {
|
|
126
|
+
var user_id = userInfo.user_id;
|
|
127
|
+
if (permission.includes(user_id)) {
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export { comparePermission, useGetQjVerifyCode as default, getUserInfoByToken };
|
|
@@ -5,19 +5,20 @@ import { currentRecordIsOnlyQunj } from '../utils.js';
|
|
|
5
5
|
* 将各级获取到的附件数据拉平成一个整体
|
|
6
6
|
*/
|
|
7
7
|
function useMergeRecords(options) {
|
|
8
|
-
var allData = options.allData, dataTypeSort = options.dataTypeSort, isDeleteAllFileWhenJustUseQj = options.isDeleteAllFileWhenJustUseQj, isDeletePlaceholderFileData = options.isDeletePlaceholderFileData;
|
|
8
|
+
var allData = options.allData, dataTypeSort = options.dataTypeSort, isDeleteAllFileWhenJustUseQj = options.isDeleteAllFileWhenJustUseQj, isDeletePlaceholderFileData = options.isDeletePlaceholderFileData, isSupportNoAttachQj = options.isSupportNoAttachQj;
|
|
9
9
|
var mergeRecords = useMemo(function () {
|
|
10
10
|
var allRecords = [];
|
|
11
11
|
dataTypeSort.forEach(function (dataType) {
|
|
12
12
|
var _a;
|
|
13
13
|
var records = ((_a = allData === null || allData === void 0 ? void 0 : allData[dataType]) === null || _a === void 0 ? void 0 : _a.records) || [];
|
|
14
|
-
|
|
14
|
+
// 这里不清楚为什么要过滤掉群杰印章的占位符??? 这里加个新属性,标识可以无附件时添加群杰印章
|
|
15
|
+
if (isDeletePlaceholderFileData && !isSupportNoAttachQj) {
|
|
15
16
|
records = records.filter(function (record) { return !currentRecordIsOnlyQunj(record); });
|
|
16
17
|
}
|
|
17
18
|
allRecords = allRecords.concat(records);
|
|
18
19
|
});
|
|
19
20
|
return allRecords;
|
|
20
|
-
}, [allData, dataTypeSort, isDeletePlaceholderFileData]);
|
|
21
|
+
}, [allData, dataTypeSort, isDeletePlaceholderFileData, isSupportNoAttachQj]);
|
|
21
22
|
// 是否仅选中群杰印章
|
|
22
23
|
var isQunjOnlyChecked = useMemo(function () {
|
|
23
24
|
return mergeRecords.some(function (record) { return currentRecordIsOnlyQunj(record); });
|
|
@@ -9,7 +9,7 @@ import myMessage from '../../message/index.js';
|
|
|
9
9
|
* 电子印章设置相关操作
|
|
10
10
|
*/
|
|
11
11
|
function useParseElectronSetting(options) {
|
|
12
|
-
var isUnControlled = options.isUnControlled, onValueChange = options.onValueChange, dataType = options.dataType, request = options.request, setLoading = options.setLoading, records = options.records, deptId = options.deptId, 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;
|
|
12
|
+
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;
|
|
13
13
|
// 点击签署位置 实时记录点击时的印章列表
|
|
14
14
|
var _a = useState(), clickElectronicSealIdList = _a[0], setClickElectronicSealIdList = _a[1];
|
|
15
15
|
// 当前合同id数据
|
|
@@ -53,7 +53,7 @@ function useParseElectronSetting(options) {
|
|
|
53
53
|
// 没有选择印章
|
|
54
54
|
if (!Array.isArray(electronicSealIdList) ||
|
|
55
55
|
(electronicSealIdList === null || electronicSealIdList === void 0 ? void 0 : electronicSealIdList.length) <= 0) {
|
|
56
|
-
console.log("
|
|
56
|
+
console.log("没有选择需要盖章的电子印章!");
|
|
57
57
|
myMessage.error("没有选择需要盖章的电子印章!");
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
@@ -80,7 +80,8 @@ function useParseElectronSetting(options) {
|
|
|
80
80
|
spinning: true,
|
|
81
81
|
tip: spinningTip,
|
|
82
82
|
});
|
|
83
|
-
var params = __assign({ attachIdList: [], sealIdList: electronicSealIdList, deleteAttachIdList: [], docAttachMap: currentDocAttachMap, deptId: deptId,
|
|
83
|
+
var params = __assign({ attachIdList: [], sealIdList: electronicSealIdList, deleteAttachIdList: [], docAttachMap: currentDocAttachMap, deptId: deptId, // 获取经济责任人签名需要传部门id
|
|
84
|
+
secondDepId: secondDepId, needYjzrr: isCheckedEconomic }, otherParams);
|
|
84
85
|
// 更新最新的电子印章选中列表
|
|
85
86
|
var newSealIdList = params.sealIdList;
|
|
86
87
|
setClickElectronicSealIdList(newSealIdList);
|
|
@@ -228,6 +229,7 @@ function useParseElectronSetting(options) {
|
|
|
228
229
|
contractId: currentContractId,
|
|
229
230
|
sealIdList: electronicSealIdList,
|
|
230
231
|
deptId: deptId,
|
|
232
|
+
secondDepId: secondDepId,
|
|
231
233
|
needYjzrr: isCheckedEconomic,
|
|
232
234
|
},
|
|
233
235
|
method: "POST",
|
|
@@ -7,7 +7,7 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
7
7
|
* 是否需要给附件加盖电子印章
|
|
8
8
|
*/
|
|
9
9
|
function useParseIsNeedElectronData(options) {
|
|
10
|
-
var onValueChange = options.onValueChange, records = options.records, dataType = options.dataType, setRecords = options.setRecords, onClearElectronListData = options.onClearElectronListData, onClearElectronSetting = options.onClearElectronSetting, deptId = options.deptId, electronicSealIdList = options.electronicSealIdList;
|
|
10
|
+
var onValueChange = options.onValueChange, records = options.records, dataType = options.dataType, setRecords = options.setRecords, onClearElectronListData = options.onClearElectronListData, onClearElectronSetting = options.onClearElectronSetting, deptId = options.deptId, secondDepId = options.secondDepId, electronicSealIdList = options.electronicSealIdList;
|
|
11
11
|
// 20241015: 这里的逻辑是。开发首次从没数据到有数据的过程中。
|
|
12
12
|
// 部门id会发生变化。这里的部门id变化是不需要清空契约锁数据的
|
|
13
13
|
// 这个地方需要组件内部处理下这个逻辑,虽然这个逻辑很奇怪
|
|
@@ -28,6 +28,23 @@ function useParseIsNeedElectronData(options) {
|
|
|
28
28
|
? item.defaultFmsIsElectronicSeal
|
|
29
29
|
: 1;
|
|
30
30
|
item.fmsIsElectronicSeal = checked ? defaultValue : 0;
|
|
31
|
+
// 20250422 盖户用合同章的逻辑与盖电子印章的逻辑互斥。
|
|
32
|
+
// 这里的逻辑是 如果勾选了我们自己的电子印章 那么默认不选中盖户用合同章
|
|
33
|
+
// const defaultOpeningContractSealValue =
|
|
34
|
+
// item.defaultOpeningContractSeal + '' === '1' ||
|
|
35
|
+
// item.defaultOpeningContractSeal + '' === '0'
|
|
36
|
+
// ? item.defaultOpeningContractSeal
|
|
37
|
+
// : 0;
|
|
38
|
+
// item.openingContractSeal = checked ? defaultOpeningContractSealValue : 0;
|
|
39
|
+
if (checked) {
|
|
40
|
+
item.openingContractSeal = 0;
|
|
41
|
+
}
|
|
42
|
+
// 这里的逻辑是 如果勾选了我们自己的电子印章 那么默认不选中推送银行
|
|
43
|
+
var defaultFmsIsPushBankValue = item.defaultFmsIsPushBank + "" === "1" ||
|
|
44
|
+
item.defaultFmsIsPushBank + "" === "0"
|
|
45
|
+
? item.defaultFmsIsPushBank
|
|
46
|
+
: 0;
|
|
47
|
+
item.fmsIsPushBank = checked ? defaultFmsIsPushBankValue : 0;
|
|
31
48
|
}
|
|
32
49
|
setRecords(newRecords);
|
|
33
50
|
if (!dataType) {
|
|
@@ -59,6 +76,8 @@ function useParseIsNeedElectronData(options) {
|
|
|
59
76
|
if (item) {
|
|
60
77
|
item.isElectronicSeal = 0;
|
|
61
78
|
item.fmsIsElectronicSeal = 0;
|
|
79
|
+
item.openingContractSeal = 0;
|
|
80
|
+
item.fmsIsPushBank = 0;
|
|
62
81
|
}
|
|
63
82
|
});
|
|
64
83
|
setRecords(newRecords);
|
|
@@ -97,7 +116,7 @@ function useParseIsNeedElectronData(options) {
|
|
|
97
116
|
clearAllElectronDataHandler(dataType);
|
|
98
117
|
}
|
|
99
118
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
100
|
-
}, [deptId]);
|
|
119
|
+
}, [deptId, secondDepId]);
|
|
101
120
|
return {
|
|
102
121
|
/** 是否加盖电子印章改变时触发 */
|
|
103
122
|
onIsStampElectronChange: onIsStampElectronChange,
|
|
@@ -69,7 +69,12 @@ function useParseQunjSingleData(options) {
|
|
|
69
69
|
// 只有当本次更新的群杰数据 和上次 更新时的群杰数据一致时,才更改
|
|
70
70
|
useEffect(function () {
|
|
71
71
|
var _a;
|
|
72
|
-
if (isSingleQj &&
|
|
72
|
+
if (isSingleQj &&
|
|
73
|
+
records &&
|
|
74
|
+
// 这里尝试修复一个bug。流程id和fileList同时设置时,records是通过setState设置的。会滞后
|
|
75
|
+
// 这里取到的records数据会不是最新的
|
|
76
|
+
records.length > 0 &&
|
|
77
|
+
records === recordsPrevious) {
|
|
73
78
|
console.log("-----修改流程id,清空契约锁数据-----");
|
|
74
79
|
var newRecords = cloneDeep((records === null || records === void 0 ? void 0 : records.slice()) || []);
|
|
75
80
|
newRecords.map(function (item) {
|
|
@@ -1,47 +1,19 @@
|
|
|
1
1
|
import { __assign } from '../../_virtual/_tslib.js';
|
|
2
|
-
import { useRef, useState, useMemo, useEffect } from 'react';
|
|
2
|
+
import { useContext, useRef, useState, useMemo, useEffect } from 'react';
|
|
3
3
|
import { useMemoizedFn } from 'ahooks';
|
|
4
4
|
import { onlyQunjAttachId, detailOnlyQunjAttachId } from '../utils.js';
|
|
5
|
+
import { ElectronSignaturesContext } from '../index.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* 内部用来区分当前附件所属类型的KEY值
|
|
8
9
|
*/
|
|
9
10
|
var DATA_TYPE_KEY = "__DATA_TYPE_KEY";
|
|
10
|
-
// 记录合并规则 返回数据类型 和 行合并规则
|
|
11
|
-
function getColumnMergeProp(options) {
|
|
12
|
-
var record = options.record, records = options.records, dataTypeSort = options.dataTypeSort, index = options.index;
|
|
13
|
-
// 获取当前项的类型
|
|
14
|
-
var currentDataType = record === null || record === void 0 ? void 0 : record[DATA_TYPE_KEY];
|
|
15
|
-
// 找到当前项类型 对应的 类型排序位置
|
|
16
|
-
var currentDataTypeIndex = dataTypeSort === null || dataTypeSort === void 0 ? void 0 : dataTypeSort.findIndex(function (type) { return type === currentDataType; });
|
|
17
|
-
// 找到数据中是当前类型的数据
|
|
18
|
-
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; });
|
|
19
|
-
// 数据中当前类型数据的长度
|
|
20
|
-
var currentDataTypeRecordsLength = dataTypeRecords.length;
|
|
21
|
-
// 当前项之前的匹配项
|
|
22
|
-
var preDataType = dataTypeSort.slice(0, currentDataTypeIndex);
|
|
23
|
-
// 所有之前数据的长度
|
|
24
|
-
var preDataTypeRecordsLength = 0;
|
|
25
|
-
preDataType.forEach(function (preDataType) {
|
|
26
|
-
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; });
|
|
27
|
-
preDataTypeRecordsLength += preDataTypeRecords.length || 0;
|
|
28
|
-
});
|
|
29
|
-
return {
|
|
30
|
-
/** 当前的数据类型 */
|
|
31
|
-
currentDataType: currentDataType,
|
|
32
|
-
/** 合并规则 */
|
|
33
|
-
props: {
|
|
34
|
-
rowSpan: index === preDataTypeRecordsLength ? currentDataTypeRecordsLength : 0,
|
|
35
|
-
},
|
|
36
|
-
/** 当前数据类型之前的数据长度 */
|
|
37
|
-
preDataTypeRecordsLength: preDataTypeRecordsLength,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
11
|
/**
|
|
41
12
|
* 附件数据处理
|
|
42
13
|
*/
|
|
43
14
|
function useParseRecords(options) {
|
|
44
|
-
var isUnControlled = options.isUnControlled, onValueChange = options.onValueChange, dataType = options.dataType, fileList = options.fileList, fileSplitRules = options.fileSplitRules, fileSplitStringRules = options.fileSplitStringRules, isSingleQj = options.isSingleQj;
|
|
15
|
+
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;
|
|
16
|
+
var isNewQys = useContext(ElectronSignaturesContext).isNewQys;
|
|
45
17
|
var fileSplitRulesRef = useRef(fileSplitRules);
|
|
46
18
|
fileSplitRulesRef.current = fileSplitRules;
|
|
47
19
|
var fileSplitStringRulesRef = useRef(fileSplitStringRules);
|
|
@@ -57,6 +29,9 @@ function useParseRecords(options) {
|
|
|
57
29
|
var _a;
|
|
58
30
|
// 这里可能外部没有传入_records 没有传入_records时,也要显示占位符数据
|
|
59
31
|
if ((Array.isArray(_records) && _records.length === 0) || !_records) {
|
|
32
|
+
if (isNewQys && !isSupportNoAttachQj) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
60
35
|
if (isSingleQj) {
|
|
61
36
|
return [];
|
|
62
37
|
}
|
|
@@ -94,7 +69,7 @@ function useParseRecords(options) {
|
|
|
94
69
|
return newRecords_1;
|
|
95
70
|
}
|
|
96
71
|
return _records;
|
|
97
|
-
}, [_records, dataType, isSingleQj]);
|
|
72
|
+
}, [_records, dataType, isSingleQj, isNewQys, isSupportNoAttachQj]);
|
|
98
73
|
// 代理下set 触发onChange方法
|
|
99
74
|
var setRecords = useMemoizedFn(function (info) {
|
|
100
75
|
var _a;
|
|
@@ -106,6 +81,8 @@ function useParseRecords(options) {
|
|
|
106
81
|
console.log("必须传入数据类型");
|
|
107
82
|
return;
|
|
108
83
|
}
|
|
84
|
+
// 20250519 批量删除所有数据时,也要触发onValueChange回调 因为此时的newRecords是空数组
|
|
85
|
+
onValueChange && onValueChange((_a = {}, _a[dataType] = { fileList: newRecords }, _a));
|
|
109
86
|
// 如果数据仅剩下这个数据 那么交给调用方处理
|
|
110
87
|
if (newRecords.length === 1 &&
|
|
111
88
|
newRecords[0].attachId + "" === onlyQunjAttachId) {
|
|
@@ -115,7 +92,7 @@ function useParseRecords(options) {
|
|
|
115
92
|
if (newRecords.length === 0) {
|
|
116
93
|
return;
|
|
117
94
|
}
|
|
118
|
-
onValueChange && onValueChange(
|
|
95
|
+
// onValueChange && onValueChange({ [dataType]: { fileList: newRecords } });
|
|
119
96
|
});
|
|
120
97
|
/**
|
|
121
98
|
* 如果是受控模式的话,直接将props的值 赋值给 内部变量
|
|
@@ -136,6 +113,36 @@ function useParseRecords(options) {
|
|
|
136
113
|
/** 修改内部数据 只是修改数据 并不会触发onValueChange回调 需要自己手动触发 */
|
|
137
114
|
innerSetRecords: _setRecords,
|
|
138
115
|
};
|
|
116
|
+
}
|
|
117
|
+
// 记录合并规则 返回数据类型 和 行合并规则
|
|
118
|
+
function getColumnMergeProp(options) {
|
|
119
|
+
var record = options.record, records = options.records, dataTypeSort = options.dataTypeSort, index = options.index;
|
|
120
|
+
// 获取当前项的类型
|
|
121
|
+
var currentDataType = record === null || record === void 0 ? void 0 : record[DATA_TYPE_KEY];
|
|
122
|
+
// 找到当前项类型 对应的 类型排序位置
|
|
123
|
+
var currentDataTypeIndex = dataTypeSort === null || dataTypeSort === void 0 ? void 0 : dataTypeSort.findIndex(function (type) { return type === currentDataType; });
|
|
124
|
+
// 找到数据中是当前类型的数据
|
|
125
|
+
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; });
|
|
126
|
+
// 数据中当前类型数据的长度
|
|
127
|
+
var currentDataTypeRecordsLength = dataTypeRecords.length;
|
|
128
|
+
// 当前项之前的匹配项
|
|
129
|
+
var preDataType = dataTypeSort.slice(0, currentDataTypeIndex);
|
|
130
|
+
// 所有之前数据的长度
|
|
131
|
+
var preDataTypeRecordsLength = 0;
|
|
132
|
+
preDataType.forEach(function (preDataType) {
|
|
133
|
+
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; });
|
|
134
|
+
preDataTypeRecordsLength += preDataTypeRecords.length || 0;
|
|
135
|
+
});
|
|
136
|
+
return {
|
|
137
|
+
/** 当前的数据类型 */
|
|
138
|
+
currentDataType: currentDataType,
|
|
139
|
+
/** 合并规则 */
|
|
140
|
+
props: {
|
|
141
|
+
rowSpan: index === preDataTypeRecordsLength ? currentDataTypeRecordsLength : 0,
|
|
142
|
+
},
|
|
143
|
+
/** 当前数据类型之前的数据长度 */
|
|
144
|
+
preDataTypeRecordsLength: preDataTypeRecordsLength,
|
|
145
|
+
};
|
|
139
146
|
}
|
|
140
147
|
|
|
141
148
|
export { DATA_TYPE_KEY, useParseRecords as default, getColumnMergeProp };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.electron-table
|
|
1
|
+
.electron-table .ant-table-tbody>tr>td:nth-child(2),.electron-table .ant-table-tbody>tr>td:nth-child(3){padding:0}.electron-table .electron-seal-list--wrap{height:90%;height:calc(100% - 70px);margin-bottom:8px;min-height:150px;text-align:left;width:100%}.electron-table .electron-seal-list--wrap>*{font-size:13px}.electron-table .electron-seal-list--wrap .zt-collapse .ant-collapse-item .ant-collapse-content-box{padding-left:8px}.electron-table .electron-seal-list--wrap .zt-collapse .ant-collapse-header{background-color:#ebf3fe}.electron-table .electron-seal-list--wrap .ant-collapse-content-box{display:flex;flex-direction:column}.electron-table .electron-seal-list--wrap .ant-checkbox-wrapper{font-size:13px;margin-left:0}.electron-table .electron-seal--first-level-person{border-bottom:1px solid #ebebeb;margin-bottom:5px;max-height:70px;overflow:hidden;padding-left:8px;text-align:left}.electron-table .electron-seal--first-level-person .ant-checkbox-wrapper{font-size:13px;max-height:70px}.electron-table .electron-seal--first-level-person .ant-checkbox-wrapper>span:last-child{display:block;overflow:hidden;text-overflow:ellipsis}.electron-table .electron-seal-detail--wrap{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;padding:5px 0}.electron-table .electron-seal-detail--wrap .electron-seal-detail--wrap__item{margin-bottom:8px;width:100%}.electron-table .electron-seal-detail--wrap .electron-seal-detail--wrap__item:last-child{margin-bottom:2px}.electron-table .electron-seal-setting--wrap{display:flex;flex-direction:column;font-size:13px;height:100%;padding-top:10px;position:sticky;top:20px}.electron-table .electron-seal--any{font-size:13px;margin-top:6px;text-align:center}.electron-table .electron-seal--any .ant-checkbox-wrapper{font-size:13px}.electron-table .electron-seal--any .ant-checkbox-wrapper+.ant-checkbox-wrapper{margin-left:0}.electron-table .file-title{align-items:center;display:flex;justify-content:space-between}.electron-table .file-title .file-label{flex:1;text-align:center}.electron-table .file-title .file-add--isOnlyQunj,.electron-table .file-title .file-upload button{font-size:13px}.electron-table .file-title .electron-seal-setting--wrap{flex-direction:row;padding-top:0;position:relative;top:0}.electron-table .qunj-list--wrap{height:100%;min-height:150px;padding:8px 0;text-align:left;width:100%}.electron-table .qunj-list--wrap>*{font-size:13px}.electron-table .qunj-list--wrap .qunj-list--need{background:#c5cdd9;display:flex;height:36px;justify-content:space-between;line-height:36px;margin-bottom:4px;padding:0 10px;text-align:center}.electron-table .qunj-list--wrap .qunj-list--area{align-items:center;background-color:#f5f9fe;border:1px solid #cdd9e6;border-radius:4px;display:flex;height:32px;justify-content:center;margin-top:2px}.electron-table .qunj-list--wrap .qunj-list--area>label{align-items:center;display:flex;height:30px;justify-content:center;padding-left:4px}.electron-table .qunj-list--wrap .qunj-list--area>label>span{color:#ff4d4f;height:30px;margin-right:2px}.electron-table .qunj-list--wrap .qunj-list--area>.ant-select .ant-select-selector{background-color:#f5f9fe;border:none;height:30px;line-height:30px}.electron-table .qunj-list--wrap .qunj-list--area>.ant-select .ant-select-selector input{height:30px!important;line-height:30px;outline:none}.electron-table .qunj-list--wrap .qunj-list--area>.ant-select .ant-select-selector .ant-select-selection-item{height:30px!important;line-height:30px}.electron-table .qunj-list--wrap .qunj-list--title{align-items:center;border-bottom:1px solid #ebebeb;display:flex;flex-direction:row;justify-content:space-between;padding-bottom:5px}.electron-table .qunj-list--wrap .qunj-list--title .ant-radio-wrapper{font-size:13px}.electron-table .qunj-list--wrap .qunj-list--contract{text-align:right}.electron-table .qunj-list--wrap .qunj-list--contract>div{white-space:nowrap}.electron-table .qunj-list--wrap .qunj-list--contract.count{width:130px}:root[lang=en] .electron-table .qunj-list--wrap .qunj-list--contract{width:auto}.electron-table .qunj-list--wrap .qunj-list--contract>span{font-size:14px}.electron-table .qunj-list--wrap .qunj-list--contract .ant-input-number{width:60px}.electron-table .qunj-list--wrap .qunj-list{margin-top:5px}.electron-table .qunj-list--wrap .qunj-list .qunj-list--item{align-items:center;display:flex;flex-direction:row;justify-content:space-between;line-height:32px}.electron-table .qunj-list--wrap .qunj-list .qunj-list--item .ant-checkbox-wrapper{flex:1;font-size:13px;line-height:22px}.electron-table .qunj-detail--wrap{height:100%;min-height:150px;padding:8px 0;text-align:left;width:100%}.electron-table .qunj-detail--wrap .qunj-detail--title{align-items:center;border-bottom:1px solid #ebebeb;display:flex;flex-direction:row;justify-content:flex-start;padding-bottom:5px}.electron-table .qunj-detail--wrap .qunj-detail--title .qunj-detail--code{background:#fcecc8;border-radius:4px;height:32px;line-height:32px;margin-right:10px;padding:0 0 0 6px;width:160px}.electron-table .qunj-detail--wrap .qunj-detail--info{border-bottom:1px solid #ebebeb;color:#888;font-size:13px;margin-bottom:5px;padding-bottom:5px}.electron-table .qunj-detail--wrap .qunj-detail--info span{color:#333}.electron-table .qunj-detail--wrap .qunj-detail--info .qunj-detail--address{align-items:center;display:flex;flex-direction:row;justify-content:flex-start}.electron-table .qunj-detail--wrap .qunj-detail--info .qunj-detail--address .qunj-detail--type{margin-right:20px}.electron-table .qunj-detail--wrap .qunj-detail--list .qunj-detail--item{align-items:center;display:flex;flex-direction:row;justify-content:space-between;line-height:28px}.electron-table .qunj-detail--wrap .qunj-detail--list .qunj-detail--item span{padding:0 4px}.electron-table .qunj-detail--wrap .qunj-detail--list .qunj-detail--item>div:first-child{flex:1;line-height:22px}.electron-table .qunj-detail--wrap .qunj-detail--list .qunj-detail--item>div:last-child{text-align:right;width:80px}.electron-table .file-add--wrap{height:100%;position:relative;width:100%}.electron-table .file-add--wrap .file-add--btn{position:sticky;top:20px}.electron-table .file-add--wrap .file-add--fragment{height:20px}.electron-table .file-operation--wrap{padding:4px}.electron-table .file-operation--wrap .file-operation--date-container{align-items:center;display:flex;justify-content:space-between}.electron-table .file-operation--wrap .file-operation--list,.electron-table .file-operation--wrap .file-operation--list>button,.electron-table .file-operation--wrap .file-operation--list>span.electron-file-upload .zt-btn.zt-btn-link{font-size:13px}.electron-table .file-operation--wrap .file-operation--title{margin-bottom:0}.electron-table .file-operation--wrap .file-operation--isWater .ant-checkbox-wrapper{font-size:13px}.electron-table .file-operation--wrap .file-operation--label{text-align:left}.electron-table .file-operation--wrap .file-operation--label>span{border:1px solid #d9d9d9;border-radius:3px;color:#ee3f3f;margin-right:4px;padding:0 3px}.electron-table .contract-comparison--wrap{align-items:center;display:flex;flex-direction:column;justify-content:center;min-width:250px}.electron-table .contract-comparison--wrap .ant-checkbox-wrapper,.electron-table .contract-comparison--wrap>button{font-size:13px}.batch-download--container>button,.batch-download--container>span.electron-file-upload{margin-right:10px}
|