ydb-components-material 0.1.138 → 0.1.140

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.
Files changed (42) hide show
  1. package/build/docs/404.html +3 -3
  2. package/build/docs/_demos/:uuid +3 -3
  3. package/build/docs/colorful-button.html +3 -3
  4. package/build/docs/colorful-input.html +3 -3
  5. package/build/docs/index.html +3 -3
  6. package/build/docs/umi.eb9ae16b.js +1 -0
  7. package/build/docs/~demos/:uuid.html +3 -3
  8. package/build/docs/~demos/colorful-button-demo.html +3 -3
  9. package/build/docs/~demos/colorful-input-demo.html +3 -3
  10. package/build/index.js +8 -8
  11. package/build/lowcode/3.js +2 -2
  12. package/build/lowcode/4.js +1 -1
  13. package/build/lowcode/5.js +1 -1
  14. package/build/lowcode/assets-daily.json +11 -11
  15. package/build/lowcode/assets-dev.json +2 -2
  16. package/build/lowcode/assets-prod.json +11 -11
  17. package/build/lowcode/index.js +1 -1
  18. package/build/lowcode/meta.js +3 -3
  19. package/build/lowcode/preview.js +11 -10
  20. package/build/lowcode/render/default/1.js +1 -1
  21. package/build/lowcode/render/default/view.js +14 -14
  22. package/build/lowcode/view.js +17 -17
  23. package/dist/1.js +2 -2
  24. package/dist/1.js.map +1 -1
  25. package/dist/2.js +1 -1
  26. package/dist/3.js +1 -1
  27. package/dist/BizComps.js +13 -13
  28. package/dist/BizComps.js.map +1 -1
  29. package/es/components/file-list/index.js +32 -14
  30. package/es/components/file-list/item.d.ts +1 -0
  31. package/es/components/file-list/item.js +195 -116
  32. package/es/components/file-list/sign.js +8 -87
  33. package/es/components/file-list/signUtil.js +20 -4
  34. package/lib/components/file-list/index.js +31 -12
  35. package/lib/components/file-list/item.d.ts +1 -0
  36. package/lib/components/file-list/item.js +194 -115
  37. package/lib/components/file-list/sign.js +6 -85
  38. package/lib/components/file-list/signUtil.js +20 -4
  39. package/lowcode_es/meta.js +1 -1
  40. package/lowcode_lib/meta.js +1 -1
  41. package/package.json +3 -3
  42. package/build/docs/umi.b1f50a93.js +0 -1
@@ -4,7 +4,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  exports.__esModule = true;
5
5
  exports["default"] = void 0;
6
6
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
7
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
7
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
9
8
  var _react = _interopRequireWildcard(require("react"));
10
9
  var _signUtil = require("./signUtil");
