fmui-base 2.3.13 → 2.3.14

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.14:表单切换组织增加开关
6
7
  - 2.3.13:子表字段带$时计算不生效,表单切换组织时,表单赋值的宏值实时更新
7
8
  - 2.3.12:门户首页grid常用应用部件增加扩展入口调整为页签(一网通办项目需求,临时版本)
8
9
  - 2.3.11:子表支持子表按钮自定义
@@ -517,7 +517,7 @@ var PageHome = function (_React$Component) {
517
517
  selectProcessCode: '', //选中的子流程
518
518
  subProcessType: '', //子流程类型 0串行 1并行
519
519
  urgencyList: [], //紧急程度列表
520
- urgency: '' }, _defineProperty(_param, 'urgent', ''), _defineProperty(_param, 'backInitiatorEndFlow', '0'), _defineProperty(_param, 'oauthWindowURL', ''), _defineProperty(_param, 'signDataId', ''), _defineProperty(_param, 'isCaUser', '0'), _defineProperty(_param, 'caFirm', ''), _defineProperty(_param, 'caESignatureName', ''), _defineProperty(_param, 'caFormSign', ''), _defineProperty(_param, 'addlotsReturn', ''), _defineProperty(_param, 'inscriptionShow', ''), _defineProperty(_param, 'showOrgSwitcher', false), _defineProperty(_param, 'approveOrgOptions', []), _defineProperty(_param, 'approveOrgSelectValue', {}), _defineProperty(_param, 'approveCurOrgId', ''), _defineProperty(_param, 'startUserOrgId', ''), _defineProperty(_param, 'taskAssignOrgId', ''), _defineProperty(_param, 'approveOrgApiUnavailable', false), _param);
520
+ urgency: '' }, _defineProperty(_param, 'urgent', ''), _defineProperty(_param, 'backInitiatorEndFlow', '0'), _defineProperty(_param, 'oauthWindowURL', ''), _defineProperty(_param, 'signDataId', ''), _defineProperty(_param, 'isCaUser', '0'), _defineProperty(_param, 'caFirm', ''), _defineProperty(_param, 'caESignatureName', ''), _defineProperty(_param, 'caFormSign', ''), _defineProperty(_param, 'addlotsReturn', ''), _defineProperty(_param, 'inscriptionShow', ''), _defineProperty(_param, 'showOrgSwitcher', false), _defineProperty(_param, 'approveOrgOptions', []), _defineProperty(_param, 'approveOrgSelectValue', {}), _defineProperty(_param, 'approveFormParttimeOrgEnabled', true), _defineProperty(_param, 'approveCurOrgId', ''), _defineProperty(_param, 'startUserOrgId', ''), _defineProperty(_param, 'taskAssignOrgId', ''), _defineProperty(_param, 'approveOrgApiUnavailable', false), _param);
521
521
  FlowCommon = require('pages/flow_common/' + module).default ? require('pages/flow_common/' + module).default : require('pages/flow_common/' + module);
522
522
 
523
523
  //处理特有参数
@@ -7638,10 +7638,18 @@ var PageHome = function (_React$Component) {
7638
7638
  value: org.id
7639
7639
  };
7640
7640
  }
