@nokecy/qc-ui 1.0.40 → 1.0.41

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.
@@ -519,6 +519,9 @@ function AgGridPlus(props) {
519
519
  onRequest && onRequest(formValues);
520
520
  return prev;
521
521
  });
522
+ },
523
+ onInit: function onInit(defaultValues) {
524
+ setQueryFilter(defaultValues);
522
525
  }
523
526
  }), /*#__PURE__*/_react.default.createElement(_antd.Card, {
524
527
  bordered: false,
@@ -9,5 +9,6 @@ declare const FormRender: (props: {
9
9
  defaultExpand?: Boolean | undefined;
10
10
  defaultRows?: number | undefined;
11
11
  onQuery: (formValue: any) => void;
12
+ onInit?: ((defaultValues: any) => void) | undefined;
12
13
  }) => React.JSX.Element;
13
14
  export default FormRender;
@@ -57,6 +57,9 @@ var FormRender = function FormRender(props) {
57
57
  }
58
58
  });
59
59
  }, []);
60
+ (0, _react2.useEffect)(function () {
61
+ props.onInit && props.onInit(form.values);
62
+ }, []);
60
63
  var SchemaField = (0, _react2.useMemo)(function () {
61
64
  return (0, _react.createSchemaField)({
62
65
  components: {
@@ -144,12 +147,12 @@ var FormRender = function FormRender(props) {
144
147
  //表单自定义组件
145
148
  var component = getComponent(colDef);
146
149
  if (colDef.filter != false) {
147
- var _colDef$searchCompone, _colDef$searchCompone2;
150
+ var _colDef$searchCompone, _colDef$searchCompone2, _colDef$searchCompone3;
148
151
  var filedSchema = {
149
152
  type: 'string',
150
153
  title: headerName,
151
154
  required: (colDef === null || colDef === void 0 || (_colDef$searchCompone = colDef.searchComponentProps) === null || _colDef$searchCompone === void 0 ? void 0 : _colDef$searchCompone.required) || false,
152
- default: colDef === null || colDef === void 0 || (_colDef$searchCompone2 = colDef.searchComponentProps) === null || _colDef$searchCompone2 === void 0 ? void 0 : _colDef$searchCompone2.default,
155
+ default: (colDef === null || colDef === void 0 || (_colDef$searchCompone2 = colDef.searchComponentProps) === null || _colDef$searchCompone2 === void 0 ? void 0 : _colDef$searchCompone2.default) || (colDef === null || colDef === void 0 || (_colDef$searchCompone3 = colDef.searchComponentProps) === null || _colDef$searchCompone3 === void 0 ? void 0 : _colDef$searchCompone3.defaultValue),
153
156
  enum: colDef === null || colDef === void 0 ? void 0 : colDef.enum,
154
157
  "x-component": component,
155
158
  "x-component-props": _objectSpread({
@@ -3,6 +3,7 @@ import React from "react";
3
3
  declare const DiySetting: (props: {
4
4
  gridKey?: string | undefined;
5
5
  gridApi?: GridApi<any> | undefined;
6
+ type?: string | undefined;
6
7
  gridApiState?: GridApi<any> | undefined;
7
8
  onSaveColumnState: (state: any) => void;
8
9
  }) => React.JSX.Element | null;
@@ -246,7 +246,9 @@ var DiySetting = function DiySetting(props) {
246
246
  var values = payload.values;
247
247
  onSaveColumnState && onSaveColumnState(values.items);
248
248
  var processedColumns = (0, _processColumnGroups.default)(values.items);
249
- gridApi.setGridOption("columnDefs", processedColumns);
249
+ if (props.type !== 'formArrayTable') {
250
+ gridApi.setGridOption("columnDefs", processedColumns);
251
+ }
250
252
  setTimeout(function () {
251
253
  gridApi.applyColumnState({
252
254
  state: processedColumns,
@@ -4,6 +4,7 @@ declare const Setting: (props: {
4
4
  gridKey?: string | undefined;
5
5
  gridApi?: GridApi<any> | undefined;
6
6
  gridApiState?: GridApi<any> | undefined;
7
+ type?: string | undefined;
7
8
  onSaveColumnState: (state: any) => void;
8
9
  }) => React.JSX.Element | null;
9
10
  export default Setting;
@@ -90,7 +90,8 @@ var Setting = function Setting(props) {
90
90
  label: /*#__PURE__*/_react2.default.createElement(_diySetting.default, {
91
91
  gridKey: gridKey,
92
92
  gridApi: gridApi,
93
- onSaveColumnState: onSaveColumnState
93
+ onSaveColumnState: onSaveColumnState,
94
+ type: props.type
94
95
  })
95
96
  }, {
96
97
  key: '2',
@@ -61,13 +61,74 @@ var ArrayTable = (0, _react2.observer)(function (props) {
61
61
  gridPlusColumnState = _useGridPlusColumnSta.columnState,
62
62
  extensibleColumns = _useGridPlusColumnSta.extensibleColumns;
63
63
  // const teststyle = '[{\"id\":\"18\",\"field\":\"xdxcp47tycp\",\"headerName\":\"A1\",\"width\":800,\"hide\":false,\"colId\":\"a1\",\"pinned\":null,\"sort\":null,\"sortIndex\":null,\"aggFunc\":null,\"rowGroup\":false,\"rowGroupIndex\":null,\"pivot\":false,\"pivotIndex\":null,\"flex\":null},{\"id\":\"19\",\"field\":\"nvhezzkyak9\",\"headerName\":\"Operations\",\"width\":60,\"hide\":false,\"colId\":\"nvhezzkyak9\",\"pinned\":null,\"sort\":null,\"sortIndex\":null,\"aggFunc\":null,\"rowGroup\":false,\"rowGroupIndex\":null,\"pivot\":false,\"pivotIndex\":null,\"flex\":null}]'
64
+ // const teststyle = [
65
+ // {
66
+ // "id": "5",
67
+ // "field": "NO_NAME_FIELD_$1",
68
+ // "headerName": "Index",
69
+ // "width": 80,
70
+ // "hide": false,
71
+ // "cellClass": "custom-cell-left",
72
+ // "suppressHeaderFilterButton": true,
73
+ // "colId": "NO_NAME_FIELD_$1",
74
+ // "pinned": null,
75
+ // "sort": null,
76
+ // "sortIndex": null,
77
+ // "aggFunc": null,
78
+ // "rowGroup": false,
79
+ // "rowGroupIndex": null,
80
+ // "pivot": false,
81
+ // "pivotIndex": null,
82
+ // "flex": null
83
+ // },
84
+ // {
85
+ // "id": "6",
86
+ // "field": "a1",
87
+ // "headerName": "A1",
88
+ // "width": 1200,
89
+ // "hide": false,
90
+ // "cellClass": "custom-cell-left",
91
+ // "suppressHeaderFilterButton": true,
92
+ // "colId": "a1",
93
+ // "pinned": null,
94
+ // "sort": null,
95
+ // "sortIndex": null,
96
+ // "aggFunc": null,
97
+ // "rowGroup": false,
98
+ // "rowGroupIndex": null,
99
+ // "pivot": false,
100
+ // "pivotIndex": null,
101
+ // "flex": null
102
+ // },
103
+ // {
104
+ // "id": "7",
105
+ // "field": "operations",
106
+ // "headerName": "Operations",
107
+ // "width": 80,
108
+ // "hide": false,
109
+ // "cellClass": "custom-cell-left",
110
+ // "suppressHeaderFilterButton": true,
111
+ // "colId": "operations",
112
+ // "pinned": "right",
113
+ // "sort": null,
114
+ // "sortIndex": null,
115
+ // "aggFunc": null,
116
+ // "rowGroup": false,
117
+ // "rowGroupIndex": null,
118
+ // "pivot": false,
119
+ // "pivotIndex": null,
120
+ // "flex": null
121
+ // }
122
+ // ]
64
123
 
65
124
  (0, _react.useEffect)(function () {
66
125
  if (props.gridKey && gridPlusColumnState && gridPlusColumnState[props.gridKey] && apiRef.current) {
67
- apiRef.current.applyColumnState({
68
- state: gridPlusColumnState[props.gridKey],
69
- applyOrder: true
70
- });
126
+ setTimeout(function () {
127
+ apiRef.current.applyColumnState({
128
+ state: gridPlusColumnState[props.gridKey],
129
+ applyOrder: true
130
+ });
131
+ }, 10);
71
132
  }
72
133
  }, [gridPlusColumnState, apiRef.current, dataSource]);
73
134
 
@@ -138,6 +199,7 @@ var ArrayTable = (0, _react2.observer)(function (props) {
138
199
  gridKey: props.gridKey,
139
200
  gridApi: apiRef.current,
140
201
  gridApiState: gridApiState,
202
+ type: 'formArrayTable',
141
203
  onSaveColumnState: onColumnStateChanged
142
204
  })), /*#__PURE__*/_react.default.createElement(_agGridReact.AgGridReact, {
143
205
  onGridReady: function onGridReady(params) {
@@ -510,6 +510,9 @@ function AgGridPlus(props) {
510
510
  onRequest && onRequest(formValues);
511
511
  return prev;
512
512
  });
513
+ },
514
+ onInit: function onInit(defaultValues) {
515
+ setQueryFilter(defaultValues);
513
516
  }
514
517
  }), /*#__PURE__*/React.createElement(Card, {
515
518
  bordered: false,
@@ -9,5 +9,6 @@ declare const FormRender: (props: {
9
9
  defaultExpand?: Boolean | undefined;
10
10
  defaultRows?: number | undefined;
11
11
  onQuery: (formValue: any) => void;
12
+ onInit?: ((defaultValues: any) => void) | undefined;
12
13
  }) => React.JSX.Element;
13
14
  export default FormRender;
@@ -49,6 +49,9 @@ var FormRender = function FormRender(props) {
49
49
  }
50
50
  });
51
51
  }, []);
52
+ useEffect(function () {
53
+ props.onInit && props.onInit(form.values);
54
+ }, []);
52
55
  var SchemaField = useMemo(function () {
53
56
  return createSchemaField({
54
57
  components: {
@@ -136,12 +139,12 @@ var FormRender = function FormRender(props) {
136
139
  //表单自定义组件
137
140
  var component = getComponent(colDef);
138
141
  if (colDef.filter != false) {
139
- var _colDef$searchCompone, _colDef$searchCompone2;
142
+ var _colDef$searchCompone, _colDef$searchCompone2, _colDef$searchCompone3;
140
143
  var filedSchema = {
141
144
  type: 'string',
142
145
  title: headerName,
143
146
  required: (colDef === null || colDef === void 0 || (_colDef$searchCompone = colDef.searchComponentProps) === null || _colDef$searchCompone === void 0 ? void 0 : _colDef$searchCompone.required) || false,
144
- default: colDef === null || colDef === void 0 || (_colDef$searchCompone2 = colDef.searchComponentProps) === null || _colDef$searchCompone2 === void 0 ? void 0 : _colDef$searchCompone2.default,
147
+ default: (colDef === null || colDef === void 0 || (_colDef$searchCompone2 = colDef.searchComponentProps) === null || _colDef$searchCompone2 === void 0 ? void 0 : _colDef$searchCompone2.default) || (colDef === null || colDef === void 0 || (_colDef$searchCompone3 = colDef.searchComponentProps) === null || _colDef$searchCompone3 === void 0 ? void 0 : _colDef$searchCompone3.defaultValue),
145
148
  enum: colDef === null || colDef === void 0 ? void 0 : colDef.enum,
146
149
  "x-component": component,
147
150
  "x-component-props": _objectSpread({
@@ -3,6 +3,7 @@ import React from "react";
3
3
  declare const DiySetting: (props: {
4
4
  gridKey?: string | undefined;
5
5
  gridApi?: GridApi<any> | undefined;
6
+ type?: string | undefined;
6
7
  gridApiState?: GridApi<any> | undefined;
7
8
  onSaveColumnState: (state: any) => void;
8
9
  }) => React.JSX.Element | null;
@@ -237,7 +237,9 @@ var DiySetting = function DiySetting(props) {
237
237
  var values = payload.values;
238
238
  onSaveColumnState && onSaveColumnState(values.items);
239
239
  var processedColumns = processColumnGroups(values.items);
240
- gridApi.setGridOption("columnDefs", processedColumns);
240
+ if (props.type !== 'formArrayTable') {
241
+ gridApi.setGridOption("columnDefs", processedColumns);
242
+ }
241
243
  setTimeout(function () {
242
244
  gridApi.applyColumnState({
243
245
  state: processedColumns,
@@ -4,6 +4,7 @@ declare const Setting: (props: {
4
4
  gridKey?: string | undefined;
5
5
  gridApi?: GridApi<any> | undefined;
6
6
  gridApiState?: GridApi<any> | undefined;
7
+ type?: string | undefined;
7
8
  onSaveColumnState: (state: any) => void;
8
9
  }) => React.JSX.Element | null;
9
10
  export default Setting;
@@ -81,7 +81,8 @@ var Setting = function Setting(props) {
81
81
  label: /*#__PURE__*/React.createElement(DiySetting, {
82
82
  gridKey: gridKey,
83
83
  gridApi: gridApi,
84
- onSaveColumnState: onSaveColumnState
84
+ onSaveColumnState: onSaveColumnState,
85
+ type: props.type
85
86
  })
86
87
  }, {
87
88
  key: '2',
@@ -55,13 +55,74 @@ var ArrayTable = observer(function (props) {
55
55
  gridPlusColumnState = _useGridPlusColumnSta.columnState,
56
56
  extensibleColumns = _useGridPlusColumnSta.extensibleColumns;
57
57
  // const teststyle = '[{\"id\":\"18\",\"field\":\"xdxcp47tycp\",\"headerName\":\"A1\",\"width\":800,\"hide\":false,\"colId\":\"a1\",\"pinned\":null,\"sort\":null,\"sortIndex\":null,\"aggFunc\":null,\"rowGroup\":false,\"rowGroupIndex\":null,\"pivot\":false,\"pivotIndex\":null,\"flex\":null},{\"id\":\"19\",\"field\":\"nvhezzkyak9\",\"headerName\":\"Operations\",\"width\":60,\"hide\":false,\"colId\":\"nvhezzkyak9\",\"pinned\":null,\"sort\":null,\"sortIndex\":null,\"aggFunc\":null,\"rowGroup\":false,\"rowGroupIndex\":null,\"pivot\":false,\"pivotIndex\":null,\"flex\":null}]'
58
+ // const teststyle = [
59
+ // {
60
+ // "id": "5",
61
+ // "field": "NO_NAME_FIELD_$1",
62
+ // "headerName": "Index",
63
+ // "width": 80,
64
+ // "hide": false,
65
+ // "cellClass": "custom-cell-left",
66
+ // "suppressHeaderFilterButton": true,
67
+ // "colId": "NO_NAME_FIELD_$1",
68
+ // "pinned": null,
69
+ // "sort": null,
70
+ // "sortIndex": null,
71
+ // "aggFunc": null,
72
+ // "rowGroup": false,
73
+ // "rowGroupIndex": null,
74
+ // "pivot": false,
75
+ // "pivotIndex": null,
76
+ // "flex": null
77
+ // },
78
+ // {
79
+ // "id": "6",
80
+ // "field": "a1",
81
+ // "headerName": "A1",
82
+ // "width": 1200,
83
+ // "hide": false,
84
+ // "cellClass": "custom-cell-left",
85
+ // "suppressHeaderFilterButton": true,
86
+ // "colId": "a1",
87
+ // "pinned": null,
88
+ // "sort": null,
89
+ // "sortIndex": null,
90
+ // "aggFunc": null,
91
+ // "rowGroup": false,
92
+ // "rowGroupIndex": null,
93
+ // "pivot": false,
94
+ // "pivotIndex": null,
95
+ // "flex": null
96
+ // },
97
+ // {
98
+ // "id": "7",
99
+ // "field": "operations",
100
+ // "headerName": "Operations",
101
+ // "width": 80,
102
+ // "hide": false,
103
+ // "cellClass": "custom-cell-left",
104
+ // "suppressHeaderFilterButton": true,
105
+ // "colId": "operations",
106
+ // "pinned": "right",
107
+ // "sort": null,
108
+ // "sortIndex": null,
109
+ // "aggFunc": null,
110
+ // "rowGroup": false,
111
+ // "rowGroupIndex": null,
112
+ // "pivot": false,
113
+ // "pivotIndex": null,
114
+ // "flex": null
115
+ // }
116
+ // ]
58
117
 
59
118
  useEffect(function () {
60
119
  if (props.gridKey && gridPlusColumnState && gridPlusColumnState[props.gridKey] && apiRef.current) {
61
- apiRef.current.applyColumnState({
62
- state: gridPlusColumnState[props.gridKey],
63
- applyOrder: true
64
- });
120
+ setTimeout(function () {
121
+ apiRef.current.applyColumnState({
122
+ state: gridPlusColumnState[props.gridKey],
123
+ applyOrder: true
124
+ });
125
+ }, 10);
65
126
  }
66
127
  }, [gridPlusColumnState, apiRef.current, dataSource]);
67
128
 
@@ -132,6 +193,7 @@ var ArrayTable = observer(function (props) {
132
193
  gridKey: props.gridKey,
133
194
  gridApi: apiRef.current,
134
195
  gridApiState: gridApiState,
196
+ type: 'formArrayTable',
135
197
  onSaveColumnState: onColumnStateChanged
136
198
  })), /*#__PURE__*/React.createElement(AgGridReact, {
137
199
  onGridReady: function onGridReady(params) {