ztxkui 4.2.18-4 → 4.2.18-41

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.
Files changed (121) hide show
  1. package/README.md +57 -57
  2. package/dist/DemoCom/BasicDemo.js +1 -1
  3. package/dist/DemoCom/SyhDemo.d.ts +3 -0
  4. package/dist/DemoCom/SyhDemo.js +257 -0
  5. package/dist/DemoCom/TableDemo.js +8 -4
  6. package/dist/TableDemo/BasicTable.js +2 -1
  7. package/dist/TableDemo/EditableTable.js +87 -67
  8. package/dist/TableDemo/ProEditableTable.d.ts +21 -0
  9. package/dist/TableDemo/ProEditableTable.js +482 -0
  10. package/dist/TableDemo/data.d.ts +15 -0
  11. package/dist/TableDemo/data.js +33 -1
  12. package/dist/TableDemo/index.js +5 -4
  13. package/dist/components/DatePicker/data-picker.d.ts +7 -8
  14. package/dist/components/Input/input.d.ts +3 -0
  15. package/dist/components/Input/input.js +52 -3
  16. package/dist/components/Menu/menu.d.ts +3 -3
  17. package/dist/components/PrintContainer/utils.js +3 -3
  18. package/dist/components/ProTable/hooks.d.ts +28 -0
  19. package/dist/components/ProTable/hooks.js +279 -0
  20. package/dist/components/ProTable/index.d.ts +8 -0
  21. package/dist/components/ProTable/index.js +77 -0
  22. package/dist/components/ProTable/interface.d.ts +51 -0
  23. package/dist/components/ProTable/interface.js +1 -0
  24. package/dist/components/Table/components/FillDown.d.ts +8 -0
  25. package/dist/components/Table/components/FillDown.js +10 -0
  26. package/dist/components/Table/components/FilterDropdown.d.ts +14 -0
  27. package/dist/components/Table/components/FilterDropdown.js +69 -0
  28. package/dist/components/Table/constants.d.ts +2 -0
  29. package/dist/components/Table/constants.js +2 -0
  30. package/dist/components/Table/hooks/useColumns.d.ts +21 -8
  31. package/dist/components/Table/hooks/useColumns.js +487 -182
  32. package/dist/components/Table/hooks/useDropRef.js +2 -1
  33. package/dist/components/Table/hooks/useInnerPagination.js +1 -0
  34. package/dist/components/Table/hooks/useSelectSubtotal.d.ts +4 -0
  35. package/dist/components/Table/hooks/useSelectSubtotal.js +178 -0
  36. package/dist/components/Table/hooks/useVituralScrollBar.d.ts +8 -0
  37. package/dist/components/Table/hooks/useVituralScrollBar.js +205 -0
  38. package/dist/components/Table/index.d.ts +7 -0
  39. package/dist/components/Table/table-adddel-column.d.ts +8 -5
  40. package/dist/components/Table/table-adddel-column.js +15 -5
  41. package/dist/components/Table/table-dynamic.js +63 -5
  42. package/dist/components/Table/table-enhance-cell.d.ts +7 -3
  43. package/dist/components/Table/table-enhance-cell.js +198 -109
  44. package/dist/components/Table/table-enhance-row.d.ts +4 -4
  45. package/dist/components/Table/table-enhance-row.js +10 -11
  46. package/dist/components/Table/table-headTooltip.d.ts +6 -0
  47. package/dist/components/Table/table-headTooltip.js +13 -0
  48. package/dist/components/Table/table-resizable-title.d.ts +4 -5
  49. package/dist/components/Table/table-resizable-title.js +32 -6
  50. package/dist/components/Table/table-sort.d.ts +11 -0
  51. package/dist/components/Table/table-sort.js +65 -0
  52. package/dist/components/Table/table.d.ts +24 -4
  53. package/dist/components/Table/table.js +505 -176
  54. package/dist/components/Table/utils/dom.d.ts +26 -0
  55. package/dist/components/Table/utils/dom.js +122 -0
  56. package/dist/components/Table/utils/filterHandle.d.ts +1 -0
  57. package/dist/components/Table/utils/filterHandle.js +51 -0
  58. package/dist/components/Table/utils/getSummaryData.d.ts +1 -0
  59. package/dist/components/Table/utils/getSummaryData.js +3 -1
  60. package/dist/components/Table/utils/shallowEqual.d.ts +2 -0
  61. package/dist/components/Table/utils/shallowEqual.js +34 -0
  62. package/dist/components/Table/utils/validate.d.ts +1 -1
  63. package/dist/components/Table/utils/validate.js +5 -5
  64. package/dist/components/TimePicker/time-picker.d.ts +0 -1
  65. package/dist/components/WorkflowPrintContainer/component/Gragh/Gragh.d.ts +9 -0
  66. package/dist/components/WorkflowPrintContainer/component/Gragh/Gragh.js +63 -0
  67. package/dist/components/WorkflowPrintContainer/component/Header.d.ts +12 -0
  68. package/dist/components/WorkflowPrintContainer/component/Header.js +106 -0
  69. package/dist/components/WorkflowPrintContainer/component/ProcessDetail.d.ts +18 -0
  70. package/dist/components/WorkflowPrintContainer/component/ProcessDetail.js +240 -0
  71. package/dist/components/WorkflowPrintContainer/component/Upload/index.d.ts +20 -0
  72. package/dist/components/WorkflowPrintContainer/component/Upload/index.js +59 -0
  73. package/dist/components/WorkflowPrintContainer/component/association/component/TableList.d.ts +10 -0
  74. package/dist/components/WorkflowPrintContainer/component/association/component/TableList.js +74 -0
  75. package/dist/components/WorkflowPrintContainer/component/association/index.d.ts +9 -0
  76. package/dist/components/WorkflowPrintContainer/component/association/index.js +91 -0
  77. package/dist/components/WorkflowPrintContainer/component/attention/component/TableList.d.ts +9 -0
  78. package/dist/components/WorkflowPrintContainer/component/attention/component/TableList.js +35 -0
  79. package/dist/components/WorkflowPrintContainer/component/attention/index.d.ts +10 -0
  80. package/dist/components/WorkflowPrintContainer/component/attention/index.js +94 -0
  81. package/dist/components/WorkflowPrintContainer/component/audit/component/TableList.d.ts +8 -0
  82. package/dist/components/WorkflowPrintContainer/component/audit/component/TableList.js +52 -0
  83. package/dist/components/WorkflowPrintContainer/component/audit/index.d.ts +7 -0
  84. package/dist/components/WorkflowPrintContainer/component/audit/index.js +87 -0
  85. package/dist/components/WorkflowPrintContainer/component/previewTable/component/TableList.d.ts +9 -0
  86. package/dist/components/WorkflowPrintContainer/component/previewTable/component/TableList.js +52 -0
  87. package/dist/components/WorkflowPrintContainer/component/previewTable/index.d.ts +11 -0
  88. package/dist/components/WorkflowPrintContainer/component/previewTable/index.js +59 -0
  89. package/dist/components/WorkflowPrintContainer/component/send/component/TableList.d.ts +9 -0
  90. package/dist/components/WorkflowPrintContainer/component/send/component/TableList.js +49 -0
  91. package/dist/components/WorkflowPrintContainer/component/send/index.d.ts +9 -0
  92. package/dist/components/WorkflowPrintContainer/component/send/index.js +91 -0
  93. package/dist/components/WorkflowPrintContainer/component/trail/component/TableList.d.ts +12 -0
  94. package/dist/components/WorkflowPrintContainer/component/trail/component/TableList.js +281 -0
  95. package/dist/components/WorkflowPrintContainer/component/trail/index.d.ts +11 -0
  96. package/dist/components/WorkflowPrintContainer/component/trail/index.js +56 -0
  97. package/dist/components/WorkflowPrintContainer/images.d.ts +2 -0
  98. package/dist/components/WorkflowPrintContainer/images.js +2 -0
  99. package/dist/components/WorkflowPrintContainer/index.d.ts +2 -0
  100. package/dist/components/WorkflowPrintContainer/index.js +2 -0
  101. package/dist/components/WorkflowPrintContainer/service.d.ts +14 -0
  102. package/dist/components/WorkflowPrintContainer/service.js +101 -0
  103. package/dist/components/WorkflowPrintContainer/usePagination.d.ts +14 -0
  104. package/dist/components/WorkflowPrintContainer/usePagination.js +22 -0
  105. package/dist/components/WorkflowPrintContainer/workflow-print-container.d.ts +100 -0
  106. package/dist/components/WorkflowPrintContainer/workflow-print-container.js +235 -0
  107. package/dist/components/ZtIcon/index.d.ts +1 -1
  108. package/dist/components/business/Common/UserForgetPassword/index.js +1 -1
  109. package/dist/components/business/Common/UserInfo/index.js +3 -1
  110. package/dist/components/business/Common/UserPassword/index.d.ts +1 -0
  111. package/dist/components/business/Common/UserPassword/index.js +25 -7
  112. package/dist/components/business/Common/validatePassword.js +125 -30
  113. package/dist/components/utils/index.d.ts +1 -0
  114. package/dist/components/utils/index.js +20 -0
  115. package/dist/components/utils/useLastest.d.ts +2 -0
  116. package/dist/components/utils/useLastest.js +6 -0
  117. package/dist/index.css +423 -7
  118. package/dist/index.css.map +1 -1
  119. package/dist/index.d.ts +2 -0
  120. package/dist/index.js +6 -0
  121. package/package.json +4 -3
