easy3wui 1.5.84 → 1.5.85-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,120 +1,120 @@
1
- @import '~antd/lib/style/themes/default.less';
2
-
3
- .tagSelect {
4
- user-select: none;
5
- margin-left: -8px;
6
- position: relative;
7
- overflow: hidden;
8
- max-height: 32px;
9
- // line-height: 32px;
10
- transition: all 0.3s;
11
- :global {
12
- .ant-tag {
13
- padding: 0 8px;
14
- margin-right: 24px;
15
- font-size: @font-size-base;
16
- }
17
- }
18
- &.expanded {
19
- transition: all 0.3s;
20
- max-height: 800px;
21
- }
22
- .trigger {
23
- position: absolute;
24
- top: 0;
25
- right: 0;
26
- i {
27
- font-size: 12px;
28
- }
29
- }
30
- &.hasExpandTag {
31
- padding-right: 50px;
32
- }
33
- }
34
-
35
- .standardFormRow {
36
- border-bottom: 1px dashed @border-color-split;
37
- // padding-bottom: 8px;
38
- // margin-bottom: 8px;
39
- display: flex;
40
- :global {
41
- .ant-form-item {
42
- margin-right: 24px;
43
- }
44
- .ant-form-item-label label {
45
- color: @text-color;
46
- margin-right: 0;
47
- }
48
- .ant-form-item-label,
49
- .ant-form-item-control {
50
- padding: 0;
51
- line-height: 32px;
52
- }
53
- }
54
- .label {
55
- // color: @heading-color;
56
- // color: rgb(173,124,89);
57
- font-size: @font-size-base;
58
- padding-right: 12px;
59
- margin-right: 12px;
60
- // margin-right: 24px;
61
- background:#F8F8FF;
62
- // background: rgb(84, 104, 178);
63
- // opacity: 0.5;
64
- flex: 0 0 auto;
65
- text-align: right;
66
- & > span {
67
- display: inline-block;
68
- height: 32px;
69
- line-height: 32px;
70
- &:after {
71
- content: '|';
72
- }
73
- }
74
- // border-radius: 2px;
75
- & > a {
76
- color: @heading-color;
77
- // color: rgb(255, 255, 255);
78
- display: inline-block;
79
- height: 32px;
80
- line-height: 32px;
81
- // width: 100%;
82
- cursor: pointer;
83
- }
84
- }
85
- .content {
86
- flex: 1 1 0;
87
- :global {
88
- .ant-form-item:last-child {
89
- margin-right: 0;
90
- }
91
- }
92
- }
93
- }
94
-
95
- .standardFormRowLast {
96
- border: none;
97
- padding-bottom: 0;
98
- margin-bottom: 0;
99
- }
100
-
101
- .standardFormRowBlock {
102
- :global {
103
- .ant-form-item,
104
- div.ant-form-item-control-wrapper {
105
- display: block;
106
- }
107
- }
108
- }
109
-
110
- .standardFormRowGrid {
111
- :global {
112
- .ant-form-item,
113
- div.ant-form-item-control-wrapper {
114
- display: block;
115
- }
116
- .ant-form-item-label {
117
- float: left;
118
- }
119
- }
120
- }
1
+ @import '~antd/lib/style/themes/default.less';
2
+
3
+ .tagSelect {
4
+ user-select: none;
5
+ margin-left: -8px;
6
+ position: relative;
7
+ overflow: hidden;
8
+ max-height: 32px;
9
+ // line-height: 32px;
10
+ transition: all 0.3s;
11
+ :global {
12
+ .ant-tag {
13
+ padding: 0 8px;
14
+ margin-right: 24px;
15
+ font-size: @font-size-base;
16
+ }
17
+ }
18
+ &.expanded {
19
+ transition: all 0.3s;
20
+ max-height: 800px;
21
+ }
22
+ .trigger {
23
+ position: absolute;
24
+ top: 0;
25
+ right: 0;
26
+ i {
27
+ font-size: 12px;
28
+ }
29
+ }
30
+ &.hasExpandTag {
31
+ padding-right: 50px;
32
+ }
33
+ }
34
+
35
+ .standardFormRow {
36
+ border-bottom: 1px dashed @border-color-split;
37
+ // padding-bottom: 8px;
38
+ // margin-bottom: 8px;
39
+ display: flex;
40
+ :global {
41
+ .ant-form-item {
42
+ margin-right: 24px;
43
+ }
44
+ .ant-form-item-label label {
45
+ color: @text-color;
46
+ margin-right: 0;
47
+ }
48
+ .ant-form-item-label,
49
+ .ant-form-item-control {
50
+ padding: 0;
51
+ line-height: 32px;
52
+ }
53
+ }
54
+ .label {
55
+ // color: @heading-color;
56
+ // color: rgb(173,124,89);
57
+ font-size: @font-size-base;
58
+ padding-right: 12px;
59
+ margin-right: 12px;
60
+ // margin-right: 24px;
61
+ background:#F8F8FF;
62
+ // background: rgb(84, 104, 178);
63
+ // opacity: 0.5;
64
+ flex: 0 0 auto;
65
+ text-align: right;
66
+ & > span {
67
+ display: inline-block;
68
+ height: 32px;
69
+ line-height: 32px;
70
+ &:after {
71
+ content: '|';
72
+ }
73
+ }
74
+ // border-radius: 2px;
75
+ & > a {
76
+ color: @heading-color;
77
+ // color: rgb(255, 255, 255);
78
+ display: inline-block;
79
+ height: 32px;
80
+ line-height: 32px;
81
+ // width: 100%;
82
+ cursor: pointer;
83
+ }
84
+ }
85
+ .content {
86
+ flex: 1 1 0;
87
+ :global {
88
+ .ant-form-item:last-child {
89
+ margin-right: 0;
90
+ }
91
+ }
92
+ }
93
+ }
94
+
95
+ .standardFormRowLast {
96
+ border: none;
97
+ padding-bottom: 0;
98
+ margin-bottom: 0;
99
+ }
100
+
101
+ .standardFormRowBlock {
102
+ :global {
103
+ .ant-form-item,
104
+ div.ant-form-item-control-wrapper {
105
+ display: block;
106
+ }
107
+ }
108
+ }
109
+
110
+ .standardFormRowGrid {
111
+ :global {
112
+ .ant-form-item,
113
+ div.ant-form-item-control-wrapper {
114
+ display: block;
115
+ }
116
+ .ant-form-item-label {
117
+ float: left;
118
+ }
119
+ }
120
+ }
@@ -38,26 +38,30 @@ var _tree2 = _interopRequireDefault(_tree);
38
38
 
