fmui-base 2.3.22 → 2.3.24

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.
@@ -722,7 +722,7 @@ var PageHome = function (_React$Component2) {
722
722
  category: category
723
723
  };
724
724
  _this3.getTransactionTitleCount(module, "undo,unread", category);
725
- _this3.getCategoryListByModule(module, category);
725
+ _this3.getCategoryListByModule(module, category, activeIndex);
726
726
  /**
727
727
  * 办理页面搜索框设置项
728
728
  * @type {{locale: string, instantSearch: boolean, hasHistory: boolean, searchDelay: number, onEnter: (()), onExit: (()), onChange: ((p1:*)), onSearch: ((p1?:*))}}
@@ -802,6 +802,8 @@ var PageHome = function (_React$Component2) {
802
802
 
803
803
  // 点击tab页签,关闭遮罩
804
804
  $('.title-wrapper.active').click();
805
+ // 切换 Tab 时按当前列表重新拉取「有数据」的分类
806
+ this.getCategoryListByModule(this.state.module, this.state.category, active);
805
807
  }
806
808
 
807
809
  /**
@@ -827,21 +829,33 @@ var PageHome = function (_React$Component2) {
827
829
  }
828
830
 
829
831
  /**
830
- * 获取分类
832
+ * 获取分类(仅当前列表有数据的分类)
833
+ * @param listType 0待办/1待阅/2已办/3已阅/4我的,默认当前 Tab
831
834
  */
832
835
 
