ztxkui 4.3.29 → 4.3.31

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.
@@ -585,7 +585,9 @@ var PrintContainer = function (_a) {
585
585
  // 生成pdf
586
586
  var onPdfHandleFn = function (_a) {
587
587
  var pdfOptions = _a.pdfOptions, imgPositionX = _a.imgPositionX;
588
- setSpinning(true);
588
+ setTimeout(function () {
589
+ setSpinning(true);
590
+ });
589
591
  htmlToPdf({
590
592
  dom: containerRef.current,
591
593
  pdfName: pdfName,
@@ -811,7 +813,7 @@ var PrintContainer = function (_a) {
811
813
  ? pdfBase64.map(function (base64, index) {
812
814
  var _a, _b;
813
815
  var title = ((_b = (_a = allDom[index]) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.title) ||
814
- pdfName ||
816
+ pdfName + "-" + (index + 1) ||
815
817
  "\u5355\u636E" + (index + 1);
816
818
  return dataURLtoFile(base64, title + ".pdf");
817
819
  })
@@ -832,6 +834,7 @@ var PrintContainer = function (_a) {
832
834
  url: '/api/zmdms-resource/seal/confirm-seal-position',
833
835
  method: 'POST',
834
836
  data: formData,
837
+ timeout: 300000,
835
838
  headers: {
836
839
  'Content-Type': 'multipart/form-data',
837
840
  },
@@ -883,7 +886,8 @@ var PrintContainer = function (_a) {
883
886
  deptId: deptId,
884
887
  needWatermark: needWatermark,
885
888
  },
886
- heaers: {
889
+ timeout: 300000,
890
+ headers: {
887
891
  'Content-Type': 'application/json',
888
892
  },
889
893
  })
@@ -960,7 +964,7 @@ var PrintContainer = function (_a) {
960
964
  ? pdfBase64.map(function (base64, index) {
961
965
  var _a, _b;
962
966
  var title = ((_b = (_a = allDom[index]) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.title) ||
963
- pdfName ||
967
+ pdfName + "-" + (index + 1) ||
964
968
  "\u5355\u636E" + (index + 1);
965
969
  return dataURLtoFile(base64, title + ".pdf");
966
970
  })
@@ -994,6 +998,7 @@ var PrintContainer = function (_a) {
994
998
  headers: {
995
999
  'Content-Type': 'multipart/form-data',
996
1000
  },
1001
+ timeout: 300000,
997
1002
  })
998
1003
  .then(function (res) {
999
1004
  var _a;
@@ -1053,7 +1058,9 @@ var PrintContainer = function (_a) {
1053
1058
  });
1054
1059
  };
1055
1060
  var onExportSealFileHandleFn = function (options, isZip) {
1056
- setSpinning(true);
1061
+ setTimeout(function () {
1062
+ setSpinning(true);
1063
+ });
1057
1064
  // 文件还在加载中
1058
1065
  if (!fontTTF.data) {
1059
1066
  loadFontTTFPromise
@@ -1252,7 +1259,7 @@ var PrintContainer = function (_a) {
1252
1259
  ? pdfBase64.map(function (base64, index) {
1253
1260
  var _a, _b;
1254
1261
  var title = ((_b = (_a = allDom[index]) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.title) ||
1255
- pdfName ||
1262
+ pdfName + "-" + (index + 1) ||
1256
1263
  "\u5355\u636E" + (index + 1);
1257
1264
  return dataURLtoFile(base64, title + ".pdf");
1258
1265
  })
@@ -1292,7 +1299,7 @@ var PrintContainer = function (_a) {
1292
1299
  ? pdfBase64.map(function (base64, index) {
1293
1300
  var _a, _b;
1294
1301
  var title = ((_b = (_a = allDom[index]) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.title) ||
1295
- pdfName ||
1302
+ pdfName + "-" + (index + 1) ||
1296
1303
  "\u5355\u636E" + (index + 1);
1297
1304
  return dataURLtoFile(base64, title + ".pdf");
1298
1305
  })
@@ -18,6 +18,7 @@ export function autoSealThenDownloadFilesHandle(request, formData, options) {
18
18
  'Content-Type': 'multipart/form-data',
19
19
  },
20
20
  responseType: 'blob',
21
+ timeout: 300000,
21
22
  })
22
23
  .then(function (res) {
23
24
  var _a;
@@ -35,11 +36,14 @@ export function autoSealThenDownloadFilesHandle(request, formData, options) {
35
36
  }
36
37
  var aLink = document.createElement('a');
37
38
  aLink.style.display = 'none';
38
- aLink.href = window.URL.createObjectURL(blob);
39
- aLink.download = fileNameStr === null || fileNameStr === void 0 ? void 0 : fileNameStr.replaceAll('"', '');
39
+ var href = window.URL.createObjectURL(blob);
40
+ aLink.href = href;
41
+ // aLink.download = fileNameStr?.replaceAll('"', '');
42
+ aLink.download = fileNameStr === null || fileNameStr === void 0 ? void 0 : fileNameStr.replace(/"/g, '');
40
43
  document.body.appendChild(aLink);
41
44
  aLink.click();
42
45
  document.body.removeChild(aLink);
46
+ window.URL.revokeObjectURL(href);
43
47
  })
44
48
  .catch(function (err) {
45
49
  var _a, _b, _c;
@@ -3,3 +3,5 @@
3
3
  */
4
4
  export declare const dynamicColumnDragType: unique symbol;
5
5
  export declare const tableDragRowType: unique symbol;
6
+ export declare const INNER_PARENT_ROW_KEY = "__inner__parent__row__key_cyx";
7
+ export declare const INNER_PARENT_ROW_KEY_NO = "__inner__parent__row__key_cyx_no";
@@ -3,3 +3,5 @@
3
3
  */
4
4
  export var dynamicColumnDragType = Symbol('dynamic-column-drag');
5
5
  export var tableDragRowType = Symbol('table-drag-row');
6
+ export var INNER_PARENT_ROW_KEY = '__inner__parent__row__key_cyx';
7
+ export var INNER_PARENT_ROW_KEY_NO = '__inner__parent__row__key_cyx_no';
@@ -36,6 +36,7 @@ interface IProps<RecordType> {
36
36
  preDataSource?: any;
37
37
  rowKey?: any;
38
38
  dataSourceRef?: any;
39
+ expandableChildrenColumnName?: string;
39
40
  }
40
41
  export declare const getTableLayoutFullData: (columns: any, tableLayout: any) => any;
41
42
  export declare const LOCALSTORAGE_KEY = "ztui_dynamic_table_key";
@@ -155,7 +155,7 @@ export function setDynamicKey(dynamicStorageKey, value) {
155
155
  localStorage.setItem(LOCALSTORAGE_LRU_KEY, JSON.stringify(lruKeys));
156
156
  }
157
157
  function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig) {
158
- var columns = basicConfig.columns, newColumnsRef = basicConfig.newColumnsRef, showColumnDynamic = basicConfig.showColumnDynamic, showColumnDynamicKey = basicConfig.showColumnDynamicKey, configInfo = basicConfig.configInfo, currentDataSource = basicConfig.currentDataSource, preDataSource = basicConfig.preDataSource, rowKey = basicConfig.rowKey, dataSourceRef = basicConfig.dataSourceRef;
158
+ var columns = basicConfig.columns, newColumnsRef = basicConfig.newColumnsRef, showColumnDynamic = basicConfig.showColumnDynamic, showColumnDynamicKey = basicConfig.showColumnDynamicKey, configInfo = basicConfig.configInfo, currentDataSource = basicConfig.currentDataSource, preDataSource = basicConfig.preDataSource, rowKey = basicConfig.rowKey, dataSourceRef = basicConfig.dataSourceRef, expandableChildrenColumnName = basicConfig.expandableChildrenColumnName;
159
159
  var onEditableSave = editableConfig.onEditableSave, onTableChange = editableConfig.onTableChange, currentPage = editableConfig.currentPage;
160
160
  var ColumnDynamicCom = dynamicConfig.ColumnDynamicCom, DelAllCom = dynamicConfig.DelAllCom, onAddAndDelHandleMemo = dynamicConfig.onAddAndDelHandleMemo, onAddAndDelHandle = dynamicConfig.onAddAndDelHandle, hideAddIcon = dynamicConfig.hideAddIcon, addIconText = dynamicConfig.addIconText, hideDelIcon = dynamicConfig.hideDelIcon, delIconText = dynamicConfig.delIconText;
161
161
  var copyByKey = otherConfig.copyByKey, myCatchColumns = otherConfig.myCatchColumns;
@@ -210,14 +210,17 @@ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig)
210
210
  _column.shouldCellUpdate = function (record, preRecord) {
211
211
  try {
212
212
  var recordKey_1 = record[rowKey];
213
- var currentIndex = currentDataSource.findIndex(function (item) { return item[rowKey] === recordKey_1; });
214
- var preIndex = preDataSource.findIndex(function (item) { return item[rowKey] === recordKey_1; });
215
- if (currentIndex !== preIndex) {
216
- return true;
217
- }
218
- if (typeof _column.dataIndex === 'string' &&
219
- record[_column.dataIndex] !== preRecord[_column.dataIndex]) {
220
- return true;
213
+ if (Array.isArray(currentDataSource) &&
214
+ Array.isArray(preDataSource)) {
215
+ var currentIndex = currentDataSource.findIndex(function (item) { return item[rowKey] === recordKey_1; });
216
+ var preIndex = preDataSource.findIndex(function (item) { return item[rowKey] === recordKey_1; });
217
+ if (currentIndex !== preIndex) {
218
+ return true;
219
+ }
220
+ if (typeof _column.dataIndex === 'string' &&
221
+ record[_column.dataIndex] !== preRecord[_column.dataIndex]) {
222
+ return true;
223
+ }
221
224
  }
222
225
  }
223
226
  catch (err) {
@@ -247,6 +250,8 @@ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig)
247
250
  onTableChange: onTableChange,
248
251
  dataSource: function () { return dataSourceRef.current; },
249
252
  currentpage: currentPage,
253
+ rowKey: rowKey,
254
+ expandableChildrenColumnName: expandableChildrenColumnName,
250
255
  });
251
256
  } });
252
257
  // 兼容下拉框滚动行为
@@ -354,7 +359,7 @@ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig)
354
359
  };
355
360
  }
356
361
  function useColumns(props) {
357
- var columns = props.columns, hiddenColumnDynamicIcon = props.hiddenColumnDynamicIcon, showColumnDynamic = props.showColumnDynamic, showColumnDynamicKey = props.showColumnDynamicKey, onAddAndDelHandle = props.onAddAndDelHandle, hideAddIcon = props.hideAddIcon, showDelAllBtn = props.showDelAllBtn, delAllChange = props.delAllChange, addIconText = props.addIconText, hideDelIcon = props.hideDelIcon, delIconText = props.delIconText, showDynamicHandle = props.showDynamicHandle, onEditableSave = props.onEditableSave, configInfo = props.configInfo, copyByKey = props.copyByKey, onTableChange = props.onTableChange, currentPage = props.currentPage, currentDataSource = props.currentDataSource, preDataSource = props.preDataSource, rowKey = props.rowKey, dataSourceRef = props.dataSourceRef;
362
+ var columns = props.columns, hiddenColumnDynamicIcon = props.hiddenColumnDynamicIcon, showColumnDynamic = props.showColumnDynamic, showColumnDynamicKey = props.showColumnDynamicKey, onAddAndDelHandle = props.onAddAndDelHandle, hideAddIcon = props.hideAddIcon, showDelAllBtn = props.showDelAllBtn, delAllChange = props.delAllChange, addIconText = props.addIconText, hideDelIcon = props.hideDelIcon, delIconText = props.delIconText, showDynamicHandle = props.showDynamicHandle, onEditableSave = props.onEditableSave, configInfo = props.configInfo, copyByKey = props.copyByKey, onTableChange = props.onTableChange, currentPage = props.currentPage, currentDataSource = props.currentDataSource, preDataSource = props.preDataSource, rowKey = props.rowKey, dataSourceRef = props.dataSourceRef, expandableChildrenColumnName = props.expandableChildrenColumnName;
358
363
  var newColumnsRef = useRef();
359
364
  // 动态列配置显隐
360
365
  var ColumnDynamicCom = useCallback(function () {
@@ -387,6 +392,7 @@ function useColumns(props) {
387
392
  preDataSource: preDataSource,
388
393
  rowKey: rowKey,
389
394
  dataSourceRef: dataSourceRef,
395
+ expandableChildrenColumnName: expandableChildrenColumnName,
390
396
  }, {
391
397
  onEditableSave: onEditableSave,
392
398
  onTableChange: onTableChange,
@@ -424,6 +430,7 @@ function useColumns(props) {
424
430
  preDataSource,
425
431
  rowKey,
426
432
  dataSourceRef,
433
+ expandableChildrenColumnName,
427
434
  ]);
428
435
  var _a = useState(false), refreshColumns = _a[0], setRefreshColumns = _a[1];
429
436
  var _b = useState([]), myCatchColumns = _b[0], setMyCatchColumns = _b[1];
@@ -63,6 +63,7 @@ import { Input } from 'antd';
63
63
  import { ERROR_TD_CLASSNAME } from './index';
64
64
  import { getInnerIndex } from './hooks/useInnerPagination';
65
65
  import { exactRound } from 'ztxkutils/dist/tools';
66
+ import { INNER_PARENT_ROW_KEY_NO, INNER_PARENT_ROW_KEY } from './constants';
66
67
  /**
67
68
  * 数据转换 将粘贴过来的数据格式化处理
68
69
  */
@@ -87,7 +88,7 @@ function transformData(data, config) {
87
88
  return newData;
88
89
  }
89
90
  var TableEnhanceCell = function (_a) {
90
- var title = _a.title, index = _a.index, editable = _a.editable, editableConfig = _a.editableConfig, children = _a.children, dataIndex = _a.dataIndex, record = _a.record, handleSave = _a.handleSave, dataSource = _a.dataSource, onTableChange = _a.onTableChange, columns = _a.columns, currentpage = _a.currentpage, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, restProps = __rest(_a, ["title", "index", "editable", "editableConfig", "children", "dataIndex", "record", "handleSave", "dataSource", "onTableChange", "columns", "currentpage", "onMouseEnter", "onMouseLeave"]);
91
+ var title = _a.title, index = _a.index, editable = _a.editable, editableConfig = _a.editableConfig, children = _a.children, dataIndex = _a.dataIndex, record = _a.record, handleSave = _a.handleSave, dataSource = _a.dataSource, onTableChange = _a.onTableChange, columns = _a.columns, currentpage = _a.currentpage, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, rowKey = _a.rowKey, expandableChildrenColumnName = _a.expandableChildrenColumnName, restProps = __rest(_a, ["title", "index", "editable", "editableConfig", "children", "dataIndex", "record", "handleSave", "dataSource", "onTableChange", "columns", "currentpage", "onMouseEnter", "onMouseLeave", "rowKey", "expandableChildrenColumnName"]);
91
92
  var tdRef = useRef();
92
93
  var valueRef = useRef({});
93
94
  var _b = useState(), val = _b[0], setVal = _b[1];
@@ -103,14 +104,43 @@ var TableEnhanceCell = function (_a) {
103
104
  * @description 保存事件
104
105
  */
105
106
  var save = useCallback(function (info) { return __awaiter(void 0, void 0, void 0, function () {
106
- var innerIndex, newDataSource, newRecord, values, result, currentInputNumberValue, result, currentInputNumberValue;
107
+ var innerIndex, newDataSource, newRecord, parentId_1, currentParentItem, parentIndex, currentParentItemChildren, childrenRecord, values, result, currentInputNumberValue, result, currentInputNumberValue;
107
108
  var _a, _b, _c;
108
109
  return __generator(this, function (_d) {
109
110
  innerIndex = getInnerIndex(currentpage, index);
110
111
  newDataSource = dataSource ? dataSource() : undefined;
111
- newRecord = Array.isArray(newDataSource) && typeof index === 'number'
112
- ? newDataSource[index]
113
- : record;
112
+ newRecord = record;
113
+ // 代表当前修改的是子项,需要通过rowKey找到父项中对应的子项,取到最新值
114
+ if (newRecord && newRecord[INNER_PARENT_ROW_KEY]) {
115
+ try {
116
+ innerIndex = typeof index === 'number' ? index : innerIndex;
117
+ parentId_1 = newRecord[INNER_PARENT_ROW_KEY];
118
+ currentParentItem = null;
119
+ // 代表没有配置rowKey,那需要找到父级index
120
+ if (parentId_1.startsWith(INNER_PARENT_ROW_KEY_NO)) {
121
+ parentIndex = parentId_1.slice(INNER_PARENT_ROW_KEY_NO.length) - 0;
122
+ currentParentItem = newDataSource[parentIndex];
123
+ }
124
+ else {
125
+ currentParentItem = newDataSource.find(function (item) { return item[rowKey] === parentId_1; });
126
+ }
127
+ currentParentItemChildren = currentParentItem[expandableChildrenColumnName];
128
+ childrenRecord = typeof index === 'number'
129
+ ? __assign({}, currentParentItemChildren[index]) : record;
130
+ Reflect.deleteProperty(childrenRecord, INNER_PARENT_ROW_KEY);
131
+ newRecord = typeof index === 'number' ? childrenRecord : record;
132
+ }
133
+ catch (err) {
134
+ console.log(err);
135
+ }
136
+ }
137
+ else {
138
+ // 直接取父级元素即可
139
+ newRecord =
140
+ Array.isArray(newDataSource) && typeof innerIndex === 'number'
141
+ ? newDataSource[innerIndex]
142
+ : record;
143
+ }
114
144
  try {
115
145
  values = valueRef.current;
116
146
  if (!handleSave) {
@@ -141,7 +171,17 @@ var TableEnhanceCell = function (_a) {
141
171
  }
142
172
  return [2 /*return*/];
143
173
  });
144
- }); }, [currentpage, dataIndex, handleSave, index, record, title, dataSource]);
174
+ }); }, [
175
+ currentpage,
176
+ dataIndex,
177
+ handleSave,
178
+ index,
179
+ record,
180
+ title,
181
+ dataSource,
182
+ expandableChildrenColumnName,
183
+ rowKey,
184
+ ]);
145
185
  var removeErrorClass = useCallback(function () {
146
186
  var _a, _b;
147
187
  if (tdRef.current &&
@@ -81,6 +81,7 @@ import { HTML5Backend } from 'react-dnd-html5-backend';
81
81
  import { DndProvider } from 'react-dnd';
82
82
  // import update from 'immutability-helper';
83
83
  import useInnerPagination, { getInnerIndex } from './hooks/useInnerPagination';
84
+ import { INNER_PARENT_ROW_KEY, INNER_PARENT_ROW_KEY_NO } from './constants';
84
85
  /**默认scroll配置 */
85
86
  // const _scroll = { y: 500, x: 1000 };
86
87
  var _scroll = { x: 1000 };
@@ -113,17 +114,18 @@ export function usePrevious(value) {
113
114
  }
114
115
  function Table(props) {
115
116
  var _this = this;
116
- var className = props.className, scroll = props.scroll, _a = props.pagination, pagination = _a === void 0 ? false : _a, _b = props.bordered, bordered = _b === void 0 ? true : _b, _columns = props.columns, initColumns = props.initColumns, dataSource = props.dataSource, onAddAndDelHandle = props.onAddAndDelHandle, hideAddIcon = props.hideAddIcon, addIconText = props.addIconText, hideDelIcon = props.hideDelIcon, showDelAllBtn = props.showDelAllBtn, delAllChange = props.delAllChange, delIconText = props.delIconText, hiddenColumnDynamicIcon = props.hiddenColumnDynamicIcon, showColumnDynamic = props.showColumnDynamic, showColumnDynamicKey = props.showColumnDynamicKey, summaryConfig = props.summaryConfig, summaryFixed = props.summaryFixed, summary = props.summary, onMoveRow = props.onMoveRow, onEditableSave = props.onEditableSave, onDynamicChange = props.onDynamicChange, _c = props.isResizableColumn, isResizableColumn = _c === void 0 ? true : _c, configInfo = props.configInfo, tableHandleRef = props.tableHandleRef, tableName = props.tableName, isFlex = props.isFlex, onTableChange = props.onTableChange, rowSelection = props.rowSelection, showInnerPagination = props.showInnerPagination, defaultInnerPageSize = props.defaultInnerPageSize, restProps = __rest(props, ["className", "scroll", "pagination", "bordered", "columns", "initColumns", "dataSource", "onAddAndDelHandle", "hideAddIcon", "addIconText", "hideDelIcon", "showDelAllBtn", "delAllChange", "delIconText", "hiddenColumnDynamicIcon", "showColumnDynamic", "showColumnDynamicKey", "summaryConfig", "summaryFixed", "summary", "onMoveRow", "onEditableSave", "onDynamicChange", "isResizableColumn", "configInfo", "tableHandleRef", "tableName", "isFlex", "onTableChange", "rowSelection", "showInnerPagination", "defaultInnerPageSize"]);
117
+ var _a, _b;
118
+ var className = props.className, scroll = props.scroll, _c = props.pagination, pagination = _c === void 0 ? false : _c, _d = props.bordered, bordered = _d === void 0 ? true : _d, _columns = props.columns, initColumns = props.initColumns, dataSource = props.dataSource, onAddAndDelHandle = props.onAddAndDelHandle, hideAddIcon = props.hideAddIcon, addIconText = props.addIconText, hideDelIcon = props.hideDelIcon, showDelAllBtn = props.showDelAllBtn, delAllChange = props.delAllChange, delIconText = props.delIconText, hiddenColumnDynamicIcon = props.hiddenColumnDynamicIcon, showColumnDynamic = props.showColumnDynamic, showColumnDynamicKey = props.showColumnDynamicKey, summaryConfig = props.summaryConfig, summaryFixed = props.summaryFixed, summary = props.summary, onMoveRow = props.onMoveRow, onEditableSave = props.onEditableSave, onDynamicChange = props.onDynamicChange, _e = props.isResizableColumn, isResizableColumn = _e === void 0 ? true : _e, configInfo = props.configInfo, tableHandleRef = props.tableHandleRef, tableName = props.tableName, isFlex = props.isFlex, onTableChange = props.onTableChange, rowSelection = props.rowSelection, showInnerPagination = props.showInnerPagination, defaultInnerPageSize = props.defaultInnerPageSize, restProps = __rest(props, ["className", "scroll", "pagination", "bordered", "columns", "initColumns", "dataSource", "onAddAndDelHandle", "hideAddIcon", "addIconText", "hideDelIcon", "showDelAllBtn", "delAllChange", "delIconText", "hiddenColumnDynamicIcon", "showColumnDynamic", "showColumnDynamicKey", "summaryConfig", "summaryFixed", "summary", "onMoveRow", "onEditableSave", "onDynamicChange", "isResizableColumn", "configInfo", "tableHandleRef", "tableName", "isFlex", "onTableChange", "rowSelection", "showInnerPagination", "defaultInnerPageSize"]);
117
119
  var classes = classNames('zt-table', className, {
118
120
  'zt-table--flex': isFlex,
119
121
  });
120
- var _d = useState(false), dynamicVisible = _d[0], setDynamicVisible = _d[1];
122
+ var _f = useState(false), dynamicVisible = _f[0], setDynamicVisible = _f[1];
121
123
  var showDynamicHandle = useCallback(function () { return setDynamicVisible(true); }, []);
122
124
  var hideDynamicHandle = useCallback(function () { return setDynamicVisible(false); }, []);
123
125
  var dataSourceRef = useRef();
124
126
  var preDataSource = usePrevious(dataSource);
125
127
  // 内部分页相关配置
126
- var _e = useInnerPagination(showInnerPagination, defaultInnerPageSize), paginationConfig = _e.paginationConfig, currentPage = _e.currentPage, setCurrent = _e.setCurrent, pageSize = _e.pageSize;
128
+ var _g = useInnerPagination(showInnerPagination, defaultInnerPageSize), paginationConfig = _g.paginationConfig, currentPage = _g.currentPage, setCurrent = _g.setCurrent, pageSize = _g.pageSize;
127
129
  var rowSelectionDataSource = useRef({});
128
130
  var myScroll = useMemo(function () {
129
131
  if (scroll) {
@@ -131,10 +133,46 @@ function Table(props) {
131
133
  }
132
134
  return isFlex ? __assign(__assign({}, _scroll), { y: 100 }) : _scroll;
133
135
  }, [scroll, isFlex]);
136
+ var expandableDataSource = useMemo(function () {
137
+ var _a, _b;
138
+ if (!onEditableSave) {
139
+ return dataSource;
140
+ }
141
+ else {
142
+ try {
143
+ var childrenColumnName_1 = ((_a = props === null || props === void 0 ? void 0 : props.expandable) === null || _a === void 0 ? void 0 : _a.childrenColumnName) || 'children';
144
+ return (_b = dataSource === null || dataSource === void 0 ? void 0 : dataSource.slice()) === null || _b === void 0 ? void 0 : _b.map(function (item, index) {
145
+ var _a;
146
+ if (item) {
147
+ var itemRowKey_1 = typeof props.rowKey === 'string'
148
+ ? item[props.rowKey]
149
+ : "" + INNER_PARENT_ROW_KEY_NO + index;
150
+ var newChildren = item[childrenColumnName_1];
151
+ if (Array.isArray(newChildren)) {
152
+ newChildren = newChildren.map(function (childrenItem) {
153
+ var _a;
154
+ return __assign(__assign({}, childrenItem), (_a = {}, _a[INNER_PARENT_ROW_KEY] = itemRowKey_1, _a));
155
+ });
156
+ return __assign(__assign({}, item), (_a = {}, _a[childrenColumnName_1] = newChildren, _a));
157
+ }
158
+ }
159
+ return item;
160
+ });
161
+ }
162
+ catch (err) {
163
+ return dataSource;
164
+ }
165
+ }
166
+ }, [
167
+ onEditableSave,
168
+ dataSource,
169
+ (_a = props === null || props === void 0 ? void 0 : props.expandable) === null || _a === void 0 ? void 0 : _a.childrenColumnName,
170
+ props.rowKey,
171
+ ]);
134
172
  /**columns更新,重新设置columns */
135
173
  useEffect(function () {
136
- dataSourceRef.current = dataSource;
137
- }, [dataSource]);
174
+ dataSourceRef.current = expandableDataSource;
175
+ }, [expandableDataSource]);
138
176
  var copyByKey = useCallback(function (key) {
139
177
  var _a, _b;
140
178
  if (Array.isArray(dataSourceRef.current)) {
@@ -209,7 +247,7 @@ function Table(props) {
209
247
  * @description 根据配置生成一个新的columns
210
248
  * 以及一个需要动态列配置的columns
211
249
  */
212
- var _f = useColumns({
250
+ var _h = useColumns({
213
251
  columns: _columns,
214
252
  hiddenColumnDynamicIcon: hiddenColumnDynamicIcon,
215
253
  showColumnDynamic: showColumnDynamic,
@@ -231,7 +269,8 @@ function Table(props) {
231
269
  preDataSource: preDataSource,
232
270
  dataSourceRef: dataSourceRef,
233
271
  rowKey: props.rowKey,
234
- }), newColumns = _f.newColumns, dynamicColumns = _f.dynamicColumns, refreshColumnsHandle = _f.refreshColumnsHandle;
272
+ expandableChildrenColumnName: ((_b = props === null || props === void 0 ? void 0 : props.expandable) === null || _b === void 0 ? void 0 : _b.childrenColumnName) || 'children',
273
+ }), newColumns = _h.newColumns, dynamicColumns = _h.dynamicColumns, refreshColumnsHandle = _h.refreshColumnsHandle;
235
274
  /**
236
275
  * @description 保存列配置
237
276
  */
@@ -510,14 +549,14 @@ function Table(props) {
510
549
  summaryFixed,
511
550
  ]);
512
551
  // 多选
513
- var rowSelectionObj = useMemo(function () { return (__assign(__assign({}, rowSelection), { onChange: function (selectedRowKeys, selectedRows, info) {
552
+ var rowSelectionObj = useMemo(function () { return (__assign(__assign({}, rowSelection), { onChange: function (selectedRowKeys, selectedRows) {
514
553
  rowSelectionDataSource.current = {
515
554
  selectedRows: selectedRows,
516
555
  selectedRowKeys: selectedRowKeys,
517
556
  isChange: true,
518
557
  };
519
558
  (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.onChange) &&
520
- rowSelection.onChange(selectedRowKeys, selectedRows, info);
559
+ rowSelection.onChange(selectedRowKeys, selectedRows);
521
560
  } })); }, [rowSelection]);
522
561
  return (React.createElement("div", { style: isFlex
523
562
  ? { position: 'relative', overflow: 'hidden', flex: 1 }
@@ -527,7 +566,7 @@ function Table(props) {
527
566
  ? pagination
528
567
  ? pagination
529
568
  : paginationConfig
530
- : pagination, scroll: myScroll, columns: mergeColumns, dataSource: dataSource, components: onMoveRow || onEditableSave
569
+ : pagination, scroll: myScroll, columns: mergeColumns, dataSource: expandableDataSource, components: onMoveRow || onEditableSave
531
570
  ? components
532
571
  : isResizableColumn
533
572
  ? tableResizableTitle
@@ -43,13 +43,14 @@ var QunjSeal = function (_a) {
43
43
  /** 渲染SealCheckboxGroup组件 */
44
44
  var getSealCheckboxGroupRender = function () {
45
45
  return (React.createElement(Item, { name: "details", label: "", noBorder: true, width: "all", style: {
46
- height: '180px',
46
+ height: '100%',
47
+ minHeight: '180px',
47
48
  overflowY: 'auto',
48
49
  overflowX: 'hidden',
49
50
  } },
50
51
  React.createElement(SealCheckboxGroup, { sealList: sealList, onChange: onSealCheckboxHandle, isEdit: isEdit })));
51
52
  };
52
- return (React.createElement(Form, { form: form, onValuesChange: onValuesChangeHandle }, checked ? (React.createElement(React.Fragment, null,
53
+ return (React.createElement(Form, { form: form, onValuesChange: onValuesChangeHandle, style: { height: '100%' } }, checked ? (React.createElement(React.Fragment, null,
53
54
  React.createElement("div", { style: {
54
55
  display: 'flex',
55
56
  justifyContent: 'space-between',
@@ -103,68 +103,68 @@ var Sinatures = function (_a) {
103
103
  var isUpload = _a.isUpload, qunjSealChange = _a.qunjSealChange, electronicSealChange = _a.electronicSealChange, onSigValuesChange = _a.onSigValuesChange, handleRef = _a.handleRef, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, systemCode = _a.systemCode, token = _a.token, openCustomerModalHandle = _a.openCustomerModalHandle, request = _a.request, showDeleteBtn = _a.showDeleteBtn, batchDownloadZipName = _a.batchDownloadZipName, otherParams = __rest(_a, ["isUpload", "qunjSealChange", "electronicSealChange", "onSigValuesChange", "handleRef", "ZT_API_BASEURL", "ZT_FILE_BASEURL", "systemCode", "token", "openCustomerModalHandle", "request", "showDeleteBtn", "batchDownloadZipName"]);
104
104
  var canEdit = otherParams.canEdit, needQj = otherParams.needQj, needDg = otherParams.needDg, needQys = otherParams.needQys, fileList = otherParams.fileList, qunjSeal = otherParams.qunjSeal, electronicSeal = otherParams.electronicSealIdList, flowId = otherParams.flowId, deptId = otherParams.deptId, flowStatus = otherParams.flowStatus, caseId = otherParams.caseId, contract_id = otherParams.contractId, docAttachMap = otherParams.docAttachMap, checkAttachIdList = otherParams.checkAttachIdList, // 已盖章附件id
105
105
  documentIdList = otherParams.documentIdList, // 文档id列表
106
- cancelDefaultCheckedQj = otherParams.cancelDefaultCheckedQj;
106
+ cancelDefaultCheckedQj = otherParams.cancelDefaultCheckedQj, // 取消默认勾选群杰用印申请
107
+ _b = otherParams.isCheckedEconomic, // 取消默认勾选群杰用印申请
108
+ isCheckedEconomic = _b === void 0 ? 1 : _b;
107
109
  var authToken = token || '';
108
110
  // 是否可编辑 1可编辑 0不可编辑
109
111
  var isEdit = canEdit === 1;
110
112
  // 如果上传,需要传入系统的code
111
113
  var uploadData = useMemo(function () { return (systemCode ? { system: systemCode } : {}); }, [systemCode]);
112
114
  // 组件内部管理的数组
113
- var _b = useRecords(fileList), records = _b.records, setRecords = _b.setRecords;
115
+ var _c = useRecords(fileList), records = _c.records, setRecords = _c.setRecords;
114
116
  // 组件内部管理的群杰数据
115
- var _c = useQunjData(qunjSeal), innerQunjSeal = _c.qunjSeal, setQunjSeal = _c.setQunjSeal;
117
+ var _d = useQunjData(qunjSeal), innerQunjSeal = _d.qunjSeal, setQunjSeal = _d.setQunjSeal;
116
118
  // 组件内部管理的电子印章数据
117
- var _d = useElectronicData(electronicSeal), innerElectronicSeal = _d.electronicSeal, setElectronicSeal = _d.setElectronicSeal;
119
+ var _e = useElectronicData(electronicSeal), innerElectronicSeal = _e.electronicSeal, setElectronicSeal = _e.setElectronicSeal;
118
120
  // 设置确认盖章按钮是否展示
119
- var _e = useState(false), checkSealVisible = _e[0], setCheckSealVisible = _e[1];
121
+ var _f = useState(false), checkSealVisible = _f[0], setCheckSealVisible = _f[1];
120
122
  // 合同id
121
- var _f = useState(null), contractId = _f[0], setContractId = _f[1];
123
+ var _g = useState(null), contractId = _g[0], setContractId = _g[1];
122
124
  // 已盖章附件id
123
- var _g = useState([]), sealedIds = _g[0], setSealedIds = _g[1];
125
+ var _h = useState([]), sealedIds = _h[0], setSealedIds = _h[1];
124
126
  // docAttachMap
125
- var _h = useState(null), attachMap = _h[0], setAttachMap = _h[1];
127
+ var _j = useState(null), attachMap = _j[0], setAttachMap = _j[1];
126
128
  // 文档id列表
127
- var _j = useState([]), documentIds = _j[0], setDocumentIds = _j[1];
129
+ var _k = useState([]), documentIds = _k[0], setDocumentIds = _k[1];
128
130
  // 总用印次数超过4倍
129
- var _k = useState(false), isTotalSealNumTooMore = _k[0], setIsTotalSealNumTooMore = _k[1];
131
+ var _l = useState(false), isTotalSealNumTooMore = _l[0], setIsTotalSealNumTooMore = _l[1];
130
132
  // 采购合同 销售合同 双边合同 部门间交易合同 需要展示合同份数 其他的不需要
131
133
  var showContranctNum = FLOW_IDS.includes("" + flowId);
132
134
  // 电子印章列表
133
- var _l = useState([]), electronicList = _l[0], setElectronicList = _l[1];
135
+ var _m = useState([]), electronicList = _m[0], setElectronicList = _m[1];
134
136
  // 群杰印章列表
135
- var _m = useState([]), sealList = _m[0], setSealList = _m[1];
137
+ var _o = useState([]), sealList = _o[0], setSealList = _o[1];
136
138
  // 上一次盖章时的参数信息
137
- var _o = useState({}), prevParam = _o[0], setPrevParam = _o[1];
139
+ var _p = useState({}), prevParam = _p[0], setPrevParam = _p[1];
138
140
  // 请确认
139
- var _p = useState(false), isSure = _p[0], setIsSure = _p[1];
141
+ var _q = useState(false), isSure = _q[0], setIsSure = _q[1];
140
142
  // 群杰表单
141
143
  var form = Form.useForm()[0];
142
144
  // 是否加盖群杰印章
143
- var _q = useState(true), checked = _q[0], setChecked = _q[1];
145
+ var _r = useState(true), checked = _r[0], setChecked = _r[1];
144
146
  // 盖章按钮loading
145
- var _r = useState(false), loading = _r[0], setLoading = _r[1];
147
+ var _s = useState(false), loading = _s[0], setLoading = _s[1];
146
148
  // 初始化是否清空契约锁信息标识
147
- var _s = useState(true), isInit = _s[0], setIsInit = _s[1];
149
+ var _t = useState(true), isInit = _t[0], setIsInit = _t[1];
148
150
  // 表格loading
149
151
  var tbloading = useState(false)[0];
150
152
  // 仅需要群杰印章
151
- var _t = useState(false), isOnlyQj = _t[0], setIsOnlyQj = _t[1];
153
+ var _u = useState(false), isOnlyQj = _u[0], setIsOnlyQj = _u[1];
152
154
  // 存放onSigValuesChange缓存回调方法
153
155
  var fnRef = useRef();
154
156
  // 是否加盖经济责任人手签章
155
- var _u = useState(true), isEconomic = _u[0], setIsEconomic = _u[1];
157
+ var _v = useState(isCheckedEconomic ? true : false), isEconomic = _v[0], setIsEconomic = _v[1];
156
158
  // 一级责任人名字
157
- var _v = useState(''), yjzrr = _v[0], setYjzrr = _v[1];
159
+ var _w = useState(''), yjzrr = _w[0], setYjzrr = _w[1];
158
160
  // 未确认盖章位置的弹窗是否可见
159
- var _w = useState(false), visible = _w[0], setVisible = _w[1];
161
+ var _x = useState(false), visible = _x[0], setVisible = _x[1];
160
162
  // 未确认盖章位置的电子印章列表
161
- var _x = useState([]), unSealList = _x[0], setUnSealList = _x[1];
163
+ var _y = useState([]), unSealList = _y[0], setUnSealList = _y[1];
162
164
  // 需重新确认盖章位置的电子印章
163
- var _y = useState([]), needReSealList = _y[0], setNeedReSealList = _y[1];
165
+ var _z = useState([]), needReSealList = _z[0], setNeedReSealList = _z[1];
164
166
  useEffect(function () {
165
- if (cancelDefaultCheckedQj) {
166
- setChecked(false);
167
- }
167
+ setChecked(cancelDefaultCheckedQj ? false : true);
168
168
  }, [cancelDefaultCheckedQj]);
169
169
  useEffect(function () {
170
170
  fnRef.current = onSigValuesChange;
@@ -178,6 +178,7 @@ var Sinatures = function (_a) {
178
178
  setSealedIds(checkAttachIdList || []);
179
179
  setAttachMap(docAttachMap);
180
180
  setDocumentIds(documentIdList);
181
+ setIsEconomic(isCheckedEconomic ? true : false);
181
182
  // 从docAttachMap中获取是否加盖经济责任人手签章
182
183
  if (typeof docAttachMap === 'string') {
183
184
  var _isEconomic = Object.entries(JSON.parse(docAttachMap)).find(function (_a) {
@@ -208,6 +209,7 @@ var Sinatures = function (_a) {
208
209
  electronicSeal,
209
210
  isInit,
210
211
  records,
212
+ isCheckedEconomic,
211
213
  ]);
212
214
  /** 是否加盖群杰印章 */
213
215
  var needQjSealFn = function (e) {
@@ -796,7 +798,7 @@ var Sinatures = function (_a) {
796
798
  });
797
799
  }
798
800
  // 上传组件的数据
799
- var _z = useState(), originFileList = _z[0], setOriginFileList = _z[1];
801
+ var _0 = useState(), originFileList = _0[0], setOriginFileList = _0[1];
800
802
  /** 签章组件onChange事件 */
801
803
  var sigValuesChange = useCallback(function (type, value) {
802
804
  var _a, _b;
@@ -826,7 +828,7 @@ var Sinatures = function (_a) {
826
828
  var hasElecSeal = records.filter(function (item) { return item.isElectronicSeal; });
827
829
  // 勾选加盖电子印章后 显示确认盖章按钮
828
830
  setCheckSealVisible(value ? true : hasElecSeal.length > 1 ? true : false);
829
- setIsEconomic(value ? true : false);
831
+ isCheckedEconomic && setIsEconomic(value ? true : false);
830
832
  // 去除加盖电子印章勾选时 清除合同id 等之前的信息
831
833
  if (!value && hasElecSeal.length === 1) {
832
834
  setSealedIds([]);
@@ -834,6 +836,7 @@ var Sinatures = function (_a) {
834
836
  setAttachMap(null);
835
837
  setDocumentIds([]);
836
838
  setElectronicSeal([]);
839
+ !isCheckedEconomic && setIsEconomic(false);
837
840
  if (onSigValuesChange) {
838
841
  onSigValuesChange(sigValuesChange('clearContractPrevInfo'));
839
842
  }
@@ -85,4 +85,6 @@ export interface IProps {
85
85
  batchDownloadZipName?: string;
86
86
  /** 取消默认勾选群杰用印申请 */
87
87
  cancelDefaultCheckedQj?: number;
88
+ /** 是否默认勾选经济责任人 1为默认勾选 0为不勾选 */
89
+ isCheckedEconomic?: number;
88
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "4.3.29",
3
+ "version": "4.3.31",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",