zmdms-webui 0.0.164 → 0.0.166

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.
@@ -20,6 +20,7 @@ var EnhanceCell = function (props) {
20
20
  // 当前数据
21
21
  var _c = useState(newRecord ? newRecord[dataIndex] : undefined), val = _c[0], setVal = _c[1];
22
22
  var iptNumberRef = useRef();
23
+ var isIptNumberBooleanRef = useRef(false);
23
24
  // 当前是否是编辑状态 性能优化,显示纯字段比显示一个完整的组件 性能要高出许多
24
25
  var _d = useEditing(), editing = _d.editing, toggleEdit = _d.toggleEdit;
25
26
  // 输入框ref对象
@@ -139,7 +140,9 @@ var EnhanceCell = function (props) {
139
140
  throw Error("如果开启了editable, 那么必须传递 onEditableSave属性 来更改表格数据!");
140
141
  }
141
142
  toggleEdit();
142
- onEditableSave(__assign(__assign({}, newRecord), (_a = {}, _a[dataIndex] = iptNumberRef.current ? iptNumberRef.current : val, _a)), index, dataIndex);
143
+ onEditableSave(__assign(__assign({}, newRecord), (_a = {}, _a[dataIndex] = isIptNumberBooleanRef.current && iptNumberRef.current
144
+ ? iptNumberRef.current
145
+ : val, _a)), index, dataIndex);
143
146
  };
144
147
  // 如果开启编辑 那么内部直接代理
