@hw-component/table 1.9.27 → 1.9.29
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.
- package/es/HTableBody/RowSelection.js +9 -2
- package/es/HTableHeader/defaultSubComponent.js +1 -1
- package/lib/HTableBody/RowSelection.js +8 -1
- package/lib/HTableHeader/defaultSubComponent.js +1 -1
- package/package.json +1 -1
- package/src/components/HTableBody/RowSelection.tsx +12 -2
- package/src/components/HTableHeader/defaultSubComponent.tsx +1 -1
- package/src/pages/Table/index.tsx +0 -23
|
@@ -8,7 +8,7 @@ import _spliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/insta
|
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
import { useHTableContext } from '../context.js';
|
|
10
10
|
import { Dropdown, Checkbox, Menu } from 'antd';
|
|
11
|
-
import { useMemo } from 'react';
|
|
11
|
+
import { useMemo, useEffect } from 'react';
|
|
12
12
|
|
|
13
13
|
var RowSelectionTitle = function RowSelectionTitle(_ref) {
|
|
14
14
|
var _ref$allPageCheck = _ref.allPageCheck,
|
|
@@ -139,21 +139,28 @@ var RowSelectionBox = function RowSelectionBox(_ref5) {
|
|
|
139
139
|
if (checked) {
|
|
140
140
|
newKeys.push(key);
|
|
141
141
|
newRowData.push(data);
|
|
142
|
+
console.log(newKeys, newRowData, "newKeys,newRowData");
|
|
142
143
|
rowOnChange(newKeys, newRowData);
|
|
143
144
|
onChange === null || onChange === void 0 || onChange(newKeys, newRowData);
|
|
144
145
|
return;
|
|
145
146
|
}
|
|
146
147
|
var keyIndex = _indexOfInstanceProperty(newKeys).call(newKeys, key);
|
|
148
|
+
console.log(keyIndex, "keyIndex");
|
|
147
149
|
_spliceInstanceProperty(newKeys).call(newKeys, keyIndex, 1);
|
|
148
150
|
_spliceInstanceProperty(newRowData).call(newRowData, keyIndex, 1);
|
|
151
|
+
console.log(newKeys, newRowData, "newKeys,newRowData");
|
|
149
152
|
rowOnChange(newKeys, newRowData);
|
|
150
153
|
onChange === null || onChange === void 0 || onChange(newKeys, newRowData);
|
|
151
154
|
};
|
|
152
155
|
var _ref6 = (getCheckboxProps === null || getCheckboxProps === void 0 ? void 0 : getCheckboxProps(data)) || {},
|
|
153
156
|
_ref6$disabled = _ref6.disabled,
|
|
154
157
|
disabled = _ref6$disabled === void 0 ? false : _ref6$disabled;
|
|
158
|
+
var checked = _indexOfInstanceProperty(keys).call(keys, key) !== -1;
|
|
159
|
+
useEffect(function () {
|
|
160
|
+
console.log("检测一次");
|
|
161
|
+
}, []);
|
|
155
162
|
return jsx(Checkbox, {
|
|
156
|
-
checked:
|
|
163
|
+
checked: checked,
|
|
157
164
|
onChange: check,
|
|
158
165
|
disabled: disabled
|
|
159
166
|
});
|
|
@@ -140,21 +140,28 @@ var RowSelectionBox = function RowSelectionBox(_ref5) {
|
|
|
140
140
|
if (checked) {
|
|
141
141
|
newKeys.push(key);
|
|
142
142
|
newRowData.push(data);
|
|
143
|
+
console.log(newKeys, newRowData, "newKeys,newRowData");
|
|
143
144
|
rowOnChange(newKeys, newRowData);
|
|
144
145
|
onChange === null || onChange === void 0 || onChange(newKeys, newRowData);
|
|
145
146
|
return;
|
|
146
147
|
}
|
|
147
148
|
var keyIndex = _indexOfInstanceProperty(newKeys).call(newKeys, key);
|
|
149
|
+
console.log(keyIndex, "keyIndex");
|
|
148
150
|
_spliceInstanceProperty(newKeys).call(newKeys, keyIndex, 1);
|
|
149
151
|
_spliceInstanceProperty(newRowData).call(newRowData, keyIndex, 1);
|
|
152
|
+
console.log(newKeys, newRowData, "newKeys,newRowData");
|
|
150
153
|
rowOnChange(newKeys, newRowData);
|
|
151
154
|
onChange === null || onChange === void 0 || onChange(newKeys, newRowData);
|
|
152
155
|
};
|
|
153
156
|
var _ref6 = (getCheckboxProps === null || getCheckboxProps === void 0 ? void 0 : getCheckboxProps(data)) || {},
|
|
154
157
|
_ref6$disabled = _ref6.disabled,
|
|
155
158
|
disabled = _ref6$disabled === void 0 ? false : _ref6$disabled;
|
|
159
|
+
var checked = _indexOfInstanceProperty(keys).call(keys, key) !== -1;
|
|
160
|
+
React.useEffect(function () {
|
|
161
|
+
console.log("检测一次");
|
|
162
|
+
}, []);
|
|
156
163
|
return jsxRuntime.jsx(antd.Checkbox, {
|
|
157
|
-
checked:
|
|
164
|
+
checked: checked,
|
|
158
165
|
onChange: check,
|
|
159
166
|
disabled: disabled
|
|
160
167
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useHTableContext } from "../context";
|
|
2
2
|
import { Checkbox, Dropdown, Menu } from "antd";
|
|
3
|
-
import { useMemo
|
|
3
|
+
import {useEffect, useMemo} from "react";
|
|
4
4
|
import type { HRowSelection } from "../modal";
|
|
5
5
|
export const RowSelectionTitle = ({
|
|
6
6
|
allPageCheck = true,
|
|
@@ -126,20 +126,30 @@ export const RowSelectionBox = ({
|
|
|
126
126
|
if (checked) {
|
|
127
127
|
newKeys.push(key);
|
|
128
128
|
newRowData.push(data);
|
|
129
|
+
console.log(newKeys,newRowData,"newKeys,newRowData")
|
|
129
130
|
rowOnChange(newKeys, newRowData);
|
|
130
131
|
onChange?.(newKeys, newRowData);
|
|
131
132
|
return;
|
|
132
133
|
}
|
|
133
134
|
const keyIndex = newKeys.indexOf(key);
|
|
135
|
+
console.log(keyIndex,"keyIndex")
|
|
134
136
|
newKeys.splice(keyIndex, 1);
|
|
135
137
|
newRowData.splice(keyIndex, 1);
|
|
138
|
+
console.log(newKeys,newRowData,"newKeys,newRowData")
|
|
136
139
|
rowOnChange(newKeys, newRowData);
|
|
137
140
|
onChange?.(newKeys, newRowData);
|
|
138
141
|
};
|
|
139
142
|
const { disabled = false } = getCheckboxProps?.(data) || {};
|
|
143
|
+
const checked=keys.indexOf(key) !== -1;
|
|
144
|
+
useEffect(() => {
|
|
145
|
+
if (checked){
|
|
146
|
+
|
|
147
|
+
}
|
|
148
|
+
console.log("检测一次")
|
|
149
|
+
}, []);
|
|
140
150
|
return (
|
|
141
151
|
<Checkbox
|
|
142
|
-
checked={
|
|
152
|
+
checked={checked}
|
|
143
153
|
onChange={check}
|
|
144
154
|
disabled={disabled}
|
|
145
155
|
/>
|
|
@@ -43,20 +43,6 @@ export const configData = [
|
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
|
-
{
|
|
47
|
-
showSearch: true,
|
|
48
|
-
searchType: "submit",
|
|
49
|
-
searchRender:(item,node,form,table)=>{
|
|
50
|
-
console.log(table)
|
|
51
|
-
return <HTableHeaderSubBtn form={form} render={([sub,reset,more])=>{
|
|
52
|
-
return <div>
|
|
53
|
-
{sub}
|
|
54
|
-
{reset}
|
|
55
|
-
{more}
|
|
56
|
-
</div>
|
|
57
|
-
}}/>
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
46
|
{
|
|
61
47
|
title: "短信接收手机号",
|
|
62
48
|
dataIndex: "mobileList",
|
|
@@ -185,19 +171,10 @@ export default () => {
|
|
|
185
171
|
searchSpan={{
|
|
186
172
|
span:24
|
|
187
173
|
}}
|
|
188
|
-
onFinish={() => {
|
|
189
|
-
console.log("fff");
|
|
190
|
-
}}
|
|
191
174
|
rowKey={(rowData, index) => {
|
|
192
175
|
return index;
|
|
193
176
|
}}
|
|
194
177
|
table={hTable}
|
|
195
|
-
loading={true}
|
|
196
|
-
onReset={() => {
|
|
197
|
-
hTable.form.setFieldsValue({
|
|
198
|
-
name1: "ffff",
|
|
199
|
-
});
|
|
200
|
-
}}
|
|
201
178
|
labelWidth={88}
|
|
202
179
|
action={{
|
|
203
180
|
test: (params) => {
|