ydb-components-material 0.1.110 → 0.1.112

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 (48) hide show
  1. package/build/docs/404.html +3 -3
  2. package/build/docs/_demos/:uuid +3 -3
  3. package/build/docs/colorful-button.html +3 -3
  4. package/build/docs/colorful-input.html +3 -3
  5. package/build/docs/index.html +3 -3
  6. package/build/docs/{umi.af2a87c1.js → umi.d94386b2.js} +1 -1
  7. package/build/docs/~demos/:uuid.html +3 -3
  8. package/build/docs/~demos/colorful-button-demo.html +3 -3
  9. package/build/docs/~demos/colorful-input-demo.html +3 -3
  10. package/build/lowcode/assets-daily.json +11 -11
  11. package/build/lowcode/assets-dev.json +2 -2
  12. package/build/lowcode/assets-prod.json +11 -11
  13. package/build/lowcode/meta.js +1 -1
  14. package/build/lowcode/render/default/view.js +1 -1
  15. package/build/lowcode/view.js +1 -1
  16. package/dist/BizComps.js +10 -10
  17. package/dist/BizComps.js.map +1 -1
  18. package/es/components/file-list/index.d.ts +1 -0
  19. package/es/components/file-list/index.js +4 -1
  20. package/es/components/file-list/item.d.ts +1 -0
  21. package/es/components/file-list/item.js +30 -14
  22. package/es/components/file-list/signerInfo.js +32 -4
  23. package/es/components/guide/compoents/materials/materials.d.ts +1 -0
  24. package/es/components/guide/compoents/materials/materials.js +4 -2
  25. package/es/components/guide/compoents/materials/situation.d.ts +1 -0
  26. package/es/components/guide/compoents/materials/situation.js +8 -4
  27. package/es/components/guide/index.d.ts +2 -0
  28. package/es/components/guide/index.js +4 -2
  29. package/lib/components/file-list/index.d.ts +1 -0
  30. package/lib/components/file-list/index.js +4 -1
  31. package/lib/components/file-list/item.d.ts +1 -0
  32. package/lib/components/file-list/item.js +30 -14
  33. package/lib/components/file-list/signerInfo.js +32 -4
  34. package/lib/components/guide/compoents/materials/materials.d.ts +1 -0
  35. package/lib/components/guide/compoents/materials/materials.js +4 -2
  36. package/lib/components/guide/compoents/materials/situation.d.ts +1 -0
  37. package/lib/components/guide/compoents/materials/situation.js +8 -4
  38. package/lib/components/guide/index.d.ts +2 -0
  39. package/lib/components/guide/index.js +4 -2
  40. package/lowcode/file-list/meta.ts +26 -0
  41. package/lowcode/guide/meta.ts +26 -0
  42. package/lowcode_es/file-list/meta.js +25 -0
  43. package/lowcode_es/guide/meta.js +25 -0
  44. package/lowcode_es/meta.js +1 -1
  45. package/lowcode_lib/file-list/meta.js +25 -0
  46. package/lowcode_lib/guide/meta.js +25 -0
  47. package/lowcode_lib/meta.js +1 -1
  48. package/package.json +3 -3
@@ -20,6 +20,7 @@ export interface FileListProps {
20
20
  closeLoading: () => void;
21
21
  valChange: (value: any) => void;
22
22
  saveSignerInfo: (value: any) => boolean;
23
+ signInfoMap?: object;
23
24
  }
24
25
  declare const FileList: React.FC<FileListProps>;
25
26
  export default FileList;
