ztxkui 4.0.1 → 4.0.3

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.
@@ -28,6 +28,7 @@ interface IProps {
28
28
  request: any;
29
29
  needSaveTemplate: boolean;
30
30
  batchDownloadZipName?: string;
31
+ docAttachMap: any;
31
32
  }
32
33
  declare const _default: React.NamedExoticComponent<IProps>;
33
34
  export default _default;
@@ -22,7 +22,7 @@ import CompareResult from './CompareResult';
22
22
  import { fileBatchDownload, preCanDownload, nextDownload, } from '../../../Upload/utils';
23
23
  var DetailTable = function (_a) {
24
24
  var _b;
25
- var needQj = _a.needQj, needQys = _a.needQys, records = _a.records, qunjSeal = _a.qunjSeal, electronicSeal = _a.electronicSealIdList, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, token = _a.token, viewSealPageFn = _a.viewSealPageFn, contractId = _a.contractId, electronicList = _a.electronicList, sealList = _a.sealList, querySealStatus = _a.querySealStatus, showContranctNum = _a.showContranctNum, request = _a.request, needSaveTemplate = _a.needSaveTemplate, batchDownloadZipName = _a.batchDownloadZipName;
25
+ var needQj = _a.needQj, needQys = _a.needQys, records = _a.records, qunjSeal = _a.qunjSeal, electronicSeal = _a.electronicSealIdList, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, token = _a.token, viewSealPageFn = _a.viewSealPageFn, contractId = _a.contractId, electronicList = _a.electronicList, sealList = _a.sealList, querySealStatus = _a.querySealStatus, showContranctNum = _a.showContranctNum, request = _a.request, needSaveTemplate = _a.needSaveTemplate, batchDownloadZipName = _a.batchDownloadZipName, docAttachMap = _a.docAttachMap;
26
26
  var authToken = token || '';
27
27
  var isOnlyQj = "" + ((_b = records === null || records === void 0 ? void 0 : records[0]) === null || _b === void 0 ? void 0 : _b.attachId) === '123456789';
28
28
  var selectRows = useRef(null);
@@ -267,9 +267,61 @@ var DetailTable = function (_a) {
267
267
  message.info('请选择需要下载的附件!');
268
268
  }
269
269
  };
270
+ /** 批量下载盖章件 */
271
+ var batchDownload = function () {
272
+ var list = selectRows.current;
273
+ if (Array.isArray(list) && list.length > 0) {
274
+ var qysAttachVOList = list.map(function (item) {
275
+ var _a;
276
+ var arr = ((_a = item === null || item === void 0 ? void 0 : item.fileName) === null || _a === void 0 ? void 0 : _a.split('.')) || [];
277
+ arr.splice(arr.length - 1, 1, 'pdf');
278
+ return {
279
+ fileName: arr.join('.'),
280
+ attachId: item.attachId,
281
+ };
282
+ });
283
+ var params = {
284
+ docAttachMap: docAttachMap,
285
+ qysAttachVOList: qysAttachVOList,
286
+ };
287
+ request({
288
+ method: 'POST',
289
+ url: '/api/zmdms-resource/seal/batch-download-seal-files',
290
+ responseType: 'blob',
291
+ data: params,
292
+ }).then(function (res) {
293
+ var _a, _b;
294
+ if (!((_a = res.headers) === null || _a === void 0 ? void 0 : _a['content-disposition'])) {
295
+ message.warning('没有可下载的内容');
296
+ return;
297
+ }
298
+ var fileName = res.headers['content-disposition'].split(';');
299
+ var fileNameArray = (_b = fileName[1]) === null || _b === void 0 ? void 0 : _b.split('=');
300
+ var fileNameStr = decodeURIComponent(fileNameArray[1]);
301
+ var blob = new Blob([res.data], {
302
+ type: 'application/vnd.ms-excel',
303
+ });
304
+ if (blob.size < 1) {
305
+ alert('下载失败,下载的内容为空!');
306
+ return;
307
+ }
308
+ var aLink = document.createElement('a');
309
+ aLink.style.display = 'none';
310
+ aLink.href = window.URL.createObjectURL(blob);
311
+ aLink.download = fileNameStr === null || fileNameStr === void 0 ? void 0 : fileNameStr.replaceAll('"', '');
312
+ document.body.appendChild(aLink);
313
+ aLink.click();
314
+ document.body.removeChild(aLink);
315
+ });
316
+ }
317
+ else {
318
+ message.info('请选择需要下载的盖章件!');
319
+ }
320
+ };
270
321
  return (React.createElement(React.Fragment, null,
271
322
  React.createElement("div", { style: { marginBottom: '10px' } },
272
- React.createElement(Button, { type: "primary", style: { marginRight: '10px' }, onClick: onAllDownloadHandle }, "\u6279\u91CF\u4E0B\u8F7D")),
323
+ React.createElement(Button, { type: "primary", style: { marginRight: '10px' }, onClick: onAllDownloadHandle }, "\u6279\u91CF\u4E0B\u8F7D\u539F\u4EF6"),
324
+ React.createElement(Button, { type: "primary", style: { marginRight: '10px' }, onClick: batchDownload }, "\u6279\u91CF\u4E0B\u8F7D\u76D6\u7AE0\u4EF6")),
273
325
  React.createElement(Table, { columns: columnsLast, rowKey: "attachId", dataSource: records, scroll: { x: 'max-content' }, rowSelection: myRowSelection })));
