tplus-components-touch 3.22.12 → 3.22.16

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.
Files changed (233) hide show
  1. package/package.json +1 -1
  2. package/dist/components/acCitySelect/CitySelect.js +0 -541
  3. package/dist/components/acCitySelect/CitySelect.js.map +0 -1
  4. package/dist/components/acCitySelect/CitySelect.less +0 -10
  5. package/dist/components/acCitySelect/citys.js +0 -1270
  6. package/dist/components/acCitySelect/citys.js.map +0 -1
  7. package/dist/components/acCitySelect/index.js +0 -18
  8. package/dist/components/acCitySelect/index.js.map +0 -1
  9. package/dist/components/acCitySelect/provinceData.js +0 -40
  10. package/dist/components/acCitySelect/provinceData.js.map +0 -1
  11. package/dist/components/addLog/AddLogProcessor.js +0 -49
  12. package/dist/components/addLog/AddLogProcessor.js.map +0 -1
  13. package/dist/components/addLog/OperationLogApi.js +0 -125
  14. package/dist/components/addLog/OperationLogApi.js.map +0 -1
  15. package/dist/components/autoComplete/index.js +0 -245
  16. package/dist/components/autoComplete/index.js.map +0 -1
  17. package/dist/components/autoComplete/index.less +0 -89
  18. package/dist/components/autoComplete/option.js +0 -75
  19. package/dist/components/autoComplete/option.js.map +0 -1
  20. package/dist/components/autoCompleteWithKeyboard/index.js +0 -231
  21. package/dist/components/autoCompleteWithKeyboard/index.js.map +0 -1
  22. package/dist/components/autoCompleteWithKeyboard/index.less +0 -8
  23. package/dist/components/billSearch/api.js +0 -465
  24. package/dist/components/billSearch/api.js.map +0 -1
  25. package/dist/components/billSearch/index.js +0 -2063
  26. package/dist/components/billSearch/index.js.map +0 -1
  27. package/dist/components/billSearch/index.less +0 -373
  28. package/dist/components/cloudPrint/BTPrintFormatUtil.js +0 -568
  29. package/dist/components/cloudPrint/BTPrintFormatUtil.js.map +0 -1
  30. package/dist/components/cloudPrint/api.js +0 -349
  31. package/dist/components/cloudPrint/api.js.map +0 -1
  32. package/dist/components/cloudPrint/index.js +0 -674
  33. package/dist/components/cloudPrint/index.js.map +0 -1
  34. package/dist/components/cloudPrint/printDispatch.js +0 -223
  35. package/dist/components/cloudPrint/printDispatch.js.map +0 -1
  36. package/dist/components/commonForm/addressPicker/index.js +0 -232
  37. package/dist/components/commonForm/addressPicker/index.js.map +0 -1
  38. package/dist/components/commonForm/addressPicker/style.less +0 -11
  39. package/dist/components/commonForm/autoComplete/index.js +0 -241
  40. package/dist/components/commonForm/autoComplete/index.js.map +0 -1
  41. package/dist/components/commonForm/autoComplete/style.less +0 -3
  42. package/dist/components/commonForm/datePicker/index.js +0 -89
  43. package/dist/components/commonForm/datePicker/index.js.map +0 -1
  44. package/dist/components/commonForm/datePicker/style.less +0 -5
  45. package/dist/components/commonForm/formControl/index.js +0 -143
  46. package/dist/components/commonForm/formControl/index.js.map +0 -1
  47. package/dist/components/commonForm/formControl/style.less +0 -0
  48. package/dist/components/commonForm/index.js +0 -225
  49. package/dist/components/commonForm/index.js.map +0 -1
  50. package/dist/components/commonForm/inputNumber/index.js +0 -272
  51. package/dist/components/commonForm/inputNumber/index.js.map +0 -1
  52. package/dist/components/commonForm/inputNumber/style.less +0 -11
  53. package/dist/components/commonForm/radio/index.js +0 -132
  54. package/dist/components/commonForm/radio/index.js.map +0 -1
  55. package/dist/components/commonForm/radio/style.less +0 -0
  56. package/dist/components/commonForm/style.less +0 -2
  57. package/dist/components/deliverySearch/api.js +0 -355
  58. package/dist/components/deliverySearch/api.js.map +0 -1
  59. package/dist/components/deliverySearch/index.js +0 -1214
  60. package/dist/components/deliverySearch/index.js.map +0 -1
  61. package/dist/components/deliverySearch/index.less +0 -554
  62. package/dist/components/form/index.js +0 -310
  63. package/dist/components/form/index.js.map +0 -1
  64. package/dist/components/hardwareAPI/index.js +0 -181
  65. package/dist/components/hardwareAPI/index.js.map +0 -1
  66. package/dist/components/hotKey/config.js +0 -306
  67. package/dist/components/hotKey/config.js.map +0 -1
  68. package/dist/components/hotKey/hotKeyModal.js +0 -479
  69. package/dist/components/hotKey/hotKeyModal.js.map +0 -1
  70. package/dist/components/hotKey/index.js +0 -785
  71. package/dist/components/hotKey/index.js.map +0 -1
  72. package/dist/components/hotKey/localConfig.js +0 -1021
  73. package/dist/components/hotKey/localConfig.js.map +0 -1
  74. package/dist/components/hotKey/style.less +0 -96
  75. package/dist/components/hotKey/utils.js +0 -135
  76. package/dist/components/hotKey/utils.js.map +0 -1
  77. package/dist/components/input/index.js +0 -251
  78. package/dist/components/input/index.js.map +0 -1
  79. package/dist/components/input/style.less +0 -99
  80. package/dist/components/input/tplusInput/index.js +0 -81
  81. package/dist/components/input/tplusInput/index.js.map +0 -1
  82. package/dist/components/input/tplusInput/inputContent.js +0 -128
  83. package/dist/components/input/tplusInput/inputContent.js.map +0 -1
  84. package/dist/components/input/tplusInput/inputs.js +0 -151
  85. package/dist/components/input/tplusInput/inputs.js.map +0 -1
  86. package/dist/components/input/tplusInput/style.less +0 -132
  87. package/dist/components/input/utils/index.js +0 -26
  88. package/dist/components/input/utils/index.js.map +0 -1
  89. package/dist/components/inventorySearch/api.js +0 -214
  90. package/dist/components/inventorySearch/api.js.map +0 -1
  91. package/dist/components/inventorySearch/index.js +0 -303
  92. package/dist/components/inventorySearch/index.js.map +0 -1
  93. package/dist/components/inventorySearch/index.less +0 -120
  94. package/dist/components/inventorySearch/store.js +0 -344
  95. package/dist/components/inventorySearch/store.js.map +0 -1
  96. package/dist/components/inventorySearch/tab.js +0 -258
  97. package/dist/components/inventorySearch/tab.js.map +0 -1
  98. package/dist/components/keyboard/index.js +0 -255
  99. package/dist/components/keyboard/index.js.map +0 -1
  100. package/dist/components/keyboard/index.less +0 -470
  101. package/dist/components/keyboard/letterKeyboard.js +0 -210
  102. package/dist/components/keyboard/letterKeyboard.js.map +0 -1
  103. package/dist/components/keyboard/numKeyboard.js +0 -459
  104. package/dist/components/keyboard/numKeyboard.js.map +0 -1
  105. package/dist/components/keyboard/numKeyboardScan.js +0 -195
  106. package/dist/components/keyboard/numKeyboardScan.js.map +0 -1
  107. package/dist/components/keyboard/numberButton_input.js +0 -303
  108. package/dist/components/keyboard/numberButton_input.js.map +0 -1
  109. package/dist/components/keyboard/numkeyboardPassword.js +0 -460
  110. package/dist/components/keyboard/numkeyboardPassword.js.map +0 -1
  111. package/dist/components/keyboard/onlyKeyboard.js +0 -90
  112. package/dist/components/keyboard/onlyKeyboard.js.map +0 -1
  113. package/dist/components/keyboard/onlyLetterButton.js +0 -187
  114. package/dist/components/keyboard/onlyLetterButton.js.map +0 -1
  115. package/dist/components/keyboard/onlyLetterButton2.js +0 -235
  116. package/dist/components/keyboard/onlyLetterButton2.js.map +0 -1
  117. package/dist/components/keyboard/onlyLetterButton2.less +0 -162
  118. package/dist/components/keyboard/onlyNumberButton.js +0 -128
  119. package/dist/components/keyboard/onlyNumberButton.js.map +0 -1
  120. package/dist/components/keyboard/onlyNumberButton2.js +0 -115
  121. package/dist/components/keyboard/onlyNumberButton2.js.map +0 -1
  122. package/dist/components/keyboard/textKeyboard.js +0 -50
  123. package/dist/components/keyboard/textKeyboard.js.map +0 -1
  124. package/dist/components/layout/hamburger.js +0 -29
  125. package/dist/components/layout/hamburger.js.map +0 -1
  126. package/dist/components/layout/index.js +0 -31
  127. package/dist/components/layout/index.js.map +0 -1
  128. package/dist/components/layout/layout.js +0 -182
  129. package/dist/components/layout/layout.js.map +0 -1
  130. package/dist/components/layout/sider.js +0 -165
  131. package/dist/components/layout/sider.js.map +0 -1
  132. package/dist/components/layout/style.less +0 -82
  133. package/dist/components/loading/index.js +0 -198
  134. package/dist/components/loading/index.js.map +0 -1
  135. package/dist/components/loading/loadingContent.js +0 -176
  136. package/dist/components/loading/loadingContent.js.map +0 -1
  137. package/dist/components/loading/style.less +0 -61
  138. package/dist/components/loading/utils.js +0 -29
  139. package/dist/components/loading/utils.js.map +0 -1
  140. package/dist/components/message/index.js +0 -308
  141. package/dist/components/message/index.js.map +0 -1
  142. package/dist/components/message/index.less +0 -101
  143. package/dist/components/modal/index.js +0 -93
  144. package/dist/components/modal/index.js.map +0 -1
  145. package/dist/components/modal/index.less +0 -19
  146. package/dist/components/modalVertical/index.js +0 -325
  147. package/dist/components/modalVertical/index.js.map +0 -1
  148. package/dist/components/modalVertical/style.less +0 -60
  149. package/dist/components/modalWraper/index.js +0 -470
  150. package/dist/components/modalWraper/index.js.map +0 -1
  151. package/dist/components/modalWraper/style.less +0 -257
  152. package/dist/components/modalWraper/utils.js +0 -48
  153. package/dist/components/modalWraper/utils.js.map +0 -1
  154. package/dist/components/notification/index.js +0 -119
  155. package/dist/components/notification/index.js.map +0 -1
  156. package/dist/components/notification/index.less +0 -52
  157. package/dist/components/overflowTip/index.js +0 -269
  158. package/dist/components/overflowTip/index.js.map +0 -1
  159. package/dist/components/overflowTip/style.less +0 -66
  160. package/dist/components/page/index.js +0 -49
  161. package/dist/components/page/index.js.map +0 -1
  162. package/dist/components/page/index.less +0 -22
  163. package/dist/components/product/detail.js +0 -148
  164. package/dist/components/product/detail.js.map +0 -1
  165. package/dist/components/product/getCard.js +0 -145
  166. package/dist/components/product/getCard.js.map +0 -1
  167. package/dist/components/product/index.less +0 -128
  168. package/dist/components/progressState/EmptyAndErrorView.js +0 -143
  169. package/dist/components/progressState/EmptyAndErrorView.js.map +0 -1
  170. package/dist/components/progressState/ProgressState.js +0 -157
  171. package/dist/components/progressState/ProgressState.js.map +0 -1
  172. package/dist/components/progressState/index.js +0 -14
  173. package/dist/components/progressState/index.js.map +0 -1
  174. package/dist/components/progressState/style.less +0 -65
  175. package/dist/components/scan/index.js +0 -219
  176. package/dist/components/scan/index.js.map +0 -1
  177. package/dist/components/scan/index.less +0 -34
  178. package/dist/components/select/index.js +0 -28
  179. package/dist/components/select/index.js.map +0 -1
  180. package/dist/components/select/index.less +0 -12
  181. package/dist/components/settlement/asyncModal.js +0 -204
  182. package/dist/components/settlement/asyncModal.js.map +0 -1
  183. package/dist/components/settlement/index.js +0 -16
  184. package/dist/components/settlement/index.js.map +0 -1
  185. package/dist/components/settlement/prototypeTable/index.js +0 -349
  186. package/dist/components/settlement/prototypeTable/index.js.map +0 -1
  187. package/dist/components/settlement/prototypeTable/style.less +0 -59
  188. package/dist/components/settlement/prototypeTable/utils.js +0 -14
  189. package/dist/components/settlement/prototypeTable/utils.js.map +0 -1
  190. package/dist/components/settlement/settlement.js +0 -5465
  191. package/dist/components/settlement/settlement.js.map +0 -1
  192. package/dist/components/settlement/settlement.less +0 -1586
  193. package/dist/components/settlement/settlementStore.js +0 -2122
  194. package/dist/components/settlement/settlementStore.js.map +0 -1
  195. package/dist/components/settlement/utils.js +0 -249
  196. package/dist/components/settlement/utils.js.map +0 -1
  197. package/dist/components/socket/index.js +0 -220
  198. package/dist/components/socket/index.js.map +0 -1
  199. package/dist/components/spin/index.js +0 -95
  200. package/dist/components/spin/index.js.map +0 -1
  201. package/dist/components/spin/spin-style.less +0 -436
  202. package/dist/components/test/index.js +0 -330
  203. package/dist/components/test/index.js.map +0 -1
  204. package/dist/components/ticon/iconfont/demo.css +0 -539
  205. package/dist/components/ticon/iconfont/demo_index.html +0 -5202
  206. package/dist/components/ticon/iconfont/iconfont.css +0 -887
  207. package/dist/components/ticon/iconfont/iconfont.eot +0 -0
  208. package/dist/components/ticon/iconfont/iconfont.js +0 -35
  209. package/dist/components/ticon/iconfont/iconfont.js.map +0 -1
  210. package/dist/components/ticon/iconfont/iconfont.json +0 -1535
  211. package/dist/components/ticon/iconfont/iconfont.svg +0 -593
  212. package/dist/components/ticon/iconfont/iconfont.ttf +0 -0
  213. package/dist/components/ticon/iconfont/iconfont.woff +0 -0
  214. package/dist/components/ticon/iconfont/iconfont.woff2 +0 -0
  215. package/dist/components/ticon/index.js +0 -60
  216. package/dist/components/ticon/index.js.map +0 -1
  217. package/dist/components/touchScroll/index.js +0 -182
  218. package/dist/components/touchScroll/index.js.map +0 -1
  219. package/dist/components/touchTable/AuthProcess.js +0 -42
  220. package/dist/components/touchTable/AuthProcess.js.map +0 -1
  221. package/dist/components/touchTable/generateWater.js +0 -59
  222. package/dist/components/touchTable/generateWater.js.map +0 -1
  223. package/dist/components/touchTable/index.js +0 -1109
  224. package/dist/components/touchTable/index.js.map +0 -1
  225. package/dist/components/touchTable/index.less +0 -370
  226. package/dist/components/touchTable/utils.js +0 -14
  227. package/dist/components/touchTable/utils.js.map +0 -1
  228. package/dist/demo/PopOverDemo.js +0 -126
  229. package/dist/demo/PopOverDemo.js.map +0 -1
  230. package/dist/index.js +0 -249
  231. package/dist/index.js.map +0 -1
  232. package/dist/util/tools.js +0 -202
  233. package/dist/util/tools.js.map +0 -1
