ns-base-module 1.0.0
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/LICENSE +21 -0
- package/README.md +20 -0
- package/dist/Button/AntdIconButton.d.ts +11 -0
- package/dist/Button/AntdIconButton.d.ts.map +1 -0
- package/dist/Button/AntdIconButton.js +22 -0
- package/dist/Button/ConfigButton.d.ts +18 -0
- package/dist/Button/ConfigButton.d.ts.map +1 -0
- package/dist/Button/ConfigButton.js +78 -0
- package/dist/Button/index.d.ts +8 -0
- package/dist/Button/index.d.ts.map +1 -0
- package/dist/Button/index.js +19 -0
- package/dist/ClassFilter/index.d.ts +11 -0
- package/dist/ClassFilter/index.d.ts.map +1 -0
- package/dist/ClassFilter/index.js +119 -0
- package/dist/ClassFilter/indexVertical.d.ts +10 -0
- package/dist/ClassFilter/indexVertical.d.ts.map +1 -0
- package/dist/ClassFilter/indexVertical.js +69 -0
- package/dist/ClassFilter/util.d.ts +17 -0
- package/dist/ClassFilter/util.d.ts.map +1 -0
- package/dist/ClassFilter/util.js +135 -0
- package/dist/CopyCol/index.d.ts +4 -0
- package/dist/CopyCol/index.d.ts.map +1 -0
- package/dist/CopyCol/index.js +57 -0
- package/dist/Entry/EntryCriteria.d.ts +17 -0
- package/dist/Entry/EntryCriteria.d.ts.map +1 -0
- package/dist/Entry/EntryCriteria.js +138 -0
- package/dist/Entry/EntryItem.d.ts +34 -0
- package/dist/Entry/EntryItem.d.ts.map +1 -0
- package/dist/Entry/EntryItem.js +757 -0
- package/dist/Entry/components/Checkbox.d.ts +12 -0
- package/dist/Entry/components/Checkbox.d.ts.map +1 -0
- package/dist/Entry/components/Checkbox.js +15 -0
- package/dist/Entry/components/ChooseModalTable.d.ts +15 -0
- package/dist/Entry/components/ChooseModalTable.d.ts.map +1 -0
- package/dist/Entry/components/ChooseModalTable.js +407 -0
- package/dist/Entry/components/Condition.d.ts +9 -0
- package/dist/Entry/components/Condition.d.ts.map +1 -0
- package/dist/Entry/components/Condition.js +30 -0
- package/dist/Entry/components/DatePicker.d.ts +12 -0
- package/dist/Entry/components/DatePicker.d.ts.map +1 -0
- package/dist/Entry/components/DatePicker.js +12 -0
- package/dist/Entry/components/Etable2Modal.d.ts +4 -0
- package/dist/Entry/components/Etable2Modal.d.ts.map +1 -0
- package/dist/Entry/components/Etable2Modal.js +122 -0
- package/dist/Entry/components/Express.d.ts +8 -0
- package/dist/Entry/components/Express.d.ts.map +1 -0
- package/dist/Entry/components/Express.js +30 -0
- package/dist/Entry/components/GroupInput.d.ts +13 -0
- package/dist/Entry/components/GroupInput.d.ts.map +1 -0
- package/dist/Entry/components/GroupInput.js +77 -0
- package/dist/Entry/components/ImageText.d.ts +13 -0
- package/dist/Entry/components/ImageText.d.ts.map +1 -0
- package/dist/Entry/components/ImageText.js +235 -0
- package/dist/Entry/components/Input.d.ts +27 -0
- package/dist/Entry/components/Input.d.ts.map +1 -0
- package/dist/Entry/components/Input.js +86 -0
- package/dist/Entry/components/InputNumber.d.ts +18 -0
- package/dist/Entry/components/InputNumber.d.ts.map +1 -0
- package/dist/Entry/components/InputNumber.js +111 -0
- package/dist/Entry/components/InputNumberRange.d.ts +10 -0
- package/dist/Entry/components/InputNumberRange.d.ts.map +1 -0
- package/dist/Entry/components/InputNumberRange.js +58 -0
- package/dist/Entry/components/ListSelect.d.ts +15 -0
- package/dist/Entry/components/ListSelect.d.ts.map +1 -0
- package/dist/Entry/components/ListSelect.js +110 -0
- package/dist/Entry/components/ObjectSelect.d.ts +14 -0
- package/dist/Entry/components/ObjectSelect.d.ts.map +1 -0
- package/dist/Entry/components/ObjectSelect.js +91 -0
- package/dist/Entry/components/Progress.d.ts +11 -0
- package/dist/Entry/components/Progress.d.ts.map +1 -0
- package/dist/Entry/components/Progress.js +63 -0
- package/dist/Entry/components/Radio.d.ts +15 -0
- package/dist/Entry/components/Radio.d.ts.map +1 -0
- package/dist/Entry/components/Radio.js +17 -0
- package/dist/Entry/components/Select.d.ts +29 -0
- package/dist/Entry/components/Select.d.ts.map +1 -0
- package/dist/Entry/components/Select.js +113 -0
- package/dist/Entry/components/Switch.d.ts +6 -0
- package/dist/Entry/components/Switch.d.ts.map +1 -0
- package/dist/Entry/components/Switch.js +19 -0
- package/dist/Entry/components/TagsDatePicker.d.ts +7 -0
- package/dist/Entry/components/TagsDatePicker.d.ts.map +1 -0
- package/dist/Entry/components/TagsDatePicker.js +229 -0
- package/dist/Entry/components/TimePicker.d.ts +6 -0
- package/dist/Entry/components/TimePicker.d.ts.map +1 -0
- package/dist/Entry/components/TimePicker.js +6 -0
- package/dist/Entry/components/TreeSelect.d.ts +6 -0
- package/dist/Entry/components/TreeSelect.d.ts.map +1 -0
- package/dist/Entry/components/TreeSelect.js +18 -0
- package/dist/Entry/components/index.scss +97 -0
- package/dist/Entry/components/utils.d.ts +1 -0
- package/dist/Entry/components/utils.d.ts.map +1 -0
- package/dist/Entry/components/utils.js +6 -0
- package/dist/Entry/data.d.ts +133 -0
- package/dist/Entry/index.d.ts +54 -0
- package/dist/Entry/index.d.ts.map +1 -0
- package/dist/Entry/index.js +45 -0
- package/dist/FilterPopover/Filter.d.ts +24 -0
- package/dist/FilterPopover/Filter.d.ts.map +1 -0
- package/dist/FilterPopover/Filter.js +370 -0
- package/dist/FilterPopover/FilterClearIcon.d.ts +8 -0
- package/dist/FilterPopover/FilterClearIcon.d.ts.map +1 -0
- package/dist/FilterPopover/FilterClearIcon.js +45 -0
- package/dist/FilterPopover/index.d.ts +20 -0
- package/dist/FilterPopover/index.d.ts.map +1 -0
- package/dist/FilterPopover/index.js +136 -0
- package/dist/Icon/IconCreate.d.ts +11 -0
- package/dist/Icon/IconCreate.d.ts.map +1 -0
- package/dist/Icon/IconCreate.js +22 -0
- package/dist/Icon/index.d.ts +6 -0
- package/dist/Icon/index.d.ts.map +1 -0
- package/dist/Icon/index.js +22 -0
- package/dist/WidgetConfig/index.d.ts +40 -0
- package/dist/WidgetConfig/index.d.ts.map +1 -0
- package/dist/WidgetConfig/index.js +129 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/test/index.d.ts +4 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +7 -0
- package/dist/umd/ns-base-module.min.js +1 -0
- package/dist/utils/cache.d.ts +17 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +127 -0
- package/dist/utils/enum.d.ts +22 -0
- package/dist/utils/enum.d.ts.map +1 -0
- package/dist/utils/enum.js +37 -0
- package/dist/utils/language.d.ts +241 -0
- package/dist/utils/language.d.ts.map +1 -0
- package/dist/utils/language.js +247 -0
- package/dist/utils/request.d.ts +15 -0
- package/dist/utils/request.d.ts.map +1 -0
- package/dist/utils/request.js +180 -0
- package/dist/utils/utils.d.ts +113 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +462 -0
- package/package.json +97 -0
- package/style/basics.scss +671 -0
- package/style/components/ClassFilter.scss +69 -0
- package/style/components/FilterPopover.scss +34 -0
- package/style/components/index.scss +2 -0
- package/style/default.scss +1219 -0
- package/style/index.scss +1 -0
- package/style/mixins/index.scss +28 -0
- package/style/mixins/libs/tint.scss +23 -0
- package/style/variables.scss +684 -0
- package/types/Action.d.ts +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 735249091@qq.com
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Date: 2023-03-07 18:49:37
|
|
3
|
+
* @description:
|
|
4
|
+
* @author chenchangfu
|
|
5
|
+
* Copyright (c) 2019, AUTHOR. All rights reserved.
|
|
6
|
+
* AUTHOR PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# ns-base-module
|
|
10
|
+
|
|
11
|
+
项目基础依赖包
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
npm unlink
|
|
15
|
+
npm run build:watch
|
|
16
|
+
npm link
|
|
17
|
+
|
|
18
|
+
在需要引入的项目中ns-rams-ui运行:
|
|
19
|
+
npm link ns-base-module
|
|
20
|
+
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* icon 为antd4版本的icon
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type { ButtonProps } from 'antd';
|
|
6
|
+
interface IconButtonProps extends Omit<ButtonProps, 'icon'> {
|
|
7
|
+
icon?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const IconButton: React.FC<IconButtonProps>;
|
|
10
|
+
export default IconButton;
|
|
11
|
+
//# sourceMappingURL=AntdIconButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AntdIconButton.d.ts","sourceRoot":"","sources":["AntdIconButton.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAIxC,UAAU,eAAgB,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAQzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var _excluded = ["icon"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
/**
|
|
6
|
+
* icon 为antd4版本的icon
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { Button } from 'antd';
|
|
10
|
+
import { IconCreate } from '@/components/Icon';
|
|
11
|
+
var IconButton = function IconButton(_ref) {
|
|
12
|
+
var icon = _ref.icon,
|
|
13
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
15
|
+
size: "small",
|
|
16
|
+
icon: icon ? /*#__PURE__*/React.createElement(IconCreate, {
|
|
17
|
+
type: "default",
|
|
18
|
+
iconType: icon
|
|
19
|
+
}) : undefined
|
|
20
|
+
}, props));
|
|
21
|
+
};
|
|
22
|
+
export default IconButton;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 根据配置渲染的按钮
|
|
3
|
+
* @param button 按钮配置
|
|
4
|
+
* @param loading 加载状态
|
|
5
|
+
* @param selectedRowKeys 勾选key组(列表的勾选key组)
|
|
6
|
+
* @param onClick 按钮点击事件
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import type { ButtonsType } from '@/components/v2/ButtonGroup';
|
|
10
|
+
interface ConfigButtonProps {
|
|
11
|
+
button: ButtonsType;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
selectedRowKeys?: any[];
|
|
14
|
+
onClick: (button: ButtonsType) => void;
|
|
15
|
+
}
|
|
16
|
+
declare const ConfigButton: React.FC<ConfigButtonProps>;
|
|
17
|
+
export default ConfigButton;
|
|
18
|
+
//# sourceMappingURL=ConfigButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigButton.d.ts","sourceRoot":"","sources":["ConfigButton.tsx"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,UAAU,iBAAiB;IACzB,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC;IACxB,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CACxC;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAiD7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
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 _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
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
|
+
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
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
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); }
|
|
8
|
+
/*
|
|
9
|
+
* @Date: 2023-04-07 10:27:41
|
|
10
|
+
* @description:
|
|
11
|
+
* @author chenchangfu
|
|
12
|
+
* Copyright (c) 2019, AUTHOR. All rights reserved.
|
|
13
|
+
* AUTHOR PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* 根据配置渲染的按钮
|
|
17
|
+
* @param button 按钮配置
|
|
18
|
+
* @param loading 加载状态
|
|
19
|
+
* @param selectedRowKeys 勾选key组(列表的勾选key组)
|
|
20
|
+
* @param onClick 按钮点击事件
|
|
21
|
+
*/
|
|
22
|
+
import React from 'react';
|
|
23
|
+
import Button from "./AntdIconButton";
|
|
24
|
+
import { Tooltip } from 'antd';
|
|
25
|
+
import { initLang } from '@/utils/language';
|
|
26
|
+
var ConfigButton = function ConfigButton(_ref) {
|
|
27
|
+
var _button$config, _button$config$style, _button$config2, _button$config3, _button$config4, _button$config5, _button$config6, _button$config7, _button$config8, _button$config9;
|
|
28
|
+
var button = _ref.button,
|
|
29
|
+
loading = _ref.loading,
|
|
30
|
+
selectedRowKeys = _ref.selectedRowKeys,
|
|
31
|
+
_onClick = _ref.onClick;
|
|
32
|
+
var iconOnClick = function iconOnClick() {
|
|
33
|
+
return _onClick(button);
|
|
34
|
+
};
|
|
35
|
+
var param = {
|
|
36
|
+
// icon="PlusOutlined"
|
|
37
|
+
icon: button === null || button === void 0 || (_button$config = button.config) === null || _button$config === void 0 ? void 0 : _button$config.icon,
|
|
38
|
+
style: _objectSpread({
|
|
39
|
+
marginRight: 5
|
|
40
|
+
}, (_button$config$style = button === null || button === void 0 || (_button$config2 = button.config) === null || _button$config2 === void 0 ? void 0 : _button$config2.style) !== null && _button$config$style !== void 0 ? _button$config$style : {}),
|
|
41
|
+
type: button === null || button === void 0 ? void 0 : button.type,
|
|
42
|
+
key: button === null || button === void 0 ? void 0 : button.code,
|
|
43
|
+
onClick: function onClick() {
|
|
44
|
+
return _onClick(button);
|
|
45
|
+
},
|
|
46
|
+
loading: loading,
|
|
47
|
+
className: !(button !== null && button !== void 0 && button.config.min) || (button === null || button === void 0 || (_button$config3 = button.config) === null || _button$config3 === void 0 ? void 0 : _button$config3.min) == 1 && (button === null || button === void 0 || (_button$config4 = button.config) === null || _button$config4 === void 0 ? void 0 : _button$config4.max) == 1 && (selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length) == 1 || (button === null || button === void 0 || (_button$config5 = button.config) === null || _button$config5 === void 0 ? void 0 : _button$config5.min) > 0 && button !== null && button !== void 0 && (_button$config6 = button.config) !== null && _button$config6 !== void 0 && _button$config6.max && (button === null || button === void 0 || (_button$config7 = button.config) === null || _button$config7 === void 0 ? void 0 : _button$config7.max) > 1 && selectedRowKeys !== null && selectedRowKeys !== void 0 && selectedRowKeys.length ? 'show' : 'hide',
|
|
48
|
+
title: button === null || button === void 0 || (_button$config8 = button.config) === null || _button$config8 === void 0 ? void 0 : _button$config8.desc
|
|
49
|
+
};
|
|
50
|
+
if (button.iconType) {
|
|
51
|
+
iconOnClick = function iconOnClick() {
|
|
52
|
+
if (!loading) {
|
|
53
|
+
return _onClick(button);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
// console.log('iconType', button.iconType);
|
|
58
|
+
return button.iconType ?
|
|
59
|
+
/*#__PURE__*/
|
|
60
|
+
// <Tooltip title={button.tipText}>
|
|
61
|
+
React.createElement(Tooltip, {
|
|
62
|
+
placement: "top",
|
|
63
|
+
title: initLang({
|
|
64
|
+
id: button.iconTypeId || 'list.export'
|
|
65
|
+
})
|
|
66
|
+
}, /*#__PURE__*/React.createElement("span", _extends({}, param, {
|
|
67
|
+
onClick: iconOnClick,
|
|
68
|
+
style: {
|
|
69
|
+
cursor: 'pointer',
|
|
70
|
+
marginLeft: 10,
|
|
71
|
+
opacity: loading ? 0.5 : 1
|
|
72
|
+
}
|
|
73
|
+
}), button.iconType)) :
|
|
74
|
+
/*#__PURE__*/
|
|
75
|
+
// </Tooltip>
|
|
76
|
+
React.createElement(Button, param, button === null || button === void 0 || (_button$config9 = button.config) === null || _button$config9 === void 0 ? void 0 : _button$config9.name);
|
|
77
|
+
};
|
|
78
|
+
export default ConfigButton;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ButtonProps } from 'antd';
|
|
3
|
+
import AntdIconButton from './AntdIconButton';
|
|
4
|
+
import ConfigButton from './ConfigButton';
|
|
5
|
+
declare const index: (props: ButtonProps) => React.JSX.Element;
|
|
6
|
+
export default index;
|
|
7
|
+
export { AntdIconButton, ConfigButton };
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAIxC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,QAAA,MAAM,KAAK,UAAW,WAAW,sBAIhC,CAAC;AAEF,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Button } from 'antd';
|
|
4
|
+
import Icon from '@/components/Icon';
|
|
5
|
+
import AntdIconButton from "./AntdIconButton";
|
|
6
|
+
import ConfigButton from "./ConfigButton";
|
|
7
|
+
var index = function index(props) {
|
|
8
|
+
var icon = typeof props.icon == 'string' ? /*#__PURE__*/React.createElement(Icon, {
|
|
9
|
+
type: props.icon
|
|
10
|
+
}) : props.icon;
|
|
11
|
+
// console.log(props.icon);
|
|
12
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
13
|
+
size: "small"
|
|
14
|
+
}, props, {
|
|
15
|
+
icon: icon
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
export default index;
|
|
19
|
+
export { AntdIconButton, ConfigButton };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../../style/components/ClassFilter.scss";
|
|
3
|
+
export interface IclassFilter {
|
|
4
|
+
classFilter: any[];
|
|
5
|
+
onStatusTag?: (item: Record<string, any>, checkedItems: Record<string, any>[]) => void;
|
|
6
|
+
statusTagItem?: Record<string, any>;
|
|
7
|
+
statusTagCounts?: Record<string, number>;
|
|
8
|
+
}
|
|
9
|
+
declare const Index: ({ classFilter, ...props }: IclassFilter) => React.JSX.Element | null;
|
|
10
|
+
export default Index;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,yCAAyC,CAAC;AAKjD,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,GAAG,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,CACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAChC,IAAI,CAAC;IACV,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED,QAAA,MAAM,KAAK,8BAA+B,YAAY,6BAsHrD,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
var _excluded = ["classFilter"];
|
|
2
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
|
+
import { DownOutlined, QuestionCircleOutlined } from "@ant-design/icons";
|
|
5
|
+
import { Dropdown, Tooltip } from "antd";
|
|
6
|
+
import { cloneDeep } from "lodash";
|
|
7
|
+
import React, { useMemo } from "react";
|
|
8
|
+
import "../../style/components/ClassFilter.scss";
|
|
9
|
+
import { adapterFilter } from "./util";
|
|
10
|
+
|
|
11
|
+
// 分类过滤
|
|
12
|
+
|
|
13
|
+
var Index = function Index(_ref) {
|
|
14
|
+
var _props$statusTagItem3;
|
|
15
|
+
var classFilter = _ref.classFilter,
|
|
16
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
var handleStatus = function handleStatus(item) {
|
|
18
|
+
var _props$onStatusTag;
|
|
19
|
+
var serchList = adapterFilter(item);
|
|
20
|
+
(_props$onStatusTag = props.onStatusTag) === null || _props$onStatusTag === void 0 || _props$onStatusTag.call(props, item, serchList);
|
|
21
|
+
};
|
|
22
|
+
var iconStyle = function iconStyle(list) {
|
|
23
|
+
var _style = {
|
|
24
|
+
marginLeft: 3,
|
|
25
|
+
verticalAlign: "middle"
|
|
26
|
+
};
|
|
27
|
+
for (var i = 0, l = list.length; i < l; i++) {
|
|
28
|
+
var _props$statusTagItem;
|
|
29
|
+
if (list[i].key === (props === null || props === void 0 || (_props$statusTagItem = props.statusTagItem) === null || _props$statusTagItem === void 0 ? void 0 : _props$statusTagItem.key)) {
|
|
30
|
+
_style.color = "var(--antd-wave-shadow-color)";
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return _style;
|
|
35
|
+
};
|
|
36
|
+
var loopSetLabel = function loopSetLabel(tree) {
|
|
37
|
+
var _loop = function _loop() {
|
|
38
|
+
var _props$statusTagItem2, _props$statusTagCount, _props$statusTagCount2;
|
|
39
|
+
var d = tree[i];
|
|
40
|
+
tree[i].label = /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
style: {
|
|
42
|
+
padding: "5px 12px",
|
|
43
|
+
width: "100%"
|
|
44
|
+
},
|
|
45
|
+
onClick: function onClick() {
|
|
46
|
+
return handleStatus(d);
|
|
47
|
+
},
|
|
48
|
+
className: "".concat(d.key === (props === null || props === void 0 || (_props$statusTagItem2 = props.statusTagItem) === null || _props$statusTagItem2 === void 0 ? void 0 : _props$statusTagItem2.key) ? "actionMenu" : "")
|
|
49
|
+
}, d.remark && /*#__PURE__*/React.createElement(Tooltip, {
|
|
50
|
+
title: d.remark
|
|
51
|
+
}, /*#__PURE__*/React.createElement(QuestionCircleOutlined, {
|
|
52
|
+
style: {
|
|
53
|
+
marginRight: 3,
|
|
54
|
+
fontSize: 10
|
|
55
|
+
}
|
|
56
|
+
})), /*#__PURE__*/React.createElement("span", null, d.label), typeof ((_props$statusTagCount = props.statusTagCounts) === null || _props$statusTagCount === void 0 ? void 0 : _props$statusTagCount[d.key]) === "number" ? /*#__PURE__*/React.createElement("span", {
|
|
57
|
+
className: "num-txt",
|
|
58
|
+
style: {
|
|
59
|
+
backgroundColor: d.backgroundColor,
|
|
60
|
+
color: d.fontColor
|
|
61
|
+
}
|
|
62
|
+
}, (_props$statusTagCount2 = props.statusTagCounts) === null || _props$statusTagCount2 === void 0 ? void 0 : _props$statusTagCount2[d.key]) : null);
|
|
63
|
+
if (d.children && d.children.length) {
|
|
64
|
+
loopSetLabel(d.children);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
for (var i = 0, l = tree.length; i < l; i++) {
|
|
68
|
+
_loop();
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// label显示
|
|
73
|
+
var datas = useMemo(function () {
|
|
74
|
+
var _classFilter = cloneDeep(classFilter);
|
|
75
|
+
for (var i = 0, l = _classFilter.length; i < l; i++) {
|
|
76
|
+
if (_classFilter[i].children && _classFilter[i].children.length) {
|
|
77
|
+
loopSetLabel(_classFilter[i].children);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return _classFilter;
|
|
81
|
+
}, [classFilter, props.statusTagCounts, props === null || props === void 0 || (_props$statusTagItem3 = props.statusTagItem) === null || _props$statusTagItem3 === void 0 ? void 0 : _props$statusTagItem3.key]);
|
|
82
|
+
if (!classFilter) return null;
|
|
83
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
84
|
+
className: "tags-wrap class-filter-component"
|
|
85
|
+
}, datas === null || datas === void 0 ? void 0 : datas.map(function (item) {
|
|
86
|
+
var _props$statusTagItem4, _props$statusTagCount3, _props$statusTagCount4;
|
|
87
|
+
var baseDom = /*#__PURE__*/React.createElement("span", {
|
|
88
|
+
className: "tags-list".concat(" ", item.key === (props === null || props === void 0 || (_props$statusTagItem4 = props.statusTagItem) === null || _props$statusTagItem4 === void 0 ? void 0 : _props$statusTagItem4.key) ? "action" : ""),
|
|
89
|
+
key: item.key,
|
|
90
|
+
onClick: function onClick() {
|
|
91
|
+
return handleStatus(item);
|
|
92
|
+
}
|
|
93
|
+
}, item.remark && /*#__PURE__*/React.createElement(Tooltip, {
|
|
94
|
+
title: item.remark
|
|
95
|
+
}, /*#__PURE__*/React.createElement(QuestionCircleOutlined, {
|
|
96
|
+
style: {
|
|
97
|
+
marginRight: 3,
|
|
98
|
+
fontSize: 10
|
|
99
|
+
}
|
|
100
|
+
})), item.label, typeof ((_props$statusTagCount3 = props.statusTagCounts) === null || _props$statusTagCount3 === void 0 ? void 0 : _props$statusTagCount3[item.key]) === "number" ? /*#__PURE__*/React.createElement("span", {
|
|
101
|
+
className: "num-txt",
|
|
102
|
+
style: {
|
|
103
|
+
backgroundColor: item.backgroundColor,
|
|
104
|
+
color: item.fontColor
|
|
105
|
+
}
|
|
106
|
+
}, (_props$statusTagCount4 = props.statusTagCounts) === null || _props$statusTagCount4 === void 0 ? void 0 : _props$statusTagCount4[item.key]) :
|
|
107
|
+
// `(${contextFilter.statusTagCounts?.[item.key]})`
|
|
108
|
+
null, item.children && item.children.length ? /*#__PURE__*/React.createElement(DownOutlined, {
|
|
109
|
+
style: iconStyle(item.children)
|
|
110
|
+
}) : null);
|
|
111
|
+
return item.children && item.children.length ? /*#__PURE__*/React.createElement(Dropdown, {
|
|
112
|
+
overlayClassName: "dropdownWrap",
|
|
113
|
+
menu: {
|
|
114
|
+
items: item.children
|
|
115
|
+
}
|
|
116
|
+
}, baseDom) : baseDom;
|
|
117
|
+
}));
|
|
118
|
+
};
|
|
119
|
+
export default Index;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../../style/components/ClassFilter.scss";
|
|
3
|
+
export interface IclassFilter {
|
|
4
|
+
classFilter: any[];
|
|
5
|
+
onStatusTag?: (item: Record<string, any> | null, checkedItems: Record<string, any>[]) => void;
|
|
6
|
+
statusTagCounts?: Record<string, number>;
|
|
7
|
+
}
|
|
8
|
+
declare const Index: ({ classFilter, ...props }: IclassFilter) => React.JSX.Element | null;
|
|
9
|
+
export default Index;
|
|
10
|
+
//# sourceMappingURL=indexVertical.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexVertical.d.ts","sourceRoot":"","sources":["indexVertical.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,yCAAyC,CAAC;AAKjD,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,GAAG,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,CACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAChC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAChC,IAAI,CAAC;IACV,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED,QAAA,MAAM,KAAK,8BAA+B,YAAY,6BAsDrD,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var _excluded = ["classFilter"];
|
|
2
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
|
+
import { QuestionCircleOutlined } from "@ant-design/icons";
|
|
5
|
+
import { Tooltip, Tree } from "antd";
|
|
6
|
+
import React from "react";
|
|
7
|
+
import "../../style/components/ClassFilter.scss";
|
|
8
|
+
import { checkFilter } from "./util";
|
|
9
|
+
|
|
10
|
+
// 分类过滤
|
|
11
|
+
|
|
12
|
+
var Index = function Index(_ref) {
|
|
13
|
+
var classFilter = _ref.classFilter,
|
|
14
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
var onCheck = function onCheck(checkedKeys, e) {
|
|
16
|
+
var _props$onStatusTag;
|
|
17
|
+
var arr = checkFilter(e);
|
|
18
|
+
(_props$onStatusTag = props.onStatusTag) === null || _props$onStatusTag === void 0 || _props$onStatusTag.call(props, null, arr);
|
|
19
|
+
};
|
|
20
|
+
var titleRender = function titleRender(item) {
|
|
21
|
+
var _props$statusTagCount, _props$statusTagCount2;
|
|
22
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
23
|
+
style: {
|
|
24
|
+
width: "100%"
|
|
25
|
+
},
|
|
26
|
+
className: "tags-list".concat(" \n "),
|
|
27
|
+
key: item.key
|
|
28
|
+
}, item.remark && /*#__PURE__*/React.createElement(Tooltip, {
|
|
29
|
+
title: item.remark
|
|
30
|
+
}, /*#__PURE__*/React.createElement(QuestionCircleOutlined, {
|
|
31
|
+
style: {
|
|
32
|
+
marginRight: 3,
|
|
33
|
+
fontSize: 10
|
|
34
|
+
}
|
|
35
|
+
})), item.label, typeof ((_props$statusTagCount = props.statusTagCounts) === null || _props$statusTagCount === void 0 ? void 0 : _props$statusTagCount[item.key]) === "number" ? /*#__PURE__*/React.createElement("span", {
|
|
36
|
+
className: "num-txt",
|
|
37
|
+
style: {
|
|
38
|
+
backgroundColor: item.backgroundColor,
|
|
39
|
+
color: item.fontColor
|
|
40
|
+
}
|
|
41
|
+
}, (_props$statusTagCount2 = props.statusTagCounts) === null || _props$statusTagCount2 === void 0 ? void 0 : _props$statusTagCount2[item.key]) : null);
|
|
42
|
+
};
|
|
43
|
+
if (!classFilter) return null;
|
|
44
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
45
|
+
className: "tags-wrap class-filter-component"
|
|
46
|
+
}, /*#__PURE__*/React.createElement(Tree, {
|
|
47
|
+
rootClassName: "filter-component-tree-content",
|
|
48
|
+
checkable: true,
|
|
49
|
+
defaultExpandAll: true,
|
|
50
|
+
blockNode: true,
|
|
51
|
+
filterTreeNode: function filterTreeNode() {
|
|
52
|
+
return false;
|
|
53
|
+
},
|
|
54
|
+
fieldNames: {
|
|
55
|
+
title: "label",
|
|
56
|
+
key: "key",
|
|
57
|
+
children: "children"
|
|
58
|
+
}
|
|
59
|
+
// defaultExpandedKeys={['0-0-0', '0-0-1']}
|
|
60
|
+
// defaultSelectedKeys={['0-0-0', '0-0-1']}
|
|
61
|
+
// defaultCheckedKeys={['0-0-0', '0-0-1']}
|
|
62
|
+
// onSelect={onSelect}
|
|
63
|
+
,
|
|
64
|
+
onCheck: onCheck,
|
|
65
|
+
treeData: classFilter,
|
|
66
|
+
titleRender: titleRender
|
|
67
|
+
}));
|
|
68
|
+
};
|
|
69
|
+
export default Index;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface IStatusItem {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string[] | number[];
|
|
4
|
+
key: string;
|
|
5
|
+
field: string;
|
|
6
|
+
parent?: IStatusItem;
|
|
7
|
+
}
|
|
8
|
+
export declare type typeFieldFilterCount = {
|
|
9
|
+
code: string;
|
|
10
|
+
fields: Record<string, any>[];
|
|
11
|
+
};
|
|
12
|
+
export declare const getFieldFilterCount: (tree: Record<string, any>[], arr: typeFieldFilterCount[]) => void;
|
|
13
|
+
export declare const adapterFilter: (item: IStatusItem) => Record<string, any>[];
|
|
14
|
+
export declare function checkFilter(e: any): Record<string, any>[];
|
|
15
|
+
export declare function showSlidePanel(config: Record<string, any> | any): "" | "left" | "right";
|
|
16
|
+
export declare function getFitterTree(tree: Record<string, any>[], treeParent?: Record<string, any>): void;
|
|
17
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAGD,oBAAY,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;CAC/B,CAAC;AA6CF,eAAO,MAAM,mBAAmB,SACxB,OAAO,MAAM,EAAE,GAAG,CAAC,EAAE,OACtB,oBAAoB,EAAE,SAW5B,CAAC;AAGF,eAAO,MAAM,aAAa,SAAU,WAAW,KAAG,OAAO,MAAM,EAAE,GAAG,CAAC,EAMpE,CAAC;AAGF,wBAAgB,WAAW,CAAC,CAAC,KAAA,yBA6B5B;AAGD,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,yBAkB/D;AAGD,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAC3B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAWjC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
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); }
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
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); }
|
|
10
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
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; }
|
|
13
|
+
import { isEmpty } from "lodash";
|
|
14
|
+
|
|
15
|
+
// 分类过滤 遍历树 获取需要查询的总数
|
|
16
|
+
|
|
17
|
+
// 平铺父级
|
|
18
|
+
function getTileParent(item, arr) {
|
|
19
|
+
if (item) {
|
|
20
|
+
arr.push({
|
|
21
|
+
field: item.field,
|
|
22
|
+
//字段名
|
|
23
|
+
argument: {
|
|
24
|
+
//查询条件
|
|
25
|
+
criteriaType: "In",
|
|
26
|
+
value: item.value,
|
|
27
|
+
necessary: true
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
if (item.parent) {
|
|
31
|
+
getTileParent(item.parent, arr);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// 拼接查询数据
|
|
37
|
+
function getSearchObj(_item) {
|
|
38
|
+
var field = {
|
|
39
|
+
code: _item.key,
|
|
40
|
+
fields: [{
|
|
41
|
+
field: _item.field,
|
|
42
|
+
argument: {
|
|
43
|
+
criteriaType: "In",
|
|
44
|
+
value: isEmpty(_item.value) ? null : _item.value,
|
|
45
|
+
necessary: true
|
|
46
|
+
}
|
|
47
|
+
}]
|
|
48
|
+
};
|
|
49
|
+
if (_item.parent) {
|
|
50
|
+
var _arr = [];
|
|
51
|
+
getTileParent(_item.parent, _arr);
|
|
52
|
+
field.fields = [].concat(_toConsumableArray(field.fields), _arr);
|
|
53
|
+
}
|
|
54
|
+
return field;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// 获取查询数量
|
|
58
|
+
export var getFieldFilterCount = function getFieldFilterCount(tree, arr) {
|
|
59
|
+
for (var i = 0, l = tree.length; i < l; i++) {
|
|
60
|
+
if (tree[i].switchTotal) {
|
|
61
|
+
var obj = getSearchObj(tree[i]);
|
|
62
|
+
arr.push(obj);
|
|
63
|
+
}
|
|
64
|
+
if (tree[i].children && tree[i].children.length) {
|
|
65
|
+
getFieldFilterCount(tree[i].children, arr);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// 点击获取查询数据
|
|
71
|
+
export var adapterFilter = function adapterFilter(item) {
|
|
72
|
+
var fieldFilter = [];
|
|
73
|
+
var _obj = getSearchObj(item);
|
|
74
|
+
fieldFilter.push(_obj);
|
|
75
|
+
return fieldFilter;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// 选中查询数据
|
|
79
|
+
export function checkFilter(e) {
|
|
80
|
+
// const nodes = cloneDeep(e.checkedNodes);
|
|
81
|
+
// for (let i = 0, l = e.checkedNodes.length; i < l; i++) {
|
|
82
|
+
// if (e.checkedNodes[i].children && e.checkedNodes[i].children.length) {
|
|
83
|
+
// // 勾选了父级 自己不需查询
|
|
84
|
+
// for (let j = 0, k = e.checkedNodes[i].children.length; j < k; j++) {
|
|
85
|
+
// const index = findIndex(nodes, (o) => o.key === e.checkedNodes[i].children[j].key);
|
|
86
|
+
// if (index > -1) {
|
|
87
|
+
// nodes.splice(index, 1);
|
|
88
|
+
// }
|
|
89
|
+
// }
|
|
90
|
+
// }
|
|
91
|
+
// }
|
|
92
|
+
|
|
93
|
+
// 只查最后的节点
|
|
94
|
+
var nodes = [];
|
|
95
|
+
for (var i = 0, l = e.checkedNodes.length; i < l; i++) {
|
|
96
|
+
if (!e.checkedNodes[i].children) {
|
|
97
|
+
nodes.push(e.checkedNodes[i]);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
var arr = [];
|
|
101
|
+
nodes.forEach(function (item) {
|
|
102
|
+
var _arr = adapterFilter(item);
|
|
103
|
+
arr = [].concat(_toConsumableArray(arr), _toConsumableArray(_arr));
|
|
104
|
+
});
|
|
105
|
+
return arr;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// 显示 左 右 面板
|
|
109
|
+
export function showSlidePanel(config) {
|
|
110
|
+
if (!config) return "";
|
|
111
|
+
// 分类过滤 classFilterPosition
|
|
112
|
+
// 查询 searchShowType
|
|
113
|
+
if ((config === null || config === void 0 ? void 0 : config.classFilterPosition) === "left" || !(config !== null && config !== void 0 && config.isHideSearchBtn) && (config === null || config === void 0 ? void 0 : config.searchShowType) === "slideLeft") {
|
|
114
|
+
return "left";
|
|
115
|
+
}
|
|
116
|
+
if ((config === null || config === void 0 ? void 0 : config.classFilterPosition) === "right" || !(config !== null && config !== void 0 && config.isHideSearchBtn) && (config === null || config === void 0 ? void 0 : config.searchShowType) == "slide") {
|
|
117
|
+
return "right";
|
|
118
|
+
}
|
|
119
|
+
return "";
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// 赋值 parent 和 key
|
|
123
|
+
export function getFitterTree(tree, treeParent) {
|
|
124
|
+
for (var i = 0, l = tree.length; i < l; i++) {
|
|
125
|
+
if (!tree[i].key) tree[i].key = new Date().getTime();
|
|
126
|
+
if (treeParent && !tree[i].parent) {
|
|
127
|
+
tree[i].parent = treeParent;
|
|
128
|
+
}
|
|
129
|
+
if (tree[i].children) {
|
|
130
|
+
getFitterTree(tree[i].children, _objectSpread(_objectSpread({}, tree[i]), {}, {
|
|
131
|
+
children: null
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,QAAA,MAAM,OAAO,oCAAqC,GAAG,sBAmDpD,CAAC;AAEF,eAAe,OAAO,CAAC"}
|