@arim-aisdc/public-components 2.1.0 → 2.1.2
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/assets/iconfont/index.css +2 -0
- package/dist/assets/iconfont/public/iconfont.css +69 -0
- package/dist/assets/iconfont/public/iconfont.ttf +0 -0
- package/dist/assets/iconfont/table/iconfont.css +26 -34
- package/dist/assets/iconfont/table/iconfont.ttf +0 -0
- package/dist/components/BaseInfo/BaseInfo.d.ts +1 -1
- package/dist/components/CacheTabs/CacheTabs.d.ts +2 -1
- package/dist/components/CacheTabs/CacheTabs.js +147 -115
- package/dist/components/CacheTabs/index.less +14 -5
- package/dist/components/ConditionExpression/index.d.ts +2 -0
- package/dist/components/ConditionExpression/index.js +86 -77
- package/dist/components/ConditionExpression/index.less +24 -40
- package/dist/components/CustomForm/CustomForm.js +2 -1
- package/dist/components/CustomForm/index.less +14 -0
- package/dist/components/TableMax/TableBody/Row.js +2 -0
- package/dist/components/TableMax/TableBody/index.less +1 -0
- package/dist/components/TableMax/TableHeader/index.less +2 -1
- package/dist/components/TableMax/TableMax.js +10 -23
- package/dist/components/TableMax/components/ColumnSetting/index.js +5 -16
- package/dist/components/TableMax/components/ColumnSetting/index.less +22 -0
- package/dist/components/TableMax/components/ColumnSort/customSortFns.d.ts +8 -8
- package/dist/components/TableMax/components/CustomDragerLayer/index.less +5 -4
- package/dist/themes/variables.less +8 -2
- package/dist/themes/variablesConfig.js +20 -10
- package/dist/utils/request.d.ts +3 -0
- package/dist/utils/request.js +3 -0
- package/package.json +2 -4
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: "iconfont-public"; /* Project id 4386651 */
|
|
3
|
+
src: url('./iconfont.ttf?t=1730099749830') format('truetype');
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.iconfont-public {
|
|
7
|
+
font-family: "iconfont-public" !important;
|
|
8
|
+
font-size: 16px;
|
|
9
|
+
font-style: normal;
|
|
10
|
+
-webkit-font-smoothing: antialiased;
|
|
11
|
+
-moz-osx-font-smoothing: grayscale;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.icon-public-guanbiqita:before {
|
|
15
|
+
content: "\e6db";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.icon-public-shuaxinbiaoqian:before {
|
|
19
|
+
content: "\e6dc";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.icon-public-guanbibiaoqian:before {
|
|
23
|
+
content: "\e6dd";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.icon-public-upload:before {
|
|
27
|
+
content: "\e877";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.icon-public-download:before {
|
|
31
|
+
content: "\e878";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.icon-public-refresh:before {
|
|
35
|
+
content: "\e7c1";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.icon-public-edit:before {
|
|
39
|
+
content: "\e7c2";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.icon-public-calendar:before {
|
|
43
|
+
content: "\e7c3";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.icon-public-reduce:before {
|
|
47
|
+
content: "\e7c4";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.icon-public-setting:before {
|
|
51
|
+
content: "\e7bc";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.icon-public-delete:before {
|
|
55
|
+
content: "\e7bd";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.icon-public-drag:before {
|
|
59
|
+
content: "\e7be";
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.icon-public-down:before {
|
|
63
|
+
content: "\e7bf";
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.icon-public-pin:before {
|
|
67
|
+
content: "\e7c0";
|
|
68
|
+
}
|
|
69
|
+
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@font-face {
|
|
2
|
-
font-family: "iconfont-table"; /* Project id
|
|
3
|
-
src: url('./iconfont.ttf?t=
|
|
2
|
+
font-family: "iconfont-table"; /* Project id 4453758 */
|
|
3
|
+
src: url('./iconfont.ttf?t=1730099737796') format('truetype');
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.iconfont-table {
|
|
@@ -11,59 +11,51 @@
|
|
|
11
11
|
-moz-osx-font-smoothing: grayscale;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.icon-table-
|
|
15
|
-
content: "\
|
|
14
|
+
.icon-table-a-xinzeng21:before {
|
|
15
|
+
content: "\e62e";
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.icon-table-
|
|
19
|
-
content: "\
|
|
18
|
+
.icon-table-a-download11:before {
|
|
19
|
+
content: "\e62f";
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.icon-table-
|
|
23
|
-
content: "\
|
|
22
|
+
.icon-table-tight:before {
|
|
23
|
+
content: "\e87e";
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.icon-table-
|
|
27
|
-
content: "\
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.icon-table-download:before {
|
|
31
|
-
content: "\e878";
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.icon-table-refresh:before {
|
|
35
|
-
content: "\e7c1";
|
|
26
|
+
.icon-table-normal:before {
|
|
27
|
+
content: "\e87f";
|
|
36
28
|
}
|
|
37
29
|
|
|
38
|
-
.icon-table-
|
|
39
|
-
content: "\
|
|
30
|
+
.icon-table-shenglvehao:before {
|
|
31
|
+
content: "\e62d";
|
|
40
32
|
}
|
|
41
33
|
|
|
42
|
-
.icon-table-
|
|
43
|
-
content: "\
|
|
34
|
+
.icon-table-delete:before {
|
|
35
|
+
content: "\e87c";
|
|
44
36
|
}
|
|
45
37
|
|
|
46
|
-
.icon-table-
|
|
47
|
-
content: "\
|
|
38
|
+
.icon-table-shuaxin:before {
|
|
39
|
+
content: "\e87b";
|
|
48
40
|
}
|
|
49
41
|
|
|
50
|
-
.icon-table-
|
|
51
|
-
content: "\
|
|
42
|
+
.icon-table-upload:before {
|
|
43
|
+
content: "\e878";
|
|
52
44
|
}
|
|
53
45
|
|
|
54
|
-
.icon-table-
|
|
55
|
-
content: "\
|
|
46
|
+
.icon-table-download:before {
|
|
47
|
+
content: "\e87a";
|
|
56
48
|
}
|
|
57
49
|
|
|
58
|
-
.icon-table-
|
|
59
|
-
content: "\
|
|
50
|
+
.icon-table-shezhi:before {
|
|
51
|
+
content: "\e643";
|
|
60
52
|
}
|
|
61
53
|
|
|
62
|
-
.icon-table-
|
|
63
|
-
content: "\
|
|
54
|
+
.icon-table-zhexian:before {
|
|
55
|
+
content: "\e644";
|
|
64
56
|
}
|
|
65
57
|
|
|
66
|
-
.icon-table-
|
|
67
|
-
content: "\
|
|
58
|
+
.icon-table-biaoge:before {
|
|
59
|
+
content: "\e645";
|
|
68
60
|
}
|
|
69
61
|
|
|
Binary file
|
|
@@ -17,7 +17,7 @@ export declare const foramtBaseInfoField: (data: any, dataField: BaseInfoFieldTy
|
|
|
17
17
|
value: any;
|
|
18
18
|
field: string;
|
|
19
19
|
label?: string;
|
|
20
|
-
text: string |
|
|
20
|
+
text: string | Element | JSX.Element;
|
|
21
21
|
units?: string;
|
|
22
22
|
width?: string;
|
|
23
23
|
labelWidth?: string;
|
|
@@ -5,6 +5,7 @@ export type CacheTabsProps = {
|
|
|
5
5
|
pathname: string;
|
|
6
6
|
history: any;
|
|
7
7
|
nodeList?: any;
|
|
8
|
+
shouldCache: boolean;
|
|
8
9
|
};
|
|
9
|
-
declare const _default: ({ useAliveController, pathname, history, nodeList }: CacheTabsProps) => React.ReactElement;
|
|
10
|
+
declare const _default: ({ useAliveController, pathname, history, nodeList, shouldCache }: CacheTabsProps) => React.ReactElement;
|
|
10
11
|
export default _default;
|
|
@@ -1,3 +1,9 @@
|
|
|
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
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
1
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
8
|
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
9
|
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); }
|
|
@@ -5,20 +11,21 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
11
|
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
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
13
|
import { Dropdown, Tabs, Tooltip } from 'antd';
|
|
8
|
-
import React, { useState } from 'react';
|
|
14
|
+
import React, { useState, useMemo, useRef, useEffect } from 'react';
|
|
9
15
|
import "./index.less";
|
|
10
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
17
|
export default (function (_ref) {
|
|
12
18
|
var useAliveController = _ref.useAliveController,
|
|
13
19
|
pathname = _ref.pathname,
|
|
14
20
|
history = _ref.history,
|
|
15
|
-
nodeList = _ref.nodeList
|
|
21
|
+
nodeList = _ref.nodeList,
|
|
22
|
+
shouldCache = _ref.shouldCache;
|
|
16
23
|
// 获取缓存列表
|
|
17
|
-
var
|
|
18
|
-
getCachingNodes =
|
|
19
|
-
dropScope =
|
|
20
|
-
clear =
|
|
21
|
-
refreshScope =
|
|
24
|
+
var _ref2 = (useAliveController === null || useAliveController === void 0 ? void 0 : useAliveController()) || {},
|
|
25
|
+
getCachingNodes = _ref2.getCachingNodes,
|
|
26
|
+
dropScope = _ref2.dropScope,
|
|
27
|
+
clear = _ref2.clear,
|
|
28
|
+
refreshScope = _ref2.refreshScope;
|
|
22
29
|
var cachingNodes = ((getCachingNodes === null || getCachingNodes === void 0 ? void 0 : getCachingNodes()) || nodeList).filter(function (item) {
|
|
23
30
|
return item === null || item === void 0 ? void 0 : item.tabName;
|
|
24
31
|
});
|
|
@@ -31,7 +38,7 @@ export default (function (_ref) {
|
|
|
31
38
|
setOpen = _useState2[1];
|
|
32
39
|
|
|
33
40
|
// 阻止右键事件冒泡
|
|
34
|
-
var
|
|
41
|
+
var _onRightClick = function onRightClick(e, name) {
|
|
35
42
|
return open.open && open.path === name && e.stopPropagation();
|
|
36
43
|
};
|
|
37
44
|
|
|
@@ -125,117 +132,142 @@ export default (function (_ref) {
|
|
|
125
132
|
var targetKey = JSON.parse(e === null || e === void 0 ? void 0 : e.key).name;
|
|
126
133
|
refreshScope === null || refreshScope === void 0 || refreshScope(targetKey);
|
|
127
134
|
};
|
|
128
|
-
var
|
|
129
|
-
|
|
130
|
-
|
|
135
|
+
var menuItems = useMemo(function () {
|
|
136
|
+
return [{
|
|
137
|
+
icon: /*#__PURE__*/_jsx("i", {
|
|
138
|
+
className: "iconfont-public icon-public-shuaxinbiaoqian"
|
|
139
|
+
}),
|
|
140
|
+
label: '刷新标签',
|
|
141
|
+
key: 'refresh',
|
|
142
|
+
onClick: onRefresh
|
|
143
|
+
}, {
|
|
144
|
+
icon: /*#__PURE__*/_jsx("i", {
|
|
145
|
+
className: "iconfont-public icon-public-guanbibiaoqian"
|
|
146
|
+
}),
|
|
147
|
+
label: '关闭标签',
|
|
148
|
+
key: 'current',
|
|
149
|
+
disabled: cachingNodes.length <= 1,
|
|
150
|
+
onClick: onCurrent
|
|
151
|
+
}, {
|
|
152
|
+
icon: /*#__PURE__*/_jsx("i", {
|
|
153
|
+
className: "iconfont-public icon-public-guanbiqita"
|
|
154
|
+
}),
|
|
155
|
+
label: '关闭其他标签页',
|
|
156
|
+
key: 'other',
|
|
157
|
+
disabled: cachingNodes.length <= 1,
|
|
158
|
+
onClick: onOther
|
|
159
|
+
}
|
|
160
|
+
// ... other menu items ...
|
|
161
|
+
];
|
|
162
|
+
}, [cachingNodes.length, onRefresh, onCurrent, onOther]);
|
|
163
|
+
var tabItems = useMemo(function () {
|
|
164
|
+
return cachingNodes.map(function (item) {
|
|
165
|
+
return {
|
|
166
|
+
label: /*#__PURE__*/_jsx(LabelDropdown, {
|
|
167
|
+
name: item.name,
|
|
168
|
+
label: item.tabName,
|
|
169
|
+
onRightClick: function onRightClick(e) {
|
|
170
|
+
return _onRightClick(e, item.name);
|
|
171
|
+
},
|
|
172
|
+
cachingNodes: cachingNodes,
|
|
173
|
+
setOpen: setOpen,
|
|
174
|
+
menuItems: menuItems.map(function (menuItem) {
|
|
175
|
+
return _objectSpread(_objectSpread({}, menuItem), {}, {
|
|
176
|
+
key: JSON.stringify({
|
|
177
|
+
name: item.name,
|
|
178
|
+
key: menuItem.key
|
|
179
|
+
})
|
|
180
|
+
});
|
|
181
|
+
})
|
|
182
|
+
}),
|
|
183
|
+
key: item.name,
|
|
184
|
+
closable: cachingNodes.length > 1
|
|
185
|
+
};
|
|
131
186
|
});
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
187
|
+
}, [cachingNodes, _onRightClick, menuItems]);
|
|
188
|
+
return /*#__PURE__*/_jsx("div", {
|
|
189
|
+
style: {
|
|
190
|
+
display: shouldCache ? 'block' : 'none'
|
|
191
|
+
},
|
|
192
|
+
children: /*#__PURE__*/_jsx(Tabs, {
|
|
193
|
+
hideAdd: true,
|
|
194
|
+
size: "middle",
|
|
195
|
+
type: "editable-card",
|
|
196
|
+
className: "cache-tabs",
|
|
197
|
+
activeKey: pathname,
|
|
198
|
+
onTabClick: clickTab,
|
|
199
|
+
onEdit: editTab,
|
|
200
|
+
items: tabItems,
|
|
201
|
+
tabBarGutter: 0
|
|
202
|
+
})
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
var LabelDropdown = /*#__PURE__*/React.memo(function (_ref3) {
|
|
206
|
+
var name = _ref3.name,
|
|
207
|
+
label = _ref3.label,
|
|
208
|
+
onRightClick = _ref3.onRightClick,
|
|
209
|
+
cachingNodes = _ref3.cachingNodes,
|
|
210
|
+
setOpen = _ref3.setOpen,
|
|
211
|
+
menuItems = _ref3.menuItems;
|
|
212
|
+
var _useState3 = useState(false),
|
|
213
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
214
|
+
isOverflowing = _useState4[0],
|
|
215
|
+
setIsOverflowing = _useState4[1];
|
|
216
|
+
var labelRef = useRef(null);
|
|
217
|
+
useEffect(function () {
|
|
218
|
+
var checkOverflow = function checkOverflow() {
|
|
219
|
+
if (labelRef.current) {
|
|
220
|
+
setIsOverflowing(labelRef.current.offsetWidth < labelRef.current.scrollWidth);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
checkOverflow();
|
|
224
|
+
window.addEventListener('resize', checkOverflow);
|
|
225
|
+
return function () {
|
|
226
|
+
return window.removeEventListener('resize', checkOverflow);
|
|
227
|
+
};
|
|
228
|
+
}, [label]);
|
|
229
|
+
return /*#__PURE__*/_jsx("div", {
|
|
230
|
+
onClick: function onClick(e) {
|
|
231
|
+
return onRightClick(e, name);
|
|
232
|
+
},
|
|
233
|
+
children: /*#__PURE__*/_jsx(Dropdown, {
|
|
234
|
+
overlayClassName: "cache-tabs-dropdown",
|
|
235
|
+
trigger: ['contextMenu'],
|
|
236
|
+
onOpenChange: function onOpenChange(e) {
|
|
237
|
+
return setOpen({
|
|
238
|
+
path: name,
|
|
239
|
+
open: e
|
|
240
|
+
});
|
|
136
241
|
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
242
|
+
menu: {
|
|
243
|
+
items: menuItems
|
|
244
|
+
},
|
|
245
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
246
|
+
title: isOverflowing ? label : '',
|
|
247
|
+
color: "var(--globalColor7)",
|
|
248
|
+
overlayStyle: {
|
|
249
|
+
border: '1px solid var(--tableColor2)',
|
|
250
|
+
borderRadius: '6px'
|
|
145
251
|
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
name: name,
|
|
154
|
-
key: 'refresh'
|
|
155
|
-
}),
|
|
156
|
-
onClick: onRefresh
|
|
157
|
-
}, {
|
|
158
|
-
icon: /*#__PURE__*/_jsx("i", {
|
|
159
|
-
className: "iconfont-table icon-table-guanbibiaoqian"
|
|
160
|
-
}),
|
|
161
|
-
label: '关闭标签',
|
|
162
|
-
key: JSON.stringify({
|
|
163
|
-
name: name,
|
|
164
|
-
key: 'current'
|
|
165
|
-
}),
|
|
166
|
-
disabled: cachingNodes.length <= 1,
|
|
167
|
-
onClick: onCurrent
|
|
168
|
-
}, {
|
|
169
|
-
icon: /*#__PURE__*/_jsx("i", {
|
|
170
|
-
className: "iconfont-table icon-table-guanbiqita"
|
|
171
|
-
}),
|
|
172
|
-
label: '关闭其他标签页',
|
|
173
|
-
key: JSON.stringify({
|
|
174
|
-
name: name,
|
|
175
|
-
key: 'other'
|
|
176
|
-
}),
|
|
177
|
-
disabled: cachingNodes.length <= 1,
|
|
178
|
-
onClick: onOther
|
|
179
|
-
}
|
|
180
|
-
// {
|
|
181
|
-
// icon: '',
|
|
182
|
-
// label: '关闭左侧',
|
|
183
|
-
// key: JSON.stringify({ name, key: 'left' }),
|
|
184
|
-
// disabled: lastIndex === 0,
|
|
185
|
-
// onClick: onLeft,
|
|
186
|
-
// },
|
|
187
|
-
// {
|
|
188
|
-
// label: '关闭右侧',
|
|
189
|
-
// key: JSON.stringify({ name, key: 'right' }),
|
|
190
|
-
// disabled: lastIndex === cachingNodes.length - 1,
|
|
191
|
-
// onClick: onRight,
|
|
192
|
-
// },
|
|
193
|
-
// {
|
|
194
|
-
// label: '重新加载',
|
|
195
|
-
// key: JSON.stringify({ name, key: 'refresh' }),
|
|
196
|
-
// onClick: onRefresh,
|
|
197
|
-
// },
|
|
198
|
-
]
|
|
252
|
+
overlayInnerStyle: {
|
|
253
|
+
padding: '6px 16px',
|
|
254
|
+
borderRadius: '6px',
|
|
255
|
+
color: 'var(--globalColor1)',
|
|
256
|
+
background: 'var(--globalColor1)',
|
|
257
|
+
fontSize: '14px',
|
|
258
|
+
lineHeight: '28px'
|
|
199
259
|
},
|
|
200
|
-
children: /*#__PURE__*/_jsx(
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
overlayInnerStyle: {
|
|
208
|
-
padding: '6px 16px',
|
|
209
|
-
borderRadius: '6px',
|
|
210
|
-
color: 'var(--globalColor1)',
|
|
211
|
-
background: 'var(--globalColor1)',
|
|
212
|
-
fontSize: '14px',
|
|
213
|
-
lineHeight: '28px'
|
|
260
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
261
|
+
ref: labelRef,
|
|
262
|
+
className: cachingNodes.length > 1 ? 'dropdown-label' : '',
|
|
263
|
+
style: {
|
|
264
|
+
overflow: 'hidden',
|
|
265
|
+
textOverflow: 'ellipsis',
|
|
266
|
+
whiteSpace: 'nowrap'
|
|
214
267
|
},
|
|
215
|
-
children:
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}, name)
|
|
220
|
-
})
|
|
221
|
-
});
|
|
222
|
-
};
|
|
223
|
-
var tabItems = cachingNodes.map(function (item) {
|
|
224
|
-
return {
|
|
225
|
-
label: labelDropdown(item.name, item.tabName),
|
|
226
|
-
key: item.name,
|
|
227
|
-
closable: cachingNodes.length > 1
|
|
228
|
-
};
|
|
229
|
-
});
|
|
230
|
-
return /*#__PURE__*/_jsx(Tabs, {
|
|
231
|
-
hideAdd: true,
|
|
232
|
-
size: "middle",
|
|
233
|
-
type: "editable-card",
|
|
234
|
-
className: "cache-tabs",
|
|
235
|
-
activeKey: pathname,
|
|
236
|
-
onTabClick: clickTab,
|
|
237
|
-
onEdit: editTab,
|
|
238
|
-
items: tabItems,
|
|
239
|
-
tabBarGutter: 0
|
|
268
|
+
children: label
|
|
269
|
+
})
|
|
270
|
+
}, name)
|
|
271
|
+
})
|
|
240
272
|
});
|
|
241
273
|
});
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
color: @globalColor2;
|
|
21
21
|
height: 100% !important;
|
|
22
22
|
padding: 0 12px !important;
|
|
23
|
+
pointer-events: auto;
|
|
23
24
|
}
|
|
24
25
|
&>.ant-tabs-nav .ant-tabs-tab-active {
|
|
25
26
|
background: @globalColor7 !important;
|
|
@@ -29,6 +30,11 @@
|
|
|
29
30
|
color: @globalColor1 !important;
|
|
30
31
|
}
|
|
31
32
|
}
|
|
33
|
+
&>.ant-tabs-nav .ant-tabs-tab:hover {
|
|
34
|
+
background: @globalColor7 !important;
|
|
35
|
+
border-radius: 6px 6px 0 0 !important;
|
|
36
|
+
border: 0 !important;
|
|
37
|
+
}
|
|
32
38
|
&>.ant-tabs-nav::before {
|
|
33
39
|
z-index: 1;
|
|
34
40
|
border-bottom: 1px solid @tableColor7;
|
|
@@ -49,11 +55,11 @@
|
|
|
49
55
|
border-left: none !important;
|
|
50
56
|
content: '';
|
|
51
57
|
}
|
|
52
|
-
.dropdown-label {
|
|
58
|
+
.ant-dropdown-trigger,.dropdown-label {
|
|
53
59
|
text-overflow: ellipsis;
|
|
54
60
|
white-space: nowrap;
|
|
55
61
|
overflow: hidden;
|
|
56
|
-
max-width:
|
|
62
|
+
max-width: 96px;
|
|
57
63
|
}
|
|
58
64
|
&>.ant-tabs-nav .ant-tabs-tab .ant-tabs-tab-remove {
|
|
59
65
|
padding: 0 !important;
|
|
@@ -64,7 +70,7 @@
|
|
|
64
70
|
width: 16px;
|
|
65
71
|
height: 16px;
|
|
66
72
|
border-radius: 8px;
|
|
67
|
-
color: @global-icon-color;
|
|
73
|
+
color: @global-icon-text-color;
|
|
68
74
|
font-size: 10px;
|
|
69
75
|
&:hover {
|
|
70
76
|
background: @globalColor_14;
|
|
@@ -80,7 +86,7 @@
|
|
|
80
86
|
.ant-dropdown-menu {
|
|
81
87
|
padding: 0 !important;
|
|
82
88
|
border-radius: 6px !important;
|
|
83
|
-
background: @global-
|
|
89
|
+
background: @global-hover-background-color;
|
|
84
90
|
box-shadow: 0px 5px 12px -4px @global-hover-box-shadow-color;
|
|
85
91
|
border-radius: 6px 6px 6px 6px;
|
|
86
92
|
border: 1px solid @tableColor7;
|
|
@@ -97,10 +103,13 @@
|
|
|
97
103
|
.ant-dropdown-menu-item-active, .ant-dropdown-menu-item:hover {
|
|
98
104
|
background: @globalColor_14 !important;
|
|
99
105
|
}
|
|
106
|
+
.ant-dropdown-menu-item-disabled, .ant-dropdown-menu-item-disabled:hover {
|
|
107
|
+
background: @global-disabled-background-color !important;
|
|
108
|
+
}
|
|
100
109
|
.iconfont-table {
|
|
101
110
|
font-size: 16px !important;
|
|
102
111
|
line-height: 22px !important;
|
|
103
|
-
color: @global-icon-color !important;
|
|
112
|
+
color: @global-icon-text-color !important;
|
|
104
113
|
margin-right: 4px;
|
|
105
114
|
margin-top: 2px;
|
|
106
115
|
}
|
|
@@ -29,6 +29,8 @@ export interface ConditionExpressionPropsType {
|
|
|
29
29
|
}[];
|
|
30
30
|
/** 第一个参数的Select的labelInValue属性 */
|
|
31
31
|
labelInValue?: boolean;
|
|
32
|
+
/** 是否支持前端筛选 */
|
|
33
|
+
canFrontFilter?: boolean;
|
|
32
34
|
}
|
|
33
35
|
declare const _default: React.NamedExoticComponent<ConditionExpressionPropsType>;
|
|
34
36
|
export default _default;
|
|
@@ -10,9 +10,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
10
10
|
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; }
|
|
11
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
12
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
-
import {
|
|
13
|
+
import { CloseOutlined, PlusOutlined } from '@ant-design/icons';
|
|
14
|
+
import { Button, Input, Select, Tooltip } from 'antd';
|
|
14
15
|
import { cloneDeep } from 'lodash';
|
|
15
16
|
import React from 'react';
|
|
17
|
+
import Icon from "../Icon";
|
|
16
18
|
import "./index.less";
|
|
17
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -65,7 +67,8 @@ var ConditionExpression = function ConditionExpression(_ref) {
|
|
|
65
67
|
_ref$showParameter = _ref.showParameter,
|
|
66
68
|
showParameter = _ref$showParameter === void 0 ? true : _ref$showParameter,
|
|
67
69
|
parameterOptions = _ref.parameterOptions,
|
|
68
|
-
labelInValue = _ref.labelInValue
|
|
70
|
+
labelInValue = _ref.labelInValue,
|
|
71
|
+
canFrontFilter = _ref.canFrontFilter;
|
|
69
72
|
/** 添加条件触发 */
|
|
70
73
|
var addExpression = function addExpression(index) {
|
|
71
74
|
var _conditionExpressionItem = value.map(function (e, i) {
|
|
@@ -158,76 +161,85 @@ var ConditionExpression = function ConditionExpression(_ref) {
|
|
|
158
161
|
var getConditionExpressionItem = function getConditionExpressionItem(item, index, notFirst) {
|
|
159
162
|
return /*#__PURE__*/_jsxs("div", {
|
|
160
163
|
className: 'condition-all',
|
|
161
|
-
children: [notFirst && conditionLink(value === null || value === void 0 ? void 0 : value[index[0] - 1].logicOperator, 'logicOperatorByGroup', [index[0] - 1]), /*#__PURE__*/
|
|
162
|
-
className:
|
|
163
|
-
children:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
children: [
|
|
173
|
-
className: 'condition-
|
|
174
|
-
children: /*#__PURE__*/_jsx(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
var _data$target;
|
|
204
|
-
return dataChange('argumentsValue', data === null || data === void 0 || (_data$target = data.target) === null || _data$target === void 0 ? void 0 : _data$target.value, [index[0], i]);
|
|
205
|
-
}
|
|
206
|
-
}), tooltipList.includes((_value$index$4 = value[index[0]]) === null || _value$index$4 === void 0 || (_value$index$4 = _value$index$4.conditionItem[i]) === null || _value$index$4 === void 0 ? void 0 : _value$index$4.operator) && /*#__PURE__*/_jsx(Tooltip, {
|
|
207
|
-
title: tooltipTitle,
|
|
208
|
-
children: /*#__PURE__*/_jsx("i", {
|
|
209
|
-
className: "iconfont-other icon-other-info ".concat('condition-tooltip')
|
|
164
|
+
children: [notFirst && conditionLink(value === null || value === void 0 ? void 0 : value[index[0] - 1].logicOperator, 'logicOperatorByGroup', [index[0] - 1]), /*#__PURE__*/_jsx("div", {
|
|
165
|
+
className: "condition-all-content",
|
|
166
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
167
|
+
className: 'condition-all-undelete',
|
|
168
|
+
children: [item === null || item === void 0 ? void 0 : item.map(function (e, i) {
|
|
169
|
+
var _value$index$, _value$index$2, _value$index$3, _value$index$4;
|
|
170
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
171
|
+
style: {
|
|
172
|
+
display: 'flex',
|
|
173
|
+
alignItems: 'center'
|
|
174
|
+
},
|
|
175
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
176
|
+
className: 'condition-item',
|
|
177
|
+
children: [showParameter && /*#__PURE__*/_jsx("div", {
|
|
178
|
+
className: 'condition-select-left',
|
|
179
|
+
children: /*#__PURE__*/_jsx(Select, {
|
|
180
|
+
value: value === null || value === void 0 || (_value$index$ = value[index[0]]) === null || _value$index$ === void 0 || (_value$index$ = _value$index$.conditionItem[i]) === null || _value$index$ === void 0 ? void 0 : _value$index$.arguments,
|
|
181
|
+
placeholder: '请选择参数',
|
|
182
|
+
options: parameterOptions,
|
|
183
|
+
labelInValue: labelInValue,
|
|
184
|
+
onSelect: function onSelect(data) {
|
|
185
|
+
return dataChange('arguments', data, [index[0], i]);
|
|
186
|
+
},
|
|
187
|
+
showSearch: canFrontFilter,
|
|
188
|
+
filterOption: canFrontFilter ? function (input, option) {
|
|
189
|
+
var _option$label;
|
|
190
|
+
return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').toLowerCase().includes(input.toLowerCase());
|
|
191
|
+
} : true
|
|
192
|
+
})
|
|
193
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
194
|
+
className: 'condition-select-middle',
|
|
195
|
+
children: /*#__PURE__*/_jsx(Select, {
|
|
196
|
+
value: (_value$index$2 = value[index[0]]) === null || _value$index$2 === void 0 || (_value$index$2 = _value$index$2.conditionItem[i]) === null || _value$index$2 === void 0 ? void 0 : _value$index$2.operator,
|
|
197
|
+
style: {
|
|
198
|
+
width: '118px'
|
|
199
|
+
},
|
|
200
|
+
placeholder: '操作符',
|
|
201
|
+
defaultValue: '=',
|
|
202
|
+
options: operatorOptions,
|
|
203
|
+
onChange: function onChange(data) {
|
|
204
|
+
return dataChange('operator', data, [index[0], i]);
|
|
205
|
+
}
|
|
210
206
|
})
|
|
207
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
208
|
+
className: 'condition-input-right',
|
|
209
|
+
children: [/*#__PURE__*/_jsx(Input, {
|
|
210
|
+
value: value === null || value === void 0 || (_value$index$3 = value[index[0]]) === null || _value$index$3 === void 0 || (_value$index$3 = _value$index$3.conditionItem[i]) === null || _value$index$3 === void 0 ? void 0 : _value$index$3.argumentsValue,
|
|
211
|
+
placeholder: '参数值',
|
|
212
|
+
onChange: function onChange(data) {
|
|
213
|
+
var _data$target;
|
|
214
|
+
return dataChange('argumentsValue', data === null || data === void 0 || (_data$target = data.target) === null || _data$target === void 0 ? void 0 : _data$target.value, [index[0], i]);
|
|
215
|
+
}
|
|
216
|
+
}), tooltipList.includes((_value$index$4 = value[index[0]]) === null || _value$index$4 === void 0 || (_value$index$4 = _value$index$4.conditionItem[i]) === null || _value$index$4 === void 0 ? void 0 : _value$index$4.operator) && /*#__PURE__*/_jsx(Tooltip, {
|
|
217
|
+
title: tooltipTitle,
|
|
218
|
+
children: /*#__PURE__*/_jsx("i", {
|
|
219
|
+
className: "iconfont-other icon-other-info ".concat('condition-tooltip')
|
|
220
|
+
})
|
|
221
|
+
})]
|
|
222
|
+
}), item.length > 1 && /*#__PURE__*/_jsx(CloseOutlined, {
|
|
223
|
+
className: "condition-item-del",
|
|
224
|
+
onClick: function onClick() {
|
|
225
|
+
return itemDelOnClick([index[0], i]);
|
|
226
|
+
}
|
|
211
227
|
})]
|
|
212
|
-
}), item.length
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
})
|
|
228
|
-
})]
|
|
229
|
-
}), value.length > 1 && /*#__PURE__*/_jsx("i", {
|
|
230
|
-
className: "iconfont-other icon-other-cancel ".concat('condition-del'),
|
|
228
|
+
}), i !== item.length - 1 && conditionLink(value === null || value === void 0 ? void 0 : value[index[0]].conditionItem[i].logicOperator, 'logicOperator', [index[0], i])]
|
|
229
|
+
}, "condition-item-".concat(index[0], "-").concat(i));
|
|
230
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
231
|
+
className: 'condition-add',
|
|
232
|
+
onClick: function onClick() {
|
|
233
|
+
return addExpression(index);
|
|
234
|
+
},
|
|
235
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
236
|
+
prefix: 'other',
|
|
237
|
+
name: 'add'
|
|
238
|
+
})
|
|
239
|
+
})]
|
|
240
|
+
})
|
|
241
|
+
}), value.length > 1 && /*#__PURE__*/_jsx(CloseOutlined, {
|
|
242
|
+
className: "condition-del",
|
|
231
243
|
onClick: function onClick() {
|
|
232
244
|
return delOnClick(index);
|
|
233
245
|
}
|
|
@@ -238,14 +250,11 @@ var ConditionExpression = function ConditionExpression(_ref) {
|
|
|
238
250
|
className: 'condition-expression-item',
|
|
239
251
|
children: [value === null || value === void 0 ? void 0 : value.map(function (e, index) {
|
|
240
252
|
return getConditionExpressionItem(e.conditionItem, [index], index !== 0);
|
|
241
|
-
}), /*#__PURE__*/
|
|
242
|
-
className: 'condition-add-group',
|
|
253
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
243
254
|
onClick: addGroup,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
children: "\u5206\u7EC4"
|
|
248
|
-
})]
|
|
255
|
+
className: 'condition-add-group',
|
|
256
|
+
icon: /*#__PURE__*/_jsx(PlusOutlined, {}),
|
|
257
|
+
children: "\u5206\u7EC4"
|
|
249
258
|
})]
|
|
250
259
|
});
|
|
251
260
|
};
|
|
@@ -1,42 +1,49 @@
|
|
|
1
1
|
.condition-expression-item {
|
|
2
2
|
display: flex;
|
|
3
3
|
padding: 6px 0;
|
|
4
|
+
padding-right: 6px;
|
|
4
5
|
grid-auto-flow: column;
|
|
5
|
-
overflow-x: auto;
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
justify-content: flex-start;
|
|
8
8
|
align-items: flex-start;
|
|
9
|
+
overflow-x: hidden;
|
|
9
10
|
|
|
10
11
|
.condition-all {
|
|
11
12
|
display: flex;
|
|
12
13
|
align-items: center;
|
|
13
14
|
position: relative;
|
|
14
|
-
margin-bottom:
|
|
15
|
+
margin-bottom: 12px;
|
|
16
|
+
max-width: 100%;
|
|
17
|
+
|
|
18
|
+
.condition-all-content {
|
|
19
|
+
overflow: auto;
|
|
20
|
+
}
|
|
15
21
|
|
|
16
22
|
/* 添加相对定位 */
|
|
17
23
|
.condition-all-undelete {
|
|
18
24
|
display: flex;
|
|
19
25
|
align-items: center;
|
|
20
26
|
position: relative;
|
|
21
|
-
border: 1px dashed
|
|
27
|
+
border: 1px dashed @global-card-effect-background-color;
|
|
22
28
|
border-radius: 6px;
|
|
29
|
+
padding: 6px 8px 6px 6px;
|
|
23
30
|
|
|
24
31
|
.condition-item {
|
|
25
32
|
display: flex;
|
|
26
33
|
align-items: center;
|
|
27
34
|
position: relative;
|
|
35
|
+
padding-right: 8px;
|
|
28
36
|
|
|
29
37
|
.condition-select-left {
|
|
30
|
-
padding:
|
|
38
|
+
padding-right: 4px;
|
|
39
|
+
width: 120px;
|
|
31
40
|
}
|
|
32
41
|
|
|
33
42
|
.condition-select-middle {
|
|
34
|
-
padding:
|
|
43
|
+
padding-right: 4px;
|
|
35
44
|
}
|
|
36
45
|
|
|
37
46
|
.condition-input-right {
|
|
38
|
-
padding: 6px 4px;
|
|
39
|
-
margin-right: 4px;
|
|
40
47
|
width: 88px;
|
|
41
48
|
|
|
42
49
|
.condition-tooltip {
|
|
@@ -50,13 +57,13 @@
|
|
|
50
57
|
.condition-item-del {
|
|
51
58
|
border-radius: 50%;
|
|
52
59
|
background-color: @globalColor8;
|
|
53
|
-
line-height:
|
|
54
|
-
height:
|
|
55
|
-
width:
|
|
56
|
-
font-size:
|
|
60
|
+
line-height: 18px;
|
|
61
|
+
height: 16px;
|
|
62
|
+
width: 16px;
|
|
63
|
+
font-size: 9px;
|
|
57
64
|
display: none;
|
|
58
65
|
position: absolute;
|
|
59
|
-
top:
|
|
66
|
+
top: -6px;
|
|
60
67
|
right: 0;
|
|
61
68
|
cursor: pointer;
|
|
62
69
|
border: none;
|
|
@@ -65,15 +72,8 @@
|
|
|
65
72
|
}
|
|
66
73
|
|
|
67
74
|
.condition-add {
|
|
68
|
-
display: flex;
|
|
69
|
-
width: 36px;
|
|
70
|
-
height: 36px;
|
|
71
|
-
justify-content: center;
|
|
72
|
-
align-items: center;
|
|
73
|
-
cursor: pointer;
|
|
74
|
-
|
|
75
75
|
i {
|
|
76
|
-
font-size:
|
|
76
|
+
font-size: 20px;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -85,10 +85,10 @@
|
|
|
85
85
|
.condition-del {
|
|
86
86
|
border-radius: 50%;
|
|
87
87
|
background-color: @globalColor8;
|
|
88
|
-
line-height:
|
|
89
|
-
height:
|
|
90
|
-
width:
|
|
91
|
-
font-size:
|
|
88
|
+
line-height: 18px;
|
|
89
|
+
height: 16px;
|
|
90
|
+
width: 16px;
|
|
91
|
+
font-size: 9px;
|
|
92
92
|
display: none;
|
|
93
93
|
position: absolute;
|
|
94
94
|
top: -6px;
|
|
@@ -106,20 +106,4 @@
|
|
|
106
106
|
.condition-link {
|
|
107
107
|
padding-right: 8px;
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
.condition-add-group {
|
|
111
|
-
display: flex;
|
|
112
|
-
flex-shrink: 0;
|
|
113
|
-
width: auto;
|
|
114
|
-
border: 2px solid @splite-line;
|
|
115
|
-
border-radius: 6px;
|
|
116
|
-
padding: 4px;
|
|
117
|
-
justify-content: center;
|
|
118
|
-
align-items: center;
|
|
119
|
-
cursor: pointer;
|
|
120
|
-
|
|
121
|
-
span {
|
|
122
|
-
padding-left: 6px;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
109
|
}
|
|
@@ -5,11 +5,15 @@
|
|
|
5
5
|
.btnContainer {
|
|
6
6
|
width: 100%;
|
|
7
7
|
text-align: right;
|
|
8
|
+
margin-top: 12px !important;
|
|
9
|
+
padding-top: 0 !important;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
.formBtnContainer {
|
|
11
13
|
width: 100%;
|
|
12
14
|
text-align: center;
|
|
15
|
+
margin-top: 12px !important;
|
|
16
|
+
padding-top: 0 !important;
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
.sectionInput {
|
|
@@ -60,3 +64,13 @@
|
|
|
60
64
|
.custom-light-input-number {
|
|
61
65
|
width: 100% !important;
|
|
62
66
|
}
|
|
67
|
+
|
|
68
|
+
.customFormRow {
|
|
69
|
+
.ant-col {
|
|
70
|
+
&:last-child {
|
|
71
|
+
.ant-form-item {
|
|
72
|
+
margin-bottom: 0;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -253,6 +253,8 @@ var Row = function Row(_ref) {
|
|
|
253
253
|
};
|
|
254
254
|
var rowMouseLeave = function rowMouseLeave() {
|
|
255
255
|
onRowMouseLeave === null || onRowMouseLeave === void 0 || onRowMouseLeave(row);
|
|
256
|
+
// 鼠标移出,清除border
|
|
257
|
+
clearHoverRowIndex === null || clearHoverRowIndex === void 0 || clearHoverRowIndex();
|
|
256
258
|
};
|
|
257
259
|
var handleCellRightClick = function handleCellRightClick(e, cell) {
|
|
258
260
|
onCellContextMenu(e, cell);
|
|
@@ -43,11 +43,12 @@ table {
|
|
|
43
43
|
align-items: center;
|
|
44
44
|
|
|
45
45
|
.cell-left-header {
|
|
46
|
-
display: box;
|
|
46
|
+
display: -webkit-box;
|
|
47
47
|
-webkit-box-orient: vertical;
|
|
48
48
|
overflow: hidden;
|
|
49
49
|
text-overflow: ellipsis;
|
|
50
50
|
white-space: normal;
|
|
51
|
+
word-break: break-all;
|
|
51
52
|
|
|
52
53
|
.ant-checkbox-wrapper {
|
|
53
54
|
line-height: 16px;
|
|
@@ -21,7 +21,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
21
21
|
import { MinusSquareOutlined, PlusSquareOutlined } from '@ant-design/icons';
|
|
22
22
|
import { getCoreRowModel, getExpandedRowModel, getFacetedUniqueValues, getFilteredRowModel, getSortedRowModel, useReactTable } from '@tanstack/react-table';
|
|
23
23
|
import { useUpdateEffect } from 'ahooks';
|
|
24
|
-
import { Button, Checkbox,
|
|
24
|
+
import { Button, Checkbox, Form, Pagination, Upload } from 'antd';
|
|
25
25
|
import dayjs from 'dayjs';
|
|
26
26
|
import { cloneDeep, debounce } from 'lodash';
|
|
27
27
|
import React, { createContext, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
@@ -35,7 +35,6 @@ import ColumnSetting from "./components/ColumnSetting";
|
|
|
35
35
|
import customSortFns, { setDefaultSortFn } from "./components/ColumnSort/customSortFns";
|
|
36
36
|
import PaginationV2 from "./components/PaginationV2";
|
|
37
37
|
import "./tableMax.less";
|
|
38
|
-
import { LayoutType, layoutOptions } from "./type";
|
|
39
38
|
import { downloadExcel, getFormatFilters, getFormatSorting, getSizeInfo, operationColumnNoTooltips } from "./utils";
|
|
40
39
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
41
40
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -1136,10 +1135,9 @@ var TableMax = function TableMax(_ref) {
|
|
|
1136
1135
|
|
|
1137
1136
|
// console.log('columnsSizeMap render');
|
|
1138
1137
|
|
|
1139
|
-
var changeCompactMode =
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
}, []);
|
|
1138
|
+
var changeCompactMode = function changeCompactMode() {
|
|
1139
|
+
setCompactMode(!compactMode);
|
|
1140
|
+
};
|
|
1143
1141
|
return /*#__PURE__*/_jsx(Form, {
|
|
1144
1142
|
form: form,
|
|
1145
1143
|
component: false,
|
|
@@ -1235,24 +1233,13 @@ var TableMax = function TableMax(_ref) {
|
|
|
1235
1233
|
marginRight: 0
|
|
1236
1234
|
},
|
|
1237
1235
|
onClick: handleClickDelete
|
|
1238
|
-
}), canCompact && /*#__PURE__*/_jsx(
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
defaultSelectedKeys: [compactMode ? LayoutType.COMPACT : LayoutType.NORMAL]
|
|
1236
|
+
}), canCompact && /*#__PURE__*/_jsx("i", {
|
|
1237
|
+
className: "iconfont-table ".concat(compactMode ? 'icon-table-normal' : 'icon-table-tight', " handleRightItem"),
|
|
1238
|
+
style: {
|
|
1239
|
+
fontSize: '16px',
|
|
1240
|
+
marginRight: 0
|
|
1244
1241
|
},
|
|
1245
|
-
|
|
1246
|
-
children: /*#__PURE__*/_jsx("i", {
|
|
1247
|
-
className: "iconfont-table icon-table-midu handleRightItem",
|
|
1248
|
-
style: {
|
|
1249
|
-
fontSize: '16px',
|
|
1250
|
-
marginRight: 0
|
|
1251
|
-
},
|
|
1252
|
-
onClick: function onClick(e) {
|
|
1253
|
-
return e.preventDefault();
|
|
1254
|
-
}
|
|
1255
|
-
})
|
|
1242
|
+
onClick: changeCompactMode
|
|
1256
1243
|
}), canSetting && /*#__PURE__*/_jsx(ColumnSetting, {
|
|
1257
1244
|
table: table,
|
|
1258
1245
|
tableId: tableId,
|
|
@@ -8,7 +8,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
8
8
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
9
9
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
10
|
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; }
|
|
11
|
-
import { Checkbox,
|
|
11
|
+
import { Checkbox, Segmented, Switch, Tooltip } from 'antd';
|
|
12
12
|
import { cloneDeep } from 'lodash';
|
|
13
13
|
import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
14
14
|
import { useDrag, useDrop } from 'react-dnd';
|
|
@@ -31,12 +31,6 @@ var headerRowNumOptions = [{
|
|
|
31
31
|
}, {
|
|
32
32
|
value: 3,
|
|
33
33
|
label: '3行'
|
|
34
|
-
}, {
|
|
35
|
-
value: 4,
|
|
36
|
-
label: '4行'
|
|
37
|
-
}, {
|
|
38
|
-
value: 5,
|
|
39
|
-
label: '5行'
|
|
40
34
|
}];
|
|
41
35
|
var SettingItem = function SettingItem(_ref) {
|
|
42
36
|
var _column$columnDef, _column$columnDef2;
|
|
@@ -363,17 +357,12 @@ var ColumnSetting = function ColumnSetting(_ref3) {
|
|
|
363
357
|
className: "header-row-num-setting",
|
|
364
358
|
children: [/*#__PURE__*/_jsx("span", {
|
|
365
359
|
children: "\u6807\u9898\u884C\u6570"
|
|
366
|
-
}), /*#__PURE__*/_jsx(
|
|
367
|
-
|
|
360
|
+
}), /*#__PURE__*/_jsx(Segmented, {
|
|
361
|
+
options: headerRowNumOptions,
|
|
362
|
+
value: headerRowNum,
|
|
363
|
+
onChange: onHeaderRowNumChange,
|
|
368
364
|
style: {
|
|
369
|
-
width: 80,
|
|
370
365
|
marginLeft: 12
|
|
371
|
-
},
|
|
372
|
-
defaultValue: headerRowNum,
|
|
373
|
-
onChange: onHeaderRowNumChange,
|
|
374
|
-
options: headerRowNumOptions,
|
|
375
|
-
getPopupContainer: function getPopupContainer() {
|
|
376
|
-
return configWrapperRef.current;
|
|
377
366
|
}
|
|
378
367
|
})]
|
|
379
368
|
})]
|
|
@@ -33,6 +33,28 @@
|
|
|
33
33
|
display: flex;
|
|
34
34
|
align-items: center;
|
|
35
35
|
width: 100%;
|
|
36
|
+
color: @global-default-text-color;
|
|
37
|
+
.ant-segmented {
|
|
38
|
+
background: @global-card-background-color;
|
|
39
|
+
height: 28px;
|
|
40
|
+
padding: 2px;
|
|
41
|
+
.ant-segmented-thumb {
|
|
42
|
+
background: @global-card-effect-background-color;
|
|
43
|
+
}
|
|
44
|
+
.ant-segmented-item {
|
|
45
|
+
color: @global-default-text-color;
|
|
46
|
+
height: 24px;
|
|
47
|
+
width: 46px;
|
|
48
|
+
.ant-segmented-item-label {
|
|
49
|
+
height: 24px;
|
|
50
|
+
line-height: 24px;
|
|
51
|
+
min-height: 24px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
.ant-segmented-item-selected {
|
|
55
|
+
background: @global-card-effect-background-color;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
36
58
|
}
|
|
37
59
|
}
|
|
38
60
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { TableMaxColumnType } from "../../type";
|
|
2
|
-
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
3
|
-
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
4
|
-
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
5
|
-
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
2
|
+
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
3
|
+
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
4
|
+
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
5
|
+
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
6
6
|
declare const customSortFns: {
|
|
7
|
-
numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
8
|
-
stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
9
|
-
timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
10
|
-
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
7
|
+
numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
8
|
+
stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
9
|
+
timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
10
|
+
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
11
11
|
};
|
|
12
12
|
export default customSortFns;
|
|
13
13
|
export type SortFnType = keyof typeof customSortFns | undefined;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
.table-max-dragger-layer-wrapper {
|
|
2
2
|
position: fixed;
|
|
3
3
|
pointer-events: none;
|
|
4
|
-
opacity: 0.5;
|
|
4
|
+
// opacity: 0.5;
|
|
5
5
|
left: 0;
|
|
6
6
|
top: 0;
|
|
7
|
+
z-index: 9999;
|
|
7
8
|
|
|
8
9
|
.tbody-tr,
|
|
9
10
|
.tbody-tr-selected {
|
|
@@ -16,8 +17,8 @@
|
|
|
16
17
|
.tbody-tr-td-drag,
|
|
17
18
|
.tbody-tr-selected > .tbody-tr-td,
|
|
18
19
|
.tbody-tr-selected > .tbody-tr-td-drag {
|
|
19
|
-
background-color: @
|
|
20
|
-
border-bottom: 1px solid @tableColor2;
|
|
20
|
+
background-color: @global-card-effect-background-color;
|
|
21
|
+
// border-bottom: 1px solid @tableColor2;
|
|
21
22
|
height: 32px;
|
|
22
23
|
line-height: 32px;
|
|
23
24
|
padding: 0 8px;
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
|
|
32
33
|
.tbody-tr-selected > .tbody-tr-td,
|
|
33
34
|
.tbody-tr-selected > .tbody-tr-td-drag {
|
|
34
|
-
background: @
|
|
35
|
+
background: @global-card-effect-background-color;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
.tbody-tr-td-drag:hover {
|
|
@@ -44,7 +44,13 @@
|
|
|
44
44
|
@tableColor8: var(--tableColor8, #f5f6f7); // 表格列设置区-列表元素hover背景色
|
|
45
45
|
@tableTooltipBgc: var(--tableTooltipBgc, #f5f6f7); // 表格tooltip背景色
|
|
46
46
|
@tableSettingModalBgc: var(--tableSettingModalBgc, #ffffff); // 表格的body的背景底色
|
|
47
|
-
@global-tip-text-color: var(--global-tip-text-color, rgba(255,255,255,0.45)); //提醒色/暂无数据颜色/placeholder颜色
|
|
47
|
+
@global-tip-text-color: var(--global-tip-text-color, rgba(255, 255, 255, 0.45)); //提醒色/暂无数据颜色/placeholder颜色
|
|
48
48
|
@global-icon-color: var(--global-icon-color, #ffffff); //图标色
|
|
49
|
-
@global-
|
|
49
|
+
@global-hover-background-color: var(--global-hover-background-color, #010c31f2); // 表格行hover背景色
|
|
50
50
|
@global-hover-box-shadow-color: var(--global-hover-box-shadow-color, #03062173); // hover/右键框投影颜色
|
|
51
|
+
@global-disabled-background-color: var(--global-disabled-background-color, #0f2347); // 禁用背景色
|
|
52
|
+
|
|
53
|
+
@global-icon-text-color: var(--global-icon-text-color, #455169);
|
|
54
|
+
@global-card-background-color: var(--global-card-background-color, #0c1b3b);
|
|
55
|
+
@global-card-effect-background-color: var(--global-card-effect-background-color, #1e345b);
|
|
56
|
+
@global-default-text-color: var(--global-default-text-color, #fff);
|
|
@@ -61,12 +61,17 @@ export var PublicThemeVariablesConfig = {
|
|
|
61
61
|
// 表格tooltip背景色
|
|
62
62
|
'--global-desc-text-disabled-color': '#d3e7fa3f',
|
|
63
63
|
// 全局默认 禁用/选中 字体颜色
|
|
64
|
-
'--tableSettingModalBgc': '#
|
|
64
|
+
'--tableSettingModalBgc': '#FFFFFFF2',
|
|
65
65
|
// 表格的body的背景底色
|
|
66
|
-
'--global-tip-text-color':
|
|
67
|
-
'--global-icon-color':
|
|
68
|
-
'--global-
|
|
69
|
-
'--global-hover-box-shadow-color':
|
|
66
|
+
'--global-tip-text-color': 'rgba(36,42,48,0.45)',
|
|
67
|
+
'--global-icon-color': '#455169',
|
|
68
|
+
'--global-hover-background-color': '#ebebebf2',
|
|
69
|
+
'--global-hover-box-shadow-color': '#0306211a',
|
|
70
|
+
'--global-disabled-background-color': '#F2F2F2',
|
|
71
|
+
'--global-icon-text-color': '#fff',
|
|
72
|
+
'--global-card-background-color': '#F7F7F8',
|
|
73
|
+
'--global-card-effect-background-color': '#E8E8E8',
|
|
74
|
+
'--global-default-text-color': '#242A30'
|
|
70
75
|
},
|
|
71
76
|
dark: {
|
|
72
77
|
'--global-curd-input-background-color': '#494c5dff',
|
|
@@ -131,12 +136,17 @@ export var PublicThemeVariablesConfig = {
|
|
|
131
136
|
// 表格tooltip背景色
|
|
132
137
|
'--global-desc-text-disabled-color': '#d3e7fa3f',
|
|
133
138
|
// 全局默认 禁用/选中 字体颜色
|
|
134
|
-
'--tableSettingModalBgc': '#
|
|
139
|
+
'--tableSettingModalBgc': '#0F2347F2',
|
|
135
140
|
// 表格的body的背景底色
|
|
136
|
-
'--global-tip-text-color':
|
|
141
|
+
'--global-tip-text-color': 'rgba(255,255,255,0.45)',
|
|
137
142
|
// 提醒色/暂无数据颜色/placeholder颜
|
|
138
|
-
'--global-icon-color':
|
|
139
|
-
'--global-
|
|
140
|
-
'--global-hover-box-shadow-color':
|
|
143
|
+
'--global-icon-color': '#fff',
|
|
144
|
+
'--global-hover-background-color': '#010C31f2',
|
|
145
|
+
'--global-hover-box-shadow-color': '#03062173',
|
|
146
|
+
'--global-disabled-background-color': '#0F2347',
|
|
147
|
+
'--global-icon-text-color': '#455169',
|
|
148
|
+
'--global-card-background-color': '#0C1B3B',
|
|
149
|
+
'--global-card-effect-background-color': '#1E345B',
|
|
150
|
+
'--global-default-text-color': '#fff'
|
|
141
151
|
}
|
|
142
152
|
};
|
package/dist/utils/request.d.ts
CHANGED
package/dist/utils/request.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arim-aisdc/public-components",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "前端组件库",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
"@tanstack/match-sorter-utils": "^8.8.4",
|
|
52
52
|
"@tanstack/react-table": "^8.9.1",
|
|
53
53
|
"ahooks": "^3.7.8",
|
|
54
|
-
"antd": "^5.18.3",
|
|
55
54
|
"classnames": "^2.5.1",
|
|
56
55
|
"css-vars-ponyfill": "^2.4.8",
|
|
57
56
|
"dayjs": "^1.11.11",
|
|
@@ -67,8 +66,7 @@
|
|
|
67
66
|
"react-dnd-html5-backend": "^16.0.1",
|
|
68
67
|
"react-draggable": "^4.4.6",
|
|
69
68
|
"react-router-dom": "^6.22.3",
|
|
70
|
-
"react-split-pane": "^0.1.92"
|
|
71
|
-
"umi-request": "^1.4.0"
|
|
69
|
+
"react-split-pane": "^0.1.92"
|
|
72
70
|
},
|
|
73
71
|
"devDependencies": {
|
|
74
72
|
"@commitlint/cli": "^17.1.2",
|