ydb-components-material 0.1.110 → 0.1.111

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.
@@ -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,
@@ -60,7 +62,16 @@ var FileItem = function FileItem(_ref) {
60
62
  keyPoint = fileConfig.keyPoint,
61
63
  isSmart = fileConfig.isSmart,
62
64
  isShareFile = fileConfig.isShareFile,
63
- needOtherSign = fileConfig.needOtherSign;
65
+ signatureSelfRole = fileConfig.signatureSelfRole,
66
+ signatureAgentRole = fileConfig.signatureAgentRole,
67
+ signSelfRole = fileConfig.signSelfRole,
68
+ signAgentRole = fileConfig.signAgentRole;
69
+ // 需要他人签批或签章
70
+ var needOtherSign = signatureSelfRole.includes(OTHER) || signatureAgentRole.includes(OTHER) || signSelfRole.includes(OTHER) || signAgentRole.includes(OTHER);
71
+ // 需要他人签名
72
+ var isNeedOtherSign = signatureSelfRole.includes(OTHER) || signatureAgentRole.includes(OTHER);
73
+ // 需要他人签章
74
+ var isNeedOtherSeal = signSelfRole.includes(OTHER) || signAgentRole.includes(OTHER);
64
75
  var signBtnText = needOtherSign ? '联合签署' : '签署文件';
65
76
  var reSignBtnText = needOtherSign ? '重新联合签署' : '重新签署';
66
77
  var _useState = useState(false),
@@ -303,7 +314,6 @@ var FileItem = function FileItem(_ref) {
303
314
 
304
315
  // 签章
305
316
  var seal = function seal() {
306
- console.log('fileType', fileType);
307
317
  var type = getFileExtension(fileName);
308
318
  if (type !== 'pdf') {
309
319
  _Message.notice('只有pdf文件才能使用电子签章');
@@ -313,6 +323,12 @@ var FileItem = function FileItem(_ref) {
313
323
  setIsShowSealPage(true);
314
324
  };
315
325
  var signAndSeal = function signAndSeal() {
326
+ // const notNeedSelfSign = !signatureSelfRole.includes(SELF) && !signatureAgentRole.includes(SELF) && !signSelfRole.includes(SELF) && !signAgentRole.includes(SELF)
327
+ // // 如果不需要自己签署 只需要别人签署 就直接打开维护签署人信息
328
+ // if (notNeedSelfSign && needOtherSign) {
329
+ // setShowSignerInfo(true)
330
+ // return
331
+ // }
316
332
  // 如果不能签章就直接签批
317
333
  if (!(userInfo.acctType === '20' && signEnable)) {
318
334
  sign();
@@ -728,13 +744,7 @@ var FileItem = function FileItem(_ref) {
728
744
  }, signatureEnable || userInfo.acctType === '20' && signEnable && /*#__PURE__*/React.createElement("div", {
729
745
  className: "operation_btn",
730
746
  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)) :
747
+ }, isSigned && isSealed ? reSignBtnText : signBtnText)) :
738
748
  // 展示材料库
739
749
  !isShareFile && !isSmart && !disabled && !!materialLib.length && /*#__PURE__*/React.createElement("div", {
740
750
  className: "operation_btn",
@@ -885,12 +895,13 @@ var FileItem = function FileItem(_ref) {
885
895
  }), showSignerInfo && /*#__PURE__*/React.createElement(SignerInfo, {
886
896
  signerInfo: signerInfo,
887
897
  handleClose: function handleClose() {
888
- console.log('close');
889
- setShowSignerInfo(false);
898
+ return setShowSignerInfo(false);
890
899
  },
891
900
  saveSignerInfo: saveSignerInfo,
892
901
  signatureEnable: signatureEnable,
893
- signEnable: signEnable
902
+ signEnable: signEnable,
903
+ isNeedOtherSign: isNeedOtherSign,
904
+ isNeedOtherSeal: isNeedOtherSeal
894
905
  }));
895
906
  };
896
907
  FileItem.displayName = 'FileItem';
@@ -16,7 +16,9 @@ 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;
20
22
  var _React$useState = React.useState([]),
21
23
  signerInfoList = _React$useState[0],
22
24
  setSignerInfoList = _React$useState[1];
@@ -234,10 +236,10 @@ function SignerInfo(props) {
234
236
  return handleFieldChange('signContent', val, index);
235
237
  },
236
238
  "aria-labelledby": "groupId"
237
- }, signatureEnable && /*#__PURE__*/React.createElement(_Checkbox, {
239
+ }, signatureEnable && isNeedOtherSign && /*#__PURE__*/React.createElement(_Checkbox, {
238
240
  id: "1",
239
241
  value: "1"
240
- }, "\u4EC5\u7B7E\u540D"), signEnable && item.signType === 1 && /*#__PURE__*/React.createElement(_Checkbox, {
242
+ }, "\u4EC5\u7B7E\u540D"), signEnable && isNeedOtherSeal && item.signType === 1 && /*#__PURE__*/React.createElement(_Checkbox, {
241
243
  id: "2",
242
244
  value: "2"
243
245
  }, "\u4EC5\u7B7E\u7AE0")))));
