@pisell/materials 2.2.61 → 2.2.63
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +150 -150
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +24 -28
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +25 -29
- package/es/components/pisellAvatar/index.js +1 -1
- package/es/components/pisellWalletPassCard/index.js +5 -3
- package/es/components/productCard/components/Time/components/SelectHolder/index.js +8 -2
- package/es/components/productCard/components/Time/components/SelectHolder/index.less +1 -3
- package/es/components/productCard/components/Time/components/SelectResource/index.js +3 -1
- package/es/components/productCard/components/Time/index.d.ts +1 -0
- package/es/components/productCard/components/Time/index.js +3 -2
- package/es/components/productCard/index.js +0 -1
- package/es/components/productCard/locales.d.ts +3 -0
- package/es/components/productCard/locales.js +9 -0
- package/es/components/productCard/utils.js +12 -2
- package/lib/components/pisellAvatar/index.js +1 -1
- package/lib/components/pisellWalletPassCard/index.js +5 -3
- package/lib/components/productCard/components/Time/components/SelectHolder/index.js +5 -7
- package/lib/components/productCard/components/Time/components/SelectHolder/index.less +1 -3
- package/lib/components/productCard/components/Time/components/SelectResource/index.js +25 -18
- package/lib/components/productCard/components/Time/index.d.ts +1 -0
- package/lib/components/productCard/components/Time/index.js +1 -0
- package/lib/components/productCard/index.js +0 -1
- package/lib/components/productCard/locales.d.ts +3 -0
- package/lib/components/productCard/locales.js +6 -3
- package/lib/components/productCard/utils.js +12 -3
- package/package.json +1 -1
|
@@ -54,7 +54,7 @@ var PisellAvatar = function PisellAvatar(_ref) {
|
|
|
54
54
|
var mergedStyle = _objectSpread(_objectSpread({}, style), {}, {
|
|
55
55
|
width: sizeMap[size],
|
|
56
56
|
height: sizeMap[size],
|
|
57
|
-
fontSize:
|
|
57
|
+
fontSize: fontSizeMap[size],
|
|
58
58
|
lineHeight: "".concat(sizeMap[size], "px"),
|
|
59
59
|
borderRadius: shape === 'square' ? "".concat(borderRadius, "px") : '50%'
|
|
60
60
|
});
|
|
@@ -318,7 +318,7 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
|
|
|
318
318
|
style: {
|
|
319
319
|
width: '100%'
|
|
320
320
|
},
|
|
321
|
-
max: 'redeem' === name ? originData.available_max_amount : undefined
|
|
321
|
+
max: 'redeem' === name ? originData === null || originData === void 0 ? void 0 : originData.available_max_amount : undefined
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
324
|
return /*#__PURE__*/React.createElement(Input, {
|
|
@@ -339,7 +339,8 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
|
|
|
339
339
|
width: 480,
|
|
340
340
|
onOk: _onConfirmEdit,
|
|
341
341
|
okText: getText('pisell-wallet-pass-card-confirm'),
|
|
342
|
-
cancelText: getText('pisell-wallet-pass-card-cancel')
|
|
342
|
+
cancelText: getText('pisell-wallet-pass-card-cancel'),
|
|
343
|
+
platform: "pc"
|
|
343
344
|
}, /*#__PURE__*/React.createElement(Form, {
|
|
344
345
|
form: form,
|
|
345
346
|
layout: 'vertical',
|
|
@@ -367,7 +368,8 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
|
|
|
367
368
|
},
|
|
368
369
|
width: 480,
|
|
369
370
|
className: "pisell-wallet-pass-card-detail-modal",
|
|
370
|
-
footer: null
|
|
371
|
+
footer: null,
|
|
372
|
+
platform: "pc"
|
|
371
373
|
}, /*#__PURE__*/React.createElement(Form, {
|
|
372
374
|
form: form2,
|
|
373
375
|
disabled: true,
|
|
@@ -25,6 +25,10 @@ var SelectHolder = function SelectHolder(_ref) {
|
|
|
25
25
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26
26
|
selectedValue = _useState2[0],
|
|
27
27
|
setSelectedValue = _useState2[1];
|
|
28
|
+
var _useState3 = useState(false),
|
|
29
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
30
|
+
open = _useState4[0],
|
|
31
|
+
setOpen = _useState4[1];
|
|
28
32
|
useEffect(function () {
|
|
29
33
|
setSelectedValue(value);
|
|
30
34
|
}, [value]);
|
|
@@ -41,14 +45,16 @@ var SelectHolder = function SelectHolder(_ref) {
|
|
|
41
45
|
e.preventDefault();
|
|
42
46
|
e.stopPropagation();
|
|
43
47
|
onAddHolder();
|
|
48
|
+
setOpen(false);
|
|
44
49
|
};
|
|
45
|
-
console.log(lists, isShowAddHolderButton, addHolderButtonText, 'select-holder');
|
|
46
50
|
var isError = useMemo(function () {
|
|
47
51
|
if (!selectedValue && isErrorHolder) return true;
|
|
48
52
|
}, [selectedValue, isErrorHolder]);
|
|
49
53
|
return /*#__PURE__*/React.createElement("div", {
|
|
50
54
|
className: "pisell-lowcode-product-card-select-holder ".concat(isError ? 'pisell-lowcode-product-card-select-holder-error' : '')
|
|
51
55
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
56
|
+
open: open,
|
|
57
|
+
onDropdownVisibleChange: setOpen,
|
|
52
58
|
onClick: function onClick(e) {
|
|
53
59
|
return e.stopPropagation();
|
|
54
60
|
},
|
|
@@ -60,7 +66,7 @@ var SelectHolder = function SelectHolder(_ref) {
|
|
|
60
66
|
return _onChange('');
|
|
61
67
|
},
|
|
62
68
|
value: selectedValue,
|
|
63
|
-
placeholder: locales.getText('pisell2.product.card.add.holder.placeholder')(
|
|
69
|
+
placeholder: locales.getText('pisell2.product.card.add.holder.placeholder')(addHolderButtonText),
|
|
64
70
|
onChange: function onChange(val) {
|
|
65
71
|
setSelectedValue(val);
|
|
66
72
|
var item = lists.find(function (d) {
|
|
@@ -12,7 +12,7 @@ import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
|
|
12
12
|
import AlertTriangle from '@pisell/icon/es/AlertTriangle';
|
|
13
13
|
import { locales } from '@pisell/utils';
|
|
14
14
|
import { Select } from 'antd';
|
|
15
|
-
import { isArr } from
|
|
15
|
+
import { isArr } from '@pisell/utils';
|
|
16
16
|
import "./index.less";
|
|
17
17
|
var SelectResource = function SelectResource(_ref) {
|
|
18
18
|
var lists = _ref.lists,
|
|
@@ -95,6 +95,7 @@ var SelectResource = function SelectResource(_ref) {
|
|
|
95
95
|
return /*#__PURE__*/React.createElement("div", {
|
|
96
96
|
className: "pisell-lowcode-product-card-select-resource ".concat(isError ? 'pisell-lowcode-product-card-select-resource-error' : '')
|
|
97
97
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
98
|
+
disabled: props.disabled,
|
|
98
99
|
mode: resourceMode,
|
|
99
100
|
size: "large",
|
|
100
101
|
showSearch: true,
|
|
@@ -109,6 +110,7 @@ var SelectResource = function SelectResource(_ref) {
|
|
|
109
110
|
flex: 1
|
|
110
111
|
},
|
|
111
112
|
value: selectedValue,
|
|
113
|
+
placeholder: locales.getText('pisell2.product.card.add.holder.placeholder')(''),
|
|
112
114
|
onChange: handleChange
|
|
113
115
|
}, renderOptions()), isError ? /*#__PURE__*/React.createElement("div", {
|
|
114
116
|
className: "pisell-lowcode-product-select-resource-error"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import './index.less';
|
|
2
3
|
declare const Time: ({ item, isShowHolder, onLike, isShowChangeResource, changeResource, changeHolder, isShowChangeHolder, holderMode, onAddHolder, isShowAddHolderButton, onClearHolder, onClearResource, }: any) => JSX.Element | null;
|
|
3
4
|
export default Time;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -85,7 +86,7 @@ var Time = function Time(_ref) {
|
|
|
85
86
|
if (!isShowChangeResource) {
|
|
86
87
|
return item === null || item === void 0 ? void 0 : item.name;
|
|
87
88
|
}
|
|
88
|
-
return /*#__PURE__*/React.createElement(SelectResource, {
|
|
89
|
+
return /*#__PURE__*/React.createElement(SelectResource, _extends({}, item, {
|
|
89
90
|
lists: item === null || item === void 0 ? void 0 : item.lists,
|
|
90
91
|
value: item === null || item === void 0 ? void 0 : item.id,
|
|
91
92
|
onChange: changeResource,
|
|
@@ -95,7 +96,7 @@ var Time = function Time(_ref) {
|
|
|
95
96
|
resourceErrorText: item === null || item === void 0 ? void 0 : item.resourceErrorText,
|
|
96
97
|
resourceMode: item.resourceMode,
|
|
97
98
|
maxLength: item.maxLength
|
|
98
|
-
});
|
|
99
|
+
}));
|
|
99
100
|
}, [isShowChangeResource]);
|
|
100
101
|
var likeAndResourceCom = useMemo(function () {
|
|
101
102
|
if (isMultipleResource) {
|
|
@@ -54,7 +54,6 @@ var ProductCard = function ProductCard(props) {
|
|
|
54
54
|
var useOpenNoteRef = useRef();
|
|
55
55
|
var locale = (utils === null || utils === void 0 || (_utils$storage = utils.storage) === null || _utils$storage === void 0 ? void 0 : _utils$storage.get('umi_locale')) || localStorage.getItem('umi_locale');
|
|
56
56
|
locales.init(localeTexts, locale || 'en');
|
|
57
|
-
console.log(dataSource, isShowImage, isShowNote, 'dataSource');
|
|
58
57
|
var image = dataSource.image,
|
|
59
58
|
bundle = dataSource.bundle,
|
|
60
59
|
relation_products = dataSource.relation_products,
|
|
@@ -15,6 +15,7 @@ declare const _default: {
|
|
|
15
15
|
'pisell2.product.card.view-less': string;
|
|
16
16
|
'pisell2.product.card.add.holder.button.text': (val: string) => string;
|
|
17
17
|
'pisell2.product.card.add.holder.placeholder': (val: string) => string;
|
|
18
|
+
'pisell2.product.card.hour.minute': (hour: number, minute: number) => string;
|
|
18
19
|
};
|
|
19
20
|
'zh-CN': {
|
|
20
21
|
'pisell2.product.card.day': (val: number) => string;
|
|
@@ -32,6 +33,7 @@ declare const _default: {
|
|
|
32
33
|
'pisell2.product.card.view-less': string;
|
|
33
34
|
'pisell2.product.card.add.holder.button.text': (val: string) => string;
|
|
34
35
|
'pisell2.product.card.add.holder.placeholder': (val: string) => string;
|
|
36
|
+
'pisell2.product.card.hour.minute': (hour: number, minute: number) => string;
|
|
35
37
|
};
|
|
36
38
|
'zh-HK': {
|
|
37
39
|
'pisell2.product.card.day': (val: number) => string;
|
|
@@ -49,6 +51,7 @@ declare const _default: {
|
|
|
49
51
|
'pisell2.product.card.view-less': string;
|
|
50
52
|
'pisell2.product.card.add.holder.button.text': (val: string) => string;
|
|
51
53
|
'pisell2.product.card.add.holder.placeholder': (val: string) => string;
|
|
54
|
+
'pisell2.product.card.hour.minute': (hour: number, minute: number) => string;
|
|
52
55
|
};
|
|
53
56
|
};
|
|
54
57
|
export default _default;
|
|
@@ -24,6 +24,9 @@ export default {
|
|
|
24
24
|
},
|
|
25
25
|
'pisell2.product.card.add.holder.placeholder': function pisell2ProductCardAddHolderPlaceholder(val) {
|
|
26
26
|
return "Please select ".concat(val || '');
|
|
27
|
+
},
|
|
28
|
+
'pisell2.product.card.hour.minute': function pisell2ProductCardHourMinute(hour, minute) {
|
|
29
|
+
return "".concat(hour > 0 ? "".concat(hour, "h") : '').concat(hour > 0 && minute > 0 ? ' ' : '').concat(minute > 0 ? "".concat(minute, "min") : '');
|
|
27
30
|
}
|
|
28
31
|
},
|
|
29
32
|
'zh-CN': {
|
|
@@ -51,6 +54,9 @@ export default {
|
|
|
51
54
|
},
|
|
52
55
|
'pisell2.product.card.add.holder.placeholder': function pisell2ProductCardAddHolderPlaceholder(val) {
|
|
53
56
|
return "\u8BF7\u9009\u62E9".concat(val || '');
|
|
57
|
+
},
|
|
58
|
+
'pisell2.product.card.hour.minute': function pisell2ProductCardHourMinute(hour, minute) {
|
|
59
|
+
return "".concat(hour > 0 ? "".concat(hour, "\u5C0F\u65F6") : '').concat(minute > 0 ? "".concat(minute, "\u5206\u949F") : '');
|
|
54
60
|
}
|
|
55
61
|
},
|
|
56
62
|
'zh-HK': {
|
|
@@ -78,6 +84,9 @@ export default {
|
|
|
78
84
|
},
|
|
79
85
|
'pisell2.product.card.add.holder.placeholder': function pisell2ProductCardAddHolderPlaceholder(val) {
|
|
80
86
|
return "\u8ACB\u9078\u64C7".concat(val || '');
|
|
87
|
+
},
|
|
88
|
+
'pisell2.product.card.hour.minute': function pisell2ProductCardHourMinute(hour, minute) {
|
|
89
|
+
return "".concat(hour > 0 ? "".concat(hour, "\u5C0F\u6642") : '').concat(minute > 0 ? "".concat(minute, "\u5206\u9418") : '');
|
|
81
90
|
}
|
|
82
91
|
}
|
|
83
92
|
};
|
|
@@ -99,8 +99,18 @@ export var getServiceTime = function getServiceTime(item, currentDate) {
|
|
|
99
99
|
var startDateTime = "".concat(startDate.format('YYYY-MM-DD'), " ").concat(startTime);
|
|
100
100
|
var endDateTime = "".concat(endDate.format('YYYY-MM-DD'), " ").concat(endTime);
|
|
101
101
|
var _duration = dayjs(endDateTime).diff(dayjs(startDateTime), item === null || item === void 0 ? void 0 : item.duration_type);
|
|
102
|
-
var
|
|
103
|
-
|
|
102
|
+
var durationText = '';
|
|
103
|
+
if ((item === null || item === void 0 ? void 0 : item.duration_type) === 'minutes') {
|
|
104
|
+
// 转为小时+分钟
|
|
105
|
+
var hours = Math.floor(_duration / 60);
|
|
106
|
+
var minutes = _duration % 60;
|
|
107
|
+
durationText = locales.getText('pisell2.product.card.hour.minute')(hours, minutes);
|
|
108
|
+
} else if ((item === null || item === void 0 ? void 0 : item.duration_type) === 'days') {
|
|
109
|
+
durationText = locales.getText('pisell2.product.card.day')(_duration);
|
|
110
|
+
} else {
|
|
111
|
+
durationText = "".concat(_duration);
|
|
112
|
+
}
|
|
113
|
+
return "".concat(dateTime, " (").concat(durationText, ")");
|
|
104
114
|
}
|
|
105
115
|
var _format = isEn ? 'ddd, DD/MM/YYYY' : 'YYYY-MM-DD,ddd';
|
|
106
116
|
|
|
@@ -80,7 +80,7 @@ var PisellAvatar = ({
|
|
|
80
80
|
...style,
|
|
81
81
|
width: sizeMap[size],
|
|
82
82
|
height: sizeMap[size],
|
|
83
|
-
fontSize:
|
|
83
|
+
fontSize: fontSizeMap[size],
|
|
84
84
|
lineHeight: `${sizeMap[size]}px`,
|
|
85
85
|
borderRadius: shape === "square" ? `${borderRadius}px` : "50%"
|
|
86
86
|
};
|
|
@@ -289,7 +289,7 @@ var PisellWalletPassCard = (props) => {
|
|
|
289
289
|
formatter: (value) => `$ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ","),
|
|
290
290
|
parser: (value) => value == null ? void 0 : value.replace(/\$\s?|(,*)/g, ""),
|
|
291
291
|
style: { width: "100%" },
|
|
292
|
-
max: "redeem" === name2 ? originData.available_max_amount : void 0
|
|
292
|
+
max: "redeem" === name2 ? originData == null ? void 0 : originData.available_max_amount : void 0
|
|
293
293
|
}
|
|
294
294
|
);
|
|
295
295
|
}
|
|
@@ -307,7 +307,8 @@ var PisellWalletPassCard = (props) => {
|
|
|
307
307
|
width: 480,
|
|
308
308
|
onOk: _onConfirmEdit,
|
|
309
309
|
okText: (0, import_locales.getText)("pisell-wallet-pass-card-confirm"),
|
|
310
|
-
cancelText: (0, import_locales.getText)("pisell-wallet-pass-card-cancel")
|
|
310
|
+
cancelText: (0, import_locales.getText)("pisell-wallet-pass-card-cancel"),
|
|
311
|
+
platform: "pc"
|
|
311
312
|
},
|
|
312
313
|
/* @__PURE__ */ import_react.default.createElement(import_antd.Form, { form, layout: "vertical", style: { padding: "16px 0" } }, Array.isArray((_b = actions == null ? void 0 : actions.edit) == null ? void 0 : _b.fields) && actions.edit.fields.map((item) => {
|
|
313
314
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -339,7 +340,8 @@ var PisellWalletPassCard = (props) => {
|
|
|
339
340
|
},
|
|
340
341
|
width: 480,
|
|
341
342
|
className: "pisell-wallet-pass-card-detail-modal",
|
|
342
|
-
footer: null
|
|
343
|
+
footer: null,
|
|
344
|
+
platform: "pc"
|
|
343
345
|
},
|
|
344
346
|
/* @__PURE__ */ import_react.default.createElement(
|
|
345
347
|
import_antd.Form,
|
|
@@ -50,6 +50,7 @@ var SelectHolder = ({
|
|
|
50
50
|
allowClear = false
|
|
51
51
|
}) => {
|
|
52
52
|
const [selectedValue, setSelectedValue] = (0, import_react.useState)();
|
|
53
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
53
54
|
(0, import_react.useEffect)(() => {
|
|
54
55
|
setSelectedValue(value);
|
|
55
56
|
}, [value]);
|
|
@@ -57,13 +58,8 @@ var SelectHolder = ({
|
|
|
57
58
|
e.preventDefault();
|
|
58
59
|
e.stopPropagation();
|
|
59
60
|
onAddHolder();
|
|
61
|
+
setOpen(false);
|
|
60
62
|
};
|
|
61
|
-
console.log(
|
|
62
|
-
lists,
|
|
63
|
-
isShowAddHolderButton,
|
|
64
|
-
addHolderButtonText,
|
|
65
|
-
"select-holder"
|
|
66
|
-
);
|
|
67
63
|
const isError = (0, import_react.useMemo)(() => {
|
|
68
64
|
if (!selectedValue && isErrorHolder) return true;
|
|
69
65
|
}, [selectedValue, isErrorHolder]);
|
|
@@ -75,6 +71,8 @@ var SelectHolder = ({
|
|
|
75
71
|
/* @__PURE__ */ import_react.default.createElement(
|
|
76
72
|
import_antd.Select,
|
|
77
73
|
{
|
|
74
|
+
open,
|
|
75
|
+
onDropdownVisibleChange: setOpen,
|
|
78
76
|
onClick: (e) => e.stopPropagation(),
|
|
79
77
|
mode: holderMode,
|
|
80
78
|
size: "large",
|
|
@@ -84,7 +82,7 @@ var SelectHolder = ({
|
|
|
84
82
|
value: selectedValue,
|
|
85
83
|
placeholder: import_utils.locales.getText(
|
|
86
84
|
"pisell2.product.card.add.holder.placeholder"
|
|
87
|
-
)(
|
|
85
|
+
)(addHolderButtonText),
|
|
88
86
|
onChange: (val) => {
|
|
89
87
|
setSelectedValue(val);
|
|
90
88
|
const item = lists.find((d) => d.id === val);
|
|
@@ -67,25 +67,28 @@ var SelectResource = ({
|
|
|
67
67
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.Select.Option, { value: d.id, key: d.id, ...d || {} }, /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: "8px" } }, /* @__PURE__ */ import_react.default.createElement("span", null, d["label"]), (d == null ? void 0 : d.isError) ? /* @__PURE__ */ import_react.default.createElement(import_AlertTriangle.default, { style: { color: "#b42318", cursor: "pointer" } }) : null));
|
|
68
68
|
});
|
|
69
69
|
}, [lists]);
|
|
70
|
-
const handleChange = (0, import_react.useCallback)(
|
|
71
|
-
|
|
72
|
-
if (
|
|
73
|
-
|
|
70
|
+
const handleChange = (0, import_react.useCallback)(
|
|
71
|
+
(val) => {
|
|
72
|
+
if (["multiple", "tags"].includes(resourceMode) && maxLength) {
|
|
73
|
+
if (value && value.length >= maxLength && val.length > value.length) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
74
76
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
77
|
+
setSelectedValue(val);
|
|
78
|
+
if (props.isParallelResource) {
|
|
79
|
+
const valueArray = (0, import_utils2.isArr)(val) ? val : [val];
|
|
80
|
+
return onChange({
|
|
81
|
+
value: valueArray,
|
|
82
|
+
options: valueArray.map((v) => resourceMap[v]),
|
|
83
|
+
resourceMode,
|
|
84
|
+
props
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
const item = resourceMap[val];
|
|
88
|
+
onChange(item);
|
|
89
|
+
},
|
|
90
|
+
[resourceMode, maxLength, value, onChange, props, resourceMap]
|
|
91
|
+
);
|
|
89
92
|
const isError = (0, import_react.useMemo)(() => {
|
|
90
93
|
if (!selectedValue && isErrorResource) return true;
|
|
91
94
|
}, [selectedValue, isErrorResource]);
|
|
@@ -97,6 +100,7 @@ var SelectResource = ({
|
|
|
97
100
|
/* @__PURE__ */ import_react.default.createElement(
|
|
98
101
|
import_antd.Select,
|
|
99
102
|
{
|
|
103
|
+
disabled: props.disabled,
|
|
100
104
|
mode: resourceMode,
|
|
101
105
|
size: "large",
|
|
102
106
|
showSearch: true,
|
|
@@ -105,6 +109,9 @@ var SelectResource = ({
|
|
|
105
109
|
onClick: (e) => e.stopPropagation(),
|
|
106
110
|
style: { flex: 1 },
|
|
107
111
|
value: selectedValue,
|
|
112
|
+
placeholder: import_utils.locales.getText(
|
|
113
|
+
"pisell2.product.card.add.holder.placeholder"
|
|
114
|
+
)(""),
|
|
108
115
|
onChange: handleChange
|
|
109
116
|
},
|
|
110
117
|
renderOptions()
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import './index.less';
|
|
2
3
|
declare const Time: ({ item, isShowHolder, onLike, isShowChangeResource, changeResource, changeHolder, isShowChangeHolder, holderMode, onAddHolder, isShowAddHolderButton, onClearHolder, onClearResource, }: any) => JSX.Element | null;
|
|
3
4
|
export default Time;
|
|
@@ -136,6 +136,7 @@ var Time = ({
|
|
|
136
136
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
137
137
|
import_SelectResource.default,
|
|
138
138
|
{
|
|
139
|
+
...item2,
|
|
139
140
|
lists: item2 == null ? void 0 : item2.lists,
|
|
140
141
|
value: item2 == null ? void 0 : item2.id,
|
|
141
142
|
onChange: changeResource,
|
|
@@ -74,7 +74,6 @@ var ProductCard = (props) => {
|
|
|
74
74
|
const useOpenNoteRef = (0, import_react.useRef)();
|
|
75
75
|
const locale = ((_a = utils == null ? void 0 : utils.storage) == null ? void 0 : _a.get("umi_locale")) || localStorage.getItem("umi_locale");
|
|
76
76
|
import_utils.locales.init(import_locales.default, locale || "en");
|
|
77
|
-
console.log(dataSource, isShowImage, isShowNote, "dataSource");
|
|
78
77
|
const {
|
|
79
78
|
image,
|
|
80
79
|
bundle,
|
|
@@ -15,6 +15,7 @@ declare const _default: {
|
|
|
15
15
|
'pisell2.product.card.view-less': string;
|
|
16
16
|
'pisell2.product.card.add.holder.button.text': (val: string) => string;
|
|
17
17
|
'pisell2.product.card.add.holder.placeholder': (val: string) => string;
|
|
18
|
+
'pisell2.product.card.hour.minute': (hour: number, minute: number) => string;
|
|
18
19
|
};
|
|
19
20
|
'zh-CN': {
|
|
20
21
|
'pisell2.product.card.day': (val: number) => string;
|
|
@@ -32,6 +33,7 @@ declare const _default: {
|
|
|
32
33
|
'pisell2.product.card.view-less': string;
|
|
33
34
|
'pisell2.product.card.add.holder.button.text': (val: string) => string;
|
|
34
35
|
'pisell2.product.card.add.holder.placeholder': (val: string) => string;
|
|
36
|
+
'pisell2.product.card.hour.minute': (hour: number, minute: number) => string;
|
|
35
37
|
};
|
|
36
38
|
'zh-HK': {
|
|
37
39
|
'pisell2.product.card.day': (val: number) => string;
|
|
@@ -49,6 +51,7 @@ declare const _default: {
|
|
|
49
51
|
'pisell2.product.card.view-less': string;
|
|
50
52
|
'pisell2.product.card.add.holder.button.text': (val: string) => string;
|
|
51
53
|
'pisell2.product.card.add.holder.placeholder': (val: string) => string;
|
|
54
|
+
'pisell2.product.card.hour.minute': (hour: number, minute: number) => string;
|
|
52
55
|
};
|
|
53
56
|
};
|
|
54
57
|
export default _default;
|
|
@@ -38,7 +38,8 @@ var locales_default = {
|
|
|
38
38
|
"pisell2.product.card.view-all": "View all",
|
|
39
39
|
"pisell2.product.card.view-less": "View less",
|
|
40
40
|
"pisell2.product.card.add.holder.button.text": (val) => `Add ${val || ""}`,
|
|
41
|
-
"pisell2.product.card.add.holder.placeholder": (val) => `Please select ${val || ""}
|
|
41
|
+
"pisell2.product.card.add.holder.placeholder": (val) => `Please select ${val || ""}`,
|
|
42
|
+
"pisell2.product.card.hour.minute": (hour, minute) => `${hour > 0 ? `${hour}h` : ""}${hour > 0 && minute > 0 ? " " : ""}${minute > 0 ? `${minute}min` : ""}`
|
|
42
43
|
},
|
|
43
44
|
"zh-CN": {
|
|
44
45
|
"pisell2.product.card.day": (val) => "天",
|
|
@@ -55,7 +56,8 @@ var locales_default = {
|
|
|
55
56
|
"pisell2.product.card.view-all": "查看全部",
|
|
56
57
|
"pisell2.product.card.view-less": "收起",
|
|
57
58
|
"pisell2.product.card.add.holder.button.text": (val) => `添加${val || ""}`,
|
|
58
|
-
"pisell2.product.card.add.holder.placeholder": (val) => `请选择${val || ""}
|
|
59
|
+
"pisell2.product.card.add.holder.placeholder": (val) => `请选择${val || ""}`,
|
|
60
|
+
"pisell2.product.card.hour.minute": (hour, minute) => `${hour > 0 ? `${hour}小时` : ""}${minute > 0 ? `${minute}分钟` : ""}`
|
|
59
61
|
},
|
|
60
62
|
"zh-HK": {
|
|
61
63
|
"pisell2.product.card.day": (val) => "天",
|
|
@@ -72,6 +74,7 @@ var locales_default = {
|
|
|
72
74
|
"pisell2.product.card.view-all": "查看全部",
|
|
73
75
|
"pisell2.product.card.view-less": "收起",
|
|
74
76
|
"pisell2.product.card.add.holder.button.text": (val) => `添加${val || ""}`,
|
|
75
|
-
"pisell2.product.card.add.holder.placeholder": (val) => `請選擇${val || ""}
|
|
77
|
+
"pisell2.product.card.add.holder.placeholder": (val) => `請選擇${val || ""}`,
|
|
78
|
+
"pisell2.product.card.hour.minute": (hour, minute) => `${hour > 0 ? `${hour}小時` : ""}${minute > 0 ? `${minute}分鐘` : ""}`
|
|
76
79
|
}
|
|
77
80
|
};
|
|
@@ -97,9 +97,18 @@ var getServiceTime = (item, currentDate) => {
|
|
|
97
97
|
}
|
|
98
98
|
const startDateTime = `${startDate.format("YYYY-MM-DD")} ${startTime}`;
|
|
99
99
|
const endDateTime = `${endDate.format("YYYY-MM-DD")} ${endTime}`;
|
|
100
|
-
|
|
101
|
-
let
|
|
102
|
-
|
|
100
|
+
let _duration = (0, import_dayjs.default)(endDateTime).diff((0, import_dayjs.default)(startDateTime), item == null ? void 0 : item.duration_type);
|
|
101
|
+
let durationText = "";
|
|
102
|
+
if ((item == null ? void 0 : item.duration_type) === "minutes") {
|
|
103
|
+
const hours = Math.floor(_duration / 60);
|
|
104
|
+
const minutes = _duration % 60;
|
|
105
|
+
durationText = import_utils.locales.getText("pisell2.product.card.hour.minute")(hours, minutes);
|
|
106
|
+
} else if ((item == null ? void 0 : item.duration_type) === "days") {
|
|
107
|
+
durationText = import_utils.locales.getText("pisell2.product.card.day")(_duration);
|
|
108
|
+
} else {
|
|
109
|
+
durationText = `${_duration}`;
|
|
110
|
+
}
|
|
111
|
+
return `${dateTime} (${durationText})`;
|
|
103
112
|
}
|
|
104
113
|
let _format = isEn2 ? "ddd, DD/MM/YYYY" : "YYYY-MM-DD,ddd";
|
|
105
114
|
if ((item == null ? void 0 : item.hasOwnProperty("format")) && ((_b = item == null ? void 0 : item.format) == null ? void 0 : _b.length) > 0) {
|