fmui-base 2.3.10 → 2.3.11

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.11:子表支持子表按钮自定义
6
7
  - 2.3.10:门户首页grid常用应用部件增加扩展入口(一网通办项目需求,临时版本)
7
8
  - 2.3.9:子表支持整个子表隐藏
8
9
  - 2.3.8:子表多列排版错乱处理
@@ -1111,6 +1111,9 @@ var PageHome = function (_React$Component) {
1111
1111
  if (!extButtonList) {
1112
1112
  extButtonList = [];
1113
1113
  }
1114
+ if (subForm && subForm[index] && subForm[index].extButtonList) {
1115
+ extButtonList = subForm[index].extButtonList;
1116
+ }
1114
1117
 
1115
1118
  return extButtonList.map(function (item, i) {
1116
1119
  return _react2.default.createElement(
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _nvoice = require('./nvoice');
8
+
9
+ Object.defineProperty(exports, 'default', {
10
+ enumerable: true,
11
+ get: function get() {
12
+ return _interopRequireDefault(_nvoice).default;
13
+ }
14
+ });
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,177 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = undefined;
7
+
8
+ 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; }; }();
9
+
10
+ var _react = require('react');
11
+
12
+ var _react2 = _interopRequireDefault(_react);
13
+
14
+ var _Group = require('saltui/lib/Group');
15
+
16
+ var _Group2 = _interopRequireDefault(_Group);
17
+
18
+ var _Field = require('saltui/lib/Field');
19
+
20
+ var _Field2 = _interopRequireDefault(_Field);
21
+
22
+ var _upload = require('../upload/upload');
23
+
24
+ var _upload2 = _interopRequireDefault(_upload);
25
+
26
+ var _Boxs = require('saltui/lib/Boxs');
27
+
28
+ var _Boxs2 = _interopRequireDefault(_Boxs);
29
+
30
+ var _db = require('../db/db');
31
+
32
+ var _db2 = _interopRequireDefault(_db);
33
+
34
+ require('./nvoice.less');
35
+
36
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37
+
38
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
39
+
40
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
41
+
42
+ 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; }
43
+
44
+ var HBox = _Boxs2.default.HBox,
45
+ Box = _Boxs2.default.Box,
46
+ VBox = _Boxs2.default.VBox;
47
+
48
+ var Nvoice = function (_React$Component) {
49
+ _inherits(Nvoice, _React$Component);
50
+
51
+ function Nvoice(props) {
52
+ _classCallCheck(this, Nvoice);
53
+
54
+ // 传入的props参数
55
+ var _this = _possibleConstructorReturn(this, (Nvoice.__proto__ || Object.getPrototypeOf(Nvoice)).call(this, props));
56
+
57
+ _this.initFn = function (id) {
58
+
59
+ // 初始发票详情数据
60
+ _db2.default.form.getNoInvoiceList({
61
+ invoicedataid: id
62
+ }).then(function (content) {
63
+ _this.setState({
64
+ invoicedata: content
65
+ });
66
+ }).catch(function (error) {
67
+ console.error('获取详情数据失败', error);
68
+ });
69
+ };
70
+
71
+ var invoicedataid = _this.props.id;
72
+ var title = _this.props.label || '发票详情';
73
+ var required = _this.props.required || false;
74
+
75
+ _this.state = {
76
+ invoicedataid: invoicedataid,
77
+ invoicedata: [],
78
+ title: title,
79
+ required: required
80
+ };
81
+
82
+ return _this;
83
+ }
84
+
85
+ _createClass(Nvoice, [{
86
+ key: 'componentDidMount',
87
+ value: function componentDidMount() {
88
+ this.initFn(this.state.invoicedataid);
89
+ }
90
+ }, {
91
+ key: 'downloadFile',
92
+
93
+
94
+ // 下载函数
95
+ value: function (_downloadFile) {
96
+ function downloadFile(_x) {
97
+ return _downloadFile.apply(this, arguments);
98
+ }
99
+
100
+ downloadFile.toString = function () {
101
+ return _downloadFile.toString();
102
+ };
103
+
104
+ return downloadFile;
105
+ }(function (file) {
106
+ downloadFile(file.relaObjId);
107
+ })
108
+ }, {
109
+ key: 'render',
110
+ value: function render() {
111
+ return _react2.default.createElement(
112
+ _Group2.default.List,
113
+ { borderTopNone: true },
114
+ _react2.default.createElement(
115
+ _Field2.default,
116
+ { required: this.state.required, label: this.state.title, layout: 'h', multiLine: true },
117
+ _react2.default.createElement(
118
+ 'div',
119
+ null,
120
+ this.state.invoicedata.map(function (item, index) {
121
+ var fileList = [];
122
+ try {
123
+ if (item.invoicefileInfo) {
124
+ fileList = JSON.parse(item.invoicefileInfo);
125
+ }
126
+ } catch (e) {
127
+ console.error('发票附件解析失败', e);
128
+ }
129
+
130
+ return _react2.default.createElement(
131
+ 'div',
132
+ { key: item.id, className: 't-MT2' },
133
+ _react2.default.createElement(
134
+ VBox,
135
+ { className: 'nvoice-filetitle', hAlign: 'start' },
136
+ _react2.default.createElement(
137
+ Box,
138
+ null,
139
+ item.invoicename
140
+ ),
141
+ _react2.default.createElement(
142
+ HBox,
143
+ { vAlign: 'center' },
144
+ _react2.default.createElement(
145
+ Box,
146
+ { className: 'label label-primary' },
147
+ item.invoicetype
148
+ ),
149
+ _react2.default.createElement(
150
+ Box,
151
+ null,
152
+ '\uFFE5',
153
+ item.invoiceamount
154
+ )
155
+ )
156
+ ),
157
+ _react2.default.createElement(_upload2.default, {
158
+ required: false,
159
+ canDel: false,
160
+ canPreview: true,
161
+ canDownload: true,
162
+ initList: fileList,
163
+ dir: 'form_invoice',
164
+ ref: 'upload_invoice'
165
+ })
166
+ );
167
+ })
168
+ )
169
+ )
170
+ );
171
+ }
172
+ }]);
173
+
174
+ return Nvoice;
175
+ }(_react2.default.Component);
176
+
177
+ exports.default = Nvoice;
File without changes
@@ -951,127 +951,7 @@ var Page = function (_React$Component) {
951
951
  var t = this;
952
952
  var scopeList = this.state.scopeList;
953
953
  var chooseType = this.getChooseType();
954
- if ("common" == type) {
955
- var commonCheckAll = t.state.commonCheckAll;
956
- commonCheckAll = !commonCheckAll;
957
- var commonUsedData = t.state.commonUsedData;
958
- var total = t.state.total;
959
- var selectCommonNum = t.state.selectCommonNum;
960
- var selectedList = t.state.selectedList;
961
- var selectUsers = selectedList.selectUsers;
962
- var selectOrgs = selectedList.selectOrgs;
963
- var selectRoles = selectedList.selectRoles;
964
- var selectStations = selectedList.selectStations;
965
- var selectGroups = selectedList.selectGroups;
966
- if (selectUsers == null || selectUsers == undefined) {
967
- selectUsers = [];
968
- }
969
- if (selectOrgs == null || selectOrgs == undefined) {
970
- selectOrgs = [];
971
- }
972
- if (selectRoles == null || selectRoles == undefined) {
973
- selectRoles = [];
974
- }
975
- if (selectStations == null || selectStations == undefined) {
976
- selectStations = [];
977
- }
978
- if (selectGroups == null || selectGroups == undefined) {
979
- selectGroups = [];
980
- }
981
- if (commonCheckAll) {
982
- for (var i = 0; i < commonUsedData.length; i++) {
983
- var common = commonUsedData[i];
984
- if (!common.checked) {
985
- commonUsedData[i].checked = true;
986
- total++;
987
- selectCommonNum++;
988
- var selectedData = { id: common.scopeValue };
989
- var selectData = null;
990
- if (common.scopeType == "user") {
991
- selectedData.userName = common.scopeName;
992
- selectedData.imageId = common.imageId;
993
- selectData = selectUsers;
994
- } else if (common.scopeType == "org") {
995
- selectedData.orgName = common.scopeName;
996
- selectData = selectOrgs;
997
- } else if (common.scopeType == "role") {
998
- selectedData.roleName = common.scopeName;
999
- selectData = selectRoles;
1000
- } else if (common.scopeType == "station") {
1001
- selectedData.stationName = common.scopeName;
1002
- selectData = selectStations;
1003
- } else if (common.scopeType == "group") {
1004
- selectedData.groupName = common.scopeName;
1005
- selectData = selectGroups;
1006
- }
1007
- if (selectData != null) {
1008
- var flag = true;
1009
- for (var j = 0; j < selectData.length; j++) {
1010
- if (selectData[j].id == common.scopeValue) {
1011
- flag = false;
1012
- break;
1013
- }
1014
- }
1015
- if (flag) {
1016
- selectData.push(selectedData);
1017
- scopeList.push(commonUsedData[i]);
1018
- }
1019
- }
1020
- }
1021
- }
1022
- } else {
1023
- for (var i = 0; i < commonUsedData.length; i++) {
1024
- var common = commonUsedData[i];
1025
- if (common.checked) {
1026
- commonUsedData[i].checked = false;
1027
- total--;
1028
- selectCommonNum--;
1029
- var selectData = null;
1030
- if (common.scopeType == "user") {
1031
- selectData = selectUsers;
1032
- } else if (common.scopeType == "org") {
1033
- selectData = selectOrgs;
1034
- } else if (common.scopeType == "role") {
1035
- selectData = selectRoles;
1036
- } else if (common.scopeType == "station") {
1037
- selectData = selectStations;
1038
- } else if (common.scopeType == "group") {
1039
- selectData = selectGroups;
1040
- }
1041
- if (selectData != null) {
1042
- for (var j = 0; j < selectData.length; j++) {
1043
- if (selectData[j].id == common.scopeValue) {
1044
- selectData.splice(j, 1);
1045
- break;
1046
- }
1047
- }
1048
- }
1049
- for (var j = 0; j < scopeList.length; j++) {
1050
- if (scopeList[j].scopeValue == common.scopeValue) {
1051
- scopeList.splice(j, 1);
1052
- break;
1053
- }
1054
- }
1055
- }
1056
- }
1057
- }
1058
- selectedList.selectUsers = selectUsers;
1059
- selectedList.selectOrgs = selectOrgs;
1060
- selectedList.selectRoles = selectRoles;
1061
- selectedList.selectStations = selectStations;
1062
- selectedList.selectGroups = selectGroups;
1063
- var commonCheckState = t.syncCommonCheckState(commonUsedData);
1064
- t.setState({
1065
- commonUsedData: commonUsedData,
1066
- total: total,
1067
- selectCommonNum: commonCheckState.selectCommonNum,
1068
- commonCheckAll: commonCheckState.commonCheckAll,
1069
- selectedList: selectedList,
1070
- scopeList: scopeList
1071
- }, function () {
1072
- _this2.instance.update(_this2.getContent());
1073
- });
1074
- } else if ("user" == type) {
954
+ if ("user" == type) {
1075
955
  var navList = t.state.navUserList;
1076
956
  var index = navList.length - 1;
1077
957
  navList[index].checkAll = !navList[index].checkAll;
@@ -2261,13 +2141,10 @@ var Page = function (_React$Component) {
2261
2141
  };
2262
2142
  commonUsedData.push(data);
2263
2143
  }
2264
- var commonCheckState = t.syncCommonCheckState(commonUsedData);
2265
2144
  t.setState({
2266
2145
  commonTreeData: commonTreeData,
2267
2146
  commonUsedData: commonUsedData,
2268
2147
  selectUserNum: selectUserNum,
2269
- selectCommonNum: commonCheckState.selectCommonNum,
2270
- commonCheckAll: commonCheckState.commonCheckAll,
2271
2148
  navCommonList: navList,
2272
2149
  isShowNav: isShowNav,
2273
2150
  isShowCheckAll: isShowCheckAll
@@ -4047,12 +3924,9 @@ var Page = function (_React$Component) {
4047
3924
  };
4048
3925
  commonUsedData.push(data);
4049
3926
  }
4050
- var commonCheckState = t.syncCommonCheckState(commonUsedData);
4051
3927
  stateParam = {
4052
3928
  commonTreeData: commonTreeData,
4053
3929
  commonUsedData: commonUsedData,
4054
- selectCommonNum: commonCheckState.selectCommonNum,
4055
- commonCheckAll: commonCheckState.commonCheckAll,
4056
3930
  navCommonList: navList,
4057
3931
  isShowNav: true,
4058
3932
  isShowCheckAll: isShowCheckAll
@@ -4274,7 +4148,7 @@ var Page = function (_React$Component) {
4274
4148
  }
4275
4149
  var result = t.checkOneCommonItem(commonUsedData[index].checked, selectData, commonUsedData, selectedData, checkType, total, selectCommonNum, index, scopeList);
4276
4150
  total = result.total;
4277
- selectCommonNum = result.selectNum;
4151
+ selectUserNum = result.selectNum;
4278
4152
  if (common.scopeType == "user") {
4279
4153
  selectedList.selectUsers = selectData;
4280
4154
  } else if (common.scopeType == "org") {
@@ -4286,12 +4160,10 @@ var Page = function (_React$Component) {
4286
4160
  } else if (common.scopeType == "group") {
4287
4161
  selectedList.selectGroups = selectData;
4288
4162
  }
4289
- var commonCheckState = t.syncCommonCheckState(commonUsedData);
4290
4163
  t.setState({
4291
4164
  commonUsedData: commonUsedData,
4292
4165
  total: total,
4293
- selectCommonNum: commonCheckState.selectCommonNum,
4294
- commonCheckAll: commonCheckState.commonCheckAll,
4166
+ selectCommonNum: selectUserNum,
4295
4167
  selectedList: selectedList,
4296
4168
  scopeList: scopeList
4297
4169
  }, function () {
@@ -5826,23 +5698,6 @@ var Page = function (_React$Component) {
5826
5698
  }
5827
5699
  }
5828
5700
 
5829
- // 根据 commonUsedData 实际选中状态同步全选
5830
-
5831
- }, {
5832
- key: 'syncCommonCheckState',
5833
- value: function syncCommonCheckState(commonUsedData) {
5834
- var selectCommonNum = 0;
5835
- if (commonUsedData != null && commonUsedData != undefined && commonUsedData.length > 0) {
5836
- for (var i = 0; i < commonUsedData.length; i++) {
5837
- if (commonUsedData[i].checked) {
5838
- selectCommonNum++;
5839
- }
5840
- }
5841
- }
5842
- var commonCheckAll = commonUsedData != null && commonUsedData != undefined && commonUsedData.length > 0 && selectCommonNum == commonUsedData.length;
5843
- return { selectCommonNum: selectCommonNum, commonCheckAll: commonCheckAll };
5844
- }
5845
-
5846
5701
  //修改获取的常用数据选中状态
5847
5702
 
5848
5703
  }, {
@@ -6529,18 +6384,22 @@ var Page = function (_React$Component) {
6529
6384
  var chooseType = this.getChooseType();
6530
6385
  if (obj.activeKey == "common") {
6531
6386
  var commonUsedData = t.state.commonUsedData;
6387
+ var selectCommonNum = 0;
6388
+ var commonCheckAll = false;
6532
6389
  if (commonUsedData != null && commonUsedData != undefined && commonUsedData.length > 0) {
6533
- t.commonDataChecked(commonUsedData);
6390
+ selectCommonNum = t.commonDataChecked(commonUsedData);
6391
+ if (selectCommonNum == commonUsedData.length) {
6392
+ commonCheckAll = true;
6393
+ }
6534
6394
  }
6535
- var commonCheckState = t.syncCommonCheckState(commonUsedData);
6536
6395
  var isShowCheckAll = true;
6537
6396
  if (checkType == "radio") {
6538
6397
  isShowCheckAll = false;
6539
6398
  }
6540
6399
  t.setState({
6541
- selectCommonNum: commonCheckState.selectCommonNum,
6400
+ selectCommonNum: selectCommonNum,
6542
6401
  isShowCheckAll: isShowCheckAll,
6543
- commonCheckAll: commonCheckState.commonCheckAll,
6402
+ commonCheckAll: commonCheckAll,
6544
6403
  isShowNav: false,
6545
6404
  activeKey: obj.activeKey
6546
6405
  }, function () {
@@ -7554,16 +7413,20 @@ var Page = function (_React$Component) {
7554
7413
 
7555
7414
  }
7556
7415
 
7416
+ var selectCommonNum = 0;
7557
7417
  if (commonSearchData.length > 0) {
7558
- t.commonDataChecked(commonSearchData);
7418
+ selectCommonNum = t.commonDataChecked(commonSearchData);
7419
+ }
7420
+ var commonCheckAll = false;
7421
+ if (commonSearchData != null && commonSearchData != undefined && selectCommonNum == commonSearchData.length) {
7422
+ commonCheckAll = true;
7559
7423
  }
7560
- var commonCheckState = t.syncCommonCheckState(commonSearchData);
7561
7424
  t.setState({
7562
7425
  commonUsedData: commonSearchData,
7563
7426
  commonTreeData: commonTreeData,
7564
- selectCommonNum: commonCheckState.selectCommonNum,
7427
+ selectCommonNum: selectCommonNum,
7565
7428
  isShowCheckAll: isShowCheckAll,
7566
- commonCheckAll: commonCheckState.commonCheckAll,
7429
+ commonCheckAll: commonCheckAll,
7567
7430
  commonName: value,
7568
7431
  isShowNav: false,
7569
7432
  activeKey: type
@@ -8277,9 +8140,6 @@ var Page = function (_React$Component) {
8277
8140
  }
8278
8141
  if (navList != null && navList.length > 0) {
8279
8142
  currentNav = navList[navList.length - 1].id;
8280
- console.log("currentNav:" + currentNav);
8281
- console.log("currentCheck:" + JSON.stringify(navList[navList.length - 1]));
8282
- console.log("currentCheckAll:" + navList[navList.length - 1].checkAll);
8283
8143
  currentCheckAll = navList[navList.length - 1].checkAll;
8284
8144
  currentCheckThisOrg = navList[navList.length - 1].checkThisOrg;
8285
8145
  //是我的部门
@@ -8717,34 +8577,6 @@ var Page = function (_React$Component) {
8717
8577
  tabContent = _react2.default.createElement(
8718
8578
  'div',
8719
8579
  { id: 'anchor', style: { overflow: "auto", height: '' + t.state.tabHeight }, className: 't-PB68 dd-top-border scrollHeight t-PR' },
8720
- _react2.default.createElement(
8721
- 'div',
8722
- { className: t.state.isShowCheckAll && t.state.commonUsedData.length > 0 ? "" : "t-DN" },
8723
- _react2.default.createElement(
8724
- 'div',
8725
- { className: 't-PL16 t-PR16 t-LH3 dd-bottom-border t-BCf', onClick: function onClick() {
8726
- t.checkAllMember("common");
8727
- } },
8728
- _react2.default.createElement(
8729
- HBox,
8730
- { vAlign: 'center' },
8731
- _react2.default.createElement(
8732
- HBox,
8733
- null,
8734
- _react2.default.createElement(
8735
- 'div',
8736
- { className: t.state.commonCheckAll ? 't-checkbox-field-icon-list checked' : 'un-checked t-checkbox-field-icon-list' },
8737
- _react2.default.createElement('i', { className: 'iconfont icon-checked t-FCf t-FS14' })
8738
- )
8739
- ),
8740
- _react2.default.createElement(
8741
- Box,
8742
- { flex: 1, className: 't-ML10' },
8743
- '\u5168\u9009'
8744
- )
8745
- )
8746
- )
8747
- ),
8748
8580
  _react2.default.createElement(
8749
8581
  'div',
8750
8582
  { className: t.state.commonName == "" && t.state.isShowNav ? "t-BCf7 t-OFA t-WSN dd-bottom-border" : "t-DN" },
@@ -49,8 +49,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
49
49
 
50
50
  function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
51
51
 
52
- 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; } /**
53
- * 流程批示意见区块(默认意见、退回意见等),与 TblForm 纯表单分离使用
52
+ 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; } /**
53
+ * 流程批示意见区块(默认意见、退回意见等),与 TblForm 纯表单分离使用
54
54
  */
55
55
 
56
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.3.10",
3
+ "version": "2.3.11",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",