fmui-base 2.3.44 → 2.3.45

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.45:数据已被他人修改时,刷新表单内容保留批示意见
6
7
  - 2.3.44:数据已被他人修改时,刷新表单内容
7
8
  - 2.3.43:表单字段关联时,空值影响
8
9
  - 2.3.42:表单字段关联时,为空行隐藏后,切换值显示不了问题处理
@@ -487,6 +487,7 @@ var PageHome = function (_React$Component) {
487
487
  errorMsg: '',
488
488
  buttonCodeList: '',
489
489
  tableStatus: '0',
490
+ formTableKey: 0,
490
491
  finalButtons: finalButtons,
491
492
  backReasonText: '', //驳回原因
492
493
  recoverReasonText: '', //收回原因
@@ -5288,6 +5289,9 @@ var PageHome = function (_React$Component) {
5288
5289
  key: 'refreshFormAfterOptlockConflict',
5289
5290
  value: function refreshFormAfterOptlockConflict() {
5290
5291
  var t = this;
5292
+ var savedComment = t.state.spyj || t.state.newspyj && t.state.newspyj.content || '';
5293
+ t._pendingCommentRestore = savedComment;
5294
+ t._pendingFormDataRestore = null;
5291
5295
  try {
5292
5296
  _Popup2.default.hide();
5293
5297
  } catch (e) {}
@@ -5296,9 +5300,18 @@ var PageHome = function (_React$Component) {
5296
5300
  _Dialog2.default.hide();
5297
5301
  }
5298
5302
  } catch (e2) {}
5299
- var savedComment = t.state.spyj || t.state.newspyj && t.state.newspyj.content || '';
5300
- t._pendingCommentRestore = savedComment;
5301
- t._pendingFormDataRestore = null;
5303
+ // 办理页是 pageStatus=1,冲突后必须先回到表单页(与取消办理一致)
5304
+ try {
5305
+ if (typeof t.handleCancelClick === 'function') {
5306
+ t.handleCancelClick();
5307
+ } else {
5308
+ t.setState({ pageStatus: '0', operate: 0 });
5309
+ }
5310
+ } catch (e3) {
5311
+ try {
5312
+ t.setState({ pageStatus: '0', operate: 0 });
5313
+ } catch (e4) {}
5314
+ }
5302
5315
  var param = {
5303
5316
  formId: t.state.formId,
5304
5317
  dataId: t.state.dataId,
@@ -5336,24 +5349,49 @@ var PageHome = function (_React$Component) {
5336
5349
  } else if (content.formData && content.formData.optlock !== undefined && content.formData.optlock !== null && content.formData.optlock !== '') {
5337
5350
  optlock = String(content.formData.optlock);
5338
5351
  }
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);
5352
+ // 注意:content.lock 是流程锁,与主表 optlock 无关;精简 getUndoTaskInfo 可能未带 optlock
5353
+ var afterBackToForm = function afterBackToForm() {
5354
+ // 再次确保仍在表单页(loadPage 异步后办理态可能残留)
5355
+ if (t.state.pageStatus !== '0') {
5356
+ t.setState({ pageStatus: '0', operate: 0 });
5357
+ }
5358
+ try {
5359
+ $(window).scrollTop(0);
5360
+ } catch (e5) {}
5348
5361
  _Toast2.default.show({
5349
5362
  type: 'error',
5350
5363
  content: '该表单已经被别人修改过,已刷新为最新版本,请核对后重新填写并提交',
5351
5364
  duration: 6000
5352
5365
  });
5353
- });
5366
+ };
5367
+ // 表单控件只在挂载时读展示值,必须先卸载再 loadPage,否则界面仍是旧显示值
5368
+ var remountAndReload = function remountAndReload(optlockVal) {
5369
+ if (optlockVal) {
5370
+ t._pendingForceOptlock = optlockVal;
5371
+ } else {
5372
+ t._pendingForceOptlock = null;
5373
+ }
5374
+ t.setState({
5375
+ formDataOptlock: optlockVal || '',
5376
+ pageStatus: '0',
5377
+ operate: 0,
5378
+ tableStatus: '0',
5379
+ formTableKey: (t.state.formTableKey || 0) + 1,
5380
+ loadSuccess: false
5381
+ }, function () {
5382
+ setTimeout(function () {
5383
+ t.loadPage(param);
5384
+ afterBackToForm();
5385
+ }, 50);
5386
+ });
5387
+ };
5388
+ remountAndReload(optlock);
5354
5389
  }).catch(function () {
5355
5390
  t._pendingCommentRestore = null;
5356
5391
  t._pendingForceOptlock = null;
5392
+ try {
5393
+ t.setState({ pageStatus: '0', operate: 0 });
5394
+ } catch (e6) {}
5357
5395
  _Toast2.default.show({ type: 'error', content: '刷新表单失败,请手动刷新页面' });
5358
5396
  });
