easy3wui 1.5.47-beta2 → 1.5.47-beta3
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/assets/gridPage.css +92 -0
- package/assets/index.css +1484 -0
- package/assets/login.css +61 -0
- package/assets/loginLayout.css +115 -0
- package/assets/modal.css +0 -0
- package/assets/result.css +45 -0
- package/assets/userLayout.css +70 -0
- package/lib/Easy3wDownLoad/Easy3wRCView.js +65 -0
- package/lib/Easy3wDownLoad/index.js +329 -0
- package/lib/Easy3wException/403.js +21 -0
- package/lib/Easy3wException/404.js +21 -0
- package/lib/Easy3wException/500.js +21 -0
- package/lib/Easy3wException/index.js +94 -0
- package/lib/Easy3wException/typeConfig.js +23 -0
- package/lib/Easy3wFlow/index.js +548 -0
- package/lib/Easy3wFormPage/index.js +2135 -0
- package/lib/Easy3wGetCookie/index.js +14 -0
- package/lib/Easy3wGlobalFooter/index.js +73 -0
- package/lib/Easy3wGlobalHeader/index.js +148 -0
- package/lib/Easy3wGridCheckBox/index.js +69 -0
- package/lib/Easy3wGridDatePicker/index.js +90 -0
- package/lib/Easy3wGridDateTimePicker/index.js +122 -0
- package/lib/Easy3wGridInput/index.js +105 -0
- package/lib/Easy3wGridInputNumber/index.js +83 -0
- package/lib/Easy3wGridInputNumberFormat/index.js +93 -0
- package/lib/Easy3wGridPage/index.js +735 -0
- package/lib/Easy3wGridRadio/index.js +70 -0
- package/lib/Easy3wGridSelect/index.js +95 -0
- package/lib/Easy3wGridTextArea/index.js +128 -0
- package/lib/Easy3wInput/index.js +48 -0
- package/lib/Easy3wLogin/index.js +386 -0
- package/lib/Easy3wLoginLayout/index.js +628 -0
- package/lib/Easy3wModal/index.js +144 -0
- package/lib/Easy3wPositionButton/index.js +99 -0
- package/lib/Easy3wQryGrid/index.js +670 -0
- package/lib/Easy3wResult/index.js +77 -0
- package/lib/Easy3wSetCookie/index.js +13 -0
- package/lib/Easy3wSpin/index.js +69 -0
- package/lib/Easy3wTabs/index.js +89 -0
- package/lib/Easy3wTagSelect/index.js +238 -0
- package/lib/Easy3wUpload/index.js +511 -0
- package/lib/Easy3wUploadB/index copy 2.js +1011 -0
- package/lib/Easy3wUploadB/index copy.js +1020 -0
- package/lib/Easy3wUploadB/index.js +1056 -0
- package/lib/Easy3wUploadM/index.js +512 -0
- package/lib/Easy3wUserLayout/index.js +138 -0
- package/package.json +1 -1
package/assets/login.css
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
|
2
|
+
/* stylelint-disable no-duplicate-selectors */
|
|
3
|
+
/* stylelint-disable */
|
|
4
|
+
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
|
|
5
|
+
.e3wLoginMain {
|
|
6
|
+
width: 368px;
|
|
7
|
+
margin: 0 auto;
|
|
8
|
+
z-index: 100;
|
|
9
|
+
}
|
|
10
|
+
.e3wLoginMain .e3wLoginTabs {
|
|
11
|
+
padding: 0 2px;
|
|
12
|
+
margin: 0 -2px;
|
|
13
|
+
}
|
|
14
|
+
.e3wLoginMain .e3wLoginTabs :global .ant-tabs-tab {
|
|
15
|
+
font-size: 16px;
|
|
16
|
+
line-height: 24px;
|
|
17
|
+
}
|
|
18
|
+
.e3wLoginMain .e3wLoginTabs :global .ant-input-affix-wrapper .ant-input:not(:first-child) {
|
|
19
|
+
padding-left: 34px;
|
|
20
|
+
}
|
|
21
|
+
.e3wLoginMain :global .ant-tabs .ant-tabs-bar {
|
|
22
|
+
border-bottom: 0;
|
|
23
|
+
margin-bottom: 24px;
|
|
24
|
+
text-align: center;
|
|
25
|
+
}
|
|
26
|
+
.e3wLoginMain :global .ant-form-item {
|
|
27
|
+
margin-bottom: 24px;
|
|
28
|
+
}
|
|
29
|
+
.e3wLoginMain :global .ant-tooltip-inner {
|
|
30
|
+
background-color: #fff;
|
|
31
|
+
}
|
|
32
|
+
.e3wLoginMain .e3wLoginPrefixIcon {
|
|
33
|
+
font-size: 14px;
|
|
34
|
+
color: rgba(0, 0, 0, 0.25);
|
|
35
|
+
}
|
|
36
|
+
.e3wLoginMain .e3wLoginAdditional {
|
|
37
|
+
text-align: left;
|
|
38
|
+
}
|
|
39
|
+
.e3wLoginMain .e3wLoginAdditional .e3wLoginForgot {
|
|
40
|
+
float: right;
|
|
41
|
+
margin-right: 12px;
|
|
42
|
+
}
|
|
43
|
+
.e3wLoginMain .e3wLoginAdditional .e3wLoginSubmit {
|
|
44
|
+
width: 100%;
|
|
45
|
+
margin-top: 24px;
|
|
46
|
+
display: block;
|
|
47
|
+
}
|
|
48
|
+
.e3wLoginMain .e3wLoginAdditional :global .ant-form-item-control {
|
|
49
|
+
line-height: 22px;
|
|
50
|
+
}
|
|
51
|
+
.e3wLoginMain .e3wLoginOther {
|
|
52
|
+
text-align: left;
|
|
53
|
+
line-height: 22px;
|
|
54
|
+
}
|
|
55
|
+
.e3wLoginMain .e3wLoginOther .e3wLoginRegister {
|
|
56
|
+
float: right;
|
|
57
|
+
margin-right: 12px;
|
|
58
|
+
}
|
|
59
|
+
.e3wLoginMain #pop {
|
|
60
|
+
color: #5468ae;
|
|
61
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
|
2
|
+
/* stylelint-disable no-duplicate-selectors */
|
|
3
|
+
/* stylelint-disable */
|
|
4
|
+
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
|
|
5
|
+
.e3wLoginLayoutHeader {
|
|
6
|
+
padding: 0 12px 0 0;
|
|
7
|
+
background: #fff;
|
|
8
|
+
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
|
|
9
|
+
position: relative;
|
|
10
|
+
}
|
|
11
|
+
.e3wLoginLayoutHeader h1 {
|
|
12
|
+
color: #000;
|
|
13
|
+
display: inline-block;
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
17
|
+
font-weight: 400;
|
|
18
|
+
}
|
|
19
|
+
.e3wLoginLayoutLogo {
|
|
20
|
+
height: 64px;
|
|
21
|
+
position: relative;
|
|
22
|
+
line-height: 64px;
|
|
23
|
+
padding-left: 35px;
|
|
24
|
+
transition: all .3s;
|
|
25
|
+
background: #fff;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
}
|
|
28
|
+
.e3wLoginLayoutLogo img {
|
|
29
|
+
display: inline-block;
|
|
30
|
+
vertical-align: middle;
|
|
31
|
+
height: 24px;
|
|
32
|
+
}
|
|
33
|
+
.e3wLoginLayoutLogo h1 {
|
|
34
|
+
color: #fff;
|
|
35
|
+
display: inline-block;
|
|
36
|
+
vertical-align: middle;
|
|
37
|
+
font-size: 20px;
|
|
38
|
+
margin: 0 0 0 12px;
|
|
39
|
+
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
40
|
+
font-weight: 600;
|
|
41
|
+
}
|
|
42
|
+
.e3wLoginLayoutTrigger {
|
|
43
|
+
font-size: 20px;
|
|
44
|
+
line-height: 64px;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
transition: all .3s;
|
|
47
|
+
padding: 0 24px;
|
|
48
|
+
}
|
|
49
|
+
.e3wLoginLayoutTrigger:hover {
|
|
50
|
+
background: #e6f7ff;
|
|
51
|
+
}
|
|
52
|
+
.e3wLoginLayoutRight {
|
|
53
|
+
float: right;
|
|
54
|
+
height: 100%;
|
|
55
|
+
}
|
|
56
|
+
.e3wLoginLayoutRight .schedule {
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
padding: 12px 12px;
|
|
59
|
+
display: inline-block;
|
|
60
|
+
transition: all .3s;
|
|
61
|
+
height: 100%;
|
|
62
|
+
}
|
|
63
|
+
.e3wLoginLayoutRight .schedule > i {
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
vertical-align: middle;
|
|
66
|
+
}
|
|
67
|
+
.e3wLoginLayoutRight .schedule:global(.ant-popover-open),
|
|
68
|
+
.e3wLoginLayoutRight .schedule:hover {
|
|
69
|
+
background: #e6f7ff;
|
|
70
|
+
}
|
|
71
|
+
.e3wLoginLayoutRight .e3wLoginLayoutAction {
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
padding: 0 12px;
|
|
74
|
+
display: inline-block;
|
|
75
|
+
transition: all .3s;
|
|
76
|
+
height: 100%;
|
|
77
|
+
}
|
|
78
|
+
.e3wLoginLayoutRight .e3wLoginLayoutAction > i {
|
|
79
|
+
font-size: 14px;
|
|
80
|
+
vertical-align: middle;
|
|
81
|
+
}
|
|
82
|
+
.e3wLoginLayoutRight .e3wLoginLayoutAction:global(.ant-popover-open),
|
|
83
|
+
.e3wLoginLayoutRight .e3wLoginLayoutAction:hover {
|
|
84
|
+
background: #e6f7ff;
|
|
85
|
+
}
|
|
86
|
+
.e3wLoginLayoutRight .search {
|
|
87
|
+
padding: 0;
|
|
88
|
+
margin: 0 12px;
|
|
89
|
+
}
|
|
90
|
+
.e3wLoginLayoutRight .search:hover {
|
|
91
|
+
background: transparent;
|
|
92
|
+
}
|
|
93
|
+
.e3wLoginLayoutRight .e3wLoginLayoutAccount .e3wLoginLayoutAvatar {
|
|
94
|
+
margin: 20px 8px 20px 0;
|
|
95
|
+
color: #1890ff;
|
|
96
|
+
background: rgba(255, 255, 255, 0.85);
|
|
97
|
+
vertical-align: middle;
|
|
98
|
+
}
|
|
99
|
+
.e3wLoginLayoutRight .e3wLoginLayoutIcon {
|
|
100
|
+
font-size: 14px;
|
|
101
|
+
padding: 4px;
|
|
102
|
+
}
|
|
103
|
+
.e3wLoginLayoutMenu :global(.anticon) {
|
|
104
|
+
margin-right: 8px;
|
|
105
|
+
}
|
|
106
|
+
.e3wLoginLayoutMenu :global(.ant-dropdown-menu-item) {
|
|
107
|
+
width: 160px;
|
|
108
|
+
}
|
|
109
|
+
.e3wLoginLayoutSider {
|
|
110
|
+
min-height: 100vh;
|
|
111
|
+
box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
|
|
112
|
+
position: relative;
|
|
113
|
+
z-index: 10;
|
|
114
|
+
background: #21273f;
|
|
115
|
+
}
|
package/assets/modal.css
ADDED
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
|
2
|
+
/* stylelint-disable no-duplicate-selectors */
|
|
3
|
+
/* stylelint-disable */
|
|
4
|
+
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
|
|
5
|
+
.e3wResult {
|
|
6
|
+
text-align: center;
|
|
7
|
+
width: 72%;
|
|
8
|
+
margin: 0 auto;
|
|
9
|
+
}
|
|
10
|
+
.e3wResult .e3wResultIcon {
|
|
11
|
+
font-size: 72px;
|
|
12
|
+
line-height: 72px;
|
|
13
|
+
margin-bottom: 24px;
|
|
14
|
+
}
|
|
15
|
+
.e3wResult .e3wResultIcon > .e3wResultSuccess {
|
|
16
|
+
color: #52c41a;
|
|
17
|
+
}
|
|
18
|
+
.e3wResult .e3wResultIcon > .e3wResultError {
|
|
19
|
+
color: #f5222d;
|
|
20
|
+
}
|
|
21
|
+
.e3wResult .e3wResultTitle {
|
|
22
|
+
font-size: 24px;
|
|
23
|
+
color: rgba(0, 0, 0, 0.85);
|
|
24
|
+
font-weight: 500;
|
|
25
|
+
line-height: 32px;
|
|
26
|
+
margin-bottom: 16px;
|
|
27
|
+
}
|
|
28
|
+
.e3wResult .e3wResultDescription {
|
|
29
|
+
font-size: 14px;
|
|
30
|
+
line-height: 22px;
|
|
31
|
+
color: rgba(0, 0, 0, 0.45);
|
|
32
|
+
margin-bottom: 24px;
|
|
33
|
+
}
|
|
34
|
+
.e3wResult .e3wResultExtra {
|
|
35
|
+
background: #fafafa;
|
|
36
|
+
padding: 24px 40px;
|
|
37
|
+
border-radius: 2px;
|
|
38
|
+
text-align: left;
|
|
39
|
+
}
|
|
40
|
+
.e3wResult .e3wResultActions {
|
|
41
|
+
margin-top: 32px;
|
|
42
|
+
}
|
|
43
|
+
.e3wResult .e3wResultActions e3wResultButton:not(:last-child) {
|
|
44
|
+
margin-right: 8px;
|
|
45
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
|
2
|
+
/* stylelint-disable no-duplicate-selectors */
|
|
3
|
+
/* stylelint-disable */
|
|
4
|
+
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
|
|
5
|
+
.e3wUserLayoutContainer {
|
|
6
|
+
background: #f0f2f5;
|
|
7
|
+
width: 100%;
|
|
8
|
+
min-height: 100%;
|
|
9
|
+
background-repeat: no-repeat;
|
|
10
|
+
background-position: center;
|
|
11
|
+
background-size: 100%;
|
|
12
|
+
padding: 40px 0 0 0;
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
.e3wUserLayoutTop {
|
|
16
|
+
text-align: center;
|
|
17
|
+
}
|
|
18
|
+
.e3wUserLayoutHeader {
|
|
19
|
+
padding: 0 12px 0 0;
|
|
20
|
+
background: #fff;
|
|
21
|
+
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
|
|
22
|
+
position: relative;
|
|
23
|
+
}
|
|
24
|
+
.e3wUserLayoutRight {
|
|
25
|
+
float: right;
|
|
26
|
+
height: 100%;
|
|
27
|
+
}
|
|
28
|
+
.e3wUserLayoutLogo {
|
|
29
|
+
float: left;
|
|
30
|
+
height: 100%;
|
|
31
|
+
line-height: 64px;
|
|
32
|
+
padding-left: 24px;
|
|
33
|
+
transition: all .3s;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
}
|
|
36
|
+
.e3wUserLayoutLogo img {
|
|
37
|
+
display: inline-block;
|
|
38
|
+
vertical-align: middle;
|
|
39
|
+
height: 32px;
|
|
40
|
+
}
|
|
41
|
+
.e3wUserLayoutLogo h1 {
|
|
42
|
+
color: #000;
|
|
43
|
+
display: inline-block;
|
|
44
|
+
vertical-align: middle;
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
margin: 0 0 0 12px;
|
|
47
|
+
font-family: AppleSystemUIFont, 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
48
|
+
font-weight: 400;
|
|
49
|
+
}
|
|
50
|
+
.e3wUserLayoutTitle {
|
|
51
|
+
font-size: 33px;
|
|
52
|
+
color: rgba(0, 0, 0, 0.85);
|
|
53
|
+
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
54
|
+
font-weight: 600;
|
|
55
|
+
position: relative;
|
|
56
|
+
top: 2px;
|
|
57
|
+
}
|
|
58
|
+
.e3wUserLayoutDesc {
|
|
59
|
+
font-size: 14px;
|
|
60
|
+
color: rgba(0, 0, 0, 0.45);
|
|
61
|
+
margin-top: 12px;
|
|
62
|
+
margin-bottom: 40px;
|
|
63
|
+
}
|
|
64
|
+
.e3wUserLayoutFooter {
|
|
65
|
+
bottom: 0px;
|
|
66
|
+
left: 0px;
|
|
67
|
+
width: 100%;
|
|
68
|
+
height: 50px;
|
|
69
|
+
z-index: 99;
|
|
70
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
6
|
+
|
|
7
|
+
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
8
|
+
|
|
9
|
+
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
10
|
+
|
|
11
|
+
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
12
|
+
|
|
13
|
+
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
14
|
+
|
|
15
|
+
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
16
|
+
|
|
17
|
+
var _react = require('react');
|
|
18
|
+
|
|
19
|
+
var _react2 = _interopRequireDefault(_react);
|
|
20
|
+
|
|
21
|
+
var _rcViewer = require('@hanyk/rc-viewer');
|
|
22
|
+
|
|
23
|
+
var _rcViewer2 = _interopRequireDefault(_rcViewer);
|
|
24
|
+
|
|
25
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
26
|
+
|
|
27
|
+
var Easy3wRCView = function (_PureComponent) {
|
|
28
|
+
(0, _inherits3['default'])(Easy3wRCView, _PureComponent);
|
|
29
|
+
|
|
30
|
+
function Easy3wRCView() {
|
|
31
|
+
(0, _classCallCheck3['default'])(this, Easy3wRCView);
|
|
32
|
+
return (0, _possibleConstructorReturn3['default'])(this, _PureComponent.apply(this, arguments));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
Easy3wRCView.prototype.componentDidUpdate = function componentDidUpdate() {
|
|
36
|
+
// eslint-disable-next-line react/no-string-refs
|
|
37
|
+
var viewer = this.refs.viewer.viewer;
|
|
38
|
+
|
|
39
|
+
viewer.show();
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
Easy3wRCView.prototype.render = function render() {
|
|
43
|
+
var _props = this.props,
|
|
44
|
+
imgUrl = _props.imgUrl,
|
|
45
|
+
hideModal = _props.hideModal;
|
|
46
|
+
|
|
47
|
+
return _react2['default'].createElement(
|
|
48
|
+
_rcViewer2['default'],
|
|
49
|
+
{
|
|
50
|
+
options: {
|
|
51
|
+
// 关闭时的回调
|
|
52
|
+
hide: hideModal
|
|
53
|
+
}
|
|
54
|
+
// eslint-disable-next-line react/no-string-refs
|
|
55
|
+
, ref: 'viewer'
|
|
56
|
+
},
|
|
57
|
+
_react2['default'].createElement('img', { style: { display: 'none' }, src: imgUrl, alt: '' })
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return Easy3wRCView;
|
|
62
|
+
}(_react.PureComponent);
|
|
63
|
+
|
|
64
|
+
exports['default'] = Easy3wRCView;
|
|
65
|
+
module.exports = exports['default'];
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _icon = require('antd/lib/icon');
|
|
6
|
+
|
|
7
|
+
var _icon2 = _interopRequireDefault(_icon);
|
|
8
|
+
|
|
9
|
+
var _extends2 = require('babel-runtime/helpers/extends');
|
|
10
|
+
|
|
11
|
+
var _extends3 = _interopRequireDefault(_extends2);
|
|
12
|
+
|
|
13
|
+
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
14
|
+
|
|
15
|
+
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
16
|
+
|
|
17
|
+
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
18
|
+
|
|
19
|
+
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
20
|
+
|
|
21
|
+
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
22
|
+
|
|
23
|
+
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
24
|
+
|
|
25
|
+
require('antd/lib/icon/style');
|
|
26
|
+
|
|
27
|
+
var _react = require('react');
|
|
28
|
+
|
|
29
|
+
var _react2 = _interopRequireDefault(_react);
|
|
30
|
+
|
|
31
|
+
var _propTypes = require('prop-types');
|
|
32
|
+
|
|
33
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
34
|
+
|
|
35
|
+
var _tooltip = require('antd/lib/tooltip');
|
|
36
|
+
|
|
37
|
+
var _tooltip2 = _interopRequireDefault(_tooltip);
|
|
38
|
+
|
|
39
|
+
require('antd/lib/tooltip/style');
|
|
40
|
+
|
|
41
|
+
var _reactImages = require('react-images');
|
|
42
|
+
|
|
43
|
+
var _reactImages2 = _interopRequireDefault(_reactImages);
|
|
44
|
+
|
|
45
|
+
var _classnames = require('classnames');
|
|
46
|
+
|
|
47
|
+
var _classnames2 = _interopRequireDefault(_classnames);
|
|
48
|
+
|
|
49
|
+
var _antd = require('antd');
|
|
50
|
+
|
|
51
|
+
var _comonConfig = require('comonConfigPath/comonConfig');
|
|
52
|
+
|
|
53
|
+
var _Easy3wPDFView = require('./Easy3wPDFView');
|
|
54
|
+
|
|
55
|
+
var _Easy3wPDFView2 = _interopRequireDefault(_Easy3wPDFView);
|
|
56
|
+
|
|
57
|
+
var _Easy3wFileView = require('./Easy3wFileView');
|
|
58
|
+
|
|
59
|
+
var _Easy3wFileView2 = _interopRequireDefault(_Easy3wFileView);
|
|
60
|
+
|
|
61
|
+
var _Easy3wRCView = require('./Easy3wRCView');
|
|
62
|
+
|
|
63
|
+
var _Easy3wRCView2 = _interopRequireDefault(_Easy3wRCView);
|
|
64
|
+
|
|
65
|
+
var _Easy3wGetCookie = require('../Easy3wGetCookie');
|
|
66
|
+
|
|
67
|
+
var _Easy3wGetCookie2 = _interopRequireDefault(_Easy3wGetCookie);
|
|
68
|
+
|
|
69
|
+
var _Easy3wAESEncrypt = require('../Easy3wAESEncrypt');
|
|
70
|
+
|
|
71
|
+
var _Easy3wAESEncrypt2 = _interopRequireDefault(_Easy3wAESEncrypt);
|
|
72
|
+
|
|
73
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
74
|
+
|
|
75
|
+
// const { previewFileUrl, previewFileFlag, previewFileType } = objPreviewFile || {};
|
|
76
|
+
|
|
77
|
+
var Easy3wDownLoad = function (_Component) {
|
|
78
|
+
(0, _inherits3['default'])(Easy3wDownLoad, _Component);
|
|
79
|
+
|
|
80
|
+
function Easy3wDownLoad(props) {
|
|
81
|
+
(0, _classCallCheck3['default'])(this, Easy3wDownLoad);
|
|
82
|
+
|
|
83
|
+
var _this = (0, _possibleConstructorReturn3['default'])(this, _Component.call(this, props));
|
|
84
|
+
|
|
85
|
+
_this.onPreview = function (file, url) {
|
|
86
|
+
var objPreviewFileNew = (0, _extends3['default'])({}, _comonConfig.objPreviewFile, _this.props.objPreviewFile);
|
|
87
|
+
var previewFileUrl = objPreviewFileNew.previewFileUrl,
|
|
88
|
+
previewFileType = objPreviewFileNew.previewFileType;
|
|
89
|
+
var uid = file.uid,
|
|
90
|
+
name = file.name;
|
|
91
|
+
|
|
92
|
+
var fileNameArr = name.toLowerCase().split('.');
|
|
93
|
+
var fileType = fileNameArr[fileNameArr.length - 1];
|
|
94
|
+
if (previewFileType.indexOf(fileType) >= 0) {
|
|
95
|
+
var src = _this.urlDeal(previewFileUrl, uid);
|
|
96
|
+
window.open(src, '_blank');
|
|
97
|
+
} else {
|
|
98
|
+
// window.open(url);
|
|
99
|
+
var aEle = document.createElement('a');
|
|
100
|
+
aEle.setAttribute('href', url);
|
|
101
|
+
aEle.setAttribute('target', '_blank');
|
|
102
|
+
aEle.setAttribute('id', 'downReportFile');
|
|
103
|
+
document.body.appendChild(aEle);
|
|
104
|
+
if (!document.getElementById('downReportFile')) {
|
|
105
|
+
document.body.appendChild(aEle);
|
|
106
|
+
}
|
|
107
|
+
aEle.click();
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
_this.touchDownload = function (file, url) {
|
|
112
|
+
var uid = file.uid,
|
|
113
|
+
name = file.name;
|
|
114
|
+
// const src = this.urlDeal(previewFileUrl, uid);
|
|
115
|
+
// window.open(url);
|
|
116
|
+
|
|
117
|
+
var aEle = document.createElement('a');
|
|
118
|
+
aEle.setAttribute('href', url);
|
|
119
|
+
aEle.setAttribute('target', '_blank');
|
|
120
|
+
aEle.setAttribute('id', 'downReportFile');
|
|
121
|
+
document.body.appendChild(aEle);
|
|
122
|
+
if (!document.getElementById('downReportFile')) {
|
|
123
|
+
document.body.appendChild(aEle);
|
|
124
|
+
}
|
|
125
|
+
aEle.click();
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
_this.urlDeal = function (urlDownloadFile, uid) {
|
|
129
|
+
var propsAFlag = _this.props.propsAFlag; // propsAFlag 加密标识 从引用组件处传入 '1':加密 '0':不加密
|
|
130
|
+
|
|
131
|
+
var retUrl = '';
|
|
132
|
+
if (uid !== '' && propsAFlag === '1' || uid !== '' && propsAFlag !== '0' && (_comonConfig.aFlag === '1' || _comonConfig.aFlag === '2')) {
|
|
133
|
+
var authToken = (0, _Easy3wGetCookie2['default'])('userToken') || 'E3WSAFEAPPQWEFGHYI7I483S';
|
|
134
|
+
var nowStr = _.now();
|
|
135
|
+
var encUrl = (0, _Easy3wAESEncrypt2['default'])(uid + '@#' + nowStr + '@#' + authToken, _comonConfig.a, _comonConfig.b);
|
|
136
|
+
return '' + urlDownloadFile + encUrl;
|
|
137
|
+
} else {
|
|
138
|
+
retUrl = '' + urlDownloadFile + uid;
|
|
139
|
+
return retUrl;
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
_this.showFileView = function (uid, name, apiKey, fileViewURL, fileCallURL) {
|
|
144
|
+
var callURl = fileCallURL + '?fileId=' + uid;
|
|
145
|
+
var crypto = require('crypto');
|
|
146
|
+
var hmac = crypto.createHmac('md5', apiKey);
|
|
147
|
+
var data = hmac.update(callURl);
|
|
148
|
+
var sign = data.digest('hex');
|
|
149
|
+
var btaoFileCallURL = btoa(callURl);
|
|
150
|
+
var viewFileUrl = fileViewURL + '?callURL=' + btaoFileCallURL + '&sign=' + sign;
|
|
151
|
+
_this.setState({ fileId: uid, fileName: name, fileViewFlag: true, viewFileUrl: viewFileUrl });
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
_this.hideFileModal = function () {
|
|
155
|
+
_this.setState({ fileId: '', fileURL: '', fileName: '', fileViewFlag: false });
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
_this.showPdfView = function (uid, url, name) {
|
|
159
|
+
_this.setState({ pdfViewFlag: true, fileId: uid, fileURL: url, fileName: name });
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
_this.hidePDFModal = function () {
|
|
163
|
+
_this.setState({ fileId: '', fileURL: '', fileName: '', pdfViewFlag: false });
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
_this.showImageView = function (url) {
|
|
167
|
+
_this.setState({ imageViewURL: url });
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
_this.hideImageView = function () {
|
|
171
|
+
_this.setState({ imageViewURL: '' });
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
_this.state = {
|
|
175
|
+
pdfViewFlag: false, // pdf预览
|
|
176
|
+
fileViewFlag: false, // xls、xlsx、doc、docx等office文件预览
|
|
177
|
+
fileId: '', // 文件id
|
|
178
|
+
fileName: '', // 文件名称
|
|
179
|
+
fileURL: '', // 文件url
|
|
180
|
+
imageViewURL: '' // 图片预览url
|
|
181
|
+
};
|
|
182
|
+
return _this;
|
|
183
|
+
}
|
|
184
|
+
// 预览
|
|
185
|
+
|
|
186
|
+
// 下载
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
Easy3wDownLoad.prototype.render = function render() {
|
|
190
|
+
var _this2 = this;
|
|
191
|
+
|
|
192
|
+
var _props = this.props,
|
|
193
|
+
urlDownloadFile = _props.urlDownloadFile,
|
|
194
|
+
downloadArr = _props.downloadArr,
|
|
195
|
+
previwPdfFlag = _props.previwPdfFlag,
|
|
196
|
+
fileViewFlag = _props.fileViewFlag,
|
|
197
|
+
apiKey = _props.apiKey,
|
|
198
|
+
fileViewURL = _props.fileViewURL,
|
|
199
|
+
fileCallURL = _props.fileCallURL;
|
|
200
|
+
|
|
201
|
+
var objPreviewFileNew = (0, _extends3['default'])({}, _comonConfig.objPreviewFile, this.props.objPreviewFile);
|
|
202
|
+
var previewFileFlag = objPreviewFileNew.previewFileFlag,
|
|
203
|
+
downloadFileFlag = objPreviewFileNew.downloadFileFlag,
|
|
204
|
+
previewFileType = objPreviewFileNew.previewFileType;
|
|
205
|
+
|
|
206
|
+
var retObj = '';
|
|
207
|
+
if (downloadArr) {
|
|
208
|
+
retObj = downloadArr.map(function (obj) {
|
|
209
|
+
var uid = obj.uid,
|
|
210
|
+
name = obj.name;
|
|
211
|
+
|
|
212
|
+
var url = _this2.urlDeal(urlDownloadFile, uid);
|
|
213
|
+
var fileNameArr = name.toLowerCase().split('.');
|
|
214
|
+
var fileType = fileNameArr[fileNameArr.length - 1];
|
|
215
|
+
if (previewFileFlag && fileViewFlag !== false && fileType.indexOf('png') < 0 && fileType.indexOf('jpg') < 0 && fileType.indexOf('jpeg') < 0) {
|
|
216
|
+
// 预览
|
|
217
|
+
return _react2['default'].createElement(
|
|
218
|
+
'div',
|
|
219
|
+
{ style: { width: '100%', display: 'flex', alignItems: 'center' } },
|
|
220
|
+
_react2['default'].createElement(
|
|
221
|
+
_tooltip2['default'],
|
|
222
|
+
{ placement: 'topLeft', title: name, style: { whiteSpace: 'pre-wrap', wordWrap: 'break-word' } },
|
|
223
|
+
_react2['default'].createElement(
|
|
224
|
+
'a',
|
|
225
|
+
{ onClick: function onClick() {
|
|
226
|
+
return _this2.onPreview(obj, url);
|
|
227
|
+
}, style: { overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', paddingRight: '12px' } },
|
|
228
|
+
name
|
|
229
|
+
)
|
|
230
|
+
),
|
|
231
|
+
downloadFileFlag === '1' ? _react2['default'].createElement(_icon2['default'], { type: 'download', onClick: function onClick() {
|
|
232
|
+
return _this2.touchDownload(obj, url);
|
|
233
|
+
}, style: { float: 'right', lineHeight: '100%' } }) : downloadFileFlag === '0' ? '' : previewFileType.indexOf(fileType) >= 0 ? '' : _react2['default'].createElement(_icon2['default'], { type: 'download', onClick: function onClick() {
|
|
234
|
+
return _this2.touchDownload(obj, url);
|
|
235
|
+
}, style: { float: 'right', lineHeight: '100%' } })
|
|
236
|
+
);
|
|
237
|
+
} else if (previwPdfFlag && fileType.indexOf('pdf') >= 0) {
|
|
238
|
+
return _react2['default'].createElement(
|
|
239
|
+
'div',
|
|
240
|
+
null,
|
|
241
|
+
_react2['default'].createElement(
|
|
242
|
+
'a',
|
|
243
|
+
{ onClick: function onClick() {
|
|
244
|
+
return _this2.showPdfView(uid, url, name);
|
|
245
|
+
} },
|
|
246
|
+
name
|
|
247
|
+
)
|
|
248
|
+
);
|
|
249
|
+
} else if (fileType && fileViewFlag && (fileType.indexOf('doc') >= 0 || fileType.indexOf('docx') >= 0 || fileType.indexOf('xls') >= 0 || fileType.indexOf('xlsx') >= 0 || fileType.indexOf('txt') >= 0)) {
|
|
250
|
+
return _react2['default'].createElement(
|
|
251
|
+
'div',
|
|
252
|
+
null,
|
|
253
|
+
_react2['default'].createElement(
|
|
254
|
+
'a',
|
|
255
|
+
{ onClick: function onClick() {
|
|
256
|
+
return _this2.showFileView(uid, name, apiKey, fileViewURL, fileCallURL);
|
|
257
|
+
} },
|
|
258
|
+
name
|
|
259
|
+
)
|
|
260
|
+
);
|
|
261
|
+
} else if (fileType && (fileType.indexOf('png') >= 0 || fileType.indexOf('jpg') >= 0 || fileType.indexOf('jpeg') >= 0)) {
|
|
262
|
+
return _react2['default'].createElement(
|
|
263
|
+
'div',
|
|
264
|
+
{ style: { width: '100%', display: 'flex', alignItems: 'center' } },
|
|
265
|
+
_react2['default'].createElement(
|
|
266
|
+
'a',
|
|
267
|
+
{ onClick: function onClick() {
|
|
268
|
+
return _this2.showImageView(url);
|
|
269
|
+
}, style: { overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', paddingRight: '12px' } },
|
|
270
|
+
name
|
|
271
|
+
),
|
|
272
|
+
_react2['default'].createElement(_icon2['default'], { type: 'download', onClick: function onClick() {
|
|
273
|
+
return _this2.touchDownload(obj, url);
|
|
274
|
+
}, style: { float: 'right', lineHeight: '100%' } })
|
|
275
|
+
);
|
|
276
|
+
} else {
|
|
277
|
+
return _react2['default'].createElement(
|
|
278
|
+
'div',
|
|
279
|
+
null,
|
|
280
|
+
_react2['default'].createElement(
|
|
281
|
+
_tooltip2['default'],
|
|
282
|
+
{ placement: 'topLeft', title: name, style: { whiteSpace: 'pre-wrap', wordWrap: 'break-word' } },
|
|
283
|
+
_react2['default'].createElement(
|
|
284
|
+
'a',
|
|
285
|
+
{ href: url },
|
|
286
|
+
name
|
|
287
|
+
)
|
|
288
|
+
)
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
var viewPDFObj = _react2['default'].createElement(_Easy3wPDFView2['default'], {
|
|
294
|
+
fileId: this.state.fileId,
|
|
295
|
+
fileName: this.state.fileName,
|
|
296
|
+
fileURL: this.state.fileURL,
|
|
297
|
+
visible: this.state.pdfViewFlag,
|
|
298
|
+
hideModal: this.hidePDFModal
|
|
299
|
+
});
|
|
300
|
+
var viewFileObj = _react2['default'].createElement(_Easy3wFileView2['default'], {
|
|
301
|
+
fileId: this.state.fileId,
|
|
302
|
+
fileName: this.state.fileName,
|
|
303
|
+
fileURL: this.state.fileURL,
|
|
304
|
+
visible: this.state.fileViewFlag,
|
|
305
|
+
hideModal: this.hideFileModal,
|
|
306
|
+
viewFileUrl: this.state.viewFileUrl
|
|
307
|
+
});
|
|
308
|
+
var viewImgObj = _react2['default'].createElement(_Easy3wRCView2['default'], { imgUrl: this.state.imageViewURL, hideModal: this.hideImageView });
|
|
309
|
+
return _react2['default'].createElement(
|
|
310
|
+
'div',
|
|
311
|
+
null,
|
|
312
|
+
retObj,
|
|
313
|
+
viewPDFObj,
|
|
314
|
+
viewFileObj,
|
|
315
|
+
viewImgObj
|
|
316
|
+
);
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
return Easy3wDownLoad;
|
|
320
|
+
}(_react.Component);
|
|
321
|
+
|
|
322
|
+
Easy3wDownLoad.propTypes = {
|
|
323
|
+
urlDownloadFile: _propTypes2['default'].string
|
|
324
|
+
};
|
|
325
|
+
Easy3wDownLoad.defaultProps = {
|
|
326
|
+
urlDownloadFile: ''
|
|
327
|
+
};
|
|
328
|
+
exports['default'] = Easy3wDownLoad;
|
|
329
|
+
module.exports = exports['default'];
|