dlt-for-react 2.1.7 → 2.1.9
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.
- package/README.md +4 -0
- package/lib/components/KyECharts/index.js +11 -6
- package/lib/components/KyTable/highSearchForm.js +34 -5
- package/lib/components/KyTable/index.js +259 -267
- package/lib/index.js +6 -0
- package/lib/utils/index.js +15 -6
- package/package.json +1 -1
|
@@ -1,153 +1,153 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = undefined;
|
|
7
7
|
|
|
8
|
-
var _objectWithoutProperties2 = require(
|
|
8
|
+
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
|
|
9
9
|
|
|
10
10
|
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
|
11
11
|
|
|
12
|
-
var _message2 = require(
|
|
12
|
+
var _message2 = require('antd/lib/message');
|
|
13
13
|
|
|
14
14
|
var _message3 = _interopRequireDefault(_message2);
|
|
15
15
|
|
|
16
|
-
var _toConsumableArray2 = require(
|
|
16
|
+
var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray');
|
|
17
17
|
|
|
18
18
|
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
|
|
19
19
|
|
|
20
|
-
var _stringify = require(
|
|
20
|
+
var _stringify = require('babel-runtime/core-js/json/stringify');
|
|
21
21
|
|
|
22
22
|
var _stringify2 = _interopRequireDefault(_stringify);
|
|
23
23
|
|
|
24
|
-
var _table = require(
|
|
24
|
+
var _table = require('antd/lib/table');
|
|
25
25
|
|
|
26
26
|
var _table2 = _interopRequireDefault(_table);
|
|
27
27
|
|
|
28
|
-
var _icon = require(
|
|
28
|
+
var _icon = require('antd/lib/icon');
|
|
29
29
|
|
|
30
30
|
var _icon2 = _interopRequireDefault(_icon);
|
|
31
31
|
|
|
32
|
-
var _col = require(
|
|
32
|
+
var _col = require('antd/lib/col');
|
|
33
33
|
|
|
34
34
|
var _col2 = _interopRequireDefault(_col);
|
|
35
35
|
|
|
36
|
-
var _row = require(
|
|
36
|
+
var _row = require('antd/lib/row');
|
|
37
37
|
|
|
38
38
|
var _row2 = _interopRequireDefault(_row);
|
|
39
39
|
|
|
40
|
-
var _radio = require(
|
|
40
|
+
var _radio = require('antd/lib/radio');
|
|
41
41
|
|
|
42
42
|
var _radio2 = _interopRequireDefault(_radio);
|
|
43
43
|
|
|
44
|
-
var _button = require(
|
|
44
|
+
var _button = require('antd/lib/button');
|
|
45
45
|
|
|
46
46
|
var _button2 = _interopRequireDefault(_button);
|
|
47
47
|
|
|
48
|
-
var _getPrototypeOf = require(
|
|
48
|
+
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
|
|
49
49
|
|
|
50
50
|
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
|
|
51
51
|
|
|
52
|
-
var _keys = require(
|
|
52
|
+
var _keys = require('babel-runtime/core-js/object/keys');
|
|
53
53
|
|
|
54
54
|
var _keys2 = _interopRequireDefault(_keys);
|
|
55
55
|
|
|
56
|
-
var _extends2 = require(
|
|
56
|
+
var _extends2 = require('babel-runtime/helpers/extends');
|
|
57
57
|
|
|
58
58
|
var _extends3 = _interopRequireDefault(_extends2);
|
|
59
59
|
|
|
60
|
-
var _assign = require(
|
|
60
|
+
var _assign = require('babel-runtime/core-js/object/assign');
|
|
61
61
|
|
|
62
62
|
var _assign2 = _interopRequireDefault(_assign);
|
|
63
63
|
|
|
64
|
-
var _classCallCheck2 = require(
|
|
64
|
+
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
65
65
|
|
|
66
66
|
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
67
67
|
|
|
68
|
-
var _possibleConstructorReturn2 = require(
|
|
68
|
+
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
69
69
|
|
|
70
70
|
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
71
71
|
|
|
72
|
-
var _createClass2 = require(
|
|
72
|
+
var _createClass2 = require('babel-runtime/helpers/createClass');
|
|
73
73
|
|
|
74
74
|
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
75
75
|
|
|
76
|
-
var _inherits2 = require(
|
|
76
|
+
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
77
77
|
|
|
78
78
|
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
79
79
|
|
|
80
|
-
var _input = require(
|
|
80
|
+
var _input = require('antd/lib/input');
|
|
81
81
|
|
|
82
82
|
var _input2 = _interopRequireDefault(_input);
|
|
83
83
|
|
|
84
|
-
var _select = require(
|
|
84
|
+
var _select = require('antd/lib/select');
|
|
85
85
|
|
|
86
86
|
var _select2 = _interopRequireDefault(_select);
|
|
87
87
|
|
|
88
|
-
require(
|
|
88
|
+
require('antd/lib/message/style');
|
|
89
89
|
|
|
90
|
-
require(
|
|
90
|
+
require('antd/lib/table/style');
|
|
91
91
|
|
|
92
|
-
require(
|
|
92
|
+
require('antd/lib/icon/style');
|
|
93
93
|
|
|
94
|
-
require(
|
|
94
|
+
require('antd/lib/col/style');
|
|
95
95
|
|
|
96
|
-
require(
|
|
96
|
+
require('antd/lib/row/style');
|
|
97
97
|
|
|
98
|
-
require(
|
|
98
|
+
require('antd/lib/radio/style');
|
|
99
99
|
|
|
100
|
-
require(
|
|
100
|
+
require('antd/lib/button/style');
|
|
101
101
|
|
|
102
|
-
require(
|
|
102
|
+
require('antd/lib/input/style');
|
|
103
103
|
|
|
104
|
-
require(
|
|
104
|
+
require('antd/lib/select/style');
|
|
105
105
|
|
|
106
|
-
var _react = require(
|
|
106
|
+
var _react = require('react');
|
|
107
107
|
|
|
108
108
|
var _react2 = _interopRequireDefault(_react);
|
|
109
109
|
|
|
110
|
-
var _reactCustomScrollbarsPatched = require(
|
|
110
|
+
var _reactCustomScrollbarsPatched = require('react-custom-scrollbars-patched');
|
|
111
111
|
|
|
112
|
-
var _NHCore = require(
|
|
112
|
+
var _NHCore = require('../../utils/NHCore');
|
|
113
113
|
|
|
114
|
-
var _expexcel = require(
|
|
114
|
+
var _expexcel = require('./expexcel.js');
|
|
115
115
|
|
|
116
116
|
var _expexcel2 = _interopRequireDefault(_expexcel);
|
|
117
117
|
|
|
118
|
-
var _KyModal = require(
|
|
118
|
+
var _KyModal = require('../KyModal');
|
|
119
119
|
|
|
120
120
|
var _KyModal2 = _interopRequireDefault(_KyModal);
|
|
121
121
|
|
|
122
|
-
var _NHFetch = require(
|
|
122
|
+
var _NHFetch = require('../../utils/NHFetch');
|
|
123
123
|
|
|
124
124
|
var _NHFetch2 = _interopRequireDefault(_NHFetch);
|
|
125
125
|
|
|
126
|
-
var _textGroup = require(
|
|
126
|
+
var _textGroup = require('./textGroup');
|
|
127
127
|
|
|
128
128
|
var _textGroup2 = _interopRequireDefault(_textGroup);
|
|
129
129
|
|
|
130
|
-
var _text = require(
|
|
130
|
+
var _text = require('./text');
|
|
131
131
|
|
|
132
132
|
var _text2 = _interopRequireDefault(_text);
|
|
133
133
|
|
|
134
|
-
var _highSearchForm = require(
|
|
134
|
+
var _highSearchForm = require('./highSearchForm');
|
|
135
135
|
|
|
136
136
|
var _highSearchForm2 = _interopRequireDefault(_highSearchForm);
|
|
137
137
|
|
|
138
|
-
require(
|
|
138
|
+
require('../../../assets/components/KyTable/index.less');
|
|
139
139
|
|
|
140
|
-
var _checkButtons = require(
|
|
140
|
+
var _checkButtons = require('./checkButtons');
|
|
141
141
|
|
|
142
142
|
var _checkButtons2 = _interopRequireDefault(_checkButtons);
|
|
143
143
|
|
|
144
|
-
var _marqueenText = require(
|
|
144
|
+
var _marqueenText = require('./marqueenText');
|
|
145
145
|
|
|
146
146
|
var _marqueenText2 = _interopRequireDefault(_marqueenText);
|
|
147
147
|
|
|
148
|
-
var _reactResizable = require(
|
|
148
|
+
var _reactResizable = require('react-resizable');
|
|
149
149
|
|
|
150
|
-
var _data = require(
|
|
150
|
+
var _data = require('./data.js');
|
|
151
151
|
|
|
152
152
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
153
153
|
|
|
@@ -189,7 +189,7 @@ selectConfig配置参数
|
|
|
189
189
|
* @returns 返回查找到的元素Dom对象,无则返回null
|
|
190
190
|
*/
|
|
191
191
|
function getNearEle(ele, type) {
|
|
192
|
-
type = type == 1 ?
|
|
192
|
+
type = type == 1 ? 'previousSibling' : 'nextSibling';
|
|
193
193
|
var nearEle = ele[type];
|
|
194
194
|
while (nearEle) {
|
|
195
195
|
if (nearEle.nodeType === 1) {
|
|
@@ -206,7 +206,7 @@ function getNearEle(ele, type) {
|
|
|
206
206
|
var KyTable = function (_React$Component) {
|
|
207
207
|
(0, _inherits3.default)(KyTable, _React$Component);
|
|
208
208
|
(0, _createClass3.default)(KyTable, [{
|
|
209
|
-
key:
|
|
209
|
+
key: 'UNSAFE_componentWillReceiveProps',
|
|
210
210
|
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
211
211
|
var updateState = {};
|
|
212
212
|
var newParams = {};
|
|
@@ -229,11 +229,11 @@ var KyTable = function (_React$Component) {
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
if ((0, _keys2.default)(newParams).length > 0) {
|
|
232
|
-
updateState[
|
|
232
|
+
updateState['params'] = newParams;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
if ((0, _keys2.default)(newSearchParams).length > 0) {
|
|
236
|
-
updateState[
|
|
236
|
+
updateState['searchParams'] = newSearchParams;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
if (!columns) {
|
|
@@ -247,16 +247,16 @@ var KyTable = function (_React$Component) {
|
|
|
247
247
|
});
|
|
248
248
|
|
|
249
249
|
if ((0, _keys2.default)(commonSearchParams).length > 0) {
|
|
250
|
-
updateState[
|
|
251
|
-
updateState[
|
|
250
|
+
updateState['tySearchAllField'] = commonSearchParams.tySearchAllField;
|
|
251
|
+
updateState['searchField'] = commonSearchParams.searchField;
|
|
252
252
|
}
|
|
253
253
|
if (this.state.searchText && !this.state.highSearch) {
|
|
254
254
|
var searchText = this.state.searchText;
|
|
255
255
|
var _newSearchParams = (0, _extends3.default)({}, this.state.quickSearcParams);
|
|
256
256
|
_newSearchParams[commonSearchParams.searchField] = searchText;
|
|
257
|
-
updateState[
|
|
257
|
+
updateState['searchParams'] = (0, _extends3.default)({}, _newSearchParams, searchParams);
|
|
258
258
|
} else {
|
|
259
|
-
updateState[
|
|
259
|
+
updateState['searchParams'] = (0, _extends3.default)({}, newSearchParams, this.state.quickSearcParams);
|
|
260
260
|
}
|
|
261
261
|
this.setState(updateState);
|
|
262
262
|
}
|
|
@@ -287,7 +287,7 @@ var KyTable = function (_React$Component) {
|
|
|
287
287
|
page: 1
|
|
288
288
|
},
|
|
289
289
|
height: _this.props.autoHeightFlag === true ? undefined : _this.props.height, //列表的高度
|
|
290
|
-
tableDivHeight: _this.props.autoHeightFlag === true ?
|
|
290
|
+
tableDivHeight: _this.props.autoHeightFlag === true ? '100%' : undefined,
|
|
291
291
|
width: undefined, //列表的宽度
|
|
292
292
|
className: (0, _NHCore.createUuid)(),
|
|
293
293
|
tySearchAllField: undefined, //通用查询的所有字段
|
|
@@ -324,7 +324,7 @@ var KyTable = function (_React$Component) {
|
|
|
324
324
|
|
|
325
325
|
//以下是列宽适应优化新增的
|
|
326
326
|
actionColumnsCfg: undefined, //操作列的配置,只有在数据有改变的时候,才需要重新计算该配置
|
|
327
|
-
selectValue:
|
|
327
|
+
selectValue: 'all' //下拉筛选值
|
|
328
328
|
};
|
|
329
329
|
return _this;
|
|
330
330
|
}
|
|
@@ -332,7 +332,7 @@ var KyTable = function (_React$Component) {
|
|
|
332
332
|
|
|
333
333
|
|
|
334
334
|
(0, _createClass3.default)(KyTable, [{
|
|
335
|
-
key:
|
|
335
|
+
key: 'UNSAFE_componentWillMount',
|
|
336
336
|
value: function UNSAFE_componentWillMount() {
|
|
337
337
|
var _this2 = this;
|
|
338
338
|
|
|
@@ -346,11 +346,11 @@ var KyTable = function (_React$Component) {
|
|
|
346
346
|
//在组件挂载之后调用一次。
|
|
347
347
|
|
|
348
348
|
}, {
|
|
349
|
-
key:
|
|
349
|
+
key: 'componentDidMount',
|
|
350
350
|
value: function componentDidMount() {
|
|
351
351
|
var highSearch = this.props.highSearch;
|
|
352
352
|
var searchParams = this.props.searchParams;
|
|
353
|
-
window.addEventListener(
|
|
353
|
+
window.addEventListener('resize', this.refreshHeight, false);
|
|
354
354
|
if (highSearch && (0, _keys2.default)(searchParams).length == 0) {
|
|
355
355
|
this.setState({ highSearch: true, searchParams: {} });
|
|
356
356
|
} else if (highSearch) {
|
|
@@ -362,12 +362,12 @@ var KyTable = function (_React$Component) {
|
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
}, {
|
|
365
|
-
key:
|
|
365
|
+
key: 'componentWillUnmount',
|
|
366
366
|
value: function componentWillUnmount() {
|
|
367
|
-
window.removeEventListener(
|
|
367
|
+
window.removeEventListener('resize', this.refreshHeight, false);
|
|
368
368
|
}
|
|
369
369
|
}, {
|
|
370
|
-
key:
|
|
370
|
+
key: 'componentDidUpdate',
|
|
371
371
|
value: function componentDidUpdate() {
|
|
372
372
|
if (this.state.params.rowKey !== undefined) {}
|
|
373
373
|
// this.refreshHeight();
|
|
@@ -375,7 +375,7 @@ var KyTable = function (_React$Component) {
|
|
|
375
375
|
// this.tableHeaderScrollListener(); // 判断是否需要显示滚动条
|
|
376
376
|
}
|
|
377
377
|
}, {
|
|
378
|
-
key:
|
|
378
|
+
key: 'columnsIsChange',
|
|
379
379
|
value: function columnsIsChange(columns) {
|
|
380
380
|
if (!columns || !(columns instanceof Array)) return false;
|
|
381
381
|
if (columns.length !== this.state.params.columns.length) return true;
|
|
@@ -567,7 +567,7 @@ var KyTable = function (_React$Component) {
|
|
|
567
567
|
/** 监听空表格表头是否存在滚动 */
|
|
568
568
|
|
|
569
569
|
}, {
|
|
570
|
-
key:
|
|
570
|
+
key: 'render',
|
|
571
571
|
value: function render() {
|
|
572
572
|
var _this3 = this;
|
|
573
573
|
|
|
@@ -582,7 +582,7 @@ var KyTable = function (_React$Component) {
|
|
|
582
582
|
pageSize: this.state.pageData.pageSize, //每页的条数
|
|
583
583
|
current: this.state.pageData.page, //当前页数
|
|
584
584
|
showTotal: function showTotal(total, range) {
|
|
585
|
-
return
|
|
585
|
+
return '\u5F53\u524D' + range[0] + '-' + range[1] + '\u6761 \u603B\u6570' + total + '\u6761';
|
|
586
586
|
},
|
|
587
587
|
showQuickJumper: true,
|
|
588
588
|
showSizeChanger: true,
|
|
@@ -594,7 +594,7 @@ var KyTable = function (_React$Component) {
|
|
|
594
594
|
/****************************以下是设置是否需要选择框*********************************/
|
|
595
595
|
if (this.state.params.checkbox !== false) {
|
|
596
596
|
var rowSelection = {
|
|
597
|
-
type: this.props.rowSelectionType ||
|
|
597
|
+
type: this.props.rowSelectionType || 'checkbox',
|
|
598
598
|
columnWidth: 63,
|
|
599
599
|
selectedRowKeys: this.state.selectedRowKeys,
|
|
600
600
|
onChange: function onChange(selectedRowKeys, selectedRows) {
|
|
@@ -607,7 +607,7 @@ var KyTable = function (_React$Component) {
|
|
|
607
607
|
},
|
|
608
608
|
// 选择框的默认属性配置 是否禁用选择框 参照antd
|
|
609
609
|
getCheckboxProps: function getCheckboxProps(record) {
|
|
610
|
-
if (_this3.props.getCheckboxProps && typeof _this3.props.getCheckboxProps ===
|
|
610
|
+
if (_this3.props.getCheckboxProps && typeof _this3.props.getCheckboxProps === 'function') {
|
|
611
611
|
var obj = _this3.props.getCheckboxProps(record);
|
|
612
612
|
return obj;
|
|
613
613
|
} else {
|
|
@@ -619,7 +619,7 @@ var KyTable = function (_React$Component) {
|
|
|
619
619
|
/****************************行选中事件*********************************/
|
|
620
620
|
var onRow = function onRow(record, index) {
|
|
621
621
|
var rowObj = {};
|
|
622
|
-
if (_this3.props.getCheckboxProps && typeof _this3.props.getCheckboxProps ===
|
|
622
|
+
if (_this3.props.getCheckboxProps && typeof _this3.props.getCheckboxProps === 'function') {
|
|
623
623
|
rowObj = _this3.props.getCheckboxProps(record);
|
|
624
624
|
}
|
|
625
625
|
if (rowObj && rowObj.disabled) {
|
|
@@ -635,7 +635,7 @@ var KyTable = function (_React$Component) {
|
|
|
635
635
|
onClick: function onClick(e3) {
|
|
636
636
|
var selectedRowKeys = _this3.state.selectedRowKeys;
|
|
637
637
|
var selectedRows = _this3.state.selectedRows;
|
|
638
|
-
var key =
|
|
638
|
+
var key = '';
|
|
639
639
|
if (_this3.state.params.rowKey instanceof Function) {
|
|
640
640
|
key = _this3.state.params.rowKey(record);
|
|
641
641
|
} else {
|
|
@@ -674,7 +674,7 @@ var KyTable = function (_React$Component) {
|
|
|
674
674
|
if (item.checkButton) advanceCheckbtns.push(item);
|
|
675
675
|
if (item.searchType) showAdvancBtn = true;
|
|
676
676
|
if (item.checkButton) showCheckbtns = true;
|
|
677
|
-
if (item.commonSearch !== false && item.commonSearch !=
|
|
677
|
+
if (item.commonSearch !== false && item.commonSearch != 'false' && item.title !== '序号' && item.title !== '操作') {
|
|
678
678
|
searchLength++;
|
|
679
679
|
if (item.title.length > maxSearchTitle) {
|
|
680
680
|
maxSearchTitle = item.title.length;
|
|
@@ -685,7 +685,7 @@ var KyTable = function (_React$Component) {
|
|
|
685
685
|
item.title
|
|
686
686
|
);
|
|
687
687
|
} else {
|
|
688
|
-
return
|
|
688
|
+
return '';
|
|
689
689
|
}
|
|
690
690
|
});
|
|
691
691
|
var searchList = this.state.params.searchList;
|
|
@@ -695,24 +695,24 @@ var KyTable = function (_React$Component) {
|
|
|
695
695
|
var columnsCfg = (0, _data.getColumns)(this.state.params.columns, this.state.actionColumnsCfg, this.state.className, this.props, this.state.pageData);
|
|
696
696
|
columnsCfg.columns = this.buildParentColumns(columnsCfg, this.props.parentColumns);
|
|
697
697
|
return _react2.default.createElement(
|
|
698
|
-
|
|
698
|
+
'div',
|
|
699
699
|
{
|
|
700
|
-
className:
|
|
701
|
-
style: { height: tableDivHeight, width:
|
|
700
|
+
className: 'ky-nhTable',
|
|
701
|
+
style: { height: tableDivHeight, width: '100%' },
|
|
702
702
|
ref: function ref(el) {
|
|
703
703
|
return _this3.xguiTable = el;
|
|
704
704
|
}
|
|
705
705
|
},
|
|
706
706
|
this.state.params.searchDivFlag !== false ? this.state.highSearch ? _react2.default.createElement(
|
|
707
|
-
|
|
708
|
-
{ className:
|
|
707
|
+
'div',
|
|
708
|
+
{ className: 'ky-nhTable-highSearch' },
|
|
709
709
|
_react2.default.createElement(_highSearchForm2.default, {
|
|
710
710
|
onCancel: function onCancel() {
|
|
711
711
|
return _this3.setState({
|
|
712
712
|
highSearch: false,
|
|
713
713
|
searchParams: {},
|
|
714
714
|
searchTextMap: {},
|
|
715
|
-
searchText:
|
|
715
|
+
searchText: '',
|
|
716
716
|
searchField: _this3.state.tySearchAllField
|
|
717
717
|
});
|
|
718
718
|
},
|
|
@@ -729,31 +729,31 @@ var KyTable = function (_React$Component) {
|
|
|
729
729
|
parentColumns: this.props.parentColumns
|
|
730
730
|
})
|
|
731
731
|
) : _react2.default.createElement(
|
|
732
|
-
|
|
733
|
-
{ className:
|
|
732
|
+
'div',
|
|
733
|
+
{ className: 'dlt-table-searchDiv' },
|
|
734
734
|
this.props.selectConfig && _react2.default.createElement(
|
|
735
|
-
|
|
736
|
-
{ className:
|
|
735
|
+
'div',
|
|
736
|
+
{ className: 'select_state' },
|
|
737
737
|
_react2.default.createElement(
|
|
738
|
-
|
|
738
|
+
'span',
|
|
739
739
|
null,
|
|
740
740
|
this.props.selectConfig.title,
|
|
741
|
-
|
|
741
|
+
'\uFF1A'
|
|
742
742
|
),
|
|
743
743
|
_react2.default.createElement(
|
|
744
744
|
_select2.default,
|
|
745
745
|
{
|
|
746
746
|
// defaultValue="all"
|
|
747
747
|
value: this.state.selectValue,
|
|
748
|
-
style: { width: 240, marginRight:
|
|
748
|
+
style: { width: 240, marginRight: '64px' },
|
|
749
749
|
onChange: function onChange(val) {
|
|
750
750
|
_this3.handleRadioGroupChange(_this3.props.selectConfig.field, val);
|
|
751
751
|
}
|
|
752
752
|
},
|
|
753
753
|
_react2.default.createElement(
|
|
754
754
|
Option,
|
|
755
|
-
{ value:
|
|
756
|
-
|
|
755
|
+
{ value: 'all' },
|
|
756
|
+
'\u5168\u90E8'
|
|
757
757
|
),
|
|
758
758
|
this.props.selectConfig.list.map(function (item, index) {
|
|
759
759
|
return _react2.default.createElement(
|
|
@@ -765,13 +765,13 @@ var KyTable = function (_React$Component) {
|
|
|
765
765
|
)
|
|
766
766
|
),
|
|
767
767
|
this.props.hiddenPartialSearch ? _react2.default.createElement(Search, {
|
|
768
|
-
placeholder:
|
|
768
|
+
placeholder: '\u8BF7\u8F93\u5165\u67E5\u8BE2\u6761\u4EF6',
|
|
769
769
|
onSearch: this.onSearch,
|
|
770
770
|
value: this.state.searchText,
|
|
771
771
|
onChange: this.zdySearchTextChange,
|
|
772
|
-
style: { width:
|
|
772
|
+
style: { width: '100%' }
|
|
773
773
|
}) : _react2.default.createElement(
|
|
774
|
-
|
|
774
|
+
'span',
|
|
775
775
|
null,
|
|
776
776
|
_react2.default.createElement(
|
|
777
777
|
_select2.default,
|
|
@@ -780,18 +780,18 @@ var KyTable = function (_React$Component) {
|
|
|
780
780
|
onChange: this.zdySearchFieldChange,
|
|
781
781
|
dropdownMatchSelectWidth: false,
|
|
782
782
|
dropdownStyle: {
|
|
783
|
-
width: tyOptions && searchLength > 6 ? 80 + (maxSearchTitle - 2) * 15 :
|
|
783
|
+
width: tyOptions && searchLength > 6 ? 80 + (maxSearchTitle - 2) * 15 : 'auto'
|
|
784
784
|
}
|
|
785
785
|
},
|
|
786
|
-
(this.state.params.searchDefaultField === undefined || this.state.params.searchDefaultField ===
|
|
786
|
+
(this.state.params.searchDefaultField === undefined || this.state.params.searchDefaultField === '') && _react2.default.createElement(
|
|
787
787
|
_select2.default.Option,
|
|
788
788
|
{ value: this.state.tySearchAllField },
|
|
789
|
-
|
|
789
|
+
'\u5168\u90E8'
|
|
790
790
|
),
|
|
791
791
|
tyOptions
|
|
792
792
|
),
|
|
793
793
|
_react2.default.createElement(Search, {
|
|
794
|
-
placeholder:
|
|
794
|
+
placeholder: '\u8BF7\u8F93\u5165\u67E5\u8BE2\u6761\u4EF6',
|
|
795
795
|
onSearch: this.onSearch,
|
|
796
796
|
value: this.state.searchText,
|
|
797
797
|
onChange: this.zdySearchTextChange,
|
|
@@ -799,37 +799,29 @@ var KyTable = function (_React$Component) {
|
|
|
799
799
|
}),
|
|
800
800
|
_react2.default.createElement(
|
|
801
801
|
_button2.default,
|
|
802
|
-
{
|
|
803
|
-
|
|
804
|
-
style: { margin: "0 8px 0 12px" },
|
|
805
|
-
onClick: this.onSearch
|
|
806
|
-
},
|
|
807
|
-
"\u67E5\u8BE2"
|
|
802
|
+
{ type: 'primary', style: { margin: '0 8px 0 12px' }, onClick: this.onSearch },
|
|
803
|
+
'\u67E5\u8BE2'
|
|
808
804
|
),
|
|
809
805
|
_react2.default.createElement(
|
|
810
806
|
_button2.default,
|
|
811
|
-
{
|
|
812
|
-
|
|
813
|
-
style: { paddingLeft: 15 },
|
|
814
|
-
onClick: this.onRest
|
|
815
|
-
},
|
|
816
|
-
"\u91CD\u7F6E"
|
|
807
|
+
{ type: 'Default', style: { paddingLeft: 15 }, onClick: this.onRest },
|
|
808
|
+
'\u91CD\u7F6E'
|
|
817
809
|
),
|
|
818
810
|
_react2.default.createElement(
|
|
819
|
-
|
|
811
|
+
'a',
|
|
820
812
|
{
|
|
821
813
|
onClick: function onClick() {
|
|
822
814
|
return _this3.setState({ highSearch: true, searchParams: {} });
|
|
823
815
|
},
|
|
824
816
|
style: {
|
|
825
817
|
marginLeft: 10,
|
|
826
|
-
display: showAdvancBtn ?
|
|
818
|
+
display: showAdvancBtn ? 'inline' : 'none'
|
|
827
819
|
}
|
|
828
820
|
},
|
|
829
|
-
|
|
821
|
+
'[\u9AD8\u7EA7\u641C\u7D22]'
|
|
830
822
|
)
|
|
831
823
|
)
|
|
832
|
-
) :
|
|
824
|
+
) : '',
|
|
833
825
|
showCheckbtns ? _react2.default.createElement(_checkButtons2.default, {
|
|
834
826
|
ref: function ref(_ref2) {
|
|
835
827
|
return _this3.checkbuttons = _ref2;
|
|
@@ -840,9 +832,9 @@ var KyTable = function (_React$Component) {
|
|
|
840
832
|
}) : null,
|
|
841
833
|
searchList && searchList.length === 1 && searchList[0].isLeftFixed && _react2.default.createElement(
|
|
842
834
|
_row2.default,
|
|
843
|
-
{ gutter: 8, style: { marginBottom:
|
|
835
|
+
{ gutter: 8, style: { marginBottom: '12px' } },
|
|
844
836
|
_react2.default.createElement(
|
|
845
|
-
|
|
837
|
+
'div',
|
|
846
838
|
null,
|
|
847
839
|
_react2.default.createElement(
|
|
848
840
|
_radio2.default.Group,
|
|
@@ -850,12 +842,12 @@ var KyTable = function (_React$Component) {
|
|
|
850
842
|
onChange: function onChange(e) {
|
|
851
843
|
return _this3.handleRadioGroupChange(searchList[0].field, e.target.value, 0);
|
|
852
844
|
},
|
|
853
|
-
defaultValue:
|
|
845
|
+
defaultValue: 'all'
|
|
854
846
|
},
|
|
855
847
|
_react2.default.createElement(
|
|
856
848
|
_radio2.default.Button,
|
|
857
|
-
{ value:
|
|
858
|
-
|
|
849
|
+
{ value: 'all' },
|
|
850
|
+
'\u5168\u90E8'
|
|
859
851
|
),
|
|
860
852
|
searchList[0].list.map(function (row, index) {
|
|
861
853
|
return _react2.default.createElement(
|
|
@@ -870,31 +862,31 @@ var KyTable = function (_React$Component) {
|
|
|
870
862
|
|
|
871
863
|
// 多行配置
|
|
872
864
|
searchList && searchList.length > 1 && _react2.default.createElement(
|
|
873
|
-
|
|
874
|
-
{ style: { marginBottom:
|
|
865
|
+
'div',
|
|
866
|
+
{ style: { marginBottom: '12px' } },
|
|
875
867
|
searchList.map(function (item) {
|
|
876
868
|
return _react2.default.createElement(
|
|
877
869
|
_row2.default,
|
|
878
870
|
{ gutter: 0, key: item.field },
|
|
879
871
|
item.title,
|
|
880
|
-
|
|
872
|
+
'\uFF1A',
|
|
881
873
|
_react2.default.createElement(
|
|
882
|
-
|
|
883
|
-
{ style: { display:
|
|
874
|
+
'div',
|
|
875
|
+
{ style: { display: 'inline' } },
|
|
884
876
|
_react2.default.createElement(
|
|
885
877
|
_textGroup2.default,
|
|
886
878
|
{
|
|
887
|
-
name:
|
|
888
|
-
style: { display:
|
|
879
|
+
name: 'textGroup',
|
|
880
|
+
style: { display: 'inline' },
|
|
889
881
|
onChange: function onChange(e) {
|
|
890
882
|
return _this3.handleRadioGroupChange(item.field, e, 0);
|
|
891
883
|
},
|
|
892
|
-
defaultValue:
|
|
884
|
+
defaultValue: 'all'
|
|
893
885
|
},
|
|
894
886
|
_react2.default.createElement(
|
|
895
887
|
_text2.default,
|
|
896
|
-
{ value:
|
|
897
|
-
|
|
888
|
+
{ value: 'all' },
|
|
889
|
+
'\u5168\u90E8'
|
|
898
890
|
),
|
|
899
891
|
item.list.map(function (row, index) {
|
|
900
892
|
return _react2.default.createElement(
|
|
@@ -911,8 +903,8 @@ var KyTable = function (_React$Component) {
|
|
|
911
903
|
|
|
912
904
|
// 只有一行的配置
|
|
913
905
|
this.props.children || searchList && searchList.length === 1 ? _react2.default.createElement(
|
|
914
|
-
|
|
915
|
-
{ className:
|
|
906
|
+
'div',
|
|
907
|
+
{ className: 'ky-table-btn', style: { marginBottom: '12px' } },
|
|
916
908
|
_react2.default.createElement(
|
|
917
909
|
_row2.default,
|
|
918
910
|
{ gutter: 16 },
|
|
@@ -932,11 +924,11 @@ var KyTable = function (_React$Component) {
|
|
|
932
924
|
_react2.default.createElement(
|
|
933
925
|
_row2.default,
|
|
934
926
|
{
|
|
935
|
-
type:
|
|
936
|
-
justify: searchList[0].isLeftFixed ?
|
|
927
|
+
type: 'flex',
|
|
928
|
+
justify: searchList[0].isLeftFixed ? 'start' : this.props.children ? 'end' : 'start'
|
|
937
929
|
},
|
|
938
930
|
_react2.default.createElement(
|
|
939
|
-
|
|
931
|
+
'div',
|
|
940
932
|
null,
|
|
941
933
|
_react2.default.createElement(
|
|
942
934
|
_radio2.default.Group,
|
|
@@ -944,20 +936,17 @@ var KyTable = function (_React$Component) {
|
|
|
944
936
|
onChange: function onChange(e) {
|
|
945
937
|
return _this3.handleRadioGroupChange(searchList[0].field, e.target.value, 0);
|
|
946
938
|
},
|
|
947
|
-
defaultValue:
|
|
939
|
+
defaultValue: 'all'
|
|
948
940
|
},
|
|
949
941
|
_react2.default.createElement(
|
|
950
942
|
_radio2.default.Button,
|
|
951
|
-
{ value:
|
|
952
|
-
|
|
943
|
+
{ value: 'all' },
|
|
944
|
+
'\u5168\u90E8'
|
|
953
945
|
),
|
|
954
946
|
searchList[0].list.map(function (row, index) {
|
|
955
947
|
return _react2.default.createElement(
|
|
956
948
|
_radio2.default.Button,
|
|
957
|
-
{
|
|
958
|
-
value: row.value,
|
|
959
|
-
key: row.value
|
|
960
|
-
},
|
|
949
|
+
{ value: row.value, key: row.value },
|
|
961
950
|
row.text
|
|
962
951
|
);
|
|
963
952
|
})
|
|
@@ -966,20 +955,20 @@ var KyTable = function (_React$Component) {
|
|
|
966
955
|
)
|
|
967
956
|
)
|
|
968
957
|
)
|
|
969
|
-
) :
|
|
958
|
+
) : '',
|
|
970
959
|
this.props.tip ? _react2.default.createElement(
|
|
971
|
-
|
|
972
|
-
{ className:
|
|
973
|
-
_react2.default.createElement(_icon2.default, { type:
|
|
960
|
+
'div',
|
|
961
|
+
{ className: 'ky-nhTable-tips-div' },
|
|
962
|
+
_react2.default.createElement(_icon2.default, { type: 'info-circle' }),
|
|
974
963
|
_react2.default.createElement(
|
|
975
964
|
_marqueenText2.default,
|
|
976
965
|
null,
|
|
977
966
|
this.props.tip
|
|
978
967
|
)
|
|
979
|
-
) :
|
|
968
|
+
) : '',
|
|
980
969
|
_react2.default.createElement(_table2.default, {
|
|
981
|
-
className: this.state.className +
|
|
982
|
-
size: this.props.size ||
|
|
970
|
+
className: this.state.className + ' ' + (this.state.showTableHeaderScroll ? 'showHeaderScroll' : ''),
|
|
971
|
+
size: this.props.size || 'small',
|
|
983
972
|
rowKey: this.state.params.rowKey,
|
|
984
973
|
rowSelection: rowSelection,
|
|
985
974
|
dataSource: this.state.data,
|
|
@@ -993,7 +982,7 @@ var KyTable = function (_React$Component) {
|
|
|
993
982
|
bordered: this.state.params.bordered,
|
|
994
983
|
showHeader: this.state.params.showHeader,
|
|
995
984
|
scroll: {
|
|
996
|
-
x: !this.props.isMaxContent_x ? columnsCfg.width :
|
|
985
|
+
x: !this.props.isMaxContent_x ? columnsCfg.width : 'max-content',
|
|
997
986
|
y: this.state.height
|
|
998
987
|
},
|
|
999
988
|
components: this.state.params.autoHeightFlag === true ? undefined : this.isIE() ? undefined : this.components
|
|
@@ -1003,11 +992,11 @@ var KyTable = function (_React$Component) {
|
|
|
1003
992
|
}),
|
|
1004
993
|
this.props.loadMore && _react2.default.createElement(
|
|
1005
994
|
_row2.default,
|
|
1006
|
-
{ type:
|
|
995
|
+
{ type: 'flex', justify: 'center', style: { padding: '20px' } },
|
|
1007
996
|
_react2.default.createElement(
|
|
1008
997
|
_col2.default,
|
|
1009
|
-
{ style: { cursor:
|
|
1010
|
-
this.state.pageCount <= this.state.pageData.page ?
|
|
998
|
+
{ style: { cursor: 'pointer' }, onClick: this.loadMoreData },
|
|
999
|
+
this.state.pageCount <= this.state.pageData.page ? '已加载全部数据' : '查看更多'
|
|
1011
1000
|
)
|
|
1012
1001
|
),
|
|
1013
1002
|
_react2.default.createElement(
|
|
@@ -1029,9 +1018,9 @@ var KyTable = function (_React$Component) {
|
|
|
1029
1018
|
})
|
|
1030
1019
|
),
|
|
1031
1020
|
_react2.default.createElement(
|
|
1032
|
-
|
|
1033
|
-
{ jsx:
|
|
1034
|
-
|
|
1021
|
+
'style',
|
|
1022
|
+
{ jsx: 'true', global: 'true' },
|
|
1023
|
+
'\n .ky-nhTable\n .ant-table-small\n > .ant-table-content\n > .ant-table-scroll\n > .ant-table-body\n > div\n > div:first-child\n > table,\n .ky-nhTable\n .ant-table-small\n > .ant-table-content\n > .ant-table-fixed-left\n > .ant-table-body-outer\n > .ant-table-body-inner\n > div\n > div:first-child\n > table,\n .ky-nhTable\n .ant-table-small\n > .ant-table-content\n > .ant-table-fixed-right\n > .ant-table-body-outer\n > .ant-table-body-inner\n > div\n > div:first-child\n > table {\n margin-bottom: ' + columnsCfg.bodyContentMarginBottom + 'px;\n }\n '
|
|
1035
1024
|
)
|
|
1036
1025
|
);
|
|
1037
1026
|
}
|
|
@@ -1070,10 +1059,10 @@ KyTable.defaultProps = {
|
|
|
1070
1059
|
searchList: undefined, // 搜索列表配置
|
|
1071
1060
|
baseUrl: undefined, //请求路径的前缀,可通过改参数控制访问的后端服务,如果不设置,则会去访问当前前端服务对应的后端服务,例如:api/sm-bpm-expansion
|
|
1072
1061
|
exportExcelCacheDataUrl: undefined, //导出Excel 缓存数据到Redis的请求URL,
|
|
1073
|
-
pageSizeOptions: [
|
|
1062
|
+
pageSizeOptions: ['10', '20', '50', '100', '200', '500'], // 分页参数
|
|
1074
1063
|
defaultPageSize: 20,
|
|
1075
1064
|
highSearch: false, //高级搜索框展示
|
|
1076
|
-
rowSelectionType:
|
|
1065
|
+
rowSelectionType: 'checkbox', // 多选/单选,checkbox or radio
|
|
1077
1066
|
onRowFalse: false, //禁用onRow 若表格存在禁用某行的情况下最好设置为true
|
|
1078
1067
|
parentColumns: undefined, //多级表头的数据,目前只支持二级表头 {title: '一级表头的名称', children: [二级表头的dataIndex数组]}
|
|
1079
1068
|
|
|
@@ -1084,7 +1073,7 @@ KyTable.defaultProps = {
|
|
|
1084
1073
|
|
|
1085
1074
|
mockDataSource: undefined, //列表的dataSource,sign为空时列表这个DataSource 方便以后原型做模拟数据【/狗头】
|
|
1086
1075
|
isVirtualList: false, //是否开启虚拟列表 &数据量在60条后生效,开启后会渲染可视范围内的列表,提高渲染效率,在大数据量下使用,建议在没有固定列的table中使用,会有一些异常的情况出现 如滚动时会出现短时间的白屏等问题 固定列bug 需要升级antd4.x,等后期优化。【不推荐】
|
|
1087
|
-
exportTitle:
|
|
1076
|
+
exportTitle: '导出Excel', //导出model标题
|
|
1088
1077
|
isMaxContent_x: false, // 是否自动调整内容合适的宽度,在固定列后,手动设置scroll{x: Number}有可能错位,即出现白色垂直空隙或者重复边框,所以设置为max-content(还有一种办法是使其中一列不设置width属性,但在此处不合适)。
|
|
1089
1078
|
selectConfig: undefined //下拉筛选
|
|
1090
1079
|
};
|
|
@@ -1094,7 +1083,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1094
1083
|
|
|
1095
1084
|
this.existHightSearchTableSelect = function () {
|
|
1096
1085
|
return _this4.state.params.columns.some(function (item) {
|
|
1097
|
-
return item.searchType ===
|
|
1086
|
+
return item.searchType === 'select' && !item.sign && !item.dmbz;
|
|
1098
1087
|
});
|
|
1099
1088
|
};
|
|
1100
1089
|
|
|
@@ -1182,17 +1171,17 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1182
1171
|
if (!height) return;
|
|
1183
1172
|
var boxDom = document.getElementsByClassName(_this4.state.className)[0];
|
|
1184
1173
|
if (boxDom) {
|
|
1185
|
-
var tableDom = boxDom.querySelector(
|
|
1186
|
-
var placeholderDom = boxDom.querySelector(
|
|
1174
|
+
var tableDom = boxDom.querySelector('.ant-table .ant-table-body');
|
|
1175
|
+
var placeholderDom = boxDom.querySelector('.ant-table .ant-table-placeholder');
|
|
1187
1176
|
if (tableDom) {
|
|
1188
|
-
tableDom.style.minHeight = height +
|
|
1177
|
+
tableDom.style.minHeight = height + 'px';
|
|
1189
1178
|
}
|
|
1190
1179
|
}
|
|
1191
1180
|
};
|
|
1192
1181
|
|
|
1193
1182
|
this.ansysParams = function (func) {
|
|
1194
1183
|
//先从缓存中获取配置信息,如果再缓存中没有配置信息则说明配置时在前端书写
|
|
1195
|
-
var paramsStr = sessionStorage.getItem(
|
|
1184
|
+
var paramsStr = sessionStorage.getItem('nhParams');
|
|
1196
1185
|
var params = undefined;
|
|
1197
1186
|
if (paramsStr != undefined) {
|
|
1198
1187
|
var params1 = JSON.parse(paramsStr);
|
|
@@ -1206,14 +1195,14 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1206
1195
|
params = tableParam;
|
|
1207
1196
|
} else {
|
|
1208
1197
|
var t = new Date().getTime();
|
|
1209
|
-
(0, _NHFetch2.default)(_this4.props.baseUrl +
|
|
1198
|
+
(0, _NHFetch2.default)(_this4.props.baseUrl + '/proData/queryAllConfig', 'GET', t).then(function (res) {
|
|
1210
1199
|
if (res && res.code === 200) {
|
|
1211
1200
|
var _tableParam = res.data.table[_this4.props.sign];
|
|
1212
1201
|
if (_tableParam) {
|
|
1213
1202
|
sessionStorage.setItem(_this4.props.sign, (0, _stringify2.default)(_tableParam));
|
|
1214
1203
|
_this4.ansysParams(func);
|
|
1215
1204
|
} else {
|
|
1216
|
-
console.warn(
|
|
1205
|
+
console.warn('无法获取' + _this4.props.sign + '配置');
|
|
1217
1206
|
}
|
|
1218
1207
|
}
|
|
1219
1208
|
});
|
|
@@ -1223,21 +1212,21 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1223
1212
|
}
|
|
1224
1213
|
if (params != undefined) {
|
|
1225
1214
|
params.rowKey = _this4.props.rowKey !== undefined ? _this4.props.rowKey : params.rowKey;
|
|
1226
|
-
params.checkbox = _this4.props.checkbox !== undefined ? _this4.props.checkbox : params.checkbox ===
|
|
1227
|
-
params.autoHeightFlag = _this4.props.autoHeightFlag !== undefined ? _this4.props.autoHeightFlag : params.autoHeightFlag ===
|
|
1228
|
-
params.footerFlag = _this4.props.footerFlag !== undefined ? _this4.props.footerFlag : params.footerFlag ===
|
|
1229
|
-
params.searchDivFlag = _this4.props.searchDivFlag !== undefined ? _this4.props.searchDivFlag : params.searchDivFlag ===
|
|
1230
|
-
params.defaultExpandAllRows = _this4.props.defaultExpandAllRows !== undefined ? _this4.props.defaultExpandAllRows : params.defaultExpandAllRows ===
|
|
1215
|
+
params.checkbox = _this4.props.checkbox !== undefined ? _this4.props.checkbox : params.checkbox === 'true' || params.checkbox === '' || params.checkbox === undefined ? true : false;
|
|
1216
|
+
params.autoHeightFlag = _this4.props.autoHeightFlag !== undefined ? _this4.props.autoHeightFlag : params.autoHeightFlag === 'false' || params.autoHeightFlag === '' || params.autoHeightFlag === undefined ? false : true;
|
|
1217
|
+
params.footerFlag = _this4.props.footerFlag !== undefined ? _this4.props.footerFlag : params.footerFlag === 'true' || params.footerFlag === '' || params.footerFlag === undefined ? true : false;
|
|
1218
|
+
params.searchDivFlag = _this4.props.searchDivFlag !== undefined ? _this4.props.searchDivFlag : params.searchDivFlag === 'true' || params.searchDivFlag === '' || params.searchDivFlag === undefined ? true : false;
|
|
1219
|
+
params.defaultExpandAllRows = _this4.props.defaultExpandAllRows !== undefined ? _this4.props.defaultExpandAllRows : params.defaultExpandAllRows === 'false' || params.defaultExpandAllRows === '' || params.defaultExpandAllRows === undefined ? false : true;
|
|
1231
1220
|
// params.defaultExpandedRowKeys=this.props.defaultExpandedRowKeys!==undefined?this.props.defaultExpandedRowKeys:((params.defaultExpandedRowKeys === '' )?undefined: params.defaultExpandedRowKeys.split(","));
|
|
1232
|
-
params.bordered = _this4.props.bordered !== undefined ? _this4.props.bordered : params.bordered ===
|
|
1221
|
+
params.bordered = _this4.props.bordered !== undefined ? _this4.props.bordered : params.bordered === 'true' /* || params.bordered === '' || params.bordered === undefined */
|
|
1233
1222
|
? true : false;
|
|
1234
|
-
params.titleHeight = _this4.props.titleHeight !== undefined ? _this4.props.titleHeight : params.titleHeight ===
|
|
1235
|
-
params.showHeader = _this4.props.showHeader !== undefined ? _this4.props.showHeader : params.showHeader ===
|
|
1236
|
-
params.url = _this4.props.url !== undefined ? _this4.props.url : params.url ===
|
|
1237
|
-
params.rangeFilter = _this4.props.rangeFilter !== undefined ? _this4.props.rangeFilter : params.rangeFilter ===
|
|
1223
|
+
params.titleHeight = _this4.props.titleHeight !== undefined ? _this4.props.titleHeight : params.titleHeight === '' || params.titleHeight === undefined ? 40 : params.titleHeight;
|
|
1224
|
+
params.showHeader = _this4.props.showHeader !== undefined ? _this4.props.showHeader : params.showHeader === 'true' || params.showHeader === '' || params.showHeader === undefined ? true : false;
|
|
1225
|
+
params.url = _this4.props.url !== undefined ? _this4.props.url : params.url === '' ? undefined : params.url;
|
|
1226
|
+
params.rangeFilter = _this4.props.rangeFilter !== undefined ? _this4.props.rangeFilter : params.rangeFilter === 'false' || params.rangeFilter === '' || params.rangeFilter === undefined ? false : true;
|
|
1238
1227
|
params.rangeFilterList = _this4.props.rangeFilterList || params.rangeFilterList;
|
|
1239
|
-
params.isDefaultLoadData = _this4.props.isDefaultLoadData !== undefined ? _this4.props.isDefaultLoadData : params.isDefaultLoadData ===
|
|
1240
|
-
params.searchDefaultField = _this4.props.searchDefaultField !== undefined ? _this4.props.searchDefaultField : params.searchDefaultField ===
|
|
1228
|
+
params.isDefaultLoadData = _this4.props.isDefaultLoadData !== undefined ? _this4.props.isDefaultLoadData : params.isDefaultLoadData === 'true' || params.isDefaultLoadData === '' || params.isDefaultLoadData === undefined ? true : false;
|
|
1229
|
+
params.searchDefaultField = _this4.props.searchDefaultField !== undefined ? _this4.props.searchDefaultField : params.searchDefaultField === '' ? undefined : params.searchDefaultField;
|
|
1241
1230
|
params.columns = _this4.props.columns !== undefined ? _this4.props.columns : params.columns;
|
|
1242
1231
|
params.columns = params.columns !== undefined ? params.columns : [];
|
|
1243
1232
|
params.columnsAfterFixed = params.columns; //备份columns
|
|
@@ -1307,12 +1296,12 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1307
1296
|
var commonSearchMap = {};
|
|
1308
1297
|
//循环判断哪些字段需要通用查询的搜索条件
|
|
1309
1298
|
if (params.searchDivFlag !== false) {
|
|
1310
|
-
if (params.searchDefaultField === undefined || params.searchDefaultField ===
|
|
1311
|
-
var tySearchAllField =
|
|
1299
|
+
if (params.searchDefaultField === undefined || params.searchDefaultField === '') {
|
|
1300
|
+
var tySearchAllField = ''; //自定义查询的所有字段
|
|
1312
1301
|
var columns = params.columns;
|
|
1313
1302
|
columns.map(function (item) {
|
|
1314
|
-
if (item.commonSearch !== false && item.commonSearch !=
|
|
1315
|
-
tySearchAllField +=
|
|
1303
|
+
if (item.commonSearch !== false && item.commonSearch != 'false' && item.title !== '序号' && item.title !== '操作') {
|
|
1304
|
+
tySearchAllField += ',' + item.dataIndex.toLowerCase();
|
|
1316
1305
|
}
|
|
1317
1306
|
return item;
|
|
1318
1307
|
});
|
|
@@ -1338,9 +1327,9 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1338
1327
|
titleHeight = 0;
|
|
1339
1328
|
}
|
|
1340
1329
|
var $table = document.getElementsByClassName(_this4.state.className)[0];
|
|
1341
|
-
if ($table && $table.getElementsByClassName(
|
|
1330
|
+
if ($table && $table.getElementsByClassName('ant-table-header')[0]) {
|
|
1342
1331
|
// 获取表格头部的高度 防止头部标题换行导致页码溢出
|
|
1343
|
-
titleHeight = $table.getElementsByClassName(
|
|
1332
|
+
titleHeight = $table.getElementsByClassName('ant-table-header')[0].offsetHeight;
|
|
1344
1333
|
}
|
|
1345
1334
|
var reduceHeight = 40 + titleHeight;
|
|
1346
1335
|
if (_this4.state.params.footerFlag === false) {
|
|
@@ -1354,7 +1343,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1354
1343
|
});
|
|
1355
1344
|
}
|
|
1356
1345
|
|
|
1357
|
-
var colSpanDom = document.getElementsByClassName(_this4.state.className)[0] ? document.getElementsByClassName(_this4.state.className)[0].querySelectorAll(
|
|
1346
|
+
var colSpanDom = document.getElementsByClassName(_this4.state.className)[0] ? document.getElementsByClassName(_this4.state.className)[0].querySelectorAll('.ant-table-scroll > .ant-table-header > table > .ant-table-thead > tr > th[colspan]') : '';
|
|
1358
1347
|
if (colSpanDom && colSpanDom.length > 0 && !_this4.props.bordered) {
|
|
1359
1348
|
// 存在二级表头的内容
|
|
1360
1349
|
for (var i = 0; i < colSpanDom.length; i++) {
|
|
@@ -1362,13 +1351,13 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1362
1351
|
var prevEle = getNearEle(nowEle, 1); //上一节点
|
|
1363
1352
|
var nextEle = getNearEle(nowEle, 0); //下一节点
|
|
1364
1353
|
if (nowEle) {
|
|
1365
|
-
nowEle.style.borderBottom =
|
|
1354
|
+
nowEle.style.borderBottom = '1px solid #e8e8e8';
|
|
1366
1355
|
}
|
|
1367
1356
|
if (prevEle) {
|
|
1368
|
-
prevEle.style.borderRight =
|
|
1357
|
+
prevEle.style.borderRight = '1px solid #e8e8e8';
|
|
1369
1358
|
}
|
|
1370
1359
|
if (nextEle) {
|
|
1371
|
-
nextEle.style.borderLeft =
|
|
1360
|
+
nextEle.style.borderLeft = '1px solid #e8e8e8';
|
|
1372
1361
|
}
|
|
1373
1362
|
}
|
|
1374
1363
|
}
|
|
@@ -1381,45 +1370,49 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1381
1370
|
if (!err) {
|
|
1382
1371
|
for (var key in values) {
|
|
1383
1372
|
if (values[key]) {
|
|
1384
|
-
if (key.endsWith(
|
|
1373
|
+
if (key.endsWith('_date')) {
|
|
1385
1374
|
if (values[key] && values[key].length > 0) {
|
|
1386
|
-
searchParams[key.replace(
|
|
1387
|
-
searchParams[key.replace(
|
|
1375
|
+
searchParams[key.replace('date', 'LTEQ')] = values[key][1].valueOf();
|
|
1376
|
+
searchParams[key.replace('date', 'GTEQ')] = values[key][0].valueOf();
|
|
1388
1377
|
} else {
|
|
1389
|
-
delete searchParams[key.replace(
|
|
1390
|
-
delete searchParams[key.replace(
|
|
1378
|
+
delete searchParams[key.replace('date', 'LTEQ')];
|
|
1379
|
+
delete searchParams[key.replace('date', 'GTEQ')];
|
|
1391
1380
|
}
|
|
1392
|
-
} else if (key.endsWith(
|
|
1381
|
+
} else if (key.endsWith('_gtdate')) {
|
|
1382
|
+
searchParams[key.replace('gtdate', 'GTEQ')] = values[key].valueOf();
|
|
1383
|
+
} else if (key.endsWith('_ltdate')) {
|
|
1384
|
+
searchParams[key.replace('ltdate', 'LTEQ')] = values[key].valueOf();
|
|
1385
|
+
} else if (key.endsWith('_dateRange')) {
|
|
1393
1386
|
if (values[key] && values[key].length > 0) {
|
|
1394
|
-
searchParams[key.replace(key,
|
|
1395
|
-
searchParams[key.replace(key,
|
|
1387
|
+
searchParams[key.replace(key, 'D_KSSJ_GTEQ')] = values[key][0].valueOf(); //开始时间
|
|
1388
|
+
searchParams[key.replace(key, 'D_JSSJ_LTEQ')] = values[key][1].valueOf(); //结束时间
|
|
1396
1389
|
} else {
|
|
1397
1390
|
delete searchParams[key];
|
|
1398
1391
|
delete searchParams[key];
|
|
1399
1392
|
}
|
|
1400
|
-
} else if (key.endsWith(
|
|
1393
|
+
} else if (key.endsWith('_dateTimeRange')) {
|
|
1401
1394
|
if (values[key] && values[key].length > 0) {
|
|
1402
|
-
searchParams[key.replace(key,
|
|
1403
|
-
searchParams[key.replace(key,
|
|
1395
|
+
searchParams[key.replace(key, 'DT_KSSJ_GTEQ')] = values[key][0].valueOf(); //开始时间
|
|
1396
|
+
searchParams[key.replace(key, 'DT_JSSJ_LTEQ')] = values[key][1].valueOf(); //结束时间
|
|
1404
1397
|
} else {
|
|
1405
1398
|
delete searchParams[key];
|
|
1406
1399
|
delete searchParams[key];
|
|
1407
1400
|
}
|
|
1408
|
-
} else if (key.endsWith(
|
|
1409
|
-
searchParams[key.replace(
|
|
1410
|
-
} else if (key.endsWith(
|
|
1411
|
-
searchParams[key.replace(
|
|
1412
|
-
} else if (key.endsWith(
|
|
1413
|
-
searchParams[key.replace(
|
|
1414
|
-
} else if (key.endsWith(
|
|
1415
|
-
searchParams[key.replace(
|
|
1416
|
-
} else if (key.startsWith(
|
|
1417
|
-
if (values[key].trim() !==
|
|
1401
|
+
} else if (key.endsWith('_time_start')) {
|
|
1402
|
+
searchParams[key.replace('time_start', 'GTEQ')] = values[key].valueOf();
|
|
1403
|
+
} else if (key.endsWith('_time_end')) {
|
|
1404
|
+
searchParams[key.replace('time_end', 'LTEQ')] = values[key].valueOf();
|
|
1405
|
+
} else if (key.endsWith('_number_start')) {
|
|
1406
|
+
searchParams[key.replace('number_start', 'GTEQ')] = values[key].valueOf();
|
|
1407
|
+
} else if (key.endsWith('_number_end')) {
|
|
1408
|
+
searchParams[key.replace('number_end', 'LTEQ')] = values[key].valueOf();
|
|
1409
|
+
} else if (key.startsWith('S') && !key.endsWith('_IN')) {
|
|
1410
|
+
if (values[key].trim() !== '') {
|
|
1418
1411
|
searchParams[key] = values[key].trim();
|
|
1419
1412
|
} else {
|
|
1420
1413
|
delete searchParams[key];
|
|
1421
1414
|
}
|
|
1422
|
-
} else if (key.endsWith(
|
|
1415
|
+
} else if (key.endsWith('_IN')) {
|
|
1423
1416
|
if (values[key] && values[key].length > 0) {
|
|
1424
1417
|
searchParams[key] = values[key];
|
|
1425
1418
|
} else {
|
|
@@ -1429,14 +1422,14 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1429
1422
|
searchParams[key] = values[key];
|
|
1430
1423
|
}
|
|
1431
1424
|
} else {
|
|
1432
|
-
if (key.endsWith(
|
|
1433
|
-
delete searchParams[key.replace(
|
|
1434
|
-
} else if (key.endsWith(
|
|
1435
|
-
delete searchParams[key.replace(
|
|
1436
|
-
} else if (key.endsWith(
|
|
1437
|
-
delete searchParams[key.replace(
|
|
1438
|
-
} else if (key.endsWith(
|
|
1439
|
-
delete searchParams[key.replace(
|
|
1425
|
+
if (key.endsWith('_time_start')) {
|
|
1426
|
+
delete searchParams[key.replace('time_start', 'GTEQ')];
|
|
1427
|
+
} else if (key.endsWith('_time_end')) {
|
|
1428
|
+
delete searchParams[key.replace('time_end', 'LTEQ')];
|
|
1429
|
+
} else if (key.endsWith('_number_start')) {
|
|
1430
|
+
delete searchParams[key.replace('number_start', 'GTEQ')];
|
|
1431
|
+
} else if (key.endsWith('_number_end')) {
|
|
1432
|
+
delete searchParams[key.replace('number_end', 'LTEQ')];
|
|
1440
1433
|
} else {
|
|
1441
1434
|
delete searchParams[key];
|
|
1442
1435
|
}
|
|
@@ -1453,7 +1446,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1453
1446
|
|
|
1454
1447
|
if (_this4.props.loadMore) {
|
|
1455
1448
|
_this4.setState({
|
|
1456
|
-
searchText: searchText ? searchText.replace("'",
|
|
1449
|
+
searchText: searchText ? searchText.replace("'", '') : searchText,
|
|
1457
1450
|
data: [],
|
|
1458
1451
|
resetData: true
|
|
1459
1452
|
}, _this4.filterTableData);
|
|
@@ -1470,9 +1463,9 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1470
1463
|
// searchParams: { ...quickSearcParams, ...this.props.searchParams }, //自定义的搜索条件
|
|
1471
1464
|
searchParams: (0, _extends3.default)({}, _this4.props.searchParams), //自定义的搜索条件
|
|
1472
1465
|
searchTextMap: {}, //下拉框查询的值,用作查询
|
|
1473
|
-
searchText:
|
|
1466
|
+
searchText: '',
|
|
1474
1467
|
searchField: _this4.state.tySearchAllField,
|
|
1475
|
-
selectValue:
|
|
1468
|
+
selectValue: 'all',
|
|
1476
1469
|
filters: {}, //多选方式过滤的值
|
|
1477
1470
|
sorter: {}, //排序字段
|
|
1478
1471
|
data: [],
|
|
@@ -1529,7 +1522,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1529
1522
|
this.readTableData = function (flag) {
|
|
1530
1523
|
var params = _this4.getFilterParams();
|
|
1531
1524
|
_this4.setState({ loading: true });
|
|
1532
|
-
var baseUrl = _this4.props.baseUrl || window.baseUrl ||
|
|
1525
|
+
var baseUrl = _this4.props.baseUrl || window.baseUrl || '';
|
|
1533
1526
|
var _props2 = _this4.props,
|
|
1534
1527
|
sign = _props2.sign,
|
|
1535
1528
|
mockDataSource = _props2.mockDataSource;
|
|
@@ -1555,11 +1548,11 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1555
1548
|
_this4.tableHeaderScrollListener(); // 判断是否需要显示滚动条
|
|
1556
1549
|
});
|
|
1557
1550
|
} else {
|
|
1558
|
-
var url = _this4.state.params.url ? _this4.state.params.url : baseUrl +
|
|
1551
|
+
var url = _this4.state.params.url ? _this4.state.params.url : baseUrl + '/proData/gridList';
|
|
1559
1552
|
// if (flag && this.props.columns) {
|
|
1560
1553
|
// this.adjustColumnWidth(); // 先进行调整,否则表头内容都会挤到一起
|
|
1561
1554
|
// }
|
|
1562
|
-
(0, _NHFetch2.default)(url,
|
|
1555
|
+
(0, _NHFetch2.default)(url, 'POST', params).then(function (res) {
|
|
1563
1556
|
var height = _this4.state.height;
|
|
1564
1557
|
|
|
1565
1558
|
if (res) {
|
|
@@ -1602,7 +1595,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1602
1595
|
|
|
1603
1596
|
this.getHightSearchData = function (callback) {
|
|
1604
1597
|
var params = _this4.getFilterParams();
|
|
1605
|
-
var baseUrl = _this4.props.baseUrl || window.baseUrl ||
|
|
1598
|
+
var baseUrl = _this4.props.baseUrl || window.baseUrl || '';
|
|
1606
1599
|
params.pagination = {
|
|
1607
1600
|
page: 1,
|
|
1608
1601
|
pageSize: 1 << 31 - 1
|
|
@@ -1619,22 +1612,22 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1619
1612
|
hightSearchData: mockDataSource || [],
|
|
1620
1613
|
highSearchFetching: false
|
|
1621
1614
|
}, function () {
|
|
1622
|
-
callback && typeof callback ===
|
|
1615
|
+
callback && typeof callback === 'function' && callback();
|
|
1623
1616
|
});
|
|
1624
1617
|
}, 500);
|
|
1625
1618
|
} else {
|
|
1626
|
-
var url = _this4.state.params.url ? _this4.state.params.url : baseUrl +
|
|
1627
|
-
(0, _NHFetch2.default)(url,
|
|
1619
|
+
var url = _this4.state.params.url ? _this4.state.params.url : baseUrl + '/proData/gridList';
|
|
1620
|
+
(0, _NHFetch2.default)(url, 'POST', params).then(function (res) {
|
|
1628
1621
|
if (res) {
|
|
1629
1622
|
_this4.setState({
|
|
1630
1623
|
hightSearchData: res.data ? res.data.list : [],
|
|
1631
1624
|
highSearchFetching: false
|
|
1632
1625
|
}, function () {
|
|
1633
|
-
callback && typeof callback ===
|
|
1626
|
+
callback && typeof callback === 'function' && callback();
|
|
1634
1627
|
});
|
|
1635
1628
|
}
|
|
1636
1629
|
}).catch(function (res) {
|
|
1637
|
-
console.log(
|
|
1630
|
+
console.log('高级搜索异常:', res);
|
|
1638
1631
|
});
|
|
1639
1632
|
}
|
|
1640
1633
|
};
|
|
@@ -1671,11 +1664,10 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1671
1664
|
sqlParams: sqlParams,
|
|
1672
1665
|
initParams: initParams,
|
|
1673
1666
|
sign: _this4.props.sign
|
|
1674
|
-
};
|
|
1675
1667
|
|
|
1676
|
-
|
|
1677
|
-
if (rangeFilter) {
|
|
1678
|
-
var userId = (0, _NHCore.getLoginUser)() ? (0, _NHCore.getLoginUser)().userId :
|
|
1668
|
+
//如果启用职位范围过滤
|
|
1669
|
+
};if (rangeFilter) {
|
|
1670
|
+
var userId = (0, _NHCore.getLoginUser)() ? (0, _NHCore.getLoginUser)().userId : '';
|
|
1679
1671
|
params.rangeFilter = { id: userId };
|
|
1680
1672
|
}
|
|
1681
1673
|
if (rangeFilterList) {
|
|
@@ -1714,43 +1706,43 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1714
1706
|
var columns = _this4.nhExpExcel.state.targetKeys;
|
|
1715
1707
|
var excelName = _this4.nhExpExcel.state.excelName;
|
|
1716
1708
|
if (!columns || columns.length <= 0) {
|
|
1717
|
-
_message3.default.info(
|
|
1709
|
+
_message3.default.info('请选择需要导出的列!');
|
|
1718
1710
|
stopLoading();
|
|
1719
1711
|
return;
|
|
1720
1712
|
}
|
|
1721
1713
|
if (!excelName) {
|
|
1722
|
-
_message3.default.info(
|
|
1714
|
+
_message3.default.info('文件名不能为空');
|
|
1723
1715
|
stopLoading();
|
|
1724
1716
|
return;
|
|
1725
1717
|
}
|
|
1726
1718
|
var columnsMap = {};
|
|
1727
1719
|
for (var i = 0; i < columns.length; i++) {
|
|
1728
|
-
var c = columns[i].split(
|
|
1720
|
+
var c = columns[i].split('@');
|
|
1729
1721
|
columnsMap[c[0]] = c[1];
|
|
1730
1722
|
}
|
|
1731
1723
|
var total = _this4.state.pageData.total;
|
|
1732
1724
|
params.columnsMap = columnsMap;
|
|
1733
1725
|
params.excelName = excelName;
|
|
1734
1726
|
if (total < 40000) {
|
|
1735
|
-
var baseUrl = _this4.props.baseUrl || window.baseUrl ||
|
|
1736
|
-
var exportExcelCacheDataUrl = _this4.props.exportExcelCacheDataUrl ||
|
|
1737
|
-
var cacheDataUrl = exportExcelCacheDataUrl ? exportExcelCacheDataUrl :
|
|
1738
|
-
(0, _NHFetch2.default)(baseUrl + cacheDataUrl,
|
|
1727
|
+
var baseUrl = _this4.props.baseUrl || window.baseUrl || '';
|
|
1728
|
+
var exportExcelCacheDataUrl = _this4.props.exportExcelCacheDataUrl || '';
|
|
1729
|
+
var cacheDataUrl = exportExcelCacheDataUrl ? exportExcelCacheDataUrl : '/proData/gridList/excel/params';
|
|
1730
|
+
(0, _NHFetch2.default)(baseUrl + cacheDataUrl, 'POST', params).then(function (res) {
|
|
1739
1731
|
if (res) {
|
|
1740
1732
|
if (!res.data) {
|
|
1741
|
-
_message3.default.info(
|
|
1733
|
+
_message3.default.info('请刷新浏览器,重新再执行此操作!');
|
|
1742
1734
|
stopLoading();
|
|
1743
1735
|
return;
|
|
1744
1736
|
}
|
|
1745
1737
|
// 本地
|
|
1746
|
-
window.open(baseUrl +
|
|
1738
|
+
window.open(baseUrl + '/proData/gridList/excel/export?uuid=' + res.data, '_blank');
|
|
1747
1739
|
}
|
|
1748
1740
|
stopLoading();
|
|
1749
1741
|
}).catch(function (err) {
|
|
1750
1742
|
return stopLoading();
|
|
1751
1743
|
});
|
|
1752
1744
|
} else {
|
|
1753
|
-
_message3.default.warn(
|
|
1745
|
+
_message3.default.warn('最大的导出数量为40000,当前导出数据量过大,无法执行导出操作!');
|
|
1754
1746
|
stopLoading();
|
|
1755
1747
|
return;
|
|
1756
1748
|
}
|
|
@@ -1758,9 +1750,9 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1758
1750
|
|
|
1759
1751
|
this.encodeSql = function (params) {
|
|
1760
1752
|
for (var key in params) {
|
|
1761
|
-
if (key.toUpperCase().startsWith(
|
|
1753
|
+
if (key.toUpperCase().startsWith('SQL_') && params[key]) {
|
|
1762
1754
|
params[key] = params[key];
|
|
1763
|
-
} else if (key.toUpperCase().startsWith(
|
|
1755
|
+
} else if (key.toUpperCase().startsWith('G_') && params[key]) {
|
|
1764
1756
|
params[key] = _this4.encodeSql(params[key]);
|
|
1765
1757
|
}
|
|
1766
1758
|
}
|
|
@@ -1775,7 +1767,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1775
1767
|
if (queryValue && _this4.state.searchField) {
|
|
1776
1768
|
var quickSearcParams = (0, _extends3.default)({}, _this4.state.quickSearcParams);
|
|
1777
1769
|
var searchParams = (0, _extends3.default)({}, quickSearcParams);
|
|
1778
|
-
searchParams[_this4.state.searchField] = queryValue.replace("'",
|
|
1770
|
+
searchParams[_this4.state.searchField] = queryValue.replace("'", '');
|
|
1779
1771
|
_this4.setState({
|
|
1780
1772
|
searchParams: searchParams
|
|
1781
1773
|
});
|
|
@@ -1809,8 +1801,8 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1809
1801
|
|
|
1810
1802
|
this.isIE = function () {
|
|
1811
1803
|
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
|
|
1812
|
-
var isIE = userAgent.indexOf(
|
|
1813
|
-
var isIE11 = userAgent.indexOf(
|
|
1804
|
+
var isIE = userAgent.indexOf('compatible') > -1 && userAgent.indexOf('MSIE') > -1; //判断是否IE<11浏览器
|
|
1805
|
+
var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf('rv:11.0') > -1;
|
|
1814
1806
|
if (isIE || isIE11) {
|
|
1815
1807
|
return true;
|
|
1816
1808
|
} else return false;
|
|
@@ -1821,11 +1813,11 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1821
1813
|
width = props.width,
|
|
1822
1814
|
minWidth = props.minWidth,
|
|
1823
1815
|
_onClick = props.onClick,
|
|
1824
|
-
restProps = (0, _objectWithoutProperties3.default)(props, [
|
|
1816
|
+
restProps = (0, _objectWithoutProperties3.default)(props, ['onResize', 'width', 'minWidth', 'onClick']);
|
|
1825
1817
|
var closeResizeableTitle = _this4.props.closeResizeableTitle;
|
|
1826
1818
|
|
|
1827
1819
|
if (closeResizeableTitle) {
|
|
1828
|
-
return _react2.default.createElement(
|
|
1820
|
+
return _react2.default.createElement('th', restProps);
|
|
1829
1821
|
} else {
|
|
1830
1822
|
return _react2.default.createElement(
|
|
1831
1823
|
_reactResizable.Resizable,
|
|
@@ -1865,7 +1857,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1865
1857
|
},
|
|
1866
1858
|
draggableOpts: { enableUserSelectHack: false }
|
|
1867
1859
|
},
|
|
1868
|
-
_react2.default.createElement(
|
|
1860
|
+
_react2.default.createElement('th', (0, _extends3.default)({
|
|
1869
1861
|
onClick: function onClick() {
|
|
1870
1862
|
if (!_this4.resizing && _onClick) {
|
|
1871
1863
|
_onClick.apply(undefined, arguments);
|
|
@@ -1883,14 +1875,14 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1883
1875
|
{
|
|
1884
1876
|
onScroll: _this4.onScroll,
|
|
1885
1877
|
autoHide: true,
|
|
1886
|
-
style: { width:
|
|
1878
|
+
style: { width: '100%' },
|
|
1887
1879
|
autoHeight: true,
|
|
1888
1880
|
autoHeightMin: 0,
|
|
1889
1881
|
autoHeightMax: _this4.state.height,
|
|
1890
1882
|
thumbMinSize: 30,
|
|
1891
1883
|
universal: true
|
|
1892
1884
|
},
|
|
1893
|
-
_react2.default.createElement(
|
|
1885
|
+
_react2.default.createElement('table', props)
|
|
1894
1886
|
);
|
|
1895
1887
|
}
|
|
1896
1888
|
};
|
|
@@ -1900,33 +1892,33 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1900
1892
|
var scrollLeft = e1.target.scrollLeft;
|
|
1901
1893
|
var scrollTop = e1.target.scrollTop;
|
|
1902
1894
|
var $parentObj = e1.target.parentNode.parentNode;
|
|
1903
|
-
var obj = $parentObj.classList.contains(
|
|
1904
|
-
if (obj ===
|
|
1905
|
-
obj = $parentObj.parentNode.parentNode.classList.contains(
|
|
1895
|
+
var obj = $parentObj.classList.contains('ant-table-body') ? 'content' : 'none';
|
|
1896
|
+
if (obj === 'none') {
|
|
1897
|
+
obj = $parentObj.parentNode.parentNode.classList.contains('ant-table-fixed-left') ? 'left' : 'right';
|
|
1906
1898
|
}
|
|
1907
1899
|
|
|
1908
1900
|
//头部对象
|
|
1909
1901
|
var $table = document.getElementsByClassName(_this4.state.className)[0];
|
|
1910
|
-
var $header = $table.getElementsByClassName(
|
|
1902
|
+
var $header = $table.getElementsByClassName('ant-table-scroll')[0].getElementsByClassName('ant-table-header')[0];
|
|
1911
1903
|
$header.scrollLeft = scrollLeft;
|
|
1912
1904
|
//中间内容区
|
|
1913
|
-
var $content = $table.getElementsByClassName(
|
|
1914
|
-
if (obj !==
|
|
1905
|
+
var $content = $table.getElementsByClassName('ant-table-scroll')[0].getElementsByClassName('ant-table-body')[0].childNodes[0].childNodes[0];
|
|
1906
|
+
if (obj !== 'content' && $content.scrollTop !== scrollTop) {
|
|
1915
1907
|
loadCount++;
|
|
1916
1908
|
$content.scrollTop = scrollTop;
|
|
1917
1909
|
}
|
|
1918
1910
|
//左部固定内容区
|
|
1919
|
-
if ($table.getElementsByClassName(
|
|
1920
|
-
var $left = $table.getElementsByClassName(
|
|
1921
|
-
if ($left && obj !==
|
|
1911
|
+
if ($table.getElementsByClassName('ant-table-fixed-left')[0]) {
|
|
1912
|
+
var $left = $table.getElementsByClassName('ant-table-fixed-left')[0].getElementsByClassName('ant-table-body-inner')[0].childNodes[0].childNodes[0];
|
|
1913
|
+
if ($left && obj !== 'left' && $left.scrollTop !== scrollTop) {
|
|
1922
1914
|
loadCount++;
|
|
1923
1915
|
$left.scrollTop = scrollTop;
|
|
1924
1916
|
}
|
|
1925
1917
|
}
|
|
1926
1918
|
//右部固定内容区
|
|
1927
|
-
if ($table.getElementsByClassName(
|
|
1928
|
-
var $right = $table.getElementsByClassName(
|
|
1929
|
-
if ($right && obj !==
|
|
1919
|
+
if ($table.getElementsByClassName('ant-table-fixed-right')[0]) {
|
|
1920
|
+
var $right = $table.getElementsByClassName('ant-table-fixed-right')[0].getElementsByClassName('ant-table-body-inner')[0].childNodes[0].childNodes[0];
|
|
1921
|
+
if ($right && obj !== 'right' && $right.scrollTop !== scrollTop) {
|
|
1930
1922
|
loadCount++;
|
|
1931
1923
|
$right.scrollTop = scrollTop;
|
|
1932
1924
|
}
|
|
@@ -1938,17 +1930,17 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1938
1930
|
|
|
1939
1931
|
this.handleRadioGroupChange = function (field, v, index) {
|
|
1940
1932
|
var quickSearcParams = (0, _extends3.default)({}, _this4.state.quickSearcParams);
|
|
1941
|
-
if (v ===
|
|
1933
|
+
if (v === 'all') {
|
|
1942
1934
|
var searchParams = (0, _extends3.default)({}, _this4.state.searchParams);
|
|
1943
|
-
delete searchParams[field +
|
|
1944
|
-
delete quickSearcParams[field +
|
|
1935
|
+
delete searchParams[field + '_EQ'];
|
|
1936
|
+
delete quickSearcParams[field + '_EQ'];
|
|
1945
1937
|
_this4.setState({ searchParams: searchParams, quickSearcParams: quickSearcParams, selectValue: v }, function () {
|
|
1946
1938
|
return _this4.filterTableData();
|
|
1947
1939
|
});
|
|
1948
1940
|
} else {
|
|
1949
1941
|
var _searchParams = (0, _extends3.default)({}, _this4.state.searchParams);
|
|
1950
|
-
_searchParams[field +
|
|
1951
|
-
quickSearcParams[field +
|
|
1942
|
+
_searchParams[field + '_EQ'] = v;
|
|
1943
|
+
quickSearcParams[field + '_EQ'] = v;
|
|
1952
1944
|
_this4.setState({ searchParams: _searchParams, quickSearcParams: quickSearcParams, selectValue: v }, function () {
|
|
1953
1945
|
return _this4.filterTableData();
|
|
1954
1946
|
});
|
|
@@ -1961,7 +1953,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1961
1953
|
if (!err) {
|
|
1962
1954
|
for (var key in values) {
|
|
1963
1955
|
if (values[key]) {
|
|
1964
|
-
if (key.endsWith(
|
|
1956
|
+
if (key.endsWith('_IN')) {
|
|
1965
1957
|
if (values[key] && values[key].length > 0) {
|
|
1966
1958
|
searchParams[key] = values[key];
|
|
1967
1959
|
}
|
|
@@ -2047,15 +2039,15 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
2047
2039
|
var tableEle = document.getElementsByClassName(_this4.state.className);
|
|
2048
2040
|
if (tableEle.length > 0) {
|
|
2049
2041
|
// 获取空表格
|
|
2050
|
-
var emptyEle = tableEle[0].getElementsByClassName(
|
|
2042
|
+
var emptyEle = tableEle[0].getElementsByClassName('ant-table-empty');
|
|
2051
2043
|
if (emptyEle.length > 0) {
|
|
2052
2044
|
var topWidth = 0;
|
|
2053
2045
|
var tableWidth = 0;
|
|
2054
2046
|
// 获取空表格表头容器
|
|
2055
|
-
var headerEle = emptyEle[0].getElementsByClassName(
|
|
2047
|
+
var headerEle = emptyEle[0].getElementsByClassName('ant-table-header');
|
|
2056
2048
|
if (headerEle.length > 0) {
|
|
2057
2049
|
// 获取空表格表头内容
|
|
2058
|
-
var table = headerEle[0].getElementsByTagName(
|
|
2050
|
+
var table = headerEle[0].getElementsByTagName('table');
|
|
2059
2051
|
topWidth = headerEle[0].offsetWidth;
|
|
2060
2052
|
tableWidth = table[0].offsetWidth;
|
|
2061
2053
|
// 如果容器小于内容,说明需要滚动条
|