39
39
  require('antd/lib/tree/style');
40
40
 
41
+ var _Easy3wSpin = require('../Easy3wSpin');
42
+
43
+ var _Easy3wSpin2 = _interopRequireDefault(_Easy3wSpin);
44
+
41
45
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
42
46
 
43
47
  var Search = _input2['default'].Search;
44
48
  var TreeNode = _tree2['default'].TreeNode;
45
49
 
46
- /**
47
- * props参数
48
- * arrData: 树数据源 必须 Array
49
- * objTreeProps: 树配置参数 非必须 Object
50
- * 另加属性:touchRenderNode, titleField = 'title', countField = 'count', keyField = 'key'
51
- * touchRenderNode: 自定义渲染节点 非必须 Function 返回值:{ title, count, key, isLeaf, expanded, selected, loading }
52
- * titleField: 节点标题字段 非必须 String 默认值:'title'
53
- * countField: 节点计数字段 非必须 String 默认值:'count'
54
- * keyField: 节点key字段 非必须 String 默认值:'key'
55
- * objSearchProps: 搜索配置参数 非必须 Object
56
- * 另加属性:searchFlag = true, onSearchCallback
57
- * searchFlag: 是否开启搜索功能 非必须 Boolean 默认值:true
58
- * onSearchCallback: 搜索回调函数 非必须 Function 返回值:(arrDataVisible, searchValue, expandedKeys)
59
- * bidPureComponent: 绑定组件方法 非必须 Function
60
- * intUpdateCount: 数据更新次数 必须 Number
50
+ /**
51
+ * props参数
52
+ * arrData: 树数据源 必须 Array
53
+ * objTreeProps: 树配置参数 非必须 Object
54
+ * 另加属性:touchRenderNode, titleField = 'title', countField = 'count', keyField = 'key'
55
+ * touchRenderNode: 自定义渲染节点 非必须 Function 返回值:{ title, count, key, isLeaf, expanded, selected, loading }
56
+ * titleField: 节点标题字段 非必须 String 默认值:'title'
57
+ * countField: 节点计数字段 非必须 String 默认值:'count'
58
+ * keyField: 节点key字段 非必须 String 默认值:'key'
59
+ * objSearchProps: 搜索配置参数 非必须 Object
60
+ * 另加属性:searchFlag = true, onSearchCallback
61
+ * searchFlag: 是否开启搜索功能 非必须 Boolean 默认值:true
62
+ * onSearchCallback: 搜索回调函数 非必须 Function 返回值:(arrDataVisible, searchValue, expandedKeys)
63
+ * bidPureComponent: 绑定组件方法 非必须 Function
64
+ * intUpdateCount: 数据更新次数 必须 Number
61
65
  */
