ztxkui 4.2.18-111 → 4.2.18-113

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.
Files changed (32) hide show
  1. package/dist/components/Table/hooks/useColumns.js +26 -2
  2. package/dist/components/electron-signatures/content.js +360 -340
  3. package/dist/components/electron-signatures/demoComponents/coUseDetail.d.ts +8 -0
  4. package/dist/components/electron-signatures/demoComponents/coUseDetail.js +255 -0
  5. package/dist/components/electron-signatures/demoComponents/index.js +4 -1
  6. package/dist/components/electron-signatures/demoComponents/makingData.d.ts +12 -0
  7. package/dist/components/electron-signatures/demoComponents/makingData.js +14 -0
  8. package/dist/components/electron-signatures/electron-signatures-fragment.js +74 -26
  9. package/dist/components/electron-signatures/electronComponents/electron-seal-personal-sign.d.ts +35 -0
  10. package/dist/components/electron-signatures/electronComponents/electron-seal-personal-sign.js +39 -0
  11. package/dist/components/electron-signatures/electronComponents/useElectronColumns.js +20 -2
  12. package/dist/components/electron-signatures/electronComponents/useFetchElectronData.d.ts +4 -0
  13. package/dist/components/electron-signatures/electronComponents/useFetchElectronData.js +103 -16
  14. package/dist/components/electron-signatures/hooks/useParseElectronSetting.d.ts +13 -4
  15. package/dist/components/electron-signatures/hooks/useParseElectronSetting.js +238 -165
  16. package/dist/components/electron-signatures/index.d.ts +2 -0
  17. package/dist/components/electron-signatures/index.js +14 -5
  18. package/dist/components/electron-signatures/interface.d.ts +16 -0
  19. package/dist/components/electron-signatures/qunjComponents/qunj-list.js +14 -5
  20. package/dist/components/electron-signatures/qunjComponents/useFetchQunjData.js +5 -0
  21. package/dist/components/electron-signatures/qunjComponents/useQunjColumns.js +2 -2
  22. package/dist/components/utils/ZtxkContext.d.ts +10 -0
  23. package/dist/components/utils/ZtxkContext.js +2 -0
  24. package/dist/components/utils/checkSealCoUse.d.ts +16 -0
  25. package/dist/components/utils/checkSealCoUse.js +83 -0
  26. package/dist/components/utils/useBaseContext.d.ts +2 -0
  27. package/dist/constants.d.ts +1 -1
  28. package/dist/constants.js +1 -1
  29. package/dist/index.css +52 -13
  30. package/dist/index.css.map +1 -1
  31. package/dist/index.js +10 -0
  32. package/package.json +1 -1
@@ -1,11 +1,50 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (_) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
1
37
  import i18next from 'ztxkutils/dist/i18next';
2
- import { useCallback, useEffect, useState, useMemo, useRef } from 'react';
38
+ import { useCallback, useContext, useEffect, useState, useMemo, useRef, } from 'react';
3
39
  import { message } from '../../../index';
40
+ import { ElectronSignaturesContext } from '..';
4
41
  /**
5
42
  * 获取电子印章远程数据
6
43
  */
