@nokecy/qc-ui 1.1.32 → 1.1.33
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
|
}
|
|
@@ -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
|
}
|