fmui-base 2.3.70 → 2.3.71

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/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  ---npm publish
4
4
 
5
5
  ## 更新日志
6
+ - 2.3.71:移动端办理列表缓急标签样式
6
7
  - 2.3.70:移动端支持表单的规则设置校验
7
8
  - 2.3.69:移动端批示意见字段落款支持表单上的自定义样式
8
9
  - 2.3.68:批示意见字段支持根据节点设置控制显示隐藏
@@ -184,7 +184,25 @@ var ListItem = function (_React$Component) {
184
184
  }
185
185
  }
186
186
 
187
- /** 办理缓急:文字/边框用配置色,背景同色透明度 0.1 */
187
+ /** 历史枚举未配 fieldColor 时的默认色(对齐原 label-primary/warn/danger) */
188
+
189
+ }, {
190
+ key: 'getDefaultUrgencyColor',
191
+ value: function getDefaultUrgencyColor(urgencyCode) {
192
+ var code = urgencyCode != null ? String(urgencyCode) : '';
193
+ if (code === '60') {
194
+ return '#5688ed';
195
+ }
196
+ if (code === '70') {
197
+ return '#ff802c';
198
+ }
199
+ if (code === '80' || code === '90') {
200
+ return '#ff3a39';
201
+ }
202
+ return '';
203
+ }
204
+
205
+ /** 办理缓急:文字/边框用配置色,背景同色透明度 0.12 */
188
206
 
189
207
  }, {
190
208
  key: 'buildUrgencyLabelStyle',
@@ -197,14 +215,14 @@ var ListItem = function (_React$Component) {
197
215
  var m;
198
216
  if (/^#([0-9a-fA-F]{3})$/.test(color)) {
199
217
  m = color.substring(1);
200
- bg = 'rgba(' + parseInt(m.charAt(0) + m.charAt(0), 16) + ',' + parseInt(m.charAt(1) + m.charAt(1), 16) + ',' + parseInt(m.charAt(2) + m.charAt(2), 16) + ',0.1)';
218
+ bg = 'rgba(' + parseInt(m.charAt(0) + m.charAt(0), 16) + ',' + parseInt(m.charAt(1) + m.charAt(1), 16) + ',' + parseInt(m.charAt(2) + m.charAt(2), 16) + ',0.12)';
201
219
  } else if (/^#([0-9a-fA-F]{6})$/.test(color)) {
202
220
  m = color.substring(1);
203
- bg = 'rgba(' + parseInt(m.substring(0, 2), 16) + ',' + parseInt(m.substring(2, 4), 16) + ',' + parseInt(m.substring(4, 6), 16) + ',0.1)';
221
+ bg = 'rgba(' + parseInt(m.substring(0, 2), 16) + ',' + parseInt(m.substring(2, 4), 16) + ',' + parseInt(m.substring(4, 6), 16) + ',0.12)';
204
222
  } else {
205
223
  m = color.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
206
224
  if (m) {
207
- bg = 'rgba(' + m[1] + ',' + m[2] + ',' + m[3] + ',0.1)';
225
+ bg = 'rgba(' + m[1] + ',' + m[2] + ',' + m[3] + ',0.12)';
208
226
  }
209
227
  }
210
228
  if (!bg) {
@@ -224,21 +242,13 @@ var ListItem = function (_React$Component) {
224
242
  //待办
225
243
  checkIsNotComplete = true;
226
244
  // 枚举禁用时后端不回填 urgencyName,此时不渲染角标(避免空 label 色块)
227
- // 有 fieldColor:文字/边框用配置色,背景同色透明;无配置时回退 60/70/80/90 样式
245
+ // 统一:文字/边框用色,背景同色透明;无 fieldColor 时用 60/70/80/90 默认色
228
246
  if (data.urgencyName) {
229
- if (data.fieldColor) {
247
+ var urgencyColor = data.fieldColor || this.getDefaultUrgencyColor(data.urgency);
248
+ if (urgencyColor) {
230
249
  urgencyTag = true;
231
250
  tagClass = 'label';
232
- urgencyStyle = this.buildUrgencyLabelStyle(data.fieldColor);
233
- } else if (data.urgency == '90' || data.urgency == '80') {
234
- urgencyTag = true;
235
- tagClass = 'label label-danger';
236
- } else if (data.urgency == '70') {
237
- urgencyTag = true;
238
- tagClass = 'label label-warn';
239
- } else if (data.urgency == '60') {
240
- urgencyTag = true;
241
- tagClass = 'label label-primary';
251
+ urgencyStyle = this.buildUrgencyLabelStyle(urgencyColor);
242
252
  }
243
253
  }
244
254
  } else if (data.type == 1) {
@@ -379,7 +379,25 @@ var ListItem = function (_React$Component) {
379
379
  }
380
380
  }
381
381
 
382
- /** 办理缓急:文字/边框用配置色,背景同色透明度 0.1 */
382
+ /** 历史枚举未配 fieldColor 时的默认色(对齐原 label-primary/warn/danger) */
383
+
384
+ }, {
385
+ key: 'getDefaultUrgencyColor',
386
+ value: function getDefaultUrgencyColor(urgencyCode) {
387
+ var code = urgencyCode != null ? String(urgencyCode) : '';
388
+ if (code === '60') {
389
+ return '#5688ed';
390
+ }
391
+ if (code === '70') {
392
+ return '#ff802c';
393
+ }
394
+ if (code === '80' || code === '90') {
395
+ return '#ff3a39';
396
+ }
397
+ return '';
398
+ }
399
+
400
+ /** 办理缓急:文字/边框用配置色,背景同色透明度 0.12 */
383
401
 
384
402
  }, {
385
403
  key: 'buildUrgencyLabelStyle',
@@ -392,14 +410,14 @@ var ListItem = function (_React$Component) {
392
410
  var m;
393
411
  if (/^#([0-9a-fA-F]{3})$/.test(color)) {
394
412
  m = color.substring(1);
395
- bg = 'rgba(' + parseInt(m.charAt(0) + m.charAt(0), 16) + ',' + parseInt(m.charAt(1) + m.charAt(1), 16) + ',' + parseInt(m.charAt(2) + m.charAt(2), 16) + ',0.1)';
413
+ bg = 'rgba(' + parseInt(m.charAt(0) + m.charAt(0), 16) + ',' + parseInt(m.charAt(1) + m.charAt(1), 16) + ',' + parseInt(m.charAt(2) + m.charAt(2), 16) + ',0.12)';
396
414
  } else if (/^#([0-9a-fA-F]{6})$/.test(color)) {
397
415
  m = color.substring(1);
398
- bg = 'rgba(' + parseInt(m.substring(0, 2), 16) + ',' + parseInt(m.substring(2, 4), 16) + ',' + parseInt(m.substring(4, 6), 16) + ',0.1)';
416
+ bg = 'rgba(' + parseInt(m.substring(0, 2), 16) + ',' + parseInt(m.substring(2, 4), 16) + ',' + parseInt(m.substring(4, 6), 16) + ',0.12)';
399
417
  } else {
400
418
  m = color.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
401
419
  if (m) {
402
- bg = 'rgba(' + m[1] + ',' + m[2] + ',' + m[3] + ',0.1)';
420
+ bg = 'rgba(' + m[1] + ',' + m[2] + ',' + m[3] + ',0.12)';
403
421
  }
404
422
  }
405
423
  if (!bg) {
@@ -425,21 +443,13 @@ var ListItem = function (_React$Component) {
425
443
  checkIsNotComplete = true;
426
444
  }
427
445
  // 枚举禁用时后端不回填 urgencyName,此时不渲染角标(避免空 label 色块)
428
- // 有 fieldColor:文字/边框用配置色,背景同色透明;无配置时回退 60/70/80/90 样式
446
+ // 统一:文字/边框用色,背景同色透明;无 fieldColor 时用 60/70/80/90 默认色(不再用无边框的 label-* 类)
429
447
  if (data.urgencyName) {
430
- if (data.fieldColor) {
448
+ var urgencyColor = data.fieldColor || this.getDefaultUrgencyColor(data.urgency);
449
+ if (urgencyColor) {
431
450
  urgencyTag = true;
432
451
  tagClass = 'label';
433
- urgencyStyle = this.buildUrgencyLabelStyle(data.fieldColor);
434
- } else if (data.urgency == '90' || data.urgency == '80') {
435
- urgencyTag = true;
436
- tagClass = 'label label-danger';
437
- } else if (data.urgency == '70') {
438
- urgencyTag = true;
439
- tagClass = 'label label-warn';
440
- } else if (data.urgency == '60') {
441
- urgencyTag = true;
442
- tagClass = 'label label-primary';
452
+ urgencyStyle = this.buildUrgencyLabelStyle(urgencyColor);
443
453
  }
444
454
  }
445
455
  } else if (data.listTabType == 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.3.70",
3
+ "version": "2.3.71",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",