jrs-react 1.1.11 → 1.1.12
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/build/index.es.js +854 -1
- package/build/index.js +854 -0
- package/package.json +1 -1
- package/src/components/JRTable/JRTable.jsx +5 -7
- package/src/index.js +2 -3
- package/src/components/Message.jsx +0 -89
package/package.json
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { TFoot, THead } from "./THead";
|
|
3
3
|
import { TBodies } from "./TBodies";
|
|
4
4
|
import { StyledJRTable } from "./StyledJRTable";
|
|
5
5
|
import JRFrame from "../JRFrame/JRFrame";
|
|
6
|
-
import { Button, Checkbox } from "antd";
|
|
7
|
-
import React from "react";
|
|
8
6
|
|
|
9
7
|
|
|
10
8
|
const getMapObject=(map,names)=>{
|
|
@@ -44,7 +42,7 @@ export default class JRTable extends JRFrame {
|
|
|
44
42
|
checkableColumn(props){
|
|
45
43
|
return {//方法1
|
|
46
44
|
render({value,onChange}){
|
|
47
|
-
return <
|
|
45
|
+
return <checkbox checked={value} onChange={(e)=>{onChange(e.target.checked)}}/>
|
|
48
46
|
}
|
|
49
47
|
,align:'center'
|
|
50
48
|
,name:'checked'
|
|
@@ -69,12 +67,12 @@ export default class JRTable extends JRFrame {
|
|
|
69
67
|
deletableColumn({name='deletable',sendValue,sendName,valueName,...props}){
|
|
70
68
|
return {
|
|
71
69
|
render({value,onChange}){
|
|
72
|
-
return <
|
|
70
|
+
return <checkbox checked={value} onChange={(e)=>{onChange(e.target.checked)}}/>
|
|
73
71
|
}
|
|
74
72
|
,align:'center'
|
|
75
73
|
,name
|
|
76
74
|
,label(){
|
|
77
|
-
return <
|
|
75
|
+
return <button
|
|
78
76
|
onClick={()=>{
|
|
79
77
|
const value=this.props.delete.value
|
|
80
78
|
?? this.getDataSource()?.filter(record=>record[name]).map(record=>sendValue?record[sendValue]:record)
|
|
@@ -88,7 +86,7 @@ export default class JRTable extends JRFrame {
|
|
|
88
86
|
,...props
|
|
89
87
|
})
|
|
90
88
|
}}
|
|
91
|
-
>刪除</
|
|
89
|
+
>刪除</button>
|
|
92
90
|
}
|
|
93
91
|
,...props
|
|
94
92
|
}
|
package/src/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import JRSubmit from './components/JRSubmit'
|
|
2
2
|
import JRFrame from './components/JRFrame/JRFrame'
|
|
3
|
-
|
|
3
|
+
import JRTable from './components/JRTable/JRTable'
|
|
4
4
|
import JRTest,{JRTestReact} from './components/JRTest'
|
|
5
5
|
export {
|
|
6
6
|
JRTest,JRTestReact
|
|
7
|
-
,JRSubmit,JRFrame
|
|
8
|
-
|
|
7
|
+
,JRSubmit,JRFrame,JRTable
|
|
9
8
|
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { message } from "antd";
|
|
2
|
-
import { CloseOutlined } from "@ant-design/icons";
|
|
3
|
-
|
|
4
|
-
message.config({ duration: 3 });
|
|
5
|
-
|
|
6
|
-
const info = (props) => {
|
|
7
|
-
const key = Date.now();
|
|
8
|
-
message.info({
|
|
9
|
-
content: (
|
|
10
|
-
<>
|
|
11
|
-
<div className="message">{props.message}</div>
|
|
12
|
-
<CloseOutlined
|
|
13
|
-
onClick={() => {
|
|
14
|
-
message.destroy(key);
|
|
15
|
-
}}
|
|
16
|
-
/>
|
|
17
|
-
</>
|
|
18
|
-
),
|
|
19
|
-
className: "info",
|
|
20
|
-
key,
|
|
21
|
-
...props
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const success = (props) => {
|
|
26
|
-
const key = Date.now();
|
|
27
|
-
message.success({
|
|
28
|
-
content: (
|
|
29
|
-
<>
|
|
30
|
-
<div className="message">{props.message}</div>
|
|
31
|
-
<CloseOutlined
|
|
32
|
-
onClick={() => {
|
|
33
|
-
message.destroy(key);
|
|
34
|
-
}}
|
|
35
|
-
/>
|
|
36
|
-
</>
|
|
37
|
-
),
|
|
38
|
-
className: "success",
|
|
39
|
-
key,
|
|
40
|
-
...props
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const warning = (props) => {
|
|
45
|
-
const key = Date.now();
|
|
46
|
-
message.warning({
|
|
47
|
-
content: (
|
|
48
|
-
<>
|
|
49
|
-
<div className="message">{props.message}</div>
|
|
50
|
-
<CloseOutlined
|
|
51
|
-
onClick={() => {
|
|
52
|
-
message.destroy(key);
|
|
53
|
-
}}
|
|
54
|
-
/>
|
|
55
|
-
</>
|
|
56
|
-
),
|
|
57
|
-
className: "warning",
|
|
58
|
-
key,
|
|
59
|
-
...props
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const error = (props) => {
|
|
64
|
-
const key = Date.now();
|
|
65
|
-
message.error({
|
|
66
|
-
content: (
|
|
67
|
-
<>
|
|
68
|
-
<div className="message">{props.message}</div>
|
|
69
|
-
<CloseOutlined
|
|
70
|
-
onClick={() => {
|
|
71
|
-
message.destroy(key);
|
|
72
|
-
}}
|
|
73
|
-
/>
|
|
74
|
-
</>
|
|
75
|
-
),
|
|
76
|
-
className: "error",
|
|
77
|
-
key,
|
|
78
|
-
...props
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const msg = {
|
|
83
|
-
info,
|
|
84
|
-
success,
|
|
85
|
-
warning,
|
|
86
|
-
error
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export default msg;
|