ydb-components-material 0.1.143 → 0.1.145

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.
@@ -197,6 +197,10 @@ var FileItem = function FileItem(_ref) {
197
197
  var _useState17 = useState(true),
198
198
  showSignPageClose = _useState17[0],
199
199
  setShowSignPageClose = _useState17[1];
200
+ var _useState18 = useState(0),
201
+ signKey = _useState18[0],
202
+ setSignKey = _useState18[1];
203
+ var timerRef = useRef(null);
200
204
  var originalUrlRef = useRef('');
201
205
  var getSignedFile = /*#__PURE__*/function () {
202
206
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(documentIdVal, contractIdVal, nameVal) {
@@ -215,12 +219,13 @@ var FileItem = function FileItem(_ref) {
215
219
  });
216
220
  case 1:
217
221
  newFile = _context.sent;
218
- sessionStorage.removeItem(tokenTY);
219
- localStorage.removeItem(tokenTY);
220
222
  if (!newFile) {
221
223
  _context.next = 2;
222
224
  break;
223
225
  }
226
+ clearInterval(timerRef.current);
227
+ sessionStorage.removeItem(tokenTY);
228
+ localStorage.removeItem(tokenTY);
224
229
  closeLoading();
225
230
  getRes(_extends({}, file, {
226
231
  fileId: newFile.fileId,
@@ -428,6 +433,9 @@ var FileItem = function FileItem(_ref) {
428
433
  }
429
434
  ;
430
435
  openLoading();
436
+ setSignKey(function (k) {
437
+ return k + 1;
438
+ });
431
439
  setIsShowSignPage(true);
432
440
  };
433
441
 
@@ -906,18 +914,21 @@ var FileItem = function FileItem(_ref) {
906
914
  originalUrl = _JSON$parse.fileUrl;
907
915
  console.log('docId', docId, contrId, nameVal);
908
916
  if (storedFileId !== fileId) return;
917
+ sessionStorage.removeItem(tokenTY);
909
918
  originalUrlRef.current = originalUrl || '';
910
919
  if (docId && contrId && nameVal) {
911
920
  openLoading();
912
- getSignedFile(docId, contrId, nameVal).then(function (success) {
913
- if (!success) {
914
- closeLoading();
915
- _Message.error('签署失败,请重新签署');
916
- }
917
- });
921
+ timerRef.current = setInterval(function () {
922
+ getSignedFile(docId, contrId, nameVal);
923
+ }, 3000);
918
924
  }
919
925
  }
920
926
  } catch (e) {}
927
+ return function () {
928
+ if (timerRef.current) {
929
+ clearInterval(timerRef.current);
930
+ }
931
+ };
921
932
  }, []);
922
933
  return /*#__PURE__*/React.createElement("div", {
923
934
  className: "file_item",
@@ -1108,6 +1119,7 @@ var FileItem = function FileItem(_ref) {
1108
1119
  className: "btn ok",
1109
1120
  onClick: selectMaterialOk
1110
1121
  }, "\u786E\u5B9A")))), isShowSignPage && /*#__PURE__*/React.createElement(SignPage, {
1122
+ key: signKey,
1111
1123
  isShowSignPage: isShowSignPage,
1112
1124
  userInfo: userInfo,
1113
1125
  file: sealedFile || file,
@@ -203,6 +203,10 @@ var FileItem = function FileItem(_ref) {
203
203
  var _useState17 = (0, _react.useState)(true),
204
204
  showSignPageClose = _useState17[0],
205
205
  setShowSignPageClose = _useState17[1];
206
+ var _useState18 = (0, _react.useState)(0),
207
+ signKey = _useState18[0],
208
+ setSignKey = _useState18[1];
209
+ var timerRef = (0, _react.useRef)(null);
206
210
  var originalUrlRef = (0, _react.useRef)('');
207
211
  var getSignedFile = /*#__PURE__*/function () {
208
212
  var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(documentIdVal, contractIdVal, nameVal) {
@@ -221,12 +225,13 @@ var FileItem = function FileItem(_ref) {
221
225
  });
222
226
  case 1:
223
227
  newFile = _context.sent;
224
- sessionStorage.removeItem(tokenTY);
225
- localStorage.removeItem(tokenTY);
226
228
  if (!newFile) {
227
229
  _context.next = 2;
228
230
  break;
229
231
  }
232
+ clearInterval(timerRef.current);
233
+ sessionStorage.removeItem(tokenTY);
234
+ localStorage.removeItem(tokenTY);
230
235
  closeLoading();
231
236
  getRes((0, _extends3["default"])({}, file, {
232
237
  fileId: newFile.fileId,
@@ -434,6 +439,9 @@ var FileItem = function FileItem(_ref) {
434
439
  }
435
440
  ;
436
441
  openLoading();
442
+ setSignKey(function (k) {
443
+ return k + 1;
444
+ });
437
445
  setIsShowSignPage(true);
438
446
  };
439
447
 
@@ -912,18 +920,21 @@ var FileItem = function FileItem(_ref) {
912
920
  originalUrl = _JSON$parse.fileUrl;
913
921
  console.log('docId', docId, contrId, nameVal);
914
922
  if (storedFileId !== fileId) return;
923
+ sessionStorage.removeItem(tokenTY);
915
924
  originalUrlRef.current = originalUrl || '';
916
925
  if (docId && contrId && nameVal) {
917
926
  openLoading();
918
- getSignedFile(docId, contrId, nameVal).then(function (success) {
919
- if (!success) {
920
- closeLoading();
921
- _message["default"].error('签署失败,请重新签署');
922
- }
923
- });
927
+ timerRef.current = setInterval(function () {
928
+ getSignedFile(docId, contrId, nameVal);
929
+ }, 3000);
924
930
  }
925
931
  }
926
932
  } catch (e) {}
933
+ return function () {
934
+ if (timerRef.current) {
935
+ clearInterval(timerRef.current);
936
+ }
937
+ };
927
938
  }, []);
928
939
  return /*#__PURE__*/_react["default"].createElement("div", {
929
940
  className: "file_item",
@@ -1114,6 +1125,7 @@ var FileItem = function FileItem(_ref) {
1114
1125
  className: "btn ok",
1115
1126
  onClick: selectMaterialOk
1116
1127
  }, "\u786E\u5B9A")))), isShowSignPage && /*#__PURE__*/_react["default"].createElement(_sign["default"], {
1128
+ key: signKey,
1117
1129
  isShowSignPage: isShowSignPage,
1118
1130
  userInfo: userInfo,
1119
1131
  file: sealedFile || file,
@@ -98,7 +98,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
98
98
  packageName = 'ydb-components-material';
99
99
  }
100
100
  if (version === void 0) {
101
- version = '0.1.143';
101
+ version = '0.1.145';
102
102
  }
103
103
  if (basicLibraryVersion === void 0) {
104
104
  basicLibraryVersion = {
@@ -103,7 +103,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
103
103
  packageName = 'ydb-components-material';
104
104
  }
105
105
  if (version === void 0) {
106
- version = '0.1.143';
106
+ version = '0.1.145';
107
107
  }
108
108
  if (basicLibraryVersion === void 0) {
109
109
  basicLibraryVersion = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-components-material",
3
- "version": "0.1.143",
3
+ "version": "0.1.145",
4
4
  "description": "ydb-components-material",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -102,10 +102,10 @@
102
102
  },
103
103
  "componentConfig": {
104
104
  "isComponentLibrary": true,
105
- "materialSchema": "https://unpkg.com/ydb-components-material@0.1.143/build/lowcode/assets-prod.json"
105
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.145/build/lowcode/assets-prod.json"
106
106
  },
107
107
  "lcMeta": {
108
108
  "type": "component"
109
109
  },
110
- "homepage": "https://unpkg.com/ydb-components-material@0.1.143/build/index.html"
110
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.145/build/index.html"
111
111
  }