fmui-base 2.1.0-beta.7 → 2.1.0-beta.8

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 --tag beta
4
4
 
5
5
  ## 更新日志
6
+ - 2.1.0-beta.8:周补丁功能合并
6
7
  - 2.1.0-beta.7:移动端关联表功能
7
8
  - 2.1.0-beta.6:按钮修改和选人组件兼职组织修复
8
9
  - 2.1.0-beta.5:选人组件修改
package/lib/form/form.js CHANGED
@@ -57,6 +57,10 @@ var _Field = require('saltui/lib/Field');
57
57
 
58
58
  var _Field2 = _interopRequireDefault(_Field);
59
59
 
60
+ var _FoldablePane = require('saltui/lib/FoldablePane');
61
+
62
+ var _FoldablePane2 = _interopRequireDefault(_FoldablePane);
63
+
60
64
  var _AngleRight = require('salt-icon/lib/AngleRight');
61
65
 
62
66
  var _AngleRight2 = _interopRequireDefault(_AngleRight);
@@ -94,7 +98,6 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
94
98
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
95
99
 
96
100
  _Field2.default;
97
- // import FoldablePane from 'saltui/lib/FoldablePane';
98
101
  // import Slot from 'saltui/lib/Slot';
99
102
 
100
103
  // import SelectFileNo from '../select-fileno/pageHome';
