ydb-components-material 0.1.211 → 0.1.213

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.
@@ -28,6 +28,7 @@ export interface FileListProps {
28
28
  valChange: (value: any) => void;
29
29
  saveSignerInfo: (value: any) => Promise<boolean>;
30
30
  signInfoMap?: object;
31
+ applicationId?: string;
31
32
  }
32
33
  declare const FileList: React.FC<FileListProps>;
33
34
  export default FileList;
@@ -69,7 +69,8 @@ var FileList = function FileList(_ref) {
69
69
  applySeal = _ref.applySeal,
70
70
  signInfoMap = _ref.signInfoMap,
71
71
  parentPageUrl = _ref.parentPageUrl,
72
- toSign = _ref.toSign;
72
+ toSign = _ref.toSign,
73
+ applicationId = _ref.applicationId;
73
74
  var _useState = useState(fileList),
74
75
  fileArray = _useState[0],
75
76
  setFileArray = _useState[1];
@@ -417,6 +418,7 @@ var FileList = function FileList(_ref) {
417
418
  autoShowSignerInfo: !!(needSignerInfo && needSignerInfo.index === index && needSignerInfo.subIndex === subIndex && needSignerInfo.fileIndex === i),
418
419
  onNeedSignerInfo: handleNeedSignerInfo,
419
420
  onCloseSignerInfo: handleCloseSignerInfo,
421
+ applicationId: applicationId,
420
422
  style: {
421
423
  marginBottom: '12px'
422
424
  }
@@ -427,6 +429,7 @@ var FileList = function FileList(_ref) {
427
429
  }, getTipText(item)), item.fileList.map(function (file, i) {
428
430
  return /*#__PURE__*/React.createElement(FileItem, {
429
431
  key: file.fileId || i,
432
+ applicationId: applicationId,
430
433
  index: index,
431
434
  fileIndex: i,
432
435
  signerInfo: signerInfo || {},
@@ -37,6 +37,7 @@ export interface FileItemProps {
37
37
  fileIndex: number;
38
38
  }) => void;
39
39
  onCloseSignerInfo?: () => void;
40
+ applicationId?: string;
40
41
  }
41
42
  declare const FileItem: React.FC<FileItemProps>;
42
43
  export default FileItem;
@@ -29,7 +29,6 @@ var RadioGroup = _Radio.Group;
29
29
  var SELF = 0;
30
30
  var OTHER = 1;
31
31
  var FileItem = function FileItem(_ref) {
32
- var _this = this;
33
32
  var index = _ref.index,
34
33
  subIndex = _ref.subIndex,
35
34
  fileIndex = _ref.fileIndex,
@@ -60,7 +59,8 @@ var FileItem = function FileItem(_ref) {
60
59
  toSign = _ref.toSign,
61
60
  autoShowSignerInfo = _ref.autoShowSignerInfo,
62
61
  onNeedSignerInfo = _ref.onNeedSignerInfo,
63
- onCloseSignerInfo = _ref.onCloseSignerInfo;
62
+ onCloseSignerInfo = _ref.onCloseSignerInfo,
63
+ applicationId = _ref.applicationId;
64
64
  // console.log('fileItem', file, maxFileSize);
65
65
  var fileName = file.fileName,
66
66
  fileUrl = file.fileUrl,
@@ -493,11 +493,11 @@ var FileItem = function FileItem(_ref) {
493
493
  // 签字要跳转三方页面 跳之前存一下当前页面数据
494
494
  var saveStorage = function saveStorage() {
495
495
  var loginAccountId = userInfo.loginAccountId;
496
- var previousData = window.localStorage.getItem(_this.state.applicationId + loginAccountId);
496
+ var previousData = window.localStorage.getItem(applicationId + loginAccountId);
497
497
  var previousDataVal = JSON.parse(previousData || '{}');
498
498
  // 消费过了。删除一下
499
499
  delete previousDataVal.isFormEdited;
500
- window.localStorage.setItem(_this.state.applicationId + loginAccountId, JSON.stringify(_extends({}, previousDataVal, {
500
+ window.localStorage.setItem(applicationId + loginAccountId, JSON.stringify(_extends({}, previousDataVal, {
501
501
  material: {
502
502
  fileList: fileList
503
503
  }
@@ -516,7 +516,7 @@ var FileItem = function FileItem(_ref) {
516
516
  return k + 1;
517
517
  });
518
518
  setIsShowSignPage(true);
519
- // saveStorage()
519
+ saveStorage();
520
520
  };
521
521
 
522
522
  // 签章
@@ -1099,7 +1099,7 @@ var FileItem = function FileItem(_ref) {
1099
1099
  // - 外层组件会修改 file.loading,需要在 loading 变为 false 时启动轮询
1100
1100
  // - 轮询自身会把 loading 置为 true,所以必须幂等,且不能在依赖变化时清理定时器
1101
1101
  useEffect(function () {
1102
- if (loading || pollingRef.current) return;
1102
+ if (pollingRef.current) return;
1103
1103
 
1104
1104
  // 只把「读取/解析本地签批信息」放在 try 里,避免后面的逻辑异常被静默吞掉
1105
1105
  var signInfo = null;
@@ -1128,6 +1128,7 @@ var FileItem = function FileItem(_ref) {
1128
1128
  // 兜底:连续 10 次轮询仍未成功则结束轮询,避免无限请求
1129
1129
  var pollCount = 0;
1130
1130
  timerRef.current = setInterval(function () {
1131
+ console.log('start polling----');
1131
1132
  getSignedFile(docId, contrId, nameVal)["catch"](function (e) {
1132
1133
  // 单次请求异常按失败处理,避免未处理的 rejection 打断轮询
1133
1134
  console.error('轮询签批结果异常', e);
@@ -1166,7 +1167,7 @@ var FileItem = function FileItem(_ref) {
1166
1167
  } catch (e) {
1167
1168
  console.error('更新文件 loading 状态失败', e);
1168
1169
  }
1169
- }, [fileId, loading]);
1170
+ }, [fileId]);
1170
1171
 
1171
1172
  // 仅在卸载时清理定时器;不能放进上面的 effect,否则 loading 变化会清掉正在进行的轮询
1172
1173
  useEffect(function () {
@@ -28,6 +28,7 @@ export interface FileListProps {
28
28
  valChange: (value: any) => void;
29
29
  saveSignerInfo: (value: any) => Promise<boolean>;
30
30
  signInfoMap?: object;
31
+ applicationId?: string;
31
32
  }
32
33
  declare const FileList: React.FC<FileListProps>;
33
34
  export default FileList;
@@ -75,7 +75,8 @@ var FileList = function FileList(_ref) {
75
75
  applySeal = _ref.applySeal,
76
76
  signInfoMap = _ref.signInfoMap,
77
77
  parentPageUrl = _ref.parentPageUrl,
78
- toSign = _ref.toSign;
78
+ toSign = _ref.toSign,
79
+ applicationId = _ref.applicationId;
79
80
  var _useState = (0, _react.useState)(fileList),
80
81
  fileArray = _useState[0],
81
82
  setFileArray = _useState[1];
@@ -423,6 +424,7 @@ var FileList = function FileList(_ref) {
423
424
  autoShowSignerInfo: !!(needSignerInfo && needSignerInfo.index === index && needSignerInfo.subIndex === subIndex && needSignerInfo.fileIndex === i),
424
425
  onNeedSignerInfo: handleNeedSignerInfo,
425
426
  onCloseSignerInfo: handleCloseSignerInfo,
427
+ applicationId: applicationId,
426
428
  style: {
427
429
  marginBottom: '12px'
428
430
  }
@@ -433,6 +435,7 @@ var FileList = function FileList(_ref) {
433
435
  }, getTipText(item)), item.fileList.map(function (file, i) {
434
436
  return /*#__PURE__*/_react["default"].createElement(_item["default"], {
435
437
  key: file.fileId || i,
438
+ applicationId: applicationId,
436
439
  index: index,
437
440
  fileIndex: i,
438
441
  signerInfo: signerInfo || {},
@@ -37,6 +37,7 @@ export interface FileItemProps {
37
37
  fileIndex: number;
38
38
  }) => void;
39
39
  onCloseSignerInfo?: () => void;
40
+ applicationId?: string;
40
41
  }
41
42
  declare const FileItem: React.FC<FileItemProps>;
42
43
  export default FileItem;
@@ -35,7 +35,6 @@ var RadioGroup = _radio["default"].Group;
35
35
  var SELF = 0;
36
36
  var OTHER = 1;
37
37
  var FileItem = function FileItem(_ref) {
38
- var _this = this;
39
38
  var index = _ref.index,
40
39
  subIndex = _ref.subIndex,
41
40
  fileIndex = _ref.fileIndex,
@@ -66,7 +65,8 @@ var FileItem = function FileItem(_ref) {
66
65
  toSign = _ref.toSign,
67
66
  autoShowSignerInfo = _ref.autoShowSignerInfo,
68
67
  onNeedSignerInfo = _ref.onNeedSignerInfo,
69
- onCloseSignerInfo = _ref.onCloseSignerInfo;
68
+ onCloseSignerInfo = _ref.onCloseSignerInfo,
69
+ applicationId = _ref.applicationId;
70
70
  // console.log('fileItem', file, maxFileSize);
71
71
  var fileName = file.fileName,
72
72
  fileUrl = file.fileUrl,
@@ -499,11 +499,11 @@ var FileItem = function FileItem(_ref) {
499
499
  // 签字要跳转三方页面 跳之前存一下当前页面数据
500
500
  var saveStorage = function saveStorage() {
501
501
  var loginAccountId = userInfo.loginAccountId;
502
- var previousData = window.localStorage.getItem(_this.state.applicationId + loginAccountId);
502
+ var previousData = window.localStorage.getItem(applicationId + loginAccountId);
503
503
  var previousDataVal = JSON.parse(previousData || '{}');
504
504
  // 消费过了。删除一下
505
505
  delete previousDataVal.isFormEdited;
506
- window.localStorage.setItem(_this.state.applicationId + loginAccountId, JSON.stringify((0, _extends3["default"])({}, previousDataVal, {
506
+ window.localStorage.setItem(applicationId + loginAccountId, JSON.stringify((0, _extends3["default"])({}, previousDataVal, {
507
507
  material: {
508
508
  fileList: fileList
509
509
  }
@@ -522,7 +522,7 @@ var FileItem = function FileItem(_ref) {
522
522
  return k + 1;
523
523
  });
524
524
  setIsShowSignPage(true);
525
- // saveStorage()
525
+ saveStorage();
526
526
  };
527
527
 
528
528
  // 签章
@@ -1105,7 +1105,7 @@ var FileItem = function FileItem(_ref) {
1105
1105
  // - 外层组件会修改 file.loading,需要在 loading 变为 false 时启动轮询
1106
1106
  // - 轮询自身会把 loading 置为 true,所以必须幂等,且不能在依赖变化时清理定时器
1107
1107
  (0, _react.useEffect)(function () {
1108
- if (loading || pollingRef.current) return;
1108
+ if (pollingRef.current) return;
1109
1109
 
1110
1110
  // 只把「读取/解析本地签批信息」放在 try 里,避免后面的逻辑异常被静默吞掉
1111
1111
  var signInfo = null;
@@ -1134,6 +1134,7 @@ var FileItem = function FileItem(_ref) {
1134
1134
  // 兜底:连续 10 次轮询仍未成功则结束轮询,避免无限请求
1135
1135
  var pollCount = 0;
1136
1136
  timerRef.current = setInterval(function () {
1137
+ console.log('start polling----');
1137
1138
  getSignedFile(docId, contrId, nameVal)["catch"](function (e) {
1138
1139
  // 单次请求异常按失败处理,避免未处理的 rejection 打断轮询
1139
1140
  console.error('轮询签批结果异常', e);
@@ -1172,7 +1173,7 @@ var FileItem = function FileItem(_ref) {
1172
1173
  } catch (e) {
1173
1174
  console.error('更新文件 loading 状态失败', e);
1174
1175
  }
1175
- }, [fileId, loading]);
1176
+ }, [fileId]);
1176
1177
 
1177
1178
  // 仅在卸载时清理定时器;不能放进上面的 effect,否则 loading 变化会清掉正在进行的轮询
1178
1179
  (0, _react.useEffect)(function () {
@@ -50,6 +50,23 @@ const FileListMeta: IPublicTypeComponentMetadata = {
50
50
  "initialValue": []
51
51
  }
52
52
  },
53
+ {
54
+ "title": {
55
+ "label": {
56
+ "type": "i18n",
57
+ "en-US": "applicationId",
58
+ "zh-CN": "applicationId"
59
+ },
60
+ "tip": "applicationId | Application ID"
61
+ },
62
+ "name": "applicationId",
63
+ "description": "Application ID",
64
+ "setter": {
65
+ "componentName": "StringSetter",
66
+ "isRequired": false,
67
+ "initialValue": ""
68
+ }
69
+ },
53
70
  {
54
71
  "title": {
55
72
  "label": {
@@ -46,6 +46,22 @@ var FileListMeta = {
46
46
  "isRequired": true,
47
47
  "initialValue": []
48
48
  }
49
+ }, {
50
+ "title": {
51
+ "label": {
52
+ "type": "i18n",
53
+ "en-US": "applicationId",
54
+ "zh-CN": "applicationId"
55
+ },
56
+ "tip": "applicationId | Application ID"
57
+ },
58
+ "name": "applicationId",
59
+ "description": "Application ID",
60
+ "setter": {
61
+ "componentName": "StringSetter",
62
+ "isRequired": false,
63
+ "initialValue": ""
64
+ }
49
65
  }, {
50
66
  "title": {
51
67
  "label": {
@@ -101,7 +101,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
101
101
  packageName = 'ydb-components-material';
102
102
  }
103
103
  if (version === void 0) {
104
- version = '0.1.211';
104
+ version = '0.1.213';
105
105
  }
106
106
  if (basicLibraryVersion === void 0) {
107
107
  basicLibraryVersion = {
@@ -51,6 +51,22 @@ var FileListMeta = {
51
51
  "isRequired": true,
52
52
  "initialValue": []
53
53
  }
54
+ }, {
55
+ "title": {
56
+ "label": {
57
+ "type": "i18n",
58
+ "en-US": "applicationId",
59
+ "zh-CN": "applicationId"
60
+ },
61
+ "tip": "applicationId | Application ID"
62
+ },
63
+ "name": "applicationId",
64
+ "description": "Application ID",
65
+ "setter": {
66
+ "componentName": "StringSetter",
67
+ "isRequired": false,
68
+ "initialValue": ""
69
+ }
54
70
  }, {
55
71
  "title": {
56
72
  "label": {
@@ -106,7 +106,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
106
106
  packageName = 'ydb-components-material';
107
107
  }
108
108
  if (version === void 0) {
109
- version = '0.1.211';
109
+ version = '0.1.213';
110
110
  }
111
111
  if (basicLibraryVersion === void 0) {
112
112
  basicLibraryVersion = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-components-material",
3
- "version": "0.1.211",
3
+ "version": "0.1.213",
4
4
  "description": "ydb-components-material",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -103,10 +103,10 @@
103
103
  },
104
104
  "componentConfig": {
105
105
  "isComponentLibrary": true,
106
- "materialSchema": "https://unpkg.com/ydb-components-material@0.1.211/build/lowcode/assets-prod.json"
106
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.213/build/lowcode/assets-prod.json"
107
107
  },
108
108
  "lcMeta": {
109
109
  "type": "component"
110
110
  },
111
- "homepage": "https://unpkg.com/ydb-components-material@0.1.211/build/index.html"
111
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.213/build/index.html"
112
112
  }