wargerm 0.5.39 → 0.6.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/dist/components/NtTable/FrameBox/index.d.ts +11 -0
- package/dist/components/NtTable/index.d.ts +97 -0
- package/dist/components/whox/example/demo1.d.ts +2 -0
- package/dist/components/wmox/example/demo1.d.ts +2 -0
- package/dist/hooks/whox.d.ts +14 -0
- package/dist/hooks/wmox.d.ts +10 -0
- package/dist/index.css +227 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.css +227 -0
- package/dist/index.esm.js +807 -6
- package/dist/index.js +812 -9
- package/package.json +7 -4
package/dist/index.js
CHANGED
@@ -3,7 +3,8 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
var React = require('react');
|
6
|
-
var
|
6
|
+
var lodashEs = require('lodash-es');
|
7
|
+
var shim = require('use-sync-external-store/shim');
|
7
8
|
require('antd/es/button/style');
|
8
9
|
var _Button = require('antd/es/button');
|
9
10
|
require('antd/es/dropdown/style');
|
@@ -40,7 +41,6 @@ var moment = require('moment');
|
|
40
41
|
require('moment/locale/zh-cn');
|
41
42
|
require('antd/es/checkbox/style');
|
42
43
|
var _Checkbox = require('antd/es/checkbox');
|
43
|
-
var uniqBy = require('lodash/uniqBy');
|
44
44
|
require('antd/es/row/style');
|
45
45
|
var _Row = require('antd/es/row');
|
46
46
|
require('antd/es/col/style');
|
@@ -116,7 +116,6 @@ var _DatePicker__default = /*#__PURE__*/_interopDefaultLegacy(_DatePicker);
|
|
116
116
|
var zhCN__default = /*#__PURE__*/_interopDefaultLegacy(zhCN);
|
117
117
|
var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
|
118
118
|
var _Checkbox__default = /*#__PURE__*/_interopDefaultLegacy(_Checkbox);
|
119
|
-
var uniqBy__default = /*#__PURE__*/_interopDefaultLegacy(uniqBy);
|
120
119
|
var _Row__default = /*#__PURE__*/_interopDefaultLegacy(_Row);
|
121
120
|
var _Col__default = /*#__PURE__*/_interopDefaultLegacy(_Col);
|
122
121
|
var _Form__default = /*#__PURE__*/_interopDefaultLegacy(_Form);
|
@@ -558,7 +557,7 @@ var EventEmitter = /*#__PURE__*/_createClass(function EventEmitter() {
|
|
558
557
|
}
|
559
558
|
|
560
559
|
subscriptionValuesCallback === null || subscriptionValuesCallback === void 0 ? void 0 : subscriptionValuesCallback({
|
561
|
-
params:
|
560
|
+
params: lodashEs.cloneDeep(args),
|
562
561
|
event: event
|
563
562
|
});
|
564
563
|
} else throw new TypeError('event must be string or number !');
|
@@ -608,6 +607,203 @@ function useEventEmitter(options) {
|
|
608
607
|
return ref.current;
|
609
608
|
}
|
610
609
|
|
610
|
+
var run = function run(fn) {
|
611
|
+
fn();
|
612
|
+
};
|
613
|
+
|
614
|
+
var __DEV__ = process.env.NODE_ENV !== 'production';
|
615
|
+
|
616
|
+
var create = function create(initStore) {
|
617
|
+
if (__DEV__ && typeof initStore !== 'function') {
|
618
|
+
throw new Error('Expected a function');
|
619
|
+
}
|
620
|
+
|
621
|
+
var store;
|
622
|
+
var listeners = new Set();
|
623
|
+
|
624
|
+
function getSetStore(s) {
|
625
|
+
if (typeof s === 'undefined') return store;
|
626
|
+
var partial = typeof s === 'function' ? s(store) : s;
|
627
|
+
store = _objectSpread2(_objectSpread2({}, store), partial);
|
628
|
+
run(function () {
|
629
|
+
return listeners.forEach(function (listener) {
|
630
|
+
return listener(partial);
|
631
|
+
});
|
632
|
+
});
|
633
|
+
}
|
634
|
+
|
635
|
+
store = initStore(getSetStore);
|
636
|
+
return function useStore() {
|
637
|
+
var proxy = React.useRef({});
|
638
|
+
var handler = React.useRef({});
|
639
|
+
var hasState = React.useRef(false);
|
640
|
+
var hasUpdate = React.useRef(false);
|
641
|
+
|
642
|
+
var _useState = React.useState(false),
|
643
|
+
_useState2 = _slicedToArray(_useState, 2),
|
644
|
+
setState = _useState2[1];
|
645
|
+
|
646
|
+
React.useMemo(function () {
|
647
|
+
handler.current = {
|
648
|
+
get: function get(target, key) {
|
649
|
+
var val = store[key];
|
650
|
+
|
651
|
+
if (typeof val !== 'function') {
|
652
|
+
hasState.current = true;
|
653
|
+
target[key] = val;
|
654
|
+
return target[key];
|
655
|
+
}
|
656
|
+
|
657
|
+
target[key] = new Proxy(val, {
|
658
|
+
get: function get(fn, fnKey) {
|
659
|
+
if (fnKey === 'loading' && !('loading' in fn)) {
|
660
|
+
fn.loading = false;
|
661
|
+
}
|
662
|
+
|
663
|
+
return fn[fnKey];
|
664
|
+
},
|
665
|
+
apply: function apply(fn, _this, args) {
|
666
|
+
var res = fn.apply(void 0, _toConsumableArray(args));
|
667
|
+
|
668
|
+
if (!('loading' in fn) || !res || typeof res.then !== 'function') {
|
669
|
+
target[key] = fn;
|
670
|
+
return res;
|
671
|
+
}
|
672
|
+
|
673
|
+
var setLoading = function setLoading(loading) {
|
674
|
+
target[key].loading = loading;
|
675
|
+
setState(function (s) {
|
676
|
+
return !s;
|
677
|
+
});
|
678
|
+
};
|
679
|
+
|
680
|
+
target[key] = function () {
|
681
|
+
var newRes = fn.apply(void 0, arguments);
|
682
|
+
setLoading(true);
|
683
|
+
return newRes.finally(function () {
|
684
|
+
return setLoading(false);
|
685
|
+
});
|
686
|
+
};
|
687
|
+
|
688
|
+
setLoading(true);
|
689
|
+
return res.finally(function () {
|
690
|
+
return setLoading(false);
|
691
|
+
});
|
692
|
+
}
|
693
|
+
});
|
694
|
+
return target[key];
|
695
|
+
},
|
696
|
+
set: function set(target, key, val) {
|
697
|
+
if (key in target && val !== target[key]) {
|
698
|
+
hasUpdate.current = true;
|
699
|
+
target[key] = val;
|
700
|
+
}
|
701
|
+
|
702
|
+
return true;
|
703
|
+
}
|
704
|
+
};
|
705
|
+
proxy.current = new Proxy({}, handler.current);
|
706
|
+
}, []);
|
707
|
+
React.useEffect(function () {
|
708
|
+
handler.current.get = function (target, key) {
|
709
|
+
return target[key];
|
710
|
+
};
|
711
|
+
}, []);
|
712
|
+
var subscribe = React.useCallback(function (update) {
|
713
|
+
if (!hasState.current) return function () {
|
714
|
+
return undefined;
|
715
|
+
};
|
716
|
+
|
717
|
+
var listener = function listener(partial) {
|
718
|
+
Object.assign(proxy.current, partial);
|
719
|
+
|
720
|
+
if (hasUpdate.current) {
|
721
|
+
hasUpdate.current = false;
|
722
|
+
update();
|
723
|
+
}
|
724
|
+
};
|
725
|
+
|
726
|
+
listeners.add(listener);
|
727
|
+
return function () {
|
728
|
+
return listeners.delete(listener);
|
729
|
+
};
|
730
|
+
}, []);
|
731
|
+
var getSnapshot = React.useCallback(function () {
|
732
|
+
return store;
|
733
|
+
}, []);
|
734
|
+
shim.useSyncExternalStore(subscribe, getSnapshot);
|
735
|
+
return proxy.current;
|
736
|
+
};
|
737
|
+
};
|
738
|
+
|
739
|
+
create.config = function (_ref) {
|
740
|
+
var batch = _ref.batch;
|
741
|
+
run = batch;
|
742
|
+
};
|
743
|
+
|
744
|
+
var run$1 = function run(fn) {
|
745
|
+
fn();
|
746
|
+
};
|
747
|
+
|
748
|
+
var __DEV__$1 = process.env.NODE_ENV !== 'production';
|
749
|
+
|
750
|
+
var wmox = function wmox(state) {
|
751
|
+
if (__DEV__$1 && Object.prototype.toString.call(state) !== '[object Object]') {
|
752
|
+
throw new Error('object required');
|
753
|
+
}
|
754
|
+
|
755
|
+
var store = {};
|
756
|
+
Object.keys(state).forEach(function (key) {
|
757
|
+
if (typeof state[key] === 'function') {
|
758
|
+
return;
|
759
|
+
}
|
760
|
+
|
761
|
+
var listeners = new Set();
|
762
|
+
store[key] = {
|
763
|
+
subscribe: function subscribe(listener) {
|
764
|
+
listeners.add(listener);
|
765
|
+
return function () {
|
766
|
+
return listeners.delete(listener);
|
767
|
+
};
|
768
|
+
},
|
769
|
+
getSnapshot: function getSnapshot() {
|
770
|
+
return state[key];
|
771
|
+
},
|
772
|
+
setSnapshot: function setSnapshot(val) {
|
773
|
+
if (val !== state[key]) {
|
774
|
+
state[key] = val;
|
775
|
+
run$1(function () {
|
776
|
+
return listeners.forEach(function (listener) {
|
777
|
+
return listener();
|
778
|
+
});
|
779
|
+
});
|
780
|
+
}
|
781
|
+
},
|
782
|
+
useSnapshot: function useSnapshot() {
|
783
|
+
return shim.useSyncExternalStore(store[key].subscribe, store[key].getSnapshot);
|
784
|
+
}
|
785
|
+
};
|
786
|
+
});
|
787
|
+
return new Proxy(state, {
|
788
|
+
get: function get(_, key) {
|
789
|
+
try {
|
790
|
+
return store[key].useSnapshot();
|
791
|
+
} catch (e) {
|
792
|
+
return state[key];
|
793
|
+
}
|
794
|
+
},
|
795
|
+
set: function set(_, key, val) {
|
796
|
+
store[key].setSnapshot(val);
|
797
|
+
return true;
|
798
|
+
}
|
799
|
+
});
|
800
|
+
};
|
801
|
+
|
802
|
+
wmox.config = function (_ref) {
|
803
|
+
var batch = _ref.batch;
|
804
|
+
run$1 = batch;
|
805
|
+
};
|
806
|
+
|
611
807
|
var _excluded = ["multiple", "children", "disabled"];
|
612
808
|
|
613
809
|
var WButton = function WButton(props) {
|
@@ -2837,7 +3033,7 @@ function Table(_ref) {
|
|
2837
3033
|
},
|
2838
3034
|
onChange: function onChange(event) {
|
2839
3035
|
setSelectedKeys(function (keys) {
|
2840
|
-
var rows =
|
3036
|
+
var rows = lodashEs.uniqBy([].concat(_toConsumableArray(selectedRows), [record]), typeof rowKey === 'function' ? rowKey(record) : rowKey);
|
2841
3037
|
|
2842
3038
|
if (event.target.checked) {
|
2843
3039
|
var _rowSelection$onChang, _rowSelection$onSelec3;
|
@@ -6779,7 +6975,7 @@ var index$6 = (function (_ref) {
|
|
6779
6975
|
/** 播放器初始化并绑定事件 */
|
6780
6976
|
|
6781
6977
|
React.useEffect(function () {
|
6782
|
-
if (!visible ||
|
6978
|
+
if (!visible || lodashEs.isEmpty(videoUrls) || player.current) {
|
6783
6979
|
return;
|
6784
6980
|
}
|
6785
6981
|
|
@@ -6849,7 +7045,7 @@ var index$6 = (function (_ref) {
|
|
6849
7045
|
/** 加载清晰度配置 */
|
6850
7046
|
|
6851
7047
|
React.useEffect(function () {
|
6852
|
-
if (!
|
7048
|
+
if (!lodashEs.isEmpty(definitionList[currentIndex]) && player.current) {
|
6853
7049
|
player.current.emit('resourceReady', definitionList[currentIndex]);
|
6854
7050
|
}
|
6855
7051
|
}, [currentIndex, definitionList]);
|
@@ -6885,6 +7081,610 @@ var index$6 = (function (_ref) {
|
|
6885
7081
|
});
|
6886
7082
|
});
|
6887
7083
|
|
7084
|
+
var _excluded$m = ["className", "frameStyle", "style", "direction", "children"];
|
7085
|
+
function FrameBox$1(_ref) {
|
7086
|
+
var _classnames;
|
7087
|
+
|
7088
|
+
var className = _ref.className,
|
7089
|
+
frameStyle = _ref.frameStyle,
|
7090
|
+
style = _ref.style,
|
7091
|
+
_ref$direction = _ref.direction,
|
7092
|
+
direction = _ref$direction === void 0 ? 'in' : _ref$direction,
|
7093
|
+
children = _ref.children,
|
7094
|
+
props = _objectWithoutProperties(_ref, _excluded$m);
|
7095
|
+
|
7096
|
+
return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread2({
|
7097
|
+
className: classnames__default['default']((_classnames = {}, _defineProperty(_classnames, 'frame', true), _defineProperty(_classnames, className || '', true), _classnames)),
|
7098
|
+
style: style
|
7099
|
+
}, props), /*#__PURE__*/React__default['default'].createElement("div", {
|
7100
|
+
style: _objectSpread2({
|
7101
|
+
transform: "translateY(".concat(direction == 'in' ? 0 : -100, "%)"),
|
7102
|
+
left: "".concat(direction == 'in' ? 0 : -1, "px)")
|
7103
|
+
}, frameStyle)
|
7104
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
7105
|
+
style: _objectSpread2({
|
7106
|
+
transform: "translateY(".concat(direction == 'in' ? 0 : -100, "%)"),
|
7107
|
+
right: "".concat(direction == 'in' ? 0 : -1, "px)")
|
7108
|
+
}, frameStyle)
|
7109
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
7110
|
+
style: _objectSpread2({
|
7111
|
+
transform: "translateY(".concat(direction == 'in' ? 0 : 100, "%)"),
|
7112
|
+
right: "".concat(direction == 'in' ? 0 : -1, "px)")
|
7113
|
+
}, frameStyle)
|
7114
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
7115
|
+
style: _objectSpread2({
|
7116
|
+
transform: "translateY(".concat(direction == 'in' ? 0 : 100, "%)"),
|
7117
|
+
left: "".concat(direction == 'in' ? 0 : -1, "px)")
|
7118
|
+
}, frameStyle)
|
7119
|
+
}), children);
|
7120
|
+
}
|
7121
|
+
|
7122
|
+
var _excluded$n = ["columns", "dataSource", "request", "onLoad", "params", "onSubmit", "rowKey", "onRow", "className", "rowClassName", "rowSelection", "style", "tbodyStyle", "thStyle", "border", "scroll", "pagination", "search", "frameBoxTable", "frameBoxDirection", "formRef", "none"];
|
7123
|
+
function NtTable(_ref) {
|
7124
|
+
var _formSearchRef$curren4, _classnames2, _columns$, _columns$2;
|
7125
|
+
|
7126
|
+
var columns = _ref.columns,
|
7127
|
+
tableList = _ref.dataSource,
|
7128
|
+
request = _ref.request,
|
7129
|
+
onLoad = _ref.onLoad,
|
7130
|
+
params = _ref.params,
|
7131
|
+
onSubmit = _ref.onSubmit,
|
7132
|
+
_ref$rowKey = _ref.rowKey,
|
7133
|
+
rowKey = _ref$rowKey === void 0 ? 'key' : _ref$rowKey,
|
7134
|
+
onRow = _ref.onRow,
|
7135
|
+
className = _ref.className,
|
7136
|
+
rowClassName = _ref.rowClassName,
|
7137
|
+
rowSelection = _ref.rowSelection,
|
7138
|
+
style = _ref.style,
|
7139
|
+
tbodyStyle = _ref.tbodyStyle,
|
7140
|
+
thStyle = _ref.thStyle,
|
7141
|
+
_ref$border = _ref.border,
|
7142
|
+
scroll = _ref.scroll,
|
7143
|
+
_ref$pagination = _ref.pagination,
|
7144
|
+
pagination = _ref$pagination === void 0 ? false : _ref$pagination,
|
7145
|
+
_ref$search = _ref.search,
|
7146
|
+
search = _ref$search === void 0 ? false : _ref$search,
|
7147
|
+
_ref$frameBoxTable = _ref.frameBoxTable,
|
7148
|
+
frameBoxTable = _ref$frameBoxTable === void 0 ? false : _ref$frameBoxTable,
|
7149
|
+
_ref$frameBoxDirectio = _ref.frameBoxDirection,
|
7150
|
+
frameBoxDirection = _ref$frameBoxDirectio === void 0 ? 'out' : _ref$frameBoxDirectio,
|
7151
|
+
formRef = _ref.formRef,
|
7152
|
+
none = _ref.none,
|
7153
|
+
props = _objectWithoutProperties(_ref, _excluded$n);
|
7154
|
+
|
7155
|
+
var _useState = React.useState(_toConsumableArray((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || [])),
|
7156
|
+
_useState2 = _slicedToArray(_useState, 2),
|
7157
|
+
selectedRowKeys = _useState2[0],
|
7158
|
+
setSelectedKeys = _useState2[1];
|
7159
|
+
|
7160
|
+
var _useState3 = React.useState([]),
|
7161
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
7162
|
+
selectedRows = _useState4[0],
|
7163
|
+
setSelectedRows = _useState4[1];
|
7164
|
+
|
7165
|
+
var onSelectAllChange = function onSelectAllChange(e) {
|
7166
|
+
if (e.target.checked) {
|
7167
|
+
setSelectedKeys(dataSource.map(function (record) {
|
7168
|
+
return typeof rowKey === 'function' ? record[rowKey(record)] : record[rowKey];
|
7169
|
+
}));
|
7170
|
+
setSelectedRows(function () {
|
7171
|
+
var _rowSelection$onSelec;
|
7172
|
+
|
7173
|
+
rowSelection === null || rowSelection === void 0 ? void 0 : (_rowSelection$onSelec = rowSelection.onSelectAll) === null || _rowSelection$onSelec === void 0 ? void 0 : _rowSelection$onSelec.call(rowSelection, e.target.checked, dataSource, dataSource);
|
7174
|
+
return dataSource;
|
7175
|
+
});
|
7176
|
+
} else {
|
7177
|
+
setSelectedKeys([]);
|
7178
|
+
setSelectedRows(function () {
|
7179
|
+
var _rowSelection$onSelec2;
|
7180
|
+
|
7181
|
+
rowSelection === null || rowSelection === void 0 ? void 0 : (_rowSelection$onSelec2 = rowSelection.onSelectAll) === null || _rowSelection$onSelec2 === void 0 ? void 0 : _rowSelection$onSelec2.call(rowSelection, e.target.checked, [], dataSource);
|
7182
|
+
return [];
|
7183
|
+
});
|
7184
|
+
}
|
7185
|
+
};
|
7186
|
+
|
7187
|
+
var _useState5 = React.useState({}),
|
7188
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
7189
|
+
columnsFields = _useState6[0],
|
7190
|
+
setColumnsFields = _useState6[1];
|
7191
|
+
|
7192
|
+
var layerIndex = getArrayLayer(columns, 'children', 1);
|
7193
|
+
|
7194
|
+
var _useState7 = React.useState({}),
|
7195
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
7196
|
+
formSearch = _useState8[0],
|
7197
|
+
setFormSearch = _useState8[1];
|
7198
|
+
|
7199
|
+
var formSearchRef = React.useRef(null);
|
7200
|
+
React.useEffect(function () {
|
7201
|
+
var _formSearchRef$curren;
|
7202
|
+
|
7203
|
+
if (formSearchRef === null || formSearchRef === void 0 ? void 0 : (_formSearchRef$curren = formSearchRef.current) === null || _formSearchRef$curren === void 0 ? void 0 : _formSearchRef$curren.columnsFields) {
|
7204
|
+
var _formSearchRef$curren2;
|
7205
|
+
|
7206
|
+
setColumnsFields(formSearchRef === null || formSearchRef === void 0 ? void 0 : (_formSearchRef$curren2 = formSearchRef.current) === null || _formSearchRef$curren2 === void 0 ? void 0 : _formSearchRef$curren2.columnsFields);
|
7207
|
+
}
|
7208
|
+
|
7209
|
+
if ((formSearchRef === null || formSearchRef === void 0 ? void 0 : formSearchRef.current) && formRef) {
|
7210
|
+
var _formSearchRef$curren3;
|
7211
|
+
|
7212
|
+
formRef.current = formSearchRef === null || formSearchRef === void 0 ? void 0 : (_formSearchRef$curren3 = formSearchRef.current) === null || _formSearchRef$curren3 === void 0 ? void 0 : _formSearchRef$curren3.form;
|
7213
|
+
}
|
7214
|
+
}, [JSON.stringify(formSearchRef === null || formSearchRef === void 0 ? void 0 : (_formSearchRef$curren4 = formSearchRef.current) === null || _formSearchRef$curren4 === void 0 ? void 0 : _formSearchRef$curren4.columnsFields), formRef, formSearchRef]);
|
7215
|
+
|
7216
|
+
var flattenColumns = function flattenColumns(columns) {
|
7217
|
+
var arr = columns.reduce(function (pre, cur) {
|
7218
|
+
if (cur.children) {
|
7219
|
+
return pre.concat(flattenColumns(cur.children));
|
7220
|
+
}
|
7221
|
+
|
7222
|
+
return pre.concat(cur);
|
7223
|
+
}, []);
|
7224
|
+
return arr;
|
7225
|
+
};
|
7226
|
+
|
7227
|
+
var filterFormColumns = React.useMemo(function () {
|
7228
|
+
return flattenColumns(columns).filter(function (c) {
|
7229
|
+
return !c.hideInSearch;
|
7230
|
+
});
|
7231
|
+
}, [columns]);
|
7232
|
+
var filterColumns = React.useMemo(function () {
|
7233
|
+
return flattenColumns(columns).filter(function (c) {
|
7234
|
+
return !c.hideInTable;
|
7235
|
+
});
|
7236
|
+
}, [columns]);
|
7237
|
+
|
7238
|
+
var calcWidth = function calcWidth(columns) {
|
7239
|
+
return columns.reduce(function (pre, cur) {
|
7240
|
+
var width = cur.width;
|
7241
|
+
|
7242
|
+
if (width) {
|
7243
|
+
return pre + width;
|
7244
|
+
}
|
7245
|
+
|
7246
|
+
return pre;
|
7247
|
+
}, 0);
|
7248
|
+
};
|
7249
|
+
|
7250
|
+
var showColumns = columns.filter(function (c) {
|
7251
|
+
return !c.hideInTable;
|
7252
|
+
});
|
7253
|
+
var renderTh = React.useMemo(function () {
|
7254
|
+
var renderThFc = function renderThFc(columns, parentHeight, isChild) {
|
7255
|
+
var showColumns = columns.filter(function (c) {
|
7256
|
+
return !c.hideInTable;
|
7257
|
+
});
|
7258
|
+
return showColumns.map(function (c, index) {
|
7259
|
+
if (c.children) {
|
7260
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
7261
|
+
className: "td",
|
7262
|
+
key: index,
|
7263
|
+
style: {
|
7264
|
+
width: c.width + 'px',
|
7265
|
+
flex: c.width ? '0 1 auto' : c.children.length,
|
7266
|
+
flexDirection: 'column',
|
7267
|
+
display: 'block',
|
7268
|
+
height: parentHeight + 'px',
|
7269
|
+
borderRight: c.children && isChild ? 'none' : '1px solid #3b5173'
|
7270
|
+
}
|
7271
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
7272
|
+
className: "td",
|
7273
|
+
style: {
|
7274
|
+
width: c.width + 'px',
|
7275
|
+
flex: c.width ? '0 1 auto' : c.children.length,
|
7276
|
+
borderBottom: '1px solid #3b5173',
|
7277
|
+
height: parentHeight / getArrayLayer(c.children, 'children', 2) + 'px'
|
7278
|
+
}
|
7279
|
+
}, c.title), /*#__PURE__*/React__default['default'].createElement("div", {
|
7280
|
+
className: "td",
|
7281
|
+
style: {
|
7282
|
+
display: 'flex',
|
7283
|
+
width: '100%',
|
7284
|
+
height: parentHeight / getArrayLayer(c.children, 'children', 2) * getArrayLayer(c.children, 'children', 1) + 'px'
|
7285
|
+
}
|
7286
|
+
}, renderThFc(c.children, parentHeight / getArrayLayer(c.children, 'children', 2) * getArrayLayer(c.children, 'children', 1), true)));
|
7287
|
+
} else {
|
7288
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
7289
|
+
key: c.dataIndex,
|
7290
|
+
style: _objectSpread2({
|
7291
|
+
width: c.width + 'px',
|
7292
|
+
flex: c.width ? '0 1 auto' : '1',
|
7293
|
+
height: !c.children ? '100%' : '32px',
|
7294
|
+
borderRight: index != showColumns.length - 1 && filterColumns.length !== showColumns.length ? '1px solid #3b5173' : 'none'
|
7295
|
+
}, c.fixed == 'left' ? {
|
7296
|
+
left: ((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.type) ? 56 : 6) + calcWidth(showColumns.slice(0, index - 2 > 0 ? index - 1 : 0))
|
7297
|
+
} : c.fixed == 'right' ? {
|
7298
|
+
right: calcWidth(showColumns.slice(index + 1))
|
7299
|
+
} : {}),
|
7300
|
+
className: "td ".concat(c.fixed == 'left' ? 'fixedLeft' : c.fixed == 'right' ? 'fixedRight' : '')
|
7301
|
+
}, c.title);
|
7302
|
+
}
|
7303
|
+
});
|
7304
|
+
};
|
7305
|
+
|
7306
|
+
return renderThFc(columns, layerIndex * 32);
|
7307
|
+
}, [columns]);
|
7308
|
+
|
7309
|
+
var renderTd = function renderTd(record) {
|
7310
|
+
var renderThFc = function renderThFc(columns) {
|
7311
|
+
var showColumns = columns.filter(function (c) {
|
7312
|
+
return !c.hideInTable;
|
7313
|
+
});
|
7314
|
+
return showColumns.map(function (c, index) {
|
7315
|
+
if (c.children) {
|
7316
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
7317
|
+
className: "td",
|
7318
|
+
key: index,
|
7319
|
+
style: {
|
7320
|
+
width: c.width + 'px',
|
7321
|
+
flex: c.width ? '0 1 auto' : c.children.length,
|
7322
|
+
flexDirection: 'column',
|
7323
|
+
alignItems: 'center',
|
7324
|
+
overflow: 'hidden'
|
7325
|
+
}
|
7326
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
7327
|
+
className: "td",
|
7328
|
+
style: {
|
7329
|
+
width: '100%',
|
7330
|
+
alignItems: 'center'
|
7331
|
+
}
|
7332
|
+
}, renderThFc(c.children)));
|
7333
|
+
} else {
|
7334
|
+
if (c.showTitle) {
|
7335
|
+
var _columnsFields$c$data;
|
7336
|
+
|
7337
|
+
return /*#__PURE__*/React__default['default'].createElement(_Tooltip__default['default'], {
|
7338
|
+
key: c.dataIndex,
|
7339
|
+
placement: "top",
|
7340
|
+
title: record[c.dataIndex]
|
7341
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
7342
|
+
className: "td ".concat(c.fixed == 'left' ? 'fixedLeft' : c.fixed == 'right' ? 'fixedRight' : '', " ").concat(c.ellipsis ? ' ellipsis' : ''),
|
7343
|
+
style: _objectSpread2({
|
7344
|
+
width: c.width + 'px',
|
7345
|
+
flex: c.width ? '0 1 auto' : '1',
|
7346
|
+
overflow: 'hidden'
|
7347
|
+
}, c.fixed == 'left' ? {
|
7348
|
+
left: ((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.type) ? 56 : 6) + calcWidth(showColumns.slice(0, index - 2 > 0 ? index - 1 : 0))
|
7349
|
+
} : c.fixed == 'right' ? {
|
7350
|
+
right: calcWidth(showColumns.slice(index + 1))
|
7351
|
+
} : {})
|
7352
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
7353
|
+
style: {
|
7354
|
+
width: '100%',
|
7355
|
+
whiteSpace: 'nowrap',
|
7356
|
+
overflow: 'hidden',
|
7357
|
+
textOverflow: 'ellipsis'
|
7358
|
+
}
|
7359
|
+
}, c.render ? c.render(record[c.dataIndex], record, index) : columnsFields[c.dataIndex] ? (_columnsFields$c$data = columnsFields[c.dataIndex].find(function (item) {
|
7360
|
+
return item.value == record[c.dataIndex];
|
7361
|
+
})) === null || _columnsFields$c$data === void 0 ? void 0 : _columnsFields$c$data.label : record[c.dataIndex])));
|
7362
|
+
} else {
|
7363
|
+
var _columnsFields$c$data2, _columnsFields$c$data3;
|
7364
|
+
|
7365
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
7366
|
+
key: c.dataIndex,
|
7367
|
+
className: "td ".concat(c.fixed == 'left' ? 'fixedLeft' : c.fixed == 'right' ? 'fixedRight' : '', " ").concat(c.ellipsis ? ' ellipsis' : ''),
|
7368
|
+
style: _objectSpread2({
|
7369
|
+
width: c.width + 'px',
|
7370
|
+
flex: c.width ? '0 1 auto' : '1',
|
7371
|
+
overflow: 'hidden'
|
7372
|
+
}, c.fixed == 'left' ? {
|
7373
|
+
left: ((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.type) ? 56 : 6) + calcWidth(showColumns.slice(0, index - 2 > 0 ? index - 1 : 0))
|
7374
|
+
} : c.fixed == 'right' ? {
|
7375
|
+
right: calcWidth(showColumns.slice(index + 1))
|
7376
|
+
} : {}),
|
7377
|
+
title: record[c.dataIndex]
|
7378
|
+
}, c.ellipsis ? /*#__PURE__*/React__default['default'].createElement("div", {
|
7379
|
+
style: {
|
7380
|
+
width: '100%',
|
7381
|
+
whiteSpace: 'nowrap',
|
7382
|
+
overflow: 'hidden',
|
7383
|
+
textOverflow: 'ellipsis'
|
7384
|
+
}
|
7385
|
+
}, c.render ? c.render(record[c.dataIndex], record, index) : columnsFields[c.dataIndex] ? (_columnsFields$c$data2 = columnsFields[c.dataIndex].find(function (item) {
|
7386
|
+
return item.value == record[c.dataIndex];
|
7387
|
+
})) === null || _columnsFields$c$data2 === void 0 ? void 0 : _columnsFields$c$data2.label : record[c.dataIndex]) : c.render ? c.render(record[c.dataIndex], record, index) : columnsFields[c.dataIndex] ? (_columnsFields$c$data3 = columnsFields[c.dataIndex].find(function (item) {
|
7388
|
+
return item.value == record[c.dataIndex];
|
7389
|
+
})) === null || _columnsFields$c$data3 === void 0 ? void 0 : _columnsFields$c$data3.label : record[c.dataIndex]);
|
7390
|
+
}
|
7391
|
+
}
|
7392
|
+
});
|
7393
|
+
};
|
7394
|
+
|
7395
|
+
return renderThFc(columns);
|
7396
|
+
};
|
7397
|
+
|
7398
|
+
var renderTr = function renderTr(record, index, key) {
|
7399
|
+
var _ref2, _ref3;
|
7400
|
+
|
7401
|
+
return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread2({
|
7402
|
+
key: key,
|
7403
|
+
className: classnames__default['default'](_defineProperty({
|
7404
|
+
tr: true
|
7405
|
+
}, typeof rowClassName === 'function' ? rowClassName(record, index) : '', true))
|
7406
|
+
}, typeof onRow === 'function' ? onRow(record, index) : {}), (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.type) === 'checkbox' && /*#__PURE__*/React__default['default'].createElement("div", {
|
7407
|
+
style: _objectSpread2({
|
7408
|
+
width: '50px',
|
7409
|
+
flex: '0 1 auto'
|
7410
|
+
}, showColumns[0].fixed == 'left' ? {
|
7411
|
+
left: 6
|
7412
|
+
} : {}),
|
7413
|
+
className: "td ".concat(showColumns[0].fixed == 'left' ? 'fixedLeft' : '')
|
7414
|
+
}, /*#__PURE__*/React__default['default'].createElement(Index$4, {
|
7415
|
+
checked: (_ref2 = [].concat(_toConsumableArray((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || []), _toConsumableArray(selectedRowKeys))) === null || _ref2 === void 0 ? void 0 : _ref2.includes(key),
|
7416
|
+
onClick: function onClick(e) {
|
7417
|
+
return e.stopPropagation();
|
7418
|
+
},
|
7419
|
+
onChange: function onChange(event) {
|
7420
|
+
setSelectedKeys(function (keys) {
|
7421
|
+
var rows = lodashEs.uniqBy([].concat(_toConsumableArray(selectedRows), [record]), typeof rowKey === 'function' ? rowKey(record) : rowKey);
|
7422
|
+
|
7423
|
+
if (event.target.checked) {
|
7424
|
+
var _rowSelection$onChang, _rowSelection$onSelec3;
|
7425
|
+
|
7426
|
+
setSelectedRows(rows);
|
7427
|
+
rowSelection === null || rowSelection === void 0 ? void 0 : (_rowSelection$onChang = rowSelection.onChange) === null || _rowSelection$onChang === void 0 ? void 0 : _rowSelection$onChang.call(rowSelection, _toConsumableArray(new Set([].concat(_toConsumableArray((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || []), _toConsumableArray(selectedRowKeys), [key]))), rows);
|
7428
|
+
rowSelection === null || rowSelection === void 0 ? void 0 : (_rowSelection$onSelec3 = rowSelection.onSelect) === null || _rowSelection$onSelec3 === void 0 ? void 0 : _rowSelection$onSelec3.call(rowSelection, record, event.target.checked, rows, event.nativeEvent);
|
7429
|
+
return _toConsumableArray(new Set([].concat(_toConsumableArray((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || []), _toConsumableArray(keys), [key])));
|
7430
|
+
} else {
|
7431
|
+
var _rowSelection$onSelec4, _rowSelection$onChang2;
|
7432
|
+
|
7433
|
+
var selectedKeys = _toConsumableArray(new Set([].concat(_toConsumableArray((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || []), _toConsumableArray(keys))));
|
7434
|
+
|
7435
|
+
var _index = selectedKeys.indexOf(key);
|
7436
|
+
|
7437
|
+
selectedKeys.splice(_index, 1);
|
7438
|
+
rows.splice(_index, 1);
|
7439
|
+
setSelectedRows(rows);
|
7440
|
+
rowSelection === null || rowSelection === void 0 ? void 0 : (_rowSelection$onSelec4 = rowSelection.onSelect) === null || _rowSelection$onSelec4 === void 0 ? void 0 : _rowSelection$onSelec4.call(rowSelection, record, event.target.checked, rows, event.nativeEvent);
|
7441
|
+
rowSelection === null || rowSelection === void 0 ? void 0 : (_rowSelection$onChang2 = rowSelection.onChange) === null || _rowSelection$onChang2 === void 0 ? void 0 : _rowSelection$onChang2.call(rowSelection, selectedKeys, rows);
|
7442
|
+
return selectedKeys;
|
7443
|
+
}
|
7444
|
+
});
|
7445
|
+
}
|
7446
|
+
})), (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.type) === 'radio' && /*#__PURE__*/React__default['default'].createElement("div", {
|
7447
|
+
style: _objectSpread2({
|
7448
|
+
width: '50px',
|
7449
|
+
flex: '0 1 auto'
|
7450
|
+
}, showColumns[0].fixed == 'left' ? {
|
7451
|
+
left: 6
|
7452
|
+
} : {}),
|
7453
|
+
className: "td ".concat(showColumns[0].fixed == 'left' ? 'fixedLeft' : '')
|
7454
|
+
}, /*#__PURE__*/React__default['default'].createElement(Index$3, {
|
7455
|
+
checked: (_ref3 = [].concat(_toConsumableArray((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || []), _toConsumableArray(selectedRowKeys))) === null || _ref3 === void 0 ? void 0 : _ref3.includes(key),
|
7456
|
+
onClick: function onClick(e) {
|
7457
|
+
return e.stopPropagation();
|
7458
|
+
},
|
7459
|
+
onChange: function onChange(event) {
|
7460
|
+
var _rowSelection$onSelec5, _rowSelection$onChang3;
|
7461
|
+
|
7462
|
+
setSelectedKeys([key]);
|
7463
|
+
setSelectedRows([record]);
|
7464
|
+
rowSelection === null || rowSelection === void 0 ? void 0 : (_rowSelection$onSelec5 = rowSelection.onSelect) === null || _rowSelection$onSelec5 === void 0 ? void 0 : _rowSelection$onSelec5.call(rowSelection, record, event.target.checked, [record], event.nativeEvent);
|
7465
|
+
rowSelection === null || rowSelection === void 0 ? void 0 : (_rowSelection$onChang3 = rowSelection.onChange) === null || _rowSelection$onChang3 === void 0 ? void 0 : _rowSelection$onChang3.call(rowSelection, _toConsumableArray(new Set([].concat(_toConsumableArray((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || []), [key]))), [record]);
|
7466
|
+
}
|
7467
|
+
})), renderTd(record));
|
7468
|
+
};
|
7469
|
+
|
7470
|
+
var _useState9 = React.useState([]),
|
7471
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
7472
|
+
dataSource = _useState10[0],
|
7473
|
+
setDataSource = _useState10[1];
|
7474
|
+
|
7475
|
+
var _useState11 = React.useState(0),
|
7476
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
7477
|
+
total = _useState12[0],
|
7478
|
+
setTotal = _useState12[1];
|
7479
|
+
|
7480
|
+
var _useState13 = React.useState({}),
|
7481
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
7482
|
+
pageParams = _useState14[0],
|
7483
|
+
setPageParams = _useState14[1];
|
7484
|
+
|
7485
|
+
var _useState15 = React.useState(false),
|
7486
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
7487
|
+
loading = _useState16[0],
|
7488
|
+
setLoading = _useState16[1];
|
7489
|
+
|
7490
|
+
var _useState17 = React.useState({
|
7491
|
+
total: total,
|
7492
|
+
pageSize: 20,
|
7493
|
+
size: 'small',
|
7494
|
+
current: 1,
|
7495
|
+
showLessItems: true,
|
7496
|
+
showTotal: function showTotal(total) {
|
7497
|
+
return "\u5171".concat(total, "\u6761\u6570\u636E");
|
7498
|
+
},
|
7499
|
+
onChange: function onChange(current, pageSize) {
|
7500
|
+
setPageParams({
|
7501
|
+
current: current,
|
7502
|
+
pageSize: pageSize
|
7503
|
+
});
|
7504
|
+
}
|
7505
|
+
}),
|
7506
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
7507
|
+
paginationParams = _useState18[0],
|
7508
|
+
setpaginationParams = _useState18[1];
|
7509
|
+
|
7510
|
+
React.useEffect(function () {
|
7511
|
+
_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
7512
|
+
var requestParams, res;
|
7513
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
7514
|
+
while (1) {
|
7515
|
+
switch (_context.prev = _context.next) {
|
7516
|
+
case 0:
|
7517
|
+
if (!request) {
|
7518
|
+
_context.next = 15;
|
7519
|
+
break;
|
7520
|
+
}
|
7521
|
+
|
7522
|
+
setLoading(true);
|
7523
|
+
requestParams = {};
|
7524
|
+
|
7525
|
+
if (pagination) {
|
7526
|
+
requestParams.current = pagination.current || 1;
|
7527
|
+
requestParams.pageSize = pagination.pageSize || 20;
|
7528
|
+
}
|
7529
|
+
|
7530
|
+
requestParams = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, requestParams), pageParams), params), formSearch);
|
7531
|
+
_context.next = 7;
|
7532
|
+
return request(requestParams);
|
7533
|
+
|
7534
|
+
case 7:
|
7535
|
+
res = _context.sent;
|
7536
|
+
setLoading(false);
|
7537
|
+
onLoad && onLoad(res.data);
|
7538
|
+
setDataSource(res.data);
|
7539
|
+
setTotal(res.total || 0);
|
7540
|
+
setpaginationParams(function (c) {
|
7541
|
+
return _objectSpread2(_objectSpread2(_objectSpread2({}, c), {}, {
|
7542
|
+
total: res.total || res.data.length
|
7543
|
+
}, pagination), requestParams);
|
7544
|
+
});
|
7545
|
+
_context.next = 16;
|
7546
|
+
break;
|
7547
|
+
|
7548
|
+
case 15:
|
7549
|
+
setpaginationParams(function (c) {
|
7550
|
+
var obj = _objectSpread2(_objectSpread2(_objectSpread2({}, c), {}, {
|
7551
|
+
total: tableList && tableList.length || 0
|
7552
|
+
}, pagination), pageParams);
|
7553
|
+
|
7554
|
+
var current = obj.current,
|
7555
|
+
pageSize = obj.pageSize;
|
7556
|
+
setDataSource(tableList ? tableList.slice((current - 1) * pageSize, current * pageSize) : []);
|
7557
|
+
return obj;
|
7558
|
+
});
|
7559
|
+
|
7560
|
+
case 16:
|
7561
|
+
case "end":
|
7562
|
+
return _context.stop();
|
7563
|
+
}
|
7564
|
+
}
|
7565
|
+
}, _callee);
|
7566
|
+
}))();
|
7567
|
+
}, [params, pageParams, pagination, tableList, formSearch, columns]);
|
7568
|
+
|
7569
|
+
var onFormSubmit = function onFormSubmit(values) {
|
7570
|
+
onSubmit && onSubmit(values);
|
7571
|
+
setFormSearch(values);
|
7572
|
+
};
|
7573
|
+
|
7574
|
+
var onReset = function onReset() {
|
7575
|
+
var requestParams = {};
|
7576
|
+
|
7577
|
+
if (pagination) {
|
7578
|
+
requestParams.current = pagination.current || 1;
|
7579
|
+
requestParams.pageSize = pagination.pageSize || 20;
|
7580
|
+
}
|
7581
|
+
|
7582
|
+
setPageParams(requestParams);
|
7583
|
+
setFormSearch({});
|
7584
|
+
};
|
7585
|
+
|
7586
|
+
return /*#__PURE__*/React__default['default'].createElement(_Spin__default['default'], {
|
7587
|
+
spinning: loading
|
7588
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
7589
|
+
className: "form"
|
7590
|
+
}, search !== false && /*#__PURE__*/React__default['default'].createElement(WForm$1, {
|
7591
|
+
ref: formSearchRef,
|
7592
|
+
search: _objectSpread2(_objectSpread2({
|
7593
|
+
labelWidth: 'auto',
|
7594
|
+
searchText: '查询',
|
7595
|
+
span: 6
|
7596
|
+
}, search), {}, {
|
7597
|
+
optionRender: function optionRender(searchConfig, formProps, dom) {
|
7598
|
+
// return [...dom.reverse()];
|
7599
|
+
return _toConsumableArray((search === null || search === void 0 ? void 0 : search.optionDomReverse) ? dom.reverse() : dom);
|
7600
|
+
}
|
7601
|
+
}),
|
7602
|
+
onSubmit: onFormSubmit,
|
7603
|
+
onReset: onReset,
|
7604
|
+
columns: filterFormColumns
|
7605
|
+
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
7606
|
+
className: classnames__default['default']((_classnames2 = {
|
7607
|
+
container: true
|
7608
|
+
}, _defineProperty(_classnames2, 'w-table', true), _defineProperty(_classnames2, 'w-frame-box-table', frameBoxTable), _defineProperty(_classnames2, className || 'defalut-table', true), _classnames2))
|
7609
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
7610
|
+
className: "theader"
|
7611
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
7612
|
+
className: "th",
|
7613
|
+
style: _objectSpread2(_objectSpread2({}, thStyle), {}, {
|
7614
|
+
height: layerIndex * 32 + 'px'
|
7615
|
+
}, (scroll === null || scroll === void 0 ? void 0 : scroll.x) ? {
|
7616
|
+
width: scroll.x
|
7617
|
+
} : {})
|
7618
|
+
}, (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.type) === 'checkbox' && /*#__PURE__*/React__default['default'].createElement("div", {
|
7619
|
+
style: _objectSpread2({
|
7620
|
+
width: '50px',
|
7621
|
+
flex: '0 1 auto',
|
7622
|
+
height: '100%'
|
7623
|
+
}, showColumns[0].fixed == 'left' ? {
|
7624
|
+
left: 6
|
7625
|
+
} : {}),
|
7626
|
+
className: "td ".concat(((_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.fixed) == 'left' ? 'fixedLeft' : '')
|
7627
|
+
}, /*#__PURE__*/React__default['default'].createElement(Index$4, {
|
7628
|
+
checked: dataSource.every(function (record) {
|
7629
|
+
return selectedRowKeys.includes(typeof rowKey === 'function' ? record[rowKey(record)] : record[rowKey]);
|
7630
|
+
}),
|
7631
|
+
indeterminate: !dataSource.every(function (record) {
|
7632
|
+
return selectedRowKeys.includes(typeof rowKey === 'function' ? record[rowKey(record)] : record[rowKey]);
|
7633
|
+
}) && dataSource.some(function (record) {
|
7634
|
+
return selectedRowKeys.includes(typeof rowKey === 'function' ? record[rowKey(record)] : record[rowKey]);
|
7635
|
+
}),
|
7636
|
+
onChange: onSelectAllChange
|
7637
|
+
})), (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.type) === 'radio' && /*#__PURE__*/React__default['default'].createElement("div", {
|
7638
|
+
style: _objectSpread2({
|
7639
|
+
width: '50px',
|
7640
|
+
flex: '0 1 auto',
|
7641
|
+
height: '100%'
|
7642
|
+
}, showColumns[0].fixed == 'left' ? {
|
7643
|
+
left: 6
|
7644
|
+
} : {}),
|
7645
|
+
className: "td ".concat(((_columns$2 = columns[0]) === null || _columns$2 === void 0 ? void 0 : _columns$2.fixed) == 'left' ? 'fixedLeft' : '')
|
7646
|
+
}), renderTh)), /*#__PURE__*/React__default['default'].createElement("div", {
|
7647
|
+
className: "tbodyContainer",
|
7648
|
+
style: _objectSpread2(_objectSpread2(_objectSpread2({}, (scroll === null || scroll === void 0 ? void 0 : scroll.x) ? {
|
7649
|
+
width: scroll.x
|
7650
|
+
} : {}), (scroll === null || scroll === void 0 ? void 0 : scroll.y) ? {
|
7651
|
+
height: scroll.y
|
7652
|
+
} : {}), {}, {
|
7653
|
+
overflow: 'auto'
|
7654
|
+
}, style)
|
7655
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
7656
|
+
className: "tbody",
|
7657
|
+
style: _objectSpread2({
|
7658
|
+
height: (style === null || style === void 0 ? void 0 : style.height) || (scroll === null || scroll === void 0 ? void 0 : scroll.y) ? "calc(".concat(style === null || style === void 0 ? void 0 : style.height, " - ").concat(52 + (pagination === false ? 0 : 42), "px)") : '200px'
|
7659
|
+
}, tbodyStyle)
|
7660
|
+
}, dataSource.length > 0 ? dataSource.map(function (record, index) {
|
7661
|
+
var key = typeof rowKey === 'function' ? record[rowKey(record)] : record[rowKey];
|
7662
|
+
return frameBoxTable ? /*#__PURE__*/React__default['default'].createElement(FrameBox$1, {
|
7663
|
+
key: key,
|
7664
|
+
direction: frameBoxDirection,
|
7665
|
+
style: {
|
7666
|
+
width: '100%'
|
7667
|
+
}
|
7668
|
+
}, renderTr(record, index, key)) : renderTr(record, index, key);
|
7669
|
+
}) : /*#__PURE__*/React__default['default'].createElement("div", {
|
7670
|
+
style: {
|
7671
|
+
width: '100%',
|
7672
|
+
height: '100%',
|
7673
|
+
display: 'flex',
|
7674
|
+
justifyContent: 'center',
|
7675
|
+
alignItems: 'center'
|
7676
|
+
}
|
7677
|
+
}, none || '暂无数据')))), _typeof(pagination) === 'object' && /*#__PURE__*/React__default['default'].createElement(_Pagination__default['default'], _objectSpread2({
|
7678
|
+
style: {
|
7679
|
+
textAlign: 'right',
|
7680
|
+
marginTop: '10px'
|
7681
|
+
}
|
7682
|
+
}, paginationParams)));
|
7683
|
+
}
|
7684
|
+
NtTable.defaultProps = {
|
7685
|
+
rowKey: 'key'
|
7686
|
+
};
|
7687
|
+
|
6888
7688
|
/*
|
6889
7689
|
* @Author: lijin
|
6890
7690
|
* @Date: 2021-08-04 13:22:21
|
@@ -7667,10 +8467,10 @@ function WaterLevelCharts(config) {
|
|
7667
8467
|
/*
|
7668
8468
|
* @Author: lijin
|
7669
8469
|
* @Date: 2021-09-09 11:02:54
|
7670
|
-
* @LastEditTime: 2022-
|
8470
|
+
* @LastEditTime: 2022-11-09 19:44:46
|
7671
8471
|
* @LastEditors: lijin
|
7672
8472
|
* @Description:
|
7673
|
-
* @FilePath: \wargerm\src\index.ts
|
8473
|
+
* @FilePath: \wargem\wargerm-components\src\index.ts
|
7674
8474
|
* 可以输入预定的版权声明、个性签名、空行等
|
7675
8475
|
*/
|
7676
8476
|
console.log(REACT_APP_ENV, 'REACT_APP_ENV');
|
@@ -7697,6 +8497,7 @@ exports.LineEcharts = LineEcharts;
|
|
7697
8497
|
exports.Modal = Modal;
|
7698
8498
|
exports.ModalForm = ModalForm$1;
|
7699
8499
|
exports.ModalTips = Modal$1;
|
8500
|
+
exports.NtTable = NtTable;
|
7700
8501
|
exports.Number = Index$8;
|
7701
8502
|
exports.NumericInput = NumericInput;
|
7702
8503
|
exports.Radio = Index$3;
|
@@ -7714,3 +8515,5 @@ exports.WForm = WForm$1;
|
|
7714
8515
|
exports.WaterLevelCharts = WaterLevelCharts;
|
7715
8516
|
exports.WebsocketHeart = WebsocketHeart;
|
7716
8517
|
exports.useEventEmitter = useEventEmitter;
|
8518
|
+
exports.whox = create;
|
8519
|
+
exports.wmox = wmox;
|