ydb-components-material 0.1.139 → 0.1.141

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 (36) 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.e7fd5197.js → umi.cd30b05c.js} +1 -1
  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/lowcode/assets-daily.json +11 -11
  11. package/build/lowcode/assets-dev.json +2 -2
  12. package/build/lowcode/assets-prod.json +11 -11
  13. package/build/lowcode/index.js +1 -1
  14. package/build/lowcode/meta.js +1 -1
  15. package/build/lowcode/render/default/view.js +1 -1
  16. package/build/lowcode/view.js +1 -1
  17. package/dist/BizComps.js +1 -1
  18. package/dist/BizComps.js.map +1 -1
  19. package/es/components/file-list/index.d.ts +2 -0
  20. package/es/components/file-list/index.js +39 -15
  21. package/es/components/file-list/item.d.ts +3 -0
  22. package/es/components/file-list/item.js +200 -117
  23. package/es/components/file-list/sign.js +13 -87
  24. package/es/components/file-list/signUtil.js +20 -4
  25. package/lib/components/file-list/index.d.ts +2 -0
  26. package/lib/components/file-list/index.js +38 -13
  27. package/lib/components/file-list/item.d.ts +3 -0
  28. package/lib/components/file-list/item.js +199 -116
  29. package/lib/components/file-list/sign.js +11 -85
  30. package/lib/components/file-list/signUtil.js +20 -4
  31. package/lowcode/file-list/meta.ts +29 -0
  32. package/lowcode_es/file-list/meta.js +27 -0
  33. package/lowcode_es/meta.js +1 -1
  34. package/lowcode_lib/file-list/meta.js +27 -0
  35. package/lowcode_lib/meta.js +1 -1
  36. package/package.json +3 -3
@@ -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,10 @@ 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,
17
+ parentPageUrl = props.parentPageUrl,
18
+ toSign = props.toSign,
18
19
  token = props.token,
19
20
  tokenTY = props.tokenTY,
20
21
  baseUrl = props.baseUrl,
