@nokecy/qc-ui 0.3.13 → 0.3.14

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,172 +1,172 @@
1
- .react-dashboard-widget-selector{
2
- position:fixed;
3
- top:50%;
4
- left:50%;
5
- transform:translate(-50%, -50%);
6
- z-index:1006;
7
- width:60%;
8
- height:60%;
9
- max-width:800px;
10
- max-height:600px;
11
- background:var(--component-background);
12
- }
13
-
14
- .react-dashboard-widget-wrap {
15
- display: flex;
16
- height:100%;
17
-
18
- .react-dashboard-widget-leftBar {
19
- padding: 10px;
20
- width: 180px;
21
- border-right: 1px solid rgba(0, 0, 0, 0.1);
22
- background: var(--component-background);
23
- .react-dashboard-widget-searchIcon {
24
- color: var(--text-color);
25
- }
26
-
27
- .react-dashboard-widget-item {
28
- display: flex;
29
- justify-content: space-between;
30
- padding: 10px;
31
-
32
- .react-dashboard-widget-Badge {
33
-
34
- .ant-badge-count {
35
- color: var(--text-color);
36
- background-color: var(--component-background-1) !important;
37
- }
38
-
39
- }
40
-
41
- cursor: pointer;
42
-
43
- &:hover {
44
- background: var(--component-background-3);
45
- font-weight: bold;
46
- }
47
- }
48
-
49
- .react-dashboard-widget-active {
50
- background: rgba(0, 0, 0, 0.03);
51
- font-weight: bold;
52
- }
53
- }
54
-
55
- .react-dashboard-widget-Layer {
56
- flex: 1 1;
57
- overflow-y: auto;
58
- overflow-x: hidden;
59
- padding: 10px;
60
- background: rgba(0, 0, 0, 0.01);
61
- &::-webkit-scrollbar {
62
- width: 1px;
63
- height: 1px;
64
- overflow: auto;
65
- }
66
-
67
- &::-webkit-scrollbar-thumb {
68
- background-color: var(--primary-color);
69
- min-height: 25px;
70
- min-width: 25px;
71
-
72
- &:hover {
73
- background-color: #a8a8a8;
74
- }
75
-
76
- &:active {
77
- background-color: #787878;
78
- }
79
- }
80
-
81
- &::-webkit-scrollbar-track {
82
- background-color: #f7f7f7;
83
- border: 1px solid #efefef;
84
- }
85
-
86
- .react-dashboard-widget-waterfall {
87
- width: 100%;
88
- }
89
-
90
- .ant-popover-inner-content {
91
- background: rgba(0, 0, 0, 0.01);
92
- }
93
-
94
-
95
- .react-dashboard-widget-item {
96
- cursor: pointer;
97
- height: auto;
98
- margin-bottom: 10px;
99
- width: 100%;
100
- height: auto;
101
- border-radius: 5px;
102
- overflow: hidden;
103
- // box-shadow: 0 0 0px rgba(255, 255, 255, 1);
104
- transition: all 0.3s;
105
- border: 1px solid rgba(0, 0, 0, 0.1);
106
- -webkit-column-break-inside: avoid;
107
- position: relative;
108
- background: var(--component-background);
109
- .react-dashboard-widget-shortcut {
110
- width: 100%;
111
- height: auto;
112
- }
113
-
114
- .react-dashboard-widget-mask {
115
- opacity: 0;
116
- position: absolute;
117
- top: 0;
118
- left: 0;
119
- width: 100%;
120
- height: 100%;
121
- background: rgba(0, 0, 0, 0.5);
122
- display: flex;
123
- justify-content: center;
124
- align-items: center;
125
- transition: all 0.3s;
126
- }
127
-
128
- &:hover {
129
- transition: all 0.3s;
130
-
131
- border: 1px solid var(--component-background-3);
132
-
133
- .react-dashboard-widget-mask {
134
- opacity: 1;
135
- transition: all 0.3s;
136
- }
137
- }
138
-
139
- .react-dashboard-widget-bottombar {
140
- border-top: 1px solid rgba(0, 0, 0, 0.1);
141
- width: 100%;
142
-
143
- padding: 5px;
144
-
145
- .react-dashboard-widget-iconWrap {
146
- display: inline-block;
147
- width: 28px;
148
- height: 28px;
149
- line-height: 28px;
150
- text-align: center;
151
- border-radius: 7px;
152
- color: #fff;
153
- margin-right: 5px;
154
- font-size: 16px;
155
- }
156
-
157
- .react-dashboard-widget-name {
158
- font-size: 16px;
159
- flex: 1;
160
- color: var(--text-color);
161
- line-height: 28px;
162
- font-weight: bold;
163
- display: inline;
164
- }
165
-
166
- .react-dashboard-widget-description {
167
- margin-top: 5px;
168
- }
169
- }
170
- }
171
- }
172
- }
1
+ .react-dashboard-widget-selector{
2
+ position:fixed;
3
+ top:50%;
4
+ left:50%;
5
+ transform:translate(-50%, -50%);
6
+ z-index:1006;
7
+ width:60%;
8
+ height:60%;
9
+ max-width:800px;
10
+ max-height:600px;
11
+ background:var(--component-background);
12
+ }
13
+
14
+ .react-dashboard-widget-wrap {
15
+ display: flex;
16
+ height:100%;
17
+
18
+ .react-dashboard-widget-leftBar {
19
+ padding: 10px;
20
+ width: 180px;
21
+ border-right: 1px solid rgba(0, 0, 0, 0.1);
22
+ background: var(--component-background);
23
+ .react-dashboard-widget-searchIcon {
24
+ color: var(--text-color);
25
+ }
26
+
27
+ .react-dashboard-widget-item {
28
+ display: flex;
29
+ justify-content: space-between;
30
+ padding: 10px;
31
+
32
+ .react-dashboard-widget-Badge {
33
+
34
+ .ant-badge-count {
35
+ color: var(--text-color);
36
+ background-color: var(--component-background-1) !important;
37
+ }
38
+
39
+ }
40
+
41
+ cursor: pointer;
42
+
43
+ &:hover {
44
+ background: var(--component-background-3);
45
+ font-weight: bold;
46
+ }
47
+ }
48
+
49
+ .react-dashboard-widget-active {
50
+ background: rgba(0, 0, 0, 0.03);
51
+ font-weight: bold;
52
+ }
53
+ }
54
+
55
+ .react-dashboard-widget-Layer {
56
+ flex: 1 1;
57
+ overflow-y: auto;
58
+ overflow-x: hidden;
59
+ padding: 10px;
60
+ background: rgba(0, 0, 0, 0.01);
61
+ &::-webkit-scrollbar {
62
+ width: 1px;
63
+ height: 1px;
64
+ overflow: auto;
65
+ }
66
+
67
+ &::-webkit-scrollbar-thumb {
68
+ background-color: var(--primary-color);
69
+ min-height: 25px;
70
+ min-width: 25px;
71
+
72
+ &:hover {
73
+ background-color: #a8a8a8;
74
+ }
75
+
76
+ &:active {
77
+ background-color: #787878;
78
+ }
79
+ }
80
+
81
+ &::-webkit-scrollbar-track {
82
+ background-color: #f7f7f7;
83
+ border: 1px solid #efefef;
84
+ }
85
+
86
+ .react-dashboard-widget-waterfall {
87
+ width: 100%;
88
+ }
89
+
90
+ .ant-popover-inner-content {
91
+ background: rgba(0, 0, 0, 0.01);
92
+ }
93
+
94
+
95
+ .react-dashboard-widget-item {
96
+ cursor: pointer;
97
+ height: auto;
98
+ margin-bottom: 10px;
99
+ width: 100%;
100
+ height: auto;
101
+ border-radius: 5px;
102
+ overflow: hidden;
103
+ // box-shadow: 0 0 0px rgba(255, 255, 255, 1);
104
+ transition: all 0.3s;
105
+ border: 1px solid rgba(0, 0, 0, 0.1);
106
+ -webkit-column-break-inside: avoid;
107
+ position: relative;
108
+ background: var(--component-background);
109
+ .react-dashboard-widget-shortcut {
110
+ width: 100%;
111
+ height: auto;
112
+ }
113
+
114
+ .react-dashboard-widget-mask {
115
+ opacity: 0;
116
+ position: absolute;
117
+ top: 0;
118
+ left: 0;
119
+ width: 100%;
120
+ height: 100%;
121
+ background: rgba(0, 0, 0, 0.5);
122
+ display: flex;
123
+ justify-content: center;
124
+ align-items: center;
125
+ transition: all 0.3s;
126
+ }
127
+
128
+ &:hover {
129
+ transition: all 0.3s;
130
+
131
+ border: 1px solid var(--component-background-3);
132
+
133
+ .react-dashboard-widget-mask {
134
+ opacity: 1;
135
+ transition: all 0.3s;
136
+ }
137
+ }
138
+
139
+ .react-dashboard-widget-bottombar {
140
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
141
+ width: 100%;
142
+
143
+ padding: 5px;
144
+
145
+ .react-dashboard-widget-iconWrap {
146
+ display: inline-block;
147
+ width: 28px;
148
+ height: 28px;
149
+ line-height: 28px;
150
+ text-align: center;
151
+ border-radius: 7px;
152
+ color: #fff;
153
+ margin-right: 5px;
154
+ font-size: 16px;
155
+ }
156
+
157
+ .react-dashboard-widget-name {
158
+ font-size: 16px;
159
+ flex: 1;
160
+ color: var(--text-color);
161
+ line-height: 28px;
162
+ font-weight: bold;
163
+ display: inline;
164
+ }
165
+
166
+ .react-dashboard-widget-description {
167
+ margin-top: 5px;
168
+ }
169
+ }
170
+ }
171
+ }
172
+ }
@@ -1,4 +1,4 @@
1
- var _excluded = ["style", "loading", "params", "request", "dataSource", "treeParentName", "rowData", "gridRef", "headerTitle", "toolBarRender", "search", "hideTool", "onGridReady", "gridKey", "gridColumnState", "children"];
1
+ var _excluded = ["style", "loading", "params", "request", "dataSource", "treeKeyName", "treeParentName", "rowData", "gridRef", "headerTitle", "toolBarRender", "search", "hideTool", "onGridReady", "gridKey", "gridColumnState", "children"];
2
2
 
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
 
