@zat-design/sisyphus-react 3.8.3-beta.1 → 3.8.3-beta.12
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 +16 -0
- package/dist/less.esm.css +16 -0
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +21 -7
- package/es/ProEditTable/components/RenderField/index.js +8 -1
- package/es/ProEditTable/index.js +14 -7
- package/es/ProEditTable/propsType.d.ts +0 -6
- package/es/ProEditTable/utils/index.js +10 -3
- package/es/ProForm/components/base/InputNumber/index.js +1 -1
- package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +2 -0
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +4 -2
- package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +2 -0
- package/es/ProForm/components/combination/FormList/components/LineFields.js +4 -2
- package/es/ProForm/components/combination/FormList/index.js +14 -3
- package/es/ProForm/components/combination/ProCascader/index.js +20 -13
- package/es/ProForm/components/combination/ProModalSelect/index.js +17 -3
- package/es/ProForm/components/render/ChangedWrapper.js +14 -2
- package/es/ProForm/components/render/Render.js +3 -1
- package/es/ProForm/components/render/RenderFields.js +4 -2
- package/es/ProForm/propsType.d.ts +1 -0
- package/es/ProForm/style/index.less +7 -0
- package/es/ProForm/utils/diffOriginal.js +14 -2
- package/es/ProForm/utils/useShouldUpdate.js +1 -9
- package/es/ProTable/components/FormatColumn/index.d.ts +2 -1
- package/es/ProTable/components/FormatColumn/index.js +61 -21
- package/es/ProTable/components/RenderColumn/index.d.ts +1 -0
- package/es/ProTable/components/RenderColumn/index.js +7 -4
- package/es/ProTable/index.js +8 -7
- package/es/ProTable/propsType.d.ts +4 -0
- package/es/ProTable/style/index.less +14 -0
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +20 -6
- package/lib/ProEditTable/components/RenderField/index.js +8 -1
- package/lib/ProEditTable/index.js +14 -7
- package/lib/ProEditTable/propsType.d.ts +0 -6
- package/lib/ProEditTable/utils/index.js +10 -3
- package/lib/ProForm/components/base/InputNumber/index.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +2 -0
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +4 -2
- package/lib/ProForm/components/combination/FormList/components/LineFields.d.ts +2 -0
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +4 -2
- package/lib/ProForm/components/combination/FormList/index.js +14 -3
- package/lib/ProForm/components/combination/ProCascader/index.js +20 -13
- package/lib/ProForm/components/combination/ProModalSelect/index.js +17 -3
- package/lib/ProForm/components/render/ChangedWrapper.js +14 -2
- package/lib/ProForm/components/render/Render.js +3 -1
- package/lib/ProForm/components/render/RenderFields.js +4 -2
- package/lib/ProForm/propsType.d.ts +1 -0
- package/lib/ProForm/style/index.less +7 -0
- package/lib/ProForm/utils/diffOriginal.js +13 -1
- package/lib/ProForm/utils/useShouldUpdate.js +1 -9
- package/lib/ProTable/components/FormatColumn/index.d.ts +2 -1
- package/lib/ProTable/components/FormatColumn/index.js +61 -21
- package/lib/ProTable/components/RenderColumn/index.d.ts +1 -0
- package/lib/ProTable/components/RenderColumn/index.js +6 -3
- package/lib/ProTable/index.js +8 -7
- package/lib/ProTable/propsType.d.ts +4 -0
- package/lib/ProTable/style/index.less +14 -0
- package/package.json +1 -1
- package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +0 -241
- package/coverage/lcov-report/src/.umi/core/history.ts.html +0 -148
- package/coverage/lcov-report/src/.umi/core/index.html +0 -206
- package/coverage/lcov-report/src/.umi/core/plugin.ts.html +0 -109
- package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +0 -160
- package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +0 -97
- package/coverage/lcov-report/src/.umi/core/routes.ts.html +0 -26050
- package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +0 -112
- package/coverage/lcov-report/src/.umi/dumi/demos/index.html +0 -116
- package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +0 -6340
- package/coverage/lcov-report/src/.umi/dumi/index.html +0 -116
- package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +0 -109
- package/coverage/lcov-report/src/.umi/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-antd/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +0 -172
- package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +0 -94
- package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +0 -196
- package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +0 -106
- package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +0 -146
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +0 -88
- package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +0 -124
- package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +0 -1246
- package/coverage/lcov-report/src/.umi/plugin-locale/index.html +0 -161
- package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +0 -268
- package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +0 -778
- package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +0 -115
- package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +0 -202
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +0 -97
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +0 -142
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +0 -334
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +0 -146
- package/coverage/lcov-report/src/.umi/plugin-model/index.html +0 -146
- package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +0 -121
- package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +0 -298
- package/coverage/lcov-report/src/.umi/plugin-request/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +0 -919
- package/coverage/lcov-report/src/.umi/umi.ts.html +0 -268
|
@@ -329,6 +329,9 @@
|
|
|
329
329
|
border-radius: 4px;
|
|
330
330
|
background: @zaui-contract-bg !important;
|
|
331
331
|
|
|
332
|
+
.@{ant-prefix}-input {
|
|
333
|
+
background: @zaui-contract-bg !important;
|
|
334
|
+
}
|
|
332
335
|
.@{ant-prefix}-select.@{ant-prefix}-select-disabled .@{ant-prefix}-select-selector{
|
|
333
336
|
background: @zaui-contract-bg !important;
|
|
334
337
|
}
|
|
@@ -403,6 +406,10 @@
|
|
|
403
406
|
border-radius: 4px;
|
|
404
407
|
background: @zaui-contract-bg-add !important;
|
|
405
408
|
|
|
409
|
+
.@{ant-prefix}-input {
|
|
410
|
+
background: @zaui-contract-bg !important;
|
|
411
|
+
}
|
|
412
|
+
|
|
406
413
|
.@{ant-prefix}-select.@{ant-prefix}-select-disabled .@{ant-prefix}-select-selector{
|
|
407
414
|
background: @zaui-contract-bg-add !important;
|
|
408
415
|
}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
import { isEqual, isFunction } from 'lodash';
|
|
1
|
+
import { isEqual, isFunction, isObject } from 'lodash';
|
|
2
2
|
import { isEmpty } from '../../utils';
|
|
3
|
+
// 过滤对象中undefined字段
|
|
4
|
+
// 防止{a: '1'} {a: '1', b: undefined}被认为不相等
|
|
5
|
+
var filterUndefined = function filterUndefined(data) {
|
|
6
|
+
if (!isObject(data) || Array.isArray(data) || data === null) return data;
|
|
7
|
+
var resData = {};
|
|
8
|
+
Object.keys(data).forEach(function (key) {
|
|
9
|
+
if (data[key] !== undefined) {
|
|
10
|
+
resData[key] = data[key];
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
return resData;
|
|
14
|
+
};
|
|
3
15
|
var nullValue = [null, undefined, '']; // 输入框空值时可能存在的三种值 视为相等
|
|
4
16
|
export var diffOriginal = function diffOriginal(params) {
|
|
5
17
|
var originalValue = params.originalValue,
|
|
@@ -29,7 +41,7 @@ export var diffOriginal = function diffOriginal(params) {
|
|
|
29
41
|
return isSame ? 'same' : 'changed';
|
|
30
42
|
}
|
|
31
43
|
if (!nullValue.includes(value) || !nullValue.includes(originalValue)) {
|
|
32
|
-
return isEqual(value, originalValue) ? 'same' : 'changed';
|
|
44
|
+
return isEqual(filterUndefined(value), filterUndefined(originalValue)) ? 'same' : 'changed';
|
|
33
45
|
}
|
|
34
46
|
return 'same';
|
|
35
47
|
};
|
|
@@ -163,9 +163,6 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
163
163
|
index: index,
|
|
164
164
|
namePath: namePath
|
|
165
165
|
}) : rules;
|
|
166
|
-
// const _component = isFunction(originComponent)
|
|
167
|
-
// ? originComponent(_currentValues, { form, index, namePath })
|
|
168
|
-
// : newComponent;
|
|
169
166
|
var _fieldProps = isFunction(fieldProps) ? fieldProps(_currentValues, {
|
|
170
167
|
form: form,
|
|
171
168
|
index: index,
|
|
@@ -196,17 +193,12 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
196
193
|
}
|
|
197
194
|
var equalRes = isEqualWith(rulesRef.current, _rules, customEqualForFun);
|
|
198
195
|
var proEqualRes = isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun);
|
|
199
|
-
if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes
|
|
200
|
-
// 值变更,需要同步更新函数式的fieldProps
|
|
201
|
-
// (isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun) && !isEqual(prevValues, currentValues)) ||
|
|
202
|
-
// !isEqualWith(originComponentRef.current, _component, customEqualForFun) ||
|
|
203
|
-
// equalDependencies(dependencies, prevValues, _currentValues)
|
|
196
|
+
if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes || (_fieldProps === null || _fieldProps === void 0 ? void 0 : _fieldProps.transformResponse) // 防止fieldProps变更时,transformResponse根据fieldProps新值无法触发更新
|
|
204
197
|
) {
|
|
205
198
|
showRef.current = _show;
|
|
206
199
|
disabledRef.current = _disabled;
|
|
207
200
|
requiredRef.current = _required;
|
|
208
201
|
rulesRef.current = _rules;
|
|
209
|
-
// originComponentRef.current = _component;
|
|
210
202
|
fieldPropsRef.current = _fieldProps;
|
|
211
203
|
reRender({});
|
|
212
204
|
return false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ProTableColumn } from '../../propsType';
|
|
3
|
-
export declare const formatColumn: ({ column, originalObj, dataSourceObj, rowKey, diffToolTip, wrapToolTipProps, scroll, onUpdateMinWidth, }: {
|
|
3
|
+
export declare const formatColumn: ({ column, originalObj, dataSourceObj, rowKey, diffToolTip, wrapToolTipProps, scroll, onUpdateMinWidth, isInNewRow, }: {
|
|
4
4
|
column: ProTableColumn;
|
|
5
5
|
originalObj: any;
|
|
6
6
|
dataSourceObj: any;
|
|
@@ -9,6 +9,7 @@ export declare const formatColumn: ({ column, originalObj, dataSourceObj, rowKey
|
|
|
9
9
|
wrapToolTipProps?: any;
|
|
10
10
|
scroll?: any;
|
|
11
11
|
onUpdateMinWidth?: any;
|
|
12
|
+
isInNewRow?: any;
|
|
12
13
|
}) => void;
|
|
13
14
|
/**
|
|
14
15
|
* 查找最近的父级className
|
|
@@ -51,7 +51,8 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
51
51
|
diffToolTip = _ref2.diffToolTip,
|
|
52
52
|
wrapToolTipProps = _ref2.wrapToolTipProps,
|
|
53
53
|
scroll = _ref2.scroll,
|
|
54
|
-
onUpdateMinWidth = _ref2.onUpdateMinWidth
|
|
54
|
+
onUpdateMinWidth = _ref2.onUpdateMinWidth,
|
|
55
|
+
isInNewRow = _ref2.isInNewRow;
|
|
55
56
|
var title = column.title,
|
|
56
57
|
valueType = column.valueType,
|
|
57
58
|
_column$format = column.format,
|
|
@@ -71,7 +72,8 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
71
72
|
originalDiffTip = _column$originalDiffT === void 0 ? true : _column$originalDiffT,
|
|
72
73
|
_column$toolTipProps = column.toolTipProps,
|
|
73
74
|
toolTipProps = _column$toolTipProps === void 0 ? {} : _column$toolTipProps,
|
|
74
|
-
minWidth = column.minWidth
|
|
75
|
+
minWidth = column.minWidth,
|
|
76
|
+
onDiff = column.onDiff;
|
|
75
77
|
// 仅在 {x: 'max-content', y: 300 } 且 column无指定 width minWidth 情况下 才开启 minWidth的自动计算
|
|
76
78
|
var isMaxContentOverFlow = isObject(scroll) ? (scroll === null || scroll === void 0 ? void 0 : scroll.x) === 'max-content' && Reflect.ownKeys(scroll).includes('y') : false;
|
|
77
79
|
calcMinWidth({
|
|
@@ -108,7 +110,7 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
108
110
|
}
|
|
109
111
|
};
|
|
110
112
|
if (column === null || column === void 0 ? void 0 : column.render) {
|
|
111
|
-
if (!originalObj && Object.keys(originalObj !== null && originalObj !== void 0 ? originalObj : {}).length === 0) {
|
|
113
|
+
if (!originalObj && Object.keys(originalObj !== null && originalObj !== void 0 ? originalObj : {}).length === 0 && !onDiff) {
|
|
112
114
|
return;
|
|
113
115
|
}
|
|
114
116
|
var originalRender = column.render; // 保存原始的 render 方法
|
|
@@ -116,12 +118,23 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
116
118
|
column.render = function (value, record, index) {
|
|
117
119
|
var _originalObj$record$r;
|
|
118
120
|
var isFn = isFunction(originalRender);
|
|
119
|
-
var _value = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(value, record !== null && record !== void 0 ? record : {}, index) :
|
|
121
|
+
var _value = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(value, record !== null && record !== void 0 ? record : {}, index) : null;
|
|
120
122
|
var originalValue = getOriginalValue(value, record !== null && record !== void 0 ? record : {}, originalObj, rowKey, dataIndex);
|
|
121
|
-
var originalRenderValue = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(originalValue, (_originalObj$record$r = originalObj === null || originalObj === void 0 ? void 0 : originalObj[record === null || record === void 0 ? void 0 : record[rowKey]]) !== null && _originalObj$record$r !== void 0 ? _originalObj$record$r : {}, index) :
|
|
123
|
+
var originalRenderValue = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(originalValue, (_originalObj$record$r = originalObj === null || originalObj === void 0 ? void 0 : originalObj[record === null || record === void 0 ? void 0 : record[rowKey]]) !== null && _originalObj$record$r !== void 0 ? _originalObj$record$r : {}, index) : null;
|
|
124
|
+
var isInNewRowFlag = isInNewRow(record);
|
|
125
|
+
// 把比对结果告诉我
|
|
126
|
+
if (onDiff) {
|
|
127
|
+
var isDiff = onDiff({
|
|
128
|
+
value: record,
|
|
129
|
+
originValue: originalObj === null || originalObj === void 0 ? void 0 : originalObj[record === null || record === void 0 ? void 0 : record[rowKey]]
|
|
130
|
+
});
|
|
131
|
+
if (!isDiff) {
|
|
132
|
+
originalValue = null;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
122
135
|
return _jsx(RenderColumn, {
|
|
123
136
|
valueType: valueType,
|
|
124
|
-
originalValue: originalValue
|
|
137
|
+
originalValue: !originalValue && originalValue !== 0 ? null : originalRenderValue,
|
|
125
138
|
ellipsis: ellipsis,
|
|
126
139
|
width: width,
|
|
127
140
|
value: _value,
|
|
@@ -129,7 +142,8 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
129
142
|
currentValue: _value,
|
|
130
143
|
originalDiffTip: _originalDiffTip,
|
|
131
144
|
toolTipProps: _toolTipProps,
|
|
132
|
-
minWidth: minWidth
|
|
145
|
+
minWidth: minWidth,
|
|
146
|
+
isInNewRowFlag: isInNewRowFlag
|
|
133
147
|
});
|
|
134
148
|
};
|
|
135
149
|
return;
|
|
@@ -171,6 +185,7 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
171
185
|
size: 8,
|
|
172
186
|
children: [prefixNode(value, record, index), renderValue, suffixNode(value, record, index)]
|
|
173
187
|
});
|
|
188
|
+
var isInNewRowFlag = isInNewRow(record);
|
|
174
189
|
return _jsx(RenderColumn, {
|
|
175
190
|
valueType: valueType,
|
|
176
191
|
originalValue: originalValue === undefined ? undefined : originalRenderValue,
|
|
@@ -181,7 +196,8 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
181
196
|
currentValue: renderValue,
|
|
182
197
|
originalDiffTip: _originalDiffTip,
|
|
183
198
|
toolTipProps: _toolTipProps,
|
|
184
|
-
minWidth: minWidth
|
|
199
|
+
minWidth: minWidth,
|
|
200
|
+
isInNewRowFlag: isInNewRowFlag
|
|
185
201
|
});
|
|
186
202
|
};
|
|
187
203
|
// 千分位, 千分位带CNY前缀
|
|
@@ -207,6 +223,7 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
207
223
|
children: "-"
|
|
208
224
|
});
|
|
209
225
|
}
|
|
226
|
+
var isInNewRowFlag = isInNewRow(record);
|
|
210
227
|
return _jsx(RenderColumn, {
|
|
211
228
|
valueType: valueType,
|
|
212
229
|
originalValue: originalValue === undefined ? undefined : originalRenderValue,
|
|
@@ -217,7 +234,8 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
217
234
|
currentValue: renderValue,
|
|
218
235
|
originalDiffTip: _originalDiffTip,
|
|
219
236
|
toolTipProps: _toolTipProps,
|
|
220
|
-
minWidth: minWidth
|
|
237
|
+
minWidth: minWidth,
|
|
238
|
+
isInNewRowFlag: isInNewRowFlag
|
|
221
239
|
});
|
|
222
240
|
};
|
|
223
241
|
} else if (['datePicker', 'date', 'dateTime', 'dateStartTime', 'dateEndTime', 'dateStartEndTime'].includes(valueType)) {
|
|
@@ -266,6 +284,7 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
266
284
|
children: "-"
|
|
267
285
|
});
|
|
268
286
|
}
|
|
287
|
+
var isInNewRowFlag = isInNewRow(record);
|
|
269
288
|
return _jsx(RenderColumn, {
|
|
270
289
|
valueType: valueType,
|
|
271
290
|
originalValue: originalValue === undefined ? undefined : originalRenderValue,
|
|
@@ -276,7 +295,8 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
276
295
|
currentValue: renderValue,
|
|
277
296
|
originalDiffTip: _originalDiffTip,
|
|
278
297
|
toolTipProps: _toolTipProps,
|
|
279
|
-
minWidth: minWidth
|
|
298
|
+
minWidth: minWidth,
|
|
299
|
+
isInNewRowFlag: isInNewRowFlag
|
|
280
300
|
});
|
|
281
301
|
};
|
|
282
302
|
} else if (['enumName', 'enumCodeName'].includes(valueType)) {
|
|
@@ -305,6 +325,7 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
305
325
|
size: 8,
|
|
306
326
|
children: [prefixNode(value, record, index), renderValue, suffixNode(value, record, index)]
|
|
307
327
|
});
|
|
328
|
+
var isInNewRowFlag = isInNewRow(record);
|
|
308
329
|
return _jsx(RenderColumn, {
|
|
309
330
|
valueType: valueType,
|
|
310
331
|
originalValue: originalValue === undefined ? undefined : originalRenderValue,
|
|
@@ -315,7 +336,8 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
315
336
|
currentValue: renderValue,
|
|
316
337
|
originalDiffTip: _originalDiffTip,
|
|
317
338
|
toolTipProps: _toolTipProps,
|
|
318
|
-
minWidth: minWidth
|
|
339
|
+
minWidth: minWidth,
|
|
340
|
+
isInNewRowFlag: isInNewRowFlag
|
|
319
341
|
});
|
|
320
342
|
};
|
|
321
343
|
} else if (precision || prefix || suffix) {
|
|
@@ -338,6 +360,7 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
338
360
|
children: "-"
|
|
339
361
|
});
|
|
340
362
|
}
|
|
363
|
+
var isInNewRowFlag = isInNewRow(record);
|
|
341
364
|
return _jsx(RenderColumn, {
|
|
342
365
|
valueType: valueType,
|
|
343
366
|
originalValue: originalValue === undefined ? undefined : originalRenderValue,
|
|
@@ -348,7 +371,8 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
348
371
|
currentValue: renderValue,
|
|
349
372
|
originalDiffTip: _originalDiffTip,
|
|
350
373
|
toolTipProps: _toolTipProps,
|
|
351
|
-
minWidth: minWidth
|
|
374
|
+
minWidth: minWidth,
|
|
375
|
+
isInNewRowFlag: isInNewRowFlag
|
|
352
376
|
});
|
|
353
377
|
};
|
|
354
378
|
} else if (valueType === 'address') {
|
|
@@ -384,21 +408,32 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
384
408
|
code: code,
|
|
385
409
|
value: originalRealValue
|
|
386
410
|
});
|
|
387
|
-
|
|
411
|
+
var renderNode = _jsx(ProForm.ProCascader, {
|
|
388
412
|
className: className,
|
|
389
413
|
isView: true,
|
|
390
414
|
mode: "address",
|
|
391
415
|
code: code,
|
|
392
416
|
value: realValue,
|
|
393
|
-
tooltip:
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
417
|
+
tooltip: false
|
|
418
|
+
});
|
|
419
|
+
var isInNewRowFlag = isInNewRow(record);
|
|
420
|
+
return _jsx(RenderColumn, {
|
|
421
|
+
valueType: valueType,
|
|
422
|
+
originalValue: originalRealValue === undefined ? undefined : originalRenderValue,
|
|
423
|
+
ellipsis: ellipsis !== null && ellipsis !== void 0 ? ellipsis : true,
|
|
424
|
+
width: width,
|
|
425
|
+
node: renderNode,
|
|
426
|
+
value: renderValue,
|
|
427
|
+
currentValue: renderValue,
|
|
428
|
+
originalDiffTip: _originalDiffTip,
|
|
429
|
+
toolTipProps: _toolTipProps,
|
|
430
|
+
minWidth: minWidth,
|
|
431
|
+
isInNewRowFlag: isInNewRowFlag
|
|
398
432
|
});
|
|
399
433
|
};
|
|
400
434
|
} else if (copyable) {
|
|
401
435
|
column.render = function (value, record, index) {
|
|
436
|
+
var isInNewRowFlag = isInNewRow(record);
|
|
402
437
|
return _jsxs(_Space, {
|
|
403
438
|
size: 8,
|
|
404
439
|
children: [prefixNode(value, record, index), _jsx(RenderColumn, {
|
|
@@ -410,7 +445,8 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
410
445
|
value: value,
|
|
411
446
|
currentValue: value,
|
|
412
447
|
toolTipProps: _toolTipProps,
|
|
413
|
-
minWidth: minWidth
|
|
448
|
+
minWidth: minWidth,
|
|
449
|
+
isInNewRowFlag: isInNewRowFlag
|
|
414
450
|
}), suffixNode(value, record, index)]
|
|
415
451
|
});
|
|
416
452
|
};
|
|
@@ -425,6 +461,7 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
425
461
|
children: "-"
|
|
426
462
|
});
|
|
427
463
|
}
|
|
464
|
+
var isInNewRowFlag = isInNewRow(record);
|
|
428
465
|
return _jsxs(_Space, {
|
|
429
466
|
size: 8,
|
|
430
467
|
children: [prefixNode(value, record, index), _jsx(RenderColumn, {
|
|
@@ -437,7 +474,8 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
437
474
|
currentValue: value || '-',
|
|
438
475
|
originalDiffTip: _originalDiffTip,
|
|
439
476
|
toolTipProps: _toolTipProps,
|
|
440
|
-
minWidth: minWidth
|
|
477
|
+
minWidth: minWidth,
|
|
478
|
+
isInNewRowFlag: isInNewRowFlag
|
|
441
479
|
}), suffixNode(value, record, index)]
|
|
442
480
|
});
|
|
443
481
|
};
|
|
@@ -456,6 +494,7 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
456
494
|
children: "-"
|
|
457
495
|
});
|
|
458
496
|
}
|
|
497
|
+
var isInNewRowFlag = isInNewRow(record);
|
|
459
498
|
return _jsx(RenderColumn, {
|
|
460
499
|
valueType: valueType,
|
|
461
500
|
originalValue: originalValue === undefined ? undefined : originalValue || '-',
|
|
@@ -466,7 +505,8 @@ export var formatColumn = function formatColumn(_ref2) {
|
|
|
466
505
|
currentValue: value || '-',
|
|
467
506
|
originalDiffTip: _originalDiffTip,
|
|
468
507
|
toolTipProps: _toolTipProps,
|
|
469
|
-
minWidth: minWidth
|
|
508
|
+
minWidth: minWidth,
|
|
509
|
+
isInNewRowFlag: isInNewRowFlag
|
|
470
510
|
});
|
|
471
511
|
};
|
|
472
512
|
}
|
|
@@ -4,7 +4,7 @@ import _Tooltip from "antd/es/tooltip";
|
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
5
|
import "antd/es/typography/style";
|
|
6
6
|
import _Typography from "antd/es/typography";
|
|
7
|
-
import { jsx as _jsx,
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
8
|
import { useSetState } from 'ahooks';
|
|
9
9
|
import { CheckOutlined } from '@ant-design/icons';
|
|
10
10
|
import { ReactSVG } from 'react-svg';
|
|
@@ -24,14 +24,15 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
24
24
|
originalDiffTip = props.originalDiffTip,
|
|
25
25
|
_props$toolTipProps = props.toolTipProps,
|
|
26
26
|
toolTipProps = _props$toolTipProps === void 0 ? {} : _props$toolTipProps,
|
|
27
|
-
minWidth = props.minWidth
|
|
27
|
+
minWidth = props.minWidth,
|
|
28
|
+
isInNewRowFlag = props.isInNewRowFlag;
|
|
28
29
|
var _useSetState = useSetState({
|
|
29
30
|
tooltip: false
|
|
30
31
|
}),
|
|
31
32
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
32
33
|
tooltip = _useSetState2[0].tooltip,
|
|
33
34
|
setState = _useSetState2[1];
|
|
34
|
-
if (originalValue
|
|
35
|
+
if ((originalValue || originalValue === 0) && !isInNewRowFlag) {
|
|
35
36
|
var renderNode = value ? node : '-';
|
|
36
37
|
if (ellipsis || originalDiffTip) {
|
|
37
38
|
if (ellipsis) {
|
|
@@ -53,7 +54,9 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
53
54
|
minWidth: minWidth
|
|
54
55
|
},
|
|
55
56
|
title: originalDiffTip ? _jsxs(_Fragment, {
|
|
56
|
-
children: ["\u521D\u59CB\u503C\uFF1A", originalValue, _jsx("br", {}), ellipsis ? "
|
|
57
|
+
children: ["\u521D\u59CB\u503C\uFF1A", originalValue, _jsx("br", {}), ellipsis ? _jsxs("span", {
|
|
58
|
+
children: ["\u5F53\u524D\u503C\uFF1A", currentValue]
|
|
59
|
+
}) : null]
|
|
57
60
|
}) : node,
|
|
58
61
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
59
62
|
return triggerNode.parentNode;
|
package/es/ProTable/index.js
CHANGED
|
@@ -183,6 +183,11 @@ function ProTable(props) {
|
|
|
183
183
|
setCurColumns(nextColumns);
|
|
184
184
|
};
|
|
185
185
|
};
|
|
186
|
+
var _rowClassName = function _rowClassName(record, index) {
|
|
187
|
+
if (originalDataSource && !originalObj.hasOwnProperty(get(record, 'rowKey'))) {
|
|
188
|
+
return 'new-cell';
|
|
189
|
+
}
|
|
190
|
+
};
|
|
186
191
|
var columns = useMemo(function () {
|
|
187
192
|
var newColumns = curColumns.map(function (item, index) {
|
|
188
193
|
var _propsColumnObj$getCo2;
|
|
@@ -215,11 +220,12 @@ function ProTable(props) {
|
|
|
215
220
|
scroll: _scroll,
|
|
216
221
|
onUpdateMinWidth: function onUpdateMinWidth(w) {
|
|
217
222
|
curColumns[index].minWidth = w;
|
|
218
|
-
}
|
|
223
|
+
},
|
|
224
|
+
isInNewRow: _rowClassName
|
|
219
225
|
});
|
|
220
226
|
});
|
|
221
227
|
return newColumns;
|
|
222
|
-
}, [curColumns, handleResize, _scroll]);
|
|
228
|
+
}, [curColumns, handleResize, _scroll, originalDataSource, originalObj, _rowClassName]);
|
|
223
229
|
var _columns = useMemo(function () {
|
|
224
230
|
return columns === null || columns === void 0 ? void 0 : columns.filter(function (item, index) {
|
|
225
231
|
var show = item.show;
|
|
@@ -368,11 +374,6 @@ function ProTable(props) {
|
|
|
368
374
|
return _ref7.apply(this, arguments);
|
|
369
375
|
};
|
|
370
376
|
}();
|
|
371
|
-
var _rowClassName = function _rowClassName(record, index) {
|
|
372
|
-
if (originalDataSource && !originalObj.hasOwnProperty(get(record, 'rowKey'))) {
|
|
373
|
-
return 'new-cell';
|
|
374
|
-
}
|
|
375
|
-
};
|
|
376
377
|
var TableComponent = draggable ? DraggableTable : BaseTable;
|
|
377
378
|
// 标记样式
|
|
378
379
|
var tagStyle = {
|
|
@@ -41,6 +41,10 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
|
|
|
41
41
|
toolTipProps?: TooltipProps & React.RefAttributes<unknown>;
|
|
42
42
|
transform?: (value: any, record?: any) => string[];
|
|
43
43
|
show?: boolean | (() => boolean);
|
|
44
|
+
onDiff?: ({ value, originValue }: {
|
|
45
|
+
value: any;
|
|
46
|
+
originValue: any;
|
|
47
|
+
}) => boolean;
|
|
44
48
|
}
|
|
45
49
|
export interface CreateTreeFromArrayOptions {
|
|
46
50
|
itemKey?: string;
|
|
@@ -272,8 +272,22 @@
|
|
|
272
272
|
.@{ant-prefix}-table-cell .varied-cell {
|
|
273
273
|
margin-left: -8px;
|
|
274
274
|
padding: var(--zaui-space-size-xs, 4px) var(--zaui-space-size-sm, 8px);
|
|
275
|
+
|
|
275
276
|
background: var(--zaui-contract-bg; #fffaa1) !important;
|
|
276
277
|
border-radius: var(--zaui-border-radius, 8px);
|
|
278
|
+
.pro-form-view-container {
|
|
279
|
+
overflow: hidden;
|
|
280
|
+
white-space: nowrap;
|
|
281
|
+
text-overflow: ellipsis;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.@{ant-prefix}-table-cell .@{ant-prefix}-typography-ellipsis {
|
|
286
|
+
.pro-form-view-container {
|
|
287
|
+
overflow: hidden;
|
|
288
|
+
white-space: nowrap;
|
|
289
|
+
text-overflow: ellipsis;
|
|
290
|
+
}
|
|
277
291
|
}
|
|
278
292
|
|
|
279
293
|
.varied-cell.empty-cell {
|
|
@@ -17,7 +17,7 @@ var _lodash = require("lodash");
|
|
|
17
17
|
var _diffOriginal = require("../../../ProForm/utils/diffOriginal");
|
|
18
18
|
var _ProConfigProvider = require("../../../ProConfigProvider");
|
|
19
19
|
var _utils = require("../../../utils");
|
|
20
|
-
var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "getValueProps", "valuePropName"];
|
|
20
|
+
var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "getValueProps", "valuePropName", "viewRender"];
|
|
21
21
|
var toNamePath = function toNamePath(name) {
|
|
22
22
|
if (Array.isArray(name)) {
|
|
23
23
|
return name;
|
|
@@ -71,7 +71,6 @@ var getOriginalValue = function getOriginalValue(_ref) {
|
|
|
71
71
|
}) : (0, _lodash.get)(originalValues, originalName);
|
|
72
72
|
};
|
|
73
73
|
var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
74
|
-
var _getValueProps;
|
|
75
74
|
var name = props.name,
|
|
76
75
|
names = props.names,
|
|
77
76
|
namesStr = props.namesStr,
|
|
@@ -89,6 +88,7 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
89
88
|
getValueProps = props.getValueProps,
|
|
90
89
|
_props$valuePropName = props.valuePropName,
|
|
91
90
|
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
91
|
+
viewRender = props.viewRender,
|
|
92
92
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
93
93
|
var _ref2 = (0, _ProConfigProvider.useProConfig)('ProEditTable') || {},
|
|
94
94
|
isDiffAll = _ref2.isDiffAll;
|
|
@@ -118,6 +118,23 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
118
118
|
}, [props[valuePropName], originalValue]);
|
|
119
119
|
var isAdd = diffType === 'add';
|
|
120
120
|
var isChanged = diffType === 'changed';
|
|
121
|
+
var tipContent = (0, _react.useMemo)(function () {
|
|
122
|
+
var _getValueProps;
|
|
123
|
+
if (!isWatch || noChange) return undefined;
|
|
124
|
+
var orgValue = getValueProps ? (_getValueProps = getValueProps(originalValue)) === null || _getValueProps === void 0 ? void 0 : _getValueProps[valuePropName] : originalValue;
|
|
125
|
+
// 兼容viewRender函数和Element场景
|
|
126
|
+
var _children = children;
|
|
127
|
+
if (viewRender) {
|
|
128
|
+
if (! /*#__PURE__*/_react.default.isValidElement(viewRender)) {
|
|
129
|
+
return viewRender(orgValue);
|
|
130
|
+
}
|
|
131
|
+
_children = viewRender;
|
|
132
|
+
}
|
|
133
|
+
return /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children), {}, (0, _defineProperty2.default)((0, _defineProperty2.default)({
|
|
134
|
+
// @ts-ignore
|
|
135
|
+
isView: true
|
|
136
|
+
}, valuePropName, orgValue), "checked", type === 'Switch' ? originalValue : undefined))) : undefined;
|
|
137
|
+
}, [originalValue, children]);
|
|
121
138
|
if (!isWatch || noChange) {
|
|
122
139
|
return /*#__PURE__*/_react.default.isValidElement(children) && /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest));
|
|
123
140
|
}
|
|
@@ -134,10 +151,7 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
134
151
|
return target.parentElement;
|
|
135
152
|
},
|
|
136
153
|
title: (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
137
|
-
children: ["\u521D\u59CB\u503C\uFF1A",
|
|
138
|
-
// @ts-ignore
|
|
139
|
-
isView: true
|
|
140
|
-
}, valuePropName, getValueProps ? (_getValueProps = getValueProps(originalValue)) === null || _getValueProps === void 0 ? void 0 : _getValueProps[valuePropName] : props[valuePropName]), "checked", type === 'Switch' ? originalValue : undefined))) : undefined]
|
|
154
|
+
children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
|
|
141
155
|
}),
|
|
142
156
|
children: (0, _jsxRuntime.jsx)("div", {
|
|
143
157
|
className: diffClassName,
|
|
@@ -255,13 +255,19 @@ var RenderField = function RenderField(_ref) {
|
|
|
255
255
|
TargetComponent = _editRender;
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
+
var viewRenderFun = function viewRenderFun(value) {
|
|
259
|
+
if (/*#__PURE__*/_react.default.isValidElement(viewRender)) {
|
|
260
|
+
return viewRender;
|
|
261
|
+
}
|
|
262
|
+
return viewRender === null || viewRender === void 0 ? void 0 : viewRender(value, record, options);
|
|
263
|
+
};
|
|
258
264
|
// 查看模式
|
|
259
265
|
if (isView) {
|
|
260
266
|
// 存在viewRender覆盖默认值
|
|
261
267
|
if (typeof viewRender === 'function') {
|
|
262
268
|
var _column$dataIndex;
|
|
263
269
|
currentValue = (column === null || column === void 0 ? void 0 : (_column$dataIndex = column.dataIndex) === null || _column$dataIndex === void 0 ? void 0 : _column$dataIndex.includes('-')) ? value : currentValue;
|
|
264
|
-
var View =
|
|
270
|
+
var View = viewRenderFun(currentValue);
|
|
265
271
|
TargetComponent = (0, _jsxRuntime.jsx)(_Container.default, {
|
|
266
272
|
viewEmpty: viewEmpty,
|
|
267
273
|
children: View
|
|
@@ -567,6 +573,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
567
573
|
valuePropName: _formItemProps.valuePropName,
|
|
568
574
|
normalize: _formItemProps.normalize,
|
|
569
575
|
getValueProps: _formItemProps.getValueProps,
|
|
576
|
+
viewRender: viewRender && viewRenderFun,
|
|
570
577
|
children: FieldComponent
|
|
571
578
|
});
|
|
572
579
|
}
|
|
@@ -24,7 +24,7 @@ var _ProForm = _interopRequireDefault(require("../ProForm"));
|
|
|
24
24
|
var _empty = _interopRequireDefault(require("../assets/empty.png"));
|
|
25
25
|
var _locale = _interopRequireWildcard(require("../locale"));
|
|
26
26
|
var _RcTable = require("./components/RcTable");
|
|
27
|
-
var _excluded = ["value", "onChange", "onDrag", "className", "columns", "type", "mode", "stripe", "draggable", "virtual", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "toolbarSticky", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "
|
|
27
|
+
var _excluded = ["value", "onChange", "onDrag", "className", "columns", "type", "mode", "stripe", "draggable", "virtual", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "toolbarSticky", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "rowKey", "rowDisabled", "rowDraggable", "footerRender", "scroll", "actionDirection"];
|
|
28
28
|
var ProEditTable = function ProEditTable(_ref, ref) {
|
|
29
29
|
var _resetProps$id, _resetProps$id$split, _themeConfig$data2;
|
|
30
30
|
var value = _ref.value,
|
|
@@ -54,7 +54,6 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
54
54
|
headerRender = _ref.headerRender,
|
|
55
55
|
pagination = _ref.pagination,
|
|
56
56
|
originalValues = _ref.originalValues,
|
|
57
|
-
originalDiffTip = _ref.originalDiffTip,
|
|
58
57
|
rowKey = _ref.rowKey,
|
|
59
58
|
rowDisabled = _ref.rowDisabled,
|
|
60
59
|
rowDraggable = _ref.rowDraggable,
|
|
@@ -92,7 +91,6 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
92
91
|
return (_ref2 = (_themeConfig$data$zau = themeConfig === null || themeConfig === void 0 ? void 0 : (_themeConfig$data = themeConfig.data) === null || _themeConfig$data === void 0 ? void 0 : _themeConfig$data.zauiFormAlign) !== null && _themeConfig$data$zau !== void 0 ? _themeConfig$data$zau : configRequiredAlign) !== null && _ref2 !== void 0 ? _ref2 : 'left';
|
|
93
92
|
}, [themeConfig === null || themeConfig === void 0 ? void 0 : (_themeConfig$data2 = themeConfig.data) === null || _themeConfig$data2 === void 0 ? void 0 : _themeConfig$data2.zauiFormAlign]);
|
|
94
93
|
var _useSetState = (0, _ahooks.useSetState)({
|
|
95
|
-
_columns: columns,
|
|
96
94
|
cellNamePath: [],
|
|
97
95
|
forceUpdate: {},
|
|
98
96
|
editingKeys: [],
|
|
@@ -170,7 +168,6 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
170
168
|
tableLength: value === null || value === void 0 ? void 0 : value.length,
|
|
171
169
|
page: page,
|
|
172
170
|
originalValues: originalValues,
|
|
173
|
-
originalDiffTip: originalDiffTip,
|
|
174
171
|
prefixCls: prefixCls,
|
|
175
172
|
rowDisabled: rowDisabled,
|
|
176
173
|
actionDirection: actionDirection
|
|
@@ -278,8 +275,8 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
278
275
|
var _columns = (0, _react.useMemo)(function () {
|
|
279
276
|
return (0, _utils.transformColumns)(columns, config);
|
|
280
277
|
}, [valueChangeRef.current, disabled, forceUpdate, columns, page, actionProps, editingKeys, cellNamePath]);
|
|
281
|
-
|
|
282
|
-
var _value$every, _originalArr$every;
|
|
278
|
+
var initDataSource = function initDataSource() {
|
|
279
|
+
var _value$every, _originalArr$every, _value$some, _originalArr$some;
|
|
283
280
|
var isAllHasKey = value === null || value === void 0 ? void 0 : (_value$every = value.every) === null || _value$every === void 0 ? void 0 : _value$every.call(value, function (item) {
|
|
284
281
|
return item.rowKey;
|
|
285
282
|
});
|
|
@@ -288,8 +285,15 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
288
285
|
var isOriginalAllHasKey = originalArr ? originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$every = originalArr.every) === null || _originalArr$every === void 0 ? void 0 : _originalArr$every.call(originalArr, function (item) {
|
|
289
286
|
return item.rowKey;
|
|
290
287
|
}) : true;
|
|
288
|
+
// 检测当前rowkey是否与制定key的值是否一致,不一致,则执行覆盖
|
|
289
|
+
var isNeedCover = value === null || value === void 0 ? void 0 : (_value$some = value.some) === null || _value$some === void 0 ? void 0 : _value$some.call(value, function (item) {
|
|
290
|
+
return item.rowKey !== getRowKey(item);
|
|
291
|
+
});
|
|
292
|
+
var isNeedCoverOriginal = originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$some = originalArr.some) === null || _originalArr$some === void 0 ? void 0 : _originalArr$some.call(originalArr, function (item) {
|
|
293
|
+
return item.rowKey !== getRowKey(item);
|
|
294
|
+
});
|
|
291
295
|
// 初始化默认生成row-key
|
|
292
|
-
if ((value === null || value === void 0 ? void 0 : value.length) && !isAllHasKey || (originalArr === null || originalArr === void 0 ? void 0 : originalArr.length) && !isOriginalAllHasKey) {
|
|
296
|
+
if ((value === null || value === void 0 ? void 0 : value.length) && (!isAllHasKey || isNeedCover) || (originalArr === null || originalArr === void 0 ? void 0 : originalArr.length) && (!isOriginalAllHasKey || isNeedCoverOriginal)) {
|
|
293
297
|
var _originalArr$forEach;
|
|
294
298
|
var nextValues = value === null || value === void 0 ? void 0 : value.map(function (item) {
|
|
295
299
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
|
@@ -304,6 +308,9 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
304
308
|
form.setFieldValue(virtualRowName, nextValues);
|
|
305
309
|
}
|
|
306
310
|
}
|
|
311
|
+
};
|
|
312
|
+
(0, _react.useEffect)(function () {
|
|
313
|
+
initDataSource();
|
|
307
314
|
}, [value, originalValues]);
|
|
308
315
|
(0, _react.useImperativeHandle)((resetProps === null || resetProps === void 0 ? void 0 : resetProps.ref) || ref, function () {
|
|
309
316
|
return {
|
|
@@ -109,7 +109,6 @@ export interface ProColumnsProps<Values = any, T = any> extends Omit<FormItemPro
|
|
|
109
109
|
}
|
|
110
110
|
export type ProEditTableColumnsProps<K = any> = ProColumnsProps & ColumnPropsMap<K, 'ProEditTable'>;
|
|
111
111
|
export interface State {
|
|
112
|
-
_columns: ProEditTableColumnsProps[];
|
|
113
112
|
cellNamePath: NamePath[];
|
|
114
113
|
forceUpdate: {};
|
|
115
114
|
editingKeys: string[];
|
|
@@ -139,11 +138,6 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
|
|
|
139
138
|
* @description 原始数据源,是否tooltip显示
|
|
140
139
|
* @default -
|
|
141
140
|
*/
|
|
142
|
-
originalDiffTip?: boolean;
|
|
143
|
-
/**
|
|
144
|
-
* @description 可编辑表格的类型,单行、多行、单元格编辑
|
|
145
|
-
* @default false
|
|
146
|
-
*/
|
|
147
141
|
mode?: 'single' | 'multiple' | 'cell';
|
|
148
142
|
/**
|
|
149
143
|
* @description 可编辑表格的类型,单行编辑或者多行编辑
|