@@ -1,1109 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.InputNumberCell = undefined;
7
-
8
- var _table = require('antd/es/table');
9
-
10
- var _table2 = _interopRequireDefault(_table);
11
-
12
- var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
13
-
14
- var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
15
-
16
- var _regenerator = require('babel-runtime/regenerator');
17
-
18
- var _regenerator2 = _interopRequireDefault(_regenerator);
19
-
20
- var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');
21
-
22
- var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
23
-
24
- var _extends2 = require('babel-runtime/helpers/extends');
25
-
26
- var _extends3 = _interopRequireDefault(_extends2);
27
-
28
- var _typeof2 = require('babel-runtime/helpers/typeof');
29
-
30
- var _typeof3 = _interopRequireDefault(_typeof2);
31
-
32
- var _checkbox = require('antd/es/checkbox');
33
-
34
- var _checkbox2 = _interopRequireDefault(_checkbox);
35
-
36
- var _set = require('babel-runtime/core-js/set');
37
-
38
- var _set2 = _interopRequireDefault(_set);
39
-
40
- var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray');
41
-
42
- var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
43
-
44
- var _getIterator2 = require('babel-runtime/core-js/get-iterator');
45
-
46
- var _getIterator3 = _interopRequireDefault(_getIterator2);
47
-
48
- var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
49
-
50
- var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
51
-
52
- var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
53
-
54
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
55
-
56
- var _createClass2 = require('babel-runtime/helpers/createClass');
57
-
58
- var _createClass3 = _interopRequireDefault(_createClass2);
59
-
60
- var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
61
-
62
- var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
63
-
64
- var _inherits2 = require('babel-runtime/helpers/inherits');
65
-
66
- var _inherits3 = _interopRequireDefault(_inherits2);
67
-
68
- var _class, _temp; /**
69
- *
70
- * waterMark 水印文字内容
71
- * waterMarkOption 水印参数 Object类型 (width, height, font, color,rotate)
72
- *
73
- * badge Boolean 徽章 在dataSource(data) 属性中每一行的数据定义badge字段会自动生成,不需要定义对应的columns
74
- * dataSource: [{badge: {text: '赠', position: 'leftTop', className: ''}}]
75
- * badge: text 文字内容 | position 徽章位置(leftTop/rightTop/leftBottom/rightBottom) | className
76
- *
77
- */
78
-
79
-
80
- require('antd/es/table/style');
81
-
82
- require('antd/es/checkbox/style');
83
-
84
- var _react = require('react');
85
-
86
- var _react2 = _interopRequireDefault(_react);
87
-
88
- var _propTypes = require('prop-types');
89
-
90
- var _propTypes2 = _interopRequireDefault(_propTypes);
91
-
92
- var _index = require('../../index');
93
-
94
- var _generateWater = require('./generateWater.js');
95
-
96
- var _utils = require('./utils');
97
-
98
- var _tools = require('../../util/tools.js');
99
-
100
- var _tools2 = _interopRequireDefault(_tools);
101
-
102
- require('./index.less');
103
-
104
- var _get2 = require('lodash/get');
105
-
106
- var _get3 = _interopRequireDefault(_get2);
107
-
108
- var _mobx = require('mobx');
109
-
110
- var _mobx2 = _interopRequireDefault(_mobx);
111
-
112
- var _beeTable = require('bee-table');
113
-
114
- var _beeTable2 = _interopRequireDefault(_beeTable);
115
-
116
- require('bee-table/build/Table.css');
117
-
118
- var _message = require('../message');
119
-
120
- var _message2 = _interopRequireDefault(_message);
121
-
122
- var _AuthProcess = require('./AuthProcess');
123
-
124
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
125
-
126
- var emptyTabImage = 'https://newretail.static.chanjet.com/empty.png';
127
-
128
- var InputNumberCell = exports.InputNumberCell = function (_Component) {
129
- (0, _inherits3.default)(InputNumberCell, _Component);
130
-
131
- function InputNumberCell() {
132
- (0, _classCallCheck3.default)(this, InputNumberCell);
133
- return (0, _possibleConstructorReturn3.default)(this, (InputNumberCell.__proto__ || (0, _getPrototypeOf2.default)(InputNumberCell)).apply(this, arguments));
134
- }
135
-
136
- (0, _createClass3.default)(InputNumberCell, [{
137
- key: 'render',
138
- value: function render() {
139
- var _props = this.props,
140
- val = _props.val,
141
- text = _props.text,
142
- record = _props.record,
143
- index = _props.index,
144
- selectedRowKeys = _props.selectedRowKeys,
145
- rowItem = _props.rowItem,
146
- _props$rowHeight = _props.rowHeight,
147
- rowHeight = _props$rowHeight === undefined ? 50 : _props$rowHeight,
148
- handleClick = _props.handleClick,
149
- mergeQuantityUnit = _props.mergeQuantityUnit;
150
-
151
- var _ref = record || {},
152
- Unit = _ref.Unit;
153
-
154
- var unitname = Unit && Unit.Name;
155
- var fileName = rowItem.FieldName ? rowItem.FieldName : rowItem.key;
156
- val = !!mergeQuantityUnit && fileName == 'Quantity' ? val + unitname || '' : val;
157
- if (selectedRowKeys && selectedRowKeys.length > 0) {
158
- var _iteratorNormalCompletion = true;
159
- var _didIteratorError = false;
160
- var _iteratorError = undefined;
161
-
162
- try {
163
- for (var _iterator = (0, _getIterator3.default)(selectedRowKeys), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
164
- var item = _step.value;
165
-
166
- if (index === parseInt(item) && rowItem.readOnly === false) {
167
- return _react2.default.createElement(
168
- 'div',
169
- { className: rowItem.quick == true ? 'selectedCell' : 'unSelectedCell' },
170
- rowItem.quick == true && _react2.default.createElement(_index.Ticon, { type: 'jianqu', className: 'iconKey primary-color', style: { height: rowHeight + 'px', lineHeight: rowHeight + 'px' }, onClick: function onClick(e) {
171
- return handleClick(e, 'minus', text, record, index, rowItem);
172
- } }),
173
- _react2.default.createElement(
174
- 'span',
175
- { onClick: function onClick(e) {
176
- return handleClick(e, 'modal', text, record, index, rowItem);
177
- }, className: 'iconText row-cell-div row-cell-pad mouse hot-key-' + (rowItem.FieldName ? rowItem.FieldName : rowItem.key) },
178
- val
179
- ),
180
- rowItem.quick == true && _react2.default.createElement(_index.Ticon, { type: 'zengjia', className: 'iconKey primary-color', style: { height: rowHeight + 'px', lineHeight: rowHeight + 'px' }, onClick: function onClick(e) {
181
- return handleClick(e, 'plus', text, record, index, rowItem);
182
- } })
183
- );
184
- }
185
- }
186
- } catch (err) {
187
- _didIteratorError = true;
188
- _iteratorError = err;
189
- } finally {
190
- try {
191
- if (!_iteratorNormalCompletion && _iterator.return) {
192
- _iterator.return();
193
- }
194
- } finally {
195
- if (_didIteratorError) {
196
- throw _iteratorError;
197
- }
198
- }
199
- }
200
- }
201
- return _react2.default.createElement(
202
- 'div',
203
- { className: 'unSelectedCell' },
204
- _react2.default.createElement(
205
- 'span',
206
- { className: 'iconText row-cell-div row-cell-pad' },
207
- val
208
- )
209
- );
210
- }
211
- }]);
212
- return InputNumberCell;
213
- }(_react.Component);
214
-
215
- var TouchTable = (_temp = _class = function (_Component2) {
216
- (0, _inherits3.default)(TouchTable, _Component2);
217
-
218
- function TouchTable(props) {
219
- var _this3 = this;
220
-
221
- (0, _classCallCheck3.default)(this, TouchTable);
222
-
223
- var _this2 = (0, _possibleConstructorReturn3.default)(this, (TouchTable.__proto__ || (0, _getPrototypeOf2.default)(TouchTable)).call(this, props));
224
-
225
- _this2.renderCheckbox = function (text, record, index) {
226
- Array.prototype.remove = function (val) {
227
- var index = this.indexOf(val);
228
- if (index > -1) {
229
- this.splice(index, 1);
230
- }
231
- };
232
- var _onChange = function _onChange(checked, index) {
233
- var arr = _this2.state.selectedRowKeys;
234
- if (checked === true) {
235
- arr.push(index);
236
- } else if (checked === false) {
237
- arr.remove(index);
238
- }
239
- _this2.setSelectedRowKeys([].concat((0, _toConsumableArray3.default)(new _set2.default(arr))));
240
- var fn = _this2.props.cboxClick;
241
- if (typeof fn == 'function') {
242
- fn(checked, index);
243
- }
244
- };
245
- var status = _this2.findSelectedRowKeys(index);
246
- return _react2.default.createElement(
247
- 'div',
248
- { style: { margin: 'auto', width: '20px' } },
249
- _react2.default.createElement(_checkbox2.default, { className: 'test', checked: status, onChange: function onChange(event) {
250
- return _onChange(event, index);
251
- } })
252
- );
253
- };
254
-
255
- _this2.renderLineNum = function (text, record, index) {
256
- return index + 1;
257
- //return this.prefixZero(index + 1, 2);
258
- };
259
-
260
- _this2.renderNumber = function (text, record, index, item) {
261
- var mergeQuantityUnit = _this2.props.mergeQuantityUnit;
262
-
263
- var precision = parseInt(item.precision);
264
- var isPercent = 'Format' in item && item.Format == 'Percent';
265
- text = isPercent ? _this2.changeDecimalMul(text, 100) : text;
266
- var val = _this2.changeDecimalBuZero(text, precision);
267
- val = isPercent ? val + "%" : val;
268
- var rowIndexs = _this2.state.selectedRowKeys;
269
- return _react2.default.createElement(InputNumberCell, {
270
- val: val,
271
- text: text,
272
- record: record,
273
- index: index,
274
- selectedRowKeys: rowIndexs,
275
- rowItem: item,
276
- mergeQuantityUnit: mergeQuantityUnit,
277
- handleClick: _this2.handleClick });
278
- };
279
-
280
- _this2.renderAction = function (text, record, index) {
281
- var status = _this2.findSelectedRowKeys(index);
282
- if (status == true) {
283
- return _react2.default.createElement(
284
- 'span',
285
- { className: 'spanDel', onClick: function onClick(e) {
286
- return _this2.handleClick(e, 'del', index, record);
287
- } },
288
- _react2.default.createElement(_index.Ticon, { type: 'shanchu', className: 'iconDel primary-color' })
289
- );
290
- } else {
291
- return '';
292
- }
293
- };
294
-
295
- _this2.renderOther = function (showText, record, index, item) {
296
- var _this2$props = _this2.props,
297
- badge = _this2$props.badge,
298
- _this2$props$height = _this2$props.height,
299
- height = _this2$props$height === undefined ? 50 : _this2$props$height,
300
- type = _this2$props.type;
301
- //针对存货为赠品属性的处理逻辑。
302
-
303
- if (item && item.Name == 'Inventory' && badge && record.badge) {
304
- var _record$badge = record.badge;
305
- _record$badge = _record$badge === undefined ? {} : _record$badge;
306
- var text = _record$badge.text,
307
- _record$badge$positio = _record$badge.position,
308
- position = _record$badge$positio === undefined ? 'leftTop' : _record$badge$positio,
309
- _record$badge$classNa = _record$badge.className,
310
- className = _record$badge$classNa === undefined ? '' : _record$badge$classNa;
311
-
312
- var badgeClassName = _utils.badgeClassNames[position];
313
- var baseNum = position.includes('Bottom') ? 25 : 0;
314
- var style = {};
315
- if (type === 'bee') {
316
- style = {
317
- top: baseNum + height * index
318
- };
319
- }
320
- return _react2.default.createElement(
321
- 'div',
322
- { className: 'tplus-table-badge' },
323
- _react2.default.createElement(
324
- 'div',
325
- { className: 'badge-item ' + className + ' ' + badgeClassName, style: style },
326
- _react2.default.createElement(
327
- 'span',
328
- null,
329
- text
330
- )
331
- ),
332
- _react2.default.createElement(
333
- 'div',
334
- { className: 'row-cell-div row-cell-pad', style: { width: '100%' } },
335
- showText
336
- )
337
- );
338
- }
339
- //增加宽度是为了控制超出之后显示省略号。
340
- return _react2.default.createElement(
341
- 'div',
342
- { className: 'row-cell-div row-cell-pad', style: { width: '100%' } },
343
- showText
344
- );
345
- };
346
-
347
- _this2.renderUserDefined = function (text, record, index, item) {
348
- var fn = item.callbackFunc;
349
- if (typeof fn == 'function') {
350
- return fn();
351
- } else {
352
- return '';
353
- }
354
- };
355
-
356
- _this2.getRowClassName = function (record, index) {
357
- var status = _this2.findSelectedRowKeys(index);
358
- if (status == true) {
359
- return 'row-selected';
360
- } else {
361
- return '';
362
- }
363
- };
364
-
365
- _this2.renderIntegralExchangeItem = function (text, record, index, item, exchangeIntegralValue) {
366
- return _react2.default.createElement(
367
- 'div',
368
- { onClick: function onClick(e) {
369
- return _this2.handleClick(e, 'modal', text, record, index, item);
370
- }, className: 'Integral-exchange-item hot-key-' + (item.FieldName ? item.FieldName : item.key) },
371
- _react2.default.createElement(
372
- 'span',
373
- { className: 'money iconText row-cell-div mouse' },
374
- exchangeIntegralValue + "积分"
375
- ),
376
- _react2.default.createElement(
377
- 'span',
378
- { className: 'value iconText row-cell-div mouse' },
379
- '¥' + text
380
- )
381
- );
382
- };
383
-
384
- _this2.getRenderColumns = function (cols, dataSource) {
385
- var _this2$props2 = _this2.props,
386
- badge = _this2$props2.badge,
387
- _this2$props2$height = _this2$props2.height,
388
- height = _this2$props2$height === undefined ? 50 : _this2$props2$height,
389
- mergeQuantityUnit = _this2$props2.mergeQuantityUnit,
390
- type = _this2$props2.type;
391
-
392
- var arr = [];
393
- var check = typeof _this2.props.checkbox == 'boolean' ? _this2.props.checkbox : false;
394
- if (check === true) {
395
- arr.push({
396
- key: 'checkbox',
397
- dataIndex: 'checkbox',
398
- title: '',
399
- width: 25,
400
- textAlign: 'center',
401
- readOnly: true,
402
- render: function render(text, record, index) {
403
- return _this2.renderCheckbox(text, record, index);
404
- }
405
- });
406
- }
407
- var lineType = typeof _this2.props.lineNum == 'boolean' ? _this2.props.lineNum : false;
408
- if (lineType === true) {
409
- arr.push({
410
- key: 'rowNum',
411
- dataIndex: 'rowNum',
412
- title: '行号',
413
- width: 50,
414
- textAlign: 'center',
415
- readOnly: true,
416
- fixed: 'left',
417
- render: function render(text, record, index) {
418
- return _this2.renderLineNum(text, record, index);
419
- }
420
- });
421
- }
422
- if (cols && cols.length > 0) {
423
- var _loop = function _loop(_item) {
424
- if (_item.controlType === 'NumTextBox') {
425
- _item.render = function (text, record, index) {
426
- // 增加积分抵现特殊显示方式
427
- var dsItem = dataSource && dataSource[index];
428
- if (dsItem && dsItem.IsIntegralExchange && (_item.FieldName == "TaxPrice" || _item.FieldName == "TaxAmount")) {
429
- var singleExchangeIntegral = dataSource[index].ExchangeIntegral;
430
- var exchangeIntegralValue = _item.FieldName == "TaxPrice" ? singleExchangeIntegral : singleExchangeIntegral * dataSource[index].Quantity;
431
- if (exchangeIntegralValue > 0) {
432
- exchangeIntegralValue = Math.ceil(exchangeIntegralValue);
433
- } else {
434
- exchangeIntegralValue = Math.floor(exchangeIntegralValue);
435
- }
436
- return _this2.renderIntegralExchangeItem(text, record, index, _item, exchangeIntegralValue);
437
- }
438
- return _this2.renderNumber(text, record, index, _item);
439
- };
440
- } else if (_item.controlType === 'Userdefined') {
441
- _item.render = function (text, record, index) {
442
- return _this2.renderUserDefined(text, record, index, _item);
443
- };
444
- } else if (_item.controlType === 'DatePicker' || _item.controlType === 'DateDropDown') {
445
- _item.render = function (text, record, index) {
446
- var renderText = _tools2.default.dateFormat(text, _item.Format);
447
- return _react2.default.createElement(
448
- 'span',
449
- null,
450
- renderText
451
- );
452
- };
453
- } else {
454
- _item.render = function (text, record, index) {
455
- if (text && (typeof text === 'undefined' ? 'undefined' : (0, _typeof3.default)(text)) == 'object') {
456
- text = (0, _get3.default)(record, _item.FieldName);
457
- }
458
- if (text && (typeof text === 'undefined' ? 'undefined' : (0, _typeof3.default)(text)) == 'object' && 'Name' in text) {
459
- text = text['Name'];
460
- }
461
- return _this2.renderOther(text, record, index, _item);
462
- };
463
- }
464
- if (type !== 'bee') {
465
- if (_item.dataIndex.lastIndexOf(".") > 0) {
466
- _item.dataIndex = _item.dataIndex.split('.');
467
- }
468
- _item.align = _item.textAlign;
469
- }
470
- if (mergeQuantityUnit && _item.FieldName == 'Quantity') {
471
- _item = (0, _extends3.default)({}, _item, { title: '数量/单位' });
472
- }
473
- arr.push(_item);
474
- item = _item;
475
- };
476
-
477
- var _iteratorNormalCompletion2 = true;
478
- var _didIteratorError2 = false;
479
- var _iteratorError2 = undefined;
480
-
481
- try {
482
- for (var _iterator2 = (0, _getIterator3.default)(cols), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
483
- var item = _step2.value;
484
-
485
- _loop(item);
486
- }
487
- } catch (err) {
488
- _didIteratorError2 = true;
489
- _iteratorError2 = err;
490
- } finally {
491
- try {
492
- if (!_iteratorNormalCompletion2 && _iterator2.return) {
493
- _iterator2.return();
494
- }
495
- } finally {
496
- if (_didIteratorError2) {
497
- throw _iteratorError2;
498
- }
499
- }
500
- }
501
- }
502
- //最后一列留白,解决最后一列自适应宽度的问题
503
- var lastColumnResize = typeof _this2.props.lastColumnResize == 'boolean' ? _this2.props.lastColumnResize : false;
504
- if (lastColumnResize == true) {
505
- arr.push({
506
- key: 'resize',
507
- dataIndex: 'resize',
508
- title: '',
509
- width: 10,
510
- textAlign: 'center',
511
- readOnly: true
512
- });
513
- }
514
- var delType = typeof _this2.props.delRow == 'boolean' ? _this2.props.delRow : true;
515
- var dynamics = typeof _this2.props.isFixDelColumn == 'boolean' && _this2.props.isFixDelColumn == true ? { fixed: 'right', width: 50 } : { width: 28 };
516
- if (delType === true) {
517
- arr.push((0, _extends3.default)({
518
- key: 'del'
519
- }, dynamics, {
520
- dataIndex: 'del',
521
- title: '',
522
- className: 'shanchu',
523
- textAlign: 'center', //beeTable居中
524
- align: 'center', //antTable居中
525
- render: function render(text, record, index) {
526
- return _this2.renderAction(text, record, index);
527
- }
528
- }));
529
- }
530
- return arr;
531
- };
532
-
533
- _this2.stopPropagation = function (_event) {
534
- if (_event && _event.stopPropagation) {
535
- _event.stopPropagation();
536
- }
537
- };
538
-
539
- _this2.handleClick = function (_event, type) {
540
- for (var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
541
- rest[_key - 2] = arguments[_key];
542
- }
543
-
544
- _this2.isHitRow = true;
545
- var lists = _this2.props.dataSource;
546
- switch (type) {
547
- case 'rowClick':
548
- _this2.rowClick.apply(_this2, rest);
549
- break;
550
- case 'del':
551
- _this2.delClick.apply(_this2, [lists].concat(rest));
552
- _this2.stopPropagation(_event);
553
- break;
554
- case 'minus':
555
- _this2.minusClick.apply(_this2, [lists].concat(rest));
556
- _this2.stopPropagation(_event);
557
- break;
558
- case 'plus':
559
- _this2.plusClick.apply(_this2, [lists].concat(rest));
560
- _this2.stopPropagation(_event);
561
- break;
562
- case 'modal':
563
- _this2.modalClick.apply(_this2, rest);
564
- break;
565
- }
566
- };
567
-
568
- _this2.selfHandleClick = function () {
569
- var _this2$props$rowIndex = _this2.props.rowIndex,
570
- rowIndex = _this2$props$rowIndex === undefined ? undefined : _this2$props$rowIndex;
571
-
572
- if (rowIndex == undefined) {
573
- return true;
574
- }
575
- return false;
576
- };
577
-
578
- _this2.rowClick = function (record, index, fn) {
579
- if (_this2.selfHandleClick()) {
580
- //当不设置行点击事件时,组件内部处理。
581
- if (_this2.state.selectedRowKeys.indexOf(index) > -1) return;
582
- _this2.setSelectedRowKeys(index, true);
583
- } else {
584
- //当设置点击事件,组件外处理
585
- _this2.outerCallback(_this2.type.click, record, index);
586
- }
587
- };
588
-
589
- _this2.delClick = function () {
590
- var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(lists, index, record) {
591
- var status;
592
- return _regenerator2.default.wrap(function _callee$(_context) {
593
- while (1) {
594
- switch (_context.prev = _context.next) {
595
- case 0:
596
- status = _AuthProcess.AuthProcess.execute('ReverseOperation');
597
-
598
- if (!status) {
599
- _this2.props.authorityValidate && _this2.props.authorityValidate({ callback: function callback(result) {
600
- if (result) {
601
- if (_this2.selfHandleClick()) {
602
- lists.splice(index, 1);
603
- _this2.clearSelectedRows();
604
- } else {
605
- _this2.outerCallback(_this2.type.delete, record, index);
606
- AddLogProcessor.execute("删除行", record.Code, '删除行成功');
607
- }
608
- }
609
- } });
610
- } else {
611
- if (_this2.selfHandleClick()) {
612
- lists.splice(index, 1);
613
- _this2.clearSelectedRows();
614
- } else {
615
- _this2.outerCallback(_this2.type.delete, record, index);
616
- }
617
- }
618
-
619
- case 2:
620
- case 'end':
621
- return _context.stop();
622
- }
623
- }
624
- }, _callee, _this3);
625
- }));
626
-
627
- return function (_x, _x2, _x3) {
628
- return _ref2.apply(this, arguments);
629
- };
630
- }();
631
-
632
- _this2.minusClick = function (lists, text, record, index, rowItem) {
633
- var val = text;
634
- var min = rowItem.minValue;
635
- var quantityUiState = record.uiState && record.uiState.Quantity;
636
- //单元格状态控制
637
- var cellMin = quantityUiState && quantityUiState.min.value;
638
- var cellMinTip = quantityUiState && quantityUiState.min.tip;
639
-
640
- var item = (0, _extends3.default)({}, lists[index]);
641
- var afterValue = _this2.accSub(val, 1);
642
-
643
- if (min !== undefined) {
644
- if (min >= val) return;
645
- afterValue = min >= afterValue ? min : afterValue;
646
- }
647
- //单元格状态控制
648
- if (!_tools2.default.isNull(cellMin)) {
649
- if (cellMin >= val) {
650
- if (!_tools2.default.isNull(cellMinTip)) _message2.default.info(cellMinTip);
651
- return;
652
- }
653
- afterValue = cellMin >= afterValue ? cellMin : afterValue;
654
- }
655
-
656
- item[rowItem.key] = afterValue;
657
- _this2.outerCallback(_this2.type.update, item, index);
658
- };
659
-
660
- _this2.plusClick = function (lists, text, record, index, rowItem) {
661
- if (text.isSerialNumber && text.SerialNumber && text.Amount === 1) {
662
- _message2.default.warn('已录入序列号后,不可增加数量');
663
- return;
664
- }
665
- var val = text;
666
- var max = rowItem.maxValue;
667
- var quantityUiState = record.uiState && record.uiState.Quantity;
668
- //单元格状态控制
669
- var cellMax = quantityUiState && quantityUiState.max.value;
670
- var cellMaxTip = quantityUiState && quantityUiState.max.tip;
671
-
672
- var item = (0, _extends3.default)({}, lists[index]);
673
- var afterValue = _this2.accAdd(val, 1);
674
- if (max !== undefined) {
675
- if (max <= val) return;
676
- afterValue = max <= afterValue ? max : afterValue;
677
- }
678
- //单元格状态控制
679
- if (!_tools2.default.isNull(cellMax)) {
680
- if (cellMax <= val) {
681
- if (!_tools2.default.isNull(cellMaxTip)) _message2.default.info(cellMaxTip);
682
- return;
683
- }
684
- afterValue = cellMax <= afterValue ? cellMax : afterValue;
685
- }
686
- item[rowItem.key] = afterValue;
687
- _this2.outerCallback(_this2.type.update, item, index);
688
- };
689
-
690
- _this2.modalClick = function (text, record, index, rowItem) {
691
- var fn = _this2.props.rowClick;
692
- if (typeof fn == 'function') {
693
- fn(_this2.type.updateField, index, record, rowItem.key, rowItem);
694
- }
695
- };
696
-
697
- _this2.setRow = function (index) {
698
- _this2.setSelectedRowKeys(index);
699
- };
700
-
701
- _this2.setSelectedRowKeys = function (params) {
702
- var _this2$props3 = _this2.props,
703
- rowIndex = _this2$props3.rowIndex,
704
- isScrolling = _this2$props3.isScrolling;
705
-
706
- var arr = new Array();
707
- if (params instanceof Array) {
708
- arr.push.apply(arr, (0, _toConsumableArray3.default)(params));
709
- } else {
710
- arr.push(params);
711
- }
712
- var tops = {};
713
- var isHitRow = event && event.type == 'click' && (event.target.nodeName == 'DIV' || event.target.nodeName == 'I');
714
- if (isScrolling && rowIndex && rowIndex > -1 && !(_this2.isHitRow === true ? true : isHitRow)) {
715
- var scrollTop = _this2.getScrollTopValue();
716
- tops = { scrollTop: scrollTop };
717
- } else {
718
- tops = { scrollTop: null };
719
- }
720
- _this2.setState((0, _extends3.default)({ selectedRowKeys: arr }, tops));
721
- if (_this2.isHitRow === true) {
722
- setTimeout(function () {
723
- _this2.isHitRow = false;
724
- }, 600);
725
- }
726
- };
727
-
728
- _this2.findSelectedRowKeys = function (index) {
729
- var rowIndexs = _this2.state.selectedRowKeys;
730
- if (rowIndexs && rowIndexs.length > 0) {
731
- for (var i = 0; i < rowIndexs.length; i++) {
732
- var _item2 = rowIndexs[i];
733
- if (_item2 === index) {
734
- return true;
735
- }
736
- }
737
- }
738
- return false;
739
- };
740
-
741
- _this2.clearSelectedRows = function () {
742
- _this2.setSelectedRowKeys([]);
743
- };
744
-
745
- _this2.outerCallback = function (type, record, index) {
746
- var cb = _this2.props.rowClick;
747
- if (typeof cb == 'function') cb(type, index, record);
748
- };
749
-
750
- _this2.changeDecimalBuZero = function (number, bitNum) {
751
- if (bitNum == 0) return number;
752
- var f_x = parseFloat(number);
753
- if (isNaN(f_x)) {
754
- return '';
755
- }
756
- // f_x = Math.round(number * 100) / 100;
757
- var newBitNum = Math.pow(10, bitNum);
758
- f_x = Math.round(number * newBitNum) / newBitNum;
759
- var s_x = (f_x + '').toString();
760
- var pos_decimal = s_x.indexOf('.');
761
- if (pos_decimal < 0) {
762
- pos_decimal = s_x.length;
763
- s_x += '.';
764
- }
765
- while (s_x.length <= pos_decimal + bitNum) {
766
- s_x += '0';
767
- }
768
- return s_x;
769
- };
770
-
771
- _this2.changeDecimalMul = function (a, b) {
772
- var c = 0,
773
- d = (a + '').toString(),
774
- e = (b + '').toString();
775
- try {
776
- c += d.split(".")[1].length;
777
- } catch (f) {}
778
- try {
779
- c += e.split(".")[1].length;
780
- } catch (f) {}
781
- return Number(d.replace(".", "")) * Number(e.replace(".", "")) / Math.pow(10, c);
782
- };
783
-
784
- _this2.prefixZero = function (num, n) {
785
- return (Array(n).join(0) + num).slice(-n);
786
- };
787
-
788
- _this2.accAdd = function (arg1, arg2) {
789
- var r1 = void 0,
790
- r2 = void 0,
791
- m = void 0,
792
- c = void 0;
793
- try {
794
- r1 = (arg1 + '').toString().split(".")[1].length;
795
- } catch (e) {
796
- r1 = 0;
797
- }
798
- try {
799
- r2 = (arg2 + '').toString().split(".")[1].length;
800
- } catch (e) {
801
- r2 = 0;
802
- }
803
- c = Math.abs(r1 - r2);
804
- m = Math.pow(10, Math.max(r1, r2));
805
- if (c > 0) {
806
- var cm = Math.pow(10, c);
807
- if (r1 > r2) {
808
- arg1 = Number((arg1 + '').toString().replace(".", ""));
809
- arg2 = Number((arg2 + '').toString().replace(".", "")) * cm;
810
- } else {
811
- arg1 = Number((arg1 + '').toString().replace(".", "")) * cm;
812
- arg2 = Number((arg2 + '').toString().replace(".", ""));
813
- }
814
- } else {
815
- arg1 = Number((arg1 + '').toString().replace(".", ""));
816
- arg2 = Number((arg2 + '').toString().replace(".", ""));
817
- }
818
- return (arg1 + arg2) / m;
819
- };
820
-
821
- _this2.accSub = function (arg1, arg2) {
822
- var r1 = void 0,
823
- r2 = void 0,
824
- m = void 0,
825
- n = void 0;
826
- try {
827
- r1 = (arg1 + '').toString().split(".")[1].length;
828
- } catch (e) {
829
- r1 = 0;
830
- }
831
- try {
832
- r2 = (arg2 + '').toString().split(".")[1].length;
833
- } catch (e) {
834
- r2 = 0;
835
- }
836
- m = Math.pow(10, Math.max(r1, r2)); //last modify by deeka //动态控制精度长度
837
- n = r1 >= r2 ? r1 : r2;
838
- return ((arg1 * m - arg2 * m) / m).toFixed(n);
839
- };
840
-
841
- _this2.emptyFunc = function (tabHeight) {
842
- var emptyStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'txt';
843
-
844
- var type = null;
845
- switch (emptyStyle) {
846
- case 'icon':
847
- type = 1;
848
- break;
849
- case 'txt':
850
- type = 2;
851
- break;
852
- case 'icon-txt':
853
- type = 3;
854
- break;
855
- default:
856
- type = 0;
857
- }
858
- return _react2.default.createElement(
859
- 'div',
860
- { className: 'defaultContainer', style: { height: tabHeight + 'px' } },
861
- _react2.default.createElement(
862
- 'div',
863
- { style: { display: type === 0 ? 'none' : '' } },
864
- _react2.default.createElement('img', { className: 'img', style: { display: type === 1 || type === 3 ? '' : 'none' }, src: emptyTabImage }),
865
- _react2.default.createElement(
866
- 'div',
867
- { style: { display: type === 2 || type === 3 ? '' : 'none' } },
868
- '\u6682\u65E0\u6570\u636E~~'
869
- )
870
- )
871
- );
872
- };
873
-
874
- _this2.getScrollHeight = function () {
875
- var _this2$props4 = _this2.props,
876
- tableHeight = _this2$props4.tableHeight,
877
- _this2$props4$headerH = _this2$props4.headerHeight,
878
- headerHeight = _this2$props4$headerH === undefined ? 50 : _this2$props4$headerH,
879
- type = _this2$props4.type;
880
-
881
- if (typeof tableHeight == 'number') return tableHeight - headerHeight;
882
- var tab = void 0;
883
- if (type === 'bee') {
884
- tab = _this2.tableElement.current;
885
- } else {
886
- tab = document.getElementsByClassName("antTable")[0];
887
- }
888
- if (tab) {
889
- var t = type === 'bee' ? tab.contentTable.parentNode.clientHeight : tab.clientHeight;
890
- return t - headerHeight > 0 ? t - headerHeight : headerHeight;
891
- } else {
892
- return 0;
893
- }
894
- };
895
-
896
- _this2.initScrollHeight = function () {
897
- var scrollHeight = _this2.getScrollHeight();
898
- _this2.setState({ scrollY: scrollHeight });
899
- };
900
-
901
- _this2.getScrollTopValue = function () {
902
- var top = 0;
903
- var _this2$props5 = _this2.props,
904
- _this2$props5$height = _this2$props5.height,
905
- height = _this2$props5$height === undefined ? 50 : _this2$props5$height,
906
- type = _this2$props5.type;
907
-
908
- var bodyTable = void 0;
909
- if (type === 'bee') {
910
- var tab = _this2.tableElement.current;
911
- bodyTable = tab && tab.bodyTable;
912
- } else {
913
- var parentNodeEl = document.getElementsByClassName("antTable")[0];
914
- bodyTable = parentNodeEl.getElementsByClassName('ant-table-body')[0];
915
- }
916
- if (bodyTable.scrollHeight > bodyTable.clientHeight) {
917
- var selectedRowKeys = _this2.state.selectedRowKeys;
918
-
919
- var rowTop = 0;
920
- if (selectedRowKeys && selectedRowKeys.length > 0) {
921
- var index = selectedRowKeys[0];
922
- var tabTop = bodyTable.scrollTop;
923
- var curTop = bodyTable.lastChild.lastChild.childNodes[index].offsetTop;
924
- rowTop = curTop - bodyTable.clientHeight + height + 10;
925
- rowTop = Math.abs(tabTop - curTop) < 100 ? tabTop : rowTop;
926
- }
927
- top = rowTop > 0 ? rowTop : 0;
928
- }
929
- return top;
930
- };
931
-
932
- _this2.state = {
933
- selectedRowKeys: [],
934
- tabColumns: [],
935
- scrollY: 0,
936
- scrollTop: null
937
- };
938
- _this2.checkboxedList = [];
939
- _this2.type = {
940
- click: 'click',
941
- update: 'update',
942
- delete: 'delete',
943
- updateField: 'updateField'
944
- };
945
- _this2.isHitRow = false;
946
- _this2.tableElement = _react2.default.createRef();
947
- _this2.getTableElement = _this2.getTableElement.bind(_this2);
948
- _this2.getRowClassName = _this2.getRowClassName.bind(_this2);
949
- return _this2;
950
- }
951
-
952
- (0, _createClass3.default)(TouchTable, [{
953
- key: 'getTableElement',
954
- value: function getTableElement() {
955
- return this.tableElement;
956
- }
957
- }, {
958
- key: 'generateWaterMark',
959
- value: function generateWaterMark() {
960
- var _props2 = this.props,
961
- waterMark = _props2.waterMark,
962
- _props2$waterMarkOpti = _props2.waterMarkOption,
963
- waterMarkOption = _props2$waterMarkOpti === undefined ? {} : _props2$waterMarkOpti,
964
- type = _props2.type;
965
-
966
- var contentTable = void 0;
967
-
968
- if (type === 'bee') {
969
- contentTable = this.tableElement.current;
970
- } else {
971
- var parentNodeEl = document.getElementsByClassName("antTable")[0];
972
- contentTable = {
973
- contentTable: parentNodeEl.children[0]
974
- };
975
- }
976
- if (waterMark != this.waterMark) {
977
- (0, _generateWater.generateWaterMark)(contentTable, (0, _extends3.default)({ text: waterMark }, waterMarkOption));
978
- this.waterMark = waterMark;
979
- }
980
- this.props.handleCallback && this.props.handleCallback();
981
- }
982
- //自定义列
983
-
984
-
985
- /*以下为触发事件*/
986
-
987
-
988
- /*以下为抽离公共方法*/
989
-
990
- /* 浮点数做相乘处理 */
991
-
992
-
993
- //相加
994
-
995
-
996
- //相减
997
-
998
- }, {
999
- key: 'componentDidMount',
1000
- value: function componentDidMount() {
1001
- var _this4 = this;
1002
-
1003
- setTimeout(function () {
1004
- if (_this4.props.rowIndex !== void 0) {
1005
- _this4.setSelectedRowKeys(_this4.props.rowIndex);
1006
- }
1007
- _this4.initScrollHeight();
1008
- }, 0);
1009
- this.generateWaterMark();
1010
- }
1011
- }, {
1012
- key: 'componentDidUpdate',
1013
- value: function componentDidUpdate() {
1014
- this.generateWaterMark();
1015
- }
1016
- }, {
1017
- key: 'componentWillReceiveProps',
1018
- value: function componentWillReceiveProps(nextProps) {
1019
- if ('rowIndex' in nextProps) {
1020
- this.setSelectedRowKeys(nextProps.rowIndex);
1021
- this.initScrollHeight();
1022
- }
1023
- }
1024
- }, {
1025
- key: 'render',
1026
- value: function render() {
1027
- var _this5 = this;
1028
-
1029
- var _props3 = this.props,
1030
- autoScroll = _props3.autoScroll,
1031
- width = _props3.width,
1032
- tableHeight = _props3.tableHeight,
1033
- _props3$headerHeight = _props3.headerHeight,
1034
- headerHeight = _props3$headerHeight === undefined ? 50 : _props3$headerHeight,
1035
- _props3$height = _props3.height,
1036
- height = _props3$height === undefined ? 50 : _props3$height,
1037
- pagination = _props3.pagination,
1038
- dataSource = _props3.dataSource,
1039
- columns = _props3.columns,
1040
- rowClick = _props3.rowClick,
1041
- cboxClick = _props3.cboxClick,
1042
- _props3$className = _props3.className,
1043
- className = _props3$className === undefined ? '' : _props3$className,
1044
- checkbox = _props3.checkbox,
1045
- emptyStyle = _props3.emptyStyle,
1046
- rowIndex = _props3.rowIndex,
1047
- type = _props3.type,
1048
- items = (0, _objectWithoutProperties3.default)(_props3, ['autoScroll', 'width', 'tableHeight', 'headerHeight', 'height', 'pagination', 'dataSource', 'columns', 'rowClick', 'cboxClick', 'className', 'checkbox', 'emptyStyle', 'rowIndex', 'type']);
1049
- var _state = this.state,
1050
- scrollY = _state.scrollY,
1051
- scrollTop = _state.scrollTop;
1052
- // let copyColumns = columns.map(el=>{return {...el}});
1053
-
1054
- var tabColumns = this.getRenderColumns(columns, dataSource);
1055
- var dyItems = scrollTop != null ? { scrollTop: scrollTop } : {};
1056
- return _react2.default.createElement(
1057
- 'div',
1058
- { className: (type === 'bee' ? 'touchTable' : 'antTable') + ' ' + className },
1059
- type === 'bee' ? _react2.default.createElement(_beeTable2.default, (0, _extends3.default)({}, items, dyItems, {
1060
- ref: this.tableElement,
1061
- style: { width: width ? width : '100%', height: tableHeight ? tableHeight : '100%' },
1062
- rowKey: function rowKey(row) {
1063
- return row.Code;
1064
- },
1065
- headerHeight: headerHeight,
1066
- pagination: pagination ? pagination : false,
1067
- data: dataSource,
1068
- columns: tabColumns,
1069
- height: height,
1070
- rowClassName: this.getRowClassName,
1071
- emptyText: function emptyText() {
1072
- return _this5.emptyFunc(tableHeight, emptyStyle);
1073
- },
1074
- scroll: autoScroll ? {} : { y: scrollY },
1075
- headerScroll: false,
1076
- onRowClick: function onRowClick(record, index) {
1077
- _this5.handleClick(null, 'rowClick', record, index, rowClick);
1078
- }
1079
- })) : _react2.default.createElement(_table2.default, (0, _extends3.default)({
1080
- id: 'ref-table'
1081
- }, items, dyItems, {
1082
- style: { width: width ? width : '100%', height: tableHeight ? tableHeight : '100%' },
1083
- rowKey: function rowKey(row) {
1084
- return row.Code;
1085
- },
1086
- pagination: pagination ? pagination : false,
1087
- dataSource: dataSource,
1088
- columns: tabColumns,
1089
- rowClassName: this.getRowClassName,
1090
- locale: { emptyText: this.emptyFunc(tableHeight - 60, emptyStyle) },
1091
- scroll: autoScroll ? { y: null } : { y: tableHeight - 60 },
1092
- onRow: function onRow(record, index) {
1093
- return {
1094
- onClick: function onClick() {
1095
- return _this5.handleClick(null, 'rowClick', record, index, rowClick);
1096
- }
1097
- };
1098
- }
1099
- }))
1100
- );
1101
- }
1102
- }]);
1103
- return TouchTable;
1104
- }(_react.Component), _class.propTypes = {
1105
- waterMark: _propTypes2.default.string,
1106
- waterMarkOption: _propTypes2.default.object
1107
- }, _temp);
1108
- exports.default = TouchTable;
1109
- //# sourceMappingURL=index.js.map