ydb-components-material 0.1.145 → 0.1.147

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.
@@ -60,6 +60,7 @@ var FileList = function FileList(_ref) {
60
60
  if (stored) {
61
61
  try {
62
62
  setFileArray(JSON.parse(stored));
63
+ localStorage.removeItem(tokenTY);
63
64
  } catch (e) {}
64
65
  } else {
65
66
  setFileArray(fileList);
@@ -224,8 +224,8 @@ var FileItem = function FileItem(_ref) {
224
224
  break;
225
225
  }
226
226
  clearInterval(timerRef.current);
227
- sessionStorage.removeItem(tokenTY);
228
- localStorage.removeItem(tokenTY);
227
+ timerRef.current = null;
228
+ localStorage.removeItem(fileId);
229
229
  closeLoading();
230
230
  getRes(_extends({}, file, {
231
231
  fileId: newFile.fileId,
@@ -747,15 +747,6 @@ var FileItem = function FileItem(_ref) {
747
747
  format: format
748
748
  });
749
749
  };
750
- var invalidHandle = function invalidHandle() {
751
- // 分享出去的需要别人签署的文件数据。标识为无效
752
- if (file.signId) {
753
- saveSignerInfo({
754
- uuid: file.signId,
755
- invalid: true
756
- });
757
- }
758
- };
759
750
  var handleDel = /*#__PURE__*/function () {
760
751
  var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
761
752
  return _regeneratorRuntime.wrap(function (_context7) {
@@ -903,18 +894,16 @@ var FileItem = function FileItem(_ref) {
903
894
  }, [fileId]);
904
895
  useEffect(function () {
905
896
  try {
906
- var stored = sessionStorage.getItem(tokenTY);
897
+ var stored = localStorage.getItem(fileId);
907
898
  if (stored) {
908
899
  console.log('stored---', stored);
909
900
  var _JSON$parse = JSON.parse(stored),
910
901
  contrId = _JSON$parse.contractId,
911
902
  docId = _JSON$parse.documentId,
912
903
  nameVal = _JSON$parse.fileName,
913
- storedFileId = _JSON$parse.fileId,
914
904
  originalUrl = _JSON$parse.fileUrl;
915
905
  console.log('docId', docId, contrId, nameVal);
916
- if (storedFileId !== fileId) return;
917
- sessionStorage.removeItem(tokenTY);
906
+ localStorage.removeItem(fileId);
918
907
  originalUrlRef.current = originalUrl || '';
919
908
  if (docId && contrId && nameVal) {
920
909
  openLoading();
@@ -927,6 +916,7 @@ var FileItem = function FileItem(_ref) {
927
916
  return function () {
928
917
  if (timerRef.current) {
929
918
  clearInterval(timerRef.current);
919
+ timerRef.current = null;
930
920
  }
931
921
  };
932
922
  }, []);
@@ -213,8 +213,8 @@ function getContractSignUrl(contractIdVal, userInfo, config) {
213
213
  }
214
214
 
215
215
  // 保存签批信息
216
- function setSignInfo(fileName, tokenTY, fileId, fileUrl) {
217
- sessionStorage.setItem(tokenTY, JSON.stringify({
216
+ function setSignInfo(fileName, fileId, fileUrl) {
217
+ localStorage.setItem(fileId, JSON.stringify({
218
218
  contractId: contractId,
219
219
  documentId: documentId,
220
220
  fileName: fileName,
@@ -257,7 +257,7 @@ function getSignUrl(userInfo, config, fileName, fileId, fileUrl) {
257
257
  console.log(res, '页面结果');
258
258
  if (res.data.code == 0) {
259
259
  if (config.fileList) {
260
- setSignInfo(fileName, config.tokenTY, fileId, fileUrl);
260
+ setSignInfo(fileName, fileId, fileUrl);
261
261
  localStorage.setItem(config.tokenTY, JSON.stringify(config.fileList));
262
262
  }
263
263
  resolve(res.data.signUrl);
@@ -66,6 +66,7 @@ var FileList = function FileList(_ref) {
66
66
  if (stored) {
67
67
  try {
68
68
  setFileArray(JSON.parse(stored));
69
+ localStorage.removeItem(tokenTY);
69
70
  } catch (e) {}
70
71
  } else {
71
72
  setFileArray(fileList);
@@ -230,8 +230,8 @@ var FileItem = function FileItem(_ref) {
230
230
  break;
231
231
  }
232
232
  clearInterval(timerRef.current);
233
- sessionStorage.removeItem(tokenTY);
234
- localStorage.removeItem(tokenTY);
233
+ timerRef.current = null;
234
+ localStorage.removeItem(fileId);
235
235
  closeLoading();
236
236
  getRes((0, _extends3["default"])({}, file, {
237
237
  fileId: newFile.fileId,
@@ -753,15 +753,6 @@ var FileItem = function FileItem(_ref) {
753
753
  format: format
754
754
  });
755
755
  };
756
- var invalidHandle = function invalidHandle() {
757
- // 分享出去的需要别人签署的文件数据。标识为无效
758
- if (file.signId) {
759
- saveSignerInfo({
760
- uuid: file.signId,
761
- invalid: true
762
- });
763
- }
764
- };
765
756
  var handleDel = /*#__PURE__*/function () {
766
757
  var _ref8 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7() {
767
758
  return _regenerator["default"].wrap(function (_context7) {
@@ -909,18 +900,16 @@ var FileItem = function FileItem(_ref) {
909
900
  }, [fileId]);
910
901
  (0, _react.useEffect)(function () {
911
902
  try {
912
- var stored = sessionStorage.getItem(tokenTY);
903
+ var stored = localStorage.getItem(fileId);
913
904
  if (stored) {
914
905
  console.log('stored---', stored);
915
906
  var _JSON$parse = JSON.parse(stored),
916
907
  contrId = _JSON$parse.contractId,
917
908
  docId = _JSON$parse.documentId,
918
909
  nameVal = _JSON$parse.fileName,
919
- storedFileId = _JSON$parse.fileId,
920
910
  originalUrl = _JSON$parse.fileUrl;
921
911
  console.log('docId', docId, contrId, nameVal);
922
- if (storedFileId !== fileId) return;
923
- sessionStorage.removeItem(tokenTY);
912
+ localStorage.removeItem(fileId);
924
913
  originalUrlRef.current = originalUrl || '';
925
914
  if (docId && contrId && nameVal) {
926
915
  openLoading();
@@ -933,6 +922,7 @@ var FileItem = function FileItem(_ref) {
933
922
  return function () {
934
923
  if (timerRef.current) {
935
924
  clearInterval(timerRef.current);
925
+ timerRef.current = null;
936
926
  }
937
927
  };
938
928
  }, []);
@@ -217,8 +217,8 @@ function getContractSignUrl(contractIdVal, userInfo, config) {
217
217
  }
218
218
 
219
219
  // 保存签批信息
220
- function setSignInfo(fileName, tokenTY, fileId, fileUrl) {
221
- sessionStorage.setItem(tokenTY, JSON.stringify({
220
+ function setSignInfo(fileName, fileId, fileUrl) {
221
+ localStorage.setItem(fileId, JSON.stringify({
222
222
  contractId: contractId,
223
223
  documentId: documentId,
224
224
  fileName: fileName,
@@ -261,7 +261,7 @@ function getSignUrl(userInfo, config, fileName, fileId, fileUrl) {
261
261
  console.log(res, '页面结果');
262
262
  if (res.data.code == 0) {
263
263
  if (config.fileList) {
264
- setSignInfo(fileName, config.tokenTY, fileId, fileUrl);
264
+ setSignInfo(fileName, fileId, fileUrl);
265
265
  localStorage.setItem(config.tokenTY, JSON.stringify(config.fileList));
266
266
  }
267
267
  resolve(res.data.signUrl);
@@ -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.145';
101
+ version = '0.1.147';
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.145';
106
+ version = '0.1.147';
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.145",
3
+ "version": "0.1.147",
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.145/build/lowcode/assets-prod.json"
105
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.147/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.145/build/index.html"
110
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.147/build/index.html"
111
111
  }