ydb-components-material 0.1.116 → 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 (35) 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.bb5b2f46.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 +1 -1
  17. package/dist/BizComps.js.map +1 -1
  18. package/es/components/file-list/item.d.ts +1 -0
  19. package/es/components/file-list/item.js +19 -6
  20. package/es/components/file-list/seal.js +3 -1
  21. package/es/components/file-list/sealUtil.js +38 -17
  22. package/es/components/file-list/signerInfo.js +62 -3
  23. package/es/components/sign-file/index.js +10 -1
  24. package/lib/components/file-list/item.d.ts +1 -0
  25. package/lib/components/file-list/item.js +19 -6
  26. package/lib/components/file-list/seal.js +3 -1
  27. package/lib/components/file-list/sealUtil.js +40 -17
  28. package/lib/components/file-list/signerInfo.js +62 -3
  29. package/lib/components/sign-file/index.js +10 -1
  30. package/lowcode/file-list/meta.ts +14 -0
  31. package/lowcode_es/file-list/meta.js +13 -0
  32. package/lowcode_es/meta.js +1 -1
  33. package/lowcode_lib/file-list/meta.js +13 -0
  34. package/lowcode_lib/meta.js +1 -1
  35. package/package.json +3 -3
@@ -20,6 +20,7 @@ export interface FileItemProps {
20
20
  style?: object;
21
21
  signerInfo?: object;
22
22
  openLoading: () => void;
23
+ applySeal: () => void;
23
24
  closeLoading: () => void;
24
25
  valChange: (value: any, fileIndex: any, index: any, subIndex: any) => void;
25
26
  download: (value: any) => void;
@@ -74,7 +74,10 @@ var FileItem = function FileItem(_ref) {
74
74
  _fileConfig$signSelfR = fileConfig.signSelfRole,
75
75
  signSelfRole = _fileConfig$signSelfR === void 0 ? [] : _fileConfig$signSelfR,
76
76
  _fileConfig$signAgent = fileConfig.signAgentRole,
77
- signAgentRole = _fileConfig$signAgent === void 0 ? [] : _fileConfig$signAgent;
77
+ signAgentRole = _fileConfig$signAgent === void 0 ? [] : _fileConfig$signAgent,
78
+ sealKeywords = fileConfig.sealKeywords,
79
+ sealPosition = fileConfig.sealPosition,
80
+ sealContent = fileConfig.sealContent;
78
81
 
79
82
  // 解构默认值只对 undefined 生效,对 null 无效,手动兜底
80
83
  var safeSignatureSelfRole = signatureSelfRole !== null && signatureSelfRole !== void 0 ? signatureSelfRole : [];
@@ -144,6 +147,9 @@ var FileItem = function FileItem(_ref) {
144
147
  var _useState16 = useState(false),
145
148
  showSignerInfo = _useState16[0],
146
149
  setShowSignerInfo = _useState16[1];
150
+ var _useState17 = useState(true),
151
+ showSignPageClose = _useState17[0],
152
+ setShowSignPageClose = _useState17[1];
147
153
  var upload = function upload() {
148
154
  if (disabled) return;
149
155
  var inputEl = document.createElement('input');
@@ -370,12 +376,12 @@ var FileItem = function FileItem(_ref) {
370
376
  _Dialog.confirm({
371
377
  title: '提示',
372
378
  footerAlign: 'center',
373
- content: '检测到您已有电子印章,是否使用电子印章签署?',
379
+ content: '本份材料可豁免签章流程,完成电子签名即可,是否确认跳过签章?',
374
380
  okProps: {
375
- children: '签署'
381
+ children: '继续签章'
376
382
  },
377
383
  cancelProps: {
378
- children: '跳过'
384
+ children: '跳过签章'
379
385
  },
380
386
  onOk: function onOk() {
381
387
  setIsShowSealPage(true);
@@ -458,6 +464,7 @@ var FileItem = function FileItem(_ref) {
458
464
  // 如果还允许签批 就连住一起做了
459
465
  if (signatureEnable) {
460
466
  setSealedFile(val);
467
+ setShowSignPageClose(false); // 签章完之后就不展示签批页面的关闭按钮了。防止用户误点击退出去
461
468
  sign();
462
469
  } else {
463
470
  valChange(val, fileIndex, index, subIndex);
@@ -937,7 +944,8 @@ var FileItem = function FileItem(_ref) {
937
944
  handleClose: function handleClose() {
938
945
  return setIsShowSignPage(false);
939
946
  },
940
- closeLoading: closeLoading
947
+ closeLoading: closeLoading,
948
+ showClose: showSignPageClose
941
949
  }), isShowSealPage && /*#__PURE__*/React.createElement(SealPage, {
942
950
  isShowSealPage: isShowSealPage,
943
951
  userInfo: userInfo,
@@ -952,7 +960,12 @@ var FileItem = function FileItem(_ref) {
952
960
  handleClose: function handleClose() {
953
961
  return setIsShowSealPage(false);
954
962
  },
955
- closeLoading: closeLoading
963
+ closeLoading: closeLoading,
964
+ sealConfig: {
965
+ sealKeywords: sealKeywords,
966
+ sealPosition: sealPosition,
967
+ sealContent: sealContent
968
+ }
956
969
  }), isShowPreview && /*#__PURE__*/React.createElement("div", {
957
970
  className: "preview"
958
971
  }, /*#__PURE__*/React.createElement("img", {
@@ -18,6 +18,8 @@ function SealPage(props) {
18
18
  isPC = props.isPC,
19
19
  accessToken = props.accessToken,
20
20
  closeLoading = props.closeLoading,
21
+ _props$sealConfig = props.sealConfig,
22
+ sealConfig = _props$sealConfig === void 0 ? {} : _props$sealConfig,
21
23
  _props$showClose = props.showClose,
22
24
  showClose = _props$showClose === void 0 ? true : _props$showClose;
23
25
  var _useState = useState(''),
@@ -43,7 +45,7 @@ function SealPage(props) {
43
45
  }
44
46
  // 传递配置参数给工具函数
45
47
  _context.next = 1;
46
- return initSealPageMethod(fileObj, userInfo, {
48
+ return initSealPageMethod(fileObj, userInfo, sealConfig, {
47
49
  tokenTY: tokenTY,
48
50
  baseUrl: baseUrl,
49
51
  env: env,
@@ -5,15 +5,17 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
  import { getBlob, upload } from "./file.js";
6
6
  import { qrySealApi, getSealUrlApi, getSignOrderIdApi, getPcSealUrlApi } from "../../api.js";
7
7
  // const userInfo = uni.getStorageSync('userInfo')
8
+ var SEAL_TYPE = '法人名章';
9
+ var SEAL_POSITION = '关键字印章';
8
10
 
9
11
  // 对外的方法 获取电子签章的页面地址
10
- export function initSealPageMethod(_x, _x2, _x3) {
12
+ export function initSealPageMethod(_x, _x2, _x3, _x4) {
11
13
  return _initSealPageMethod.apply(this, arguments);
12
14
  }
13
15
 
14
16
  // [第 1 步] 查询当前用户是否有电子签章
15
17
  function _initSealPageMethod() {
16
- _initSealPageMethod = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileObj, userInfo, config) {
18
+ _initSealPageMethod = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileObj, userInfo, sealConfig, config) {
17
19
  var fileName, sealList, fileUrl, orderId, pageUrl, params;
18
20
  return _regeneratorRuntime.wrap(function (_context) {
19
21
  while (1) switch (_context.prev = _context.next) {
@@ -38,7 +40,7 @@ function _initSealPageMethod() {
38
40
  return _context.abrupt("return", false);
39
41
  case 3:
40
42
  _context.next = 4;
41
- return getSignOrderId(sealList, fileObj, fileUrl, userInfo, config);
43
+ return getSignOrderId(sealList, fileObj, fileUrl, userInfo, sealConfig, config);
42
44
  case 4:
43
45
  orderId = _context.sent;
44
46
  console.log('orderId---', orderId);
@@ -91,7 +93,7 @@ export function querySeal(userInfo, config) {
91
93
  }
92
94
 
93
95
  // [第 2 步] 上传文件
94
- function uploadSealFile(_x4, _x5) {
96
+ function uploadSealFile(_x5, _x6) {
95
97
  return _uploadSealFile.apply(this, arguments);
96
98
  } // [第 3 步] 获取电子印章页面
97
99
  function _uploadSealFile() {
@@ -137,32 +139,51 @@ function _uploadSealFile() {
137
139
  }));
138
140
  return _uploadSealFile.apply(this, arguments);
139
141
  }
140
- function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo, config) {
142
+ function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo, sealConfig, config) {
141
143
  // uni.showLoading({ title: '获取签章页面中' })
142
144
  console.log('sealList', sealList, fileObj, esusFileUrl, userInfo);
143
145
  var fileId = fileObj.fileId,
144
146
  fileName = fileObj.fileName;
145
147
  // 循环签章列表 - 开始
146
148
  var apiSignDtosArr = [];
147
- sealList.forEach(function (sealItem, sealIndex) {
149
+ // 当前用户有法人名章
150
+ var legalSeal = sealList.find(function (item) {
151
+ return item.sealTypeName === SEAL_TYPE;
152
+ });
153
+ // 如果设置的有关键字签章
154
+ if (sealConfig.sealKeywords && sealConfig.sealPosition === SEAL_POSITION && sealConfig.sealContent === SEAL_TYPE && legalSeal) {
148
155
  apiSignDtosArr.push({
149
156
  deviceType: 3,
150
157
  // 签章类型 (默认 3)
151
- signType: 0,
158
+ signType: 3,
152
159
  // 签章方式 (0 - 自由签章 or 定位签章 2 - 关键字签章 3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
153
- sealCode: sealItem.sealCode,
160
+ sealCode: legalSeal.sealCode,
154
161
  // 印章编码
155
- signatories: [
156
- // 定位签章参数
157
- {
158
- pageIndex: sealIndex,
159
- // 签章所在页码
160
- x: 0.00,
161
- // 位置横坐标 支持百分比坐标<1,百分比。>1,pdf 磅,ofd 毫米
162
- y: 0.00 // 位置纵坐标
162
+ keyWordParam: [{
163
+ keyWord: sealConfig.sealKeywords
163
164
  }]
164
165
  });
165
- });
166
+ } else {
167
+ sealList.forEach(function (sealItem, sealIndex) {
168
+ apiSignDtosArr.push({
169
+ deviceType: 3,
170
+ // 签章类型 (默认 3)
171
+ signType: 0,
172
+ // 签章方式 (0 - 自由签章 or 定位签章 2 - 关键字签章 3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
173
+ sealCode: sealItem.sealCode,
174
+ // 印章编码
175
+ signatories: [
176
+ // 定位签章参数
177
+ {
178
+ pageIndex: sealIndex,
179
+ // 签章所在页码
180
+ x: 0.00,
181
+ // 位置横坐标 支持百分比坐标<1,百分比。>1,pdf 磅,ofd 毫米
182
+ y: 0.00 // 位置纵坐标
183
+ }]
184
+ });
185
+ });
186
+ }
166
187
  var params = {
167
188
  deptCode: userInfo.certificateSno,
168
189
  // 单位统一社会信用代码
@@ -50,18 +50,77 @@ function SignerInfo(props) {
50
50
  };
51
51
  var next = /*#__PURE__*/function () {
52
52
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
53
- var saveRes;
53
+ var i, item, fields, _i, _fields, field, val, saveRes;
54
54
  return _regeneratorRuntime.wrap(function (_context) {
55
55
  while (1) switch (_context.prev = _context.next) {
56
56
  case 0:
57
+ i = 0;
58
+ case 1:
59
+ if (!(i < signerInfoList.length)) {
60
+ _context.next = 5;
61
+ break;
62
+ }
63
+ item = signerInfoList[i];
64
+ fields = [{
65
+ label: '签署内容',
66
+ value: item.signContent
67
+ }];
68
+ if (item.signType === 0) {
69
+ // 个人:姓名、身份证号、手机号、签署内容
70
+ fields.push({
71
+ label: '姓名',
72
+ value: item.signerName
73
+ }, {
74
+ label: '身份证号',
75
+ value: item.signerCerNo
76
+ }, {
77
+ label: '手机号',
78
+ value: item.signerPhoneNum
79
+ });
80
+ } else {
81
+ // 企业:手机号、企业名称、统一社会信用代码、签署内容
82
+ fields.push({
83
+ label: '手机号',
84
+ value: item.signerPhoneNum
85
+ }, {
86
+ label: '企业名称',
87
+ value: item.signerCompany
88
+ }, {
89
+ label: '统一社会信用代码',
90
+ value: item.signerCertificateSno
91
+ });
92
+ }
93
+ _i = 0, _fields = fields;
94
+ case 2:
95
+ if (!(_i < _fields.length)) {
96
+ _context.next = 4;
97
+ break;
98
+ }
99
+ field = _fields[_i];
100
+ val = field.value;
101
+ if (!(val === undefined || val === null || val === '' || Array.isArray(val) && val.length === 0)) {
102
+ _context.next = 3;
103
+ break;
104
+ }
105
+ _Message.warning("\u7B7E\u7F72\u65B9" + (i + 1) + "\u7684\"" + field.label + "\"\u4E0D\u80FD\u4E3A\u7A7A");
106
+ return _context.abrupt("return");
107
+ case 3:
108
+ _i++;
109
+ _context.next = 2;
110
+ break;
111
+ case 4:
112
+ i++;
57
113
  _context.next = 1;
114
+ break;
115
+ case 5:
116
+ _context.next = 6;
58
117
  return saveSignerInfo({
59
118
  list: signerInfoList,
60
119
  file: file,
61
120
  materialName: materialName,
62
121
  date: getCurrentTime()
63
122
  });
64
- case 1:
123
+ case 6:
65
124
  saveRes = _context.sent;
66
125
  if (saveRes) {
67
126
  setUrl("https://zwfw.xzspglj.taiyuan.gov.cn/threeSign?draftNo=" + saveRes);
@@ -69,7 +128,7 @@ function SignerInfo(props) {
69
128
  } else {
70
129
  _Message.warning('信息保存失败,请重试');
71
130
  }
72
- case 2:
131
+ case 7:
73
132
  case "end":
74
133
  return _context.stop();
75
134
  }
@@ -14,6 +14,9 @@ import SealPage from "../file-list/seal";
14
14
  import { getGuideImg, getUrlById, onlinePreview } from "../../api";
15
15
  import { getFileExtension } from "./file.js";
16
16
  import "./index.scss";
17
+ var SIGN = 1; // 签名
18
+ var SEAL = 2; // 签章
19
+
17
20
  var SignFile = function SignFile(_ref) {
18
21
  var file = _ref.file,
19
22
  userInfo = _ref.userInfo,
@@ -32,7 +35,8 @@ var SignFile = function SignFile(_ref) {
32
35
  fileType = file.fileType,
33
36
  signatureEnable = file.signatureEnable,
34
37
  signEnable = file.signEnable,
35
- guideImg = file.signGuidFileId;
38
+ guideImg = file.signGuidFileId,
39
+ signContent = file.signContent;
36
40
  var _useState = useState(false),
37
41
  isShowSignPage = _useState[0],
38
42
  setIsShowSignPage = _useState[1];
@@ -289,6 +293,11 @@ var SignFile = function SignFile(_ref) {
289
293
 
290
294
  // 签章
291
295
  var seal = function seal() {
296
+ // 如果不需要签章 就直接去签字
297
+ if (!signContent.includes(SEAL)) {
298
+ sign();
299
+ return;
300
+ }
292
301
  console.log('fileType', fileType);
293
302
  var type = getFileExtension(fileName);
294
303
  if (type !== 'pdf') {
@@ -20,6 +20,7 @@ export interface FileItemProps {
20
20
  style?: object;
21
21
  signerInfo?: object;
22
22
  openLoading: () => void;
23
+ applySeal: () => void;
23
24
  closeLoading: () => void;
24
25
  valChange: (value: any, fileIndex: any, index: any, subIndex: any) => void;
25
26
  download: (value: any) => void;
@@ -80,7 +80,10 @@ var FileItem = function FileItem(_ref) {
80
80
  _fileConfig$signSelfR = fileConfig.signSelfRole,
81
81
  signSelfRole = _fileConfig$signSelfR === void 0 ? [] : _fileConfig$signSelfR,
82
82
  _fileConfig$signAgent = fileConfig.signAgentRole,
83
- signAgentRole = _fileConfig$signAgent === void 0 ? [] : _fileConfig$signAgent;
83
+ signAgentRole = _fileConfig$signAgent === void 0 ? [] : _fileConfig$signAgent,
84
+ sealKeywords = fileConfig.sealKeywords,
85
+ sealPosition = fileConfig.sealPosition,
86
+ sealContent = fileConfig.sealContent;
84
87
 
85
88
  // 解构默认值只对 undefined 生效,对 null 无效,手动兜底
86
89
  var safeSignatureSelfRole = signatureSelfRole !== null && signatureSelfRole !== void 0 ? signatureSelfRole : [];
@@ -150,6 +153,9 @@ var FileItem = function FileItem(_ref) {
150
153
  var _useState16 = (0, _react.useState)(false),
151
154
  showSignerInfo = _useState16[0],
152
155
  setShowSignerInfo = _useState16[1];
156
+ var _useState17 = (0, _react.useState)(true),
157
+ showSignPageClose = _useState17[0],
158
+ setShowSignPageClose = _useState17[1];
153
159
  var upload = function upload() {
154
160
  if (disabled) return;
155
161
  var inputEl = document.createElement('input');
@@ -376,12 +382,12 @@ var FileItem = function FileItem(_ref) {
376
382
  _dialog["default"].confirm({
377
383
  title: '提示',
378
384
  footerAlign: 'center',
379
- content: '检测到您已有电子印章,是否使用电子印章签署?',
385
+ content: '本份材料可豁免签章流程,完成电子签名即可,是否确认跳过签章?',
380
386
  okProps: {
381
- children: '签署'
387
+ children: '继续签章'
382
388
  },
383
389
  cancelProps: {
384
- children: '跳过'
390
+ children: '跳过签章'
385
391
  },
386
392
  onOk: function onOk() {
387
393
  setIsShowSealPage(true);
@@ -464,6 +470,7 @@ var FileItem = function FileItem(_ref) {
464
470
  // 如果还允许签批 就连住一起做了
465
471
  if (signatureEnable) {
466
472
  setSealedFile(val);
473
+ setShowSignPageClose(false); // 签章完之后就不展示签批页面的关闭按钮了。防止用户误点击退出去
467
474
  sign();
468
475
  } else {
469
476
  valChange(val, fileIndex, index, subIndex);
@@ -943,7 +950,8 @@ var FileItem = function FileItem(_ref) {
943
950
  handleClose: function handleClose() {
944
951
  return setIsShowSignPage(false);
945
952
  },
946
- closeLoading: closeLoading
953
+ closeLoading: closeLoading,
954
+ showClose: showSignPageClose
947
955
  }), isShowSealPage && /*#__PURE__*/_react["default"].createElement(_seal["default"], {
948
956
  isShowSealPage: isShowSealPage,
949
957
  userInfo: userInfo,
@@ -958,7 +966,12 @@ var FileItem = function FileItem(_ref) {
958
966
  handleClose: function handleClose() {
959
967
  return setIsShowSealPage(false);
960
968
  },
961
- closeLoading: closeLoading
969
+ closeLoading: closeLoading,
970
+ sealConfig: {
971
+ sealKeywords: sealKeywords,
972
+ sealPosition: sealPosition,
973
+ sealContent: sealContent
974
+ }
962
975
  }), isShowPreview && /*#__PURE__*/_react["default"].createElement("div", {
963
976
  className: "preview"
964
977
  }, /*#__PURE__*/_react["default"].createElement("img", {
@@ -24,6 +24,8 @@ function SealPage(props) {
24
24
  isPC = props.isPC,
25
25
  accessToken = props.accessToken,
26
26
  closeLoading = props.closeLoading,
27
+ _props$sealConfig = props.sealConfig,
28
+ sealConfig = _props$sealConfig === void 0 ? {} : _props$sealConfig,
27
29
  _props$showClose = props.showClose,
28
30
  showClose = _props$showClose === void 0 ? true : _props$showClose;
29
31
  var _useState = (0, _react.useState)(''),
@@ -49,7 +51,7 @@ function SealPage(props) {
49
51
  }
50
52
  // 传递配置参数给工具函数
51
53
  _context.next = 1;
52
- return (0, _sealUtil.initSealPageMethod)(fileObj, userInfo, {
54
+ return (0, _sealUtil.initSealPageMethod)(fileObj, userInfo, sealConfig, {
53
55
  tokenTY: tokenTY,
54
56
  baseUrl: baseUrl,
55
57
  env: env,
@@ -10,13 +10,17 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
10
10
  var _file = require("./file.js");
11
11
  var _api = require("../../api.js");
12
12
  // import apiConfig from '@/config/api.cofig'
13
+
13
14
  // const userInfo = uni.getStorageSync('userInfo')
15
+ var SEAL_TYPE = '法人名章';
16
+ var SEAL_POSITION = '关键字印章';
17
+
14
18
  // 对外的方法 获取电子签章的页面地址
15
- function initSealPageMethod(_x, _x2, _x3) {
19
+ function initSealPageMethod(_x, _x2, _x3, _x4) {
16
20
  return _initSealPageMethod.apply(this, arguments);
17
21
  } // [第 1 步] 查询当前用户是否有电子签章
18
22
  function _initSealPageMethod() {
19
- _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) {
20
24
  var fileName, sealList, fileUrl, orderId, pageUrl, params;
21
25
  return _regenerator["default"].wrap(function (_context) {
22
26
  while (1) switch (_context.prev = _context.next) {
@@ -41,7 +45,7 @@ function _initSealPageMethod() {
41
45
  return _context.abrupt("return", false);
42
46
  case 3:
43
47
  _context.next = 4;
44
- return getSignOrderId(sealList, fileObj, fileUrl, userInfo, config);
48
+ return getSignOrderId(sealList, fileObj, fileUrl, userInfo, sealConfig, config);
45
49
  case 4:
46
50
  orderId = _context.sent;
47
51
  console.log('orderId---', orderId);
@@ -94,7 +98,7 @@ function querySeal(userInfo, config) {
94
98
  }
95
99
 
96
100
  // [第 2 步] 上传文件
97
- function uploadSealFile(_x4, _x5) {
101
+ function uploadSealFile(_x5, _x6) {
98
102
  return _uploadSealFile.apply(this, arguments);
99
103
  } // [第 3 步] 获取电子印章页面
100
104
  function _uploadSealFile() {
@@ -140,32 +144,51 @@ function _uploadSealFile() {
140
144
  }));
141
145
  return _uploadSealFile.apply(this, arguments);
142
146
  }
143
- function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo, config) {
147
+ function getSignOrderId(sealList, fileObj, esusFileUrl, userInfo, sealConfig, config) {
144
148
  // uni.showLoading({ title: '获取签章页面中' })
145
149
  console.log('sealList', sealList, fileObj, esusFileUrl, userInfo);
146
150
  var fileId = fileObj.fileId,
147
151
  fileName = fileObj.fileName;
148
152
  // 循环签章列表 - 开始
149
153
  var apiSignDtosArr = [];
150
- 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) {
151
160
  apiSignDtosArr.push({
152
161
  deviceType: 3,
153
162
  // 签章类型 (默认 3)
154
- signType: 0,
163
+ signType: 3,
155
164
  // 签章方式 (0 - 自由签章 or 定位签章 2 - 关键字签章 3 - 骑缝签章,一次只能有个一个类型,多个请写多组)
156
- sealCode: sealItem.sealCode,
165
+ sealCode: legalSeal.sealCode,
157
166
  // 印章编码
158
- signatories: [
159
- // 定位签章参数
160
- {
161
- pageIndex: sealIndex,
162
- // 签章所在页码
163
- x: 0.00,
164
- // 位置横坐标 支持百分比坐标<1,百分比。>1,pdf 磅,ofd 毫米
165
- y: 0.00 // 位置纵坐标
167
+ keyWordParam: [{
168
+ keyWord: sealConfig.sealKeywords
166
169
  }]
167
170
  });
168
- });
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
+ }
169
192
  var params = {
170
193
  deptCode: userInfo.certificateSno,
171
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
  }
@@ -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') {
@@ -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": {