fmui-base 2.2.18 → 2.2.20

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.2.20:流程列表组件支持流程分类category参数
7
+ - 2.2.19:上传组件添加图片点击放大事件
6
8
  - 2.2.18:修改关联流程暂无数据样式
7
9
  - 2.2.17:表单字段关联支持主表字段和子表字段一起配置
8
10
  - 2.2.16:修改关联流程暂无数据样式
@@ -482,6 +482,7 @@ var PageHome = function (_React$Component2) {
482
482
  var activeIndex = props.activeIndex ? props.activeIndex : 0;
483
483
  var type = props.type ? props.type : "self"; //self:本应用,all:全模块
484
484
  var module = props.module ? props.module : type == "self" ? "approve" : "";
485
+ var category = props.category ? props.category : ""; //分类
485
486
  var hasBatch = eval(props.hasBatch ? props.hasBatch : "true"); //是否有批量办理
486
487
  var tabCodes = props.tabCodes ? props.tabCodes : "undo,unread,done,read,myself"; //标签页
487
488
  var searchVal = props.search;
@@ -501,17 +502,17 @@ var PageHome = function (_React$Component2) {
501
502
  var readListUrl;
502
503
  var myselfListUrl;
503
504
  if (type == "self") {
504
- undoListUrl = _variables2.default.URLS.transaction.undo + "&module=" + module;
505
- unreadListUrl = _variables2.default.URLS.transaction.unread + "&module=" + module;
506
- doneListUrl = _variables2.default.URLS.transaction.done + "&module=" + module;
507
- readListUrl = _variables2.default.URLS.transaction.read + "&module=" + module;
508
- myselfListUrl = _variables2.default.URLS.transaction.myself + "&module=" + module;
505
+ undoListUrl = _variables2.default.URLS.transaction.undo + "&module=" + module + "&category=" + category;
506
+ unreadListUrl = _variables2.default.URLS.transaction.unread + "&module=" + module + "&category=" + category;
507
+ doneListUrl = _variables2.default.URLS.transaction.done + "&module=" + module + "&category=" + category;
508
+ readListUrl = _variables2.default.URLS.transaction.read + "&module=" + module + "&category=" + category;
509
+ myselfListUrl = _variables2.default.URLS.transaction.myself + "&module=" + module + "&category=" + category;
509
510
  } else {
510
- undoListUrl = _variables2.default.URLS.transaction.undo + "&unified=1&sourceType=unitedapprove&module=" + module;
511
- unreadListUrl = _variables2.default.URLS.transaction.unread + "&unified=1&sourceType=unitedapprove&module=" + module;
512
- doneListUrl = _variables2.default.URLS.transaction.done + "&unified=1&sourceType=unitedapprove&module=" + module;
513
- readListUrl = _variables2.default.URLS.transaction.read + "&unified=1&sourceType=unitedapprove&module=" + module;
514
- myselfListUrl = _variables2.default.URLS.transaction.myself + "&unified=1&sourceType=unitedapprove&module=" + module;
511
+ undoListUrl = _variables2.default.URLS.transaction.undo + "&unified=1&sourceType=unitedapprove&module=" + module + "&category=" + category;
512
+ unreadListUrl = _variables2.default.URLS.transaction.unread + "&unified=1&sourceType=unitedapprove&module=" + module + "&category=" + category;
513
+ doneListUrl = _variables2.default.URLS.transaction.done + "&unified=1&sourceType=unitedapprove&module=" + module + "&category=" + category;
514
+ readListUrl = _variables2.default.URLS.transaction.read + "&unified=1&sourceType=unitedapprove&module=" + module + "&category=" + category;
515
+ myselfListUrl = _variables2.default.URLS.transaction.myself + "&unified=1&sourceType=unitedapprove&module=" + module + "&category=" + category;
515
516
  }
516
517
  _this2.state = {
517
518
  tabCodes: tabCodes,
@@ -552,10 +553,11 @@ var PageHome = function (_React$Component2) {
552
553
  category1: [],
553
554
  category2: [],
554
555
  category3: [],
555
- category4: []
556
+ category4: [],
557
+ category: category
556
558
  };
557
- _this2.getTransactionTitleCount(module, "undo,unread");
558
- _this2.getCategoryListByModule(module);
559
+ _this2.getTransactionTitleCount(module, "undo,unread", category);
560
+ _this2.getCategoryListByModule(module, category);
559
561
  /**
560
562
  * 办理页面搜索框设置项
561
563
  * @type {{locale: string, instantSearch: boolean, hasHistory: boolean, searchDelay: number, onEnter: (()), onExit: (()), onChange: ((p1:*)), onSearch: ((p1?:*))}}
@@ -643,13 +645,14 @@ var PageHome = function (_React$Component2) {
643
645
 
644
646
  }, {
645
647
  key: 'getTransactionTitleCount',
646
- value: function getTransactionTitleCount(module, codes) {
648
+ value: function getTransactionTitleCount(module, codes, category) {
647
649
  var _this3 = this;
648
650
 
649
651
  var t = this;
650
652
  _db2.default.FlowApproval.getApproveCount({
651
653
  module: module,
652
- codes: codes
654
+ codes: codes,
655
+ category: category
653
656
  }).then(function (content) {
654
657
  _this3.state.titleCount.undo = content.undo;
655
658
  _this3.state.titleCount.unread = content.unread;
@@ -664,12 +667,13 @@ var PageHome = function (_React$Component2) {
664
667
 
665
668
  }, {
666
669
  key: 'getCategoryListByModule',
667
- value: function getCategoryListByModule(module) {
670
+ value: function getCategoryListByModule(module, category) {
668
671
  var _this4 = this;
669
672
 
670
673
  var t = this;
671
674
  _db2.default.FlowApproval.getCategoryListByModule({
672
- module: module
675
+ module: module,
676
+ code: category
673
677
  }).then(function (content) {
674
678
  if (content) {
675
679
  _this4.state.categoryList = content;
@@ -1322,8 +1326,7 @@ var PageHome = function (_React$Component2) {
1322
1326
  processData: this.processData.bind(this),
1323
1327
  ref: 'transaction_undo_ref',
1324
1328
  noDataImage: _variables2.default.nodataIcon,
1325
- currentPageKey: 'page',
1326
- noDataTip: this.state.noDataTip0
1329
+ currentPageKey: 'page'
1327
1330
  },
1328
1331
  _react2.default.createElement(ListItem, { type: '0', isBatch: this.state.isBatch, ableClick: this.state.ableClick, fromType: this.state.type, projectPath: this.state.projectPath, updateAbleClick: this.updateAbleClick.bind(this) })
1329
1332
  )
@@ -1372,8 +1375,7 @@ var PageHome = function (_React$Component2) {
1372
1375
  processData: this.processData.bind(this),
1373
1376
  ref: 'transaction_unread_ref',
1374
1377
  noDataImage: _variables2.default.nodataIcon,
1375
- currentPageKey: 'page',
1376
- noDataTip: this.state.noDataTip1
1378
+ currentPageKey: 'page'
1377
1379
  },
1378
1380
  _react2.default.createElement(ListItem, { type: '1', ableClick: this.state.ableClick, isBatch: this.state.isBatch, fromType: this.state.type, projectPath: this.state.projectPath, updateAbleClick: this.updateAbleClick.bind(this) })
1379
1381
  )
@@ -1417,8 +1419,7 @@ var PageHome = function (_React$Component2) {
1417
1419
  processData: this.processData.bind(this),
1418
1420
  ref: 'transaction_done_ref',
1419
1421
  noDataImage: _variables2.default.nodataIcon,
1420
- currentPageKey: 'page',
1421
- noDataTip: this.state.noDataTip2
1422
+ currentPageKey: 'page'
1422
1423
  },
1423
1424
  _react2.default.createElement(ListItem, { type: '2', ableClick: this.state.ableClick, isBatch: this.state.isBatch, fromType: this.state.type, projectPath: this.state.projectPath, updateAbleClick: this.updateAbleClick.bind(this) })
1424
1425
  )
@@ -1462,8 +1463,7 @@ var PageHome = function (_React$Component2) {
1462
1463
  processData: this.processData.bind(this),
1463
1464
  ref: 'transaction_read_ref',
1464
1465
  noDataImage: _variables2.default.nodataIcon,
1465
- currentPageKey: 'page',
1466
- noDataTip: this.state.noDataTip3
1466
+ currentPageKey: 'page'
1467
1467
  },
1468
1468
  _react2.default.createElement(ListItem, { type: '3', ableClick: this.state.ableClick, isBatch: this.state.isBatch, fromType: this.state.type, projectPath: this.state.projectPath, updateAbleClick: this.updateAbleClick.bind(this) })
1469
1469
  )
@@ -1507,8 +1507,8 @@ var PageHome = function (_React$Component2) {
1507
1507
  processData: this.processData.bind(this),
1508
1508
  ref: 'transaction_myself_ref',
1509
1509
  noDataImage: _variables2.default.nodataIcon,
1510
- currentPageKey: 'page',
1511
- noDataTip: this.state.noDataTip4
1510
+ currentPageKey: 'page'
1511
+
1512
1512
  },
1513
1513
  _react2.default.createElement(ListItem, { type: '4', ableClick: this.state.ableClick, isBatch: this.state.isBatch, fromType: this.state.type, projectPath: this.state.projectPath, updateAbleClick: this.updateAbleClick.bind(this) })
1514
1514
  )
@@ -21,10 +21,16 @@ var _Progress2 = _interopRequireDefault(_Progress);
21
21
 
22
22
  var _uploadcore = require('uploadcore');
23
23
 
24
+ var _h5Imageviewer = require('h5-imageviewer');
25
+
26
+ var viewer = _interopRequireWildcard(_h5Imageviewer);
27
+
24
28
  require('whatwg-fetch');
25
29
 
26
30
  require('es6-promise');
27
31
 
32
+ 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; } }
33
+
28
34
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
35
 
30
36
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -91,6 +97,12 @@ var PageHome = function (_React$Component) {
91
97
  return currentFileName;
92
98
  };
93
99
 
100
+ _this.viewImageHandel = function (url) {
101
+ viewer.showViewer({
102
+ src: url
103
+ });
104
+ };
105
+
94
106
  var label = props.label;
95
107
  if (!label) {
96
108
  label = '';
@@ -505,7 +517,13 @@ var PageHome = function (_React$Component) {
505
517
  var isCopy = this.props.isCopy;
506
518
  var isPrint = this.props.isPrint;
507
519
  var fileExt = file.fileExt;
508
- downloadFile(id, 'android', fileExt, isCopy, isPrint, allowDownLoad);
520
+
521
+ if (fileExt == ".jpg" || fileExt == ".jpeg" || fileExt == ".gif" || fileExt == ".png") {
522
+ var urlFileImg = this.state.urlPrev + id;
523
+ this.viewImageHandel(urlFileImg);
524
+ } else {
525
+ downloadFile(id, 'android', fileExt, isCopy, isPrint, allowDownLoad);
526
+ }
509
527
  } else {
510
528
  downloadFile(id);
511
529
  }
@@ -610,11 +628,13 @@ var PageHome = function (_React$Component) {
610
628
 
611
629
  // 文件图标
612
630
 
613
- }, {
614
- key: 'render',
615
-
616
631
  //加载文件列表
617
632
 
633
+
634
+ // 点击放大图片
635
+
636
+ }, {
637
+ key: 'render',
618
638
  value: function render() {
619
639
  var _this3 = this;
620
640
 
@@ -653,7 +673,7 @@ var PageHome = function (_React$Component) {
653
673
  return t.state.uploadType == 'image' ? _react2.default.createElement(
654
674
  'div',
655
675
  { className: 'upload-image-item', key: i },
656
- _react2.default.createElement('img', { width: '100', height: '98', src: t.state.urlPrev + item.id }),
676
+ _react2.default.createElement('img', { width: '100', height: '98', onClick: _this3.viewImageHandel.bind(_this3, t.state.urlPrev + item.id), src: t.state.urlPrev + item.id }),
657
677
  _react2.default.createElement('i', { className: t.state.canDel ? 'iconfont icon-minus' : 't-DN', onClick: _this3.del.bind(_this3, i) })
658
678
  ) :
659
679
  // <div className="t-FBH" key={i} >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.2.18",
3
+ "version": "2.2.20",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",