ydb-components-material 0.1.66 → 0.1.67

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 (38) 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.2387c9e8.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/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/meta.js +1 -1
  14. package/build/lowcode/render/default/view.js +1 -1
  15. package/build/lowcode/view.js +1 -1
  16. package/dist/BizComps.js +5 -5
  17. package/dist/BizComps.js.map +1 -1
  18. package/es/api.js +16 -11
  19. package/es/components/file-item/index.d.ts +1 -0
  20. package/es/components/file-item/index.js +48 -21
  21. package/es/components/file-item/seal.js +5 -20
  22. package/es/components/file-item/sealUtil.js +20 -38
  23. package/es/components/file-item/sign.js +9 -16
  24. package/es/components/file-item/signUtil.js +28 -41
  25. package/lib/api.js +17 -12
  26. package/lib/components/file-item/index.d.ts +1 -0
  27. package/lib/components/file-item/index.js +47 -20
  28. package/lib/components/file-item/seal.js +5 -20
  29. package/lib/components/file-item/sealUtil.js +20 -38
  30. package/lib/components/file-item/sign.js +9 -16
  31. package/lib/components/file-item/signUtil.js +28 -41
  32. package/lowcode/file-item/meta.ts +15 -0
  33. package/lowcode_es/file-item/meta.js +14 -0
  34. package/lowcode_es/meta.js +1 -1
  35. package/lowcode_lib/file-item/meta.js +14 -0
  36. package/lowcode_lib/meta.js +1 -1
  37. package/package.json +3 -3
  38. package/build/docs/umi.04af327b.js +0 -1
@@ -10,15 +10,10 @@ var _react = _interopRequireWildcard(require("react"));
10
10
  var _signUtil = require("./signUtil");
11
11
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
12
12
  function SignPage(props) {
13
- var isShowSignPage = props.isShowSignPage,
14
- userInfo = props.userInfo,
13
+ var userInfo = props.userInfo,
15
14
  file = props.file,
16
- token = props.token,
17
- tokenTY = props.tokenTY,
18
15
  getRes = props.getRes,
19
- handleClose = props.handleClose,
20
- baseUrl = props.baseUrl,
21
- device = props.device;
16
+ handleClose = props.handleClose;
22
17
  var _useState = (0, _react.useState)(''),
23
18
  srcUrl = _useState[0],
24
19
  setSrcUrl = _useState[1];
@@ -43,7 +38,7 @@ function SignPage(props) {
43
38
  fileObj.url = file.oldUrl;
44
39
  }
45
40
  _context.next = 1;
46
- return (0, _signUtil.initSignPageMethod)(file, userInfo, token, device);
41
+ return (0, _signUtil.initSignPageMethod)(file, userInfo);
47
42
  case 1:
48
43
  res = _context.sent;
49
44
  documentIdVal = res.documentId, contractIdVal = res.contractId, pageUrl = res.pageUrl, nameVal = res.name;
@@ -63,15 +58,13 @@ function SignPage(props) {
63
58
  };
64
59
  }();
65
60
  var getSignedFile = /*#__PURE__*/function () {
66
- var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(documentIdVal, contractIdVal, nameVal, tokenVal, baseUrl) {
61
+ var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(documentIdVal, contractIdVal, nameVal) {
67
62
  var newFile, finalFile;
68
63
  return _regenerator["default"].wrap(function (_context2) {
69
64
  while (1) switch (_context2.prev = _context2.next) {
70
65
  case 0:
71
- console.log('tokenVal----', tokenVal);
72
- // const { autoUpload } = this
73
66
  _context2.next = 1;
74
- return (0, _signUtil.getSignRes)(documentIdVal, contractIdVal, nameVal, true, tokenVal, baseUrl);
67
+ return (0, _signUtil.getSignRes)(documentIdVal, contractIdVal, nameVal, true);
75
68
  case 1:
76
69
  newFile = _context2.sent;
77
70
  console.log(newFile, '签署完毕后的');
@@ -96,7 +89,7 @@ function SignPage(props) {
96
89
  }
97
90
  }, _callee2);
98
91
  }));
99
- return function getSignedFile(_x, _x2, _x3, _x4, _x5) {
92
+ return function getSignedFile(_x, _x2, _x3) {
100
93
  return _ref2.apply(this, arguments);
101
94
  };
102
95
  }();
@@ -108,16 +101,16 @@ function SignPage(props) {
108
101
  init();
109
102
  }, []);