package/README.md CHANGED
@@ -1,57 +1,57 @@
1
- # 前端ui库
2
-
3
- ## 关于 typescript 相关配置说明
4
-
5
- _[tsconfig.json](https://www.tslang.cn/docs/handbook/tsconfig-json.html) 如果一个目录下存在一个 tsconfig.json 文件,那么它意味着这个目录是 TypeScript 项目的根目录。tsconfig.json 文件中指定了用来编译这个项目的根文件和编译选现_
6
-
7
- - compilerOptions 可以忽略,如果忽略 会使用默认值
8
- - outDir 指定的目录下的文件永远会被编译器排除,除非使用 files 包含
9
- - typeRoots 默认所有可见的 @types 包会在编译过程中被包含进来,如果指定了这个配置 只有他下面的包才会被包含进来
10
-
11
- * files 指定一个包含相对或绝对文件路径的列表,优先级最高
12
- * include 需要编译的文件 优先级最低
13
- * exclude 不需要编译的文件 优先级中等
14
- * extends 继承配置 继承的文件会覆盖源文件
15
-
16
- _[eslint](https://eslint.bootcss.com/docs/user-guide/getting-started)ESLint 是在 ECMAScript/JavaScript 代码中识别和报告模式匹配的工具,它的目标是保证代码的一致性和避免错误_
17
-
18
- - parser 解析器(eslint 默认使用 Espree 作为其解析器)
19
- - parserOptions 解析器配置选项
20
- - env 和 globals 环境和全局变量
21
-
22
- * rules 规则(off 或 0,关闭规则;warn 或 1,开启规则;error 或 2,开启规则,并会出错阻止代码运行)
23
- - semi 是否使用分号(当前不使用 错误级别 1)
24
- - no-trailing-spaces 禁止行尾空格
25
- - array-bracket-spacing 强制数组括号内的空格一致
26
- - operator-linebreak 强制操作符使用一致的换行符
27
- - function-paren-newline 强制函数括号内使用一致的换行
28
- * no-magic-numbers 禁止使用魔术数字
29
- - ignoreArrayIndexes 数字可否作为数组的索引
30
- - block-spacing 禁止或强制在代码块中开括号前和闭括号后有空格
31
- - brace-style 大括号风格要求
32
- - no-multiple-empty-lines 最大换行数
33
- - object-curly-spacing 强制在花括号中使用一致的空格
34
- * comma-spacing 强制在逗号周围使用空格
35
- - before false 禁止逗号前使用空格
36
- - after true 要求逗号后使用一个或多个空格
37
- * keyword-spacing 强制关键字周围空格的一致性
38
- - before true (默认) 要求在关键字之前至少有一个空格
39
- - after true (默认) 要求在关键字之后至少有一个空格
40
- * comma-style 逗号风格
41
- - last (默认) 要求逗号放在数组元素、对象属性或变量声明之后,且在同一行
42
- - no-multi-spaces 禁止出现多个空格
43
-
44
- - plugins 插件(插件可以提供处理器 配置在 processor 中 通过 pluginName/parserName)
45
- - overrides 为特定类型的文件指定处理器,请使用 overrides 和 processor 的组合
46
- - extends 拓展 一个配置文件可以被基础配置中的已启用的规则继承
47
- - settings 提供给每一个将被执行的规则
48
- - root 如果为 true 则项目中的 eslint 规则 在根目录中找
49
-
50
- ## 本地调试
51
-
52
- ```json
53
- "peerDependencies": {
54
- "react": ">=16.9.0",
55
- "react-dom": ">=16.9.0"
56
- }
57
- ```
1
+ # 前端ui库
2
+
3
+ ## 关于 typescript 相关配置说明
4
+
5
+ _[tsconfig.json](https://www.tslang.cn/docs/handbook/tsconfig-json.html) 如果一个目录下存在一个 tsconfig.json 文件,那么它意味着这个目录是 TypeScript 项目的根目录。tsconfig.json 文件中指定了用来编译这个项目的根文件和编译选现_
6
+
7
+ - compilerOptions 可以忽略,如果忽略 会使用默认值
8
+ - outDir 指定的目录下的文件永远会被编译器排除,除非使用 files 包含
9
+ - typeRoots 默认所有可见的 @types 包会在编译过程中被包含进来,如果指定了这个配置 只有他下面的包才会被包含进来
10
+
11
+ * files 指定一个包含相对或绝对文件路径的列表,优先级最高
12
+ * include 需要编译的文件 优先级最低
13
+ * exclude 不需要编译的文件 优先级中等
14
+ * extends 继承配置 继承的文件会覆盖源文件
15
+
16
+ _[eslint](https://eslint.bootcss.com/docs/user-guide/getting-started)ESLint 是在 ECMAScript/JavaScript 代码中识别和报告模式匹配的工具,它的目标是保证代码的一致性和避免错误_
17
+
18
+ - parser 解析器(eslint 默认使用 Espree 作为其解析器)
19
+ - parserOptions 解析器配置选项
20
+ - env 和 globals 环境和全局变量
21
+
22
+ * rules 规则(off 或 0,关闭规则;warn 或 1,开启规则;error 或 2,开启规则,并会出错阻止代码运行)
23
+ - semi 是否使用分号(当前不使用 错误级别 1)
24
+ - no-trailing-spaces 禁止行尾空格
25
+ - array-bracket-spacing 强制数组括号内的空格一致
26
+ - operator-linebreak 强制操作符使用一致的换行符
27
+ - function-paren-newline 强制函数括号内使用一致的换行
28
+ * no-magic-numbers 禁止使用魔术数字
29
+ - ignoreArrayIndexes 数字可否作为数组的索引
30
+ - block-spacing 禁止或强制在代码块中开括号前和闭括号后有空格
31
+ - brace-style 大括号风格要求
32
+ - no-multiple-empty-lines 最大换行数
33
+ - object-curly-spacing 强制在花括号中使用一致的空格
34
+ * comma-spacing 强制在逗号周围使用空格
35
+ - before false 禁止逗号前使用空格
36
+ - after true 要求逗号后使用一个或多个空格
37
+ * keyword-spacing 强制关键字周围空格的一致性
38
+ - before true (默认) 要求在关键字之前至少有一个空格
39
+ - after true (默认) 要求在关键字之后至少有一个空格
40
+ * comma-style 逗号风格
41
+ - last (默认) 要求逗号放在数组元素、对象属性或变量声明之后,且在同一行
42
+ - no-multi-spaces 禁止出现多个空格
43
+
44
+ - plugins 插件(插件可以提供处理器 配置在 processor 中 通过 pluginName/parserName)
45
+ - overrides 为特定类型的文件指定处理器,请使用 overrides 和 processor 的组合
46
+ - extends 拓展 一个配置文件可以被基础配置中的已启用的规则继承
47
+ - settings 提供给每一个将被执行的规则
48
+ - root 如果为 true 则项目中的 eslint 规则 在根目录中找
49
+
50
+ ## 本地调试
51
+
52
+ ```json
53
+ "peerDependencies": {
54
+ "react": ">=16.9.0",
55
+ "react-dom": ">=16.9.0"
56
+ }
57
+ ```
@@ -136,7 +136,7 @@ function BasicDemo() {
136
136
  console.log((_b = (_a = rangeValue === null || rangeValue === void 0 ? void 0 : rangeValue[0]) === null || _a === void 0 ? void 0 : _a.format) === null || _b === void 0 ? void 0 : _b.call(_a, 'YYYY-MM-DD'));
137
137
  console.log((_d = (_c = rangeValue === null || rangeValue === void 0 ? void 0 : rangeValue[1]) === null || _c === void 0 ? void 0 : _c.format) === null || _d === void 0 ? void 0 : _d.call(_c, 'YYYY-MM-DD'));
138
138
  } }, "\u83B7\u53D6\u6570\u636E")),
139
- React.createElement(Input.TextArea, { className: "placeholder", autoSize: true }),
139
+ React.createElement(Input.TextArea, { className: "placeholder", autoSize: true, isModalInput: true }),
140
140
  React.createElement("div", { style: { border: '1px solid red' } },
141
141
  React.createElement(FormList, { gutter: 16 },
142
142
  React.createElement(FormList.FormItem, { span: 24, title: "\u63D0\u5355\u53F7\u63D0\u5355\u53F7\u63D0\u5355\u53F7\u63D0\u5355\u53F7", isEllipsis: false }, test),
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const SyhDemo: () => JSX.Element;
3
+ export default SyhDemo;
@@ -0,0 +1,257 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ /**
13
+ * @description
14
+ */
15
+ import React, { useState, useRef, useEffect, useCallback } from 'react';
16
+ import SearchContainer from '../components/business/SearchContainer';
17
+ import Form from '../components/Form';
18
+ import Input from 'components/Input';
19
+ import Table from 'components/Table';
20
+ import DatePicker from 'components/DatePicker';
21
+ import { Cascader } from 'antd';
22
+ import dayjs from 'dayjs';
23
+ import { timeTransfrom } from 'ztxkutils/dist/tools';
24
+ var SearchItem = SearchContainer.SearchItem, SearchLeft = SearchContainer.SearchLeft, SearchRight = SearchContainer.SearchRight;
25
+ var TextArea = Input.TextArea;
26
+ var RangePicker = DatePicker.RangePicker;
27
+ var aa = [
28
+ {
29
+ extra: '1',
30
+ hasChildren: true,
31
+ id: '1460583429813227521',
32
+ key: '1460583429813227521',
33
+ parentId: '1460582731688103938',
34
+ remark: null,
35
+ label: '合同工',
36
+ value: '1',
37
+ children: [
38
+ {
39
+ extra: '11',
40
+ id: '1460582731776184321',
41
+ key: '1460582731776184321',
42
+ parentId: '1460583429813227521',
43
+ remark: null,
44
+ label: '合同制',
45
+ value: '11',
46
+ },
47
+ {
48
+ extra: '16',
49
+ id: '1460582731797155842',
50
+ key: '1460582731797155842',
51
+ parentId: '1460583429813227521',
52
+ remark: null,
53
+ label: '退休返聘',
54
+ value: '16',
55
+ },
56
+ ],
57
+ },
58
+ {
59
+ extra: '2',
60
+ hasChildren: true,
61
+ id: '1460583501221253121',
62
+ key: '1460583501221253121',
63
+ parentId: '1460582731688103938',
64
+ remark: null,
65
+ label: '非合同工',
66
+ value: '2',
67
+ children: [
68
+ {
69
+ extra: '12',
70
+ id: '1460582731784572929',
71
+ key: '1460582731784572929',
72
+ parentId: '1460583501221253121',
73
+ remark: null,
74
+ label: '非全日制',
75
+ value: '12',
76
+ },
77
+ {
78
+ extra: '13',
79
+ id: '1460582731792961538',
80
+ key: '1460582731792961538',
81
+ parentId: '1460583501221253121',
82
+ remark: null,
83
+ label: '临时协议',
84
+ value: '13',
85
+ },
86
+ {
87
+ extra: '15',
88
+ id: '1460582731792961539',
89
+ key: '1460582731792961539',
90
+ parentId: '1460583501221253121',
91
+ remark: null,
92
+ label: '劳务派遣',
93
+ value: '15',
94
+ },
95
+ {
96
+ extra: '22',
97
+ id: '1460582731797155843',
98
+ key: '1460582731797155843',
99
+ parentId: '1460583501221253121',
100
+ remark: null,
101
+ label: '外包协议',
102
+ value: '22',
103
+ },
104
+ ],
105
+ },
106
+ ];
107
+ var SyhDemo = function () {
108
+ var form = Form.useForm()[0];
109
+ var _a = useState([
110
+ { id: 1, test1: 1, test2: 1 },
111
+ ]), records = _a[0], setRecords = _a[1];
112
+ var recordsRef = useRef([]);
113
+ var _b = useState(false), firstRender = _b[0], setFirstRender = _b[1];
114
+ // 新增删除行改变
115
+ var _c = useState(false), lengthChange = _c[0], setLengthChange = _c[1];
116
+ useEffect(function () {
117
+ recordsRef.current = records;
118
+ }, [records]);
119
+ var columns = [
120
+ {
121
+ title: '序号',
122
+ width: 38,
123
+ fixed: 'left',
124
+ key: 'index',
125
+ render: function (text, _record, index) { return "" + (index + 1); },
126
+ },
127
+ {
128
+ title: '测试1',
129
+ width: 100,
130
+ dataIndex: 'test1',
131
+ key: 'test1',
132
+ render: function (text, record, index) { return (React.createElement(TextArea, { value: text, maxLength: 6, autoSize: { minRows: 1 }, onChange: function (e) {
133
+ var newRecord = {
134
+ test1: e.target.value,
135
+ };
136
+ onEditableSaveHandle(newRecord, index);
137
+ } })); },
138
+ shouldCellUpdate: function (record, preRecord) {
139
+ if (firstRender) {
140
+ setFirstRender(false);
141
+ return true;
142
+ }
143
+ if (lengthChange) {
144
+ setLengthChange(false);
145
+ return true;
146
+ }
147
+ return record.test1 !== preRecord.test1;
148
+ },
149
+ },
150
+ {
151
+ title: '测试2',
152
+ width: 100,
153
+ dataIndex: 'test2',
154
+ key: 'test2',
155
+ editable: true,
156
+ editableConfig: {
157
+ type: 'textArea',
158
+ maxLength: 6,
159
+ },
160
+ },
161
+ {
162
+ title: '测试3',
163
+ width: 100,
164
+ dataIndex: 'test3',
165
+ key: 'test3',
166
+ render: function (text, record, index) { return (React.createElement(DatePicker, { value: text ? dayjs(text) : null, onChange: function (value, dateString) {
167
+ var newRecord = {
168
+ test3: dateString,
169
+ };
170
+ onEditableSaveHandle(newRecord, index);
171
+ } })); },
172
+ shouldCellUpdate: function (record, preRecord) {
173
+ if (firstRender) {
174
+ setFirstRender(false);
175
+ return true;
176
+ }
177
+ if (lengthChange) {
178
+ setLengthChange(false);
179
+ return true;
180
+ }
181
+ return record.test3 !== preRecord.test3;
182
+ },
183
+ },
184
+ {
185
+ title: '测试4',
186
+ width: 100,
187
+ dataIndex: 'text4Start',
188
+ key: 'text4Start',
189
+ render: function (text, record, index) {
190
+ var newParams = (record === null || record === void 0 ? void 0 : record.text4Start) && (record === null || record === void 0 ? void 0 : record.test4End)
191
+ ? timeTransfrom({
192
+ params: {
193
+ text4Start: record === null || record === void 0 ? void 0 : record.text4Start,
194
+ test4End: record === null || record === void 0 ? void 0 : record.test4End,
195
+ },
196
+ fromKey: [['text4Start', 'test4End']],
197
+ toKey: ['text4'],
198
+ type: 'object',
199
+ })
200
+ : {};
201
+ return (React.createElement(RangePicker, { value: newParams === null || newParams === void 0 ? void 0 : newParams.text4, onChange: function (value) {
202
+ var newRecord = timeTransfrom({
203
+ params: { text4: value },
204
+ fromKey: ['text4'],
205
+ toKey: [['text4Start', 'test4End']],
206
+ });
207
+ onEditableSaveHandle(newRecord, index);
208
+ } }));
209
+ },
210
+ shouldCellUpdate: function (record, preRecord) {
211
+ if (firstRender) {
212
+ setFirstRender(false);
213
+ return true;
214
+ }
215
+ if (lengthChange) {
216
+ setLengthChange(false);
217
+ return true;
218
+ }
219
+ return record.test4 !== preRecord.test4;
220
+ },
221
+ },
222
+ ];
223
+ var onEditableSaveHandle = useCallback(function (record, index, _dataIndex) {
224
+ var _a;
225
+ if (_dataIndex === void 0) { _dataIndex = ''; }
226
+ if (typeof index === 'number') {
227
+ var newRecords = recordsRef.current.slice();
228
+ var item = newRecords[index];
229
+ newRecords.splice(index, 1, _dataIndex
230
+ ? __assign(__assign(__assign({}, record), item), (_a = {}, _a[_dataIndex] = record[_dataIndex], _a)) : __assign(__assign({}, item), record));
231
+ setRecords(newRecords);
232
+ }
233
+ }, [setRecords]);
234
+ return (React.createElement(React.Fragment, null,
235
+ React.createElement(Form, { name: "syh-demo", form: form },
236
+ React.createElement(SearchContainer, null,
237
+ React.createElement(SearchLeft, null,
238
+ React.createElement(SearchItem, { width: "half", name: "a", label: "\u7B2C\u4E00" },
239
+ React.createElement(Input.TextArea, { autoSize: true, allowClear: true, onChange: function (e) {
240
+ console.log(e.target.value);
241
+ } })),
242
+ React.createElement(SearchItem, { width: "half", name: "b", label: "\u7B2C\u4E8C" },
243
+ React.createElement(Input, null)),
244
+ React.createElement(SearchItem, { width: "half", name: "c", label: "\u7B2C\u4E09" },
245
+ React.createElement(Input, null)),
246
+ React.createElement(SearchItem, { width: "half", name: "d", label: "\u7B2C\u56DB" },
247
+ React.createElement(Input, null)),
248
+ React.createElement(SearchItem, { width: "half", name: "e", label: "\u7B2C\u4E94" },
249
+ React.createElement(Input, null)),
250
+ React.createElement(SearchItem, { name: "f", label: "\u7B2C\u516D" },
251
+ React.createElement(Cascader, { options: aa })),
252
+ React.createElement(SearchItem, { name: "g", label: "\u7B2C\u4E03" },
253
+ React.createElement(TextArea, { maxLength: 6 }))),
254
+ React.createElement(SearchRight, { onResetHandle: function () { }, onSearchHandle: function () { } }))),
255
+ React.createElement(Table, { columns: columns, dataSource: records, rowKey: "id", onEditableSave: onEditableSaveHandle })));
256
+ };
257
+ export default SyhDemo;
@@ -66,7 +66,7 @@ import FormDemo from './FormDemo';
66
66
  // 获取表格数据
67
67
  function useGetTableRecords() {
68
68
  // 表格数据
69
- var _a = useState(Array.from({ length: 10 }).map(function (item, index) {
69
+ var _a = useState(Array.from({ length: 100 }).map(function (item, index) {
70
70
  var newItem = {
71
71
  id: "" + (index + 1),
72
72
  test1: index + 1 + "-test1",
@@ -547,6 +547,7 @@ var TableDemo = function () {
547
547
  width: 400,
548
548
  dataIndex: 'key1',
549
549
  key: 'key1',
550
+ hideColumn: true,
550
551
  shouldCellUpdate: function (record, preRecord) {
551
552
  if (lengthChange) {
552
553
  setLengthChange(false);
@@ -928,11 +929,12 @@ var TableDemo = function () {
928
929
  // 如果需要保留本地偏好,那么这里需要预处理一下columns数据
929
930
  // columns={getTableLayoutFullData(columns, tableLayout)}
930
931
  // initColumns={columns}
931
- columns: columns, dataSource: records, rowKey: "id", tableHandleRef: tableHandleRef,
932
+ columns: columns, dataSource: [], rowKey: "id", tableHandleRef: tableHandleRef, virtualTableKey: "test",
932
933
  // 配置表格列
933
934
  // configInfo={tableConfig}
934
935
  // 添加动态列配置
935
- showColumnDynamic: true, showColumnDynamicKey: "testkey",
936
+ // showColumnDynamic
937
+ // showColumnDynamicKey="testkey"
936
938
  // onDynamicChange={onDynamicChange}
937
939
  // 表格项可输入
938
940
  onEditableSave: onEditableSaveHandle,
@@ -941,7 +943,9 @@ var TableDemo = function () {
941
943
  // 表格行拖拽
942
944
  onMoveRow: onMoveRowHandle,
943
945
  // 自动伸缩列
944
- isResizableColumn: true, isFlex: true, scroll: { x: 1000 }, summaryFixed: true, summaryConfig: [
946
+ isResizableColumn: true,
947
+ // isFlex
948
+ scroll: { x: 1000, y: 200 }, summaryFixed: true, summaryConfig: [
945
949
  {
946
950
  type: 'subtotal',
947
951
  fields: [
@@ -26,6 +26,7 @@ var BasicTable = function (_a) {
26
26
  width: 100,
27
27
  dataIndex: 'test1',
28
28
  key: 'test1',
29
+ fixed: true,
29
30
  },
30
31
  {
31
32
  title: '测试2',
@@ -91,6 +92,6 @@ var BasicTable = function (_a) {
91
92
  React.createElement("br", null),
92
93
  React.createElement("b", null, "\u5217\u4F38\u7F29\uFF1B"),
93
94
  "isResizableColumn\u5C5E\u6027\u9ED8\u8BA4\u4E3Atrue\uFF0C\u5982\u679C\u4E0D\u9700\u8981\u5217\u4F38\u7F29\u53EF\u4EE5\u4F20\u5165false"),
94
- React.createElement(Table, { dataSource: dataSource, columns: columns, rowKey: "id", showColumnDynamic: true, showColumnDynamicKey: dynamicKey || 'symbol-id-1' })));
95
+ React.createElement(Table, { dataSource: dataSource, columns: columns, rowKey: "id", scroll: { x: 400, y: 300 }, isOpenVirtualScrollBar: true })));
95
96
  };
96
97
  export default BasicTable;
@@ -157,11 +157,12 @@ var EditableTable = function () {
157
157
  var _d = useState(false), moveChange = _d[0], setMoveChange = _d[1];
158
158
  // 表格
159
159
  var tableHandleRef = useRef({});
160
+ var _e = useState([]), expandedRowKeys = _e[0], setExpandedRowKeys = _e[1];
160
161
  // 表格配置
161
- var _e = useState({
162
+ var _f = useState({
162
163
  test1: { isChangeable: 1, isDisplay: 1, isRequired: 1 },
163
164
  test2: { isChangeable: 1, isDisplay: 1, isRequired: 1 },
164
- }), tableConfig = _e[0], setTableConfig = _e[1];
165
+ }), tableConfig = _f[0], setTableConfig = _f[1];
165
166
  useEffect(function () {
166
167
  setTimeout(function () {
167
168
  setTableConfig({
@@ -182,10 +183,14 @@ var EditableTable = function () {
182
183
  },
183
184
  {
184
185
  title: '测试1',
185
- width: 100,
186
+ width: 400,
186
187
  dataIndex: 'test1',
187
188
  key: 'test1',
188
189
  editable: true,
190
+ editableConfig: {
191
+ type: 'textArea',
192
+ maxLength: 100,
193
+ },
189
194
  showCopy: true,
190
195
  validate: {},
191
196
  shouldCellUpdate: function (record, preRecord) {
@@ -206,7 +211,7 @@ var EditableTable = function () {
206
211
  },
207
212
  {
208
213
  title: '测试111',
209
- width: 100,
214
+ width: 400,
210
215
  dataIndex: 'test111',
211
216
  key: 'test111',
212
217
  editable: true,
@@ -337,62 +342,62 @@ var EditableTable = function () {
337
342
  } }));
338
343
  },
339
344
  },
340
- // {
341
- // title: '测试4',
342
- // width: 100,
343
- // dataIndex: 'test4',
344
- // key: 'test4',
345
- // },
346
- // {
347
- // title: '测试5',
348
- // // width: 100,
349
- // // dataIndex: 'test5',
350
- // // key: 'test5',
351
- // children: [
352
- // {
353
- // title: '测试5-001',
354
- // width: 100,
355
- // dataIndex: 'test5-001',
356
- // key: 'test5-001',
357
- // },
358
- // {
359
- // title: '测试5-002',
360
- // width: 100,
361
- // dataIndex: 'test5-002',
362
- // key: 'test5-002',
363
- // },
364
- // ],
365
- // },
366
- // {
367
- // title: '测试6',
368
- // width: 100,
369
- // dataIndex: 'test6',
370
- // key: 'test6',
371
- // },
372
- // {
373
- // title: '测试7',
374
- // width: 100,
375
- // dataIndex: 'test7',
376
- // key: 'test7',
377
- // },
378
- // {
379
- // title: '测试8',
380
- // width: 100,
381
- // dataIndex: 'test8',
382
- // key: 'test8',
383
- // },
384
- // {
385
- // title: '测试9',
386
- // width: 100,
387
- // dataIndex: 'test9',
388
- // key: 'test9',
389
- // },
390
- // {
391
- // title: '测试10',
392
- // width: 100,
393
- // dataIndex: 'test10',
394
- // key: 'test10',
395
- // },
345
+ {
346
+ title: '测试4',
347
+ width: 100,
348
+ dataIndex: 'test4',
349
+ key: 'test4',
350
+ },
351
+ {
352
+ title: '测试5',
353
+ // width: 100,
354
+ // dataIndex: 'test5',
355
+ // key: 'test5',
356
+ children: [
357
+ {
358
+ title: '测试5-001',
359
+ width: 100,
360
+ dataIndex: 'test5-001',
361
+ key: 'test5-001',
362
+ },
363
+ {
364
+ title: '测试5-002',
365
+ width: 100,
366
+ dataIndex: 'test5-002',
367
+ key: 'test5-002',
368
+ },
369
+ ],
370
+ },
371
+ {
372
+ title: '测试6',
373
+ width: 100,
374
+ dataIndex: 'test6',
375
+ key: 'test6',
376
+ },
377
+ {
378
+ title: '测试7',
379
+ width: 100,
380
+ dataIndex: 'test7',
381
+ key: 'test7',
382
+ },
383
+ {
384
+ title: '测试8',
385
+ width: 100,
386
+ dataIndex: 'test8',
387
+ key: 'test8',
388
+ },
389
+ {
390
+ title: '测试9',
391
+ width: 100,
392
+ dataIndex: 'test9',
393
+ key: 'test9',
394
+ },
395
+ {
396
+ title: '测试10',
397
+ width: 100,
398
+ dataIndex: 'test10',
399
+ key: 'test10',
400
+ },
396
401
  ];
397
402
  // 初始化渲染,针对配置了editable、editableConfig的列配置
398
403
  useEffect(function () {
@@ -525,6 +530,8 @@ var EditableTable = function () {
525
530
  } }, "\u9A8C\u8BC1"),
526
531
  React.createElement(Button, { onClick: function () {
527
532
  console.log(records);
533
+ var ids = records.map(function (item) { return item.id; });
534
+ setExpandedRowKeys(ids);
528
535
  } }, "\u83B7\u53D6\u6570\u636E"),
529
536
  React.createElement(Table, { dataSource: records, columns: columns, rowKey: "id",
530
537
  // 表格项可输入
@@ -536,14 +543,27 @@ var EditableTable = function () {
536
543
  // tableValidate
537
544
  tableHandleRef: tableHandleRef, tableName: "\u6211\u662F\u4E00\u4E2A\u8868\u683C",
538
545
  // 显隐配置
539
- configInfo: tableConfig, showColumnDynamic: true, showColumnDynamicKey: "test-o-0011", onTableChange: onTableChange, showInnerPagination: true, expandable: {
540
- expandedRowRender: function (record) { return React.createElement("p", { style: { margin: 0 } }, "111"); },
541
- rowExpandable: function (record) { return true; },
542
- },
543
- // scroll={{ x: 1000, y: 200 }}
544
- showDelAllBtn: true, delAllChange: onDelAllChange, rowSelection: {
546
+ // configInfo={tableConfig}
547
+ showColumnDynamic: true, showColumnDynamicKey: "test-o-0011", onTableChange: onTableChange, showInnerPagination: true, expandable: {
548
+ // expandedRowRender: (record) => <p style={{ margin: 0 }}>111</p>,
549
+ // rowExpandable: (record) => true,
550
+ expandedRowKeys: expandedRowKeys,
551
+ onExpand: function (expanded, record) {
552
+ if (expanded) {
553
+ setExpandedRowKeys(function (pre) { return __spreadArray(__spreadArray([], pre), [record === null || record === void 0 ? void 0 : record.id]); });
554
+ }
555
+ else {
556
+ setExpandedRowKeys(function (pre) {
557
+ var index = pre.findIndex(function (id) { return id === (record === null || record === void 0 ? void 0 : record.id); });
558
+ var newRecord = pre.slice();
559
+ newRecord.splice(index, 1);
560
+ return newRecord;
561
+ });
562
+ }
563
+ },
564
+ }, isOpenVirtualScrollBar: true, scroll: { x: 1200, y: 400 }, showDelAllBtn: true, delAllChange: onDelAllChange, rowSelection: {
545
565
  type: 'checkbox',
546
- }, summaryConfig: [
566
+ }, summaryFixed: true, summaryConfig: [
547
567
  {
548
568
  type: 'subtotal',
549
569
  fields: [