@@ -23,22 +24,9 @@ function SignPage(props) {
23
24
  closeLoading = props.closeLoading,
24
25
  _props$showClose = props.showClose,
25
26
  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
27
  var init = /*#__PURE__*/function () {
40
28
  var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
41
- var fileObj, res, documentIdVal, contractIdVal, pageUrl, nameVal;
29
+ var fileObj, res, pageUrl;
42
30
  return _regenerator["default"].wrap(function (_context) {
43
31
  while (1) switch (_context.prev = _context.next) {
44
32
  case 0:
@@ -55,16 +43,17 @@ function SignPage(props) {
55
43
  tokenTY: tokenTY,
56
44
  baseUrl: baseUrl,
57
45
  env: env,
58
- isPC: isPC
46
+ isPC: isPC,
47
+ fileList: fileList,
48
+ parentPageUrl: parentPageUrl
59
49
  });
60
50
  case 1:
61
51
  res = _context.sent;
62
- documentIdVal = res.documentId, contractIdVal = res.contractId, pageUrl = res.pageUrl, nameVal = res.fileName;
52
+ pageUrl = res.pageUrl;
63
53
  closeLoading();
64
- setSrcUrl(pageUrl);
65
- setDocumentId(documentIdVal);
66
- setContractId(contractIdVal);
67
- setName(nameVal);
54
+ if (toSign) {
55
+ toSign(pageUrl);
56
+ }
68
57
  console.log(res);
69
58
  case 2:
70
59
  case "end":
@@ -76,66 +65,9 @@ function SignPage(props) {
76
65
  return _ref.apply(this, arguments);
77
66
  };
78
67
  }();
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
68
  (0, _react.useEffect)(function () {
126
69
  init();
127
70
  }, []);
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
71
  return /*#__PURE__*/_react["default"].createElement("div", {
140
72
  className: "sign_page"
141
73
  }, showClose && /*#__PURE__*/_react["default"].createElement("img", {
@@ -143,12 +75,6 @@ function SignPage(props) {
143
75
  src: _close["default"],
144
76
  alt: "",
145
77
  onClick: handleClose
146
- }), /*#__PURE__*/_react["default"].createElement("iframe", {
147
- src: srcUrl,
148
- id: "iframe",
149
- frameborder: "0",
150
- height: "100%",
151
- width: "100%"
152
78
  }));
153
79
  }
154
80
  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,19 @@ function getContractSignUrl(contractIdVal, userInfo, config) {
216
216
  });
217
217
  }
218
218
 
219
+ // 保存签批信息
220
+ function setSignInfo(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
+ }
229
+
219
230
  // 【第 4 步】获取签 pi 页面
220
- function getSignUrl(userInfo, config) {
231
+ function getSignUrl(userInfo, config, fileName, fileId, fileUrl) {
221
232
  // uni.showLoading({ title: '加载中' })
222
233
  var params = {
223
234
  contractId: contractId,
@@ -242,12 +253,17 @@ function getSignUrl(userInfo, config) {
242
253
  autoClosePage: true,
243
254
  // 操作完成自动关闭页面
244
255
  language: 'ZH_CN',
256
+ callbackPage: config.parentPageUrl,
245
257
  deviceType: config.isPC || 'H5' // 取值范围:PC(返回 PC 页面),H5(返回 H5 页面);不传值默认为:根据请求的 UserAgent 自动判断返回的页面类型。
246
258
  };
247
259
  return new Promise(function (resolve) {
248
260
  (0, _api.signurl)(params, config).then(function (res) {
249
261
  console.log(res, '页面结果');
250
262
  if (res.data.code == 0) {
263
+ if (config.fileList) {
264
+ setSignInfo(fileName, config.tokenTY, fileId, fileUrl);
265
+ localStorage.setItem(config.tokenTY, JSON.stringify(config.fileList));
266
+ }
251
267
  resolve(res.data.signUrl);
252
268
  } else {
253
269
  resolve(false);
@@ -117,6 +117,21 @@ const FileListMeta: IPublicTypeComponentMetadata = {
117
117
  "initialValue": ""
118
118
  }
119
119
  },
120
+ {
121
+ "title": {
122
+ "label": {
123
+ "type": "i18n",
124
+ "en-US": "parentPageUrl",
125
+ "zh-CN": "parentPageUrl"
126
+ }
127
+ },
128
+ "name": "parentPageUrl",
129
+ "setter": {
130
+ "componentName": "StringSetter",
131
+ "isRequired": true,
132
+ "initialValue": ""
133
+ }
134
+ },
120
135
  {
121
136
  "title": {
122
137
  "label": {
@@ -245,6 +260,20 @@ const FileListMeta: IPublicTypeComponentMetadata = {
245
260
  "isRequired": true
246
261
  }
247
262
  },
263
+ {
264
+ "title": {
265
+ "label": {
266
+ "type": "i18n",
267
+ "en-US": "toSign",
268
+ "zh-CN": "toSign"
269
+ }
270
+ },
271
+ "name": "toSign",
272
+ "setter": {
273
+ "componentName": "FunctionSetter",
274
+ "isRequired": true
275
+ }
276
+ },
248
277
  {
249
278
  "title": {
250
279
  "label": {
@@ -110,6 +110,20 @@ var FileListMeta = {
110
110
  "isRequired": true,
111
111
  "initialValue": ""
112
112
  }
113
+ }, {
114
+ "title": {
115
+ "label": {
116
+ "type": "i18n",
117
+ "en-US": "parentPageUrl",
118
+ "zh-CN": "parentPageUrl"
119
+ }
120
+ },
121
+ "name": "parentPageUrl",
122
+ "setter": {
123
+ "componentName": "StringSetter",
124
+ "isRequired": true,
125
+ "initialValue": ""
126
+ }
113
127
  }, {
114
128
  "title": {
115
129
  "label": {
@@ -230,6 +244,19 @@ var FileListMeta = {
230
244
  "componentName": "FunctionSetter",
231
245
  "isRequired": true
232
246
  }
247
+ }, {
248
+ "title": {
249
+ "label": {
250
+ "type": "i18n",
251
+ "en-US": "toSign",
252
+ "zh-CN": "toSign"
253
+ }
254
+ },
255
+ "name": "toSign",
256
+ "setter": {
257
+ "componentName": "FunctionSetter",
258
+ "isRequired": true
259
+ }
233
260
  }, {
234
261
  "title": {
235
262
  "label": {
@@ -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.139';
101
+ version = '0.1.141';
102
102
  }
103
103
  if (basicLibraryVersion === void 0) {
104
104
  basicLibraryVersion = {
@@ -115,6 +115,20 @@ var FileListMeta = {
115
115
  "isRequired": true,
116
116
  "initialValue": ""
117
117
  }
118
+ }, {
119
+ "title": {
120
+ "label": {
121
+ "type": "i18n",
122
+ "en-US": "parentPageUrl",
123
+ "zh-CN": "parentPageUrl"
124
+ }
125
+ },
126
+ "name": "parentPageUrl",
127
+ "setter": {
128
+ "componentName": "StringSetter",
129
+ "isRequired": true,
130
+ "initialValue": ""
131
+ }
118
132
  }, {
119
133
  "title": {
120
134
  "label": {
@@ -235,6 +249,19 @@ var FileListMeta = {
235
249
  "componentName": "FunctionSetter",
236
250
  "isRequired": true
237
251
  }
252
+ }, {
253
+ "title": {
254
+ "label": {
255
+ "type": "i18n",
256
+ "en-US": "toSign",
257
+ "zh-CN": "toSign"
258
+ }
259
+ },
260
+ "name": "toSign",
261
+ "setter": {
262
+ "componentName": "FunctionSetter",
263
+ "isRequired": true
264
+ }
238
265
  }, {
239
266
  "title": {
240
267
  "label": {
@@ -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.139';
106
+ version = '0.1.141';
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.139",
3
+ "version": "0.1.141",
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.139/build/lowcode/assets-prod.json"
105
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.141/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.139/build/index.html"
110
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.141/build/index.html"
111
111
  }