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