@zat-design/sisyphus-react 3.7.3-beta.12 → 3.7.3-beta.14
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/index.esm.css +13 -2
- package/dist/less.esm.css +13 -2
- package/es/ProEnum/components/Group.js +10 -2
- package/es/ProEnum/style/index.less +5 -4
- package/es/ProForm/components/combination/ProModalSelect/index.js +29 -24
- package/es/ProTable/components/FormatColumn/index.d.ts +7 -1
- package/es/ProTable/components/FormatColumn/index.js +14 -8
- package/es/ProTable/index.js +30 -13
- package/es/ProTable/propsType.d.ts +14 -1
- package/es/ProTable/style/index.less +1 -1
- package/es/ProTree/components/AdaptiveTooltip.d.ts +4 -0
- package/es/ProTree/components/AdaptiveTooltip.js +55 -0
- package/es/ProTree/components/List.js +15 -3
- package/es/ProTree/components/ProTreeSelect/index.js +20 -0
- package/es/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
- package/es/ProTree/components/SearchTitle.d.ts +1 -0
- package/es/ProTree/components/SearchTitle.js +7 -8
- package/es/ProTree/style/index.less +14 -0
- package/es/style/theme/index.less +1 -1
- package/lib/ProEnum/components/Group.js +10 -2
- package/lib/ProEnum/style/index.less +5 -4
- package/lib/ProForm/components/combination/ProModalSelect/index.js +29 -24
- package/lib/ProTable/components/FormatColumn/index.d.ts +7 -1
- package/lib/ProTable/components/FormatColumn/index.js +14 -8
- package/lib/ProTable/index.js +30 -13
- package/lib/ProTable/propsType.d.ts +14 -1
- package/lib/ProTable/style/index.less +1 -1
- package/lib/ProTree/components/AdaptiveTooltip.d.ts +4 -0
- package/lib/ProTree/components/AdaptiveTooltip.js +61 -0
- package/lib/ProTree/components/List.js +15 -3
- package/lib/ProTree/components/ProTreeSelect/index.js +20 -0
- package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
- package/lib/ProTree/components/SearchTitle.d.ts +1 -0
- package/lib/ProTree/components/SearchTitle.js +8 -7
- package/lib/ProTree/style/index.less +14 -0
- package/lib/style/theme/index.less +1 -1
- package/package.json +1 -1
package/dist/index.esm.css
CHANGED
|
@@ -1909,7 +1909,7 @@
|
|
|
1909
1909
|
.pro-table .ant-table-body .ant-table-cell .varied-cell {
|
|
1910
1910
|
margin-left: -8px;
|
|
1911
1911
|
padding: var(--zaui-space-size-xs, 4px) var(--zaui-space-size-sm, 8px);
|
|
1912
|
-
background: var(--zaui-contract-bg, #fffaa1);
|
|
1912
|
+
background: var(--zaui-contract-bg, #fffaa1) !important;
|
|
1913
1913
|
border-radius: var(--zaui-border-radius, 8px);
|
|
1914
1914
|
}
|
|
1915
1915
|
.pro-table .ant-table-body .varied-cell.empty-cell {
|
|
@@ -3856,6 +3856,14 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
3856
3856
|
.pro-transfer-right .checked-item.disabled .anticon {
|
|
3857
3857
|
pointer-events: none;
|
|
3858
3858
|
}
|
|
3859
|
+
.pro-tree-wrap-ellipse {
|
|
3860
|
+
display: block;
|
|
3861
|
+
width: 100%;
|
|
3862
|
+
overflow: hidden;
|
|
3863
|
+
white-space: nowrap;
|
|
3864
|
+
text-overflow: ellipsis;
|
|
3865
|
+
word-break: keep-all;
|
|
3866
|
+
}
|
|
3859
3867
|
.pro-tree {
|
|
3860
3868
|
height: 100%;
|
|
3861
3869
|
}
|
|
@@ -4222,6 +4230,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
4222
4230
|
.pro-tree-select-drop-down-container.ant-select-dropdown .ant-select-tree-node-content-wrapper .check-mark-icon {
|
|
4223
4231
|
display: none;
|
|
4224
4232
|
}
|
|
4233
|
+
.ant-select-tree-node-content-wrapper:has(.pro-tree-wrap-ellipse) {
|
|
4234
|
+
overflow: hidden;
|
|
4235
|
+
}
|
|
4225
4236
|
.pro-drawer .pro-drawer-close {
|
|
4226
4237
|
position: absolute;
|
|
4227
4238
|
top: 6px;
|
|
@@ -5315,7 +5326,7 @@ input[type='button'] {
|
|
|
5315
5326
|
--zaui-brand: #006aff;
|
|
5316
5327
|
--zaui-brand-hover: #3387ff;
|
|
5317
5328
|
--zaui-brand-active: #005ad9;
|
|
5318
|
-
--zaui-brand-disabled:
|
|
5329
|
+
--zaui-brand-disabled: color-mix(in srgb, var(--zaui-brand) 70%, white);
|
|
5319
5330
|
--zaui-text: #343434;
|
|
5320
5331
|
--zaui-text-weak: #616161;
|
|
5321
5332
|
--zaui-aide-text: #909090;
|
package/dist/less.esm.css
CHANGED
|
@@ -1909,7 +1909,7 @@
|
|
|
1909
1909
|
.pro-table .ant-table-body .ant-table-cell .varied-cell {
|
|
1910
1910
|
margin-left: -8px;
|
|
1911
1911
|
padding: var(--zaui-space-size-xs, 4px) var(--zaui-space-size-sm, 8px);
|
|
1912
|
-
background: var(--zaui-contract-bg, #fffaa1);
|
|
1912
|
+
background: var(--zaui-contract-bg, #fffaa1) !important;
|
|
1913
1913
|
border-radius: var(--zaui-border-radius, 8px);
|
|
1914
1914
|
}
|
|
1915
1915
|
.pro-table .ant-table-body .varied-cell.empty-cell {
|
|
@@ -3856,6 +3856,14 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
3856
3856
|
.pro-transfer-right .checked-item.disabled .anticon {
|
|
3857
3857
|
pointer-events: none;
|
|
3858
3858
|
}
|
|
3859
|
+
.pro-tree-wrap-ellipse {
|
|
3860
|
+
display: block;
|
|
3861
|
+
width: 100%;
|
|
3862
|
+
overflow: hidden;
|
|
3863
|
+
white-space: nowrap;
|
|
3864
|
+
text-overflow: ellipsis;
|
|
3865
|
+
word-break: keep-all;
|
|
3866
|
+
}
|
|
3859
3867
|
.pro-tree {
|
|
3860
3868
|
height: 100%;
|
|
3861
3869
|
}
|
|
@@ -4222,6 +4230,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
4222
4230
|
.pro-tree-select-drop-down-container.ant-select-dropdown .ant-select-tree-node-content-wrapper .check-mark-icon {
|
|
4223
4231
|
display: none;
|
|
4224
4232
|
}
|
|
4233
|
+
.ant-select-tree-node-content-wrapper:has(.pro-tree-wrap-ellipse) {
|
|
4234
|
+
overflow: hidden;
|
|
4235
|
+
}
|
|
4225
4236
|
.pro-drawer .pro-drawer-close {
|
|
4226
4237
|
position: absolute;
|
|
4227
4238
|
top: 6px;
|
|
@@ -5315,7 +5326,7 @@ input[type='button'] {
|
|
|
5315
5326
|
--zaui-brand: #006aff;
|
|
5316
5327
|
--zaui-brand-hover: #3387ff;
|
|
5317
5328
|
--zaui-brand-active: #005ad9;
|
|
5318
|
-
--zaui-brand-disabled:
|
|
5329
|
+
--zaui-brand-disabled: color-mix(in srgb, var(--zaui-brand) 70%, white);
|
|
5319
5330
|
--zaui-text: #343434;
|
|
5320
5331
|
--zaui-text-weak: #616161;
|
|
5321
5332
|
--zaui-aide-text: #909090;
|
|
@@ -43,7 +43,10 @@ var Group = function Group(props) {
|
|
|
43
43
|
}
|
|
44
44
|
return _jsx("div", {
|
|
45
45
|
id: id,
|
|
46
|
-
className: classNames(
|
|
46
|
+
className: classNames({
|
|
47
|
+
'pro-enum-group-root': true,
|
|
48
|
+
'pro-enum-group-root-disabled': disabled
|
|
49
|
+
}),
|
|
47
50
|
children: dataSource.map(function (item, index) {
|
|
48
51
|
return _jsx("div", {
|
|
49
52
|
onClick: function onClick() {
|
|
@@ -51,7 +54,12 @@ var Group = function Group(props) {
|
|
|
51
54
|
handleClick(item[fieldValue], index);
|
|
52
55
|
}
|
|
53
56
|
},
|
|
54
|
-
className: classNames(
|
|
57
|
+
className: classNames({
|
|
58
|
+
'pro-enum-group-item': true,
|
|
59
|
+
'pro-enum-group-item-selected': value === item[fieldValue],
|
|
60
|
+
'pro-enum-group-item-disabled-after': index === idx.current || index + 1 === idx.current,
|
|
61
|
+
'pro-enum-group-item-disabled': item.disabled
|
|
62
|
+
}),
|
|
55
63
|
children: item[fieldLabel]
|
|
56
64
|
}, item[fieldValue]);
|
|
57
65
|
})
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
@root-entry-name: 'default';
|
|
2
2
|
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
3
|
|
|
4
|
+
@zaui-disabled-bg: var(--zaui-disabled-bg);
|
|
5
|
+
|
|
4
6
|
.pro-enum {
|
|
5
7
|
&-tag-root {
|
|
6
8
|
display: flex;
|
|
@@ -96,14 +98,13 @@
|
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
&-group-root-disabled {
|
|
99
|
-
color:
|
|
101
|
+
color: var(--zaui-aide-text);
|
|
100
102
|
|
|
101
103
|
.pro-enum-group-item {
|
|
102
104
|
background: var(--zaui-disabled-bg);
|
|
103
105
|
&.pro-enum-group-item-selected {
|
|
104
|
-
background: var(--zaui-brand);
|
|
105
|
-
|
|
106
|
-
border-color: var(--zaui-brand);
|
|
106
|
+
background: var(--zaui-brand-disabled);
|
|
107
|
+
border-color: var(--zaui-brand-disabled);
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
}
|
|
@@ -616,32 +616,37 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
616
616
|
}
|
|
617
617
|
}, [onOff, visible, value]);
|
|
618
618
|
useEffect(function () {
|
|
619
|
-
if (value && !visible && isInit) {
|
|
620
|
-
|
|
621
|
-
// 加定时器 修复依赖数据同步更新未取到问题
|
|
622
|
-
setTimeout(function () {
|
|
623
|
-
var _useRequest$options7, _useRequest$options8;
|
|
624
|
-
var initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
|
625
|
-
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
|
626
|
-
var _contentForm$getField2;
|
|
627
|
-
initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0 ? void 0 : (_contentForm$getField2 = contentForm.getFieldsValue) === null || _contentForm$getField2 === void 0 ? void 0 : _contentForm$getField2.call(contentForm));
|
|
628
|
-
}
|
|
629
|
-
var params = withPagination ? {
|
|
630
|
-
pageNum: 1,
|
|
631
|
-
pageSize: 50,
|
|
632
|
-
queryBean: _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.defaultParams), initParams)
|
|
633
|
-
} : _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options8 = useRequest.options) === null || _useRequest$options8 === void 0 ? void 0 : _useRequest$options8.defaultParams), initParams);
|
|
634
|
-
var nextParams = transformParams ? transformParams(params) : params;
|
|
635
|
-
run(nextParams);
|
|
636
|
-
setState({
|
|
637
|
-
isInit: false
|
|
638
|
-
});
|
|
639
|
-
}, 300);
|
|
640
|
-
} else {
|
|
641
|
-
getInitValues();
|
|
642
|
-
}
|
|
619
|
+
if (value && !visible && isInit && !readOnly) {
|
|
620
|
+
getInitValues();
|
|
643
621
|
}
|
|
644
622
|
}, [value, visible, isInit, useRequest]);
|
|
623
|
+
useEffect(function () {
|
|
624
|
+
if (value && !visible && readOnly) {
|
|
625
|
+
var _options$some;
|
|
626
|
+
var isHasValue = options === null || options === void 0 ? void 0 : (_options$some = options.some) === null || _options$some === void 0 ? void 0 : _options$some.call(options, function (item) {
|
|
627
|
+
return item[valueKey] === value;
|
|
628
|
+
});
|
|
629
|
+
if (isHasValue) {
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
// 加定时器 修复依赖数据同步更新未取到问题
|
|
633
|
+
setTimeout(function () {
|
|
634
|
+
var _useRequest$options7, _useRequest$options8;
|
|
635
|
+
var initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
|
636
|
+
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
|
637
|
+
var _contentForm$getField2;
|
|
638
|
+
initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0 ? void 0 : (_contentForm$getField2 = contentForm.getFieldsValue) === null || _contentForm$getField2 === void 0 ? void 0 : _contentForm$getField2.call(contentForm));
|
|
639
|
+
}
|
|
640
|
+
var params = withPagination ? {
|
|
641
|
+
pageNum: 1,
|
|
642
|
+
pageSize: 50,
|
|
643
|
+
queryBean: _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.defaultParams), initParams)
|
|
644
|
+
} : _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options8 = useRequest.options) === null || _useRequest$options8 === void 0 ? void 0 : _useRequest$options8.defaultParams), initParams);
|
|
645
|
+
var nextParams = transformParams ? transformParams(params) : params;
|
|
646
|
+
run(nextParams);
|
|
647
|
+
}, 300);
|
|
648
|
+
}
|
|
649
|
+
}, [value, options, visible, useRequest]);
|
|
645
650
|
useEffect(function () {
|
|
646
651
|
if (!value) {
|
|
647
652
|
if (defaultOne) {
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ProTableColumn } from '../../propsType';
|
|
3
|
-
export declare const formatColumn: (column
|
|
3
|
+
export declare const formatColumn: ({ column, originalObj, dataSourceObj, rowKey, diffToolTip, }: {
|
|
4
|
+
column: ProTableColumn;
|
|
5
|
+
originalObj: any;
|
|
6
|
+
dataSourceObj: any;
|
|
7
|
+
rowKey: any;
|
|
8
|
+
diffToolTip?: boolean;
|
|
9
|
+
}) => void;
|
|
4
10
|
/**
|
|
5
11
|
* 查找最近的父级className
|
|
6
12
|
* @param element 当前node节点
|
|
@@ -11,7 +11,12 @@ import RenderColumn from '../RenderColumn';
|
|
|
11
11
|
import { getDecimalDigits, getOriginalValue } from '../../utils';
|
|
12
12
|
import getEnumLabel from '../../../ProEnum/utils/getEnumLabel';
|
|
13
13
|
import ProForm from '../../../ProForm';
|
|
14
|
-
export var formatColumn = function formatColumn(
|
|
14
|
+
export var formatColumn = function formatColumn(_ref) {
|
|
15
|
+
var column = _ref.column,
|
|
16
|
+
originalObj = _ref.originalObj,
|
|
17
|
+
dataSourceObj = _ref.dataSourceObj,
|
|
18
|
+
rowKey = _ref.rowKey,
|
|
19
|
+
diffToolTip = _ref.diffToolTip;
|
|
15
20
|
var title = column.title,
|
|
16
21
|
valueType = column.valueType,
|
|
17
22
|
_column$format = column.format,
|
|
@@ -31,6 +36,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
|
|
|
31
36
|
originalDiffTip = _column$originalDiffT === void 0 ? true : _column$originalDiffT,
|
|
32
37
|
_column$toolTipProps = column.toolTipProps,
|
|
33
38
|
toolTipProps = _column$toolTipProps === void 0 ? {} : _column$toolTipProps;
|
|
39
|
+
var _originalDiffTip = diffToolTip !== null && diffToolTip !== void 0 ? diffToolTip : originalDiffTip;
|
|
34
40
|
// 前缀处理
|
|
35
41
|
var prefixNode = function prefixNode(value, record, index) {
|
|
36
42
|
if (!prefix) {
|
|
@@ -98,7 +104,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
|
|
|
98
104
|
node: node,
|
|
99
105
|
value: value,
|
|
100
106
|
currentValue: renderValue,
|
|
101
|
-
originalDiffTip:
|
|
107
|
+
originalDiffTip: _originalDiffTip,
|
|
102
108
|
toolTipProps: toolTipProps
|
|
103
109
|
});
|
|
104
110
|
};
|
|
@@ -128,7 +134,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
|
|
|
128
134
|
node: node,
|
|
129
135
|
value: value,
|
|
130
136
|
currentValue: renderValue,
|
|
131
|
-
originalDiffTip:
|
|
137
|
+
originalDiffTip: _originalDiffTip,
|
|
132
138
|
toolTipProps: toolTipProps
|
|
133
139
|
});
|
|
134
140
|
};
|
|
@@ -181,7 +187,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
|
|
|
181
187
|
node: node,
|
|
182
188
|
value: value,
|
|
183
189
|
currentValue: renderValue,
|
|
184
|
-
originalDiffTip:
|
|
190
|
+
originalDiffTip: _originalDiffTip,
|
|
185
191
|
toolTipProps: toolTipProps
|
|
186
192
|
});
|
|
187
193
|
};
|
|
@@ -219,7 +225,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
|
|
|
219
225
|
node: node,
|
|
220
226
|
value: value,
|
|
221
227
|
currentValue: renderValue,
|
|
222
|
-
originalDiffTip:
|
|
228
|
+
originalDiffTip: _originalDiffTip,
|
|
223
229
|
toolTipProps: toolTipProps
|
|
224
230
|
});
|
|
225
231
|
};
|
|
@@ -246,7 +252,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
|
|
|
246
252
|
node: node,
|
|
247
253
|
value: value,
|
|
248
254
|
currentValue: renderValue,
|
|
249
|
-
originalDiffTip:
|
|
255
|
+
originalDiffTip: _originalDiffTip,
|
|
250
256
|
toolTipProps: toolTipProps
|
|
251
257
|
});
|
|
252
258
|
};
|
|
@@ -323,7 +329,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
|
|
|
323
329
|
node: value,
|
|
324
330
|
value: value,
|
|
325
331
|
currentValue: value || '-',
|
|
326
|
-
originalDiffTip:
|
|
332
|
+
originalDiffTip: _originalDiffTip,
|
|
327
333
|
toolTipProps: toolTipProps
|
|
328
334
|
}), suffixNode(value, record, index)]
|
|
329
335
|
});
|
|
@@ -346,7 +352,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
|
|
|
346
352
|
node: node,
|
|
347
353
|
value: value,
|
|
348
354
|
currentValue: value || '-',
|
|
349
|
-
originalDiffTip:
|
|
355
|
+
originalDiffTip: _originalDiffTip,
|
|
350
356
|
toolTipProps: toolTipProps
|
|
351
357
|
});
|
|
352
358
|
};
|
package/es/ProTable/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
7
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
8
|
-
var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stripe", "columns", "className", "draggable", "disabled", "isView", "rowDisabled", "summary", "emptyText", "
|
|
8
|
+
var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stripe", "columns", "className", "draggable", "disabled", "isView", "rowDisabled", "summary", "emptyText", "diffConfig", "onDragStart", "onDragEnd"],
|
|
9
9
|
_excluded2 = ["resizeColumn", "columnConfig", "cacheTime", "storage"];
|
|
10
10
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { useEffect, useMemo, useState, createContext } from 'react';
|
|
@@ -52,10 +52,15 @@ function ProTable(props) {
|
|
|
52
52
|
summary = props.summary,
|
|
53
53
|
_props$emptyText = props.emptyText,
|
|
54
54
|
emptyText = _props$emptyText === void 0 ? locale === null || locale === void 0 ? void 0 : (_locale$ProTable = locale.ProTable) === null || _locale$ProTable === void 0 ? void 0 : _locale$ProTable.noData : _props$emptyText,
|
|
55
|
-
|
|
55
|
+
diffConfig = props.diffConfig,
|
|
56
56
|
onDragStartGuard = props.onDragStart,
|
|
57
57
|
onDragEndGuard = props.onDragEnd,
|
|
58
58
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
59
|
+
var _ref3 = diffConfig || {},
|
|
60
|
+
originalDataSource = _ref3.originalDataSource,
|
|
61
|
+
changeTipColor = _ref3.changeTipColor,
|
|
62
|
+
addTipColor = _ref3.addTipColor,
|
|
63
|
+
toolTip = _ref3.toolTip;
|
|
59
64
|
var quickTableConfig = quickConfig ? _objectSpread({
|
|
60
65
|
columnConfig: true,
|
|
61
66
|
cacheTime: true
|
|
@@ -71,10 +76,10 @@ function ProTable(props) {
|
|
|
71
76
|
_quickTableConfig$sto = quickTableConfig.storage,
|
|
72
77
|
storage = _quickTableConfig$sto === void 0 ? configStorage : _quickTableConfig$sto,
|
|
73
78
|
tableProps = _objectWithoutProperties(quickTableConfig, _excluded2);
|
|
74
|
-
var
|
|
75
|
-
pagination =
|
|
76
|
-
dataSource =
|
|
77
|
-
rowKey =
|
|
79
|
+
var _ref4 = tableProps || {},
|
|
80
|
+
pagination = _ref4.pagination,
|
|
81
|
+
dataSource = _ref4.dataSource,
|
|
82
|
+
rowKey = _ref4.rowKey;
|
|
78
83
|
var initDataSource = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
79
84
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
80
85
|
rowKey: getRowKey(rowKey, item)
|
|
@@ -157,8 +162,8 @@ function ProTable(props) {
|
|
|
157
162
|
};
|
|
158
163
|
// 列宽resize函数
|
|
159
164
|
var handleResize = function handleResize(index) {
|
|
160
|
-
return function (e,
|
|
161
|
-
var size =
|
|
165
|
+
return function (e, _ref5) {
|
|
166
|
+
var size = _ref5.size;
|
|
162
167
|
var nextColumns = _toConsumableArray(curColumns);
|
|
163
168
|
nextColumns[index] = _objectSpread(_objectSpread({}, nextColumns[index]), {}, {
|
|
164
169
|
width: size.width
|
|
@@ -188,7 +193,13 @@ function ProTable(props) {
|
|
|
188
193
|
return !(item === null || item === void 0 ? void 0 : item.delete);
|
|
189
194
|
});
|
|
190
195
|
newColumns === null || newColumns === void 0 ? void 0 : newColumns.forEach(function (item) {
|
|
191
|
-
formatColumn(
|
|
196
|
+
formatColumn({
|
|
197
|
+
column: item,
|
|
198
|
+
originalObj: originalObj,
|
|
199
|
+
dataSourceObj: dataSourceObj,
|
|
200
|
+
rowKey: 'rowKey',
|
|
201
|
+
diffToolTip: toolTip
|
|
202
|
+
});
|
|
192
203
|
});
|
|
193
204
|
return newColumns;
|
|
194
205
|
}, [curColumns, handleResize]);
|
|
@@ -205,7 +216,7 @@ function ProTable(props) {
|
|
|
205
216
|
});
|
|
206
217
|
}, [columns]);
|
|
207
218
|
var handleColumnConfig = /*#__PURE__*/function () {
|
|
208
|
-
var
|
|
219
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(checkList) {
|
|
209
220
|
var newColumns, _columnConfig$onColum, catchColumns;
|
|
210
221
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
211
222
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -241,7 +252,7 @@ function ProTable(props) {
|
|
|
241
252
|
}, _callee);
|
|
242
253
|
}));
|
|
243
254
|
return function handleColumnConfig(_x) {
|
|
244
|
-
return
|
|
255
|
+
return _ref6.apply(this, arguments);
|
|
245
256
|
};
|
|
246
257
|
}();
|
|
247
258
|
useDebounceEffect(function () {
|
|
@@ -314,7 +325,7 @@ function ProTable(props) {
|
|
|
314
325
|
return _rowSelection;
|
|
315
326
|
};
|
|
316
327
|
var onDataSourceChange = /*#__PURE__*/function () {
|
|
317
|
-
var
|
|
328
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(nextDataSource) {
|
|
318
329
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
319
330
|
while (1) switch (_context2.prev = _context2.next) {
|
|
320
331
|
case 0:
|
|
@@ -330,7 +341,7 @@ function ProTable(props) {
|
|
|
330
341
|
}, _callee2);
|
|
331
342
|
}));
|
|
332
343
|
return function onDataSourceChange(_x2) {
|
|
333
|
-
return
|
|
344
|
+
return _ref7.apply(this, arguments);
|
|
334
345
|
};
|
|
335
346
|
}();
|
|
336
347
|
var _rowClassName = function _rowClassName(record, index) {
|
|
@@ -339,6 +350,11 @@ function ProTable(props) {
|
|
|
339
350
|
}
|
|
340
351
|
};
|
|
341
352
|
var TableComponent = draggable ? DraggableTable : BaseTable;
|
|
353
|
+
// 标记样式
|
|
354
|
+
var tagStyle = {
|
|
355
|
+
'--zaui-contract-bg': changeTipColor,
|
|
356
|
+
'--zaui-contract-bg-add': addTipColor
|
|
357
|
+
};
|
|
342
358
|
return _jsx(TableContext.Provider, {
|
|
343
359
|
value: {
|
|
344
360
|
pathKey: pathKey,
|
|
@@ -362,6 +378,7 @@ function ProTable(props) {
|
|
|
362
378
|
}
|
|
363
379
|
}), _jsxs("div", {
|
|
364
380
|
className: "pro-table-container",
|
|
381
|
+
style: tagStyle,
|
|
365
382
|
children: [_jsx(TableComponent, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
366
383
|
draggableProps: {
|
|
367
384
|
onChange: onDataSourceChange,
|
|
@@ -59,6 +59,16 @@ export interface DragStartGuardProps {
|
|
|
59
59
|
activeObject: any;
|
|
60
60
|
currentDataSource: any[];
|
|
61
61
|
}
|
|
62
|
+
export interface TableDiffConfigProps {
|
|
63
|
+
/** 比对原始数据源 */
|
|
64
|
+
originalDataSource: any[];
|
|
65
|
+
/** 是否显示对比值气泡 */
|
|
66
|
+
toolTip?: boolean;
|
|
67
|
+
/** 变更提示颜色 */
|
|
68
|
+
changeTipColor?: string;
|
|
69
|
+
/** 新增提示颜色 */
|
|
70
|
+
addTipColor?: string;
|
|
71
|
+
}
|
|
62
72
|
export interface ProTableProps<T = any> extends Omit<TableProps<any>, 'summary' | 'columns'> {
|
|
63
73
|
tableId?: string;
|
|
64
74
|
rowKey?: string | GetRowKey<any>;
|
|
@@ -84,7 +94,10 @@ export interface ProTableProps<T = any> extends Omit<TableProps<any>, 'summary'
|
|
|
84
94
|
*/
|
|
85
95
|
stripe?: boolean;
|
|
86
96
|
columns: ProTableColumn[];
|
|
87
|
-
|
|
97
|
+
/**
|
|
98
|
+
* 比对配置
|
|
99
|
+
*/
|
|
100
|
+
diffConfig?: TableDiffConfigProps;
|
|
88
101
|
/**
|
|
89
102
|
* 拖拽额外配置
|
|
90
103
|
*/
|
|
@@ -270,7 +270,7 @@
|
|
|
270
270
|
.@{ant-prefix}-table-cell .varied-cell {
|
|
271
271
|
margin-left: -8px;
|
|
272
272
|
padding: var(--zaui-space-size-xs, 4px) var(--zaui-space-size-sm, 8px);
|
|
273
|
-
background: var(--zaui-contract-bg
|
|
273
|
+
background: var(--zaui-contract-bg; #fffaa1) !important;
|
|
274
274
|
border-radius: var(--zaui-border-radius, 8px);
|
|
275
275
|
}
|
|
276
276
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import "antd/es/tooltip/style";
|
|
2
|
+
import _Tooltip from "antd/es/tooltip";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
/*
|
|
6
|
+
* @Author: za-xuwenli xuwenli@zhongan.io
|
|
7
|
+
* @Date: 2024-09-20 10:26:04
|
|
8
|
+
* @LastEditors: za-xuwenli xuwenli@zhongan.io
|
|
9
|
+
* @LastEditTime: 2024-09-26 14:12:44
|
|
10
|
+
* @FilePath: /za-material-warehouse/src/ProTree/components/AdaptiveTooltip.tsx
|
|
11
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { useEffect, useState } from 'react';
|
|
15
|
+
var AdaptiveTooltip = function AdaptiveTooltip(_ref) {
|
|
16
|
+
var children = _ref.children;
|
|
17
|
+
var _useState = useState('right'),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
placement = _useState2[0],
|
|
20
|
+
setPlacement = _useState2[1];
|
|
21
|
+
useEffect(function () {
|
|
22
|
+
var handleResize = function handleResize() {
|
|
23
|
+
var tooltipElement = document.getElementById('adaptive-tooltip');
|
|
24
|
+
if (tooltipElement) {
|
|
25
|
+
var boundingRect = tooltipElement.getBoundingClientRect();
|
|
26
|
+
var windowWidth = window.innerWidth;
|
|
27
|
+
if (windowWidth - boundingRect.right < 150) {
|
|
28
|
+
setPlacement('left');
|
|
29
|
+
} else {
|
|
30
|
+
setPlacement('right');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
window.addEventListener('resize', handleResize);
|
|
35
|
+
handleResize();
|
|
36
|
+
return function () {
|
|
37
|
+
window.removeEventListener('resize', handleResize);
|
|
38
|
+
};
|
|
39
|
+
}, [children]);
|
|
40
|
+
return _jsx(_Tooltip, {
|
|
41
|
+
placement: placement,
|
|
42
|
+
title: _jsx("div", {
|
|
43
|
+
onMouseDown: function onMouseDown(e) {
|
|
44
|
+
return e.stopPropagation();
|
|
45
|
+
},
|
|
46
|
+
children: children
|
|
47
|
+
}),
|
|
48
|
+
id: "adaptive-tooltip",
|
|
49
|
+
children: _jsxs("span", {
|
|
50
|
+
className: "pro-tree-wrap-ellipse",
|
|
51
|
+
children: [" ", children]
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
export default AdaptiveTooltip;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
1
2
|
import "antd/es/checkbox/style";
|
|
2
3
|
import _Checkbox from "antd/es/checkbox";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
+
var _excluded = ["checkedValues", "disabled", "treeData", "searchStr", "showCodeName", "mode", "fieldNames", "handleOnChange", "handleFilterClose", "optionRender"];
|
|
3
6
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
/*
|
|
8
|
+
* @Author: za-xuwenli xuwenli@zhongan.io
|
|
9
|
+
* @Date: 2024-07-03 11:02:19
|
|
10
|
+
* @LastEditors: za-xuwenli xuwenli@zhongan.io
|
|
11
|
+
* @LastEditTime: 2024-09-26 14:30:26
|
|
12
|
+
* @FilePath: /za-material-warehouse/src/ProTree/components/List.tsx
|
|
13
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
14
|
+
*/
|
|
4
15
|
import { memo } from 'react';
|
|
5
16
|
import SearchTitle from './SearchTitle';
|
|
6
17
|
import CloseIcon from './CloseIcon';
|
|
@@ -15,7 +26,8 @@ function List(props) {
|
|
|
15
26
|
fieldNames = props.fieldNames,
|
|
16
27
|
handleOnChange = props.handleOnChange,
|
|
17
28
|
handleFilterClose = props.handleFilterClose,
|
|
18
|
-
optionRender = props.optionRender
|
|
29
|
+
optionRender = props.optionRender,
|
|
30
|
+
other = _objectWithoutProperties(props, _excluded);
|
|
19
31
|
var fieldNameLabel = fieldNames.label;
|
|
20
32
|
var fieldNameValue = fieldNames.value;
|
|
21
33
|
if (mode === 'render') {
|
|
@@ -37,10 +49,10 @@ function List(props) {
|
|
|
37
49
|
value: item[fieldNameValue],
|
|
38
50
|
disabled: item.disabled,
|
|
39
51
|
children: _jsx("span", {
|
|
40
|
-
children: optionRender ? optionRender(item, searchStr) : _jsx(SearchTitle, {
|
|
52
|
+
children: optionRender ? optionRender(item, searchStr) : _jsx(SearchTitle, _objectSpread({
|
|
41
53
|
label: title,
|
|
42
54
|
searchStr: searchStr
|
|
43
|
-
})
|
|
55
|
+
}, other))
|
|
44
56
|
})
|
|
45
57
|
})
|
|
46
58
|
}, item[fieldNameValue]);
|
|
@@ -21,6 +21,7 @@ import { useImperativeHandle, forwardRef } from 'react';
|
|
|
21
21
|
import { cloneDeep } from 'lodash';
|
|
22
22
|
import { useProConfig } from '../../../ProConfigProvider';
|
|
23
23
|
import Container from '../../../ProForm/components/Container';
|
|
24
|
+
import AdaptiveTooltip from '../AdaptiveTooltip';
|
|
24
25
|
var SHOW_PARENT = _TreeSelect.SHOW_PARENT;
|
|
25
26
|
export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
26
27
|
// 全局属性配置在ConfigProvider
|
|
@@ -74,6 +75,11 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
74
75
|
selectProps = _objectWithoutProperties(props, _excluded);
|
|
75
76
|
var _props$value = props.value,
|
|
76
77
|
value = _props$value === void 0 ? undefined : _props$value;
|
|
78
|
+
var _props$showEllipse = props.showEllipse,
|
|
79
|
+
showEllipse = _props$showEllipse === void 0 ? true : _props$showEllipse,
|
|
80
|
+
_props$isDiffChange = props.isDiffChange,
|
|
81
|
+
isDiffChange = _props$isDiffChange === void 0 ? false : _props$isDiffChange;
|
|
82
|
+
var _showEllipse = showEllipse && !isDiffChange;
|
|
77
83
|
var _ref2 = otherProps || {},
|
|
78
84
|
isView = _ref2.isView,
|
|
79
85
|
viewEmpty = _ref2.viewEmpty;
|
|
@@ -312,6 +318,20 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
312
318
|
children: _jsx(Icon, {})
|
|
313
319
|
}) : null]
|
|
314
320
|
});
|
|
321
|
+
if (_showEllipse) {
|
|
322
|
+
title = _jsx(AdaptiveTooltip, {
|
|
323
|
+
children: treeCheckable ? titleHtml : _jsxs("span", {
|
|
324
|
+
className: "check-option-text",
|
|
325
|
+
children: [_jsx("span", {
|
|
326
|
+
className: "check-option-text-content",
|
|
327
|
+
children: titleHtml
|
|
328
|
+
}), !disabled ? _jsx("span", {
|
|
329
|
+
className: "check-mark-icon",
|
|
330
|
+
children: _jsx(Icon, {})
|
|
331
|
+
}) : null]
|
|
332
|
+
})
|
|
333
|
+
});
|
|
334
|
+
}
|
|
315
335
|
if (!children) {
|
|
316
336
|
return _jsx(_TreeSelect.TreeNode, {
|
|
317
337
|
value: value,
|
|
@@ -73,6 +73,8 @@ export interface PropTreeSelectProps extends Omit<TreeSelectProps, 'onSearch'> {
|
|
|
73
73
|
expandedKeys?: any[];
|
|
74
74
|
checkStrictly?: boolean;
|
|
75
75
|
checkable?: boolean;
|
|
76
|
+
showEllipse?: boolean;
|
|
77
|
+
isDiffChange?: boolean;
|
|
76
78
|
}
|
|
77
79
|
export interface ProSelectAction {
|
|
78
80
|
/** 获取发生请求的 useRequest 的 ref */
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import "antd/es/tooltip/style";
|
|
2
|
-
import _Tooltip from "antd/es/tooltip";
|
|
3
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
2
|
import { memo } from 'react';
|
|
3
|
+
import AdaptiveTooltip from './AdaptiveTooltip';
|
|
5
4
|
function SearchTitle(props) {
|
|
6
5
|
var label = props.label,
|
|
7
6
|
_props$searchStr = props.searchStr,
|
|
8
7
|
searchStr = _props$searchStr === void 0 ? '' : _props$searchStr,
|
|
9
8
|
showEllipse = props.showEllipse,
|
|
10
|
-
ellipseWidth = props.ellipseWidth
|
|
9
|
+
ellipseWidth = props.ellipseWidth,
|
|
10
|
+
_props$isDiffChange = props.isDiffChange,
|
|
11
|
+
isDiffChange = _props$isDiffChange === void 0 ? false : _props$isDiffChange;
|
|
11
12
|
var strTitle = label;
|
|
12
13
|
var index = strTitle === null || strTitle === void 0 ? void 0 : strTitle.indexOf(searchStr);
|
|
13
14
|
var beforeStr = strTitle === null || strTitle === void 0 ? void 0 : strTitle.substring(0, index);
|
|
@@ -40,11 +41,9 @@ function SearchTitle(props) {
|
|
|
40
41
|
style: style,
|
|
41
42
|
children: strTitle
|
|
42
43
|
});
|
|
43
|
-
if (classEllipse) {
|
|
44
|
-
return _jsx(
|
|
45
|
-
|
|
46
|
-
placement: "rightTop",
|
|
47
|
-
children: title
|
|
44
|
+
if (classEllipse && !isDiffChange) {
|
|
45
|
+
return _jsx(AdaptiveTooltip, {
|
|
46
|
+
children: titleTips
|
|
48
47
|
});
|
|
49
48
|
}
|
|
50
49
|
return title;
|