ztxkui 3.2.0 → 3.2.1

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.
@@ -21,7 +21,8 @@ var CompareResult = function (_a) {
21
21
  request({
22
22
  url: "/api/zmdms-resource/seal/query-compare-task/" + task_id_1,
23
23
  method: 'GET',
24
- }).then(function (res) {
24
+ })
25
+ .then(function (res) {
25
26
  if (res.status === 200 && res.data.code === 200) {
26
27
  var url = ZT_API_BASEURL + "/zmdms-resource/seal/download-compare-file/" + task_id_1 + "?Zmdms-Auth=" + token + "&fullfilename=1.zip";
27
28
  // 比对文件下载
@@ -30,6 +31,10 @@ var CompareResult = function (_a) {
30
31
  else {
31
32
  message.error(res.data.msg || '出错了');
32
33
  }
34
+ })
35
+ .catch(function (error) {
36
+ var _a, _b;
37
+ 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) || '请求失败!');
33
38
  });
34
39
  }
35
40
  else {
@@ -20,7 +20,8 @@ var ElectronicSeal = function (_a) {
20
20
  url: '/api/zmdms-resource/flowdeptseal/page',
21
21
  params: params,
22
22
  method: 'GET',
23
- }).then(function (res) {
23
+ })
24
+ .then(function (res) {
24
25
  var _a, _b;
25
26
  if (res.status === 200 && res.data.code === 200) {
26
27
  setElectronicList((_b = (_a = res.data.data) === null || _a === void 0 ? void 0 : _a.records[0]) === null || _b === void 0 ? void 0 : _b.sealInfoList);
@@ -28,6 +29,10 @@ var ElectronicSeal = function (_a) {
28
29
  else {
29
30
  message.error(res.data.msg || '出错了');
30
31
  }
32
+ })
33
+ .catch(function (error) {
34
+ var _a, _b;
35
+ 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) || '请求失败!');
31
36
  });
32
37
  }, [request, flowId, deptId]);
33
38
  return (React.createElement(Checkbox.Group, { defaultValue: value, onChange: onChange, className: "flex-checkbox-group", disabled: !isEdit }, Array.isArray(electronicList) &&
@@ -20,7 +20,8 @@ var QunjSeal = function (_a) {
20
20
  request({
21
21
  url: "/api/zmdms-resource/flowqjuse/query-qj-seal-list/" + flowId,
22
22
  method: 'GET',
23
- }).then(function (res) {
23
+ })
24
+ .then(function (res) {
24
25
  var _a;
25
26
  if (res.status === 200 && res.data.code === 200) {
26
27
  setSealList((_a = res.data.data) === null || _a === void 0 ? void 0 : _a.map(function (item, index) { return ({
@@ -31,6 +32,10 @@ var QunjSeal = function (_a) {
31
32
  else {
32
33
  message.error(res.data.msg || '出错了');
33
34
  }
35
+ })
36
+ .catch(function (error) {
37
+ var _a, _b;
38
+ 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) || '请求失败!');
34
39
  });
35
40
  }, [request, flowId]);
36
41
  useEffect(function () {
@@ -64,6 +69,6 @@ var QunjSeal = function (_a) {
64
69
  React.createElement(Radio, { value: 0 }, "\u5185\u90E8\u7528\u5370"),
65
70
  React.createElement(Radio, { value: 1 }, "\u5916\u90E8\u7528\u5370"))),
66
71
  React.createElement(Item, { name: "details", label: "", noBorder: true, width: "all", style: { height: '200px', overflowY: 'auto', overflowX: 'hidden' } },
67
- React.createElement(SealCheckboxGroup, { sealList: sealList, onChange: onSealCheckboxHandle, handleRef: handleRef }))))));
72
+ React.createElement(SealCheckboxGroup, { sealList: sealList, onChange: onSealCheckboxHandle, handleRef: handleRef, isEdit: isEdit }))))));
68
73
  };
69
74
  export default QunjSeal;
@@ -6,6 +6,7 @@ import React from 'react';
6
6
  interface IProps {
7
7
  name: string;
8
8
  id: string;
9
+ isEdit: boolean;
9
10
  value?: any;
10
11
  onChange?: any;
11
12
  }
@@ -20,6 +21,7 @@ interface ISealProps {
20
21
  sealCount: number;
21
22
  }[];
22
23
  handleRef?: any;
24
+ isEdit: boolean;
23
25
  }
24
26
  declare const SealCheckboxGroup: React.FC<ISealProps>;
25
27
  export { SealCheckboxGroup };
@@ -25,7 +25,7 @@ import sumBy from 'lodash/sumBy';
25
25
  import { Checkbox, InputNumber } from '../../../../index';
26
26
  import { message } from 'antd';