62
66
 
63
67
  var Easy3wTree = function (_Component) {
@@ -117,12 +121,10 @@ var Easy3wTree = function (_Component) {
117
121
  arrDefaultExpandedKeys = _state.arrDefaultExpandedKeys,
118
122
  arrSearchExpandedKeys = _state.arrSearchExpandedKeys;
119
123
  var _props = this.props,
120
- _props$objTreeProps = _props.objTreeProps,
121
- objTreeProps = _props$objTreeProps === undefined ? {} : _props$objTreeProps,
122
- _props$objSearchProps = _props.objSearchProps,
123
- objSearchProps = _props$objSearchProps === undefined ? {} : _props$objSearchProps;
124
- var _objSearchProps$searc = objSearchProps.searchFlag,
125
- searchFlag = _objSearchProps$searc === undefined ? true : _objSearchProps$searc;
124
+ objTreeProps = _props.objTreeProps,
125
+ objSearchProps = _props.objSearchProps,
126
+ arrData = _props.arrData;
127
+ var searchFlag = objSearchProps.searchFlag;
126
128
 
127
129
  return _react2['default'].createElement(
128
130
  'div',
@@ -136,38 +138,57 @@ var Easy3wTree = function (_Component) {
136
138
  , ref: this.searchRef,
137
139
  className: (0, _classnames2['default'])('easy3wTreeSearch')
138
140
  }) : '',
139
- treevisible ? _react2['default'].createElement(
140
- _tree2['default'],
141
- (0, _extends3['default'])({
142
- defaultExpandedKeys: arrSearchExpandedKeys && arrSearchExpandedKeys.length > 0 ? arrSearchExpandedKeys : arrDefaultExpandedKeys // 树默认展开节点key Array
143
- , selectedKeys: selectedKeys // 选中节点key Array
144
- , showLine: true,
145
- showIcon: true
146
- // multiple 多选
147
- , onSelect: this.touchSelect
148
- }, objTreeProps),
149
- this.touchRenderTreeNodes(arrDataVisible)
150
- ) : ''
141
+ _react2['default'].createElement(
142
+ _Easy3wSpin2['default'],
143
+ {
144
+ spinLoading: !(arrData && arrData.length),
145
+ noStyle: true
146
+ },
147
+ treevisible ? _react2['default'].createElement(
148
+ _tree2['default'],
149
+ (0, _extends3['default'])({
150
+ defaultExpandedKeys: arrSearchExpandedKeys && arrSearchExpandedKeys.length > 0 ? arrSearchExpandedKeys : arrDefaultExpandedKeys // 树默认展开节点key Array
151
+ , selectedKeys: selectedKeys // 选中节点key Array
152
+ , showLine: true,
153
+ showIcon: true
154
+ // multiple 多选
155
+ , onSelect: this.touchSelect
156
+ }, objTreeProps),
157
+ this.touchRenderTreeNodes(arrDataVisible)
158
+ ) : ''
159
+ )
151
160
  );
152
161
  };
