fmui-base 2.3.42 → 2.3.44

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 CHANGED
@@ -3,6 +3,8 @@
3
3
  ---npm publish
4
4
 
5
5
  ## 更新日志
6
+ - 2.3.44:数据已被他人修改时,刷新表单内容
7
+ - 2.3.43:表单字段关联时,空值影响
6
8
  - 2.3.42:表单字段关联时,为空行隐藏后,切换值显示不了问题处理
7
9
  - 2.3.41:移动端支持表单字段校验属性
8
10
  - 2.3.40:表单html字段增加className="ueditor-content"
package/lib/form/form.js CHANGED
@@ -2068,7 +2068,7 @@ var PageHome = function (_React$Component) {
2068
2068
  if (!skipEditMust && matched && defaultshowFields.indexOf(itemParam.uniqueName) != -1) {
2069
2069
  itemParam.readOnly = false;
2070
2070
  editFlag = true;
2071
- } else if (!skipEditMust && !editFlag && defaultshowFields.indexOf(itemParam.uniqueName) != -1 && nowValue != '') {
2071
+ } else if (!skipEditMust && !editFlag && defaultshowFields.indexOf(itemParam.uniqueName) != -1 && nowValue != '' && nowValue != ' ') {
2072
2072
  itemParam.readOnly = true;
2073
2073
  } else if (!editFlag && defaultshowFields.indexOf(itemParam.uniqueName) != -1) {
2074
2074
  itemParam.readOnly = baseline.readOnly;
package/lib/form/table.js CHANGED
@@ -1304,7 +1304,7 @@ var PageHome = function (_React$Component) {
1304
1304
  if (!skipEditMust && matched && defaultshowFields.indexOf(targetUniqueName) != -1) {
1305
1305
  readOnly = false;
1306
1306
  editFlag = true;
1307
- } else if (!skipEditMust && !editFlag && defaultshowFields.indexOf(targetUniqueName) != -1 && nowValue != '') {
1307
+ } else if (!skipEditMust && !editFlag && defaultshowFields.indexOf(targetUniqueName) != -1 && nowValue != '' && nowValue != ' ') {
1308
1308
  readOnly = true;
1309
1309
  } else if (!editFlag && defaultshowFields.indexOf(targetUniqueName) != -1) {
1310
1310
  readOnly = baseline.readOnly;
@@ -1463,9 +1463,6 @@ var PageHome = function (_React$Component) {
1463
1463
  var formRelaFieldMapsObjItem = formRelaFieldMapsObj[formIndex];
1464
1464
  mustFlag = false;
1465
1465
  var triggerFieldVal = formRelaFieldMapsObjItem.triggerFieldVal;
1466
- if (triggerFieldVal == " ") {
1467
- triggerFieldVal = "";
1468
- }
1469
1466
  var relaFieldTblName = formRelaFieldMapsObjItem.relaFieldTblName;
1470
1467
  var editType = formRelaFieldMapsObjItem.editType;
1471
1468
  if (relaFieldTblName) {
@@ -1584,7 +1581,7 @@ var PageHome = function (_React$Component) {
1584
1581
  } else if (editType == 'must') {
1585
1582
  relaFieldMap["key"] = "required";
1586
1583
  var triggerFieldValBoolean = mustFlag;
1587
- if (triggerFieldVal == nowValue || nowValue.split(',').indexOf(triggerFieldVal) != -1) {
1584
+ if ((0, _formExtHelper.isRelaRuleMatched)({ triggerFieldVal: triggerFieldVal }, nowValue)) {
1588
1585
  relaFieldMap["value"] = true;
1589
1586
  triggerFieldValBoolean = true;
1590
1587
  mustFlag = true;
@@ -1631,7 +1628,7 @@ var PageHome = function (_React$Component) {
1631
1628
  }
1632
1629
  } else if (editType == 'edit') {
1633
1630
  relaFieldMap["key"] = "readOnly";
1634
- if ((triggerFieldVal == nowValue || nowValue.split(',').indexOf(triggerFieldVal) != -1) && defaultshowFields.indexOf(relaFieldTblNameArrayItem) != -1) {
1631
+ if ((0, _formExtHelper.isRelaRuleMatched)({ triggerFieldVal: triggerFieldVal }, nowValue) && defaultshowFields.indexOf(relaFieldTblNameArrayItem) != -1) {
1635
1632
  relaFieldMap["value"] = false;
1636
1633
  editFlag = true;
1637
1634
  } else if (!editFlag && defaultshowFields.indexOf(relaFieldTblNameArrayItem) != -1) {
@@ -1541,9 +1541,14 @@ var PageHome = function (_React$Component) {
1541
1541
  // urgentSelectList = urgentList;
1542
1542
  // }
1543
1543
  // }
1544
+ var resolvedOptlock = formData && formData.optlock !== undefined && formData.optlock !== null && formData.optlock !== '' ? String(formData.optlock) : content.optlock !== undefined && content.optlock !== null && content.optlock !== '' ? String(content.optlock) : '';
1545
+ if (t._pendingForceOptlock) {
1546
+ resolvedOptlock = String(t._pendingForceOptlock);
1547
+ t._pendingForceOptlock = null;
1548
+ }
1544
1549
  t.setState({
1545
1550
  editFormData: formData,
1546
- formDataOptlock: formData && formData.optlock !== undefined && formData.optlock !== null && formData.optlock !== '' ? String(formData.optlock) : content.optlock !== undefined && content.optlock !== null && content.optlock !== '' ? String(content.optlock) : '',
1551
+ formDataOptlock: resolvedOptlock,
1547
1552
  //formDataNew:content.formDataNew,
1548
1553
  // formData: formData,
1549
1554
  // fileContent: fileContent,
@@ -1624,6 +1629,14 @@ var PageHome = function (_React$Component) {
1624
1629
  startUserOrgId: content.startUserOrgId || content.startUserGroupId || '',
1625
1630
  taskAssignOrgId: content.taskAssignOrgId || ''
1626
1631
  }, function () {
1632
+ if (t._pendingCommentRestore != null && t._pendingCommentRestore !== '') {
1633
+ var restoredComment = t._pendingCommentRestore;
1634
+ t._pendingCommentRestore = null;
1635
+ t.setState({
1636
+ spyj: restoredComment,
1637
+ newspyj: Object.assign({}, t.state.newspyj, { content: restoredComment })
1638
+ });
1639
+ }
1627
1640
  t.initApproveOrgSwitcher();
1628
1641
  t.refs["selectMember_circulate"].initSelectData();
1629
1642
  t.refs["selectMember_circulate1"].initSelectData();
@@ -5271,6 +5284,79 @@ var PageHome = function (_React$Component) {
5271
5284
 
5272
5285
  //发送流程function
5273
5286
 
5287
+ }, {
5288
+ key: 'refreshFormAfterOptlockConflict',
5289
+ value: function refreshFormAfterOptlockConflict() {
5290
+ var t = this;
5291
+ try {
5292
+ _Popup2.default.hide();
5293
+ } catch (e) {}
5294
+ try {
5295
+ if (typeof _Dialog2.default !== 'undefined' && _Dialog2.default.hide) {
5296
+ _Dialog2.default.hide();
5297
+ }
5298
+ } catch (e2) {}
5299
+ var savedComment = t.state.spyj || t.state.newspyj && t.state.newspyj.content || '';
5300
+ t._pendingCommentRestore = savedComment;
5301
+ t._pendingFormDataRestore = null;
5302
+ var param = {
5303
+ formId: t.state.formId,
5304
+ dataId: t.state.dataId,
5305
+ permissionCode: t.state.permissionCode,
5306
+ taskId: t.state.taskId,
5307
+ processInstanceId: t.state.processInstanceId,
5308
+ type: t.state.listType,
5309
+ module: t.state.module,
5310
+ isSub: isSub
5311
+ };
5312
+ _db2.default.FlowModuleAPI.getUndoTaskInfo({
5313
+ taskId: t.state.taskId,
5314
+ processInstanceId: t.state.processInstanceId,
5315
+ module: t.state.module,
5316
+ permissionCode: t.state.permissionCode,
5317
+ dataId: t.state.dataId,
5318
+ formId: t.state.formId
5319
+ }).then(function (content) {
5320
+ if (!content || content.message === 'delete' || content.message === 'view' || content.buttons === '') {
5321
+ _Toast2.default.show({ type: 'error', content: '流程已被他人办理' });
5322
+ setTimeout(function () {
5323
+ if (t.state.isPush == '1') {
5324
+ closePage();
5325
+ } else {
5326
+ backPage();
5327
+ }
5328
+ }, 1500);
5329
+ t._pendingCommentRestore = null;
5330
+ t._pendingForceOptlock = null;
5331
+ return;
5332
+ }
5333
+ var optlock = '';
5334
+ if (content.optlock !== undefined && content.optlock !== null && content.optlock !== '') {
5335
+ optlock = String(content.optlock);
5336
+ } else if (content.formData && content.formData.optlock !== undefined && content.formData.optlock !== null && content.formData.optlock !== '') {
5337
+ optlock = String(content.formData.optlock);
5338
+ }
5339
+ if (!optlock) {
5340
+ t._pendingCommentRestore = null;
5341
+ t._pendingForceOptlock = null;
5342
+ _Toast2.default.show({ type: 'error', content: '未获取到最新表单版本,请手动刷新页面' });
5343
+ return;
5344
+ }
5345
+ t._pendingForceOptlock = optlock;
5346
+ t.setState({ formDataOptlock: optlock }, function () {
5347
+ t.loadPage(param);
5348
+ _Toast2.default.show({
5349
+ type: 'error',
5350
+ content: '该表单已经被别人修改过,已刷新为最新版本,请核对后重新填写并提交',
5351
+ duration: 6000
5352
+ });
5353
+ });
5354
+ }).catch(function () {
5355
+ t._pendingCommentRestore = null;
5356
+ t._pendingForceOptlock = null;
5357
+ _Toast2.default.show({ type: 'error', content: '刷新表单失败,请手动刷新页面' });
5358
+ });
5359
+ }
5274
5360
  }, {
5275
5361
  key: 'sendFlowFuc',
5276
5362
  value: function sendFlowFuc(param) {
@@ -5461,6 +5547,10 @@ var PageHome = function (_React$Component) {
5461
5547
  if (message.indexOf('已经办理') != -1) {
5462
5548
  message = "流程已办理!";
5463
5549
  }
5550
+ if (message.indexOf('数据已被他人修改') >= 0 || message.indexOf('请刷新后重试') >= 0) {
5551
+ t.refreshFormAfterOptlockConflict();
5552
+ return;
5553
+ }
5464
5554
  setTimeout(function () {
5465
5555
  _Toast2.default.show({
5466
5556
  type: 'error',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.3.42",
3
+ "version": "2.3.44",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",