27
27
  var SealCheckbox = function (_a) {
28
- var name = _a.name, id = _a.id, value = _a.value, onChange = _a.onChange;
28
+ var name = _a.name, id = _a.id, value = _a.value, onChange = _a.onChange, isEdit = _a.isEdit;
29
29
  var onCheckboxChange = function (e) {
30
30
  onChange &&
31
31
  onChange(__assign(__assign({}, (value || {})), { sealName: e.target.checked ? name : null, sealNo: e.target.checked ? id : null }));
@@ -34,13 +34,13 @@ var SealCheckbox = function (_a) {
34
34
  onChange && onChange(__assign(__assign({}, (value || {})), { sealCount: sealCount }));
35
35
  };
36
36
  return (React.createElement("div", { style: { padding: '0 6px' } },
37
- React.createElement(Checkbox, { onChange: onCheckboxChange, checked: value && value.sealName ? true : false }, name),
37
+ React.createElement(Checkbox, { onChange: onCheckboxChange, checked: value && value.sealNo ? true : false, disabled: !isEdit }, name),
38
38
  React.createElement("div", null,
39
39
  React.createElement("span", null, "\u7528\u5370\u6B21\u6570\uFF1A"),
40
- React.createElement(InputNumber, { bordered: false, size: "small", value: value && value.sealCount ? value.sealCount : undefined, onChange: onNumberChange, style: { borderBottom: '1px solid #e9ecf3' } }))));
40
+ React.createElement(InputNumber, { bordered: false, disabled: !isEdit, size: "small", value: value && value.sealCount ? value.sealCount : undefined, onChange: onNumberChange, style: { borderBottom: '1px solid #e9ecf3' } }))));
41
41
  };
