@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
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
@root-entry-name: 'default';
|
|
2
2
|
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
3
|
|
|
4
|
+
.pro-tree-wrap-ellipse {
|
|
5
|
+
display: block;
|
|
6
|
+
width: 100%;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
white-space: nowrap;
|
|
9
|
+
text-overflow: ellipsis;
|
|
10
|
+
word-break: keep-all;
|
|
11
|
+
}
|
|
12
|
+
|
|
4
13
|
.pro-tree {
|
|
5
14
|
height: 100%; // tree auto css
|
|
6
15
|
.@{ant-prefix}-tree-iconEle{
|
|
@@ -368,3 +377,8 @@
|
|
|
368
377
|
}
|
|
369
378
|
|
|
370
379
|
|
|
380
|
+
.@{ant-prefix}-select-tree-node-content-wrapper {
|
|
381
|
+
&:has(.pro-tree-wrap-ellipse){
|
|
382
|
+
overflow: hidden;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
--zaui-brand : #006aff;
|
|
9
9
|
--zaui-brand-hover : #3387ff;
|
|
10
10
|
--zaui-brand-active : #005ad9;
|
|
11
|
-
--zaui-brand-disabled :
|
|
11
|
+
--zaui-brand-disabled : color-mix(in srgb, var(--zaui-brand) 70%, white);
|
|
12
12
|
--zaui-text : #343434;
|
|
13
13
|
--zaui-text-weak : #616161;
|
|
14
14
|
--zaui-aide-text : #909090;
|
|
@@ -50,7 +50,10 @@ var Group = function Group(props) {
|
|
|
50
50
|
}
|
|
51
51
|
return (0, _jsxRuntime.jsx)("div", {
|
|
52
52
|
id: id,
|
|
53
|
-
className: (0, _classnames.default)(
|
|
53
|
+
className: (0, _classnames.default)({
|
|
54
|
+
'pro-enum-group-root': true,
|
|
55
|
+
'pro-enum-group-root-disabled': disabled
|
|
56
|
+
}),
|
|
54
57
|
children: dataSource.map(function (item, index) {
|
|
55
58
|
return (0, _jsxRuntime.jsx)("div", {
|
|
56
59
|
onClick: function onClick() {
|
|
@@ -58,7 +61,12 @@ var Group = function Group(props) {
|
|
|
58
61
|
handleClick(item[fieldValue], index);
|
|
59
62
|
}
|
|
60
63
|
},
|
|
61
|
-
className: (0, _classnames.default)(
|
|
64
|
+
className: (0, _classnames.default)({
|
|
65
|
+
'pro-enum-group-item': true,
|
|
66
|
+
'pro-enum-group-item-selected': value === item[fieldValue],
|
|
67
|
+
'pro-enum-group-item-disabled-after': index === idx.current || index + 1 === idx.current,
|
|
68
|
+
'pro-enum-group-item-disabled': item.disabled
|
|
69
|
+
}),
|
|
62
70
|
children: item[fieldLabel]
|
|
63
71
|
}, item[fieldValue]);
|
|
64
72
|
})
|
|
@@ -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
|
}
|
|
@@ -611,32 +611,37 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
611
611
|
}
|
|
612
612
|
}, [onOff, visible, value]);
|
|
613
613
|
(0, _react.useEffect)(function () {
|
|
614
|
-
if (value && !visible && isInit) {
|
|
615
|
-
|
|
616
|
-
// 加定时器 修复依赖数据同步更新未取到问题
|
|
617
|
-
setTimeout(function () {
|
|
618
|
-
var _useRequest$options7, _useRequest$options8;
|
|
619
|
-
var initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
|
620
|
-
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
|
621
|
-
var _contentForm$getField2;
|
|
622
|
-
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));
|
|
623
|
-
}
|
|
624
|
-
var params = withPagination ? {
|
|
625
|
-
pageNum: 1,
|
|
626
|
-
pageSize: 50,
|
|
627
|
-
queryBean: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.defaultParams), initParams)
|
|
628
|
-
} : (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options8 = useRequest.options) === null || _useRequest$options8 === void 0 ? void 0 : _useRequest$options8.defaultParams), initParams);
|
|
629
|
-
var nextParams = transformParams ? transformParams(params) : params;
|
|
630
|
-
run(nextParams);
|
|
631
|
-
setState({
|
|
632
|
-
isInit: false
|
|
633
|
-
});
|
|
634
|
-
}, 300);
|
|
635
|
-
} else {
|
|
636
|
-
getInitValues();
|
|
637
|
-
}
|
|
614
|
+
if (value && !visible && isInit && !readOnly) {
|
|
615
|
+
getInitValues();
|
|
638
616
|
}
|
|
639
617
|
}, [value, visible, isInit, useRequest]);
|
|
618
|
+
(0, _react.useEffect)(function () {
|
|
619
|
+
if (value && !visible && readOnly) {
|
|
620
|
+
var _options$some;
|
|
621
|
+
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) {
|
|
622
|
+
return item[valueKey] === value;
|
|
623
|
+
});
|
|
624
|
+
if (isHasValue) {
|
|
625
|
+
return;
|
|
626
|
+
}
|
|
627
|
+
// 加定时器 修复依赖数据同步更新未取到问题
|
|
628
|
+
setTimeout(function () {
|
|
629
|
+
var _useRequest$options7, _useRequest$options8;
|
|
630
|
+
var initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
|
631
|
+
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
|
632
|
+
var _contentForm$getField2;
|
|
633
|
+
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));
|
|
634
|
+
}
|
|
635
|
+
var params = withPagination ? {
|
|
636
|
+
pageNum: 1,
|
|
637
|
+
pageSize: 50,
|
|
638
|
+
queryBean: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.defaultParams), initParams)
|
|
639
|
+
} : (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options8 = useRequest.options) === null || _useRequest$options8 === void 0 ? void 0 : _useRequest$options8.defaultParams), initParams);
|
|
640
|
+
var nextParams = transformParams ? transformParams(params) : params;
|
|
641
|
+
run(nextParams);
|
|
642
|
+
}, 300);
|
|
643
|
+
}
|
|
644
|
+
}, [value, options, visible, useRequest]);
|
|
640
645
|
(0, _react.useEffect)(function () {
|
|
641
646
|
if (!value) {
|
|
642
647
|
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节点
|
|
@@ -17,7 +17,12 @@ var _RenderColumn = _interopRequireDefault(require("../RenderColumn"));
|
|
|
17
17
|
var _utils2 = require("../../utils");
|
|
18
18
|
var _getEnumLabel = _interopRequireDefault(require("../../../ProEnum/utils/getEnumLabel"));
|
|
19
19
|
var _ProForm = _interopRequireDefault(require("../../../ProForm"));
|
|
20
|
-
var formatColumn = exports.formatColumn = function formatColumn(
|
|
20
|
+
var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
21
|
+
var column = _ref.column,
|
|
22
|
+
originalObj = _ref.originalObj,
|
|
23
|
+
dataSourceObj = _ref.dataSourceObj,
|
|
24
|
+
rowKey = _ref.rowKey,
|
|
25
|
+
diffToolTip = _ref.diffToolTip;
|
|
21
26
|
var title = column.title,
|
|
22
27
|
valueType = column.valueType,
|
|
23
28
|
_column$format = column.format,
|
|
@@ -37,6 +42,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
|
|
|
37
42
|
originalDiffTip = _column$originalDiffT === void 0 ? true : _column$originalDiffT,
|
|
38
43
|
_column$toolTipProps = column.toolTipProps,
|
|
39
44
|
toolTipProps = _column$toolTipProps === void 0 ? {} : _column$toolTipProps;
|
|
45
|
+
var _originalDiffTip = diffToolTip !== null && diffToolTip !== void 0 ? diffToolTip : originalDiffTip;
|
|
40
46
|
// 前缀处理
|
|
41
47
|
var prefixNode = function prefixNode(value, record, index) {
|
|
42
48
|
if (!prefix) {
|
|
@@ -104,7 +110,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
|
|
|
104
110
|
node: node,
|
|
105
111
|
value: value,
|
|
106
112
|
currentValue: renderValue,
|
|
107
|
-
originalDiffTip:
|
|
113
|
+
originalDiffTip: _originalDiffTip,
|
|
108
114
|
toolTipProps: toolTipProps
|
|
109
115
|
});
|
|
110
116
|
};
|
|
@@ -134,7 +140,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
|
|
|
134
140
|
node: node,
|
|
135
141
|
value: value,
|
|
136
142
|
currentValue: renderValue,
|
|
137
|
-
originalDiffTip:
|
|
143
|
+
originalDiffTip: _originalDiffTip,
|
|
138
144
|
toolTipProps: toolTipProps
|
|
139
145
|
});
|
|
140
146
|
};
|
|
@@ -187,7 +193,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
|
|
|
187
193
|
node: node,
|
|
188
194
|
value: value,
|
|
189
195
|
currentValue: renderValue,
|
|
190
|
-
originalDiffTip:
|
|
196
|
+
originalDiffTip: _originalDiffTip,
|
|
191
197
|
toolTipProps: toolTipProps
|
|
192
198
|
});
|
|
193
199
|
};
|
|
@@ -225,7 +231,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
|
|
|
225
231
|
node: node,
|
|
226
232
|
value: value,
|
|
227
233
|
currentValue: renderValue,
|
|
228
|
-
originalDiffTip:
|
|
234
|
+
originalDiffTip: _originalDiffTip,
|
|
229
235
|
toolTipProps: toolTipProps
|
|
230
236
|
});
|
|
231
237
|
};
|
|
@@ -252,7 +258,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
|
|
|
252
258
|
node: node,
|
|
253
259
|
value: value,
|
|
254
260
|
currentValue: renderValue,
|
|
255
|
-
originalDiffTip:
|
|
261
|
+
originalDiffTip: _originalDiffTip,
|
|
256
262
|
toolTipProps: toolTipProps
|
|
257
263
|
});
|
|
258
264
|
};
|
|
@@ -329,7 +335,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
|
|
|
329
335
|
node: value,
|
|
330
336
|
value: value,
|
|
331
337
|
currentValue: value || '-',
|
|
332
|
-
originalDiffTip:
|
|
338
|
+
originalDiffTip: _originalDiffTip,
|
|
333
339
|
toolTipProps: toolTipProps
|
|
334
340
|
}), suffixNode(value, record, index)]
|
|
335
341
|
});
|
|
@@ -352,7 +358,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
|
|
|
352
358
|
node: node,
|
|
353
359
|
value: value,
|
|
354
360
|
currentValue: value || '-',
|
|
355
|
-
originalDiffTip:
|
|
361
|
+
originalDiffTip: _originalDiffTip,
|
|
356
362
|
toolTipProps: toolTipProps
|
|
357
363
|
});
|
|
358
364
|
};
|
package/lib/ProTable/index.js
CHANGED
|
@@ -27,7 +27,7 @@ var _reset = _interopRequireDefault(require("../assets/reset.svg"));
|
|
|
27
27
|
var _customColumn = _interopRequireDefault(require("../assets/customColumn.svg"));
|
|
28
28
|
var _utils = require("./utils");
|
|
29
29
|
var _locale = _interopRequireDefault(require("../locale"));
|
|
30
|
-
var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stripe", "columns", "className", "draggable", "disabled", "isView", "rowDisabled", "summary", "emptyText", "
|
|
30
|
+
var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stripe", "columns", "className", "draggable", "disabled", "isView", "rowDisabled", "summary", "emptyText", "diffConfig", "onDragStart", "onDragEnd"],
|
|
31
31
|
_excluded2 = ["resizeColumn", "columnConfig", "cacheTime", "storage"];
|
|
32
32
|
var defaultCacheTime = 1; // columns 配置保存时间为一天
|
|
33
33
|
// 全局上下文
|
|
@@ -59,10 +59,15 @@ function ProTable(props) {
|
|
|
59
59
|
summary = props.summary,
|
|
60
60
|
_props$emptyText = props.emptyText,
|
|
61
61
|
emptyText = _props$emptyText === void 0 ? _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable = _locale.default.ProTable) === null || _locale$ProTable === void 0 ? void 0 : _locale$ProTable.noData : _props$emptyText,
|
|
62
|
-
|
|
62
|
+
diffConfig = props.diffConfig,
|
|
63
63
|
onDragStartGuard = props.onDragStart,
|
|
64
64
|
onDragEndGuard = props.onDragEnd,
|
|
65
65
|
restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
66
|
+
var _ref3 = diffConfig || {},
|
|
67
|
+
originalDataSource = _ref3.originalDataSource,
|
|
68
|
+
changeTipColor = _ref3.changeTipColor,
|
|
69
|
+
addTipColor = _ref3.addTipColor,
|
|
70
|
+
toolTip = _ref3.toolTip;
|
|
66
71
|
var quickTableConfig = quickConfig ? (0, _objectSpread4.default)({
|
|
67
72
|
columnConfig: true,
|
|
68
73
|
cacheTime: true
|
|
@@ -78,10 +83,10 @@ function ProTable(props) {
|
|
|
78
83
|
_quickTableConfig$sto = quickTableConfig.storage,
|
|
79
84
|
storage = _quickTableConfig$sto === void 0 ? configStorage : _quickTableConfig$sto,
|
|
80
85
|
tableProps = (0, _objectWithoutProperties2.default)(quickTableConfig, _excluded2);
|
|
81
|
-
var
|
|
82
|
-
pagination =
|
|
83
|
-
dataSource =
|
|
84
|
-
rowKey =
|
|
86
|
+
var _ref4 = tableProps || {},
|
|
87
|
+
pagination = _ref4.pagination,
|
|
88
|
+
dataSource = _ref4.dataSource,
|
|
89
|
+
rowKey = _ref4.rowKey;
|
|
85
90
|
var initDataSource = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
86
91
|
return (0, _objectSpread4.default)((0, _objectSpread4.default)({}, item), {}, {
|
|
87
92
|
rowKey: (0, _utils.getRowKey)(rowKey, item)
|
|
@@ -164,8 +169,8 @@ function ProTable(props) {
|
|
|
164
169
|
};
|
|
165
170
|
// 列宽resize函数
|
|
166
171
|
var handleResize = function handleResize(index) {
|
|
167
|
-
return function (e,
|
|
168
|
-
var size =
|
|
172
|
+
return function (e, _ref5) {
|
|
173
|
+
var size = _ref5.size;
|
|
169
174
|
var nextColumns = (0, _toConsumableArray2.default)(curColumns);
|
|
170
175
|
nextColumns[index] = (0, _objectSpread4.default)((0, _objectSpread4.default)({}, nextColumns[index]), {}, {
|
|
171
176
|
width: size.width
|
|
@@ -195,7 +200,13 @@ function ProTable(props) {
|
|
|
195
200
|
return !(item === null || item === void 0 ? void 0 : item.delete);
|
|
196
201
|
});
|
|
197
202
|
newColumns === null || newColumns === void 0 ? void 0 : newColumns.forEach(function (item) {
|
|
198
|
-
(0, _FormatColumn.formatColumn)(
|
|
203
|
+
(0, _FormatColumn.formatColumn)({
|
|
204
|
+
column: item,
|
|
205
|
+
originalObj: originalObj,
|
|
206
|
+
dataSourceObj: dataSourceObj,
|
|
207
|
+
rowKey: 'rowKey',
|
|
208
|
+
diffToolTip: toolTip
|
|
209
|
+
});
|
|
199
210
|
});
|
|
200
211
|
return newColumns;
|
|
201
212
|
}, [curColumns, handleResize]);
|
|
@@ -212,7 +223,7 @@ function ProTable(props) {
|
|
|
212
223
|
});
|
|
213
224
|
}, [columns]);
|
|
214
225
|
var handleColumnConfig = /*#__PURE__*/function () {
|
|
215
|
-
var
|
|
226
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(checkList) {
|
|
216
227
|
var newColumns, _columnConfig$onColum, catchColumns;
|
|
217
228
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
218
229
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -248,7 +259,7 @@ function ProTable(props) {
|
|
|
248
259
|
}, _callee);
|
|
249
260
|
}));
|
|
250
261
|
return function handleColumnConfig(_x) {
|
|
251
|
-
return
|
|
262
|
+
return _ref6.apply(this, arguments);
|
|
252
263
|
};
|
|
253
264
|
}();
|
|
254
265
|
(0, _ahooks.useDebounceEffect)(function () {
|
|
@@ -321,7 +332,7 @@ function ProTable(props) {
|
|
|
321
332
|
return _rowSelection;
|
|
322
333
|
};
|
|
323
334
|
var onDataSourceChange = /*#__PURE__*/function () {
|
|
324
|
-
var
|
|
335
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(nextDataSource) {
|
|
325
336
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
326
337
|
while (1) switch (_context2.prev = _context2.next) {
|
|
327
338
|
case 0:
|
|
@@ -337,7 +348,7 @@ function ProTable(props) {
|
|
|
337
348
|
}, _callee2);
|
|
338
349
|
}));
|
|
339
350
|
return function onDataSourceChange(_x2) {
|
|
340
|
-
return
|
|
351
|
+
return _ref7.apply(this, arguments);
|
|
341
352
|
};
|
|
342
353
|
}();
|
|
343
354
|
var _rowClassName = function _rowClassName(record, index) {
|
|
@@ -346,6 +357,11 @@ function ProTable(props) {
|
|
|
346
357
|
}
|
|
347
358
|
};
|
|
348
359
|
var TableComponent = draggable ? _RcTable.DraggableTable : _RcTable.BaseTable;
|
|
360
|
+
// 标记样式
|
|
361
|
+
var tagStyle = {
|
|
362
|
+
'--zaui-contract-bg': changeTipColor,
|
|
363
|
+
'--zaui-contract-bg-add': addTipColor
|
|
364
|
+
};
|
|
349
365
|
return (0, _jsxRuntime.jsx)(TableContext.Provider, {
|
|
350
366
|
value: {
|
|
351
367
|
pathKey: pathKey,
|
|
@@ -369,6 +385,7 @@ function ProTable(props) {
|
|
|
369
385
|
}
|
|
370
386
|
}), (0, _jsxRuntime.jsxs)("div", {
|
|
371
387
|
className: "pro-table-container",
|
|
388
|
+
style: tagStyle,
|
|
372
389
|
children: [(0, _jsxRuntime.jsx)(TableComponent, (0, _objectSpread4.default)((0, _objectSpread4.default)({}, restProps), {}, {
|
|
373
390
|
draggableProps: {
|
|
374
391
|
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,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _react = require("react");
|
|
12
|
+
/*
|
|
13
|
+
* @Author: za-xuwenli xuwenli@zhongan.io
|
|
14
|
+
* @Date: 2024-09-20 10:26:04
|
|
15
|
+
* @LastEditors: za-xuwenli xuwenli@zhongan.io
|
|
16
|
+
* @LastEditTime: 2024-09-26 14:12:44
|
|
17
|
+
* @FilePath: /za-material-warehouse/src/ProTree/components/AdaptiveTooltip.tsx
|
|
18
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
var AdaptiveTooltip = function AdaptiveTooltip(_ref) {
|
|
22
|
+
var children = _ref.children;
|
|
23
|
+
var _useState = (0, _react.useState)('right'),
|
|
24
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
25
|
+
placement = _useState2[0],
|
|
26
|
+
setPlacement = _useState2[1];
|
|
27
|
+
(0, _react.useEffect)(function () {
|
|
28
|
+
var handleResize = function handleResize() {
|
|
29
|
+
var tooltipElement = document.getElementById('adaptive-tooltip');
|
|
30
|
+
if (tooltipElement) {
|
|
31
|
+
var boundingRect = tooltipElement.getBoundingClientRect();
|
|
32
|
+
var windowWidth = window.innerWidth;
|
|
33
|
+
if (windowWidth - boundingRect.right < 150) {
|
|
34
|
+
setPlacement('left');
|
|
35
|
+
} else {
|
|
36
|
+
setPlacement('right');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
window.addEventListener('resize', handleResize);
|
|
41
|
+
handleResize();
|
|
42
|
+
return function () {
|
|
43
|
+
window.removeEventListener('resize', handleResize);
|
|
44
|
+
};
|
|
45
|
+
}, [children]);
|
|
46
|
+
return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
47
|
+
placement: placement,
|
|
48
|
+
title: (0, _jsxRuntime.jsx)("div", {
|
|
49
|
+
onMouseDown: function onMouseDown(e) {
|
|
50
|
+
return e.stopPropagation();
|
|
51
|
+
},
|
|
52
|
+
children: children
|
|
53
|
+
}),
|
|
54
|
+
id: "adaptive-tooltip",
|
|
55
|
+
children: (0, _jsxRuntime.jsxs)("span", {
|
|
56
|
+
className: "pro-tree-wrap-ellipse",
|
|
57
|
+
children: [" ", children]
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
var _default = exports.default = AdaptiveTooltip;
|
|
@@ -5,11 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
8
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
11
|
var _react = require("react");
|
|
10
12
|
var _antd = require("antd");
|
|
11
13
|
var _SearchTitle = _interopRequireDefault(require("./SearchTitle"));
|
|
12
14
|
var _CloseIcon = _interopRequireDefault(require("./CloseIcon"));
|
|
15
|
+
var _excluded = ["checkedValues", "disabled", "treeData", "searchStr", "showCodeName", "mode", "fieldNames", "handleOnChange", "handleFilterClose", "optionRender"];
|
|
16
|
+
/*
|
|
17
|
+
* @Author: za-xuwenli xuwenli@zhongan.io
|
|
18
|
+
* @Date: 2024-07-03 11:02:19
|
|
19
|
+
* @LastEditors: za-xuwenli xuwenli@zhongan.io
|
|
20
|
+
* @LastEditTime: 2024-09-26 14:30:26
|
|
21
|
+
* @FilePath: /za-material-warehouse/src/ProTree/components/List.tsx
|
|
22
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
23
|
+
*/
|
|
13
24
|
function List(props) {
|
|
14
25
|
var checkedValues = props.checkedValues,
|
|
15
26
|
disabled = props.disabled,
|
|
@@ -21,7 +32,8 @@ function List(props) {
|
|
|
21
32
|
fieldNames = props.fieldNames,
|
|
22
33
|
handleOnChange = props.handleOnChange,
|
|
23
34
|
handleFilterClose = props.handleFilterClose,
|
|
24
|
-
optionRender = props.optionRender
|
|
35
|
+
optionRender = props.optionRender,
|
|
36
|
+
other = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
25
37
|
var fieldNameLabel = fieldNames.label;
|
|
26
38
|
var fieldNameValue = fieldNames.value;
|
|
27
39
|
if (mode === 'render') {
|
|
@@ -43,10 +55,10 @@ function List(props) {
|
|
|
43
55
|
value: item[fieldNameValue],
|
|
44
56
|
disabled: item.disabled,
|
|
45
57
|
children: (0, _jsxRuntime.jsx)("span", {
|
|
46
|
-
children: optionRender ? optionRender(item, searchStr) : (0, _jsxRuntime.jsx)(_SearchTitle.default, {
|
|
58
|
+
children: optionRender ? optionRender(item, searchStr) : (0, _jsxRuntime.jsx)(_SearchTitle.default, (0, _objectSpread2.default)({
|
|
47
59
|
label: title,
|
|
48
60
|
searchStr: searchStr
|
|
49
|
-
})
|
|
61
|
+
}, other))
|
|
50
62
|
})
|
|
51
63
|
})
|
|
52
64
|
}, item[fieldNameValue]);
|
|
@@ -17,6 +17,7 @@ var _react = require("react");
|
|
|
17
17
|
var _lodash = require("lodash");
|
|
18
18
|
var _ProConfigProvider = require("../../../ProConfigProvider");
|
|
19
19
|
var _Container = _interopRequireDefault(require("../../../ProForm/components/Container"));
|
|
20
|
+
var _AdaptiveTooltip = _interopRequireDefault(require("../AdaptiveTooltip"));
|
|
20
21
|
var _excluded = ["disabled", "code", "dataSource", "defaultDisableValue", "onChange", "useRequest", "transformResponse", "fieldNames", "tooltip", "showSearch", "filterTreeNode", "treeNodeFilterProp", "defaultExpandAll", "expandedKeys", "treeCheckable", "onSearch", "otherProps", "width", "dropdownStyle", "popupClassName", "style", "allowClear", "listHeight", "showCodeName", "className", "checkStrictly", "checkable"],
|
|
21
22
|
_excluded2 = ["children"];
|
|
22
23
|
/* eslint-disable react/no-danger */
|
|
@@ -74,6 +75,11 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
74
75
|
selectProps = (0, _objectWithoutProperties2.default)(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 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
312
318
|
children: (0, _jsxRuntime.jsx)(Icon, {})
|
|
313
319
|
}) : null]
|
|
314
320
|
});
|
|
321
|
+
if (_showEllipse) {
|
|
322
|
+
title = (0, _jsxRuntime.jsx)(_AdaptiveTooltip.default, {
|
|
323
|
+
children: treeCheckable ? titleHtml : (0, _jsxRuntime.jsxs)("span", {
|
|
324
|
+
className: "check-option-text",
|
|
325
|
+
children: [(0, _jsxRuntime.jsx)("span", {
|
|
326
|
+
className: "check-option-text-content",
|
|
327
|
+
children: titleHtml
|
|
328
|
+
}), !disabled ? (0, _jsxRuntime.jsx)("span", {
|
|
329
|
+
className: "check-mark-icon",
|
|
330
|
+
children: (0, _jsxRuntime.jsx)(Icon, {})
|
|
331
|
+
}) : null]
|
|
332
|
+
})
|
|
333
|
+
});
|
|
334
|
+
}
|
|
315
335
|
if (!children) {
|
|
316
336
|
return (0, _jsxRuntime.jsx)(_antd.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,18 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = void 0;
|
|
7
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
9
|
var _react = require("react");
|
|
9
|
-
var
|
|
10
|
+
var _AdaptiveTooltip = _interopRequireDefault(require("./AdaptiveTooltip"));
|
|
10
11
|
function SearchTitle(props) {
|
|
11
12
|
var label = props.label,
|
|
12
13
|
_props$searchStr = props.searchStr,
|
|
13
14
|
searchStr = _props$searchStr === void 0 ? '' : _props$searchStr,
|
|
14
15
|
showEllipse = props.showEllipse,
|
|
15
|
-
ellipseWidth = props.ellipseWidth
|
|
16
|
+
ellipseWidth = props.ellipseWidth,
|
|
17
|
+
_props$isDiffChange = props.isDiffChange,
|
|
18
|
+
isDiffChange = _props$isDiffChange === void 0 ? false : _props$isDiffChange;
|
|
16
19
|
var strTitle = label;
|
|
17
20
|
var index = strTitle === null || strTitle === void 0 ? void 0 : strTitle.indexOf(searchStr);
|
|
18
21
|
var beforeStr = strTitle === null || strTitle === void 0 ? void 0 : strTitle.substring(0, index);
|
|
@@ -45,11 +48,9 @@ function SearchTitle(props) {
|
|
|
45
48
|
style: style,
|
|
46
49
|
children: strTitle
|
|
47
50
|
});
|
|
48
|
-
if (classEllipse) {
|
|
49
|
-
return (0, _jsxRuntime.jsx)(
|
|
50
|
-
|
|
51
|
-
placement: "rightTop",
|
|
52
|
-
children: title
|
|
51
|
+
if (classEllipse && !isDiffChange) {
|
|
52
|
+
return (0, _jsxRuntime.jsx)(_AdaptiveTooltip.default, {
|
|
53
|
+
children: titleTips
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
return title;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
@root-entry-name: 'default';
|
|
2
2
|
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
3
|
|
|
4
|
+
.pro-tree-wrap-ellipse {
|
|
5
|
+
display: block;
|
|
6
|
+
width: 100%;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
white-space: nowrap;
|
|
9
|
+
text-overflow: ellipsis;
|
|
10
|
+
word-break: keep-all;
|
|
11
|
+
}
|
|
12
|
+
|
|
4
13
|
.pro-tree {
|
|
5
14
|
height: 100%; // tree auto css
|
|
6
15
|
.@{ant-prefix}-tree-iconEle{
|
|
@@ -368,3 +377,8 @@
|
|
|
368
377
|
}
|
|
369
378
|
|
|
370
379
|
|
|
380
|
+
.@{ant-prefix}-select-tree-node-content-wrapper {
|
|
381
|
+
&:has(.pro-tree-wrap-ellipse){
|
|
382
|
+
overflow: hidden;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
--zaui-brand : #006aff;
|
|
9
9
|
--zaui-brand-hover : #3387ff;
|
|
10
10
|
--zaui-brand-active : #005ad9;
|
|
11
|
-
--zaui-brand-disabled :
|
|
11
|
+
--zaui-brand-disabled : color-mix(in srgb, var(--zaui-brand) 70%, white);
|
|
12
12
|
--zaui-text : #343434;
|
|
13
13
|
--zaui-text-weak : #616161;
|
|
14
14
|
--zaui-aide-text : #909090;
|