ydb-components-material 0.1.158 → 0.1.159

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.
@@ -1156,7 +1156,8 @@ var FileItem = function FileItem(_ref) {
1156
1156
  return setIsShowSignPage(false);
1157
1157
  },
1158
1158
  closeLoading: closeLoading,
1159
- showClose: showSignPageClose
1159
+ showClose: showSignPageClose,
1160
+ originalFileId: file.fileId
1160
1161
  }), isShowSealPage && /*#__PURE__*/React.createElement(SealPage, {
1161
1162
  isShowSealPage: isShowSealPage,
1162
1163
  userInfo: userInfo,
@@ -13,7 +13,8 @@ function SignPage(props) {
13
13
  baseUrl = props.baseUrl,
14
14
  env = props.env,
15
15
  isPC = props.isPC,
16
- closeLoading = props.closeLoading;
16
+ closeLoading = props.closeLoading,
17
+ originalFileId = props.originalFileId;
17
18
  var init = /*#__PURE__*/function () {
18
19
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
19
20
  var fileObj, res, pageUrl;
@@ -27,6 +28,7 @@ function SignPage(props) {
27
28
  fileObj.originalUrl = file.fileUrl;
28
29
  }
29
30
  // 传递配置参数给工具函数
31
+ // originalFileId 用于确保 localStorage 的 key 是原始 fileId,外层 useEffect 能正确找到
30
32
  _context.next = 1;
31
33
  return initSignPageMethod(fileObj, userInfo, {
32
34
  token: token,
@@ -36,7 +38,7 @@ function SignPage(props) {
36
38
  isPC: isPC,
37
39
  fileList: fileList,
38
40
  parentPageUrl: parentPageUrl
39
- });
41
+ }, originalFileId);
40
42
  case 1:
41
43
  res = _context.sent;
42
44
  pageUrl = res.pageUrl;
@@ -11,14 +11,17 @@ var documentId = ''; // 手写签批生成的文件id
11
11
  var contractId = ''; // 合同id
12
12
 
13
13
  // 对外的方法 初始化手写签批的页面
14
- export function initSignPageMethod(_x, _x2, _x3) {
14
+ // originalFileId:用于 localStorage 存储的 fileId,在"先签章再签批"场景下,
15
+ // fileObj.fileId 可能是签章后新上传文件的新 ID,但外层 useEffect 用原始 file.fileId 查 localStorage,
16
+ // 所以需要传入原始 fileId 以确保数据能被正确找到。
17
+ export function initSignPageMethod(_x, _x2, _x3, _x4) {
15
18
  return _initSignPageMethod.apply(this, arguments);
16
19
  }
17
20
 
18
21
  // 【第 1 步】上传要手写签批的文件
19
22
  function _initSignPageMethod() {
20
- _initSignPageMethod = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileObj, userInfo, config) {
21
- var fileName, fileId, originalUrl, fileUrl, docId, contrId, flag, pageUrl, params;
23
+ _initSignPageMethod = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileObj, userInfo, config, originalFileId) {
24
+ var fileName, fileId, originalUrl, fileUrl, docId, contrId, flag, localStorageFileId, pageUrl, params;
22
25
  return _regeneratorRuntime.wrap(function (_context) {
23
26
  while (1) switch (_context.prev = _context.next) {
24
27
  case 0:
@@ -62,8 +65,11 @@ function _initSignPageMethod() {
62
65
  }
63
66
  return _context.abrupt("return", false);
64
67
  case 6:
68
+ // 【第 4 步】获取签章页面
69
+ // 用 originalFileId(如果传入)作为 localStorage key,确保外层 useEffect 能找到数据
70
+ localStorageFileId = originalFileId || fileId;
65
71
  _context.next = 7;
66
- return getSignUrl(userInfo, config, fileName, fileId, originalUrl || fileUrl);
72
+ return getSignUrl(userInfo, config, fileName, localStorageFileId, originalUrl || fileUrl);
67
73
  case 7:
68
74
  pageUrl = _context.sent;
69
75
  if (pageUrl) {
@@ -88,7 +94,7 @@ function _initSignPageMethod() {
88
94
  }));
89
95
  return _initSignPageMethod.apply(this, arguments);
90
96
  }
91
- function uploadSignFile(_x4, _x5) {
97
+ function uploadSignFile(_x5, _x6) {
92
98
  return _uploadSignFile.apply(this, arguments);
93
99
  } // 【第 2 步】创建或者发起电子签批
94
100
  function _uploadSignFile() {
@@ -275,7 +281,7 @@ function getSignUrl(userInfo, config, fileName, fileId, fileUrl) {
275
281
  // 下方是打开手写签批页面后 的后续操作
276
282
 
277
283
  // 对外的方法 获取签批后的文件
278
- export function getSignRes(_x6, _x7, _x8, _x9, _x0) {
284
+ export function getSignRes(_x7, _x8, _x9, _x0, _x1) {
279
285
  return _getSignRes.apply(this, arguments);
280
286
  }
281
287
 
@@ -1162,7 +1162,8 @@ var FileItem = function FileItem(_ref) {
1162
1162
  return setIsShowSignPage(false);
1163
1163
  },
1164
1164
  closeLoading: closeLoading,
1165
- showClose: showSignPageClose
1165
+ showClose: showSignPageClose,
1166
+ originalFileId: file.fileId
1166
1167
  }), isShowSealPage && /*#__PURE__*/_react["default"].createElement(_seal["default"], {
1167
1168
  isShowSealPage: isShowSealPage,
1168
1169
  userInfo: userInfo,
@@ -18,7 +18,8 @@ function SignPage(props) {
18
18
  baseUrl = props.baseUrl,
19
19
  env = props.env,
20
20
  isPC = props.isPC,
21
- closeLoading = props.closeLoading;
21
+ closeLoading = props.closeLoading,
22
+ originalFileId = props.originalFileId;
22
23
  var init = /*#__PURE__*/function () {
23
24
  var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
24
25
  var fileObj, res, pageUrl;
@@ -32,6 +33,7 @@ function SignPage(props) {
32
33
  fileObj.originalUrl = file.fileUrl;
33
34
  }
34
35
  // 传递配置参数给工具函数
36
+ // originalFileId 用于确保 localStorage 的 key 是原始 fileId,外层 useEffect 能正确找到
35
37
  _context.next = 1;
36
38
  return (0, _signUtil.initSignPageMethod)(fileObj, userInfo, {
37
39
  token: token,
@@ -41,7 +43,7 @@ function SignPage(props) {
41
43
  isPC: isPC,
42
44
  fileList: fileList,
43
45
  parentPageUrl: parentPageUrl
44
- });
46
+ }, originalFileId);
45
47
  case 1:
46
48
  res = _context.sent;
47
49
  pageUrl = res.pageUrl;
@@ -17,12 +17,15 @@ var documentId = ''; // 手写签批生成的文件id
17
17
  var contractId = ''; // 合同id
18
18
 
19
19
  // 对外的方法 初始化手写签批的页面
20
- function initSignPageMethod(_x, _x2, _x3) {
20
+ // originalFileId:用于 localStorage 存储的 fileId,在"先签章再签批"场景下,
21
+ // fileObj.fileId 可能是签章后新上传文件的新 ID,但外层 useEffect 用原始 file.fileId 查 localStorage,
22
+ // 所以需要传入原始 fileId 以确保数据能被正确找到。
23
+ function initSignPageMethod(_x, _x2, _x3, _x4) {
21
24
  return _initSignPageMethod.apply(this, arguments);
22
25
  } // 【第 1 步】上传要手写签批的文件
23
26
  function _initSignPageMethod() {
24
- _initSignPageMethod = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fileObj, userInfo, config) {
25
- var fileName, fileId, originalUrl, fileUrl, docId, contrId, flag, pageUrl, params;
27
+ _initSignPageMethod = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fileObj, userInfo, config, originalFileId) {
28
+ var fileName, fileId, originalUrl, fileUrl, docId, contrId, flag, localStorageFileId, pageUrl, params;
26
29
  return _regenerator["default"].wrap(function (_context) {
27
30
  while (1) switch (_context.prev = _context.next) {
28
31
  case 0:
@@ -66,8 +69,11 @@ function _initSignPageMethod() {
66
69
  }
67
70
  return _context.abrupt("return", false);
68
71
  case 6:
72
+ // 【第 4 步】获取签章页面
73
+ // 用 originalFileId(如果传入)作为 localStorage key,确保外层 useEffect 能找到数据
74
+ localStorageFileId = originalFileId || fileId;
69
75
  _context.next = 7;
70
- return getSignUrl(userInfo, config, fileName, fileId, originalUrl || fileUrl);
76
+ return getSignUrl(userInfo, config, fileName, localStorageFileId, originalUrl || fileUrl);
71
77
  case 7:
72
78
  pageUrl = _context.sent;
73
79
  if (pageUrl) {
@@ -92,7 +98,7 @@ function _initSignPageMethod() {
92
98
  }));
93
99
  return _initSignPageMethod.apply(this, arguments);
94
100
  }
95
- function uploadSignFile(_x4, _x5) {
101
+ function uploadSignFile(_x5, _x6) {
96
102
  return _uploadSignFile.apply(this, arguments);
97
103
  } // 【第 2 步】创建或者发起电子签批
98
104
  function _uploadSignFile() {
@@ -279,7 +285,7 @@ function getSignUrl(userInfo, config, fileName, fileId, fileUrl) {
279
285
  // 下方是打开手写签批页面后 的后续操作
280
286
 
281
287
  // 对外的方法 获取签批后的文件
282
- function getSignRes(_x6, _x7, _x8, _x9, _x0) {
288
+ function getSignRes(_x7, _x8, _x9, _x0, _x1) {
283
289
  return _getSignRes.apply(this, arguments);
284
290
  } // 轮询 签批状态
285
291
  function _getSignRes() {
@@ -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.158';
101
+ version = '0.1.159';
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.158';
106
+ version = '0.1.159';
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.158",
3
+ "version": "0.1.159",
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.158/build/lowcode/assets-prod.json"
105
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.159/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.158/build/index.html"
110
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.159/build/index.html"
111
111
  }