153
162
 
154
163
  return Easy3wTree;
155
164
  }(_react.Component);
156
165
 
166
+ Easy3wTree.defaultProps = {
167
+ objTreeProps: {
168
+ titleField: 'title',
169
+ countField: 'count',
170
+ keyField: 'key'
171
+ },
172
+ objSearchProps: {
173
+ searchFlag: true
174
+ }
175
+ };
176
+
157
177
  var _initialiseProps = function _initialiseProps() {
158
178
  var _this3 = this;
159
179
 
160
180
  this.componentDidUpdate = function (prevProps) {
181
+ var arrDefaultExpandedKeys = _this3.state.arrDefaultExpandedKeys;
161
182
  var _props2 = _this3.props,
162
183
  intUpdateCount = _props2.intUpdateCount,
163
184
  arrData = _props2.arrData;
164
185
 
165
186
  if (intUpdateCount !== prevProps.intUpdateCount) {
166
- var arrDefaultExpandedKeys = _this3.touchGetDEK(arrData);
187
+ var arrDEKeys = _this3.touchGetDEK(arrData);
167
188
  // eslint-disable-next-line react/no-did-update-set-state
168
189
  _this3.setState({
169
190
  arrDataVisible: arrData || [], // 树数据源-显示数据
170
- arrDefaultExpandedKeys: arrDefaultExpandedKeys, // 树默认展开节点
191
+ arrDefaultExpandedKeys: arrDefaultExpandedKeys && arrDefaultExpandedKeys.length ? arrDefaultExpandedKeys : arrDEKeys, // 树默认展开节点
171
192
  treevisible: false // 隐藏树
172
193
  }, function () {
173
194
  _this3.setState({
@@ -181,10 +202,8 @@ var _initialiseProps = function _initialiseProps() {
181
202
  var arrDefaultExpandedKeys = [];
182
203
  if (arrData && arrData.length > 0) {
183
204
  var item = arrData[0];
184
- var _props$objTreeProps2 = _this3.props.objTreeProps,
185
- objTreeProps = _props$objTreeProps2 === undefined ? {} : _props$objTreeProps2;
186
- var _objTreeProps$keyFiel = objTreeProps.keyField,
187
- keyField = _objTreeProps$keyFiel === undefined ? 'key' : _objTreeProps$keyFiel;
205
+ var objTreeProps = _this3.props.objTreeProps;
206
+ var keyField = objTreeProps.keyField;
188
207
 
189
208
  arrDefaultExpandedKeys = item[keyField] ? [item[keyField]] : [];
190
209
  }
@@ -241,12 +260,10 @@ var _initialiseProps = function _initialiseProps() {
241
260
  };
242
261
 
243
262
  this.touchFilterTreeData = function (arrAllData, searchValue, expandedKeys) {
244
- var _props$objTreeProps3 = _this3.props.objTreeProps,
245
- objTreeProps = _props$objTreeProps3 === undefined ? {} : _props$objTreeProps3;
246
- var _objTreeProps$titleFi = objTreeProps.titleField,
247
- titleField = _objTreeProps$titleFi === undefined ? 'title' : _objTreeProps$titleFi,
248
- _objTreeProps$keyFiel2 = objTreeProps.keyField,
249
- keyField = _objTreeProps$keyFiel2 === undefined ? 'key' : _objTreeProps$keyFiel2;
263
+ var _props$objTreeProps = _this3.props.objTreeProps,
264
+ objTreeProps = _props$objTreeProps === undefined ? {} : _props$objTreeProps;
265
+ var titleField = objTreeProps.titleField,
266
+ keyField = objTreeProps.keyField;
250
267
 
251
268
  var filteredData = arrAllData.map(function (item) {
252
269
  // 递归过滤子节点
@@ -266,8 +283,8 @@ var _initialiseProps = function _initialiseProps() {
266
283
  };
267
284
 
268
285
  this.touchSelect = function (selectedKeys, info) {
269
- var _props$objTreeProps4 = _this3.props.objTreeProps,
270
- objTreeProps = _props$objTreeProps4 === undefined ? {} : _props$objTreeProps4;
286
+ var _props$objTreeProps2 = _this3.props.objTreeProps,
287
+ objTreeProps = _props$objTreeProps2 === undefined ? {} : _props$objTreeProps2;
271
288
  var onSelectCallback = objTreeProps.onSelectCallback;
272
289
 
273
290
  if (onSelectCallback && typeof onSelectCallback === 'function') {
@@ -279,15 +296,12 @@ var _initialiseProps = function _initialiseProps() {
279
296
  };
280
297
 
281
298
  this.touchRenderTreeNodes = function (arrDataVisible) {
282
- var _props$objTreeProps5 = _this3.props.objTreeProps,
283
- objTreeProps = _props$objTreeProps5 === undefined ? {} : _props$objTreeProps5;
299
+ var _props$objTreeProps3 = _this3.props.objTreeProps,
300
+ objTreeProps = _props$objTreeProps3 === undefined ? {} : _props$objTreeProps3;
284
301
  var touchRenderNode = objTreeProps.touchRenderNode,
285
- _objTreeProps$titleFi2 = objTreeProps.titleField,
286
- titleField = _objTreeProps$titleFi2 === undefined ? 'title' : _objTreeProps$titleFi2,
287
- _objTreeProps$countFi = objTreeProps.countField,
288
- countField = _objTreeProps$countFi === undefined ? 'count' : _objTreeProps$countFi,
289
- _objTreeProps$keyFiel3 = objTreeProps.keyField,
290
- keyField = _objTreeProps$keyFiel3 === undefined ? 'key' : _objTreeProps$keyFiel3;
302
+ titleField = objTreeProps.titleField,
303
+ countField = objTreeProps.countField,
304
+ keyField = objTreeProps.keyField;
291
305
 
292
306
  return arrDataVisible.map(function (item) {
293
307
  var children = item.children;
@@ -420,7 +420,8 @@ var Easy3wUpload = function (_Component) {
420
420
  urlDownloadFile: urlDownloadFile,
421
421
  downloadArr: initialValue,
422
422
  propsAFlag: propsAFlag,
423
- fileViewFlag: fileViewFlag
423
+ fileViewFlag: fileViewFlag,
424
+ objPreviewFile: objPreviewFileNew
424
425
  })),
425
426
  extendBackShowFlag ? extendBack : ''
426
427
  ) : _react2['default'].createElement(
@@ -402,7 +402,8 @@ var BigFileUpload = function (_Component) {
402
402
  urlDownloadFile: urlDownloadFile,
403
403
  downloadArr: initialValue,
404
404
  propsAFlag: propsAFlag,
405
- fileViewFlag: fileViewFlag
405
+ fileViewFlag: fileViewFlag,
406
+ objPreviewFile: objPreviewFileNew
406
407
  }))
407
408
  ) : _react2['default'].createElement(
408
409
  _form2['default'].Item,
@@ -446,7 +446,8 @@ var Easy3wUploadM = function (_Component) {
446
446
  urlDownloadFile: urlDownloadFile,
447
447
  downloadArr: initialValue,
448
448
  propsAFlag: propsAFlag,
449
- fileViewFlag: fileViewFlag
449
+ fileViewFlag: fileViewFlag,
450
+ objPreviewFile: objPreviewFileNew
450
451
  })),
451
452
  extendBackShowFlag ? extendBack : ''
452
453
  ) : _react2['default'].createElement(
package/lib/index.js CHANGED
@@ -20,6 +20,15 @@ Object.defineProperty(exports, 'Easy3wSpin', {
20
20
  }
21
21
  });
22
22
 
23
+ var _Easy3wSkeleton = require('./Easy3wSkeleton');
24
+
25
+ Object.defineProperty(exports, 'Easy3wSkeleton', {
26
+ enumerable: true,
27
+ get: function get() {
28
+ return _interopRequireDefault(_Easy3wSkeleton)['default'];
29
+ }
30
+ });
31
+
23
32
  var _Easy3wA = require('./Easy3wA');
24
33
 
25
34
  Object.defineProperty(exports, 'Easy3wA', {