cloud-b2b 1.0.8 → 1.1.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/es/CodeInput/CodeInput.js +153 -0
- package/es/CodeInput/package.json +6 -0
- package/es/Control/Control.js +23 -8
- package/es/SuperTable2/SuperTable2.js +17 -14
- package/es/SuperTable2/SuperTable2.less +9 -7
- package/es/WingBlank/WingBlank.js +1 -1
- package/lib/CodeInput/CodeInput.js +182 -0
- package/lib/CodeInput/package.json +6 -0
- package/lib/Control/Control.js +26 -10
- package/lib/SuperTable2/SuperTable2.js +17 -14
- package/lib/SuperTable2/SuperTable2.less +9 -7
- package/lib/WingBlank/WingBlank.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
3
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
4
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
6
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
7
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
|
8
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
9
|
+
import _Row from "antd/es/row";
|
|
10
|
+
import _Button from "antd/es/button";
|
|
11
|
+
import _Col from "antd/es/col";
|
|
12
|
+
import _Input from "antd/es/input";
|
|
13
|
+
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
14
|
+
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
15
|
+
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
16
|
+
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
17
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
18
|
+
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
19
|
+
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
20
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
21
|
+
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
+
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
+
|
|
26
|
+
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
27
|
+
|
|
28
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
29
|
+
|
|
30
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
31
|
+
|
|
32
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
33
|
+
import _setInterval from "@babel/runtime-corejs3/core-js-stable/set-interval";
|
|
34
|
+
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
35
|
+
import React from 'react';
|
|
36
|
+
import PropTypes from 'prop-types';
|
|
37
|
+
import helper from '../helper';
|
|
38
|
+
var PROPS = {
|
|
39
|
+
filter: PropTypes.bool,
|
|
40
|
+
remark: PropTypes.bool,
|
|
41
|
+
searchWhenClick: PropTypes.bool,
|
|
42
|
+
noSearchWhenTypo: PropTypes.bool,
|
|
43
|
+
options: PropTypes.array,
|
|
44
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]),
|
|
45
|
+
inputRef: PropTypes.func,
|
|
46
|
+
onChange: PropTypes.func,
|
|
47
|
+
onBlur: PropTypes.func,
|
|
48
|
+
onSelect: PropTypes.func,
|
|
49
|
+
onSearch: PropTypes.func
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var PROPS_KEYS = _Object$keys(PROPS);
|
|
53
|
+
|
|
54
|
+
var CodeInput = /*#__PURE__*/function (_React$Component) {
|
|
55
|
+
_inherits(CodeInput, _React$Component);
|
|
56
|
+
|
|
57
|
+
var _super = _createSuper(CodeInput);
|
|
58
|
+
|
|
59
|
+
function CodeInput(_props) {
|
|
60
|
+
var _this;
|
|
61
|
+
|
|
62
|
+
_classCallCheck(this, CodeInput);
|
|
63
|
+
|
|
64
|
+
_this = _super.call(this, _props);
|
|
65
|
+
|
|
66
|
+
_defineProperty(_assertThisInitialized(_this), "onGetCode", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
67
|
+
var onGetCode, that, s;
|
|
68
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
69
|
+
while (1) {
|
|
70
|
+
switch (_context.prev = _context.next) {
|
|
71
|
+
case 0:
|
|
72
|
+
// const url = await helper.fetchJson();
|
|
73
|
+
onGetCode = _this.props.onGetCode;
|
|
74
|
+
_context.next = 3;
|
|
75
|
+
return onGetCode && onGetCode();
|
|
76
|
+
|
|
77
|
+
case 3:
|
|
78
|
+
if (!_context.sent) {
|
|
79
|
+
_context.next = 8;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
debugger;
|
|
84
|
+
|
|
85
|
+
_this.setState({
|
|
86
|
+
time: _this.props.time || 60
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
that = _assertThisInitialized(_this);
|
|
90
|
+
s = _setInterval(function () {
|
|
91
|
+
that.setState({
|
|
92
|
+
time: that.state.time -= 1
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
if (that.state.time === 0) {
|
|
96
|
+
clearInterval(s);
|
|
97
|
+
}
|
|
98
|
+
}, 1000);
|
|
99
|
+
|
|
100
|
+
case 8:
|
|
101
|
+
;
|
|
102
|
+
|
|
103
|
+
case 9:
|
|
104
|
+
case "end":
|
|
105
|
+
return _context.stop();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}, _callee);
|
|
109
|
+
})));
|
|
110
|
+
|
|
111
|
+
_defineProperty(_assertThisInitialized(_this), "btnProps", function (props) {
|
|
112
|
+
var btnProps = _Object$assign(helper.getObjectExclude(props, ['onGetCode']));
|
|
113
|
+
|
|
114
|
+
return _objectSpread(_objectSpread({}, btnProps), {}, {
|
|
115
|
+
size: 'large',
|
|
116
|
+
disabled: _this.state.time !== 0,
|
|
117
|
+
onClick: _this.onGetCode
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
_defineProperty(_assertThisInitialized(_this), "inputProps", function (props) {
|
|
122
|
+
var inpPros = _Object$assign(helper.getObjectExclude(props, ['onGetCode']));
|
|
123
|
+
|
|
124
|
+
return _objectSpread(_objectSpread({}, inpPros), {}, {
|
|
125
|
+
size: 'large'
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
_this.state = {
|
|
130
|
+
value: _props.value,
|
|
131
|
+
time: 0
|
|
132
|
+
};
|
|
133
|
+
return _this;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
_createClass(CodeInput, [{
|
|
137
|
+
key: "render",
|
|
138
|
+
value: function render() {
|
|
139
|
+
var _this$props = this.props,
|
|
140
|
+
inputKey = _this$props.inputKey,
|
|
141
|
+
readonly = _this$props.readonly,
|
|
142
|
+
value = _this$props.value;
|
|
143
|
+
var time = this.state.time;
|
|
144
|
+
return /*#__PURE__*/React.createElement(_Row, null, /*#__PURE__*/React.createElement(_Col, {
|
|
145
|
+
span: 20
|
|
146
|
+
}, /*#__PURE__*/React.createElement(_Input, this.inputProps(this.props))), /*#__PURE__*/React.createElement(_Col, null, /*#__PURE__*/React.createElement(_Button, this.btnProps(this.props), time === 0 ? "\u83B7\u53D6\u9A8C\u8BC1\u7801" : "".concat(time, "s\u83B7\u53D6\u9A8C\u8BC1\u7801"))));
|
|
147
|
+
}
|
|
148
|
+
}]);
|
|
149
|
+
|
|
150
|
+
return CodeInput;
|
|
151
|
+
}(React.Component);
|
|
152
|
+
|
|
153
|
+
export default CodeInput;
|
package/es/Control/Control.js
CHANGED
|
@@ -39,10 +39,11 @@ import InputEditor from '../InputEditor';
|
|
|
39
39
|
import InputSelect from '../InputSelect';
|
|
40
40
|
import InputWriting from '../InputWriting';
|
|
41
41
|
import InpurCascader from '../InpurCascader';
|
|
42
|
-
import SuperUpload from '../SuperUpload';
|
|
43
|
-
import Area from '../Area';
|
|
44
42
|
import moment from 'moment';
|
|
45
43
|
import eventWrapper from './event';
|
|
44
|
+
import CodeInput from '../CodeInput';
|
|
45
|
+
import SuperUpload from '../SuperUpload';
|
|
46
|
+
import Area from '../Area/Area';
|
|
46
47
|
var SelectOption = _Select.Option;
|
|
47
48
|
var TextArea = _Input.TextArea;
|
|
48
49
|
var RadioGroup = _Radio.Group;
|
|
@@ -131,6 +132,9 @@ var textArea = function textArea(props) {
|
|
|
131
132
|
|
|
132
133
|
var readonly = function readonly(props) {
|
|
133
134
|
props.readOnly = true;
|
|
135
|
+
props.style = _Object$assign(props.style || {}, {
|
|
136
|
+
backgroundColor: '#f0f0f0'
|
|
137
|
+
});
|
|
134
138
|
|
|
135
139
|
if (props.value || props.defaultValue) {
|
|
136
140
|
props.title = props.value || props.defaultValue;
|
|
@@ -176,6 +180,14 @@ var select = function select(props) {
|
|
|
176
180
|
}
|
|
177
181
|
|
|
178
182
|
return /*#__PURE__*/React.createElement(_Select, props, _mapInstanceProperty(options).call(options, toOption));
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
var area = function area(props) {
|
|
186
|
+
var areaProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
187
|
+
onParentChange: props.onChange
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
return /*#__PURE__*/React.createElement(Area, areaProps);
|
|
179
191
|
}; // 下拉选择框-取title作为值
|
|
180
192
|
|
|
181
193
|
|
|
@@ -312,12 +324,13 @@ var cascader = function cascader(props) {
|
|
|
312
324
|
return /*#__PURE__*/React.createElement(InpurCascader, props);
|
|
313
325
|
};
|
|
314
326
|
|
|
315
|
-
var
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
327
|
+
var captcha = function captcha(props) {
|
|
328
|
+
if (props.ref) {
|
|
329
|
+
props.inputRef = props.ref;
|
|
330
|
+
delete props.ref;
|
|
331
|
+
}
|
|
319
332
|
|
|
320
|
-
return /*#__PURE__*/React.createElement(
|
|
333
|
+
return /*#__PURE__*/React.createElement(CodeInput, props);
|
|
321
334
|
};
|
|
322
335
|
|
|
323
336
|
var uploadImg = function uploadImg(props) {
|
|
@@ -351,6 +364,7 @@ var controls = {
|
|
|
351
364
|
selectSearch: selectSearch,
|
|
352
365
|
selectWriting: selectWriting,
|
|
353
366
|
cascader: cascader,
|
|
367
|
+
captcha: captcha,
|
|
354
368
|
area: area,
|
|
355
369
|
uploadImg: uploadImg
|
|
356
370
|
};
|
|
@@ -373,7 +387,8 @@ Control.propTypes = {
|
|
|
373
387
|
autoFocus: PropTypes.bool,
|
|
374
388
|
onChange: PropTypes.func,
|
|
375
389
|
onSearch: PropTypes.func,
|
|
376
|
-
onBlur: PropTypes.func
|
|
390
|
+
onBlur: PropTypes.func,
|
|
391
|
+
onGetCode: PropTypes.func
|
|
377
392
|
}; // 依据value查找对应的标题
|
|
378
393
|
|
|
379
394
|
var getTitle = function getTitle(value) {
|
|
@@ -26,13 +26,13 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
|
26
26
|
|
|
27
27
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
28
28
|
|
|
29
|
-
function _unsupportedIterableToArray(o, minLen) { var
|
|
29
|
+
function _unsupportedIterableToArray(o, minLen) { var _context13; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context13 = Object.prototype.toString.call(o)).call(_context13, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
30
30
|
|
|
31
31
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
32
32
|
|
|
33
33
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
34
34
|
|
|
35
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
35
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context11, _context12; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context11 = ownKeys(Object(source), !0)).call(_context11, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context12 = ownKeys(Object(source))).call(_context12, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
36
36
|
|
|
37
37
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
38
38
|
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
@@ -361,7 +361,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
361
361
|
|
|
362
362
|
_defineProperty(_assertThisInitialized(_this), "getCellRender", function (col) {
|
|
363
363
|
return function (value, record, index) {
|
|
364
|
-
var _context3, _context4, _context5;
|
|
364
|
+
var _context3, _context4, _context5, _context6;
|
|
365
365
|
|
|
366
366
|
var realType = record._isEdit === true && _this.canReadonly(col.type) ? col.editType : col.type;
|
|
367
367
|
|
|
@@ -424,9 +424,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
424
424
|
return _this.props.callback.onRenderCustom(record.key, col.key, value, col.props);
|
|
425
425
|
|
|
426
426
|
case 'toolbar':
|
|
427
|
+
//showByKey为true时,每条数据中与按钮key相同的属性值决定按钮是否显示,建议key用下划线开始命名,避免与后台数据冲突
|
|
427
428
|
var props = {
|
|
428
429
|
onClick: _this.props.callback.onToolbar ? _bindInstanceProperty(_context4 = _this.props.callback.onToolbar).call(_context4, null, col.key, record.key, record) : undefined,
|
|
429
|
-
buttons: _filterInstanceProperty(_context5 = col.props.buttons).call(_context5, function (item) {
|
|
430
|
+
buttons: col.props.showByKey ? _filterInstanceProperty(_context5 = col.props.buttons).call(_context5, function (item) {
|
|
431
|
+
return record[item.key] === true;
|
|
432
|
+
}) : _filterInstanceProperty(_context6 = col.props.buttons).call(_context6, function (item) {
|
|
430
433
|
return item.defaultShow === !record._isEdit;
|
|
431
434
|
})
|
|
432
435
|
};
|
|
@@ -527,18 +530,18 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
527
530
|
});
|
|
528
531
|
|
|
529
532
|
_defineProperty(_assertThisInitialized(_this), "canReadonly", function (type) {
|
|
530
|
-
var
|
|
533
|
+
var _context7;
|
|
531
534
|
|
|
532
|
-
return !_includesInstanceProperty(
|
|
535
|
+
return !_includesInstanceProperty(_context7 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar']).call(_context7, type);
|
|
533
536
|
});
|
|
534
537
|
|
|
535
538
|
_defineProperty(_assertThisInitialized(_this), "getColumns", function (cols) {
|
|
536
|
-
var
|
|
539
|
+
var _context8;
|
|
537
540
|
|
|
538
541
|
var readonly = _this.props.readonly;
|
|
539
|
-
return _mapInstanceProperty(
|
|
542
|
+
return _mapInstanceProperty(_context8 = _filterInstanceProperty(cols).call(cols, function (col) {
|
|
540
543
|
return !col.hide;
|
|
541
|
-
})).call(
|
|
544
|
+
})).call(_context8, function (_ref11, index) {
|
|
542
545
|
var col = _extends({}, _ref11);
|
|
543
546
|
|
|
544
547
|
col.className = _this.getColumnClassName(col);
|
|
@@ -566,13 +569,13 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
566
569
|
_defineProperty(_assertThisInitialized(_this), "getDataSource", function (items, cols) {
|
|
567
570
|
return _mapInstanceProperty(items).call(items, function (item, index) {
|
|
568
571
|
return _reduceInstanceProperty(cols).call(cols, function (result, _ref12) {
|
|
569
|
-
var
|
|
572
|
+
var _context9;
|
|
570
573
|
|
|
571
574
|
var key = _ref12.key,
|
|
572
575
|
type = _ref12.type,
|
|
573
576
|
options = _ref12.options;
|
|
574
577
|
|
|
575
|
-
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || _Array$isArray(item.isReadonly) && !_includesInstanceProperty(
|
|
578
|
+
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || _Array$isArray(item.isReadonly) && !_includesInstanceProperty(_context9 = item.isReadonly).call(_context9, key))) {
|
|
576
579
|
result[key] = item[key];
|
|
577
580
|
} else {
|
|
578
581
|
result[key] = getTitle(item[key], options);
|
|
@@ -606,7 +609,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
606
609
|
});
|
|
607
610
|
|
|
608
611
|
_defineProperty(_assertThisInitialized(_this), "getProps", function () {
|
|
609
|
-
var
|
|
612
|
+
var _context10;
|
|
610
613
|
|
|
611
614
|
var _this$props3 = _this.props,
|
|
612
615
|
cols = _this$props3.cols,
|
|
@@ -621,9 +624,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
621
624
|
isEmphasized = _this$props3$isEmphas === void 0 ? false : _this$props3$isEmphas,
|
|
622
625
|
maxHeight = _this$props3.maxHeight;
|
|
623
626
|
|
|
624
|
-
var widthX = _reduceInstanceProperty(
|
|
627
|
+
var widthX = _reduceInstanceProperty(_context10 = _filterInstanceProperty(cols).call(cols, function (col) {
|
|
625
628
|
return !col.hide;
|
|
626
|
-
})).call(
|
|
629
|
+
})).call(_context10, function (width, item) {
|
|
627
630
|
return width += item.width ? item.width : 120;
|
|
628
631
|
}, 0);
|
|
629
632
|
|
|
@@ -105,12 +105,14 @@
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
}
|
|
109
108
|
|
|
110
|
-
.weakenedSelectRow{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
.weakenedSelectRow{
|
|
110
|
+
background-color: @table-row-hover-bg;
|
|
111
|
+
color :#999;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.weakenedUnselectRow{
|
|
115
|
+
color :#999;
|
|
116
|
+
}
|
|
116
117
|
}
|
|
118
|
+
|
|
@@ -13,7 +13,7 @@ function WingBlank(_ref) {
|
|
|
13
13
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
14
|
|
|
15
15
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
16
|
-
className: _concatInstanceProperty(_context = "".concat(className, " ")).call(_context, variables('
|
|
16
|
+
className: _concatInstanceProperty(_context = "".concat(className, " ")).call(_context, variables('WingBlank'))
|
|
17
17
|
}, props), /*#__PURE__*/React.createElement("div", null, children));
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
4
|
+
|
|
5
|
+
var _Object$keys2 = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
6
|
+
|
|
7
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
8
|
+
|
|
9
|
+
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
10
|
+
|
|
11
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
12
|
+
|
|
13
|
+
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
14
|
+
|
|
15
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
16
|
+
|
|
17
|
+
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
18
|
+
|
|
19
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
20
|
+
|
|
21
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
22
|
+
|
|
23
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
exports["default"] = void 0;
|
|
28
|
+
|
|
29
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
|
|
30
|
+
|
|
31
|
+
var _row = _interopRequireDefault(require("antd/lib/row"));
|
|
32
|
+
|
|
33
|
+
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
34
|
+
|
|
35
|
+
var _col = _interopRequireDefault(require("antd/lib/col"));
|
|
36
|
+
|
|
37
|
+
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
38
|
+
|
|
39
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
|
40
|
+
|
|
41
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
42
|
+
|
|
43
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
44
|
+
|
|
45
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
46
|
+
|
|
47
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
48
|
+
|
|
49
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
50
|
+
|
|
51
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
52
|
+
|
|
53
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
54
|
+
|
|
55
|
+
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
56
|
+
|
|
57
|
+
var _setInterval2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-interval"));
|
|
58
|
+
|
|
59
|
+
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
60
|
+
|
|
61
|
+
var _react = _interopRequireDefault(require("react"));
|
|
62
|
+
|
|
63
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
64
|
+
|
|
65
|
+
var _helper = _interopRequireDefault(require("../helper"));
|
|
66
|
+
|
|
67
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys2(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
68
|
+
|
|
69
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
70
|
+
|
|
71
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
72
|
+
|
|
73
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
74
|
+
|
|
75
|
+
var PROPS = {
|
|
76
|
+
filter: _propTypes["default"].bool,
|
|
77
|
+
remark: _propTypes["default"].bool,
|
|
78
|
+
searchWhenClick: _propTypes["default"].bool,
|
|
79
|
+
noSearchWhenTypo: _propTypes["default"].bool,
|
|
80
|
+
options: _propTypes["default"].array,
|
|
81
|
+
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number, _propTypes["default"].object]),
|
|
82
|
+
inputRef: _propTypes["default"].func,
|
|
83
|
+
onChange: _propTypes["default"].func,
|
|
84
|
+
onBlur: _propTypes["default"].func,
|
|
85
|
+
onSelect: _propTypes["default"].func,
|
|
86
|
+
onSearch: _propTypes["default"].func
|
|
87
|
+
};
|
|
88
|
+
var PROPS_KEYS = (0, _keys["default"])(PROPS);
|
|
89
|
+
|
|
90
|
+
var CodeInput = /*#__PURE__*/function (_React$Component) {
|
|
91
|
+
(0, _inherits2["default"])(CodeInput, _React$Component);
|
|
92
|
+
|
|
93
|
+
var _super = _createSuper(CodeInput);
|
|
94
|
+
|
|
95
|
+
function CodeInput(_props) {
|
|
96
|
+
var _this;
|
|
97
|
+
|
|
98
|
+
(0, _classCallCheck2["default"])(this, CodeInput);
|
|
99
|
+
_this = _super.call(this, _props);
|
|
100
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onGetCode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
101
|
+
var onGetCode, that, s;
|
|
102
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
103
|
+
while (1) {
|
|
104
|
+
switch (_context.prev = _context.next) {
|
|
105
|
+
case 0:
|
|
106
|
+
// const url = await helper.fetchJson();
|
|
107
|
+
onGetCode = _this.props.onGetCode;
|
|
108
|
+
_context.next = 3;
|
|
109
|
+
return onGetCode && onGetCode();
|
|
110
|
+
|
|
111
|
+
case 3:
|
|
112
|
+
if (!_context.sent) {
|
|
113
|
+
_context.next = 8;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
debugger;
|
|
118
|
+
|
|
119
|
+
_this.setState({
|
|
120
|
+
time: _this.props.time || 60
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
that = (0, _assertThisInitialized2["default"])(_this);
|
|
124
|
+
s = (0, _setInterval2["default"])(function () {
|
|
125
|
+
that.setState({
|
|
126
|
+
time: that.state.time -= 1
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
if (that.state.time === 0) {
|
|
130
|
+
clearInterval(s);
|
|
131
|
+
}
|
|
132
|
+
}, 1000);
|
|
133
|
+
|
|
134
|
+
case 8:
|
|
135
|
+
;
|
|
136
|
+
|
|
137
|
+
case 9:
|
|
138
|
+
case "end":
|
|
139
|
+
return _context.stop();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}, _callee);
|
|
143
|
+
})));
|
|
144
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "btnProps", function (props) {
|
|
145
|
+
var btnProps = (0, _assign["default"])(_helper["default"].getObjectExclude(props, ['onGetCode']));
|
|
146
|
+
return _objectSpread(_objectSpread({}, btnProps), {}, {
|
|
147
|
+
size: 'large',
|
|
148
|
+
disabled: _this.state.time !== 0,
|
|
149
|
+
onClick: _this.onGetCode
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "inputProps", function (props) {
|
|
153
|
+
var inpPros = (0, _assign["default"])(_helper["default"].getObjectExclude(props, ['onGetCode']));
|
|
154
|
+
return _objectSpread(_objectSpread({}, inpPros), {}, {
|
|
155
|
+
size: 'large'
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
_this.state = {
|
|
159
|
+
value: _props.value,
|
|
160
|
+
time: 0
|
|
161
|
+
};
|
|
162
|
+
return _this;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
(0, _createClass2["default"])(CodeInput, [{
|
|
166
|
+
key: "render",
|
|
167
|
+
value: function render() {
|
|
168
|
+
var _this$props = this.props,
|
|
169
|
+
inputKey = _this$props.inputKey,
|
|
170
|
+
readonly = _this$props.readonly,
|
|
171
|
+
value = _this$props.value;
|
|
172
|
+
var time = this.state.time;
|
|
173
|
+
return /*#__PURE__*/_react["default"].createElement(_row["default"], null, /*#__PURE__*/_react["default"].createElement(_col["default"], {
|
|
174
|
+
span: 20
|
|
175
|
+
}, /*#__PURE__*/_react["default"].createElement(_input["default"], this.inputProps(this.props))), /*#__PURE__*/_react["default"].createElement(_col["default"], null, /*#__PURE__*/_react["default"].createElement(_button["default"], this.btnProps(this.props), time === 0 ? "\u83B7\u53D6\u9A8C\u8BC1\u7801" : "".concat(time, "s\u83B7\u53D6\u9A8C\u8BC1\u7801"))));
|
|
176
|
+
}
|
|
177
|
+
}]);
|
|
178
|
+
return CodeInput;
|
|
179
|
+
}(_react["default"].Component);
|
|
180
|
+
|
|
181
|
+
var _default = CodeInput;
|
|
182
|
+
exports["default"] = _default;
|
package/lib/Control/Control.js
CHANGED
|
@@ -76,14 +76,16 @@ var _InputWriting = _interopRequireDefault(require("../InputWriting"));
|
|
|
76
76
|
|
|
77
77
|
var _InpurCascader = _interopRequireDefault(require("../InpurCascader"));
|
|
78
78
|
|
|
79
|
-
var _SuperUpload = _interopRequireDefault(require("../SuperUpload"));
|
|
80
|
-
|
|
81
|
-
var _Area = _interopRequireDefault(require("../Area"));
|
|
82
|
-
|
|
83
79
|
var _moment = _interopRequireDefault(require("moment"));
|
|
84
80
|
|
|
85
81
|
var _event = _interopRequireDefault(require("./event"));
|
|
86
82
|
|
|
83
|
+
var _CodeInput = _interopRequireDefault(require("../CodeInput"));
|
|
84
|
+
|
|
85
|
+
var _SuperUpload = _interopRequireDefault(require("../SuperUpload"));
|
|
86
|
+
|
|
87
|
+
var _Area = _interopRequireDefault(require("../Area/Area"));
|
|
88
|
+
|
|
87
89
|
var _excluded = ["options"],
|
|
88
90
|
_excluded2 = ["type", "autoFocus"];
|
|
89
91
|
|
|
@@ -180,6 +182,9 @@ var textArea = function textArea(props) {
|
|
|
180
182
|
|
|
181
183
|
var readonly = function readonly(props) {
|
|
182
184
|
props.readOnly = true;
|
|
185
|
+
props.style = (0, _assign["default"])(props.style || {}, {
|
|
186
|
+
backgroundColor: '#f0f0f0'
|
|
187
|
+
});
|
|
183
188
|
|
|
184
189
|
if (props.value || props.defaultValue) {
|
|
185
190
|
props.title = props.value || props.defaultValue;
|
|
@@ -225,6 +230,14 @@ var select = function select(props) {
|
|
|
225
230
|
}
|
|
226
231
|
|
|
227
232
|
return /*#__PURE__*/_react["default"].createElement(_select["default"], props, (0, _map["default"])(options).call(options, toOption));
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
var area = function area(props) {
|
|
236
|
+
var areaProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
237
|
+
onParentChange: props.onChange
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
return /*#__PURE__*/_react["default"].createElement(_Area["default"], areaProps);
|
|
228
241
|
}; // 下拉选择框-取title作为值
|
|
229
242
|
|
|
230
243
|
|
|
@@ -360,12 +373,13 @@ var cascader = function cascader(props) {
|
|
|
360
373
|
return /*#__PURE__*/_react["default"].createElement(_InpurCascader["default"], props);
|
|
361
374
|
};
|
|
362
375
|
|
|
363
|
-
var
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
376
|
+
var captcha = function captcha(props) {
|
|
377
|
+
if (props.ref) {
|
|
378
|
+
props.inputRef = props.ref;
|
|
379
|
+
delete props.ref;
|
|
380
|
+
}
|
|
367
381
|
|
|
368
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
382
|
+
return /*#__PURE__*/_react["default"].createElement(_CodeInput["default"], props);
|
|
369
383
|
};
|
|
370
384
|
|
|
371
385
|
var uploadImg = function uploadImg(props) {
|
|
@@ -399,6 +413,7 @@ var controls = {
|
|
|
399
413
|
selectSearch: selectSearch,
|
|
400
414
|
selectWriting: selectWriting,
|
|
401
415
|
cascader: cascader,
|
|
416
|
+
captcha: captcha,
|
|
402
417
|
area: area,
|
|
403
418
|
uploadImg: uploadImg
|
|
404
419
|
};
|
|
@@ -420,7 +435,8 @@ Control.propTypes = {
|
|
|
420
435
|
autoFocus: _propTypes["default"].bool,
|
|
421
436
|
onChange: _propTypes["default"].func,
|
|
422
437
|
onSearch: _propTypes["default"].func,
|
|
423
|
-
onBlur: _propTypes["default"].func
|
|
438
|
+
onBlur: _propTypes["default"].func,
|
|
439
|
+
onGetCode: _propTypes["default"].func
|
|
424
440
|
}; // 依据value查找对应的标题
|
|
425
441
|
|
|
426
442
|
var getTitle = function getTitle(value) {
|
|
@@ -96,13 +96,13 @@ var _variables = _interopRequireDefault(require("../variables"));
|
|
|
96
96
|
|
|
97
97
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray2(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
98
98
|
|
|
99
|
-
function _unsupportedIterableToArray(o, minLen) { var
|
|
99
|
+
function _unsupportedIterableToArray(o, minLen) { var _context13; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context13 = Object.prototype.toString.call(o)).call(_context13, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
100
100
|
|
|
101
101
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
102
102
|
|
|
103
103
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty2(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
104
104
|
|
|
105
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
105
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context11, _context12; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context11 = ownKeys(Object(source), !0)).call(_context11, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context12 = ownKeys(Object(source))).call(_context12, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
106
106
|
|
|
107
107
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
108
108
|
|
|
@@ -400,7 +400,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
400
400
|
});
|
|
401
401
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getCellRender", function (col) {
|
|
402
402
|
return function (value, record, index) {
|
|
403
|
-
var _context3, _context4, _context5;
|
|
403
|
+
var _context3, _context4, _context5, _context6;
|
|
404
404
|
|
|
405
405
|
var realType = record._isEdit === true && _this.canReadonly(col.type) ? col.editType : col.type;
|
|
406
406
|
|
|
@@ -463,9 +463,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
463
463
|
return _this.props.callback.onRenderCustom(record.key, col.key, value, col.props);
|
|
464
464
|
|
|
465
465
|
case 'toolbar':
|
|
466
|
+
//showByKey为true时,每条数据中与按钮key相同的属性值决定按钮是否显示,建议key用下划线开始命名,避免与后台数据冲突
|
|
466
467
|
var props = {
|
|
467
468
|
onClick: _this.props.callback.onToolbar ? (0, _bind["default"])(_context4 = _this.props.callback.onToolbar).call(_context4, null, col.key, record.key, record) : undefined,
|
|
468
|
-
buttons: (0, _filter["default"])(_context5 = col.props.buttons).call(_context5, function (item) {
|
|
469
|
+
buttons: col.props.showByKey ? (0, _filter["default"])(_context5 = col.props.buttons).call(_context5, function (item) {
|
|
470
|
+
return record[item.key] === true;
|
|
471
|
+
}) : (0, _filter["default"])(_context6 = col.props.buttons).call(_context6, function (item) {
|
|
469
472
|
return item.defaultShow === !record._isEdit;
|
|
470
473
|
})
|
|
471
474
|
};
|
|
@@ -561,17 +564,17 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
561
564
|
}
|
|
562
565
|
});
|
|
563
566
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "canReadonly", function (type) {
|
|
564
|
-
var
|
|
567
|
+
var _context7;
|
|
565
568
|
|
|
566
|
-
return !(0, _includes["default"])(
|
|
569
|
+
return !(0, _includes["default"])(_context7 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar']).call(_context7, type);
|
|
567
570
|
});
|
|
568
571
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumns", function (cols) {
|
|
569
|
-
var
|
|
572
|
+
var _context8;
|
|
570
573
|
|
|
571
574
|
var readonly = _this.props.readonly;
|
|
572
|
-
return (0, _map["default"])(
|
|
575
|
+
return (0, _map["default"])(_context8 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
573
576
|
return !col.hide;
|
|
574
|
-
})).call(
|
|
577
|
+
})).call(_context8, function (_ref11, index) {
|
|
575
578
|
var col = (0, _extends2["default"])({}, _ref11);
|
|
576
579
|
col.className = _this.getColumnClassName(col);
|
|
577
580
|
col.title = _this.getColumnTitle(col);
|
|
@@ -597,13 +600,13 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
597
600
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
|
|
598
601
|
return (0, _map["default"])(items).call(items, function (item, index) {
|
|
599
602
|
return (0, _reduce["default"])(cols).call(cols, function (result, _ref12) {
|
|
600
|
-
var
|
|
603
|
+
var _context9;
|
|
601
604
|
|
|
602
605
|
var key = _ref12.key,
|
|
603
606
|
type = _ref12.type,
|
|
604
607
|
options = _ref12.options;
|
|
605
608
|
|
|
606
|
-
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || (0, _isArray["default"])(item.isReadonly) && !(0, _includes["default"])(
|
|
609
|
+
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || (0, _isArray["default"])(item.isReadonly) && !(0, _includes["default"])(_context9 = item.isReadonly).call(_context9, key))) {
|
|
607
610
|
result[key] = item[key];
|
|
608
611
|
} else {
|
|
609
612
|
result[key] = (0, _Control.getTitle)(item[key], options);
|
|
@@ -635,7 +638,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
635
638
|
};
|
|
636
639
|
});
|
|
637
640
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
|
|
638
|
-
var
|
|
641
|
+
var _context10;
|
|
639
642
|
|
|
640
643
|
var _this$props3 = _this.props,
|
|
641
644
|
cols = _this$props3.cols,
|
|
@@ -649,9 +652,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
649
652
|
_this$props3$isEmphas = _this$props3.isEmphasized,
|
|
650
653
|
isEmphasized = _this$props3$isEmphas === void 0 ? false : _this$props3$isEmphas,
|
|
651
654
|
maxHeight = _this$props3.maxHeight;
|
|
652
|
-
var widthX = (0, _reduce["default"])(
|
|
655
|
+
var widthX = (0, _reduce["default"])(_context10 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
653
656
|
return !col.hide;
|
|
654
|
-
})).call(
|
|
657
|
+
})).call(_context10, function (width, item) {
|
|
655
658
|
return width += item.width ? item.width : 120;
|
|
656
659
|
}, 0);
|
|
657
660
|
return _objectSpread({
|
|
@@ -105,12 +105,14 @@
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
}
|
|
109
108
|
|
|
110
|
-
.weakenedSelectRow{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
.weakenedSelectRow{
|
|
110
|
+
background-color: @table-row-hover-bg;
|
|
111
|
+
color :#999;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.weakenedUnselectRow{
|
|
115
|
+
color :#999;
|
|
116
|
+
}
|
|
116
117
|
}
|
|
118
|
+
|
|
@@ -29,7 +29,7 @@ function WingBlank(_ref) {
|
|
|
29
29
|
children = _ref.children,
|
|
30
30
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
31
31
|
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
|
32
|
-
className: (0, _concat["default"])(_context = "".concat(className, " ")).call(_context, (0, _variables["default"])('
|
|
32
|
+
className: (0, _concat["default"])(_context = "".concat(className, " ")).call(_context, (0, _variables["default"])('WingBlank'))
|
|
33
33
|
}, props), /*#__PURE__*/_react["default"].createElement("div", null, children));
|
|
34
34
|
}
|
|
35
35
|
|