easy3wui 1.5.47-beta3 → 1.5.47-beta4
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/lib/Easy3wFormPage/index.js +43 -5
- package/package.json +1 -1
|
@@ -332,7 +332,9 @@ var Easy3wFormPage = function (_Component) {
|
|
|
332
332
|
var fieldType = item.fieldType,
|
|
333
333
|
cmptPros = item.cmptPros,
|
|
334
334
|
disableFlag = item.disableFlag,
|
|
335
|
-
readFlag = item.readFlag
|
|
335
|
+
readFlag = item.readFlag,
|
|
336
|
+
dataDesensitizationFlagTrue = item.dataDesensitizationFlagTrue,
|
|
337
|
+
fieldId = item.fieldId;
|
|
336
338
|
|
|
337
339
|
var itemNew = item;
|
|
338
340
|
var newCmptPros = {};
|
|
@@ -342,6 +344,24 @@ var Easy3wFormPage = function (_Component) {
|
|
|
342
344
|
} else {
|
|
343
345
|
newCmptPros = { disabled: true };
|
|
344
346
|
}
|
|
347
|
+
if (dataDesensitizationFlagTrue) {
|
|
348
|
+
var _newCmptPros = newCmptPros,
|
|
349
|
+
addonAfter = _newCmptPros.addonAfter;
|
|
350
|
+
|
|
351
|
+
newCmptPros = (0, _extends3['default'])({}, newCmptPros, {
|
|
352
|
+
addonAfter: addonAfter || _react2['default'].createElement(
|
|
353
|
+
'span',
|
|
354
|
+
null,
|
|
355
|
+
_react2['default'].createElement(
|
|
356
|
+
'a',
|
|
357
|
+
{ onClick: function onClick() {
|
|
358
|
+
return _this.touchImplicit(fieldId);
|
|
359
|
+
} },
|
|
360
|
+
_react2['default'].createElement(_icon2['default'], { type: _this.state[fieldId + 'dataDesensitizationEyeFlag'] ? 'eye' : 'eye-invisible' })
|
|
361
|
+
)
|
|
362
|
+
)
|
|
363
|
+
});
|
|
364
|
+
}
|
|
345
365
|
itemNew = (0, _extends3['default'])({}, item, { cmptPros: newCmptPros });
|
|
346
366
|
}
|
|
347
367
|
if ((readFlag || allReadFlag) && (fieldType === 'checkBox' || fieldType === 'radio')) {
|
|
@@ -445,6 +465,10 @@ var Easy3wFormPage = function (_Component) {
|
|
|
445
465
|
value = _this.getcheckDesensitizeData(value, item);
|
|
446
466
|
}
|
|
447
467
|
return value;
|
|
468
|
+
} else if (disableFlag && _comonConfig.dataDesensitizationFlag) {
|
|
469
|
+
// 只读字段会进行数据校验及脱敏
|
|
470
|
+
value = _this.getcheckDesensitizeData(value, item);
|
|
471
|
+
return value;
|
|
448
472
|
}
|
|
449
473
|
if (fieldType === 'datePicker') {
|
|
450
474
|
/** 格式化日期型数据 */
|
|
@@ -704,7 +728,7 @@ var Easy3wFormPage = function (_Component) {
|
|
|
704
728
|
}
|
|
705
729
|
if (itemValue || itemValue === 0) {
|
|
706
730
|
decoratorObj = (0, _extends3['default'])({}, decoratorObj, {
|
|
707
|
-
initialValue: itemValue
|
|
731
|
+
initialValue: dataDesensitizationFlagTrue ? _this.state[fieldId + 'dataDesensitizationEyeFlag'] ? value : itemValue : itemValue
|
|
708
732
|
});
|
|
709
733
|
}
|
|
710
734
|
if (readFlag || allReadFlag) {
|
|
@@ -912,6 +936,8 @@ var Easy3wFormPage = function (_Component) {
|
|
|
912
936
|
fieldType = item.fieldType;
|
|
913
937
|
|
|
914
938
|
var itemValue = _this.getItemValue(item);
|
|
939
|
+
var dataDesensitizationFlagTrue = item.dataDesensitizationFlagTrue,
|
|
940
|
+
value = item.value;
|
|
915
941
|
var colSpan = cmptPros.colSpan;
|
|
916
942
|
|
|
917
943
|
var addRules = [];
|
|
@@ -921,7 +947,7 @@ var Easy3wFormPage = function (_Component) {
|
|
|
921
947
|
addRules = rules;
|
|
922
948
|
}
|
|
923
949
|
var decoratorObj = {
|
|
924
|
-
initialValue: itemValue,
|
|
950
|
+
initialValue: dataDesensitizationFlagTrue ? _this.state[fieldId + 'dataDesensitizationEyeFlag'] ? value : itemValue : itemValue,
|
|
925
951
|
rules: [{ required: required, message: requiredMessage || '\u8BF7\u586B\u5199' + label }].concat(addRules)
|
|
926
952
|
};
|
|
927
953
|
if (cmptPros && cmptPros.getValueFromEvent) {
|
|
@@ -944,7 +970,19 @@ var Easy3wFormPage = function (_Component) {
|
|
|
944
970
|
initialValue: 'easy3wView',
|
|
945
971
|
rules: [{ required: required, message: requiredMessage || '\u8BF7\u586B\u5199' + label }]
|
|
946
972
|
})(_react2['default'].createElement(_input2['default'], { type: 'hidden' })),
|
|
947
|
-
|
|
973
|
+
dataDesensitizationFlagTrue ? _react2['default'].createElement(
|
|
974
|
+
'span',
|
|
975
|
+
null,
|
|
976
|
+
_this.state[fieldId + 'dataDesensitizationEyeFlag'] ? value : itemValue,
|
|
977
|
+
' ',
|
|
978
|
+
_react2['default'].createElement(
|
|
979
|
+
'a',
|
|
980
|
+
{ onClick: function onClick() {
|
|
981
|
+
return _this.touchImplicit(fieldId);
|
|
982
|
+
} },
|
|
983
|
+
_react2['default'].createElement(_icon2['default'], { type: _this.state[fieldId + 'dataDesensitizationEyeFlag'] ? 'eye' : 'eye-invisible' })
|
|
984
|
+
)
|
|
985
|
+
) : itemValue
|
|
948
986
|
)
|
|
949
987
|
);
|
|
950
988
|
}
|
|
@@ -1185,8 +1223,8 @@ var Easy3wFormPage = function (_Component) {
|
|
|
1185
1223
|
_this.getColItem = function (colObj, formItemLayout) {
|
|
1186
1224
|
var fieldType = colObj.fieldType;
|
|
1187
1225
|
|
|
1188
|
-
var itemArea = _this.getItemArea(colObj);
|
|
1189
1226
|
var itemValue = _this.getItemValue(colObj);
|
|
1227
|
+
var itemArea = _this.getItemArea(colObj);
|
|
1190
1228
|
var afterBtns = _this.getAfterBtn(colObj);
|
|
1191
1229
|
if (fieldType === 'upload') {
|
|
1192
1230
|
var up = _this.getUploadColItem(colObj, formItemLayout);
|