@zat-design/sisyphus-react 3.9.4-beta.7 → 3.9.4-beta.9

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.
@@ -128,6 +128,7 @@ export var formatColumn = function formatColumn(_ref2) {
128
128
  var isInNewRowFlag = isInNewRow(record);
129
129
  var _isAddCell = isAddCell;
130
130
  otherProps.isChanged = isChanged;
131
+ var nextValue = value;
131
132
  // 存在比对
132
133
  if (isFunction(otherProps === null || otherProps === void 0 ? void 0 : otherProps.viewRender) && (diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.originalDataSource)) {
133
134
  var _originalObj$record$r;
@@ -139,10 +140,17 @@ export var formatColumn = function formatColumn(_ref2) {
139
140
  index: index
140
141
  });
141
142
  // viewRender 返回值为 false 时,不显示对比
142
- if (isBoolean(diffResult)) {
143
+ if (isBoolean(diffResult) && !diffResult) {
143
144
  otherProps.isChanged = false;
144
145
  }
145
146
  originalValue = diffResult;
147
+ nextValue = otherProps.viewRender({
148
+ originalValue: value,
149
+ originalRecord: record !== null && record !== void 0 ? record : {},
150
+ value: value,
151
+ record: record,
152
+ index: index
153
+ });
146
154
  }
147
155
  // 存在自定义onDiff比对
148
156
  if (isFunction(onDiff)) {
@@ -150,14 +158,16 @@ export var formatColumn = function formatColumn(_ref2) {
150
158
  var _diffResult = onDiff({
151
159
  originalValue: originalValue,
152
160
  originalRecord: (_originalObj$record$r2 = originalObj === null || originalObj === void 0 ? void 0 : originalObj[record === null || record === void 0 ? void 0 : record[rowKey]]) !== null && _originalObj$record$r2 !== void 0 ? _originalObj$record$r2 : {},
153
- value: value,
161
+ value: nextValue,
154
162
  record: record,
155
163
  index: index
156
164
  });
157
165
  if (_diffResult === 'changed') {
166
+ _isAddCell = false;
158
167
  otherProps.isChanged = true;
159
168
  }
160
169
  if (_diffResult === 'same') {
170
+ _isAddCell = false;
161
171
  otherProps.isChanged = false;
162
172
  }
163
173
  if (_diffResult === 'add') {
@@ -134,6 +134,7 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref2) {
134
134
  var isInNewRowFlag = isInNewRow(record);
135
135
  var _isAddCell = isAddCell;
136
136
  otherProps.isChanged = isChanged;
137
+ var nextValue = value;
137
138
  // 存在比对
138
139
  if ((0, _lodash.isFunction)(otherProps === null || otherProps === void 0 ? void 0 : otherProps.viewRender) && (diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.originalDataSource)) {
139
140
  var _originalObj$record$r;
@@ -145,10 +146,17 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref2) {
145
146
  index: index
146
147
  });
147
148
  // viewRender 返回值为 false 时,不显示对比
148
- if ((0, _lodash.isBoolean)(diffResult)) {
149
+ if ((0, _lodash.isBoolean)(diffResult) && !diffResult) {
149
150
  otherProps.isChanged = false;
150
151
  }
151
152
  originalValue = diffResult;
153
+ nextValue = otherProps.viewRender({
154
+ originalValue: value,
155
+ originalRecord: record !== null && record !== void 0 ? record : {},
156
+ value: value,
157
+ record: record,
158
+ index: index
159
+ });
152
160
  }
153
161
  // 存在自定义onDiff比对
154
162
  if ((0, _lodash.isFunction)(onDiff)) {
@@ -156,14 +164,16 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref2) {
156
164
  var _diffResult = onDiff({
157
165
  originalValue: originalValue,
158
166
  originalRecord: (_originalObj$record$r2 = originalObj === null || originalObj === void 0 ? void 0 : originalObj[record === null || record === void 0 ? void 0 : record[rowKey]]) !== null && _originalObj$record$r2 !== void 0 ? _originalObj$record$r2 : {},
159
- value: value,
167
+ value: nextValue,
160
168
  record: record,
161
169
  index: index
162
170
  });
163
171
  if (_diffResult === 'changed') {
172
+ _isAddCell = false;
164
173
  otherProps.isChanged = true;
165
174
  }
166
175
  if (_diffResult === 'same') {
176
+ _isAddCell = false;
167
177
  otherProps.isChanged = false;
168
178
  }
169
179
  if (_diffResult === 'add') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.9.4-beta.7",
3
+ "version": "3.9.4-beta.9",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",