fmui-base 2.3.20 → 2.3.22

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.22:排他网关支持直接连其他网关
7
+ - 2.3.21:移动端切换组织时支持重新加载当前组织选人字段
6
8
  - 2.3.20:移动端流程表单选人字段默认值支持选择当前用户,当前用户组织,与宏值逻辑一致
7
9
  - 2.3.19:移动端流程表单支持在线编辑
8
10
  - 2.3.18:流程抢占加签支持加签多人,流程表单支持在线编辑
package/lib/form/form.js CHANGED
@@ -3756,16 +3756,20 @@ var PageHome = function (_React$Component) {
3756
3756
  var t = this;
3757
3757
  var ctx = t.buildOfficeCtx();
3758
3758
  ctx.mode = mode || 'edit';
3759
- // 可编辑入口二次校验:仅 wpsWebOffice
3759
+ // 可编辑入口:进页已解析为 wps 时不再二次 resolveType(企微 location.href 卸页易导致请求 abort → 误弹「无法识别正文类型」)
3760
3760
  if (mode !== 'preview' && ctx.mode !== 'preview' && !ctx.readOnly) {
3761
+ if (t.state.mobileOfficeResolved && t.state.mobileOfficeAllowEdit) {
3762
+ MobileOffice.open(ctx);
3763
+ return;
3764
+ }
3761
3765
  MobileOffice.resolveType(ctx).then(function (resolved) {
3762
3766
  if (!t.isMobileWpsWebOffice(resolved)) {
3763
3767
  _Toast2.default.show({ content: '移动端暂仅支持 WPS 中台在线编辑,请到 PC 端操作' });
3764
3768
  return;
3765
3769
  }
3766
3770
  MobileOffice.open(ctx);
3767
- }).catch(function () {
3768
- _Toast2.default.show({ content: '无法识别正文类型' });
3771
+ }).catch(function (err) {
3772
+ console.error('[openWeboffice] resolveType failed', err);
3769
3773
  });
3770
3774
  return;
3771
3775
  }
@@ -667,6 +667,7 @@ var PageHome = function (_React$Component) {
667
667
  checkedItem.must = item.must;
668
668
  checkedItem.maxOutgoing = maxOutgoing;
669
669
  checkedItem.participants = participants;
670
+ checkedItem.parallelGatewayId = item.parallelGatewayId;
670
671
  if (item.must == true && (maxOutgoing == 1 && checkActi == 0 || maxOutgoing == 0)) {
671
672
  //必须
672
673
  checkedItem.disable = false;
@@ -702,6 +703,14 @@ var PageHome = function (_React$Component) {
702
703
  //如果没有默认选中的下一个节点且是单选,则第一个默认选中
703
704
  if (nextActivityList.length > 0 && nextRadomList.length == 0) {
704
705
  nextActivityList[0].checked = true;
706
+ var pgFirst = nextActivityList[0].parallelGatewayId;
707
+ if (pgFirst) {
708
+ for (var pgi = 0; pgi < nextActivityList.length; pgi++) {
709
+ if (nextActivityList[pgi].parallelGatewayId == pgFirst) {
710
+ nextActivityList[pgi].checked = true;
711
+ }
712
+ }
713
+ }
705
714
  //nextSelectType = 'next';
706
715
  } else if (nextRadomList.length > 0 && nextActivityList.length == 0) {
707
716
  nextRadomList[0].subRandomList[0].checked = true;
@@ -1369,11 +1378,16 @@ var PageHome = function (_React$Component) {
1369
1378
  //单选
1370
1379
  if (!checked) {
1371
1380
  //选中的时候
1381
+ var pgId = item.parallelGatewayId;
1372
1382
  for (var j = 0; j < nextActivityList.length; j++) {
1373
1383
  if (nextActivityList[j].disable == true) {
1374
1384
  return false;
1375
1385
  }
1376
1386
  if (nextActivityList[j].isRadio) {
1387
+ // 排他下并行同组不能互相取消
1388
+ if (pgId && nextActivityList[j].parallelGatewayId == pgId) {
1389
+ continue;
1390
+ }
1377
1391
  if (type == 'radom') {
1378
1392
  if (maxOutgoing == 1 || value == nextActivityList[j].value) {
1379
1393
  nextActivityList[j].checked = false;
@@ -1384,6 +1398,13 @@ var PageHome = function (_React$Component) {
1384
1398
  }
1385
1399
  }
1386
1400
  nextActivityList[i].checked = !checked;
1401
+ if (pgId) {
1402
+ for (var j = 0; j < nextActivityList.length; j++) {
1403
+ if (nextActivityList[j].parallelGatewayId == pgId) {
1404
+ nextActivityList[j].checked = true;
1405
+ }
1406
+ }
1407
+ }
1387
1408
  if (checked == false && item.end == false) {
1388
1409
  //当选中时
1389
1410
  this.refs[item.value + "_" + i].clickAdd();
@@ -1394,6 +1415,14 @@ var PageHome = function (_React$Component) {
1394
1415
  return false;
1395
1416
  } else {
1396
1417
  nextActivityList[i].checked = !checked;
1418
+ var pgIdUn = item.parallelGatewayId;
1419
+ if (pgIdUn) {
1420
+ for (var j = 0; j < nextActivityList.length; j++) {
1421
+ if (nextActivityList[j].parallelGatewayId == pgIdUn) {
1422
+ nextActivityList[j].checked = false;
1423
+ }
1424
+ }
1425
+ }
1397
1426
  }
1398
1427
  }
1399
1428
  } else {
@@ -1403,6 +1432,14 @@ var PageHome = function (_React$Component) {
1403
1432
  // return false;
1404
1433
  // }else{
1405
1434
  nextActivityList[i].checked = !checked;
1435
+ var pgIdCk = item.parallelGatewayId;
1436
+ if (pgIdCk) {
1437
+ for (var j = 0; j < nextActivityList.length; j++) {
1438
+ if (nextActivityList[j].parallelGatewayId == pgIdCk) {
1439
+ nextActivityList[j].checked = true;
1440
+ }
1441
+ }
1442
+ }
1406
1443
  if (checked == false && item.end == false) {
1407
1444
  //当选中时
1408
1445
  this.refs[item.value + "_" + i].clickAdd();
@@ -1426,6 +1463,14 @@ var PageHome = function (_React$Component) {
1426
1463
  return false;
1427
1464
  }
1428
1465
  nextActivityList[i].checked = !checked;
1466
+ var pgIdCkUn = item.parallelGatewayId;
1467
+ if (pgIdCkUn) {
1468
+ for (var j = 0; j < nextActivityList.length; j++) {
1469
+ if (nextActivityList[j].parallelGatewayId == pgIdCkUn) {
1470
+ nextActivityList[j].checked = false;
1471
+ }
1472
+ }
1473
+ }
1429
1474
  }
1430
1475
  }
1431
1476
  }
@@ -1761,7 +1806,12 @@ var PageHome = function (_React$Component) {
1761
1806
  _react2.default.createElement(
1762
1807
  Box,
1763
1808
  { className: 't-LH24 t-FS16 t-PL18 t-omit', flex: 1 },
1764
- item.name
1809
+ item.name,
1810
+ item.parallelGatewayId ? _react2.default.createElement(
1811
+ 'span',
1812
+ { className: 't-FCc t-FS12' },
1813
+ '\uFF08\u5E76\u884C\uFF09'
1814
+ ) : null
1765
1815
  )
1766
1816
  ),
1767
1817
  _react2.default.createElement(
@@ -2862,6 +2862,7 @@ var PageHome = function (_React$Component) {
2862
2862
  checkedItem.participants = participants;
2863
2863
  checkedItem.level = item.level;
2864
2864
  checkedItem.maxOutgoing = maxOutgoing;
2865
+ checkedItem.parallelGatewayId = item.parallelGatewayId;
2865
2866
  if (item.must == true && (maxOutgoing == 1 && checkActi == 0 || maxOutgoing == 0)) {
2866
2867
  //必须
2867
2868
  checkedItem.disable = false;
@@ -2897,6 +2898,14 @@ var PageHome = function (_React$Component) {
2897
2898
  //如果没有默认选中的下一个节点且是单选,则第一个默认选中
2898
2899
  if (nextActivityList.length > 0 && nextRadomList.length == 0) {
2899
2900
  nextActivityList[0].checked = true;
2901
+ var pgFirst = nextActivityList[0].parallelGatewayId;
2902
+ if (pgFirst) {
2903
+ for (var pgi = 0; pgi < nextActivityList.length; pgi++) {
2904
+ if (nextActivityList[pgi].parallelGatewayId == pgFirst) {
2905
+ nextActivityList[pgi].checked = true;
2906
+ }
2907
+ }
2908
+ }
2900
2909
  //nextSelectType = 'next';
2901
2910
  } else if (nextRadomList.length > 0 && nextActivityList.length == 0) {
2902
2911
  nextRadomList[0].subRandomList[0].checked = true;
@@ -7344,11 +7353,16 @@ var PageHome = function (_React$Component) {
7344
7353
  //单选
7345
7354
  if (!checked) {
7346
7355
  //选中的时候
7356
+ var pgId = item.parallelGatewayId;
7347
7357
  for (var j = 0; j < nextActivityList.length; j++) {
7348
7358
  if (nextActivityList[j].disable == true) {
7349
7359
  return false;
7350
7360
  }
7351
7361
  if (nextActivityList[j].isRadio) {
7362
+ // 排他下并行同组不能互相取消
7363
+ if (pgId && nextActivityList[j].parallelGatewayId == pgId) {
7364
+ continue;
7365
+ }
7352
7366
  if (type == 'radom') {
7353
7367
  if (maxOutgoing == 1 || value == nextActivityList[j].value) {
7354
7368
  nextActivityList[j].checked = false;
@@ -7359,6 +7373,13 @@ var PageHome = function (_React$Component) {
7359
7373
  }
7360
7374
  }
7361
7375
  nextActivityList[i].checked = !checked;
7376
+ if (pgId) {
7377
+ for (var j = 0; j < nextActivityList.length; j++) {
7378
+ if (nextActivityList[j].parallelGatewayId == pgId) {
7379
+ nextActivityList[j].checked = true;
7380
+ }
7381
+ }
7382
+ }
7362
7383
  if (checked == false && item.end == false) {//当选中时
7363
7384
  // this.refs[item.value+"_"+i].clickAdd();
7364
7385
  }
@@ -7368,6 +7389,14 @@ var PageHome = function (_React$Component) {
7368
7389
  return false;
7369
7390
  } else {
7370
7391
  nextActivityList[i].checked = !checked;
7392
+ var pgIdUn = item.parallelGatewayId;
7393
+ if (pgIdUn) {
7394
+ for (var j = 0; j < nextActivityList.length; j++) {
7395
+ if (nextActivityList[j].parallelGatewayId == pgIdUn) {
7396
+ nextActivityList[j].checked = false;
7397
+ }
7398
+ }
7399
+ }
7371
7400
  }
7372
7401
  }
7373
7402
  } else {
@@ -7377,6 +7406,14 @@ var PageHome = function (_React$Component) {
7377
7406
  // return false;
7378
7407
  // }else{
7379
7408
  nextActivityList[i].checked = !checked;
7409
+ var pgIdCk = item.parallelGatewayId;
7410
+ if (pgIdCk) {
7411
+ for (var j = 0; j < nextActivityList.length; j++) {
7412
+ if (nextActivityList[j].parallelGatewayId == pgIdCk) {
7413
+ nextActivityList[j].checked = true;
7414
+ }
7415
+ }
7416
+ }
7380
7417
  if (checked == false && item.end == false) {} //当选中时
7381
7418
  // this.refs[item.value+"_"+i].clickAdd();
7382
7419
 
@@ -7399,6 +7436,14 @@ var PageHome = function (_React$Component) {
7399
7436
  return false;
7400
7437
  }
7401
7438
  nextActivityList[i].checked = !checked;
7439
+ var pgIdCkUn = item.parallelGatewayId;
7440
+ if (pgIdCkUn) {
7441
+ for (var j = 0; j < nextActivityList.length; j++) {
7442
+ if (nextActivityList[j].parallelGatewayId == pgIdCkUn) {
7443
+ nextActivityList[j].checked = false;
7444
+ }
7445
+ }
7446
+ }
7402
7447
  }
7403
7448
  }
7404
7449
  }
@@ -7822,6 +7867,23 @@ var PageHome = function (_React$Component) {
7822
7867
  if (!fieldMap || Object.keys(fieldMap).length == 0) {
7823
7868
  return;
7824
7869
  }
7870
+ var isPopuserVal = function isPopuserVal(v) {
7871
+ return v && (typeof v === 'undefined' ? 'undefined' : _typeof(v)) == 'object' && !Array.isArray(v) && (v.type == 'popuser' || v.defaultUserScopeJson);
7872
+ };
7873
+ var parsePopDefault = function parsePopDefault(popVal) {
7874
+ if (!popVal) {
7875
+ return null;
7876
+ }
7877
+ var json = popVal.defaultUserScopeJson;
7878
+ if (typeof json == 'string') {
7879
+ try {
7880
+ return JSON.parse(json);
7881
+ } catch (e) {
7882
+ return null;
7883
+ }
7884
+ }
7885
+ return json || null;
7886
+ };
7825
7887
  var editFormData = t.state.editFormData || {};
7826
7888
  var mainTblData = editFormData.mainTblData || [];
7827
7889
  var mainTblName = editFormData.mainTblName || t.state.form && t.state.form.formTblName || '';
@@ -7849,9 +7911,10 @@ var PageHome = function (_React$Component) {
7849
7911
  } else if (mainTblName && mapKey.indexOf(mainTblName + '$') === 0) {
7850
7912
  itemCode = mapKey.substring(mainTblName.length + 1);
7851
7913
  }
7914
+ var storeVal = isPopuserVal(newVal) ? '' : newVal;
7852
7915
  for (var i = 0; i < mainTblData.length; i++) {
7853
7916
  if (mainTblData[i].key == itemCode || mainTblData[i].key == mapKey) {
7854
- mainTblData[i].value = newVal;
7917
+ mainTblData[i].value = storeVal;
7855
7918
  }
7856
7919
  }
7857
7920
  // 可编辑 / 只读字段均通过 Form.reloadItemParam 刷新展示
@@ -7874,7 +7937,12 @@ var PageHome = function (_React$Component) {
7874
7937
  continue;
7875
7938
  }
7876
7939
  try {
7877
- formRef.reloadItemParam([{ key: 'value', value: newVal }]);
7940
+ if (isPopuserVal(newVal)) {
7941
+ var popDefault = parsePopDefault(newVal);
7942
+ formRef.reloadItemParam([{ key: 'value', value: '' }, { key: 'defaultValue', value: popDefault }]);
7943
+ } else {
7944
+ formRef.reloadItemParam([{ key: 'value', value: newVal }]);
7945
+ }
7878
7946
  // 只读 TextField 偶发不跟 props,强制再刷一次
7879
7947
  if (typeof formRef.forceUpdate === 'function') {
7880
7948
  formRef.forceUpdate();
@@ -7898,8 +7966,23 @@ var PageHome = function (_React$Component) {
7898
7966
  }
7899
7967
  var mv = resolveMacroVal(it);
7900
7968
  if (typeof mv != 'undefined') {
7901
- it.defaultValue = mv;
7902
- it.value = mv;
7969
+ if (isPopuserVal(mv)) {
7970
+ var popDefault = parsePopDefault(mv);
7971
+ it.value = '';
7972
+ it.defaultValue = popDefault;
7973
+ if (!it.popuserMap) {
7974
+ it.popuserMap = {};
7975
+ }
7976
+ it.popuserMap.defaultUserScopeJson = mv.defaultUserScopeJson;
7977
+ it.popuserMap.defaultScopeName = mv.scopeName;
7978
+ it.popuserMap.defaultScopeValue = mv.scopeValue;
7979
+ if (mv.defaultType) {
7980
+ it.popuserMap.defaultType = mv.defaultType;
7981
+ }
7982
+ } else {
7983
+ it.defaultValue = mv;
7984
+ it.value = mv;
7985
+ }
7903
7986
  }
7904
7987
  if (it.children && it.children.length) {
7905
7988
  syncDefault(it.children);
@@ -8549,7 +8632,12 @@ var PageHome = function (_React$Component) {
8549
8632
  _react2.default.createElement(
8550
8633
  Box,
8551
8634
  { className: 't-LH24 t-FS16 t-PL18 t-omit', flex: 1 },
8552
- item.name
8635
+ item.name,
8636
+ item.parallelGatewayId ? _react2.default.createElement(
8637
+ 'span',
8638
+ { className: 't-FCc t-FS12' },
8639
+ '\uFF08\u5E76\u884C\uFF09'
8640
+ ) : null
8553
8641
  )
8554
8642
  ),
8555
8643
  _react2.default.createElement(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.3.20",
3
+ "version": "2.3.22",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",