833
836
  }, {
834
837
  key: 'getCategoryListByModule',
835
- value: function getCategoryListByModule(module, category) {
838
+ value: function getCategoryListByModule(module, category, listType) {
836
839
  var _this5 = this;
837
840
 
838
841
  var t = this;
842
+ var type = listType;
843
+ if (type === undefined || type === null || type === '') {
844
+ type = this.state.activeTabIndex;
845
+ }
839
846
  _db2.default.FlowApproval.getCategoryListByModule({
840
847
  module: module,
841
- code: category
848
+ code: category,
849
+ listType: type
842
850
  }).then(function (content) {
843
851
  if (content) {
844
- _this5.state.categoryList = content;
852
+ _this5.setState({
853
+ categoryList: content
854
+ });
855
+ } else {
856
+ _this5.setState({
857
+ categoryList: []
858
+ });
845
859
  }
846
860
  }).catch(function (error) {
847
861
  console.log(error);
@@ -33,6 +33,8 @@ require('whatwg-fetch');
33
33
 
34
34
  require('es6-promise');
35
35
 
36
+ require('./upload.less');
37
+
36
38
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
37
39
 
38
40
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -262,19 +264,28 @@ var PageHome = function (_React$Component) {
262
264
  key: 'componentDidMount',
263
265
  value: function componentDidMount() {
264
266
  var t = this;
265
- var param = {
266
- name: 'file',
267
- url: this.state.uploadUrl,
268
- autoPending: true,
269
- accept: t.state.accept,
270
- multiple: true,
271
- fileSizeLimit: t.state.fileSizeLimit
272
- };
273
- var limitNo = t.state.limitNo;
274
- //param.queueCapcity= limitNo;
275
- var up = this.getCore(param);
276
- var picker = up.getPickerCollector();
277
- picker.addArea(document.getElementById('ddUploadPic' + t.state.keyNum));
267
+ try {
268
+ var param = {
269
+ name: 'file',
270
+ url: this.state.uploadUrl,
271
+ autoPending: true,
272
+ accept: t.state.accept,
273
+ multiple: true,
274
+ fileSizeLimit: t.state.fileSizeLimit
275
+ };
276
+ var up = this.getCore(param);
277
+ var picker = up.getPickerCollector();
278
+ var areaEl = document.getElementById('ddUploadPic' + t.state.keyNum);
279
+ if (areaEl) {
280
+ picker.addArea(areaEl);
281
+ }
282
+ } catch (e) {
283
+ console.log('upload picker init error:', e);
284
+ }
285
+ // 父级 ref 回调偶发未触发时,自行按 initIds 拉附件列表
286
+ if (this.props.initIds) {
287
+ this.initData();
288
+ }
278
289
  }
279
290
  }, {
280
291
  key: 'getCore',
@@ -613,21 +624,29 @@ var PageHome = function (_React$Component) {
613
624
  // t.props.onChange(initList);
614
625
  if (res.ok) {
615
626
  res.json().then(function (obj) {
616
- var objList = obj.data;
627
+ // 接口常 HTTP 200 + body failure;data 非数组时不能 concat,否则渲染崩溃导致附件区空白
628
+ var objList = obj && obj.data ? obj.data : [];
629
+ if (!(objList instanceof Array)) {
630
+ objList = [];
631
+ }
632
+ if (obj && obj.type === 'failure') {
633
+ console.log('getAttachmentByIds failure:', obj.message || obj.code);
634
+ return;
635
+ }
617
636
  initList = initList.concat(objList);
618
637
  if (t.props.onChange) {
619
- t.props.onChange(initList);
638
+ // 初始化回填:传 '1',避免触发表单向上 onChange 导致重挂载丢列表
639
+ t.props.onChange(initList, '1');
620
640
  }
621
641
  t.setState({
622
642
  initList: initList
623
643
  });
624
- // Get the JSON
625
644
  });
626
645
  } else if (res.status == 401) {
627
- // To do with res
646
+ console.log('getAttachmentByIds 401');
628
647
  }
629
648
  }, function (e) {
630
- // Handling errors
649
+ console.log('getAttachmentByIds network error', e);
631
650
  }).catch(function (error) {
632
651
  console.log("错误:" + error);
633
652
  });
@@ -731,7 +750,7 @@ var PageHome = function (_React$Component) {
731
750
  _react2.default.createElement('i', { className: _this3.getIcon(item.fileExt) }),
732
751
  _react2.default.createElement(
733
752
  'div',
734
- { className: 't-list-title t-omit t-LH1_4' },
753
+ { className: 't-list-title upload-file-name t-LH1_4' },
735
754
  typeof item.fileDisplayName == 'undefined' ? item.name : item.fileDisplayName
736
755
  )
737
756
  ),
@@ -751,7 +770,7 @@ var PageHome = function (_React$Component) {
751
770
  _react2.default.createElement('i', { className: _this3.getIcon(item.fileExt) }),
752
771
  _react2.default.createElement(
753
772
  'div',
754
- { className: 't-list-title t-omit t-LH1_4' },
773
+ { className: 't-list-title upload-file-name t-LH1_4' },
755
774
  typeof item.fileDisplayName == 'undefined' ? item.name : item.fileDisplayName
756
775
  )
757
776
  ),
@@ -0,0 +1,345 @@
1
+ /* 上传组件基础样式(勿整文件覆盖,否则附件区会空白) */
2
+ .upload {
3
+ width: 100%;
4
+ text-align: left;
5
+ box-sizing: border-box;
6
+ }
7
+
8
+ .upload .t-field-box {
9
+ padding-right: 10px;
10
+ }
11
+
12
+ .upload-list {
13
+ margin: 5px 0;
14
+ }
15
+
16
+ .upload-list-item {
17
+ display: flex;
18
+ align-items: center;
19
+ width: 100%;
20
+ padding: 5px 10px 5px 10px;
21
+ border-radius: 5px;
22
+ background: #f5f5f5;
23
+ }
24
+
25
+ .upload-list-item-content {
26
+ max-width: 85%;
27
+ display: flex;
28
+ flex-direction: column;
29
+ justify-content: center;
30
+ align-items: flex-start;
31
+ }
32
+
33
+ .upload-name-icon {
34
+ width: 100%;
35
+ display: flex;
36
+ align-items: center;
37
+ }
38
+
39
+ .upload-icon {
40
+ margin-left: auto;
41
+ }
42
+
43
+ .upload-list-item .icon-delete {
44
+ margin-left: auto;
45
+ font-size: 16px;
46
+ color: #fa5151;
47
+ }
48
+
49
+ .upload-list-item .t-list-title {
50
+ font-size: 14px;
51
+ color: #000000;
52
+ }
53
+
54
+ .upload-list-item .iconfont-fontsize {
55
+ margin-right: 5px;
56
+ font-size: 12px;
57
+ }
58
+
59
+ .upload-list-item .icon-PDF {
60
+ color: #ee3434;
61
+ }
62
+
63
+ .upload-list-item .icon-DPS {
64
+ color: #ff6a10;
65
+ }
66
+
67
+ .upload-list-item .icon-XLS {
68
+ color: #4ec10f;
69
+ }
70
+
71
+ .upload-list-item .icon-DOC {
72
+ color: #4799e7;
73
+ }
74
+
75
+ .upload-list-item .icon-ET {
76
+ color: #4ec10f;
77
+ }
78
+
79
+ .upload-list-item .icon-OFD {
80
+ color: #ee3434;
81
+ }
82
+
83
+ .upload-list-item .icon-WPS {
84
+ color: #ff6a10;
85
+ }
86
+
87
+ .upload-list-item .icon-ZIP {
88
+ color: #337ab7;
89
+ }
90
+
91
+ .upload-list-item .icon-TXT {
92
+ color: #4799e7;
93
+ }
94
+
95
+ .upload-list-item .icon-TIF {
96
+ color: #ff9900;
97
+ }
98
+
99
+ .upload-list-item .icon-SWF {
100
+ color: #a94442;
101
+ }
102
+
103
+ .upload-list-item .icon-RAR {
104
+ color: #337ab7;
105
+ }
106
+
107
+ .upload-list-item .icon-PPT {
108
+ color: #ff6a10;
109
+ }
110
+
111
+ .upload-list-item .icon-MP3 {
112
+ color: #a06feb;
113
+ }
114
+
115
+ .upload-list-item .icon-MP4 {
116
+ color: #a06feb;
117
+ }
118
+
119
+ .upload-list-item .icon-MOV {
120
+ color: #0fb8c3;
121
+ }
122
+
123
+ .upload-list-item .icon-GIF {
124
+ color: #ff9900;
125
+ }
126
+
127
+ .upload-list-item .icon-FLV {
128
+ color: #0fb8c3;
129
+ }
130
+
131
+ .upload-list-item .icon-EXE {
132
+ color: #31708f;
133
+ }
134
+
135
+ .upload-list-item .icon-AVI {
136
+ color: #0fb8c3;
137
+ }
138
+
139
+ .upload-list-item .icon-7Z {
140
+ color: #337ab7;
141
+ }
142
+
143
+ .upload-list-item .icon-download1 {
144
+ margin-right: 5px;
145
+ font-size: 16px;
146
+ }
147
+
148
+ .upload-list-item .dd-t-list-time {
149
+ font-size: 10px;
150
+ line-height: 12px;
151
+ }
152
+
153
+ .upload-file {
154
+ display: flex;
155
+ justify-content: center;
156
+ align-items: center;
157
+ position: relative;
158
+ width: 100%;
159
+ height: 40px;
160
+ font-size: 20px;
161
+ background: #ffffff;
162
+ color: rgba(0, 0, 0, 0.3);
163
+ border-radius: 10px;
164
+ border: 1px dashed rgba(0, 0, 0, 0.3);
165
+ }
166
+
167
+ .upload-image {
168
+ position: relative;
169
+ display: flex;
170
+ justify-content: center;
171
+ align-items: center;
172
+ width: 100px;
173
+ height: 99px;
174
+ background: #ffffff;
175
+ font-size: 20px;
176
+ color: rgba(0, 0, 0, 0.3);
177
+ border-radius: 10px;
178
+ border: 1px dashed rgba(0, 0, 0, 0.3);
179
+ }
180
+
181
+ .upload-image .icon-plus {
182
+ color: rgba(0, 0, 0, 0.3);
183
+ }
184
+
185
+ .upload-file-p {
186
+ display: flex;
187
+ justify-content: center;
188
+ align-items: center;
189
+ position: relative;
190
+ width: 100%;
191
+ padding: 4px;
192
+ margin-bottom: 5px;
193
+ font-size: 20px;
194
+ background: #ffffff;
195
+ color: rgba(0, 0, 0, 0.3);
196
+ border-radius: 10px;
197
+ border: 1px dashed rgba(0, 0, 0, 0.3);
198
+ }
199
+
200
+ .upload-image-p {
201
+ display: flex;
202
+ justify-content: center;
203
+ align-items: center;
204
+ width: 100px;
205
+ height: 99px;
206
+ margin-right: 10px;
207
+ padding: 0 4px;
208
+ background: #ffffff;
209
+ font-size: 20px;
210
+ color: rgba(0, 0, 0, 0.3);
211
+ border-radius: 10px;
212
+ border: 1px dashed rgba(0, 0, 0, 0.3);
213
+ }
214
+
215
+ .upload-image-item {
216
+ width: 100px;
217
+ height: 98px;
218
+ position: relative;
219
+ margin: 0 10px 25px 0px;
220
+ border-radius: 10px;
221
+ background: rgba(0, 0, 0, 0.2);
222
+ }
223
+
224
+ .upload-progress {
225
+ margin-bottom: 15px;
226
+ }
227
+
228
+ .upload-progress-tip {
229
+ width: 100%;
230
+ display: block;
231
+ text-align: center;
232
+ font-size: 12px;
233
+ }
234
+
235
+ .upload-progress .progress-bar.green-bar .bar-core {
236
+ box-shadow: 0 0;
237
+ }
238
+
239
+ .upload-image-item img {
240
+ border-radius: 10px;
241
+ }
242
+
243
+ .upload-image-content {
244
+ position: relative;
245
+ }
246
+
247
+ .dd-upload-file {
248
+ flex-wrap: wrap;
249
+ }
250
+
251
+ .upload-image-item .iconfont {
252
+ position: absolute;
253
+ right: -10px;
254
+ top: -10px;
255
+ background: #fa5151;
256
+ font-size: 14px;
257
+ width: 21px;
258
+ height: 21px;
259
+ line-height: 21px;
260
+ text-align: center;
261
+ border-radius: 50%;
262
+ color: #fff;
263
+ z-index: 10;
264
+ }
265
+
266
+ .upload-image-test-hidden {
267
+ display: none;
268
+ }
269
+
270
+ .upload-image-test {
271
+ display: flex;
272
+ align-items: center;
273
+ justify-content: space-between;
274
+ width: 100%;
275
+ padding-right: 27px;
276
+ margin-top: 18px;
277
+ margin-bottom: 21px;
278
+ }
279
+
280
+ .upload-image-test-left {
281
+ font-family: PingFangSC-Regular;
282
+ font-size: 16px;
283
+ color: rgba(0, 0, 0, 0.85);
284
+ }
285
+
286
+ .upload-image-test-right {
287
+ font-size: 12px;
288
+ color: rgba(0, 0, 0, 0.3);
289
+ font-family: SourceHanSansSC-Regular;
290
+ }
291
+
292
+ .dd-uploaded-delete {
293
+ background: #ff213b;
294
+ font-size: 14px;
295
+ width: 21px;
296
+ height: 21px;
297
+ line-height: 21px;
298
+ text-align: center;
299
+ border-radius: 50%;
300
+ color: #fff;
301
+ margin: 14px 0 0 16px;
302
+ }
303
+
304
+ /* 流程表单附件:名称完整显示,过长换行(不截断省略) */
305
+ .upload-list {
306
+ .upload-list-item {
307
+ align-items: flex-start;
308
+ }
309
+
310
+ .upload-content,
311
+ .upload-list-item,
312
+ .upload-list-item-content,
313
+ .upload-name-icon {
314
+ min-width: 0;
315
+ }
316
+
317
+ .upload-list-item-content {
318
+ flex: 1;
319
+ max-width: none;
320
+ }
321
+
322
+ .upload-name-icon {
323
+ align-items: flex-start;
324
+ }
325
+
326
+ .upload-name-icon > i {
327
+ flex-shrink: 0;
328
+ }
329
+
330
+ .upload-file-name,
331
+ .t-list-title.upload-file-name {
332
+ flex: 1;
333
+ min-width: 0;
334
+ white-space: normal !important;
335
+ word-break: break-all !important;
336
+ overflow-wrap: break-word !important;
337
+ word-wrap: break-word !important;
338
+ overflow: visible !important;
339
+ text-overflow: clip !important;
340
+ -webkit-line-clamp: unset !important;
341
+ line-clamp: unset !important;
342
+ max-width: 100%;
343
+ line-height: 1.4;
344
+ }
345
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.3.22",
3
+ "version": "2.3.24",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",