274
326
  };
275
327
  export default memo(DetailTable);
@@ -465,6 +465,7 @@ var Sinatures = function (_a) {
465
465
  })
466
466
  .catch(function (error) {
467
467
  var _a, _b;
468
+ resolve(false);
468
469
  message.error(((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || '请求失败!');
469
470
  });
470
471
  });
@@ -861,6 +862,9 @@ var Sinatures = function (_a) {
861
862
  function qunjSealChangeHandle(value) {
862
863
  var contractNum = value === null || value === void 0 ? void 0 : value.contranctNum;
863
864
  var totalSealNum = sumBy(value === null || value === void 0 ? void 0 : value.details, 'sealCount');
865
+ qunjSealChange && qunjSealChange(value);
866
+ setQunjSeal(value);
867
+ onSigValuesChange && onSigValuesChange(sigValuesChange('qunjSeal', value));
864
868
  if (typeof contractNum === 'number' && showContranctNum) {
865
869
  if (totalSealNum > contractNum * 4) {
866
870
  setIsTotalSealNumTooMore(true);
@@ -879,9 +883,6 @@ var Sinatures = function (_a) {
879
883
  return;
880
884
  }
881
885
  }
882
- qunjSealChange && qunjSealChange(value);
883
- setQunjSeal(value);
884
- onSigValuesChange && onSigValuesChange(sigValuesChange('qunjSeal', value));
885
886
  }
886
887
  /** 电子印章修改 */
887
888
  function electronicSealChangeHandle(value) {
@@ -1002,13 +1003,6 @@ var Sinatures = function (_a) {
1002
1003
  message.warning('请勾选加盖电子印章所需要的印章列表!');
1003
1004
  return [2 /*return*/, false];
1004
1005
  }
1005
- if (!(needQys &&
1006
- isEdit &&
1007
- hasElectronicSeal &&
1008
- (innerElectronicSeal === null || innerElectronicSeal === void 0 ? void 0 : innerElectronicSeal.length) > 0)) return [3 /*break*/, 2];
1009
- return [4 /*yield*/, getNoSealInfoList()];
1010
- case 1: return [2 /*return*/, _b.sent()];
1011
- case 2:
1012
1006
  // 超过4倍禁止提交审批
1013
1007
  if (isEdit && needQj && isTotalSealNumTooMore && showContranctNum) {
1014
1008
  message.warning('您的用印次数远超超过合理次数范围,请修改。');
@@ -1041,7 +1035,13 @@ var Sinatures = function (_a) {
1041
1035
  return [2 /*return*/, false];
1042
1036
  }
1043
1037
  }
1044
- return [2 /*return*/, true];
1038
+ if (!(needQys &&
1039
+ isEdit &&
1040
+ hasElectronicSeal &&
1041
+ (innerElectronicSeal === null || innerElectronicSeal === void 0 ? void 0 : innerElectronicSeal.length) > 0)) return [3 /*break*/, 2];
1042
+ return [4 /*yield*/, getNoSealInfoList()];
1043
+ case 1: return [2 /*return*/, _b.sent()];
1044
+ case 2: return [2 /*return*/, true];
1045
1045
  }
1046
1046
  });
1047
1047
  }); },
@@ -1063,6 +1063,7 @@ var Sinatures = function (_a) {
1063
1063
  showContranctNum: showContranctNum,
1064
1064
  request: request,
1065
1065
  needSaveTemplate: NEED_SAVE_TEMPLATE.includes("" + flowId),
1066
+ docAttachMap: attachMap,
1066
1067
  };
1067
1068
  return (React.createElement(React.Fragment, null,
1068
1069
  isEdit ? (React.createElement(Table, { columns: columnsLast, rowKey: "attachId", loading: tbloading, dataSource: records, scroll: { x: 'max-content' } })) : (React.createElement(DetailTable, __assign({}, detail, { batchDownloadZipName: batchDownloadZipName }))),
@@ -1073,7 +1074,7 @@ var Sinatures = function (_a) {
1073
1074
  checkSealFn('needReSeal');
1074
1075
  } }, needReSealList.length > 0 ? '指定签署位置' : '确定')) },
1075
1076
  React.createElement(Checkbox.Group, { defaultValue: unSealList.map(function (item) { return item.sealId; }), value: needReSealList, onChange: needReSealChange, className: "flex-checkbox-group" }, unSealList.map(function (item) {
1076
- return (React.createElement(Checkbox, { key: item.sealId, value: item.sealId }, item.sealName));
1077
+ return (React.createElement(Checkbox, { key: item.sealId, value: item.sealId, style: { width: '100%', margin: '0 8px' } }, item.sealName));
1077
1078
  })))));
1078
1079
  };
1079
1080
  export default Sinatures;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",