fmui-base 2.3.11 → 2.3.13

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.13:子表字段带$时计算不生效,表单切换组织时,表单赋值的宏值实时更新
7
+ - 2.3.12:门户首页grid常用应用部件增加扩展入口调整为页签(一网通办项目需求,临时版本)
6
8
  - 2.3.11:子表支持子表按钮自定义
7
9
  - 2.3.10:门户首页grid常用应用部件增加扩展入口(一网通办项目需求,临时版本)
8
10
  - 2.3.9:子表支持整个子表隐藏
package/lib/db/db.js CHANGED
@@ -1140,6 +1140,16 @@ context.create('FlowModuleAPI', {
1140
1140
  Authorization: 'Bearer ' + getLoginUserInfo().token
1141
1141
  },
1142
1142
  willFetch: function willFetch() {}
1143
+ },
1144
+ reloadFuzhiMacroFields: {
1145
+ mockUrl: 'query/reloadFuzhiMacroFields.json',
1146
+ url: _variables2.default.URLS.reloadFuzhiMacroFields,
1147
+ method: 'POST',
1148
+ postDataFomat: 'FORM',
1149
+ header: {
1150
+ Authorization: 'Bearer ' + getLoginUserInfo().token
1151
+ },
1152
+ willFetch: function willFetch() {}
1143
1153
  }
1144
1154
 
1145
1155
  });
@@ -143,7 +143,8 @@ exports.default = {
143
143
  getSysSettingByMark: approveUrlPrefix + "getSysSettingByMark" + '?', //获取系统设置
144
144
  getUserSetInfo: urlBasicPrefix + 'setting/userinfo/getUserSetInfo' + '?', //获取用户组织信息
145
145
  orgSwitch: urlBasicPrefix + 'front/personal/orgSwitch' + '?', //切换组织
146
- updateStartUserOrg: approveUrlPrefix + 'updateStartUserOrg' + '?' //更新发起人组织
146
+ updateStartUserOrg: approveUrlPrefix + 'updateStartUserOrg' + '?', //更新发起人组织
147
+ reloadFuzhiMacroFields: approveUrlPrefix + 'reloadFuzhiMacroFields' + '?' //组织切换后重载赋值宏值
147
148
  },
148
149
  nodataIcon: context + "/mobile/fmui/images/noData.png",
149
150
  loadingIcon: context + "/mobile/fmui/images/loading.gif",
package/lib/form/form.js CHANGED
@@ -2109,8 +2109,9 @@ var PageHome = function (_React$Component) {
2109
2109
  }
2110
2110
  }
2111
2111
  }
