@pisell/private-materials 3.4.85 → 3.4.86
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.js +2 -2
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/eftpos/hooks.d.ts +1 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/List/index.js +32 -16
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +16 -10
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/es/components/systemSettings/registry/components/ItemModal.js +121 -51
- package/es/components/systemSettings/registry/locales.d.ts +9 -0
- package/es/components/systemSettings/registry/locales.js +15 -3
- package/es/components/systemSettings/registry/types.d.ts +1 -0
- package/es/hooks/usePaymentLogger.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/eftpos/hooks.d.ts +1 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/List/index.js +19 -11
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +21 -22
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/lib/components/systemSettings/registry/components/ItemModal.js +78 -24
- package/lib/components/systemSettings/registry/locales.d.ts +9 -0
- package/lib/components/systemSettings/registry/locales.js +15 -3
- package/lib/components/systemSettings/registry/types.d.ts +1 -0
- package/lib/hooks/usePaymentLogger.d.ts +1 -0
- package/lowcode/eco-cup-list/meta.ts +1 -1
- package/lowcode/eco-customer-list/meta.ts +1 -1
- package/package.json +4 -4
|
@@ -15,6 +15,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
15
15
|
import React, { useState, useImperativeHandle, forwardRef, useMemo, useContext } from 'react';
|
|
16
16
|
import { Button } from 'antd';
|
|
17
17
|
import { locales } from '@pisell/utils';
|
|
18
|
+
import { useDebounceFn } from 'ahooks';
|
|
18
19
|
import { PisellModal, Iconfont, PisellCheckboxGroup, PisellRow, getBankCardTypeImg, PisellLoading, PisellText } from '@pisell/materials';
|
|
19
20
|
import classNames from 'classnames';
|
|
20
21
|
import { Context } from "../../../model";
|
|
@@ -126,12 +127,15 @@ var MWCreditCardList = function MWCreditCardList(props, ref) {
|
|
|
126
127
|
// 关闭管理卡模式
|
|
127
128
|
setManage(false);
|
|
128
129
|
|
|
130
|
+
// 重置确认按钮loading状态
|
|
131
|
+
setOkLoading(false);
|
|
132
|
+
|
|
129
133
|
// 选中第一个卡
|
|
130
134
|
setCurrentCard(0);
|
|
131
135
|
|
|
132
136
|
// 异步 获取信用卡列表
|
|
133
137
|
_getCreditCardList();
|
|
134
|
-
case
|
|
138
|
+
case 7:
|
|
135
139
|
case "end":
|
|
136
140
|
return _context2.stop();
|
|
137
141
|
}
|
|
@@ -266,21 +270,32 @@ var MWCreditCardList = function MWCreditCardList(props, ref) {
|
|
|
266
270
|
* @Author: zhiwei.Wang
|
|
267
271
|
* @Date: 2024-08-16 11:11
|
|
268
272
|
*/
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
273
|
+
// 确认按钮loading状态
|
|
274
|
+
var _useState13 = useState(false),
|
|
275
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
276
|
+
okLoading = _useState14[0],
|
|
277
|
+
setOkLoading = _useState14[1];
|
|
278
|
+
var _useDebounceFn = useDebounceFn(function () {
|
|
279
|
+
var _props$onChange;
|
|
280
|
+
// 管理卡模式下, 则执行删除卡操作
|
|
281
|
+
if (manage) {
|
|
282
|
+
setManage(false);
|
|
283
|
+
handleBatchDeleteCards();
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
277
286
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
287
|
+
// 展示loading, 防止重复点击
|
|
288
|
+
setOkLoading(true);
|
|
289
|
+
|
|
290
|
+
// 否则回调到外部
|
|
291
|
+
var cur = creditCardList.find(function (d) {
|
|
292
|
+
return d.id === currentCard;
|
|
293
|
+
});
|
|
294
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, cur);
|
|
295
|
+
}, {
|
|
296
|
+
wait: 300
|
|
297
|
+
}),
|
|
298
|
+
onOk = _useDebounceFn.run;
|
|
284
299
|
|
|
285
300
|
// 渲染列表
|
|
286
301
|
var renderList = useMemo(function () {
|
|
@@ -330,7 +345,8 @@ var MWCreditCardList = function MWCreditCardList(props, ref) {
|
|
|
330
345
|
okText: manage ? locales.getText('tocPay.text.done') : okText,
|
|
331
346
|
onOk: onOk,
|
|
332
347
|
okButtonProps: {
|
|
333
|
-
disabled: !currentCard
|
|
348
|
+
disabled: !currentCard,
|
|
349
|
+
loading: okLoading
|
|
334
350
|
},
|
|
335
351
|
bodyStyle: {
|
|
336
352
|
padding: 24
|
|
@@ -367,15 +367,7 @@ export var createThreeDSMethodIframe = /*#__PURE__*/function () {
|
|
|
367
367
|
timer = null; // 返回promise
|
|
368
368
|
return _context3.abrupt("return", new Promise(function (res, rej) {
|
|
369
369
|
var _threeDSMethodData$pa7;
|
|
370
|
-
|
|
371
|
-
timer = setTimeout(function () {
|
|
372
|
-
res(defaultReturnParams);
|
|
373
|
-
log({
|
|
374
|
-
msg: '第三步: 10秒超时则走N逻辑',
|
|
375
|
-
data: threeDSMethodData
|
|
376
|
-
});
|
|
377
|
-
}, (threeDSMethodData === null || threeDSMethodData === void 0 || (_threeDSMethodData$pa7 = threeDSMethodData.pay_info) === null || _threeDSMethodData$pa7 === void 0 ? void 0 : _threeDSMethodData$pa7.tdsMethodTimeoutMS) || 10000);
|
|
378
|
-
window.addEventListener('message', function (event) {
|
|
370
|
+
var handleMessage = function handleMessage(event) {
|
|
379
371
|
// 判断域名
|
|
380
372
|
if (event.origin.indexOf(postmessageUrl) !== -1 || event.origin.indexOf('securesuite') !== -1) {
|
|
381
373
|
// 返回 threeDSServerTransID 则 res
|
|
@@ -388,6 +380,8 @@ export var createThreeDSMethodIframe = /*#__PURE__*/function () {
|
|
|
388
380
|
if (timer) {
|
|
389
381
|
clearTimeout(timer);
|
|
390
382
|
}
|
|
383
|
+
// 移除监听器,防止重复触发
|
|
384
|
+
window.removeEventListener('message', handleMessage);
|
|
391
385
|
// 10秒内成功则走Y逻辑
|
|
392
386
|
res({
|
|
393
387
|
threeDSServerTransID: event.data.threeDSServerTransID,
|
|
@@ -395,7 +389,19 @@ export var createThreeDSMethodIframe = /*#__PURE__*/function () {
|
|
|
395
389
|
});
|
|
396
390
|
}
|
|
397
391
|
}
|
|
398
|
-
}
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
// 10秒内没有成功则走N逻辑
|
|
395
|
+
timer = setTimeout(function () {
|
|
396
|
+
// 超时也要移除监听器
|
|
397
|
+
window.removeEventListener('message', handleMessage);
|
|
398
|
+
res(defaultReturnParams);
|
|
399
|
+
log({
|
|
400
|
+
msg: '第三步: 10秒超时则走N逻辑',
|
|
401
|
+
data: threeDSMethodData
|
|
402
|
+
});
|
|
403
|
+
}, (threeDSMethodData === null || threeDSMethodData === void 0 || (_threeDSMethodData$pa7 = threeDSMethodData.pay_info) === null || _threeDSMethodData$pa7 === void 0 ? void 0 : _threeDSMethodData$pa7.tdsMethodTimeoutMS) || 10000);
|
|
404
|
+
window.addEventListener('message', handleMessage, false);
|
|
399
405
|
}));
|
|
400
406
|
case 28:
|
|
401
407
|
case "end":
|
|
@@ -99,6 +99,9 @@ var interfaceTypeOptions = {
|
|
|
99
99
|
}, {
|
|
100
100
|
value: 'Input.JSON',
|
|
101
101
|
label: 'JSON编辑器'
|
|
102
|
+
}, {
|
|
103
|
+
value: 'RecordListWrapper',
|
|
104
|
+
label: '记录列表包装器'
|
|
102
105
|
}]
|
|
103
106
|
};
|
|
104
107
|
var ItemModal = function ItemModal(_ref) {
|
|
@@ -152,7 +155,9 @@ var ItemModal = function ItemModal(_ref) {
|
|
|
152
155
|
style: {
|
|
153
156
|
width: '100%'
|
|
154
157
|
},
|
|
155
|
-
precision: 0
|
|
158
|
+
precision: 0
|
|
159
|
+
// @ts-ignore
|
|
160
|
+
,
|
|
156
161
|
allowClear: true
|
|
157
162
|
});
|
|
158
163
|
case 'float':
|
|
@@ -160,7 +165,9 @@ var ItemModal = function ItemModal(_ref) {
|
|
|
160
165
|
placeholder: "\u8BF7\u8F93\u5165\u6570\u5B57",
|
|
161
166
|
style: {
|
|
162
167
|
width: '100%'
|
|
163
|
-
}
|
|
168
|
+
}
|
|
169
|
+
// @ts-ignore
|
|
170
|
+
,
|
|
164
171
|
allowClear: true
|
|
165
172
|
});
|
|
166
173
|
case 'boolean':
|
|
@@ -258,6 +265,16 @@ var ItemModal = function ItemModal(_ref) {
|
|
|
258
265
|
};
|
|
259
266
|
}
|
|
260
267
|
|
|
268
|
+
// 处理记录列表包装器JSON配置
|
|
269
|
+
var xRecordSchema = schema['x-record-schema'];
|
|
270
|
+
if (!xRecordSchema) {
|
|
271
|
+
formData.xRecordSchema = '';
|
|
272
|
+
} else if (typeof xRecordSchema === 'string') {
|
|
273
|
+
formData.xRecordSchema = xRecordSchema;
|
|
274
|
+
} else if (_typeof(xRecordSchema) === 'object') {
|
|
275
|
+
formData.xRecordSchema = JSON.stringify(xRecordSchema, null, 2);
|
|
276
|
+
}
|
|
277
|
+
|
|
261
278
|
// 处理自定义UI Schema
|
|
262
279
|
var xCustomUiSchema = schema['x-custom-ui-schema'];
|
|
263
280
|
if (!xCustomUiSchema) {
|
|
@@ -299,7 +316,8 @@ var ItemModal = function ItemModal(_ref) {
|
|
|
299
316
|
xDataSource: {
|
|
300
317
|
type: 'default',
|
|
301
318
|
options: []
|
|
302
|
-
}
|
|
319
|
+
},
|
|
320
|
+
xRecordSchema: ''
|
|
303
321
|
};
|
|
304
322
|
form.setFieldsValue(defaultValues);
|
|
305
323
|
setSelectedFieldType('string');
|
|
@@ -329,6 +347,11 @@ var ItemModal = function ItemModal(_ref) {
|
|
|
329
347
|
}
|
|
330
348
|
});
|
|
331
349
|
|
|
350
|
+
// 清空记录列表包装器JSON配置
|
|
351
|
+
form.setFieldsValue({
|
|
352
|
+
xRecordSchema: ''
|
|
353
|
+
});
|
|
354
|
+
|
|
332
355
|
// 重新验证默认值字段
|
|
333
356
|
form.validateFields(['default']).catch(function () {
|
|
334
357
|
// 验证失败时不做特殊处理,让用户看到错误信息
|
|
@@ -337,15 +360,14 @@ var ItemModal = function ItemModal(_ref) {
|
|
|
337
360
|
|
|
338
361
|
// 处理界面类型变化
|
|
339
362
|
var handleInterfaceTypeChange = function handleInterfaceTypeChange(value) {
|
|
340
|
-
//
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
363
|
+
// 清空选项配置和记录列表包装器JSON配置
|
|
364
|
+
form.setFieldsValue({
|
|
365
|
+
xDataSource: {
|
|
366
|
+
type: 'default',
|
|
367
|
+
options: []
|
|
368
|
+
},
|
|
369
|
+
xRecordSchema: ''
|
|
370
|
+
});
|
|
349
371
|
};
|
|
350
372
|
|
|
351
373
|
// 处理作用域变化
|
|
@@ -361,7 +383,7 @@ var ItemModal = function ItemModal(_ref) {
|
|
|
361
383
|
// 处理确认
|
|
362
384
|
var handleOk = /*#__PURE__*/function () {
|
|
363
385
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
364
|
-
var values, validation, _validation, schema, _ref3, _ref3$type, _type, _ref3$options, options, rest;
|
|
386
|
+
var values, validation, _validation, schema, needUseXDataSource, _ref3, _ref3$type, _type, _ref3$options, options, rest, needUseXRecordSchema;
|
|
365
387
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
366
388
|
while (1) switch (_context.prev = _context.next) {
|
|
367
389
|
case 0:
|
|
@@ -425,72 +447,103 @@ var ItemModal = function ItemModal(_ref) {
|
|
|
425
447
|
_context.t0 = _context["catch"](22);
|
|
426
448
|
throw new Error("UI Schema\u683C\u5F0F\u9519\u8BEF: ".concat(_context.t0 instanceof Error ? _context.t0.message : '未知错误'));
|
|
427
449
|
case 29:
|
|
428
|
-
|
|
429
|
-
|
|
450
|
+
// 将 xDataSource 合并到 schema 的 x-data-source 中
|
|
451
|
+
needUseXDataSource = ['Select', 'RecordListWrapper'].includes(values.interfaceType || '');
|
|
452
|
+
if (!(needUseXDataSource && values.xDataSource)) {
|
|
453
|
+
_context.next = 51;
|
|
430
454
|
break;
|
|
431
455
|
}
|
|
432
456
|
_ref3 = (values === null || values === void 0 ? void 0 : values.xDataSource) || {}, _ref3$type = _ref3.type, _type = _ref3$type === void 0 ? 'default' : _ref3$type, _ref3$options = _ref3.options, options = _ref3$options === void 0 ? [] : _ref3$options, rest = _objectWithoutProperties(_ref3, _excluded);
|
|
433
457
|
if (!(_type === 'default')) {
|
|
434
|
-
_context.next =
|
|
458
|
+
_context.next = 36;
|
|
435
459
|
break;
|
|
436
460
|
}
|
|
437
461
|
schema['x-data-source'] = {
|
|
438
462
|
type: _type,
|
|
439
463
|
options: options
|
|
440
464
|
};
|
|
441
|
-
_context.next =
|
|
465
|
+
_context.next = 49;
|
|
442
466
|
break;
|
|
443
|
-
case
|
|
467
|
+
case 36:
|
|
444
468
|
if (!(_type === 'api')) {
|
|
445
|
-
_context.next =
|
|
469
|
+
_context.next = 48;
|
|
446
470
|
break;
|
|
447
471
|
}
|
|
448
472
|
schema['x-data-source'] = _objectSpread({
|
|
449
473
|
type: _type
|
|
450
474
|
}, rest || {});
|
|
451
475
|
if (!(rest !== null && rest !== void 0 && rest.extraParams)) {
|
|
452
|
-
_context.next =
|
|
476
|
+
_context.next = 46;
|
|
453
477
|
break;
|
|
454
478
|
}
|
|
455
|
-
_context.prev =
|
|
479
|
+
_context.prev = 39;
|
|
456
480
|
schema['x-data-source'].extraParams = JSON.parse(rest.extraParams);
|
|
457
|
-
_context.next =
|
|
481
|
+
_context.next = 46;
|
|
458
482
|
break;
|
|
459
|
-
case
|
|
460
|
-
_context.prev =
|
|
461
|
-
_context.t1 = _context["catch"](
|
|
483
|
+
case 43:
|
|
484
|
+
_context.prev = 43;
|
|
485
|
+
_context.t1 = _context["catch"](39);
|
|
462
486
|
throw new Error("Extra Params\u683C\u5F0F\u9519\u8BEF: ".concat(_context.t1 instanceof Error ? _context.t1.message : '未知错误'));
|
|
463
|
-
case
|
|
464
|
-
_context.next =
|
|
487
|
+
case 46:
|
|
488
|
+
_context.next = 49;
|
|
465
489
|
break;
|
|
466
|
-
case
|
|
490
|
+
case 48:
|
|
467
491
|
if (_type === 'custom') {
|
|
468
492
|
schema['x-data-source'] = {
|
|
469
493
|
type: _type
|
|
470
494
|
};
|
|
471
495
|
}
|
|
472
|
-
case
|
|
496
|
+
case 49:
|
|
497
|
+
_context.next = 52;
|
|
498
|
+
break;
|
|
499
|
+
case 51:
|
|
500
|
+
schema['x-data-source'] = undefined;
|
|
501
|
+
case 52:
|
|
502
|
+
// 将 xRecordSchema 合并到 schema 的 x-record-schema 中
|
|
503
|
+
needUseXRecordSchema = values.interfaceType === 'RecordListWrapper';
|
|
504
|
+
if (!(needUseXRecordSchema && values.xRecordSchema)) {
|
|
505
|
+
_context.next = 63;
|
|
506
|
+
break;
|
|
507
|
+
}
|
|
508
|
+
_context.prev = 54;
|
|
509
|
+
// 验证并解析JSON字符串
|
|
510
|
+
schema['x-record-schema'] = JSON.parse(values.xRecordSchema);
|
|
511
|
+
_context.next = 61;
|
|
512
|
+
break;
|
|
513
|
+
case 58:
|
|
514
|
+
_context.prev = 58;
|
|
515
|
+
_context.t2 = _context["catch"](54);
|
|
516
|
+
throw new Error("Record List Wrapper Schema\u683C\u5F0F\u9519\u8BEF: ".concat(_context.t2 instanceof Error ? _context.t2.message : '未知错误'));
|
|
517
|
+
case 61:
|
|
518
|
+
_context.next = 64;
|
|
519
|
+
break;
|
|
520
|
+
case 63:
|
|
521
|
+
schema['x-record-schema'] = undefined;
|
|
522
|
+
case 64:
|
|
473
523
|
// 更新 uiSchema
|
|
474
524
|
values.schema = Object.keys(schema).length > 0 ? schema : undefined;
|
|
475
525
|
|
|
476
|
-
// 从提交数据中移除 xDataSource
|
|
526
|
+
// 从提交数据中移除 xDataSource
|
|
477
527
|
delete values.xDataSource;
|
|
528
|
+
// 从提交数据中移除 xRecordSchema
|
|
529
|
+
delete values.xRecordSchema;
|
|
530
|
+
// 从提交数据中移除 xCustomUiSchema
|
|
478
531
|
delete values.xCustomUiSchema;
|
|
479
|
-
_context.next =
|
|
532
|
+
_context.next = 70;
|
|
480
533
|
return onOk(values);
|
|
481
|
-
case
|
|
482
|
-
_context.next =
|
|
534
|
+
case 70:
|
|
535
|
+
_context.next = 75;
|
|
483
536
|
break;
|
|
484
|
-
case
|
|
485
|
-
_context.prev =
|
|
486
|
-
_context.
|
|
487
|
-
console.error('Validation failed:', _context.
|
|
537
|
+
case 72:
|
|
538
|
+
_context.prev = 72;
|
|
539
|
+
_context.t3 = _context["catch"](0);
|
|
540
|
+
console.error('Validation failed:', _context.t3);
|
|
488
541
|
// 保存失败时不清空表单,不关闭抽屉
|
|
489
|
-
case
|
|
542
|
+
case 75:
|
|
490
543
|
case "end":
|
|
491
544
|
return _context.stop();
|
|
492
545
|
}
|
|
493
|
-
}, _callee, null, [[0,
|
|
546
|
+
}, _callee, null, [[0, 72], [22, 26], [39, 43], [54, 58]]);
|
|
494
547
|
}));
|
|
495
548
|
return function handleOk() {
|
|
496
549
|
return _ref2.apply(this, arguments);
|
|
@@ -503,6 +556,18 @@ var ItemModal = function ItemModal(_ref) {
|
|
|
503
556
|
onCancel();
|
|
504
557
|
};
|
|
505
558
|
var title = locales.getText(type === 'add' ? 'registry.modal.add.item' : 'registry.modal.edit.item');
|
|
559
|
+
var jsonValidator = function jsonValidator(value, message) {
|
|
560
|
+
// 支持空值时跳过验证
|
|
561
|
+
if (!value || value.trim() === '') {
|
|
562
|
+
return Promise.resolve();
|
|
563
|
+
}
|
|
564
|
+
try {
|
|
565
|
+
JSON.parse(value);
|
|
566
|
+
return Promise.resolve();
|
|
567
|
+
} catch (error) {
|
|
568
|
+
return Promise.reject(new Error(message));
|
|
569
|
+
}
|
|
570
|
+
};
|
|
506
571
|
return /*#__PURE__*/React.createElement(Drawer, {
|
|
507
572
|
title: title,
|
|
508
573
|
open: open,
|
|
@@ -600,10 +665,24 @@ var ItemModal = function ItemModal(_ref) {
|
|
|
600
665
|
key: option.value,
|
|
601
666
|
value: option.value
|
|
602
667
|
}, option.label);
|
|
603
|
-
}))))), _interfaceType
|
|
668
|
+
}))))), ['Select', 'RecordListWrapper'].includes(_interfaceType || '') && /*#__PURE__*/React.createElement(OptionDataSource, {
|
|
604
669
|
form: form,
|
|
605
670
|
treeDataSource: treeDataSource
|
|
606
|
-
}), /*#__PURE__*/React.createElement(Form.Item, {
|
|
671
|
+
}), _interfaceType === 'RecordListWrapper' && /*#__PURE__*/React.createElement(Form.Item, {
|
|
672
|
+
name: "xRecordSchema",
|
|
673
|
+
label: locales.getText('registry.form.recordListWrapper.label'),
|
|
674
|
+
rules: [{
|
|
675
|
+
validator: function validator(_, value) {
|
|
676
|
+
return jsonValidator(value, locales.getText('registry.message.recordListWrapper.invalid'));
|
|
677
|
+
}
|
|
678
|
+
}]
|
|
679
|
+
}, /*#__PURE__*/React.createElement(TextArea, {
|
|
680
|
+
placeholder: locales.getText('registry.form.recordListWrapper.placeholder'),
|
|
681
|
+
rows: 6,
|
|
682
|
+
style: {
|
|
683
|
+
fontFamily: 'monospace'
|
|
684
|
+
}
|
|
685
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
607
686
|
name: "scopes",
|
|
608
687
|
label: locales.getText('registry.form.scopes'),
|
|
609
688
|
rules: [{
|
|
@@ -658,16 +737,7 @@ var ItemModal = function ItemModal(_ref) {
|
|
|
658
737
|
label: locales.getText('registry.form.uiSchema'),
|
|
659
738
|
rules: [{
|
|
660
739
|
validator: function validator(_, value) {
|
|
661
|
-
|
|
662
|
-
if (!value || value.trim() === '') {
|
|
663
|
-
return Promise.resolve();
|
|
664
|
-
}
|
|
665
|
-
try {
|
|
666
|
-
JSON.parse(value);
|
|
667
|
-
return Promise.resolve();
|
|
668
|
-
} catch (error) {
|
|
669
|
-
return Promise.reject(new Error(locales.getText('registry.message.uiSchema.invalid')));
|
|
670
|
-
}
|
|
740
|
+
return jsonValidator(value, locales.getText('registry.message.uiSchema.invalid'));
|
|
671
741
|
}
|
|
672
742
|
}]
|
|
673
743
|
}, /*#__PURE__*/React.createElement(TextArea, {
|
|
@@ -113,6 +113,9 @@ declare const _default: {
|
|
|
113
113
|
'registry.optionDataSource.options.required-desc': string;
|
|
114
114
|
'registry.optionDataSource.options.empty': string;
|
|
115
115
|
'registry.optionDataSource.options.add': string;
|
|
116
|
+
'registry.form.recordListWrapper.label': string;
|
|
117
|
+
'registry.form.recordListWrapper.placeholder': string;
|
|
118
|
+
'registry.message.recordListWrapper.invalid': string;
|
|
116
119
|
};
|
|
117
120
|
'zh-CN': {
|
|
118
121
|
'registry.title': string;
|
|
@@ -228,6 +231,9 @@ declare const _default: {
|
|
|
228
231
|
'registry.optionDataSource.options.required-desc': string;
|
|
229
232
|
'registry.optionDataSource.options.empty': string;
|
|
230
233
|
'registry.optionDataSource.options.add': string;
|
|
234
|
+
'registry.form.recordListWrapper.label': string;
|
|
235
|
+
'registry.form.recordListWrapper.placeholder': string;
|
|
236
|
+
'registry.message.recordListWrapper.invalid': string;
|
|
231
237
|
};
|
|
232
238
|
'zh-HK': {
|
|
233
239
|
'registry.title': string;
|
|
@@ -336,6 +342,9 @@ declare const _default: {
|
|
|
336
342
|
'registry.optionDataSource.options.required-desc': string;
|
|
337
343
|
'registry.optionDataSource.options.empty': string;
|
|
338
344
|
'registry.optionDataSource.options.add': string;
|
|
345
|
+
'registry.form.recordListWrapper.label': string;
|
|
346
|
+
'registry.form.recordListWrapper.placeholder': string;
|
|
347
|
+
'registry.message.recordListWrapper.invalid': string;
|
|
339
348
|
};
|
|
340
349
|
ja: {
|
|
341
350
|
'registry.title': string;
|
|
@@ -124,7 +124,11 @@ export default {
|
|
|
124
124
|
'registry.optionDataSource.options.drag-desc': 'Drag rows to reorder.',
|
|
125
125
|
'registry.optionDataSource.options.required-desc': 'Each option must have a value and a label.',
|
|
126
126
|
'registry.optionDataSource.options.empty': 'Please add at least one option for Pre-defined data source.',
|
|
127
|
-
'registry.optionDataSource.options.add': 'Add Option'
|
|
127
|
+
'registry.optionDataSource.options.add': 'Add Option',
|
|
128
|
+
// 记录列表包装器JSON配置
|
|
129
|
+
'registry.form.recordListWrapper.label': 'Record List Wrapper Schema',
|
|
130
|
+
'registry.form.recordListWrapper.placeholder': 'Please enter record list wrapper schema in JSON format',
|
|
131
|
+
'registry.message.recordListWrapper.invalid': 'Please enter valid JSON format'
|
|
128
132
|
},
|
|
129
133
|
'zh-CN': {
|
|
130
134
|
// 页面标题
|
|
@@ -251,7 +255,11 @@ export default {
|
|
|
251
255
|
'registry.optionDataSource.options.drag-desc': '拖拽行可调整顺序。',
|
|
252
256
|
'registry.optionDataSource.options.required-desc': '每个选项必须有选项值和标签。',
|
|
253
257
|
'registry.optionDataSource.options.empty': '预设类型至少需要添加一个选项。',
|
|
254
|
-
'registry.optionDataSource.options.add': '添加选项'
|
|
258
|
+
'registry.optionDataSource.options.add': '添加选项',
|
|
259
|
+
// 记录列表包装器JSON配置
|
|
260
|
+
'registry.form.recordListWrapper.label': '记录列表包装器JSON配置',
|
|
261
|
+
'registry.form.recordListWrapper.placeholder': '请输入记录列表包装器JSON配置',
|
|
262
|
+
'registry.message.recordListWrapper.invalid': '请输入有效的JSON格式'
|
|
255
263
|
},
|
|
256
264
|
'zh-HK': {
|
|
257
265
|
// 页面标题
|
|
@@ -370,7 +378,11 @@ export default {
|
|
|
370
378
|
'registry.optionDataSource.options.drag-desc': '拖拽行可調整順序。',
|
|
371
379
|
'registry.optionDataSource.options.required-desc': '每個選項必須有選項值和標籤。',
|
|
372
380
|
'registry.optionDataSource.options.empty': '預設類型至少需要添加一個選項。',
|
|
373
|
-
'registry.optionDataSource.options.add': '添加選項'
|
|
381
|
+
'registry.optionDataSource.options.add': '添加選項',
|
|
382
|
+
// 记录列表包装器JSON配置
|
|
383
|
+
'registry.form.recordListWrapper.label': '記錄列表包裝器JSON配置',
|
|
384
|
+
'registry.form.recordListWrapper.placeholder': '請輸入記錄列表包裝器JSON配置',
|
|
385
|
+
'registry.message.recordListWrapper.invalid': '請輸入有效的JSON格式'
|
|
374
386
|
},
|
|
375
387
|
ja: {
|
|
376
388
|
'registry.title': '設定レジストリ',
|
|
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(List_exports);
|
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_utils = require("@pisell/utils");
|
|
38
|
+
var import_ahooks = require("ahooks");
|
|
38
39
|
var import_materials = require("@pisell/materials");
|
|
39
40
|
var import_classnames = __toESM(require("classnames"));
|
|
40
41
|
var import_model = require("../../../model");
|
|
@@ -63,6 +64,7 @@ var MWCreditCardList = (props, ref) => {
|
|
|
63
64
|
setOrder(_order);
|
|
64
65
|
setOpen(true);
|
|
65
66
|
setManage(false);
|
|
67
|
+
setOkLoading(false);
|
|
66
68
|
setCurrentCard(0);
|
|
67
69
|
_getCreditCardList();
|
|
68
70
|
};
|
|
@@ -137,16 +139,21 @@ var MWCreditCardList = (props, ref) => {
|
|
|
137
139
|
});
|
|
138
140
|
}
|
|
139
141
|
};
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
const [okLoading, setOkLoading] = (0, import_react.useState)(false);
|
|
143
|
+
const { run: onOk } = (0, import_ahooks.useDebounceFn)(
|
|
144
|
+
() => {
|
|
145
|
+
var _a;
|
|
146
|
+
if (manage) {
|
|
147
|
+
setManage(false);
|
|
148
|
+
handleBatchDeleteCards();
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
setOkLoading(true);
|
|
152
|
+
let cur = creditCardList.find((d) => d.id === currentCard);
|
|
153
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, cur);
|
|
154
|
+
},
|
|
155
|
+
{ wait: 300 }
|
|
156
|
+
);
|
|
150
157
|
const renderList = (0, import_react.useMemo)(() => {
|
|
151
158
|
return creditCardList.filter((d) => d.delete !== 1);
|
|
152
159
|
}, [creditCardList]);
|
|
@@ -178,7 +185,8 @@ var MWCreditCardList = (props, ref) => {
|
|
|
178
185
|
okText: manage ? import_utils.locales.getText("tocPay.text.done") : okText,
|
|
179
186
|
onOk,
|
|
180
187
|
okButtonProps: {
|
|
181
|
-
disabled: !currentCard
|
|
188
|
+
disabled: !currentCard,
|
|
189
|
+
loading: okLoading
|
|
182
190
|
},
|
|
183
191
|
bodyStyle: { padding: 24 }
|
|
184
192
|
},
|