110
103
  (0, _react.useEffect)(function () {
111
- if (srcUrl && documentId && contractId && name && tokenTY && baseUrl && !timerRef.current) {
104
+ if (srcUrl && documentId && contractId && name && !timerRef.current) {
112
105
  handleClearInterval();
113
106
  timerRef.current = setInterval(function () {
114
- getSignedFile(documentId, contractId, name, tokenTY, baseUrl);
107
+ getSignedFile(documentId, contractId, name);
115
108
  }, 3000);
116
109
  }
117
110
  return function () {
118
111
  handleClearInterval();
119
112
  };
120
- }, [srcUrl, documentId, contractId, name, tokenTY, baseUrl]);
113
+ }, [srcUrl, documentId, contractId, name]);
121
114
  return /*#__PURE__*/_react["default"].createElement("div", {
122
115
  className: "sign_page"
123
116
  }, /*#__PURE__*/_react["default"].createElement("iframe", {
@@ -8,25 +8,24 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
8
8
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
9
9
  var _file = require("./file");
10
10
  var _api = require("../../api");
11
- var baseURL = 'http://172.16.132.12:5005';
12
11
  var categoryId = '3354397552669692408';
13
12
  var documentId = ''; // 手写签批生成的文件id
14
13
  var contractId = ''; // 合同id
15
14
 
16
15
  // 对外的方法 初始化手写签批的页面
17
- function initSignPageMethod(_x, _x2, _x3, _x4, _x5) {
16
+ function initSignPageMethod(_x, _x2) {
18
17
  return _initSignPageMethod.apply(this, arguments);
19
18
  } // 【第1步】上传要手写签批的文件
20
19
  function _initSignPageMethod() {
21
- _initSignPageMethod = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fileObj, userInfo, token, device, tokenTY) {
20
+ _initSignPageMethod = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fileObj, userInfo) {
22
21
  var name, docId, contrId, flag, pageUrl, params;
23
22
  return _regenerator["default"].wrap(function (_context) {
24
23
  while (1) switch (_context.prev = _context.next) {
25
24
  case 0:
26
- console.log('fileObj', fileObj, userInfo, token, tokenTY);
25
+ console.log('fileObj', fileObj, userInfo);
27
26
  name = fileObj.name; // 【第1步】上传要手写签批的文件
28
27
  _context.next = 1;
29
- return uploadSignFile(fileObj, token);
28
+ return uploadSignFile(fileObj);
30
29
  case 1:
31
30
  docId = _context.sent;
32
31
  console.log('docId---', docId);
@@ -40,7 +39,7 @@ function _initSignPageMethod() {
40
39
 
41
40
  // 【第2步】创建或者发起电子签批
42
41
  _context.next = 3;
43
- return createbycategoryFun(name, docId, token);
42
+ return createbycategoryFun(name, docId);
44
43
  case 3:
45
44
  contrId = _context.sent;
46
45
  console.log('contrId---', contrId);
@@ -60,7 +59,7 @@ function _initSignPageMethod() {
60
59
 
61
60
  // 【第3步】创建手写签批页面
62
61
  _context.next = 5;
63
- return getContractSignUrl(contrId, userInfo, token);
62
+ return getContractSignUrl(contrId, userInfo);
64
63
  case 5:
65
64
  flag = _context.sent;
66
65
  if (flag) {
@@ -70,7 +69,7 @@ function _initSignPageMethod() {
70
69
  return _context.abrupt("return", false);
71
70
  case 6:
72
71
  _context.next = 7;
73
- return getSignUrl(userInfo, token, device);
72
+ return getSignUrl(userInfo);
74
73
  case 7:
75
74
  pageUrl = _context.sent;
76
75
  if (pageUrl) {
@@ -95,11 +94,11 @@ function _initSignPageMethod() {
95
94
  }));
96
95
  return _initSignPageMethod.apply(this, arguments);
97
96
  }
98
- function uploadSignFile(_x6, _x7) {
97
+ function uploadSignFile(_x3) {
99
98
  return _uploadSignFile.apply(this, arguments);
100
99
  } // 【第2步】创建或者发起电子签批
101
100
  function _uploadSignFile() {
102
- _uploadSignFile = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(event, token) {
101
+ _uploadSignFile = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(event) {
103
102
  var blob, file, signApprovalFileType;
104
103
  return _regenerator["default"].wrap(function (_context2) {
105
104
  while (1) switch (_context2.prev = _context2.next) {
@@ -123,9 +122,9 @@ function _uploadSignFile() {
123
122
  filename: event.name,
124
123
  // 文件名称
125
124
  headers: {
126
- Authorization: token
125
+ Authorization: window.token
127
126
  },
128
- action: "\nhttps://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/createbyfile",
127
+ action: "\nhttps://zwfwpt.sxzwfw.gov.cn" + (window.env === 'release' ? ':10010' : '') + "/DeclarationAPI/declaration/center/signapproval/api/createbyfile",
129
128
  // 上传文件的地址
130
129
  onError: function onError(e) {
131
130
  // uni.$u.toast(e.msg || '手写签批上传文件异常');
@@ -147,7 +146,7 @@ function _uploadSignFile() {
147
146
  }));
148
147
  return _uploadSignFile.apply(this, arguments);
149
148
  }
150
- function createbycategoryFun(fileName, documentIdVal, token) {
149
+ function createbycategoryFun(fileName, documentIdVal) {
151
150
  // uni.showLoading({ title: '加载中' })
152
151
  var params = {
153
152
  subject: fileName,
@@ -157,9 +156,7 @@ function createbycategoryFun(fileName, documentIdVal, token) {
157
156
  tenantName: '山西省行政审批服务管理局'
158
157
  };
159
158
  return new Promise(function (resolve) {
160
- (0, _api.createbycategory)(params, {
161
- token: token
162
- }).then(function (res) {
159
+ (0, _api.createbycategory)(params).then(function (res) {
163
160
  console.log('创建订单成功', res);
164
161
  if (res.code === 200) {
165
162
  resolve(res.data.contractId);
@@ -174,7 +171,7 @@ function createbycategoryFun(fileName, documentIdVal, token) {
174
171
  }
175
172
 
176
173
  // 【第3步】创建手写签批页面
177
- function getContractSignUrl(contractIdVal, userInfo, token) {
174
+ function getContractSignUrl(contractIdVal, userInfo) {
178
175
  console.log('contractIdVal', contractIdVal, userInfo);
179
176
  // uni.showLoading({ title: '加载中' })
180
177
  var params = {
@@ -191,9 +188,7 @@ function getContractSignUrl(contractIdVal, userInfo, token) {
191
188
  }]
192
189
  };
193
190
  return new Promise(function (resolve) {
194
- (0, _api.contractSignUrl)(params, {
195
- token: token
196
- }).then(function (res) {
191
+ (0, _api.contractSignUrl)(params).then(function (res) {
197
192
  if (res.data.code == 0) {
198
193
  resolve(true);
199
194
  } else {
@@ -214,7 +209,7 @@ function getContractSignUrl(contractIdVal, userInfo, token) {
214
209
  }
215
210
 
216
211
  // 【第4步】获取签pi页面
217
- function getSignUrl(userInfo, token, device) {
212
+ function getSignUrl(userInfo) {
218
213
  // uni.showLoading({ title: '加载中' })
219
214
  var params = {
220
215
  contractId: contractId,
@@ -239,12 +234,10 @@ function getSignUrl(userInfo, token, device) {
239
234
  autoClosePage: true,
240
235
  // 操作完成自动关闭页面
241
236
  language: 'ZH_CN',
242
- deviceType: device || 'H5' // 取值范围:PC(返回PC页面),H5(返回H5页面);不传值默认为:根据请求的UserAgent自动判断返回的页面类型。
237
+ deviceType: window.isPC || 'H5' // 取值范围:PC(返回PC页面),H5(返回H5页面);不传值默认为:根据请求的UserAgent自动判断返回的页面类型。
243
238
  };
244
239
  return new Promise(function (resolve) {
245
- (0, _api.signurl)(params, {
246
- token: token
247
- }).then(function (res) {
240
+ (0, _api.signurl)(params).then(function (res) {
248
241
  console.log(res, '页面结果');
249
242
  if (res.data.code == 0) {
250
243
  resolve(res.data.signUrl);
@@ -262,17 +255,17 @@ function getSignUrl(userInfo, token, device) {
262
255
  // 下方是打开手写签批页面后 的后续操作
263
256
 
264
257
  // 对外的方法 获取签批后的文件
265
- function getSignRes(_x8, _x9, _x0, _x1, _x10, _x11) {
258
+ function getSignRes(_x4, _x5, _x6, _x7) {
266
259
  return _getSignRes.apply(this, arguments);
267
260
  } // 轮询 签批状态
268
261
  function _getSignRes() {
269
- _getSignRes = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(documentIdVal, contractIdVal, name, autoUpload, token, baseUrl) {
262
+ _getSignRes = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(documentIdVal, contractIdVal, name, autoUpload) {
270
263
  var isSignSucc, newFile, uploadedFileObj;
271
264
  return _regenerator["default"].wrap(function (_context3) {
272
265
  while (1) switch (_context3.prev = _context3.next) {
273
266
  case 0:
274
267
  _context3.next = 1;
275
- return getCheckSignState(contractIdVal, token);
268
+ return getCheckSignState(contractIdVal);
276
269
  case 1:
277
270
  isSignSucc = _context3.sent;
278
271
  if (!isSignSucc) {
@@ -280,9 +273,9 @@ function _getSignRes() {
280
273
  break;
281
274
  }
282
275
  // 封存
283
- getContractFinish(contractIdVal, token);
276
+ getContractFinish(contractIdVal);
284
277
  _context3.next = 2;
285
- return handleSignApprovalDown(documentIdVal, name, token);
278
+ return handleSignApprovalDown(documentIdVal, name);
286
279
  case 2:
287
280
  newFile = _context3.sent;
288
281
  console.log('newFile', newFile);
@@ -292,7 +285,7 @@ function _getSignRes() {
292
285
  break;
293
286
  }
294
287
  _context3.next = 3;
295
- return (0, _file.uploadFilePromise)(newFile, baseUrl, token);
288
+ return (0, _file.uploadFilePromise)(newFile);
296
289
  case 3:
297
290
  uploadedFileObj = _context3.sent;
298
291
  console.log('签批完成后的文件地址', uploadedFileObj);
@@ -312,12 +305,10 @@ function _getSignRes() {
312
305
  }));
313
306
  return _getSignRes.apply(this, arguments);
314
307
  }
315
- function getCheckSignState(contractIdVal, token) {
308
+ function getCheckSignState(contractIdVal) {
316
309
  return new Promise(function (resolve) {
317
310
  (0, _api.checkSignState)({
318
311
  contractId: contractIdVal
319
- }, {
320
- token: token
321
312
  }).then(function (res) {
322
313
  console.log('轮询结果---', res);
323
314
  // console.log('轮询结果', JSON.parse(res.data));
@@ -337,24 +328,20 @@ function getCheckSignState(contractIdVal, token) {
337
328
  }
338
329
 
339
330
  // 封存电子签批
340
- function getContractFinish(contractIdVal, token) {
331
+ function getContractFinish(contractIdVal) {
341
332
  (0, _api.contractFinish)({
342
333
  contractId: contractIdVal
343
- }, {
344
- token: token
345
334
  });
346
335
  }
347
336
 
348
337
  // 下载签署完的文档
349
- function handleSignApprovalDown(documentIdVal, name, token) {
338
+ function handleSignApprovalDown(documentIdVal, name) {
350
339
  var params = {
351
340
  documentId: documentIdVal,
352
341
  type: 'pdf'
353
342
  };
354
343
  return new Promise(function (resolve) {
355
- (0, _api.documentDownload)(params, {
356
- token: token
357
- }).then(function (res) {
344
+ (0, _api.documentDownload)(params).then(function (res) {
358
345
  console.log('下载文件:', res);
359
346
  // 返回来是base64格式的
360
347
  var blob = (0, _file.dataURLtoBlob)(res.data); // 转成blob格式进行上传
@@ -333,6 +333,21 @@ const FileItemMeta: IPublicTypeComponentMetadata = {
333
333
  "initialValue": ""
334
334
  }
335
335
  },
336
+ {
337
+ "title": {
338
+ "label": {
339
+ "type": "i18n",
340
+ "en-US": "env",
341
+ "zh-CN": "env"
342
+ }
343
+ },
344
+ "name": "env",
345
+ "setter": {
346
+ "componentName": "StringSetter",
347
+ "isRequired": true,
348
+ "initialValue": ""
349
+ }
350
+ },
336
351
  {
337
352
  "title": {
338
353
  "label": {
@@ -309,6 +309,20 @@ var FileItemMeta = {
309
309
  "isRequired": true,
310
310
  "initialValue": ""
311
311
  }
312
+ }, {
313
+ "title": {
314
+ "label": {
315
+ "type": "i18n",
316
+ "en-US": "env",
317
+ "zh-CN": "env"
318
+ }
319
+ },
320
+ "name": "env",
321
+ "setter": {
322
+ "componentName": "StringSetter",
323
+ "isRequired": true,
324
+ "initialValue": ""
325
+ }
312
326
  }, {
313
327
  "title": {
314
328
  "label": {
@@ -89,7 +89,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
89
89
  packageName = 'ydb-components-material';
90
90
  }
91
91
  if (version === void 0) {
92
- version = '0.1.66';
92
+ version = '0.1.67';
93
93
  }
94
94
  if (basicLibraryVersion === void 0) {
95
95
  basicLibraryVersion = {
@@ -314,6 +314,20 @@ var FileItemMeta = {
314
314
  "isRequired": true,
315
315
  "initialValue": ""
316
316
  }
317
+ }, {
318
+ "title": {
319
+ "label": {
320
+ "type": "i18n",
321
+ "en-US": "env",
322
+ "zh-CN": "env"
323
+ }
324
+ },
325
+ "name": "env",
326
+ "setter": {
327
+ "componentName": "StringSetter",
328
+ "isRequired": true,
329
+ "initialValue": ""
330
+ }
317
331
  }, {
318
332
  "title": {
319
333
  "label": {
@@ -94,7 +94,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
94
94
  packageName = 'ydb-components-material';
95
95
  }
96
96
  if (version === void 0) {
97
- version = '0.1.66';
97
+ version = '0.1.67';
98
98
  }
99
99
  if (basicLibraryVersion === void 0) {
100
100
  basicLibraryVersion = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-components-material",
3
- "version": "0.1.66",
3
+ "version": "0.1.67",
4
4
  "description": "ydb-components-material",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -97,10 +97,10 @@
97
97
  },
98
98
  "componentConfig": {
99
99
  "isComponentLibrary": true,
100
- "materialSchema": "https://unpkg.com/ydb-components-material@0.1.66/build/lowcode/assets-prod.json"
100
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.67/build/lowcode/assets-prod.json"
101
101
  },
102
102
  "lcMeta": {
103
103
  "type": "component"
104
104
  },
105
- "homepage": "https://unpkg.com/ydb-components-material@0.1.66/build/index.html"
105
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.67/build/index.html"
106
106
  }