fmui-base 2.1.30 → 2.1.31
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 +1 -0
- package/lib/db/db.js +15 -0
- package/lib/db/variables.js +2 -1
- package/lib/form/form.js +47 -0
- package/lib/form/table.js +15 -4
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/db/db.js
CHANGED
|
@@ -919,6 +919,21 @@ context.create('FlowModuleAPI', {
|
|
|
919
919
|
duration: 800
|
|
920
920
|
});
|
|
921
921
|
}
|
|
922
|
+
},
|
|
923
|
+
getUserInfo: {
|
|
924
|
+
url: _variables2.default.URLS.getUserInfo,
|
|
925
|
+
method: 'GET',
|
|
926
|
+
postDataFomat: 'FORM',
|
|
927
|
+
header: {
|
|
928
|
+
Authorization: 'Bearer ' + getLoginUserInfo().token
|
|
929
|
+
},
|
|
930
|
+
/* header:{'content-Type':'application/x-www-form-urlencoded'},*/
|
|
931
|
+
willFetch: function willFetch() {
|
|
932
|
+
_Toast2.default.show({
|
|
933
|
+
content: _react2.default.createElement(_loading2.default, null),
|
|
934
|
+
duration: 800
|
|
935
|
+
});
|
|
936
|
+
}
|
|
922
937
|
}
|
|
923
938
|
|
|
924
939
|
});
|
package/lib/db/variables.js
CHANGED
|
@@ -121,7 +121,8 @@ exports.default = {
|
|
|
121
121
|
getAllActivity: approveUrlPrefix + "getAllActivity" + '?', //获取所有节点
|
|
122
122
|
getCategoryListByModule: approveUrlPrefix + "getCategoryListByModule" + '?', //获取所有节点
|
|
123
123
|
cancelLimit: approveUrlPrefix + "cancelLimit" + '?', //取消超时
|
|
124
|
-
getCanCancelLimit: approveUrlPrefix + "getCanCancelLimit" + '?' //是否可以取消超时
|
|
124
|
+
getCanCancelLimit: approveUrlPrefix + "getCanCancelLimit" + '?', //是否可以取消超时
|
|
125
|
+
getUserInfo: approveUrlPrefix + "getUserInfo" + '?' //获取用户信息
|
|
125
126
|
},
|
|
126
127
|
nodataIcon: context + "/mobile/fmui/images/noData.png",
|
|
127
128
|
loadingIcon: context + "/mobile/fmui/images/loading.gif",
|
package/lib/form/form.js
CHANGED
|
@@ -2475,6 +2475,14 @@ var PageHome = function (_React$Component) {
|
|
|
2475
2475
|
}, {
|
|
2476
2476
|
key: 'popuserChange',
|
|
2477
2477
|
value: function popuserChange(code, newValue, oldValue) {
|
|
2478
|
+
console.log("===popuserChange===");
|
|
2479
|
+
var t = this;
|
|
2480
|
+
var userId = "";
|
|
2481
|
+
for (var i = 0; i < newValue.length; i++) {
|
|
2482
|
+
if (newValue[i] && newValue[i].scopeType == 'user') {
|
|
2483
|
+
userId = newValue[i].scopeValue;
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2478
2486
|
//alert(JSON.stringify(newValue));
|
|
2479
2487
|
var data = this.props.data;
|
|
2480
2488
|
if (newValue) {
|
|
@@ -2486,6 +2494,45 @@ var PageHome = function (_React$Component) {
|
|
|
2486
2494
|
} else {
|
|
2487
2495
|
newValue = "";
|
|
2488
2496
|
}
|
|
2497
|
+
var formItem = data.formItem;
|
|
2498
|
+
var mainTblData = data.mainTblData;
|
|
2499
|
+
if (userId) {
|
|
2500
|
+
// t.refs[mainTblName+"_"+itemExt.key].reloadItemParam(itemExt.value);
|
|
2501
|
+
_db2.default.FlowModuleAPI.getUserInfo({ userId: userId }).then(function (content) {
|
|
2502
|
+
if (content && content.length > 0) {
|
|
2503
|
+
var userInfo = content[0];
|
|
2504
|
+
for (var i = 0; i < formItem.length; i++) {
|
|
2505
|
+
var item = formItem[i];
|
|
2506
|
+
if (item.dataAttr && item.dataAttr.relatepopuserField && item.dataAttr.relatepopuserField == code) {
|
|
2507
|
+
var relatepopuservalue = item.dataAttr.relatepopuserValue;
|
|
2508
|
+
for (var j = 0; j < mainTblData.length; j++) {
|
|
2509
|
+
var mainTblDataItem = mainTblData[j];
|
|
2510
|
+
if (mainTblDataItem.key == item.itemCode) {
|
|
2511
|
+
if (relatepopuservalue == 'relateuserorg') {
|
|
2512
|
+
mainTblDataItem.value = userInfo.orgName;
|
|
2513
|
+
} else if (relatepopuservalue == 'relateusercode') {
|
|
2514
|
+
mainTblDataItem.value = userInfo.userCode;
|
|
2515
|
+
} else if (relatepopuservalue == 'relateusertelphone') {
|
|
2516
|
+
mainTblDataItem.value = userInfo.telephone;
|
|
2517
|
+
} else if (relatepopuservalue == 'relateuserdutyname') {
|
|
2518
|
+
mainTblDataItem.value = userInfo.dutyName;
|
|
2519
|
+
} else if (relatepopuservalue == 'relateusercardid') {
|
|
2520
|
+
mainTblDataItem.value = userInfo.cardId;
|
|
2521
|
+
}
|
|
2522
|
+
t.props.reloadItemParam(data.mainTblName + "_" + mainTblDataItem.key, mainTblDataItem.value);
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
} else {}
|
|
2528
|
+
}).catch(function (error) {
|
|
2529
|
+
_Toast2.default.show({
|
|
2530
|
+
type: 'error',
|
|
2531
|
+
content: error.errorMsg
|
|
2532
|
+
});
|
|
2533
|
+
});
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2489
2536
|
data = this.editData(code, newValue, data);
|
|
2490
2537
|
var itemParam = this.state.itemParam;
|
|
2491
2538
|
itemParam.value = newValue;
|
package/lib/form/table.js
CHANGED
|
@@ -309,6 +309,17 @@ var PageHome = function (_React$Component) {
|
|
|
309
309
|
// formData:formData
|
|
310
310
|
// });
|
|
311
311
|
}
|
|
312
|
+
}, {
|
|
313
|
+
key: 'reloadItemParam',
|
|
314
|
+
value: function reloadItemParam(key, value) {
|
|
315
|
+
var t = this;
|
|
316
|
+
var textValue = '';
|
|
317
|
+
var valueMap = {};
|
|
318
|
+
valueMap.key = 'value';
|
|
319
|
+
valueMap.value = value;
|
|
320
|
+
|
|
321
|
+
t.refs[key].reloadItemParam([valueMap]);
|
|
322
|
+
}
|
|
312
323
|
}, {
|
|
313
324
|
key: 'change',
|
|
314
325
|
value: function change(data, itemParam, subTblNo) {
|
|
@@ -1667,7 +1678,7 @@ var PageHome = function (_React$Component) {
|
|
|
1667
1678
|
return _react2.default.createElement(
|
|
1668
1679
|
'div',
|
|
1669
1680
|
{ className: "form_" + item2.uniqueName },
|
|
1670
|
-
_react2.default.createElement(_form2.default, { keyNo: j, ref: item2.uniqueName, newspyj: t.props.newspyj, hasCommentField: t.props.hasCommentField, commentUpload: t.props.commentUpload, commentField: t.props.commentField, module: t.props.module, formKey: t.props.allForm.formcode, status: t.props.status, form: item2, allForm: t.props.allForm, formStyle: t.props.formStyleObj, commentList: t.props.commentFieldList, defaultValue: t.props.defaultValue, data: t.props.data, fieldControll: t.props.fieldControll, caIsPrd: t.props.caIsPrd, preCaFields: t.props.preCaFields, formRelaFieldMaps: t.state.formRelaFieldMaps, linkFields: t.state.linkFields, isRemoveCommentFormHtml: t.props.isRemoveCommentFormHtml, onChange: this.change.bind(this) })
|
|
1681
|
+
_react2.default.createElement(_form2.default, { keyNo: j, ref: item2.uniqueName, newspyj: t.props.newspyj, hasCommentField: t.props.hasCommentField, commentUpload: t.props.commentUpload, commentField: t.props.commentField, module: t.props.module, formKey: t.props.allForm.formcode, status: t.props.status, form: item2, allForm: t.props.allForm, formStyle: t.props.formStyleObj, commentList: t.props.commentFieldList, defaultValue: t.props.defaultValue, data: t.props.data, fieldControll: t.props.fieldControll, caIsPrd: t.props.caIsPrd, preCaFields: t.props.preCaFields, formRelaFieldMaps: t.state.formRelaFieldMaps, linkFields: t.state.linkFields, isRemoveCommentFormHtml: t.props.isRemoveCommentFormHtml, onChange: this.change.bind(this), reloadItemParam: this.reloadItemParam.bind(this) })
|
|
1671
1682
|
);
|
|
1672
1683
|
}.bind(this)) : item.itemType == 'detail' ? _react2.default.createElement(
|
|
1673
1684
|
'div',
|
|
@@ -1676,7 +1687,7 @@ var PageHome = function (_React$Component) {
|
|
|
1676
1687
|
) : _react2.default.createElement(
|
|
1677
1688
|
'div',
|
|
1678
1689
|
{ className: "form_" + item.uniqueName },
|
|
1679
|
-
_react2.default.createElement(_form2.default, { ref: item.uniqueName, keyNo: i, operate: t.props.operate, newspyj: t.props.newspyj, hasCommentField: t.props.hasCommentField, commentUpload: t.props.commentUpload, commentField: t.props.commentField, module: t.props.module, formKey: t.props.allForm.formcode, status: t.props.status, form: item, allForm: t.props.allForm, formStyle: t.props.formStyleObj, commentList: t.props.commentFieldList, defaultValue: t.props.defaultValue, data: t.props.data, fieldControll: t.props.fieldControll, caIsPrd: t.props.caIsPrd, preCaFields: t.props.preCaFields, formRelaFieldMaps: t.state.formRelaFieldMaps, linkFields: t.state.linkFields, isRemoveCommentFormHtml: t.props.isRemoveCommentFormHtml, onChange: this.change.bind(this) })
|
|
1690
|
+
_react2.default.createElement(_form2.default, { ref: item.uniqueName, keyNo: i, operate: t.props.operate, newspyj: t.props.newspyj, hasCommentField: t.props.hasCommentField, commentUpload: t.props.commentUpload, commentField: t.props.commentField, module: t.props.module, formKey: t.props.allForm.formcode, status: t.props.status, form: item, allForm: t.props.allForm, formStyle: t.props.formStyleObj, commentList: t.props.commentFieldList, defaultValue: t.props.defaultValue, data: t.props.data, fieldControll: t.props.fieldControll, caIsPrd: t.props.caIsPrd, preCaFields: t.props.preCaFields, formRelaFieldMaps: t.state.formRelaFieldMaps, linkFields: t.state.linkFields, isRemoveCommentFormHtml: t.props.isRemoveCommentFormHtml, onChange: this.change.bind(this), reloadItemParam: this.reloadItemParam.bind(this) })
|
|
1680
1691
|
);
|
|
1681
1692
|
}.bind(this)) : "" : _react2.default.createElement(
|
|
1682
1693
|
'div',
|
|
@@ -1703,7 +1714,7 @@ var PageHome = function (_React$Component) {
|
|
|
1703
1714
|
return _react2.default.createElement(
|
|
1704
1715
|
'div',
|
|
1705
1716
|
{ className: t.state.active == item.tabCode ? "" : "t-DN" },
|
|
1706
|
-
_react2.default.createElement(_form2.default, { className: "form_" + item.uniqueName, keyNo: j, ref: item.uniqueName, operate: t.props.operate, hasCommentField: t.props.hasCommentField, commentUpload: t.props.commentUpload, newspyj: t.props.newspyj, commentField: t.props.commentField, module: t.props.module, formKey: t.props.allForm.formcode, status: t.props.status, form: item2, allForm: t.props.allForm, formStyle: t.props.formStyleObj, commentList: t.props.commentFieldList, data: t.props.data, fieldControll: t.props.fieldControll, onChange: this.change.bind(this) })
|
|
1717
|
+
_react2.default.createElement(_form2.default, { className: "form_" + item.uniqueName, keyNo: j, ref: item.uniqueName, operate: t.props.operate, hasCommentField: t.props.hasCommentField, commentUpload: t.props.commentUpload, newspyj: t.props.newspyj, commentField: t.props.commentField, module: t.props.module, formKey: t.props.allForm.formcode, status: t.props.status, form: item2, allForm: t.props.allForm, formStyle: t.props.formStyleObj, commentList: t.props.commentFieldList, data: t.props.data, fieldControll: t.props.fieldControll, onChange: this.change.bind(this), reloadItemParam: this.reloadItemParam.bind(this) })
|
|
1707
1718
|
);
|
|
1708
1719
|
}.bind(this)) : item.itemType == 'detail' ? _react2.default.createElement(
|
|
1709
1720
|
'div',
|
|
@@ -1712,7 +1723,7 @@ var PageHome = function (_React$Component) {
|
|
|
1712
1723
|
) : _react2.default.createElement(
|
|
1713
1724
|
'div',
|
|
1714
1725
|
{ className: t.state.active == item.tabCode ? "" : "t-DN" },
|
|
1715
|
-
_react2.default.createElement(_form2.default, { className: "form_" + item.uniqueName, ref: item.uniqueName, keyNo: i, operate: t.props.operate, newspyj: t.props.newspyj, hasCommentField: t.props.hasCommentField, commentUpload: t.props.commentUpload, commentField: t.props.commentField, module: t.props.module, formKey: t.props.allForm.formcode, status: t.props.status, form: item, allForm: t.props.allForm, formStyle: t.props.formStyleObj, commentList: t.props.commentFieldList, data: t.props.data, fieldControll: t.props.fieldControll, onChange: this.change.bind(this) })
|
|
1726
|
+
_react2.default.createElement(_form2.default, { className: "form_" + item.uniqueName, ref: item.uniqueName, keyNo: i, operate: t.props.operate, newspyj: t.props.newspyj, hasCommentField: t.props.hasCommentField, commentUpload: t.props.commentUpload, commentField: t.props.commentField, module: t.props.module, formKey: t.props.allForm.formcode, status: t.props.status, form: item, allForm: t.props.allForm, formStyle: t.props.formStyleObj, commentList: t.props.commentFieldList, data: t.props.data, fieldControll: t.props.fieldControll, onChange: this.change.bind(this), reloadItemParam: this.reloadItemParam.bind(this) })
|
|
1716
1727
|
);
|
|
1717
1728
|
}.bind(this))
|
|
1718
1729
|
)
|