@nokecy/qc-ui 0.0.15 → 0.0.17

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.
@@ -132,7 +132,13 @@ function AgGridPlus(props) {
132
132
 
133
133
  var defaultColDef = {
134
134
  resizable: true,
135
- sortable: true
135
+ sortable: true,
136
+ headerComponentParams: {
137
+ template: '<div class="ag-cell-label-container" role="presentation">' + // ' <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>' +
138
+ ' <div ref="eLabel" class="ag-header-cell-label" role="presentation">' + ' <span ref="eText" class="ag-header-cell-text"></span>' + // ' <span ref="eFilter" class="ag-header-icon ag-filter-icon"></span>' +
139
+ // ' <span ref="eSortOrder" class="ag-header-icon ag-sort-order"></span>' +
140
+ ' <span ref="eSortAsc" class="ag-header-icon ag-sort-ascending-icon"></span>' + ' <span ref="eSortDesc" class="ag-header-icon ag-sort-descending-icon"></span>' + ' <span ref="eSortNone" class="ag-header-icon ag-sort-none-icon"></span>' + ' </div>' + '</div>'
141
+ }
136
142
  }; //请求数据
137
143
 
138
144
  (0, _react.useEffect)(function () {
@@ -172,7 +178,7 @@ function AgGridPlus(props) {
172
178
  filter: filter
173
179
  }, gridParams), {}, {
174
180
  current: pagination.current,
175
- skipCount: pagination.current == 1 ? 0 : pagination.current * pagination.pageSize,
181
+ skipCount: pagination.current == 1 ? 0 : (pagination.current - 1) * pagination.pageSize,
176
182
  maxResultCount: pagination.pageSize,
177
183
  sorter: getSort(sortColumn)
178
184
  });
@@ -190,9 +196,7 @@ function AgGridPlus(props) {
190
196
  });
191
197
  };
192
198
 
193
- var actionDom = (0, _react.useMemo)(function () {
194
- return toolBarRender && toolBarRender(apiRef.current, (0, _utils.convertFilterModel)(queryFilter), queryFilter);
195
- }, [apiRef, columnsRef, queryFilter]);
199
+ var actionDom = toolBarRender && toolBarRender(apiRef.current, (0, _utils.convertFilterModel)(queryFilter), queryFilter);
196
200
 
