bee-front-components 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/config/config.ts +28 -0
- package/lib/assets/images/empty.png +0 -0
- package/lib/components/BaseModal/index.d.ts +41 -0
- package/lib/components/BaseModal/index.js +133 -0
- package/lib/components/BaseModal/index.module.less +66 -0
- package/lib/components/Buttons/Button.d.ts +17 -0
- package/lib/components/Buttons/Button.js +34 -0
- package/lib/components/Buttons/ButtonPermission.d.ts +18 -0
- package/lib/components/Buttons/ButtonPermission.js +34 -0
- package/lib/components/Buttons/index.d.ts +3 -0
- package/lib/components/Buttons/index.js +3 -0
- package/lib/components/Buttons/index.module.less +21 -0
- package/lib/components/ContentHeader/index.d.ts +17 -0
- package/lib/components/ContentHeader/index.js +22 -0
- package/lib/components/ContentHeader/index.module.less +14 -0
- package/lib/components/Empty/index.d.ts +17 -0
- package/lib/components/Empty/index.js +23 -0
- package/lib/components/Empty/index.module.less +15 -0
- package/lib/components/ExcelExport/index.d.ts +28 -0
- package/lib/components/ExcelExport/index.js +60 -0
- package/lib/components/ExcelExport/index.module.less +61 -0
- package/lib/components/Modal/index.d.ts +26 -0
- package/lib/components/Modal/index.js +191 -0
- package/lib/components/Modal/index.module.less +79 -0
- package/lib/components/PageHeader/index.d.ts +43 -0
- package/lib/components/PageHeader/index.js +72 -0
- package/lib/components/PageHeader/index.module.less +38 -0
- package/lib/components/PdfViewer/index.d.ts +49 -0
- package/lib/components/PdfViewer/index.js +699 -0
- package/lib/components/QueryBar/TableQueryBar.d.ts +32 -0
- package/lib/components/QueryBar/TableQueryBar.js +115 -0
- package/lib/components/QueryBar/index.d.ts +25 -0
- package/lib/components/QueryBar/index.js +102 -0
- package/lib/components/QueryBar/index.module.less +58 -0
- package/lib/components/RemainDay/index.d.ts +22 -0
- package/lib/components/RemainDay/index.js +47 -0
- package/lib/components/RemainDay/index.module.less +42 -0
- package/lib/components/Scanner/hooks/useKeyboardScanner.d.ts +14 -0
- package/lib/components/Scanner/hooks/useKeyboardScanner.js +95 -0
- package/lib/components/Scanner/index.d.ts +60 -0
- package/lib/components/Scanner/index.js +318 -0
- package/lib/components/Scanner/index.module.less +264 -0
- package/lib/components/Scanner/utils/device.d.ts +2 -0
- package/lib/components/Scanner/utils/device.js +18 -0
- package/lib/components/StatusTab/index.d.ts +36 -0
- package/lib/components/StatusTab/index.js +118 -0
- package/lib/components/StatusTab/index.module.less +20 -0
- package/lib/components/StatusTag/index.d.ts +32 -0
- package/lib/components/StatusTag/index.js +142 -0
- package/lib/components/StatusTag/index.module.less +37 -0
- package/lib/components/StepProgress/index.d.ts +36 -0
- package/lib/components/StepProgress/index.js +84 -0
- package/lib/components/StepProgress/index.module.less +180 -0
- package/lib/components/Table/index.d.ts +44 -0
- package/lib/components/Table/index.js +135 -0
- package/lib/components/Table/index.module.less +24 -0
- package/lib/components/TableOperationColumn/index.d.ts +45 -0
- package/lib/components/TableOperationColumn/index.js +205 -0
- package/lib/components/TableOperationColumn/index.module.less +22 -0
- package/lib/components/Tabs/TabGroup.d.ts +9 -0
- package/lib/components/Tabs/TabGroup.js +12 -0
- package/lib/components/Tabs/TabPane.d.ts +9 -0
- package/lib/components/Tabs/TabPane.js +12 -0
- package/lib/components/Tabs/Tabs.d.ts +23 -0
- package/lib/components/Tabs/Tabs.js +42 -0
- package/lib/components/Tabs/index.d.ts +4 -0
- package/lib/components/Tabs/index.js +4 -0
- package/lib/components/Tabs/index.module.less +20 -0
- package/lib/components/Upload/BatchUpload/index.d.ts +42 -0
- package/lib/components/Upload/BatchUpload/index.js +140 -0
- package/lib/components/Upload/BatchUpload/index.module.less +10 -0
- package/lib/components/Upload/DraggerUpload/index.d.ts +42 -0
- package/lib/components/Upload/DraggerUpload/index.js +142 -0
- package/lib/components/Upload/DraggerUpload/index.module.less +30 -0
- package/lib/components/Upload/FileUpload.d.ts +36 -0
- package/lib/components/Upload/FileUpload.js +122 -0
- package/lib/components/Upload/index.d.ts +4 -0
- package/lib/components/Upload/index.js +4 -0
- package/lib/components/VipFlag/index.d.ts +10 -0
- package/lib/components/VipFlag/index.js +23 -0
- package/lib/components/VipFlag/index.module.less +20 -0
- package/lib/typings/blank.d.ts +0 -0
- package/lib/typings.d.ts +3 -0
- package/lib/utils/const.d.ts +21 -0
- package/lib/utils/const.js +22 -0
- package/lib/utils/index.d.ts +95 -0
- package/lib/utils/index.js +319 -0
- package/lib/utils/menuTab.d.ts +60 -0
- package/lib/utils/menuTab.js +122 -0
- package/lib/utils/utils.d.ts +61 -0
- package/lib/utils/utils.js +270 -0
- package/package.json +41 -0
package/config/config.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { extendParentConfig } from "@hzerojs/plugin-micro";
|
|
2
|
+
|
|
3
|
+
export default extendParentConfig({
|
|
4
|
+
webpack5: {},
|
|
5
|
+
// 开启fastRefresh此配置,每次修改config文件都需要重新启动dev server
|
|
6
|
+
// fastRefresh: {},
|
|
7
|
+
hash: true,
|
|
8
|
+
hzeroMicro: {
|
|
9
|
+
microConfig: {
|
|
10
|
+
"registerRegex": "\\/.*",
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
// 如果存在发布 lib 包需求,可以解开该配置,对应 babelrc 中的内容
|
|
14
|
+
// 注意若父模块与子模块都配置了module-resolver插件,请保证数组的第三个参数不能为同一个字符串或者都为空
|
|
15
|
+
extraBabelPlugins: [
|
|
16
|
+
[
|
|
17
|
+
"module-resolver",
|
|
18
|
+
{
|
|
19
|
+
root: ["./"],
|
|
20
|
+
alias: {
|
|
21
|
+
"@": "./src",
|
|
22
|
+
"bee-components": "./src/components",
|
|
23
|
+
"bee-utils": "./src/utils",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
],
|
|
28
|
+
});
|
|
Binary file
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface BaseModalRef {
|
|
3
|
+
open: (config?: Partial<BaseModalConfig>) => void;
|
|
4
|
+
close: () => void;
|
|
5
|
+
}
|
|
6
|
+
export interface BaseModalConfig {
|
|
7
|
+
/** 弹窗标题 */
|
|
8
|
+
title?: React.ReactNode;
|
|
9
|
+
/** 标题位置 */
|
|
10
|
+
titlePosition?: "top" | "center";
|
|
11
|
+
/** 弹窗内容 */
|
|
12
|
+
content?: React.ReactNode;
|
|
13
|
+
/** 确定按钮文本 */
|
|
14
|
+
okText?: string;
|
|
15
|
+
/** 取消按钮文本 */
|
|
16
|
+
cancelText?: string;
|
|
17
|
+
/** 弹窗宽度 */
|
|
18
|
+
width?: number | string;
|
|
19
|
+
/** 弹窗样式 */
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
/** 弹窗内容样式 */
|
|
22
|
+
bodyStyle?: React.CSSProperties;
|
|
23
|
+
/** 是否显示右上角关闭按钮 */
|
|
24
|
+
closable?: boolean;
|
|
25
|
+
/** 是否可关闭遮罩层 */
|
|
26
|
+
maskClosable?: boolean | "click" | "dblclick";
|
|
27
|
+
/** 弹窗图标 */
|
|
28
|
+
icon?: string;
|
|
29
|
+
/** 是否显示图标 */
|
|
30
|
+
iconVisible?: boolean;
|
|
31
|
+
/** 图标颜色 */
|
|
32
|
+
iconColor?: string;
|
|
33
|
+
/** 图标样式 */
|
|
34
|
+
iconStyle?: React.CSSProperties;
|
|
35
|
+
/** 确定按钮点击事件 */
|
|
36
|
+
onOk?: () => Promise<boolean | undefined | void> | boolean | undefined | void;
|
|
37
|
+
/** 取消按钮点击事件 */
|
|
38
|
+
onCancel?: () => Promise<boolean | undefined | void> | boolean | undefined | void;
|
|
39
|
+
}
|
|
40
|
+
declare const BaseModal: React.ForwardRefExoticComponent<React.RefAttributes<BaseModalRef>>;
|
|
41
|
+
export default BaseModal;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import _Modal from "@hzero-front-ui/c7n-ui/lib/ModalPro";
|
|
2
|
+
/**
|
|
3
|
+
* @name BaseModal - 基础弹窗组件
|
|
4
|
+
* @description 基于 choerodon-ui/pro Modal.open 封装,支持顶部/居中标题、自定义图标、确认/取消回调,
|
|
5
|
+
* 通过 ref 暴露 open / close 方法控制弹窗生命周期,适用于全局提示、二次确认等场景。
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* const modalRef = useRef<BaseModalRef>(null);
|
|
10
|
+
*
|
|
11
|
+
* <BaseModal ref={modalRef} />
|
|
12
|
+
*
|
|
13
|
+
* modalRef.current?.open({
|
|
14
|
+
* title: '确认删除?',
|
|
15
|
+
* content: '删除后不可恢复',
|
|
16
|
+
* onOk: async () => { await deleteData(); return true; },
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
import { ButtonColor, FuncType } from "choerodon-ui/pro/lib/button/enum";
|
|
21
|
+
import React, { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
|
|
22
|
+
import { Button } from "../Buttons";
|
|
23
|
+
import styles from "./index.module.less?modules";
|
|
24
|
+
const BaseModal = /*#__PURE__*/forwardRef((props, ref) => {
|
|
25
|
+
// 使用 useRef 存储 modal 实例,防止组件重渲染导致实例丢失
|
|
26
|
+
const modalInstanceRef = useRef(null);
|
|
27
|
+
const open = useCallback(config => {
|
|
28
|
+
if (modalInstanceRef.current) {
|
|
29
|
+
modalInstanceRef.current.close();
|
|
30
|
+
}
|
|
31
|
+
const mergedConfig = {
|
|
32
|
+
title: "",
|
|
33
|
+
titlePosition: "center",
|
|
34
|
+
content: "",
|
|
35
|
+
okText: "确定",
|
|
36
|
+
cancelText: "取消",
|
|
37
|
+
width: 600,
|
|
38
|
+
closable: true,
|
|
39
|
+
maskClosable: false,
|
|
40
|
+
icon: "icon-jingshi",
|
|
41
|
+
iconVisible: true,
|
|
42
|
+
iconColor: "#FF4433",
|
|
43
|
+
...config
|
|
44
|
+
};
|
|
45
|
+
const handleOk = async () => {
|
|
46
|
+
var _modalInstanceRef$cur;
|
|
47
|
+
if (mergedConfig.onOk) {
|
|
48
|
+
const res = await mergedConfig.onOk();
|
|
49
|
+
if (res === false) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
(_modalInstanceRef$cur = modalInstanceRef.current) === null || _modalInstanceRef$cur === void 0 ? void 0 : _modalInstanceRef$cur.close();
|
|
54
|
+
modalInstanceRef.current = null;
|
|
55
|
+
};
|
|
56
|
+
const handleCancel = async () => {
|
|
57
|
+
var _modalInstanceRef$cur2;
|
|
58
|
+
if (mergedConfig.onCancel) {
|
|
59
|
+
const res = await mergedConfig.onCancel();
|
|
60
|
+
if (res === false) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
(_modalInstanceRef$cur2 = modalInstanceRef.current) === null || _modalInstanceRef$cur2 === void 0 ? void 0 : _modalInstanceRef$cur2.close();
|
|
65
|
+
modalInstanceRef.current = null;
|
|
66
|
+
};
|
|
67
|
+
modalInstanceRef.current = _Modal.open({
|
|
68
|
+
title: "",
|
|
69
|
+
// 清空默认标题,使用自定义 header
|
|
70
|
+
header: /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
className: styles.baseModalHeader
|
|
72
|
+
}, mergedConfig.titlePosition === "top" && /*#__PURE__*/React.createElement("div", {
|
|
73
|
+
className: styles.headerTitle
|
|
74
|
+
}, mergedConfig.title), mergedConfig.closable && /*#__PURE__*/React.createElement("i", {
|
|
75
|
+
className: `iconfont icon-guanbi ${styles.closeIcon}`,
|
|
76
|
+
onClick: handleCancel
|
|
77
|
+
})),
|
|
78
|
+
style: {
|
|
79
|
+
width: mergedConfig.width,
|
|
80
|
+
...mergedConfig.style
|
|
81
|
+
},
|
|
82
|
+
className: styles.baseModal,
|
|
83
|
+
closable: mergedConfig.closable,
|
|
84
|
+
maskClosable: mergedConfig.maskClosable,
|
|
85
|
+
autoCenter: true,
|
|
86
|
+
bodyStyle: {
|
|
87
|
+
padding: "0px",
|
|
88
|
+
...mergedConfig.bodyStyle
|
|
89
|
+
},
|
|
90
|
+
// 弹窗内容
|
|
91
|
+
children: /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: `${styles.baseModalContent} ${mergedConfig.titlePosition === "top" ? styles.baseModalContentHasTitle : ""}`
|
|
93
|
+
}, mergedConfig.iconVisible && /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
className: styles.iconContainer
|
|
95
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
96
|
+
className: `iconfont ${mergedConfig.icon} ${styles.icon}`,
|
|
97
|
+
style: {
|
|
98
|
+
color: mergedConfig.iconColor,
|
|
99
|
+
...(mergedConfig.iconStyle || {})
|
|
100
|
+
}
|
|
101
|
+
})), mergedConfig.title && mergedConfig.titlePosition === "center" && /*#__PURE__*/React.createElement("div", {
|
|
102
|
+
className: styles.title
|
|
103
|
+
}, mergedConfig.title), /*#__PURE__*/React.createElement("div", {
|
|
104
|
+
className: styles.content
|
|
105
|
+
}, mergedConfig.content)),
|
|
106
|
+
// 底部按钮区
|
|
107
|
+
footer: /*#__PURE__*/React.createElement("div", {
|
|
108
|
+
className: styles.footerContainer
|
|
109
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
110
|
+
color: "default",
|
|
111
|
+
funcType: "raised",
|
|
112
|
+
className: styles.cancelButton,
|
|
113
|
+
onClick: handleCancel
|
|
114
|
+
}, mergedConfig.cancelText), /*#__PURE__*/React.createElement(Button, {
|
|
115
|
+
funcType: "raised",
|
|
116
|
+
className: styles.okButton,
|
|
117
|
+
onClick: handleOk
|
|
118
|
+
}, mergedConfig.okText))
|
|
119
|
+
});
|
|
120
|
+
}, []);
|
|
121
|
+
const close = useCallback(() => {
|
|
122
|
+
if (modalInstanceRef.current) {
|
|
123
|
+
modalInstanceRef.current.close();
|
|
124
|
+
modalInstanceRef.current = null;
|
|
125
|
+
}
|
|
126
|
+
}, []);
|
|
127
|
+
useImperativeHandle(ref, () => ({
|
|
128
|
+
open,
|
|
129
|
+
close
|
|
130
|
+
}), [open, close]);
|
|
131
|
+
return null;
|
|
132
|
+
});
|
|
133
|
+
export default BaseModal;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
.baseModal {
|
|
2
|
+
.baseModalHeader {
|
|
3
|
+
.flex(@justify: center);
|
|
4
|
+
position: relative;
|
|
5
|
+
width: 100%;
|
|
6
|
+
font-size: 0.2rem;
|
|
7
|
+
height: 0.2rem;
|
|
8
|
+
line-height: 0.2rem;
|
|
9
|
+
.closeIcon {
|
|
10
|
+
font-size: 0.34rem;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
position: absolute;
|
|
13
|
+
right: 0;
|
|
14
|
+
}
|
|
15
|
+
.headerTitle::after {
|
|
16
|
+
content: "";
|
|
17
|
+
position: absolute;
|
|
18
|
+
left: -0.16rem;
|
|
19
|
+
right: -0.016rem;
|
|
20
|
+
bottom: -0.16rem;
|
|
21
|
+
height: 0.01rem;
|
|
22
|
+
background-color: @borderColor;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
.baseModalContent {
|
|
26
|
+
text-align: center;
|
|
27
|
+
padding: 0.08rem 0.48rem;
|
|
28
|
+
&.baseModalContentHasTitle {
|
|
29
|
+
padding-top: 0.24rem;
|
|
30
|
+
}
|
|
31
|
+
.iconContainer {
|
|
32
|
+
margin-bottom: 0.36rem;
|
|
33
|
+
}
|
|
34
|
+
.icon {
|
|
35
|
+
font-size: 0.48rem;
|
|
36
|
+
line-height: 0.48rem;
|
|
37
|
+
}
|
|
38
|
+
.title {
|
|
39
|
+
font-size: 0.2rem;
|
|
40
|
+
margin-bottom: 0.16rem;
|
|
41
|
+
line-height: 0.2rem;
|
|
42
|
+
}
|
|
43
|
+
.content {
|
|
44
|
+
font-size: 0.2rem;
|
|
45
|
+
color: @minorWord;
|
|
46
|
+
min-height: 0.78rem;
|
|
47
|
+
line-height: 0.28rem;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
.footerContainer {
|
|
51
|
+
.flex(@justify: space-between);
|
|
52
|
+
width: 100%;
|
|
53
|
+
padding: 0 0.32rem 0.32rem;
|
|
54
|
+
gap: 0.36rem;
|
|
55
|
+
.cancelButton,
|
|
56
|
+
.okButton {
|
|
57
|
+
flex: 1;
|
|
58
|
+
text-align: center;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
:global {
|
|
62
|
+
.c7n-pro-modal-header {
|
|
63
|
+
padding-bottom: 0.16rem !important;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name 可配置按钮权限按钮
|
|
3
|
+
* @param {string} className 该组件自定义类名
|
|
4
|
+
* @param {string} icon 按钮图标 同choerodon-ui的icon类型 若传icon-xxxx则使用自定义iconfont图标
|
|
5
|
+
* @param {...args} 其他剩余参数 同hzero组件中的Button使用方式
|
|
6
|
+
* @author lichen
|
|
7
|
+
*/
|
|
8
|
+
import React from "react";
|
|
9
|
+
import type { ButtonProps } from "choerodon-ui/pro/lib/button/Button";
|
|
10
|
+
interface IProps extends ButtonProps {
|
|
11
|
+
/** 自定义类名 */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** 自定义按钮图标 */
|
|
14
|
+
icon?: string;
|
|
15
|
+
}
|
|
16
|
+
declare const Button: React.FC<IProps>;
|
|
17
|
+
export default Button;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import _Button from "@hzero-front-ui/c7n-ui/lib/ButtonPro";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
const _excluded = ["className", "icon"];
|
|
5
|
+
/**
|
|
6
|
+
* @name 可配置按钮权限按钮
|
|
7
|
+
* @param {string} className 该组件自定义类名
|
|
8
|
+
* @param {string} icon 按钮图标 同choerodon-ui的icon类型 若传icon-xxxx则使用自定义iconfont图标
|
|
9
|
+
* @param {...args} 其他剩余参数 同hzero组件中的Button使用方式
|
|
10
|
+
* @author lichen
|
|
11
|
+
*/
|
|
12
|
+
import React, { useMemo } from "react";
|
|
13
|
+
import classNames from "classnames";
|
|
14
|
+
import { ButtonColor, FuncType } from "choerodon-ui/pro/lib/button/enum";
|
|
15
|
+
import styles from "./index.module.less?modules";
|
|
16
|
+
const Button = props => {
|
|
17
|
+
const className = props.className,
|
|
18
|
+
icon = props.icon,
|
|
19
|
+
args = _objectWithoutProperties(props, _excluded);
|
|
20
|
+
const isIconfont = useMemo(() => !!icon && icon.startsWith("icon-"), [icon]); // 判断当前icon是否为自定义iconfont图标 若是则使用自定义iconfont图标样式 否则使用choerodon-ui的icon样式
|
|
21
|
+
return isIconfont ? /*#__PURE__*/React.createElement(_Button, _extends({
|
|
22
|
+
className: classNames(styles.defaultBtn, className),
|
|
23
|
+
funcType: "flat",
|
|
24
|
+
color: "primary"
|
|
25
|
+
}, args), /*#__PURE__*/React.createElement("i", {
|
|
26
|
+
className: classNames("iconfont", styles.btnIcon, icon)
|
|
27
|
+
}), (args === null || args === void 0 ? void 0 : args.children) || null) : /*#__PURE__*/React.createElement(_Button, _extends({
|
|
28
|
+
className: classNames(styles.defaultBtn, className),
|
|
29
|
+
icon: icon,
|
|
30
|
+
funcType: "flat",
|
|
31
|
+
color: "primary"
|
|
32
|
+
}, args));
|
|
33
|
+
};
|
|
34
|
+
export default Button;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name 可配置按钮权限按钮
|
|
3
|
+
* @param {string} className 该组件自定义类名
|
|
4
|
+
* @param {string} icon 按钮图标 同choerodon-ui的icon类型 若传icon-xxxx则使用自定义iconfont图标
|
|
5
|
+
* @param {...args} 其他剩余参数 同hzero组件中的Button使用方式
|
|
6
|
+
* @author lichen
|
|
7
|
+
*/
|
|
8
|
+
import React from "react";
|
|
9
|
+
interface IProps {
|
|
10
|
+
/** 自定义类名 */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** 自定义按钮图标 */
|
|
13
|
+
icon?: string;
|
|
14
|
+
/** 其他属性 */
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
declare const ButtonPermission: React.FC<IProps>;
|
|
18
|
+
export default ButtonPermission;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
const _excluded = ["className", "icon"];
|
|
4
|
+
/**
|
|
5
|
+
* @name 可配置按钮权限按钮
|
|
6
|
+
* @param {string} className 该组件自定义类名
|
|
7
|
+
* @param {string} icon 按钮图标 同choerodon-ui的icon类型 若传icon-xxxx则使用自定义iconfont图标
|
|
8
|
+
* @param {...args} 其他剩余参数 同hzero组件中的Button使用方式
|
|
9
|
+
* @author lichen
|
|
10
|
+
*/
|
|
11
|
+
import React, { useMemo } from "react";
|
|
12
|
+
import { Button } from "components/Permission";
|
|
13
|
+
import classNames from "classnames";
|
|
14
|
+
import { ButtonColor } from "choerodon-ui/pro/lib/button/enum";
|
|
15
|
+
import styles from "./index.module.less?modules";
|
|
16
|
+
const ButtonPermission = props => {
|
|
17
|
+
const className = props.className,
|
|
18
|
+
icon = props.icon,
|
|
19
|
+
args = _objectWithoutProperties(props, _excluded);
|
|
20
|
+
const isIconfont = useMemo(() => !!icon && icon.startsWith("icon-"), [icon]); // 判断当前icon是否为自定义iconfont图标 若是则使用自定义iconfont图标样式 否则使用choerodon-ui的icon样式
|
|
21
|
+
return isIconfont ? /*#__PURE__*/React.createElement(Button, _extends({
|
|
22
|
+
className: classNames(styles.defaultBtn, className),
|
|
23
|
+
type: "c7n-pro",
|
|
24
|
+
color: "primary"
|
|
25
|
+
}, args), /*#__PURE__*/React.createElement("i", {
|
|
26
|
+
className: classNames("iconfont", styles.btnIcon, icon)
|
|
27
|
+
}), (args === null || args === void 0 ? void 0 : args.children) || null) : /*#__PURE__*/React.createElement(Button, _extends({
|
|
28
|
+
className: classNames(styles.defaultPerBtn, className),
|
|
29
|
+
type: "c7n-pro",
|
|
30
|
+
icon: icon,
|
|
31
|
+
color: "primary"
|
|
32
|
+
}, args));
|
|
33
|
+
};
|
|
34
|
+
export default ButtonPermission;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// 按钮通用样式
|
|
2
|
+
.defaultBtn {
|
|
3
|
+
&:global(.c7n-pro-btn-wrapper.c7n-pro-btn.c7n-pro-btn-raised) {
|
|
4
|
+
.flex;
|
|
5
|
+
min-width: 0.88rem;
|
|
6
|
+
height: 0.36rem;
|
|
7
|
+
line-height: normal;
|
|
8
|
+
padding: 0 0.16rem;
|
|
9
|
+
font-size: @fontSize;
|
|
10
|
+
border-radius: @borderRadius;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.btnIcon {
|
|
15
|
+
font-size: @fontSize;
|
|
16
|
+
margin-right: 0.04rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.btnText {
|
|
20
|
+
font-size: @fontSize;
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name 详情页相关二级模块的头部标题
|
|
3
|
+
* @param {string} className 自定义类名
|
|
4
|
+
* @param {string} title 标题名称
|
|
5
|
+
* @param {string} iconName 所用的iconfont名称
|
|
6
|
+
*/
|
|
7
|
+
import React from "react";
|
|
8
|
+
interface IProps {
|
|
9
|
+
/** 自定义类名 */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** 标题名称 */
|
|
12
|
+
title: string;
|
|
13
|
+
/** 所用的iconfont名称 */
|
|
14
|
+
iconName?: string;
|
|
15
|
+
}
|
|
16
|
+
declare const ContentHeader: React.FC<IProps>;
|
|
17
|
+
export default ContentHeader;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name 详情页相关二级模块的头部标题
|
|
3
|
+
* @param {string} className 自定义类名
|
|
4
|
+
* @param {string} title 标题名称
|
|
5
|
+
* @param {string} iconName 所用的iconfont名称
|
|
6
|
+
*/
|
|
7
|
+
import React from "react";
|
|
8
|
+
import classNames from "classnames";
|
|
9
|
+
import styles from "./index.module.less?modules";
|
|
10
|
+
const ContentHeader = props => {
|
|
11
|
+
const className = props.className,
|
|
12
|
+
iconName = props.iconName,
|
|
13
|
+
title = props.title;
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: classNames(styles.contentHeaderWrap, className)
|
|
16
|
+
}, iconName && /*#__PURE__*/React.createElement("i", {
|
|
17
|
+
className: classNames("iconfont", iconName, styles.contentIcon)
|
|
18
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
19
|
+
className: styles.contentTitle
|
|
20
|
+
}, title || "基础信息"));
|
|
21
|
+
};
|
|
22
|
+
export default ContentHeader;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// 详情页相关二级模块的头部标题组件样式
|
|
2
|
+
.contentHeaderWrap {
|
|
3
|
+
.flex(@justify: flex-start);
|
|
4
|
+
gap: 0.08rem;
|
|
5
|
+
line-height: normal;
|
|
6
|
+
.contentIcon {
|
|
7
|
+
font-size: @mediumFont;
|
|
8
|
+
color: @primaryColor;
|
|
9
|
+
}
|
|
10
|
+
.contentTitle {
|
|
11
|
+
font-size: @fontSize20;
|
|
12
|
+
font-weight: 500;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name 全局空状态组件
|
|
3
|
+
* @param {string} className 该组件自定义类名
|
|
4
|
+
* @param {string} emptyContent 自定义空状态提示语
|
|
5
|
+
* @param {ReactNode} children 自定义空状态主体内容
|
|
6
|
+
*/
|
|
7
|
+
import React from "react";
|
|
8
|
+
interface IProps {
|
|
9
|
+
/** 自定义类名 */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** 自定义空状态提示语 */
|
|
12
|
+
emptyContent?: string;
|
|
13
|
+
/** 自定义空状态主体内容 */
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
declare const Empty: React.FC<IProps>;
|
|
17
|
+
export default Empty;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name 全局空状态组件
|
|
3
|
+
* @param {string} className 该组件自定义类名
|
|
4
|
+
* @param {string} emptyContent 自定义空状态提示语
|
|
5
|
+
* @param {ReactNode} children 自定义空状态主体内容
|
|
6
|
+
*/
|
|
7
|
+
import React from "react";
|
|
8
|
+
import classNames from "classnames";
|
|
9
|
+
import emptyImg from "../../assets/images/empty.png";
|
|
10
|
+
import styles from "./index.module.less?modules";
|
|
11
|
+
const Empty = ({
|
|
12
|
+
className,
|
|
13
|
+
emptyContent = "暂无数据",
|
|
14
|
+
children
|
|
15
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: classNames(styles.emptyWrap, className)
|
|
17
|
+
}, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", {
|
|
18
|
+
className: styles.emptyImg,
|
|
19
|
+
src: emptyImg
|
|
20
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
21
|
+
className: styles.emptyContent
|
|
22
|
+
}, emptyContent)));
|
|
23
|
+
export default Empty;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name 批量导出组件
|
|
3
|
+
* @param {string} key dom元素标识 多作为Table组件的buttons等参数数组中标识符
|
|
4
|
+
* @param {string} requestUrl 导出请求路径
|
|
5
|
+
* @param {Record<string, any>} queryParams 导出列表的筛选查询参数
|
|
6
|
+
* @param {string} icon 按钮图标 同choerodon-ui的icon类型 若传icon-xxxx则使用自定义iconfont图标
|
|
7
|
+
* @param {string} buttonText 按钮文字
|
|
8
|
+
* @param {Omit<ButtonProps, "icon">} otherButtonProps 导出按钮的其他属性
|
|
9
|
+
*/
|
|
10
|
+
import React from "react";
|
|
11
|
+
import type { IExcelExportProps } from "hzero-front/lib/components/ExcelExportPro";
|
|
12
|
+
import type { ButtonProps } from "choerodon-ui/pro/lib/button/Button";
|
|
13
|
+
interface IProps extends Omit<IExcelExportProps, "buttonText" | "otherButtonProps"> {
|
|
14
|
+
/** dom元素标识 */
|
|
15
|
+
key?: string;
|
|
16
|
+
/** 导出请求路径 */
|
|
17
|
+
requestUrl: string;
|
|
18
|
+
/** 导出列表的筛选查询参数 */
|
|
19
|
+
queryParams?: Record<string, any>;
|
|
20
|
+
/** 按钮图标 同choerodon-ui的icon类型 若传icon-xxxx则使用自定义iconfont图标 */
|
|
21
|
+
icon?: string;
|
|
22
|
+
/** 按钮文字 */
|
|
23
|
+
buttonText?: string;
|
|
24
|
+
/** 导出按钮的其他属性 */
|
|
25
|
+
otherButtonProps?: Omit<ButtonProps, "icon">;
|
|
26
|
+
}
|
|
27
|
+
declare const ExcelExport: React.FC<IProps>;
|
|
28
|
+
export default ExcelExport;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _Icon from "choerodon-ui/lib/icon";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
const _excluded = ["key", "requestUrl", "queryParams", "icon", "buttonText", "otherButtonProps"];
|
|
5
|
+
/**
|
|
6
|
+
* @name 批量导出组件
|
|
7
|
+
* @param {string} key dom元素标识 多作为Table组件的buttons等参数数组中标识符
|
|
8
|
+
* @param {string} requestUrl 导出请求路径
|
|
9
|
+
* @param {Record<string, any>} queryParams 导出列表的筛选查询参数
|
|
10
|
+
* @param {string} icon 按钮图标 同choerodon-ui的icon类型 若传icon-xxxx则使用自定义iconfont图标
|
|
11
|
+
* @param {string} buttonText 按钮文字
|
|
12
|
+
* @param {Omit<ButtonProps, "icon">} otherButtonProps 导出按钮的其他属性
|
|
13
|
+
*/
|
|
14
|
+
import React, { useCallback, useMemo } from "react";
|
|
15
|
+
import classNames from "classnames";
|
|
16
|
+
import ExcelExportPro from "components/ExcelExportPro";
|
|
17
|
+
import { ButtonColor } from "choerodon-ui/pro/lib/button/enum";
|
|
18
|
+
import styles from "./index.module.less?modules";
|
|
19
|
+
const ExcelExport = props => {
|
|
20
|
+
const _props$key = props.key,
|
|
21
|
+
key = _props$key === void 0 ? "batchExport" : _props$key,
|
|
22
|
+
requestUrl = props.requestUrl,
|
|
23
|
+
queryParams = props.queryParams,
|
|
24
|
+
_props$icon = props.icon,
|
|
25
|
+
icon = _props$icon === void 0 ? "icon-piliangdaochu" : _props$icon,
|
|
26
|
+
_props$buttonText = props.buttonText,
|
|
27
|
+
buttonText = _props$buttonText === void 0 ? "批量导出" : _props$buttonText,
|
|
28
|
+
otherButtonProps = props.otherButtonProps,
|
|
29
|
+
args = _objectWithoutProperties(props, _excluded);
|
|
30
|
+
const isIconfont = useMemo(() => !!icon && icon.startsWith("icon-"), [icon]); // 判断当前icon是否为自定义iconfont图标 若是则使用自定义iconfont图标样式 否则使用choerodon-ui的icon样式
|
|
31
|
+
|
|
32
|
+
// 自定义导出按钮样式
|
|
33
|
+
const ExportBtn = useCallback(() => /*#__PURE__*/React.createElement(React.Fragment, null, isIconfont ? /*#__PURE__*/React.createElement("i", {
|
|
34
|
+
className: classNames("iconfont", styles.btnIcon, icon)
|
|
35
|
+
}) : /*#__PURE__*/React.createElement(_Icon, {
|
|
36
|
+
className: styles.btnIcon,
|
|
37
|
+
type: icon
|
|
38
|
+
}), /*#__PURE__*/React.createElement("span", null, buttonText)), [icon, buttonText]);
|
|
39
|
+
return /*#__PURE__*/React.createElement(ExcelExportPro, _extends({
|
|
40
|
+
key: key,
|
|
41
|
+
requestUrl: requestUrl,
|
|
42
|
+
queryParams: queryParams,
|
|
43
|
+
otherButtonProps: {
|
|
44
|
+
className: styles.exportBtn,
|
|
45
|
+
color: "primary",
|
|
46
|
+
...otherButtonProps,
|
|
47
|
+
icon: ""
|
|
48
|
+
},
|
|
49
|
+
modalProps: {
|
|
50
|
+
className: styles.modalContent,
|
|
51
|
+
header: /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: styles.modalHeader
|
|
53
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: styles.headerTitle
|
|
55
|
+
}, buttonText))
|
|
56
|
+
},
|
|
57
|
+
buttonText: /*#__PURE__*/React.createElement(ExportBtn, null)
|
|
58
|
+
}, args));
|
|
59
|
+
};
|
|
60
|
+
export default ExcelExport;
|