ztxkui 3.3.9 → 3.3.12

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.
@@ -195,7 +195,9 @@ function UploadDemo() {
195
195
  'Zmdms-Auth': token,
196
196
  }, authToken: token, data: {
197
197
  system: '2',
198
- }, ztAccept: ['.ttf'], apiBaseUrl: "http://192.168.0.83:8888", fileBaseUrl: "http://192.168.0.83:88", originFileList: fileList, callback: uploadCallbackFn, onDeleteCallback: function (index, file) {
198
+ },
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) {
199
201
  console.log(index, file);
200
202
  }, upload: upload, rowSelection: "checkbox", uploadTableRef: uploadTableRef, tableRestProps: {
201
203
  tableHandleRef: tableHandleRef,
@@ -124,8 +124,24 @@ var UploadTable = function (_a) {
124
124
  width: 80,
125
125
  fixed: 'right',
126
126
  render: function (text, record, index) {
127
+ var operationAuth = record === null || record === void 0 ? void 0 : record.operationAuth;
128
+ // '1' 预览 '2' 下载 '3' 删除
129
+ var authDownloadBtn = typeof operationAuth === 'string' &&
130
+ operationAuth.indexOf('2') !== -1
131
+ ? true
132
+ : false;
133
+ var authPreviewBtn = typeof operationAuth === 'string' &&
134
+ operationAuth.indexOf('1') !== -1
135
+ ? true
136
+ : false;
137
+ var authDeleteBtn = typeof operationAuth === 'string' &&
138
+ operationAuth.indexOf('3') !== -1
139
+ ? true
140
+ : false;
127
141
  return (React.createElement(React.Fragment, null,
128
- showDownloadBtn && (React.createElement(Button, { type: "link", style: {
142
+ (typeof operationAuth === 'string'
143
+ ? authDownloadBtn
144
+ : showDownloadBtn) && (React.createElement(Button, { type: "link", style: {
129
145
  height: 28,
130
146
  }, onClick: function () {
131
147
  if (isPublic) {
@@ -147,7 +163,9 @@ var UploadTable = function (_a) {
147
163
  });
148
164
  }
149
165
  } }, "\u4E0B\u8F7D")),
150
- showPreviewBtn && (React.createElement(Button, { type: "link", style: {
166
+ (typeof operationAuth === 'string'
167
+ ? authPreviewBtn
168
+ : showPreviewBtn) && (React.createElement(Button, { type: "link", style: {
151
169
  height: 28,
152
170
  }, onClick: function () {
153
171
  if ((record === null || record === void 0 ? void 0 : record.fileSize) >= 10 * 1024 * 1024) {
@@ -162,7 +180,9 @@ var UploadTable = function (_a) {
162
180
  onPreviewCallbackBefore(record);
163
181
  }
164
182
  } }, "\u9884\u89C8")),
165
- showDeleteBtn && (React.createElement(Popconfirm, { title: "\u662F\u5426\u5220\u9664\u8BE5\u6761\u6570\u636E?", cancelText: "\u5426", okText: "\u662F", onConfirm: function () { return onDeleteFile(record, index); } },
183
+ (typeof operationAuth === 'string'
184
+ ? authDeleteBtn
185
+ : showDeleteBtn) && (React.createElement(Popconfirm, { title: "\u662F\u5426\u5220\u9664\u8BE5\u6761\u6570\u636E?", cancelText: "\u5426", okText: "\u662F", onConfirm: function () { return onDeleteFile(record, index); } },
166
186
  React.createElement(Button, { style: {
167
187
  height: 28,
168
188
  }, type: "link" }, "\u5220\u9664")))));
@@ -205,6 +205,10 @@ var Upload = function (props) {
205
205
  message.warning("\u4E0D\u652F\u6301 " + fileNameSuffix + " \u6587\u4EF6\u683C\u5F0F\uFF01");
206
206
  return AntUpload.LIST_IGNORE;
207
207
  }
208
+ if (fileSize === 0) {
209
+ message.warning("\u4E0D\u80FD\u4E0A\u4F20\u7A7A\u6587\u4EF6\uFF01");
210
+ return AntUpload.LIST_IGNORE;
211
+ }
208
212
  if (fileSize > MAXSIZE) {
209
213
  message.warning("\u6587\u4EF6\u8D85\u51FA " + MAXSIZESTR + "\uFF01");
210
214
  return AntUpload.LIST_IGNORE;
@@ -97,7 +97,7 @@ var QunjSeal = function (_a) {
97
97
  justifyContent: 'space-between',
98
98
  width: '100%',
99
99
  } },
100
- React.createElement(Item, { name: "needQj", label: "", noBorder: true, width: "half" },
100
+ React.createElement(Item, { name: "needQj", label: "", valuePropName: "checked", noBorder: true, width: "half" },
101
101
  React.createElement(Checkbox, { checked: checked, disabled: !isEdit, style: { marginTop: '8px' }, onChange: function (e) { return needQjSealFn(e); } }, "\u662F\u5426\u52A0\u76D6\u7FA4\u6770\u5370\u7AE0")),
102
102
  checked ? (React.createElement(React.Fragment, null,
103
103
  React.createElement(Item, { name: "isTakeOut", label: "", noBorder: true, width: "half" },
@@ -111,7 +111,7 @@ var QunjSeal = function (_a) {
111
111
  showContranctNum ? (React.createElement(Item, { name: "contranctNum", label: "\u5408\u540C\u4EFD\u6570", width: "all" },
112
112
  React.createElement(InputNumber, { disabled: !isEdit, min: 0 }))) : (''),
113
113
  getSealCheckboxGroupRender())) : (React.createElement(React.Fragment, null)))))) : (React.createElement(Form, { form: form, onValuesChange: onValuesChangeHandle },
114
- React.createElement(Item, { name: "needQj", label: "", noBorder: true, width: "all" },
114
+ React.createElement(Item, { name: "needQj", label: "", valuePropName: "checked", noBorder: true, width: "all" },
115
115
  React.createElement(Checkbox, { checked: checked, disabled: !isEdit, style: { marginTop: '8px' }, onChange: function (e) { return needQjSealFn(e); } }, "\u662F\u5426\u52A0\u76D6\u7FA4\u6770\u5370\u7AE0")),
116
116
  React.createElement(SearchContainer, null, checked ? (React.createElement(SearchLeft, null,
117
117
  React.createElement(Item, { name: "vertifyCode", label: "\u7FA4\u6770\u9A8C\u8BC1\u7801", width: "all" },
@@ -38,28 +38,36 @@ var SealCheckbox = function (_a) {
38
38
  if (typeof num !== 'number') {
39
39
  Reflect.deleteProperty(value, 'sealCount');
40
40
  }
41
- onChange &&
42
- onChange(__assign(__assign({}, (value || {})), (typeof num === 'number' ? { sealCount: num } : {})));
41
+ var info = __assign(__assign({}, (value || {})), (typeof num === 'number' ? { sealCount: num } : {}));
42
+ if (typeof info.sealCount === 'number') {
43
+ info = __assign(__assign({}, info), { sealName: name, sealNo: id });
44
+ }
45
+ onChange && onChange(info, 'sealCount');
43
46
  };
44
47
  return (React.createElement("div", { style: __assign({ padding: '6px' }, (isOnlyQunj ? { display: 'flex' } : {})) },
45
48
  React.createElement(Checkbox, { onChange: onCheckboxChange, checked: value && value.sealNo ? true : false, disabled: !isEdit, style: { width: '40%' } }, name),
46
49
  React.createElement("div", null,
47
50
  React.createElement("span", null, "\u7528\u5370\u6B21\u6570\uFF1A"),
48
- React.createElement(InputNumber, { bordered: false, disabled: !isEdit || !(value === null || value === void 0 ? void 0 : value.sealNo), min: 0, size: "small", value: typeof (value === null || value === void 0 ? void 0 : value.sealCount) === 'number' ? value === null || value === void 0 ? void 0 : value.sealCount : undefined, onChange: onNumberChange, style: { borderBottom: '1px solid #e9ecf3' } }))));
51
+ React.createElement(InputNumber, { bordered: false, disabled: !isEdit, min: 0, size: "small", value: typeof (value === null || value === void 0 ? void 0 : value.sealCount) === 'number' ? value === null || value === void 0 ? void 0 : value.sealCount : undefined, onChange: onNumberChange, style: { borderBottom: '1px solid #e9ecf3' } }))));
49
52
  };
50
53
  var SealCheckboxGroup = function (_a) {
51
54
  var value = _a.value, onChange = _a.onChange, sealList = _a.sealList, handleRef = _a.handleRef, isEdit = _a.isEdit, isOnlyQunj = _a.isOnlyQunj;
52
- var onChangeHandle = function (_value, index, sealNo) {
55
+ var onChangeHandle = function (_value, index, sealNo, type) {
53
56
  var _a, _b, _c, _d;
54
57
  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;
55
58
  var valueArr = Array.isArray(value) ? __spreadArray([], value) : [];
56
59
  var vIndex = valueArr === null || valueArr === void 0 ? void 0 : valueArr.findIndex(function (item) { return item.sealNo === sealNo; });
57
60
  if (_value.sealNo) {
58
- if (typeof (_value === null || _value === void 0 ? void 0 : _value.sealCount) === 'number') {
61
+ if (typeof (_value === null || _value === void 0 ? void 0 : _value.sealCount) === 'number' && vIndex > -1) {
59
62
  valueArr.splice(vIndex, 1, _value);
60
63
  }
61
64
  else {
62
- valueArr.splice(vIndex, vIndex > -1 ? 1 : 0, _value);
65
+ if (type === 'sealCount' && typeof _value.sealCount !== 'number') {
66
+ valueArr.splice(vIndex, 1);
67
+ }
68
+ else {
69
+ valueArr.splice(vIndex, vIndex > -1 ? 1 : 0, _value);
70
+ }
63
71
  }
64
72
  }
65
73
  else {
@@ -92,8 +100,8 @@ var SealCheckboxGroup = function (_a) {
92
100
  if (Array.isArray(value)) {
93
101
  itemValue = value.find(function (valueItem) { return valueItem.sealNo === item.sealNo; });
94
102
  }
95
- 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, isOnlyQunj: isOnlyQunj, onChange: function (value) {
96
- onChangeHandle(value, index, item.sealNo);
103
+ 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, isOnlyQunj: isOnlyQunj, onChange: function (value, type) {
104
+ onChangeHandle(value, index, item.sealNo, type);
97
105
  } }));
98
106
  })));
99
107
  };
@@ -396,6 +396,7 @@ var Sinatures = function (_a) {
396
396
  },
397
397
  /** 签章组件相关校验 */
398
398
  validateSealFn: function () {
399
+ var _a;
399
400
  // 勾选加盖电子印章时未勾选电子印章
400
401
  if (innerElectronicSeal.length === 0) {
401
402
  var isElectronicSeal = records.filter(function (item) { return !!item.isElectronicSeal; });
@@ -409,6 +410,33 @@ var Sinatures = function (_a) {
409
410
  message.warning('您的用印次数远超超过合理次数范围,请修改。');
410
411
  return false;
411
412
  }
413
+ // 没有确认盖章
414
+ if (!contractId) {
415
+ message.warning('请点击确认盖章按钮,确认盖章位置后方可提交!');
416
+ return false;
417
+ }
418
+ if (innerQunjSeal.needQj) {
419
+ // 合同份数为空
420
+ if (!(innerQunjSeal === null || innerQunjSeal === void 0 ? void 0 : innerQunjSeal.contranctNum)) {
421
+ message.warning('请填写合同份数!');
422
+ return false;
423
+ }
424
+ // 勾选的群杰印章 没有填用印次数
425
+ if (((_a = innerQunjSeal === null || innerQunjSeal === void 0 ? void 0 : innerQunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) > 0) {
426
+ innerQunjSeal.details.forEach(function (item) {
427
+ if (!item.sealCount) {
428
+ message.warning("\u8BF7\u586B\u5199" + item.sealName + " \u7684\u7528\u5370\u6B21\u6570\uFF01");
429
+ }
430
+ });
431
+ if (innerQunjSeal.details.filter(function (item) { return !item.sealCount; }).length > 0) {
432
+ return false;
433
+ }
434
+ }
435
+ else {
436
+ message.warning('请选择用印!');
437
+ return false;
438
+ }
439
+ }
412
440
  return true;
413
441
  },
414
442
  }); });
@@ -42,6 +42,10 @@ export function checkFile(file, restParams) {
42
42
  message.warning("\u4E0D\u652F\u6301 " + fileNameSuffix + " \u6587\u4EF6\u683C\u5F0F\uFF01");
43
43
  return AntUpload.LIST_IGNORE;
44
44
  }
45
+ if (fileSize === 0) {
46
+ message.warning("\u4E0D\u80FD\u4E0A\u4F20\u7A7A\u6587\u4EF6\uFF01");
47
+ return AntUpload.LIST_IGNORE;
48
+ }
45
49
  if (fileSize > MAXSIZE) {
46
50
  message.warning("\u6587\u4EF6\u8D85\u51FA " + MAXSIZESTR + "\uFF01");
47
51
  return AntUpload.LIST_IGNORE;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "3.3.9",
3
+ "version": "3.3.12",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",