zmdms-webui 0.0.77 → 0.0.78

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.
@@ -85,8 +85,6 @@ function getCurrentDynamicItems(dynamicKey, parentDynamicKey, list) {
85
85
  else {
86
86
  // 递归比对 用户传入配置 和 缓存中的配置。转换成正确的数据
87
87
  recursionDynamicItems(list, currentDynamicList_1);
88
- console.log(currentDynamicList_1);
89
- debugger;
90
88
  }
91
89
  // 最终需要过滤掉 没从传入配置中找到的字段
92
90
  // 如果没从传入配置中找到改字段 说明 该字段已经被业务弃用删除了
@@ -1,5 +1,6 @@
1
1
  import { __rest, __assign } from '../../_virtual/_tslib.js';
2
2
  import { jsx } from 'react/jsx-runtime';
3
+ import { useMemo } from 'react';
3
4
  import classNames from '../../node_modules/classnames/index.js';
4
5
  import useDragRef from './useDragRef.js';
5
6
 
@@ -10,12 +11,14 @@ var BasicBodyRow = function (props) {
10
11
  };
11
12
  // 拖拽行配置
12
13
  var MoveBodyRow = function (props) {
13
- var className = props.className, style = props.style, index = props.index, moveRow = props.moveRow, resetProps = __rest(props, ["className", "style", "index", "moveRow"]);
14
- var ref = useDragRef(index, moveRow).ref;
15
- var classes = classNames("ztxk-table__enhance-row", className
16
- // isOver ? dropClassName : ""
17
- );
18
- return (jsx("tr", __assign({ ref: ref, style: __assign({ cursor: "move" }, style), className: classes }, resetProps)));
14
+ var className = props.className, style = props.style, index = props.index, moveRow = props.moveRow, vRow = props.vRow, resetProps = __rest(props, ["className", "style", "index", "moveRow", "vRow"]);
15
+ var _a = useDragRef(index, moveRow), ref = _a.ref, isOver = _a.isOver, dropClassName = _a.dropClassName;
16
+ var memoStyle = useMemo(function () { return (__assign({ cursor: !moveRow ? "default" : "move" }, style)); }, [moveRow, style]);
17
+ var classes = classNames("ztxk-table__enhance-row", className, isOver ? dropClassName : "");
18
+ var tempProps = useMemo(function () {
19
+ return __assign({ ref: ref, className: classes, style: memoStyle }, resetProps);
20
+ }, [classes, resetProps, memoStyle, ref]);
21
+ return vRow ? (vRow(tempProps, ref)) : (jsx("tr", __assign({ ref: ref, style: __assign({ cursor: "move" }, style), className: classes }, resetProps)));
19
22
  };
20
23
 
21
24
  export { BasicBodyRow, MoveBodyRow };
@@ -14,10 +14,9 @@ function useDragRef(index, moveRow) {
14
14
  return {};
15
15
  }
16
16
  return {
17
- // 这里暂时不做拖放的样式 使用浏览器的默认样式
18
- // isOver: monitor.isOver(),
19
- // dropClassName:
20
- // dragIndex < index ? " drop-over-downward" : " drop-over-upward",
17
+ // 这里暂时不做拖放的样式 使用浏览器的默认样式
18
+ isOver: monitor.isOver(),
19
+ dropClassName: dragIndex < index ? " drop-over-downward" : " drop-over-upward",
21
20
  };
22
21
  },
23
22
  drop: function (item) {
@@ -26,9 +25,9 @@ function useDragRef(index, moveRow) {
26
25
  }
27
26
  moveRow(item.index, index);
28
27
  },
29
- }); }, [index]), drop = _a[1];
28
+ }); }, [index]), _b = _a[0], isOver = _b.isOver, dropClassName = _b.dropClassName, drop = _a[1];
30
29
  // 定义拖拽项
31
- var _b = useDrag({
30
+ var _c = useDrag({
32
31
  type: TABLE_DRAG_ROW_TYPE,
33
32
  item: { index: index },
34
33
  collect: function (monitor) { return ({
@@ -37,19 +36,19 @@ function useDragRef(index, moveRow) {
37
36
  canDrag: function (monitor) { var _a;
38
37
  // 解决拖拽行中有input 选中时 不让其拖拽
39
38
  return !((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.tagName.toLowerCase().match(/input|textarea/)); },
40
- }), drag = _b[1];
39
+ }), drag = _c[1];
41
40
  drop(drag(ref));
42
41
  if (moveRow) {
43
42
  return {
44
43
  ref: ref,
45
- // isOver,
46
- // dropClassName,
44
+ isOver: isOver,
45
+ dropClassName: dropClassName,
47
46
  };
48
47
  }
49
48
  return {
50
49
  ref: ref,
51
- // isOver: null,
52
- // dropClassName: null,
50
+ isOver: null,
51
+ dropClassName: null,
53
52
  };
54
53
  }
55
54
 
@@ -100,7 +100,6 @@ var Table = function (props) {
100
100
  // 伸缩列
101
101
  isResizableColumn: isResizableColumn,
102
102
  }).newColumns;
103
- console.log(newColumns);
104
103
  // 内部表格总结栏
105
104
  var getSummaryHandle = useSummary(summaryConfig, newColumns, {
106
105
  summaryFixed: summaryFixed,
@@ -160,7 +159,7 @@ var Table = function (props) {
160
159
  vComponents.body.cell = components.body.cell;
161
160
  }
162
161
  // 需要支持拖拽
163
- if ((_b = components === null || components === void 0 ? void 0 : components.body) === null || _b === void 0 ? void 0 : _b.row) {
162
+ if (((_b = components === null || components === void 0 ? void 0 : components.body) === null || _b === void 0 ? void 0 : _b.row) && isMove) {
164
163
  var row_1 = vComponents.body.row;
165
164
  vComponents.body.row = function (props) {
166
165
  return jsx(MoveBodyRow, __assign({}, props, { vRow: row_1 }));
@@ -1,8 +1,8 @@
1
1
  import { __assign, __spreadArray } from '../_virtual/_tslib.js';
2
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
3
  import { getTableColumns } from './utils.js';
4
- import '../node_modules/classnames/index.js';
5
4
  import 'react';
5
+ import '../node_modules/classnames/index.js';
6
6
  import './components/EnhanceHeaderCell.js';
7
7
  import ColumnDynamic from './components/ColumnDynamic.js';
8
8
  import ColumnAddDel, { ColumnDelAll } from './components/ColumnAddDel.js';