197
201
  var sortChanged = function sortChanged(columnApi) {
198
202
  var sortedColumn = columnApi.getColumnState().find(function (col) {
@@ -340,7 +344,7 @@ function AgGridPlus(props) {
340
344
  },
341
345
  size: "small",
342
346
  showTotal: function showTotal(total, range) {
343
- return "\u7B2C ".concat(range[0], "-").concat(range[1], " \u6761/\u603B\u5171 ").concat(total, " items");
347
+ return "\u7B2C ".concat(range[0], "-").concat(range[1], " \u6761/\u603B\u5171 ").concat(total, " \u6761");
344
348
  },
345
349
  pageSizeOptions: [10, 100, 200, 500, 1000],
346
350
  hideOnSinglePage: true,
@@ -24,7 +24,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
24
24
  var useCollapseGrid = function useCollapseGrid(maxRows) {
25
25
  var grid = (0, _react.useMemo)(function () {
26
26
  return _antd.FormGrid.createFormGrid({
27
- maxColumns: 4,
27
+ maxColumns: 5,
28
28
  maxWidth: 240,
29
29
  maxRows: maxRows,
30
30
  shouldVisible: function shouldVisible(node, grid) {
@@ -70,7 +70,7 @@ var convertFilterModel = function convertFilterModel(filterModel) {
70
70
  Object.keys(filterModel).map(function (key) {
71
71
  var value = filterModel[key];
72
72
 
73
- if (value) {
73
+ if (!value && value != "") {
74
74
  items.push(getFilter(key, value));
75
75
  }
76
76
  });
@@ -26,7 +26,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
26
26
 
27
27
  import { AgGridReact } from 'ag-grid-react';
28
28
  import { Spin, Pagination, Card, Tag } from 'antd';
29
- import React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
29
+ import React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
30
30
  import "ag-grid-enterprise";
31
31
  import "./global.scss";
32
32
  import "./index.less";
@@ -106,7 +106,13 @@ function AgGridPlus(props) {
106
106
 
107
107
  var defaultColDef = {
108
108
  resizable: true,
109
- sortable: true
109
+ sortable: true,
110
+ headerComponentParams: {
111
+ template: '<div class="ag-cell-label-container" role="presentation">' + // ' <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>' +
112
+ ' <div ref="eLabel" class="ag-header-cell-label" role="presentation">' + ' <span ref="eText" class="ag-header-cell-text"></span>' + // ' <span ref="eFilter" class="ag-header-icon ag-filter-icon"></span>' +
113
+ // ' <span ref="eSortOrder" class="ag-header-icon ag-sort-order"></span>' +
114
+ ' <span ref="eSortAsc" class="ag-header-icon ag-sort-ascending-icon"></span>' + ' <span ref="eSortDesc" class="ag-header-icon ag-sort-descending-icon"></span>' + ' <span ref="eSortNone" class="ag-header-icon ag-sort-none-icon"></span>' + ' </div>' + '</div>'
115
+ }
110
116
  }; //请求数据
111
117
 
112
118
  useEffect(function () {
@@ -146,7 +152,7 @@ function AgGridPlus(props) {
146
152
  filter: filter
147
153
  }, gridParams), {}, {
148
154
  current: pagination.current,
149
- skipCount: pagination.current == 1 ? 0 : pagination.current * pagination.pageSize,
155
+ skipCount: pagination.current == 1 ? 0 : (pagination.current - 1) * pagination.pageSize,
150
156
  maxResultCount: pagination.pageSize,
151
157
  sorter: getSort(sortColumn)
152
158
  });
@@ -164,9 +170,7 @@ function AgGridPlus(props) {
164
170
  });
165
171
  };
166
172
 
167
- var actionDom = useMemo(function () {
168
- return toolBarRender && toolBarRender(apiRef.current, convertFilterModel(queryFilter), queryFilter);
169
- }, [apiRef, columnsRef, queryFilter]);
173
+ var actionDom = toolBarRender && toolBarRender(apiRef.current, convertFilterModel(queryFilter), queryFilter);
170
174
 
171
175
  var sortChanged = function sortChanged(columnApi) {
172
176
  var sortedColumn = columnApi.getColumnState().find(function (col) {
@@ -314,7 +318,7 @@ function AgGridPlus(props) {
314
318
  },
315
319
  size: "small",
316
320
  showTotal: function showTotal(total, range) {
317
- return "\u7B2C ".concat(range[0], "-").concat(range[1], " \u6761/\u603B\u5171 ").concat(total, " items");
321
+ return "\u7B2C ".concat(range[0], "-").concat(range[1], " \u6761/\u603B\u5171 ").concat(total, " \u6761");
318
322
  },
319
323
  pageSizeOptions: [10, 100, 200, 500, 1000],
320
324
  hideOnSinglePage: true,
@@ -7,7 +7,7 @@ import { observer } from '@formily/react';
7
7
  var useCollapseGrid = function useCollapseGrid(maxRows) {
8
8
  var grid = useMemo(function () {
9
9
  return FormGrid.createFormGrid({
10
- maxColumns: 4,
10
+ maxColumns: 5,
11
11
  maxWidth: 240,
12
12
  maxRows: maxRows,
13
13
  shouldVisible: function shouldVisible(node, grid) {
@@ -61,7 +61,7 @@ var convertFilterModel = function convertFilterModel(filterModel) {
61
61
  Object.keys(filterModel).map(function (key) {
62
62
  var value = filterModel[key];
63
63
 
64
- if (value) {
64
+ if (!value && value != "") {
65
65
  items.push(getFilter(key, value));
66
66
  }
67
67
  });