zy-react-library 1.0.45 → 1.0.46
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.
|
@@ -1,58 +1,32 @@
|
|
|
1
|
-
import { request } from "@cqsjjb/jjb-common-lib/http";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import BasicLeftTree from "../../Basic";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 部门左侧树组件(港务局版本)
|
|
7
|
-
*/
|
|
8
|
-
function DepartmentSelectTree(props) {
|
|
9
|
-
const {
|
|
10
|
-
params = {},
|
|
11
|
-
...restProps
|
|
12
|
-
} = props;
|
|
13
|
-
|
|
14
|
-
const [treeData, setTreeData] = useState([
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
{
|
|
34
|
-
name: "parent 1-1",
|
|
35
|
-
id: "0-0-1",
|
|
36
|
-
childrenList: [{ name: <span style={{ color: "#1677ff" }}>sss</span>, id: "0-0-1-0" }],
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
},
|
|
40
|
-
]);
|
|
41
|
-
|
|
42
|
-
const getData = async () => {
|
|
43
|
-
const { data } = await request("/basic-info/department/listTree", "post", params);
|
|
44
|
-
setTreeData(data);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
getData();
|
|
49
|
-
}, []);
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<BasicLeftTree treeData={treeData} placeholder="部门" {...restProps} />
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
DepartmentSelectTree.displayName = "DepartmentSelectTree";
|
|
57
|
-
|
|
58
|
-
export default DepartmentSelectTree;
|
|
1
|
+
import { request } from "@cqsjjb/jjb-common-lib/http";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import BasicLeftTree from "../../Basic";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 部门左侧树组件(港务局版本)
|
|
7
|
+
*/
|
|
8
|
+
function DepartmentSelectTree(props) {
|
|
9
|
+
const {
|
|
10
|
+
params = {},
|
|
11
|
+
...restProps
|
|
12
|
+
} = props;
|
|
13
|
+
|
|
14
|
+
const [treeData, setTreeData] = useState([]);
|
|
15
|
+
|
|
16
|
+
const getData = async () => {
|
|
17
|
+
const { data } = await request("/basic-info/department/listTree", "post", params);
|
|
18
|
+
setTreeData(data);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
getData();
|
|
23
|
+
}, []);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<BasicLeftTree treeData={treeData} placeholder="部门" {...restProps} />
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
DepartmentSelectTree.displayName = "DepartmentSelectTree";
|
|
31
|
+
|
|
32
|
+
export default DepartmentSelectTree;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import Table from "@cqsjjb/jjb-react-admin-component/Table";
|
|
2
|
-
import { getIndexColumn } from "../../utils/index";
|
|
3
|
-
import "./index.less";
|
|
4
|
-
|
|
5
|
-
function TablePro(props) {
|
|
6
|
-
const {
|
|
7
|
-
columns = [],
|
|
8
|
-
showIndex = true,
|
|
9
|
-
useAlignCenter = true,
|
|
10
|
-
rowKey = "id",
|
|
11
|
-
...restProps
|
|
12
|
-
} = props;
|
|
13
|
-
|
|
14
|
-
const storeIndex = props.storeIndex || `${window.process.env.app.antd["ant-prefix"]}_${Math.random().toString(36).substring(2)}`;
|
|
15
|
-
function calcColumns() {
|
|
16
|
-
showIndex && columns.unshift(getIndexColumn(props.pagination));
|
|
17
|
-
return columns.map(item => ({ align: useAlignCenter ? "center" : "left", ...item }));
|
|
18
|
-
}
|
|
19
|
-
return <Table rowKey={rowKey} storeIndex={storeIndex} columns={calcColumns()} {...restProps} />;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default TablePro;
|
|
1
|
+
import Table from "@cqsjjb/jjb-react-admin-component/Table";
|
|
2
|
+
import { getIndexColumn } from "../../utils/index";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
|
|
5
|
+
function TablePro(props) {
|
|
6
|
+
const {
|
|
7
|
+
columns = [],
|
|
8
|
+
showIndex = true,
|
|
9
|
+
useAlignCenter = true,
|
|
10
|
+
rowKey = "id",
|
|
11
|
+
...restProps
|
|
12
|
+
} = props;
|
|
13
|
+
|
|
14
|
+
const storeIndex = props.storeIndex || `${window.process.env.app.antd["ant-prefix"]}_${Math.random().toString(36).substring(2)}`;
|
|
15
|
+
function calcColumns() {
|
|
16
|
+
showIndex && columns.unshift(getIndexColumn(props.pagination));
|
|
17
|
+
return columns.map(item => ({ align: useAlignCenter ? "center" : "left", ...item }));
|
|
18
|
+
}
|
|
19
|
+
return <Table rowKey={rowKey} storeIndex={storeIndex} columns={calcColumns()} {...restProps} />;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default TablePro;
|