@nokecy/qc-ui 1.0.23 → 1.0.24

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.
@@ -20,7 +20,7 @@ var _icons = require("@ant-design/icons");
20
20
  var _utils = require("./utils");
21
21
  var _setting = _interopRequireDefault(require("./setting"));
22
22
  var _ = require(".");
23
- var _excluded = ["style", "loading", "params", "request", "dataSource", "treeKeyName", "treeParentName", "rowData", "gridRef", "headerTitle", "toolBarRender", "search", "hideTool", "onGridReady", "gridKey", "children", "defaultSearchExpand"];
23
+ var _excluded = ["style", "loading", "params", "request", "dataSource", "treeKeyName", "treeParentName", "rowData", "gridRef", "headerTitle", "toolBarRender", "search", "hideTool", "onGridReady", "gridKey", "children", "defaultSearchExpand", "overlayNoRowsTemplateText"];
24
24
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
25
25
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -61,6 +61,7 @@ function AgGridPlus(props) {
61
61
  gridKey = props.gridKey,
62
62
  children = props.children,
63
63
  defaultSearchExpand = props.defaultSearchExpand,
64
+ overlayNoRowsTemplateText = props.overlayNoRowsTemplateText,
64
65
  rest = _objectWithoutProperties(props, _excluded);
65
66
  var _useGridPlusColumnSta = (0, _.useGridPlusColumnState)(),
66
67
  onSaveColumnState = _useGridPlusColumnSta.onSaveColumnState,
@@ -177,6 +178,7 @@ function AgGridPlus(props) {
177
178
  state: gridPlusColumnState[gridKey],
178
179
  applyOrder: true
179
180
  });
181
+ apiRef.current.setGridOption("columnDefs", gridPlusColumnState[gridKey]);
180
182
  }
181
183
  }, [gridPlusColumnState, apiRef.current]);
182
184
  (0, _react.useEffect)(function () {
@@ -523,6 +525,7 @@ function AgGridPlus(props) {
523
525
  enableCellTextSelection: true,
524
526
  ensureDomOrder: true
525
527
  },
528
+ overlayNoRowsTemplate: "<span style=\"\n display: flex; \n justify-content: center; \n align-items: center; \n height: 100%; \n font-size: 14px; \n color: #aaa; \n line-height: 1.5;\n text-align: center;\">\n ".concat(overlayNoRowsTemplateText || '没有找到数据,试试调整筛选条件吧!', "\n </span>"),
526
529
  enableRangeSelection: true,
527
530
  suppressCopyRowsToClipboard: true
528
531
  //指定客户端模式
@@ -27,6 +27,10 @@ interface GridProps extends AgGridReactProps {
27
27
  * 列方案
28
28
  */
29
29
  gridColumnState?: any[];
30
+ /**
31
+ * 列表空数据文字提示
32
+ */
33
+ overlayNoRowsTemplateText?: string;
30
34
  gridRef?: React.Ref<GridRef | undefined>;
31
35
  }
32
36
  interface AgGridColumnPropsClone extends ColDef {
@@ -63,7 +63,9 @@ var Setting = function Setting(props) {
63
63
  headerName: colDef.headerName,
64
64
  width: columnState.width,
65
65
  hide: columnState.hide,
66
- cellClass: colDef.cellClass
66
+ cellClass: colDef.cellClass,
67
+ // 添加 cellClass
68
+ suppressHeaderFilterButton: colDef.suppressHeaderFilterButton
67
69
  }, columnState));
68
70
  });
69
71
  return columnRowData;
@@ -124,7 +126,7 @@ var Setting = function Setting(props) {
124
126
  })), /*#__PURE__*/_react2.default.createElement(SchemaField.Void, {
125
127
  "x-component": "ArrayTable.Column",
126
128
  "x-component-props": {
127
- width: 300,
129
+ width: 280,
128
130
  title: "列名"
129
131
  }
130
132
  }, /*#__PURE__*/_react2.default.createElement(SchemaField.String, {
@@ -132,6 +134,16 @@ var Setting = function Setting(props) {
132
134
  "x-decorator": "FormItem",
133
135
  "x-component": "Input",
134
136
  "x-read-pretty": true
137
+ })), /*#__PURE__*/_react2.default.createElement(SchemaField.Void, {
138
+ "x-component": "ArrayTable.Column",
139
+ "x-component-props": {
140
+ width: 80,
141
+ title: "列过滤"
142
+ }
143
+ }, /*#__PURE__*/_react2.default.createElement(SchemaField.String, {
144
+ name: "suppressHeaderFilterButton",
145
+ "x-decorator": "FormItem",
146
+ "x-component": "Switch"
135
147
  })), /*#__PURE__*/_react2.default.createElement(SchemaField.Void, {
136
148
  "x-component": "ArrayTable.Column",
137
149
  "x-component-props": {
@@ -219,6 +231,7 @@ var Setting = function Setting(props) {
219
231
  state: values.items,
220
232
  applyOrder: true
221
233
  });
234
+ gridApi.setGridOption("columnDefs", values.items);
222
235
  }, 100);
223
236
  next(payload);
224
237
  }).open(formProps);
