ydb-components-material 0.1.83 → 0.1.85

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 (43) 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.97a3bada.css → umi.466b4c0a.css} +1 -1
  7. package/build/docs/umi.860fec17.js +1 -0
  8. package/build/docs/~demos/:uuid.html +3 -3
  9. package/build/docs/~demos/colorful-button-demo.html +3 -3
  10. package/build/docs/~demos/colorful-input-demo.html +3 -3
  11. package/build/lowcode/assets-daily.json +11 -11
  12. package/build/lowcode/assets-dev.json +2 -2
  13. package/build/lowcode/assets-prod.json +11 -11
  14. package/build/lowcode/meta.js +1 -1
  15. package/build/lowcode/render/default/view.css +1 -1
  16. package/build/lowcode/render/default/view.js +1 -1
  17. package/build/lowcode/view.css +1 -1
  18. package/build/lowcode/view.js +1 -1
  19. package/dist/BizComps.css +1 -1
  20. package/dist/BizComps.js +3 -3
  21. package/dist/BizComps.js.map +1 -1
  22. package/es/api.js +31 -30
  23. package/es/components/file-item/checkPoint.scss +1 -1
  24. package/es/components/file-item/file.js +5 -4
  25. package/es/components/file-item/index.js +55 -34
  26. package/es/components/file-item/seal.js +36 -6
  27. package/es/components/file-item/sealUtil.js +33 -59
  28. package/es/components/file-item/sign.js +22 -4
  29. package/es/components/file-item/signUtil.js +43 -56
  30. package/lib/api.js +31 -30
  31. package/lib/components/file-item/checkPoint.scss +1 -1
  32. package/lib/components/file-item/file.js +5 -4
  33. package/lib/components/file-item/index.js +54 -33
  34. package/lib/components/file-item/seal.js +36 -6
  35. package/lib/components/file-item/sealUtil.js +33 -59
  36. package/lib/components/file-item/sign.js +22 -4
  37. package/lib/components/file-item/signUtil.js +43 -56
  38. package/lowcode_es/meta.js +1 -1
  39. package/lowcode_lib/meta.js +1 -1
  40. package/package.json +3 -3
  41. package/build/docs/umi.84ae667a.js +0 -1
  42. package/es/components/file-item/Untitled-5.json +0 -290
  43. package/lib/components/file-item/Untitled-5.json +0 -290
