cloud-b2b 1.1.59 → 1.1.60
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/es/Area/Area.js +141 -0
- package/es/Card/Card.js +19 -0
- package/es/CodeInput/CodeInput.js +123 -0
- package/es/Control/Control.js +444 -0
- package/es/Control/event.js +43 -0
- package/es/Enhance/Dialogs.js +52 -0
- package/es/Enhance/Loading.js +131 -0
- package/{src → es}/Enhance/index.js +6 -8
- package/es/Header/Header.js +162 -0
- package/es/Header/Vertical.js +106 -0
- package/es/ImageView/ImageView.js +100 -0
- package/es/Indent/Indent.js +19 -0
- package/es/InpurCascader/InputCascader.js +117 -0
- package/es/InputEditor/InputEditor.js +173 -0
- package/es/InputSearch/InputSearch.js +266 -0
- package/es/InputSelect/InputSelect.js +160 -0
- package/es/InputTreeSelect/InputTreeSelect.js +121 -0
- package/es/InputWriting/InputWriting.js +85 -0
- package/es/Layout/Layout.js +201 -0
- package/es/LayoutLink/LayoutLink.js +73 -0
- package/es/Link/Link.js +85 -0
- package/es/Loading/Loading.js +13 -0
- package/es/Loading2/Loading2.js +9 -0
- package/es/ModalWithDrag/ModalWithDrag.js +29 -0
- package/{src → es}/ModalWithDrag/drag.js +116 -128
- package/es/NumberInput/NumberInput.js +200 -0
- package/es/Search/Search.js +497 -0
- package/es/Search2/Search.js +597 -0
- package/es/Sidebar/Sidebar.js +144 -0
- package/es/Sidebar2/Sidebar.js +165 -0
- package/es/SuperForm/SuperForm.js +598 -0
- package/es/SuperForm2/SuperForm.js +687 -0
- package/es/SuperIcon/SuperIcon.js +27 -0
- package/es/SuperPagination/SuperPagination.js +109 -0
- package/es/SuperTab/SuperTab.js +107 -0
- package/es/SuperTab2/SuperTab2.js +145 -0
- package/es/SuperTable/DragSortRow.js +97 -0
- package/es/SuperTable/FilterDropDown.js +164 -0
- package/es/SuperTable/SuperTable.js +808 -0
- package/es/SuperTable/fixed.js +34 -0
- package/es/SuperTable2/SuperTable2.js +926 -0
- package/es/SuperTable2/SuperTableCell.js +234 -0
- package/es/SuperTable3/FilterDropDown.js +164 -0
- package/es/SuperTable3/SuperTable.js +665 -0
- package/es/SuperTable3/fixed.js +34 -0
- package/es/SuperToolbar/SuperToolbar.js +195 -0
- package/es/SuperUpload/SuperUpload.js +356 -0
- package/es/Title/Title.js +33 -0
- package/es/Viewer/ImageViews.js +258 -0
- package/es/Viewer/Viewer.js +122 -0
- package/es/WingBlank/WingBlank.js +16 -0
- package/es/helper.js +240 -0
- package/{src → es}/history.js +6 -6
- package/es/index.js +38 -0
- package/es/variables.js +6 -0
- package/lib/Area/Area.js +149 -0
- package/lib/Area/package.json +6 -0
- package/lib/Card/Card.js +27 -0
- package/lib/Card/package.json +6 -0
- package/lib/CodeInput/CodeInput.js +131 -0
- package/lib/CodeInput/package.json +6 -0
- package/lib/Control/Control.js +450 -0
- package/lib/Control/event.js +51 -0
- package/lib/Control/package.json +6 -0
- package/lib/Enhance/Dialogs.js +60 -0
- package/lib/Enhance/Loading.js +138 -0
- package/lib/Enhance/index.js +25 -0
- package/lib/Enhance/package.json +6 -0
- package/lib/Header/Header.js +169 -0
- package/lib/Header/Header.less +95 -0
- package/lib/Header/Vertical.js +114 -0
- package/lib/Header/Vertical.less +60 -0
- package/lib/Header/package.json +6 -0
- package/lib/ImageView/ImageView.js +108 -0
- package/lib/ImageView/ImageView.less +14 -0
- package/lib/ImageView/package.json +6 -0
- package/lib/Indent/Indent.js +27 -0
- package/lib/Indent/package.json +6 -0
- package/lib/InpurCascader/InputCascader.js +124 -0
- package/lib/InpurCascader/package.json +6 -0
- package/lib/InputEditor/InputEditor.js +181 -0
- package/lib/InputEditor/inputEditor.less +8 -0
- package/lib/InputEditor/package.json +6 -0
- package/lib/InputSearch/InputSearch.js +274 -0
- package/lib/InputSearch/package.json +6 -0
- package/lib/InputSelect/InputSelect.js +168 -0
- package/lib/InputSelect/package.json +6 -0
- package/lib/InputTreeSelect/InputTreeSelect.js +128 -0
- package/lib/InputTreeSelect/package.json +6 -0
- package/lib/InputWriting/InputWriting.js +93 -0
- package/lib/InputWriting/package.json +6 -0
- package/lib/Layout/Layout.js +209 -0
- package/lib/Layout/Layout.less +28 -0
- package/lib/Layout/package.json +6 -0
- package/lib/LayoutLink/LayoutLink.js +86 -0
- package/lib/LayoutLink/LayoutLink.less +53 -0
- package/lib/LayoutLink/package.json +6 -0
- package/lib/Link/Link.js +93 -0
- package/lib/Link/package.json +6 -0
- package/lib/Loading/Loading.js +21 -0
- package/lib/Loading/Loading.less +13 -0
- package/lib/Loading/package.json +6 -0
- package/lib/Loading2/Loading2.js +17 -0
- package/lib/Loading2/Loading2.less +19 -0
- package/lib/Loading2/package.json +6 -0
- package/lib/ModalWithDrag/ModalWithDrag.js +37 -0
- package/lib/ModalWithDrag/ModalWithDrag.less +6 -0
- package/lib/ModalWithDrag/drag.js +124 -0
- package/lib/ModalWithDrag/package.json +6 -0
- package/lib/NumberInput/NumberInput.js +208 -0
- package/lib/NumberInput/package.json +6 -0
- package/lib/Search/Search.js +510 -0
- package/lib/Search/Search.less +63 -0
- package/lib/Search/package.json +6 -0
- package/lib/Search2/Search.js +609 -0
- package/lib/Search2/Search.less +65 -0
- package/lib/Search2/package.json +6 -0
- package/lib/Sidebar/Sidebar.js +152 -0
- package/lib/Sidebar/Sidebar.less +78 -0
- package/lib/Sidebar/package.json +6 -0
- package/lib/Sidebar2/Sidebar.js +173 -0
- package/lib/Sidebar2/Sidebar.less +153 -0
- package/lib/Sidebar2/package.json +6 -0
- package/lib/SuperForm/SuperForm.js +610 -0
- package/lib/SuperForm/SuperForm.less +52 -0
- package/lib/SuperForm/package.json +6 -0
- package/lib/SuperForm2/SuperForm.js +699 -0
- package/lib/SuperForm2/SuperForm.less +52 -0
- package/lib/SuperForm2/package.json +6 -0
- package/lib/SuperIcon/SuperIcon.js +35 -0
- package/lib/SuperIcon/package.json +6 -0
- package/lib/SuperPagination/SuperPagination.js +117 -0
- package/lib/SuperPagination/package.json +6 -0
- package/lib/SuperTab/SuperTab.js +115 -0
- package/lib/SuperTab/SuperTab.less +43 -0
- package/lib/SuperTab/package.json +6 -0
- package/lib/SuperTab2/SuperTab2.js +153 -0
- package/lib/SuperTab2/SuperTab2.less +18 -0
- package/lib/SuperTab2/package.json +6 -0
- package/lib/SuperTable/DragSortRow.js +105 -0
- package/lib/SuperTable/DragSortRow.less +17 -0
- package/lib/SuperTable/FilterDropDown.js +172 -0
- package/lib/SuperTable/FilterDropDown.less +30 -0
- package/lib/SuperTable/SuperTable.js +816 -0
- package/lib/SuperTable/SuperTable.less +132 -0
- package/lib/SuperTable/fixed.js +42 -0
- package/lib/SuperTable/package.json +6 -0
- package/lib/SuperTable2/SuperTable2.js +939 -0
- package/lib/SuperTable2/SuperTable2.less +118 -0
- package/lib/SuperTable2/SuperTableCell.js +239 -0
- package/lib/SuperTable2/package.json +6 -0
- package/lib/SuperTable3/FilterDropDown.js +172 -0
- package/lib/SuperTable3/FilterDropDown.less +29 -0
- package/lib/SuperTable3/SuperTable.js +673 -0
- package/lib/SuperTable3/SuperTable.less +99 -0
- package/lib/SuperTable3/fixed.js +42 -0
- package/lib/SuperTable3/package.json +6 -0
- package/lib/SuperToolbar/SuperToolbar.js +203 -0
- package/lib/SuperToolbar/SuperToolbar.less +17 -0
- package/lib/SuperToolbar/package.json +6 -0
- package/lib/SuperUpload/SuperUpload.js +368 -0
- package/lib/SuperUpload/SuperUpload.less +28 -0
- package/lib/SuperUpload/package.json +6 -0
- package/lib/Title/Title.js +41 -0
- package/lib/Title/Title.less +35 -0
- package/lib/Title/package.json +6 -0
- package/lib/Viewer/ImageViews.js +266 -0
- package/lib/Viewer/Viewer.js +130 -0
- package/lib/Viewer/Viewer.less +67 -0
- package/lib/Viewer/imgView.less +59 -0
- package/lib/Viewer/package.json +7 -0
- package/lib/WingBlank/WingBlank.js +24 -0
- package/lib/WingBlank/WingBlank.less +12 -0
- package/lib/WingBlank/package.json +6 -0
- package/lib/adjust.less +89 -0
- package/lib/helper.js +246 -0
- package/lib/history.js +12 -0
- package/lib/index.js +278 -0
- package/lib/index.less +32 -0
- package/lib/style.less +30 -0
- package/lib/variables.js +14 -0
- package/lib/variables.less +73 -0
- package/package.json +22 -44
- package/src/Area/Area.js +0 -94
- package/src/Card/Card.js +0 -16
- package/src/CodeInput/CodeInput.js +0 -76
- package/src/Control/Control.js +0 -338
- package/src/Control/event.js +0 -45
- package/src/Enhance/Dialogs.js +0 -24
- package/src/Enhance/Loading.js +0 -83
- package/src/Header/Header.js +0 -149
- package/src/Header/Vertical.js +0 -74
- package/src/ImageView/ImageView.js +0 -62
- package/src/Indent/Indent.js +0 -12
- package/src/InpurCascader/InputCascader.js +0 -83
- package/src/InputEditor/InputEditor.js +0 -93
- package/src/InputSearch/InputSearch.js +0 -186
- package/src/InputSelect/InputSelect.js +0 -103
- package/src/InputTreeSelect/InputTreeSelect.js +0 -87
- package/src/InputWriting/InputWriting.js +0 -65
- package/src/Layout/Layout.js +0 -121
- package/src/LayoutLink/LayoutLink.js +0 -59
- package/src/Link/Link.js +0 -57
- package/src/Loading/Loading.js +0 -15
- package/src/Loading2/Loading2.js +0 -15
- package/src/ModalWithDrag/ModalWithDrag.js +0 -17
- package/src/NumberInput/NumberInput.js +0 -137
- package/src/Search/Search.js +0 -368
- package/src/Search2/Search.js +0 -436
- package/src/Sidebar/Sidebar.js +0 -111
- package/src/Sidebar2/Sidebar.js +0 -143
- package/src/SuperForm/SuperForm.js +0 -519
- package/src/SuperForm2/SuperForm.js +0 -588
- package/src/SuperIcon/SuperIcon.js +0 -14
- package/src/SuperPagination/SuperPagination.js +0 -65
- package/src/SuperTab/SuperTab.js +0 -84
- package/src/SuperTab2/SuperTab2.js +0 -94
- package/src/SuperTable/DragSortRow.js +0 -62
- package/src/SuperTable/FilterDropDown.js +0 -111
- package/src/SuperTable/SuperTable.js +0 -590
- package/src/SuperTable/fixed.js +0 -34
- package/src/SuperTable2/SuperTable2.js +0 -624
- package/src/SuperTable2/SuperTableCell.js +0 -175
- package/src/SuperTable3/FilterDropDown.js +0 -111
- package/src/SuperTable3/SuperTable.js +0 -498
- package/src/SuperTable3/fixed.js +0 -34
- package/src/SuperToolbar/SuperToolbar.js +0 -128
- package/src/SuperUpload/SuperUpload.js +0 -137
- package/src/Title/Title.js +0 -18
- package/src/Viewer/ImageViews.js +0 -220
- package/src/Viewer/Viewer.js +0 -97
- package/src/WingBlank/WingBlank.js +0 -14
- package/src/helper.js +0 -185
- package/src/index.js +0 -39
- package/src/variables.js +0 -5
- package/test/index.html +0 -10
- package/test/test.js +0 -16
- package/test/test.less +0 -12
- package/test/webpack.config.js +0 -71
- package/tools/babel.config.js +0 -14
- package/tools/build.js +0 -70
- package/tools/publish.js +0 -9
- package/tools/util.js +0 -53
- /package/{src → es}/Area/package.json +0 -0
- /package/{src → es}/Card/package.json +0 -0
- /package/{src → es}/CodeInput/package.json +0 -0
- /package/{src → es}/Control/package.json +0 -0
- /package/{src → es}/Enhance/package.json +0 -0
- /package/{src → es}/Header/Header.less +0 -0
- /package/{src → es}/Header/Vertical.less +0 -0
- /package/{src → es}/Header/package.json +0 -0
- /package/{src → es}/ImageView/ImageView.less +0 -0
- /package/{src → es}/ImageView/package.json +0 -0
- /package/{src → es}/Indent/package.json +0 -0
- /package/{src → es}/InpurCascader/package.json +0 -0
- /package/{src → es}/InputEditor/inputEditor.less +0 -0
- /package/{src → es}/InputEditor/package.json +0 -0
- /package/{src → es}/InputSearch/package.json +0 -0
- /package/{src → es}/InputSelect/package.json +0 -0
- /package/{src → es}/InputTreeSelect/package.json +0 -0
- /package/{src → es}/InputWriting/package.json +0 -0
- /package/{src → es}/Layout/Layout.less +0 -0
- /package/{src → es}/Layout/package.json +0 -0
- /package/{src → es}/LayoutLink/LayoutLink.less +0 -0
- /package/{src → es}/LayoutLink/package.json +0 -0
- /package/{src → es}/Link/package.json +0 -0
- /package/{src → es}/Loading/Loading.less +0 -0
- /package/{src → es}/Loading/package.json +0 -0
- /package/{src → es}/Loading2/Loading2.less +0 -0
- /package/{src → es}/Loading2/package.json +0 -0
- /package/{src → es}/ModalWithDrag/ModalWithDrag.less +0 -0
- /package/{src → es}/ModalWithDrag/package.json +0 -0
- /package/{src → es}/NumberInput/package.json +0 -0
- /package/{src → es}/Search/Search.less +0 -0
- /package/{src → es}/Search/package.json +0 -0
- /package/{src → es}/Search2/Search.less +0 -0
- /package/{src → es}/Search2/package.json +0 -0
- /package/{src → es}/Sidebar/Sidebar.less +0 -0
- /package/{src → es}/Sidebar/package.json +0 -0
- /package/{src → es}/Sidebar2/Sidebar.less +0 -0
- /package/{src → es}/Sidebar2/package.json +0 -0
- /package/{src → es}/SuperForm/SuperForm.less +0 -0
- /package/{src → es}/SuperForm/package.json +0 -0
- /package/{src → es}/SuperForm2/SuperForm.less +0 -0
- /package/{src → es}/SuperForm2/package.json +0 -0
- /package/{src → es}/SuperIcon/package.json +0 -0
- /package/{src → es}/SuperPagination/package.json +0 -0
- /package/{src → es}/SuperTab/SuperTab.less +0 -0
- /package/{src → es}/SuperTab/package.json +0 -0
- /package/{src → es}/SuperTab2/SuperTab2.less +0 -0
- /package/{src → es}/SuperTab2/package.json +0 -0
- /package/{src → es}/SuperTable/DragSortRow.less +0 -0
- /package/{src → es}/SuperTable/FilterDropDown.less +0 -0
- /package/{src → es}/SuperTable/SuperTable.less +0 -0
- /package/{src → es}/SuperTable/package.json +0 -0
- /package/{src → es}/SuperTable2/SuperTable2.less +0 -0
- /package/{src → es}/SuperTable2/package.json +0 -0
- /package/{src → es}/SuperTable3/FilterDropDown.less +0 -0
- /package/{src → es}/SuperTable3/SuperTable.less +0 -0
- /package/{src → es}/SuperTable3/package.json +0 -0
- /package/{src → es}/SuperToolbar/SuperToolbar.less +0 -0
- /package/{src → es}/SuperToolbar/package.json +0 -0
- /package/{src → es}/SuperUpload/SuperUpload.less +0 -0
- /package/{src → es}/SuperUpload/package.json +0 -0
- /package/{src → es}/Title/Title.less +0 -0
- /package/{src → es}/Title/package.json +0 -0
- /package/{src → es}/Viewer/Viewer.less +0 -0
- /package/{src → es}/Viewer/imgView.less +0 -0
- /package/{src → es}/Viewer/package.json +0 -0
- /package/{src → es}/WingBlank/WingBlank.less +0 -0
- /package/{src → es}/WingBlank/package.json +0 -0
- /package/{src → es}/adjust.less +0 -0
- /package/{src → es}/style.less +0 -0
- /package/{src → es}/variables.less +0 -0
package/src/Enhance/Loading.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import Loading from '../Loading';
|
|
4
|
-
|
|
5
|
-
const STATUS = [
|
|
6
|
-
'loadingWithInit', // 显示加载画面,并自动触发onInit事件,默认值
|
|
7
|
-
'loading', // 显示加载画面
|
|
8
|
-
'retry', // 显示重试画面
|
|
9
|
-
'retryForHome', // 显示重试画面(触发onInit时,home参数为true)
|
|
10
|
-
'page', // 显示正常的页面(表明页面状态已经初始化好)
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* status: [可选], 当前状态。默认为loadingWithInit
|
|
15
|
-
* home: [可选],为true表明接受首页触发的事件。默认为false
|
|
16
|
-
* onInit: [可选],原型为func(home),home为true表明初始化是来源首页
|
|
17
|
-
* onRefreshForHome:[可选],检测到来至首页时会触发该事件,原型为func()
|
|
18
|
-
*/
|
|
19
|
-
const Enhance = Component => class extends React.Component {
|
|
20
|
-
static propTypes = {
|
|
21
|
-
status: PropTypes.oneOf(STATUS),
|
|
22
|
-
home: PropTypes.bool,
|
|
23
|
-
onInit: PropTypes.func,
|
|
24
|
-
onRefreshForHome: PropTypes.func
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
triggerEvent = () => {
|
|
28
|
-
if (!global.isServer) {
|
|
29
|
-
const {status='loadingWithInit', home, onInit, onRefreshForHome} = this.props;
|
|
30
|
-
if (!home) {
|
|
31
|
-
if (status === 'loadingWithInit') {
|
|
32
|
-
onInit && onInit(false);
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
const __home = global['__home'];
|
|
36
|
-
global['__home'] && (global['__home'] = false);
|
|
37
|
-
if (status === 'loadingWithInit') {
|
|
38
|
-
onInit && onInit(__home);
|
|
39
|
-
} else if (__home) {
|
|
40
|
-
if (status === 'page') {
|
|
41
|
-
onRefreshForHome && onRefreshForHome();
|
|
42
|
-
} else if (status !== 'loading') {
|
|
43
|
-
onInit && onInit(__home);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
componentDidMount() {
|
|
51
|
-
this.triggerEvent();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
componentDidUpdate() {
|
|
55
|
-
this.triggerEvent();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
onRetry = () => {
|
|
59
|
-
const {status, onInit} = this.props;
|
|
60
|
-
onInit && onInit(status === 'retryForHome');
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
getPageProps = () => {
|
|
64
|
-
const props = {...this.props};
|
|
65
|
-
delete props.status;
|
|
66
|
-
delete props.home;
|
|
67
|
-
delete props.onInit;
|
|
68
|
-
delete props.onRefreshForHome;
|
|
69
|
-
return props;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
render() {
|
|
73
|
-
const {status} = this.props;
|
|
74
|
-
if (status !== 'page') {
|
|
75
|
-
const retry = status === 'retry' || status === 'retryForHome';
|
|
76
|
-
return <Loading retry={retry} onRetry={this.onRetry}/>;
|
|
77
|
-
} else {
|
|
78
|
-
return <Component {...this.getPageProps()} />;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export default Enhance;
|
package/src/Header/Header.js
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {Badge, Avatar, Menu, Dropdown} from 'antd';
|
|
3
|
-
import Link from '../Link';
|
|
4
|
-
import SuperIcon from '../SuperIcon';
|
|
5
|
-
import helper from '../helper';
|
|
6
|
-
import Vertical from './Vertical';
|
|
7
|
-
import variables from '../variables';
|
|
8
|
-
|
|
9
|
-
const MenuItem = Menu.Item;
|
|
10
|
-
|
|
11
|
-
class Header extends React.Component {
|
|
12
|
-
|
|
13
|
-
static Vertical = Vertical;
|
|
14
|
-
|
|
15
|
-
constructor(props) {
|
|
16
|
-
super(props);
|
|
17
|
-
if (props.selectUrl) {
|
|
18
|
-
this.state = {[props.selectKey]: props.selectUrl};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
componentWillReceiveProps(props) {
|
|
23
|
-
if (props.selectUrl) {
|
|
24
|
-
this.setState({[props.selectKey]: props.selectUrl});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
toLogo = () => {
|
|
29
|
-
const img = this.props.logoImg || '/logo.png';
|
|
30
|
-
const props = this.getLinkProps('home', this.state['main'] || this.props.homeUrl || '/', {role: 'logo'});
|
|
31
|
-
return <Link {...props}><img src={img} alt='logo'/></Link>;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
toIcon = (type) => {
|
|
35
|
-
const style = {fontSize: 18, verticalAlign: 'middle'};
|
|
36
|
-
return <SuperIcon type={type} style={style} />;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
getLinkProps = (key, url, props={}) => {
|
|
40
|
-
return {
|
|
41
|
-
...props,
|
|
42
|
-
to: url,
|
|
43
|
-
'data-role': 'block',
|
|
44
|
-
'data-active': this.props.selectKey === key ? 'true' : null
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
toSetting = (settingUrl) => {
|
|
49
|
-
if (settingUrl) {
|
|
50
|
-
const props = this.getLinkProps('setting', this.state['setting'] || settingUrl);
|
|
51
|
-
return <Link {...props}>{this.toIcon('pld-setting')}</Link>;
|
|
52
|
-
} else {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
toMessage = (messageUrl, count=0) => {
|
|
58
|
-
if (messageUrl) {
|
|
59
|
-
const props = this.getLinkProps('message', this.state['message'] || messageUrl);
|
|
60
|
-
const msgProps = {
|
|
61
|
-
overflowCount: 99,
|
|
62
|
-
title: `您有${count}条未读消息`,
|
|
63
|
-
count
|
|
64
|
-
};
|
|
65
|
-
return (
|
|
66
|
-
<Link {...props}>
|
|
67
|
-
<span role='message'>
|
|
68
|
-
<Badge {...msgProps}>{this.toIcon('pld-xiaoxi')}</Badge>
|
|
69
|
-
</span>
|
|
70
|
-
</Link>
|
|
71
|
-
);
|
|
72
|
-
} else {
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
onMenuItemClick = ({key}) => {
|
|
78
|
-
const {onMenuClick} = this.props;
|
|
79
|
-
onMenuClick && onMenuClick(key);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
menu = (hasImport) => {
|
|
83
|
-
return (
|
|
84
|
-
<Menu className={variables('Header').menu} onClick={this.onMenuItemClick}>
|
|
85
|
-
<MenuItem key='person'>个人信息</MenuItem>
|
|
86
|
-
{hasImport ? <MenuItem key='mode'>导入模板</MenuItem> : null}
|
|
87
|
-
<MenuItem key='modify'>修改密码</MenuItem>
|
|
88
|
-
</Menu>
|
|
89
|
-
);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
avatar = (hasImport) => {
|
|
93
|
-
return (
|
|
94
|
-
<Dropdown placement='bottomRight' overlay={this.menu(hasImport)}>
|
|
95
|
-
<span data-role='avatar' style={{cursor: 'pointer'}}>
|
|
96
|
-
{this.toIcon(this.props.userIcon)}
|
|
97
|
-
</span>
|
|
98
|
-
</Dropdown>
|
|
99
|
-
);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
toPerson = () => {
|
|
103
|
-
const hasImport = this.props.hasImport || true;
|
|
104
|
-
return (
|
|
105
|
-
<div role='person'>
|
|
106
|
-
<div/>
|
|
107
|
-
{this.avatar(hasImport)}
|
|
108
|
-
<span>{this.props.userName}</span>
|
|
109
|
-
</div>
|
|
110
|
-
);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
toLogout = () => {
|
|
114
|
-
const props = {
|
|
115
|
-
to: this.props.loginUrl,
|
|
116
|
-
'data-role': 'block',
|
|
117
|
-
onClick: this.props.onLogout()
|
|
118
|
-
};
|
|
119
|
-
return (
|
|
120
|
-
<Link {...props}>
|
|
121
|
-
{this.toIcon('logout')}
|
|
122
|
-
<span>退出</span>
|
|
123
|
-
</Link>
|
|
124
|
-
);
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
toTail = () => {
|
|
128
|
-
const {settingUrl,messageUrl,messageCount} = this.props;
|
|
129
|
-
return (
|
|
130
|
-
<span>
|
|
131
|
-
{this.toSetting(settingUrl)}
|
|
132
|
-
{this.toMessage(messageUrl,messageCount)}
|
|
133
|
-
{this.toPerson()}
|
|
134
|
-
{this.toLogout()}
|
|
135
|
-
</span>
|
|
136
|
-
);
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
render() {
|
|
140
|
-
return (
|
|
141
|
-
<header className={variables('Header')}>
|
|
142
|
-
{this.toLogo()}
|
|
143
|
-
{this.toTail()}
|
|
144
|
-
</header>
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export default Header;
|
package/src/Header/Vertical.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import Link from '../Link';
|
|
4
|
-
import SuperIcon from '../SuperIcon';
|
|
5
|
-
import variables from '../variables';
|
|
6
|
-
|
|
7
|
-
const ITEM_TYPE = {
|
|
8
|
-
key: PropTypes.string.isRequired,
|
|
9
|
-
href: PropTypes.string.isRequired,
|
|
10
|
-
title: PropTypes.string.isRequired,
|
|
11
|
-
icon: PropTypes.string.isRequired
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* selectKey: 选中的key
|
|
16
|
-
* url:url优先级高于item中的href
|
|
17
|
-
*/
|
|
18
|
-
class Vertical extends React.Component {
|
|
19
|
-
static propTypes = {
|
|
20
|
-
selectKey: PropTypes.string,
|
|
21
|
-
url: PropTypes.object,
|
|
22
|
-
items: PropTypes.arrayOf(PropTypes.shape(ITEM_TYPE)),
|
|
23
|
-
onSelectKey: PropTypes.func
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
state = {id: ''};
|
|
27
|
-
|
|
28
|
-
isSelect = (item) => {
|
|
29
|
-
return item.key === this.props.selectKey;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
getUrl = (item) => {
|
|
33
|
-
return this.props.url[item.key] || item.href;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
onClick = (selectKey) => {
|
|
37
|
-
this.props.onSelectKey && this.props.onSelectKey(selectKey);
|
|
38
|
-
if (this.state.id) {
|
|
39
|
-
clearTimeout(this.state.id);
|
|
40
|
-
}
|
|
41
|
-
this.setState({id: setTimeout(() => {
|
|
42
|
-
this.setState({id: ''});
|
|
43
|
-
}, 500)})
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
toItem = (item) => {
|
|
47
|
-
if (!item.jumpOut) {
|
|
48
|
-
return (
|
|
49
|
-
<Link key={item.key} to={this.getUrl(item)} data-select={this.isSelect(item)} onClick={this.onClick.bind(null, item.key)}>
|
|
50
|
-
<span><SuperIcon type={item.icon} /></span>
|
|
51
|
-
<span>{item.title}</span>
|
|
52
|
-
</Link>
|
|
53
|
-
);
|
|
54
|
-
} else {
|
|
55
|
-
const props = {key: item.key, href: item.href, target: '_blank'};
|
|
56
|
-
return (
|
|
57
|
-
<a {...props}>
|
|
58
|
-
<span><SuperIcon type={item.icon} /></span>
|
|
59
|
-
<span>{item.title}</span>
|
|
60
|
-
</a>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
render() {
|
|
66
|
-
return (
|
|
67
|
-
<header className={variables('Vertical')} data-click={!!this.state.id}>
|
|
68
|
-
{this.props.items.map(this.toItem)}
|
|
69
|
-
</header>
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export default Vertical;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {ModalWithDrag, Title} from '../index';
|
|
3
|
-
import { Empty } from 'antd';
|
|
4
|
-
import variables from '../variables';
|
|
5
|
-
|
|
6
|
-
class ImageView extends React.Component{
|
|
7
|
-
constructor(props) {
|
|
8
|
-
super(props);
|
|
9
|
-
this.state = {
|
|
10
|
-
previewVisible: false,
|
|
11
|
-
index: 0,
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
ClosePreview = () => {this.setState({ previewVisible: false })}
|
|
15
|
-
showBigImg = () =>{
|
|
16
|
-
const {imgList} = this.props;
|
|
17
|
-
const {previewVisible,index} = this.state;
|
|
18
|
-
const props = {
|
|
19
|
-
width: 900,
|
|
20
|
-
title: imgList[index].fileName,
|
|
21
|
-
onCancel: this.ClosePreview,
|
|
22
|
-
visible: previewVisible,
|
|
23
|
-
maskClosable: true,
|
|
24
|
-
footer: null
|
|
25
|
-
};
|
|
26
|
-
return (
|
|
27
|
-
<ModalWithDrag {...props}>
|
|
28
|
-
<img alt="example" style={{ width: '100%' }} src={imgList[index].fileUrl} />
|
|
29
|
-
</ModalWithDrag>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
toSeeImg = (e) =>{
|
|
34
|
-
if (this.props.toSeeImg) {
|
|
35
|
-
this.props.toSeeImg(e);
|
|
36
|
-
} else {
|
|
37
|
-
this.myClick(e.index)
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
myClick = (index) =>{
|
|
42
|
-
this.setState({ previewVisible: true , index: index})
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
render (){
|
|
46
|
-
const {imgList,title, toSeeImg} = this.props;
|
|
47
|
-
return (
|
|
48
|
-
<div className={variables('ImageView')}>
|
|
49
|
-
{title ? <Title title={title}></Title> : null}
|
|
50
|
-
{imgList.length === 0 ? (<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />) : imgList.map((item,index) =>{
|
|
51
|
-
return (<div className={'imgBox'} key={index} onClick={() => this.toSeeImg({imgArr:imgList,index})}>
|
|
52
|
-
<img src={item.fileUrl}/>
|
|
53
|
-
<p>{item.fileName}</p>
|
|
54
|
-
</div>)
|
|
55
|
-
})}
|
|
56
|
-
{toSeeImg ? null : this.showBigImg()}
|
|
57
|
-
</div>
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export default ImageView;
|
package/src/Indent/Indent.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
//级联选择input
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { Cascader } from 'antd';
|
|
5
|
-
import { getObjectExclude } from '../helper';
|
|
6
|
-
|
|
7
|
-
const optionsType = {
|
|
8
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
9
|
-
disabled: PropTypes.bool,
|
|
10
|
-
children: PropTypes.array,
|
|
11
|
-
title: PropTypes.string,
|
|
12
|
-
isLeaf: PropTypes.bool //false 就会触发 loadData 方法,从而在loadData方法中请求下一级数据,
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const PROPS = {
|
|
17
|
-
options: PropTypes.arrayOf(PropTypes.shape(optionsType)).isRequired,
|
|
18
|
-
value: PropTypes.array.isRequired,
|
|
19
|
-
placeholder: PropTypes.string,
|
|
20
|
-
onChange: PropTypes.func,
|
|
21
|
-
loadData: PropTypes.func, //动态加载 ps:loadData 与 showSearch 无法一起使用
|
|
22
|
-
showSearch: PropTypes.func
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const PROPS_KEYS = Object.keys(PROPS);
|
|
26
|
-
class InputCascader extends React.Component {
|
|
27
|
-
static propTypes = PROPS;
|
|
28
|
-
|
|
29
|
-
constructor(props) {
|
|
30
|
-
super(props);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
onChange = (value) => {
|
|
34
|
-
const { onChange } = this.props;
|
|
35
|
-
onChange && onChange(value)
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
loadData = selectedOptions => {
|
|
39
|
-
const { onSearch } = this.props;
|
|
40
|
-
onSearch && onSearch(selectedOptions[0])
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
getOptions = (options) => {
|
|
44
|
-
return options.map(option => {
|
|
45
|
-
let obj = { ...option, label: option.title};
|
|
46
|
-
if(option.children && option.children.length > 0){
|
|
47
|
-
obj.children = this.getOptions(option.children)
|
|
48
|
-
}
|
|
49
|
-
return obj;
|
|
50
|
-
})
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
showSearch = (inputValue, path) => {
|
|
54
|
-
return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
getProps = () => {
|
|
58
|
-
const { options = [], placeholder, size,value,loadData,showSearch,changeOnSelect=true } = this.props;
|
|
59
|
-
const props = Object.assign(getObjectExclude({}, PROPS_KEYS), {
|
|
60
|
-
onChange: this.onChange,
|
|
61
|
-
value: value,
|
|
62
|
-
options: this.getOptions(options),
|
|
63
|
-
changeOnSelect,
|
|
64
|
-
placeholder: placeholder,
|
|
65
|
-
size
|
|
66
|
-
})
|
|
67
|
-
//动态加载 ps:loadData 与 showSearch 无法一起使用
|
|
68
|
-
if(showSearch){
|
|
69
|
-
props.showSearch = true;
|
|
70
|
-
}else if(loadData){
|
|
71
|
-
props.loadData = this.loadData
|
|
72
|
-
}
|
|
73
|
-
return props;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
render() {
|
|
77
|
-
return (
|
|
78
|
-
<Cascader {...this.getProps()} />
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export default InputCascader;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import variables from '../variables';
|
|
3
|
-
import helper from "../helper";
|
|
4
|
-
|
|
5
|
-
const defaultMenus = [
|
|
6
|
-
'head', // 标题
|
|
7
|
-
'bold', // 粗体
|
|
8
|
-
'fontSize', // 字号
|
|
9
|
-
'fontName', // 字体
|
|
10
|
-
'italic', // 斜体
|
|
11
|
-
'underline', // 下划线
|
|
12
|
-
'strikeThrough', // 删除线
|
|
13
|
-
'foreColor', // 文字颜色
|
|
14
|
-
'backColor', // 背景颜色
|
|
15
|
-
'link', // 插入链接
|
|
16
|
-
'list', // 列表
|
|
17
|
-
'justify', // 对齐方式
|
|
18
|
-
'quote', // 引用
|
|
19
|
-
'image', // 插入图片
|
|
20
|
-
'table', // 表格
|
|
21
|
-
'code', // 插入代码
|
|
22
|
-
'video', // 插入视频
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
class InputEditor extends React.Component {
|
|
26
|
-
|
|
27
|
-
componentDidMount() {
|
|
28
|
-
const {inputKey,menus,color,showLinkImg = true,uploadImgShowBase64 = true,onChange,value, readonly, uploadVideoServer='/api/proxy/base-server-service/file/client/upload/document',} = this.props;
|
|
29
|
-
if (!readonly) {
|
|
30
|
-
const elem = this.refs[inputKey];
|
|
31
|
-
this[inputKey] = new E(elem);
|
|
32
|
-
//配置菜单
|
|
33
|
-
menus && (this[inputKey].config.menus = menus);
|
|
34
|
-
//配置颜色
|
|
35
|
-
color && (this[inputKey].config.menus = color);
|
|
36
|
-
//配置菜单
|
|
37
|
-
this[inputKey].config.menus = defaultMenus;
|
|
38
|
-
if(menus){
|
|
39
|
-
this[inputKey].config.menus = menus
|
|
40
|
-
}
|
|
41
|
-
this[inputKey].config.uploadImgShowBase64 = uploadImgShowBase64; //是否可以上传图片
|
|
42
|
-
this[inputKey].config.showLinkImg = showLinkImg; //隐藏网络图片
|
|
43
|
-
if (uploadVideoServer) {
|
|
44
|
-
this[inputKey].config.uploadVideoServer = uploadVideoServer;
|
|
45
|
-
this[inputKey].config.uploadVideoMaxSize = 1024 * 1024 * 100; // 100MB
|
|
46
|
-
this[inputKey].config.uploadVideoAccept = ['mp4', 'webm', 'ogg']; // 支持的视频格式
|
|
47
|
-
this[inputKey].config.uploadVideoName = 'file'; // form-data fieldName
|
|
48
|
-
// 自定义视频插入回调
|
|
49
|
-
this[inputKey].config.uploadVideoHooks = {
|
|
50
|
-
customInsert: async (insertVideo, results) => {
|
|
51
|
-
console.log(results)
|
|
52
|
-
if (results.returnCode === 0 && results.result) {
|
|
53
|
-
const URL_DOWNLOAD= '/api/standard/download'; // 点击下载
|
|
54
|
-
const {returnCode, result, returnMsg} = await helper.fetchJson(`${URL_DOWNLOAD}/${results.result}`);
|
|
55
|
-
if (returnCode !== 0) {
|
|
56
|
-
return helper.showError(returnMsg);
|
|
57
|
-
}
|
|
58
|
-
const currentOrigin = window.location.origin; // 获取当前页面的协议+域名+端口
|
|
59
|
-
const videoUrl = `${currentOrigin}/api/proxy/base-server-service/file/url/documents/open/${results.result}`;
|
|
60
|
-
insertVideo(videoUrl);
|
|
61
|
-
} else {
|
|
62
|
-
alert('视频上传失败: ' + (results.message || '未知错误'));
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
this[inputKey].config.onchange = html => {
|
|
68
|
-
onChange && onChange(html);
|
|
69
|
-
};
|
|
70
|
-
//配置编辑区域的 z-index
|
|
71
|
-
this[inputKey].config.zIndex = 0;
|
|
72
|
-
this[inputKey].create();
|
|
73
|
-
this[inputKey].txt.html(value)
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
componentDidUpdate() {
|
|
78
|
-
// const {inputKey,value='', readonly} = this.props;
|
|
79
|
-
// !readonly && value && this[inputKey].txt.html(value); //支持清空操作
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
render() {
|
|
83
|
-
const {inputKey, readonly, value} = this.props;
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<div className={variables('InputEditor')}>
|
|
87
|
-
{readonly ? <div dangerouslySetInnerHTML = {{__html:`${value}`}}/> : <div ref={inputKey} />}
|
|
88
|
-
</div>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export default InputEditor;
|