fmui-base 2.1.7 → 2.1.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
4
4
 
5
5
  ## 更新日志
6
+ - 2.1.8:流程表单支持自动保存设置
6
7
  - 2.1.7:移动选人bug
7
8
  - 2.1.6:增加二开自定义按钮的扩展方法
8
9
  - 2.1.5:退回流程提交到退回活动,默认勾选
@@ -308,6 +308,8 @@ var PageHome = function (_React$Component) {
308
308
  }).catch(function (error) {
309
309
  console.error(error);
310
310
  });
311
+ //自动保存
312
+ var autoSaveApprove = getSystemInfo().autoSaveApprove;
311
313
 
312
314
  var param = {
313
315
  bottom: bottom,
@@ -481,6 +483,15 @@ var PageHome = function (_React$Component) {
481
483
  // }
482
484
  // });
483
485
 
486
+ //自动保存表单
487
+ if (getSystemInfo().autoSaveApprove == '1') {
488
+ var approveSaveTime = getSystemInfo().approveSaveTime;
489
+ if (approveSaveTime) {
490
+ if (listType == '0') {
491
+ t.autoSaveApproveFunc(approveSaveTime);
492
+ }
493
+ }
494
+ }
484
495
 
485
496
  // this.addBackListener();
486
497
  return _this;
@@ -3949,7 +3960,7 @@ var PageHome = function (_React$Component) {
3949
3960
 
3950
3961
  }, {
3951
3962
  key: 'saveForm',
3952
- value: function saveForm() {
3963
+ value: function saveForm(isAuto) {
3953
3964
  var t = this;
3954
3965
  //表单提交前
3955
3966
 
@@ -3966,7 +3977,7 @@ var PageHome = function (_React$Component) {
3966
3977
  }
3967
3978
  if (typeof mobileExt !== 'undefined' && mobileExt["saveDraftBefore"] === "function") {
3968
3979
  mobileExt["saveDraftBefore"](t.state, function () {
3969
- t.saveFormFuc();
3980
+ t.saveFormFuc(isAuto);
3970
3981
  }, function (error) {
3971
3982
  _Toast2.default.show({
3972
3983
  type: 'error',
@@ -3974,7 +3985,7 @@ var PageHome = function (_React$Component) {
3974
3985
  });
3975
3986
  });
3976
3987
  } else {
3977
- t.saveFormFuc();
3988
+ t.saveFormFuc(isAuto);
3978
3989
  }
3979
3990
  }, function (error) {
3980
3991
  _Toast2.default.show({
@@ -3994,7 +4005,7 @@ var PageHome = function (_React$Component) {
3994
4005
  }
3995
4006
  if (typeof mobileExt !== 'undefined' && typeof mobileExt["saveDraftBefore"] === "function") {
3996
4007
  mobileExt["saveDraftBefore"](t.state, function () {
3997
- t.saveFormFuc();
4008
+ t.saveFormFuc(isAuto);
3998
4009
  }, function (error) {
3999
4010
  _Toast2.default.show({
4000
4011
  type: 'error',
@@ -4002,7 +4013,7 @@ var PageHome = function (_React$Component) {
4002
4013
  });
4003
4014
  });
4004
4015
  } else {
4005
- t.saveFormFuc();
4016
+ t.saveFormFuc(isAuto);
4006
4017
  }
4007
4018
  }
4008
4019
  }
@@ -4011,7 +4022,7 @@ var PageHome = function (_React$Component) {
4011
4022
 
4012
4023
  }, {
4013
4024
  key: 'saveFormFuc',
4014
- value: function saveFormFuc() {
4025
+ value: function saveFormFuc(isAuto) {
4015
4026
  var _param;
4016
4027
 
4017
4028
  var t = this;
@@ -4095,14 +4106,19 @@ var PageHome = function (_React$Component) {
4095
4106
  // mobileExt["fieldSignCA"]({type:type,dataId:dataId,isBatch:0},t.state);
4096
4107
  // }
4097
4108
  // }
4098
-
4099
- if (isPush == '1') {
4100
- closePage();
4109
+ if (isAuto && isAuto == 1) {
4110
+ t.setState({
4111
+ dataId: dataId
4112
+ });
4101
4113
  } else {
4102
- setTimeout(function () {
4103
- // window.ReactNativeWebView.postMessage('final');
4104
- backPage();
4105
- }, 1500);
4114
+ if (isPush == '1') {
4115
+ closePage();
4116
+ } else {
4117
+ setTimeout(function () {
4118
+ // window.ReactNativeWebView.postMessage('final');
4119
+ backPage();
4120
+ }, 1500);
4121
+ }
4106
4122
  }
4107
4123
  }).catch(function (error) {
4108
4124
  if (typeof error.errorMsg == 'undefined') {
@@ -4126,95 +4142,162 @@ var PageHome = function (_React$Component) {
4126
4142
  }
4127
4143
  });
4128
4144
  } else {
4129
- _Dialog2.default.confirm({
4130
- locale: 'zh_CN',
4131
- title: '提示',
4132
- content: '是否保存到草稿箱',
4133
- onConfirm: function onConfirm() {
4134
- db.FlowModuleAPI.saveForm(param).then(function (content) {
4135
- _Toast2.default.show({
4136
- type: 'success',
4137
- content: '保存成功'
4138
- });
4145
+ if (isAuto && isAuto == 1) {
4146
+ db.FlowModuleAPI.saveForm(param).then(function (content) {
4147
+ _Toast2.default.show({
4148
+ type: 'success',
4149
+ content: '保存成功'
4150
+ });
4139
4151
 
4140
- var dataId = content.dataId;
4141
- //操作回调
4142
- if (typeof FlowCommon.operateCallBack === "function") {
4143
- FlowCommon.operateCallBack({ type: 5, dataId: dataId, isBatch: 0 }, t.state);
4144
- }
4145
- //项目开发扩展
4146
- var mobileExt;
4147
- try {
4148
- if (t.state.formKey) {
4149
- mobileExt = typeof eval(t.state.module + "_" + t.state.formKey + "_mobileExt") !== 'undefined' ? eval(t.state.module + "_" + t.state.formKey + "_mobileExt") : null;
4150
- }
4151
- } catch (e) {
4152
- // alert("exception: "+e.message);
4153
- }
4154
- if (typeof mobileExt !== 'undefined' && typeof mobileExt["operateCallBack"] === "function") {
4155
- mobileExt["operateCallBack"]({ type: 5, dataId: dataId, isBatch: 0 }, t.state);
4152
+ var dataId = content.dataId;
4153
+ //操作回调
4154
+ if (typeof FlowCommon.operateCallBack === "function") {
4155
+ FlowCommon.operateCallBack({ type: 5, dataId: dataId, isBatch: 0 }, t.state);
4156
+ }
4157
+ //项目开发扩展
4158
+ var mobileExt;
4159
+ try {
4160
+ if (t.state.formKey) {
4161
+ mobileExt = typeof eval(t.state.module + "_" + t.state.formKey + "_mobileExt") !== 'undefined' ? eval(t.state.module + "_" + t.state.formKey + "_mobileExt") : null;
4156
4162
  }
4163
+ } catch (e) {
4164
+ // alert("exception: "+e.message);
4165
+ }
4166
+ if (typeof mobileExt !== 'undefined' && typeof mobileExt["operateCallBack"] === "function") {
4167
+ mobileExt["operateCallBack"]({ type: 5, dataId: dataId, isBatch: 0 }, t.state);
4168
+ }
4157
4169
 
4158
- if (isPush == '1') {
4159
- closePage();
4160
- //alert("_thirdMenuType:"+_thirdMenuType);
4161
- //不得已的办法
4162
- // if(_thirdMenuType == 'WX'){
4163
- // wx.ready(function(){
4164
- // wx.closeWindow();
4165
- // });
4166
- // }else if(_thirdMenuType =='MH' && typeof(emp)!="undefined"){
4167
- // emp.window.close({
4168
- // id:'this', //指定被关闭窗口标识,如果id=‘this‘,则关闭当前窗口
4169
- // })
4170
- // }else{
4171
- // setTimeout(
4172
- // function () {
4173
-
4174
- // backPage();
4175
-
4176
- // }, 1500);
4177
- // }
4178
- } else {
4179
- setTimeout(function () {
4180
- // window.ReactNativeWebView.postMessage('final');
4181
- backPage();
4182
- }, 1500);
4170
+ t.setState({
4171
+ dataId: dataId
4172
+ });
4173
+
4174
+ // setTimeout(
4175
+ // function () {
4176
+ // backPage();
4177
+ // }, 1500);
4178
+ }).catch(function (error) {
4179
+ if (typeof error.errorMsg == 'undefined') {
4180
+ setTimeout(function () {
4181
+ _Toast2.default.show({
4182
+ type: 'error',
4183
+ content: '保存出错'
4184
+ });
4185
+ }, 800);
4186
+ } else {
4187
+ var message = error.errorMsg;
4188
+ if (message.indexOf('exclusive gateway') != -1) {
4189
+ message = "请检查判断条件字段是否正确填写!";
4183
4190
  }
4191
+ setTimeout(function () {
4192
+ _Toast2.default.show({
4193
+ type: 'error',
4194
+ content: message
4195
+ });
4196
+ }, 800);
4197
+ }
4198
+ });
4199
+ } else {
4200
+ _Dialog2.default.confirm({
4201
+ locale: 'zh_CN',
4202
+ title: '提示',
4203
+ content: '是否保存到草稿箱',
4204
+ onConfirm: function onConfirm() {
4205
+ db.FlowModuleAPI.saveForm(param).then(function (content) {
4206
+ _Toast2.default.show({
4207
+ type: 'success',
4208
+ content: '保存成功'
4209
+ });
4184
4210
 
4185
- // setTimeout(
4186
- // function () {
4187
- // backPage();
4188
- // }, 1500);
4189
- }).catch(function (error) {
4190
- if (typeof error.errorMsg == 'undefined') {
4191
- setTimeout(function () {
4192
- _Toast2.default.show({
4193
- type: 'error',
4194
- content: '保存出错'
4195
- });
4196
- }, 800);
4197
- } else {
4198
- var message = error.errorMsg;
4199
- if (message.indexOf('exclusive gateway') != -1) {
4200
- message = "请检查判断条件字段是否正确填写!";
4211
+ var dataId = content.dataId;
4212
+ //操作回调
4213
+ if (typeof FlowCommon.operateCallBack === "function") {
4214
+ FlowCommon.operateCallBack({ type: 5, dataId: dataId, isBatch: 0 }, t.state);
4201
4215
  }
4202
- setTimeout(function () {
4203
- _Toast2.default.show({
4204
- type: 'error',
4205
- content: message
4206
- });
4207
- }, 800);
4208
- }
4209
- });
4210
- },
4211
- onCancel: function onCancel() {
4212
- console.log('confirm cancel');
4213
- }
4214
- });
4216
+ //项目开发扩展
4217
+ var mobileExt;
4218
+ try {
4219
+ if (t.state.formKey) {
4220
+ mobileExt = typeof eval(t.state.module + "_" + t.state.formKey + "_mobileExt") !== 'undefined' ? eval(t.state.module + "_" + t.state.formKey + "_mobileExt") : null;
4221
+ }
4222
+ } catch (e) {
4223
+ // alert("exception: "+e.message);
4224
+ }
4225
+ if (typeof mobileExt !== 'undefined' && typeof mobileExt["operateCallBack"] === "function") {
4226
+ mobileExt["operateCallBack"]({ type: 5, dataId: dataId, isBatch: 0 }, t.state);
4227
+ }
4228
+
4229
+ if (isPush == '1') {
4230
+ closePage();
4231
+ //alert("_thirdMenuType:"+_thirdMenuType);
4232
+ //不得已的办法
4233
+ // if(_thirdMenuType == 'WX'){
4234
+ // wx.ready(function(){
4235
+ // wx.closeWindow();
4236
+ // });
4237
+ // }else if(_thirdMenuType =='MH' && typeof(emp)!="undefined"){
4238
+ // emp.window.close({
4239
+ // id:'this', //指定被关闭窗口标识,如果id=‘this‘,则关闭当前窗口
4240
+ // })
4241
+ // }else{
4242
+ // setTimeout(
4243
+ // function () {
4244
+
4245
+ // backPage();
4246
+
4247
+ // }, 1500);
4248
+ // }
4249
+ } else {
4250
+ setTimeout(function () {
4251
+ // window.ReactNativeWebView.postMessage('final');
4252
+ backPage();
4253
+ }, 1500);
4254
+ }
4255
+
4256
+ // setTimeout(
4257
+ // function () {
4258
+ // backPage();
4259
+ // }, 1500);
4260
+ }).catch(function (error) {
4261
+ if (typeof error.errorMsg == 'undefined') {
4262
+ setTimeout(function () {
4263
+ _Toast2.default.show({
4264
+ type: 'error',
4265
+ content: '保存出错'
4266
+ });
4267
+ }, 800);
4268
+ } else {
4269
+ var message = error.errorMsg;
4270
+ if (message.indexOf('exclusive gateway') != -1) {
4271
+ message = "请检查判断条件字段是否正确填写!";
4272
+ }
4273
+ setTimeout(function () {
4274
+ _Toast2.default.show({
4275
+ type: 'error',
4276
+ content: message
4277
+ });
4278
+ }, 800);
4279
+ }
4280
+ });
4281
+ },
4282
+ onCancel: function onCancel() {
4283
+ console.log('confirm cancel');
4284
+ }
4285
+ });
4286
+ }
4215
4287
  }
4216
4288
  }
4289
+ //自动保存表单
4217
4290
 
4291
+ }, {
4292
+ key: 'autoSaveApproveFunc',
4293
+ value: function autoSaveApproveFunc(saveTime) {
4294
+ var t = this;
4295
+ console.log("autoSaveApproveFunc");
4296
+ setTimeout(function () {
4297
+ console.log("自动保存表单");
4298
+ t.saveForm(1);
4299
+ }, saveTime * 60 * 1000);
4300
+ }
4218
4301
  //提交发送流程
4219
4302
 
4220
4303
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.1.7",
3
+ "version": "2.1.8",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",