7641
+
7642
+ /** 流程设置「表单切换兼职组织」是否启用,默认启用(仅明确为 0 时禁用) */
7643
+
7644
+ }, {
7645
+ key: 'isApproveFormParttimeOrgEnabled',
7646
+ value: function isApproveFormParttimeOrgEnabled() {
7647
+ return this.state.approveFormParttimeOrgEnabled !== false;
7648
+ }
7641
7649
  }, {
7642
7650
  key: 'renderApproveOrgSwitcher',
7643
7651
  value: function renderApproveOrgSwitcher(orgList, selectedOrgId) {
7644
- if (!orgList || orgList.length <= 1) {
7652
+ if (!this.isApproveFormParttimeOrgEnabled() || !orgList || orgList.length <= 1) {
7645
7653
  this.setState({
7646
7654
  showOrgSwitcher: false,
7647
7655
  approveOrgOptions: [],
@@ -7686,44 +7694,85 @@ var PageHome = function (_React$Component) {
7686
7694
  if (!window.approveOrgAutoSwitchedMap) {
7687
7695
  window.approveOrgAutoSwitchedMap = {};
7688
7696
  }
7689
- _db2.default.FlowModuleAPI.getUserSetInfo({}).then(function (userInfo) {
7690
- if (currentSeq != window.approveOrgSwitcherSeq || t.state.approveOrgApiUnavailable) {
7691
- return;
7692
- }
7693
- if (!userInfo) {
7694
- t.hideApproveOrgSwitcherSilently();
7695
- return;
7696
- }
7697
- if (userInfo.content && !userInfo.orgList) {
7698
- userInfo = userInfo.content;
7699
- }
7700
- var orgList = userInfo.orgList || [];
7701
- if (!orgList || orgList.length <= 1) {
7702
- t.setState({ showOrgSwitcher: false });
7703
- return;
7704
- }
7705
- var curOrgId = userInfo.curOrgId || '';
7706
- var targetOrgId = t.resolveApproveOrgTargetId(orgList, curOrgId, t.state.taskAssignOrgId, t.state.startUserOrgId);
7707
- if (targetOrgId && targetOrgId != curOrgId && !window.approveOrgAutoSwitchedMap[autoSwitchKey]) {
7708
- t.switchApproveOrg(targetOrgId, function () {
7709
- if (currentSeq != window.approveOrgSwitcherSeq) {
7710
- return;
7711
- }
7712
- window.approveOrgAutoSwitchedMap[autoSwitchKey] = true;
7713
- t.renderApproveOrgSwitcher(orgList, targetOrgId);
7714
- }, function () {
7715
- if (currentSeq != window.approveOrgSwitcherSeq) {
7716
- return;
7697
+ // 先读取流程设置「表单切换兼职组织」(默认启用)
7698
+ var loadOrgSwitcher = function loadOrgSwitcher(parttimeOrgEnabled) {
7699
+ t.setState({ approveFormParttimeOrgEnabled: parttimeOrgEnabled !== false });
7700
+ _db2.default.FlowModuleAPI.getUserSetInfo({}).then(function (userInfo) {
7701
+ if (currentSeq != window.approveOrgSwitcherSeq || t.state.approveOrgApiUnavailable) {
7702
+ return;
7703
+ }
7704
+ if (!userInfo) {
7705
+ t.hideApproveOrgSwitcherSilently();
7706
+ return;
7707
+ }
7708
+ if (userInfo.content && !userInfo.orgList) {
7709
+ userInfo = userInfo.content;
7710
+ }
7711
+ var orgList = userInfo.orgList || [];
7712
+ var showSwitcher = parttimeOrgEnabled !== false && orgList && orgList.length > 1;
7713
+ if (!orgList || orgList.length == 0 || !showSwitcher) {
7714
+ // 开关禁用但有兼职时,仍可静默切到目标组织,仅隐藏切换区
7715
+ if (orgList && orgList.length > 1 && parttimeOrgEnabled === false) {
7716
+ var curOrgIdHide = userInfo.curOrgId || '';
7717
+ var hideTargetOrgId = t.resolveApproveOrgTargetId(orgList, curOrgIdHide, t.state.taskAssignOrgId, t.state.startUserOrgId);
7718
+ if (hideTargetOrgId && hideTargetOrgId != curOrgIdHide && !window.approveOrgAutoSwitchedMap[autoSwitchKey]) {
7719
+ t.switchApproveOrg(hideTargetOrgId, function () {
7720
+ if (currentSeq != window.approveOrgSwitcherSeq) {
7721
+ return;
7722
+ }
7723
+ window.approveOrgAutoSwitchedMap[autoSwitchKey] = true;
7724
+ t.setState({ showOrgSwitcher: false });
7725
+ }, function () {
7726
+ if (currentSeq != window.approveOrgSwitcherSeq) {
7727
+ return;
7728
+ }
7729
+ t.setState({ showOrgSwitcher: false });
7730
+ }, { silent: true });
7731
+ return;
7732
+ }
7717
7733
  }
7734
+ t.setState({ showOrgSwitcher: false });
7735
+ return;
7736
+ }
7737
+ var curOrgId = userInfo.curOrgId || '';
7738
+ var targetOrgId = t.resolveApproveOrgTargetId(orgList, curOrgId, t.state.taskAssignOrgId, t.state.startUserOrgId);
7739
+ if (targetOrgId && targetOrgId != curOrgId && !window.approveOrgAutoSwitchedMap[autoSwitchKey]) {
7740
+ t.switchApproveOrg(targetOrgId, function () {
7741
+ if (currentSeq != window.approveOrgSwitcherSeq) {
7742
+ return;
7743
+ }
7744
+ window.approveOrgAutoSwitchedMap[autoSwitchKey] = true;
7745
+ t.renderApproveOrgSwitcher(orgList, targetOrgId);
7746
+ }, function () {
7747
+ if (currentSeq != window.approveOrgSwitcherSeq) {
7748
+ return;
7749
+ }
7750
+ t.hideApproveOrgSwitcherSilently();
7751
+ }, { silent: true });
7752
+ return;
7753
+ }
7754
+ t.renderApproveOrgSwitcher(orgList, targetOrgId || curOrgId);
7755
+ }).catch(function (err) {
7756
+ if (currentSeq == window.approveOrgSwitcherSeq) {
7718
7757
  t.hideApproveOrgSwitcherSilently();
7719
- }, { silent: true });
7758
+ }
7759
+ });
7760
+ };
7761
+ _db2.default.FlowModuleAPI.getSysSettingByMark({ mark: 'approveFormParttimeOrg' }).then(function (content) {
7762
+ if (currentSeq != window.approveOrgSwitcherSeq) {
7720
7763
  return;
7721
7764
  }
7722
- t.renderApproveOrgSwitcher(orgList, targetOrgId || curOrgId);
7723
- }).catch(function (err) {
7724
- if (currentSeq == window.approveOrgSwitcherSeq) {
7725
- t.hideApproveOrgSwitcherSilently();
7765
+ var val = content;
7766
+ if (content && (typeof content === 'undefined' ? 'undefined' : _typeof(content)) === 'object' && content.content != null) {
7767
+ val = content.content;
7768
+ }
7769
+ // 默认启用:仅明确为 '0' 时禁用
7770
+ loadOrgSwitcher(val != '0');
7771
+ }).catch(function () {
7772
+ if (currentSeq != window.approveOrgSwitcherSeq) {
7773
+ return;
7726
7774
  }
7775
+ loadOrgSwitcher(true);
7727
7776
  });
7728
7777
  }
7729
7778
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.3.13",
3
+ "version": "2.3.14",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",