fmui-base 2.1.30 → 2.1.32
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/db/db.js +15 -0
- package/lib/db/variables.js +2 -1
- package/lib/form/form.js +64 -1
- 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
|
@@ -641,7 +641,7 @@ var PageHome = function (_React$Component) {
|
|
|
641
641
|
alert("265====="+itemParam.dataAttr.textLineFeed);
|
|
642
642
|
}*/
|
|
643
643
|
//宏值签名图片
|
|
644
|
-
if (itemParam.dataAttr && itemParam.dataAttr.dataSrc == '2' && !readOnly) {
|
|
644
|
+
if (itemParam.dataAttr && itemParam.dataAttr.dataSrc == '2' && !readOnly && !itemParam.bizCodeRuleId) {
|
|
645
645
|
value = form.defaultValue;
|
|
646
646
|
}
|
|
647
647
|
if (itemParam.dataAttr && itemParam.dataAttr.dataSrc == '2' && itemParam.dataAttr.fromMacro.value == 'currentUserSignPic') {
|
|
@@ -1335,6 +1335,22 @@ var PageHome = function (_React$Component) {
|
|
|
1335
1335
|
});
|
|
1336
1336
|
t.props.onChange(data, t.state.itemParam);
|
|
1337
1337
|
}
|
|
1338
|
+
} else if (itemType == 'html') {
|
|
1339
|
+
|
|
1340
|
+
// if(value){
|
|
1341
|
+
// value = value.split('_')[0];
|
|
1342
|
+
// value = context + '/api/m/plugin/attachment/mobile/viewImage?token=' + token + '&fid='+value;
|
|
1343
|
+
// //alert("value==="+value);
|
|
1344
|
+
// }
|
|
1345
|
+
var updatedHtml = value.replace(/<img\s+([^>]*)src="([^"]*)"/gi, function (match, p1, p2, p3) {
|
|
1346
|
+
console.log(p1);
|
|
1347
|
+
if (p2 && p2.indexOf("/attachment/" > 0)) {
|
|
1348
|
+
p2 = context + "/attachment/" + p2.split("/attachment/")[1];
|
|
1349
|
+
}
|
|
1350
|
+
return '<img ' + p1 + 'src="' + p2 + '"';
|
|
1351
|
+
});
|
|
1352
|
+
console.log(updatedHtml);
|
|
1353
|
+
itemParam.value = updatedHtml;
|
|
1338
1354
|
}
|
|
1339
1355
|
itemParam = t.dealwithLinkField(itemParam, data, status);
|
|
1340
1356
|
itemParam = t.dealwithRelaField(itemParam, allForm);
|
|
@@ -2475,6 +2491,14 @@ var PageHome = function (_React$Component) {
|
|
|
2475
2491
|
}, {
|
|
2476
2492
|
key: 'popuserChange',
|
|
2477
2493
|
value: function popuserChange(code, newValue, oldValue) {
|
|
2494
|
+
console.log("===popuserChange===");
|
|
2495
|
+
var t = this;
|
|
2496
|
+
var userId = "";
|
|
2497
|
+
for (var i = 0; i < newValue.length; i++) {
|
|
2498
|
+
if (newValue[i] && newValue[i].scopeType == 'user') {
|
|
2499
|
+
userId = newValue[i].scopeValue;
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2478
2502
|
//alert(JSON.stringify(newValue));
|
|
2479
2503
|
var data = this.props.data;
|
|
2480
2504
|
if (newValue) {
|
|
@@ -2486,6 +2510,45 @@ var PageHome = function (_React$Component) {
|
|
|
2486
2510
|
} else {
|
|
2487
2511
|
newValue = "";
|
|
2488
2512
|
}
|
|
2513
|
+
var formItem = data.formItem;
|
|
2514
|
+
var mainTblData = data.mainTblData;
|
|
2515
|
+
if (userId) {
|
|
2516
|
+
// t.refs[mainTblName+"_"+itemExt.key].reloadItemParam(itemExt.value);
|
|
2517
|
+
_db2.default.FlowModuleAPI.getUserInfo({ userId: userId }).then(function (content) {
|
|
2518
|
+
if (content && content.length > 0) {
|
|
2519
|
+
var userInfo = content[0];
|
|
2520
|
+
for (var i = 0; i < formItem.length; i++) {
|
|
2521
|
+
var item = formItem[i];
|
|
2522
|
+
if (item.dataAttr && item.dataAttr.relatepopuserField && item.dataAttr.relatepopuserField == code) {
|
|
2523
|
+
var relatepopuservalue = item.dataAttr.relatepopuserValue;
|
|
2524
|
+
for (var j = 0; j < mainTblData.length; j++) {
|
|
2525
|
+
var mainTblDataItem = mainTblData[j];
|
|
2526
|
+
if (mainTblDataItem.key == item.itemCode) {
|
|
2527
|
+
if (relatepopuservalue == 'relateuserorg') {
|
|
2528
|
+
mainTblDataItem.value = userInfo.orgName;
|
|
2529
|
+
} else if (relatepopuservalue == 'relateusercode') {
|
|
2530
|
+
mainTblDataItem.value = userInfo.userCode;
|
|
2531
|
+
} else if (relatepopuservalue == 'relateusertelphone') {
|
|
2532
|
+
mainTblDataItem.value = userInfo.telephone;
|
|
2533
|
+
} else if (relatepopuservalue == 'relateuserdutyname') {
|
|
2534
|
+
mainTblDataItem.value = userInfo.dutyName;
|
|
2535
|
+
} else if (relatepopuservalue == 'relateusercardid') {
|
|
2536
|
+
mainTblDataItem.value = userInfo.cardId;
|
|
2537
|
+
}
|
|
2538
|
+
t.props.reloadItemParam(data.mainTblName + "_" + mainTblDataItem.key, mainTblDataItem.value);
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
} else {}
|
|
2544
|
+
}).catch(function (error) {
|
|
2545
|
+
_Toast2.default.show({
|
|
2546
|
+
type: 'error',
|
|
2547
|
+
content: error.errorMsg
|
|
2548
|
+
});
|
|
2549
|
+
});
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2489
2552
|
data = this.editData(code, newValue, data);
|
|
2490
2553
|
var itemParam = this.state.itemParam;
|
|
2491
2554
|
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
|
)
|