cfel-base-components 2.4.2 → 2.4.3
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/demo/src/index.jsx
CHANGED
|
@@ -29,6 +29,21 @@ const App = () => {
|
|
|
29
29
|
dataIndex: "status",
|
|
30
30
|
key: "status",
|
|
31
31
|
},
|
|
32
|
+
{
|
|
33
|
+
title: "操作",
|
|
34
|
+
width: 120,
|
|
35
|
+
fixed: "right",
|
|
36
|
+
render: (row) => (
|
|
37
|
+
<a
|
|
38
|
+
onClick={() => {
|
|
39
|
+
setEditingData(row);
|
|
40
|
+
setInstanceDetailOpen(true);
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
详情
|
|
44
|
+
</a>
|
|
45
|
+
),
|
|
46
|
+
},
|
|
32
47
|
];
|
|
33
48
|
|
|
34
49
|
return (
|
|
@@ -92,6 +107,7 @@ const App = () => {
|
|
|
92
107
|
|
|
93
108
|
<ProTable
|
|
94
109
|
columns={columns}
|
|
110
|
+
nameSpace="device"
|
|
95
111
|
dataSource={[{ name: "1", description: "1", status: "1" }]}
|
|
96
112
|
/>
|
|
97
113
|
</Layout>
|
package/package.json
CHANGED
|
@@ -9,14 +9,7 @@ export default function ProTableComponent({
|
|
|
9
9
|
nameSpace,
|
|
10
10
|
...restFileds
|
|
11
11
|
}: ProTableProps<any, any> | any) {
|
|
12
|
-
|
|
13
|
-
localStorage.getItem("TABLE_COLUMNS_CONFIG")!
|
|
14
|
-
);
|
|
15
|
-
const currentConfig = tableColumnsConfig?.[nameSpace];
|
|
16
|
-
const [columnsStateMap, setColumnsStateMap]: any = useState(
|
|
17
|
-
currentConfig || {}
|
|
18
|
-
);
|
|
19
|
-
|
|
12
|
+
|
|
20
13
|
return (
|
|
21
14
|
<ProTable
|
|
22
15
|
className={cx({
|
|
@@ -29,20 +22,8 @@ export default function ProTableComponent({
|
|
|
29
22
|
x: "max-content",
|
|
30
23
|
}}
|
|
31
24
|
columnsState={{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
setColumnsStateMap(v);
|
|
35
|
-
if (!nameSpace || typeof nameSpace !== "string") {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
localStorage.setItem(
|
|
39
|
-
"TABLE_COLUMNS_CONFIG",
|
|
40
|
-
JSON.stringify({
|
|
41
|
-
...tableColumnsConfig,
|
|
42
|
-
[nameSpace]: v,
|
|
43
|
-
})
|
|
44
|
-
);
|
|
45
|
-
},
|
|
25
|
+
persistenceKey: nameSpace,
|
|
26
|
+
persistenceType: "localStorage",
|
|
46
27
|
}}
|
|
47
28
|
{...restFileds}
|
|
48
29
|
/>
|