zmdms-webui 0.0.87 → 0.0.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,15 +39,25 @@ function recursionDynamicItems(list, currentDynamicList) {
39
39
  }
40
40
  });
41
41
  }
42
+ // 直接递归给子元素添加已找到标识,这里是不存在dynamic的情况的处理
43
+ function recursionAddFind(list) {
44
+ var newList = [];
45
+ list.forEach(function (item) {
46
+ var newItem = __assign(__assign({}, item), { checked: item.checked !== undefined ? item.checked : true });
47
+ if (newItem.children) {
48
+ newItem.children = recursionAddFind(newItem.children);
49
+ }
50
+ newList.push(__assign(__assign({}, newItem), { isFind: true }));
51
+ });
52
+ return newList;
53
+ }
42
54
  function recursionDeleteDynamicItems(currentDynamicList) {
43
55
  return currentDynamicList
44
56
  .filter(function (item) {
45
57
  if (item.isFind) {
46
58
  // 这里递归找子元素删除子元素逻辑
47
59
  if (Array.isArray(item.children)) {
48
- console.log(item.children);
49
60
  item.children = recursionDeleteDynamicItems(item.children);
50
- console.log(item.children);
51
61
  }
52
62
  return true;
53
63
  }
@@ -79,6 +89,10 @@ function getCurrentDynamicItems(dynamicKey, parentDynamicKey, list) {
79
89
  // 如果缓存中没值,那么以传入的配置为准
80
90
  list.forEach(function (item) {
81
91
  var result = __assign(__assign({}, item), { checked: item.checked !== undefined ? item.checked : true });
92
+ // 这里要递归将子元素添加已找到的标识
93
+ if (result.children) {
94
+ result.children = recursionAddFind(result.children);
95
+ }
82
96
  currentDynamicList_1.push(__assign(__assign({}, result), { isFind: true }));
83
97
  });
84
98
  }
@@ -28,8 +28,8 @@ import { DndProvider } from '../node_modules/react-dnd/dist/core/DndProvider.js'
28
28
  // completed: 实现小计 总计功能
29
29
  // completed: 实现可拖拽行
30
30
  // completed: 实现可编辑功能
31
- // TODO: 实现虚拟滚动配置
32
- // TODO: 实现表头自定义伸缩
31
+ // completed: 实现虚拟滚动配置
32
+ // completed: 实现表头自定义伸缩
33
33
  var Table = function (props) {
34
34
  // console.log("表格渲染");
35
35
  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, _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, resetProps = __rest(props, ["className", "bordered", "pagination", "isFlex", "tablePreferences", "dynamicKey", "hiddenDynamicIcon", "columns", "dataSource", "onTableChange", "isEdit", "isMove", "isAdd", "addMode", "addCallback", "isDel", "isDelAll", "isAddAndDelAuto", "summaryConfig", "summaryFixed", "isInnerPagination", "innerPaginationPageSize", "innerPaginationPosition", "innerPaginationPageSizeOptions", "tableRefHandle", "tableName", "serviceOrder", "differences", "virtualKey", "isResizableColumn"]);
@@ -226,7 +226,13 @@ var Table = function (props) {
226
226
  : paginationConfig
227
227
  : pagination, rowClassName: rowClassName }, resetProps)));
228
228
  return (jsxs("div", __assign({ style: isFlex
229
- ? { position: "relative", overflow: "hidden", flex: 1 }
229
+ ? {
230
+ position: "relative",
231
+ overflow: "hidden",
232
+ flex: 1,
233
+ // 需要给一个最小的高度
234
+ minHeight: "200px",
235
+ }
230
236
  : { position: "relative", overflow: "hidden" }, ref: tableRef }, { children: [isMove ? (jsx(DndProvider, __assign({ backend: HTML5Backend, context: window }, { children: SingleTable }))) : (SingleTable), dynamicKey ? (jsx(DynamicSetting, { parentDynamicKey: TABLE_DYNAMIC_KEY, dynamicKey: dynamicKey, defaultList: defaultDynamicList, onCurrentListChange: onCurrentListChange, ref: dynamicSettingRef, hiddenOperationIcon: true, isMore: true, isFixed: true })) : null] })));
231
237
  };
232
238
  var MemoTable = memo(Table);