@@ -47,7 +47,8 @@ var FileList = function FileList(_ref) {
47
47
  openLoading = _ref.openLoading,
48
48
  closeLoading = _ref.closeLoading,
49
49
  valChange = _ref.valChange,
50
- saveSignerInfo = _ref.saveSignerInfo;
50
+ saveSignerInfo = _ref.saveSignerInfo,
51
+ signInfoMap = _ref.signInfoMap;
51
52
  var _useState = useState(false),
52
53
  showMerge = _useState[0],
53
54
  setShowMerge = _useState[1];
@@ -291,6 +292,7 @@ var FileList = function FileList(_ref) {
291
292
  env: env,
292
293
  isPC: isPC,
293
294
  signerInfo: signerInfo,
295
+ signInfoMap: signInfoMap,
294
296
  disabled: disabled,
295
297
  download: download,
296
298
  valChange: handleChange,
@@ -309,6 +311,7 @@ var FileList = function FileList(_ref) {
309
311
  index: index,
310
312
  fileIndex: i,
311
313
  signerInfo: signerInfo,
314
+ signInfoMap: signInfoMap,
312
315
  file: file,
313
316
  fileConfig: item,
314
317
  maxFileSize: item.materialSize,
@@ -24,6 +24,7 @@ export interface FileItemProps {
24
24
  valChange: (value: any, fileIndex: any, index: any, subIndex: any) => void;
25
25
  download: (value: any) => void;
26
26
  saveSignerInfo: (value: any) => boolean;
27
+ signInfoMap?: object;
27
28
  }
28
29
  declare const FileItem: React.FC<FileItemProps>;
29
30
  export default FileItem;
@@ -23,6 +23,8 @@ import CheckPoint from "./checkPoint";
23
23
  import SignerInfo from "./signerInfo";
24
24
  import "./item.scss";
25
25
  var RadioGroup = _Radio.Group;
26
+ var SELF = 0;
27
+ var OTHER = 1;
26
28
  var FileItem = function FileItem(_ref) {
27
29
  var index = _ref.index,
28
30
  subIndex = _ref.subIndex,
@@ -45,7 +47,8 @@ var FileItem = function FileItem(_ref) {
45
47
  download = _ref.download,
46
48
  openLoading = _ref.openLoading,
47
49
  closeLoading = _ref.closeLoading,
48
- saveSignerInfo = _ref.saveSignerInfo;
50
+ saveSignerInfo = _ref.saveSignerInfo,
51
+ signInfoMap = _ref.signInfoMap;
49
52
  console.log('fileItem', file, maxFileSize);
50
53
  var fileName = file.fileName,
51
54
  fileUrl = file.fileUrl,
@@ -53,14 +56,24 @@ var FileItem = function FileItem(_ref) {
53
56
  isSigned = file.isSigned,
54
57
  isSealed = file.isSealed,
55
58
  fileType = file.fileType;
56
- var signatureEnable = fileConfig.signatureEnable,
59
+ var materialName = fileConfig.materialName,
60
+ signatureEnable = fileConfig.signatureEnable,
57
61
  signEnable = fileConfig.signEnable,
58
62
  isInValid = fileConfig.isInValid,
59
63
  signGuidFileId = fileConfig.signGuidFileId,
60
64
  keyPoint = fileConfig.keyPoint,
61
65
  isSmart = fileConfig.isSmart,
62
66
  isShareFile = fileConfig.isShareFile,
63
- needOtherSign = fileConfig.needOtherSign;
67
+ signatureSelfRole = fileConfig.signatureSelfRole,
68
+ signatureAgentRole = fileConfig.signatureAgentRole,
69
+ signSelfRole = fileConfig.signSelfRole,
70
+ signAgentRole = fileConfig.signAgentRole;
71
+ // 需要他人签批或签章
72
+ var needOtherSign = signatureSelfRole.includes(OTHER) || signatureAgentRole.includes(OTHER) || signSelfRole.includes(OTHER) || signAgentRole.includes(OTHER);
73
+ // 需要他人签名
74
+ var isNeedOtherSign = signatureSelfRole.includes(OTHER) || signatureAgentRole.includes(OTHER);
75
+ // 需要他人签章
76
+ var isNeedOtherSeal = signSelfRole.includes(OTHER) || signAgentRole.includes(OTHER);
64
77
  var signBtnText = needOtherSign ? '联合签署' : '签署文件';
65
78
  var reSignBtnText = needOtherSign ? '重新联合签署' : '重新签署';
66
79
  var _useState = useState(false),
@@ -303,7 +316,6 @@ var FileItem = function FileItem(_ref) {
303
316
 
304
317
  // 签章
305
318
  var seal = function seal() {
306
- console.log('fileType', fileType);
307
319
  var type = getFileExtension(fileName);
308
320
  if (type !== 'pdf') {
309
321
  _Message.notice('只有pdf文件才能使用电子签章');
@@ -313,6 +325,12 @@ var FileItem = function FileItem(_ref) {
313
325
  setIsShowSealPage(true);
314
326
  };
315
327
  var signAndSeal = function signAndSeal() {
328
+ // const notNeedSelfSign = !signatureSelfRole.includes(SELF) && !signatureAgentRole.includes(SELF) && !signSelfRole.includes(SELF) && !signAgentRole.includes(SELF)
329
+ // // 如果不需要自己签署 只需要别人签署 就直接打开维护签署人信息
330
+ // if (notNeedSelfSign && needOtherSign) {
331
+ // setShowSignerInfo(true)
332
+ // return
333
+ // }
316
334
  // 如果不能签章就直接签批
317
335
  if (!(userInfo.acctType === '20' && signEnable)) {
318
336
  sign();
@@ -728,13 +746,7 @@ var FileItem = function FileItem(_ref) {
728
746
  }, signatureEnable || userInfo.acctType === '20' && signEnable && /*#__PURE__*/React.createElement("div", {
729
747
  className: "operation_btn",
730
748
  onClick: signAndSeal
731
- }, isSigned && isSealed ? reSignBtnText : signBtnText), !(userInfo.acctType === '20' && signEnable) && signatureEnable && /*#__PURE__*/React.createElement("div", {
732
- className: "operation_btn",
733
- onClick: sign
734
- }, isSigned ? reSignBtnText : signBtnText), !signatureEnable && userInfo.acctType === '20' && signEnable && /*#__PURE__*/React.createElement("div", {
735
- className: "operation_btn",
736
- onClick: seal
737
- }, isSealed ? reSignBtnText : signBtnText)) :
749
+ }, isSigned && isSealed ? reSignBtnText : signBtnText)) :
738
750
  // 展示材料库
739
751
  !isShareFile && !isSmart && !disabled && !!materialLib.length && /*#__PURE__*/React.createElement("div", {
740
752
  className: "operation_btn",
@@ -885,12 +897,16 @@ var FileItem = function FileItem(_ref) {
885
897
  }), showSignerInfo && /*#__PURE__*/React.createElement(SignerInfo, {
886
898
  signerInfo: signerInfo,
887
899
  handleClose: function handleClose() {
888
- console.log('close');
889
- setShowSignerInfo(false);
900
+ return setShowSignerInfo(false);
890
901
  },
891
902
  saveSignerInfo: saveSignerInfo,
892
903
  signatureEnable: signatureEnable,
893
- signEnable: signEnable
904
+ signEnable: signEnable,
905
+ isNeedOtherSign: isNeedOtherSign,
906
+ isNeedOtherSeal: isNeedOtherSeal,
907
+ file: file,
908
+ materialName: materialName,
909
+ signInfoMap: signInfoMap
894
910
  }));
895
911
  };
896
912
  FileItem.displayName = 'FileItem';
@@ -16,7 +16,12 @@ function SignerInfo(props) {
16
16
  signerInfo = props.signerInfo,
17
17
  saveSignerInfo = props.saveSignerInfo,
18
18
  signatureEnable = props.signatureEnable,
19
- signEnable = props.signEnable;
19
+ signEnable = props.signEnable,
20
+ isNeedOtherSign = props.isNeedOtherSign,
21
+ isNeedOtherSeal = props.isNeedOtherSeal,
22
+ file = props.file,
23
+ materialName = props.materialName,
24
+ signInfoMap = props.signInfoMap;
20
25
  var _React$useState = React.useState([]),
21
26
  signerInfoList = _React$useState[0],
22
27
  setSignerInfoList = _React$useState[1];
@@ -33,6 +38,16 @@ function SignerInfo(props) {
33
38
  newList[index] = _extends({}, newList[index], (_extends2 = {}, _extends2[field] = val, _extends2));
34
39
  setSignerInfoList(newList);
35
40
  };
41
+ var getCurrentTime = function getCurrentTime() {
42
+ var now = new Date();
43
+ var year = now.getFullYear();
44
+ var month = now.getMonth() + 1; // 无前导零
45
+ var day = now.getDate(); // 无前导零
46
+ var hours = now.getHours().toString().padStart(2, '0');
47
+ var minutes = now.getMinutes().toString().padStart(2, '0');
48
+ var seconds = now.getSeconds().toString().padStart(2, '0');
49
+ return year + "/" + month + "/" + day + " " + hours + ":" + minutes + ":" + seconds;
50
+ };
36
51
  var next = /*#__PURE__*/function () {
37
52
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
38
53
  var saveRes;
@@ -40,7 +55,12 @@ function SignerInfo(props) {
40
55
  while (1) switch (_context.prev = _context.next) {
41
56
  case 0:
42
57
  _context.next = 1;
43
- return saveSignerInfo(signerInfoList);
58
+ return saveSignerInfo({
59
+ list: signerInfoList,
60
+ file: file,
61
+ materialName: materialName,
62
+ date: getCurrentTime()
63
+ });
44
64
  case 1:
45
65
  saveRes = _context.sent;
46
66
  if (saveRes) {
@@ -71,6 +91,14 @@ function SignerInfo(props) {
71
91
  navigator.clipboard.writeText(url);
72
92
  _Message.success('复制成功');
73
93
  };
94
+ useEffect(function () {
95
+ if (signInfoMap && file) {
96
+ var fileId = file.fileId;
97
+ if (signInfoMap[fileId]) {
98
+ setSignerInfoList(signInfoMap[fileId]);
99
+ }
100
+ }
101
+ }, [signInfoMap, file]);
74
102
  useEffect(function () {
75
103
  if (signerInfo) {
76
104
  console.log('signerInfo', signerInfo);
@@ -234,10 +262,10 @@ function SignerInfo(props) {
234
262
  return handleFieldChange('signContent', val, index);
235
263
  },
236
264
  "aria-labelledby": "groupId"
237
- }, signatureEnable && /*#__PURE__*/React.createElement(_Checkbox, {
265
+ }, signatureEnable && isNeedOtherSign && /*#__PURE__*/React.createElement(_Checkbox, {
238
266
  id: "1",
239
267
  value: "1"
240
- }, "\u4EC5\u7B7E\u540D"), signEnable && item.signType === 1 && /*#__PURE__*/React.createElement(_Checkbox, {
268
+ }, "\u4EC5\u7B7E\u540D"), signEnable && isNeedOtherSeal && item.signType === 1 && /*#__PURE__*/React.createElement(_Checkbox, {
241
269
  id: "2",
242
270
  value: "2"
243
271
  }, "\u4EC5\u7B7E\u7AE0")))));
@@ -12,6 +12,7 @@ export interface MaterialsProps {
12
12
  download?: (params: any) => void;
13
13
  situationResRechange?: (data: any) => void;
14
14
  taskHandleItem?: string;
15
+ previousData?: any;
15
16
  }
16
17
  declare const Materials: React.FC<MaterialsProps>;
17
18
  export default Materials;
@@ -13,7 +13,8 @@ var Materials = function Materials(_ref) {
13
13
  baseUrlProp = _ref.baseUrl,
14
14
  downloadProp = _ref.download,
15
15
  situationResRechangeProp = _ref.situationResRechange,
16
- taskHandleItemProp = _ref.taskHandleItem;
16
+ taskHandleItemProp = _ref.taskHandleItem,
17
+ previousDataProp = _ref.previousData;
17
18
  return /*#__PURE__*/React.createElement("div", {
18
19
  className: "materials-content"
19
20
  }, situationPageUrlProp && /*#__PURE__*/React.createElement(Situation, {
@@ -25,7 +26,8 @@ var Materials = function Materials(_ref) {
25
26
  declarationAppToken: declarationAppTokenProp,
26
27
  situationPageUrl: situationPageUrlProp,
27
28
  situationResRechange: situationResRechangeProp,
28
- taskHandleItem: taskHandleItemProp
29
+ taskHandleItem: taskHandleItemProp,
30
+ previousData: previousDataProp
29
31
  }), /*#__PURE__*/React.createElement(MaterialsList, {
30
32
  eventInfo: eventInfoProp,
31
33
  finalMaterials: finalMaterialsProp,
@@ -10,6 +10,7 @@ export interface SituationProps {
10
10
  situationPageUrl?: string;
11
11
  taskHandleItem?: string;
12
12
  situationResRechange?: (data: any) => void;
13
+ previousData?: any;
13
14
  }
14
15
  declare const Situation: React.FC<SituationProps>;
15
16
  export default Situation;
@@ -14,7 +14,8 @@ var Situation = function Situation(_ref) {
14
14
  declarationAppTokenProp = _ref.declarationAppToken,
15
15
  situationPageUrlProp = _ref.situationPageUrl,
16
16
  taskHandleItemProp = _ref.taskHandleItem,
17
- situationResRechangeProp = _ref.situationResRechange;
17
+ situationResRechangeProp = _ref.situationResRechange,
18
+ previousDataProp = _ref.previousData;
18
19
  var _React$useState = React.useState('说明:因个人情况不同上交材料不同,可通过情形选择查看必须上传的材料!'),
19
20
  tip = _React$useState[0];
20
21
  var _React$useState2 = React.useState(false),
@@ -29,14 +30,14 @@ var Situation = function Situation(_ref) {
29
30
  return function () {
30
31
  window.removeEventListener('message', getMessage);
31
32
  };
32
- }, []);
33
+ }, [eventInfoProp, taskHandleItemProp, situationPageUrlProp, declarationAppTokenProp, finalMaterialsProp, applicationIdProp, accessTokenProp, acctTypeProp, previousDataProp]);
33
34
  var initPage = function initPage() {
34
35
  if (!situationPageUrlProp) return;
35
- var url = situationPageUrlProp + "&isFirst=1&isReCheck=1";
36
+ var url = situationPageUrlProp + "&isFirst=1&isReCheck=1&isZXBB=1";
36
37
  setIframeSrc(url);
37
38
  };
38
39
  var getMessage = function getMessage(e) {
39
- var typeArr = ['getAccessToken', 'getDeclaraToken', 'getApplicationId', 'getTaskHandleItem', 'getFormId', 'getMaterials', 'getFormData'];
40
+ var typeArr = ['getAccessToken', 'getDeclaraToken', 'getApplicationId', 'getTaskHandleItem', 'getFormId', 'getMaterials', 'getFormData', 'getPreviousData'];
40
41
  var _ref2 = e.data || {},
41
42
  type = _ref2.type,
42
43
  data = _ref2.data;
@@ -82,6 +83,9 @@ var Situation = function Situation(_ref) {
82
83
  case 'getMaterials':
83
84
  sendData.data.materials = finalMaterials || (eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.taskGeneralMaterials);
84
85
  break;
86
+ case 'getPreviousData':
87
+ sendData.data.previousData = previousDataProp;
88
+ break;
85
89
  }
86
90
  var formIframe = document.getElementById('situationIframe');
87
91
  if (formIframe !== null && formIframe !== void 0 && formIframe.contentWindow) {
@@ -30,6 +30,8 @@ export interface GuideProps {
30
30
  download?: (params: any) => void;
31
31
  /** Situation result re-change handler */
32
32
  situationResRechange?: (data: any) => void;
33
+ /** Previous form data from parent */
34
+ previousData?: any;
33
35
  }
34
36
  declare const Guide: React.FC<GuideProps>;
35
37
  export default Guide;
@@ -42,7 +42,8 @@ var Guide = function Guide(_ref) {
42
42
  situationPageUrl = _ref.situationPageUrl,
43
43
  baseUrl = _ref.baseUrl,
44
44
  download = _ref.download,
45
- situationResRechange = _ref.situationResRechange;
45
+ situationResRechange = _ref.situationResRechange,
46
+ previousData = _ref.previousData;
46
47
  var _React$useState = React.useState(false),
47
48
  pageLoading = _React$useState[0];
48
49
  var _React$useState2 = React.useState(true),
@@ -286,7 +287,8 @@ var Guide = function Guide(_ref) {
286
287
  baseUrl: baseUrl,
287
288
  download: download,
288
289
  situationResRechange: situationResRechange,
289
- taskHandleItem: taskHandleItem
290
+ taskHandleItem: taskHandleItem,
291
+ previousData: previousData
290
292
  }), tabIndex === 1 && /*#__PURE__*/React.createElement(BasicInfo, {
291
293
  eventInfo: eventInfoProp
292
294
  }), tabIndex === 2 && /*#__PURE__*/React.createElement(ProcessImg, {
@@ -20,6 +20,7 @@ export interface FileListProps {
20
20
  closeLoading: () => void;
21
21
  valChange: (value: any) => void;
22
22
  saveSignerInfo: (value: any) => boolean;
23
+ signInfoMap?: object;
23
24
  }
24
25
  declare const FileList: React.FC<FileListProps>;
25
26
  export default FileList;
@@ -52,7 +52,8 @@ var FileList = function FileList(_ref) {
52
52
  openLoading = _ref.openLoading,
53
53
  closeLoading = _ref.closeLoading,
54
54
  valChange = _ref.valChange,
55
- saveSignerInfo = _ref.saveSignerInfo;
55
+ saveSignerInfo = _ref.saveSignerInfo,
56
+ signInfoMap = _ref.signInfoMap;
56
57
  var _useState = (0, _react.useState)(false),
57
58
  showMerge = _useState[0],
58
59
  setShowMerge = _useState[1];
@@ -296,6 +297,7 @@ var FileList = function FileList(_ref) {
296
297
  env: env,
297
298
  isPC: isPC,
298
299
  signerInfo: signerInfo,
300
+ signInfoMap: signInfoMap,
299
301
  disabled: disabled,
300
302
  download: download,
301
303
  valChange: handleChange,
@@ -314,6 +316,7 @@ var FileList = function FileList(_ref) {
314
316
  index: index,
315
317
  fileIndex: i,
316
318
  signerInfo: signerInfo,
319
+ signInfoMap: signInfoMap,
317
320
  file: file,
318
321
  fileConfig: item,
319
322
  maxFileSize: item.materialSize,
@@ -24,6 +24,7 @@ export interface FileItemProps {
24
24
  valChange: (value: any, fileIndex: any, index: any, subIndex: any) => void;
25
25
  download: (value: any) => void;
26
26
  saveSignerInfo: (value: any) => boolean;
27
+ signInfoMap?: object;
27
28
  }
28
29
  declare const FileItem: React.FC<FileItemProps>;
29
30
  export default FileItem;
@@ -29,6 +29,8 @@ var _signerInfo = _interopRequireDefault(require("./signerInfo"));
29
29
  require("./item.scss");
30
30
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
31
31
  var RadioGroup = _radio["default"].Group;
32
+ var SELF = 0;
33
+ var OTHER = 1;
32
34
  var FileItem = function FileItem(_ref) {
33
35
  var index = _ref.index,
34
36
  subIndex = _ref.subIndex,
@@ -51,7 +53,8 @@ var FileItem = function FileItem(_ref) {
51
53
  download = _ref.download,
52
54
  openLoading = _ref.openLoading,
53
55
  closeLoading = _ref.closeLoading,
54
- saveSignerInfo = _ref.saveSignerInfo;
56
+ saveSignerInfo = _ref.saveSignerInfo,
57
+ signInfoMap = _ref.signInfoMap;
55
58
  console.log('fileItem', file, maxFileSize);
56
59
  var fileName = file.fileName,
57
60
  fileUrl = file.fileUrl,
@@ -59,14 +62,24 @@ var FileItem = function FileItem(_ref) {
59
62
  isSigned = file.isSigned,
60
63
  isSealed = file.isSealed,
61
64
  fileType = file.fileType;
62
- var signatureEnable = fileConfig.signatureEnable,
65
+ var materialName = fileConfig.materialName,
66
+ signatureEnable = fileConfig.signatureEnable,
63
67
  signEnable = fileConfig.signEnable,
64
68
  isInValid = fileConfig.isInValid,
65
69
  signGuidFileId = fileConfig.signGuidFileId,
66
70
  keyPoint = fileConfig.keyPoint,
67
71
  isSmart = fileConfig.isSmart,
68
72
  isShareFile = fileConfig.isShareFile,
69
- needOtherSign = fileConfig.needOtherSign;
73
+ signatureSelfRole = fileConfig.signatureSelfRole,
74
+ signatureAgentRole = fileConfig.signatureAgentRole,
75
+ signSelfRole = fileConfig.signSelfRole,
76
+ signAgentRole = fileConfig.signAgentRole;
77
+ // 需要他人签批或签章
78
+ var needOtherSign = signatureSelfRole.includes(OTHER) || signatureAgentRole.includes(OTHER) || signSelfRole.includes(OTHER) || signAgentRole.includes(OTHER);
79
+ // 需要他人签名
80
+ var isNeedOtherSign = signatureSelfRole.includes(OTHER) || signatureAgentRole.includes(OTHER);
81
+ // 需要他人签章
82
+ var isNeedOtherSeal = signSelfRole.includes(OTHER) || signAgentRole.includes(OTHER);
70
83
  var signBtnText = needOtherSign ? '联合签署' : '签署文件';
71
84
  var reSignBtnText = needOtherSign ? '重新联合签署' : '重新签署';
72
85
  var _useState = (0, _react.useState)(false),
@@ -309,7 +322,6 @@ var FileItem = function FileItem(_ref) {
309
322
 
310
323
  // 签章
311
324
  var seal = function seal() {
312
- console.log('fileType', fileType);
313
325
  var type = (0, _file2.getFileExtension)(fileName);
314
326
  if (type !== 'pdf') {
315
327
  _message["default"].notice('只有pdf文件才能使用电子签章');
@@ -319,6 +331,12 @@ var FileItem = function FileItem(_ref) {
319
331
  setIsShowSealPage(true);
320
332
  };
321
333
  var signAndSeal = function signAndSeal() {
334
+ // const notNeedSelfSign = !signatureSelfRole.includes(SELF) && !signatureAgentRole.includes(SELF) && !signSelfRole.includes(SELF) && !signAgentRole.includes(SELF)
335
+ // // 如果不需要自己签署 只需要别人签署 就直接打开维护签署人信息
336
+ // if (notNeedSelfSign && needOtherSign) {
337
+ // setShowSignerInfo(true)
338
+ // return
339
+ // }
322
340
  // 如果不能签章就直接签批
323
341
  if (!(userInfo.acctType === '20' && signEnable)) {
324
342
  sign();
@@ -734,13 +752,7 @@ var FileItem = function FileItem(_ref) {
734
752
  }, signatureEnable || userInfo.acctType === '20' && signEnable && /*#__PURE__*/_react["default"].createElement("div", {
735
753
  className: "operation_btn",
736
754
  onClick: signAndSeal
737
- }, isSigned && isSealed ? reSignBtnText : signBtnText), !(userInfo.acctType === '20' && signEnable) && signatureEnable && /*#__PURE__*/_react["default"].createElement("div", {
738
- className: "operation_btn",
739
- onClick: sign
740
- }, isSigned ? reSignBtnText : signBtnText), !signatureEnable && userInfo.acctType === '20' && signEnable && /*#__PURE__*/_react["default"].createElement("div", {
741
- className: "operation_btn",
742
- onClick: seal
743
- }, isSealed ? reSignBtnText : signBtnText)) :
755
+ }, isSigned && isSealed ? reSignBtnText : signBtnText)) :
744
756
  // 展示材料库
745
757
  !isShareFile && !isSmart && !disabled && !!materialLib.length && /*#__PURE__*/_react["default"].createElement("div", {
746
758
  className: "operation_btn",
@@ -891,12 +903,16 @@ var FileItem = function FileItem(_ref) {
891
903
  }), showSignerInfo && /*#__PURE__*/_react["default"].createElement(_signerInfo["default"], {
892
904
  signerInfo: signerInfo,
893
905
  handleClose: function handleClose() {
894
- console.log('close');
895
- setShowSignerInfo(false);
906
+ return setShowSignerInfo(false);
896
907
  },
897
908
  saveSignerInfo: saveSignerInfo,
898
909
  signatureEnable: signatureEnable,
899
- signEnable: signEnable
910
+ signEnable: signEnable,
911
+ isNeedOtherSign: isNeedOtherSign,
912
+ isNeedOtherSeal: isNeedOtherSeal,
913
+ file: file,
914
+ materialName: materialName,
915
+ signInfoMap: signInfoMap
900
916
  }));
901
917
  };
902
918
  FileItem.displayName = 'FileItem';
@@ -22,7 +22,12 @@ function SignerInfo(props) {
22
22
  signerInfo = props.signerInfo,
23
23
  saveSignerInfo = props.saveSignerInfo,
24
24
  signatureEnable = props.signatureEnable,
25
- signEnable = props.signEnable;
25
+ signEnable = props.signEnable,
26
+ isNeedOtherSign = props.isNeedOtherSign,
27
+ isNeedOtherSeal = props.isNeedOtherSeal,
28
+ file = props.file,
29
+ materialName = props.materialName,
30
+ signInfoMap = props.signInfoMap;
26
31
  var _React$useState = _react["default"].useState([]),
27
32
  signerInfoList = _React$useState[0],
28
33
  setSignerInfoList = _React$useState[1];
@@ -39,6 +44,16 @@ function SignerInfo(props) {
39
44
  newList[index] = (0, _extends3["default"])({}, newList[index], (_extends2 = {}, _extends2[field] = val, _extends2));
40
45
  setSignerInfoList(newList);
41
46
  };
47
+ var getCurrentTime = function getCurrentTime() {
48
+ var now = new Date();
49
+ var year = now.getFullYear();
50
+ var month = now.getMonth() + 1; // 无前导零
51
+ var day = now.getDate(); // 无前导零
52
+ var hours = now.getHours().toString().padStart(2, '0');
53
+ var minutes = now.getMinutes().toString().padStart(2, '0');
54
+ var seconds = now.getSeconds().toString().padStart(2, '0');
55
+ return year + "/" + month + "/" + day + " " + hours + ":" + minutes + ":" + seconds;
56
+ };
42
57
  var next = /*#__PURE__*/function () {
43
58
  var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
44
59
  var saveRes;
@@ -46,7 +61,12 @@ function SignerInfo(props) {
46
61
  while (1) switch (_context.prev = _context.next) {
47
62
  case 0:
48
63
  _context.next = 1;
49
- return saveSignerInfo(signerInfoList);
64
+ return saveSignerInfo({
65
+ list: signerInfoList,
66
+ file: file,
67
+ materialName: materialName,
68
+ date: getCurrentTime()
69
+ });
50
70
  case 1:
51
71
  saveRes = _context.sent;
52
72
  if (saveRes) {
@@ -77,6 +97,14 @@ function SignerInfo(props) {
77
97
  navigator.clipboard.writeText(url);
78
98
  _message["default"].success('复制成功');
79
99
  };
100
+ (0, _react.useEffect)(function () {
101
+ if (signInfoMap && file) {
102
+ var fileId = file.fileId;
103
+ if (signInfoMap[fileId]) {
104
+ setSignerInfoList(signInfoMap[fileId]);
105
+ }
106
+ }
107
+ }, [signInfoMap, file]);
80
108
  (0, _react.useEffect)(function () {
81
109
  if (signerInfo) {
82
110
  console.log('signerInfo', signerInfo);
@@ -240,10 +268,10 @@ function SignerInfo(props) {
240
268
  return handleFieldChange('signContent', val, index);
241
269
  },
242
270
  "aria-labelledby": "groupId"
243
- }, signatureEnable && /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
271
+ }, signatureEnable && isNeedOtherSign && /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
244
272
  id: "1",
245
273
  value: "1"
246
- }, "\u4EC5\u7B7E\u540D"), signEnable && item.signType === 1 && /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
274
+ }, "\u4EC5\u7B7E\u540D"), signEnable && isNeedOtherSeal && item.signType === 1 && /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
247
275
  id: "2",
248
276
  value: "2"
249
277
  }, "\u4EC5\u7B7E\u7AE0")))));
@@ -12,6 +12,7 @@ export interface MaterialsProps {
12
12
  download?: (params: any) => void;
13
13
  situationResRechange?: (data: any) => void;
14
14
  taskHandleItem?: string;
15
+ previousData?: any;
15
16
  }
16
17
  declare const Materials: React.FC<MaterialsProps>;
17
18
  export default Materials;
@@ -19,7 +19,8 @@ var Materials = function Materials(_ref) {
19
19
  baseUrlProp = _ref.baseUrl,
20
20
  downloadProp = _ref.download,
21
21
  situationResRechangeProp = _ref.situationResRechange,
22
- taskHandleItemProp = _ref.taskHandleItem;
22
+ taskHandleItemProp = _ref.taskHandleItem,
23
+ previousDataProp = _ref.previousData;
23
24
  return /*#__PURE__*/React.createElement("div", {
24
25
  className: "materials-content"
25
26
  }, situationPageUrlProp && /*#__PURE__*/React.createElement(_situation["default"], {
@@ -31,7 +32,8 @@ var Materials = function Materials(_ref) {
31
32
  declarationAppToken: declarationAppTokenProp,
32
33
  situationPageUrl: situationPageUrlProp,
33
34
  situationResRechange: situationResRechangeProp,
34
- taskHandleItem: taskHandleItemProp
35
+ taskHandleItem: taskHandleItemProp,
36
+ previousData: previousDataProp
35
37
  }), /*#__PURE__*/React.createElement(_materialsList["default"], {
36
38
  eventInfo: eventInfoProp,
37
39
  finalMaterials: finalMaterialsProp,
@@ -10,6 +10,7 @@ export interface SituationProps {
10
10
  situationPageUrl?: string;
11
11
  taskHandleItem?: string;
12
12
  situationResRechange?: (data: any) => void;
13
+ previousData?: any;
13
14
  }
14
15
  declare const Situation: React.FC<SituationProps>;
15
16
  export default Situation;
@@ -18,7 +18,8 @@ var Situation = function Situation(_ref) {
18
18
  declarationAppTokenProp = _ref.declarationAppToken,
19
19
  situationPageUrlProp = _ref.situationPageUrl,
20
20
  taskHandleItemProp = _ref.taskHandleItem,
21
- situationResRechangeProp = _ref.situationResRechange;
21
+ situationResRechangeProp = _ref.situationResRechange,
22
+ previousDataProp = _ref.previousData;
22
23
  var _React$useState = React.useState('说明:因个人情况不同上交材料不同,可通过情形选择查看必须上传的材料!'),
23
24
  tip = _React$useState[0];
24
25
  var _React$useState2 = React.useState(false),
@@ -33,14 +34,14 @@ var Situation = function Situation(_ref) {
33
34
  return function () {
34
35
  window.removeEventListener('message', getMessage);
35
36
  };
36
- }, []);
37
+ }, [eventInfoProp, taskHandleItemProp, situationPageUrlProp, declarationAppTokenProp, finalMaterialsProp, applicationIdProp, accessTokenProp, acctTypeProp, previousDataProp]);
37
38
  var initPage = function initPage() {
38
39
  if (!situationPageUrlProp) return;
39
- var url = situationPageUrlProp + "&isFirst=1&isReCheck=1";
40
+ var url = situationPageUrlProp + "&isFirst=1&isReCheck=1&isZXBB=1";
40
41
  setIframeSrc(url);
41
42
  };
42
43
  var getMessage = function getMessage(e) {
43
- var typeArr = ['getAccessToken', 'getDeclaraToken', 'getApplicationId', 'getTaskHandleItem', 'getFormId', 'getMaterials', 'getFormData'];
44
+ var typeArr = ['getAccessToken', 'getDeclaraToken', 'getApplicationId', 'getTaskHandleItem', 'getFormId', 'getMaterials', 'getFormData', 'getPreviousData'];
44
45
  var _ref2 = e.data || {},
45
46
  type = _ref2.type,
46
47
  data = _ref2.data;
@@ -86,6 +87,9 @@ var Situation = function Situation(_ref) {
86
87
  case 'getMaterials':
87
88
  sendData.data.materials = finalMaterials || (eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.taskGeneralMaterials);
88
89
  break;
90
+ case 'getPreviousData':
91
+ sendData.data.previousData = previousDataProp;
92
+ break;
89
93
  }
90
94
  var formIframe = document.getElementById('situationIframe');
91
95
  if (formIframe !== null && formIframe !== void 0 && formIframe.contentWindow) {
@@ -30,6 +30,8 @@ export interface GuideProps {
30
30
  download?: (params: any) => void;
31
31
  /** Situation result re-change handler */
32
32
  situationResRechange?: (data: any) => void;
33
+ /** Previous form data from parent */
34
+ previousData?: any;
33
35
  }
34
36
  declare const Guide: React.FC<GuideProps>;
35
37
  export default Guide;
@@ -47,7 +47,8 @@ var Guide = function Guide(_ref) {
47
47
  situationPageUrl = _ref.situationPageUrl,
48
48
  baseUrl = _ref.baseUrl,
49
49
  download = _ref.download,
50
- situationResRechange = _ref.situationResRechange;
50
+ situationResRechange = _ref.situationResRechange,
51
+ previousData = _ref.previousData;
51
52
  var _React$useState = React.useState(false),
52
53
  pageLoading = _React$useState[0];
53
54
  var _React$useState2 = React.useState(true),
@@ -291,7 +292,8 @@ var Guide = function Guide(_ref) {
291
292
  baseUrl: baseUrl,
292
293
  download: download,
293
294
  situationResRechange: situationResRechange,
294
- taskHandleItem: taskHandleItem
295
+ taskHandleItem: taskHandleItem,
296
+ previousData: previousData
295
297
  }), tabIndex === 1 && /*#__PURE__*/React.createElement(_basicInfo["default"], {
296
298
  eventInfo: eventInfoProp
297
299
  }), tabIndex === 2 && /*#__PURE__*/React.createElement(_processImg["default"], {