ns-base-module 2.0.5 → 2.0.6
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/dist/CopyCol/index.js +58 -11
- package/dist/FilterPopover/Filter.js +67 -32
- package/dist/FilterPopover/index.js +4 -0
- package/dist/TableHeaderConfigPopover/Dustbin.js +13 -4
- package/dist/TableHeaderConfigPopover/index.js +49 -19
- package/dist/TableHeaderConfigPopover/utils.js +2 -1
- package/dist/scroll/index.js +281 -0
- package/dist/scroll/stories/InfiniteScrollWithHeight.js +84 -0
- package/dist/scroll/stories/PullDownToRefreshInfScroll.js +83 -0
- package/dist/scroll/stories/ScrollableTargetInfScroll.js +78 -0
- package/dist/scroll/stories/ScrolleableTop.js +86 -0
- package/dist/scroll/stories/WindowInfiniteScrollComponent.js +68 -0
- package/dist/scroll/stories/stories.js +43 -0
- package/dist/scroll/utils/threshold.js +34 -0
- package/dist/umd/ns-base-module.min.css +1 -1
- package/dist/umd/ns-base-module.min.js +1 -1
- package/dist/utils/language.js +2 -1
- package/package.json +1 -1
- package/style/components/FilterPopover.scss +4 -0
package/dist/CopyCol/index.js
CHANGED
|
@@ -1,21 +1,41 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
1
7
|
import { CopyOutlined } from "@ant-design/icons";
|
|
2
8
|
import { message } from "antd";
|
|
3
9
|
import { get } from "lodash";
|
|
4
|
-
import React from "react";
|
|
10
|
+
import React, { useEffect, useState } from "react";
|
|
5
11
|
import { initLang } from "../utils/language";
|
|
6
12
|
var CopyCol = function CopyCol(_ref) {
|
|
7
13
|
var dataSource = _ref.dataSource,
|
|
8
14
|
dataIndex = _ref.dataIndex,
|
|
9
15
|
list = _ref.list;
|
|
16
|
+
var _useState = useState(),
|
|
17
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
+
dataSource_ = _useState2[0],
|
|
19
|
+
setDataSource_ = _useState2[1];
|
|
10
20
|
// 复制
|
|
21
|
+
|
|
22
|
+
useEffect(function () {
|
|
23
|
+
if (dataSource) {
|
|
24
|
+
setDataSource_(dataSource);
|
|
25
|
+
}
|
|
26
|
+
}, [JSON.stringify(dataSource)]);
|
|
11
27
|
var handleCopy = function handleCopy() {
|
|
12
28
|
try {
|
|
13
29
|
var str = "";
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
30
|
+
if (dataSource_) {
|
|
31
|
+
dataSource_ === null || dataSource_ === void 0 || dataSource_.forEach(function (item) {
|
|
32
|
+
if (typeof item === "string" || typeof item === "number") {
|
|
33
|
+
str = str ? "".concat(str, "\r\n").concat(item) : "".concat(item);
|
|
34
|
+
} else {
|
|
35
|
+
var val = get(item, dataIndex, "");
|
|
36
|
+
if (val && (typeof val === "string" || typeof val === "number")) {
|
|
37
|
+
str = str ? "".concat(str, "\r\n").concat(val) : "".concat(val);
|
|
38
|
+
}
|
|
19
39
|
}
|
|
20
40
|
});
|
|
21
41
|
}
|
|
@@ -31,17 +51,44 @@ var CopyCol = function CopyCol(_ref) {
|
|
|
31
51
|
message.warn("该类型不支持复制");
|
|
32
52
|
return;
|
|
33
53
|
}
|
|
34
|
-
navigator.clipboard
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
54
|
+
if (navigator.clipboard) {
|
|
55
|
+
navigator.clipboard.writeText(str).then(function () {
|
|
56
|
+
message.info("复制成功");
|
|
57
|
+
}).catch(function (err) {
|
|
58
|
+
message.error("复制失败");
|
|
59
|
+
});
|
|
60
|
+
} else {
|
|
61
|
+
fallbackCopyText(str);
|
|
62
|
+
}
|
|
39
63
|
} catch (error) {
|
|
40
64
|
message.error("复制失败");
|
|
41
65
|
}
|
|
42
66
|
};
|
|
67
|
+
var fallbackCopyText = function fallbackCopyText(text) {
|
|
68
|
+
var textArea = document.createElement("textarea");
|
|
69
|
+
textArea.value = text;
|
|
70
|
+
// 隐藏文本域(避免影响页面)
|
|
71
|
+
textArea.style.position = "fixed";
|
|
72
|
+
textArea.style.top = "-999px";
|
|
73
|
+
textArea.style.left = "-999px";
|
|
74
|
+
document.body.appendChild(textArea);
|
|
75
|
+
textArea.select(); // 选中内容
|
|
76
|
+
try {
|
|
77
|
+
var success = document.execCommand("copy");
|
|
78
|
+
if (success) {
|
|
79
|
+
message.info("复制成功");
|
|
80
|
+
}
|
|
81
|
+
} catch (err) {
|
|
82
|
+
message.error("复制失败");
|
|
83
|
+
} finally {
|
|
84
|
+
document.body.removeChild(textArea); // 清理 DOM
|
|
85
|
+
}
|
|
86
|
+
};
|
|
43
87
|
return /*#__PURE__*/React.createElement("span", {
|
|
44
88
|
className: "copy-icon-wrap",
|
|
89
|
+
style: {
|
|
90
|
+
display: "block"
|
|
91
|
+
},
|
|
45
92
|
onClick: function onClick() {
|
|
46
93
|
return handleCopy();
|
|
47
94
|
}
|
|
@@ -21,10 +21,12 @@ import { ArrowDownOutlined, ArrowUpOutlined } from "@ant-design/icons";
|
|
|
21
21
|
import { Button, Divider } from "antd";
|
|
22
22
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
23
23
|
import InfiniteScroll from "react-infinite-scroll-component";
|
|
24
|
+
// import InfiniteScroll from "../sollr/index";
|
|
25
|
+
|
|
24
26
|
import Checkbox from "../Entry/components/Checkbox";
|
|
25
27
|
import Input from "../Entry/components/Input";
|
|
26
28
|
import CopyCol from "../CopyCol";
|
|
27
|
-
import { cloneDeep, find, flattenDeep, get } from "lodash";
|
|
29
|
+
import { cloneDeep, find, flattenDeep, get, isFunction } from "lodash";
|
|
28
30
|
import "../../style/components/FilterPopover.scss";
|
|
29
31
|
import { initLang } from "../utils/language";
|
|
30
32
|
// import request from "../utils/request";
|
|
@@ -52,6 +54,7 @@ var Filter = function Filter(props) {
|
|
|
52
54
|
menuCode = props.menuCode,
|
|
53
55
|
argument = props.argument,
|
|
54
56
|
request = props.request,
|
|
57
|
+
newRequest = props.newRequest,
|
|
55
58
|
open = props.open,
|
|
56
59
|
variablePara = props.variablePara,
|
|
57
60
|
exportAllParam = props.exportAllParam;
|
|
@@ -71,7 +74,7 @@ var Filter = function Filter(props) {
|
|
|
71
74
|
setSearchval = _useState6[1];
|
|
72
75
|
var searchValue = useRef("");
|
|
73
76
|
var searchEmnuValue = useRef([]); // 枚举搜索
|
|
74
|
-
|
|
77
|
+
var srolRef = useRef(null);
|
|
75
78
|
var page = useRef({
|
|
76
79
|
pageNum: 1,
|
|
77
80
|
pageSize: 40,
|
|
@@ -92,8 +95,8 @@ var Filter = function Filter(props) {
|
|
|
92
95
|
// 获取列表
|
|
93
96
|
var getDates = /*#__PURE__*/function () {
|
|
94
97
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
95
|
-
var _searchEmnuValue$curr
|
|
96
|
-
var _list, checkValues, _label, _searchArgument, params, res, datas, arr, _datas;
|
|
98
|
+
var _searchEmnuValue$curr;
|
|
99
|
+
var _list, checkValues, _label, _searchArgument, params, res, datas, _res, _res2, dataRow, arr, _datas;
|
|
97
100
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
98
101
|
while (1) switch (_context.prev = _context.next) {
|
|
99
102
|
case 0:
|
|
@@ -136,16 +139,45 @@ var Filter = function Filter(props) {
|
|
|
136
139
|
pageNum: page.current.pageNum,
|
|
137
140
|
pageSize: page.current.pageSize,
|
|
138
141
|
distinctField: [dataIndex],
|
|
139
|
-
variablePara: variablePara
|
|
142
|
+
variablePara: variablePara,
|
|
143
|
+
orderKey: orderKey,
|
|
144
|
+
orderType: orderType
|
|
140
145
|
};
|
|
141
|
-
|
|
146
|
+
res = {};
|
|
147
|
+
datas = [];
|
|
148
|
+
if (!isFunction(request)) {
|
|
149
|
+
_context.next = 18;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
_context.next = 14;
|
|
142
153
|
return request === null || request === void 0 ? void 0 : request("/querier/menu", {
|
|
143
154
|
method: "POST",
|
|
144
155
|
data: params
|
|
145
156
|
});
|
|
146
|
-
case
|
|
157
|
+
case 14:
|
|
147
158
|
res = _context.sent;
|
|
148
159
|
datas = get(res, "data.rows", []) || [];
|
|
160
|
+
setTotal((_res = res) === null || _res === void 0 || (_res = _res.data) === null || _res === void 0 ? void 0 : _res.total);
|
|
161
|
+
page.current.total = (_res2 = res) === null || _res2 === void 0 || (_res2 = _res2.data) === null || _res2 === void 0 ? void 0 : _res2.total;
|
|
162
|
+
case 18:
|
|
163
|
+
if (!isFunction(newRequest)) {
|
|
164
|
+
_context.next = 25;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
_context.next = 21;
|
|
168
|
+
return newRequest === null || newRequest === void 0 ? void 0 : newRequest({
|
|
169
|
+
url: "/api/querier/menu",
|
|
170
|
+
method: "POST",
|
|
171
|
+
data: _objectSpread(_objectSpread(_objectSpread({}, props === null || props === void 0 ? void 0 : props.requestOrderParam), params), {}, {
|
|
172
|
+
withFieldConfigs: false
|
|
173
|
+
})
|
|
174
|
+
});
|
|
175
|
+
case 21:
|
|
176
|
+
dataRow = _context.sent;
|
|
177
|
+
datas = get(dataRow, "rows", []) || [];
|
|
178
|
+
setTotal(dataRow === null || dataRow === void 0 ? void 0 : dataRow.total);
|
|
179
|
+
page.current.total = dataRow === null || dataRow === void 0 ? void 0 : dataRow.total;
|
|
180
|
+
case 25:
|
|
149
181
|
arr = [];
|
|
150
182
|
if (dataIndex) {
|
|
151
183
|
datas.map(function (d) {
|
|
@@ -170,9 +202,7 @@ var Filter = function Filter(props) {
|
|
|
170
202
|
setChecked([].concat(_toConsumableArray(checked), arr));
|
|
171
203
|
}
|
|
172
204
|
}
|
|
173
|
-
|
|
174
|
-
page.current.total = res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.total;
|
|
175
|
-
case 21:
|
|
205
|
+
case 31:
|
|
176
206
|
case "end":
|
|
177
207
|
return _context.stop();
|
|
178
208
|
}
|
|
@@ -184,23 +214,26 @@ var Filter = function Filter(props) {
|
|
|
184
214
|
}();
|
|
185
215
|
var updateOpen = useRef(false);
|
|
186
216
|
useEffect(function () {
|
|
187
|
-
|
|
188
|
-
|
|
217
|
+
console.log("updateOpen.currentupdateOpen.current:", open, argument, updateOpen.current);
|
|
218
|
+
|
|
219
|
+
// if (updateOpen.current === open) return;
|
|
220
|
+
// updateOpen.current = open; // 防止当前筛选被更新
|
|
189
221
|
|
|
190
222
|
if (open) {
|
|
191
223
|
// 半选状态 - 不刷新列表
|
|
192
|
-
if (!(checked.length > 0 && checked.length < list.length)) {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
224
|
+
// if (!(checked.length > 0 && checked.length < list.length)) {
|
|
225
|
+
page.current.pageNum = 1;
|
|
226
|
+
page.current.total = 20;
|
|
227
|
+
searchValue.current = "";
|
|
228
|
+
setSearchval("");
|
|
229
|
+
setList([]);
|
|
230
|
+
setChecked([]);
|
|
231
|
+
getDates();
|
|
232
|
+
// }
|
|
201
233
|
}
|
|
202
234
|
}, [dictItems, JSON.stringify(argument), open]);
|
|
203
235
|
var loadMoreData = function loadMoreData() {
|
|
236
|
+
console.log("jiahzihl");
|
|
204
237
|
if (page.current.pageNum * page.current.pageSize >= page.current.total) return;
|
|
205
238
|
page.current.pageNum = page.current.pageNum + 1;
|
|
206
239
|
getDates();
|
|
@@ -327,7 +360,11 @@ var Filter = function Filter(props) {
|
|
|
327
360
|
var searchListCheckBox = function searchListCheckBox() {
|
|
328
361
|
return searchList.map(function (item, index) {
|
|
329
362
|
return /*#__PURE__*/React.createElement("div", {
|
|
330
|
-
key: "".concat(item)
|
|
363
|
+
key: "".concat(item),
|
|
364
|
+
style: {
|
|
365
|
+
display: "block",
|
|
366
|
+
width: "100%"
|
|
367
|
+
}
|
|
331
368
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
332
369
|
value: item
|
|
333
370
|
}, item));
|
|
@@ -375,17 +412,13 @@ var Filter = function Filter(props) {
|
|
|
375
412
|
var handleSelectSearch = function handleSelectSearch() {
|
|
376
413
|
onSearch(selectValue);
|
|
377
414
|
};
|
|
378
|
-
|
|
379
|
-
// const hasEntryItem = useMemo(() => {
|
|
380
|
-
// return entryType && _TYPES.includes(entryType);
|
|
381
|
-
// }, [entryType]);
|
|
382
|
-
|
|
415
|
+
console.log("list.lengthlist.length:", list.length, dataIndex + "-" + "scrollableDiv");
|
|
383
416
|
return /*#__PURE__*/React.createElement("div", {
|
|
384
417
|
className: "filter-wrapper-body"
|
|
385
418
|
}, sort && /*#__PURE__*/React.createElement("div", {
|
|
386
419
|
className: "sort"
|
|
387
420
|
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(CopyCol, {
|
|
388
|
-
dataSource:
|
|
421
|
+
dataSource: searchList,
|
|
389
422
|
dataIndex: dataIndex
|
|
390
423
|
})), /*#__PURE__*/React.createElement("span", {
|
|
391
424
|
onClick: function onClick() {
|
|
@@ -420,26 +453,28 @@ var Filter = function Filter(props) {
|
|
|
420
453
|
}
|
|
421
454
|
}), /*#__PURE__*/React.createElement("div", {
|
|
422
455
|
className: "filter-group",
|
|
456
|
+
ref: srolRef,
|
|
423
457
|
id: "".concat(dataIndex, "-scrollableDiv")
|
|
424
|
-
}, /*#__PURE__*/React.createElement(InfiniteScroll, {
|
|
458
|
+
}, srolRef.current && /*#__PURE__*/React.createElement(InfiniteScroll, {
|
|
425
459
|
dataLength: list.length,
|
|
426
460
|
next: loadMoreData,
|
|
427
461
|
hasMore: page.current.pageNum * page.current.pageSize < total,
|
|
428
462
|
loader: /*#__PURE__*/React.createElement(Divider, {
|
|
429
463
|
plain: true,
|
|
430
464
|
style: {
|
|
431
|
-
margin:
|
|
465
|
+
margin: "10px 0"
|
|
432
466
|
}
|
|
433
467
|
}),
|
|
434
468
|
endMessage: /*#__PURE__*/React.createElement(Divider, {
|
|
435
469
|
plain: true,
|
|
436
470
|
style: {
|
|
437
|
-
margin:
|
|
471
|
+
margin: "10px 0"
|
|
438
472
|
}
|
|
439
473
|
})
|
|
440
474
|
// endMessage={<Divider plain>无更多数据</Divider>}
|
|
475
|
+
// scrollableTarget={`${dataIndex}-scrollableDiv`}
|
|
441
476
|
,
|
|
442
|
-
scrollableTarget:
|
|
477
|
+
scrollableTarget: srolRef.current
|
|
443
478
|
}, /*#__PURE__*/React.createElement(CheckboxGroup, {
|
|
444
479
|
value: checked,
|
|
445
480
|
onChange: onChange
|
|
@@ -87,6 +87,7 @@ var Index = function Index(_ref2) {
|
|
|
87
87
|
|
|
88
88
|
// 活动的icon显示
|
|
89
89
|
var visibilityStyle = useMemo(function () {
|
|
90
|
+
console.log("filterValuefilterValue:", filterValue);
|
|
90
91
|
var _value = get(props === null || props === void 0 ? void 0 : props.filterSearch, "".concat(dataIndex, ".value"), "");
|
|
91
92
|
if (!dataIndex) return null;
|
|
92
93
|
if (!_value) {
|
|
@@ -96,14 +97,17 @@ var Index = function Index(_ref2) {
|
|
|
96
97
|
}
|
|
97
98
|
if (orderKey !== null && orderKey !== void 0 && orderKey.includes(dataIndex)) return {
|
|
98
99
|
visibility: "visible",
|
|
100
|
+
display: "block",
|
|
99
101
|
color: "#06B50F"
|
|
100
102
|
};
|
|
101
103
|
if (searchFlag) return {
|
|
102
104
|
visibility: "visible",
|
|
105
|
+
display: "block",
|
|
103
106
|
color: "#06B50F"
|
|
104
107
|
};
|
|
105
108
|
return {
|
|
106
109
|
visibility: "visible",
|
|
110
|
+
display: "block",
|
|
107
111
|
color: "#06B50F"
|
|
108
112
|
};
|
|
109
113
|
}, [filterValue, list, dataIndex, orderKey, searchFlag, props.filterSearch]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["onChange", "showArrows"];
|
|
2
|
+
var _excluded = ["onChange", "showArrows", "isRoot"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -14,7 +14,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
14
14
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
16
|
import { HolderOutlined, VerticalAlignBottomOutlined, VerticalAlignMiddleOutlined, VerticalAlignTopOutlined } from "@ant-design/icons";
|
|
17
|
-
import { Slider, Tooltip } from "antd";
|
|
17
|
+
import { Slider, Switch, Tooltip } from "antd";
|
|
18
18
|
import React from "react";
|
|
19
19
|
import { useDrag, useDrop } from "react-dnd";
|
|
20
20
|
import "../../style/components/TableHeaderConfigPopover.scss";
|
|
@@ -40,6 +40,7 @@ var Box = function Box(_ref) {
|
|
|
40
40
|
var Dustbin = function Dustbin(_ref2) {
|
|
41
41
|
var _onChange = _ref2.onChange,
|
|
42
42
|
showArrows = _ref2.showArrows,
|
|
43
|
+
isRoot = _ref2.isRoot,
|
|
43
44
|
props = _objectWithoutProperties(_ref2, _excluded);
|
|
44
45
|
var item = props.item;
|
|
45
46
|
var _useDrop = useDrop({
|
|
@@ -83,7 +84,7 @@ var Dustbin = function Dustbin(_ref2) {
|
|
|
83
84
|
flex: 1
|
|
84
85
|
},
|
|
85
86
|
onChange: function onChange(e) {
|
|
86
|
-
return _onChange(e, item);
|
|
87
|
+
return _onChange(e, item, "width");
|
|
87
88
|
},
|
|
88
89
|
value: typeof item.width === "number" ? item.width : 0
|
|
89
90
|
}), /*#__PURE__*/React.createElement("span", {
|
|
@@ -103,6 +104,14 @@ var Dustbin = function Dustbin(_ref2) {
|
|
|
103
104
|
onClick: function onClick(e) {
|
|
104
105
|
return props.onFixed(item.dataIndex, "right", e);
|
|
105
106
|
}
|
|
106
|
-
}))
|
|
107
|
+
})), !!isRoot && /*#__PURE__*/React.createElement(Switch, {
|
|
108
|
+
checkedChildren: "\u6298\u53E0",
|
|
109
|
+
unCheckedChildren: "\u5C55\u5F00",
|
|
110
|
+
size: "small",
|
|
111
|
+
checked: item.frontEndFold === true || item.frontEndFold === undefined && ["FIRST", "LAST", "NONEDATA"].includes(item.hierarchyState),
|
|
112
|
+
onChange: function onChange(e) {
|
|
113
|
+
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(e, item, "frontEndFold");
|
|
114
|
+
}
|
|
115
|
+
}));
|
|
107
116
|
};
|
|
108
117
|
export default Dustbin;
|
|
@@ -69,14 +69,6 @@ var ColumnsToolbarRender = /*#__PURE__*/memo(function (props) {
|
|
|
69
69
|
var _props$editItem, _props$editItem2;
|
|
70
70
|
setTemplateName((_props$editItem = props.editItem) === null || _props$editItem === void 0 ? void 0 : _props$editItem.label);
|
|
71
71
|
setPermsType(((_props$editItem2 = props.editItem) === null || _props$editItem2 === void 0 ? void 0 : _props$editItem2.perms_type) || "private");
|
|
72
|
-
// if (
|
|
73
|
-
// props.editItem?.owner === "Y" &&
|
|
74
|
-
// props.editItem?.perms_type === "public"
|
|
75
|
-
// ) {
|
|
76
|
-
// setCheckShare(true);
|
|
77
|
-
// } else {
|
|
78
|
-
// setCheckShare(false);
|
|
79
|
-
// }
|
|
80
72
|
}, [props.editItem]);
|
|
81
73
|
var saveTempale = /*#__PURE__*/function () {
|
|
82
74
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
@@ -313,12 +305,11 @@ var ColumnsToolbarRender = /*#__PURE__*/memo(function (props) {
|
|
|
313
305
|
};
|
|
314
306
|
|
|
315
307
|
// 宽度调整
|
|
316
|
-
var
|
|
317
|
-
var _columnsTree = _toConsumableArray(columnsTree);
|
|
308
|
+
var changeTableHeader = function changeTableHeader(val, item, _key) {
|
|
318
309
|
function loopItmes(arr) {
|
|
319
310
|
for (var i = 0, l = arr.length; i < l; i++) {
|
|
320
311
|
if (arr[i].dataIndex === item.dataIndex) {
|
|
321
|
-
arr[i]
|
|
312
|
+
arr[i][_key] = val;
|
|
322
313
|
return;
|
|
323
314
|
}
|
|
324
315
|
if (arr[i].children) {
|
|
@@ -326,9 +317,12 @@ var ColumnsToolbarRender = /*#__PURE__*/memo(function (props) {
|
|
|
326
317
|
}
|
|
327
318
|
}
|
|
328
319
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
320
|
+
if (_key) {
|
|
321
|
+
var _columnsTree = _toConsumableArray(columnsTree);
|
|
322
|
+
loopItmes(_columnsTree);
|
|
323
|
+
setColumnsTree(_columnsTree);
|
|
324
|
+
updateColumns(_columnsTree);
|
|
325
|
+
}
|
|
332
326
|
};
|
|
333
327
|
|
|
334
328
|
// const [leftFixed, unFixed, rightFixed]: any = columnsTree.reduce(
|
|
@@ -492,7 +486,7 @@ var ColumnsToolbarRender = /*#__PURE__*/memo(function (props) {
|
|
|
492
486
|
disabled: d.customizable === false,
|
|
493
487
|
title: d.customizable === false ? d.title : /*#__PURE__*/React.createElement(Dustbin, {
|
|
494
488
|
item: d,
|
|
495
|
-
onChange:
|
|
489
|
+
onChange: changeTableHeader,
|
|
496
490
|
onFixed: onFixed,
|
|
497
491
|
showArrows: showArrows,
|
|
498
492
|
onDrop: d.customizable === false ? null : onDrop // 子动态列 不能拖拽
|
|
@@ -587,7 +581,8 @@ var ColumnsToolbarRender = /*#__PURE__*/memo(function (props) {
|
|
|
587
581
|
onDrop: onDrop,
|
|
588
582
|
onFixed: onFixed,
|
|
589
583
|
showArrows: ["center", "down"],
|
|
590
|
-
onChange:
|
|
584
|
+
onChange: changeTableHeader,
|
|
585
|
+
isRoot: c.children && c.children.length
|
|
591
586
|
}),
|
|
592
587
|
children: titleChildren(c.children, ["center", "down"])
|
|
593
588
|
};
|
|
@@ -619,7 +614,8 @@ var ColumnsToolbarRender = /*#__PURE__*/memo(function (props) {
|
|
|
619
614
|
onDrop: onDrop,
|
|
620
615
|
onFixed: onFixed,
|
|
621
616
|
showArrows: ["up", "down"],
|
|
622
|
-
onChange:
|
|
617
|
+
onChange: changeTableHeader,
|
|
618
|
+
isRoot: c.children && c.children.length
|
|
623
619
|
}),
|
|
624
620
|
children: titleChildren(c.children, ["up", "down"])
|
|
625
621
|
};
|
|
@@ -649,7 +645,8 @@ var ColumnsToolbarRender = /*#__PURE__*/memo(function (props) {
|
|
|
649
645
|
onDrop: onDrop,
|
|
650
646
|
onFixed: onFixed,
|
|
651
647
|
showArrows: ["up", "center"],
|
|
652
|
-
onChange:
|
|
648
|
+
onChange: changeTableHeader,
|
|
649
|
+
isRoot: c.children && c.children.length
|
|
653
650
|
}),
|
|
654
651
|
children: titleChildren(c.children, ["up", "center"])
|
|
655
652
|
};
|
|
@@ -952,6 +949,7 @@ var ColumnsToolbar = function ColumnsToolbar(_ref4) {
|
|
|
952
949
|
menu_code: menuCode,
|
|
953
950
|
form_template_code: formTemplateCode,
|
|
954
951
|
is_default: isDefault,
|
|
952
|
+
is_default_public: isDefault,
|
|
955
953
|
code: item === null || item === void 0 ? void 0 : item.value,
|
|
956
954
|
name: item === null || item === void 0 ? void 0 : item.label,
|
|
957
955
|
configs: item === null || item === void 0 ? void 0 : item.define,
|
|
@@ -964,7 +962,7 @@ var ColumnsToolbar = function ColumnsToolbar(_ref4) {
|
|
|
964
962
|
id: "message.success.set"
|
|
965
963
|
}));
|
|
966
964
|
// 刷新列表
|
|
967
|
-
setCurItem({});
|
|
965
|
+
// setCurItem({});
|
|
968
966
|
getColumnsFilter();
|
|
969
967
|
}
|
|
970
968
|
});
|
|
@@ -972,6 +970,29 @@ var ColumnsToolbar = function ColumnsToolbar(_ref4) {
|
|
|
972
970
|
}
|
|
973
971
|
});
|
|
974
972
|
};
|
|
973
|
+
|
|
974
|
+
// 取消选择 恢复默认
|
|
975
|
+
var cancelSelect = function cancelSelect() {
|
|
976
|
+
setValue("");
|
|
977
|
+
setCurItem({});
|
|
978
|
+
restColumns("cancel");
|
|
979
|
+
};
|
|
980
|
+
var restColumns = function restColumns(code) {
|
|
981
|
+
if (curItem !== null && curItem !== void 0 && curItem.define && !code) {
|
|
982
|
+
props.updateColumns(JSON.parse(curItem.define));
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
985
|
+
var loopColumns = function loopColumns(arr, firstLoop) {
|
|
986
|
+
return arr.map(function (field) {
|
|
987
|
+
return _objectSpread(_objectSpread({}, field), {}, {
|
|
988
|
+
checked: typeof field.checked === "boolean" ? field.checked : field.defaultDisplay == false ? false : true,
|
|
989
|
+
children: field.children ? loopColumns(field.children) : null
|
|
990
|
+
});
|
|
991
|
+
});
|
|
992
|
+
};
|
|
993
|
+
var _columns = loopColumns(cloneDeep(props.columns), true);
|
|
994
|
+
props.updateColumns(_columns);
|
|
995
|
+
};
|
|
975
996
|
return /*#__PURE__*/React.createElement("div", {
|
|
976
997
|
className: "popover-body ".concat(showConfig ? "config-body" : "")
|
|
977
998
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -997,6 +1018,7 @@ var ColumnsToolbar = function ColumnsToolbar(_ref4) {
|
|
|
997
1018
|
columns: columnsCofnig,
|
|
998
1019
|
updateColumns: props.updateColumns,
|
|
999
1020
|
handleBack: function handleBack() {
|
|
1021
|
+
restColumns();
|
|
1000
1022
|
setShowConfig(false);
|
|
1001
1023
|
},
|
|
1002
1024
|
handleSaveCallback: handleSaveCallback,
|
|
@@ -1144,6 +1166,14 @@ var ColumnsToolbar = function ColumnsToolbar(_ref4) {
|
|
|
1144
1166
|
size: "small"
|
|
1145
1167
|
}, initLang({
|
|
1146
1168
|
id: "button.set.default"
|
|
1169
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
1170
|
+
style: {
|
|
1171
|
+
marginLeft: 8
|
|
1172
|
+
},
|
|
1173
|
+
onClick: cancelSelect,
|
|
1174
|
+
size: "small"
|
|
1175
|
+
}, initLang({
|
|
1176
|
+
id: "button.set.cancelSelect"
|
|
1147
1177
|
})))));
|
|
1148
1178
|
};
|
|
1149
1179
|
var Index = function Index(_ref9) {
|
|
@@ -87,7 +87,8 @@ var updateTemplateFilds = function updateTemplateFilds(JsonPares, _columns) {
|
|
|
87
87
|
_index: JsonPares[r]._index,
|
|
88
88
|
key: JsonPares[r].key,
|
|
89
89
|
return: JsonPares[r].return,
|
|
90
|
-
dataIndex: JsonPares[r].dataIndex
|
|
90
|
+
dataIndex: JsonPares[r].dataIndex,
|
|
91
|
+
frontEndFold: JsonPares[r].frontEndFold
|
|
91
92
|
});
|
|
92
93
|
}
|
|
93
94
|
};
|