@@ -29,7 +29,7 @@ var Situation = function Situation(_ref) {
29
29
  return function () {
30
30
  window.removeEventListener('message', getMessage);
31
31
  };
32
- }, []);
32
+ }, [eventInfoProp, taskHandleItemProp, situationPageUrlProp, declarationAppTokenProp, finalMaterialsProp, applicationIdProp, accessTokenProp, acctTypeProp]);
33
33
  var initPage = function initPage() {
34
34
  if (!situationPageUrlProp) return;
35
35
  var url = situationPageUrlProp + "&isFirst=1&isReCheck=1";
@@ -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,
@@ -66,7 +68,16 @@ var FileItem = function FileItem(_ref) {
66
68
  keyPoint = fileConfig.keyPoint,
67
69
  isSmart = fileConfig.isSmart,
68
70
  isShareFile = fileConfig.isShareFile,
69
- needOtherSign = fileConfig.needOtherSign;
71
+ signatureSelfRole = fileConfig.signatureSelfRole,
72
+ signatureAgentRole = fileConfig.signatureAgentRole,
73
+ signSelfRole = fileConfig.signSelfRole,
74
+ signAgentRole = fileConfig.signAgentRole;
75
+ // 需要他人签批或签章
76
+ var needOtherSign = signatureSelfRole.includes(OTHER) || signatureAgentRole.includes(OTHER) || signSelfRole.includes(OTHER) || signAgentRole.includes(OTHER);
77
+ // 需要他人签名
78
+ var isNeedOtherSign = signatureSelfRole.includes(OTHER) || signatureAgentRole.includes(OTHER);
79
+ // 需要他人签章
80
+ var isNeedOtherSeal = signSelfRole.includes(OTHER) || signAgentRole.includes(OTHER);
70
81
  var signBtnText = needOtherSign ? '联合签署' : '签署文件';
71
82
  var reSignBtnText = needOtherSign ? '重新联合签署' : '重新签署';
72
83
  var _useState = (0, _react.useState)(false),
@@ -309,7 +320,6 @@ var FileItem = function FileItem(_ref) {
309
320
 
310
321
  // 签章
311
322
  var seal = function seal() {
312
- console.log('fileType', fileType);
313
323
  var type = (0, _file2.getFileExtension)(fileName);
314
324
  if (type !== 'pdf') {
315
325
  _message["default"].notice('只有pdf文件才能使用电子签章');
@@ -319,6 +329,12 @@ var FileItem = function FileItem(_ref) {
319
329
  setIsShowSealPage(true);
320
330
  };
321
331
  var signAndSeal = function signAndSeal() {
332
+ // const notNeedSelfSign = !signatureSelfRole.includes(SELF) && !signatureAgentRole.includes(SELF) && !signSelfRole.includes(SELF) && !signAgentRole.includes(SELF)
333
+ // // 如果不需要自己签署 只需要别人签署 就直接打开维护签署人信息
334
+ // if (notNeedSelfSign && needOtherSign) {
335
+ // setShowSignerInfo(true)
336
+ // return
337
+ // }
322
338
  // 如果不能签章就直接签批
323
339
  if (!(userInfo.acctType === '20' && signEnable)) {
324
340
  sign();
@@ -734,13 +750,7 @@ var FileItem = function FileItem(_ref) {
734
750
  }, signatureEnable || userInfo.acctType === '20' && signEnable && /*#__PURE__*/_react["default"].createElement("div", {
735
751
  className: "operation_btn",
736
752
  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)) :
753
+ }, isSigned && isSealed ? reSignBtnText : signBtnText)) :
744
754
  // 展示材料库
745
755
  !isShareFile && !isSmart && !disabled && !!materialLib.length && /*#__PURE__*/_react["default"].createElement("div", {
746
756
  className: "operation_btn",
@@ -891,12 +901,13 @@ var FileItem = function FileItem(_ref) {
891
901
  }), showSignerInfo && /*#__PURE__*/_react["default"].createElement(_signerInfo["default"], {
892
902
  signerInfo: signerInfo,
893
903
  handleClose: function handleClose() {
894
- console.log('close');
895
- setShowSignerInfo(false);
904
+ return setShowSignerInfo(false);
896
905
  },
897
906
  saveSignerInfo: saveSignerInfo,
898
907
  signatureEnable: signatureEnable,
899
- signEnable: signEnable
908
+ signEnable: signEnable,
909
+ isNeedOtherSign: isNeedOtherSign,
910
+ isNeedOtherSeal: isNeedOtherSeal
900
911
  }));
901
912
  };
902
913
  FileItem.displayName = 'FileItem';
@@ -22,7 +22,9 @@ 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;
26
28
  var _React$useState = _react["default"].useState([]),
27
29
  signerInfoList = _React$useState[0],
28
30
  setSignerInfoList = _React$useState[1];
@@ -240,10 +242,10 @@ function SignerInfo(props) {
240
242
  return handleFieldChange('signContent', val, index);
241
243
  },
242
244
  "aria-labelledby": "groupId"
243
- }, signatureEnable && /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
245
+ }, signatureEnable && isNeedOtherSign && /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
244
246
  id: "1",
245
247
  value: "1"
246
- }, "\u4EC5\u7B7E\u540D"), signEnable && item.signType === 1 && /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
248
+ }, "\u4EC5\u7B7E\u540D"), signEnable && isNeedOtherSeal && item.signType === 1 && /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
247
249
  id: "2",