42
42
  var SealCheckboxGroup = function (_a) {
43
- var value = _a.value, onChange = _a.onChange, sealList = _a.sealList, handleRef = _a.handleRef;
43
+ var value = _a.value, onChange = _a.onChange, sealList = _a.sealList, handleRef = _a.handleRef, isEdit = _a.isEdit;
44
44
  var onChangeHandle = function (_value, index) {
45
45
  var _a, _b;
46
46
  var contractNum = (_b = (_a = handleRef === null || handleRef === void 0 ? void 0 : handleRef.current) === null || _a === void 0 ? void 0 : _a.getData().qunjSeal) === null || _b === void 0 ? void 0 : _b.contranctNum;
@@ -65,9 +65,9 @@ var SealCheckboxGroup = function (_a) {
65
65
  sealList.map(function (item, index) {
66
66
  var itemValue = {};
67
67
  if (Array.isArray(value)) {
68
- itemValue = value.find(function (valueItem) { return valueItem.sealName === item.sealName; });
68
+ itemValue = value.find(function (valueItem) { return valueItem.sealNo === item.sealNo; });
69
69
  }
70
- return (React.createElement(SealCheckbox, { key: item === null || item === void 0 ? void 0 : item.sealNo, name: item === null || item === void 0 ? void 0 : item.sealName, id: item === null || item === void 0 ? void 0 : item.sealNo, value: itemValue, onChange: function (value) {
70
+ return (React.createElement(SealCheckbox, { key: item === null || item === void 0 ? void 0 : item.sealNo, name: item === null || item === void 0 ? void 0 : item.sealName, id: item === null || item === void 0 ? void 0 : item.sealNo, value: itemValue, isEdit: isEdit, onChange: function (value) {
71
71
  onChangeHandle(value, index);
72
72
  } }));
73
73
  })));
@@ -27,7 +27,8 @@ var TemplateAttach = function (_a) {
27
27
  request({
28
28
  url: "/api/zmdms-resource/seal/create-compare-task/" + params.leftAttachId + "/" + params.rightAttachId,
29
29
  method: 'GET',
30
- }).then(function (res) {
30
+ })
31
+ .then(function (res) {
31
32
  var _a;
32
33
  if (res.status === 200 && res.data.code === 200) {
33
34
  getTaskId((_a = res.data.data) === null || _a === void 0 ? void 0 : _a.taskId, index);
@@ -36,6 +37,10 @@ var TemplateAttach = function (_a) {
36
37
  else {
37
38
  message.error(res.data.msg || '出错了');
38
39
  }
40
+ })
41
+ .catch(function (error) {
42
+ var _a, _b;
43
+ 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) || '请求失败!');
39
44
  });
40
45
  }
41
46
  catch (err) {
@@ -18,7 +18,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
18
18
  * @author 陈亚雄
19
19
  * @description 电子签章组件
20
20
  */
21
- import React, { useImperativeHandle, useCallback, useState, useMemo, } from 'react';
21
+ import React, { useImperativeHandle, useCallback, useState, useMemo, useEffect, } from 'react';
22
22
  // redux
23
23
  // ztxkui公共组件
24
24
  import { Table, Upload, message, Checkbox, Button } from '../../../index';
@@ -37,7 +37,7 @@ import { useRecords, useQunjData, useElectronicData } from './hooks';
37
37
  * 实现受控,接收一个附件列表
38
38
  */
39
39
  var Sinatures = function (_a) {
40
- var needQj = _a.needQj, needDg = _a.needDg, needQys = _a.needQys, isUpload = _a.isUpload, fileList = _a.fileList, qunjSeal = _a.qunjSeal, qunjSealChange = _a.qunjSealChange, electronicSeal = _a.electronicSeal, electronicSealChange = _a.electronicSealChange, handleRef = _a.handleRef, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, systemCode = _a.systemCode, token = _a.token, openCustomerModalHandle = _a.openCustomerModalHandle, request = _a.request, flowId = _a.flowId, deptId = _a.deptId, canEdit = _a.canEdit, caseId = _a.caseId, contract_id = _a.contractId, docAttachMap = _a.docAttachMap, checkAttachIdList = _a.checkAttachIdList, // 已盖章附件id
40
+ var needQj = _a.needQj, needDg = _a.needDg, needQys = _a.needQys, isUpload = _a.isUpload, fileList = _a.fileList, qunjSeal = _a.qunjSeal, qunjSealChange = _a.qunjSealChange, electronicSeal = _a.electronicSealIdList, electronicSealChange = _a.electronicSealChange, handleRef = _a.handleRef, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, systemCode = _a.systemCode, token = _a.token, openCustomerModalHandle = _a.openCustomerModalHandle, request = _a.request, flowId = _a.flowId, deptId = _a.deptId, canEdit = _a.canEdit, caseId = _a.caseId, contract_id = _a.contractId, docAttachMap = _a.docAttachMap, checkAttachIdList = _a.checkAttachIdList, // 已盖章附件id
41
41
  documentIdList = _a.documentIdList;
42
42
  var authToken = token || '';
43
43
  // 是否可编辑 1可编辑 0不可编辑
@@ -51,12 +51,7 @@ var Sinatures = function (_a) {
51
51
  // 组件内部管理的电子印章数据
52
52
  var _d = useElectronicData(electronicSeal), innerElectronicSeal = _d.electronicSeal, setElectronicSeal = _d.setElectronicSeal;
53
53
  // 设置确认盖章按钮是否展示
54
- var _e = useState(function () {
55
- return Array.isArray(fileList) &&
56
- fileList.filter(function (item) { return item.isElectronicSeal; }).length > 0
57
- ? true
58
- : false;
59
- }), checkSealVisible = _e[0], setCheckSealVisible = _e[1];
54
+ var _e = useState(false), checkSealVisible = _e[0], setCheckSealVisible = _e[1];
60
55
  // 合同id
61
56
  var _f = useState(contract_id), contractId = _f[0], setContractId = _f[1];
62
57
  // 已盖章附件id
@@ -65,6 +60,13 @@ var Sinatures = function (_a) {
65
60
  var _h = useState(docAttachMap), attachMap = _h[0], setAttachMap = _h[1];
66
61
  // 文档id列表
67
62
  var _j = useState(documentIdList), documentIds = _j[0], setDocumentIds = _j[1];
63
+ useEffect(function () {
64
+ // 判断入参fileList中是否有已勾选电子印章的元素
65
+ if (Array.isArray(fileList) &&
66
+ fileList.filter(function (item) { return item.isElectronicSeal; }).length > 0) {
67
+ setCheckSealVisible(true);
68
+ }
69
+ }, [fileList]);
68
70
  /** 获取taskId */
69
71
  var getTaskId = function (id, index) {
70
72
  handleRef.current.setTemplateData({
@@ -110,7 +112,8 @@ var Sinatures = function (_a) {
110
112
  url: '/api/zmdms-resource/seal/confirm-seal-info',
111
113
  method: 'POST',
112
114
  data: params,
113
- }).then(function (res) {
115
+ })
116
+ .then(function (res) {
114
117
  if (res.status === 200 &&
115
118
  res.data.code === 200 &&
116
119
  res.data.data.preSignUrl) {
@@ -128,6 +131,10 @@ var Sinatures = function (_a) {
128
131
  else {
129
132
  message.error(res.data.msg || '出错了');
130
133
  }
134
+ })
135
+ .catch(function (error) {
136
+ var _a, _b;
137
+ 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) || '请求失败!');
131
138
  });
132
139
  };
133
140
  /** 查看盖章页面 */
@@ -137,7 +144,8 @@ var Sinatures = function (_a) {
137
144
  url: '/api/zmdms-resource/seal/view-seal-state',
138
145
  data: { contractId: contractId || contract_id },
139
146
  method: 'POST',
140
- }).then(function (res) {
147
+ })
148
+ .then(function (res) {
141
149
  if (res.status === 200 &&
142
150
  res.data.code === 200 &&
143
151
  res.data.data.viewUrl) {
@@ -146,6 +154,10 @@ var Sinatures = function (_a) {
146
154
  else {
147
155
  message.error(res.data.msg || '出错了');
148
156
  }
157
+ })
158
+ .catch(function (error) {
159
+ var _a, _b;
160
+ 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) || '请求失败!');
149
161
  });
150
162
  }
151
163
  else {
@@ -35,7 +35,7 @@ export interface IProps {
35
35
  /** 群杰印章修改事件 */
36
36
  qunjSealChange?: any;
37
37
  /** 已选中的电子印章列表 */
38
- electronicSeal?: any[];
38
+ electronicSealIdList?: any[];
39
39
  /** 电子印章修改事件 */
40
40
  electronicSealChange?: any;
41
41
  /** 组件暴露给外部得方法 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",