easy3wui 1.4.220 → 1.4.224
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 +35 -12
- package/package.json +1 -1
|
@@ -388,14 +388,19 @@ var Easy3wFormPage = function (_Component) {
|
|
|
388
388
|
|
|
389
389
|
if (treeData && treeData.length > 0) {
|
|
390
390
|
if (typeof value === 'object') {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
391
|
+
if (!value) {
|
|
392
|
+
value = undefined;
|
|
393
|
+
} else if (!value.key && !value.value) {
|
|
394
|
+
value = undefined;
|
|
395
|
+
} else if (value instanceof Array) {
|
|
396
|
+
// 数组
|
|
397
|
+
var arrVal = value && value.map(function (itemVal) {
|
|
396
398
|
return itemVal.label;
|
|
397
399
|
});
|
|
398
400
|
value = arrVal.join();
|
|
401
|
+
} else {
|
|
402
|
+
// 对象
|
|
403
|
+
value = value.label;
|
|
399
404
|
}
|
|
400
405
|
}
|
|
401
406
|
}
|
|
@@ -1378,11 +1383,11 @@ var Easy3wFormPage = function (_Component) {
|
|
|
1378
1383
|
var findObj = ''; // 只读单选字符串
|
|
1379
1384
|
var afterBtns = _this.getAfterBtn(item);
|
|
1380
1385
|
selectOpts = optionLst && optionLst.map(function (opt) {
|
|
1381
|
-
return _react2['default'].createElement(
|
|
1386
|
+
return opt.key || opt.value ? _react2['default'].createElement(
|
|
1382
1387
|
Option,
|
|
1383
|
-
{ key: opt.value },
|
|
1388
|
+
{ key: opt.value || opt.key, disabled: opt.disabled },
|
|
1384
1389
|
opt.label
|
|
1385
|
-
);
|
|
1390
|
+
) : '';
|
|
1386
1391
|
});
|
|
1387
1392
|
var allContents = optionLst && optionLst.map(function (opt) {
|
|
1388
1393
|
if (value && value instanceof Array && value.length > 0) {
|
|
@@ -1462,12 +1467,31 @@ var Easy3wFormPage = function (_Component) {
|
|
|
1462
1467
|
var getFieldDecorator = form.getFieldDecorator;
|
|
1463
1468
|
|
|
1464
1469
|
var disabled = false;
|
|
1470
|
+
var addRules = [];
|
|
1471
|
+
// 添加rule,getValueFromEvent属性
|
|
1472
|
+
var decoratorObj = {
|
|
1473
|
+
rules: [{ required: required, message: requiredMessage || '\u8BF7\u586B\u5199' + label }]
|
|
1474
|
+
};
|
|
1475
|
+
if (cmptPros) {
|
|
1476
|
+
if (cmptPros.rules) {
|
|
1477
|
+
var rules = cmptPros.rules;
|
|
1478
|
+
|
|
1479
|
+
addRules = rules;
|
|
1480
|
+
decoratorObj.rules.push(addRules);
|
|
1481
|
+
}
|
|
1482
|
+
if (cmptPros.getValueFromEvent) {
|
|
1483
|
+
var getValueFromEvent = cmptPros.getValueFromEvent;
|
|
1484
|
+
|
|
1485
|
+
decoratorObj = (0, _extends3['default'])({}, decoratorObj, { getValueFromEvent: getValueFromEvent });
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1465
1488
|
if (disableFlag || cmptPros.disableFlag) {
|
|
1466
1489
|
disabled = true;
|
|
1467
1490
|
}
|
|
1468
1491
|
if (allReadFlag) {
|
|
1469
1492
|
disabled = true;
|
|
1470
1493
|
}
|
|
1494
|
+
|
|
1471
1495
|
var cmptProsNew = (0, _extends3['default'])({}, cmptPros, { disabled: disabled });
|
|
1472
1496
|
return _react2['default'].createElement(
|
|
1473
1497
|
FormItem,
|
|
@@ -1477,10 +1501,9 @@ var Easy3wFormPage = function (_Component) {
|
|
|
1477
1501
|
style: formItemStyle,
|
|
1478
1502
|
className: (0, _classnames2['default'])(['formContent'])
|
|
1479
1503
|
}),
|
|
1480
|
-
getFieldDecorator(fieldId, {
|
|
1481
|
-
initialValue: value
|
|
1482
|
-
|
|
1483
|
-
})(_react2['default'].createElement(RadioGroup, cmptProsNew))
|
|
1504
|
+
getFieldDecorator(fieldId, (0, _extends3['default'])({}, decoratorObj, {
|
|
1505
|
+
initialValue: value
|
|
1506
|
+
}))(_react2['default'].createElement(RadioGroup, cmptProsNew))
|
|
1484
1507
|
);
|
|
1485
1508
|
}, _this.getCheckBoxColItem = function (item, formItemLayout) {
|
|
1486
1509
|
var _this$props7 = _this.props,
|