@nokecy/qc-ui 1.0.20 → 1.0.21
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.
|
@@ -172,11 +172,11 @@ function AgGridPlus(props) {
|
|
|
172
172
|
// 加载列方案
|
|
173
173
|
(0, _react.useEffect)(function () {
|
|
174
174
|
if (gridPlusColumnState && gridKey && gridPlusColumnState[gridKey] && apiRef.current) {
|
|
175
|
+
setColumnCellClass(handelgridPlusColumnState(gridPlusColumnState[gridKey]));
|
|
175
176
|
apiRef.current.applyColumnState({
|
|
176
177
|
state: gridPlusColumnState[gridKey],
|
|
177
178
|
applyOrder: true
|
|
178
179
|
});
|
|
179
|
-
setColumnCellClass(handelgridPlusColumnState(gridPlusColumnState[gridKey]));
|
|
180
180
|
}
|
|
181
181
|
}, [gridPlusColumnState, apiRef.current]);
|
|
182
182
|
(0, _react.useEffect)(function () {
|
|
@@ -249,8 +249,8 @@ function AgGridPlus(props) {
|
|
|
249
249
|
}, []);
|
|
250
250
|
var onColumnStateChanged = function onColumnStateChanged(columnState) {
|
|
251
251
|
if (gridKey) {
|
|
252
|
-
setColumnCellClass(handelgridPlusColumnState(columnState));
|
|
253
252
|
onSaveColumnState && onSaveColumnState(gridKey, columnState);
|
|
253
|
+
setColumnCellClass(handelgridPlusColumnState(columnState));
|
|
254
254
|
}
|
|
255
255
|
};
|
|
256
256
|
(0, _react.useEffect)(function () {
|
|
@@ -53,14 +53,17 @@ var Setting = function Setting(props) {
|
|
|
53
53
|
var getColumnData = function getColumnData() {
|
|
54
54
|
var columnStates = gridApi.getColumnState();
|
|
55
55
|
var columnRowData = [];
|
|
56
|
-
|
|
56
|
+
columnStates.forEach(function (columnState) {
|
|
57
57
|
var colDef = gridApi === null || gridApi === void 0 ? void 0 : gridApi.getColumnDef(columnState.colId);
|
|
58
|
+
|
|
59
|
+
// 将列信息和 cellClass 一并加入到 columnRowData 中
|
|
58
60
|
columnRowData.push(_objectSpread({
|
|
59
61
|
id: (0, _uniqueId2.default)(),
|
|
60
62
|
field: colDef.field,
|
|
61
63
|
headerName: colDef.headerName,
|
|
62
64
|
width: columnState.width,
|
|
63
|
-
hide: columnState.hide
|
|
65
|
+
hide: columnState.hide,
|
|
66
|
+
cellClass: colDef.cellClass
|
|
64
67
|
}, columnState));
|
|
65
68
|
});
|
|
66
69
|
return columnRowData;
|
|
@@ -139,6 +142,7 @@ var Setting = function Setting(props) {
|
|
|
139
142
|
name: "cellClass",
|
|
140
143
|
"x-decorator": "FormItem",
|
|
141
144
|
"x-component": "Select",
|
|
145
|
+
default: "custom-cell-left",
|
|
142
146
|
enum: [{
|
|
143
147
|
value: "custom-cell-left",
|
|
144
148
|
label: "左对齐"
|
|
@@ -209,11 +213,13 @@ var Setting = function Setting(props) {
|
|
|
209
213
|
});
|
|
210
214
|
formDialog.forConfirm(function (payload, next) {
|
|
211
215
|
var values = payload.values;
|
|
212
|
-
var falg = gridApi.applyColumnState({
|
|
213
|
-
state: values.items,
|
|
214
|
-
applyOrder: true
|
|
215
|
-
});
|
|
216
216
|
onSaveColumnState && onSaveColumnState(values.items);
|
|
217
|
+
setTimeout(function () {
|
|
218
|
+
var falg = gridApi.applyColumnState({
|
|
219
|
+
state: values.items,
|
|
220
|
+
applyOrder: true
|
|
221
|
+
});
|
|
222
|
+
}, 100);
|
|
217
223
|
next(payload);
|
|
218
224
|
}).open(formProps);
|
|
219
225
|
case 2:
|
|
@@ -163,11 +163,11 @@ function AgGridPlus(props) {
|
|
|
163
163
|
// 加载列方案
|
|
164
164
|
useEffect(function () {
|
|
165
165
|
if (gridPlusColumnState && gridKey && gridPlusColumnState[gridKey] && apiRef.current) {
|
|
166
|
+
setColumnCellClass(handelgridPlusColumnState(gridPlusColumnState[gridKey]));
|
|
166
167
|
apiRef.current.applyColumnState({
|
|
167
168
|
state: gridPlusColumnState[gridKey],
|
|
168
169
|
applyOrder: true
|
|
169
170
|
});
|
|
170
|
-
setColumnCellClass(handelgridPlusColumnState(gridPlusColumnState[gridKey]));
|
|
171
171
|
}
|
|
172
172
|
}, [gridPlusColumnState, apiRef.current]);
|
|
173
173
|
useEffect(function () {
|
|
@@ -240,8 +240,8 @@ function AgGridPlus(props) {
|
|
|
240
240
|
}, []);
|
|
241
241
|
var onColumnStateChanged = function onColumnStateChanged(columnState) {
|
|
242
242
|
if (gridKey) {
|
|
243
|
-
setColumnCellClass(handelgridPlusColumnState(columnState));
|
|
244
243
|
onSaveColumnState && onSaveColumnState(gridKey, columnState);
|
|
244
|
+
setColumnCellClass(handelgridPlusColumnState(columnState));
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
247
|
useEffect(function () {
|
|
@@ -44,14 +44,17 @@ var Setting = function Setting(props) {
|
|
|
44
44
|
var getColumnData = function getColumnData() {
|
|
45
45
|
var columnStates = gridApi.getColumnState();
|
|
46
46
|
var columnRowData = [];
|
|
47
|
-
|
|
47
|
+
columnStates.forEach(function (columnState) {
|
|
48
48
|
var colDef = gridApi === null || gridApi === void 0 ? void 0 : gridApi.getColumnDef(columnState.colId);
|
|
49
|
+
|
|
50
|
+
// 将列信息和 cellClass 一并加入到 columnRowData 中
|
|
49
51
|
columnRowData.push(_objectSpread({
|
|
50
52
|
id: _uniqueId(),
|
|
51
53
|
field: colDef.field,
|
|
52
54
|
headerName: colDef.headerName,
|
|
53
55
|
width: columnState.width,
|
|
54
|
-
hide: columnState.hide
|
|
56
|
+
hide: columnState.hide,
|
|
57
|
+
cellClass: colDef.cellClass
|
|
55
58
|
}, columnState));
|
|
56
59
|
});
|
|
57
60
|
return columnRowData;
|
|
@@ -130,6 +133,7 @@ var Setting = function Setting(props) {
|
|
|
130
133
|
name: "cellClass",
|
|
131
134
|
"x-decorator": "FormItem",
|
|
132
135
|
"x-component": "Select",
|
|
136
|
+
default: "custom-cell-left",
|
|
133
137
|
enum: [{
|
|
134
138
|
value: "custom-cell-left",
|
|
135
139
|
label: "左对齐"
|
|
@@ -200,11 +204,13 @@ var Setting = function Setting(props) {
|
|
|
200
204
|
});
|
|
201
205
|
formDialog.forConfirm(function (payload, next) {
|
|
202
206
|
var values = payload.values;
|
|
203
|
-
var falg = gridApi.applyColumnState({
|
|
204
|
-
state: values.items,
|
|
205
|
-
applyOrder: true
|
|
206
|
-
});
|
|
207
207
|
onSaveColumnState && onSaveColumnState(values.items);
|
|
208
|
+
setTimeout(function () {
|
|
209
|
+
var falg = gridApi.applyColumnState({
|
|
210
|
+
state: values.items,
|
|
211
|
+
applyOrder: true
|
|
212
|
+
});
|
|
213
|
+
}, 100);
|
|
208
214
|
next(payload);
|
|
209
215
|
}).open(formProps);
|
|
210
216
|
case 2:
|