@zat-design/sisyphus-react 3.2.2-beta.9 → 3.3.0
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 +7 -4
- package/es/ProDrawerForm/index.js +1 -15
- package/es/ProEditTable/style/index.less +8 -6
- package/es/ProForm/components/base/SwitchCheckbox/style/index.less +3 -0
- package/es/ProForm/components/base/TextArea/index.less +3 -2
- package/es/ProForm/components/base/TimePicker/style/index.less +3 -0
- package/es/ProForm/components/combination/Container/style/index.less +3 -0
- package/es/ProForm/components/combination/FormList/style/index.less +3 -0
- package/es/ProForm/components/combination/Group/style/index.less +3 -0
- package/es/ProForm/components/combination/ProAddressBar/style/index.less +3 -0
- package/es/ProForm/components/combination/ProCombination/style/index.less +3 -0
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +6 -1
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +3 -0
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +3 -0
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +3 -0
- package/es/ProForm/components/render/RenderFields.js +1 -2
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +3 -0
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +3 -0
- package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +3 -0
- package/es/ProLayout/components/Layout/Menu/style/index.less +2 -0
- package/es/ProLayout/components/Layout/Notice/style/index.less +3 -0
- package/es/ProLayout/components/ProCollapse/style/index.less +3 -0
- package/es/ProLayout/components/ProFooter/style/index.less +3 -0
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +3 -0
- package/es/ProLayout/components/ProHeader/style/index.less +2 -0
- package/es/ProTable/index.js +12 -4
- package/es/ProTable/style/index.less +8 -0
- package/es/ProTable/utils.d.ts +1 -1
- package/es/ProTable/utils.js +38 -19
- package/es/ProTree/components/ProTree.js +27 -11
- package/es/ProTree/components/Tree.js +1 -1
- package/es/ProTree/propsType.d.ts +2 -2
- package/es/ProTree/utils.d.ts +6 -0
- package/es/ProTree/utils.js +11 -0
- package/es/ProTreeSelect/index.js +6 -4
- package/es/ProTreeSelect/propsType.d.ts +2 -0
- package/es/ProUpload/components/ImageRender.js +5 -1
- package/es/ProUpload/style/index.less +6 -0
- package/es/locale/en_US.d.ts +1 -0
- package/es/locale/en_US.js +2 -1
- package/es/locale/zh_CN.d.ts +1 -0
- package/es/locale/zh_CN.js +2 -1
- package/lib/ProDrawerForm/index.js +0 -14
- package/lib/ProEditTable/style/index.less +8 -6
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +3 -0
- package/lib/ProForm/components/base/TextArea/index.less +3 -2
- package/lib/ProForm/components/base/TimePicker/style/index.less +3 -0
- package/lib/ProForm/components/combination/Container/style/index.less +3 -0
- package/lib/ProForm/components/combination/FormList/style/index.less +3 -0
- package/lib/ProForm/components/combination/Group/style/index.less +3 -0
- package/lib/ProForm/components/combination/ProAddressBar/style/index.less +3 -0
- package/lib/ProForm/components/combination/ProCombination/style/index.less +3 -0
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +7 -1
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +3 -0
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +3 -0
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +3 -0
- package/lib/ProForm/components/render/RenderFields.js +1 -2
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +3 -0
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +3 -0
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +3 -0
- package/lib/ProLayout/components/Layout/Menu/style/index.less +2 -0
- package/lib/ProLayout/components/Layout/Notice/style/index.less +3 -0
- package/lib/ProLayout/components/ProCollapse/style/index.less +3 -0
- package/lib/ProLayout/components/ProFooter/style/index.less +3 -0
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +3 -0
- package/lib/ProLayout/components/ProHeader/style/index.less +2 -0
- package/lib/ProTable/index.js +11 -3
- package/lib/ProTable/style/index.less +8 -0
- package/lib/ProTable/utils.d.ts +1 -1
- package/lib/ProTable/utils.js +38 -19
- package/lib/ProTree/components/ProTree.js +26 -10
- package/lib/ProTree/components/Tree.js +1 -1
- package/lib/ProTree/propsType.d.ts +2 -2
- package/lib/ProTree/utils.d.ts +6 -0
- package/lib/ProTree/utils.js +12 -0
- package/lib/ProTreeSelect/index.js +6 -4
- package/lib/ProTreeSelect/propsType.d.ts +2 -0
- package/lib/ProUpload/components/ImageRender.js +5 -1
- package/lib/ProUpload/style/index.less +6 -0
- package/lib/locale/en_US.d.ts +1 -0
- package/lib/locale/en_US.js +2 -1
- package/lib/locale/zh_CN.d.ts +1 -0
- package/lib/locale/zh_CN.js +2 -1
- package/package.json +1 -1
- package/typings.d.ts +0 -6
package/dist/index.esm.css
CHANGED
|
@@ -3027,6 +3027,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
3027
3027
|
-ms-flex-pack: center;
|
|
3028
3028
|
justify-content: center;
|
|
3029
3029
|
}
|
|
3030
|
+
.proupload-modal-preview .ant-modal {
|
|
3031
|
+
width: 600px;
|
|
3032
|
+
}
|
|
3030
3033
|
.pro-tree-select .ant-select-selector .check-mark-icon {
|
|
3031
3034
|
display: none;
|
|
3032
3035
|
}
|
|
@@ -4062,6 +4065,10 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
4062
4065
|
line-height: 1;
|
|
4063
4066
|
content: "*";
|
|
4064
4067
|
}
|
|
4068
|
+
.pro-edit-table .ant-table-scroll-horizontal .ant-table-cell-fix-right-first::after {
|
|
4069
|
+
-webkit-box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
|
|
4070
|
+
box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
|
|
4071
|
+
}
|
|
4065
4072
|
.pro-edit-table .ant-table-content > table .ant-table-summary {
|
|
4066
4073
|
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
4067
4074
|
color: var(--zaui-text, #343434);
|
|
@@ -4071,10 +4078,6 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
4071
4078
|
.pro-edit-table .ant-table-content > table .ant-table-summary .ant-table-cell-fix-right {
|
|
4072
4079
|
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
4073
4080
|
}
|
|
4074
|
-
.pro-edit-table .ant-table-content > table .ant-table-cell-fix-right-first::after {
|
|
4075
|
-
-webkit-box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
|
|
4076
|
-
box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
|
|
4077
|
-
}
|
|
4078
4081
|
.pro-edit-table .ant-table-content > table th.ant-table-selection-column {
|
|
4079
4082
|
width: 48px;
|
|
4080
4083
|
}
|
|
@@ -2,7 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
var _locale$ProDrawerForm3;
|
|
4
4
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
-
import { forwardRef,
|
|
5
|
+
import { forwardRef, useImperativeHandle, useMemo } from 'react';
|
|
6
6
|
import { ProDrawer, ProModal } from './components';
|
|
7
7
|
import ProForm from '../ProForm';
|
|
8
8
|
import { transformBySize } from './utils';
|
|
@@ -50,20 +50,6 @@ var ProDrawerForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
50
50
|
Modal: ProModal
|
|
51
51
|
}[showType];
|
|
52
52
|
}, [showType]);
|
|
53
|
-
var removeStyle = function removeStyle() {
|
|
54
|
-
var styleTags = document.getElementsByTagName('style');
|
|
55
|
-
for (var i = 0; i < styleTags.length; i++) {
|
|
56
|
-
var rcUtilKey = styleTags[i].getAttribute('rc-util-key');
|
|
57
|
-
if ((rcUtilKey === null || rcUtilKey === void 0 ? void 0 : rcUtilKey.indexOf('rc-util-locker')) === 0) {
|
|
58
|
-
styleTags[i].remove();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
useEffect(function () {
|
|
63
|
-
if (!visible) {
|
|
64
|
-
removeStyle();
|
|
65
|
-
}
|
|
66
|
-
}, [visible]);
|
|
67
53
|
return _jsx(_Fragment, {
|
|
68
54
|
children: visible ? _jsx(Com, _objectSpread(_objectSpread({}, props), {}, {
|
|
69
55
|
isView: isView,
|
|
@@ -133,6 +133,14 @@
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
.@{ant-prefix}-table-scroll-horizontal {
|
|
137
|
+
.@{ant-prefix}-table-cell-fix-right-first {
|
|
138
|
+
&::after {
|
|
139
|
+
box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
136
144
|
.@{ant-prefix}-table-content {
|
|
137
145
|
>table {
|
|
138
146
|
.@{ant-prefix}-table-summary {
|
|
@@ -147,12 +155,6 @@
|
|
|
147
155
|
}
|
|
148
156
|
}
|
|
149
157
|
|
|
150
|
-
.@{ant-prefix}-table-cell-fix-right-first {
|
|
151
|
-
&::after {
|
|
152
|
-
box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
158
|
th.@{ant-prefix}-table-selection-column {
|
|
157
159
|
width: 48px;
|
|
158
160
|
}
|
|
@@ -5,6 +5,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
5
5
|
import { useDebounceFn, usePrevious, useRequest } from 'ahooks';
|
|
6
6
|
import { isEqual } from 'lodash';
|
|
7
7
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
8
|
+
import locale, { formatMessage } from '../../../../../locale';
|
|
8
9
|
var defaultPage = {
|
|
9
10
|
pageNum: 1,
|
|
10
11
|
pageSize: 10
|
|
@@ -128,7 +129,11 @@ export function useRequestList(service, options, useRequestOptions) {
|
|
|
128
129
|
onShowSizeChange: onChange,
|
|
129
130
|
hideOnSinglePage: page.pageSize === 10,
|
|
130
131
|
showTotal: function showTotal(total) {
|
|
131
|
-
|
|
132
|
+
var _locale$ProEditTable;
|
|
133
|
+
if (!total) return;
|
|
134
|
+
return formatMessage(locale === null || locale === void 0 ? void 0 : (_locale$ProEditTable = locale.ProEditTable) === null || _locale$ProEditTable === void 0 ? void 0 : _locale$ProEditTable.total, {
|
|
135
|
+
total: total
|
|
136
|
+
});
|
|
132
137
|
}
|
|
133
138
|
} : false
|
|
134
139
|
});
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@root-entry-name: 'default';
|
|
2
|
+
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
|
+
|
|
1
4
|
.@{ant-prefix}-form-item-has-error {
|
|
2
5
|
.@{ant-prefix}-picker-status-error
|
|
3
6
|
~ .forever-checkbox:not(.@{ant-prefix}-input-disabled):not(.@{ant-prefix}-input-borderless).@{ant-prefix}-input {
|
|
@@ -66,8 +66,7 @@ var RenderFields = function RenderFields(props) {
|
|
|
66
66
|
formItemChildProps = _column$formItemChild === void 0 ? {} : _column$formItemChild,
|
|
67
67
|
_column$fieldProps = column.fieldProps,
|
|
68
68
|
fieldProps = _column$fieldProps === void 0 ? {} : _column$fieldProps,
|
|
69
|
-
|
|
70
|
-
disabled = _column$disabled === void 0 ? false : _column$disabled,
|
|
69
|
+
disabled = column.disabled,
|
|
71
70
|
equalWith = column.equalWith,
|
|
72
71
|
_column$clearNotShow = column.clearNotShow,
|
|
73
72
|
clearNotShow = _column$clearNotShow === void 0 ? outerClearNotShow : _column$clearNotShow,
|
package/es/ProTable/index.js
CHANGED
|
@@ -12,7 +12,7 @@ var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stri
|
|
|
12
12
|
_excluded2 = ["resizeColumn", "columnConfig", "cacheTime", "storage"];
|
|
13
13
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { useEffect, useMemo, useState, createContext } from 'react';
|
|
15
|
-
import { cloneDeep, get } from 'lodash';
|
|
15
|
+
import { cloneDeep, get, keyBy } from 'lodash';
|
|
16
16
|
import { useDebounceEffect, useDeepCompareEffect } from 'ahooks';
|
|
17
17
|
import { ReactSVG } from 'react-svg';
|
|
18
18
|
import classnames from 'classnames';
|
|
@@ -72,7 +72,10 @@ function ProTable(props) {
|
|
|
72
72
|
tableProps = _objectWithoutProperties(quickTableConfig, _excluded2);
|
|
73
73
|
var _ref3 = tableProps || {},
|
|
74
74
|
pagination = _ref3.pagination,
|
|
75
|
-
dataSource = _ref3.dataSource
|
|
75
|
+
dataSource = _ref3.dataSource,
|
|
76
|
+
rowKey = _ref3.rowKey;
|
|
77
|
+
var originalObj = originalDataSource ? keyBy(originalDataSource, rowKey) : undefined;
|
|
78
|
+
var dataSourceObj = dataSource ? keyBy(dataSource, rowKey) : {};
|
|
76
79
|
var propsColumnObj = useMemo(function () {
|
|
77
80
|
return propsColumns.reduce(function (acc, cur) {
|
|
78
81
|
// @ts-ignore
|
|
@@ -163,7 +166,7 @@ function ProTable(props) {
|
|
|
163
166
|
return !(item === null || item === void 0 ? void 0 : item.delete);
|
|
164
167
|
});
|
|
165
168
|
newColumns === null || newColumns === void 0 ? void 0 : newColumns.forEach(function (item) {
|
|
166
|
-
formatColumn(item,
|
|
169
|
+
formatColumn(item, originalObj, dataSourceObj, rowKey);
|
|
167
170
|
});
|
|
168
171
|
return newColumns;
|
|
169
172
|
}, [curColumns, handleResize]);
|
|
@@ -326,7 +329,12 @@ function ProTable(props) {
|
|
|
326
329
|
},
|
|
327
330
|
summary: _typeof(summary) === 'object' ? function () {
|
|
328
331
|
return renderSummary();
|
|
329
|
-
} : summary
|
|
332
|
+
} : summary,
|
|
333
|
+
rowClassName: function rowClassName(record, index) {
|
|
334
|
+
if (originalDataSource && !originalObj.hasOwnProperty(get(record, rowKey))) {
|
|
335
|
+
return 'new-cell';
|
|
336
|
+
}
|
|
337
|
+
}
|
|
330
338
|
}, tableProps)), _jsx(ResizableLine, {})]
|
|
331
339
|
}), footerRender ? _jsx("div", {
|
|
332
340
|
className: "pro-table-footer ".concat(pagination && !!(dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) ? 'has-page' : 'no-page'),
|
|
@@ -64,6 +64,14 @@
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.@{ant-prefix}-table-body {
|
|
67
|
+
// .@{ant-prefix}-table-tbody .@{ant-prefix}-table-row:nth-child(odd).new-cell {
|
|
68
|
+
// background: #00ae4d !important;
|
|
69
|
+
|
|
70
|
+
// td {
|
|
71
|
+
// background: #00ae4d !important;
|
|
72
|
+
// }
|
|
73
|
+
// }
|
|
74
|
+
|
|
67
75
|
.@{ant-prefix}-table-cell .varied-cell {
|
|
68
76
|
margin-left: -8px;
|
|
69
77
|
background: var(--zaui-contract-bg, #fffaa1);
|
package/es/ProTable/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ProTableColumn } from './propsType';
|
|
3
|
-
export declare const formatColumn: (column: ProTableColumn,
|
|
3
|
+
export declare const formatColumn: (column: ProTableColumn, originalObj: any, dataSourceObj: any, rowKey: any) => void;
|
|
4
4
|
export declare const getColumnDataIndex: (dataIndex: string | string[]) => string;
|
|
5
5
|
/**
|
|
6
6
|
* 查找最近的父级className
|
package/es/ProTable/utils.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import "antd/es/space/style";
|
|
2
2
|
import _Space from "antd/es/space";
|
|
3
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
4
3
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
4
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
6
5
|
import { isValidElement } from 'react';
|
|
@@ -22,7 +21,27 @@ var getDecimalDigits = function getDecimalDigits() {
|
|
|
22
21
|
var match = Number(num).toString().match(/\.(\d+)/);
|
|
23
22
|
return match ? match[1].length : 0;
|
|
24
23
|
};
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* @description: 获取初始值
|
|
26
|
+
* @author: xiangchengli
|
|
27
|
+
* @param {any} rowKey
|
|
28
|
+
* @param any value
|
|
29
|
+
* @param any originalObj
|
|
30
|
+
* @param {any} dataIndex
|
|
31
|
+
* @return {any}
|
|
32
|
+
*/
|
|
33
|
+
var getOriginalValue = function getOriginalValue(value, record, originalObj, rowKey, dataIndex) {
|
|
34
|
+
if (!originalObj) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
var originalRecord = get(originalObj, get(record, rowKey));
|
|
38
|
+
var originalValue = get(originalRecord, dataIndex);
|
|
39
|
+
if (!isEqual(originalValue, value)) {
|
|
40
|
+
return originalValue;
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
};
|
|
44
|
+
export var formatColumn = function formatColumn(column, originalObj, dataSourceObj, rowKey) {
|
|
26
45
|
var title = column.title,
|
|
27
46
|
valueType = column.valueType,
|
|
28
47
|
_column$format = column.format,
|
|
@@ -86,7 +105,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
86
105
|
var multiple = valueType === 'percentage' ? 100 : 1000;
|
|
87
106
|
var realValue = tools.calc(Number(value), '*', multiple);
|
|
88
107
|
var renderValue = getDecimalDigits(value) > valueTypePrecision ? realValue : realValue.toFixed(valueTypePrecision);
|
|
89
|
-
var originalValue =
|
|
108
|
+
var originalValue = getOriginalValue(value, record, originalObj, rowKey, dataIndex);
|
|
90
109
|
var originalRealValue = tools.calc(Number(originalValue || null), '*', multiple);
|
|
91
110
|
var originalRenderValue = getDecimalDigits(originalValue) > valueTypePrecision ? originalRealValue : originalRealValue.toFixed(valueTypePrecision);
|
|
92
111
|
if (!originalValue && originalValue !== 0) {
|
|
@@ -97,7 +116,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
97
116
|
}
|
|
98
117
|
return _jsx(RenderColumn, {
|
|
99
118
|
valueType: valueType,
|
|
100
|
-
originalValue:
|
|
119
|
+
originalValue: originalValue === undefined ? undefined : originalRenderValue,
|
|
101
120
|
ellipsis: ellipsis,
|
|
102
121
|
width: width,
|
|
103
122
|
node: renderValue,
|
|
@@ -111,7 +130,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
111
130
|
column.render = function (value, record, index) {
|
|
112
131
|
var valueStr = valueTypePrecision ? "".concat(Number(value).toFixed(valueTypePrecision)) : "".concat(value);
|
|
113
132
|
var renderValue = valueStr.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
114
|
-
var originalValue =
|
|
133
|
+
var originalValue = getOriginalValue(value, record, originalObj, rowKey, dataIndex);
|
|
115
134
|
var originalRealValue = valueTypePrecision ? "".concat(Number(originalValue).toFixed(valueTypePrecision)) : "".concat(originalValue);
|
|
116
135
|
var originalRenderValue = originalRealValue.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
117
136
|
if (!originalValue && originalValue !== 0) {
|
|
@@ -126,7 +145,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
126
145
|
}
|
|
127
146
|
return _jsx(RenderColumn, {
|
|
128
147
|
valueType: valueType,
|
|
129
|
-
originalValue:
|
|
148
|
+
originalValue: originalValue === undefined ? undefined : originalRenderValue,
|
|
130
149
|
ellipsis: ellipsis,
|
|
131
150
|
width: width,
|
|
132
151
|
node: node,
|
|
@@ -139,7 +158,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
139
158
|
column.render = function (value, record, index) {
|
|
140
159
|
var _moment, _moment2, _moment3, _moment4, _moment5, _moment6, _moment7, _moment8, _moment9, _moment10, _moment11, _moment12, _moment13, _moment14;
|
|
141
160
|
var renderValue = (_moment = moment(value)) === null || _moment === void 0 ? void 0 : _moment.format(format);
|
|
142
|
-
var originalValue =
|
|
161
|
+
var originalValue = getOriginalValue(value, record, originalObj, rowKey, dataIndex);
|
|
143
162
|
var originalRenderValue = (_moment2 = moment(originalValue)) === null || _moment2 === void 0 ? void 0 : _moment2.format(format);
|
|
144
163
|
switch (valueType) {
|
|
145
164
|
case 'date':
|
|
@@ -178,7 +197,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
178
197
|
}
|
|
179
198
|
return _jsx(RenderColumn, {
|
|
180
199
|
valueType: valueType,
|
|
181
|
-
originalValue:
|
|
200
|
+
originalValue: originalValue === undefined ? undefined : originalRenderValue,
|
|
182
201
|
ellipsis: ellipsis,
|
|
183
202
|
width: width,
|
|
184
203
|
node: node,
|
|
@@ -191,7 +210,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
191
210
|
column.render = function (value, record, index) {
|
|
192
211
|
var realCode = typeof code === 'function' ? code() : code;
|
|
193
212
|
var renderValue = getEnumLabel(realCode, value, valueType === 'enumCodeName');
|
|
194
|
-
var originalValue =
|
|
213
|
+
var originalValue = getOriginalValue(value, record, originalObj, rowKey, dataIndex);
|
|
195
214
|
var originalRenderValue = getEnumLabel(realCode, originalValue, valueType === 'enumCodeName');
|
|
196
215
|
var node = _jsxs(_Space, {
|
|
197
216
|
size: 8,
|
|
@@ -199,7 +218,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
199
218
|
});
|
|
200
219
|
return _jsx(RenderColumn, {
|
|
201
220
|
valueType: valueType,
|
|
202
|
-
originalValue:
|
|
221
|
+
originalValue: originalValue === undefined ? undefined : originalRenderValue,
|
|
203
222
|
ellipsis: ellipsis,
|
|
204
223
|
width: width,
|
|
205
224
|
node: node,
|
|
@@ -211,7 +230,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
211
230
|
} else if (precision || prefix || suffix) {
|
|
212
231
|
column.render = function (value, record, index) {
|
|
213
232
|
var renderValue = value === 'number' ? value.toFixed(precision) : value;
|
|
214
|
-
var originalValue =
|
|
233
|
+
var originalValue = getOriginalValue(value, record, originalObj, rowKey, dataIndex);
|
|
215
234
|
var originalRenderValue = originalValue === 'number' ? originalValue.toFixed(precision) : originalValue;
|
|
216
235
|
var node = _jsxs(_Space, {
|
|
217
236
|
size: 8,
|
|
@@ -225,7 +244,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
225
244
|
}
|
|
226
245
|
return _jsx(RenderColumn, {
|
|
227
246
|
valueType: valueType,
|
|
228
|
-
originalValue:
|
|
247
|
+
originalValue: originalValue === undefined ? undefined : originalRenderValue,
|
|
229
248
|
ellipsis: ellipsis,
|
|
230
249
|
width: width,
|
|
231
250
|
node: node,
|
|
@@ -238,7 +257,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
238
257
|
column.render = function (value, record, index) {
|
|
239
258
|
var _realValue$filter;
|
|
240
259
|
var realValue = transform ? transform(value, record) : value;
|
|
241
|
-
var originalValue =
|
|
260
|
+
var originalValue = getOriginalValue(value, record, originalObj, rowKey, dataIndex);
|
|
242
261
|
var originalRealValue = transform ? transform(originalValue, record) : originalValue;
|
|
243
262
|
var isEmpty = !realValue || Array.isArray(realValue) && (realValue === null || realValue === void 0 ? void 0 : (_realValue$filter = realValue.filter(function (item) {
|
|
244
263
|
return !!item;
|
|
@@ -247,7 +266,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
247
266
|
return '-';
|
|
248
267
|
}
|
|
249
268
|
var className = classnames({
|
|
250
|
-
'varied-cell':
|
|
269
|
+
'varied-cell': originalValue !== undefined,
|
|
251
270
|
'empty-cell': isEmpty
|
|
252
271
|
});
|
|
253
272
|
var renderValue = _jsx(ProForm.ProAddressBar, {
|
|
@@ -265,7 +284,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
265
284
|
isView: true,
|
|
266
285
|
code: code,
|
|
267
286
|
value: realValue,
|
|
268
|
-
tooltip:
|
|
287
|
+
tooltip: originalValue !== undefined ? _jsxs(_Fragment, {
|
|
269
288
|
children: ["\u521D\u59CB\u503C\uFF1A", originalRenderValue, _jsx("br", {}), ellipsis ? _jsxs(_Fragment, {
|
|
270
289
|
children: ["\u5F53\u524D\u503C\uFF1A", renderValue]
|
|
271
290
|
}) : undefined]
|
|
@@ -289,7 +308,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
289
308
|
};
|
|
290
309
|
} else if (ellipsis) {
|
|
291
310
|
column.render = function (value, record, index) {
|
|
292
|
-
var originalValue =
|
|
311
|
+
var originalValue = getOriginalValue(value, record, originalObj, rowKey, dataIndex);
|
|
293
312
|
if (!value && value !== 0 && value === originalValue) {
|
|
294
313
|
return '-';
|
|
295
314
|
}
|
|
@@ -297,7 +316,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
297
316
|
size: 8,
|
|
298
317
|
children: [prefixNode(value, record, index), _jsx(RenderColumn, {
|
|
299
318
|
valueType: valueType,
|
|
300
|
-
originalValue:
|
|
319
|
+
originalValue: originalValue === undefined ? undefined : originalValue || '-',
|
|
301
320
|
ellipsis: ellipsis,
|
|
302
321
|
width: width,
|
|
303
322
|
node: value,
|
|
@@ -309,7 +328,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
309
328
|
};
|
|
310
329
|
} else {
|
|
311
330
|
column.render = function (value, record, index) {
|
|
312
|
-
var originalValue =
|
|
331
|
+
var originalValue = getOriginalValue(value, record, originalObj, rowKey, dataIndex);
|
|
313
332
|
var node = _jsxs(_Space, {
|
|
314
333
|
size: 8,
|
|
315
334
|
children: [prefixNode(value, record, index), value, suffixNode(value, record, index)]
|
|
@@ -319,7 +338,7 @@ export var formatColumn = function formatColumn(column, originalDataSource) {
|
|
|
319
338
|
}
|
|
320
339
|
return _jsx(RenderColumn, {
|
|
321
340
|
valueType: valueType,
|
|
322
|
-
originalValue:
|
|
341
|
+
originalValue: originalValue === undefined ? undefined : originalValue || '-',
|
|
323
342
|
ellipsis: ellipsis,
|
|
324
343
|
width: width,
|
|
325
344
|
node: node,
|