@@ -13,8 +12,8 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
13
12
  function SignPage(props) {
14
13
  var userInfo = props.userInfo,
15
14
  file = props.file,
16
- getRes = props.getRes,
17
15
  handleClose = props.handleClose,
16
+ fileList = props.fileList,
18
17
  token = props.token,
19
18
  tokenTY = props.tokenTY,
20
19
  baseUrl = props.baseUrl,
@@ -23,22 +22,9 @@ function SignPage(props) {
23
22
  closeLoading = props.closeLoading,
24
23
  _props$showClose = props.showClose,
25
24
  showClose = _props$showClose === void 0 ? true : _props$showClose;
26
- var _useState = (0, _react.useState)(''),
27
- srcUrl = _useState[0],
28
- setSrcUrl = _useState[1];
29
- var _useState2 = (0, _react.useState)(''),
30
- documentId = _useState2[0],
31
- setDocumentId = _useState2[1];
32
- var _useState3 = (0, _react.useState)(''),
33
- contractId = _useState3[0],
34
- setContractId = _useState3[1];
35
- var _useState4 = (0, _react.useState)(''),
36
- name = _useState4[0],
37
- setName = _useState4[1];
38
- var timerRef = (0, _react.useRef)(null);
39
25
  var init = /*#__PURE__*/function () {
40
26
  var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
41
- var fileObj, res, documentIdVal, contractIdVal, pageUrl, nameVal;
27
+ var fileObj, res, pageUrl;
42
28
  return _regenerator["default"].wrap(function (_context) {
43
29
  while (1) switch (_context.prev = _context.next) {
44
30
  case 0:
@@ -55,16 +41,14 @@ function SignPage(props) {
55
41
  tokenTY: tokenTY,
56
42
  baseUrl: baseUrl,
57
43
  env: env,
58
- isPC: isPC
44
+ isPC: isPC,
45
+ fileList: fileList
59
46
  });
60
47
  case 1:
61
48
  res = _context.sent;
62
- documentIdVal = res.documentId, contractIdVal = res.contractId, pageUrl = res.pageUrl, nameVal = res.fileName;
49
+ pageUrl = res.pageUrl;
63
50
  closeLoading();
64
- setSrcUrl(pageUrl);
65
- setDocumentId(documentIdVal);
66
- setContractId(contractIdVal);
67
- setName(nameVal);
51
+ window.location.href = pageUrl;
68
52
  console.log(res);
69
53
  case 2:
70
54
  case "end":
@@ -76,66 +60,9 @@ function SignPage(props) {
76
60
  return _ref.apply(this, arguments);
77
61
  };
78
62
  }();
79
- var getSignedFile = /*#__PURE__*/function () {
80
- var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(documentIdVal, contractIdVal, nameVal) {
81
- var newFile, finalFile;
82
- return _regenerator["default"].wrap(function (_context2) {
83
- while (1) switch (_context2.prev = _context2.next) {
84
- case 0:
85
- _context2.next = 1;
86
- return (0, _signUtil.getSignRes)(documentIdVal, contractIdVal, nameVal, true, {
87
- token: token,
88
- tokenTY: tokenTY,
89
- baseUrl: baseUrl,
90
- env: env,
91
- isPC: isPC
92
- });
93
- case 1:
94
- newFile = _context2.sent;
95
- console.log(newFile, '签署完毕后的');
96
- if (newFile) {
97
- // 关闭轮询定时
98
- handleClearInterval();
99
- // 关闭弹框
100
- handleClose();
101
- // 将手写签批后的新文件 传给
102
- finalFile = (0, _extends2["default"])({}, file, {
103
- fileId: newFile.fileId,
104
- fileName: nameVal,
105
- fileUrl: newFile.fileUrlList[2],
106
- isSigned: true
107
- });
108
- console.log('finalFile---', finalFile);
109
- getRes(finalFile);
110
- }
111
- case 2:
112
- case "end":
113
- return _context2.stop();
114
- }
115
- }, _callee2);
116
- }));
117
- return function getSignedFile(_x, _x2, _x3) {
118
- return _ref2.apply(this, arguments);
119
- };
120
- }();
121
- var handleClearInterval = function handleClearInterval() {
122
- clearInterval(timerRef.current);
123
- timerRef.current = null;
124
- };
125
63
  (0, _react.useEffect)(function () {
126
64
  init();
127
65
  }, []);
128
- (0, _react.useEffect)(function () {
129
- if (srcUrl && documentId && contractId && name && !timerRef.current) {
130
- handleClearInterval();
131
- timerRef.current = setInterval(function () {
132
- getSignedFile(documentId, contractId, name);
133
- }, 3000);
134
- }
135
- return function () {
136
- handleClearInterval();
137
- };
138
- }, [srcUrl, documentId, contractId, name]);
139
66
  return /*#__PURE__*/_react["default"].createElement("div", {
140
67
  className: "sign_page"
141
68
  }, showClose && /*#__PURE__*/_react["default"].createElement("img", {
@@ -143,12 +70,6 @@ function SignPage(props) {
143
70
  src: _close["default"],
144
71
  alt: "",
145
72
  onClick: handleClose
146
- }), /*#__PURE__*/_react["default"].createElement("iframe", {
147
- src: srcUrl,
148
- id: "iframe",
149
- frameborder: "0",
150
- height: "100%",
151
- width: "100%"
152
73
  }));
153
74
  }
154
75
  var _default = exports["default"] = SignPage;
@@ -22,12 +22,12 @@ function initSignPageMethod(_x, _x2, _x3) {
22
22
  } // 【第 1 步】上传要手写签批的文件
23
23
  function _initSignPageMethod() {
24
24
  _initSignPageMethod = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fileObj, userInfo, config) {
25
- var fileName, docId, contrId, flag, pageUrl, params;
25
+ var fileName, fileId, originalUrl, fileUrl, docId, contrId, flag, pageUrl, params;
26
26
  return _regenerator["default"].wrap(function (_context) {
27
27
  while (1) switch (_context.prev = _context.next) {
28
28
  case 0:
29
29
  console.log('fileObj', fileObj, userInfo);
30
- fileName = fileObj.fileName; // 【第 1 步】上传要手写签批的文件
30
+ fileName = fileObj.fileName, fileId = fileObj.fileId, originalUrl = fileObj.originalUrl, fileUrl = fileObj.fileUrl; // 【第 1 步】上传要手写签批的文件
31
31
  _context.next = 1;
32
32
  return uploadSignFile(fileObj, config);
33
33
  case 1:
@@ -67,7 +67,7 @@ function _initSignPageMethod() {
67
67
  return _context.abrupt("return", false);
68
68
  case 6:
69
69
  _context.next = 7;
70
- return getSignUrl(userInfo, config);
70
+ return getSignUrl(userInfo, config, fileName, fileId, originalUrl || fileUrl);
71
71
  case 7:
72
72
  pageUrl = _context.sent;
73
73
  if (pageUrl) {
@@ -216,8 +216,20 @@ function getContractSignUrl(contractIdVal, userInfo, config) {
216
216
  });
217
217
  }
218
218
 
219
+ // 拼接回调页面的参数
220
+ function getCallbackPageUrl(fileName, tokenTY, fileId, fileUrl) {
221
+ sessionStorage.setItem(tokenTY, JSON.stringify({
222
+ contractId: contractId,
223
+ documentId: documentId,
224
+ fileName: fileName,
225
+ fileId: fileId,
226
+ fileUrl: fileUrl
227
+ }));
228
+ return window.location.href;
229
+ }
230
+
219
231
  // 【第 4 步】获取签 pi 页面
220
- function getSignUrl(userInfo, config) {
232
+ function getSignUrl(userInfo, config, fileName, fileId, fileUrl) {
221
233
  // uni.showLoading({ title: '加载中' })
222
234
  var params = {
223
235
  contractId: contractId,
@@ -242,12 +254,16 @@ function getSignUrl(userInfo, config) {
242
254
  autoClosePage: true,
243
255
  // 操作完成自动关闭页面
244
256
  language: 'ZH_CN',
257
+ callbackPage: getCallbackPageUrl(fileName, config.tokenTY, fileId, fileUrl),
245
258
  deviceType: config.isPC || 'H5' // 取值范围:PC(返回 PC 页面),H5(返回 H5 页面);不传值默认为:根据请求的 UserAgent 自动判断返回的页面类型。
246
259
  };
247
260
  return new Promise(function (resolve) {
248
261
  (0, _api.signurl)(params, config).then(function (res) {
249
262
  console.log(res, '页面结果');
250
263
  if (res.data.code == 0) {
264
+ if (config.fileList) {
265
+ localStorage.setItem(config.tokenTY, JSON.stringify(config.fileList));
266
+ }
251
267
  resolve(res.data.signUrl);
252
268
  } else {
253
269
  resolve(false);
@@ -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.138';
101
+ version = '0.1.140';
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.138';
106
+ version = '0.1.140';
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.138",
3
+ "version": "0.1.140",
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.138/build/lowcode/assets-prod.json"
105
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.140/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.138/build/index.html"
110
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.140/build/index.html"
111
111
  }