ztxkui 3.3.9 → 3.3.10

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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "3.3.9",
3
+ "version": "3.3.10",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",