@teamix/pro 1.5.0 → 1.5.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/pro.css +1 -1
- package/dist/pro.js +1103 -123
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/index.d.ts +4 -0
- package/es/actions/index.js +34 -9
- package/es/actions/index.scss +5 -0
- package/es/card/index.scss +7 -0
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/es/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/es/sidebar/index.d.ts +2 -0
- package/es/sidebar/index.js +3 -1
- package/es/table/components/CardView/index.d.ts +5 -0
- package/es/table/components/CardView/index.js +446 -0
- package/es/table/components/CardView/index.scss +46 -0
- package/es/table/components/Filter/index.d.ts +1 -0
- package/es/table/components/Filter/index.js +21 -14
- package/es/table/components/Layout/index.js +4 -2
- package/es/table/components/LoadMore/index.d.ts +20 -0
- package/es/table/components/LoadMore/index.js +107 -0
- package/es/table/components/LoadMore/index.scss +19 -0
- package/es/table/components/QuickAction/index.d.ts +1 -0
- package/es/table/components/ToolBar/CardSwitch.d.ts +8 -0
- package/es/table/components/ToolBar/CardSwitch.js +63 -0
- package/es/table/components/ToolBar/FilterColumnIcon.js +13 -2
- package/es/table/components/ToolBar/Fullscreen.js +15 -2
- package/es/table/components/ToolBar/index.js +64 -33
- package/es/table/components/ToolBar/index.scss +10 -1
- package/es/table/index.js +132 -34
- package/es/table/typing.d.ts +69 -0
- package/es/table/utils/columnRender.d.ts +1 -1
- package/es/table/utils/columnRender.js +4 -2
- package/es/table/utils/genProColumnToColumn.d.ts +1 -1
- package/es/table/utils/genProColumnToColumn.js +3 -1
- package/lib/actions/index.d.ts +4 -0
- package/lib/actions/index.js +33 -9
- package/lib/actions/index.scss +5 -0
- package/lib/card/index.scss +7 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/lib/sidebar/index.d.ts +2 -0
- package/lib/sidebar/index.js +12 -1
- package/lib/table/components/CardView/index.d.ts +5 -0
- package/lib/table/components/CardView/index.js +468 -0
- package/lib/table/components/CardView/index.scss +46 -0
- package/lib/table/components/Filter/index.d.ts +1 -0
- package/lib/table/components/Filter/index.js +21 -14
- package/lib/table/components/Layout/index.js +4 -2
- package/lib/table/components/LoadMore/index.d.ts +20 -0
- package/lib/table/components/LoadMore/index.js +128 -0
- package/lib/table/components/LoadMore/index.scss +19 -0
- package/lib/table/components/QuickAction/index.d.ts +1 -0
- package/lib/table/components/ToolBar/CardSwitch.d.ts +8 -0
- package/lib/table/components/ToolBar/CardSwitch.js +82 -0
- package/lib/table/components/ToolBar/FilterColumnIcon.js +13 -2
- package/lib/table/components/ToolBar/Fullscreen.js +15 -2
- package/lib/table/components/ToolBar/index.js +65 -32
- package/lib/table/components/ToolBar/index.scss +10 -1
- package/lib/table/index.js +134 -34
- package/lib/table/typing.d.ts +69 -0
- package/lib/table/utils/columnRender.d.ts +1 -1
- package/lib/table/utils/columnRender.js +4 -2
- package/lib/table/utils/genProColumnToColumn.d.ts +1 -1
- package/lib/table/utils/genProColumnToColumn.js +3 -1
- package/package.json +1 -1
package/dist/pro.js
CHANGED
@@ -60848,16 +60848,26 @@ var FieldDate = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().forwar
|
|
60848
60848
|
'teamix-pro-field-layout-compact': true
|
60849
60849
|
}),
|
60850
60850
|
onChange: function onChange(date, dateStr) {
|
60851
|
-
|
60852
|
-
|
60853
|
-
|
60851
|
+
setFieldVal(date);
|
60852
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_8__/* .bindRefValue */ .Dd)(dateStr, ref);
|
60853
|
+
|
60854
|
+
if (['dateWeek', 'dateQuarter', 'dateWeekRange', 'dateQuarterRange'].includes(type)) {
|
60855
|
+
if (Array.isArray(date)) {
|
60856
|
+
var str = date.map(function (item) {
|
60857
|
+
return item.format(format !== null && format !== void 0 ? format : 'YYYY-MM-DD');
|
60858
|
+
});
|
60859
|
+
setFieldValStr(str);
|
60860
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange((0,_utils__WEBPACK_IMPORTED_MODULE_8__/* .formatterOnchangeValue */ .WO)(str), (0,_utils__WEBPACK_IMPORTED_MODULE_8__/* .formatterOnchangeValue */ .WO)(date));
|
60861
|
+
} else {
|
60862
|
+
var _str = date.format(format !== null && format !== void 0 ? format : 'YYYY-MM-DD');
|
60863
|
+
|
60864
|
+
setFieldValStr(_str);
|
60865
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange((0,_utils__WEBPACK_IMPORTED_MODULE_8__/* .formatterOnchangeValue */ .WO)(_str), (0,_utils__WEBPACK_IMPORTED_MODULE_8__/* .formatterOnchangeValue */ .WO)(date));
|
60866
|
+
}
|
60854
60867
|
} else {
|
60855
|
-
setFieldVal(date);
|
60856
60868
|
setFieldValStr(dateStr);
|
60869
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange((0,_utils__WEBPACK_IMPORTED_MODULE_8__/* .formatterOnchangeValue */ .WO)(dateStr), (0,_utils__WEBPACK_IMPORTED_MODULE_8__/* .formatterOnchangeValue */ .WO)(date));
|
60857
60870
|
}
|
60858
|
-
|
60859
|
-
(0,_utils__WEBPACK_IMPORTED_MODULE_8__/* .bindRefValue */ .Dd)(dateStr, ref);
|
60860
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange((0,_utils__WEBPACK_IMPORTED_MODULE_8__/* .formatterOnchangeValue */ .WO)(dateStr), (0,_utils__WEBPACK_IMPORTED_MODULE_8__/* .formatterOnchangeValue */ .WO)(date));
|
60861
60871
|
},
|
60862
60872
|
size: size,
|
60863
60873
|
disabled: disabled
|
@@ -63788,7 +63798,12 @@ var FieldSelect = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().forw
|
|
63788
63798
|
onChange: function onChange(val) {
|
63789
63799
|
setFieldVal(val);
|
63790
63800
|
(0,_utils__WEBPACK_IMPORTED_MODULE_3__/* .bindRefValue */ .Dd)(val, ref);
|
63791
|
-
|
63801
|
+
|
63802
|
+
for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
63803
|
+
others[_key - 1] = arguments[_key];
|
63804
|
+
}
|
63805
|
+
|
63806
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange.apply(void 0, [(0,_utils__WEBPACK_IMPORTED_MODULE_3__/* .formatterOnchangeValue */ .WO)(val)].concat(others));
|
63792
63807
|
},
|
63793
63808
|
showSearch: true,
|
63794
63809
|
hasClear: true,
|
@@ -67797,7 +67812,8 @@ function _defineProperty(obj, key, value) {
|
|
67797
67812
|
var cls = (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_0__.usePrefixCls)('teamix-pro-field-output-ip');
|
67798
67813
|
var ipTypeMap = {
|
67799
67814
|
"public": (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_0__.getMessage)('public'),
|
67800
|
-
"private": (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_0__.getMessage)('private')
|
67815
|
+
"private": (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_0__.getMessage)('private'),
|
67816
|
+
elastic: (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_0__.getMessage)('elastic')
|
67801
67817
|
};
|
67802
67818
|
|
67803
67819
|
var Ip = function Ip(props) {
|
@@ -81729,7 +81745,7 @@ ProPageContainer.Tab = _tab__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z;
|
|
81729
81745
|
/* harmony import */ var _alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(33049);
|
81730
81746
|
/* harmony import */ var _alicloudfe_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__);
|
81731
81747
|
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20701);
|
81732
|
-
var _excluded = ["key", "path"],
|
81748
|
+
var _excluded = ["key", "path", "title", "badge"],
|
81733
81749
|
_excluded2 = ["activeKey", "children"],
|
81734
81750
|
_excluded3 = ["children"];
|
81735
81751
|
|
@@ -81839,10 +81855,23 @@ var ProPageContainerConfigTab = function ProPageContainerConfigTab(props) {
|
|
81839
81855
|
}, tabs.map(function (tab) {
|
81840
81856
|
var key = tab.key,
|
81841
81857
|
path = tab.path,
|
81858
|
+
titleProp = tab.title,
|
81859
|
+
badge = tab.badge,
|
81842
81860
|
others = _objectWithoutProperties(tab, _excluded);
|
81843
81861
|
|
81862
|
+
var title = titleProp;
|
81863
|
+
|
81864
|
+
if (badge) {
|
81865
|
+
title = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.Badge, {
|
81866
|
+
count: badge
|
81867
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
81868
|
+
className: "teamix-pro-page-container-tab-badge-content"
|
81869
|
+
}, titleProp));
|
81870
|
+
}
|
81871
|
+
|
81844
81872
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.Tab.Item, _objectSpread({
|
81845
|
-
key: tab.key
|
81873
|
+
key: tab.key,
|
81874
|
+
title: title
|
81846
81875
|
}, others));
|
81847
81876
|
}));
|
81848
81877
|
};
|
@@ -83960,6 +83989,125 @@ var useUrlState = function useUrlState(initialState, urlStateOptions) {
|
|
83960
83989
|
|
83961
83990
|
|
83962
83991
|
|
83992
|
+
/***/ }),
|
83993
|
+
|
83994
|
+
/***/ 76672:
|
83995
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
83996
|
+
|
83997
|
+
"use strict";
|
83998
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
83999
|
+
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
|
84000
|
+
/* harmony export */ });
|
84001
|
+
// @ts-ignore
|
84002
|
+
var columns = [{
|
84003
|
+
dataIndex: 'instanceName',
|
84004
|
+
title: '实例ID/实例名称',
|
84005
|
+
tooltip: '我是实例ID的说明',
|
84006
|
+
width: 250,
|
84007
|
+
render: {
|
84008
|
+
icon: 'task-fill',
|
84009
|
+
iconColor: 'B20',
|
84010
|
+
description: '{{record.rsId}}',
|
84011
|
+
descriptionRows: 2,
|
84012
|
+
link: 'https://teamixpro.dg.aliyun-inc.com/?rsId={{rsId}}',
|
84013
|
+
linkTarget: '_blank'
|
84014
|
+
}
|
84015
|
+
}, {
|
84016
|
+
dataIndex: '',
|
84017
|
+
title: '标签',
|
84018
|
+
tooltip: '我是标签的说明,我没有 dataIndex',
|
84019
|
+
render: {
|
84020
|
+
icon: 'label-line',
|
84021
|
+
iconColor: 'var(--color-text1-8, #848484)'
|
84022
|
+
}
|
84023
|
+
}, {
|
84024
|
+
dataIndex: 'organizationName',
|
84025
|
+
title: '组织',
|
84026
|
+
sortable: true,
|
84027
|
+
width: '15%',
|
84028
|
+
tooltip: '我这一列是可以被复制的~',
|
84029
|
+
render: {
|
84030
|
+
copy: true
|
84031
|
+
}
|
84032
|
+
}, {
|
84033
|
+
dataIndex: 'cost',
|
84034
|
+
title: '费用',
|
84035
|
+
valueType: 'money'
|
84036
|
+
}, {
|
84037
|
+
dataIndex: 'ip',
|
84038
|
+
title: 'IP 地址',
|
84039
|
+
filters: [{
|
84040
|
+
label: 'ip1',
|
84041
|
+
value: '0.0.0.0'
|
84042
|
+
}, {
|
84043
|
+
label: 'ip2',
|
84044
|
+
value: '8.8.8.8'
|
84045
|
+
}],
|
84046
|
+
render: {
|
84047
|
+
type: 'ip'
|
84048
|
+
}
|
84049
|
+
}, {
|
84050
|
+
dataIndex: 'status',
|
84051
|
+
title: '使用状态',
|
84052
|
+
filters: true,
|
84053
|
+
filterMode: 'multiple',
|
84054
|
+
dataSource: [{
|
84055
|
+
label: '进行中',
|
84056
|
+
value: 'process',
|
84057
|
+
color: 'process'
|
84058
|
+
}, {
|
84059
|
+
label: '成功',
|
84060
|
+
value: 'success',
|
84061
|
+
color: 'success'
|
84062
|
+
}, {
|
84063
|
+
label: '失败',
|
84064
|
+
value: 'fail',
|
84065
|
+
color: 'fail'
|
84066
|
+
}, {
|
84067
|
+
label: '提醒',
|
84068
|
+
value: 'warning',
|
84069
|
+
color: 'warning'
|
84070
|
+
}, {
|
84071
|
+
label: '暂停',
|
84072
|
+
value: 'pause',
|
84073
|
+
color: 'pause'
|
84074
|
+
}, {
|
84075
|
+
label: '启动中',
|
84076
|
+
value: 'loading',
|
84077
|
+
color: 'loading'
|
84078
|
+
}],
|
84079
|
+
render: {
|
84080
|
+
type: 'statusIconTag'
|
84081
|
+
}
|
84082
|
+
}, {
|
84083
|
+
dataIndex: 'gmtCreated',
|
84084
|
+
sortable: true,
|
84085
|
+
title: '创建时间',
|
84086
|
+
valueType: 'dateTime',
|
84087
|
+
width: '10%'
|
84088
|
+
}, {
|
84089
|
+
title: '操作',
|
84090
|
+
width: '10%',
|
84091
|
+
actionSchema: {
|
84092
|
+
actions: [{
|
84093
|
+
key: 'action',
|
84094
|
+
children: '二次确认',
|
84095
|
+
config: {
|
84096
|
+
type: 'confirm',
|
84097
|
+
onOk: function onOk(context) {
|
84098
|
+
console.log('onOk', context);
|
84099
|
+
},
|
84100
|
+
onCancel: function onCancel(context) {
|
84101
|
+
console.log('onCancel', context);
|
84102
|
+
},
|
84103
|
+
title: 'Test',
|
84104
|
+
content: 'xxxxxx'
|
84105
|
+
}
|
84106
|
+
}]
|
84107
|
+
}
|
84108
|
+
}];
|
84109
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (columns);
|
84110
|
+
|
83963
84111
|
/***/ }),
|
83964
84112
|
|
83965
84113
|
/***/ 54842:
|
@@ -84826,13 +84974,13 @@ function useErrorAction(action, context) {
|
|
84826
84974
|
/* harmony import */ var _pop_confirm__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(51121);
|
84827
84975
|
/* harmony import */ var _danger_pop_confirm__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(33312);
|
84828
84976
|
var _excluded = ["type"],
|
84829
|
-
_excluded2 = ["config", "icon", "iconSize", "type", "context", "children", "visible", "disabled", "onClick", "tooltip", "disabledTooltip", "tooltipProps"],
|
84977
|
+
_excluded2 = ["config", "icon", "iconSize", "type", "context", "children", "visible", "disabled", "onClick", "tooltip", "disabledTooltip", "tooltipProps", "data-teamix-spm"],
|
84830
84978
|
_excluded3 = ["loading"],
|
84831
84979
|
_excluded4 = ["icon", "iconSize", "label", "actions", "children", "context", "type", "className", "noArrow"],
|
84832
84980
|
_excluded5 = ["context", "text"],
|
84833
84981
|
_excluded6 = ["key", "actions"],
|
84834
84982
|
_excluded7 = ["key", "config"],
|
84835
|
-
_excluded8 = ["type", "divider", "max", "moreText", "more", "context", "actions", "className"];
|
84983
|
+
_excluded8 = ["type", "divider", "max", "moreText", "more", "context", "actions", "className", "data-teamix-spm"];
|
84836
84984
|
|
84837
84985
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
84838
84986
|
|
@@ -84991,6 +85139,7 @@ var ProActionButton = function ProActionButton(props) {
|
|
84991
85139
|
tooltip = props.tooltip,
|
84992
85140
|
disabledTooltip = props.disabledTooltip,
|
84993
85141
|
tooltipProps = props.tooltipProps,
|
85142
|
+
dataTeamixSpm = props['data-teamix-spm'],
|
84994
85143
|
others = _objectWithoutPropertiesLoose(props, _excluded2);
|
84995
85144
|
|
84996
85145
|
var actionProps = useAction(config, context);
|
@@ -85003,6 +85152,11 @@ var ProActionButton = function ProActionButton(props) {
|
|
85003
85152
|
}) : _extends({
|
85004
85153
|
disabled: disabled
|
85005
85154
|
}, actionProps, others);
|
85155
|
+
|
85156
|
+
if (dataTeamixSpm) {
|
85157
|
+
buttonProps['data-teamix-spm'] = dataTeamixSpm;
|
85158
|
+
}
|
85159
|
+
|
85006
85160
|
var content = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.Button, _extends({
|
85007
85161
|
type: type
|
85008
85162
|
}, buttonProps), buttonContent(children, icon, iconSize, context));
|
@@ -85035,7 +85189,8 @@ var ProActionMenuButtonItem = function ProActionMenuButtonItem(props) {
|
|
85035
85189
|
var _cls;
|
85036
85190
|
|
85037
85191
|
var action = props.action,
|
85038
|
-
context = props.context
|
85192
|
+
context = props.context,
|
85193
|
+
dataTeamixSpm = props['data-teamix-spm'];
|
85039
85194
|
var config = action.config,
|
85040
85195
|
btnContext = action.context,
|
85041
85196
|
_onClick2 = action.onClick,
|
@@ -85062,6 +85217,11 @@ var ProActionMenuButtonItem = function ProActionMenuButtonItem(props) {
|
|
85062
85217
|
return _onClick2(e, context);
|
85063
85218
|
}
|
85064
85219
|
}) : _extends({}, menuItemProps);
|
85220
|
+
|
85221
|
+
if (dataTeamixSpm) {
|
85222
|
+
buttonProps['data-teamix-spm'] = dataTeamixSpm;
|
85223
|
+
}
|
85224
|
+
|
85065
85225
|
var content = buttonContent(children, icon, undefined, context);
|
85066
85226
|
|
85067
85227
|
var baseToolTipProps = _extends({
|
@@ -85090,7 +85250,7 @@ var ProActionMenuButtonItem = function ProActionMenuButtonItem(props) {
|
|
85090
85250
|
}, buttonProps), content);
|
85091
85251
|
};
|
85092
85252
|
|
85093
|
-
function renderCommonActionButtonMenuItem(action, key, context) {
|
85253
|
+
function renderCommonActionButtonMenuItem(action, key, context, dataTeamixSpm) {
|
85094
85254
|
if (action.type === 'divider') {
|
85095
85255
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.Menu.Divider, {
|
85096
85256
|
key: key
|
@@ -85104,14 +85264,15 @@ function renderCommonActionButtonMenuItem(action, key, context) {
|
|
85104
85264
|
key: key,
|
85105
85265
|
label: menuBtn.label || menuBtn.children
|
85106
85266
|
}, menuBtn.actions.map(function (a) {
|
85107
|
-
return renderCommonActionButtonMenuItem(a, a.key, context);
|
85267
|
+
return renderCommonActionButtonMenuItem(a, a.key, context, a['data-teamix-spm']);
|
85108
85268
|
}));
|
85109
85269
|
}
|
85110
85270
|
|
85111
85271
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ProActionMenuButtonItem, {
|
85112
85272
|
key: key,
|
85113
85273
|
action: action,
|
85114
|
-
context: context
|
85274
|
+
context: context,
|
85275
|
+
"data-teamix-spm": dataTeamixSpm + "-" + key
|
85115
85276
|
});
|
85116
85277
|
}
|
85117
85278
|
|
@@ -85144,7 +85305,7 @@ var ProActionMenuButton = function ProActionMenuButton(props) {
|
|
85144
85305
|
'teamix-pro-actions-text-menu-btn-no-arrow': noArrow
|
85145
85306
|
})
|
85146
85307
|
}, others), actions.map(function (action, i) {
|
85147
|
-
return renderCommonActionButtonMenuItem(action, action.key || i, context);
|
85308
|
+
return renderCommonActionButtonMenuItem(action, action.key || i, context, others == null ? void 0 : others['data-teamix-spm']);
|
85148
85309
|
}));
|
85149
85310
|
};
|
85150
85311
|
|
@@ -85178,7 +85339,7 @@ function formatGroupActions(actions, max, moreConfig) {
|
|
85178
85339
|
} // 渲染一个 button 或者 menu button
|
85179
85340
|
|
85180
85341
|
|
85181
|
-
function renderCommonActionButton(button, context, isTypeText) {
|
85342
|
+
function renderCommonActionButton(button, context, isTypeText, dataTeamixSpm) {
|
85182
85343
|
if (button.type === 'divider') {
|
85183
85344
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.Divider, {
|
85184
85345
|
key: button.key,
|
@@ -85196,6 +85357,10 @@ function renderCommonActionButton(button, context, isTypeText) {
|
|
85196
85357
|
text: text || isTypeText
|
85197
85358
|
}, others);
|
85198
85359
|
|
85360
|
+
if (dataTeamixSpm) {
|
85361
|
+
buttonProps['data-teamix-spm'] = dataTeamixSpm;
|
85362
|
+
}
|
85363
|
+
|
85199
85364
|
if (!button.actions) {
|
85200
85365
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ProActionButton, buttonProps);
|
85201
85366
|
}
|
@@ -85278,6 +85443,7 @@ function ProActionGroup(props) {
|
|
85278
85443
|
_props$actions = props.actions,
|
85279
85444
|
actions = _props$actions === void 0 ? [] : _props$actions,
|
85280
85445
|
className = props.className,
|
85446
|
+
dataTeamixSpm = props['data-teamix-spm'],
|
85281
85447
|
containerProps = _objectWithoutPropertiesLoose(props, _excluded8);
|
85282
85448
|
|
85283
85449
|
var isTypeText = type === 'text';
|
@@ -85293,7 +85459,14 @@ function ProActionGroup(props) {
|
|
85293
85459
|
})
|
85294
85460
|
}, containerProps), formatedActions.map(function (actionBtn, i) {
|
85295
85461
|
var isLastOne = i === formatedActions.length - 1;
|
85296
|
-
|
85462
|
+
|
85463
|
+
if (dataTeamixSpm) {
|
85464
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), {
|
85465
|
+
key: actionBtn.key
|
85466
|
+
}, renderCommonActionButton(actionBtn, context, isTypeText, dataTeamixSpm + "-" + (actionBtn.key || i)), isTypeText && divider && !isLastOne && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.Divider, {
|
85467
|
+
direction: "ver"
|
85468
|
+
}));
|
85469
|
+
} else return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), {
|
85297
85470
|
key: actionBtn.key
|
85298
85471
|
}, renderCommonActionButton(actionBtn, context, isTypeText), isTypeText && divider && !isLastOne && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.Divider, {
|
85299
85472
|
direction: "ver"
|
@@ -90803,6 +90976,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
90803
90976
|
/* harmony export */ "ProCardContainer": () => (/* reexport safe */ _card__WEBPACK_IMPORTED_MODULE_1__.l0),
|
90804
90977
|
/* harmony export */ "ProField": () => (/* reexport safe */ _field__WEBPACK_IMPORTED_MODULE_2__.ZP),
|
90805
90978
|
/* harmony export */ "ProForm": () => (/* reexport safe */ _form__WEBPACK_IMPORTED_MODULE_3__.ZP),
|
90979
|
+
/* harmony export */ "ProIconSwitch": () => (/* reexport safe */ _sidebar__WEBPACK_IMPORTED_MODULE_11__.G),
|
90806
90980
|
/* harmony export */ "ProInfo": () => (/* reexport safe */ _info__WEBPACK_IMPORTED_MODULE_5__.Z),
|
90807
90981
|
/* harmony export */ "ProPageContainer": () => (/* reexport safe */ _page_container__WEBPACK_IMPORTED_MODULE_6__.ZP),
|
90808
90982
|
/* harmony export */ "ProPageHeader": () => (/* reexport safe */ _page_header__WEBPACK_IMPORTED_MODULE_7__.Z),
|
@@ -91017,7 +91191,7 @@ if (!((_window = window) != null && _window.TEAMIXPRO_WITHOUT_ICON)) {
|
|
91017
91191
|
|
91018
91192
|
|
91019
91193
|
|
91020
|
-
var version = '1.5.
|
91194
|
+
var version = '1.5.1';
|
91021
91195
|
|
91022
91196
|
|
91023
91197
|
/***/ }),
|
@@ -95253,6 +95427,7 @@ var ProSidebarTree = function ProSidebarTree(props) {
|
|
95253
95427
|
"use strict";
|
95254
95428
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
95255
95429
|
/* harmony export */ "Ch": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.Ch),
|
95430
|
+
/* harmony export */ "G": () => (/* reexport safe */ _components_tree_node_components_IconSwitch__WEBPACK_IMPORTED_MODULE_7__.Z),
|
95256
95431
|
/* harmony export */ "H8": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.H8),
|
95257
95432
|
/* harmony export */ "N4": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.N4),
|
95258
95433
|
/* harmony export */ "VX": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_6__.VX),
|
@@ -95269,10 +95444,11 @@ var ProSidebarTree = function ProSidebarTree(props) {
|
|
95269
95444
|
/* harmony import */ var _components_sidebar_container__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60343);
|
95270
95445
|
/* harmony import */ var _components_tree__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20867);
|
95271
95446
|
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(42345);
|
95272
|
-
/* harmony import */ var
|
95447
|
+
/* harmony import */ var _utils_action_ref__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(89611);
|
95273
95448
|
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(39339);
|
95274
95449
|
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_5__);
|
95275
95450
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65272);
|
95451
|
+
/* harmony import */ var _components_tree_node_components_IconSwitch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(16786);
|
95276
95452
|
var _excluded = ["selectedKeys", "checkedKeys", "dataSource", "className", "style", "searchOnChange", "showSearch", "onSelect", "onCheck", "treeProps", "cardProps", "actionRef", "onBeforeRenderNodeEvent", "beforeRenderNode", "url", "method", "params", "data", "extendParams", "beforeRequest", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError", "link", "scrollArea", "onExpandAllChange", "onExpandLevelChange"];
|
95277
95453
|
|
95278
95454
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
@@ -95289,6 +95465,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
95289
95465
|
|
95290
95466
|
|
95291
95467
|
|
95468
|
+
|
95292
95469
|
var cls = (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_1__.usePrefixCls)('teamix-pro-sidebar');
|
95293
95470
|
|
95294
95471
|
var ProSidebar = function ProSidebar(props) {
|
@@ -95398,7 +95575,7 @@ var ProSidebar = function ProSidebar(props) {
|
|
95398
95575
|
});
|
95399
95576
|
};
|
95400
95577
|
|
95401
|
-
(0,
|
95578
|
+
(0,_utils_action_ref__WEBPACK_IMPORTED_MODULE_8__/* .useActionType */ .t)(actionRefProp != null ? actionRefProp : actionRef, {
|
95402
95579
|
refresh: function refresh() {
|
95403
95580
|
request();
|
95404
95581
|
}
|
@@ -95458,6 +95635,7 @@ var ProSidebar = function ProSidebar(props) {
|
|
95458
95635
|
|
95459
95636
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProSidebar);
|
95460
95637
|
|
95638
|
+
|
95461
95639
|
/***/ }),
|
95462
95640
|
|
95463
95641
|
/***/ 89611:
|
@@ -95815,6 +95993,445 @@ function getTreeNodeProps(item) {
|
|
95815
95993
|
|
95816
95994
|
/***/ }),
|
95817
95995
|
|
95996
|
+
/***/ 9285:
|
95997
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
95998
|
+
|
95999
|
+
"use strict";
|
96000
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
96001
|
+
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
|
96002
|
+
/* harmony export */ });
|
96003
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59787);
|
96004
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
96005
|
+
/* harmony import */ var _alicloudfe_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33049);
|
96006
|
+
/* harmony import */ var _alicloudfe_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_1__);
|
96007
|
+
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42345);
|
96008
|
+
/* harmony import */ var _skeleton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53277);
|
96009
|
+
/* harmony import */ var _teamix_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(80653);
|
96010
|
+
/* harmony import */ var _utils_columnRender__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97332);
|
96011
|
+
/* harmony import */ var _LoadMore__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(53986);
|
96012
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
96013
|
+
|
96014
|
+
|
96015
|
+
|
96016
|
+
|
96017
|
+
|
96018
|
+
|
96019
|
+
|
96020
|
+
|
96021
|
+
|
96022
|
+
var Row = _alicloudfe_components__WEBPACK_IMPORTED_MODULE_1__.Grid.Row,
|
96023
|
+
Col = _alicloudfe_components__WEBPACK_IMPORTED_MODULE_1__.Grid.Col;
|
96024
|
+
var cls = (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_4__.usePrefixCls)('teamix-pro-table-card-view');
|
96025
|
+
|
96026
|
+
var CardView = function CardView(props) {
|
96027
|
+
var _cardViewProps$scroll;
|
96028
|
+
|
96029
|
+
var dataSource = props.dataSource,
|
96030
|
+
_props$columns = props.columns,
|
96031
|
+
columns = _props$columns === void 0 ? [] : _props$columns,
|
96032
|
+
_props$loading = props.loading,
|
96033
|
+
loading = _props$loading === void 0 ? false : _props$loading,
|
96034
|
+
originColumns = props.originColumns,
|
96035
|
+
_props$cardViewProps = props.cardViewProps,
|
96036
|
+
cardViewProps = _props$cardViewProps === void 0 ? {} : _props$cardViewProps,
|
96037
|
+
actionRef = props.actionRef,
|
96038
|
+
context = props.context,
|
96039
|
+
scrollHeight = props.scrollHeight,
|
96040
|
+
_props$showSkeleton = props.showSkeleton,
|
96041
|
+
showSkeleton = _props$showSkeleton === void 0 ? false : _props$showSkeleton; // 加载状态
|
96042
|
+
|
96043
|
+
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('none'),
|
96044
|
+
loadState = _useState[0],
|
96045
|
+
setLoadState = _useState[1]; // 骨架屏状态
|
96046
|
+
|
96047
|
+
|
96048
|
+
var _useState2 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),
|
96049
|
+
skeletonVisible = _useState2[0],
|
96050
|
+
setSkeletonVisible = _useState2[1]; // 加载状态变化回调
|
96051
|
+
|
96052
|
+
|
96053
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
96054
|
+
setLoadState(loading ? 'loading' : 'loadMore');
|
96055
|
+
setSkeletonVisible(showSkeleton);
|
96056
|
+
|
96057
|
+
if (showSkeleton) {
|
96058
|
+
setLoadState('none');
|
96059
|
+
}
|
96060
|
+
}, [loading, skeletonVisible, showSkeleton]);
|
96061
|
+
|
96062
|
+
var getDataIndexValue = function getDataIndexValue(dataIndex, dataSource) {
|
96063
|
+
if (Array.isArray(dataIndex)) {
|
96064
|
+
return dataIndex.map(function (item) {
|
96065
|
+
return (0,___WEBPACK_IMPORTED_MODULE_2__.getDeepValue)(item != null ? item : '', dataSource);
|
96066
|
+
});
|
96067
|
+
}
|
96068
|
+
|
96069
|
+
return (0,___WEBPACK_IMPORTED_MODULE_2__.getDeepValue)(dataIndex != null ? dataIndex : '', dataSource);
|
96070
|
+
}; // 获取卡片 columns
|
96071
|
+
|
96072
|
+
|
96073
|
+
var cardColumns = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
96074
|
+
return columns.map(function (column) {
|
96075
|
+
var _originColumn$title;
|
96076
|
+
|
96077
|
+
var originColumn = originColumns == null ? void 0 : originColumns.find(function (item) {
|
96078
|
+
return item.dataIndex === column.dataIndex;
|
96079
|
+
});
|
96080
|
+
var render = column == null ? void 0 : column.render;
|
96081
|
+
|
96082
|
+
if (typeof (column == null ? void 0 : column.render) === 'function') {
|
96083
|
+
render = function render(value, record) {
|
96084
|
+
return column == null ? void 0 : column.render == null ? void 0 : column.render(value, undefined, record);
|
96085
|
+
};
|
96086
|
+
} else {
|
96087
|
+
var _Object$entries$map, _Object$entries, _column$render;
|
96088
|
+
|
96089
|
+
render = Object.fromEntries((_Object$entries$map = (_Object$entries = Object.entries((_column$render = column == null ? void 0 : column.render) != null ? _column$render : {})) == null ? void 0 : _Object$entries.map == null ? void 0 : _Object$entries.map(function (_ref) {
|
96090
|
+
var k = _ref[0],
|
96091
|
+
v = _ref[1];
|
96092
|
+
|
96093
|
+
if (typeof v === 'function') {
|
96094
|
+
return [k, function (value, record) {
|
96095
|
+
return v == null ? void 0 : v(value, undefined, record);
|
96096
|
+
}];
|
96097
|
+
}
|
96098
|
+
|
96099
|
+
return [k, v];
|
96100
|
+
})) != null ? _Object$entries$map : []);
|
96101
|
+
}
|
96102
|
+
|
96103
|
+
return _extends({}, column, {
|
96104
|
+
title: (_originColumn$title = originColumn == null ? void 0 : originColumn.title) != null ? _originColumn$title : column.title,
|
96105
|
+
render: render
|
96106
|
+
});
|
96107
|
+
}).filter(function (item) {
|
96108
|
+
return !(item != null && item.actionSchema);
|
96109
|
+
});
|
96110
|
+
}, [columns, originColumns]); // 获取单个渲染数据
|
96111
|
+
|
96112
|
+
var renderCardInfoItem = function renderCardInfoItem(itemProps, record, index) {
|
96113
|
+
if (itemProps) {
|
96114
|
+
if (typeof itemProps === 'string' || Array.isArray(itemProps)) {
|
96115
|
+
var _titleColumn$cell;
|
96116
|
+
|
96117
|
+
var titleColumn = cardColumns.find(function (item) {
|
96118
|
+
return item.dataIndex === itemProps;
|
96119
|
+
});
|
96120
|
+
return (_titleColumn$cell = titleColumn == null ? void 0 : titleColumn.cell == null ? void 0 : titleColumn.cell(getDataIndexValue(itemProps, record), index, record)) != null ? _titleColumn$cell : '';
|
96121
|
+
}
|
96122
|
+
|
96123
|
+
return (0,_utils_columnRender__WEBPACK_IMPORTED_MODULE_5__/* .renderCell */ .c)(getDataIndexValue(itemProps.dataIndex, record), itemProps, index, record, actionRef, context);
|
96124
|
+
}
|
96125
|
+
}; // 渲染卡片title
|
96126
|
+
|
96127
|
+
|
96128
|
+
var renderCardTitle = function renderCardTitle(record, index) {
|
96129
|
+
var _cardColumns$, _cardColumns$$render, _cardColumns$2, _cardColumns$3;
|
96130
|
+
|
96131
|
+
var titleProp = cardViewProps.title;
|
96132
|
+
var title = titleProp;
|
96133
|
+
|
96134
|
+
if (typeof titleProp === 'function') {
|
96135
|
+
title = titleProp == null ? void 0 : titleProp(index, record);
|
96136
|
+
}
|
96137
|
+
|
96138
|
+
if (titleProp) {
|
96139
|
+
return renderCardInfoItem(title, record, index);
|
96140
|
+
} // 【默认情况】看看第一列有没有 description,有的话,只取 title
|
96141
|
+
|
96142
|
+
|
96143
|
+
if (cardColumns != null && (_cardColumns$ = cardColumns[0]) != null && (_cardColumns$$render = _cardColumns$.render) != null && _cardColumns$$render.description) {
|
96144
|
+
var _originColumn$render;
|
96145
|
+
|
96146
|
+
var column = cardColumns == null ? void 0 : cardColumns[0];
|
96147
|
+
var originColumn = originColumns == null ? void 0 : originColumns[0]; // 转化为新的 table columns
|
96148
|
+
|
96149
|
+
var _columns = _extends({}, originColumn, {
|
96150
|
+
render: _extends({}, originColumn == null ? void 0 : originColumn.render, {
|
96151
|
+
value: originColumn == null ? void 0 : (_originColumn$render = originColumn.render) == null ? void 0 : _originColumn$render.value,
|
96152
|
+
description: undefined,
|
96153
|
+
descriptionCopy: undefined
|
96154
|
+
})
|
96155
|
+
});
|
96156
|
+
|
96157
|
+
return (0,_utils_columnRender__WEBPACK_IMPORTED_MODULE_5__/* .renderCell */ .c)(getDataIndexValue(column == null ? void 0 : column.dataIndex, record), _columns, index, record, actionRef, context);
|
96158
|
+
} // 【默认情况】直接拿第一列的 cell
|
96159
|
+
|
96160
|
+
|
96161
|
+
return cardColumns == null ? void 0 : (_cardColumns$2 = cardColumns[0]) == null ? void 0 : _cardColumns$2.cell == null ? void 0 : _cardColumns$2.cell(getDataIndexValue(cardColumns == null ? void 0 : (_cardColumns$3 = cardColumns[0]) == null ? void 0 : _cardColumns$3.dataIndex, record), index, record);
|
96162
|
+
}; // 渲染卡片subTitle
|
96163
|
+
|
96164
|
+
|
96165
|
+
var renderCardSubTitle = function renderCardSubTitle(record, index) {
|
96166
|
+
var _cardColumns$4, _cardColumns$4$render;
|
96167
|
+
|
96168
|
+
var subTitleProp = cardViewProps.subTitle;
|
96169
|
+
var subTitle = subTitleProp;
|
96170
|
+
|
96171
|
+
if (typeof subTitleProp === 'function') {
|
96172
|
+
subTitle = subTitleProp == null ? void 0 : subTitleProp(index, record);
|
96173
|
+
}
|
96174
|
+
|
96175
|
+
if (subTitle) {
|
96176
|
+
return renderCardInfoItem(subTitle, record, index);
|
96177
|
+
} // 【默认情况】看看第一列有没有 description,有的话,只取 title
|
96178
|
+
|
96179
|
+
|
96180
|
+
if (cardColumns != null && (_cardColumns$4 = cardColumns[0]) != null && (_cardColumns$4$render = _cardColumns$4.render) != null && _cardColumns$4$render.description) {
|
96181
|
+
var _originColumn$render2, _column$render2;
|
96182
|
+
|
96183
|
+
var column = cardColumns == null ? void 0 : cardColumns[0];
|
96184
|
+
var originColumn = originColumns == null ? void 0 : originColumns[0]; // 转化为新的 table columns
|
96185
|
+
|
96186
|
+
var _columns2 = _extends({}, originColumn, {
|
96187
|
+
render: {
|
96188
|
+
value: originColumn == null ? void 0 : (_originColumn$render2 = originColumn.render) == null ? void 0 : _originColumn$render2.description,
|
96189
|
+
description: undefined,
|
96190
|
+
descriptionCopy: undefined
|
96191
|
+
}
|
96192
|
+
});
|
96193
|
+
|
96194
|
+
return (0,_utils_columnRender__WEBPACK_IMPORTED_MODULE_5__/* .renderCell */ .c)(getDataIndexValue(column == null ? void 0 : (_column$render2 = column.render) == null ? void 0 : _column$render2.value, record), _columns2, index, record, actionRef, context);
|
96195
|
+
}
|
96196
|
+
}; // 获取ProInfoColumns
|
96197
|
+
|
96198
|
+
|
96199
|
+
var getPropInfoColumns = function getPropInfoColumns(record, index) {
|
96200
|
+
var contentProp = cardViewProps.content;
|
96201
|
+
var content = contentProp;
|
96202
|
+
|
96203
|
+
if (typeof contentProp === 'function') {
|
96204
|
+
content = contentProp == null ? void 0 : contentProp(index, record);
|
96205
|
+
}
|
96206
|
+
|
96207
|
+
if (content) {
|
96208
|
+
return content.map(function (item) {
|
96209
|
+
if (typeof item === 'string') {
|
96210
|
+
return cardColumns.find(function (column) {
|
96211
|
+
return column.dataIndex === item;
|
96212
|
+
});
|
96213
|
+
}
|
96214
|
+
|
96215
|
+
return content;
|
96216
|
+
});
|
96217
|
+
} // 默认取4条数据
|
96218
|
+
|
96219
|
+
|
96220
|
+
return cardColumns.filter(function (item, index) {
|
96221
|
+
return index > 0 && index < 5;
|
96222
|
+
});
|
96223
|
+
}; // 从表格columns获取Action配置
|
96224
|
+
|
96225
|
+
|
96226
|
+
var getActionGroupFromColumn = function getActionGroupFromColumn(dataIndex, record, index) {
|
96227
|
+
var actionColumn;
|
96228
|
+
|
96229
|
+
if (dataIndex) {
|
96230
|
+
actionColumn = columns == null ? void 0 : columns.find(function (item) {
|
96231
|
+
return item.dataIndex.toString() === dataIndex.toString();
|
96232
|
+
});
|
96233
|
+
} else {
|
96234
|
+
// 默认继承表格操作列
|
96235
|
+
// 获取操作列,只能获取最后一列
|
96236
|
+
actionColumn = columns == null ? void 0 : columns[(columns == null ? void 0 : columns.length) - 1];
|
96237
|
+
}
|
96238
|
+
|
96239
|
+
if (actionColumn.actionSchema) {
|
96240
|
+
var _actionColumn, _actionColumn$actionS;
|
96241
|
+
|
96242
|
+
var newActionColumn = _extends({}, actionColumn, {
|
96243
|
+
actionSchema: {
|
96244
|
+
actions: (_actionColumn = actionColumn) == null ? void 0 : (_actionColumn$actionS = _actionColumn.actionSchema) == null ? void 0 : _actionColumn$actionS.actions,
|
96245
|
+
max: 1
|
96246
|
+
}
|
96247
|
+
});
|
96248
|
+
|
96249
|
+
return (0,_utils_columnRender__WEBPACK_IMPORTED_MODULE_5__/* .renderCell */ .c)(null, newActionColumn, index, record, actionRef, context);
|
96250
|
+
}
|
96251
|
+
|
96252
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);
|
96253
|
+
}; // 获取Card操作列配置
|
96254
|
+
|
96255
|
+
|
96256
|
+
var getProCardExtra = function getProCardExtra(record, index) {
|
96257
|
+
var extraProp = cardViewProps.extra;
|
96258
|
+
var extra = extraProp;
|
96259
|
+
|
96260
|
+
if (typeof extraProp === 'function') {
|
96261
|
+
extra = extraProp == null ? void 0 : extraProp(index, record);
|
96262
|
+
}
|
96263
|
+
|
96264
|
+
if (Array.isArray(extra)) {
|
96265
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
96266
|
+
className: cls('extra')
|
96267
|
+
}, extra.map(function (item) {
|
96268
|
+
if (typeof item === 'string') {
|
96269
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
96270
|
+
className: cls('extra-item')
|
96271
|
+
}, getActionGroupFromColumn(item, record, index));
|
96272
|
+
}
|
96273
|
+
|
96274
|
+
if ( /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.isValidElement)(item)) {
|
96275
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
96276
|
+
className: cls('extra-item')
|
96277
|
+
}, item);
|
96278
|
+
}
|
96279
|
+
|
96280
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
96281
|
+
className: cls('extra-item')
|
96282
|
+
}, (0,_utils_columnRender__WEBPACK_IMPORTED_MODULE_5__/* .renderCell */ .c)(null, item, index, record, actionRef, context));
|
96283
|
+
}));
|
96284
|
+
}
|
96285
|
+
|
96286
|
+
return getActionGroupFromColumn(undefined, record, index);
|
96287
|
+
}; // 渲染Tag
|
96288
|
+
|
96289
|
+
|
96290
|
+
var getTags = function getTags(record, index) {
|
96291
|
+
var tagProp = cardViewProps.tags;
|
96292
|
+
var tags = tagProp != null ? tagProp : [];
|
96293
|
+
|
96294
|
+
if (typeof tagProp === 'function') {
|
96295
|
+
var _tagProp;
|
96296
|
+
|
96297
|
+
tags = (_tagProp = tagProp == null ? void 0 : tagProp(index, record)) != null ? _tagProp : [];
|
96298
|
+
}
|
96299
|
+
|
96300
|
+
var getTagFromColumns = function getTagFromColumns(columns, dataIndex) {
|
96301
|
+
var _columns$render, _columns$render2, _columns$render4, _columns$render5, _columns$render7, _columns$render8;
|
96302
|
+
|
96303
|
+
var text = getDataIndexValue(dataIndex, record);
|
96304
|
+
|
96305
|
+
if (columns != null && (_columns$render = columns.render) != null && _columns$render.value && typeof (columns == null ? void 0 : (_columns$render2 = columns.render) == null ? void 0 : _columns$render2.value) === 'string') {
|
96306
|
+
var _columns$render3;
|
96307
|
+
|
96308
|
+
text = columns == null ? void 0 : (_columns$render3 = columns.render) == null ? void 0 : _columns$render3.value;
|
96309
|
+
}
|
96310
|
+
|
96311
|
+
if (columns != null && (_columns$render4 = columns.render) != null && _columns$render4.value && typeof (columns == null ? void 0 : (_columns$render5 = columns.render) == null ? void 0 : _columns$render5.value) === 'function') {
|
96312
|
+
var _columns$render6;
|
96313
|
+
|
96314
|
+
text = columns == null ? void 0 : (_columns$render6 = columns.render) == null ? void 0 : _columns$render6.value(getDataIndexValue(dataIndex, record), index, record);
|
96315
|
+
}
|
96316
|
+
|
96317
|
+
var color = columns == null ? void 0 : (_columns$render7 = columns.render) == null ? void 0 : _columns$render7.color;
|
96318
|
+
|
96319
|
+
if (typeof (columns == null ? void 0 : (_columns$render8 = columns.render) == null ? void 0 : _columns$render8.color) === 'function') {
|
96320
|
+
var _columns$render9;
|
96321
|
+
|
96322
|
+
color = columns == null ? void 0 : (_columns$render9 = columns.render) == null ? void 0 : _columns$render9.color(getDataIndexValue(dataIndex, record), index, record);
|
96323
|
+
}
|
96324
|
+
|
96325
|
+
return {
|
96326
|
+
children: text,
|
96327
|
+
color: color
|
96328
|
+
};
|
96329
|
+
};
|
96330
|
+
|
96331
|
+
return tags.map(function (tagItem) {
|
96332
|
+
if (typeof tagItem === 'string') {
|
96333
|
+
var tagColumns = columns.find(function (item) {
|
96334
|
+
return item.dataIndex === tagItem;
|
96335
|
+
});
|
96336
|
+
return getTagFromColumns(tagColumns, tagItem);
|
96337
|
+
}
|
96338
|
+
|
96339
|
+
if (typeof tagItem === 'object') {
|
96340
|
+
return getTagFromColumns(tagItem, tagItem == null ? void 0 : tagItem.dataIndex);
|
96341
|
+
}
|
96342
|
+
});
|
96343
|
+
}; // 加载下一页回调
|
96344
|
+
|
96345
|
+
|
96346
|
+
var onLoadMore = function onLoadMore() {
|
96347
|
+
var _actionRef$current;
|
96348
|
+
|
96349
|
+
actionRef == null ? void 0 : (_actionRef$current = actionRef.current) == null ? void 0 : _actionRef$current.nextPage == null ? void 0 : _actionRef$current.nextPage();
|
96350
|
+
}; // 触底回调
|
96351
|
+
|
96352
|
+
|
96353
|
+
var onScrollBottom = function onScrollBottom() {
|
96354
|
+
if (cardViewProps.autoLoadNextPage !== false) {
|
96355
|
+
onLoadMore();
|
96356
|
+
cardViewProps == null ? void 0 : cardViewProps.onScrollBottom == null ? void 0 : cardViewProps.onScrollBottom();
|
96357
|
+
}
|
96358
|
+
}; // 获取ProCard配置
|
96359
|
+
|
96360
|
+
|
96361
|
+
var getProCardProps = function getProCardProps(record, index) {
|
96362
|
+
var _cardViewProps$cardPr;
|
96363
|
+
|
96364
|
+
var external = ['onCollapse', 'onSelect', 'onClick'];
|
96365
|
+
return Object.fromEntries(Object.entries((_cardViewProps$cardPr = cardViewProps.cardProps) != null ? _cardViewProps$cardPr : {}).map(function (_ref2) {
|
96366
|
+
var key = _ref2[0],
|
96367
|
+
value = _ref2[1];
|
96368
|
+
|
96369
|
+
if (typeof value === 'function' && !external.includes(key)) {
|
96370
|
+
return [key, value == null ? void 0 : value(index, record)];
|
96371
|
+
}
|
96372
|
+
|
96373
|
+
if (typeof value === 'function' && external.includes(key)) {
|
96374
|
+
return [key, function () {
|
96375
|
+
for (var _len = arguments.length, others = new Array(_len), _key = 0; _key < _len; _key++) {
|
96376
|
+
others[_key] = arguments[_key];
|
96377
|
+
}
|
96378
|
+
|
96379
|
+
return value == null ? void 0 : value.apply(void 0, [index, record].concat(others));
|
96380
|
+
}];
|
96381
|
+
}
|
96382
|
+
|
96383
|
+
return [key, value];
|
96384
|
+
}));
|
96385
|
+
}; // 渲染单个卡片
|
96386
|
+
|
96387
|
+
|
96388
|
+
var renderCard = function renderCard(record, index) {
|
96389
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Col, {
|
96390
|
+
xxs: 24,
|
96391
|
+
xs: 12,
|
96392
|
+
s: 8,
|
96393
|
+
m: 8,
|
96394
|
+
l: 6,
|
96395
|
+
xl: 6,
|
96396
|
+
key: index,
|
96397
|
+
className: cls('card-item')
|
96398
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.ProCard, _extends({
|
96399
|
+
title: renderCardTitle(record, index),
|
96400
|
+
subTitle: renderCardSubTitle(record, index),
|
96401
|
+
extra: getProCardExtra(record, index),
|
96402
|
+
tags: getTags(record, index)
|
96403
|
+
}, getProCardProps(record, index)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.ProInfo, {
|
96404
|
+
columns: getPropInfoColumns(record, index),
|
96405
|
+
dataSource: record,
|
96406
|
+
context: {
|
96407
|
+
record: record,
|
96408
|
+
index: index
|
96409
|
+
}
|
96410
|
+
})));
|
96411
|
+
};
|
96412
|
+
|
96413
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
96414
|
+
className: cls()
|
96415
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_LoadMore__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
|
96416
|
+
onScrollBottom: onScrollBottom,
|
96417
|
+
onLoadMore: onLoadMore,
|
96418
|
+
loadState: loadState,
|
96419
|
+
scrollHeight: (_cardViewProps$scroll = cardViewProps.scrollHeight) != null ? _cardViewProps$scroll : scrollHeight
|
96420
|
+
}, skeletonVisible && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_skeleton__WEBPACK_IMPORTED_MODULE_3__/* .ProSkeletonRaw.Content */ .vR.Content, null), !skeletonVisible && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Row, {
|
96421
|
+
gutter: 16,
|
96422
|
+
wrap: true,
|
96423
|
+
style: {
|
96424
|
+
marginTop: '-16px'
|
96425
|
+
}
|
96426
|
+
}, dataSource == null ? void 0 : dataSource.map(function (item, index) {
|
96427
|
+
return renderCard(item, index);
|
96428
|
+
}))));
|
96429
|
+
};
|
96430
|
+
|
96431
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CardView);
|
96432
|
+
|
96433
|
+
/***/ }),
|
96434
|
+
|
95818
96435
|
/***/ 98300:
|
95819
96436
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
95820
96437
|
|
@@ -95879,7 +96496,8 @@ var RadioItem = _alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.Menu.RadioIt
|
|
95879
96496
|
|
95880
96497
|
var Filter = function Filter(props) {
|
95881
96498
|
var column = props.column,
|
95882
|
-
actionRef = props.actionRef
|
96499
|
+
actionRef = props.actionRef,
|
96500
|
+
switchCardView = props.switchCardView;
|
95883
96501
|
var _column$filtersWidth = column.filtersWidth,
|
95884
96502
|
filtersWidth = _column$filtersWidth === void 0 ? 130 : _column$filtersWidth; // 选中过滤项
|
95885
96503
|
|
@@ -96011,7 +96629,7 @@ var Filter = function Filter(props) {
|
|
96011
96629
|
btn: true
|
96012
96630
|
}),
|
96013
96631
|
onClick: function onClick() {
|
96014
|
-
var _actionRef$current2, _actionRef$current$ge5, _actionRef$current3, _actionRef$current3$g, _actionRef$current4, _extends2, _actionRef$current5, _actionRef$
|
96632
|
+
var _actionRef$current2, _actionRef$current$ge5, _actionRef$current3, _actionRef$current3$g, _actionRef$current4, _extends2, _actionRef$current5, _actionRef$current7, _actionRef$current7$r, _actionRef$current8, _actionRef$current9;
|
96015
96633
|
|
96016
96634
|
(_actionRef$current2 = actionRef.current) == null ? void 0 : _actionRef$current2.filterDataSource == null ? void 0 : _actionRef$current2.filterDataSource(column.dataIndex); // 先获取此列的param
|
96017
96635
|
|
@@ -96035,13 +96653,19 @@ var Filter = function Filter(props) {
|
|
96035
96653
|
|
96036
96654
|
if (pageInfo && pageInfo != null && pageInfo.targetPageKey) {
|
96037
96655
|
targetPageKey = pageInfo == null ? void 0 : pageInfo.targetPageKey;
|
96656
|
+
}
|
96657
|
+
|
96658
|
+
if (switchCardView === 'card') {
|
96659
|
+
var _actionRef$current6;
|
96660
|
+
|
96661
|
+
(_actionRef$current6 = actionRef.current) == null ? void 0 : _actionRef$current6.setData == null ? void 0 : _actionRef$current6.setData([]);
|
96038
96662
|
} // 发送请求
|
96039
96663
|
|
96040
96664
|
|
96041
|
-
(_actionRef$
|
96042
|
-
(_actionRef$
|
96665
|
+
(_actionRef$current7 = actionRef.current) == null ? void 0 : _actionRef$current7.request == null ? void 0 : _actionRef$current7.request((_actionRef$current7$r = {}, _actionRef$current7$r[targetPageKey] = 1, _actionRef$current7$r));
|
96666
|
+
(_actionRef$current8 = actionRef.current) == null ? void 0 : _actionRef$current8.resetPage == null ? void 0 : _actionRef$current8.resetPage(); // 清空表格选择
|
96043
96667
|
|
96044
|
-
(_actionRef$
|
96668
|
+
(_actionRef$current9 = actionRef.current) == null ? void 0 : _actionRef$current9.clearRowSelection == null ? void 0 : _actionRef$current9.clearRowSelection();
|
96045
96669
|
setVisible(false);
|
96046
96670
|
}
|
96047
96671
|
}, (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_3__.getMessage)('ok')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
|
@@ -96051,31 +96675,31 @@ var Filter = function Filter(props) {
|
|
96051
96675
|
btn: true
|
96052
96676
|
}),
|
96053
96677
|
onClick: function onClick() {
|
96054
|
-
var _actionRef$current$ge6, _actionRef$
|
96678
|
+
var _actionRef$current$ge6, _actionRef$current10, _actionRef$current10$, _actionRef$current11, _extends3, _actionRef$current12;
|
96055
96679
|
|
96056
96680
|
setSelected([]);
|
96057
|
-
var rules = (_actionRef$current$ge6 = (_actionRef$
|
96058
|
-
(_actionRef$
|
96681
|
+
var rules = (_actionRef$current$ge6 = (_actionRef$current10 = actionRef.current) == null ? void 0 : _actionRef$current10.getState == null ? void 0 : (_actionRef$current10$ = _actionRef$current10.getState()) == null ? void 0 : _actionRef$current10$.filterRules) != null ? _actionRef$current$ge6 : {};
|
96682
|
+
(_actionRef$current11 = actionRef.current) == null ? void 0 : _actionRef$current11.setFilterRules == null ? void 0 : _actionRef$current11.setFilterRules(_extends({}, rules, (_extends3 = {}, _extends3[column.dataIndex] = {
|
96059
96683
|
rules: [],
|
96060
96684
|
params: ''
|
96061
96685
|
}, _extends3)));
|
96062
|
-
(_actionRef$
|
96686
|
+
(_actionRef$current12 = actionRef.current) == null ? void 0 : _actionRef$current12.filterDataSource == null ? void 0 : _actionRef$current12.filterDataSource(column.dataIndex);
|
96063
96687
|
|
96064
96688
|
if (selected.length > 0) {
|
96065
|
-
var _actionRef$
|
96689
|
+
var _actionRef$current13, _actionRef$current14, _actionRef$current14$, _actionRef$current15, _actionRef$current16;
|
96066
96690
|
|
96067
96691
|
var targetPageKey = 'currentPage';
|
96068
|
-
var pageInfo = (_actionRef$
|
96692
|
+
var pageInfo = (_actionRef$current13 = actionRef.current) == null ? void 0 : _actionRef$current13.pageInfo;
|
96069
96693
|
|
96070
96694
|
if (pageInfo && pageInfo != null && pageInfo.targetPageKey) {
|
96071
96695
|
targetPageKey = pageInfo == null ? void 0 : pageInfo.targetPageKey;
|
96072
96696
|
} // 发送请求
|
96073
96697
|
|
96074
96698
|
|
96075
|
-
(_actionRef$
|
96076
|
-
(_actionRef$
|
96699
|
+
(_actionRef$current14 = actionRef.current) == null ? void 0 : _actionRef$current14.request == null ? void 0 : _actionRef$current14.request((_actionRef$current14$ = {}, _actionRef$current14$[targetPageKey] = 1, _actionRef$current14$));
|
96700
|
+
(_actionRef$current15 = actionRef.current) == null ? void 0 : _actionRef$current15.resetPage == null ? void 0 : _actionRef$current15.resetPage(); // 清空表格选择
|
96077
96701
|
|
96078
|
-
(_actionRef$
|
96702
|
+
(_actionRef$current16 = actionRef.current) == null ? void 0 : _actionRef$current16.clearRowSelection == null ? void 0 : _actionRef$current16.clearRowSelection();
|
96079
96703
|
} // setVisible(!visible);
|
96080
96704
|
|
96081
96705
|
}
|
@@ -96101,7 +96725,7 @@ var Filter = function Filter(props) {
|
|
96101
96725
|
/* harmony import */ var _form__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(89417);
|
96102
96726
|
/* harmony import */ var _ToolBar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(75348);
|
96103
96727
|
/* harmony import */ var _QuickAction__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96379);
|
96104
|
-
var _excluded = ["header", "mainAction", "extra", "actionRef", "dataFilter", "dataFilterFormRef", "afterDataFilter", "rowSelection", "toolBar"];
|
96728
|
+
var _excluded = ["header", "mainAction", "extra", "actionRef", "dataFilter", "dataFilterFormRef", "afterDataFilter", "rowSelection", "toolBar", "dataTeamixSpm"];
|
96105
96729
|
|
96106
96730
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
96107
96731
|
|
@@ -96127,6 +96751,7 @@ var Layout = function Layout(props) {
|
|
96127
96751
|
afterDataFilter = props.afterDataFilter,
|
96128
96752
|
rowSelection = props.rowSelection,
|
96129
96753
|
toolBar = props.toolBar,
|
96754
|
+
dataTeamixSpm = props.dataTeamixSpm,
|
96130
96755
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded); // 渲染主操作区
|
96131
96756
|
|
96132
96757
|
|
@@ -96151,7 +96776,8 @@ var Layout = function Layout(props) {
|
|
96151
96776
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
96152
96777
|
className: cls('main-action')
|
96153
96778
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_actions__WEBPACK_IMPORTED_MODULE_3__/* .ProActionGroup */ .d5, _extends({}, mainAction, {
|
96154
|
-
context: _extends({}, defaultContext, mainAction.context)
|
96779
|
+
context: _extends({}, defaultContext, mainAction.context),
|
96780
|
+
"data-teamix-spm": dataTeamixSpm ? dataTeamixSpm + "-mainAction" : undefined
|
96155
96781
|
})));
|
96156
96782
|
} else return mainAction;
|
96157
96783
|
}; // 渲染 addonAfter
|
@@ -96286,6 +96912,116 @@ var Layout = function Layout(props) {
|
|
96286
96912
|
|
96287
96913
|
/***/ }),
|
96288
96914
|
|
96915
|
+
/***/ 53986:
|
96916
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
96917
|
+
|
96918
|
+
"use strict";
|
96919
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
96920
|
+
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
|
96921
|
+
/* harmony export */ });
|
96922
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59787);
|
96923
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
96924
|
+
/* harmony import */ var _teamix_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80653);
|
96925
|
+
/* harmony import */ var _teamix_icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(89227);
|
96926
|
+
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39339);
|
96927
|
+
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_3__);
|
96928
|
+
|
96929
|
+
|
96930
|
+
|
96931
|
+
|
96932
|
+
|
96933
|
+
var cls = (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_1__.usePrefixCls)('teamix-pro-load-more');
|
96934
|
+
|
96935
|
+
var LoadMore = function LoadMore(props) {
|
96936
|
+
var children = props.children,
|
96937
|
+
onChangeLoadState = props.onChangeLoadState,
|
96938
|
+
onLoadMore = props.onLoadMore,
|
96939
|
+
scrollHeight = props.scrollHeight,
|
96940
|
+
onScrollBottom = props.onScrollBottom,
|
96941
|
+
loadStateProp = props.loadState,
|
96942
|
+
scrollPositionProp = props.scrollPosition;
|
96943
|
+
var scrollDom = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); // 加载状态
|
96944
|
+
|
96945
|
+
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('loadMore'),
|
96946
|
+
loadState = _useState[0],
|
96947
|
+
setLoadState = _useState[1];
|
96948
|
+
|
96949
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
96950
|
+
var _scrollDom$current;
|
96951
|
+
|
96952
|
+
scrollDom == null ? void 0 : (_scrollDom$current = scrollDom.current) == null ? void 0 : _scrollDom$current.addEventListener('scroll', lodash_debounce__WEBPACK_IMPORTED_MODULE_3___default()(function (e) {
|
96953
|
+
var _e$target, _e$target2, _e$target3;
|
96954
|
+
|
96955
|
+
var scrollTop = e == null ? void 0 : (_e$target = e.target) == null ? void 0 : _e$target.scrollTop;
|
96956
|
+
var clientHeight = e == null ? void 0 : (_e$target2 = e.target) == null ? void 0 : _e$target2.clientHeight;
|
96957
|
+
var scrollHeight = e == null ? void 0 : (_e$target3 = e.target) == null ? void 0 : _e$target3.scrollHeight;
|
96958
|
+
|
96959
|
+
if (scrollTop + clientHeight + 5 >= scrollHeight) {
|
96960
|
+
onScrollBottom == null ? void 0 : onScrollBottom();
|
96961
|
+
}
|
96962
|
+
}, 100));
|
96963
|
+
}, []);
|
96964
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
96965
|
+
setLoadState(loadStateProp);
|
96966
|
+
}, [loadStateProp]); // 更改加载状态
|
96967
|
+
|
96968
|
+
var onLoadState = function onLoadState(state) {
|
96969
|
+
setLoadState(state);
|
96970
|
+
|
96971
|
+
if (state === 'loading') {
|
96972
|
+
onLoadMore == null ? void 0 : onLoadMore();
|
96973
|
+
}
|
96974
|
+
|
96975
|
+
onChangeLoadState == null ? void 0 : onChangeLoadState(state);
|
96976
|
+
}; // 渲染加载更多和正在加载区域
|
96977
|
+
|
96978
|
+
|
96979
|
+
var renderLoadMore = function renderLoadMore() {
|
96980
|
+
if (loadState === 'loadMore') {
|
96981
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
96982
|
+
className: cls('bottom-text'),
|
96983
|
+
onClick: function onClick() {
|
96984
|
+
return onLoadState('loading');
|
96985
|
+
}
|
96986
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_teamix_icon__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
|
96987
|
+
type: "down-line",
|
96988
|
+
size: "small",
|
96989
|
+
className: cls('bottom-text-icon')
|
96990
|
+
}), "\u52A0\u8F7D\u66F4\u591A");
|
96991
|
+
}
|
96992
|
+
|
96993
|
+
if (loadState === 'loading') {
|
96994
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
96995
|
+
className: cls('bottom-text')
|
96996
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_teamix_icon__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
|
96997
|
+
type: "loading-line",
|
96998
|
+
size: "small",
|
96999
|
+
className: cls('bottom-text-icon')
|
97000
|
+
}), "\u52A0\u8F7D\u4E2D");
|
97001
|
+
}
|
97002
|
+
|
97003
|
+
if (loadState === 'noMore') {
|
97004
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
97005
|
+
className: cls('bottom-text')
|
97006
|
+
}, "\u6CA1\u6709\u66F4\u591A\u4E86");
|
97007
|
+
}
|
97008
|
+
|
97009
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);
|
97010
|
+
};
|
97011
|
+
|
97012
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
97013
|
+
className: cls(),
|
97014
|
+
style: {
|
97015
|
+
height: scrollHeight != null ? scrollHeight : 'auto'
|
97016
|
+
},
|
97017
|
+
ref: scrollDom
|
97018
|
+
}, children, renderLoadMore());
|
97019
|
+
};
|
97020
|
+
|
97021
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadMore);
|
97022
|
+
|
97023
|
+
/***/ }),
|
97024
|
+
|
96289
97025
|
/***/ 33977:
|
96290
97026
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
96291
97027
|
|
@@ -96602,6 +97338,73 @@ var QuickAction = function QuickAction(props) {
|
|
96602
97338
|
|
96603
97339
|
/***/ }),
|
96604
97340
|
|
97341
|
+
/***/ 18418:
|
97342
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
97343
|
+
|
97344
|
+
"use strict";
|
97345
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
97346
|
+
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
|
97347
|
+
/* harmony export */ });
|
97348
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59787);
|
97349
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
97350
|
+
/* harmony import */ var _alicloudfe_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33049);
|
97351
|
+
/* harmony import */ var _alicloudfe_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_1__);
|
97352
|
+
/* harmony import */ var _teamix_icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(89227);
|
97353
|
+
/* harmony import */ var _teamix_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80653);
|
97354
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(90450);
|
97355
|
+
/**
|
97356
|
+
* 切换 table card 视角
|
97357
|
+
*/
|
97358
|
+
|
97359
|
+
|
97360
|
+
|
97361
|
+
|
97362
|
+
|
97363
|
+
|
97364
|
+
var RadioGroup = _alicloudfe_components__WEBPACK_IMPORTED_MODULE_1__.Radio.Group;
|
97365
|
+
var cls = (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_3__.usePrefixCls)('teamix-pro-table-toolbar-switch-card');
|
97366
|
+
|
97367
|
+
var CardSwitch = function CardSwitch(props) {
|
97368
|
+
var actionRef = props.actionRef,
|
97369
|
+
defaultView = props.defaultView; // 选择视角
|
97370
|
+
|
97371
|
+
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(defaultView != null ? defaultView : 'table'),
|
97372
|
+
radioView = _useState[0],
|
97373
|
+
setRadioView = _useState[1]; // 选择视角回调
|
97374
|
+
|
97375
|
+
|
97376
|
+
var onRadioViewChange = function onRadioViewChange(value) {
|
97377
|
+
var _actionRef$current;
|
97378
|
+
|
97379
|
+
setRadioView(value);
|
97380
|
+
(_actionRef$current = actionRef.current) == null ? void 0 : _actionRef$current.switchView == null ? void 0 : _actionRef$current.switchView(value);
|
97381
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_4__/* .emit */ .j8)('cardSwitchChange', value);
|
97382
|
+
};
|
97383
|
+
|
97384
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RadioGroup, {
|
97385
|
+
shape: "button",
|
97386
|
+
value: radioView,
|
97387
|
+
onChange: onRadioViewChange,
|
97388
|
+
className: cls()
|
97389
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_1__.Radio, {
|
97390
|
+
id: "banana",
|
97391
|
+
value: "table"
|
97392
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_teamix_icon__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
|
97393
|
+
type: "menu-line",
|
97394
|
+
size: "small"
|
97395
|
+
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_1__.Radio, {
|
97396
|
+
id: "watermelon",
|
97397
|
+
value: "card"
|
97398
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_teamix_icon__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
|
97399
|
+
type: "all-line",
|
97400
|
+
size: "small"
|
97401
|
+
})));
|
97402
|
+
};
|
97403
|
+
|
97404
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CardSwitch);
|
97405
|
+
|
97406
|
+
/***/ }),
|
97407
|
+
|
96605
97408
|
/***/ 69257:
|
96606
97409
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
96607
97410
|
|
@@ -96812,7 +97615,12 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
96812
97615
|
|
96813
97616
|
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),
|
96814
97617
|
dropdownVisible = _useState5[0],
|
96815
|
-
setDropdownVisible = _useState5[1];
|
97618
|
+
setDropdownVisible = _useState5[1]; // 视角
|
97619
|
+
|
97620
|
+
|
97621
|
+
var _useState6 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)('table'),
|
97622
|
+
cardView = _useState6[0],
|
97623
|
+
setCardView = _useState6[1];
|
96816
97624
|
|
96817
97625
|
(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {
|
96818
97626
|
_utils__WEBPACK_IMPORTED_MODULE_4__.on == null ? void 0 : (0,_utils__WEBPACK_IMPORTED_MODULE_4__.on)(function (stateFilterColumns) {
|
@@ -96830,8 +97638,12 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
96830
97638
|
setNewColumns(stateColumns);
|
96831
97639
|
}
|
96832
97640
|
}, 'refreshFilterState');
|
97641
|
+
_utils__WEBPACK_IMPORTED_MODULE_4__.on == null ? void 0 : (0,_utils__WEBPACK_IMPORTED_MODULE_4__.on)(function (view) {
|
97642
|
+
setCardView(view);
|
97643
|
+
}, 'cardSwitchChange');
|
96833
97644
|
return function () {
|
96834
97645
|
(0,_utils__WEBPACK_IMPORTED_MODULE_4__/* .off */ .S1)('refreshFilterState');
|
97646
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_4__/* .off */ .S1)('cardSwitchChange');
|
96835
97647
|
};
|
96836
97648
|
});
|
96837
97649
|
(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {
|
@@ -96998,7 +97810,8 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
96998
97810
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(CheckboxItem, {
|
96999
97811
|
indeterminate: indeterminate,
|
97000
97812
|
checked: allVisible,
|
97001
|
-
onChange: onChangeAllColumns
|
97813
|
+
onChange: onChangeAllColumns,
|
97814
|
+
disabled: cardView === 'card'
|
97002
97815
|
}, (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_2__.getMessage)('selectAll'), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
|
97003
97816
|
onClick: restColumns,
|
97004
97817
|
className: cls({
|
@@ -97217,6 +98030,8 @@ var FullScreen = function FullScreen(props) {
|
|
97217
98030
|
}, [visible, actionRef]);
|
97218
98031
|
|
97219
98032
|
var afterClose = function afterClose() {
|
98033
|
+
var _document;
|
98034
|
+
|
97220
98035
|
// 判断全屏前后筛选表单值是否有改变
|
97221
98036
|
var n = JSON.stringify((0,_teamix_utils__WEBPACK_IMPORTED_MODULE_2__.getValidValues)(normalDataFilterForm == null ? void 0 : normalDataFilterForm.values));
|
97222
98037
|
var f = JSON.stringify((0,_teamix_utils__WEBPACK_IMPORTED_MODULE_2__.getValidValues)(fullscreenDataFilterForm == null ? void 0 : fullscreenDataFilterForm.values));
|
@@ -97230,11 +98045,17 @@ var FullScreen = function FullScreen(props) {
|
|
97230
98045
|
} // 关闭全屏后,关闭全屏表单onFilter
|
97231
98046
|
|
97232
98047
|
|
97233
|
-
filterEnableRef.current.fullscreen = false;
|
98048
|
+
filterEnableRef.current.fullscreen = false; // 移除类名
|
98049
|
+
|
98050
|
+
if (document && (_document = document) != null && _document.body) {
|
98051
|
+
document.body.classList.remove('teamix-pro-table-fullscreen');
|
98052
|
+
}
|
97234
98053
|
}; // 全屏开启之后
|
97235
98054
|
|
97236
98055
|
|
97237
98056
|
var afterOpen = function afterOpen() {
|
98057
|
+
var _document2;
|
98058
|
+
|
97238
98059
|
// 判断全屏前后筛选表单值是否有改变
|
97239
98060
|
var n = JSON.stringify((0,_teamix_utils__WEBPACK_IMPORTED_MODULE_2__.getValidValues)(normalDataFilterForm == null ? void 0 : normalDataFilterForm.values));
|
97240
98061
|
var f = JSON.stringify((0,_teamix_utils__WEBPACK_IMPORTED_MODULE_2__.getValidValues)(fullscreenDataFilterForm == null ? void 0 : fullscreenDataFilterForm.values));
|
@@ -97248,7 +98069,12 @@ var FullScreen = function FullScreen(props) {
|
|
97248
98069
|
} // 全屏后,关闭普通表单onFilter
|
97249
98070
|
|
97250
98071
|
|
97251
|
-
filterEnableRef.current.normal = false; //
|
98072
|
+
filterEnableRef.current.normal = false; // 为 body 添加类名,用于判断是否全屏
|
98073
|
+
|
98074
|
+
if (document && (_document2 = document) != null && _document2.body) {
|
98075
|
+
document.body.classList.add('teamix-pro-table-fullscreen');
|
98076
|
+
} // 消息提示
|
98077
|
+
|
97252
98078
|
|
97253
98079
|
_alicloudfe_components__WEBPACK_IMPORTED_MODULE_1__.Message.show({
|
97254
98080
|
type: 'notice',
|
@@ -97374,6 +98200,11 @@ var LayoutIcon = function LayoutIcon(props) {
|
|
97374
98200
|
/* harmony import */ var _teamix_hooks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(42341);
|
97375
98201
|
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(39339);
|
97376
98202
|
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_9__);
|
98203
|
+
/* harmony import */ var _CardSwitch__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(18418);
|
98204
|
+
/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(52308);
|
98205
|
+
/* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(lodash_clonedeep__WEBPACK_IMPORTED_MODULE_11__);
|
98206
|
+
|
98207
|
+
|
97377
98208
|
|
97378
98209
|
|
97379
98210
|
|
@@ -97390,7 +98221,8 @@ var presetToolBarMap = {
|
|
97390
98221
|
refresh: _RefreshIcon__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z,
|
97391
98222
|
density: _DensityIcon__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z,
|
97392
98223
|
filtercolumn: _FilterColumnIcon__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z,
|
97393
|
-
fullscreen: _FullScreenIcon__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z
|
98224
|
+
fullscreen: _FullScreenIcon__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z,
|
98225
|
+
switchcard: _CardSwitch__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z
|
97394
98226
|
};
|
97395
98227
|
var presetToolBarName = ['refresh', 'density', 'filtercolumn', 'fullscreen'];
|
97396
98228
|
var presetToolBar = [{
|
@@ -97415,7 +98247,10 @@ var ToolBar = function ToolBar(props) {
|
|
97415
98247
|
var _toolBarRef$current, _toolBarRef$current$p, _toolBarRef$current$p2;
|
97416
98248
|
|
97417
98249
|
var toolBar = props.toolBar,
|
97418
|
-
fullScreenState = props.fullScreenState
|
98250
|
+
fullScreenState = props.fullScreenState,
|
98251
|
+
switchCardView = props.switchCardView,
|
98252
|
+
_props$toolBarAutoWid = props.toolBarAutoWidth,
|
98253
|
+
toolBarAutoWidth = _props$toolBarAutoWid === void 0 ? true : _props$toolBarAutoWid;
|
97419
98254
|
var toolBarRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); // const toolBarSize = useSize(toolBarRef);
|
97420
98255
|
// 用于获取内容宽度
|
97421
98256
|
|
@@ -97434,44 +98269,69 @@ var ToolBar = function ToolBar(props) {
|
|
97434
98269
|
|
97435
98270
|
|
97436
98271
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(lodash_debounce__WEBPACK_IMPORTED_MODULE_9___default()(function () {
|
97437
|
-
|
97438
|
-
// layoutInlineSize?.width,
|
97439
|
-
// leftWidth,
|
97440
|
-
// toolBarContentRef.current?.clientWidth,
|
97441
|
-
// );
|
97442
|
-
if (layoutInlineSize != null && layoutInlineSize.width && leftWidth && toolBarContentRef.current) {
|
98272
|
+
if (layoutInlineSize != null && layoutInlineSize.width && leftWidth && toolBarContentRef.current && toolBarAutoWidth) {
|
97443
98273
|
var _toolBarContentRef$cu;
|
97444
98274
|
|
97445
|
-
var width = layoutInlineSize.width
|
98275
|
+
var width = layoutInlineSize.width,
|
98276
|
+
height = layoutInlineSize.height;
|
97446
98277
|
|
97447
|
-
if (width - leftWidth <= ((_toolBarContentRef$cu = toolBarContentRef.current) == null ? void 0 : _toolBarContentRef$cu.clientWidth) + 8) {
|
98278
|
+
if (width - leftWidth <= ((_toolBarContentRef$cu = toolBarContentRef.current) == null ? void 0 : _toolBarContentRef$cu.clientWidth) + 8 || height > 40) {
|
97448
98279
|
setFlat(false);
|
97449
|
-
} else {
|
98280
|
+
} else if (height === 40) {
|
97450
98281
|
setFlat(true);
|
97451
98282
|
}
|
97452
98283
|
}
|
97453
|
-
}, 300));
|
97454
|
-
|
98284
|
+
}, 300)); // 初始态
|
98285
|
+
|
98286
|
+
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
98287
|
+
if (!(layoutInlineSize != null && layoutInlineSize.width && leftWidth)) {
|
98288
|
+
setFlat(true);
|
98289
|
+
}
|
98290
|
+
}, []);
|
98291
|
+
var toolBarList = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
|
98292
|
+
var result = toolBar !== false ? lodash_clonedeep__WEBPACK_IMPORTED_MODULE_11___default()(presetToolBar) : [];
|
98293
|
+
|
98294
|
+
if (switchCardView && !result.find(function (item) {
|
98295
|
+
return item.name === 'switchCard';
|
98296
|
+
})) {
|
98297
|
+
result.push({
|
98298
|
+
type: 'preset',
|
98299
|
+
name: 'switchCard',
|
98300
|
+
component: presetToolBarMap['switchcard']
|
98301
|
+
});
|
98302
|
+
}
|
98303
|
+
|
98304
|
+
if (Array.isArray(toolBar)) {
|
98305
|
+
result = toolBar.map(function (item, index) {
|
98306
|
+
if (typeof item === 'string' && presetToolBarName.includes(item.toLowerCase())) {
|
98307
|
+
return {
|
98308
|
+
type: 'preset',
|
98309
|
+
name: item,
|
98310
|
+
component: presetToolBarMap[item.toLowerCase()]
|
98311
|
+
};
|
98312
|
+
}
|
97455
98313
|
|
97456
|
-
if (Array.isArray(toolBar)) {
|
97457
|
-
toolBarList = toolBar.map(function (item, index) {
|
97458
|
-
if (typeof item === 'string' && presetToolBarName.includes(item.toLowerCase())) {
|
97459
98314
|
return {
|
97460
|
-
type: '
|
97461
|
-
name:
|
97462
|
-
component:
|
98315
|
+
type: 'custom',
|
98316
|
+
name: "custom" + index,
|
98317
|
+
component: item
|
97463
98318
|
};
|
97464
|
-
}
|
98319
|
+
});
|
97465
98320
|
|
97466
|
-
|
97467
|
-
|
97468
|
-
|
97469
|
-
|
97470
|
-
|
97471
|
-
|
97472
|
-
|
98321
|
+
if (!toolBar.includes('switchCard') && switchCardView && !result.find(function (item) {
|
98322
|
+
return item.name === 'switchCard';
|
98323
|
+
})) {
|
98324
|
+
result.push({
|
98325
|
+
type: 'preset',
|
98326
|
+
name: 'switchCard',
|
98327
|
+
component: presetToolBarMap['switchcard']
|
98328
|
+
});
|
98329
|
+
}
|
98330
|
+
}
|
97473
98331
|
|
97474
|
-
|
98332
|
+
return result;
|
98333
|
+
}, [toolBar]);
|
98334
|
+
var renderFlatShape = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
|
97475
98335
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
|
97476
98336
|
className: cls('content')
|
97477
98337
|
}, toolBarList.map(function (_ref) {
|
@@ -97489,7 +98349,7 @@ var ToolBar = function ToolBar(props) {
|
|
97489
98349
|
})
|
97490
98350
|
}, Component));
|
97491
98351
|
}));
|
97492
|
-
};
|
98352
|
+
}, [toolBarList]);
|
97493
98353
|
|
97494
98354
|
var renderUnFlatShape = function renderUnFlatShape() {
|
97495
98355
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.Balloon.Tooltip, {
|
@@ -97504,7 +98364,7 @@ var ToolBar = function ToolBar(props) {
|
|
97504
98364
|
type: "more-line"
|
97505
98365
|
})),
|
97506
98366
|
align: "tr"
|
97507
|
-
}, renderFlatShape
|
98367
|
+
}, renderFlatShape));
|
97508
98368
|
};
|
97509
98369
|
|
97510
98370
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
|
@@ -97512,10 +98372,10 @@ var ToolBar = function ToolBar(props) {
|
|
97512
98372
|
flat: flat
|
97513
98373
|
}),
|
97514
98374
|
ref: toolBarRef
|
97515
|
-
}, !flat && !fullScreenState ? renderUnFlatShape() : renderFlatShape
|
98375
|
+
}, !flat && !fullScreenState ? renderUnFlatShape() : renderFlatShape, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
|
97516
98376
|
className: cls('shadow'),
|
97517
98377
|
ref: toolBarContentRef
|
97518
|
-
}, renderFlatShape
|
98378
|
+
}, renderFlatShape));
|
97519
98379
|
};
|
97520
98380
|
|
97521
98381
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ToolBar);
|
@@ -97539,7 +98399,7 @@ var ToolBar = function ToolBar(props) {
|
|
97539
98399
|
/* harmony import */ var _skeleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53277);
|
97540
98400
|
/* harmony import */ var _components_Layout__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9458);
|
97541
98401
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(90450);
|
97542
|
-
/* harmony import */ var
|
98402
|
+
/* harmony import */ var _utils_getTableProps__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(78964);
|
97543
98403
|
/* harmony import */ var _utils_getTableSortIcons__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98806);
|
97544
98404
|
/* harmony import */ var _utils_useTableSelection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(23779);
|
97545
98405
|
/* harmony import */ var _components_ToolBar_Fullscreen__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(21630);
|
@@ -97550,7 +98410,9 @@ var ToolBar = function ToolBar(props) {
|
|
97550
98410
|
/* harmony import */ var _page_container__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2781);
|
97551
98411
|
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(39339);
|
97552
98412
|
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_15__);
|
97553
|
-
|
98413
|
+
/* harmony import */ var _components_CardView__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(9285);
|
98414
|
+
/* harmony import */ var _demos_table_columns__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(76672);
|
98415
|
+
var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "afterDataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestConfig", "requestWhenMount", "showPagination", "pageSizeList", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest", "filterColumnType", "defaultFilterParams", "reserveSelectedRecords", "size", "disableSelectAll", "context", "fixedTableBody", "isTree", "toolBarAutoWidth", "data-teamix-spm", "switchCardView", "cardViewProps", "defaultView"];
|
97554
98416
|
|
97555
98417
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
97556
98418
|
|
@@ -97585,6 +98447,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
97585
98447
|
|
97586
98448
|
|
97587
98449
|
|
98450
|
+
|
98451
|
+
|
97588
98452
|
|
97589
98453
|
|
97590
98454
|
var cls = (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_4__.usePrefixCls)('teamix-pro-table');
|
@@ -97713,6 +98577,14 @@ var ProTable = function ProTable(props) {
|
|
97713
98577
|
_props$fixedTableBody = props.fixedTableBody,
|
97714
98578
|
fixedTableBody = _props$fixedTableBody === void 0 ? false : _props$fixedTableBody,
|
97715
98579
|
isTree = props.isTree,
|
98580
|
+
_props$toolBarAutoWid = props.toolBarAutoWidth,
|
98581
|
+
toolBarAutoWidth = _props$toolBarAutoWid === void 0 ? true : _props$toolBarAutoWid,
|
98582
|
+
dataTeamixSpm = props['data-teamix-spm'],
|
98583
|
+
_props$switchCardView = props.switchCardView,
|
98584
|
+
switchCardView = _props$switchCardView === void 0 ? false : _props$switchCardView,
|
98585
|
+
cardViewProps = props.cardViewProps,
|
98586
|
+
_props$defaultView = props.defaultView,
|
98587
|
+
defaultView = _props$defaultView === void 0 ? 'table' : _props$defaultView,
|
97716
98588
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
97717
98589
|
|
97718
98590
|
var targetPageKey = pageKey || globalPageKey;
|
@@ -97733,7 +98605,7 @@ var ProTable = function ProTable(props) {
|
|
97733
98605
|
|
97734
98606
|
var _useState4 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(propsDataSource != null ? propsDataSource : []),
|
97735
98607
|
data = _useState4[0],
|
97736
|
-
|
98608
|
+
_setData = _useState4[1];
|
97737
98609
|
|
97738
98610
|
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(props.sort || {}),
|
97739
98611
|
sort = _useState5[0],
|
@@ -97875,7 +98747,11 @@ var ProTable = function ProTable(props) {
|
|
97875
98747
|
|
97876
98748
|
var offsetHeaderHeight = headerHeight + tableHeaderHeight + pageHeaderHeight + teamixNavHeight + footerRowSelectionHeight + 16 + (offset != null ? offset : 0) + 1;
|
97877
98749
|
|
97878
|
-
if (
|
98750
|
+
if (switchViewState === 'card') {
|
98751
|
+
offsetHeaderHeight = offsetHeaderHeight - tableHeaderHeight - footerRowSelectionHeight;
|
98752
|
+
}
|
98753
|
+
|
98754
|
+
if ((tableBodyDom == null ? void 0 : tableBodyDom.clientHeight) < (tableBodyDom == null ? void 0 : tableBodyDom.scrollHeight)) {
|
97879
98755
|
setFooterSuctionState(true);
|
97880
98756
|
} else {
|
97881
98757
|
setFooterSuctionState(false);
|
@@ -97908,7 +98784,12 @@ var ProTable = function ProTable(props) {
|
|
97908
98784
|
|
97909
98785
|
var _useState14 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
|
97910
98786
|
fullscreenState = _useState14[0],
|
97911
|
-
setFullscreenState = _useState14[1]; //
|
98787
|
+
setFullscreenState = _useState14[1]; // 切换视角
|
98788
|
+
|
98789
|
+
|
98790
|
+
var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(defaultView != null ? defaultView : 'table'),
|
98791
|
+
switchViewState = _useState15[0],
|
98792
|
+
setSwitchViewState = _useState15[1]; // 切换全屏搜索开关
|
97912
98793
|
|
97913
98794
|
|
97914
98795
|
var filterEnableRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({
|
@@ -97924,9 +98805,9 @@ var ProTable = function ProTable(props) {
|
|
97924
98805
|
var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef; // let dataFilterForm = dataFilterFormRef.current;
|
97925
98806
|
// 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
|
97926
98807
|
|
97927
|
-
var
|
97928
|
-
footerSuctionState =
|
97929
|
-
setFooterSuctionState =
|
98808
|
+
var _useState16 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
|
98809
|
+
footerSuctionState = _useState16[0],
|
98810
|
+
setFooterSuctionState = _useState16[1]; // TODO 获取内容区是否超出一屏(暂时仅支持全家桶)
|
97930
98811
|
|
97931
98812
|
|
97932
98813
|
var getFooterSuctionState = function getFooterSuctionState() {
|
@@ -98052,7 +98933,7 @@ var ProTable = function ProTable(props) {
|
|
98052
98933
|
|
98053
98934
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
98054
98935
|
if (propsDataSource) {
|
98055
|
-
|
98936
|
+
_setData(propsDataSource);
|
98056
98937
|
}
|
98057
98938
|
}, [propsDataSource]); // 初始化 ActionRef。
|
98058
98939
|
|
@@ -98118,7 +98999,18 @@ var ProTable = function ProTable(props) {
|
|
98118
98999
|
_setSize(mode);
|
98119
99000
|
},
|
98120
99001
|
refresh: function refresh(params) {
|
98121
|
-
|
99002
|
+
// card视角的刷新等于重新请求
|
99003
|
+
if (switchViewState === 'card') {
|
99004
|
+
var _extends2;
|
99005
|
+
|
99006
|
+
setCurrentPage(1);
|
99007
|
+
|
99008
|
+
_request(_extends({}, params, (_extends2 = {}, _extends2[targetPageKey] = 1, _extends2)));
|
99009
|
+
|
99010
|
+
setShowSkeleton(true);
|
99011
|
+
} else {
|
99012
|
+
_request(params);
|
99013
|
+
}
|
98122
99014
|
},
|
98123
99015
|
request: function request(params) {
|
98124
99016
|
// 如果请求中还有翻页相关信息,需要自动设置到指定页
|
@@ -98146,6 +99038,14 @@ var ProTable = function ProTable(props) {
|
|
98146
99038
|
resetPage: function resetPage() {
|
98147
99039
|
setCurrentPage(1);
|
98148
99040
|
},
|
99041
|
+
nextPage: function nextPage() {
|
99042
|
+
var _request3;
|
99043
|
+
|
99044
|
+
var newCurrentPage = currentPage + 1;
|
99045
|
+
setCurrentPage(newCurrentPage);
|
99046
|
+
|
99047
|
+
_request((_request3 = {}, _request3[targetPageKey] = newCurrentPage, _request3));
|
99048
|
+
},
|
98149
99049
|
rowSelection: rowSelection,
|
98150
99050
|
clearRowSelection: function clearRowSelection() {
|
98151
99051
|
rowSelectionHook.setSelectedRowKeys([]);
|
@@ -98165,8 +99065,34 @@ var ProTable = function ProTable(props) {
|
|
98165
99065
|
normalDataFilterForm: normalDataFilterForm,
|
98166
99066
|
fullscreenDataFilterForm: fullscreenDataFilterForm,
|
98167
99067
|
filterEnableRef: filterEnableRef,
|
99068
|
+
setData: function setData(data) {
|
99069
|
+
_setData(data);
|
99070
|
+
},
|
98168
99071
|
resetTableMaxBodyHeight: function resetTableMaxBodyHeight(offset) {
|
98169
99072
|
getHeaderHeight(fullscreenState, offset);
|
99073
|
+
},
|
99074
|
+
switchView: function switchView(view) {
|
99075
|
+
setSwitchViewState(view);
|
99076
|
+
setShowSkeleton(true);
|
99077
|
+
setCurrentPage(1);
|
99078
|
+
|
99079
|
+
if (view === 'table') {
|
99080
|
+
var _request4;
|
99081
|
+
|
99082
|
+
setPageSize(pageSize != null ? pageSize : 20);
|
99083
|
+
|
99084
|
+
_request((_request4 = {}, _request4[targetPageSizeKey] = pageSize != null ? pageSize : 20, _request4[targetPageKey] = 1, _request4));
|
99085
|
+
}
|
99086
|
+
|
99087
|
+
if (view === 'card') {
|
99088
|
+
var _cardViewProps$pageSi, _cardViewProps$pageSi2, _request5;
|
99089
|
+
|
99090
|
+
setPageSize((_cardViewProps$pageSi = cardViewProps == null ? void 0 : cardViewProps.pageSize) != null ? _cardViewProps$pageSi : 12);
|
99091
|
+
|
99092
|
+
_request((_request5 = {}, _request5[targetPageSizeKey] = (_cardViewProps$pageSi2 = cardViewProps == null ? void 0 : cardViewProps.pageSize) != null ? _cardViewProps$pageSi2 : 12, _request5[targetPageKey] = 1, _request5));
|
99093
|
+
}
|
99094
|
+
|
99095
|
+
getHeaderHeight(fullscreenState);
|
98170
99096
|
}
|
98171
99097
|
}); // 将 Actions 绑定到传入的 propsActionRef 中
|
98172
99098
|
|
@@ -98175,8 +99101,6 @@ var ProTable = function ProTable(props) {
|
|
98175
99101
|
}
|
98176
99102
|
|
98177
99103
|
function onFormatResult(next) {
|
98178
|
-
var _next$data;
|
98179
|
-
|
98180
99104
|
props.onFormatResult && props.onFormatResult(next);
|
98181
99105
|
var time = autoRefresh ? autoRefresh(next.data) : false;
|
98182
99106
|
|
@@ -98188,8 +99112,22 @@ var ProTable = function ProTable(props) {
|
|
98188
99112
|
} // 设置 dataSource、total
|
98189
99113
|
|
98190
99114
|
|
98191
|
-
|
98192
|
-
|
99115
|
+
if (switchViewState === 'table' || currentPage === 1) {
|
99116
|
+
var _next$data;
|
99117
|
+
|
99118
|
+
_setData(next.data || []);
|
99119
|
+
|
99120
|
+
setTotal(next.total || ((_next$data = next.data) == null ? void 0 : _next$data.length));
|
99121
|
+
}
|
99122
|
+
|
99123
|
+
if (switchViewState === 'card' && currentPage !== 1) {
|
99124
|
+
var _next$data2;
|
99125
|
+
|
99126
|
+
_setData([].concat(_toConsumableArray(data), _toConsumableArray(next.data || [])));
|
99127
|
+
|
99128
|
+
setTotal(total + (next.total || ((_next$data2 = next.data) == null ? void 0 : _next$data2.length)));
|
99129
|
+
}
|
99130
|
+
|
98193
99131
|
setShowSkeleton(false);
|
98194
99132
|
} // 请求表格数据工具函数
|
98195
99133
|
|
@@ -98263,7 +99201,7 @@ var ProTable = function ProTable(props) {
|
|
98263
99201
|
}); // 请求函数
|
98264
99202
|
|
98265
99203
|
function _request(params, noLoading, filterParams) {
|
98266
|
-
var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current5,
|
99204
|
+
var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current5, _extends3;
|
98267
99205
|
|
98268
99206
|
// 如果没有传 url 且没有 customRequest,直接返回
|
98269
99207
|
if (!url && !customRequest) {
|
@@ -98280,7 +99218,7 @@ var ProTable = function ProTable(props) {
|
|
98280
99218
|
|
98281
99219
|
var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current5 = actionRef.current) == null ? void 0 : _actionRef$current5.getFilterRules == null ? void 0 : _actionRef$current5.getFilterRules()) != null ? _actionRef$current$ge : {}; // 格式化后的请求参数
|
98282
99220
|
|
98283
|
-
var requestData = formatParams(_extends({}, !showPagination ? _extends({}, dataFilterParams, propsParams, sortParams, columnsFilterParams) : _extends((
|
99221
|
+
var requestData = formatParams(_extends({}, !showPagination ? _extends({}, dataFilterParams, propsParams, sortParams, columnsFilterParams) : _extends((_extends3 = {}, _extends3[targetPageKey] = currentPage, _extends3[targetPageSizeKey] = pageSize, _extends3), dataFilterParams, propsParams, sortParams, columnsFilterParams), params));
|
98284
99222
|
|
98285
99223
|
if (requestData) {
|
98286
99224
|
if (autoRefreshTimerRef.current) {
|
@@ -98308,14 +99246,24 @@ var ProTable = function ProTable(props) {
|
|
98308
99246
|
if (customRequest && typeof customRequest === 'function') {
|
98309
99247
|
setCustomTableLoading(true);
|
98310
99248
|
customRequest(requestData).then(function (res) {
|
98311
|
-
var
|
98312
|
-
|
99249
|
+
var dataRes = res.data,
|
99250
|
+
totalRes = res.total,
|
98313
99251
|
success = res.success;
|
98314
99252
|
|
98315
99253
|
if (success === true) {
|
98316
99254
|
// 设置 dataSource、total
|
98317
|
-
|
98318
|
-
|
99255
|
+
if (switchViewState === 'table' || params['targetPageKey'] === 1) {
|
99256
|
+
_setData(dataRes || []);
|
99257
|
+
|
99258
|
+
setTotal(totalRes || (dataRes == null ? void 0 : dataRes.length));
|
99259
|
+
}
|
99260
|
+
|
99261
|
+
if (switchViewState === 'card' && params['targetPageKey'] !== 1) {
|
99262
|
+
_setData([].concat(_toConsumableArray(data), _toConsumableArray(dataRes || [])));
|
99263
|
+
|
99264
|
+
setTotal(total + (totalRes || (dataRes == null ? void 0 : dataRes.length)));
|
99265
|
+
}
|
99266
|
+
|
98319
99267
|
setShowSkeleton(false);
|
98320
99268
|
setCustomTableLoading(false);
|
98321
99269
|
} // 重新计算是否需要吸底
|
@@ -98366,7 +99314,7 @@ var ProTable = function ProTable(props) {
|
|
98366
99314
|
return true;
|
98367
99315
|
} : undefined,
|
98368
99316
|
onFilter: function onFilter(values) {
|
98369
|
-
var _actionRef$current6,
|
99317
|
+
var _actionRef$current6, _request6;
|
98370
99318
|
|
98371
99319
|
// 全屏状态,判断全屏表单onFilter是否禁用
|
98372
99320
|
if (fullscreenState && !filterEnableRef.current.fullscreen) {
|
@@ -98384,19 +99332,17 @@ var ProTable = function ProTable(props) {
|
|
98384
99332
|
|
98385
99333
|
(_actionRef$current6 = actionRef.current) == null ? void 0 : _actionRef$current6.clearRowSelection == null ? void 0 : _actionRef$current6.clearRowSelection();
|
98386
99334
|
setCurrentPage(1);
|
98387
|
-
console.log('currentPageSize1', pageSize);
|
98388
99335
|
|
98389
|
-
_request((
|
99336
|
+
_request((_request6 = {}, _request6[targetPageKey] = 1, _request6), false, values);
|
98390
99337
|
},
|
98391
99338
|
onReset: function onReset(values) {
|
98392
|
-
var _dataFilterFormRef$cu3,
|
99339
|
+
var _dataFilterFormRef$cu3, _request7;
|
98393
99340
|
|
98394
99341
|
(propsDataFilter == null ? void 0 : propsDataFilter.onReset) && (propsDataFilter == null ? void 0 : propsDataFilter.onReset());
|
98395
99342
|
(_dataFilterFormRef$cu3 = dataFilterFormRef.current) == null ? void 0 : _dataFilterFormRef$cu3.reset();
|
98396
99343
|
setCurrentPage(1);
|
98397
|
-
console.log('currentPageSize2', pageSize);
|
98398
99344
|
|
98399
|
-
_request((
|
99345
|
+
_request((_request7 = {}, _request7[targetPageKey] = 1, _request7), false, values);
|
98400
99346
|
}
|
98401
99347
|
});
|
98402
99348
|
|
@@ -98414,7 +99360,8 @@ var ProTable = function ProTable(props) {
|
|
98414
99360
|
className: classnames__WEBPACK_IMPORTED_MODULE_13___default()('teamix-pro-table-container', className, 'teamix-test-request'),
|
98415
99361
|
"data-teamix-test-request": "url=" + url + "&formatResult=" + !!formatResult,
|
98416
99362
|
"data-teamix-test-params": (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_4__.getTestRequestParams)(propsParams),
|
98417
|
-
"data-teamix-test-data": (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_4__.getTestRequestData)(propsColumns)
|
99363
|
+
"data-teamix-test-data": (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_4__.getTestRequestData)(propsColumns),
|
99364
|
+
"data-teamix-spm": dataTeamixSpm
|
98418
99365
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_Layout__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
|
98419
99366
|
header: header,
|
98420
99367
|
mainAction: mainAction,
|
@@ -98427,11 +99374,15 @@ var ProTable = function ProTable(props) {
|
|
98427
99374
|
dataFilterFormRef: isFullScreen ? fullscreenDataFilterFormRef : normalDataFilterFormRef,
|
98428
99375
|
rowSelection: rowSelection,
|
98429
99376
|
filterColumnType: filterColumnType,
|
98430
|
-
fullScreenState: isFullScreen
|
98431
|
-
|
99377
|
+
fullScreenState: isFullScreen,
|
99378
|
+
toolBarAutoWidth: toolBarAutoWidth,
|
99379
|
+
dataTeamixSpm: dataTeamixSpm,
|
99380
|
+
switchCardView: switchCardView,
|
99381
|
+
defaultView: defaultView
|
99382
|
+
}), switchViewState === 'table' && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_1__.Table.StickyLock, _extends({
|
98432
99383
|
hasBorder: false,
|
98433
99384
|
dataSource: showSkeleton ? skeletonDataSource : data || props.dataSource,
|
98434
|
-
columns: (0,_utils_genProColumnToColumn__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(filteredColumns, showSkeleton, actionRef, context),
|
99385
|
+
columns: (0,_utils_genProColumnToColumn__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(filteredColumns, showSkeleton, actionRef, context, dataTeamixSpm),
|
98435
99386
|
loading: getTableLoading(),
|
98436
99387
|
className: classnames__WEBPACK_IMPORTED_MODULE_13___default()('teamix-pro-table', tableClassName, {
|
98437
99388
|
'with-row-select': rowSelection,
|
@@ -98448,12 +99399,22 @@ var ProTable = function ProTable(props) {
|
|
98448
99399
|
fixedHeader: fullscreenState || fixedTableBody,
|
98449
99400
|
maxBodyHeight: "calc(100vh - " + headerHeight + "px)" // 过滤出可以传到 Table 的 Props
|
98450
99401
|
|
98451
|
-
}, (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_4__.pickProps)((0,
|
99402
|
+
}, (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_4__.pickProps)((0,_utils_getTableProps__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .Z)(), otherProps))), switchViewState === 'card' && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_CardView__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
|
99403
|
+
dataSource: showSkeleton ? skeletonDataSource : data || props.dataSource,
|
99404
|
+
showSkeleton: showSkeleton,
|
99405
|
+
loading: getTableLoading(),
|
99406
|
+
originColumns: _demos_table_columns__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z,
|
99407
|
+
cardViewProps: cardViewProps,
|
99408
|
+
scrollHeight: fullscreenState || fixedTableBody ? "calc(100vh - " + headerHeight + "px)" : undefined,
|
99409
|
+
actionRef: actionRef,
|
99410
|
+
context: context,
|
99411
|
+
columns: (0,_utils_genProColumnToColumn__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(filteredColumns, showSkeleton, actionRef, context)
|
99412
|
+
}));
|
98452
99413
|
} else {
|
98453
99414
|
// 不传 columns 直接返回原始 Table
|
98454
99415
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_1__.Table, _extends({
|
98455
99416
|
className: cls()
|
98456
|
-
}, (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_4__.pickProps)((0,
|
99417
|
+
}, (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_4__.pickProps)((0,_utils_getTableProps__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .Z)(), otherProps)));
|
98457
99418
|
}
|
98458
99419
|
};
|
98459
99420
|
|
@@ -98480,14 +99441,15 @@ var ProTable = function ProTable(props) {
|
|
98480
99441
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
98481
99442
|
className: cls('footer-action')
|
98482
99443
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_actions__WEBPACK_IMPORTED_MODULE_12__/* .ProActionGroup */ .d5, _extends({}, targetFooterActions, {
|
98483
|
-
context: _extends({}, defaultContext, targetFooterActions == null ? void 0 : targetFooterActions.context)
|
99444
|
+
context: _extends({}, defaultContext, targetFooterActions == null ? void 0 : targetFooterActions.context),
|
99445
|
+
"data-teamix-spm": dataTeamixSpm ? dataTeamixSpm + "-footerAction" : undefined
|
98484
99446
|
})));
|
98485
99447
|
} else return footerAction;
|
98486
99448
|
};
|
98487
99449
|
|
98488
99450
|
var renderFooter = function renderFooter() {
|
98489
99451
|
function onChangePagination(currentPage, params) {
|
98490
|
-
var
|
99452
|
+
var _extends4;
|
98491
99453
|
|
98492
99454
|
if (params === void 0) {
|
98493
99455
|
params = {};
|
@@ -98502,11 +99464,11 @@ var ProTable = function ProTable(props) {
|
|
98502
99464
|
|
98503
99465
|
setCurrentPage(currentPage);
|
98504
99466
|
|
98505
|
-
_request(_extends((
|
99467
|
+
_request(_extends((_extends4 = {}, _extends4[targetPageKey] = currentPage, _extends4), params));
|
98506
99468
|
}
|
98507
99469
|
|
98508
99470
|
function onChangePaginationSize(currentPageSize) {
|
98509
|
-
var
|
99471
|
+
var _request8;
|
98510
99472
|
|
98511
99473
|
// 翻页默认清空选择
|
98512
99474
|
if (!reserveSelectedRecords) {
|
@@ -98518,7 +99480,7 @@ var ProTable = function ProTable(props) {
|
|
98518
99480
|
setPageSize(currentPageSize);
|
98519
99481
|
setCurrentPage(1);
|
98520
99482
|
|
98521
|
-
_request((
|
99483
|
+
_request((_request8 = {}, _request8[targetPageSizeKey] = currentPageSize, _request8[targetPageKey] = 1, _request8));
|
98522
99484
|
}
|
98523
99485
|
|
98524
99486
|
function renderRowSelection() {
|
@@ -98530,13 +99492,13 @@ var ProTable = function ProTable(props) {
|
|
98530
99492
|
} else {
|
98531
99493
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
98532
99494
|
className: cls('footer-left-wrapper')
|
98533
|
-
}, rowSelection.mode !== 'single' && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_1__.Checkbox, _extends({
|
99495
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, rowSelection.mode !== 'single' && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_1__.Checkbox, _extends({
|
98534
99496
|
className: cls("footer-checkbox-" + size)
|
98535
99497
|
}, getCheckAllProps())), footerAction && renderFooterAction(), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
98536
99498
|
className: cls('selected-msg')
|
98537
99499
|
}, (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_4__.getMessage)('selected', {
|
98538
99500
|
count: selectedCount
|
98539
|
-
})));
|
99501
|
+
}))));
|
98540
99502
|
}
|
98541
99503
|
} else if (footerAction) {
|
98542
99504
|
if (showSkeleton) {
|
@@ -98551,7 +99513,7 @@ var ProTable = function ProTable(props) {
|
|
98551
99513
|
}
|
98552
99514
|
}
|
98553
99515
|
|
98554
|
-
if (showPagination) {
|
99516
|
+
if (showPagination && switchViewState === 'table') {
|
98555
99517
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
98556
99518
|
className: cls('footer', {
|
98557
99519
|
'footer-has-rowSelection': rowSelection,
|
@@ -98582,7 +99544,7 @@ var ProTable = function ProTable(props) {
|
|
98582
99544
|
return onChangePaginationSize(number);
|
98583
99545
|
}
|
98584
99546
|
}, props.paginationProps)))));
|
98585
|
-
} else if (!showPagination) {
|
99547
|
+
} else if (!showPagination && (footerAction || rowSelection || useRowSelection)) {
|
98586
99548
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
98587
99549
|
className: cls('footer', {
|
98588
99550
|
'footer-has-rowSelection': rowSelection
|
@@ -98596,6 +99558,7 @@ var ProTable = function ProTable(props) {
|
|
98596
99558
|
|
98597
99559
|
var fixFooterState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
98598
99560
|
if (fullscreenState) {
|
99561
|
+
// TODO XXX
|
98599
99562
|
return false;
|
98600
99563
|
}
|
98601
99564
|
|
@@ -98741,7 +99704,7 @@ var renderColumnsTitle = function renderColumnsTitle(item, actionRef) {
|
|
98741
99704
|
* 负责单元格的具体渲染
|
98742
99705
|
*/
|
98743
99706
|
|
98744
|
-
var renderCell = function renderCell(value, item, index, record, actionRef, context) {
|
99707
|
+
var renderCell = function renderCell(value, item, index, record, actionRef, context, dataTeamixSpm) {
|
98745
99708
|
var _actionSchema$actions;
|
98746
99709
|
|
98747
99710
|
var _item$valueType = item.valueType,
|
@@ -98812,7 +99775,8 @@ var renderCell = function renderCell(value, item, index, record, actionRef, cont
|
|
98812
99775
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_actions__WEBPACK_IMPORTED_MODULE_2__/* .ProActionGroup */ .d5, _extends({
|
98813
99776
|
type: "text"
|
98814
99777
|
}, actionSchema, {
|
98815
|
-
context: _extends({}, defaultContext, actionSchema.context)
|
99778
|
+
context: _extends({}, defaultContext, actionSchema.context),
|
99779
|
+
"data-teamix-spm": dataTeamixSpm ? dataTeamixSpm + "-columnAction" : undefined
|
98816
99780
|
}));
|
98817
99781
|
} // dataSource可传函数
|
98818
99782
|
|
@@ -98939,7 +99903,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
98939
99903
|
*/
|
98940
99904
|
function genProColumnToColumn(columns,
|
98941
99905
|
/** 是否渲染骨架屏 */
|
98942
|
-
showSkeleton, actionRef, context
|
99906
|
+
showSkeleton, actionRef, context, // 用于埋点
|
99907
|
+
dataTeamixSpm) {
|
98943
99908
|
if (context === void 0) {
|
98944
99909
|
context = {};
|
98945
99910
|
}
|
@@ -98969,7 +99934,7 @@ showSkeleton, actionRef, context) {
|
|
98969
99934
|
dataIndex: dataIndex == null ? void 0 : dataIndex.toString(),
|
98970
99935
|
title: (0,_columnRender__WEBPACK_IMPORTED_MODULE_1__/* .renderColumnsTitle */ .p)(columnProps, actionRef),
|
98971
99936
|
cell: function cell(value, index, record) {
|
98972
|
-
return (0,_columnRender__WEBPACK_IMPORTED_MODULE_1__/* .renderCell */ .c)(value, columnProps, index, record, actionRef, context);
|
99937
|
+
return (0,_columnRender__WEBPACK_IMPORTED_MODULE_1__/* .renderCell */ .c)(value, columnProps, index, record, actionRef, context, dataTeamixSpm);
|
98973
99938
|
}
|
98974
99939
|
});
|
98975
99940
|
});
|
@@ -102406,7 +103371,8 @@ function getGlobalConfig(key) {
|
|
102406
103371
|
classicBlue: 'Classic Blue',
|
102407
103372
|
cloudProductSelected: '{count} cloud products have been selected',
|
102408
103373
|
"public": 'Public',
|
102409
|
-
"private": 'Private'
|
103374
|
+
"private": 'Private',
|
103375
|
+
elastic: 'Elastic'
|
102410
103376
|
});
|
102411
103377
|
|
102412
103378
|
/***/ }),
|
@@ -102535,7 +103501,8 @@ var getMessage = function getMessage(id, data) {
|
|
102535
103501
|
classicBlue: '经典蓝',
|
102536
103502
|
cloudProductSelected: '已选择{count}个云产品',
|
102537
103503
|
"public": '公',
|
102538
|
-
"private": '私'
|
103504
|
+
"private": '私',
|
103505
|
+
elastic: '弹'
|
102539
103506
|
});
|
102540
103507
|
|
102541
103508
|
/***/ }),
|
@@ -102616,7 +103583,8 @@ var getMessage = function getMessage(id, data) {
|
|
102616
103583
|
classicBlue: '經典藍',
|
102617
103584
|
cloudProductSelected: '已選擇{count}個雲產品',
|
102618
103585
|
"public": '公',
|
102619
|
-
"private": '私'
|
103586
|
+
"private": '私',
|
103587
|
+
elastic: '弹'
|
102620
103588
|
});
|
102621
103589
|
|
102622
103590
|
/***/ }),
|
@@ -103414,6 +104382,16 @@ var setLightTheme = function setLightTheme() {
|
|
103414
104382
|
window.currentTheme = 'light';
|
103415
104383
|
};
|
103416
104384
|
|
104385
|
+
var setXconsoleTheme = function setXconsoleTheme() {
|
104386
|
+
document.documentElement.classList.add('theme-xconsole');
|
104387
|
+
document.documentElement.classList.remove('theme-hybridcloud');
|
104388
|
+
document.documentElement.classList.remove('theme-hybridcloud-dark'); // for 导航
|
104389
|
+
|
104390
|
+
document.documentElement.classList.remove('hybridcloud-dark');
|
104391
|
+
setChartsTheme('default', 'light');
|
104392
|
+
window.currentTheme = 'xconsole';
|
104393
|
+
};
|
104394
|
+
|
103417
104395
|
var setBrandColor = function setBrandColor(brandColor, theme) {
|
103418
104396
|
var brandColorStyleElement;
|
103419
104397
|
|
@@ -103464,6 +104442,8 @@ var setTheme = function setTheme(basicTheme, customTheme) {
|
|
103464
104442
|
setDarkTheme();
|
103465
104443
|
} else if (basicTheme === 'light') {
|
103466
104444
|
setLightTheme();
|
104445
|
+
} else if (basicTheme === 'xconsole') {
|
104446
|
+
setXconsoleTheme();
|
103467
104447
|
} else if (basicTheme === 'auto') {
|
103468
104448
|
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
103469
104449
|
setDarkTheme();
|