248
250
  value: "2"
249
251
  }, "\u4EC5\u7B7E\u7AE0")))));
@@ -33,7 +33,7 @@ var Situation = function Situation(_ref) {
33
33
  return function () {
34
34
  window.removeEventListener('message', getMessage);
35
35
  };
36
- }, []);
36
+ }, [eventInfoProp, taskHandleItemProp, situationPageUrlProp, declarationAppTokenProp, finalMaterialsProp, applicationIdProp, accessTokenProp, acctTypeProp]);
37
37
  var initPage = function initPage() {
38
38
  if (!situationPageUrlProp) return;
39
39
  var url = situationPageUrlProp + "&isFirst=1&isReCheck=1";
@@ -97,7 +97,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
97
97
  packageName = 'ydb-components-material';
98
98
  }
99
99
  if (version === void 0) {
100
- version = '0.1.110';
100
+ version = '0.1.111';
101
101
  }
102
102
  if (basicLibraryVersion === void 0) {
103
103
  basicLibraryVersion = {
@@ -102,7 +102,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
102
102
  packageName = 'ydb-components-material';
103
103
  }
104
104
  if (version === void 0) {
105
- version = '0.1.110';
105
+ version = '0.1.111';
106
106
  }
107
107
  if (basicLibraryVersion === void 0) {
108
108
  basicLibraryVersion = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-components-material",
3
- "version": "0.1.110",
3
+ "version": "0.1.111",
4
4
  "description": "ydb-components-material",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -101,10 +101,10 @@
101
101
  },
102
102
  "componentConfig": {
103
103
  "isComponentLibrary": true,
104
- "materialSchema": "https://unpkg.com/ydb-components-material@0.1.110/build/lowcode/assets-prod.json"
104
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.111/build/lowcode/assets-prod.json"
105
105
  },
106
106
  "lcMeta": {
107
107
  "type": "component"
108
108
  },
109
- "homepage": "https://unpkg.com/ydb-components-material@0.1.110/build/index.html"
109
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.111/build/index.html"
110
110
  }