ydb-components-material 0.1.115 → 0.1.117

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 (41) 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.4643e826.js → umi.43c50c6a.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/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 +10 -10
  17. package/dist/BizComps.js.map +1 -1
  18. package/es/components/file-list/index.d.ts +1 -0
  19. package/es/components/file-list/index.js +3 -0
  20. package/es/components/file-list/item.d.ts +1 -0
  21. package/es/components/file-list/item.js +174 -66
  22. package/es/components/file-list/seal.js +3 -1
  23. package/es/components/file-list/sealUtil.js +51 -37
  24. package/es/components/file-list/signerInfo.js +64 -5
  25. package/es/components/sign-file/index.js +10 -1
  26. package/es/style.js +1 -1
  27. package/lib/components/file-list/index.d.ts +1 -0
  28. package/lib/components/file-list/index.js +3 -0
  29. package/lib/components/file-list/item.d.ts +1 -0
  30. package/lib/components/file-list/item.js +174 -66
  31. package/lib/components/file-list/seal.js +3 -1
  32. package/lib/components/file-list/sealUtil.js +53 -36
  33. package/lib/components/file-list/signerInfo.js +64 -5
  34. package/lib/components/sign-file/index.js +10 -1
  35. package/lib/style.js +1 -1
  36. package/lowcode/file-list/meta.ts +14 -0
  37. package/lowcode_es/file-list/meta.js +13 -0
  38. package/lowcode_es/meta.js +1 -1
  39. package/lowcode_lib/file-list/meta.js +13 -0
  40. package/lowcode_lib/meta.js +1 -1
  41. package/package.json +3 -3
@@ -3,63 +3,61 @@
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  exports.__esModule = true;
5
5
  exports.initSealPageMethod = initSealPageMethod;
6
+ exports.querySeal = querySeal;
6
7
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
7
8
  var _message = _interopRequireDefault(require("@alifd/next/lib/message"));
8
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
9
10
  var _file = require("./file.js");
10
11
  var _api = require("../../api.js");
11
12
  // import apiConfig from '@/config/api.cofig'
13
+
12
14
  // const userInfo = uni.getStorageSync('userInfo')
15
+ var SEAL_TYPE = '法人名章';
16
+ var SEAL_POSITION = '关键字印章';
17
+
13
18
  // 对外的方法 获取电子签章的页面地址
