ztxkui 3.5.1 → 3.5.2

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.
@@ -39,7 +39,7 @@ import Upload from 'components/Upload';
39
39
  import { useState, useEffect, useCallback, useRef } from 'react';
40
40
  import { UploadSingle } from './index';
41
41
  var originFileList = [];
42
- var token = "bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJtZW1iZXJfdHlwZSI6MSwiaGFuZGxlX2hyX3Bob25lIjpudWxsLCJyZXN1bWVfZGF0ZSI6bnVsbCwidXNlcl9uYW1lIjoiY2hlbnl4IiwiZW1wX25hbWUiOm51bGwsImVtcF9udW1iZXIiOm51bGwsImltdF9pZCI6bnVsbCwicmVhbF9uYW1lIjoi6ZmI5Lqa6ZuEIiwiY2xpZW50X3R5cGUiOiJ3ZWIiLCJkYXRhX3JvbGVfaWQiOiIxMzQzNDkwNjg2MjYwMjI4MDk3LDEzNDU5Nzg1MDUzMDIwNTY5NjIsMTQ2ODAzNTM1MTYyNTI4NTYzNCwxNTQyMDc2MzA4NTc4MDI1NDc0IiwiY2xpZW50X2lkIjoic3dvcmQiLCJ1c2VyX3R5cGUiOiJ3ZWIiLCJyb2xlX2lkIjoiMTEyMzU5ODgxNjczODY3NTIwMSwxNDY3MDE1OTc1NDg0NzYwMDY2LDE0NjgwMzQ0MzcxNTc5NjE3MjksMTQ4MDgyOTMzNzkzOTEzMjQxNyIsInBvc3RfbmFtZSI6bnVsbCwic2NvcGUiOlsiYWxsIl0sImludGVydmlld19pZCI6bnVsbCwiZXhwIjoxNjU5MDU2NTgxLCJvcmdfbmFtZSI6bnVsbCwianRpIjoiYzI5NDlhYmQtNTRlYS00ODhkLTg2MzQtMzEyYTZkMzdhZjE0IiwibWVtYmVyX2lkIjoxLCJjb21wYW55X2lkIjpudWxsLCJzeXN0ZW1faWQiOm51bGwsImRlcHRfbmFtZSI6bnVsbCwiYXZhdGFyIjoiIiwiZGF0YV9yb2xlX25hbWUiOiJudWxsLGFkbWluLGFkbWluLGFkbWluIiwiYXV0aG9yaXRpZXMiOlsiYWRtaW4iLCJ1c2VyIiwiYWRtaW5pc3RyYXRvciJdLCJyb2xlX25hbWUiOiJhZG1pbmlzdHJhdG9yLHVzZXIsYWRtaW4sYWRtaW4iLCJyZXN1bWVfdGVtcGxhdGUiOm51bGwsImxpY2Vuc2UiOiJwb3dlcmVkIGJ5IHptZG1zIiwicG9zdF9pZCI6IiIsInVzZXJfaWQiOiIxNDEyOTUzODA0MzMzNTU1NzE0Iiwib3JnX2lkIjpudWxsLCJuaWNrX25hbWUiOiLpmYjkuprpm4QiLCJjb21wYW55X25hbWUiOm51bGwsImRlcHRfaWQiOiIiLCJoYW5kbGVfaHJfbmFtZSI6bnVsbCwiYWNjb3VudCI6ImNoZW55eCIsInJlc3VtZV9pZCI6bnVsbH0.oekbQq3Q_7PWmPgR_A1G48oN9pE2pzDMSSvmkdqg6KM";
42
+ var token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJtZW1iZXJfdHlwZSI6MSwiaGFuZGxlX2hyX3Bob25lIjpudWxsLCJyZXN1bWVfZGF0ZSI6bnVsbCwidXNlcl9uYW1lIjoid2YxMCIsImVtcF9uYW1lIjoi5rWB56iL5Lit5b-DMTAiLCJlbXBfbnVtYmVyIjoiWUcyMjAzMDUwIiwiaW10X2lkIjpudWxsLCJyZWFsX25hbWUiOiLmtYHnqIvkuK3lv4MxMCIsImNsaWVudF90eXBlIjoid2ViIiwiZGF0YV9yb2xlX2lkIjoiMTM0NTk3ODUwNTMwMjA1Njk2MiwxNTQyMDc2MzA4NTc4MDI1NDc0IiwiY2xpZW50X2lkIjoic3dvcmQiLCJ1c2VyX3R5cGUiOiJ3ZWIiLCJyb2xlX2lkIjoiMTQ0NjgxOTQ2MzY5Mzg0NDQ4MiwxNDgwODI5MDYzNTY0NTQxOTU0IiwicG9zdF9uYW1lIjpudWxsLCJzY29wZSI6WyJhbGwiXSwiaW50ZXJ2aWV3X2lkIjpudWxsLCJleHAiOjE2NjA4MjM2OTUsIm9yZ19uYW1lIjoi5rWZ5ZWG5Lit5ouT6ZuG5Zui6IKh5Lu95pyJ6ZmQ5YWs5Y-4IiwianRpIjoiYzEyZTUxOTctZTg1OS00ZTYzLWJhNDQtYjVkOTQ2NzBlMjYzIiwibWVtYmVyX2lkIjoxNTA5NTA5ODExODI5OTUyNTEzLCJjb21wYW55X2lkIjoxNDE1ODM3OTkxNzAxMDM3MDU3LCJzeXN0ZW1faWQiOm51bGwsImRlcHRfbmFtZSI6bnVsbCwiYXZhdGFyIjoiIiwiZGF0YV9yb2xlX25hbWUiOiJhZG1pbixhZG1pbiIsImF1dGhvcml0aWVzIjpbInVzZXIiLCJhZG1pbmlzdHJhdG9yIl0sInJvbGVfbmFtZSI6ImFkbWluaXN0cmF0b3IsdXNlciIsInJlc3VtZV90ZW1wbGF0ZSI6bnVsbCwibGljZW5zZSI6InBvd2VyZWQgYnkgem1kbXMiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IjE1MDk1MTAyMzAzNjY5MjQ4MDIiLCJvcmdfaWQiOjE0NTc1Mjc3NjU5MTg1MTUyMDEsIm5pY2tfbmFtZSI6Iua1geeoi-S4reW_gzEwIiwiY29tcGFueV9uYW1lIjoi5rWZ5ZWG5Lit5ouT6ZuG5Zui6IKh5Lu95pyJ6ZmQ5YWs5Y-4IiwiZGVwdF9pZCI6IjE0MzI5NTYyMDI2NzQxODgyODkiLCJoYW5kbGVfaHJfbmFtZSI6bnVsbCwiYWNjb3VudCI6IndmMTAiLCJyZXN1bWVfaWQiOm51bGx9.mz7PP0RGshNbc6ynDibJASDvw1q1tmHn1rCBWQ2khEI";
43
43
  function UploadDemo() {
44
44
  var _this = this;
45
45
  var _a = useState(originFileList), fileList = _a[0], setFileList = _a[1];
@@ -176,7 +176,7 @@ function UploadDemo() {
176
176
  };
177
177
  var tableHandleRef = useRef();
178
178
  return (React.createElement("div", null,
179
- React.createElement(UploadSingle, { action: "http://192.168.0.83:8888/api/zmdms-resource/oss/endpoint/put-file-attach", data: {
179
+ React.createElement(UploadSingle, { action: "http://192.168.0.83:8000/api/zmdms-resource/oss/endpoint/put-file-attach", data: {
180
180
  system: '2',
181
181
  }, headers: {
182
182
  'Zmdms-Auth': token,
@@ -197,7 +197,7 @@ function UploadDemo() {
197
197
  system: '2',
198
198
  },
199
199
  // ztAccept={['.ttf']}
200
- apiBaseUrl: "http://192.168.0.83:8888", fileBaseUrl: "http://192.168.0.83:88", originFileList: fileList, callback: uploadCallbackFn, onDeleteCallback: function (index, file) {
200
+ apiBaseUrl: "http://192.168.0.83:8000", fileBaseUrl: "http://192.168.0.83:88", originFileList: fileList, callback: uploadCallbackFn, onDeleteCallback: function (index, file) {
201
201
  console.log(index, file);
202
202
  }, upload: upload, rowSelection: "checkbox", uploadTableRef: uploadTableRef, tableRestProps: {
203
203
  tableHandleRef: tableHandleRef,
@@ -61,7 +61,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
61
61
  to[j] = from[i];
62
62
  return to;
63
63
  };
64
- import React, { useState, useEffect, memo, useMemo, useImperativeHandle, } from 'react';
64
+ import React, { useState, useEffect, memo, useMemo, useImperativeHandle, useRef, } from 'react';
65
65
  import { Button, Progress, message, Popconfirm } from '../../index';
66
66
  import Table from '../Table';
67
67
  import dayjs from 'dayjs';
@@ -73,6 +73,10 @@ var UploadTable = function (_a) {
73
73
  var _e = useState([]), dataSource = _e[0], setDataSource = _e[1];
74
74
  var _f = useState(false), loading = _f[0], setLoading = _f[1];
75
75
  var _g = useState(), selectedRows = _g[0], setSelectedRows = _g[1];
76
+ var dataSourceRef = useRef([]);
77
+ useEffect(function () {
78
+ dataSourceRef.current = dataSource;
79
+ }, [dataSource]);
76
80
  useImperativeHandle(uploadTableRef, function () { return ({
77
81
  getSelectedRows: function () { return selectedRows; },
78
82
  }); }, [selectedRows]);
@@ -128,72 +132,7 @@ var UploadTable = function (_a) {
128
132
  ellipsis: false,
129
133
  fixed: 'right',
130
134
  render: function (text, record, index) {
131
- var operationAuth = record === null || record === void 0 ? void 0 : record.operationAuth;
132
- // '1' 预览 '2' 下载 '3' 删除
133
- var authDownloadBtn = typeof operationAuth === 'string' &&
134
- operationAuth.indexOf('2') !== -1
135
- ? true
136
- : false;
137
- var authPreviewBtn = typeof operationAuth === 'string' &&
138
- operationAuth.indexOf('1') !== -1
139
- ? true
140
- : false;
141
- var authDeleteBtn = typeof operationAuth === 'string' &&
142
- operationAuth.indexOf('3') !== -1
143
- ? true
144
- : false;
145
- return (React.createElement(React.Fragment, null,
146
- ((typeof operationAuth === 'string'
147
- ? authDownloadBtn
148
- : showDownloadBtn) ||
149
- ((typeof operationAuth === 'string'
150
- ? authPreviewBtn
151
- : showPreviewBtn) &&
152
- (record === null || record === void 0 ? void 0 : record.fileSize) >= 10 * 1024 * 1024)) && (React.createElement(Button, { type: "link", style: {
153
- height: 28,
154
- }, onClick: function () {
155
- if (isPublic) {
156
- downloadPublicFile(apiBaseUrl, record === null || record === void 0 ? void 0 : record.fileId, record === null || record === void 0 ? void 0 : record.fileName);
157
- }
158
- else {
159
- // downloadFile(
160
- // apiBaseUrl,
161
- // record?.fileId,
162
- // record?.fileName,
163
- // authToken
164
- // );
165
- downloadFileCallBack(apiBaseUrl, record === null || record === void 0 ? void 0 : record.fileId, record === null || record === void 0 ? void 0 : record.fileName, {
166
- authToken: authToken,
167
- callbackAfter: function () {
168
- onDownLoadCallbackAfter &&
169
- onDownLoadCallbackAfter(record);
170
- },
171
- });
172
- }
173
- } }, "\u4E0B\u8F7D")),
174
- (typeof operationAuth === 'string'
175
- ? authPreviewBtn
176
- : showPreviewBtn) && (React.createElement(Button, { type: "link", style: {
177
- height: 28,
178
- }, onClick: function () {
179
- if ((record === null || record === void 0 ? void 0 : record.fileSize) >= 10 * 1024 * 1024) {
180
- message.warning('文件过大,暂不支持在线预览,请先下载后查看!');
181
- }
182
- else {
183
- previewFile(fileBaseUrl, record === null || record === void 0 ? void 0 : record.fileId, {
184
- titleName: record === null || record === void 0 ? void 0 : record.fileName,
185
- authToken: authToken,
186
- });
187
- onPreviewCallbackBefore &&
188
- onPreviewCallbackBefore(record);
189
- }
190
- } }, "\u9884\u89C8")),
191
- (typeof operationAuth === 'string'
192
- ? authDeleteBtn
193
- : showDeleteBtn) && (React.createElement(Popconfirm, { title: "\u662F\u5426\u5220\u9664\u8BE5\u6761\u6570\u636E?", cancelText: "\u5426", okText: "\u662F", onConfirm: function () { return onDeleteFile(record, index); } },
194
- React.createElement(Button, { style: {
195
- height: 28,
196
- }, type: "link" }, "\u5220\u9664")))));
135
+ return createOpt(text, record, index);
197
136
  },
198
137
  },
199
138
  ]) : __spreadArray(__spreadArray(__spreadArray(__spreadArray([], startColumns), [
@@ -235,75 +174,108 @@ var UploadTable = function (_a) {
235
174
  ellipsis: false,
236
175
  fixed: 'right',
237
176
  render: function (text, record, index) {
238
- var operationAuth = record === null || record === void 0 ? void 0 : record.operationAuth;
239
- // '1' 预览 '2' 下载 '3' 删除
240
- var authDownloadBtn = typeof operationAuth === 'string' &&
241
- operationAuth.indexOf('2') !== -1
242
- ? true
243
- : false;
244
- var authPreviewBtn = typeof operationAuth === 'string' &&
245
- operationAuth.indexOf('1') !== -1
246
- ? true
247
- : false;
248
- var authDeleteBtn = typeof operationAuth === 'string' &&
249
- operationAuth.indexOf('3') !== -1
250
- ? true
251
- : false;
252
- return (React.createElement(React.Fragment, null,
253
- ((typeof operationAuth === 'string'
254
- ? authDownloadBtn
255
- : showDownloadBtn) ||
256
- ((typeof operationAuth === 'string'
257
- ? authPreviewBtn
258
- : showPreviewBtn) &&
259
- (record === null || record === void 0 ? void 0 : record.fileSize) >= 10 * 1024 * 1024)) && (React.createElement(Button, { type: "link", style: {
260
- height: 28,
261
- }, onClick: function () {
262
- if (isPublic) {
263
- downloadPublicFile(apiBaseUrl, record === null || record === void 0 ? void 0 : record.fileId, record === null || record === void 0 ? void 0 : record.fileName);
264
- }
265
- else {
266
- // downloadFile(
267
- // apiBaseUrl,
268
- // record?.fileId,
269
- // record?.fileName,
270
- // authToken
271
- // );
272
- downloadFileCallBack(apiBaseUrl, record === null || record === void 0 ? void 0 : record.fileId, record === null || record === void 0 ? void 0 : record.fileName, {
273
- authToken: authToken,
274
- callbackAfter: function () {
275
- onDownLoadCallbackAfter &&
276
- onDownLoadCallbackAfter(record);
277
- },
278
- });
279
- }
280
- } }, "\u4E0B\u8F7D")),
281
- (typeof operationAuth === 'string'
282
- ? authPreviewBtn
283
- : showPreviewBtn) && (React.createElement(Button, { type: "link", style: {
284
- height: 28,
285
- }, onClick: function () {
286
- if ((record === null || record === void 0 ? void 0 : record.fileSize) >= 10 * 1024 * 1024) {
287
- message.warning('文件过大,暂不支持在线预览,请先下载后查看!');
288
- }
289
- else {
290
- previewFile(fileBaseUrl, record === null || record === void 0 ? void 0 : record.fileId, {
291
- titleName: record === null || record === void 0 ? void 0 : record.fileName,
292
- authToken: authToken,
293
- });
294
- onPreviewCallbackBefore &&
295
- onPreviewCallbackBefore(record);
296
- }
297
- } }, "\u9884\u89C8")),
298
- (typeof operationAuth === 'string'
299
- ? authDeleteBtn
300
- : showDeleteBtn) && (React.createElement(Popconfirm, { title: "\u662F\u5426\u5220\u9664\u8BE5\u6761\u6570\u636E?", cancelText: "\u5426", okText: "\u662F", onConfirm: function () { return onDeleteFile(record, index); } },
301
- React.createElement(Button, { style: {
302
- height: 28,
303
- }, type: "link" }, "\u5220\u9664")))));
177
+ return createOpt(text, record, index);
304
178
  },
305
179
  },
306
180
  ]);
181
+ function createOpt(text, record, index) {
182
+ var operationAuth = record === null || record === void 0 ? void 0 : record.operationAuth;
183
+ // '1' 预览 '2' 下载 '3' 删除
184
+ var authDownloadBtn = typeof operationAuth === 'string' && operationAuth.indexOf('2') !== -1
185
+ ? true
186
+ : false;
187
+ var authPreviewBtn = typeof operationAuth === 'string' && operationAuth.indexOf('1') !== -1
188
+ ? true
189
+ : false;
190
+ var authDeleteBtn = typeof operationAuth === 'string' && operationAuth.indexOf('3') !== -1
191
+ ? true
192
+ : false;
193
+ return (React.createElement(React.Fragment, null,
194
+ ((typeof operationAuth === 'string'
195
+ ? authDownloadBtn
196
+ : showDownloadBtn) ||
197
+ ((typeof operationAuth === 'string'
198
+ ? authPreviewBtn
199
+ : showPreviewBtn) &&
200
+ (record === null || record === void 0 ? void 0 : record.fileSize) >= 10 * 1024 * 1024)) && (React.createElement(Button, { type: "link", style: {
201
+ height: 28,
202
+ }, loading: record === null || record === void 0 ? void 0 : record.loading, onClick: function () {
203
+ var newDataSource = dataSource.slice();
204
+ newDataSource.splice(index, 1, __assign(__assign({}, record), { loading: true }));
205
+ setDataSource(newDataSource);
206
+ if (isPublic) {
207
+ downloadPublicFile(apiBaseUrl, record === null || record === void 0 ? void 0 : record.fileId, record === null || record === void 0 ? void 0 : record.fileName, {
208
+ callbackAfter: function () {
209
+ var _a, _b, _c;
210
+ var newDataSource = ((_b = (_a = (dataSourceRef.current || [])) === null || _a === void 0 ? void 0 : _a.slice) === null || _b === void 0 ? void 0 : _b.call(_a)) || [];
211
+ if ((_c = newDataSource[index]) === null || _c === void 0 ? void 0 : _c.loading) {
212
+ newDataSource.splice(index, 1, __assign(__assign({}, record), { loading: false }));
213
+ setDataSource(newDataSource);
214
+ }
215
+ },
216
+ callbackError: function () {
217
+ var _a, _b, _c;
218
+ var newDataSource = ((_b = (_a = (dataSourceRef.current || [])) === null || _a === void 0 ? void 0 : _a.slice) === null || _b === void 0 ? void 0 : _b.call(_a)) || [];
219
+ if ((_c = newDataSource[index]) === null || _c === void 0 ? void 0 : _c.loading) {
220
+ newDataSource.splice(index, 1, __assign(__assign({}, record), { loading: false }));
221
+ setDataSource(newDataSource);
222
+ }
223
+ },
224
+ });
225
+ }
226
+ else {
227
+ // downloadFile(
228
+ // apiBaseUrl,
229
+ // record?.fileId,
230
+ // record?.fileName,
231
+ // authToken
232
+ // );
233
+ downloadFileCallBack(apiBaseUrl, record === null || record === void 0 ? void 0 : record.fileId, record === null || record === void 0 ? void 0 : record.fileName, {
234
+ authToken: authToken,
235
+ callbackAfter: function () {
236
+ var _a, _b, _c;
237
+ var newDataSource = ((_b = (_a = (dataSourceRef.current || [])) === null || _a === void 0 ? void 0 : _a.slice) === null || _b === void 0 ? void 0 : _b.call(_a)) || [];
238
+ if ((_c = newDataSource[index]) === null || _c === void 0 ? void 0 : _c.loading) {
239
+ newDataSource.splice(index, 1, __assign(__assign({}, record), { loading: false }));
240
+ setDataSource(newDataSource);
241
+ }
242
+ onDownLoadCallbackAfter &&
243
+ onDownLoadCallbackAfter(record);
244
+ },
245
+ callbackError: function () {
246
+ var _a, _b, _c;
247
+ var newDataSource = ((_b = (_a = (dataSourceRef.current || [])) === null || _a === void 0 ? void 0 : _a.slice) === null || _b === void 0 ? void 0 : _b.call(_a)) || [];
248
+ if ((_c = newDataSource[index]) === null || _c === void 0 ? void 0 : _c.loading) {
249
+ newDataSource.splice(index, 1, __assign(__assign({}, record), { loading: false }));
250
+ setDataSource(newDataSource);
251
+ }
252
+ },
253
+ });
254
+ }
255
+ } }, "\u4E0B\u8F7D")),
256
+ (typeof operationAuth === 'string'
257
+ ? authPreviewBtn
258
+ : showPreviewBtn) && (React.createElement(Button, { type: "link", style: {
259
+ height: 28,
260
+ }, onClick: function () {
261
+ if ((record === null || record === void 0 ? void 0 : record.fileSize) >= 10 * 1024 * 1024) {
262
+ message.warning('文件过大,暂不支持在线预览,请先下载后查看!');
263
+ }
264
+ else {
265
+ previewFile(fileBaseUrl, record === null || record === void 0 ? void 0 : record.fileId, {
266
+ titleName: record === null || record === void 0 ? void 0 : record.fileName,
267
+ authToken: authToken,
268
+ });
269
+ onPreviewCallbackBefore && onPreviewCallbackBefore(record);
270
+ }
271
+ } }, "\u9884\u89C8")),
272
+ (typeof operationAuth === 'string'
273
+ ? authDeleteBtn
274
+ : showDeleteBtn) && (React.createElement(Popconfirm, { title: "\u662F\u5426\u5220\u9664\u8BE5\u6761\u6570\u636E?", cancelText: "\u5426", okText: "\u662F", onConfirm: function () { return onDeleteFile(record, index); } },
275
+ React.createElement(Button, { style: {
276
+ height: 28,
277
+ }, type: "link" }, "\u5220\u9664")))));
278
+ }
307
279
  /**重新上传 */
308
280
  function onSubmitFile(file, index) {
309
281
  return __awaiter(this, void 0, void 0, function () {
@@ -466,7 +438,11 @@ var UploadTable = function (_a) {
466
438
  ? {
467
439
  type: rowSelection,
468
440
  onChange: function (selectedRowKeys, selectedRows) {
469
- setSelectedRows(selectedRows);
441
+ setSelectedRows(selectedRows.map(function (item) {
442
+ var newItem = __assign({}, item);
443
+ Reflect.deleteProperty(newItem, 'loading');
444
+ return newItem;
445
+ }));
470
446
  },
471
447
  }
472
448
  : rowSelection;
@@ -14,7 +14,7 @@ var ElectronicSeal = function (_a) {
14
14
  overflowY: 'auto',
15
15
  overflowX: 'hidden',
16
16
  } },
17
- React.createElement(Checkbox.Group, { defaultValue: value, onChange: onChange, className: "flex-checkbox-group", disabled: !isEdit }, Array.isArray(electronicList) &&
17
+ React.createElement(Checkbox.Group, { defaultValue: value, value: value, onChange: onChange, className: "flex-checkbox-group", disabled: !isEdit }, Array.isArray(electronicList) &&
18
18
  electronicList.map(function (item) {
19
19
  return (React.createElement(Checkbox, { key: item.sealId, value: item.sealId }, item.sealName));
20
20
  }))));
@@ -39,7 +39,7 @@ var SealCheckbox = function (_a) {
39
39
  num = 1;
40
40
  }
41
41
  if (typeof contractNum !== 'number' && showContranctNum && onChange) {
42
- message.info('请输入合同份数!');
42
+ message.info('请先输入合同份数,重新填写用印次数!');
43
43
  num = null;
44
44
  }
45
45
  if (typeof num !== 'number' && value) {
@@ -56,7 +56,13 @@ var SealCheckbox = function (_a) {
56
56
  justifyContent: 'space-between',
57
57
  height: '32px',
58
58
  } },
59
- React.createElement(Checkbox, { onChange: onCheckboxChange, checked: value && value.sealNo ? true : false, disabled: !isEdit, style: { width: '70%' } }, name),
59
+ React.createElement(Checkbox, { onChange: onCheckboxChange, checked: value && value.sealNo ? true : false, disabled: !isEdit, style: { width: '70%' } },
60
+ React.createElement("div", { style: {
61
+ textOverflow: 'ellipsis',
62
+ overflow: 'hidden',
63
+ width: '320px',
64
+ whiteSpace: 'nowrap',
65
+ }, title: name }, name)),
60
66
  React.createElement("div", { style: { display: 'flex', lineHeight: '32px' } },
61
67
  React.createElement("div", { style: { marginRight: '5px' } }, "\u7528\u5370"),
62
68
  React.createElement(Item, { noLabel: true, width: "half" },
@@ -103,6 +103,8 @@ var Sinatures = function (_a) {
103
103
  var form = Form.useForm()[0];
104
104
  // 是否加盖群杰印章
105
105
  var _q = useState(true), checked = _q[0], setChecked = _q[1];
106
+ // 盖章按钮loading
107
+ var _r = useState(false), loading = _r[0], setLoading = _r[1];
106
108
  /** 是否加盖群杰印章 */
107
109
  var needQjSealFn = function (e) {
108
110
  if (!e.target.checked) {
@@ -222,6 +224,7 @@ var Sinatures = function (_a) {
222
224
  };
223
225
  /** 指定签署位置 */
224
226
  var checkSealFn = function () {
227
+ setLoading(true);
225
228
  // 已勾选的要加盖电子印章的附件id列表
226
229
  var checkedElecSealIds = records
227
230
  .filter(function (item) { return item.isElectronicSeal; })
@@ -264,15 +267,17 @@ var Sinatures = function (_a) {
264
267
  })
265
268
  .then(function (res) {
266
269
  var _a;
270
+ setLoading(false);
267
271
  if (res.status === 200 &&
268
272
  res.data.code === 200 &&
269
273
  res.data.data.preSignUrl) {
270
- for (var i = sealedIds.length; i--; i >= 0) {
271
- if ((_a = res.data.data.deleteAttachIdList) === null || _a === void 0 ? void 0 : _a.includes(sealedIds[i])) {
272
- sealedIds.splice(i, 1);
274
+ var sealedIdsCopy = __spreadArray([], sealedIds);
275
+ for (var i = sealedIdsCopy.length; i--; i >= 0) {
276
+ if ((_a = res.data.data.deleteAttachIdList) === null || _a === void 0 ? void 0 : _a.includes(sealedIdsCopy[i])) {
277
+ sealedIdsCopy.splice(i, 1);
273
278
  }
274
279
  }
275
- setSealedIds(__spreadArray(__spreadArray([], sealedIds), res.data.data.attachIdList));
280
+ setSealedIds(__spreadArray(__spreadArray([], sealedIdsCopy), res.data.data.attachIdList));
276
281
  setContractId(res.data.data.contractId);
277
282
  setAttachMap(res.data.data.docAttachMap);
278
283
  setDocumentIds(res.data.data.documentIdList);
@@ -284,6 +289,7 @@ var Sinatures = function (_a) {
284
289
  })
285
290
  .catch(function (error) {
286
291
  var _a, _b;
292
+ setLoading(false);
287
293
  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) || '请求失败!');
288
294
  });
289
295
  };
@@ -423,7 +429,7 @@ var Sinatures = function (_a) {
423
429
  // 是否有勾选加盖电子印章
424
430
  var hasElectronicSeal = records === null || records === void 0 ? void 0 : records.some(function (item) { return !!item.isElectronicSeal; });
425
431
  var obj = {
426
- children: (React.createElement(ElectronicSeal, { value: electronicSeal, onChange: electronicSealChangeHandle, isEdit: hasElectronicSeal && isEdit, electronicList: electronicList })),
432
+ children: (React.createElement(ElectronicSeal, { value: innerElectronicSeal, onChange: electronicSealChangeHandle, isEdit: hasElectronicSeal && isEdit, electronicList: electronicList })),
427
433
  props: {},
428
434
  };
429
435
  obj.props['rowSpan'] = index === 0 ? records.length : 0;
@@ -434,13 +440,13 @@ var Sinatures = function (_a) {
434
440
  title: '电子印章设置',
435
441
  key: 'setElectronicSeal',
436
442
  dataIndex: 'setElectronicSeal',
437
- width: 110,
443
+ width: 135,
438
444
  render: function (value, row, index) {
439
445
  var Comp = function () {
440
446
  return records.length !== 0 ? (React.createElement("div", { style: { height: '100%', paddingTop: '23px' } },
441
447
  React.createElement(Button, { type: "link", style: __assign({}, (checkSealVisible && isEdit
442
448
  ? {}
443
- : { display: 'none' })), size: "small", onClick: checkSealFn }, "\u6307\u5B9A\u7B7E\u7F72\u4F4D\u7F6E"),
449
+ : { display: 'none' })), size: "small", loading: loading, onClick: checkSealFn }, "\u6307\u5B9A\u7B7E\u7F72\u4F4D\u7F6E"),
444
450
  React.createElement(Button, { type: "link", style: __assign({}, (contractId || contract_id ? {} : { display: 'none' })), size: "small", onClick: viewSealPageFn }, "\u9884\u89C8\u76D6\u7AE0\u6548\u679C"))) : (React.createElement(React.Fragment, null));
445
451
  };
446
452
  var obj = {
@@ -493,7 +499,7 @@ var Sinatures = function (_a) {
493
499
  columnsLast = columnsLast.filter(function (item) { return !['isWatermark', 'needQys'].includes(item.key); });
494
500
  }
495
501
  // 上传组件的数据
496
- var _r = useState(), originFileList = _r[0], setOriginFileList = _r[1];
502
+ var _s = useState(), originFileList = _s[0], setOriginFileList = _s[1];
497
503
  /** 签章组件onChange事件 */
498
504
  var sigValuesChange = function (type, value) {
499
505
  var _a, _b;
@@ -510,10 +516,11 @@ var Sinatures = function (_a) {
510
516
  setCheckSealVisible(value ? true : hasElecSeal.length > 1 ? true : false);
511
517
  // 去除加盖电子印章勾选时 清除合同id 等之前的信息
512
518
  if (!value && hasElecSeal.length === 1) {
513
- setSealedIds(__spreadArray([], sealedIds));
519
+ setSealedIds([]);
514
520
  setContractId('');
515
521
  setAttachMap(null);
516
522
  setDocumentIds([]);
523
+ setElectronicSeal([]);
517
524
  }
518
525
  }
519
526
  setRecords(function (preRecords) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "3.5.1",
3
+ "version": "3.5.2",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",
@@ -23,7 +23,7 @@
23
23
  "react-infinite-scroll-component": "^6.1.0",
24
24
  "react-resizable": "^3.0.4",
25
25
  "react-to-print": "^2.14.7",
26
- "ztxkutils": "^2.8.19"
26
+ "ztxkutils": "^2.9.1"
27
27
  },
28
28
  "scripts": {
29
29
  "analyze": "source-map-explorer 'dist/static/js/*.js'",