fmui-base 2.3.43 → 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,7 @@
3
3
  ---npm publish
4
4
 
5
5
  ## 更新日志
6
+ - 2.3.44:数据已被他人修改时,刷新表单内容
6
7
  - 2.3.43:表单字段关联时,空值影响
7
8
  - 2.3.42:表单字段关联时,为空行隐藏后,切换值显示不了问题处理
8
9
  - 2.3.41:移动端支持表单字段校验属性
@@ -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.43",
3
+ "version": "2.3.44",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",