cfel-base-components 2.4.2 → 2.4.4

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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cfel-base-components",
3
- "version": "2.4.2",
3
+ "version": "2.4.4",
4
4
  "description": "cfel-base-components",
5
5
  "main": "/src/index.tsx",
6
6
  "types": "src/index.d.ts",
@@ -9,14 +9,7 @@ export default function ProTableComponent({
9
9
  nameSpace,
10
10
  ...restFileds
11
11
  }: ProTableProps<any, any> | any) {
12
- const tableColumnsConfig = JSON.parse(
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({
@@ -28,22 +21,6 @@ export default function ProTableComponent({
28
21
  scroll={{
29
22
  x: "max-content",
30
23
  }}
31
- columnsState={{
32
- value: columnsStateMap,
33
- onChange: (v) => {
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
- },
46
- }}
47
24
  {...restFileds}
48
25
  />
49
26
  );