@@ -847,6 +850,10 @@ var PageHome = function (_React$Component) {
847
850
  var dateDisplayFormat = form.dataAttr.dateDisplayFormat;
848
851
  if (dateDisplayFormat == "STime" || dateFormat == "YMDHM") {
849
852
  dateFormat = "YMDHM";
853
+ } else if (dateDisplayFormat == "YearMon") {
854
+ dateFormat = "YM";
855
+ } else if (dateDisplayFormat == "Year") {
856
+ dateFormat = "Y";
850
857
  } else {
851
858
  if (dateDisplayFormat == "ODate") {
852
859
  dateFormat = "YMD";
@@ -895,6 +902,10 @@ var PageHome = function (_React$Component) {
895
902
  } else if (value && value.length >= 10) {
896
903
  value = value.substring(0, 19);
897
904
  value = new Date(value.replace(/-/g, "/")).getTime();
905
+ } else if (value && value.length == 4 && dateFormat == "Y") {
906
+ value = new Date(value).getTime();
907
+ } else if (value && value.length == 7 && dateFormat == "YM") {
908
+ value = new Date(value).getTime();
898
909
  } else {
899
910
  for (var i = 0; i < mainTblData.length; i++) {
900
911
  if (itemParam.key == mainTblData[i].key) {
@@ -941,25 +952,30 @@ var PageHome = function (_React$Component) {
941
952
  }
942
953
  } else if (itemType == 'upload' || itemType == 'image') {
943
954
  //附件图片
944
- var uploadFileNumLimit = form.uploadFileNumLimit; //上传个数限制
945
- var uploadFileLimit = form.uploadFileLimit; //上传类型限制
946
- if (value) {
947
- value = value.replace(/\|/g, ",");
948
- itemParam.initIds = value;
949
- value = [];
950
- } else {
951
- value = [];
952
- }
953
- if (uploadFileNumLimit) {
954
- itemParam.uploadFileNumLimit = uploadFileNumLimit;
955
- } else {
956
- itemParam.uploadFileNumLimit = -1;
957
- }
955
+ var formDataAttr = form.dataAttr;
956
+ if (formDataAttr) {
957
+ var uploadFileNumLimit = formDataAttr.uploadFileNumLimit; //上传个数限制
958
+ var uploadFileLimit = formDataAttr.uploadFileLimit; //上传类型限制
959
+ var canDownload = formDataAttr.canDownload; //是否下载
960
+ if (value) {
961
+ value = value.replace(/\|/g, ",");
962
+ itemParam.initIds = value;
963
+ value = [];
964
+ } else {
965
+ value = [];
966
+ }
967
+ if (uploadFileNumLimit) {
968
+ itemParam.uploadFileNumLimit = uploadFileNumLimit;
969
+ } else {
970
+ itemParam.uploadFileNumLimit = -1;
971
+ }
958
972
 
959
- if (uploadFileLimit) {
960
- itemParam.uploadFileLimit = uploadFileLimit;
961
- } else {
962
- itemParam.uploadFileLimit = "";
973
+ if (uploadFileLimit) {
974
+ itemParam.uploadFileLimit = uploadFileLimit;
975
+ } else {
976
+ itemParam.uploadFileLimit = "";
977
+ }
978
+ itemParam.canDownload = canDownload;
963
979
  }
964
980
  } else if (itemType == 'poppage') {
965
981
  //弹出选择
@@ -2096,6 +2112,12 @@ var PageHome = function (_React$Component) {
2096
2112
  var hour = this.dealwithDate(date.getHours());
2097
2113
  var min = this.dealwithDate(date.getMinutes());
2098
2114
  return year + '-' + month + '-' + dates + ' ' + hour + ':' + min;
2115
+ } else if (formatStr == 'Y') {
2116
+ //年
2117
+ return year;
2118
+ } else if (formatStr == 'YM') {
2119
+ //年月
2120
+ return year + '-' + month;
2099
2121
  } else {
2100
2122
  return '';
2101
2123
  }
@@ -2919,6 +2941,7 @@ var PageHome = function (_React$Component) {
2919
2941
  ref: "upload_" + t.state.itemParam.tableName + "_" + t.state.itemParam.key,
2920
2942
  canAdd: t.state.itemParam.readOnly == true ? false : true,
2921
2943
  canDel: t.state.itemParam.readOnly == true ? false : true,
2944
+ canDownload: this.state.itemParam.canDownload == "1" ? true : false,
2922
2945
  initList: t.state.itemParam.value,
2923
2946
  initIds: t.state.itemParam.initIds,
2924
2947
  dir: t.state.module,
@@ -2993,12 +3016,36 @@ var PageHome = function (_React$Component) {
2993
3016
  _react2.default.createElement(
2994
3017
  'div',
2995
3018
  { className: t.state.commentField == this.state.itemParam.uniqueName ? 't-PL10' : 't-DN' },
2996
- _react2.default.createElement(_TextareaField2.default, {
2997
- readOnly: false,
2998
- minRows: 3, maxRows: 5,
2999
- placeholder: '请输入批示意见',
3000
- value: t.state.spyj,
3001
- onChange: this.changeSpyj3.bind(this) })
3019
+ _react2.default.createElement(
3020
+ 'div',
3021
+ { className: t.state.commentField == this.state.itemParam.uniqueName ? 't-FCddblue t-P6 t-FS16 commonwords' : 't-DN', onClick: this.selectCommonwords.bind(this) },
3022
+ '\u5E38\u7528\u8BED'
3023
+ ),
3024
+ _react2.default.createElement(
3025
+ 'div',
3026
+ { id: t.state.prefixName + "_" + t.state.itemParam.key },
3027
+ _react2.default.createElement(_TextareaField2.default, {
3028
+ readOnly: false,
3029
+ minRows: 3, maxRows: 5,
3030
+ placeholder: '请输入批示意见',
3031
+ value: t.state.spyj,
3032
+ onChange: this.changeSpyj3.bind(this) })
3033
+ )
3034
+ ),
3035
+ _react2.default.createElement(
3036
+ _FoldablePane2.default,
3037
+ { foldHeight: 0, isFold: this.state.fold },
3038
+ _react2.default.createElement(
3039
+ 'div',
3040
+ { className: 'phrase-list' },
3041
+ this.state.phraseListNew.length > 0 ? this.state.phraseListNew.map(function (item, i) {
3042
+ return _react2.default.createElement(
3043
+ 'div',
3044
+ { className: 'phrase-item', onClick: this.phraseItemClick.bind(this, item.value) },
3045
+ item.value
3046
+ );
3047
+ }.bind(this)) : ''
3048
+ )
3002
3049
  )
3003
3050
  )
3004
3051
  )
package/lib/form/table.js CHANGED
@@ -1468,6 +1468,8 @@ var PageHome = function (_React$Component) {
1468
1468
  }, {
1469
1469
  key: 'render',
1470
1470
  value: function render() {
1471
+ var _this2 = this;
1472
+
1471
1473
  var t = this;
1472
1474
  var allForm = this.props.allForm;
1473
1475
  var tabCodes = allForm.tabCodes;
@@ -1498,11 +1500,17 @@ var PageHome = function (_React$Component) {
1498
1500
  'div',
1499
1501
  null,
1500
1502
  _react2.default.createElement(
1501
- _Tab2.default,
1502
- { activeKey: tabCodes[0], className: 'dd-tab-br-none', onChange: this.onChangeTab.bind(this), onTabClick: this.changeTab.bind(this) },
1503
- tabCodes.map(function (item1, k) {
1504
- return _react2.default.createElement(_Tab2.default.Item, { key: item1, title: tabNames[k] });
1505
- }.bind(this))
1503
+ 'ul',
1504
+ { className: 'tab-page-tree' },
1505
+ tabCodes.map(function (item, index) {
1506
+ return _react2.default.createElement(
1507
+ 'li',
1508
+ { className: t.state.active == item ? "tab-page-tree-item active" : "tab-page-tree-item", onClick: function onClick() {
1509
+ _this2.changeTab(item);
1510
+ }, key: item },
1511
+ tabNames[index]
1512
+ );
1513
+ })
1506
1514
  ),
1507
1515
  _react2.default.createElement('div', { className: 't-H10 t-BCf7' }),
1508
1516
  _react2.default.createElement(
@@ -1513,16 +1521,16 @@ var PageHome = function (_React$Component) {
1513
1521
  return _react2.default.createElement(
1514
1522
  'div',
1515
1523
  { className: t.state.active == item.tabCode ? "" : "t-DN" },
1516
- _react2.default.createElement(_form2.default, { keyNo: j, ref: item.uniqueName, operate: t.props.operate, hasCommentField: t.props.hasCommentField, newspyj: t.props.newspyj, commentField: t.props.commentField, module: t.props.module, formKey: t.props.allForm.formcode, status: t.props.status, form: item2, formStyle: t.props.formStyleObj, commentList: t.props.commentFieldList, data: t.props.data, fieldControll: t.props.fieldControll, onChange: this.change.bind(this) })
1524
+ _react2.default.createElement(_form2.default, { keyNo: j, ref: item.uniqueName, operate: t.props.operate, hasCommentField: t.props.hasCommentField, newspyj: t.props.newspyj, commentField: t.props.commentField, module: t.props.module, formKey: t.props.allForm.formcode, status: t.props.status, form: item2, allForm: t.props.allForm, formStyle: t.props.formStyleObj, commentList: t.props.commentFieldList, data: t.props.data, fieldControll: t.props.fieldControll, onChange: this.change.bind(this) })
1517
1525
  );
1518
1526
  }.bind(this)) : item.itemType == 'detail' ? _react2.default.createElement(
1519
1527
  'div',
1520
1528
  { className: t.state.active == item.tabCode ? "" : "t-DN" },
1521
- _react2.default.createElement(_subForm2.default, { keyNo: i, ref: 'sub_' + item.itemCode, operate: t.props.operate, newspyj: t.props.newspyj, hasCommentField: t.props.hasCommentField, commentField: t.props.commentField, module: t.props.module, formKey: t.props.allForm.formcode, status: t.props.status, form: item, formStyle: t.props.formStyleObj, commentList: t.props.commentFieldList, data: t.props.data, fieldControll: t.props.fieldControll, onChange: this.change.bind(this) })
1529
+ _react2.default.createElement(_subForm2.default, { keyNo: i, ref: 'sub_' + item.itemCode, operate: t.props.operate, newspyj: t.props.newspyj, hasCommentField: t.props.hasCommentField, commentField: t.props.commentField, module: t.props.module, formKey: t.props.allForm.formcode, status: t.props.status, form: item, allForm: t.props.allForm, formStyle: t.props.formStyleObj, commentList: t.props.commentFieldList, data: t.props.data, fieldControll: t.props.fieldControll, onChange: this.change.bind(this) })
1522
1530
  ) : _react2.default.createElement(
1523
1531
  'div',
1524
1532
  { className: t.state.active == item.tabCode ? "" : "t-DN" },
1525
- _react2.default.createElement(_form2.default, { ref: item.uniqueName, keyNo: i, operate: t.props.operate, newspyj: t.props.newspyj, hasCommentField: t.props.hasCommentField, commentField: t.props.commentField, module: t.props.module, formKey: t.props.allForm.formcode, status: t.props.status, form: item, formStyle: t.props.formStyleObj, commentList: t.props.commentFieldList, data: t.props.data, fieldControll: t.props.fieldControll, onChange: this.change.bind(this) })
1533
+ _react2.default.createElement(_form2.default, { ref: item.uniqueName, keyNo: i, operate: t.props.operate, newspyj: t.props.newspyj, hasCommentField: t.props.hasCommentField, commentField: t.props.commentField, module: t.props.module, formKey: t.props.allForm.formcode, status: t.props.status, form: item, allForm: t.props.allForm, formStyle: t.props.formStyleObj, commentList: t.props.commentFieldList, data: t.props.data, fieldControll: t.props.fieldControll, onChange: this.change.bind(this) })
1526
1534
  );
1527
1535
  }.bind(this))
1528
1536
  )
@@ -54,6 +54,10 @@ var _Boxs = require('saltui/lib/Boxs');
54
54
 
55
55
  var _Boxs2 = _interopRequireDefault(_Boxs);
56
56
 
57
+ var _h5Imageviewer = require('h5-imageviewer');
58
+
59
+ var viewer = _interopRequireWildcard(_h5Imageviewer);
60
+
57
61
  var _ActionSheet = require('saltui/lib/ActionSheet');
58
62
 
59
63
  var _ActionSheet2 = _interopRequireDefault(_ActionSheet);
@@ -98,6 +102,8 @@ var _upload = require('../upload/upload');
98
102
 
99
103
  var _upload2 = _interopRequireDefault(_upload);
100
104
 
105
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
106
+
101
107
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
102
108
 
103
109
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -119,6 +125,7 @@ var extFile = "";
119
125
  var ActionSheetButton = void 0;
120
126
  var iconIndex = 0;
121
127
  var searchVal = '';
128
+ // const viewer = null;
122
129
 
123
130
  var evoRemind = '0';
124
131
  var sysSMSsetting = '0';
@@ -159,9 +166,15 @@ var PageHome = function (_React$Component) {
159
166
 
160
167
  /* $(".loading-containter").hide();*/
161
168
 
162
- //消息提醒
163
169
  var _this = _possibleConstructorReturn(this, (PageHome.__proto__ || Object.getPrototypeOf(PageHome)).call(this, props));
164
170
 
171
+ var bottom = 52;
172
+ var isIPhoneXR = /iphone/gi.test(window.navigator.userAgent) && window.screen.height >= 812;
173
+ if (isIPhoneXR) {
174
+ bottom = 52 + 46;
175
+ }
176
+
177
+ //消息提醒
165
178
  _thirdMenuType = getLoginUserInfo().thirdMenuType;
166
179
  var loginUserId = getLoginUserInfo().userId;
167
180
  var fxUserId = props.userId;
@@ -292,6 +305,7 @@ var PageHome = function (_React$Component) {
292
305
  });
293
306
 
294
307
  var param = {
308
+ bottom: bottom,
295
309
  editType: editType,
296
310
  isDraft: isDraft,
297
311
  listType: listType,
@@ -577,16 +591,33 @@ var PageHome = function (_React$Component) {
577
591
  "overflow": "auto",
578
592
  "height": ""
579
593
  });
594
+ if (viewer) {
595
+ viewer.hideViewer();
596
+ }
597
+
580
598
  _Dialog2.default.hide();
581
599
  _Popup2.default.hide();
582
600
  if (ActionSheetButton) {
583
601
  ActionSheetButton.close();
584
602
  }
585
603
  }
604
+ }, {
605
+ key: 'imageView',
606
+ value: function imageView(src) {
607
+ viewer.showViewer({
608
+ src: src
609
+ });
610
+ }
586
611
  }, {
587
612
  key: 'componentDidMount',
588
613
  value: function componentDidMount() {
589
614
  var t = this;
615
+ document.addEventListener('click', function (e) {
616
+ if (e.target.tagName === 'IMG') {
617
+ t.imageView(e.target.src);
618
+ }
619
+ });
620
+
590
621
  var taskId = this.state.taskId;
591
622
  var processInstanceId = this.state.processInstanceId;
592
623
  var listType = this.state.listType;
@@ -1014,7 +1045,10 @@ var PageHome = function (_React$Component) {
1014
1045
  //关联字段
1015
1046
  var formRelaField = content.formRelaField;
1016
1047
  var commentFieldList = [];
1017
- var defaultValue = content.defaultValue;
1048
+ var defaultValue = "";
1049
+ if (content.defaultValue || content.defaultValue === 0) {
1050
+ defaultValue = content.defaultValue;
1051
+ }
1018
1052
  var commentId = content.commentId;
1019
1053
  //alert(defaultValue);
1020
1054
  var commentDefaultList = [];
@@ -2132,6 +2166,7 @@ var PageHome = function (_React$Component) {
2132
2166
  var personValues = []; //备选的人
2133
2167
  var participantMode = item.participantMode; //判断选人是单选还是多选
2134
2168
  var commonUsedData = []; //自定义选人的范围,常用
2169
+ var commonTreeData = [];
2135
2170
  var popCode = "";
2136
2171
  var chooseType = "";
2137
2172
  var type3ParNum = 0;
@@ -2179,6 +2214,11 @@ var PageHome = function (_React$Component) {
2179
2214
  }
2180
2215
  var commonUsedId = ''; //常用选择范围
2181
2216
  var participantList = item.participantList;
2217
+ var participantListNew = item.participantListNew;
2218
+ if (participantListNew != null && participantListNew != "" && participantListNew.length > 0) {
2219
+ commonTreeData = participantListNew;
2220
+ }
2221
+
2182
2222
  participants = '';
2183
2223
  if (participantList != null && participantList != "" && participantList.length > 0) {
2184
2224
  for (var i = 0; i < participantList.length; i++) {
@@ -2231,6 +2271,10 @@ var PageHome = function (_React$Component) {
2231
2271
  chooseType = "userNotOrg,userNotGroup";
2232
2272
  var commonUsedId = ''; //常用选择范围
2233
2273
  var participantList = item.participantList;
2274
+ var participantListNew = item.participantListNew;
2275
+ if (participantListNew != null && participantListNew != "" && participantListNew.length > 0) {
2276
+ commonTreeData = participantListNew;
2277
+ }
2234
2278
  if (participantList != null && participantList != "" && participantList.length > 0) {
2235
2279
  for (var i = 0; i < participantList.length; i++) {
2236
2280
  if (participantList[i].type != "user") {
@@ -2277,6 +2321,7 @@ var PageHome = function (_React$Component) {
2277
2321
  checkedItem.code = popCode;
2278
2322
  checkedItem.chooseType = chooseType;
2279
2323
  checkedItem.commonUsedData = commonUsedData;
2324
+ checkedItem.commonTreeData = commonTreeData;
2280
2325
  checkedItem.participantMode = participantMode; //选人单选还是多选,1多选,0单选
2281
2326
  checkedItem.personValue = personValue;
2282
2327
  checkedItem.selectUserReadOnly = selectUserReadOnly;
@@ -6328,9 +6373,10 @@ var PageHome = function (_React$Component) {
6328
6373
 
6329
6374
  var isReadOnly = false;
6330
6375
  var t = this;
6376
+ var bottomStyle = { paddingBottom: this.state.bottom + 'px' };
6331
6377
  return _react2.default.createElement(
6332
6378
  'div',
6333
- { className: 'approval-details' },
6379
+ { style: bottomStyle, className: 'approval-details' },
6334
6380
  _react2.default.createElement(
6335
6381
  'div',
6336
6382
  { className: this.state.errorMsg == '任务不存在' ? "dd-state-page" : 't-DN' },
@@ -6610,6 +6656,7 @@ var PageHome = function (_React$Component) {
6610
6656
  isDelete: true,
6611
6657
  defaultValue: item.personValue,
6612
6658
  commonUsedData: item.commonUsedData,
6659
+ commonTreeData: item.commonTreeData,
6613
6660
  onChange: this.getChoosePerson.bind(this, i),
6614
6661
  queryLimit: item.participants == '' ? '' : '5',
6615
6662
  limitData: item.participants == '' ? '' : item.participants