@nokecy/qc-ui 1.0.98 → 1.0.99
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.
|
@@ -198,23 +198,55 @@ var BackendApiSchemeAdapter = exports.BackendApiSchemeAdapter = /*#__PURE__*/fun
|
|
|
198
198
|
return this.request(url);
|
|
199
199
|
case 5:
|
|
200
200
|
response = _context2.sent;
|
|
201
|
+
// 将所有列方案的 columnConfig 从字符串解析为对象数组
|
|
202
|
+
if (response.columnSchemes) {
|
|
203
|
+
Object.keys(response.columnSchemes).forEach(function (gridId) {
|
|
204
|
+
response.columnSchemes[gridId] = response.columnSchemes[gridId].map(function (scheme) {
|
|
205
|
+
if (typeof scheme.columnConfig === 'string') {
|
|
206
|
+
return _objectSpread(_objectSpread({}, scheme), {}, {
|
|
207
|
+
columnConfig: JSON.parse(scheme.columnConfig)
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
return scheme;
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// 将所有查询方案的字段从字符串解析为数组和对象
|
|
216
|
+
if (response.querySchemes) {
|
|
217
|
+
Object.keys(response.querySchemes).forEach(function (gridId) {
|
|
218
|
+
response.querySchemes[gridId] = response.querySchemes[gridId].map(function (scheme) {
|
|
219
|
+
var parsedScheme = _objectSpread({}, scheme);
|
|
220
|
+
if (typeof parsedScheme.itemsOrder === 'string') {
|
|
221
|
+
parsedScheme.itemsOrder = JSON.parse(parsedScheme.itemsOrder);
|
|
222
|
+
}
|
|
223
|
+
if (typeof parsedScheme.hiddenFields === 'string') {
|
|
224
|
+
parsedScheme.hiddenFields = JSON.parse(parsedScheme.hiddenFields);
|
|
225
|
+
}
|
|
226
|
+
if (typeof parsedScheme.formValues === 'string') {
|
|
227
|
+
parsedScheme.formValues = JSON.parse(parsedScheme.formValues);
|
|
228
|
+
}
|
|
229
|
+
return parsedScheme;
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
}
|
|
201
233
|
this.log('加载完成', {
|
|
202
234
|
columnSchemes: Object.keys(response.columnSchemes || {}).length,
|
|
203
235
|
querySchemes: Object.keys(response.querySchemes || {}).length,
|
|
204
236
|
version: response.version
|
|
205
237
|
});
|
|
206
238
|
return _context2.abrupt("return", response);
|
|
207
|
-
case
|
|
208
|
-
_context2.prev =
|
|
239
|
+
case 12:
|
|
240
|
+
_context2.prev = 12;
|
|
209
241
|
_context2.t0 = _context2["catch"](0);
|
|
210
242
|
console.error('[BackendApiAdapter] 加载方案失败:', _context2.t0);
|
|
211
243
|
_antd.message.error('加载方案失败');
|
|
212
244
|
throw _context2.t0;
|
|
213
|
-
case
|
|
245
|
+
case 17:
|
|
214
246
|
case "end":
|
|
215
247
|
return _context2.stop();
|
|
216
248
|
}
|
|
217
|
-
}, _callee2, this, [[0,
|
|
249
|
+
}, _callee2, this, [[0, 12]]);
|
|
218
250
|
}));
|
|
219
251
|
function loadAllSchemes() {
|
|
220
252
|
return _loadAllSchemes.apply(this, arguments);
|
|
@@ -225,42 +257,52 @@ var BackendApiSchemeAdapter = exports.BackendApiSchemeAdapter = /*#__PURE__*/fun
|
|
|
225
257
|
key: "saveColumnScheme",
|
|
226
258
|
value: function () {
|
|
227
259
|
var _saveColumnScheme = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(gridId, scheme) {
|
|
228
|
-
var url, response;
|
|
260
|
+
var schemeForBackend, url, response, savedScheme;
|
|
229
261
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
230
262
|
while (1) switch (_context3.prev = _context3.next) {
|
|
231
263
|
case 0:
|
|
232
264
|
_context3.prev = 0;
|
|
233
265
|
this.log("\u4FDD\u5B58\u5217\u65B9\u6848: ".concat(gridId, " - ").concat(scheme.name));
|
|
266
|
+
|
|
267
|
+
// 将 columnConfig 转换为 JSON 字符串
|
|
268
|
+
schemeForBackend = _objectSpread(_objectSpread({}, scheme), {}, {
|
|
269
|
+
columnConfig: JSON.stringify(scheme.columnConfig)
|
|
270
|
+
});
|
|
234
271
|
url = "".concat(this.config.apiBaseUrl, "/api/extra-object/table-scheme/save-column-scheme");
|
|
235
|
-
_context3.next =
|
|
272
|
+
_context3.next = 6;
|
|
236
273
|
return this.request(url, {
|
|
237
274
|
method: 'POST',
|
|
238
275
|
body: JSON.stringify({
|
|
239
276
|
gridId: gridId,
|
|
240
|
-
scheme:
|
|
277
|
+
scheme: schemeForBackend
|
|
241
278
|
})
|
|
242
279
|
});
|
|
243
|
-
case
|
|
280
|
+
case 6:
|
|
244
281
|
response = _context3.sent;
|
|
245
282
|
if (response.success) {
|
|
246
|
-
_context3.next =
|
|
283
|
+
_context3.next = 9;
|
|
247
284
|
break;
|
|
248
285
|
}
|
|
249
286
|
throw new Error(response.message || '保存失败');
|
|
250
|
-
case
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
287
|
+
case 9:
|
|
288
|
+
// 将返回的 columnConfig 从字符串解析为对象数组
|
|
289
|
+
savedScheme = response.scheme;
|
|
290
|
+
if (savedScheme && typeof savedScheme.columnConfig === 'string') {
|
|
291
|
+
savedScheme.columnConfig = JSON.parse(savedScheme.columnConfig);
|
|
292
|
+
}
|
|
293
|
+
this.log('保存成功', savedScheme);
|
|
294
|
+
return _context3.abrupt("return", savedScheme);
|
|
295
|
+
case 15:
|
|
296
|
+
_context3.prev = 15;
|
|
255
297
|
_context3.t0 = _context3["catch"](0);
|
|
256
298
|
console.error('[BackendApiAdapter] 保存列方案失败:', _context3.t0);
|
|
257
299
|
_antd.message.error('保存列方案失败');
|
|
258
300
|
throw _context3.t0;
|
|
259
|
-
case
|
|
301
|
+
case 20:
|
|
260
302
|
case "end":
|
|
261
303
|
return _context3.stop();
|
|
262
304
|
}
|
|
263
|
-
}, _callee3, this, [[0,
|
|
305
|
+
}, _callee3, this, [[0, 15]]);
|
|
264
306
|
}));
|
|
265
307
|
function saveColumnScheme(_x2, _x3) {
|
|
266
308
|
return _saveColumnScheme.apply(this, arguments);
|
|
@@ -314,42 +356,62 @@ var BackendApiSchemeAdapter = exports.BackendApiSchemeAdapter = /*#__PURE__*/fun
|
|
|
314
356
|
key: "saveQueryScheme",
|
|
315
357
|
value: function () {
|
|
316
358
|
var _saveQueryScheme = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(gridId, scheme) {
|
|
317
|
-
var url, response;
|
|
359
|
+
var schemeForBackend, url, response, savedScheme;
|
|
318
360
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
319
361
|
while (1) switch (_context5.prev = _context5.next) {
|
|
320
362
|
case 0:
|
|
321
363
|
_context5.prev = 0;
|
|
322
364
|
this.log("\u4FDD\u5B58\u67E5\u8BE2\u65B9\u6848: ".concat(gridId, " - ").concat(scheme.name));
|
|
365
|
+
|
|
366
|
+
// 将数组和对象字段转换为 JSON 字符串
|
|
367
|
+
schemeForBackend = _objectSpread(_objectSpread({}, scheme), {}, {
|
|
368
|
+
itemsOrder: scheme.itemsOrder ? JSON.stringify(scheme.itemsOrder) : undefined,
|
|
369
|
+
hiddenFields: scheme.hiddenFields ? JSON.stringify(scheme.hiddenFields) : undefined,
|
|
370
|
+
formValues: scheme.formValues ? JSON.stringify(scheme.formValues) : undefined
|
|
371
|
+
});
|
|
323
372
|
url = "".concat(this.config.apiBaseUrl, "/api/extra-object/table-scheme/save-query-scheme");
|
|
324
|
-
_context5.next =
|
|
373
|
+
_context5.next = 6;
|
|
325
374
|
return this.request(url, {
|
|
326
375
|
method: 'POST',
|
|
327
376
|
body: JSON.stringify({
|
|
328
377
|
gridId: gridId,
|
|
329
|
-
scheme:
|
|
378
|
+
scheme: schemeForBackend
|
|
330
379
|
})
|
|
331
380
|
});
|
|
332
|
-
case
|
|
381
|
+
case 6:
|
|
333
382
|
response = _context5.sent;
|
|
334
383
|
if (response.success) {
|
|
335
|
-
_context5.next =
|
|
384
|
+
_context5.next = 9;
|
|
336
385
|
break;
|
|
337
386
|
}
|
|
338
387
|
throw new Error(response.message || '保存失败');
|
|
339
|
-
case
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
388
|
+
case 9:
|
|
389
|
+
// 将返回的字符串字段解析为数组和对象
|
|
390
|
+
savedScheme = response.scheme;
|
|
391
|
+
if (savedScheme) {
|
|
392
|
+
if (typeof savedScheme.itemsOrder === 'string') {
|
|
393
|
+
savedScheme.itemsOrder = JSON.parse(savedScheme.itemsOrder);
|
|
394
|
+
}
|
|
395
|
+
if (typeof savedScheme.hiddenFields === 'string') {
|
|
396
|
+
savedScheme.hiddenFields = JSON.parse(savedScheme.hiddenFields);
|
|
397
|
+
}
|
|
398
|
+
if (typeof savedScheme.formValues === 'string') {
|
|
399
|
+
savedScheme.formValues = JSON.parse(savedScheme.formValues);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
this.log('保存成功', savedScheme);
|
|
403
|
+
return _context5.abrupt("return", savedScheme);
|
|
404
|
+
case 15:
|
|
405
|
+
_context5.prev = 15;
|
|
344
406
|
_context5.t0 = _context5["catch"](0);
|
|
345
407
|
console.error('[BackendApiAdapter] 保存查询方案失败:', _context5.t0);
|
|
346
408
|
_antd.message.error('保存查询方案失败');
|
|
347
409
|
throw _context5.t0;
|
|
348
|
-
case
|
|
410
|
+
case 20:
|
|
349
411
|
case "end":
|
|
350
412
|
return _context5.stop();
|
|
351
413
|
}
|
|
352
|
-
}, _callee5, this, [[0,
|
|
414
|
+
}, _callee5, this, [[0, 15]]);
|
|
353
415
|
}));
|
|
354
416
|
function saveQueryScheme(_x6, _x7) {
|
|
355
417
|
return _saveQueryScheme.apply(this, arguments);
|
|
@@ -199,23 +199,55 @@ export var BackendApiSchemeAdapter = /*#__PURE__*/function () {
|
|
|
199
199
|
return this.request(url);
|
|
200
200
|
case 5:
|
|
201
201
|
response = _context2.sent;
|
|
202
|
+
// 将所有列方案的 columnConfig 从字符串解析为对象数组
|
|
203
|
+
if (response.columnSchemes) {
|
|
204
|
+
Object.keys(response.columnSchemes).forEach(function (gridId) {
|
|
205
|
+
response.columnSchemes[gridId] = response.columnSchemes[gridId].map(function (scheme) {
|
|
206
|
+
if (typeof scheme.columnConfig === 'string') {
|
|
207
|
+
return _objectSpread(_objectSpread({}, scheme), {}, {
|
|
208
|
+
columnConfig: JSON.parse(scheme.columnConfig)
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
return scheme;
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// 将所有查询方案的字段从字符串解析为数组和对象
|
|
217
|
+
if (response.querySchemes) {
|
|
218
|
+
Object.keys(response.querySchemes).forEach(function (gridId) {
|
|
219
|
+
response.querySchemes[gridId] = response.querySchemes[gridId].map(function (scheme) {
|
|
220
|
+
var parsedScheme = _objectSpread({}, scheme);
|
|
221
|
+
if (typeof parsedScheme.itemsOrder === 'string') {
|
|
222
|
+
parsedScheme.itemsOrder = JSON.parse(parsedScheme.itemsOrder);
|
|
223
|
+
}
|
|
224
|
+
if (typeof parsedScheme.hiddenFields === 'string') {
|
|
225
|
+
parsedScheme.hiddenFields = JSON.parse(parsedScheme.hiddenFields);
|
|
226
|
+
}
|
|
227
|
+
if (typeof parsedScheme.formValues === 'string') {
|
|
228
|
+
parsedScheme.formValues = JSON.parse(parsedScheme.formValues);
|
|
229
|
+
}
|
|
230
|
+
return parsedScheme;
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
}
|
|
202
234
|
this.log('加载完成', {
|
|
203
235
|
columnSchemes: Object.keys(response.columnSchemes || {}).length,
|
|
204
236
|
querySchemes: Object.keys(response.querySchemes || {}).length,
|
|
205
237
|
version: response.version
|
|
206
238
|
});
|
|
207
239
|
return _context2.abrupt("return", response);
|
|
208
|
-
case
|
|
209
|
-
_context2.prev =
|
|
240
|
+
case 12:
|
|
241
|
+
_context2.prev = 12;
|
|
210
242
|
_context2.t0 = _context2["catch"](0);
|
|
211
243
|
console.error('[BackendApiAdapter] 加载方案失败:', _context2.t0);
|
|
212
244
|
message.error('加载方案失败');
|
|
213
245
|
throw _context2.t0;
|
|
214
|
-
case
|
|
246
|
+
case 17:
|
|
215
247
|
case "end":
|
|
216
248
|
return _context2.stop();
|
|
217
249
|
}
|
|
218
|
-
}, _callee2, this, [[0,
|
|
250
|
+
}, _callee2, this, [[0, 12]]);
|
|
219
251
|
}));
|
|
220
252
|
function loadAllSchemes() {
|
|
221
253
|
return _loadAllSchemes.apply(this, arguments);
|
|
@@ -226,42 +258,52 @@ export var BackendApiSchemeAdapter = /*#__PURE__*/function () {
|
|
|
226
258
|
key: "saveColumnScheme",
|
|
227
259
|
value: function () {
|
|
228
260
|
var _saveColumnScheme = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(gridId, scheme) {
|
|
229
|
-
var url, response;
|
|
261
|
+
var schemeForBackend, url, response, savedScheme;
|
|
230
262
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
231
263
|
while (1) switch (_context3.prev = _context3.next) {
|
|
232
264
|
case 0:
|
|
233
265
|
_context3.prev = 0;
|
|
234
266
|
this.log("\u4FDD\u5B58\u5217\u65B9\u6848: ".concat(gridId, " - ").concat(scheme.name));
|
|
267
|
+
|
|
268
|
+
// 将 columnConfig 转换为 JSON 字符串
|
|
269
|
+
schemeForBackend = _objectSpread(_objectSpread({}, scheme), {}, {
|
|
270
|
+
columnConfig: JSON.stringify(scheme.columnConfig)
|
|
271
|
+
});
|
|
235
272
|
url = "".concat(this.config.apiBaseUrl, "/api/extra-object/table-scheme/save-column-scheme");
|
|
236
|
-
_context3.next =
|
|
273
|
+
_context3.next = 6;
|
|
237
274
|
return this.request(url, {
|
|
238
275
|
method: 'POST',
|
|
239
276
|
body: JSON.stringify({
|
|
240
277
|
gridId: gridId,
|
|
241
|
-
scheme:
|
|
278
|
+
scheme: schemeForBackend
|
|
242
279
|
})
|
|
243
280
|
});
|
|
244
|
-
case
|
|
281
|
+
case 6:
|
|
245
282
|
response = _context3.sent;
|
|
246
283
|
if (response.success) {
|
|
247
|
-
_context3.next =
|
|
284
|
+
_context3.next = 9;
|
|
248
285
|
break;
|
|
249
286
|
}
|
|
250
287
|
throw new Error(response.message || '保存失败');
|
|
251
|
-
case
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
288
|
+
case 9:
|
|
289
|
+
// 将返回的 columnConfig 从字符串解析为对象数组
|
|
290
|
+
savedScheme = response.scheme;
|
|
291
|
+
if (savedScheme && typeof savedScheme.columnConfig === 'string') {
|
|
292
|
+
savedScheme.columnConfig = JSON.parse(savedScheme.columnConfig);
|
|
293
|
+
}
|
|
294
|
+
this.log('保存成功', savedScheme);
|
|
295
|
+
return _context3.abrupt("return", savedScheme);
|
|
296
|
+
case 15:
|
|
297
|
+
_context3.prev = 15;
|
|
256
298
|
_context3.t0 = _context3["catch"](0);
|
|
257
299
|
console.error('[BackendApiAdapter] 保存列方案失败:', _context3.t0);
|
|
258
300
|
message.error('保存列方案失败');
|
|
259
301
|
throw _context3.t0;
|
|
260
|
-
case
|
|
302
|
+
case 20:
|
|
261
303
|
case "end":
|
|
262
304
|
return _context3.stop();
|
|
263
305
|
}
|
|
264
|
-
}, _callee3, this, [[0,
|
|
306
|
+
}, _callee3, this, [[0, 15]]);
|
|
265
307
|
}));
|
|
266
308
|
function saveColumnScheme(_x2, _x3) {
|
|
267
309
|
return _saveColumnScheme.apply(this, arguments);
|
|
@@ -315,42 +357,62 @@ export var BackendApiSchemeAdapter = /*#__PURE__*/function () {
|
|
|
315
357
|
key: "saveQueryScheme",
|
|
316
358
|
value: function () {
|
|
317
359
|
var _saveQueryScheme = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(gridId, scheme) {
|
|
318
|
-
var url, response;
|
|
360
|
+
var schemeForBackend, url, response, savedScheme;
|
|
319
361
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
320
362
|
while (1) switch (_context5.prev = _context5.next) {
|
|
321
363
|
case 0:
|
|
322
364
|
_context5.prev = 0;
|
|
323
365
|
this.log("\u4FDD\u5B58\u67E5\u8BE2\u65B9\u6848: ".concat(gridId, " - ").concat(scheme.name));
|
|
366
|
+
|
|
367
|
+
// 将数组和对象字段转换为 JSON 字符串
|
|
368
|
+
schemeForBackend = _objectSpread(_objectSpread({}, scheme), {}, {
|
|
369
|
+
itemsOrder: scheme.itemsOrder ? JSON.stringify(scheme.itemsOrder) : undefined,
|
|
370
|
+
hiddenFields: scheme.hiddenFields ? JSON.stringify(scheme.hiddenFields) : undefined,
|
|
371
|
+
formValues: scheme.formValues ? JSON.stringify(scheme.formValues) : undefined
|
|
372
|
+
});
|
|
324
373
|
url = "".concat(this.config.apiBaseUrl, "/api/extra-object/table-scheme/save-query-scheme");
|
|
325
|
-
_context5.next =
|
|
374
|
+
_context5.next = 6;
|
|
326
375
|
return this.request(url, {
|
|
327
376
|
method: 'POST',
|
|
328
377
|
body: JSON.stringify({
|
|
329
378
|
gridId: gridId,
|
|
330
|
-
scheme:
|
|
379
|
+
scheme: schemeForBackend
|
|
331
380
|
})
|
|
332
381
|
});
|
|
333
|
-
case
|
|
382
|
+
case 6:
|
|
334
383
|
response = _context5.sent;
|
|
335
384
|
if (response.success) {
|
|
336
|
-
_context5.next =
|
|
385
|
+
_context5.next = 9;
|
|
337
386
|
break;
|
|
338
387
|
}
|
|
339
388
|
throw new Error(response.message || '保存失败');
|
|
340
|
-
case
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
389
|
+
case 9:
|
|
390
|
+
// 将返回的字符串字段解析为数组和对象
|
|
391
|
+
savedScheme = response.scheme;
|
|
392
|
+
if (savedScheme) {
|
|
393
|
+
if (typeof savedScheme.itemsOrder === 'string') {
|
|
394
|
+
savedScheme.itemsOrder = JSON.parse(savedScheme.itemsOrder);
|
|
395
|
+
}
|
|
396
|
+
if (typeof savedScheme.hiddenFields === 'string') {
|
|
397
|
+
savedScheme.hiddenFields = JSON.parse(savedScheme.hiddenFields);
|
|
398
|
+
}
|
|
399
|
+
if (typeof savedScheme.formValues === 'string') {
|
|
400
|
+
savedScheme.formValues = JSON.parse(savedScheme.formValues);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
this.log('保存成功', savedScheme);
|
|
404
|
+
return _context5.abrupt("return", savedScheme);
|
|
405
|
+
case 15:
|
|
406
|
+
_context5.prev = 15;
|
|
345
407
|
_context5.t0 = _context5["catch"](0);
|
|
346
408
|
console.error('[BackendApiAdapter] 保存查询方案失败:', _context5.t0);
|
|
347
409
|
message.error('保存查询方案失败');
|
|
348
410
|
throw _context5.t0;
|
|
349
|
-
case
|
|
411
|
+
case 20:
|
|
350
412
|
case "end":
|
|
351
413
|
return _context5.stop();
|
|
352
414
|
}
|
|
353
|
-
}, _callee5, this, [[0,
|
|
415
|
+
}, _callee5, this, [[0, 15]]);
|
|
354
416
|
}));
|
|
355
417
|
function saveQueryScheme(_x6, _x7) {
|
|
356
418
|
return _saveQueryScheme.apply(this, arguments);
|