dlt-for-react 1.1.7 → 1.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 +5 -1
- package/lib/components/KyTable/index.js +267 -281
- package/lib/utils/index.js +38 -2
- 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 _reactCustomScrollbars = require(
|
|
110
|
+
var _reactCustomScrollbars = require("react-custom-scrollbars");
|
|
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: "xgui-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,
|
|
@@ -800,36 +800,36 @@ var KyTable = function (_React$Component) {
|
|
|
800
800
|
_react2.default.createElement(
|
|
801
801
|
_button2.default,
|
|
802
802
|
{
|
|
803
|
-
type:
|
|
804
|
-
style: { margin:
|
|
803
|
+
type: "primary",
|
|
804
|
+
style: { margin: "0 8px 0 12px" },
|
|
805
805
|
onClick: this.onSearch
|
|
806
806
|
},
|
|
807
|
-
|
|
807
|
+
"\u67E5\u8BE2"
|
|
808
808
|
),
|
|
809
809
|
_react2.default.createElement(
|
|
810
810
|
_button2.default,
|
|
811
811
|
{
|
|
812
|
-
type:
|
|
812
|
+
type: "Default",
|
|
813
813
|
style: { paddingLeft: 15 },
|
|
814
814
|
onClick: this.onRest
|
|
815
815
|
},
|
|
816
|
-
|
|
816
|
+
"\u91CD\u7F6E"
|
|
817
817
|
),
|
|
818
818
|
_react2.default.createElement(
|
|
819
|
-
|
|
819
|
+
"a",
|
|
820
820
|
{
|
|
821
821
|
onClick: function onClick() {
|
|
822
822
|
return _this3.setState({ highSearch: true, searchParams: {} });
|
|
823
823
|
},
|
|
824
824
|
style: {
|
|
825
825
|
marginLeft: 10,
|
|
826
|
-
display: showAdvancBtn ?
|
|
826
|
+
display: showAdvancBtn ? "inline" : "none"
|
|
827
827
|
}
|
|
828
828
|
},
|
|
829
|
-
|
|
829
|
+
"[\u9AD8\u7EA7\u641C\u7D22]"
|
|
830
830
|
)
|
|
831
831
|
)
|
|
832
|
-
) :
|
|
832
|
+
) : "",
|
|
833
833
|
showCheckbtns ? _react2.default.createElement(_checkButtons2.default, {
|
|
834
834
|
ref: function ref(_ref2) {
|
|
835
835
|
return _this3.checkbuttons = _ref2;
|
|
@@ -840,9 +840,9 @@ var KyTable = function (_React$Component) {
|
|
|
840
840
|
}) : null,
|
|
841
841
|
searchList && searchList.length === 1 && searchList[0].isLeftFixed && _react2.default.createElement(
|
|
842
842
|
_row2.default,
|
|
843
|
-
{ gutter: 8, style: { marginBottom:
|
|
843
|
+
{ gutter: 8, style: { marginBottom: "12px" } },
|
|
844
844
|
_react2.default.createElement(
|
|
845
|
-
|
|
845
|
+
"div",
|
|
846
846
|
null,
|
|
847
847
|
_react2.default.createElement(
|
|
848
848
|
_radio2.default.Group,
|
|
@@ -850,12 +850,12 @@ var KyTable = function (_React$Component) {
|
|
|
850
850
|
onChange: function onChange(e) {
|
|
851
851
|
return _this3.handleRadioGroupChange(searchList[0].field, e.target.value, 0);
|
|
852
852
|
},
|
|
853
|
-
defaultValue:
|
|
853
|
+
defaultValue: "all"
|
|
854
854
|
},
|
|
855
855
|
_react2.default.createElement(
|
|
856
856
|
_radio2.default.Button,
|
|
857
|
-
{ value:
|
|
858
|
-
|
|
857
|
+
{ value: "all" },
|
|
858
|
+
"\u5168\u90E8"
|
|
859
859
|
),
|
|
860
860
|
searchList[0].list.map(function (row, index) {
|
|
861
861
|
return _react2.default.createElement(
|
|
@@ -870,31 +870,31 @@ var KyTable = function (_React$Component) {
|
|
|
870
870
|
|
|
871
871
|
// 多行配置
|
|
872
872
|
searchList && searchList.length > 1 && _react2.default.createElement(
|
|
873
|
-
|
|
874
|
-
{ style: { marginBottom:
|
|
873
|
+
"div",
|
|
874
|
+
{ style: { marginBottom: "12px" } },
|
|
875
875
|
searchList.map(function (item) {
|
|
876
876
|
return _react2.default.createElement(
|
|
877
877
|
_row2.default,
|
|
878
878
|
{ gutter: 0, key: item.field },
|
|
879
879
|
item.title,
|
|
880
|
-
|
|
880
|
+
"\uFF1A",
|
|
881
881
|
_react2.default.createElement(
|
|
882
|
-
|
|
883
|
-
{ style: { display:
|
|
882
|
+
"div",
|
|
883
|
+
{ style: { display: "inline" } },
|
|
884
884
|
_react2.default.createElement(
|
|
885
885
|
_textGroup2.default,
|
|
886
886
|
{
|
|
887
|
-
name:
|
|
888
|
-
style: { display:
|
|
887
|
+
name: "textGroup",
|
|
888
|
+
style: { display: "inline" },
|
|
889
889
|
onChange: function onChange(e) {
|
|
890
890
|
return _this3.handleRadioGroupChange(item.field, e, 0);
|
|
891
891
|
},
|
|
892
|
-
defaultValue:
|
|
892
|
+
defaultValue: "all"
|
|
893
893
|
},
|
|
894
894
|
_react2.default.createElement(
|
|
895
895
|
_text2.default,
|
|
896
|
-
{ value:
|
|
897
|
-
|
|
896
|
+
{ value: "all" },
|
|
897
|
+
"\u5168\u90E8"
|
|
898
898
|
),
|
|
899
899
|
item.list.map(function (row, index) {
|
|
900
900
|
return _react2.default.createElement(
|
|
@@ -911,8 +911,8 @@ var KyTable = function (_React$Component) {
|
|
|
911
911
|
|
|
912
912
|
// 只有一行的配置
|
|
913
913
|
this.props.children || searchList && searchList.length === 1 ? _react2.default.createElement(
|
|
914
|
-
|
|
915
|
-
{ className:
|
|
914
|
+
"div",
|
|
915
|
+
{ className: "ky-table-btn", style: { marginBottom: "12px" } },
|
|
916
916
|
_react2.default.createElement(
|
|
917
917
|
_row2.default,
|
|
918
918
|
{ gutter: 16 },
|
|
@@ -932,11 +932,11 @@ var KyTable = function (_React$Component) {
|
|
|
932
932
|
_react2.default.createElement(
|
|
933
933
|
_row2.default,
|
|
934
934
|
{
|
|
935
|
-
type:
|
|
936
|
-
justify: searchList[0].isLeftFixed ?
|
|
935
|
+
type: "flex",
|
|
936
|
+
justify: searchList[0].isLeftFixed ? "start" : this.props.children ? "end" : "start"
|
|
937
937
|
},
|
|
938
938
|
_react2.default.createElement(
|
|
939
|
-
|
|
939
|
+
"div",
|
|
940
940
|
null,
|
|
941
941
|
_react2.default.createElement(
|
|
942
942
|
_radio2.default.Group,
|
|
@@ -944,12 +944,12 @@ var KyTable = function (_React$Component) {
|
|
|
944
944
|
onChange: function onChange(e) {
|
|
945
945
|
return _this3.handleRadioGroupChange(searchList[0].field, e.target.value, 0);
|
|
946
946
|
},
|
|
947
|
-
defaultValue:
|
|
947
|
+
defaultValue: "all"
|
|
948
948
|
},
|
|
949
949
|
_react2.default.createElement(
|
|
950
950
|
_radio2.default.Button,
|
|
951
|
-
{ value:
|
|
952
|
-
|
|
951
|
+
{ value: "all" },
|
|
952
|
+
"\u5168\u90E8"
|
|
953
953
|
),
|
|
954
954
|
searchList[0].list.map(function (row, index) {
|
|
955
955
|
return _react2.default.createElement(
|
|
@@ -966,20 +966,20 @@ var KyTable = function (_React$Component) {
|
|
|
966
966
|
)
|
|
967
967
|
)
|
|
968
968
|
)
|
|
969
|
-
) :
|
|
969
|
+
) : "",
|
|
970
970
|
this.props.tip ? _react2.default.createElement(
|
|
971
|
-
|
|
972
|
-
{ className:
|
|
973
|
-
_react2.default.createElement(_icon2.default, { type:
|
|
971
|
+
"div",
|
|
972
|
+
{ className: "ky-nhTable-tips-div" },
|
|
973
|
+
_react2.default.createElement(_icon2.default, { type: "info-circle" }),
|
|
974
974
|
_react2.default.createElement(
|
|
975
975
|
_marqueenText2.default,
|
|
976
976
|
null,
|
|
977
977
|
this.props.tip
|
|
978
978
|
)
|
|
979
|
-
) :
|
|
979
|
+
) : "",
|
|
980
980
|
_react2.default.createElement(_table2.default, {
|
|
981
|
-
className: this.state.className +
|
|
982
|
-
size: this.props.size ||
|
|
981
|
+
className: this.state.className + " " + (this.state.showTableHeaderScroll ? "showHeaderScroll" : ""),
|
|
982
|
+
size: this.props.size || "small",
|
|
983
983
|
rowKey: this.state.params.rowKey,
|
|
984
984
|
rowSelection: rowSelection,
|
|
985
985
|
dataSource: this.state.data,
|
|
@@ -993,7 +993,7 @@ var KyTable = function (_React$Component) {
|
|
|
993
993
|
bordered: this.state.params.bordered,
|
|
994
994
|
showHeader: this.state.params.showHeader,
|
|
995
995
|
scroll: {
|
|
996
|
-
x: !this.props.isMaxContent_x ? columnsCfg.width :
|
|
996
|
+
x: !this.props.isMaxContent_x ? columnsCfg.width : "max-content",
|
|
997
997
|
y: this.state.height
|
|
998
998
|
},
|
|
999
999
|
components: this.state.params.autoHeightFlag === true ? undefined : this.isIE() ? undefined : this.components
|
|
@@ -1003,11 +1003,11 @@ var KyTable = function (_React$Component) {
|
|
|
1003
1003
|
}),
|
|
1004
1004
|
this.props.loadMore && _react2.default.createElement(
|
|
1005
1005
|
_row2.default,
|
|
1006
|
-
{ type:
|
|
1006
|
+
{ type: "flex", justify: "center", style: { padding: "20px" } },
|
|
1007
1007
|
_react2.default.createElement(
|
|
1008
1008
|
_col2.default,
|
|
1009
|
-
{ style: { cursor:
|
|
1010
|
-
this.state.pageCount <= this.state.pageData.page ?
|
|
1009
|
+
{ style: { cursor: "pointer" }, onClick: this.loadMoreData },
|
|
1010
|
+
this.state.pageCount <= this.state.pageData.page ? "已加载全部数据" : "查看更多"
|
|
1011
1011
|
)
|
|
1012
1012
|
),
|
|
1013
1013
|
_react2.default.createElement(
|
|
@@ -1029,9 +1029,9 @@ var KyTable = function (_React$Component) {
|
|
|
1029
1029
|
})
|
|
1030
1030
|
),
|
|
1031
1031
|
_react2.default.createElement(
|
|
1032
|
-
|
|
1032
|
+
"style",
|
|
1033
1033
|
{ jsx: "true", global: "true" },
|
|
1034
|
-
|
|
1034
|
+
"\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
1035
|
)
|
|
1036
1036
|
);
|
|
1037
1037
|
}
|
|
@@ -1070,10 +1070,10 @@ KyTable.defaultProps = {
|
|
|
1070
1070
|
searchList: undefined, // 搜索列表配置
|
|
1071
1071
|
baseUrl: undefined, //请求路径的前缀,可通过改参数控制访问的后端服务,如果不设置,则会去访问当前前端服务对应的后端服务,例如:api/sm-bpm-expansion
|
|
1072
1072
|
exportExcelCacheDataUrl: undefined, //导出Excel 缓存数据到Redis的请求URL,
|
|
1073
|
-
pageSizeOptions: [
|
|
1073
|
+
pageSizeOptions: ["10", "20", "50", "100", "200", "500"], // 分页参数
|
|
1074
1074
|
defaultPageSize: 20,
|
|
1075
1075
|
highSearch: false, //高级搜索框展示
|
|
1076
|
-
rowSelectionType:
|
|
1076
|
+
rowSelectionType: "checkbox", // 多选/单选,checkbox or radio
|
|
1077
1077
|
onRowFalse: false, //禁用onRow 若表格存在禁用某行的情况下最好设置为true
|
|
1078
1078
|
parentColumns: undefined, //多级表头的数据,目前只支持二级表头 {title: '一级表头的名称', children: [二级表头的dataIndex数组]}
|
|
1079
1079
|
|
|
@@ -1084,7 +1084,7 @@ KyTable.defaultProps = {
|
|
|
1084
1084
|
|
|
1085
1085
|
mockDataSource: undefined, //列表的dataSource,sign为空时列表这个DataSource 方便以后原型做模拟数据【/狗头】
|
|
1086
1086
|
isVirtualList: false, //是否开启虚拟列表 &数据量在60条后生效,开启后会渲染可视范围内的列表,提高渲染效率,在大数据量下使用,建议在没有固定列的table中使用,会有一些异常的情况出现 如滚动时会出现短时间的白屏等问题 固定列bug 需要升级antd4.x,等后期优化。【不推荐】
|
|
1087
|
-
exportTitle:
|
|
1087
|
+
exportTitle: "导出Excel", //导出model标题
|
|
1088
1088
|
isMaxContent_x: false, // 是否自动调整内容合适的宽度,在固定列后,手动设置scroll{x: Number}有可能错位,即出现白色垂直空隙或者重复边框,所以设置为max-content(还有一种办法是使其中一列不设置width属性,但在此处不合适)。
|
|
1089
1089
|
selectConfig: undefined //下拉筛选
|
|
1090
1090
|
};
|
|
@@ -1094,7 +1094,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1094
1094
|
|
|
1095
1095
|
this.existHightSearchTableSelect = function () {
|
|
1096
1096
|
return _this4.state.params.columns.some(function (item) {
|
|
1097
|
-
return item.searchType ===
|
|
1097
|
+
return item.searchType === "select" && !item.sign && !item.dmbz;
|
|
1098
1098
|
});
|
|
1099
1099
|
};
|
|
1100
1100
|
|
|
@@ -1182,17 +1182,17 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1182
1182
|
if (!height) return;
|
|
1183
1183
|
var boxDom = document.getElementsByClassName(_this4.state.className)[0];
|
|
1184
1184
|
if (boxDom) {
|
|
1185
|
-
var tableDom = boxDom.querySelector(
|
|
1186
|
-
var placeholderDom = boxDom.querySelector(
|
|
1185
|
+
var tableDom = boxDom.querySelector(".ant-table .ant-table-body");
|
|
1186
|
+
var placeholderDom = boxDom.querySelector(".ant-table .ant-table-placeholder");
|
|
1187
1187
|
if (tableDom) {
|
|
1188
|
-
tableDom.style.minHeight = height +
|
|
1188
|
+
tableDom.style.minHeight = height + "px";
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
1191
1191
|
};
|
|
1192
1192
|
|
|
1193
1193
|
this.ansysParams = function (func) {
|
|
1194
1194
|
//先从缓存中获取配置信息,如果再缓存中没有配置信息则说明配置时在前端书写
|
|
1195
|
-
var paramsStr = sessionStorage.getItem(
|
|
1195
|
+
var paramsStr = sessionStorage.getItem("nhParams");
|
|
1196
1196
|
var params = undefined;
|
|
1197
1197
|
if (paramsStr != undefined) {
|
|
1198
1198
|
var params1 = JSON.parse(paramsStr);
|
|
@@ -1206,14 +1206,14 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1206
1206
|
params = tableParam;
|
|
1207
1207
|
} else {
|
|
1208
1208
|
var t = new Date().getTime();
|
|
1209
|
-
(0, _NHFetch2.default)(_this4.props.baseUrl +
|
|
1209
|
+
(0, _NHFetch2.default)(_this4.props.baseUrl + "/proData/queryAllConfig", "GET", t).then(function (res) {
|
|
1210
1210
|
if (res && res.code === 200) {
|
|
1211
1211
|
var _tableParam = res.data.table[_this4.props.sign];
|
|
1212
1212
|
if (_tableParam) {
|
|
1213
1213
|
sessionStorage.setItem(_this4.props.sign, (0, _stringify2.default)(_tableParam));
|
|
1214
1214
|
_this4.ansysParams(func);
|
|
1215
1215
|
} else {
|
|
1216
|
-
console.warn(
|
|
1216
|
+
console.warn("无法获取" + _this4.props.sign + "配置");
|
|
1217
1217
|
}
|
|
1218
1218
|
}
|
|
1219
1219
|
});
|
|
@@ -1223,21 +1223,21 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
if (params != undefined) {
|
|
1225
1225
|
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 ===
|
|
1226
|
+
params.checkbox = _this4.props.checkbox !== undefined ? _this4.props.checkbox : params.checkbox === "true" || params.checkbox === "" || params.checkbox === undefined ? true : false;
|
|
1227
|
+
params.autoHeightFlag = _this4.props.autoHeightFlag !== undefined ? _this4.props.autoHeightFlag : params.autoHeightFlag === "false" || params.autoHeightFlag === "" || params.autoHeightFlag === undefined ? false : true;
|
|
1228
|
+
params.footerFlag = _this4.props.footerFlag !== undefined ? _this4.props.footerFlag : params.footerFlag === "true" || params.footerFlag === "" || params.footerFlag === undefined ? true : false;
|
|
1229
|
+
params.searchDivFlag = _this4.props.searchDivFlag !== undefined ? _this4.props.searchDivFlag : params.searchDivFlag === "true" || params.searchDivFlag === "" || params.searchDivFlag === undefined ? true : false;
|
|
1230
|
+
params.defaultExpandAllRows = _this4.props.defaultExpandAllRows !== undefined ? _this4.props.defaultExpandAllRows : params.defaultExpandAllRows === "false" || params.defaultExpandAllRows === "" || params.defaultExpandAllRows === undefined ? false : true;
|
|
1231
1231
|
// 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 ===
|
|
1232
|
+
params.bordered = _this4.props.bordered !== undefined ? _this4.props.bordered : params.bordered === "true" /* || params.bordered === '' || params.bordered === undefined */
|
|
1233
1233
|
? 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 ===
|
|
1234
|
+
params.titleHeight = _this4.props.titleHeight !== undefined ? _this4.props.titleHeight : params.titleHeight === "" || params.titleHeight === undefined ? 40 : params.titleHeight;
|
|
1235
|
+
params.showHeader = _this4.props.showHeader !== undefined ? _this4.props.showHeader : params.showHeader === "true" || params.showHeader === "" || params.showHeader === undefined ? true : false;
|
|
1236
|
+
params.url = _this4.props.url !== undefined ? _this4.props.url : params.url === "" ? undefined : params.url;
|
|
1237
|
+
params.rangeFilter = _this4.props.rangeFilter !== undefined ? _this4.props.rangeFilter : params.rangeFilter === "false" || params.rangeFilter === "" || params.rangeFilter === undefined ? false : true;
|
|
1238
1238
|
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 ===
|
|
1239
|
+
params.isDefaultLoadData = _this4.props.isDefaultLoadData !== undefined ? _this4.props.isDefaultLoadData : params.isDefaultLoadData === "true" || params.isDefaultLoadData === "" || params.isDefaultLoadData === undefined ? true : false;
|
|
1240
|
+
params.searchDefaultField = _this4.props.searchDefaultField !== undefined ? _this4.props.searchDefaultField : params.searchDefaultField === "" ? undefined : params.searchDefaultField;
|
|
1241
1241
|
params.columns = _this4.props.columns !== undefined ? _this4.props.columns : params.columns;
|
|
1242
1242
|
params.columns = params.columns !== undefined ? params.columns : [];
|
|
1243
1243
|
params.columnsAfterFixed = params.columns; //备份columns
|
|
@@ -1307,12 +1307,12 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1307
1307
|
var commonSearchMap = {};
|
|
1308
1308
|
//循环判断哪些字段需要通用查询的搜索条件
|
|
1309
1309
|
if (params.searchDivFlag !== false) {
|
|
1310
|
-
if (params.searchDefaultField === undefined || params.searchDefaultField ===
|
|
1311
|
-
var tySearchAllField =
|
|
1310
|
+
if (params.searchDefaultField === undefined || params.searchDefaultField === "") {
|
|
1311
|
+
var tySearchAllField = ""; //自定义查询的所有字段
|
|
1312
1312
|
var columns = params.columns;
|
|
1313
1313
|
columns.map(function (item) {
|
|
1314
|
-
if (item.commonSearch !== false && item.commonSearch !=
|
|
1315
|
-
tySearchAllField +=
|
|
1314
|
+
if (item.commonSearch !== false && item.commonSearch != "false" && item.title !== "序号" && item.title !== "操作") {
|
|
1315
|
+
tySearchAllField += "," + item.dataIndex.toLowerCase();
|
|
1316
1316
|
}
|
|
1317
1317
|
return item;
|
|
1318
1318
|
});
|
|
@@ -1338,9 +1338,9 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1338
1338
|
titleHeight = 0;
|
|
1339
1339
|
}
|
|
1340
1340
|
var $table = document.getElementsByClassName(_this4.state.className)[0];
|
|
1341
|
-
if ($table && $table.getElementsByClassName(
|
|
1341
|
+
if ($table && $table.getElementsByClassName("ant-table-header")[0]) {
|
|
1342
1342
|
// 获取表格头部的高度 防止头部标题换行导致页码溢出
|
|
1343
|
-
titleHeight = $table.getElementsByClassName(
|
|
1343
|
+
titleHeight = $table.getElementsByClassName("ant-table-header")[0].offsetHeight;
|
|
1344
1344
|
}
|
|
1345
1345
|
var reduceHeight = 40 + titleHeight;
|
|
1346
1346
|
if (_this4.state.params.footerFlag === false) {
|
|
@@ -1354,7 +1354,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1354
1354
|
});
|
|
1355
1355
|
}
|
|
1356
1356
|
|
|
1357
|
-
var colSpanDom = document.getElementsByClassName(_this4.state.className)[0] ? document.getElementsByClassName(_this4.state.className)[0].querySelectorAll(
|
|
1357
|
+
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
1358
|
if (colSpanDom && colSpanDom.length > 0 && !_this4.props.bordered) {
|
|
1359
1359
|
// 存在二级表头的内容
|
|
1360
1360
|
for (var i = 0; i < colSpanDom.length; i++) {
|
|
@@ -1362,13 +1362,13 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1362
1362
|
var prevEle = getNearEle(nowEle, 1); //上一节点
|
|
1363
1363
|
var nextEle = getNearEle(nowEle, 0); //下一节点
|
|
1364
1364
|
if (nowEle) {
|
|
1365
|
-
nowEle.style.borderBottom =
|
|
1365
|
+
nowEle.style.borderBottom = "1px solid #e8e8e8";
|
|
1366
1366
|
}
|
|
1367
1367
|
if (prevEle) {
|
|
1368
|
-
prevEle.style.borderRight =
|
|
1368
|
+
prevEle.style.borderRight = "1px solid #e8e8e8";
|
|
1369
1369
|
}
|
|
1370
1370
|
if (nextEle) {
|
|
1371
|
-
nextEle.style.borderLeft =
|
|
1371
|
+
nextEle.style.borderLeft = "1px solid #e8e8e8";
|
|
1372
1372
|
}
|
|
1373
1373
|
}
|
|
1374
1374
|
}
|
|
@@ -1381,45 +1381,45 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1381
1381
|
if (!err) {
|
|
1382
1382
|
for (var key in values) {
|
|
1383
1383
|
if (values[key]) {
|
|
1384
|
-
if (key.endsWith(
|
|
1384
|
+
if (key.endsWith("_date")) {
|
|
1385
1385
|
if (values[key] && values[key].length > 0) {
|
|
1386
|
-
searchParams[key.replace(
|
|
1387
|
-
searchParams[key.replace(
|
|
1386
|
+
searchParams[key.replace("date", "LTEQ")] = values[key][1].valueOf();
|
|
1387
|
+
searchParams[key.replace("date", "GTEQ")] = values[key][0].valueOf();
|
|
1388
1388
|
} else {
|
|
1389
|
-
delete searchParams[key.replace(
|
|
1390
|
-
delete searchParams[key.replace(
|
|
1389
|
+
delete searchParams[key.replace("date", "LTEQ")];
|
|
1390
|
+
delete searchParams[key.replace("date", "GTEQ")];
|
|
1391
1391
|
}
|
|
1392
|
-
} else if (key.endsWith(
|
|
1392
|
+
} else if (key.endsWith("_dateRange")) {
|
|
1393
1393
|
if (values[key] && values[key].length > 0) {
|
|
1394
|
-
searchParams[key.replace(key,
|
|
1395
|
-
searchParams[key.replace(key,
|
|
1394
|
+
searchParams[key.replace(key, "D_KSSJ_GTEQ")] = values[key][0].valueOf(); //开始时间
|
|
1395
|
+
searchParams[key.replace(key, "D_JSSJ_LTEQ")] = values[key][1].valueOf(); //结束时间
|
|
1396
1396
|
} else {
|
|
1397
1397
|
delete searchParams[key];
|
|
1398
1398
|
delete searchParams[key];
|
|
1399
1399
|
}
|
|
1400
|
-
} else if (key.endsWith(
|
|
1400
|
+
} else if (key.endsWith("_dateTimeRange")) {
|
|
1401
1401
|
if (values[key] && values[key].length > 0) {
|
|
1402
|
-
searchParams[key.replace(key,
|
|
1403
|
-
searchParams[key.replace(key,
|
|
1402
|
+
searchParams[key.replace(key, "DT_KSSJ_GTEQ")] = values[key][0].valueOf(); //开始时间
|
|
1403
|
+
searchParams[key.replace(key, "DT_JSSJ_LTEQ")] = values[key][1].valueOf(); //结束时间
|
|
1404
1404
|
} else {
|
|
1405
1405
|
delete searchParams[key];
|
|
1406
1406
|
delete searchParams[key];
|
|
1407
1407
|
}
|
|
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() !==
|
|
1408
|
+
} else if (key.endsWith("_time_start")) {
|
|
1409
|
+
searchParams[key.replace("time_start", "GTEQ")] = values[key].valueOf();
|
|
1410
|
+
} else if (key.endsWith("_time_end")) {
|
|
1411
|
+
searchParams[key.replace("time_end", "LTEQ")] = values[key].valueOf();
|
|
1412
|
+
} else if (key.endsWith("_number_start")) {
|
|
1413
|
+
searchParams[key.replace("number_start", "GTEQ")] = values[key].valueOf();
|
|
1414
|
+
} else if (key.endsWith("_number_end")) {
|
|
1415
|
+
searchParams[key.replace("number_end", "LTEQ")] = values[key].valueOf();
|
|
1416
|
+
} else if (key.startsWith("S") && !key.endsWith("_IN")) {
|
|
1417
|
+
if (values[key].trim() !== "") {
|
|
1418
1418
|
searchParams[key] = values[key].trim();
|
|
1419
1419
|
} else {
|
|
1420
1420
|
delete searchParams[key];
|
|
1421
1421
|
}
|
|
1422
|
-
} else if (key.endsWith(
|
|
1422
|
+
} else if (key.endsWith("_IN")) {
|
|
1423
1423
|
if (values[key] && values[key].length > 0) {
|
|
1424
1424
|
searchParams[key] = values[key];
|
|
1425
1425
|
} else {
|
|
@@ -1429,14 +1429,14 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1429
1429
|
searchParams[key] = values[key];
|
|
1430
1430
|
}
|
|
1431
1431
|
} 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(
|
|
1432
|
+
if (key.endsWith("_time_start")) {
|
|
1433
|
+
delete searchParams[key.replace("time_start", "GTEQ")];
|
|
1434
|
+
} else if (key.endsWith("_time_end")) {
|
|
1435
|
+
delete searchParams[key.replace("time_end", "LTEQ")];
|
|
1436
|
+
} else if (key.endsWith("_number_start")) {
|
|
1437
|
+
delete searchParams[key.replace("number_start", "GTEQ")];
|
|
1438
|
+
} else if (key.endsWith("_number_end")) {
|
|
1439
|
+
delete searchParams[key.replace("number_end", "LTEQ")];
|
|
1440
1440
|
} else {
|
|
1441
1441
|
delete searchParams[key];
|
|
1442
1442
|
}
|
|
@@ -1444,32 +1444,22 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1444
1444
|
}
|
|
1445
1445
|
}
|
|
1446
1446
|
});
|
|
1447
|
-
_this4.setState({ searchParams: searchParams },
|
|
1448
|
-
return _this4.filterTableData();
|
|
1449
|
-
});
|
|
1447
|
+
_this4.setState({ searchParams: searchParams }, _this4.filterTableData);
|
|
1450
1448
|
};
|
|
1451
1449
|
|
|
1452
1450
|
this.onSearch = function () {
|
|
1453
1451
|
// 去除英文引号
|
|
1454
1452
|
var searchText = _this4.state.searchText;
|
|
1455
1453
|
|
|
1456
|
-
_this4.
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
},
|
|
1466
|
-
data: [],
|
|
1467
|
-
resetData: true
|
|
1468
|
-
}, _this4.filterTableData);
|
|
1469
|
-
} else {
|
|
1470
|
-
_this4.filterTableData();
|
|
1471
|
-
}
|
|
1472
|
-
});
|
|
1454
|
+
if (_this4.props.loadMore) {
|
|
1455
|
+
_this4.setState({
|
|
1456
|
+
searchText: searchText ? searchText.replace("'", "") : searchText,
|
|
1457
|
+
data: [],
|
|
1458
|
+
resetData: true
|
|
1459
|
+
}, _this4.filterTableData);
|
|
1460
|
+
} else {
|
|
1461
|
+
_this4.filterTableData();
|
|
1462
|
+
}
|
|
1473
1463
|
};
|
|
1474
1464
|
|
|
1475
1465
|
this.onRest = function () {
|
|
@@ -1480,20 +1470,15 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1480
1470
|
// searchParams: { ...quickSearcParams, ...this.props.searchParams }, //自定义的搜索条件
|
|
1481
1471
|
searchParams: (0, _extends3.default)({}, _this4.props.searchParams), //自定义的搜索条件
|
|
1482
1472
|
searchTextMap: {}, //下拉框查询的值,用作查询
|
|
1483
|
-
searchText:
|
|
1473
|
+
searchText: "",
|
|
1484
1474
|
searchField: _this4.state.tySearchAllField,
|
|
1485
|
-
selectValue:
|
|
1475
|
+
selectValue: "all",
|
|
1486
1476
|
filters: {}, //多选方式过滤的值
|
|
1487
1477
|
sorter: {}, //排序字段
|
|
1488
1478
|
data: [],
|
|
1489
1479
|
resetData: true,
|
|
1490
1480
|
selectedRows: [], //选中的数据
|
|
1491
|
-
selectedRowKeys: []
|
|
1492
|
-
pageData: {
|
|
1493
|
-
total: _this4.state.pageData.total,
|
|
1494
|
-
pageSize: _this4.state.pageData.pageSize,
|
|
1495
|
-
page: 1
|
|
1496
|
-
}
|
|
1481
|
+
selectedRowKeys: [] //选中的数据的主键loading
|
|
1497
1482
|
};
|
|
1498
1483
|
}, function () {
|
|
1499
1484
|
_this4.filterTableData();
|
|
@@ -1505,8 +1490,8 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1505
1490
|
this.filterTableData = function () {
|
|
1506
1491
|
_this4.setState({
|
|
1507
1492
|
pageData: {
|
|
1508
|
-
total:
|
|
1509
|
-
pageSize: _this4.
|
|
1493
|
+
total: _this4.state.pageData.total,
|
|
1494
|
+
pageSize: _this4.state.pageData.pageSize,
|
|
1510
1495
|
page: 1
|
|
1511
1496
|
}
|
|
1512
1497
|
}, function () {
|
|
@@ -1544,7 +1529,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1544
1529
|
this.readTableData = function (flag) {
|
|
1545
1530
|
var params = _this4.getFilterParams();
|
|
1546
1531
|
_this4.setState({ loading: true });
|
|
1547
|
-
var baseUrl = _this4.props.baseUrl || window.baseUrl ||
|
|
1532
|
+
var baseUrl = _this4.props.baseUrl || window.baseUrl || "";
|
|
1548
1533
|
var _props2 = _this4.props,
|
|
1549
1534
|
sign = _props2.sign,
|
|
1550
1535
|
mockDataSource = _props2.mockDataSource;
|
|
@@ -1570,11 +1555,11 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1570
1555
|
_this4.tableHeaderScrollListener(); // 判断是否需要显示滚动条
|
|
1571
1556
|
});
|
|
1572
1557
|
} else {
|
|
1573
|
-
var url = _this4.state.params.url ? _this4.state.params.url : baseUrl +
|
|
1558
|
+
var url = _this4.state.params.url ? _this4.state.params.url : baseUrl + "/proData/gridList";
|
|
1574
1559
|
// if (flag && this.props.columns) {
|
|
1575
1560
|
// this.adjustColumnWidth(); // 先进行调整,否则表头内容都会挤到一起
|
|
1576
1561
|
// }
|
|
1577
|
-
(0, _NHFetch2.default)(url,
|
|
1562
|
+
(0, _NHFetch2.default)(url, "POST", params).then(function (res) {
|
|
1578
1563
|
var height = _this4.state.height;
|
|
1579
1564
|
|
|
1580
1565
|
if (res) {
|
|
@@ -1617,7 +1602,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1617
1602
|
|
|
1618
1603
|
this.getHightSearchData = function (callback) {
|
|
1619
1604
|
var params = _this4.getFilterParams();
|
|
1620
|
-
var baseUrl = _this4.props.baseUrl || window.baseUrl ||
|
|
1605
|
+
var baseUrl = _this4.props.baseUrl || window.baseUrl || "";
|
|
1621
1606
|
params.pagination = {
|
|
1622
1607
|
page: 1,
|
|
1623
1608
|
pageSize: 1 << 31 - 1
|
|
@@ -1634,22 +1619,22 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1634
1619
|
hightSearchData: mockDataSource || [],
|
|
1635
1620
|
highSearchFetching: false
|
|
1636
1621
|
}, function () {
|
|
1637
|
-
callback && typeof callback ===
|
|
1622
|
+
callback && typeof callback === "function" && callback();
|
|
1638
1623
|
});
|
|
1639
1624
|
}, 500);
|
|
1640
1625
|
} else {
|
|
1641
|
-
var url = _this4.state.params.url ? _this4.state.params.url : baseUrl +
|
|
1642
|
-
(0, _NHFetch2.default)(url,
|
|
1626
|
+
var url = _this4.state.params.url ? _this4.state.params.url : baseUrl + "/proData/gridList";
|
|
1627
|
+
(0, _NHFetch2.default)(url, "POST", params).then(function (res) {
|
|
1643
1628
|
if (res) {
|
|
1644
1629
|
_this4.setState({
|
|
1645
1630
|
hightSearchData: res.data ? res.data.list : [],
|
|
1646
1631
|
highSearchFetching: false
|
|
1647
1632
|
}, function () {
|
|
1648
|
-
callback && typeof callback ===
|
|
1633
|
+
callback && typeof callback === "function" && callback();
|
|
1649
1634
|
});
|
|
1650
1635
|
}
|
|
1651
1636
|
}).catch(function (res) {
|
|
1652
|
-
console.log(
|
|
1637
|
+
console.log("高级搜索异常:", res);
|
|
1653
1638
|
});
|
|
1654
1639
|
}
|
|
1655
1640
|
};
|
|
@@ -1686,10 +1671,11 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1686
1671
|
sqlParams: sqlParams,
|
|
1687
1672
|
initParams: initParams,
|
|
1688
1673
|
sign: _this4.props.sign
|
|
1674
|
+
};
|
|
1689
1675
|
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
var userId = (0, _NHCore.getLoginUser)() ? (0, _NHCore.getLoginUser)().userId :
|
|
1676
|
+
//如果启用职位范围过滤
|
|
1677
|
+
if (rangeFilter) {
|
|
1678
|
+
var userId = (0, _NHCore.getLoginUser)() ? (0, _NHCore.getLoginUser)().userId : "";
|
|
1693
1679
|
params.rangeFilter = { id: userId };
|
|
1694
1680
|
}
|
|
1695
1681
|
if (rangeFilterList) {
|
|
@@ -1728,43 +1714,43 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1728
1714
|
var columns = _this4.nhExpExcel.state.targetKeys;
|
|
1729
1715
|
var excelName = _this4.nhExpExcel.state.excelName;
|
|
1730
1716
|
if (!columns || columns.length <= 0) {
|
|
1731
|
-
_message3.default.info(
|
|
1717
|
+
_message3.default.info("请选择需要导出的列!");
|
|
1732
1718
|
stopLoading();
|
|
1733
1719
|
return;
|
|
1734
1720
|
}
|
|
1735
1721
|
if (!excelName) {
|
|
1736
|
-
_message3.default.info(
|
|
1722
|
+
_message3.default.info("文件名不能为空");
|
|
1737
1723
|
stopLoading();
|
|
1738
1724
|
return;
|
|
1739
1725
|
}
|
|
1740
1726
|
var columnsMap = {};
|
|
1741
1727
|
for (var i = 0; i < columns.length; i++) {
|
|
1742
|
-
var c = columns[i].split(
|
|
1728
|
+
var c = columns[i].split("@");
|
|
1743
1729
|
columnsMap[c[0]] = c[1];
|
|
1744
1730
|
}
|
|
1745
1731
|
var total = _this4.state.pageData.total;
|
|
1746
1732
|
params.columnsMap = columnsMap;
|
|
1747
1733
|
params.excelName = excelName;
|
|
1748
1734
|
if (total < 40000) {
|
|
1749
|
-
var baseUrl = _this4.props.baseUrl || window.baseUrl ||
|
|
1750
|
-
var exportExcelCacheDataUrl = _this4.props.exportExcelCacheDataUrl ||
|
|
1751
|
-
var cacheDataUrl = exportExcelCacheDataUrl ? exportExcelCacheDataUrl :
|
|
1752
|
-
(0, _NHFetch2.default)(baseUrl + cacheDataUrl,
|
|
1735
|
+
var baseUrl = _this4.props.baseUrl || window.baseUrl || "";
|
|
1736
|
+
var exportExcelCacheDataUrl = _this4.props.exportExcelCacheDataUrl || "";
|
|
1737
|
+
var cacheDataUrl = exportExcelCacheDataUrl ? exportExcelCacheDataUrl : "/proData/gridList/excel/params";
|
|
1738
|
+
(0, _NHFetch2.default)(baseUrl + cacheDataUrl, "POST", params).then(function (res) {
|
|
1753
1739
|
if (res) {
|
|
1754
1740
|
if (!res.data) {
|
|
1755
|
-
_message3.default.info(
|
|
1741
|
+
_message3.default.info("请刷新浏览器,重新再执行此操作!");
|
|
1756
1742
|
stopLoading();
|
|
1757
1743
|
return;
|
|
1758
1744
|
}
|
|
1759
1745
|
// 本地
|
|
1760
|
-
window.open(baseUrl +
|
|
1746
|
+
window.open(baseUrl + "/proData/gridList/excel/export?uuid=" + res.data, "_blank");
|
|
1761
1747
|
}
|
|
1762
1748
|
stopLoading();
|
|
1763
1749
|
}).catch(function (err) {
|
|
1764
1750
|
return stopLoading();
|
|
1765
1751
|
});
|
|
1766
1752
|
} else {
|
|
1767
|
-
_message3.default.warn(
|
|
1753
|
+
_message3.default.warn("最大的导出数量为40000,当前导出数据量过大,无法执行导出操作!");
|
|
1768
1754
|
stopLoading();
|
|
1769
1755
|
return;
|
|
1770
1756
|
}
|
|
@@ -1772,9 +1758,9 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1772
1758
|
|
|
1773
1759
|
this.encodeSql = function (params) {
|
|
1774
1760
|
for (var key in params) {
|
|
1775
|
-
if (key.toUpperCase().startsWith(
|
|
1761
|
+
if (key.toUpperCase().startsWith("SQL_") && params[key]) {
|
|
1776
1762
|
params[key] = params[key];
|
|
1777
|
-
} else if (key.toUpperCase().startsWith(
|
|
1763
|
+
} else if (key.toUpperCase().startsWith("G_") && params[key]) {
|
|
1778
1764
|
params[key] = _this4.encodeSql(params[key]);
|
|
1779
1765
|
}
|
|
1780
1766
|
}
|
|
@@ -1789,7 +1775,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1789
1775
|
if (queryValue && _this4.state.searchField) {
|
|
1790
1776
|
var quickSearcParams = (0, _extends3.default)({}, _this4.state.quickSearcParams);
|
|
1791
1777
|
var searchParams = (0, _extends3.default)({}, quickSearcParams);
|
|
1792
|
-
searchParams[_this4.state.searchField] = queryValue.replace("'",
|
|
1778
|
+
searchParams[_this4.state.searchField] = queryValue.replace("'", "");
|
|
1793
1779
|
_this4.setState({
|
|
1794
1780
|
searchParams: searchParams
|
|
1795
1781
|
});
|
|
@@ -1823,8 +1809,8 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1823
1809
|
|
|
1824
1810
|
this.isIE = function () {
|
|
1825
1811
|
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
|
|
1826
|
-
var isIE = userAgent.indexOf(
|
|
1827
|
-
var isIE11 = userAgent.indexOf(
|
|
1812
|
+
var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
|
|
1813
|
+
var isIE11 = userAgent.indexOf("Trident") > -1 && userAgent.indexOf("rv:11.0") > -1;
|
|
1828
1814
|
if (isIE || isIE11) {
|
|
1829
1815
|
return true;
|
|
1830
1816
|
} else return false;
|
|
@@ -1835,11 +1821,11 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1835
1821
|
width = props.width,
|
|
1836
1822
|
minWidth = props.minWidth,
|
|
1837
1823
|
_onClick = props.onClick,
|
|
1838
|
-
restProps = (0, _objectWithoutProperties3.default)(props, [
|
|
1824
|
+
restProps = (0, _objectWithoutProperties3.default)(props, ["onResize", "width", "minWidth", "onClick"]);
|
|
1839
1825
|
var closeResizeableTitle = _this4.props.closeResizeableTitle;
|
|
1840
1826
|
|
|
1841
1827
|
if (closeResizeableTitle) {
|
|
1842
|
-
return _react2.default.createElement(
|
|
1828
|
+
return _react2.default.createElement("th", restProps);
|
|
1843
1829
|
} else {
|
|
1844
1830
|
return _react2.default.createElement(
|
|
1845
1831
|
_reactResizable.Resizable,
|
|
@@ -1879,7 +1865,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1879
1865
|
},
|
|
1880
1866
|
draggableOpts: { enableUserSelectHack: false }
|
|
1881
1867
|
},
|
|
1882
|
-
_react2.default.createElement(
|
|
1868
|
+
_react2.default.createElement("th", (0, _extends3.default)({
|
|
1883
1869
|
onClick: function onClick() {
|
|
1884
1870
|
if (!_this4.resizing && _onClick) {
|
|
1885
1871
|
_onClick.apply(undefined, arguments);
|
|
@@ -1897,14 +1883,14 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1897
1883
|
{
|
|
1898
1884
|
onScroll: _this4.onScroll,
|
|
1899
1885
|
autoHide: true,
|
|
1900
|
-
style: { width:
|
|
1886
|
+
style: { width: "100%" },
|
|
1901
1887
|
autoHeight: true,
|
|
1902
1888
|
autoHeightMin: 0,
|
|
1903
1889
|
autoHeightMax: _this4.state.height,
|
|
1904
1890
|
thumbMinSize: 30,
|
|
1905
1891
|
universal: true
|
|
1906
1892
|
},
|
|
1907
|
-
_react2.default.createElement(
|
|
1893
|
+
_react2.default.createElement("table", props)
|
|
1908
1894
|
);
|
|
1909
1895
|
}
|
|
1910
1896
|
};
|
|
@@ -1914,33 +1900,33 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1914
1900
|
var scrollLeft = e1.target.scrollLeft;
|
|
1915
1901
|
var scrollTop = e1.target.scrollTop;
|
|
1916
1902
|
var $parentObj = e1.target.parentNode.parentNode;
|
|
1917
|
-
var obj = $parentObj.classList.contains(
|
|
1918
|
-
if (obj ===
|
|
1919
|
-
obj = $parentObj.parentNode.parentNode.classList.contains(
|
|
1903
|
+
var obj = $parentObj.classList.contains("ant-table-body") ? "content" : "none";
|
|
1904
|
+
if (obj === "none") {
|
|
1905
|
+
obj = $parentObj.parentNode.parentNode.classList.contains("ant-table-fixed-left") ? "left" : "right";
|
|
1920
1906
|
}
|
|
1921
1907
|
|
|
1922
1908
|
//头部对象
|
|
1923
1909
|
var $table = document.getElementsByClassName(_this4.state.className)[0];
|
|
1924
|
-
var $header = $table.getElementsByClassName(
|
|
1910
|
+
var $header = $table.getElementsByClassName("ant-table-scroll")[0].getElementsByClassName("ant-table-header")[0];
|
|
1925
1911
|
$header.scrollLeft = scrollLeft;
|
|
1926
1912
|
//中间内容区
|
|
1927
|
-
var $content = $table.getElementsByClassName(
|
|
1928
|
-
if (obj !==
|
|
1913
|
+
var $content = $table.getElementsByClassName("ant-table-scroll")[0].getElementsByClassName("ant-table-body")[0].childNodes[0].childNodes[0];
|
|
1914
|
+
if (obj !== "content" && $content.scrollTop !== scrollTop) {
|
|
1929
1915
|
loadCount++;
|
|
1930
1916
|
$content.scrollTop = scrollTop;
|
|
1931
1917
|
}
|
|
1932
1918
|
//左部固定内容区
|
|
1933
|
-
if ($table.getElementsByClassName(
|
|
1934
|
-
var $left = $table.getElementsByClassName(
|
|
1935
|
-
if ($left && obj !==
|
|
1919
|
+
if ($table.getElementsByClassName("ant-table-fixed-left")[0]) {
|
|
1920
|
+
var $left = $table.getElementsByClassName("ant-table-fixed-left")[0].getElementsByClassName("ant-table-body-inner")[0].childNodes[0].childNodes[0];
|
|
1921
|
+
if ($left && obj !== "left" && $left.scrollTop !== scrollTop) {
|
|
1936
1922
|
loadCount++;
|
|
1937
1923
|
$left.scrollTop = scrollTop;
|
|
1938
1924
|
}
|
|
1939
1925
|
}
|
|
1940
1926
|
//右部固定内容区
|
|
1941
|
-
if ($table.getElementsByClassName(
|
|
1942
|
-
var $right = $table.getElementsByClassName(
|
|
1943
|
-
if ($right && obj !==
|
|
1927
|
+
if ($table.getElementsByClassName("ant-table-fixed-right")[0]) {
|
|
1928
|
+
var $right = $table.getElementsByClassName("ant-table-fixed-right")[0].getElementsByClassName("ant-table-body-inner")[0].childNodes[0].childNodes[0];
|
|
1929
|
+
if ($right && obj !== "right" && $right.scrollTop !== scrollTop) {
|
|
1944
1930
|
loadCount++;
|
|
1945
1931
|
$right.scrollTop = scrollTop;
|
|
1946
1932
|
}
|
|
@@ -1952,17 +1938,17 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1952
1938
|
|
|
1953
1939
|
this.handleRadioGroupChange = function (field, v, index) {
|
|
1954
1940
|
var quickSearcParams = (0, _extends3.default)({}, _this4.state.quickSearcParams);
|
|
1955
|
-
if (v ===
|
|
1941
|
+
if (v === "all") {
|
|
1956
1942
|
var searchParams = (0, _extends3.default)({}, _this4.state.searchParams);
|
|
1957
|
-
delete searchParams[field +
|
|
1958
|
-
delete quickSearcParams[field +
|
|
1943
|
+
delete searchParams[field + "_EQ"];
|
|
1944
|
+
delete quickSearcParams[field + "_EQ"];
|
|
1959
1945
|
_this4.setState({ searchParams: searchParams, quickSearcParams: quickSearcParams, selectValue: v }, function () {
|
|
1960
1946
|
return _this4.filterTableData();
|
|
1961
1947
|
});
|
|
1962
1948
|
} else {
|
|
1963
1949
|
var _searchParams = (0, _extends3.default)({}, _this4.state.searchParams);
|
|
1964
|
-
_searchParams[field +
|
|
1965
|
-
quickSearcParams[field +
|
|
1950
|
+
_searchParams[field + "_EQ"] = v;
|
|
1951
|
+
quickSearcParams[field + "_EQ"] = v;
|
|
1966
1952
|
_this4.setState({ searchParams: _searchParams, quickSearcParams: quickSearcParams, selectValue: v }, function () {
|
|
1967
1953
|
return _this4.filterTableData();
|
|
1968
1954
|
});
|
|
@@ -1975,7 +1961,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1975
1961
|
if (!err) {
|
|
1976
1962
|
for (var key in values) {
|
|
1977
1963
|
if (values[key]) {
|
|
1978
|
-
if (key.endsWith(
|
|
1964
|
+
if (key.endsWith("_IN")) {
|
|
1979
1965
|
if (values[key] && values[key].length > 0) {
|
|
1980
1966
|
searchParams[key] = values[key];
|
|
1981
1967
|
}
|
|
@@ -2061,15 +2047,15 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
2061
2047
|
var tableEle = document.getElementsByClassName(_this4.state.className);
|
|
2062
2048
|
if (tableEle.length > 0) {
|
|
2063
2049
|
// 获取空表格
|
|
2064
|
-
var emptyEle = tableEle[0].getElementsByClassName(
|
|
2050
|
+
var emptyEle = tableEle[0].getElementsByClassName("ant-table-empty");
|
|
2065
2051
|
if (emptyEle.length > 0) {
|
|
2066
2052
|
var topWidth = 0;
|
|
2067
2053
|
var tableWidth = 0;
|
|
2068
2054
|
// 获取空表格表头容器
|
|
2069
|
-
var headerEle = emptyEle[0].getElementsByClassName(
|
|
2055
|
+
var headerEle = emptyEle[0].getElementsByClassName("ant-table-header");
|
|
2070
2056
|
if (headerEle.length > 0) {
|
|
2071
2057
|
// 获取空表格表头内容
|
|
2072
|
-
var table = headerEle[0].getElementsByTagName(
|
|
2058
|
+
var table = headerEle[0].getElementsByTagName("table");
|
|
2073
2059
|
topWidth = headerEle[0].offsetWidth;
|
|
2074
2060
|
tableWidth = table[0].offsetWidth;
|
|
2075
2061
|
// 如果容器小于内容,说明需要滚动条
|