2112
+ // 浅拷贝强制触发重渲染(只读 TextField 同引用时可能不刷新展示)
2112
2113
  this.setState({
2113
- itemParam: itemParam
2114
+ itemParam: Object.assign({}, itemParam)
2114
2115
  }, function () {
2115
2116
  if (checkboxValueHas) {
2116
2117
  this.refs["checkbox_" + itemParam.tableName + "_" + itemParam.key].setState({
package/lib/form/table.js CHANGED
@@ -1973,17 +1973,17 @@ var PageHome = function (_React$Component) {
1973
1973
  filedItemValue = 0;
1974
1974
  //return false;
1975
1975
  }
1976
- var sumRegExp = new RegExp("sum\\(\\[" + fieldArrayItem + "\\]\\)", "g");
1976
+ var sumRegExp = new RegExp("sum\\(\\[" + this.replaceDollar(fieldArrayItem) + "\\]\\)", "g");
1977
1977
 
1978
1978
  if (exp.match(sumRegExp)) {
1979
1979
  //当有sum函数
1980
1980
  if (Array.isArray(fieldItem)) {
1981
1981
  var sumValue = this.sum(fieldItem);
1982
- exp = exp.replace(new RegExp("sum\\(\\[" + fieldArrayItem + "\\]\\)", "g"), "(" + sumValue + ")");
1982
+ exp = exp.replace(new RegExp("sum\\(\\[" + this.replaceDollar(fieldArrayItem) + "\\]\\)", "g"), "(" + sumValue + ")");
1983
1983
  }
1984
1984
  }
1985
1985
 
1986
- exp = exp.replace(new RegExp("\\[" + fieldArrayItem + "\\]", "g"), "(" + filedItemValue + ")");
1986
+ exp = exp.replace(new RegExp("\\[" + this.replaceDollar(fieldArrayItem) + "\\]", "g"), "(" + filedItemValue + ")");
1987
1987
  }
1988
1988
  }
1989
1989
 
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
8
+
7
9
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8
10
 
9
11
  var _react = require('react');
@@ -391,6 +393,7 @@ var PageHome = function (_React$Component) {
391
393
  dataId: dataId,
392
394
  formId: props.formId,
393
395
  editFormData: {},
396
+ formDataOptlock: '',
394
397
  formDataNew: {},
395
398
  data: {
396
399
  dataId: "",
@@ -1471,6 +1474,7 @@ var PageHome = function (_React$Component) {
1471
1474
  // }
1472
1475
  t.setState({
1473
1476
  editFormData: formData,
1477
+ formDataOptlock: formData && formData.optlock !== undefined && formData.optlock !== null && formData.optlock !== '' ? String(formData.optlock) : '',
1474
1478
  //formDataNew:content.formDataNew,
1475
1479
  // formData: formData,
1476
1480
  // fileContent: fileContent,
@@ -2497,6 +2501,9 @@ var PageHome = function (_React$Component) {
2497
2501
  processInstanceId: _this2.state.processInstanceId,
2498
2502
  permissionCode: _this2.state.permissionCode
2499
2503
  };
2504
+ if (t.state.formDataOptlock !== '' && t.state.formDataOptlock !== null && typeof t.state.formDataOptlock !== 'undefined') {
2505
+ param.optlock = t.state.formDataOptlock;
2506
+ }
2500
2507
  var dealActionName = "";
2501
2508
  if (_this2.state.isStart == true) {
2502
2509
  dealActionName = "提交";
@@ -4676,6 +4683,9 @@ var PageHome = function (_React$Component) {
4676
4683
  formType: "4",
4677
4684
  editType: editType
4678
4685
  }, _defineProperty(_param2, 'module', t.state.module), _defineProperty(_param2, 'comment', newComment), _defineProperty(_param2, 'commentType', 'text'), _defineProperty(_param2, 'commentId', t.state.commentId), _defineProperty(_param2, 'commentAttitude', t.getSelectedCommentAttitude()), _defineProperty(_param2, 'attachId', t.state.commentAttachId), _defineProperty(_param2, 'sealId', t.state.commentSealId), _defineProperty(_param2, 'permissionCode', t.state.permissionCode), _defineProperty(_param2, 'hasCommentField', t.state.hasCommentField), _defineProperty(_param2, 'dataId', dataId), _param2);
4686
+ if (t.state.formDataOptlock !== '' && t.state.formDataOptlock !== null && typeof t.state.formDataOptlock !== 'undefined') {
4687
+ param.optlock = t.state.formDataOptlock;
4688
+ }
4679
4689
  var commentbizSn = t.guid2();
4680
4690
  if (param.commentId && param.commentId != "" && param.commentId != null && typeof param.commentId != "undefined") {
4681
4691
  commentbizSn = param.commentId;
@@ -4689,6 +4699,12 @@ var PageHome = function (_React$Component) {
4689
4699
  type: 'success',
4690
4700
  content: '保存成功'
4691
4701
  });
4702
+ if (t.state.formDataOptlock !== '' && t.state.formDataOptlock !== null) {
4703
+ var ol = parseInt(t.state.formDataOptlock, 10);
4704
+ if (!isNaN(ol)) {
4705
+ t.setState({ formDataOptlock: String(ol + 1) });
4706
+ }
4707
+ }
4692
4708
 
4693
4709
  var dataId = content.dataId;
4694
4710
  //操作回调
@@ -5082,6 +5098,9 @@ var PageHome = function (_React$Component) {
5082
5098
  // param.commentbizSn=commentbizSn;
5083
5099
  // }
5084
5100
  param.commentbizSn = commentbizSn;
5101
+ if (t.state.formDataOptlock !== '' && t.state.formDataOptlock !== null && typeof t.state.formDataOptlock !== 'undefined') {
5102
+ param.optlock = t.state.formDataOptlock;
5103
+ }
5085
5104
 
5086
5105
  var db = _db2.default;
5087
5106
  db.FlowModuleAPI.sendFlow(param).then(function (content) {
@@ -7728,6 +7747,9 @@ var PageHome = function (_React$Component) {
7728
7747
  approveCurOrgId: newOrgId,
7729
7748
  approveOrgSelectValue: value,
7730
7749
  startUserOrgId: t.isApproveStartOrgUpdateScene() ? newOrgId : t.state.startUserOrgId
7750
+ }, function () {
7751
+ // 用户手动切换组织后,重载赋值宏值字段
7752
+ t.reloadFuzhiMacroFieldsByOrg();
7731
7753
  });
7732
7754
  }, function () {
7733
7755
  t.setState({
@@ -7736,6 +7758,122 @@ var PageHome = function (_React$Component) {
7736
7758
  });
7737
7759
  });
7738
7760
  }
7761
+
7762
+ /** 所属组织切换后,按当前组织重载赋值宏值字段并写回表单 */
7763
+
7764
+ }, {
7765
+ key: 'reloadFuzhiMacroFieldsByOrg',
7766
+ value: function reloadFuzhiMacroFieldsByOrg() {
7767
+ var t = this;
7768
+ var fuzhiFields = '';
7769
+ if (t.state.fieldControll && t.state.fieldControll.fuzhiFields) {
7770
+ fuzhiFields = t.state.fieldControll.fuzhiFields;
7771
+ }
7772
+ if (!fuzhiFields || fuzhiFields == 'null' || fuzhiFields == 'undefined' || !t.state.formId) {
7773
+ return;
7774
+ }
7775
+ _db2.default.FlowModuleAPI.reloadFuzhiMacroFields({
7776
+ formId: t.state.formId,
7777
+ fuzhiFields: fuzhiFields
7778
+ }).then(function (content) {
7779
+ var fieldMap = content || {};
7780
+ if (content && content.content && _typeof(content.content) === 'object' && !Array.isArray(content.content)) {
7781
+ fieldMap = content.content;
7782
+ }
7783
+ if (!fieldMap || Object.keys(fieldMap).length == 0) {
7784
+ return;
7785
+ }
7786
+ var editFormData = t.state.editFormData || {};
7787
+ var mainTblData = editFormData.mainTblData || [];
7788
+ var mainTblName = editFormData.mainTblName || t.state.form && t.state.form.formTblName || '';
7789
+ var tableRef = t.refs.approveFormTable;
7790
+ var resolveMacroVal = function resolveMacroVal(it) {
7791
+ if (!it) {
7792
+ return undefined;
7793
+ }
7794
+ if (it.uniqueName && typeof fieldMap[it.uniqueName] != 'undefined') {
7795
+ return fieldMap[it.uniqueName];
7796
+ }
7797
+ if (it.itemCode && typeof fieldMap[it.itemCode] != 'undefined') {
7798
+ return fieldMap[it.itemCode];
7799
+ }
7800
+ return undefined;
7801
+ };
7802
+ Object.keys(fieldMap).forEach(function (mapKey) {
7803
+ var newVal = fieldMap[mapKey];
7804
+ if (typeof newVal == 'undefined' || newVal == null) {
7805
+ return;
7806
+ }
7807
+ var itemCode = mapKey;
7808
+ if (mainTblName && mapKey.indexOf(mainTblName + '_') === 0) {
7809
+ itemCode = mapKey.substring(mainTblName.length + 1);
7810
+ } else if (mainTblName && mapKey.indexOf(mainTblName + '$') === 0) {
7811
+ itemCode = mapKey.substring(mainTblName.length + 1);
7812
+ }
7813
+ for (var i = 0; i < mainTblData.length; i++) {
7814
+ if (mainTblData[i].key == itemCode || mainTblData[i].key == mapKey) {
7815
+ mainTblData[i].value = newVal;
7816
+ }
7817
+ }
7818
+ // 可编辑 / 只读字段均通过 Form.reloadItemParam 刷新展示
7819
+ if (tableRef && tableRef.refs) {
7820
+ var tryKeys = [mapKey];
7821
+ if (mainTblName) {
7822
+ tryKeys.push(mainTblName + '_' + itemCode);
7823
+ tryKeys.push(mainTblName + '_' + mapKey);
7824
+ }
7825
+ if (mapKey.indexOf('$') >= 0) {
7826
+ tryKeys.push(mapKey.replace(/\$/g, '_'));
7827
+ if (mainTblName) {
7828
+ tryKeys.push(mainTblName + '_' + itemCode);
7829
+ }
7830
+ }
7831
+ for (var k = 0; k < tryKeys.length; k++) {
7832
+ var hitKey = tryKeys[k];
7833
+ var formRef = tableRef.refs[hitKey];
7834
+ if (!formRef || !formRef.reloadItemParam) {
7835
+ continue;
7836
+ }
7837
+ try {
7838
+ formRef.reloadItemParam([{ key: 'value', value: newVal }]);
7839
+ // 只读 TextField 偶发不跟 props,强制再刷一次
7840
+ if (typeof formRef.forceUpdate === 'function') {
7841
+ formRef.forceUpdate();
7842
+ }
7843
+ } catch (e) {}
7844
+ break;
7845
+ }
7846
+ }
7847
+ });
7848
+ editFormData.mainTblData = mainTblData;
7849
+ // 同步字段定义中的 value / defaultValue(只读赋值宏依赖)
7850
+ var formItem = t.state.formItem || [];
7851
+ var syncDefault = function syncDefault(items) {
7852
+ if (!items || !items.length) {
7853
+ return;
7854
+ }
7855
+ for (var i = 0; i < items.length; i++) {
7856
+ var it = items[i];
7857
+ if (!it) {
7858
+ continue;
7859
+ }
7860
+ var mv = resolveMacroVal(it);
7861
+ if (typeof mv != 'undefined') {
7862
+ it.defaultValue = mv;
7863
+ it.value = mv;
7864
+ }
7865
+ if (it.children && it.children.length) {
7866
+ syncDefault(it.children);
7867
+ }
7868
+ }
7869
+ };
7870
+ syncDefault(formItem);
7871
+ t.setState({
7872
+ editFormData: editFormData,
7873
+ formItem: formItem
7874
+ });
7875
+ }).catch(function () {});
7876
+ }
7739
7877
  }, {
7740
7878
  key: 'switchApproveOrg',
7741
7879
  value: function switchApproveOrg(orgId, callback, failCallback, options) {
@@ -8154,7 +8292,7 @@ var PageHome = function (_React$Component) {
8154
8292
  _react2.default.createElement(
8155
8293
  _Group2.default.List,
8156
8294
  null,
8157
- this.state.tableStatus == '0' ? "" : _react2.default.createElement(_table2.default, { 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) })
8295
+ 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) })
8158
8296
  )
8159
8297
  )
8160
8298
  )
@@ -829,9 +829,17 @@ var MyGrid = function (_React$Component) {
829
829
  null,
830
830
  _react2.default.createElement('img', { className: 'nodata t-PL10 t-PR10', src: '../../../fmui/images/home/nodata.png' })
831
831
  )
832
+ ),
833
+ _react2.default.createElement(
834
+ _Tab2.default.Item,
835
+ { title: _react2.default.createElement(
836
+ 'div',
837
+ { style: { color: styleSetting.titleSet.titleColor, fontWeight: styleSetting.titleSet.titleWeight == 1 ? 700 : '', fontSize: styleSetting.titleSet.titleSize } },
838
+ t.props.cyyyPlusTitle ? t.props.cyyyPlusTitle : ''
839
+ ) },
840
+ t.props.cyyyPlusContent ? t.props.cyyyPlusContent : ''
832
841
  )
833
- ),
834
- t.props.extendedContent ? t.props.extendedContent : ''
842
+ )
835
843
  );
836
844
  }
837
845
  if (item.portletCode === 'bssx') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.3.11",
3
+ "version": "2.3.13",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",