fmui-base 2.3.70 → 2.3.72
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 +2 -0
- package/lib/form/form.js +24 -3
- package/lib/form/table.js +18 -3
- package/lib/msg_list/msgList.js +26 -16
- package/lib/process_list/processList.js +26 -16
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/form/form.js
CHANGED
|
@@ -2109,6 +2109,7 @@ var PageHome = function (_React$Component) {
|
|
|
2109
2109
|
}
|
|
2110
2110
|
|
|
2111
2111
|
// 组装 CSS 声明;important=true 用于压过 SaltUI 固定字号
|
|
2112
|
+
// options.skipFontFamily:避免字段字体覆盖 iconfont 图标
|
|
2112
2113
|
|
|
2113
2114
|
}, {
|
|
2114
2115
|
key: 'buildFormCssDecls',
|
|
@@ -2119,7 +2120,7 @@ var PageHome = function (_React$Component) {
|
|
|
2119
2120
|
options = options || {};
|
|
2120
2121
|
var important = options.important ? ' !important' : '';
|
|
2121
2122
|
var parts = [];
|
|
2122
|
-
if (styleObj.fontFamily) {
|
|
2123
|
+
if (!options.skipFontFamily && styleObj.fontFamily) {
|
|
2123
2124
|
parts.push("font-family:'" + styleObj.fontFamily + "'" + important);
|
|
2124
2125
|
}
|
|
2125
2126
|
if (!options.skipColor && styleObj.color) {
|
|
@@ -2143,6 +2144,15 @@ var PageHome = function (_React$Component) {
|
|
|
2143
2144
|
return parts.join(';');
|
|
2144
2145
|
}
|
|
2145
2146
|
|
|
2147
|
+
// 字段样式注入后恢复图标字体,防止 font-family !important 导致 icon 乱码
|
|
2148
|
+
|
|
2149
|
+
}, {
|
|
2150
|
+
key: 'buildIconFontRestoreCss',
|
|
2151
|
+
value: function buildIconFontRestoreCss(scope) {
|
|
2152
|
+
var base = '{font-style:normal !important;font-weight:normal !important;}';
|
|
2153
|
+
return [[scope + ' .iconfont', scope + ' .iconfont:before', scope + ' .iconfont:after', scope + ' i.iconfont', scope + ' span.iconfont'].join(',') + '{font-family:"iconfont" !important;' + base.slice(1), [scope + ' .iconfont-ywtb', scope + ' .iconfont-ywtb:before', scope + ' .iconfont-ywtb:after'].join(',') + '{font-family:"iconfont-ywtb" !important;' + base.slice(1)].join('');
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2146
2156
|
// 字段名称+字段内容统一用 style 标签落地,避免各控件默认字号不一致、jQuery 被 React 冲掉
|
|
2147
2157
|
|
|
2148
2158
|
}, {
|
|
@@ -2177,15 +2187,26 @@ var PageHome = function (_React$Component) {
|
|
|
2177
2187
|
}
|
|
2178
2188
|
|
|
2179
2189
|
if (this.hasFormStyleProps(cs)) {
|
|
2190
|
+
// 普通文本内容:完整字体样式
|
|
2180
2191
|
var contentCss = this.buildFormCssDecls(cs, { important: true, withLineHeight: true });
|
|
2181
|
-
|
|
2192
|
+
// 含图标的选人/选页等:不写 font-family,避免盖住 iconfont
|
|
2193
|
+
var contentCssNoFont = this.buildFormCssDecls(cs, { important: true, withLineHeight: true, skipFontFamily: true });
|
|
2194
|
+
cssParts.push([scope + ' .t-text-field-input', scope + ' .t-text-field-content-main', scope + ' .t-text-field-content-main span:not(.iconfont)', scope + ' .t-field-content-box > .t-FB1', scope + ' .t-field-content-box > .t-FB1 span:not(.iconfont)', scope + ' .t-field-multi', scope + ' .t-field-multi span:not(.iconfont)', scope + ' .t-select-field-value', scope + ' .t-select-field-value span:not(.iconfont)', scope + ' .t-radio-field-value', scope + ' .t-radio-field-value span:not(.iconfont)', scope + ' .t-radio-field-value .t-FB1', scope + ' .t-radio-field-value .t-omit', scope + ' .t-datetime-field-value', scope + ' .t-datetime-field-value span:not(.iconfont)', scope + ' .t-textarea-field-content', scope + ' .t-textarea-field-content textarea', scope + ' .t-checkbox-field-content', scope + ' .t-checkbox-field-label', scope + ' .t-checkbox-field-value-list', scope + ' .t-checkbox-field-value-list span:not(.iconfont)', scope + ' .dd-select-input-option-text', scope + ' .t-popuser-placeholder', scope + ' .t-poppage-placeholder',
|
|
2182
2195
|
// 月日自定义、意见、html 等非 SaltUI 标准内容节点
|
|
2183
2196
|
scope + ' .t-FL', scope + ' .flex-comment .t-PT10', scope + ' .flex-comment .t-textarea-field-content',
|
|
2184
2197
|
// 批示意见落款与内容字体颜色一致
|
|
2185
|
-
scope + ' .comment-html', scope + ' .comment-html span', scope + ' .comment-content', scope + ' .ueditor-content', scope + ' .t-FB1.t-FAL', scope + ' .t-FB1.t-omit', scope + ' .t-omit', scope + ' .t-LH1_4', scope + ' .t-FS16', scope + ' .t-field-box.t-FS16', scope + ' .t-field-box.t-FS16 .t-FB1', scope + ' .section-content .t-FB1'].join(',') + '{' + contentCss + '}');
|
|
2198
|
+
scope + ' .comment-html', scope + ' .comment-html span:not(.iconfont)', scope + ' .comment-content', scope + ' .ueditor-content', scope + ' .t-FB1.t-FAL', scope + ' .t-FB1.t-omit', scope + ' .t-omit', scope + ' .t-LH1_4', scope + ' .t-FS16', scope + ' .t-field-box.t-FS16', scope + ' .t-field-box.t-FS16 .t-FB1', scope + ' .section-content .t-FB1'].join(',') + '{' + contentCss + '}');
|
|
2199
|
+
|
|
2200
|
+
// 选人/选页标签:只同步颜色字号,不改 font-family
|
|
2201
|
+
if (contentCssNoFont) {
|
|
2202
|
+
cssParts.push([scope + ' .t-popuser-value', scope + ' .t-popuser-value span:not(.iconfont)', scope + ' .t-poppage-value', scope + ' .t-poppage-value span:not(.iconfont)'].join(',') + '{' + contentCssNoFont + '}');
|
|
2203
|
+
}
|
|
2186
2204
|
|
|
2187
2205
|
var placeholderCss = this.buildFormCssDecls(cs, { important: true, skipColor: true, withLineHeight: true });
|
|
2188
2206
|
cssParts.push([scope + ' .t-text-field-placeholder', scope + ' .t-select-field-placeholder', scope + ' .t-datetime-field-placeholder', scope + ' .t-checkbox-field-placeholder'].join(',') + '{' + placeholderCss + '}');
|
|
2207
|
+
|
|
2208
|
+
// 兜底恢复图标字体
|
|
2209
|
+
cssParts.push(this.buildIconFontRestoreCss(scope));
|
|
2189
2210
|
}
|
|
2190
2211
|
|
|
2191
2212
|
var styleEl = document.getElementById(styleId);
|
package/lib/form/table.js
CHANGED
|
@@ -488,7 +488,7 @@ var PageHome = function (_React$Component) {
|
|
|
488
488
|
options = options || {};
|
|
489
489
|
var important = options.important ? ' !important' : '';
|
|
490
490
|
var parts = [];
|
|
491
|
-
if (styleObj.fontFamily) {
|
|
491
|
+
if (!options.skipFontFamily && styleObj.fontFamily) {
|
|
492
492
|
parts.push("font-family:'" + styleObj.fontFamily + "'" + important);
|
|
493
493
|
}
|
|
494
494
|
if (!options.skipColor && styleObj.color) {
|
|
@@ -512,6 +512,15 @@ var PageHome = function (_React$Component) {
|
|
|
512
512
|
return parts.join(';');
|
|
513
513
|
}
|
|
514
514
|
|
|
515
|
+
// 字段样式注入后恢复图标字体,防止 font-family !important 导致 icon 乱码
|
|
516
|
+
|
|
517
|
+
}, {
|
|
518
|
+
key: 'buildIconFontRestoreCss',
|
|
519
|
+
value: function buildIconFontRestoreCss(scope) {
|
|
520
|
+
var base = '{font-style:normal !important;font-weight:normal !important;}';
|
|
521
|
+
return [[scope + ' .iconfont', scope + ' .iconfont:before', scope + ' .iconfont:after', scope + ' i.iconfont', scope + ' span.iconfont'].join(',') + '{font-family:"iconfont" !important;' + base.slice(1), [scope + ' .iconfont-ywtb', scope + ' .iconfont-ywtb:before', scope + ' .iconfont-ywtb:after'].join(',') + '{font-family:"iconfont-ywtb" !important;' + base.slice(1)].join('');
|
|
522
|
+
}
|
|
523
|
+
|
|
515
524
|
// 表单级统一样式:覆盖主表/子表/编辑/只读,避免依赖 fieldId class(UUID 数字开头选择器会失效)
|
|
516
525
|
|
|
517
526
|
}, {
|
|
@@ -542,13 +551,19 @@ var PageHome = function (_React$Component) {
|
|
|
542
551
|
}
|
|
543
552
|
if (this.hasFormStyleProps(cs)) {
|
|
544
553
|
var contentCss = this.buildFormCssDecls(cs, { important: true, withLineHeight: true });
|
|
545
|
-
|
|
554
|
+
var contentCssNoFont = this.buildFormCssDecls(cs, { important: true, withLineHeight: true, skipFontFamily: true });
|
|
555
|
+
cssParts.push([scope + ' .t-text-field-input', scope + ' .t-text-field-content-main', scope + ' .t-text-field-content-main span:not(.iconfont)', scope + ' .t-field-content-box > .t-FB1', scope + ' .t-field-content-box > .t-FB1 span:not(.iconfont)', scope + ' .t-field-multi', scope + ' .t-field-multi span:not(.iconfont)', scope + ' .t-select-field-value', scope + ' .t-select-field-value span:not(.iconfont)', scope + ' .t-radio-field-value', scope + ' .t-radio-field-value span:not(.iconfont)', scope + ' .t-radio-field-value .t-FB1', scope + ' .t-radio-field-value .t-omit', scope + ' .t-datetime-field-value', scope + ' .t-datetime-field-value span:not(.iconfont)', scope + ' .t-textarea-field-content', scope + ' .t-textarea-field-content textarea', scope + ' .t-checkbox-field-content', scope + ' .t-checkbox-field-label', scope + ' .t-checkbox-field-value-list', scope + ' .t-checkbox-field-value-list span:not(.iconfont)', scope + ' .dd-select-input-option-text', scope + ' .t-popuser-placeholder', scope + ' .t-poppage-placeholder', scope + ' .t-FL', scope + ' .flex-comment .t-textarea-field-content', scope + ' .flex-comment .t-PT10',
|
|
546
556
|
// 批示意见落款与内容字体颜色一致
|
|
547
|
-
scope + ' .comment-html', scope + ' .comment-html span', scope + ' .comment-content', scope + ' .ueditor-content',
|
|
557
|
+
scope + ' .comment-html', scope + ' .comment-html span:not(.iconfont)', scope + ' .comment-content', scope + ' .ueditor-content',
|
|
548
558
|
// 弹出选择/只读展示:常带 t-FS16 等工具类,需一并覆盖
|
|
549
559
|
scope + ' .t-FB1.t-FAL', scope + ' .t-FB1.t-omit', scope + ' .t-omit', scope + ' .t-LH1_4', scope + ' .t-FS16', scope + ' .t-field-box.t-FS16', scope + ' .t-field-box.t-FS16 .t-FB1', scope + ' .section-content .t-FB1'].join(',') + '{' + contentCss + '}');
|
|
560
|
+
// 选人/选页标签:只同步颜色字号,不改 font-family
|
|
561
|
+
if (contentCssNoFont) {
|
|
562
|
+
cssParts.push([scope + ' .t-popuser-value', scope + ' .t-popuser-value span:not(.iconfont)', scope + ' .t-poppage-value', scope + ' .t-poppage-value span:not(.iconfont)'].join(',') + '{' + contentCssNoFont + '}');
|
|
563
|
+
}
|
|
550
564
|
var placeholderCss = this.buildFormCssDecls(cs, { important: true, skipColor: true, withLineHeight: true });
|
|
551
565
|
cssParts.push([scope + ' .t-text-field-placeholder', scope + ' .t-select-field-placeholder', scope + ' .t-datetime-field-placeholder', scope + ' .t-checkbox-field-placeholder'].join(',') + '{' + placeholderCss + '}');
|
|
566
|
+
cssParts.push(this.buildIconFontRestoreCss(scope));
|
|
552
567
|
}
|
|
553
568
|
if (!styleEl) {
|
|
554
569
|
styleEl = document.createElement('style');
|
package/lib/msg_list/msgList.js
CHANGED
|
@@ -184,7 +184,25 @@ var ListItem = function (_React$Component) {
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
/**
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
//
|
|
245
|
+
// 统一:文字/边框用色,背景同色透明;无 fieldColor 时用 60/70/80/90 默认色
|
|
228
246
|
if (data.urgencyName) {
|
|
229
|
-
|
|
247
|
+
var urgencyColor = data.fieldColor || this.getDefaultUrgencyColor(data.urgency);
|
|
248
|
+
if (urgencyColor) {
|
|
230
249
|
urgencyTag = true;
|
|
231
250
|
tagClass = 'label';
|
|
232
|
-
urgencyStyle = this.buildUrgencyLabelStyle(
|
|
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
|
-
/**
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
//
|
|
446
|
+
// 统一:文字/边框用色,背景同色透明;无 fieldColor 时用 60/70/80/90 默认色(不再用无边框的 label-* 类)
|
|
429
447
|
if (data.urgencyName) {
|
|
430
|
-
|
|
448
|
+
var urgencyColor = data.fieldColor || this.getDefaultUrgencyColor(data.urgency);
|
|
449
|
+
if (urgencyColor) {
|
|
431
450
|
urgencyTag = true;
|
|
432
451
|
tagClass = 'label';
|
|
433
|
-
urgencyStyle = this.buildUrgencyLabelStyle(
|
|
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) {
|