szld-libs 0.2.33 → 0.2.35
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/dist/szld-components.es.js +487 -483
- package/dist/szld-components.umd.js +16 -16
- package/es/components/SearchTable/index.js +10 -7
- package/es/index.js +11 -17
- package/lib/components/SearchTable/index.js +10 -7
- package/lib/index.js +10 -16
- package/package.json +1 -1
|
@@ -31,8 +31,9 @@ function SearchTable(props) {
|
|
|
31
31
|
const getWidth = (v) => {
|
|
32
32
|
var _a, _b;
|
|
33
33
|
let width = v.width || minColumnWidth;
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
34
|
+
if (v.dataIndex && tableId) {
|
|
35
|
+
const key = Array.isArray(v.dataIndex) ? v.dataIndex.join("-") : String(v.dataIndex);
|
|
36
|
+
const _width = (_b = (_a = getLocalStorage(storageKey)) == null ? void 0 : _a[tableId]) == null ? void 0 : _b[key];
|
|
36
37
|
if (_width) {
|
|
37
38
|
width = _width;
|
|
38
39
|
}
|
|
@@ -78,8 +79,9 @@ function SearchTable(props) {
|
|
|
78
79
|
const obj = getLocalStorage(storageKey) || {};
|
|
79
80
|
obj[tableId] = obj[tableId] || {};
|
|
80
81
|
list == null ? void 0 : list.forEach((v) => {
|
|
81
|
-
if (
|
|
82
|
-
|
|
82
|
+
if (v.dataIndex) {
|
|
83
|
+
const key = Array.isArray(v.dataIndex) ? v.dataIndex.join("-") : String(v.dataIndex);
|
|
84
|
+
obj[tableId][key] = v.width;
|
|
83
85
|
}
|
|
84
86
|
});
|
|
85
87
|
localStorage.setItem(storageKey, JSON.stringify(obj));
|
|
@@ -90,19 +92,20 @@ function SearchTable(props) {
|
|
|
90
92
|
const components = {
|
|
91
93
|
header: {
|
|
92
94
|
cell: ResizeableTitle
|
|
93
|
-
}
|
|
95
|
+
},
|
|
96
|
+
...rest == null ? void 0 : rest.components
|
|
94
97
|
};
|
|
95
98
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
96
99
|
searchProps && /* @__PURE__ */ jsx(CreateForm, { hiddenTitle: true, ...searchProps, items: searchProps.items }),
|
|
97
100
|
/* @__PURE__ */ jsx(
|
|
98
101
|
Table,
|
|
99
102
|
{
|
|
100
|
-
...rest,
|
|
101
|
-
columns,
|
|
102
103
|
scroll: {
|
|
103
104
|
x: columns == null ? void 0 : columns.reduce((a, b) => a + (typeof b.width === "number" ? b.width : minColumnWidth), 0)
|
|
104
105
|
},
|
|
106
|
+
...rest,
|
|
105
107
|
components,
|
|
108
|
+
columns,
|
|
106
109
|
className: classNames(classes.table, tableProps == null ? void 0 : tableProps.className),
|
|
107
110
|
pagination: typeof (tableProps == null ? void 0 : tableProps.pagination) === "boolean" ? tableProps.pagination : {
|
|
108
111
|
showPrevNextJumpers: true,
|
package/es/index.js
CHANGED
|
@@ -4,29 +4,15 @@ import ReactDOM from "react-dom/client";
|
|
|
4
4
|
import { BrowserRouter } from "react-router-dom";
|
|
5
5
|
import { Table, Button } from "antd";
|
|
6
6
|
import useConfig from "./hooks/useConfig";
|
|
7
|
-
import {
|
|
7
|
+
import { SearchTable } from "./main";
|
|
8
8
|
let key = "U2FsdGVkX1/dG1NSXNR9hnp3Ech/v6Gh8CDDJxgBm1EPFQel12ySIf84ARXCPwTae7TzwgPvjOyE3S5rAEzl/wAZmId6pbezpFeFcJqxdmIl3FeluYHFxJzQHDETTvrr3G/REvv00kHptOVwg6ecjPH6yk7PNit0sWTBLorROxLxMD8lVDmOA66p7Zp4QnYzqScYJGFbutmfHYXfBRBe1Q2UKummJ798svNY5SIwEwl4spzgyWmhARtuyq4zhysFrj/xODuNDjtwitA6XfX566WcZkj3F+2P+mkYzDYOhXXaomnlybjrZ2hEHfcczQhUfJd89O8PNIuEWo24wjYRgMdKlw5CWSeocFCqV7ZJ/CV/7vNRcaO4awKlFNobLikkwDznxpcX+4UEej+ED+pgfmPQLsKedcfEscStkSAZXaD5pBRTiFU9xGLfDt6seUrEnMBeXkpMIY9j1SZDDK18/G7lSHjDQMZYZP6sfLdBdwY=";
|
|
9
9
|
const Demo = () => {
|
|
10
10
|
useConfig(key);
|
|
11
11
|
useEffect(() => {
|
|
12
|
-
jiami();
|
|
13
12
|
}, []);
|
|
14
|
-
const jiami = () => {
|
|
15
|
-
const aes = new AES();
|
|
16
|
-
aes.encrypt(
|
|
17
|
-
JSON.stringify({
|
|
18
|
-
AppID: "GZY_SZLD_GZYDP",
|
|
19
|
-
Password: "GZY_SZLD_GZYDP2557013",
|
|
20
|
-
copyright: " © 云雁科技有限公司 2023 版权所有",
|
|
21
|
-
icp: 'ICP备案/许可证号:<a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">湘B2-20090059</a> 公网安备号 44030502008569 隐私政策',
|
|
22
|
-
tel: "400-607-0705",
|
|
23
|
-
Salt: "HnSzldjt#2557013#"
|
|
24
|
-
})
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
13
|
const columns = [
|
|
28
14
|
{
|
|
29
|
-
dataIndex: "a",
|
|
15
|
+
dataIndex: ["a", 2],
|
|
30
16
|
title: "a"
|
|
31
17
|
},
|
|
32
18
|
Table.EXPAND_COLUMN,
|
|
@@ -63,12 +49,20 @@ const Demo = () => {
|
|
|
63
49
|
}
|
|
64
50
|
},
|
|
65
51
|
tableId: "demo1",
|
|
66
|
-
storageKey: "szld-libs-test"
|
|
52
|
+
storageKey: "szld-libs-test",
|
|
53
|
+
components: {
|
|
54
|
+
body: {
|
|
55
|
+
cell: CustomCell
|
|
56
|
+
}
|
|
57
|
+
}
|
|
67
58
|
}
|
|
68
59
|
}
|
|
69
60
|
)
|
|
70
61
|
] });
|
|
71
62
|
};
|
|
63
|
+
const CustomCell = (props) => {
|
|
64
|
+
return /* @__PURE__ */ jsx("td", { ...props, className: "tdtdtdtd", children: props.children });
|
|
65
|
+
};
|
|
72
66
|
ReactDOM.createRoot(document.getElementById("root")).render(
|
|
73
67
|
/* @__PURE__ */ jsx(BrowserRouter, { children: /* @__PURE__ */ jsx(Demo, {}) })
|
|
74
68
|
);
|
|
@@ -32,8 +32,9 @@ function SearchTable(props) {
|
|
|
32
32
|
const getWidth = (v) => {
|
|
33
33
|
var _a, _b;
|
|
34
34
|
let width = v.width || minColumnWidth;
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
35
|
+
if (v.dataIndex && tableId) {
|
|
36
|
+
const key = Array.isArray(v.dataIndex) ? v.dataIndex.join("-") : String(v.dataIndex);
|
|
37
|
+
const _width = (_b = (_a = utils.getLocalStorage(storageKey)) == null ? void 0 : _a[tableId]) == null ? void 0 : _b[key];
|
|
37
38
|
if (_width) {
|
|
38
39
|
width = _width;
|
|
39
40
|
}
|
|
@@ -79,8 +80,9 @@ function SearchTable(props) {
|
|
|
79
80
|
const obj = utils.getLocalStorage(storageKey) || {};
|
|
80
81
|
obj[tableId] = obj[tableId] || {};
|
|
81
82
|
list == null ? void 0 : list.forEach((v) => {
|
|
82
|
-
if (
|
|
83
|
-
|
|
83
|
+
if (v.dataIndex) {
|
|
84
|
+
const key = Array.isArray(v.dataIndex) ? v.dataIndex.join("-") : String(v.dataIndex);
|
|
85
|
+
obj[tableId][key] = v.width;
|
|
84
86
|
}
|
|
85
87
|
});
|
|
86
88
|
localStorage.setItem(storageKey, JSON.stringify(obj));
|
|
@@ -91,19 +93,20 @@ function SearchTable(props) {
|
|
|
91
93
|
const components = {
|
|
92
94
|
header: {
|
|
93
95
|
cell: ResizeableTitle
|
|
94
|
-
}
|
|
96
|
+
},
|
|
97
|
+
...rest == null ? void 0 : rest.components
|
|
95
98
|
};
|
|
96
99
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
97
100
|
searchProps && /* @__PURE__ */ jsxRuntime.jsx(CreateForm, { hiddenTitle: true, ...searchProps, items: searchProps.items }),
|
|
98
101
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
99
102
|
antd.Table,
|
|
100
103
|
{
|
|
101
|
-
...rest,
|
|
102
|
-
columns,
|
|
103
104
|
scroll: {
|
|
104
105
|
x: columns == null ? void 0 : columns.reduce((a, b) => a + (typeof b.width === "number" ? b.width : minColumnWidth), 0)
|
|
105
106
|
},
|
|
107
|
+
...rest,
|
|
106
108
|
components,
|
|
109
|
+
columns,
|
|
107
110
|
className: classNames(classes.table, tableProps == null ? void 0 : tableProps.className),
|
|
108
111
|
pagination: typeof (tableProps == null ? void 0 : tableProps.pagination) === "boolean" ? tableProps.pagination : {
|
|
109
112
|
showPrevNextJumpers: true,
|
package/lib/index.js
CHANGED
|
@@ -10,24 +10,10 @@ let key = "U2FsdGVkX1/dG1NSXNR9hnp3Ech/v6Gh8CDDJxgBm1EPFQel12ySIf84ARXCPwTae7Tzw
|
|
|
10
10
|
const Demo = () => {
|
|
11
11
|
useConfig(key);
|
|
12
12
|
react.useEffect(() => {
|
|
13
|
-
jiami();
|
|
14
13
|
}, []);
|
|
15
|
-
const jiami = () => {
|
|
16
|
-
const aes = new main.AES();
|
|
17
|
-
aes.encrypt(
|
|
18
|
-
JSON.stringify({
|
|
19
|
-
AppID: "GZY_SZLD_GZYDP",
|
|
20
|
-
Password: "GZY_SZLD_GZYDP2557013",
|
|
21
|
-
copyright: " © 云雁科技有限公司 2023 版权所有",
|
|
22
|
-
icp: 'ICP备案/许可证号:<a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">湘B2-20090059</a> 公网安备号 44030502008569 隐私政策',
|
|
23
|
-
tel: "400-607-0705",
|
|
24
|
-
Salt: "HnSzldjt#2557013#"
|
|
25
|
-
})
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
14
|
const columns = [
|
|
29
15
|
{
|
|
30
|
-
dataIndex: "a",
|
|
16
|
+
dataIndex: ["a", 2],
|
|
31
17
|
title: "a"
|
|
32
18
|
},
|
|
33
19
|
antd.Table.EXPAND_COLUMN,
|
|
@@ -64,12 +50,20 @@ const Demo = () => {
|
|
|
64
50
|
}
|
|
65
51
|
},
|
|
66
52
|
tableId: "demo1",
|
|
67
|
-
storageKey: "szld-libs-test"
|
|
53
|
+
storageKey: "szld-libs-test",
|
|
54
|
+
components: {
|
|
55
|
+
body: {
|
|
56
|
+
cell: CustomCell
|
|
57
|
+
}
|
|
58
|
+
}
|
|
68
59
|
}
|
|
69
60
|
}
|
|
70
61
|
)
|
|
71
62
|
] });
|
|
72
63
|
};
|
|
64
|
+
const CustomCell = (props) => {
|
|
65
|
+
return /* @__PURE__ */ jsxRuntime.jsx("td", { ...props, className: "tdtdtdtd", children: props.children });
|
|
66
|
+
};
|
|
73
67
|
ReactDOM.createRoot(document.getElementById("root")).render(
|
|
74
68
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.BrowserRouter, { children: /* @__PURE__ */ jsxRuntime.jsx(Demo, {}) })
|
|
75
69
|
);
|