@@ -48,6 +48,7 @@ function AgGridPlus(props) {
48
48
  gridParams = props.params,
49
49
  request = props.request,
50
50
  dataSource = props.dataSource,
51
+ treeKeyName = props.treeKeyName,
51
52
  treeParentName = props.treeParentName,
52
53
  propRowData = props.rowData,
53
54
  propsGridRef = props.gridRef,
@@ -264,7 +265,7 @@ function AgGridPlus(props) {
264
265
  return !columnProps ? props.columnDefs ? props.columnDefs : [] : columnProps;
265
266
  }, [props.columnDefs]);
266
267
  var rowDataMemo = useMemo(function () {
267
- return props.treeData ? flatten(toTree(rowData), treeParentName) : rowData;
268
+ return props.treeData ? flatten(toTree(rowData, treeParentName !== null && treeParentName !== void 0 ? treeParentName : "id", treeParentName !== null && treeParentName !== void 0 ? treeParentName : "parentId"), treeParentName) : rowData;
268
269
  }, [rowData, props.treeData]);
269
270
  return /*#__PURE__*/React.createElement(Spin, {
270
271
  spinning: loading,
@@ -12,6 +12,7 @@ interface GridProps extends AgGridReactProps {
12
12
  loading?: boolean;
13
13
  request?: (params: any, sort: any, filter: any) => Promise<any>;
14
14
  dataSource?: any[];
15
+ treeKeyName?: string;
15
16
  treeParentName?: string;
16
17
  search?: boolean;
17
18
  headerTitle?: React.ReactNode;
@@ -4,6 +4,6 @@ declare const convertSortModel: (sortModel: any[]) => string;
4
4
  declare const dateValueFormatter: (params: ValueFormatterParams) => string;
5
5
  declare const dateTimeValueFormatter: (params: ValueFormatterParams) => string;
6
6
  declare const flatten: (arr: any[], parentPropName: any, parentref?: any[]) => any;
7
- declare const toTree: (data: any[]) => any[];
7
+ declare const toTree: (data: any[], keyName: any, parentKeyName: any) => any[];
8
8
  declare const flattenTreeDeep: (treeData: any[], childrenName?: string) => any[];
9
9
  export { dateValueFormatter, dateTimeValueFormatter, convertFilterModel, convertSortModel, flattenTreeDeep, toTree, flatten };
@@ -114,7 +114,7 @@ var flatten = function flatten(arr, parentPropName, parentref) {
114
114
  return data;
115
115
  };
116
116
 
117
- var toTree = function toTree(data) {
117
+ var toTree = function toTree(data, keyName, parentKeyName) {
118
118
  // 删除 所有 children,以防止多次调用
119
119
  data.forEach(function (item) {
120
120
  delete item.children;
@@ -122,12 +122,12 @@ var toTree = function toTree(data) {
122
122
 
123
123
  var map = {};
124
124
  data.forEach(function (item) {
125
- map[item.id] = item;
125
+ map[item[keyName]] = item;
126
126
  });
127
127
  var val = [];
128
128
  data.forEach(function (item) {
129
129
  // 以当前遍历项,的pid,去map对象中找到索引的id
130
- var parent = map[item.parentId]; // 好绕啊,如果找到索引,那么说明此项不在顶级当中,那么需要把此项添加到,他对应的父级中
130
+ var parent = map[item[parentKeyName]]; // 好绕啊,如果找到索引,那么说明此项不在顶级当中,那么需要把此项添加到,他对应的父级中
131
131
 
132
132
  if (parent) {
133
133
  (parent.children || (parent.children = [])).push(item);
@@ -1,49 +1,49 @@
1
- .react-dashboard-toolbar {
2
- display: flex;
3
- align-items: center;
4
- justify-content: space-between;
5
- // width: 100%;
6
- padding: 0 10px;
7
- padding-bottom: 10px;
8
- // background: var(--component-background);
9
-
10
- &:after {
11
- display: block;
12
- clear: both;
13
- content: '';
14
- }
15
-
16
- &-left {
17
- float: left;
18
-
19
- button {
20
- margin-right: 10px;
21
- }
22
- }
23
-
24
- &-right {
25
- float: right;
26
-
27
- button {
28
- margin-left: 10px;
29
- }
30
- }
31
-
32
- &-space {
33
- flex: auto;
34
- height: 1px;
35
- margin: 0 !important;
36
- padding: 0 !important;
37
- border: 0 !important;
38
- -webkit-box-flex: 1;
39
- }
40
-
41
- &-fixed {
42
- position: fixed;
43
- right: 0;
44
- bottom: 0;
45
- z-index: 9;
46
- border-top: 1px solid rgba(128, 128, 128, 0.1);
47
- box-shadow: 0 -1px 2px rgba(128, 128, 128, 0.03);
48
- }
49
- }
1
+ .react-dashboard-toolbar {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ // width: 100%;
6
+ padding: 0 10px;
7
+ padding-bottom: 10px;
8
+ // background: var(--component-background);
9
+
10
+ &:after {
11
+ display: block;
12
+ clear: both;
13
+ content: '';
14
+ }
15
+
16
+ &-left {
17
+ float: left;
18
+
19
+ button {
20
+ margin-right: 10px;
21
+ }
22
+ }
23
+
24
+ &-right {
25
+ float: right;
26
+
27
+ button {
28
+ margin-left: 10px;
29
+ }
30
+ }
31
+
32
+ &-space {
33
+ flex: auto;
34
+ height: 1px;
35
+ margin: 0 !important;
36
+ padding: 0 !important;
37
+ border: 0 !important;
38
+ -webkit-box-flex: 1;
39
+ }
40
+
41
+ &-fixed {
42
+ position: fixed;
43
+ right: 0;
44
+ bottom: 0;
45
+ z-index: 9;
46
+ border-top: 1px solid rgba(128, 128, 128, 0.1);
47
+ box-shadow: 0 -1px 2px rgba(128, 128, 128, 0.03);
48
+ }
49
+ }