@@ -2,7 +2,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
2
  import _sumBy from "lodash/sumBy";
3
3
  import _uniqueId from "lodash/uniqueId";
4
4
  import _isArray from "lodash/isArray";
5
- var _excluded = ["style", "loading", "params", "request", "dataSource", "treeKeyName", "treeParentName", "rowData", "gridRef", "headerTitle", "toolBarRender", "search", "hideTool", "onGridReady", "gridKey", "children", "defaultSearchExpand"];
5
+ var _excluded = ["style", "loading", "params", "request", "dataSource", "treeKeyName", "treeParentName", "rowData", "gridRef", "headerTitle", "toolBarRender", "search", "hideTool", "onGridReady", "gridKey", "children", "defaultSearchExpand", "overlayNoRowsTemplateText"];
6
6
  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); }
7
7
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
8
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -52,6 +52,7 @@ function AgGridPlus(props) {
52
52
  gridKey = props.gridKey,
53
53
  children = props.children,
54
54
  defaultSearchExpand = props.defaultSearchExpand,
55
+ overlayNoRowsTemplateText = props.overlayNoRowsTemplateText,
55
56
  rest = _objectWithoutProperties(props, _excluded);
56
57
  var _useGridPlusColumnSta = useGridPlusColumnState(),
57
58
  onSaveColumnState = _useGridPlusColumnSta.onSaveColumnState,
@@ -168,6 +169,7 @@ function AgGridPlus(props) {
168
169
  state: gridPlusColumnState[gridKey],
169
170
  applyOrder: true
170
171
  });
172
+ apiRef.current.setGridOption("columnDefs", gridPlusColumnState[gridKey]);
171
173
  }
172
174
  }, [gridPlusColumnState, apiRef.current]);
173
175
  useEffect(function () {
@@ -514,6 +516,7 @@ function AgGridPlus(props) {
514
516
  enableCellTextSelection: true,
515
517
  ensureDomOrder: true
516
518
  },
519
+ overlayNoRowsTemplate: "<span style=\"\n display: flex; \n justify-content: center; \n align-items: center; \n height: 100%; \n font-size: 14px; \n color: #aaa; \n line-height: 1.5;\n text-align: center;\">\n ".concat(overlayNoRowsTemplateText || '没有找到数据,试试调整筛选条件吧!', "\n </span>"),
517
520
  enableRangeSelection: true,
518
521
  suppressCopyRowsToClipboard: true
519
522
  //指定客户端模式
@@ -27,6 +27,10 @@ interface GridProps extends AgGridReactProps {
27
27
  * 列方案
28
28
  */
29
29
  gridColumnState?: any[];
30
+ /**
31
+ * 列表空数据文字提示
32
+ */
33
+ overlayNoRowsTemplateText?: string;
30
34
  gridRef?: React.Ref<GridRef | undefined>;
31
35
  }
32
36
  interface AgGridColumnPropsClone extends ColDef {
@@ -54,7 +54,9 @@ var Setting = function Setting(props) {
54
54
  headerName: colDef.headerName,
55
55
  width: columnState.width,
56
56
  hide: columnState.hide,
57
- cellClass: colDef.cellClass
57
+ cellClass: colDef.cellClass,
58
+ // 添加 cellClass
59
+ suppressHeaderFilterButton: colDef.suppressHeaderFilterButton
58
60
  }, columnState));
59
61
  });
60
62
  return columnRowData;
@@ -115,7 +117,7 @@ var Setting = function Setting(props) {
115
117
  })), /*#__PURE__*/React.createElement(SchemaField.Void, {
116
118
  "x-component": "ArrayTable.Column",
117
119
  "x-component-props": {
118
- width: 300,
120
+ width: 280,
119
121
  title: "列名"
120
122
  }
121
123
  }, /*#__PURE__*/React.createElement(SchemaField.String, {
@@ -123,6 +125,16 @@ var Setting = function Setting(props) {
123
125
  "x-decorator": "FormItem",
124
126
  "x-component": "Input",
125
127
  "x-read-pretty": true
128
+ })), /*#__PURE__*/React.createElement(SchemaField.Void, {
129
+ "x-component": "ArrayTable.Column",
130
+ "x-component-props": {
131
+ width: 80,
132
+ title: "列过滤"
133
+ }
134
+ }, /*#__PURE__*/React.createElement(SchemaField.String, {
135
+ name: "suppressHeaderFilterButton",
136
+ "x-decorator": "FormItem",
137
+ "x-component": "Switch"
126
138
  })), /*#__PURE__*/React.createElement(SchemaField.Void, {
127
139
  "x-component": "ArrayTable.Column",
128
140
  "x-component-props": {
@@ -210,6 +222,7 @@ var Setting = function Setting(props) {
210
222
  state: values.items,
211
223
  applyOrder: true
212
224
  });
225
+ gridApi.setGridOption("columnDefs", values.items);
213
226
  }, 100);
214
227
  next(payload);
215
228
  }).open(formProps);