145
148
  if (typeof editable === "function" ? editable(newRecord) : editable) {
@@ -157,6 +160,7 @@ var EnhanceCell = function (props) {
157
160
  if (type === "input") {
158
161
  CurrentReactNode = (jsx(MemoInput, __assign({ value: val, onChange: function (e) {
159
162
  var resultValue = e.target.value;
163
+ isIptNumberBooleanRef.current = false;
160
164
  setVal(resultValue);
161
165
  if (isValidate) {
162
166
  removeErrorClass();
@@ -167,6 +171,7 @@ var EnhanceCell = function (props) {
167
171
  if (type === "textarea") {
168
172
  CurrentReactNode = (jsx(MemoInput.TextArea, __assign({ value: val, onChange: function (e) {
169
173
  var resultValue = e.target.value;
174
+ isIptNumberBooleanRef.current = false;
170
175
  setVal(resultValue);
171
176
  if (isValidate) {
172
177
  removeErrorClass();
@@ -188,6 +193,7 @@ var EnhanceCell = function (props) {
188
193
  }
189
194
  }
190
195
  setVal(resultValue);
196
+ isIptNumberBooleanRef.current = true;
191
197
  iptNumberRef.current = resultValue;
192
198
  if (isValidate) {
193
199
  removeErrorClass();
@@ -227,6 +227,10 @@ interface ITableProps<RecordType> extends Omit<TableProps<RecordType>, "columns"
227
227
  * 是否显示增加行功能
228
228
  */
229
229
  isAdd?: boolean;
230
+ /**
231
+ * 是否显示表头的新增行按钮(当没有一条数据时,可以点击表头行实现数据的插入)
232
+ */
233
+ isTheadTitleAdd?: boolean;
230
234
  /**
231
235
  * 新增的逻辑 默认生成一条空白数据 或者复制
232
236
  */
@@ -37,7 +37,7 @@ import { DndProvider } from '../node_modules/react-dnd/dist/core/DndProvider.js'
37
37
  // TODO: 过滤功能
38
38
  var Table = function (props) {
39
39
  // console.log("表格渲染");
40
- var className = props.className, _a = props.bordered, bordered = _a === void 0 ? true : _a, _b = props.pagination, pagination = _b === void 0 ? false : _b, isFlex = props.isFlex; props.tablePreferences; var dynamicKey = props.dynamicKey, hiddenDynamicIcon = props.hiddenDynamicIcon, _columns = props.columns, dataSource = props.dataSource, onTableChange = props.onTableChange, isEdit = props.isEdit, isMove = props.isMove, isAdd = props.isAdd, addMode = props.addMode, addCallback = props.addCallback, isDel = props.isDel, hiddenDelBtnHandle = props.hiddenDelBtnHandle, _c = props.isDelAll, isDelAll = _c === void 0 ? true : _c, isAddAndDelAuto = props.isAddAndDelAuto, summaryConfig = props.summaryConfig, _d = props.summaryFixed, summaryFixed = _d === void 0 ? true : _d, isInnerPagination = props.isInnerPagination, _e = props.innerPaginationPageSize, innerPaginationPageSize = _e === void 0 ? 30 : _e, _f = props.innerPaginationPosition, innerPaginationPosition = _f === void 0 ? INNER_TABLE_PAGINATION_POSITION : _f, _g = props.innerPaginationPageSizeOptions, innerPaginationPageSizeOptions = _g === void 0 ? INNER_TABLE_PAGINATION_PAGESIZEOPTIONS : _g, tableRefHandle = props.tableRefHandle, tableName = props.tableName, serviceOrder = props.serviceOrder, differences = props.differences, virtualKey = props.virtualKey, _h = props.isResizableColumn, isResizableColumn = _h === void 0 ? true : _h, _j = props.isRealTimeValidate, isRealTimeValidate = _j === void 0 ? true : _j, isMarginTop = props.isMarginTop, isMarginBottom = props.isMarginBottom, resetProps = __rest(props, ["className", "bordered", "pagination", "isFlex", "tablePreferences", "dynamicKey", "hiddenDynamicIcon", "columns", "dataSource", "onTableChange", "isEdit", "isMove", "isAdd", "addMode", "addCallback", "isDel", "hiddenDelBtnHandle", "isDelAll", "isAddAndDelAuto", "summaryConfig", "summaryFixed", "isInnerPagination", "innerPaginationPageSize", "innerPaginationPosition", "innerPaginationPageSizeOptions", "tableRefHandle", "tableName", "serviceOrder", "differences", "virtualKey", "isResizableColumn", "isRealTimeValidate", "isMarginTop", "isMarginBottom"]);
40
+ var className = props.className, _a = props.bordered, bordered = _a === void 0 ? true : _a, _b = props.pagination, pagination = _b === void 0 ? false : _b, isFlex = props.isFlex; props.tablePreferences; var dynamicKey = props.dynamicKey, hiddenDynamicIcon = props.hiddenDynamicIcon, _columns = props.columns, dataSource = props.dataSource, onTableChange = props.onTableChange, isEdit = props.isEdit, isMove = props.isMove, isAdd = props.isAdd, _c = props.isTheadTitleAdd, isTheadTitleAdd = _c === void 0 ? true : _c, addMode = props.addMode, addCallback = props.addCallback, isDel = props.isDel, hiddenDelBtnHandle = props.hiddenDelBtnHandle, _d = props.isDelAll, isDelAll = _d === void 0 ? true : _d, isAddAndDelAuto = props.isAddAndDelAuto, summaryConfig = props.summaryConfig, _e = props.summaryFixed, summaryFixed = _e === void 0 ? true : _e, isInnerPagination = props.isInnerPagination, _f = props.innerPaginationPageSize, innerPaginationPageSize = _f === void 0 ? 30 : _f, _g = props.innerPaginationPosition, innerPaginationPosition = _g === void 0 ? INNER_TABLE_PAGINATION_POSITION : _g, _h = props.innerPaginationPageSizeOptions, innerPaginationPageSizeOptions = _h === void 0 ? INNER_TABLE_PAGINATION_PAGESIZEOPTIONS : _h, tableRefHandle = props.tableRefHandle, tableName = props.tableName, serviceOrder = props.serviceOrder, differences = props.differences, virtualKey = props.virtualKey, _j = props.isResizableColumn, isResizableColumn = _j === void 0 ? true : _j, _k = props.isRealTimeValidate, isRealTimeValidate = _k === void 0 ? true : _k, isMarginTop = props.isMarginTop, isMarginBottom = props.isMarginBottom, resetProps = __rest(props, ["className", "bordered", "pagination", "isFlex", "tablePreferences", "dynamicKey", "hiddenDynamicIcon", "columns", "dataSource", "onTableChange", "isEdit", "isMove", "isAdd", "isTheadTitleAdd", "addMode", "addCallback", "isDel", "hiddenDelBtnHandle", "isDelAll", "isAddAndDelAuto", "summaryConfig", "summaryFixed", "isInnerPagination", "innerPaginationPageSize", "innerPaginationPosition", "innerPaginationPageSizeOptions", "tableRefHandle", "tableName", "serviceOrder", "differences", "virtualKey", "isResizableColumn", "isRealTimeValidate", "isMarginTop", "isMarginBottom"]);
41
41
  // 做一些前置处理
42
42
  // 比如过滤某些列 不做展示
43
43
  var columns = useParseColumns(_columns);
@@ -48,14 +48,14 @@ var Table = function (props) {
48
48
  var dataSourceRef = useLatest(dataSource);
49
49
  var hiddenDelBtnHandleRef = useLatest(hiddenDelBtnHandle);
50
50
  // 得到动态列配置信息
51
- var _k = useDynamicListByColumns(columns, dynamicKey), defaultDynamicList = _k.defaultDynamicList, onCurrentListChange = _k.onCurrentListChange, currentDynamicList = _k.currentDynamicList, dynamicSettingRef = _k.dynamicSettingRef;
51
+ var _l = useDynamicListByColumns(columns, dynamicKey), defaultDynamicList = _l.defaultDynamicList, onCurrentListChange = _l.onCurrentListChange, currentDynamicList = _l.currentDynamicList, dynamicSettingRef = _l.dynamicSettingRef;
52
52
  // 针对SCU和增减行 做特殊处理
53
- var _l = useScuRfresh(), refreshScuCell = _l.refreshScuCell, getRefreshScuCell = _l.getRefreshScuCell;
53
+ var _m = useScuRfresh(), refreshScuCell = _m.refreshScuCell, getRefreshScuCell = _m.getRefreshScuCell;
54
54
  // 内部分页相关配置
55
- var _m = useInnerPagination(isInnerPagination, innerPaginationPageSize, {
55
+ var _o = useInnerPagination(isInnerPagination, innerPaginationPageSize, {
56
56
  innerPaginationPosition: innerPaginationPosition,
57
57
  innerPaginationPageSizeOptions: innerPaginationPageSizeOptions,
58
- }), paginationConfig = _m.paginationConfig, currentPage = _m.currentPage, setCurrent = _m.setCurrent, pageSize = _m.pageSize;
58
+ }), paginationConfig = _o.paginationConfig, currentPage = _o.currentPage, setCurrent = _o.setCurrent, pageSize = _o.pageSize;
59
59
  // 内部表格编辑事件
60
60
  var onEditableSave = useEditChange(dataSourceRef, onTableChange);
61
61
  // 内部表格拖拽事件
@@ -74,12 +74,12 @@ var Table = function (props) {
74
74
  currentPage: currentPage,
75
75
  });
76
76
  // 自定义排序方法
77
- var _o = useCustomSort(dataSource, onTableChange, {
77
+ var _p = useCustomSort(dataSource, onTableChange, {
78
78
  refreshScuCell: refreshScuCell,
79
79
  currentPage: currentPage,
80
80
  rowKey: props === null || props === void 0 ? void 0 : props.rowKey,
81
81
  serviceOrder: serviceOrder,
82
- }), order = _o.order, setOrder = _o.setOrder, customSortHandle = _o.customSortHandle, sortDataSource = _o.sortDataSource;
82
+ }), order = _p.order, setOrder = _p.setOrder, customSortHandle = _p.customSortHandle, sortDataSource = _p.sortDataSource;
83
83
  // 处理列配置信息 得到新的列配置信息
84
84
  var newColumns = useColumns(columns, {
85
85
  // 动态列配置相关信息
@@ -93,6 +93,7 @@ var Table = function (props) {
93
93
  onEditableSave: onEditableSave,
94
94
  isEdit: isEdit,
95
95
  isAdd: isAdd,
96
+ isTheadTitleAdd: isTheadTitleAdd,
96
97
  isDel: isDel,
97
98
  onAddAndDel: onAddAndDel,
98
99
  getRefreshScuCell: getRefreshScuCell,
@@ -119,7 +120,7 @@ var Table = function (props) {
119
120
  isDel: isDel,
120
121
  });
121
122
  // 表格验证
122
- var _p = useTableValidate(), tableRef = _p.tableRef, getCurrentTable = _p.getCurrentTable, clearErrorClass = _p.clearErrorClass;
123
+ var _q = useTableValidate(), tableRef = _q.tableRef, getCurrentTable = _q.getCurrentTable, clearErrorClass = _q.clearErrorClass;
123
124
  // 虚拟滚动选项
124
125
  var vComponents = useMemo(function () {
125
126
  var _a;
@@ -17,7 +17,7 @@ import { PLACEHOLDER_NULL } from '../config/constant.js';
17
17
  // 不适用column里面的dataIndex字段,使用key字段
18
18
  function useColumns(columns, options) {
19
19
  var _a, _b;
20
- var dynamicKey = options.dynamicKey, hiddenDynamicIcon = options.hiddenDynamicIcon, currentDynamicList = options.currentDynamicList, dataSourceRef = options.dataSourceRef, onEditableSave = options.onEditableSave, isEdit = options.isEdit, isAdd = options.isAdd, isDel = options.isDel, dynamicSettingRef = options.dynamicSettingRef, onCurrentListChange = options.onCurrentListChange, onAddAndDel = options.onAddAndDel, getRefreshScuCell = options.getRefreshScuCell, isDelAll = options.isDelAll, currentPage = options.currentPage, onTableChange = options.onTableChange, order = options.order, setOrder = options.setOrder, customSortHandle = options.customSortHandle, isResizableColumn = options.isResizableColumn, isRealTimeValidate = options.isRealTimeValidate, hiddenDelBtnHandleRef = options.hiddenDelBtnHandleRef;
20
+ var dynamicKey = options.dynamicKey, hiddenDynamicIcon = options.hiddenDynamicIcon, currentDynamicList = options.currentDynamicList, dataSourceRef = options.dataSourceRef, onEditableSave = options.onEditableSave, isEdit = options.isEdit, isAdd = options.isAdd, isTheadTitleAdd = options.isTheadTitleAdd, isDel = options.isDel, dynamicSettingRef = options.dynamicSettingRef, onCurrentListChange = options.onCurrentListChange, onAddAndDel = options.onAddAndDel, getRefreshScuCell = options.getRefreshScuCell, isDelAll = options.isDelAll, currentPage = options.currentPage, onTableChange = options.onTableChange, order = options.order, setOrder = options.setOrder, customSortHandle = options.customSortHandle, isResizableColumn = options.isResizableColumn, isRealTimeValidate = options.isRealTimeValidate, hiddenDelBtnHandleRef = options.hiddenDelBtnHandleRef;
21
21
  var newColumns = getTableColumns(columns, currentDynamicList);
22
22
  // 循环遍历 neColumns 根据一些内容进行处理
23
23
  var myNewColumns = [];
@@ -185,7 +185,8 @@ function useColumns(columns, options) {
185
185
  isDel &&
186
186
  Array.isArray(dataSourceRef === null || dataSourceRef === void 0 ? void 0 : dataSourceRef.current) &&
187
187
  ((_a = dataSourceRef === null || dataSourceRef === void 0 ? void 0 : dataSourceRef.current) === null || _a === void 0 ? void 0 : _a.length) > 0;
188
- var showTitleAddIcon_1 = isAdd &&
188
+ var showTitleAddIcon_1 = isTheadTitleAdd &&
189
+ isAdd &&
189
190
  (!(dataSourceRef === null || dataSourceRef === void 0 ? void 0 : dataSourceRef.current) || ((_b = dataSourceRef === null || dataSourceRef === void 0 ? void 0 : dataSourceRef.current) === null || _b === void 0 ? void 0 : _b.length) === 0);
190
191
  // 如果配置了增减行
191
192
  if (isAdd || isDel) {
@@ -71,24 +71,46 @@ function useBeforeUpload(props) {
71
71
  * 文件改变触发事件
72
72
  */
73
73
  function useOnChange(props) {
74
- var onChange = props.onChange, userName = props.userName, fileList = props.fileList, isImage = props.isImage, isPublic = props.isPublic, API_BASEURL = props.API_BASEURL, newFieldNames = props.newFieldNames;
74
+ var onChange = props.onChange, userName = props.userName, fileList = props.fileList, isImage = props.isImage, isPublic = props.isPublic, API_BASEURL = props.API_BASEURL, newFieldNames = props.newFieldNames, listType = props.listType;
75
75
  var _a = useState(), innerFileList = _a[0], setInnerFileList = _a[1];
76
76
  var ATTACH_ID_KEY = newFieldNames.ATTACH_ID_KEY, ATTACH_NAME_KEY = newFieldNames.ATTACH_NAME_KEY, ATTACH_SIZE_KEY = newFieldNames.ATTACH_SIZE_KEY, UPLOAD_USER_KEY = newFieldNames.UPLOAD_USER_KEY, UPLOAD_TIME_KEY = newFieldNames.UPLOAD_TIME_KEY;
77
77
  useEffect(function () {
78
78
  if (fileList) {
79
79
  if (isImage) {
80
80
  setInnerFileList(fileList.map(function (i) {
81
- return __assign(__assign({}, i), { url: createDownloadLink(i[ATTACH_ID_KEY], {
81
+ return __assign(__assign({ uid: i[ATTACH_ID_KEY] ? i[ATTACH_ID_KEY] : i.uid }, i), {
82
+ // 针对图片类型的一些处理
83
+ url: createDownloadLink(i[ATTACH_ID_KEY], {
82
84
  API_BASEURL: API_BASEURL,
83
85
  open: isPublic,
84
86
  }) });
85
87
  }));
86
88
  }
87
89
  else {
88
- setInnerFileList(fileList);
90
+ if (listType === "text") {
91
+ setInnerFileList(fileList.map(function (i) {
92
+ return __assign(__assign({ uid: i[ATTACH_ID_KEY] ? i[ATTACH_ID_KEY] : i.uid }, i), {
93
+ // 针对listType='text' 的一些处理
94
+ name: i[ATTACH_NAME_KEY], size: i[ATTACH_SIZE_KEY] });
95
+ }));
96
+ }
97
+ else {
98
+ setInnerFileList(fileList.map(function (i) {
99
+ return __assign({ uid: i[ATTACH_ID_KEY] ? i[ATTACH_ID_KEY] : i.uid }, i);
100
+ }));
101
+ }
89
102
  }
90
103
  }
91
- }, [fileList, isImage, API_BASEURL, isPublic, ATTACH_ID_KEY]);
104
+ }, [
105
+ fileList,
106
+ isImage,
107
+ API_BASEURL,
108
+ isPublic,
109
+ listType,
110
+ ATTACH_NAME_KEY,
111
+ ATTACH_SIZE_KEY,
112
+ ATTACH_ID_KEY,
113
+ ]);
92
114
  var onChangeHandle = useCallback(function (info) {
93
115
  var _a;
94
116
  var _b, _c, _d, _e;
@@ -102,7 +124,8 @@ function useOnChange(props) {
102
124
  var _a;
103
125
  var _b, _c;
104
126
  var size = item.size, name = item.name, response = item.response;
105
- return __assign((_a = {}, _a[ATTACH_ID_KEY] = (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.attachId, _a[ATTACH_NAME_KEY] = name ? name : (_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.originalName, _a[ATTACH_SIZE_KEY] = size, _a[UPLOAD_TIME_KEY] = Date.now(), _a[UPLOAD_USER_KEY] = userName, _a), item);
127
+ var attachId = ((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.attachId) || (item === null || item === void 0 ? void 0 : item[ATTACH_ID_KEY]);
128
+ return __assign(__assign((_a = {}, _a[ATTACH_ID_KEY] = attachId, _a[ATTACH_NAME_KEY] = name ? name : (_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.originalName, _a[ATTACH_SIZE_KEY] = size, _a[UPLOAD_TIME_KEY] = Date.now(), _a[UPLOAD_USER_KEY] = userName, _a), item), { uid: attachId ? attachId : item.uid });
106
129
  });
107
130
  // antd 4 再React 18下的一个bug
108
131
  // 暂时先这么修复 强制更新
@@ -119,8 +142,24 @@ function useOnChange(props) {
119
142
  if (currentFileList.every(function (item) {
120
143
  return item.status === "done" || item.status === "error" || !item.status;
121
144
  })) {
122
- var successFileList = fileList.filter(function (item) { return item.status === "done" || !item.status; });
123
- var errorFileList = fileList.filter(function (item) { return item.status === "error"; });
145
+ var successFileList = fileList
146
+ .filter(function (item) { return item.status === "done" || !item.status; })
147
+ .map(function (item) {
148
+ var _a;
149
+ var _b, _c, _d;
150
+ var size = item.size, name = item.name, response = item.response;
151
+ var attachId = ((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.attachId) || (item === null || item === void 0 ? void 0 : item[ATTACH_ID_KEY]);
152
+ return __assign(__assign((_a = {}, _a[ATTACH_ID_KEY] = (_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.attachId, _a[ATTACH_NAME_KEY] = name ? name : (_d = response === null || response === void 0 ? void 0 : response.data) === null || _d === void 0 ? void 0 : _d.originalName, _a[ATTACH_SIZE_KEY] = size, _a[UPLOAD_TIME_KEY] = Date.now(), _a[UPLOAD_USER_KEY] = userName, _a), item), { uid: attachId ? attachId : item.uid });
153
+ });
154
+ var errorFileList = fileList
155
+ .filter(function (item) { return item.status === "error"; })
156
+ .map(function (item) {
157
+ var _a;
158
+ var _b, _c;
159
+ var size = item.size, name = item.name, response = item.response;
160
+ var attachId = ((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.attachId) || (item === null || item === void 0 ? void 0 : item[ATTACH_ID_KEY]);
161
+ return __assign(__assign((_a = {}, _a[ATTACH_ID_KEY] = attachId, _a[ATTACH_NAME_KEY] = name ? name : (_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.originalName, _a[ATTACH_SIZE_KEY] = size, _a[UPLOAD_TIME_KEY] = Date.now(), _a[UPLOAD_USER_KEY] = userName, _a), item), { uid: attachId ? attachId : item.uid });
162
+ });
124
163
  onChange &&
125
164
  onChange({
126
165
  file: currentFile,
@@ -147,20 +186,23 @@ function useOnChange(props) {
147
186
  ]);
148
187
  return {
149
188
  innerFileList: innerFileList,
150
- setInnerFileList: function (c) {
189
+ setInnerFileList: function (c, isTriggerChange) {
190
+ if (isTriggerChange === void 0) { isTriggerChange = true; }
151
191
  setInnerFileList(c);
152
- // 当删除附加时,需要手动触发这些操作
153
- var newFileList = typeof c === "function" ? c(innerFileList) : c;
154
- var successFileList = newFileList.filter(function (item) { return item.status === "done" || !item.status; });
155
- var errorFileList = newFileList.filter(function (item) { return item.status === "error"; });
156
- onChange &&
157
- onChange({
158
- file: null,
159
- isComplete: true,
160
- fileList: newFileList,
161
- successFileList: successFileList,
162
- errorFileList: errorFileList,
163
- });
192
+ if (isTriggerChange) {
193
+ // 当删除附加时,需要手动触发这些操作
194
+ var newFileList = typeof c === "function" ? c(innerFileList) : c;
195
+ var successFileList = newFileList.filter(function (item) { return item.status === "done" || !item.status; });
196
+ var errorFileList = newFileList.filter(function (item) { return item.status === "error"; });
197
+ onChange &&
198
+ onChange({
199
+ file: null,
200
+ isComplete: true,
201
+ fileList: newFileList,
202
+ successFileList: successFileList,
203
+ errorFileList: errorFileList,
204
+ });
205
+ }
164
206
  },
165
207
  onChangeHandle: onChangeHandle,
166
208
  };
@@ -293,11 +335,14 @@ function uploadFile(props) {
293
335
  }
294
336
  else {
295
337
  try {
296
- var result = JSON.parse(xhr.response);
338
+ var result = xhr.response
339
+ ? JSON.parse(xhr.response)
340
+ : { msg: "文件上传失败,请检查网络!" };
297
341
  reject();
298
342
  message.warning(result.msg || "文件上传失败!");
299
343
  }
300
344
  catch (err) {
345
+ reject();
301
346
  console.log(err);
302
347
  }
303
348
  }
@@ -306,7 +351,8 @@ function uploadFile(props) {
306
351
  xhr.upload.addEventListener("progress", function (event) {
307
352
  var loaded = event.loaded, total = event.total;
308
353
  var percent = exactRound(times(divide(loaded, total), 100), 2);
309
- onProgress(percent);
354
+ var percentNum = Number(percent);
355
+ onProgress(isNaN(percentNum) ? percent : percentNum);
310
356
  });
311
357
  if (headers) {
312
358
  for (_i = 0, _a = Object.entries(headers); _i < _a.length; _i++) {
@@ -1 +1 @@
1
- .ant-upload{font-feature-settings:"tnum";box-sizing:border-box;color:#000000a6;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;outline:0;padding:0}.ant-upload p{margin:0}.ant-upload-btn{display:block;outline:none;width:100%}.ant-upload input[type=file]{cursor:pointer}.ant-upload.ant-upload-select{display:inline-block}.ant-upload.ant-upload-disabled{color:#00000040;cursor:not-allowed}.ant-upload.ant-upload-select-picture-card{background-color:#fafafa;border:1px dashed #d9d9d9;border-radius:2px;cursor:pointer;height:104px;margin-bottom:8px;margin-right:8px;text-align:center;transition:border-color .3s;vertical-align:top;width:104px}.ant-upload.ant-upload-select-picture-card>.ant-upload{align-items:center;display:flex;height:100%;justify-content:center;text-align:center}.ant-upload.ant-upload-select-picture-card:hover{border-color:#5b76f6}.ant-upload-disabled.ant-upload.ant-upload-select-picture-card:hover{border-color:#d9d9d9}.ant-upload.ant-upload-drag{background:#fafafa;border:1px dashed #d9d9d9;border-radius:2px;cursor:pointer;height:100%;position:relative;text-align:center;transition:border-color .3s;width:100%}.ant-upload.ant-upload-drag .ant-upload{padding:16px 0}.ant-upload.ant-upload-drag.ant-upload-drag-hover:not(.ant-upload-disabled){border-color:#4255cf}.ant-upload.ant-upload-drag.ant-upload-disabled{cursor:not-allowed}.ant-upload.ant-upload-drag .ant-upload-btn{display:table;height:100%}.ant-upload.ant-upload-drag .ant-upload-drag-container{display:table-cell;vertical-align:middle}.ant-upload.ant-upload-drag:not(.ant-upload-disabled):hover{border-color:#879fff}.ant-upload.ant-upload-drag p.ant-upload-drag-icon{margin-bottom:20px}.ant-upload.ant-upload-drag p.ant-upload-drag-icon .anticon{color:#879fff;font-size:48px}.ant-upload.ant-upload-drag p.ant-upload-text{color:#000000d9;font-size:16px;margin:0 0 4px}.ant-upload.ant-upload-drag p.ant-upload-hint{color:#00000073;font-size:14px}.ant-upload.ant-upload-drag .anticon-plus{color:#00000040;font-size:30px;transition:all .3s}.ant-upload.ant-upload-drag .anticon-plus:hover,.ant-upload.ant-upload-drag:hover .anticon-plus{color:#00000073}.ant-upload-picture-card-wrapper{display:inline-block;width:100%}.ant-upload-picture-card-wrapper:before{content:"";display:table}.ant-upload-picture-card-wrapper:after{clear:both;content:"";display:table}.ant-upload-list{font-feature-settings:"tnum";box-sizing:border-box;color:#000000a6;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-upload-list:after,.ant-upload-list:before{content:"";display:table}.ant-upload-list:after{clear:both}.ant-upload-list-item{font-size:14px;height:22.001px;margin-top:8px;position:relative}.ant-upload-list-item-name{display:inline-block;line-height:1.5715;overflow:hidden;padding-left:22px;text-overflow:ellipsis;white-space:nowrap;width:100%}.ant-upload-list-item-card-actions{position:absolute;right:0}.ant-upload-list-item-card-actions-btn{opacity:0}.ant-upload-list-item-card-actions-btn.ant-btn-sm{height:22.001px;line-height:1;vertical-align:top}.ant-upload-list-item-card-actions.picture{line-height:0;top:22px}.ant-upload-list-item-card-actions-btn:focus,.ant-upload-list-item-card-actions.picture .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-card-actions .anticon{color:#00000073;transition:all .3s}.ant-upload-list-item-card-actions:hover .anticon{color:#000000a6}.ant-upload-list-item-info{height:100%;transition:background-color .3s}.ant-upload-list-item-info>span{display:block;height:100%;width:100%}.ant-upload-list-item-info .ant-upload-text-icon .anticon,.ant-upload-list-item-info .anticon-loading .anticon{color:#00000073;font-size:14px;position:absolute;top:5px}.ant-upload-list-item:hover .ant-upload-list-item-info{background-color:#f5f5f5}.ant-upload-list-item:hover .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-error,.ant-upload-list-item-error .ant-upload-list-item-card-actions .anticon,.ant-upload-list-item-error .ant-upload-list-item-name,.ant-upload-list-item-error .ant-upload-text-icon>.anticon{color:#ff4d4f}.ant-upload-list-item-error .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-progress{bottom:-12px;font-size:14px;line-height:0;padding-left:26px;position:absolute;width:100%}.ant-upload-list-picture .ant-upload-list-item,.ant-upload-list-picture-card .ant-upload-list-item{border:1px solid #d9d9d9;border-radius:2px;height:66px;padding:8px;position:relative}.ant-upload-list-picture .ant-upload-list-item:hover,.ant-upload-list-picture-card .ant-upload-list-item:hover{background:#0000}.ant-upload-list-picture .ant-upload-list-item-error,.ant-upload-list-picture-card .ant-upload-list-item-error{border-color:#ff4d4f}.ant-upload-list-picture .ant-upload-list-item:hover .ant-upload-list-item-info,.ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info{background:#0000}.ant-upload-list-picture .ant-upload-list-item-uploading,.ant-upload-list-picture-card .ant-upload-list-item-uploading{border-style:dashed}.ant-upload-list-picture .ant-upload-list-item-thumbnail,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail{height:48px;line-height:60px;opacity:.8;text-align:center;width:48px}.ant-upload-list-picture .ant-upload-list-item-thumbnail .anticon,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail .anticon{font-size:26px}.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#e6f7ff"],.ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#e6f7ff"]{fill:#fff2f0}.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#1890ff"],.ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#1890ff"]{fill:#ff4d4f}.ant-upload-list-picture .ant-upload-list-item-icon,.ant-upload-list-picture-card .ant-upload-list-item-icon{font-size:26px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.ant-upload-list-picture .ant-upload-list-item-icon .anticon,.ant-upload-list-picture-card .ant-upload-list-item-icon .anticon{font-size:26px}.ant-upload-list-picture .ant-upload-list-item-image,.ant-upload-list-picture-card .ant-upload-list-item-image{max-width:100%}.ant-upload-list-picture .ant-upload-list-item-thumbnail img,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{display:block;height:48px;overflow:hidden;width:48px}.ant-upload-list-picture .ant-upload-list-item-name,.ant-upload-list-picture-card .ant-upload-list-item-name{box-sizing:border-box;display:inline-block;line-height:44px;margin:0 0 0 8px;max-width:100%;overflow:hidden;padding-left:48px;padding-right:8px;text-overflow:ellipsis;transition:all .3s;white-space:nowrap}.ant-upload-list-picture .ant-upload-list-item-uploading .ant-upload-list-item-name,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-name{margin-bottom:12px}.ant-upload-list-picture .ant-upload-list-item-progress,.ant-upload-list-picture-card .ant-upload-list-item-progress{bottom:14px;margin-top:0;padding-left:56px;width:calc(100% - 24px)}.ant-upload-list-picture-card-container{display:inline-block;height:104px;margin:0 8px 8px 0;vertical-align:top;width:104px}.ant-upload-list-picture-card .ant-upload-list-item{height:100%;margin:0}.ant-upload-list-picture-card .ant-upload-list-item-info{height:100%;overflow:hidden;position:relative}.ant-upload-list-picture-card .ant-upload-list-item-info:before{background-color:#00000080;content:" ";height:100%;opacity:0;position:absolute;transition:all .3s;width:100%;z-index:1}.ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info:before{opacity:1}.ant-upload-list-picture-card .ant-upload-list-item-actions{left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%);transition:all .3s;white-space:nowrap;z-index:10}.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye{color:#ffffffd9;cursor:pointer;font-size:16px;margin:0 4px;transition:all .3s;width:16px;z-index:10}.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete:hover,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download:hover,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye:hover{color:#fff}.ant-upload-list-picture-card .ant-upload-list-item-actions:hover,.ant-upload-list-picture-card .ant-upload-list-item-info:hover+.ant-upload-list-item-actions{opacity:1}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{display:block;height:100%;object-fit:contain;position:static;width:100%}.ant-upload-list-picture-card .ant-upload-list-item-name{display:none;line-height:1.5715;margin:8px 0 0;padding:0;text-align:center}.ant-upload-list-picture-card .ant-upload-list-item-file+.ant-upload-list-item-name{bottom:10px;display:block;position:absolute}.ant-upload-list-picture-card .ant-upload-list-item-uploading.ant-upload-list-item{background-color:#fafafa}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info{height:auto}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-delete,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-eye,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info:before{display:none}.ant-upload-list-picture-card .ant-upload-list-item-progress{bottom:32px;padding-left:0;width:calc(100% - 14px)}.ant-upload-list-picture-container,.ant-upload-list-text-container{transition:opacity .3s,height .3s}.ant-upload-list-picture-container:before,.ant-upload-list-text-container:before{content:"";display:table;height:0;width:0}.ant-upload-list-picture-container .ant-upload-span,.ant-upload-list-text-container .ant-upload-span{display:block;flex:auto}.ant-upload-list-picture .ant-upload-span,.ant-upload-list-text .ant-upload-span{align-items:center;display:flex}.ant-upload-list-picture .ant-upload-span>*,.ant-upload-list-text .ant-upload-span>*{flex:none}.ant-upload-list-picture .ant-upload-list-item-name,.ant-upload-list-text .ant-upload-list-item-name{flex:auto;margin:0;padding:0 8px}.ant-upload-list-picture .ant-upload-list-item-card-actions,.ant-upload-list-text .ant-upload-list-item-card-actions,.ant-upload-list-text .ant-upload-text-icon .anticon{position:static}.ant-upload-list .ant-upload-animate-inline-appear,.ant-upload-list .ant-upload-animate-inline-enter,.ant-upload-list .ant-upload-animate-inline-leave{animation-duration:.3s;animation-fill-mode:forwards;animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-upload-list .ant-upload-animate-inline-appear,.ant-upload-list .ant-upload-animate-inline-enter{animation-name:uploadAnimateInlineIn}.ant-upload-list .ant-upload-animate-inline-leave{animation-name:uploadAnimateInlineOut}@keyframes uploadAnimateInlineIn{0%{height:0;margin:0;opacity:0;padding:0;width:0}}@keyframes uploadAnimateInlineOut{to{height:0;margin:0;opacity:0;padding:0;width:0}}.ant-upload-rtl{direction:rtl}.ant-upload-rtl.ant-upload.ant-upload-select-picture-card{margin-left:8px;margin-right:auto}.ant-upload-list-rtl{direction:rtl}.ant-upload-list-rtl .ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-1{padding-left:14px;padding-right:22px}.ant-upload-list-rtl .ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-2{padding-left:28px;padding-right:22px}.ant-upload-list-rtl .ant-upload-list-item-name{padding-left:0;padding-right:22px}.ant-upload-list-rtl .ant-upload-list-item-name-icon-count-1{padding-left:14px}.ant-upload-list-rtl .ant-upload-list-item-card-actions{left:0;right:auto}.ant-upload-list-rtl .ant-upload-list-item-card-actions .anticon{padding-left:5px;padding-right:0}.ant-upload-list-rtl .ant-upload-list-item-info{padding:0 4px 0 12px}.ant-upload-list-rtl .ant-upload-list-item-error .ant-upload-list-item-card-actions .anticon{padding-left:5px;padding-right:0}.ant-upload-list-rtl .ant-upload-list-item-progress{padding-left:0;padding-right:26px}.ant-upload-list-picture .ant-upload-list-item-info,.ant-upload-list-picture-card .ant-upload-list-item-info{padding:0}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-thumbnail,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-thumbnail{left:auto;right:8px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-icon,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-icon{left:auto;right:50%;transform:translate(50%,-50%)}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name{margin:0 8px 0 0;padding-left:8px;padding-right:48px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name-icon-count-1,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-1{padding-left:18px;padding-right:48px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name-icon-count-2,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-2{padding-left:36px;padding-right:48px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-progress,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-progress{padding-left:0;padding-right:0}.ant-upload-list-rtl .ant-upload-list-picture-card-container{margin:0 0 8px 8px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-actions{left:auto;right:50%;transform:translate(50%,-50%)}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-file+.ant-upload-list-item-name{margin:8px 0 0;padding:0}.ztxk-upload .ant-upload.ant-upload-select-picture-card{height:auto;width:auto}.ztxk-upload .ztxk-upload--picture{align-items:center;background-color:#fafafa;border:1px dashed #d9d9d9;border-radius:2px;cursor:pointer;display:flex;flex-direction:column;height:110px;justify-content:center;text-align:center;width:110px}.ztxk-upload .ant-upload-list-picture-card-container{height:110px;width:110px}.ztxk-upload .ztxk-upload--tips{margin-left:10px}.ztxk-upload .ztxk-table{margin-top:10px}.ztxk-upload .ztxk-table .ant-progress-text{width:1em}.ztxk-upload>button{margin-left:10px}.ztxk-upload>button:first-child{margin-left:0}.ztxk-upload-imgcrop .ant-modal-body>button{bottom:10px}
1
+ .ant-upload{font-feature-settings:"tnum";box-sizing:border-box;color:#000000a6;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;outline:0;padding:0}.ant-upload p{margin:0}.ant-upload-btn{display:block;outline:none;width:100%}.ant-upload input[type=file]{cursor:pointer}.ant-upload.ant-upload-select{display:inline-block}.ant-upload.ant-upload-disabled{color:#00000040;cursor:not-allowed}.ant-upload.ant-upload-select-picture-card{background-color:#fafafa;border:1px dashed #d9d9d9;border-radius:2px;cursor:pointer;height:104px;margin-bottom:8px;margin-right:8px;text-align:center;transition:border-color .3s;vertical-align:top;width:104px}.ant-upload.ant-upload-select-picture-card>.ant-upload{align-items:center;display:flex;height:100%;justify-content:center;text-align:center}.ant-upload.ant-upload-select-picture-card:hover{border-color:#5b76f6}.ant-upload-disabled.ant-upload.ant-upload-select-picture-card:hover{border-color:#d9d9d9}.ant-upload.ant-upload-drag{background:#fafafa;border:1px dashed #d9d9d9;border-radius:2px;cursor:pointer;height:100%;position:relative;text-align:center;transition:border-color .3s;width:100%}.ant-upload.ant-upload-drag .ant-upload{padding:16px 0}.ant-upload.ant-upload-drag.ant-upload-drag-hover:not(.ant-upload-disabled){border-color:#4255cf}.ant-upload.ant-upload-drag.ant-upload-disabled{cursor:not-allowed}.ant-upload.ant-upload-drag .ant-upload-btn{display:table;height:100%}.ant-upload.ant-upload-drag .ant-upload-drag-container{display:table-cell;vertical-align:middle}.ant-upload.ant-upload-drag:not(.ant-upload-disabled):hover{border-color:#879fff}.ant-upload.ant-upload-drag p.ant-upload-drag-icon{margin-bottom:20px}.ant-upload.ant-upload-drag p.ant-upload-drag-icon .anticon{color:#879fff;font-size:48px}.ant-upload.ant-upload-drag p.ant-upload-text{color:#000000d9;font-size:16px;margin:0 0 4px}.ant-upload.ant-upload-drag p.ant-upload-hint{color:#00000073;font-size:14px}.ant-upload.ant-upload-drag .anticon-plus{color:#00000040;font-size:30px;transition:all .3s}.ant-upload.ant-upload-drag .anticon-plus:hover,.ant-upload.ant-upload-drag:hover .anticon-plus{color:#00000073}.ant-upload-picture-card-wrapper{display:inline-block;width:100%}.ant-upload-picture-card-wrapper:before{content:"";display:table}.ant-upload-picture-card-wrapper:after{clear:both;content:"";display:table}.ant-upload-list{font-feature-settings:"tnum";box-sizing:border-box;color:#000000a6;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-upload-list:after,.ant-upload-list:before{content:"";display:table}.ant-upload-list:after{clear:both}.ant-upload-list-item{font-size:14px;height:22.001px;margin-top:8px;position:relative}.ant-upload-list-item-name{display:inline-block;line-height:1.5715;overflow:hidden;padding-left:22px;text-overflow:ellipsis;white-space:nowrap;width:100%}.ant-upload-list-item-card-actions{position:absolute;right:0}.ant-upload-list-item-card-actions-btn{opacity:0}.ant-upload-list-item-card-actions-btn.ant-btn-sm{height:22.001px;line-height:1;vertical-align:top}.ant-upload-list-item-card-actions.picture{line-height:0;top:22px}.ant-upload-list-item-card-actions-btn:focus,.ant-upload-list-item-card-actions.picture .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-card-actions .anticon{color:#00000073;transition:all .3s}.ant-upload-list-item-card-actions:hover .anticon{color:#000000a6}.ant-upload-list-item-info{height:100%;transition:background-color .3s}.ant-upload-list-item-info>span{display:block;height:100%;width:100%}.ant-upload-list-item-info .ant-upload-text-icon .anticon,.ant-upload-list-item-info .anticon-loading .anticon{color:#00000073;font-size:14px;position:absolute;top:5px}.ant-upload-list-item:hover .ant-upload-list-item-info{background-color:#f5f5f5}.ant-upload-list-item:hover .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-error,.ant-upload-list-item-error .ant-upload-list-item-card-actions .anticon,.ant-upload-list-item-error .ant-upload-list-item-name,.ant-upload-list-item-error .ant-upload-text-icon>.anticon{color:#ff4d4f}.ant-upload-list-item-error .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-progress{bottom:-12px;font-size:14px;line-height:0;padding-left:26px;position:absolute;width:100%}.ant-upload-list-picture .ant-upload-list-item,.ant-upload-list-picture-card .ant-upload-list-item{border:1px solid #d9d9d9;border-radius:2px;height:66px;padding:8px;position:relative}.ant-upload-list-picture .ant-upload-list-item:hover,.ant-upload-list-picture-card .ant-upload-list-item:hover{background:#0000}.ant-upload-list-picture .ant-upload-list-item-error,.ant-upload-list-picture-card .ant-upload-list-item-error{border-color:#ff4d4f}.ant-upload-list-picture .ant-upload-list-item:hover .ant-upload-list-item-info,.ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info{background:#0000}.ant-upload-list-picture .ant-upload-list-item-uploading,.ant-upload-list-picture-card .ant-upload-list-item-uploading{border-style:dashed}.ant-upload-list-picture .ant-upload-list-item-thumbnail,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail{height:48px;line-height:60px;opacity:.8;text-align:center;width:48px}.ant-upload-list-picture .ant-upload-list-item-thumbnail .anticon,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail .anticon{font-size:26px}.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#e6f7ff"],.ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#e6f7ff"]{fill:#fff2f0}.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#1890ff"],.ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#1890ff"]{fill:#ff4d4f}.ant-upload-list-picture .ant-upload-list-item-icon,.ant-upload-list-picture-card .ant-upload-list-item-icon{font-size:26px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.ant-upload-list-picture .ant-upload-list-item-icon .anticon,.ant-upload-list-picture-card .ant-upload-list-item-icon .anticon{font-size:26px}.ant-upload-list-picture .ant-upload-list-item-image,.ant-upload-list-picture-card .ant-upload-list-item-image{max-width:100%}.ant-upload-list-picture .ant-upload-list-item-thumbnail img,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{display:block;height:48px;overflow:hidden;width:48px}.ant-upload-list-picture .ant-upload-list-item-name,.ant-upload-list-picture-card .ant-upload-list-item-name{box-sizing:border-box;display:inline-block;line-height:44px;margin:0 0 0 8px;max-width:100%;overflow:hidden;padding-left:48px;padding-right:8px;text-overflow:ellipsis;transition:all .3s;white-space:nowrap}.ant-upload-list-picture .ant-upload-list-item-uploading .ant-upload-list-item-name,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-name{margin-bottom:12px}.ant-upload-list-picture .ant-upload-list-item-progress,.ant-upload-list-picture-card .ant-upload-list-item-progress{bottom:14px;margin-top:0;padding-left:56px;width:calc(100% - 24px)}.ant-upload-list-picture-card-container{display:inline-block;height:104px;margin:0 8px 8px 0;vertical-align:top;width:104px}.ant-upload-list-picture-card .ant-upload-list-item{height:100%;margin:0}.ant-upload-list-picture-card .ant-upload-list-item-info{height:100%;overflow:hidden;position:relative}.ant-upload-list-picture-card .ant-upload-list-item-info:before{background-color:#00000080;content:" ";height:100%;opacity:0;position:absolute;transition:all .3s;width:100%;z-index:1}.ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info:before{opacity:1}.ant-upload-list-picture-card .ant-upload-list-item-actions{left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%);transition:all .3s;white-space:nowrap;z-index:10}.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye{color:#ffffffd9;cursor:pointer;font-size:16px;margin:0 4px;transition:all .3s;width:16px;z-index:10}.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete:hover,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download:hover,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye:hover{color:#fff}.ant-upload-list-picture-card .ant-upload-list-item-actions:hover,.ant-upload-list-picture-card .ant-upload-list-item-info:hover+.ant-upload-list-item-actions{opacity:1}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{display:block;height:100%;object-fit:contain;position:static;width:100%}.ant-upload-list-picture-card .ant-upload-list-item-name{display:none;line-height:1.5715;margin:8px 0 0;padding:0;text-align:center}.ant-upload-list-picture-card .ant-upload-list-item-file+.ant-upload-list-item-name{bottom:10px;display:block;position:absolute}.ant-upload-list-picture-card .ant-upload-list-item-uploading.ant-upload-list-item{background-color:#fafafa}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info{height:auto}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-delete,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-eye,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info:before{display:none}.ant-upload-list-picture-card .ant-upload-list-item-progress{bottom:32px;padding-left:0;width:calc(100% - 14px)}.ant-upload-list-picture-container,.ant-upload-list-text-container{transition:opacity .3s,height .3s}.ant-upload-list-picture-container:before,.ant-upload-list-text-container:before{content:"";display:table;height:0;width:0}.ant-upload-list-picture-container .ant-upload-span,.ant-upload-list-text-container .ant-upload-span{display:block;flex:auto}.ant-upload-list-picture .ant-upload-span,.ant-upload-list-text .ant-upload-span{align-items:center;display:flex}.ant-upload-list-picture .ant-upload-span>*,.ant-upload-list-text .ant-upload-span>*{flex:none}.ant-upload-list-picture .ant-upload-list-item-name,.ant-upload-list-text .ant-upload-list-item-name{flex:auto;margin:0;padding:0 8px}.ant-upload-list-picture .ant-upload-list-item-card-actions,.ant-upload-list-text .ant-upload-list-item-card-actions,.ant-upload-list-text .ant-upload-text-icon .anticon{position:static}.ant-upload-list .ant-upload-animate-inline-appear,.ant-upload-list .ant-upload-animate-inline-enter,.ant-upload-list .ant-upload-animate-inline-leave{animation-duration:.3s;animation-fill-mode:forwards;animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-upload-list .ant-upload-animate-inline-appear,.ant-upload-list .ant-upload-animate-inline-enter{animation-name:uploadAnimateInlineIn}.ant-upload-list .ant-upload-animate-inline-leave{animation-name:uploadAnimateInlineOut}@keyframes uploadAnimateInlineIn{0%{height:0;margin:0;opacity:0;padding:0;width:0}}@keyframes uploadAnimateInlineOut{to{height:0;margin:0;opacity:0;padding:0;width:0}}.ant-upload-rtl{direction:rtl}.ant-upload-rtl.ant-upload.ant-upload-select-picture-card{margin-left:8px;margin-right:auto}.ant-upload-list-rtl{direction:rtl}.ant-upload-list-rtl .ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-1{padding-left:14px;padding-right:22px}.ant-upload-list-rtl .ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-2{padding-left:28px;padding-right:22px}.ant-upload-list-rtl .ant-upload-list-item-name{padding-left:0;padding-right:22px}.ant-upload-list-rtl .ant-upload-list-item-name-icon-count-1{padding-left:14px}.ant-upload-list-rtl .ant-upload-list-item-card-actions{left:0;right:auto}.ant-upload-list-rtl .ant-upload-list-item-card-actions .anticon{padding-left:5px;padding-right:0}.ant-upload-list-rtl .ant-upload-list-item-info{padding:0 4px 0 12px}.ant-upload-list-rtl .ant-upload-list-item-error .ant-upload-list-item-card-actions .anticon{padding-left:5px;padding-right:0}.ant-upload-list-rtl .ant-upload-list-item-progress{padding-left:0;padding-right:26px}.ant-upload-list-picture .ant-upload-list-item-info,.ant-upload-list-picture-card .ant-upload-list-item-info{padding:0}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-thumbnail,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-thumbnail{left:auto;right:8px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-icon,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-icon{left:auto;right:50%;transform:translate(50%,-50%)}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name{margin:0 8px 0 0;padding-left:8px;padding-right:48px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name-icon-count-1,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-1{padding-left:18px;padding-right:48px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name-icon-count-2,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-2{padding-left:36px;padding-right:48px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-progress,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-progress{padding-left:0;padding-right:0}.ant-upload-list-rtl .ant-upload-list-picture-card-container{margin:0 0 8px 8px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-actions{left:auto;right:50%;transform:translate(50%,-50%)}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-file+.ant-upload-list-item-name{margin:8px 0 0;padding:0}.ztxk-upload .ant-upload.ant-upload-select-picture-card{height:auto;width:auto}.ztxk-upload .ztxk-upload--picture{align-items:center;background-color:#fafafa;border:1px dashed #d9d9d9;border-radius:2px;cursor:pointer;display:flex;flex-direction:column;height:110px;justify-content:center;text-align:center;width:110px}.ztxk-upload .ant-upload-list-picture-card-container{height:110px;width:110px}.ztxk-upload .ztxk-upload--tips{margin-left:10px}.ztxk-upload .ztxk-table{margin-top:10px}.ztxk-upload .ztxk-table .ztxk-upload--progress{align-items:center;display:flex;justify-content:center}.ztxk-upload .ztxk-table .ztxk-upload--progress .ant-progress-text{width:30px}.ztxk-upload>button{margin-left:10px}.ztxk-upload>button:first-child{margin-left:0}.ztxk-upload-imgcrop .ant-modal-body>button{bottom:10px}
@@ -60,6 +60,7 @@ var UploadList = function (props, ref) {
60
60
  isPublic: isPublic,
61
61
  API_BASEURL: API_BASEURL,
62
62
  newFieldNames: newFieldNames,
63
+ listType: listType,
63
64
  }), onChangeHandle = _g.onChangeHandle, innerFileList = _g.innerFileList, setInnerFileList = _g.setInnerFileList;
64
65
  // 基础参数
65
66
  var _h = useBasicInfo({
@@ -147,7 +147,13 @@ var UploadTable = function (_a, ref) {
147
147
  if (record.status === "error") {
148
148
  return (jsx(ButtonCom, __assign({ type: "link", style: { color: "#ff4d4f" }, onClick: function () { return onReloadUploadHandle(record, index); } }, { children: "\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF0C\u91CD\u65B0\u4E0A\u4F20" })));
149
149
  }
150
- return (jsx(Progress, { percent: (_b = (_a = record === null || record === void 0 ? void 0 : record.percent) === null || _a === void 0 ? void 0 : _a.toFixed) === null || _b === void 0 ? void 0 : _b.call(_a, 2), status: status }));
150
+ var percent = (_b = (_a = record === null || record === void 0 ? void 0 : record.percent) === null || _a === void 0 ? void 0 : _a.toFixed) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
151
+ // 要状态 和 进度都是完成时,才能把进度设置成100%
152
+ if (percent + "" === "100" &&
153
+ (record.status === "uploading" || record.status === "error")) {
154
+ percent = 99;
155
+ }
156
+ return (jsx(Progress, { className: "ztxk-upload--progress", percent: percent, status: status }));
151
157
  },
152
158
  },
153
159
  {
@@ -230,14 +236,14 @@ var UploadTable = function (_a, ref) {
230
236
  var newInnerFileList = innerFileList.slice();
231
237
  newInnerFileList.splice(index, 1, __assign(__assign({}, record), { status: "uploading", percent: percent }));
232
238
  return newInnerFileList;
233
- });
239
+ }, false);
234
240
  },
235
241
  })
236
242
  .then(function (res) {
237
243
  setLoading(false);
238
244
  setInnerFileList(function (innerFileList) {
239
245
  var newInnerFileList = innerFileList.slice();
240
- newInnerFileList.splice(index, 1, __assign(__assign({}, record), { attachId: res === null || res === void 0 ? void 0 : res.attachId, status: "done", percent: "100%" }));
246
+ newInnerFileList.splice(index, 1, __assign(__assign({}, record), { attachId: res === null || res === void 0 ? void 0 : res.attachId, status: "done", percent: 100 }));
241
247
  return newInnerFileList;
242
248
  });
243
249
  })
@@ -245,7 +251,7 @@ var UploadTable = function (_a, ref) {
245
251
  setLoading(false);
246
252
  setInnerFileList(function (innerFileList) {
247
253
  var newInnerFileList = innerFileList.slice();
248
- newInnerFileList.splice(index, 1, __assign(__assign({}, record), { status: "error", percent: "0" }));
254
+ newInnerFileList.splice(index, 1, __assign(__assign({}, record), { status: "error", percent: 0 }));
249
255
  return newInnerFileList;
250
256
  });
251
257
  });