ydb-components-material 0.1.142 → 0.1.143

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,7 +197,6 @@ var FileItem = function FileItem(_ref) {
197
197
  var _useState17 = useState(true),
198
198
  showSignPageClose = _useState17[0],
199
199
  setShowSignPageClose = _useState17[1];
200
- var timerRef = useRef(null);
201
200
  var originalUrlRef = useRef('');
202
201
  var getSignedFile = /*#__PURE__*/function () {
203
202
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(documentIdVal, contractIdVal, nameVal) {
@@ -216,20 +215,24 @@ var FileItem = function FileItem(_ref) {
216
215
  });
217
216
  case 1:
218
217
  newFile = _context.sent;
219
- if (newFile) {
220
- closeLoading();
221
- sessionStorage.removeItem(tokenTY);
222
- clearInterval(timerRef.current);
223
- timerRef.current = null;
224
- getRes(_extends({}, file, {
225
- fileId: newFile.fileId,
226
- fileName: nameVal,
227
- fileUrl: newFile.fileUrlList[2],
228
- originalUrl: originalUrlRef.current,
229
- isSigned: true
230
- }));
218
+ sessionStorage.removeItem(tokenTY);
219
+ localStorage.removeItem(tokenTY);
220
+ if (!newFile) {
221
+ _context.next = 2;
222
+ break;
231
223
  }
224
+ closeLoading();
225
+ getRes(_extends({}, file, {
226
+ fileId: newFile.fileId,
227
+ fileName: nameVal,
228
+ fileUrl: newFile.fileUrlList[2],
229
+ originalUrl: originalUrlRef.current,
230
+ isSigned: true
231
+ }));
232
+ return _context.abrupt("return", true);
232
233
  case 2:
234
+ return _context.abrupt("return", false);
235
+ case 3:
233
236
  case "end":
234
237
  return _context.stop();
235
238
  }
@@ -239,10 +242,6 @@ var FileItem = function FileItem(_ref) {
239
242
  return _ref2.apply(this, arguments);
240
243
  };
241
244
  }();
242
- var handleClearInterval = function handleClearInterval() {
243
- clearInterval(timerRef.current);
244
- timerRef.current = null;
245
- };
246
245
  var upload = function upload() {
247
246
  if (disabled) return;
248
247
  var inputEl = document.createElement('input');
@@ -908,19 +907,17 @@ var FileItem = function FileItem(_ref) {
908
907
  console.log('docId', docId, contrId, nameVal);
909
908
  if (storedFileId !== fileId) return;
910
909
  originalUrlRef.current = originalUrl || '';
911
- if (docId && contrId && nameVal && !timerRef.current) {
912
- handleClearInterval();
910
+ if (docId && contrId && nameVal) {
913
911
  openLoading();
914
- timerRef.current = setInterval(function () {
915
- console.log('docId---', docId, contrId, nameVal);
916
- getSignedFile(docId, contrId, nameVal);
917
- }, 3000);
912
+ getSignedFile(docId, contrId, nameVal).then(function (success) {
913
+ if (!success) {
914
+ closeLoading();
915
+ _Message.error('签署失败,请重新签署');
916
+ }
917
+ });
918
918
  }
919
919
  }
920
920
  } catch (e) {}
921
- return function () {
922
- handleClearInterval();
923
- };
924
921
  }, []);
925
922
  return /*#__PURE__*/React.createElement("div", {
926
923
  className: "file_item",
@@ -203,7 +203,6 @@ 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 timerRef = (0, _react.useRef)(null);
207
206
  var originalUrlRef = (0, _react.useRef)('');
208
207
  var getSignedFile = /*#__PURE__*/function () {
209
208
  var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(documentIdVal, contractIdVal, nameVal) {
@@ -222,20 +221,24 @@ var FileItem = function FileItem(_ref) {
222
221
  });
223
222
  case 1:
224
223
  newFile = _context.sent;
225
- if (newFile) {
226
- closeLoading();
227
- sessionStorage.removeItem(tokenTY);
228
- clearInterval(timerRef.current);
229
- timerRef.current = null;
230
- getRes((0, _extends3["default"])({}, file, {
231
- fileId: newFile.fileId,
232
- fileName: nameVal,
233
- fileUrl: newFile.fileUrlList[2],
234
- originalUrl: originalUrlRef.current,
235
- isSigned: true
236
- }));
224
+ sessionStorage.removeItem(tokenTY);
225
+ localStorage.removeItem(tokenTY);
226
+ if (!newFile) {
227
+ _context.next = 2;
228
+ break;
237
229
  }
230
+ closeLoading();
231
+ getRes((0, _extends3["default"])({}, file, {
232
+ fileId: newFile.fileId,
233
+ fileName: nameVal,
234
+ fileUrl: newFile.fileUrlList[2],
235
+ originalUrl: originalUrlRef.current,
236
+ isSigned: true
237
+ }));
238
+ return _context.abrupt("return", true);
238
239
  case 2:
240
+ return _context.abrupt("return", false);
241
+ case 3:
239
242
  case "end":
240
243
  return _context.stop();
241
244
  }
@@ -245,10 +248,6 @@ var FileItem = function FileItem(_ref) {
245
248
  return _ref2.apply(this, arguments);
246
249
  };
247
250
  }();
248
- var handleClearInterval = function handleClearInterval() {
249
- clearInterval(timerRef.current);
250
- timerRef.current = null;
251
- };
252
251
  var upload = function upload() {
253
252
  if (disabled) return;
254
253
  var inputEl = document.createElement('input');
@@ -914,19 +913,17 @@ var FileItem = function FileItem(_ref) {
914
913
  console.log('docId', docId, contrId, nameVal);
915
914
  if (storedFileId !== fileId) return;
916
915
  originalUrlRef.current = originalUrl || '';
917
- if (docId && contrId && nameVal && !timerRef.current) {
918
- handleClearInterval();
916
+ if (docId && contrId && nameVal) {
919
917
  openLoading();
920
- timerRef.current = setInterval(function () {
921
- console.log('docId---', docId, contrId, nameVal);
922
- getSignedFile(docId, contrId, nameVal);
923
- }, 3000);
918
+ getSignedFile(docId, contrId, nameVal).then(function (success) {
919
+ if (!success) {
920
+ closeLoading();
921
+ _message["default"].error('签署失败,请重新签署');
922
+ }
923
+ });
924
924
  }
925
925
  }
926
926
  } catch (e) {}
927
- return function () {
928
- handleClearInterval();
929
- };
930
927
  }, []);
931
928
  return /*#__PURE__*/_react["default"].createElement("div", {
932
929
  className: "file_item",
@@ -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.142';
101
+ version = '0.1.143';
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.142';
106
+ version = '0.1.143';
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.142",
3
+ "version": "0.1.143",
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.142/build/lowcode/assets-prod.json"
105
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.143/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.142/build/index.html"
110
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.143/build/index.html"
111
111
  }