fmui-base 2.0.74 → 2.0.76
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 +31 -0
- package/lib/form/subForm.js +5 -1
- package/lib/form/table.js +22 -8
- package/lib/react_grid/react_grid.js +1 -1
- package/lib/react_grid/react_grid.less +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/form/form.js
CHANGED
|
@@ -888,6 +888,37 @@ var PageHome = function (_React$Component) {
|
|
|
888
888
|
if (maxDate) {
|
|
889
889
|
itemParam.maxDate = maxDate;
|
|
890
890
|
}
|
|
891
|
+
var fromCalculate = form.dataAttr.fromCalculate;
|
|
892
|
+
if (fromCalculate && typeof fromCalculate != "undefined") {
|
|
893
|
+
var calculateExpList = fromCalculate.calculateExpList; //计算公式列表
|
|
894
|
+
var calculateExp = fromCalculate.calculateExp; //计算公式
|
|
895
|
+
if (calculateExp) {
|
|
896
|
+
var fieldArray = this.getFieldArray(calculateExp);
|
|
897
|
+
if (!value) {
|
|
898
|
+
value = this.dealwithCalculate(calculateExp, fieldArray, form, allForm);
|
|
899
|
+
}
|
|
900
|
+
for (var i = 0; i < fieldArray.length; i++) {
|
|
901
|
+
var calculateExpValue;
|
|
902
|
+
if (calculateExpList) {
|
|
903
|
+
calculateExpValue = calculateExpList[fieldArray[i]];
|
|
904
|
+
if (!calculateExpValue) {
|
|
905
|
+
calculateExpValue = [];
|
|
906
|
+
}
|
|
907
|
+
} else {
|
|
908
|
+
calculateExpList = {};
|
|
909
|
+
calculateExpValue = [];
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
var calculateExpValueItem = {};
|
|
913
|
+
calculateExpValueItem.exp = calculateExp; //计算公式
|
|
914
|
+
calculateExpValueItem.result = uniqueName; //公式结果字段
|
|
915
|
+
calculateExpValueItem.key = key; //公式结果字段key
|
|
916
|
+
calculateExpValue.push(calculateExpValueItem);
|
|
917
|
+
calculateExpList[fieldArray[i]] = calculateExpValue;
|
|
918
|
+
}
|
|
919
|
+
data.calculateExpList = calculateExpList;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
891
922
|
} else {
|
|
892
923
|
dateFormat = "YMDHM";
|
|
893
924
|
}
|
package/lib/form/subForm.js
CHANGED
|
@@ -340,11 +340,15 @@ var PageHome = function (_React$Component) {
|
|
|
340
340
|
key: 'reloadSubItemParam',
|
|
341
341
|
value: function reloadSubItemParam(itemNew) {
|
|
342
342
|
if (itemNew != null && itemNew != undefined && Array.isArray(itemNew)) {
|
|
343
|
+
var itemParam = this.state.itemParam;
|
|
344
|
+
var value = itemParam.value;
|
|
343
345
|
for (var i = 0; i < itemNew.length; i++) {
|
|
344
346
|
var fieldCode = itemNew[i].key;
|
|
345
347
|
var value = itemNew[i].value;
|
|
346
348
|
var index = itemNew[i].index;
|
|
347
|
-
|
|
349
|
+
if (value[index]) {
|
|
350
|
+
value[index][fieldCode] = value;
|
|
351
|
+
}
|
|
348
352
|
if (this.refs[fieldCode + '_' + index]) {
|
|
349
353
|
var valueItem = {};
|
|
350
354
|
valueItem.key = 'value';
|
package/lib/form/table.js
CHANGED
|
@@ -365,19 +365,19 @@ var PageHome = function (_React$Component) {
|
|
|
365
365
|
} else {
|
|
366
366
|
if (itemExt.index || itemExt.index == 0) {
|
|
367
367
|
if (itemExt.subCode) {
|
|
368
|
+
|
|
368
369
|
t.refs["sub_" + itemExt.key].refs[itemExt.key + "_" + itemExt.subCode + "_" + itemExt.index].reloadItemParam(itemExt.value);
|
|
370
|
+
// t.refs["sub_" + itemExt.key].reloadSubItemParam([itemExt]);
|
|
369
371
|
for (var iExtSub = 0; iExtSub < subTbl.length; iExtSub++) {
|
|
370
372
|
var subTblName = subTbl[iExtSub].subTblName;
|
|
371
373
|
if (subTblName == itemExt.key) {
|
|
372
374
|
if (itemExt.data) {
|
|
373
375
|
var subTblData = subTbl[iExtSub].subTblData;
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
subTblItemData[iExtSubDataItem].value = itemExt.data;
|
|
380
|
-
}
|
|
376
|
+
if (subTblData.length > itemExt.index) {
|
|
377
|
+
var subTblItemData = subTbl[iExtSub].subTblData[itemExt.index];
|
|
378
|
+
for (var iExtSubDataItem = 0; iExtSubDataItem < subTblItemData.length; iExtSubDataItem++) {
|
|
379
|
+
if (itemExt.subCode == subTblItemData[iExtSubDataItem].key) {
|
|
380
|
+
subTblItemData[iExtSubDataItem].value = itemExt.data;
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
}
|
|
@@ -953,6 +953,19 @@ var PageHome = function (_React$Component) {
|
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
|
+
if (itemParam.itemType == 'datetime' || itemParam.itemType == 'text') {
|
|
957
|
+
console.log("adddays");
|
|
958
|
+
var adddaysDateRegExp = new RegExp("adddays\\(", "g");
|
|
959
|
+
if (exp.match(adddaysDateRegExp)) {
|
|
960
|
+
//当有adddays函数
|
|
961
|
+
if (typeof filedItemValue == 'undefined' || filedItemValue == "" || filedItemValue == null) {
|
|
962
|
+
//filedItemValue = 0;
|
|
963
|
+
return false;
|
|
964
|
+
} else {
|
|
965
|
+
filedItemValue = filedItemValue.value ? filedItemValue.value : filedItemValue;
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
956
969
|
|
|
957
970
|
if (typeof filedItemValue == 'undefined' || filedItemValue == "" && filedItemValue != "0" || filedItemValue == null) {
|
|
958
971
|
//当filedItemValue为空或者其他异常状态时置为0
|
|
@@ -977,6 +990,7 @@ var PageHome = function (_React$Component) {
|
|
|
977
990
|
exp = exp.replace(new RegExp("differDate\\(", "g"), 'calculate.differDate(');
|
|
978
991
|
exp = exp.replace(new RegExp("differHour\\(", "g"), 'calculate.differHour(');
|
|
979
992
|
exp = exp.replace(new RegExp("differHalfDate\\(", "g"), 'calculate.differHalfDate(');
|
|
993
|
+
exp = exp.replace(new RegExp("adddays\\(", "g"), 'calculate.adddays(');
|
|
980
994
|
try {
|
|
981
995
|
var res = eval(exp);
|
|
982
996
|
} catch (e) {
|
|
@@ -1018,8 +1032,8 @@ var PageHome = function (_React$Component) {
|
|
|
1018
1032
|
var resultMap = {};
|
|
1019
1033
|
resultMap.key = 'value';
|
|
1020
1034
|
resultMap.value = res;
|
|
1021
|
-
this.refs[resultItem].reloadItemParam([resultMap]);
|
|
1022
1035
|
data = this.editData(resultKey, res, data);
|
|
1036
|
+
this.refs[resultItem].reloadItemParam([resultMap]);
|
|
1023
1037
|
}
|
|
1024
1038
|
if (returnResultItem && returnResultItem.length > 0) {
|
|
1025
1039
|
for (var r = 0; r < returnResultItem.length; r++) {
|
|
@@ -1678,7 +1678,7 @@ var MyGrid = function (_React$Component) {
|
|
|
1678
1678
|
if (t.state[item.portletCode + '_' + item.id] && t.state[item.portletCode + '_' + item.id].length > 0) {
|
|
1679
1679
|
componentContent = _react2.default.createElement(
|
|
1680
1680
|
_Carousel2.default,
|
|
1681
|
-
{ showNav: true,
|
|
1681
|
+
{ showNav: true, auto: false, className: 'jxzt-content', onSlideClick: function onSlideClick(option) {
|
|
1682
1682
|
t.skip2Zhuanti(option);
|
|
1683
1683
|
} },
|
|
1684
1684
|
_carouselItem
|
|
@@ -620,7 +620,7 @@
|
|
|
620
620
|
|
|
621
621
|
// 通知部件
|
|
622
622
|
.carousel-notice.t-slide {
|
|
623
|
-
margin: 16px;
|
|
623
|
+
// margin: 16px;
|
|
624
624
|
border-radius: 5px;
|
|
625
625
|
|
|
626
626
|
.t-slide-item {
|
|
@@ -667,6 +667,7 @@
|
|
|
667
667
|
|
|
668
668
|
.jxzt-content {
|
|
669
669
|
margin: 0;
|
|
670
|
+
height: 100% ;
|
|
670
671
|
.t-image-slide-item {
|
|
671
672
|
// height: 91px !important;
|
|
672
673
|
background-image: url(/mobile/fmui/images/notice-card-bg.png);
|
|
@@ -675,7 +676,7 @@
|
|
|
675
676
|
}
|
|
676
677
|
|
|
677
678
|
.t-slide-view {
|
|
678
|
-
height:
|
|
679
|
+
height: 100% !important;
|
|
679
680
|
}
|
|
680
681
|
}
|
|
681
682
|
|