@nokecy/qc-ui 1.1.32 → 1.1.34
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.
|
@@ -229,16 +229,21 @@ var BackendApiSchemeAdapter = exports.BackendApiSchemeAdapter = /*#__PURE__*/fun
|
|
|
229
229
|
return this.request(url);
|
|
230
230
|
case 5:
|
|
231
231
|
response = _context2.sent;
|
|
232
|
-
// 将所有列方案的 columnConfig
|
|
232
|
+
// 将所有列方案的 columnConfig 从字符串解析为对象数组,并计算 isGlobal 字段
|
|
233
|
+
// @author nokecy
|
|
233
234
|
if (response.columnSchemes) {
|
|
234
235
|
Object.keys(response.columnSchemes).forEach(function (gridId) {
|
|
235
236
|
response.columnSchemes[gridId] = response.columnSchemes[gridId].map(function (scheme) {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
237
|
+
var processedScheme = _objectSpread({}, scheme);
|
|
238
|
+
|
|
239
|
+
// 解析 columnConfig
|
|
240
|
+
if (typeof processedScheme.columnConfig === 'string') {
|
|
241
|
+
processedScheme.columnConfig = JSON.parse(processedScheme.columnConfig);
|
|
240
242
|
}
|
|
241
|
-
|
|
243
|
+
|
|
244
|
+
// 计算 isGlobal 字段(userId 为 null 表示全局方案)
|
|
245
|
+
processedScheme.isGlobal = processedScheme.userId === null || processedScheme.userId === undefined;
|
|
246
|
+
return processedScheme;
|
|
242
247
|
});
|
|
243
248
|
});
|
|
244
249
|
}
|
|
@@ -289,11 +294,10 @@ var BackendApiSchemeAdapter = exports.BackendApiSchemeAdapter = /*#__PURE__*/fun
|
|
|
289
294
|
_context3.prev = 0;
|
|
290
295
|
this.log("\u4FDD\u5B58\u5217\u65B9\u6848: ".concat(gridId, " - ").concat(scheme.name));
|
|
291
296
|
|
|
292
|
-
//
|
|
297
|
+
// 【修复】将 columnConfig 转换为 JSON 字符串
|
|
298
|
+
// 【修复】保持 createdAt/updatedAt 为数字类型(时间戳),不要转换为 ISO 字符串 @author nokecy
|
|
293
299
|
schemeForBackend = _objectSpread(_objectSpread({}, scheme), {}, {
|
|
294
|
-
columnConfig: JSON.stringify(scheme.columnConfig)
|
|
295
|
-
createdAt: this.toIsoString(scheme.createdAt),
|
|
296
|
-
updatedAt: this.toIsoString(scheme.updatedAt)
|
|
300
|
+
columnConfig: JSON.stringify(scheme.columnConfig)
|
|
297
301
|
});
|
|
298
302
|
url = "".concat(this.config.apiBaseUrl, "/api/extra-object/table-scheme/save-column-scheme");
|
|
299
303
|
_context3.next = 6;
|
|
@@ -312,20 +316,15 @@ var BackendApiSchemeAdapter = exports.BackendApiSchemeAdapter = /*#__PURE__*/fun
|
|
|
312
316
|
}
|
|
313
317
|
throw new Error(response.message || '保存失败');
|
|
314
318
|
case 9:
|
|
315
|
-
// 【修复】将返回的数据转换回前端格式
|
|
319
|
+
// 【修复】将返回的数据转换回前端格式 @author nokecy
|
|
316
320
|
savedScheme = response.scheme;
|
|
317
321
|
if (savedScheme) {
|
|
318
322
|
// 解析 columnConfig
|
|
319
323
|
if (typeof savedScheme.columnConfig === 'string') {
|
|
320
324
|
savedScheme.columnConfig = JSON.parse(savedScheme.columnConfig);
|
|
321
325
|
}
|
|
322
|
-
//
|
|
323
|
-
|
|
324
|
-
savedScheme.createdAt = this.fromIsoString(savedScheme.createdAt);
|
|
325
|
-
}
|
|
326
|
-
if (savedScheme.updatedAt) {
|
|
327
|
-
savedScheme.updatedAt = this.fromIsoString(savedScheme.updatedAt);
|
|
328
|
-
}
|
|
326
|
+
// 计算 isGlobal 字段
|
|
327
|
+
savedScheme.isGlobal = savedScheme.userId === null || savedScheme.userId === undefined;
|
|
329
328
|
}
|
|
330
329
|
this.log('保存成功', savedScheme);
|
|
331
330
|
return _context3.abrupt("return", savedScheme);
|
|
@@ -230,16 +230,21 @@ export var BackendApiSchemeAdapter = /*#__PURE__*/function () {
|
|
|
230
230
|
return this.request(url);
|
|
231
231
|
case 5:
|
|
232
232
|
response = _context2.sent;
|
|
233
|
-
// 将所有列方案的 columnConfig
|
|
233
|
+
// 将所有列方案的 columnConfig 从字符串解析为对象数组,并计算 isGlobal 字段
|
|
234
|
+
// @author nokecy
|
|
234
235
|
if (response.columnSchemes) {
|
|
235
236
|
Object.keys(response.columnSchemes).forEach(function (gridId) {
|
|
236
237
|
response.columnSchemes[gridId] = response.columnSchemes[gridId].map(function (scheme) {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
var processedScheme = _objectSpread({}, scheme);
|
|
239
|
+
|
|
240
|
+
// 解析 columnConfig
|
|
241
|
+
if (typeof processedScheme.columnConfig === 'string') {
|
|
242
|
+
processedScheme.columnConfig = JSON.parse(processedScheme.columnConfig);
|
|
241
243
|
}
|
|
242
|
-
|
|
244
|
+
|
|
245
|
+
// 计算 isGlobal 字段(userId 为 null 表示全局方案)
|
|
246
|
+
processedScheme.isGlobal = processedScheme.userId === null || processedScheme.userId === undefined;
|
|
247
|
+
return processedScheme;
|
|
243
248
|
});
|
|
244
249
|
});
|
|
245
250
|
}
|
|
@@ -290,11 +295,10 @@ export var BackendApiSchemeAdapter = /*#__PURE__*/function () {
|
|
|
290
295
|
_context3.prev = 0;
|
|
291
296
|
this.log("\u4FDD\u5B58\u5217\u65B9\u6848: ".concat(gridId, " - ").concat(scheme.name));
|
|
292
297
|
|
|
293
|
-
//
|
|
298
|
+
// 【修复】将 columnConfig 转换为 JSON 字符串
|
|
299
|
+
// 【修复】保持 createdAt/updatedAt 为数字类型(时间戳),不要转换为 ISO 字符串 @author nokecy
|
|
294
300
|
schemeForBackend = _objectSpread(_objectSpread({}, scheme), {}, {
|
|
295
|
-
columnConfig: JSON.stringify(scheme.columnConfig)
|
|
296
|
-
createdAt: this.toIsoString(scheme.createdAt),
|
|
297
|
-
updatedAt: this.toIsoString(scheme.updatedAt)
|
|
301
|
+
columnConfig: JSON.stringify(scheme.columnConfig)
|
|
298
302
|
});
|
|
299
303
|
url = "".concat(this.config.apiBaseUrl, "/api/extra-object/table-scheme/save-column-scheme");
|
|
300
304
|
_context3.next = 6;
|
|
@@ -313,20 +317,15 @@ export var BackendApiSchemeAdapter = /*#__PURE__*/function () {
|
|
|
313
317
|
}
|
|
314
318
|
throw new Error(response.message || '保存失败');
|
|
315
319
|
case 9:
|
|
316
|
-
// 【修复】将返回的数据转换回前端格式
|
|
320
|
+
// 【修复】将返回的数据转换回前端格式 @author nokecy
|
|
317
321
|
savedScheme = response.scheme;
|
|
318
322
|
if (savedScheme) {
|
|
319
323
|
// 解析 columnConfig
|
|
320
324
|
if (typeof savedScheme.columnConfig === 'string') {
|
|
321
325
|
savedScheme.columnConfig = JSON.parse(savedScheme.columnConfig);
|
|
322
326
|
}
|
|
323
|
-
//
|
|
324
|
-
|
|
325
|
-
savedScheme.createdAt = this.fromIsoString(savedScheme.createdAt);
|
|
326
|
-
}
|
|
327
|
-
if (savedScheme.updatedAt) {
|
|
328
|
-
savedScheme.updatedAt = this.fromIsoString(savedScheme.updatedAt);
|
|
329
|
-
}
|
|
327
|
+
// 计算 isGlobal 字段
|
|
328
|
+
savedScheme.isGlobal = savedScheme.userId === null || savedScheme.userId === undefined;
|
|
330
329
|
}
|
|
331
330
|
this.log('保存成功', savedScheme);
|
|
332
331
|
return _context3.abrupt("return", savedScheme);
|