@@ -16,7 +16,12 @@ function SealPage(props) {
16
16
  var userInfo = props.userInfo,
17
17
  file = props.file,
18
18
  getSealRes = props.getSealRes,
19
- handleClose = props.handleClose;
19
+ handleClose = props.handleClose,
20
+ tokenTY = props.tokenTY,
21
+ baseUrl = props.baseUrl,
22
+ env = props.env,
23
+ isPC = props.isPC,
24
+ accessToken = props.accessToken;
20
25
  var _useState = (0, _react.useState)(''),
21
26
  srcUrl = _useState[0],
22
27
  setSrcUrl = _useState[1];
@@ -32,12 +37,19 @@ function SealPage(props) {
32
37
  while (1) switch (_context.prev = _context.next) {
33
38
  case 0:
34
39
  console.log('file', file, userInfo);
35
- fileObj = file; // 有旧的URL说明是重新签章 旧的是原始的空白的 重新签需要签在原始的空白文件
40
+ fileObj = file; // 有旧的 URL 说明是重新签章 旧的是原始的空白的 重新签需要签在原始的空白文件
36
41
  if (file.oldUrl) {
37
42
  fileObj.url = file.oldUrl;
38
43
  }
44
+ // 传递配置参数给工具函数
39
45
  _context.next = 1;
40
- return (0, _sealUtil.initSealPageMethod)(fileObj, userInfo);
46
+ return (0, _sealUtil.initSealPageMethod)(fileObj, userInfo, {
47
+ tokenTY: tokenTY,
48
+ baseUrl: baseUrl,
49
+ env: env,
50
+ isPC: isPC,
51
+ accessToken: accessToken
52
+ });
41
53
  case 1:
42
54
  res = _context.sent;
43
55
  if (res) {
@@ -77,7 +89,13 @@ function SealPage(props) {
77
89
  };
78
90
  console.log('params', params);
79
91
  _context2.next = 1;
80
- return (0, _api.fileUploadApi)(params);
92
+ return (0, _api.fileUploadApi)(params, {
93
+ tokenTY: tokenTY,
94
+ baseUrl: baseUrl,
95
+ env: env,
96
+ isPC: isPC,
97
+ accessToken: accessToken
98
+ });
81
99
  case 1:
82
100
  uploadRes = _context2.sent;
83
101
  console.log('重新上传的文件', uploadRes);
@@ -106,6 +124,12 @@ function SealPage(props) {
106
124
  var signFileDown = function signFileDown(filePath) {
107
125
  (0, _api.signFileDownApi)({
108
126
  fileUrl: filePath
127
+ }, {
128
+ tokenTY: tokenTY,
129
+ baseUrl: baseUrl,
130
+ env: env,
131
+ isPC: isPC,
132
+ accessToken: accessToken
109
133
  }).then(function (res) {
110
134
  if (res.code === 200) {
111
135
  uploadNewFile(res.data);
@@ -113,14 +137,20 @@ function SealPage(props) {
113
137
  });
114
138
  };
115
139
 
116
- // 电子签章-移动端签批 获取移动端签章结果(文件地址)
140
+ // 电子签章 - 移动端签批 获取移动端签章结果 (文件地址)
117
141
  var getSignFileFun = function getSignFileFun() {
118
142
  // uni.showLoading({ title: '加载中' })
119
143
 
120
144
  var params = {
121
145
  orderId: orderId
122
146
  };
123
- (0, _api.getSignFileApi)(params).then(function (res) {
147
+ (0, _api.getSignFileApi)(params, {
148
+ tokenTY: tokenTY,
149
+ baseUrl: baseUrl,
150
+ env: env,
151
+ isPC: isPC,
152
+ accessToken: accessToken
153
+ }).then(function (res) {
124
154
  if (!res) {
125
155
  return;
126
156
  }
@@ -11,20 +11,20 @@ var _api = require("../../api.js");
11
11
  // import apiConfig from '@/config/api.cofig'
12
12
  // const userInfo = uni.getStorageSync('userInfo')
13
13
  // 对外的方法 获取电子签章的页面地址
14
- function initSealPageMethod(_x, _x2) {
14
+ function initSealPageMethod(_x, _x2, _x3) {
15
15
  return _initSealPageMethod.apply(this, arguments);
16
- } // [第1步] 查询当前用户是否有电子签章
16
+ } // [第 1 步] 查询当前用户是否有电子签章
17
17
  function _initSealPageMethod() {
18
- _initSealPageMethod = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fileObj, userInfo) {
18
+ _initSealPageMethod = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fileObj, userInfo, config) {
19
19
  var name, sealList, fileUrl, orderId, pageUrl, params;
20
20
  return _regenerator["default"].wrap(function (_context) {
21
21
  while (1) switch (_context.prev = _context.next) {
22
22
  case 0:
23
23
  name = fileObj.name;
24
24
  console.log('fileObj', fileObj, userInfo);
25
- // 【第1步】判断当前用户是否有印章
25
+ // 【第 1 步】判断当前用户是否有印章
26
26
  _context.next = 1;
27
- return querySeal(userInfo);
27
+ return querySeal(userInfo, config);
28
28
  case 1:
29
29
  sealList = _context.sent;
30
30
  console.log('sealList---', sealList);
@@ -36,7 +36,7 @@ function _initSealPageMethod() {
36
36
  return _context.abrupt("return", false);
37
37
  case 2:
38
38
  _context.next = 3;
39
- return uploadSealFile(fileObj);
39
+ return uploadSealFile(fileObj, config);
40
40
  case 3:
41
41
  fileUrl = _context.sent;
42
42
  console.log('fileUrl---', fileUrl);
@@ -47,7 +47,7 @@ function _initSealPageMethod() {
47
47
  return _context.abrupt("return", false);
48
48
  case 4:
49
49
  _context.next = 5;
50
- return getSignOrderId(sealList, fileObj, fileUrl, userInfo);
50
+ return getSignOrderId(sealList, fileObj, fileUrl, userInfo, config);
51
51
  case 5:
52
52
  orderId = _context.sent;
53
53
  console.log('orderId---', orderId);
@@ -58,7 +58,7 @@ function _initSealPageMethod() {
58
58
  return _context.abrupt("return", false);
59
59
  case 6:
60
60
  _context.next = 7;
61
- return getMobilePageFun(orderId);
61
+ return getMobilePageFun(orderId, config);
62
62
  case 7:
63
63
  pageUrl = _context.sent;
64
64
  // 将 电子签章地址/文件名称 返回
@@ -76,7 +76,7 @@ function _initSealPageMethod() {
76
76
  }));
77
77
  return _initSealPageMethod.apply(this, arguments);
78
78
  }
79
- function querySeal(userInfo) {
79
+ function querySeal(userInfo, config) {
80
80
  console.log('querySeal', userInfo);
81
81
  // uni.showLoading({ title: '查询印章中' })
82
82
  var params = {
@@ -85,7 +85,7 @@ function querySeal(userInfo) {
85
85
  userIdType: '2'
86
86
  };
87
87
  return new Promise(function (resolve) {
88
- (0, _api.qrySealApi)(params).then(function (res) {
88
+ (0, _api.qrySealApi)(params, config).then(function (res) {
89
89
  if (res.data && res.data.length > 0) {
90
90
  resolve(res.data);
91
91
  } else {
@@ -99,12 +99,12 @@ function querySeal(userInfo) {
99
99
  });
100
100
  }
101
101
 
102
- // [第2步] 上传文件
103
- function uploadSealFile(_x3) {
102
+ // [第 2 步] 上传文件
103
+ function uploadSealFile(_x4, _x5) {
104
104
  return _uploadSealFile.apply(this, arguments);
105
- } // [第3步] 获取电子印章页面
105
+ } // [第 3 步] 获取电子印章页面
106
106
  function _uploadSealFile() {
107
- _uploadSealFile = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(fileObj) {
107
+ _uploadSealFile = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(fileObj, config) {
108
108
  var blob, file;
109
109
  return _regenerator["default"].wrap(function (_context2) {
110
110
  while (1) switch (_context2.prev = _context2.next) {
@@ -122,9 +122,9 @@ function _uploadSealFile() {
122
122
  filename: fileObj.name,
123
123
  // 文件名称
124
124
  headers: {
125
- Authorization: window.tokenTY
125
+ Authorization: config.tokenTY
126
126
  },
127
- action: window.baseUrl + "/declaration/center/sign/api/fileUploadApi",
127
+ action: config.baseUrl + "/declaration/center/sign/api/fileUploadApi",
128
128
  // 上传文件的地址
129
129
  onError: function onError(e) {
130
130
  // uni.$u.toast(e.msg || '上传文件异常');
@@ -146,7 +146,7 @@ function _uploadSealFile() {
146
146
  }));
147
147
  return _uploadSealFile.apply(this, arguments);
148
148
  }
149
- function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo) {
149
+ function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo, config) {
150
150
  // uni.showLoading({ title: '获取签章页面中' })
151
151
  console.log('sealList', sealList, fileObj, esusFileUrl, userInfo);
152
152
  var fileId = fileObj.fileId,
@@ -156,9 +156,9 @@ function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo) {
156
156
  sealList.forEach(function (sealItem, sealIndex) {
157
157
  apiSignDtosArr.push({
158
158
  deviceType: 3,
159
- // 签章类型(默认3)
159
+ // 签章类型 (默认 3)
160
160
  signType: 0,
161
- // 签章方式(0 - 自由签章 or 定位签章2 - 关键字签章3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
161
+ // 签章方式 (0 - 自由签章 or 定位签章 2 - 关键字签章 3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
162
162
  sealCode: sealItem.sealCode,
163
163
  // 印章编码
164
164
  signatories: [
@@ -167,7 +167,7 @@ function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo) {
167
167
  pageIndex: sealIndex,
168
168
  // 签章所在页码
169
169
  x: 0.00,
170
- // 位置横坐标 支持百分比坐标<1,百分比。>1,pdf磅,ofd 毫米
170
+ // 位置横坐标 支持百分比坐标<1,百分比。>1,pdf 磅,ofd 毫米
171
171
  y: 0.00 // 位置纵坐标
172
172
  }]
173
173
  });
@@ -181,48 +181,22 @@ function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo) {
181
181
  // 2:身份证
182
182
  signFileReqs: [{
183
183
  file: esusFileUrl,
184
- // 签章文件(签章文件base64编码文件数据或者文件地址)
184
+ // 签章文件 (签章文件 base64 编码文件数据或者文件地址)
185
185
  fileType: '0',
186
- // 文件格式类型(0文件路径;1文件数据)
186
+ // 文件格式类型 (0 文件路径;1 文件数据)
187
187
  docType: '0',
188
188
  // 文件内容类型 (0 PDF;1 OFD)
189
189
  fileId: fileId,
190
- // 业务系统文件id (用于回传文件,不可重复)
190
+ // 业务系统文件 id (用于回传文件,不可重复)
191
191
  fileName: name,
192
- // 签章文件名称(文件名称包含文件格式,如a.pdf,b.ofd)
192
+ // 签章文件名称 (文件名称包含文件格式,如 a.pdf,b.ofd)
193
193
  apiSignDtos: apiSignDtosArr
194
- // apiSignDtos: [ // 签章信息列表(一次可以多个签章参数。每个参数选一个签章参数)
195
- // {
196
- // deviceType: 3, // 签章类型(默认3)
197
- // sealCode: '14110000000423', // 印章编码
198
- // signType: 0, // 签章方式(0 - 自由签章 or 定位签章2 - 关键字签章3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
199
- // signatories: [ // 定位签章参数
200
- // {
201
- // pageIndex: 0, // 签章所在页码
202
- // x: 0.00, // 位置横坐标 支持百分比坐标<1,百分比。>1,pdf磅,ofd 毫米
203
- // y: 0.00, // 位置纵坐标
204
- // }
205
- // ]
206
- // },
207
- // {
208
- // deviceType: 3, // 签章类型(默认3)
209
- // sealCode: '14110000000392', // 印章编码
210
- // signType: 0, // 签章方式(0 - 自由签章 or 定位签章2 - 关键字签章3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
211
- // signatories: [ // 定位签章参数
212
- // {
213
- // pageIndex: 0, // 签章所在页码
214
- // x: 0.00, // 位置横坐标 支持百分比坐标<1,百分比。>1,pdf磅,ofd 毫米
215
- // y: 0.00, // 位置纵坐标
216
- // }
217
- // ]
218
- // }
219
- // ]
220
194
  }]
221
195
  };
222
196
  console.log('params---', params);
223
197
  return new Promise(function (resolve) {
224
- console.log('获取签章订单id');
225
- (0, _api.getSignOrderIdApi)(params).then(function (res) {
198
+ console.log('获取签章订单 id');
199
+ (0, _api.getSignOrderIdApi)(params, config).then(function (res) {
226
200
  if (res) {
227
201
  var bigNumber = BigInt(res);
228
202
  resolve(bigNumber + '');
@@ -238,18 +212,18 @@ function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo) {
238
212
  });
239
213
  }
240
214
 
241
- // [第4步-移动端] 获取电子印章页面
242
- function getMobilePageFun(orderId) {
215
+ // [第 4 步 - 移动端] 获取电子印章页面
216
+ function getMobilePageFun(orderId, config) {
243
217
  // uni.showLoading({ title: '获取移动端签章页面中' })
244
218
  var params = {
245
- accessToken: window.accessToken,
219
+ accessToken: config.accessToken,
246
220
  acctType: '20',
247
221
  orderId: orderId
248
222
  };
249
223
  return new Promise(function (resolve) {
250
- if (window.isPC) {
251
- (0, _api.getPcSealUrlApi)(params).then(function (res) {
252
- console.log('签章页面pc----', res);
224
+ if (config.isPC) {
225
+ (0, _api.getPcSealUrlApi)(params, config).then(function (res) {
226
+ console.log('签章页面 pc----', res);
253
227
  if (res.code === 200) {
254
228
  resolve(res.data);
255
229
  // uni.hideLoading()
@@ -262,7 +236,7 @@ function getMobilePageFun(orderId) {
262
236
  // uni.hideLoading()
263
237
  });
264
238
  } else {
265
- (0, _api.getSealUrlApi)(params).then(function (res) {
239
+ (0, _api.getSealUrlApi)(params, config).then(function (res) {
266
240
  if (res) {
267
241
  console.log(res, '移动端签章页面');
268
242
  resolve(res);
@@ -13,7 +13,12 @@ function SignPage(props) {
13
13
  var userInfo = props.userInfo,
14
14
  file = props.file,
15
15
  getRes = props.getRes,
16
- handleClose = props.handleClose;
16
+ handleClose = props.handleClose,
17
+ token = props.token,
18
+ tokenTY = props.tokenTY,
19
+ baseUrl = props.baseUrl,
20
+ env = props.env,
21
+ isPC = props.isPC;
17
22
  var _useState = (0, _react.useState)(''),
18
23
  srcUrl = _useState[0],
19
24
  setSrcUrl = _useState[1];
@@ -33,12 +38,19 @@ function SignPage(props) {
33
38
  return _regenerator["default"].wrap(function (_context) {
34
39
  while (1) switch (_context.prev = _context.next) {
35
40
  case 0:
36
- fileObj = file; // 有旧的URL说明是重新签章 旧的是原始的空白的 重新签需要签在原始的空白文件
41
+ fileObj = file; // 有旧的 URL 说明是重新签章 旧的是原始的空白的 重新签需要签在原始的空白文件
37
42
  if (file.oldUrl) {
38
43
  fileObj.url = file.oldUrl;
39
44
  }
45
+ // 传递配置参数给工具函数
40
46
  _context.next = 1;
41
- return (0, _signUtil.initSignPageMethod)(fileObj, userInfo);
47
+ return (0, _signUtil.initSignPageMethod)(fileObj, userInfo, {
48
+ token: token,
49
+ tokenTY: tokenTY,
50
+ baseUrl: baseUrl,
51
+ env: env,
52
+ isPC: isPC
53
+ });
42
54
  case 1:
43
55
  res = _context.sent;
44
56
  documentIdVal = res.documentId, contractIdVal = res.contractId, pageUrl = res.pageUrl, nameVal = res.name;
@@ -64,7 +76,13 @@ function SignPage(props) {
64
76
  while (1) switch (_context2.prev = _context2.next) {
65
77
  case 0:
66
78
  _context2.next = 1;
67
- return (0, _signUtil.getSignRes)(documentIdVal, contractIdVal, nameVal, true);
79
+ return (0, _signUtil.getSignRes)(documentIdVal, contractIdVal, nameVal, true, {
80
+ token: token,
81
+ tokenTY: tokenTY,
82
+ baseUrl: baseUrl,
83
+ env: env,
84
+ isPC: isPC
85
+ });
68
86
  case 1:
69
87
  newFile = _context2.sent;
70
88
  console.log(newFile, '签署完毕后的');
@@ -15,19 +15,19 @@ var documentId = ''; // 手写签批生成的文件id
15
15
  var contractId = ''; // 合同id
16
16
 
17
17
  // 对外的方法 初始化手写签批的页面
18
- function initSignPageMethod(_x, _x2) {
18
+ function initSignPageMethod(_x, _x2, _x3) {
19
19
  return _initSignPageMethod.apply(this, arguments);
20
- } // 【第1步】上传要手写签批的文件
20
+ } // 【第 1 步】上传要手写签批的文件
21
21
  function _initSignPageMethod() {
22
- _initSignPageMethod = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fileObj, userInfo) {
22
+ _initSignPageMethod = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fileObj, userInfo, config) {
23
23
  var name, docId, contrId, flag, pageUrl, params;
24
24
  return _regenerator["default"].wrap(function (_context) {
25
25
  while (1) switch (_context.prev = _context.next) {
26
26
  case 0:
27
27
  console.log('fileObj', fileObj, userInfo);
28
- name = fileObj.name; // 【第1步】上传要手写签批的文件
28
+ name = fileObj.name; // 【第 1 步】上传要手写签批的文件
29
29
  _context.next = 1;
30
- return uploadSignFile(fileObj);
30
+ return uploadSignFile(fileObj, config);
31
31
  case 1:
32
32
  docId = _context.sent;
33
33
  console.log('docId---', docId);
@@ -37,11 +37,11 @@ function _initSignPageMethod() {
37
37
  }
38
38
  return _context.abrupt("return", false);
39
39
  case 2:
40
- documentId = docId; // 保存文档id
40
+ documentId = docId; // 保存文档 id
41
41
 
42
- // 【第2步】创建或者发起电子签批
42
+ // 【第 2 步】创建或者发起电子签批
43
43
  _context.next = 3;
44
- return createbycategoryFun(name, docId);
44
+ return createbycategoryFun(name, docId, config);
45
45
  case 3:
46
46
  contrId = _context.sent;
47
47
  console.log('contrId---', contrId);
@@ -52,16 +52,10 @@ function _initSignPageMethod() {
52
52
  return _context.abrupt("return", false);
53
53
  case 4:
54
54
  contractId = contrId;
55
- // const contractIdList = [contrId];
56
- // uni.setStorageSync('contractIdList',
57
- // [
58
- // ...uni.getStorageSync('contractIdList'), ...contractIdList
59
- // ]
60
- // );
61
55
 
62
- // 【第3步】创建手写签批页面
56
+ // 【第 3 步】创建手写签批页面
63
57
  _context.next = 5;
64
- return getContractSignUrl(contrId, userInfo);
58
+ return getContractSignUrl(contrId, userInfo, config);
65
59
  case 5:
66
60
  flag = _context.sent;
67
61
  if (flag) {
@@ -71,7 +65,7 @@ function _initSignPageMethod() {
71
65
  return _context.abrupt("return", false);
72
66
  case 6:
73
67
  _context.next = 7;
74
- return getSignUrl(userInfo);
68
+ return getSignUrl(userInfo, config);
75
69
  case 7:
76
70
  pageUrl = _context.sent;
77
71
  if (pageUrl) {
@@ -80,7 +74,7 @@ function _initSignPageMethod() {
80
74
  }
81
75
  return _context.abrupt("return", false);
82
76
  case 8:
83
- // 将 文档id/签批文件id/签署地址/文件名称 返回
77
+ // 将 文档 id/签批文件 id/签署地址/文件名称 返回
84
78
  params = {
85
79
  documentId: documentId,
86
80
  contractId: contractId,
@@ -96,16 +90,16 @@ function _initSignPageMethod() {
96
90
  }));
97
91
  return _initSignPageMethod.apply(this, arguments);
98
92
  }
99
- function uploadSignFile(_x3) {
93
+ function uploadSignFile(_x4, _x5) {
100
94
  return _uploadSignFile.apply(this, arguments);
101
- } // 【第2步】创建或者发起电子签批
95
+ } // 【第 2 步】创建或者发起电子签批
102
96
  function _uploadSignFile() {
103
- _uploadSignFile = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(event) {
97
+ _uploadSignFile = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(event, config) {
104
98
  var blob, file, signApprovalFileType;
105
99
  return _regenerator["default"].wrap(function (_context2) {
106
100
  while (1) switch (_context2.prev = _context2.next) {
107
101
  case 0:
108
- console.log(event, '文件1111', window.env);
102
+ console.log(event, '文件 1111', config);
109
103
  // uni.showLoading({ title: '加载中' })
110
104
  _context2.next = 1;
111
105
  return (0, _file.getBlob)(event.url);
@@ -124,9 +118,10 @@ function _uploadSignFile() {
124
118
  filename: event.name,
125
119
  // 文件名称
126
120
  headers: {
127
- Authorization: window.token
121
+ Authorization: config.tokenTY
128
122
  },
129
- action: "\nhttps://zwfwpt.sxzwfw.gov.cn" + (window.env === 'release' ? ':10010' : '') + "/DeclarationAPI/declaration/center/signapproval/api/createbyfile",
123
+ // https://zwfwpt.sxzwfw.gov.cn${window.env === 'release' ? ':10010' : ''}/DeclarationAPI
124
+ action: config.baseUrl + "/declaration/center/signapproval/api/createbyfile",
130
125
  // 上传文件的地址
131
126
  onError: function onError(e) {
132
127
  // uni.$u.toast(e.msg || '手写签批上传文件异常');
@@ -148,18 +143,18 @@ function _uploadSignFile() {
148
143
  }));
149
144
  return _uploadSignFile.apply(this, arguments);
150
145
  }
151
- function createbycategoryFun(fileName, documentIdVal) {
146
+ function createbycategoryFun(fileName, documentIdVal, config) {
152
147
  // uni.showLoading({ title: '加载中' })
153
- console.log('env---', window.env);
148
+ console.log('env---', config.env);
154
149
  var params = {
155
150
  subject: fileName,
156
151
  documents: [documentIdVal],
157
- categoryId: window.env === 'release' ? categoryIdRelease : categoryId,
152
+ categoryId: config.env === 'releaseHLW' ? categoryIdRelease : categoryId,
158
153
  send: true,
159
154
  tenantName: '山西省行政审批服务管理局'
160
155
  };
161
156
  return new Promise(function (resolve) {
162
- (0, _api.createbycategory)(params).then(function (res) {
157
+ (0, _api.createbycategory)(params, config).then(function (res) {
163
158
  console.log('创建订单成功', res);
164
159
  if (res.code === 200) {
165
160
  resolve(res.data.contractId);
@@ -173,8 +168,8 @@ function createbycategoryFun(fileName, documentIdVal) {
173
168
  });
174
169
  }
175
170
 
176
- // 【第3步】创建手写签批页面
177
- function getContractSignUrl(contractIdVal, userInfo) {
171
+ // 【第 3 步】创建手写签批页面
172
+ function getContractSignUrl(contractIdVal, userInfo, config) {
178
173
  console.log('contractIdVal', contractIdVal, userInfo);
179
174
  // uni.showLoading({ title: '加载中' })
180
175
  var params = {
@@ -191,7 +186,7 @@ function getContractSignUrl(contractIdVal, userInfo) {
191
186
  }]
192
187
  };
193
188
  return new Promise(function (resolve) {
194
- (0, _api.contractSignUrl)(params).then(function (res) {
189
+ (0, _api.contractSignUrl)(params, config).then(function (res) {
195
190
  if (res.data.code == 0) {
196
191
  resolve(true);
197
192
  } else {
@@ -211,8 +206,8 @@ function getContractSignUrl(contractIdVal, userInfo) {
211
206
  });
212
207
  }
213
208
 
214
- // 【第4步】获取签pi页面
215
- function getSignUrl(userInfo) {
209
+ // 【第 4 步】获取签 pi 页面
210
+ function getSignUrl(userInfo, config) {
216
211
  // uni.showLoading({ title: '加载中' })
217
212
  var params = {
218
213
  contractId: contractId,
@@ -233,14 +228,14 @@ function getSignUrl(userInfo) {
233
228
  canViewDetail: false,
234
229
  // 页面是否显示签署详情按钮
235
230
  canMoreOperation: false,
236
- // 页面是否显示“更多操作”按钮
231
+ // 页面是否显示"更多操作"按钮
237
232
  autoClosePage: true,
238
233
  // 操作完成自动关闭页面
239
234
  language: 'ZH_CN',
240
- deviceType: window.isPC || 'H5' // 取值范围:PC(返回PC页面),H5(返回H5页面);不传值默认为:根据请求的UserAgent自动判断返回的页面类型。
235
+ deviceType: config.isPC || 'H5' // 取值范围:PC(返回 PC 页面),H5(返回 H5 页面);不传值默认为:根据请求的 UserAgent 自动判断返回的页面类型。
241
236
  };
242
237
  return new Promise(function (resolve) {
243
- (0, _api.signurl)(params).then(function (res) {
238
+ (0, _api.signurl)(params, config).then(function (res) {
244
239
  console.log(res, '页面结果');
245
240
  if (res.data.code == 0) {
246
241
  resolve(res.data.signUrl);
@@ -258,17 +253,17 @@ function getSignUrl(userInfo) {
258
253
  // 下方是打开手写签批页面后 的后续操作
259
254
 
260
255
  // 对外的方法 获取签批后的文件
261
- function getSignRes(_x4, _x5, _x6, _x7) {
256
+ function getSignRes(_x6, _x7, _x8, _x9, _x0) {
262
257
  return _getSignRes.apply(this, arguments);
263
258
  } // 轮询 签批状态
264
259
  function _getSignRes() {
265
- _getSignRes = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(documentIdVal, contractIdVal, name, autoUpload) {
260
+ _getSignRes = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(documentIdVal, contractIdVal, name, autoUpload, config) {
266
261
  var isSignSucc, newFile, uploadedFileObj;
267
262
  return _regenerator["default"].wrap(function (_context3) {
268
263
  while (1) switch (_context3.prev = _context3.next) {
269
264
  case 0:
270
265
  _context3.next = 1;
271
- return getCheckSignState(contractIdVal);
266
+ return getCheckSignState(contractIdVal, config);
272
267
  case 1:
273
268
  isSignSucc = _context3.sent;
274
269
  if (!isSignSucc) {
@@ -276,9 +271,9 @@ function _getSignRes() {
276
271
  break;
277
272
  }
278
273
  // 封存
279
- getContractFinish(contractIdVal);
274
+ getContractFinish(contractIdVal, config);
280
275
  _context3.next = 2;
281
- return handleSignApprovalDown(documentIdVal, name);
276
+ return handleSignApprovalDown(documentIdVal, name, config);
282
277
  case 2:
283
278
  newFile = _context3.sent;
284
279
  console.log('newFile', newFile);
@@ -288,7 +283,7 @@ function _getSignRes() {
288
283
  break;
289
284
  }
290
285
  _context3.next = 3;
291
- return (0, _file.uploadFilePromise)(newFile);
286
+ return (0, _file.uploadFilePromise)(newFile, config);
292
287
  case 3:
293
288
  uploadedFileObj = _context3.sent;
294
289
  console.log('签批完成后的文件地址', uploadedFileObj);
@@ -308,11 +303,11 @@ function _getSignRes() {
308
303
  }));
309
304
  return _getSignRes.apply(this, arguments);
310
305
  }
311
- function getCheckSignState(contractIdVal) {
306
+ function getCheckSignState(contractIdVal, config) {
312
307
  return new Promise(function (resolve) {
313
308
  (0, _api.checkSignState)({
314
309
  contractId: contractIdVal
315
- }).then(function (res) {
310
+ }, config).then(function (res) {
316
311
  console.log('轮询结果---', res);
317
312
  // console.log('轮询结果', JSON.parse(res.data));
318
313
  // 签署完成
@@ -331,32 +326,24 @@ function getCheckSignState(contractIdVal) {
331
326
  }
332
327
 
333
328
  // 封存电子签批
334
- function getContractFinish(contractIdVal) {
329
+ function getContractFinish(contractIdVal, config) {
335
330
  (0, _api.contractFinish)({
336
331
  contractId: contractIdVal
337
- });
332
+ }, config);
338
333
  }
339
334
 
340
335
  // 下载签署完的文档
341
- function handleSignApprovalDown(documentIdVal, name) {
336
+ function handleSignApprovalDown(documentIdVal, name, config) {
342
337
  var params = {
343
338
  documentId: documentIdVal,
344
339
  type: 'pdf'
345
340
  };
346
341
  return new Promise(function (resolve) {
347
- (0, _api.documentDownload)(params).then(function (res) {
342
+ (0, _api.documentDownload)(params, config).then(function (res) {
348
343
  console.log('下载文件:', res);
349
344
  // 返回来是base64格式的
350
345
  var blob = (0, _file.dataURLtoBlob)(res.data); // 转成blob格式进行上传
351
346
  console.log(blob, '新文件的blob格式');
352
- var fileObj = {
353
- file: [{
354
- url: res.data,
355
- size: blob.size,
356
- isSignApproval: true,
357
- name: name
358
- }]
359
- };
360
347
  resolve(blob);
361
348
  });
362
349
  });
@@ -90,7 +90,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
90
90
  packageName = 'ydb-components-material';
91
91
  }
92
92
  if (version === void 0) {
93
- version = '0.1.83';
93
+ version = '0.1.85';
94
94
  }
95
95
  if (basicLibraryVersion === void 0) {
96
96
  basicLibraryVersion = {
@@ -95,7 +95,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
95
95
  packageName = 'ydb-components-material';
96
96
  }
97
97
  if (version === void 0) {
98
- version = '0.1.83';
98
+ version = '0.1.85';
99
99
  }
100
100
  if (basicLibraryVersion === void 0) {
101
101
  basicLibraryVersion = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-components-material",
3
- "version": "0.1.83",
3
+ "version": "0.1.85",
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.83/build/lowcode/assets-prod.json"
100
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.85/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.83/build/index.html"
105
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.85/build/index.html"
106
106
  }