14
- function initSealPageMethod(_x, _x2, _x3) {
19
+ function initSealPageMethod(_x, _x2, _x3, _x4) {
15
20
  return _initSealPageMethod.apply(this, arguments);
16
21
  } // [第 1 步] 查询当前用户是否有电子签章
17
22
  function _initSealPageMethod() {
18
- _initSealPageMethod = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fileObj, userInfo, config) {
23
+ _initSealPageMethod = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fileObj, userInfo, sealConfig, config) {
19
24
  var fileName, sealList, fileUrl, orderId, pageUrl, params;
20
25
  return _regenerator["default"].wrap(function (_context) {
21
26
  while (1) switch (_context.prev = _context.next) {
22
27
  case 0:
23
28
  fileName = fileObj.fileName;
24
29
  console.log('fileObj', fileObj, userInfo);
25
- // 【第 1 步】判断当前用户是否有印章
30
+
31
+ // 查询印章列表(getSignOrderId 需要)
26
32
  _context.next = 1;
27
33
  return querySeal(userInfo, config);
28
34
  case 1:
29
35
  sealList = _context.sent;
30
- console.log('sealList---', sealList);
31
- if (sealList.length) {
32
- _context.next = 2;
33
- break;
34
- }
35
- _message["default"].error('该单位下暂无印章,请前往“山西政务服务网”或“三晋通”小程序申领印章');
36
- return _context.abrupt("return", false);
37
- case 2:
38
- _context.next = 3;
36
+ _context.next = 2;
39
37
  return uploadSealFile(fileObj, config);
40
- case 3:
38
+ case 2:
41
39
  fileUrl = _context.sent;
42
40
  console.log('fileUrl---', fileUrl);
43
41
  if (fileUrl) {
44
- _context.next = 4;
42
+ _context.next = 3;
45
43
  break;
46
44
  }
47
45
  return _context.abrupt("return", false);
46
+ case 3:
47
+ _context.next = 4;
48
+ return getSignOrderId(sealList, fileObj, fileUrl, userInfo, sealConfig, config);
48
49
  case 4:
49
- _context.next = 5;
50
- return getSignOrderId(sealList, fileObj, fileUrl, userInfo, config);
51
- case 5:
52
50
  orderId = _context.sent;
53
51
  console.log('orderId---', orderId);
54
52
  if (orderId) {
55
- _context.next = 6;
53
+ _context.next = 5;
56
54
  break;
57
55
  }
58
56
  return _context.abrupt("return", false);
59
- case 6:
60
- _context.next = 7;
57
+ case 5:
58
+ _context.next = 6;
61
59
  return getMobilePageFun(orderId, config, fileObj, fileUrl);
62
- case 7:
60
+ case 6:
63
61
  pageUrl = _context.sent;
64
62
  // 将 电子签章地址/文件名称 返回
65
63
  params = {
@@ -68,7 +66,7 @@ function _initSealPageMethod() {
68
66
  orderId: orderId
69
67
  };
70
68
  return _context.abrupt("return", params);
71
- case 8:
69
+ case 7:
72
70
  case "end":
73
71
  return _context.stop();
74
72
  }
@@ -100,7 +98,7 @@ function querySeal(userInfo, config) {
100
98
  }
101
99
 
102
100
  // [第 2 步] 上传文件
103
- function uploadSealFile(_x4, _x5) {
101
+ function uploadSealFile(_x5, _x6) {
104
102
  return _uploadSealFile.apply(this, arguments);
105
103
  } // [第 3 步] 获取电子印章页面
106
104
  function _uploadSealFile() {
@@ -146,32 +144,51 @@ function _uploadSealFile() {
146
144
  }));
147
145
  return _uploadSealFile.apply(this, arguments);
148
146
  }
149
- function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo, config) {
147
+ function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo, sealConfig, config) {
150
148
  // uni.showLoading({ title: '获取签章页面中' })
151
149
  console.log('sealList', sealList, fileObj, esusFileUrl, userInfo);
152
150
  var fileId = fileObj.fileId,
153
151
  fileName = fileObj.fileName;
154
152
  // 循环签章列表 - 开始
155
153
  var apiSignDtosArr = [];
156
- sealList.forEach(function (sealItem, sealIndex) {
154
+ // 当前用户有法人名章
155
+ var legalSeal = sealList.find(function (item) {
156
+ return item.sealTypeName === SEAL_TYPE;
157
+ });
158
+ // 如果设置的有关键字签章
159
+ if (sealConfig.sealKeywords && sealConfig.sealPosition === SEAL_POSITION && sealConfig.sealContent === SEAL_TYPE && legalSeal) {
157
160
  apiSignDtosArr.push({
158
161
  deviceType: 3,
159
162
  // 签章类型 (默认 3)
160
- signType: 0,
163
+ signType: 3,
161
164
  // 签章方式 (0 - 自由签章 or 定位签章 2 - 关键字签章 3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
162
- sealCode: sealItem.sealCode,
165
+ sealCode: legalSeal.sealCode,
163
166
  // 印章编码
164
- signatories: [
165
- // 定位签章参数
166
- {
167
- pageIndex: sealIndex,
168
- // 签章所在页码
169
- x: 0.00,
170
- // 位置横坐标 支持百分比坐标<1,百分比。>1,pdf 磅,ofd 毫米
171
- y: 0.00 // 位置纵坐标
167
+ keyWordParam: [{
168
+ keyWord: sealConfig.sealKeywords
172
169
  }]
173
170
  });
174
- });
171
+ } else {
172
+ sealList.forEach(function (sealItem, sealIndex) {
173
+ apiSignDtosArr.push({
174
+ deviceType: 3,
175
+ // 签章类型 (默认 3)
176
+ signType: 0,
177
+ // 签章方式 (0 - 自由签章 or 定位签章 2 - 关键字签章 3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
178
+ sealCode: sealItem.sealCode,
179
+ // 印章编码
180
+ signatories: [
181
+ // 定位签章参数
182
+ {
183
+ pageIndex: sealIndex,
184
+ // 签章所在页码
185
+ x: 0.00,
186
+ // 位置横坐标 支持百分比坐标<1,百分比。>1,pdf 磅,ofd 毫米
187
+ y: 0.00 // 位置纵坐标
188
+ }]
189
+ });
190
+ });
191
+ }
175
192
  var params = {
176
193
  deptCode: userInfo.certificateSno,
177
194
  // 单位统一社会信用代码
@@ -56,18 +56,77 @@ function SignerInfo(props) {
56
56
  };
57
57
  var next = /*#__PURE__*/function () {
58
58
  var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
59
- var saveRes;
59
+ var i, item, fields, _i, _fields, field, val, saveRes;
60
60
  return _regenerator["default"].wrap(function (_context) {
61
61
  while (1) switch (_context.prev = _context.next) {
62
62
  case 0:
63
+ i = 0;
64
+ case 1:
65
+ if (!(i < signerInfoList.length)) {
66
+ _context.next = 5;
67
+ break;
68
+ }
69
+ item = signerInfoList[i];
70
+ fields = [{
71
+ label: '签署内容',
72
+ value: item.signContent
73
+ }];
74
+ if (item.signType === 0) {
75
+ // 个人:姓名、身份证号、手机号、签署内容
76
+ fields.push({
77
+ label: '姓名',
78
+ value: item.signerName
79
+ }, {
80
+ label: '身份证号',
81
+ value: item.signerCerNo
82
+ }, {
83
+ label: '手机号',
84
+ value: item.signerPhoneNum
85
+ });
86
+ } else {
87
+ // 企业:手机号、企业名称、统一社会信用代码、签署内容
88
+ fields.push({
89
+ label: '手机号',
90
+ value: item.signerPhoneNum
91
+ }, {
92
+ label: '企业名称',
93
+ value: item.signerCompany
94
+ }, {
95
+ label: '统一社会信用代码',
96
+ value: item.signerCertificateSno
97
+ });
98
+ }
99
+ _i = 0, _fields = fields;
100
+ case 2:
101
+ if (!(_i < _fields.length)) {
102
+ _context.next = 4;
103
+ break;
104
+ }
105
+ field = _fields[_i];
106
+ val = field.value;
107
+ if (!(val === undefined || val === null || val === '' || Array.isArray(val) && val.length === 0)) {
108
+ _context.next = 3;
109
+ break;
110
+ }
111
+ _message["default"].warning("\u7B7E\u7F72\u65B9" + (i + 1) + "\u7684\"" + field.label + "\"\u4E0D\u80FD\u4E3A\u7A7A");
112
+ return _context.abrupt("return");
113
+ case 3:
114
+ _i++;
115
+ _context.next = 2;
116
+ break;
117
+ case 4:
118
+ i++;
63
119
  _context.next = 1;
120
+ break;
121
+ case 5:
122
+ _context.next = 6;
64
123
  return saveSignerInfo({
65
124
  list: signerInfoList,
66
125
  file: file,
67
126
  materialName: materialName,
68
127
  date: getCurrentTime()
69
128
  });
70
- case 1:
129
+ case 6:
71
130
  saveRes = _context.sent;
72
131
  if (saveRes) {
73
132
  setUrl("https://zwfw.xzspglj.taiyuan.gov.cn/threeSign?draftNo=" + saveRes);
@@ -75,7 +134,7 @@ function SignerInfo(props) {
75
134
  } else {
76
135
  _message["default"].warning('信息保存失败,请重试');
77
136
  }
78
- case 2:
137
+ case 7:
79
138
  case "end":
80
139
  return _context.stop();
81
140
  }
@@ -127,7 +186,7 @@ function SignerInfo(props) {
127
186
  }
128
187
  }, [signerInfo]);
129
188
  (0, _react.useEffect)(function () {
130
- if (canvasRef.current) {
189
+ if (canvasRef.current && url) {
131
190
  var options = {
132
191
  width: 110,
133
192
  // 二维码的宽度
@@ -142,7 +201,7 @@ function SignerInfo(props) {
142
201
  };
143
202
  _qrcode["default"].toCanvas(canvasRef.current, url, options, function () {});
144
203
  }
145
- }, [url]);
204
+ }, [url, showQRcode]);
146
205
  return /*#__PURE__*/_react["default"].createElement("div", {
147
206
  className: "signer-info-mask"
148
207
  }, !showQRcode && /*#__PURE__*/_react["default"].createElement("div", {
@@ -21,6 +21,9 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
21
21
  // import SignPage from './sign';
22
22
  // import SealPage from './seal';
23
23
 
24
+ var SIGN = 1; // 签名
25
+ var SEAL = 2; // 签章
26
+
24
27
  var SignFile = function SignFile(_ref) {
25
28
  var file = _ref.file,
26
29
  userInfo = _ref.userInfo,
@@ -39,7 +42,8 @@ var SignFile = function SignFile(_ref) {
39
42
  fileType = file.fileType,
40
43
  signatureEnable = file.signatureEnable,
41
44
  signEnable = file.signEnable,
42
- guideImg = file.signGuidFileId;
45
+ guideImg = file.signGuidFileId,
46
+ signContent = file.signContent;
43
47
  var _useState = (0, _react.useState)(false),
44
48
  isShowSignPage = _useState[0],
45
49
  setIsShowSignPage = _useState[1];
@@ -296,6 +300,11 @@ var SignFile = function SignFile(_ref) {
296
300
 
297
301
  // 签章
298
302
  var seal = function seal() {
303
+ // 如果不需要签章 就直接去签字
304
+ if (!signContent.includes(SEAL)) {
305
+ sign();
306
+ return;
307
+ }
299
308
  console.log('fileType', fileType);
300
309
  var type = (0, _file2.getFileExtension)(fileName);
301
310
  if (type !== 'pdf') {
package/lib/style.js CHANGED
@@ -4,8 +4,8 @@ require('@alifd/next/lib/radio/style');
4
4
  require('@alifd/next/lib/checkbox/style');
5
5
  require('@alifd/next/lib/balloon/style');
6
6
  require('antd/lib/cascader/style');
7
- require('@alifd/next/lib/input/style');
8
7
  require('@alifd/next/lib/dialog/style');
8
+ require('@alifd/next/lib/input/style');
9
9
  require('@alifd/next/lib/loading/style');
10
10
  require('@alifd/next/lib/button/style');
11
11
  require('./index.scss');
@@ -245,6 +245,20 @@ const FileListMeta: IPublicTypeComponentMetadata = {
245
245
  "isRequired": true
246
246
  }
247
247
  },
248
+ {
249
+ "title": {
250
+ "label": {
251
+ "type": "i18n",
252
+ "en-US": "applySeal",
253
+ "zh-CN": "applySeal"
254
+ }
255
+ },
256
+ "name": "applySeal",
257
+ "setter": {
258
+ "componentName": "FunctionSetter",
259
+ "isRequired": false
260
+ }
261
+ },
248
262
  {
249
263
  "title": {
250
264
  "label": {
@@ -230,6 +230,19 @@ var FileListMeta = {
230
230
  "componentName": "FunctionSetter",
231
231
  "isRequired": true
232
232
  }
233
+ }, {
234
+ "title": {
235
+ "label": {
236
+ "type": "i18n",
237
+ "en-US": "applySeal",
238
+ "zh-CN": "applySeal"
239
+ }
240
+ },
241
+ "name": "applySeal",
242
+ "setter": {
243
+ "componentName": "FunctionSetter",
244
+ "isRequired": false
245
+ }
233
246
  }, {
234
247
  "title": {
235
248
  "label": {
@@ -97,7 +97,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
97
97
  packageName = 'ydb-components-material';
98
98
  }
99
99
  if (version === void 0) {
100
- version = '0.1.115';
100
+ version = '0.1.117';
101
101
  }
102
102
  if (basicLibraryVersion === void 0) {
103
103
  basicLibraryVersion = {
@@ -235,6 +235,19 @@ var FileListMeta = {
235
235
  "componentName": "FunctionSetter",
236
236
  "isRequired": true
237
237
  }
238
+ }, {
239
+ "title": {
240
+ "label": {
241
+ "type": "i18n",
242
+ "en-US": "applySeal",
243
+ "zh-CN": "applySeal"
244
+ }
245
+ },
246
+ "name": "applySeal",
247
+ "setter": {
248
+ "componentName": "FunctionSetter",
249
+ "isRequired": false
250
+ }
238
251
  }, {
239
252
  "title": {
240
253
  "label": {
@@ -102,7 +102,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
102
102
  packageName = 'ydb-components-material';
103
103
  }
104
104
  if (version === void 0) {
105
- version = '0.1.115';
105
+ version = '0.1.117';
106
106
  }
107
107
  if (basicLibraryVersion === void 0) {
108
108
  basicLibraryVersion = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-components-material",
3
- "version": "0.1.115",
3
+ "version": "0.1.117",
4
4
  "description": "ydb-components-material",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -101,10 +101,10 @@
101
101
  },
102
102
  "componentConfig": {
103
103
  "isComponentLibrary": true,
104
- "materialSchema": "https://unpkg.com/ydb-components-material@0.1.115/build/lowcode/assets-prod.json"
104
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.117/build/lowcode/assets-prod.json"
105
105
  },
106
106
  "lcMeta": {
107
107
  "type": "component"
108
108
  },
109
- "homepage": "https://unpkg.com/ydb-components-material@0.1.115/build/index.html"
109
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.117/build/index.html"
110
110
  }