7
44
  export default function useFetchElectronData(options) {
8
- var request = options.request, needQys = options.needQys, deptId = options.deptId, secondDepId = options.secondDepId, flowId = options.flowId, records = options.records;
45
+ var _this = this;
46
+ var request = options.request, needQys = options.needQys, deptId = options.deptId, secondDepId = options.secondDepId, flowId = options.flowId, organizationType = options.organizationType, records = options.records;
47
+ var isFilterLegalSeal = useContext(ElectronSignaturesContext).isFilterLegalSeal;
9
48
  // records里面是否有勾选了电子印章的数据
10
49
  var hasElectronMemo = useMemo(function () {
11
50
  var _a;
@@ -14,8 +53,30 @@ export default function useFetchElectronData(options) {
14
53
  var isFirstRenderRef = useRef(false);
15
54
  // 印章列表数据
16
55
  var _a = useState(), electronList = _a[0], setElectronList = _a[1];
56
+ // 个人签署(手签章)配置列表
57
+ var _b = useState([]), personalSignList = _b[0], setPersonalSignList = _b[1];
17
58
  // 一级责任人数据
18
- var _b = useState(), firstLevelPersonName = _b[0], setFirstLevelPersonName = _b[1];
59
+ var _c = useState(), firstLevelPersonName = _c[0], setFirstLevelPersonName = _c[1];
60
+ // 获取流程下需要过滤掉的印章列表 开关关闭或失败时降级不过滤
61
+ var getFilterSealList = useCallback(function (flowId) {
62
+ if (!flowId || !request || !isFilterLegalSeal) {
63
+ return Promise.resolve([]);
64
+ }
65
+ return request({
66
+ url: '/api/zmdms-scm-system/legalsealflow/getSeal',
67
+ params: { flowId: flowId },
68
+ method: 'GET',
69
+ })
70
+ .then(function (res) {
71
+ if (res.status === 200 && res.data.code === 200) {
72
+ return res.data.data || [];
73
+ }
74
+ return [];
75
+ })
76
+ .catch(function () {
77
+ return [];
78
+ });
79
+ }, [request, isFilterLegalSeal]);
19
80
  // 获取电子印章信息 接口层必须传入部门id 和 流程id 才能获取到印章信息
20
81
  var getElectronList = useCallback(function (params) {
21
82
  var newParam = {
@@ -30,25 +91,47 @@ export default function useFetchElectronData(options) {
30
91
  if (params.secondDepId) {
31
92
  newParam.secondDepId = params.secondDepId;
32
93
  }
94
+ // 个人签署(手签章)配置的组织机构类型 不传则后端按默认处理
95
+ if (params.organizationType) {
96
+ newParam.organizationType = params.organizationType;
97
+ }
33
98
  return request === null || request === void 0 ? void 0 : request({
34
99
  url: '/api/zmdms-resource/flowdeptseal/select-seal-info-list',
35
100
  params: newParam,
36
101
  method: 'GET',
37
- }).then(function (res) {
38
- var _a, _b, _c;
39
- if (res.status === 200 && res.data.code === 200) {
40
- return ((_c = (_b = (_a = res.data.data) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.sealInfoList) || [];
41
- }
42
- else {
43
- message.error(res.data.msg || i18next.t('出错了'));
44
- return Promise.reject(res);
45
- }
46
- }).catch(function (error) {
102
+ }).then(function (res) { return __awaiter(_this, void 0, void 0, function () {
103
+ var firstRecord, sealInfoList, personalSignList_1, filterSealList, newSealInfoList, filterSealIds_1;
104
+ var _a, _b;
105
+ return __generator(this, function (_c) {
106
+ switch (_c.label) {
107
+ case 0:
108
+ if (!(res.status === 200 && res.data.code === 200)) return [3 /*break*/, 2];
109
+ firstRecord = ((_b = (_a = res.data.data) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) || {};
110
+ sealInfoList = firstRecord.sealInfoList || [];
111
+ personalSignList_1 = firstRecord.personalSignList || [];
112
+ return [4 /*yield*/, getFilterSealList(params.flowId)];
113
+ case 1:
114
+ filterSealList = _c.sent();
115
+ newSealInfoList = sealInfoList;
116
+ if (filterSealList.length > 0) {
117
+ filterSealIds_1 = new Set(filterSealList.map(function (item) { return item.sealId + ''; }));
118
+ newSealInfoList = sealInfoList.filter(function (seal) { return !filterSealIds_1.has(seal.sealId + ''); });
119
+ }
120
+ return [2 /*return*/, {
121
+ sealInfoList: newSealInfoList,
122
+ personalSignList: personalSignList_1,
123
+ }];
124
+ case 2:
125
+ message.error(res.data.msg || i18next.t('出错了'));
126
+ return [2 /*return*/, Promise.reject(res)];
127
+ }
128
+ });
129
+ }); }).catch(function (error) {
47
130
  var _a, _b;
48
131
  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('请求失败!'));
49
132
  return Promise.reject(error);
50
133
  });
51
- }, [request]);
134
+ }, [request, getFilterSealList]);
52
135
  // 获取一级责任人名字 通过部门
53
136
  var getFirstLevelPerson = useCallback(function (deptId) {
54
137
  return request({
@@ -113,10 +196,12 @@ export default function useFetchElectronData(options) {
113
196
  deptId: deptId,
114
197
  secondDepId: secondDepId,
115
198
  flowId: flowId,
199
+ organizationType: organizationType,
116
200
  }).then(function (res) {
117
- setElectronList(res);
201
+ setElectronList(res.sealInfoList);
202
+ setPersonalSignList(res.personalSignList);
118
203
  });
119
- }, [needQys, deptId, secondDepId, flowId, getElectronList]);
204
+ }, [needQys, deptId, secondDepId, flowId, organizationType, getElectronList]);
120
205
  // 20240920:部门变更了 需要重新获取一级责任人
121
206
  // 20250522: 有些流程没有部门id,但是会传入二级单元,根据二级单元获取一级责任人
122
207
  useEffect(function () {
@@ -161,6 +246,8 @@ export default function useFetchElectronData(options) {
161
246
  return {
162
247
  /** 当前印章列表数据 */
163
248
  electronList: electronList,
249
+ /** 个人签署(手签章)配置列表 后端已展开最终签署用户 signUsers */
250
+ personalSignList: personalSignList,
164
251
  /** 当前经济责任人(一级责任人)数据 */
165
252
  firstLevelPersonName: firstLevelPersonName,
166
253
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IElectronSignaturesProps, IElectronSignaturesItem, IAppointSignLocationOptions } from '../interface';
2
+ import { IElectronSignaturesProps, IElectronSignaturesItem, IAppointSignLocationOptions, IFileFieldsName, IQunjProps } from '../interface';
3
3
  import type { SpinProps } from 'antd/es/spin';
4
4
  interface IOptions {
5
5
  /**
@@ -53,6 +53,9 @@ interface IOptions {
53
53
  */
54
54
  isCheckedEconomic?: boolean;
55
55
  setCurrentIsCheckedEconomic?: any;
56
+ /** 个人签署(手签章)已勾选的用户id列表 */
57
+ personalSignUserIds?: Array<number | string>;
58
+ setPersonalSignUserIds?: any;
56
59
  /**
57
60
  * 是否可以编辑 1 可以编辑 0 不可编辑
58
61
  */
@@ -63,9 +66,15 @@ interface IOptions {
63
66
  flowStatus?: IElectronSignaturesItem['flowStatus'];
64
67
  onElectronicSealIdChange?: any;
65
68
  /**
66
- * 电子印章列表(用于校验必须共同使用逻辑)
69
+ * 当前选中的群杰印章数据(用于校验必须共同使用逻辑)
67
70
  */
68
- electronList?: any[];
71
+ qunjSeal?: IQunjProps;
72
+ /**
73
+ * 字段对应表(用于从附件数据中收集单附件群杰印章编号)
74
+ */
75
+ fileFieldsNameRef?: {
76
+ current: IFileFieldsName;
77
+ };
69
78
  }
70
79
  /**
71
80
  * 电子印章设置相关操作
@@ -83,7 +92,7 @@ export default function useParseElectronSetting(options: IOptions): {
83
92
  currentDocumentIdList: any;
84
93
  setCurrentDocumentIdList: React.Dispatch<any>;
85
94
  /** 指定签署位置 */
86
- appointSignLocation: (this: unknown, options?: IAppointSignLocationOptions) => void;
95
+ appointSignLocation: (this: unknown, options?: IAppointSignLocationOptions) => Promise<void>;
87
96
  /** 预览盖章效果 */
88
97
  viewSignPage: (this: unknown) => void;
89
98
  /** 暴露一个清空数据的方法 */