5359
5397
  }
@@ -8790,7 +8828,7 @@ var PageHome = function (_React$Component) {
8790
8828
  _react2.default.createElement(
8791
8829
  _Group2.default.List,
8792
8830
  null,
8793
- this.state.tableStatus == '0' ? "" : _react2.default.createElement(_table2.default, { ref: 'approveFormTable', module: this.state.module, operate: this.state.operate, editType: this.state.editType, dataId: this.state.dataId, hasCommentField: t.state.hasCommentField, newspyj: t.state.newspyj, commentField: t.state.commentField, commentAttitude: t.state.commentAttitude, status: t.state.status, form: t.state.formItem, formStyleObj: t.state.formStyleObj, subColumnCount: t.state.subColumnCount, allForm: t.state.form, data: t.state.editFormData, commentFieldList: t.state.commentFieldList, defaultValue: t.state.defaultValue, commentDefaultList: t.state.commentDefaultList, commentBackList: t.state.commentBackList, fieldControll: t.state.fieldControll, caIsPrd: t.state.caIsPrd, preCaFields: t.state.preCaFields, formRelaField: t.state.formRelaField, isRemoveCommentFormHtml: t.state.isRemoveCommentFormHtml, commentUpload: t.state.commentUpload, isCaUser: t.state.isCaUser, caFirm: t.state.caFirm, caESignatureName: t.state.caESignatureName, caFormSign: t.state.caFormSign, inscriptionShow: t.state.inscriptionShow, onChange: this.change.bind(this) })
8831
+ this.state.tableStatus == '0' ? "" : _react2.default.createElement(_table2.default, { key: 'approveFormTable_' + this.state.formTableKey, ref: 'approveFormTable', module: this.state.module, operate: this.state.operate, editType: this.state.editType, dataId: this.state.dataId, hasCommentField: t.state.hasCommentField, newspyj: t.state.newspyj, commentField: t.state.commentField, commentAttitude: t.state.commentAttitude, status: t.state.status, form: t.state.formItem, formStyleObj: t.state.formStyleObj, subColumnCount: t.state.subColumnCount, allForm: t.state.form, data: t.state.editFormData, commentFieldList: t.state.commentFieldList, defaultValue: t.state.defaultValue, commentDefaultList: t.state.commentDefaultList, commentBackList: t.state.commentBackList, fieldControll: t.state.fieldControll, caIsPrd: t.state.caIsPrd, preCaFields: t.state.preCaFields, formRelaField: t.state.formRelaField, isRemoveCommentFormHtml: t.state.isRemoveCommentFormHtml, commentUpload: t.state.commentUpload, isCaUser: t.state.isCaUser, caFirm: t.state.caFirm, caESignatureName: t.state.caESignatureName, caFormSign: t.state.caFormSign, inscriptionShow: t.state.inscriptionShow, onChange: this.change.bind(this) })
8794
8832
  )
8795
8833
  )
8796
8834
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.3.44",
3
+ "version": "2.3.45",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",